komodo-cli 2.3.0 → 2.4.0
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.
|
@@ -4955,9 +4955,9 @@ async function getLatestSnapshot(basePath, environmentId) {
|
|
|
4955
4955
|
);
|
|
4956
4956
|
return snapshots[0];
|
|
4957
4957
|
}
|
|
4958
|
-
var DEFAULT_MODEL = "
|
|
4959
|
-
var DEFAULT_MAX_TOKENS =
|
|
4960
|
-
var DEFAULT_TEMPERATURE = 0.
|
|
4958
|
+
var DEFAULT_MODEL = "zai-glm-4.7";
|
|
4959
|
+
var DEFAULT_MAX_TOKENS = 4096;
|
|
4960
|
+
var DEFAULT_TEMPERATURE = 0.7;
|
|
4961
4961
|
var CerebrasAI = class {
|
|
4962
4962
|
apiKey;
|
|
4963
4963
|
model;
|
|
@@ -5163,7 +5163,7 @@ var KomodoChat = class {
|
|
|
5163
5163
|
baseUrl = "https://api.cerebras.ai/v1";
|
|
5164
5164
|
conversationHistory = [];
|
|
5165
5165
|
context = null;
|
|
5166
|
-
constructor(apiKey, model = "
|
|
5166
|
+
constructor(apiKey, model = "zai-glm-4.7") {
|
|
5167
5167
|
this.apiKey = apiKey;
|
|
5168
5168
|
this.model = model;
|
|
5169
5169
|
}
|
|
@@ -5290,13 +5290,14 @@ Only include the JSON block if you're recommending specific package changes.`;
|
|
|
5290
5290
|
body: JSON.stringify({
|
|
5291
5291
|
model: this.model,
|
|
5292
5292
|
messages,
|
|
5293
|
-
max_tokens:
|
|
5294
|
-
temperature: 0.
|
|
5293
|
+
max_tokens: 4096,
|
|
5294
|
+
temperature: 0.7,
|
|
5295
5295
|
top_p: 1
|
|
5296
5296
|
})
|
|
5297
5297
|
});
|
|
5298
5298
|
if (!response.ok) {
|
|
5299
|
-
|
|
5299
|
+
const error = await response.text();
|
|
5300
|
+
throw new Error(`API error: ${response.status} - ${error}`);
|
|
5300
5301
|
}
|
|
5301
5302
|
const data = await response.json();
|
|
5302
5303
|
return data.choices[0]?.message?.content ?? "";
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
runDoctor,
|
|
32
32
|
searchTemplates,
|
|
33
33
|
visualizeTree
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-JV7H5NE4.js";
|
|
35
35
|
|
|
36
36
|
// src/index.ts
|
|
37
37
|
import { Command } from "commander";
|
|
@@ -42,10 +42,9 @@ import * as readline from "readline";
|
|
|
42
42
|
import { createRequire } from "module";
|
|
43
43
|
var require2 = createRequire(import.meta.url);
|
|
44
44
|
var packageJson = require2("../package.json");
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var chat = new KomodoChat(API_KEY);
|
|
45
|
+
var CEREBRAS_API_KEY = "csk-m4vcnx94p854xmvnhxx38chwmxxwtffpnymk2ewexktk3962";
|
|
46
|
+
var komodo = new Komodo(CEREBRAS_API_KEY);
|
|
47
|
+
var chat = new KomodoChat(CEREBRAS_API_KEY);
|
|
49
48
|
var program = new Command();
|
|
50
49
|
program.name("komodo").description("The simple way to set up your project").version(packageJson.version);
|
|
51
50
|
var gradientColors = [
|
|
@@ -178,8 +177,8 @@ async function startInteractiveMode(projectPath) {
|
|
|
178
177
|
console.log(chalk.hex("#b4ffb4").dim(` ${formatOs(hardware.os)} \xB7 ${formatGpu(hardware)} \xB7 ${hardware.totalMemoryGb}GB memory`));
|
|
179
178
|
console.log();
|
|
180
179
|
console.log(chalk.hex("#96ff96").dim(" Commands: ") + chalk.hex("#d2ffd2")("fix") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("conflicts") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("doctor") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("optimize") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("tree"));
|
|
181
|
-
console.log(chalk.hex("#96ff96").dim(" ") + chalk.hex("#d2ffd2")("undo") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("list") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("check") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("
|
|
182
|
-
console.log(chalk.dim(" Or just
|
|
180
|
+
console.log(chalk.hex("#96ff96").dim(" ") + chalk.hex("#d2ffd2")("undo") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("list") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("check") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("clear") + chalk.dim(" \xB7 ") + chalk.hex("#d2ffd2")("exit"));
|
|
181
|
+
console.log(chalk.dim(" Or just type anything in natural language! The AI understands context."));
|
|
183
182
|
console.log();
|
|
184
183
|
await updateChatContext(projectPath);
|
|
185
184
|
const rl = readline.createInterface({
|
|
@@ -328,19 +327,52 @@ async function startInteractiveMode(projectPath) {
|
|
|
328
327
|
}
|
|
329
328
|
if (trimmed === "ask" || trimmed.startsWith("ask ")) {
|
|
330
329
|
const question = trimmed === "ask" ? "" : trimmed.slice(4).trim();
|
|
331
|
-
if (
|
|
332
|
-
console.log();
|
|
333
|
-
console.log(chalk.hex("#b4ffb4")(" Ask me anything about your environment!"));
|
|
334
|
-
console.log(chalk.dim(" Example: ask what should I install for a REST API?"));
|
|
335
|
-
console.log();
|
|
336
|
-
} else {
|
|
330
|
+
if (question) {
|
|
337
331
|
const spinner = ora(chalk.hex("#b4ffb4")("Thinking...")).start();
|
|
338
332
|
await updateChatContext(projectPath);
|
|
339
333
|
const response = await chat.chat(question);
|
|
340
334
|
spinner.stop();
|
|
341
335
|
displayAIResponse(response);
|
|
336
|
+
} else {
|
|
337
|
+
console.log();
|
|
338
|
+
console.log(chalk.hex("#b4ffb4")(" Ask me anything about your environment and what you want to build!"));
|
|
339
|
+
console.log(chalk.dim(" Examples:"));
|
|
340
|
+
console.log(chalk.dim(" \u2022 What should I install for a REST API?"));
|
|
341
|
+
console.log(chalk.dim(" \u2022 How do I train an LLM?"));
|
|
342
|
+
console.log(chalk.dim(" \u2022 Set up a venv for LLADA 8B"));
|
|
343
|
+
console.log(chalk.dim(" \u2022 Type 'exit' to go back to main menu"));
|
|
344
|
+
console.log();
|
|
345
|
+
const chatRl = readline.createInterface({
|
|
346
|
+
input: process.stdin,
|
|
347
|
+
output: process.stdout
|
|
348
|
+
});
|
|
349
|
+
const chatPrompt = () => {
|
|
350
|
+
chatRl.question(chalk.hex("#5aff5a")(" ai> "), async (chatInput) => {
|
|
351
|
+
const chatTrimmed = chatInput.trim();
|
|
352
|
+
if (!chatTrimmed) {
|
|
353
|
+
chatPrompt();
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
if (chatTrimmed === "exit" || chatTrimmed === "quit" || chatTrimmed === "q") {
|
|
357
|
+
chatRl.close();
|
|
358
|
+
console.log();
|
|
359
|
+
prompt();
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const spinner = ora(chalk.hex("#b4ffb4")("Thinking...")).start();
|
|
363
|
+
try {
|
|
364
|
+
const response = await chat.chat(chatTrimmed);
|
|
365
|
+
spinner.stop();
|
|
366
|
+
displayAIResponse(response);
|
|
367
|
+
} catch (error) {
|
|
368
|
+
spinner.fail();
|
|
369
|
+
console.error(chalk.red("Error: " + (error instanceof Error ? error.message : "Unknown error")));
|
|
370
|
+
}
|
|
371
|
+
chatPrompt();
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
chatPrompt();
|
|
342
375
|
}
|
|
343
|
-
prompt();
|
|
344
376
|
return;
|
|
345
377
|
}
|
|
346
378
|
if (isAIQuestion(trimmed)) {
|
|
@@ -369,7 +401,7 @@ async function handleInstall(intent, projectPath) {
|
|
|
369
401
|
path: projectPath,
|
|
370
402
|
dryRun: false,
|
|
371
403
|
useAI: true,
|
|
372
|
-
apiKey:
|
|
404
|
+
apiKey: CEREBRAS_API_KEY,
|
|
373
405
|
onProgress: (message) => {
|
|
374
406
|
const friendly = friendlyMessage(message);
|
|
375
407
|
if (spinner.isSpinning) {
|
|
@@ -869,7 +901,7 @@ async function handleUI(projectPath) {
|
|
|
869
901
|
console.log();
|
|
870
902
|
console.log(chalk.hex("#b4ffb4").dim(" Starting dashboard..."));
|
|
871
903
|
try {
|
|
872
|
-
const { startServer } = await import("./server-
|
|
904
|
+
const { startServer } = await import("./server-GJZAY4WK.js");
|
|
873
905
|
await startServer(projectPath, port);
|
|
874
906
|
console.log(chalk.hex("#5aff5a")(` \u2713 Dashboard ready at ${chalk.bold(url)}`));
|
|
875
907
|
console.log();
|
|
@@ -1198,7 +1230,7 @@ program.command("ui").description("Open the visual dashboard").option("-p, --pat
|
|
|
1198
1230
|
const url = `http://localhost:${port}`;
|
|
1199
1231
|
console.log(chalk.dim(" Starting dashboard..."));
|
|
1200
1232
|
try {
|
|
1201
|
-
const { startServer } = await import("./server-
|
|
1233
|
+
const { startServer } = await import("./server-GJZAY4WK.js");
|
|
1202
1234
|
await startServer(options.path, port);
|
|
1203
1235
|
console.log();
|
|
1204
1236
|
console.log(chalk.green(` \u2713 Dashboard ready at ${chalk.bold(url)}`));
|