yats-toolkit 0.1.2 → 0.1.3
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 +1 -1
- package/src/setup.js +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yats-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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
|
@@ -297,8 +297,10 @@ async function checkPort(port) {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
async function checkYatsRunning() {
|
|
300
|
+
// Check if the compose file from a previous setup exists
|
|
301
|
+
if (!existsSync(COMPOSE_FILE)) return false;
|
|
302
|
+
// Check if the YATS setup container is actually running
|
|
300
303
|
return new Promise((resolve) => {
|
|
301
|
-
// Only match the YATS setup containers (not dev containers)
|
|
302
304
|
const proc = spawn("docker", ["ps", "--format", "{{.Names}}", "--filter", "name=yats-yats"], { stdio: "pipe" });
|
|
303
305
|
let out = "";
|
|
304
306
|
proc.stdout.on("data", (d) => (out += d));
|
|
@@ -384,13 +386,19 @@ async function main() {
|
|
|
384
386
|
// Check for existing YATS containers BEFORE the wizard
|
|
385
387
|
const existingContainers = await checkYatsRunning();
|
|
386
388
|
if (existingContainers) {
|
|
387
|
-
|
|
389
|
+
// Try to read the port from the existing compose/env
|
|
390
|
+
let port = 5555;
|
|
391
|
+
try {
|
|
392
|
+
const composeContent = require("fs").readFileSync(COMPOSE_FILE, "utf-8");
|
|
393
|
+
const match = composeContent.match(/YATS_PORT=(\d+)/) || composeContent.match(/"(\d+):(\d+)"/);
|
|
394
|
+
if (match) port = parseInt(match[1] || match[2], 10);
|
|
395
|
+
} catch {}
|
|
396
|
+
|
|
397
|
+
console.log(` ${G}✓${R} YATS is already running on ${C}http://localhost:${port}/mcp${R}`);
|
|
388
398
|
console.log("");
|
|
389
399
|
console.log(` To start fresh ${B}(destroys all indexed data):${R}`);
|
|
390
400
|
console.log(` ${C}cd ~/.yats && docker compose down -v${R}`);
|
|
391
401
|
console.log("");
|
|
392
|
-
console.log(` To reconnect your AI agent, just point it at ${C}http://localhost:5555/mcp${R}`);
|
|
393
|
-
console.log("");
|
|
394
402
|
process.exit(0);
|
|
395
403
|
}
|
|
396
404
|
|