agdi 2.8.1 → 2.8.6
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/index.js +85 -63
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -984,12 +984,12 @@ async function login() {
|
|
|
984
984
|
const provider = await select({
|
|
985
985
|
message: "Select your AI provider:",
|
|
986
986
|
choices: [
|
|
987
|
-
{ name: "
|
|
988
|
-
{ name: "
|
|
989
|
-
{ name: "
|
|
990
|
-
{ name: "
|
|
991
|
-
{ name: "
|
|
992
|
-
{ name: "
|
|
987
|
+
{ name: "Google Gemini (Recommended)", value: "gemini" },
|
|
988
|
+
{ name: "OpenRouter (100+ models)", value: "openrouter" },
|
|
989
|
+
{ name: "OpenAI (GPT-4, GPT-5)", value: "openai" },
|
|
990
|
+
{ name: "Anthropic (Claude)", value: "anthropic" },
|
|
991
|
+
{ name: "DeepSeek", value: "deepseek" },
|
|
992
|
+
{ name: "Local LLM (Ollama)", value: "ollama" }
|
|
993
993
|
]
|
|
994
994
|
});
|
|
995
995
|
if (provider === "ollama") {
|
|
@@ -1398,44 +1398,54 @@ import { select as select2, password as password2 } from "@inquirer/prompts";
|
|
|
1398
1398
|
import chalk8 from "chalk";
|
|
1399
1399
|
var PROVIDER_MODELS = {
|
|
1400
1400
|
gemini: [
|
|
1401
|
-
{ name: "
|
|
1402
|
-
{ name: "
|
|
1403
|
-
{ name: "
|
|
1401
|
+
{ name: "Gemini 3 Pro (Most Intelligent)", value: "gemini-3-pro-preview" },
|
|
1402
|
+
{ name: "Gemini 3 Flash (Fast)", value: "gemini-3-flash-preview" },
|
|
1403
|
+
{ name: "Gemini 3 Deep Think (Reasoning)", value: "gemini-3-deep-think" },
|
|
1404
|
+
{ name: "Gemini 2.5 Pro", value: "gemini-2.5-pro" },
|
|
1405
|
+
{ name: "Gemini 2.5 Flash", value: "gemini-2.5-flash" },
|
|
1406
|
+
{ name: "Gemini 2.0 Flash", value: "gemini-2.0-flash" }
|
|
1404
1407
|
],
|
|
1405
1408
|
openrouter: [
|
|
1406
1409
|
// FREE MODELS (no API credits needed)
|
|
1407
|
-
{ name: "
|
|
1408
|
-
{ name: "
|
|
1409
|
-
{ name: "
|
|
1410
|
-
{ name: "
|
|
1411
|
-
{ name: "
|
|
1412
|
-
{ name: "
|
|
1413
|
-
{ name: "
|
|
1414
|
-
{ name: "
|
|
1415
|
-
{ name: "
|
|
1410
|
+
{ name: "GPT-OSS 120B (Free)", value: "openai/gpt-oss-120b:free" },
|
|
1411
|
+
{ name: "GPT-OSS 20B (Free)", value: "openai/gpt-oss-20b:free" },
|
|
1412
|
+
{ name: "Qwen3 Coder (Free)", value: "qwen/qwen3-coder:free" },
|
|
1413
|
+
{ name: "Qwen3 Next 80B (Free)", value: "qwen/qwen3-next-80b-a3b-instruct:free" },
|
|
1414
|
+
{ name: "Kimi K2 (Free)", value: "moonshotai/kimi-k2:free" },
|
|
1415
|
+
{ name: "Gemma 3N E2B (Free)", value: "google/gemma-3n-e2b-it:free" },
|
|
1416
|
+
{ name: "Qwen 2.5 VL 7B (Free)", value: "qwen/qwen-2.5-vl-7b-instruct:free" },
|
|
1417
|
+
{ name: "LFM Thinking 1.2B (Free, Agentic)", value: "liquid/lfm-2.5-1.2b-thinking:free" },
|
|
1418
|
+
{ name: "Devstral (Free, ends Jan 27)", value: "mistralai/devstral-2512:free" },
|
|
1416
1419
|
// PAID MODELS
|
|
1417
|
-
{ name: "
|
|
1418
|
-
{ name: "
|
|
1419
|
-
{ name: "
|
|
1420
|
-
{ name: "
|
|
1421
|
-
{ name: "
|
|
1422
|
-
{ name: "
|
|
1423
|
-
{ name: "
|
|
1420
|
+
{ name: "Claude 3.5 Sonnet", value: "anthropic/claude-3.5-sonnet" },
|
|
1421
|
+
{ name: "GPT-4o", value: "openai/gpt-4o" },
|
|
1422
|
+
{ name: "GPT-4o Mini", value: "openai/gpt-4o-mini" },
|
|
1423
|
+
{ name: "Gemini 2.5 Flash", value: "google/gemini-2.5-flash-preview" },
|
|
1424
|
+
{ name: "Llama 3.3 70B", value: "meta-llama/llama-3.3-70b-instruct" },
|
|
1425
|
+
{ name: "DeepSeek R1", value: "deepseek/deepseek-r1" },
|
|
1426
|
+
{ name: "Mistral Large", value: "mistral/mistral-large-latest" }
|
|
1424
1427
|
],
|
|
1425
1428
|
openai: [
|
|
1426
|
-
{ name: "
|
|
1427
|
-
{ name: "
|
|
1428
|
-
{ name: "
|
|
1429
|
-
{ name: "
|
|
1429
|
+
{ name: "GPT-5.2 (Flagship)", value: "gpt-5.2" },
|
|
1430
|
+
{ name: "GPT-5.2 Instant", value: "gpt-5.2-instant" },
|
|
1431
|
+
{ name: "GPT-5.2 Thinking (Reasoning)", value: "gpt-5.2-thinking" },
|
|
1432
|
+
{ name: "GPT-5.2 Codex (Coding)", value: "gpt-5.2-codex" },
|
|
1433
|
+
{ name: "GPT-5.1", value: "gpt-5.1" },
|
|
1434
|
+
{ name: "GPT-5.1 Instant", value: "gpt-5.1-instant" },
|
|
1435
|
+
{ name: "GPT-5.1 Codex Max", value: "gpt-5.1-codex-max" },
|
|
1436
|
+
{ name: "GPT-4o", value: "gpt-4o" },
|
|
1437
|
+
{ name: "GPT-4o Mini", value: "gpt-4o-mini" },
|
|
1438
|
+
{ name: "o1", value: "o1" },
|
|
1439
|
+
{ name: "o1-mini", value: "o1-mini" }
|
|
1430
1440
|
],
|
|
1431
1441
|
anthropic: [
|
|
1432
|
-
{ name: "
|
|
1433
|
-
{ name: "
|
|
1434
|
-
{ name: "
|
|
1442
|
+
{ name: "Claude 3.5 Sonnet", value: "claude-3-5-sonnet-20241022" },
|
|
1443
|
+
{ name: "Claude 3.5 Haiku", value: "claude-3-5-haiku-20241022" },
|
|
1444
|
+
{ name: "Claude 3 Opus", value: "claude-3-opus-20240229" }
|
|
1435
1445
|
],
|
|
1436
1446
|
deepseek: [
|
|
1437
|
-
{ name: "
|
|
1438
|
-
{ name: "
|
|
1447
|
+
{ name: "DeepSeek V3", value: "deepseek-chat" },
|
|
1448
|
+
{ name: "DeepSeek R1 (Reasoning)", value: "deepseek-reasoner" }
|
|
1439
1449
|
]
|
|
1440
1450
|
};
|
|
1441
1451
|
function needsOnboarding() {
|
|
@@ -1457,7 +1467,7 @@ function getActiveProvider() {
|
|
|
1457
1467
|
return {
|
|
1458
1468
|
provider,
|
|
1459
1469
|
apiKey,
|
|
1460
|
-
model: config.defaultModel || PROVIDER_MODELS[provider]?.[0]?.value || "gemini-
|
|
1470
|
+
model: config.defaultModel || PROVIDER_MODELS[provider]?.[0]?.value || "gemini-3-flash-preview"
|
|
1461
1471
|
};
|
|
1462
1472
|
}
|
|
1463
1473
|
for (const [p, key] of Object.entries(keyMap)) {
|
|
@@ -1465,7 +1475,7 @@ function getActiveProvider() {
|
|
|
1465
1475
|
return {
|
|
1466
1476
|
provider: p,
|
|
1467
1477
|
apiKey: key,
|
|
1468
|
-
model: config.defaultModel || PROVIDER_MODELS[p]?.[0]?.value || "gemini-
|
|
1478
|
+
model: config.defaultModel || PROVIDER_MODELS[p]?.[0]?.value || "gemini-3-flash-preview"
|
|
1469
1479
|
};
|
|
1470
1480
|
}
|
|
1471
1481
|
}
|
|
@@ -1479,11 +1489,11 @@ async function runOnboarding() {
|
|
|
1479
1489
|
const provider = await select2({
|
|
1480
1490
|
message: "Which AI provider would you like to use?",
|
|
1481
1491
|
choices: [
|
|
1482
|
-
{ name: "
|
|
1483
|
-
{ name: "
|
|
1484
|
-
{ name: "
|
|
1485
|
-
{ name: "
|
|
1486
|
-
{ name: "
|
|
1492
|
+
{ name: "Google Gemini (Recommended - Free tier)", value: "gemini" },
|
|
1493
|
+
{ name: "OpenRouter (100+ models, pay-per-use)", value: "openrouter" },
|
|
1494
|
+
{ name: "OpenAI (GPT-4o)", value: "openai" },
|
|
1495
|
+
{ name: "Anthropic (Claude)", value: "anthropic" },
|
|
1496
|
+
{ name: "DeepSeek", value: "deepseek" }
|
|
1487
1497
|
]
|
|
1488
1498
|
});
|
|
1489
1499
|
console.log(chalk8.white.bold("\nStep 2/3: Enter your API key\n"));
|
|
@@ -1556,11 +1566,11 @@ async function selectModel() {
|
|
|
1556
1566
|
selectedProvider = await select2({
|
|
1557
1567
|
message: "Select provider:",
|
|
1558
1568
|
choices: [
|
|
1559
|
-
{ name: "
|
|
1560
|
-
{ name: "
|
|
1561
|
-
{ name: "
|
|
1562
|
-
{ name: "
|
|
1563
|
-
{ name: "
|
|
1569
|
+
{ name: "Gemini", value: "gemini" },
|
|
1570
|
+
{ name: "OpenRouter", value: "openrouter" },
|
|
1571
|
+
{ name: "OpenAI", value: "openai" },
|
|
1572
|
+
{ name: "Anthropic", value: "anthropic" },
|
|
1573
|
+
{ name: "DeepSeek", value: "deepseek" }
|
|
1564
1574
|
]
|
|
1565
1575
|
});
|
|
1566
1576
|
const keyMap = {
|
|
@@ -3205,10 +3215,16 @@ Target: ${env.workspaceRoot}`
|
|
|
3205
3215
|
"\u26A0\uFE0F DANGEROUS COMMANDS DETECTED",
|
|
3206
3216
|
dangerousActions.map((a) => `\u2022 ${a.argv.join(" ")}`).join("\n") + "\n\nThese commands can modify your system or delete files."
|
|
3207
3217
|
);
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3218
|
+
let allowDangerous = false;
|
|
3219
|
+
let validResponse = false;
|
|
3220
|
+
while (!validResponse) {
|
|
3221
|
+
const response = await confirm({
|
|
3222
|
+
message: 'Type "yes" to execute or "no" to cancel',
|
|
3223
|
+
default: false
|
|
3224
|
+
});
|
|
3225
|
+
allowDangerous = response;
|
|
3226
|
+
validResponse = true;
|
|
3227
|
+
}
|
|
3212
3228
|
if (!allowDangerous) {
|
|
3213
3229
|
console.log(chalk11.yellow("\n\u{1F44B} Execution cancelled for safety.\n"));
|
|
3214
3230
|
return { success: false, results, filesCreated, commandsRun, errors: ["User cancelled dangerous commands"] };
|
|
@@ -4226,6 +4242,22 @@ function getMemoryStats() {
|
|
|
4226
4242
|
}
|
|
4227
4243
|
|
|
4228
4244
|
// src/commands/agdi-dev.ts
|
|
4245
|
+
async function collectMultiLineInput(message) {
|
|
4246
|
+
console.log(chalk13.cyan.bold(message) + chalk13.gray(" (paste text, press Enter on empty line to submit)"));
|
|
4247
|
+
const lines = [];
|
|
4248
|
+
while (true) {
|
|
4249
|
+
const line = await input5({ message: chalk13.gray("\u2502 ") });
|
|
4250
|
+
if (line.trim() === "") {
|
|
4251
|
+
if (lines.length > 0) break;
|
|
4252
|
+
continue;
|
|
4253
|
+
}
|
|
4254
|
+
lines.push(line);
|
|
4255
|
+
if (lines.length === 1 && line.trim().startsWith("/")) {
|
|
4256
|
+
break;
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
return lines.join("\n").trim();
|
|
4260
|
+
}
|
|
4229
4261
|
var multiAgentMode = false;
|
|
4230
4262
|
var BASE_CHAT_PROMPT = `You are Agdi dev, an elite AI coding assistant. You help developers write code, debug issues, and build applications.
|
|
4231
4263
|
|
|
@@ -4282,14 +4314,6 @@ Instead, output a single JSON object with this exact structure:
|
|
|
4282
4314
|
- writeFile: { type: "writeFile", path: "relative/path/file.ts", content: "file contents" }
|
|
4283
4315
|
- deleteFile: { type: "deleteFile", path: "relative/path/file.ts" }
|
|
4284
4316
|
- exec: { type: "exec", argv: ["command", "arg1", "arg2"], cwd: "." }
|
|
4285
|
-
- generateImage: { type: "generateImage", prompt: "description of image", savePath: "public/hero.png", style: "tech" }
|
|
4286
|
-
|
|
4287
|
-
## Image Generation
|
|
4288
|
-
For landing pages, portfolios, or apps that need visuals, use generateImage actions:
|
|
4289
|
-
- style options: "realistic", "artistic", "minimal", "tech"
|
|
4290
|
-
- Save to public/ folder (e.g., public/hero.png, public/logo.png)
|
|
4291
|
-
- Use descriptive prompts based on the project type
|
|
4292
|
-
- Example: { type: "generateImage", prompt: "Modern tech startup hero image, abstract blue gradient", savePath: "public/hero.png", style: "tech" }
|
|
4293
4317
|
|
|
4294
4318
|
## Rules
|
|
4295
4319
|
1. All paths MUST be relative to workspace root (no leading /)
|
|
@@ -4299,7 +4323,7 @@ For landing pages, portfolios, or apps that need visuals, use generateImage acti
|
|
|
4299
4323
|
5. Create complete, production-ready code
|
|
4300
4324
|
6. Use TypeScript by default
|
|
4301
4325
|
7. Include proper error handling
|
|
4302
|
-
8. For
|
|
4326
|
+
8. For images, use placeholder URLs or instruct user to add images later
|
|
4303
4327
|
9. Output ONLY the JSON object, no extra text`;
|
|
4304
4328
|
async function startCodingMode() {
|
|
4305
4329
|
const activeConfig = getActiveProvider();
|
|
@@ -4330,9 +4354,7 @@ Context: ${isGitRepo() ? chalk13.green("Git Repository") : chalk13.gray("Local
|
|
|
4330
4354
|
conversation.setSystemPrompt(buildContextAwarePrompt());
|
|
4331
4355
|
while (true) {
|
|
4332
4356
|
try {
|
|
4333
|
-
const userInput = await
|
|
4334
|
-
message: chalk13.cyan.bold("\u{1F464} YOU \u203A")
|
|
4335
|
-
});
|
|
4357
|
+
const userInput = await collectMultiLineInput("\u{1F464} YOU \u203A");
|
|
4336
4358
|
const trimmed = userInput.trim().toLowerCase();
|
|
4337
4359
|
if (trimmed === "/exit" || trimmed === "exit" || trimmed === "quit") {
|
|
4338
4360
|
logSessionEnd();
|
|
@@ -4872,7 +4894,7 @@ ${chalk15.cyan(`/_/ |_|\\_, /\\__,_//_/ `)}
|
|
|
4872
4894
|
${chalk15.cyan(` /____/ `)}
|
|
4873
4895
|
`;
|
|
4874
4896
|
var program = new Command();
|
|
4875
|
-
program.name("agdi").description(chalk15.cyan("\u{1F680} AI-powered coding assistant")).version("2.8.
|
|
4897
|
+
program.name("agdi").description(chalk15.cyan("\u{1F680} AI-powered coding assistant")).version("2.8.6").option("-y, --yes", "Auto-approve all prompts (headless/CI mode)").option("-m, --minimal", "Generate only the requested file(s), not a full app").option("-d, --dry-run", "Show what would be created without writing files");
|
|
4876
4898
|
program.hook("preAction", (thisCommand) => {
|
|
4877
4899
|
const opts = thisCommand.opts();
|
|
4878
4900
|
if (opts.yes) {
|