yats-toolkit 0.1.4 → 0.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/bin/setup.js +5 -2
- package/package.json +1 -1
- package/src/indexer.js +6 -1
package/bin/setup.js
CHANGED
|
@@ -18,9 +18,12 @@ switch (cmd) {
|
|
|
18
18
|
import("../src/setup.js").then(m => m.default());
|
|
19
19
|
break;
|
|
20
20
|
case "index":
|
|
21
|
-
case "add":
|
|
22
|
-
|
|
21
|
+
case "add": {
|
|
22
|
+
const skipDocs = args.includes("--skip-docs");
|
|
23
|
+
const cleanArgs = args.filter(a => a !== "--skip-docs");
|
|
24
|
+
import("../src/indexer.js").then(m => m.default(cleanArgs, { skipDocs }));
|
|
23
25
|
break;
|
|
26
|
+
}
|
|
24
27
|
case "status":
|
|
25
28
|
import("../src/status.js").then(m => m.default());
|
|
26
29
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yats-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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/indexer.js
CHANGED
|
@@ -27,7 +27,8 @@ async function walk(dir) {
|
|
|
27
27
|
return files;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export default async function indexRepo(args) {
|
|
30
|
+
export default async function indexRepo(args, options = {}) {
|
|
31
|
+
const skipDocs = options.skipDocs || false;
|
|
31
32
|
const repoPath = args[0];
|
|
32
33
|
if (!repoPath) {
|
|
33
34
|
console.error("Usage: npx yats index <path>");
|
|
@@ -61,6 +62,10 @@ export default async function indexRepo(args) {
|
|
|
61
62
|
|
|
62
63
|
for (const file of files) {
|
|
63
64
|
const relPath = relative(repoPath, file);
|
|
65
|
+
|
|
66
|
+
// Skip docs if requested
|
|
67
|
+
if (skipDocs && relPath.endsWith(".md")) continue;
|
|
68
|
+
|
|
64
69
|
try {
|
|
65
70
|
const content = readFileSync(file, "utf-8");
|
|
66
71
|
// Skip binary/large files
|