yats-toolkit 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/setup.js +10 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yats-toolkit",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "YATS — Yet Another Token Saver. One-command MCP server that indexes your codebase into a knowledge graph so AI agents (Claude, Cursor, Copilot) can search and navigate it without burning tokens.",
5
5
  "author": "Franco Vinciarelli <vinciarellifranco@gmail.com>",
6
6
  "license": "MIT",
package/src/setup.js CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import { spawn } from "node:child_process";
12
- import { writeFileSync, mkdirSync, existsSync } from "node:fs";
12
+ import { writeFileSync, mkdirSync, existsSync, readFileSync } from "node:fs";
13
13
  import { homedir } from "node:os";
14
14
  import { join } from "node:path";
15
15
  import { createInterface } from "node:readline";
@@ -18,7 +18,13 @@ import { createInterface } from "node:readline";
18
18
  // Constants
19
19
  // ============================================================
20
20
 
21
- const YATS_VERSION = "0.1.0";
21
+ // Read version from package.json dynamically
22
+ let YATS_VERSION = "0.1.0";
23
+ try {
24
+ const pkgPath = new URL("../package.json", import.meta.url);
25
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
26
+ YATS_VERSION = pkg.version || YATS_VERSION;
27
+ } catch {}
22
28
  const YATS_DIR = join(homedir(), ".yats");
23
29
  const REPOS_DIR = join(YATS_DIR, "repos");
24
30
  const COMPOSE_FILE = join(YATS_DIR, "docker-compose.yml");
@@ -161,7 +167,7 @@ function box(lines, width = W) {
161
167
  if (line === "") {
162
168
  console.log(` ║ ${" ".repeat(width)} ║`);
163
169
  } else {
164
- console.log(` ║ ${pad(line)} ║`);
170
+ console.log(` ║ ${center(line)} ║`);
165
171
  }
166
172
  }
167
173
  console.log(bottom);
@@ -430,6 +436,7 @@ async function main() {
430
436
  console.log("");
431
437
  console.log(` ${Y}⚠${R} This is a paid service — you may be charged for API usage.`);
432
438
  console.log("");
439
+ console.log("");
433
440
  }
434
441
 
435
442
  // Step 3: Embedding batch size