codemaxxing 0.4.9 → 0.4.10
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 +4 -4
- package/dist/utils/ollama.d.ts +1 -1
- package/dist/utils/ollama.js +28 -6
- package/package.json +1 -1
- package/src/index.tsx +4 -4
- package/src/utils/ollama.ts +29 -7
package/dist/index.js
CHANGED
|
@@ -1465,8 +1465,8 @@ function App() {
|
|
|
1465
1465
|
if (key.return) {
|
|
1466
1466
|
// Auto-install Ollama if not present
|
|
1467
1467
|
if (!isOllamaInstalled()) {
|
|
1468
|
-
|
|
1469
|
-
|
|
1468
|
+
setLoading(true);
|
|
1469
|
+
setSpinnerMsg("Installing Ollama... this may take a minute");
|
|
1470
1470
|
// Run install async so the UI can update
|
|
1471
1471
|
const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
|
|
1472
1472
|
(async () => {
|
|
@@ -1481,17 +1481,17 @@ function App() {
|
|
|
1481
1481
|
});
|
|
1482
1482
|
});
|
|
1483
1483
|
addMsg("info", "✅ Ollama installed! Proceeding to model download...");
|
|
1484
|
+
setLoading(false);
|
|
1484
1485
|
// Small delay for PATH to update on Windows
|
|
1485
1486
|
await new Promise(r => setTimeout(r, 2000));
|
|
1486
1487
|
// Go back to models screen so user can pick and it'll proceed to pull
|
|
1487
1488
|
setWizardScreen("models");
|
|
1488
|
-
setWizardPullProgress(null);
|
|
1489
1489
|
}
|
|
1490
1490
|
catch (e) {
|
|
1491
1491
|
addMsg("error", `Install failed: ${e.message}`);
|
|
1492
1492
|
addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
|
|
1493
|
+
setLoading(false);
|
|
1493
1494
|
setWizardScreen("install-ollama");
|
|
1494
|
-
setWizardPullProgress(null);
|
|
1495
1495
|
}
|
|
1496
1496
|
})();
|
|
1497
1497
|
return;
|
package/dist/utils/ollama.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Check if ollama binary exists on PATH
|
|
1
|
+
/** Check if ollama binary exists on PATH, known install locations, or server is running */
|
|
2
2
|
export declare function isOllamaInstalled(): boolean;
|
|
3
3
|
/** Check if ollama server is responding */
|
|
4
4
|
export declare function isOllamaRunning(): Promise<boolean>;
|
package/dist/utils/ollama.js
CHANGED
|
@@ -11,20 +11,42 @@ function getWindowsOllamaPaths() {
|
|
|
11
11
|
paths.push(join(localAppData, "Ollama", "ollama.exe"));
|
|
12
12
|
return paths;
|
|
13
13
|
}
|
|
14
|
-
/** Check if ollama binary exists on PATH
|
|
14
|
+
/** Check if ollama binary exists on PATH, known install locations, or server is running */
|
|
15
15
|
export function isOllamaInstalled() {
|
|
16
|
+
// Check PATH first
|
|
16
17
|
try {
|
|
17
18
|
const cmd = process.platform === "win32" ? "where ollama" : "which ollama";
|
|
18
19
|
execSync(cmd, { stdio: ["pipe", "pipe", "pipe"], timeout: 3000 });
|
|
19
20
|
return true;
|
|
20
21
|
}
|
|
21
|
-
catch {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
catch { }
|
|
23
|
+
// Check known install paths on Windows
|
|
24
|
+
if (process.platform === "win32") {
|
|
25
|
+
if (getWindowsOllamaPaths().some(p => existsSync(p)))
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
// Check if the server is responding (if server is running, Ollama is definitely installed)
|
|
29
|
+
try {
|
|
30
|
+
execSync("curl -s http://localhost:11434/api/tags", {
|
|
31
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
32
|
+
timeout: 3000,
|
|
33
|
+
});
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
catch { }
|
|
37
|
+
// Check if ollama process is running (Windows)
|
|
38
|
+
if (process.platform === "win32") {
|
|
39
|
+
try {
|
|
40
|
+
const result = execSync("tasklist /fi \"imagename eq ollama app.exe\" /fo csv /nh", {
|
|
41
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
42
|
+
timeout: 3000,
|
|
43
|
+
});
|
|
44
|
+
if (result.toString().toLowerCase().includes("ollama"))
|
|
45
|
+
return true;
|
|
25
46
|
}
|
|
26
|
-
|
|
47
|
+
catch { }
|
|
27
48
|
}
|
|
49
|
+
return false;
|
|
28
50
|
}
|
|
29
51
|
/** Check if ollama server is responding */
|
|
30
52
|
export async function isOllamaRunning() {
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1489,8 +1489,8 @@ function App() {
|
|
|
1489
1489
|
if (key.return) {
|
|
1490
1490
|
// Auto-install Ollama if not present
|
|
1491
1491
|
if (!isOllamaInstalled()) {
|
|
1492
|
-
|
|
1493
|
-
|
|
1492
|
+
setLoading(true);
|
|
1493
|
+
setSpinnerMsg("Installing Ollama... this may take a minute");
|
|
1494
1494
|
|
|
1495
1495
|
// Run install async so the UI can update
|
|
1496
1496
|
const installCmd = getOllamaInstallCommand(wizardHardware?.os ?? "linux");
|
|
@@ -1504,16 +1504,16 @@ function App() {
|
|
|
1504
1504
|
});
|
|
1505
1505
|
});
|
|
1506
1506
|
addMsg("info", "✅ Ollama installed! Proceeding to model download...");
|
|
1507
|
+
setLoading(false);
|
|
1507
1508
|
// Small delay for PATH to update on Windows
|
|
1508
1509
|
await new Promise(r => setTimeout(r, 2000));
|
|
1509
1510
|
// Go back to models screen so user can pick and it'll proceed to pull
|
|
1510
1511
|
setWizardScreen("models");
|
|
1511
|
-
setWizardPullProgress(null);
|
|
1512
1512
|
} catch (e: any) {
|
|
1513
1513
|
addMsg("error", `Install failed: ${e.message}`);
|
|
1514
1514
|
addMsg("info", `Try manually in a separate terminal: ${installCmd}`);
|
|
1515
|
+
setLoading(false);
|
|
1515
1516
|
setWizardScreen("install-ollama");
|
|
1516
|
-
setWizardPullProgress(null);
|
|
1517
1517
|
}
|
|
1518
1518
|
})();
|
|
1519
1519
|
return;
|
package/src/utils/ollama.ts
CHANGED
|
@@ -13,19 +13,41 @@ function getWindowsOllamaPaths(): string[] {
|
|
|
13
13
|
return paths;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/** Check if ollama binary exists on PATH
|
|
16
|
+
/** Check if ollama binary exists on PATH, known install locations, or server is running */
|
|
17
17
|
export function isOllamaInstalled(): boolean {
|
|
18
|
+
// Check PATH first
|
|
18
19
|
try {
|
|
19
20
|
const cmd = process.platform === "win32" ? "where ollama" : "which ollama";
|
|
20
21
|
execSync(cmd, { stdio: ["pipe", "pipe", "pipe"], timeout: 3000 });
|
|
21
22
|
return true;
|
|
22
|
-
} catch {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
} catch {}
|
|
24
|
+
|
|
25
|
+
// Check known install paths on Windows
|
|
26
|
+
if (process.platform === "win32") {
|
|
27
|
+
if (getWindowsOllamaPaths().some(p => existsSync(p))) return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Check if the server is responding (if server is running, Ollama is definitely installed)
|
|
31
|
+
try {
|
|
32
|
+
execSync("curl -s http://localhost:11434/api/tags", {
|
|
33
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
34
|
+
timeout: 3000,
|
|
35
|
+
});
|
|
36
|
+
return true;
|
|
37
|
+
} catch {}
|
|
38
|
+
|
|
39
|
+
// Check if ollama process is running (Windows)
|
|
40
|
+
if (process.platform === "win32") {
|
|
41
|
+
try {
|
|
42
|
+
const result = execSync("tasklist /fi \"imagename eq ollama app.exe\" /fo csv /nh", {
|
|
43
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
44
|
+
timeout: 3000,
|
|
45
|
+
});
|
|
46
|
+
if (result.toString().toLowerCase().includes("ollama")) return true;
|
|
47
|
+
} catch {}
|
|
28
48
|
}
|
|
49
|
+
|
|
50
|
+
return false;
|
|
29
51
|
}
|
|
30
52
|
|
|
31
53
|
/** Check if ollama server is responding */
|