@zabaca/lattice 1.0.8 → 1.0.10
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/commands/entity-extract.md +14 -0
- package/commands/graph-sync.md +12 -0
- package/commands/research.md +13 -0
- package/dist/main.js +18 -34
- package/package.json +1 -1
- package/dist/cli.js +0 -3035
|
@@ -6,6 +6,20 @@ model: haiku
|
|
|
6
6
|
|
|
7
7
|
Extract entities and relationships from the markdown file "$ARGUMENTS" and update its frontmatter.
|
|
8
8
|
|
|
9
|
+
## Configuration
|
|
10
|
+
|
|
11
|
+
**⚠️ CRITICAL: All documentation lives in `~/.lattice/docs/`**
|
|
12
|
+
|
|
13
|
+
| Path | Purpose |
|
|
14
|
+
|------|---------|
|
|
15
|
+
| `~/.lattice/docs/` | Root documentation directory (ALWAYS use this) |
|
|
16
|
+
| `~/.lattice/docs/{topic}/` | Topic directories |
|
|
17
|
+
| `~/.lattice/docs/{topic}/*.md` | Research documents |
|
|
18
|
+
|
|
19
|
+
**NEVER use project-local `docs/` directories. ALWAYS use absolute path `~/.lattice/docs/`.**
|
|
20
|
+
|
|
21
|
+
**If the argument "$ARGUMENTS" is a relative path like `docs/topic/file.md`, convert it to `~/.lattice/docs/topic/file.md`.**
|
|
22
|
+
|
|
9
23
|
## IMPORTANT: Always Re-Extract
|
|
10
24
|
|
|
11
25
|
Even if the document already has frontmatter with entities:
|
package/commands/graph-sync.md
CHANGED
|
@@ -5,6 +5,18 @@ model: sonnet
|
|
|
5
5
|
|
|
6
6
|
Identify modified documents in `~/.lattice/docs/`, extract entities from them, and sync to the knowledge graph.
|
|
7
7
|
|
|
8
|
+
## Configuration
|
|
9
|
+
|
|
10
|
+
**⚠️ CRITICAL: All documentation lives in `~/.lattice/docs/`**
|
|
11
|
+
|
|
12
|
+
| Path | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `~/.lattice/docs/` | Root documentation directory (ALWAYS use this) |
|
|
15
|
+
| `~/.lattice/docs/{topic}/` | Topic directories |
|
|
16
|
+
| `~/.lattice/docs/{topic}/*.md` | Research documents |
|
|
17
|
+
|
|
18
|
+
**NEVER use project-local `docs/` directories. ALWAYS use absolute path `~/.lattice/docs/`.**
|
|
19
|
+
|
|
8
20
|
## Process
|
|
9
21
|
|
|
10
22
|
### Step 1: Check What Needs Syncing
|
package/commands/research.md
CHANGED
|
@@ -6,6 +6,19 @@ model: sonnet
|
|
|
6
6
|
|
|
7
7
|
Research the topic "$ARGUMENTS" by first checking existing documentation, then performing new research if needed.
|
|
8
8
|
|
|
9
|
+
## Configuration
|
|
10
|
+
|
|
11
|
+
**⚠️ CRITICAL: All documentation lives in `~/.lattice/docs/`**
|
|
12
|
+
|
|
13
|
+
| Path | Purpose |
|
|
14
|
+
|------|---------|
|
|
15
|
+
| `~/.lattice/docs/` | Root documentation directory (ALWAYS use this) |
|
|
16
|
+
| `~/.lattice/docs/{topic}/` | Topic directories |
|
|
17
|
+
| `~/.lattice/docs/{topic}/README.md` | Topic index |
|
|
18
|
+
| `~/.lattice/docs/{topic}/*.md` | Research documents |
|
|
19
|
+
|
|
20
|
+
**NEVER use project-local `docs/` directories. ALWAYS use absolute path `~/.lattice/docs/`.**
|
|
21
|
+
|
|
9
22
|
## Process
|
|
10
23
|
|
|
11
24
|
### Step 1: Search Existing Research
|
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";
|
|
@@ -2515,7 +2499,7 @@ class StatusCommand extends CommandRunner4 {
|
|
|
2515
2499
|
}
|
|
2516
2500
|
}
|
|
2517
2501
|
__legacyDecorateClassTS([
|
|
2518
|
-
|
|
2502
|
+
Option2({
|
|
2519
2503
|
flags: "-v, --verbose",
|
|
2520
2504
|
description: "Show all documents including unchanged"
|
|
2521
2505
|
}),
|
|
@@ -2538,7 +2522,7 @@ StatusCommand = __legacyDecorateClassTS([
|
|
|
2538
2522
|
import { watch } from "fs";
|
|
2539
2523
|
import { join as join3 } from "path";
|
|
2540
2524
|
import { Injectable as Injectable14 } from "@nestjs/common";
|
|
2541
|
-
import { Command as Command5, CommandRunner as CommandRunner5, Option as
|
|
2525
|
+
import { Command as Command5, CommandRunner as CommandRunner5, Option as Option3 } from "nest-commander";
|
|
2542
2526
|
|
|
2543
2527
|
// src/sync/graph-validator.service.ts
|
|
2544
2528
|
import { Injectable as Injectable13, Logger as Logger6 } from "@nestjs/common";
|
|
@@ -2947,7 +2931,7 @@ class SyncCommand extends CommandRunner5 {
|
|
|
2947
2931
|
}
|
|
2948
2932
|
}
|
|
2949
2933
|
__legacyDecorateClassTS([
|
|
2950
|
-
|
|
2934
|
+
Option3({
|
|
2951
2935
|
flags: "-f, --force",
|
|
2952
2936
|
description: "Force re-sync: with paths, clears only those docs; without paths, rebuilds entire graph"
|
|
2953
2937
|
}),
|
|
@@ -2956,7 +2940,7 @@ __legacyDecorateClassTS([
|
|
|
2956
2940
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2957
2941
|
], SyncCommand.prototype, "parseForce", null);
|
|
2958
2942
|
__legacyDecorateClassTS([
|
|
2959
|
-
|
|
2943
|
+
Option3({
|
|
2960
2944
|
flags: "-d, --dry-run",
|
|
2961
2945
|
description: "Show what would change without applying"
|
|
2962
2946
|
}),
|
|
@@ -2965,7 +2949,7 @@ __legacyDecorateClassTS([
|
|
|
2965
2949
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2966
2950
|
], SyncCommand.prototype, "parseDryRun", null);
|
|
2967
2951
|
__legacyDecorateClassTS([
|
|
2968
|
-
|
|
2952
|
+
Option3({
|
|
2969
2953
|
flags: "-v, --verbose",
|
|
2970
2954
|
description: "Show detailed output"
|
|
2971
2955
|
}),
|
|
@@ -2974,7 +2958,7 @@ __legacyDecorateClassTS([
|
|
|
2974
2958
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2975
2959
|
], SyncCommand.prototype, "parseVerbose", null);
|
|
2976
2960
|
__legacyDecorateClassTS([
|
|
2977
|
-
|
|
2961
|
+
Option3({
|
|
2978
2962
|
flags: "-w, --watch",
|
|
2979
2963
|
description: "Watch for file changes and sync automatically"
|
|
2980
2964
|
}),
|
|
@@ -2983,7 +2967,7 @@ __legacyDecorateClassTS([
|
|
|
2983
2967
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2984
2968
|
], SyncCommand.prototype, "parseWatch", null);
|
|
2985
2969
|
__legacyDecorateClassTS([
|
|
2986
|
-
|
|
2970
|
+
Option3({
|
|
2987
2971
|
flags: "--diff",
|
|
2988
2972
|
description: "Show only changed documents (alias for --dry-run)"
|
|
2989
2973
|
}),
|
|
@@ -2992,7 +2976,7 @@ __legacyDecorateClassTS([
|
|
|
2992
2976
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
2993
2977
|
], SyncCommand.prototype, "parseDiff", null);
|
|
2994
2978
|
__legacyDecorateClassTS([
|
|
2995
|
-
|
|
2979
|
+
Option3({
|
|
2996
2980
|
flags: "--skip-cascade",
|
|
2997
2981
|
description: "Skip cascade analysis (faster for large repos)"
|
|
2998
2982
|
}),
|
|
@@ -3001,7 +2985,7 @@ __legacyDecorateClassTS([
|
|
|
3001
2985
|
__legacyMetadataTS("design:returntype", Boolean)
|
|
3002
2986
|
], SyncCommand.prototype, "parseSkipCascade", null);
|
|
3003
2987
|
__legacyDecorateClassTS([
|
|
3004
|
-
|
|
2988
|
+
Option3({
|
|
3005
2989
|
flags: "--no-embeddings",
|
|
3006
2990
|
description: "Disable embedding generation during sync"
|
|
3007
2991
|
}),
|
|
@@ -3023,7 +3007,7 @@ SyncCommand = __legacyDecorateClassTS([
|
|
|
3023
3007
|
], SyncCommand);
|
|
3024
3008
|
// src/commands/validate.command.ts
|
|
3025
3009
|
import { Injectable as Injectable15 } from "@nestjs/common";
|
|
3026
|
-
import { Command as Command6, CommandRunner as CommandRunner6, Option as
|
|
3010
|
+
import { Command as Command6, CommandRunner as CommandRunner6, Option as Option4 } from "nest-commander";
|
|
3027
3011
|
class ValidateCommand extends CommandRunner6 {
|
|
3028
3012
|
parserService;
|
|
3029
3013
|
_graphValidator;
|
|
@@ -3115,7 +3099,7 @@ Overall: ${totalErrors === 0 ? "\u2713 PASSED" : "\u2717 FAILED"}${totalWarnings
|
|
|
3115
3099
|
}
|
|
3116
3100
|
}
|
|
3117
3101
|
__legacyDecorateClassTS([
|
|
3118
|
-
|
|
3102
|
+
Option4({
|
|
3119
3103
|
flags: "--fix",
|
|
3120
3104
|
description: "Show suggestions for common issues"
|
|
3121
3105
|
}),
|