netheriteai-code 1.1.4 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netheriteai-code",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "NetheriteAI:Code by hurdacu. High-performance coding assistant.",
5
5
  "author": "hurdacu",
6
6
  "license": "MIT",
package/src/cli.js CHANGED
@@ -11,7 +11,7 @@ import { printTable, resolveWorkspaceRoot } from "./utils.js";
11
11
 
12
12
  const execFileAsync = promisify(execFile);
13
13
 
14
- const VERSION = "1.1.4";
14
+ const VERSION = "1.1.5";
15
15
 
16
16
  function isNewer(latest, current) {
17
17
  const l = String(latest || "0.0.0").split(".").map(Number);
package/src/ollama.js CHANGED
@@ -59,12 +59,15 @@ export async function listModels() {
59
59
 
60
60
  export async function pickDefaultModel() {
61
61
  try {
62
- const models = await listModels();
63
- if (!models.length) throw new Error("Server down");
64
- const match = models.find(m => PREFERRED_DEFAULT_MODELS.some(p => p.toLowerCase() === m.name.toLowerCase()));
65
- return match ? match.name : models[0].name;
62
+ const models = await listModels().catch(() => []);
63
+ if (models.length > 0) {
64
+ const match = models.find(m => PREFERRED_DEFAULT_MODELS.some(p => p.toLowerCase() === m.name.toLowerCase()));
65
+ if (match) return match.name;
66
+ }
67
+ // If list fails or no match, fallback to the first preferred model directly
68
+ return PREFERRED_DEFAULT_MODELS[0];
66
69
  } catch {
67
- throw new Error("Server down");
70
+ return PREFERRED_DEFAULT_MODELS[0];
68
71
  }
69
72
  }
70
73