netheriteai-code 1.1.0 → 1.1.2

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,10 +1,16 @@
1
1
  {
2
2
  "name": "netheriteai-code",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "NetheriteAI:Code by hurdacu. High-performance coding assistant.",
5
5
  "author": "hurdacu",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
+ "files": [
9
+ "bin",
10
+ "src",
11
+ "README.md",
12
+ "package.json"
13
+ ],
8
14
  "bin": {
9
15
  "netheriteai-code": "bin/netheriteai-code.js",
10
16
  "netheritecode": "bin/netheriteai-code.js",
@@ -12,7 +18,6 @@
12
18
  },
13
19
  "scripts": {
14
20
  "start": "node ./bin/netheriteai-code.js",
15
- "models": "node ./bin/netheriteai-code.js models",
16
21
  "chat": "node ./bin/netheriteai-code.js chat",
17
22
  "tui": "node ./bin/netheriteai-code.js tui"
18
23
  },
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.0";
14
+ const VERSION = "1.1.2";
15
15
 
16
16
  async function handleAutoUpdate() {
17
17
  // If we were just restarted by an update, don't check again
package/src/tools.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  } from "./utils.js";
14
14
 
15
15
  const activeProcesses = new Map();
16
+ const isWin = process.platform === "win32";
16
17
 
17
18
  function todoFile(root) {
18
19
  return path.join(root, ".netherite", "todos.json");
@@ -170,16 +171,20 @@ export function getToolDefinitions() {
170
171
 
171
172
  function listRecursive(root, basePath) {
172
173
  const entries = [];
173
- for (const entry of fs.readdirSync(basePath)) {
174
- const absolute = path.join(basePath, entry);
175
- const rel = relativeToRoot(root, absolute);
176
- entries.push({
177
- path: rel,
178
- ...statEntry(absolute),
179
- });
180
- if (fs.statSync(absolute).isDirectory()) {
181
- entries.push(...listRecursive(root, absolute));
174
+ try {
175
+ for (const entry of fs.readdirSync(basePath)) {
176
+ const absolute = path.join(basePath, entry);
177
+ const rel = relativeToRoot(root, absolute);
178
+ entries.push({
179
+ path: rel,
180
+ ...statEntry(absolute),
181
+ });
182
+ if (fs.statSync(absolute).isDirectory()) {
183
+ entries.push(...listRecursive(root, absolute));
184
+ }
182
185
  }
186
+ } catch {
187
+ // Ignore errors in list
183
188
  }
184
189
  return entries;
185
190
  }
@@ -200,6 +205,7 @@ async function runSpawnedCommand(root, command, args = [], hooks = {}) {
200
205
  const child = spawn(command, args, {
201
206
  cwd: root,
202
207
  stdio: ["pipe", "pipe", "pipe"],
208
+ shell: isWin,
203
209
  });
204
210
 
205
211
  const p = { child, stdout: "", stderr: "" };
@@ -293,17 +299,6 @@ export async function executeToolCall(root, toolCall, hooks = {}) {
293
299
  const content = fs.readFileSync(target, "utf8");
294
300
  return { path: args.path, content: clampText(content, 24000) };
295
301
  }
296
- case "create_file": {
297
- const target = toAbsoluteInsideRoot(root, args.path);
298
- if (fs.existsSync(target)) {
299
- throw new Error(`File already exists: ${args.path}`);
300
- }
301
- ensureDir(path.dirname(target));
302
- hooks.onProgress?.({ stream: "preview", text: `Creating ${args.path}\n` });
303
- await streamFilePreview(args.content, hooks);
304
- fs.writeFileSync(target, args.content, "utf8");
305
- return { ok: true, path: args.path, bytesWritten: Buffer.byteLength(args.content, "utf8"), created: true };
306
- }
307
302
  case "write_file": {
308
303
  const target = toAbsoluteInsideRoot(root, args.path);
309
304
  ensureDir(path.dirname(target));
@@ -312,14 +307,6 @@ export async function executeToolCall(root, toolCall, hooks = {}) {
312
307
  fs.writeFileSync(target, args.content, "utf8");
313
308
  return { ok: true, path: args.path, bytesWritten: Buffer.byteLength(args.content, "utf8") };
314
309
  }
315
- case "append_file": {
316
- const target = toAbsoluteInsideRoot(root, args.path);
317
- ensureDir(path.dirname(target));
318
- hooks.onProgress?.({ stream: "preview", text: `Appending ${args.path}\n` });
319
- await streamFilePreview(args.content, hooks);
320
- fs.appendFileSync(target, args.content, "utf8");
321
- return { ok: true, path: args.path, bytesWritten: Buffer.byteLength(args.content, "utf8"), appended: true };
322
- }
323
310
  case "edit_file": {
324
311
  const target = toAbsoluteInsideRoot(root, args.path);
325
312
  const original = fs.readFileSync(target, "utf8");
@@ -396,19 +383,6 @@ export async function executeToolCall(root, toolCall, hooks = {}) {
396
383
  }
397
384
  return await runOneCommand(root, args.command, args.args || [], hooks);
398
385
  }
399
- case "batch_command": {
400
- const results = [];
401
- for (const command of args.commands || []) {
402
- if (command.commandLine) {
403
- hooks.onProgress?.({ stream: "stdout", text: `$ ${command.commandLine}\n` });
404
- results.push(await runShellLine(root, command.commandLine, hooks));
405
- } else {
406
- hooks.onProgress?.({ stream: "stdout", text: `$ ${[command.command, ...(command.args || [])].filter(Boolean).join(" ")}\n` });
407
- results.push(await runOneCommand(root, command.command, command.args || [], hooks));
408
- }
409
- }
410
- return { results };
411
- }
412
386
  case "todo_create": {
413
387
  const todos = loadTodos(root);
414
388
  const next = {
@@ -439,9 +413,3 @@ export async function executeToolCall(root, toolCall, hooks = {}) {
439
413
  throw new Error(`Unknown tool: ${name}`);
440
414
  }
441
415
  }
442
- odo;
443
- }
444
- default:
445
- throw new Error(`Unknown tool: ${name}`);
446
- }
447
- }
package/hi.txt DELETED
@@ -1 +0,0 @@
1
- Hello there! Welcome to your new file. Feel free to edit it whenever you'd like.
package/image.png DELETED
Binary file