codemaxxing 0.4.3 → 0.4.5

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,9 @@ 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 = require("../package.json").version;
19
+ import { createRequire } from "module";
20
+ const _require = createRequire(import.meta.url);
21
+ const VERSION = _require("../package.json").version;
20
22
  // ── Helpers ──
21
23
  function formatTimeAgo(date) {
22
24
  const secs = Math.floor((Date.now() - date.getTime()) / 1000);
@@ -1463,15 +1465,30 @@ function App() {
1463
1465
  if (key.return) {
1464
1466
  // Auto-install Ollama if not present
1465
1467
  if (!isOllamaInstalled()) {
1466
- addMsg("info", "📦 Installing Ollama...");
1468
+ addMsg("info", "📦 Installing Ollama... (this may take a minute)");
1467
1469
  const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
1468
1470
  try {
1469
- const { execSync } = require("child_process");
1470
- execSync(installCmd, { stdio: "inherit", timeout: 120000 });
1471
- addMsg("info", "✅ Ollama installed!");
1471
+ // Use pipe instead of inherit — Ink TUI conflicts with inherit stdio
1472
+ const parts = installCmd.split(" ");
1473
+ const result = _require("child_process").spawnSync(parts[0], parts.slice(1), {
1474
+ stdio: "pipe",
1475
+ timeout: 180000,
1476
+ shell: true,
1477
+ encoding: "utf-8",
1478
+ });
1479
+ if (result.status === 0) {
1480
+ addMsg("info", "✅ Ollama installed!");
1481
+ }
1482
+ else {
1483
+ const errMsg = (result.stderr || result.stdout || "").trim().split("\n").pop() || "Unknown error";
1484
+ addMsg("error", `Install failed: ${errMsg}`);
1485
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1486
+ return;
1487
+ }
1472
1488
  }
1473
1489
  catch (e) {
1474
- addMsg("error", `Failed to install Ollama. Try manually: ${installCmd}`);
1490
+ addMsg("error", `Install failed: ${e.message}`);
1491
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1475
1492
  return;
1476
1493
  }
1477
1494
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemaxxing",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
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,9 @@ 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 = require("../package.json").version;
20
+ import { createRequire } from "module";
21
+ const _require = createRequire(import.meta.url);
22
+ const VERSION = _require("../package.json").version;
21
23
 
22
24
  // ── Helpers ──
23
25
  function formatTimeAgo(date: Date): string {
@@ -1487,14 +1489,28 @@ function App() {
1487
1489
  if (key.return) {
1488
1490
  // Auto-install Ollama if not present
1489
1491
  if (!isOllamaInstalled()) {
1490
- addMsg("info", "📦 Installing Ollama...");
1492
+ addMsg("info", "📦 Installing Ollama... (this may take a minute)");
1491
1493
  const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
1492
1494
  try {
1493
- const { execSync } = require("child_process");
1494
- execSync(installCmd, { stdio: "inherit", timeout: 120000 });
1495
- addMsg("info", "✅ Ollama installed!");
1495
+ // Use pipe instead of inherit — Ink TUI conflicts with inherit stdio
1496
+ const parts = installCmd.split(" ");
1497
+ const result = _require("child_process").spawnSync(parts[0], parts.slice(1), {
1498
+ stdio: "pipe",
1499
+ timeout: 180000,
1500
+ shell: true,
1501
+ encoding: "utf-8",
1502
+ });
1503
+ if (result.status === 0) {
1504
+ addMsg("info", "✅ Ollama installed!");
1505
+ } else {
1506
+ const errMsg = (result.stderr || result.stdout || "").trim().split("\n").pop() || "Unknown error";
1507
+ addMsg("error", `Install failed: ${errMsg}`);
1508
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1509
+ return;
1510
+ }
1496
1511
  } catch (e: any) {
1497
- addMsg("error", `Failed to install Ollama. Try manually: ${installCmd}`);
1512
+ addMsg("error", `Install failed: ${e.message}`);
1513
+ addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
1498
1514
  return;
1499
1515
  }
1500
1516
  }