codemaxxing 0.4.2 → 0.4.4

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 CHANGED
@@ -16,7 +16,7 @@ import { listServers, addServer, removeServer, getConnectedServers } from "./uti
16
16
  import { detectHardware, formatBytes } from "./utils/hardware.js";
17
17
  import { getRecommendationsWithLlmfit, getFitIcon, isLlmfitAvailable } from "./utils/models.js";
18
18
  import { isOllamaInstalled, isOllamaRunning, getOllamaInstallCommand, startOllama, stopOllama, pullModel, listInstalledModelsDetailed, deleteModel, getGPUMemoryUsage } from "./utils/ollama.js";
19
- const VERSION = "0.1.9";
19
+ const VERSION = require("../package.json").version;
20
20
  // ── Helpers ──
21
21
  function formatTimeAgo(date) {
22
22
  const secs = Math.floor((Date.now() - date.getTime()) / 1000);
@@ -1463,15 +1463,30 @@ function App() {
1463
1463
  if (key.return) {
1464
1464
  // Auto-install Ollama if not present
1465
1465
  if (!isOllamaInstalled()) {
1466
- addMsg("info", "📦 Installing Ollama...");
1466
+ addMsg("info", "📦 Installing Ollama... (this may take a minute)");
1467
1467
  const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
1468
1468
  try {
1469
- const { execSync } = require("child_process");
1470
- execSync(installCmd, { stdio: "inherit", timeout: 120000 });
1471
- addMsg("info", "✅ Ollama installed!");
1469
+ // Use pipe instead of inherit — Ink TUI conflicts with inherit stdio
1470
+ const parts = installCmd.split(" ");
1471
+ const result = require("child_process").spawnSync(parts[0], parts.slice(1), {
1472
+ stdio: "pipe",
1473
+ timeout: 180000,
1474
+ shell: true,
1475
+ encoding: "utf-8",
1476
+ });
1477
+ if (result.status === 0) {
1478
+ addMsg("info", "✅ Ollama installed!");
1479
+ }
1480
+ else {
1481
+ const errMsg = (result.stderr || result.stdout || "").trim().split("\n").pop() || "Unknown error";
1482
+ addMsg("error", `Install failed: ${errMsg}`);
1483
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1484
+ return;
1485
+ }
1472
1486
  }
1473
1487
  catch (e) {
1474
- addMsg("error", `Failed to install Ollama. Try manually: ${installCmd}`);
1488
+ addMsg("error", `Install failed: ${e.message}`);
1489
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1475
1490
  return;
1476
1491
  }
1477
1492
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemaxxing",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Open-source terminal coding agent. Connect any LLM. Max your code.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.tsx CHANGED
@@ -17,7 +17,7 @@ import { detectHardware, formatBytes, type HardwareInfo } from "./utils/hardware
17
17
  import { getRecommendations, getRecommendationsWithLlmfit, getFitIcon, isLlmfitAvailable, type ScoredModel } from "./utils/models.js";
18
18
  import { isOllamaInstalled, isOllamaRunning, getOllamaInstallCommand, startOllama, stopOllama, pullModel, listInstalledModelsDetailed, deleteModel, getGPUMemoryUsage, type PullProgress } from "./utils/ollama.js";
19
19
 
20
- const VERSION = "0.1.9";
20
+ const VERSION = require("../package.json").version;
21
21
 
22
22
  // ── Helpers ──
23
23
  function formatTimeAgo(date: Date): string {
@@ -1487,14 +1487,28 @@ function App() {
1487
1487
  if (key.return) {
1488
1488
  // Auto-install Ollama if not present
1489
1489
  if (!isOllamaInstalled()) {
1490
- addMsg("info", "📦 Installing Ollama...");
1490
+ addMsg("info", "📦 Installing Ollama... (this may take a minute)");
1491
1491
  const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
1492
1492
  try {
1493
- const { execSync } = require("child_process");
1494
- execSync(installCmd, { stdio: "inherit", timeout: 120000 });
1495
- addMsg("info", "✅ Ollama installed!");
1493
+ // Use pipe instead of inherit — Ink TUI conflicts with inherit stdio
1494
+ const parts = installCmd.split(" ");
1495
+ const result = require("child_process").spawnSync(parts[0], parts.slice(1), {
1496
+ stdio: "pipe",
1497
+ timeout: 180000,
1498
+ shell: true,
1499
+ encoding: "utf-8",
1500
+ });
1501
+ if (result.status === 0) {
1502
+ addMsg("info", "✅ Ollama installed!");
1503
+ } else {
1504
+ const errMsg = (result.stderr || result.stdout || "").trim().split("\n").pop() || "Unknown error";
1505
+ addMsg("error", `Install failed: ${errMsg}`);
1506
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1507
+ return;
1508
+ }
1496
1509
  } catch (e: any) {
1497
- addMsg("error", `Failed to install Ollama. Try manually: ${installCmd}`);
1510
+ addMsg("error", `Install failed: ${e.message}`);
1511
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1498
1512
  return;
1499
1513
  }
1500
1514
  }