@zabaca/lattice 1.0.9 → 1.0.11
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/dist/main.js +20 -35
- package/package.json +1 -1
- package/dist/cli.js +0 -3035
package/dist/main.js
CHANGED
|
@@ -30,7 +30,7 @@ import { homedir as homedir2 } from "os";
|
|
|
30
30
|
import * as path from "path";
|
|
31
31
|
import { fileURLToPath } from "url";
|
|
32
32
|
import { Injectable } from "@nestjs/common";
|
|
33
|
-
import { Command, CommandRunner
|
|
33
|
+
import { Command, CommandRunner } from "nest-commander";
|
|
34
34
|
|
|
35
35
|
// src/utils/paths.ts
|
|
36
36
|
import { existsSync, mkdirSync } from "fs";
|
|
@@ -75,7 +75,7 @@ var __dirname2 = path.dirname(__filename2);
|
|
|
75
75
|
var COMMANDS = ["research.md", "graph-sync.md", "entity-extract.md"];
|
|
76
76
|
|
|
77
77
|
class InitCommand extends CommandRunner {
|
|
78
|
-
async run(_inputs,
|
|
78
|
+
async run(_inputs, _options) {
|
|
79
79
|
try {
|
|
80
80
|
ensureLatticeHome();
|
|
81
81
|
const envPath = getEnvPath();
|
|
@@ -90,7 +90,7 @@ VOYAGE_API_KEY=
|
|
|
90
90
|
console.log(` Documents: ${getDocsPath()}`);
|
|
91
91
|
console.log(` Config: ${envPath}`);
|
|
92
92
|
console.log();
|
|
93
|
-
const targetDir =
|
|
93
|
+
const targetDir = path.join(homedir2(), ".claude", "commands");
|
|
94
94
|
let commandsSourceDir = path.resolve(__dirname2, "..", "commands");
|
|
95
95
|
try {
|
|
96
96
|
await fs.access(commandsSourceDir);
|
|
@@ -148,10 +148,6 @@ VOYAGE_API_KEY=
|
|
|
148
148
|
console.log(" /graph-sync - Extract entities and sync to graph");
|
|
149
149
|
console.log(" /entity-extract - Extract entities from a single document");
|
|
150
150
|
console.log();
|
|
151
|
-
if (!options.global) {
|
|
152
|
-
console.log("\uD83D\uDCA1 Tip: Use 'lattice init --global' to install for all projects");
|
|
153
|
-
console.log();
|
|
154
|
-
}
|
|
155
151
|
console.log(`\u26A0\uFE0F Add your Voyage API key to: ${getEnvPath()}`);
|
|
156
152
|
console.log();
|
|
157
153
|
process.exit(0);
|
|
@@ -160,19 +156,7 @@ VOYAGE_API_KEY=
|
|
|
160
156
|
process.exit(1);
|
|
161
157
|
}
|
|
162
158
|
}
|
|
163
|
-
parseGlobal() {
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
159
|
}
|
|
167
|
-
__legacyDecorateClassTS([
|
|
168
|
-
Option({
|
|
169
|
-
flags: "-g, --global",
|
|
170
|
-
description: "Install to ~/.claude/commands/ (available in all projects)"
|
|
171
|
-
}),
|
|
172
|
-
__legacyMetadataTS("design:type", Function),
|
|
173
|
-
__legacyMetadataTS("design:paramtypes", []),
|
|
174
|
-
__legacyMetadataTS("design:returntype", Boolean)
|
|
175
|
-
], InitCommand.prototype, "parseGlobal", null);
|
|
176
160
|
InitCommand = __legacyDecorateClassTS([
|
|
177
161
|
Injectable(),
|
|
178
162
|
Command({
|
|
@@ -571,7 +555,7 @@ OntologyCommand = __legacyDecorateClassTS([
|
|
|
571
555
|
], OntologyCommand);
|
|
572
556
|
// src/commands/query.command.ts
|
|
573
557
|
import { Injectable as Injectable7 } from "@nestjs/common";
|
|
574
|
-
import { Command as Command3, CommandRunner as CommandRunner3, Option
|
|
558
|
+
import { Command as Command3, CommandRunner as CommandRunner3, Option } from "nest-commander";
|
|
575
559
|
|
|
576
560
|
// src/embedding/embedding.service.ts
|
|
577
561
|
import { Injectable as Injectable5, Logger as Logger2 } from "@nestjs/common";
|
|
@@ -1313,7 +1297,7 @@ Note: Semantic search requires embeddings to be generated first.`);
|
|
|
1313
1297
|
}
|
|
1314
1298
|
}
|
|
1315
1299
|
__legacyDecorateClassTS([
|
|
1316
|
-
|
|
1300
|
+
Option({
|
|
1317
1301
|
flags: "-l, --label <label>",
|
|
1318
1302
|
description: "Filter by entity label (e.g., Technology, Concept, Document)"
|
|
1319
1303
|
}),
|
|
@@ -1324,7 +1308,7 @@ __legacyDecorateClassTS([
|
|
|
1324
1308
|
__legacyMetadataTS("design:returntype", String)
|
|
1325
1309
|
], SearchCommand.prototype, "parseLabel", null);
|
|
1326
1310
|
__legacyDecorateClassTS([
|
|
1327
|
-
|
|
1311
|
+
Option({
|
|
1328
1312
|
flags: "--limit <n>",
|
|
1329
1313
|
description: "Limit results",
|
|
1330
1314
|
defaultValue: "20"
|
|
@@ -1427,7 +1411,7 @@ SqlCommand = __legacyDecorateClassTS([
|
|
|
1427
1411
|
], SqlCommand);
|
|
1428
1412
|
// src/commands/status.command.ts
|
|
1429
1413
|
import { Injectable as Injectable12 } from "@nestjs/common";
|
|
1430
|
-
import { Command as Command4, CommandRunner as CommandRunner4, Option as
|
|
1414
|
+
import { Command as Command4, CommandRunner as CommandRunner4, Option as Option2 } from "nest-commander";
|
|
1431
1415
|
|
|
1432
1416
|
// src/sync/manifest.service.ts
|
|
1433
1417
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -2350,7 +2334,8 @@ class SyncService {
|
|
|
2350
2334
|
}
|
|
2351
2335
|
const embeddingGenerated = await this.syncDocument(doc, options, preloadedDoc !== undefined);
|
|
2352
2336
|
change.embeddingGenerated = embeddingGenerated;
|
|
2353
|
-
this.
|
|
2337
|
+
const currentDoc = await this.parser.parseDocument(change.path);
|
|
2338
|
+
this.manifest.updateEntry(currentDoc.path, currentDoc.contentHash, currentDoc.frontmatterHash, currentDoc.entities.length, currentDoc.relationships.length);
|
|
2354
2339
|
break;
|
|
2355
2340
|
}
|
|
2356
2341
|
case "deleted": {
|
|
@@ -2515,7 +2500,7 @@ class StatusCommand extends CommandRunner4 {
|
|
|
2515
2500
|
}
|
|
2516
2501
|
}
|
|
2517
2502
|
__legacyDecorateClassTS([
|
|
2518
|
-
|
|
2503
|
+
Option2({
|
|
2519
2504
|
flags: "-v, --verbose",
|
|
2520
2505
|
description: "Show all documents including unchanged"
|
|
2521
2506
|
}),
|
|
@@ -2538,7 +2523,7 @@ StatusCommand = __legacyDecorateClassTS([
|
|
|
2538
2523
|
import { watch } from "fs";
|
|
2539
2524
|
import { join as join3 } from "path";
|
|
2540
2525
|
import { Injectable as Injectable14 } from "@nestjs/common";
|
|
2541
|
-
import { Command as Command5, CommandRunner as CommandRunner5, Option as
|
|
2526
|
+
import { Command as Command5, CommandRunner as CommandRunner5, Option as Option3 } from "nest-commander";
|
|
2542
2527
|
|
|
2543
2528
|
// src/sync/graph-validator.service.ts
|
|
2544
2529
|
import { Injectable as Injectable13, Logger as Logger6 } from "@nestjs/common";
|
|
@@ -2947,7 +2932,7 @@ class SyncCommand extends CommandRunner5 {
|
|
|
2947
2932
|
}
|
|
2948
2933
|
}
|
|
2949
2934
|
__legacyDecorateClassTS([
|
|
2950
|
-
|
|
2935
|
+
Option3({
|
|
2951
2936
|
flags: "-f, --force",
|
|
2952
2937
|
description: "Force re-sync: with paths, clears only those docs; without paths, rebuilds entire graph"
|
|
2953
2938
|
}),
|
|
@@ -2956,7 +2941,7 @@ __legacyDecorateClassTS([
|
|
|
2956
2941
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2957
2942
|
], SyncCommand.prototype, "parseForce", null);
|
|
2958
2943
|
__legacyDecorateClassTS([
|
|
2959
|
-
|
|
2944
|
+
Option3({
|
|
2960
2945
|
flags: "-d, --dry-run",
|
|
2961
2946
|
description: "Show what would change without applying"
|
|
2962
2947
|
}),
|
|
@@ -2965,7 +2950,7 @@ __legacyDecorateClassTS([
|
|
|
2965
2950
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2966
2951
|
], SyncCommand.prototype, "parseDryRun", null);
|
|
2967
2952
|
__legacyDecorateClassTS([
|
|
2968
|
-
|
|
2953
|
+
Option3({
|
|
2969
2954
|
flags: "-v, --verbose",
|
|
2970
2955
|
description: "Show detailed output"
|
|
2971
2956
|
}),
|
|
@@ -2974,7 +2959,7 @@ __legacyDecorateClassTS([
|
|
|
2974
2959
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2975
2960
|
], SyncCommand.prototype, "parseVerbose", null);
|
|
2976
2961
|
__legacyDecorateClassTS([
|
|
2977
|
-
|
|
2962
|
+
Option3({
|
|
2978
2963
|
flags: "-w, --watch",
|
|
2979
2964
|
description: "Watch for file changes and sync automatically"
|
|
2980
2965
|
}),
|
|
@@ -2983,7 +2968,7 @@ __legacyDecorateClassTS([
|
|
|
2983
2968
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2984
2969
|
], SyncCommand.prototype, "parseWatch", null);
|
|
2985
2970
|
__legacyDecorateClassTS([
|
|
2986
|
-
|
|
2971
|
+
Option3({
|
|
2987
2972
|
flags: "--diff",
|
|
2988
2973
|
description: "Show only changed documents (alias for --dry-run)"
|
|
2989
2974
|
}),
|
|
@@ -2992,7 +2977,7 @@ __legacyDecorateClassTS([
|
|
|
2992
2977
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2993
2978
|
], SyncCommand.prototype, "parseDiff", null);
|
|
2994
2979
|
__legacyDecorateClassTS([
|
|
2995
|
-
|
|
2980
|
+
Option3({
|
|
2996
2981
|
flags: "--skip-cascade",
|
|
2997
2982
|
description: "Skip cascade analysis (faster for large repos)"
|
|
2998
2983
|
}),
|
|
@@ -3001,7 +2986,7 @@ __legacyDecorateClassTS([
|
|
|
3001
2986
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
3002
2987
|
], SyncCommand.prototype, "parseSkipCascade", null);
|
|
3003
2988
|
__legacyDecorateClassTS([
|
|
3004
|
-
|
|
2989
|
+
Option3({
|
|
3005
2990
|
flags: "--no-embeddings",
|
|
3006
2991
|
description: "Disable embedding generation during sync"
|
|
3007
2992
|
}),
|
|
@@ -3023,7 +3008,7 @@ SyncCommand = __legacyDecorateClassTS([
|
|
|
3023
3008
|
], SyncCommand);
|
|
3024
3009
|
// src/commands/validate.command.ts
|
|
3025
3010
|
import { Injectable as Injectable15 } from "@nestjs/common";
|
|
3026
|
-
import { Command as Command6, CommandRunner as CommandRunner6, Option as
|
|
3011
|
+
import { Command as Command6, CommandRunner as CommandRunner6, Option as Option4 } from "nest-commander";
|
|
3027
3012
|
class ValidateCommand extends CommandRunner6 {
|
|
3028
3013
|
parserService;
|
|
3029
3014
|
_graphValidator;
|
|
@@ -3115,7 +3100,7 @@ Overall: ${totalErrors === 0 ? "\u2713 PASSED" : "\u2717 FAILED"}${totalWarnings
|
|
|
3115
3100
|
}
|
|
3116
3101
|
}
|
|
3117
3102
|
__legacyDecorateClassTS([
|
|
3118
|
-
|
|
3103
|
+
Option4({
|
|
3119
3104
|
flags: "--fix",
|
|
3120
3105
|
description: "Show suggestions for common issues"
|
|
3121
3106
|
}),
|