@nodesify/astria 1.0.0 → 1.0.2
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/LICENSE +21 -21
- package/README.md +65 -65
- package/dist/commands/add.d.ts +7 -7
- package/dist/commands/add.js +33 -33
- package/dist/commands/affected.d.ts +5 -5
- package/dist/commands/affected.js +29 -29
- package/dist/commands/cluster.d.ts +1 -1
- package/dist/commands/cluster.js +50 -50
- package/dist/commands/diagnose.d.ts +4 -4
- package/dist/commands/diagnose.js +19 -19
- package/dist/commands/diff.d.ts +1 -1
- package/dist/commands/diff.js +35 -35
- package/dist/commands/explain.d.ts +3 -3
- package/dist/commands/explain.js +37 -37
- package/dist/commands/export.d.ts +6 -6
- package/dist/commands/export.js +32 -32
- package/dist/commands/feedback.d.ts +11 -11
- package/dist/commands/feedback.js +40 -40
- package/dist/commands/global.d.ts +6 -6
- package/dist/commands/global.js +60 -60
- package/dist/commands/history.d.ts +4 -4
- package/dist/commands/history.js +27 -27
- package/dist/commands/hook-guard.d.ts +1 -1
- package/dist/commands/hook-guard.js +144 -144
- package/dist/commands/hook.d.ts +2 -2
- package/dist/commands/hook.js +52 -52
- package/dist/commands/install.d.ts +2 -2
- package/dist/commands/install.js +39 -39
- package/dist/commands/map.d.ts +5 -5
- package/dist/commands/map.js +15 -15
- package/dist/commands/mcp.d.ts +3 -3
- package/dist/commands/mcp.js +14 -14
- package/dist/commands/merge.d.ts +1 -1
- package/dist/commands/merge.js +50 -50
- package/dist/commands/migrate.d.ts +3 -3
- package/dist/commands/migrate.js +74 -74
- package/dist/commands/path.d.ts +5 -5
- package/dist/commands/path.js +18 -18
- package/dist/commands/prs.d.ts +4 -4
- package/dist/commands/prs.js +132 -132
- package/dist/commands/query.d.ts +9 -9
- package/dist/commands/query.js +21 -21
- package/dist/commands/run.d.ts +9 -9
- package/dist/commands/run.js +68 -68
- package/dist/commands/stats.d.ts +3 -3
- package/dist/commands/stats.js +17 -17
- package/dist/commands/status.d.ts +3 -3
- package/dist/commands/status.js +56 -56
- package/dist/commands/tree.d.ts +5 -5
- package/dist/commands/tree.js +52 -52
- package/dist/commands/update.d.ts +6 -6
- package/dist/commands/update.js +65 -65
- package/dist/commands/watch.d.ts +3 -3
- package/dist/commands/watch.js +113 -113
- package/dist/commands/wiki.d.ts +6 -6
- package/dist/commands/wiki.js +59 -59
- package/dist/index.d.ts +4 -4
- package/dist/index.js +249 -249
- package/dist/install/hooks.d.ts +11 -11
- package/dist/install/hooks.js +306 -306
- package/dist/install/index.d.ts +2 -2
- package/dist/install/index.js +361 -361
- package/dist/install/markdown-inject.d.ts +6 -6
- package/dist/install/markdown-inject.js +177 -177
- package/dist/install/platforms.d.ts +12 -12
- package/dist/install/platforms.js +129 -129
- package/dist/install/settings-inject.d.ts +17 -17
- package/dist/install/settings-inject.js +424 -424
- package/dist/native.d.ts +31 -31
- package/dist/native.js +106 -106
- package/package.json +72 -72
- package/skills/skill-aider.md +40 -40
- package/skills/skill-codex.md +46 -46
- package/skills/skill-copilot.md +46 -46
- package/skills/skill-cursor.md +39 -39
- package/skills/skill-gemini.md +46 -46
- package/skills/skill-kiro.md +39 -39
- package/skills/skill-opencode.md +44 -44
- package/skills/skill-trae.md +46 -46
- package/skills/skill.md +266 -266
- package/dist/graphify.node +0 -4
package/dist/index.js
CHANGED
|
@@ -1,251 +1,251 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.program = void 0;
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
const run_1 = require("./commands/run");
|
|
7
|
-
const stats_1 = require("./commands/stats");
|
|
8
|
-
const explain_1 = require("./commands/explain");
|
|
9
|
-
const export_1 = require("./commands/export");
|
|
10
|
-
const query_1 = require("./commands/query");
|
|
11
|
-
const path_1 = require("./commands/path");
|
|
12
|
-
const map_1 = require("./commands/map");
|
|
13
|
-
const affected_1 = require("./commands/affected");
|
|
14
|
-
const mcp_1 = require("./commands/mcp");
|
|
15
|
-
const tree_1 = require("./commands/tree");
|
|
16
|
-
const wiki_1 = require("./commands/wiki");
|
|
17
|
-
const prs_1 = require("./commands/prs");
|
|
18
|
-
const add_1 = require("./commands/add");
|
|
19
|
-
const diagnose_1 = require("./commands/diagnose");
|
|
20
|
-
const feedback_1 = require("./commands/feedback");
|
|
21
|
-
const global_1 = require("./commands/global");
|
|
22
|
-
const hook_guard_1 = require("./commands/hook-guard");
|
|
23
|
-
const migrate_1 = require("./commands/migrate");
|
|
24
|
-
const update_1 = require("./commands/update");
|
|
25
|
-
const watch_1 = require("./commands/watch");
|
|
26
|
-
const cluster_1 = require("./commands/cluster");
|
|
27
|
-
const merge_1 = require("./commands/merge");
|
|
28
|
-
const diff_1 = require("./commands/diff");
|
|
29
|
-
const history_1 = require("./commands/history");
|
|
30
|
-
const status_1 = require("./commands/status");
|
|
31
|
-
const install_1 = require("./commands/install");
|
|
32
|
-
const hook_1 = require("./commands/hook");
|
|
33
|
-
const program = new commander_1.Command();
|
|
34
|
-
exports.program = program;
|
|
35
|
-
program
|
|
36
|
-
.name('astria')
|
|
37
|
-
.description('Turn any folder into a queryable knowledge graph')
|
|
38
|
-
.version(require('../package.json').version);
|
|
39
|
-
program
|
|
40
|
-
.command('run')
|
|
41
|
-
.description('Run the full pipeline on a directory')
|
|
42
|
-
.argument('<path>', 'Directory to analyze')
|
|
43
|
-
.option('--no-dedup', 'Skip near-duplicate node merging')
|
|
44
|
-
.option('--backend <name>', 'Semantic LLM backend: claude, openai (any OpenAI-compatible), or gemini')
|
|
45
|
-
.option('--model <name>', 'Semantic LLM model name (backend-specific)')
|
|
46
|
-
.option('--wiki', 'Also export a markdown wiki to .astria/wiki')
|
|
47
|
-
.option('--embed', 'Compute local embeddings: similar_to edges + semantic query recall (downloads a small model on first use)')
|
|
48
|
-
.option('--global', 'After building, merge this repo into the cross-repo global graph')
|
|
49
|
-
.option('--as <tag>', 'Repo tag for --global (defaults to the directory name)')
|
|
50
|
-
.action((path, opts) => (0, run_1.runCommand)(path, { ...opts, global: opts.global, as: opts.as }));
|
|
51
|
-
program
|
|
52
|
-
.command('update')
|
|
53
|
-
.description('Run incremental AST-only rebuild')
|
|
54
|
-
.argument('<path>', 'Directory to update')
|
|
55
|
-
.option('--no-dedup', 'Skip near-duplicate node merging')
|
|
56
|
-
.option('--backend <name>', 'Semantic LLM backend: claude, openai (any OpenAI-compatible), or gemini')
|
|
57
|
-
.option('--model <name>', 'Semantic LLM model name (backend-specific)')
|
|
58
|
-
.option('--embed', 'Compute local embeddings: similar_to edges + semantic query recall (downloads a small model on first use)')
|
|
59
|
-
.action(update_1.updateCommand);
|
|
60
|
-
program
|
|
61
|
-
.command('watch')
|
|
62
|
-
.description('Watch for file changes and auto-rebuild')
|
|
63
|
-
.argument('<path>', 'Directory to watch')
|
|
64
|
-
.option('--debounce <ms>', 'Debounce interval in milliseconds', '3000')
|
|
65
|
-
.action(watch_1.watchCommand);
|
|
66
|
-
program
|
|
67
|
-
.command('explain')
|
|
68
|
-
.description('Explain a node and its connections')
|
|
69
|
-
.argument('<node>', 'Node ID or label')
|
|
70
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
71
|
-
.action(explain_1.explainCommand);
|
|
72
|
-
program
|
|
73
|
-
.command('query')
|
|
74
|
-
.description('BFS/DFS graph traversal for a question')
|
|
75
|
-
.argument('<question>', 'Search terms')
|
|
76
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
77
|
-
.option('--dfs', 'Use depth-first search instead of breadth-first')
|
|
78
|
-
.option('--depth <n>', 'Traversal depth', '2')
|
|
79
|
-
.option('--budget <n>', 'Token budget for output', '2000')
|
|
80
|
-
.option('--directed', 'Follow edges only in their stored direction (caller -> callee)')
|
|
81
|
-
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
82
|
-
.option('--cursor <n>', 'Continuation token from a previous truncated query', '0')
|
|
83
|
-
.action(query_1.queryCommand);
|
|
84
|
-
program
|
|
85
|
-
.command('path')
|
|
86
|
-
.description('Find shortest path between two nodes')
|
|
87
|
-
.argument('<source>', 'Source node label')
|
|
88
|
-
.argument('<target>', 'Target node label')
|
|
89
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
90
|
-
.option('--directed', 'Follow edges only in their stored direction (caller -> callee)')
|
|
91
|
-
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
92
|
-
.action(path_1.pathCommand);
|
|
93
|
-
program
|
|
94
|
-
.command('map')
|
|
95
|
-
.description('Repo map: PageRank-ranked files with top symbols, within a token budget')
|
|
96
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
97
|
-
.option('--budget <n>', 'Token budget for output', '2000')
|
|
98
|
-
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
99
|
-
.action(map_1.mapCommand);
|
|
100
|
-
program
|
|
101
|
-
.command('affected')
|
|
102
|
-
.description('Show the blast radius of a node — everything impacted by changing it')
|
|
103
|
-
.argument('<node>', 'Node ID, label, or source file path')
|
|
104
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
105
|
-
.option('--depth <n>', 'Maximum hops to traverse', '2')
|
|
106
|
-
.option('--relation <type>', 'Only follow one relation (e.g. calls, imports, uses)')
|
|
107
|
-
.action(affected_1.affectedCommand);
|
|
108
|
-
program
|
|
109
|
-
.command('stats')
|
|
110
|
-
.description('Show graph statistics')
|
|
111
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
112
|
-
.action(stats_1.statsCommand);
|
|
113
|
-
program
|
|
114
|
-
.command('export')
|
|
115
|
-
.description('Export graph to JSON, HTML, GraphML, or Cypher (Neo4j)')
|
|
116
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
117
|
-
.option('--out <file>', 'Output file', 'graph.json')
|
|
118
|
-
.option('--format <type>', 'Export format: json, html, graphml, cypher', 'json')
|
|
119
|
-
.option('--mode <mode>', 'HTML visualization mode: standard or large', 'standard')
|
|
120
|
-
.action(export_1.exportCommand);
|
|
121
|
-
program
|
|
122
|
-
.command('cluster-only')
|
|
123
|
-
.description('Run cluster + analyze + report only (no extract/build)')
|
|
124
|
-
.argument('<path>', 'Directory with existing graph')
|
|
125
|
-
.action(cluster_1.clusterCommand);
|
|
126
|
-
program
|
|
127
|
-
.command('merge')
|
|
128
|
-
.description('Merge two graphs into a new output graph')
|
|
129
|
-
.argument('<pathA>', 'First project root')
|
|
130
|
-
.argument('<pathB>', 'Second project root')
|
|
131
|
-
.argument('<outPath>', 'Output project root')
|
|
132
|
-
.action(merge_1.mergeCommand);
|
|
133
|
-
program
|
|
134
|
-
.command('diff')
|
|
135
|
-
.description('Compare two graphs and show differences')
|
|
136
|
-
.argument('<pathA>', 'First project root')
|
|
137
|
-
.argument('<pathB>', 'Second project root')
|
|
138
|
-
.action(diff_1.diffCommand);
|
|
139
|
-
program
|
|
140
|
-
.command('history')
|
|
141
|
-
.description('Show recent query history')
|
|
142
|
-
.option('--limit <n>', 'Number of entries to show', '20')
|
|
143
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
144
|
-
.action(history_1.historyCommand);
|
|
145
|
-
program
|
|
146
|
-
.command('mcp')
|
|
147
|
-
.description('Run an MCP stdio server exposing the graph to AI agents (Claude, etc.)')
|
|
148
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
149
|
-
.action(mcp_1.mcpCommand);
|
|
150
|
-
program
|
|
151
|
-
.command('tree')
|
|
152
|
-
.description('Export a collapsible filesystem tree of all graph symbols (self-contained HTML)')
|
|
153
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
154
|
-
.option('--out <file>', 'Output HTML file', 'tree.html')
|
|
155
|
-
.option('--max-children <n>', 'Max symbols shown per directory', '40')
|
|
156
|
-
.action(tree_1.treeCommand);
|
|
157
|
-
program
|
|
158
|
-
.command('wiki')
|
|
159
|
-
.description('Export a Wikipedia-style markdown wiki (index.md + one article per community and god node)')
|
|
160
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
161
|
-
.option('--out <dir>', 'Output directory', '.astria/wiki')
|
|
162
|
-
.option('--max-nodes <n>', 'Max key concepts listed per community article', '25')
|
|
163
|
-
.option('--format <type>', 'markdown (wiki articles) or obsidian (vault: per-node notes + canvas)', 'markdown')
|
|
164
|
-
.action(wiki_1.wikiCommand);
|
|
165
|
-
program
|
|
166
|
-
.command('prs')
|
|
167
|
-
.description('Map open pull requests onto the knowledge graph (impact + merge-order risk)')
|
|
168
|
-
.argument('[count]', 'Number of PRs to analyze', '20')
|
|
169
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
170
|
-
.option('--conflicts', 'Flag PRs sharing communities (merge-order risk)')
|
|
171
|
-
.action(prs_1.prsCommand);
|
|
172
|
-
program
|
|
173
|
-
.command('add')
|
|
174
|
-
.description('Fetch a URL (arXiv paper, tweet, webpage, image, PDF) into ./raw and update the graph')
|
|
175
|
-
.argument('[url]', 'URL to fetch (required unless --scip/--postgres is given)')
|
|
176
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
177
|
-
.option('--author <name>', 'Author recorded in the saved metadata')
|
|
178
|
-
.option('--contributor <name>', 'Contributor recorded in the saved metadata')
|
|
179
|
-
.option('--scip <file>', 'Ingest a simplified SCIP JSON index instead of fetching a URL')
|
|
180
|
-
.option('--postgres <dsn>', 'Introspect a live PostgreSQL schema (requires psql on PATH) instead of fetching a URL')
|
|
181
|
-
.action(add_1.addCommand);
|
|
182
|
-
program
|
|
183
|
-
.command('status')
|
|
184
|
-
.description('Check graph health and staleness')
|
|
185
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
186
|
-
.action(status_1.statusCommand);
|
|
187
|
-
program
|
|
188
|
-
.command('migrate')
|
|
189
|
-
.description('Migrate a pre-1.0 .graphify layout to .astria (renames the data folder, ignore file, and global store)')
|
|
190
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
191
|
-
.action(migrate_1.migrateCommand);
|
|
192
|
-
(0, install_1.registerInstallCommand)(program);
|
|
193
|
-
(0, hook_1.registerHookCommand)(program);
|
|
194
|
-
program
|
|
195
|
-
.command('diagnose')
|
|
196
|
-
.description('Read-only graph health report: dangling edges, self-loops, duplicates, stubs')
|
|
197
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
198
|
-
.option('--json', 'Machine-readable output')
|
|
199
|
-
.action(diagnose_1.diagnoseCommand);
|
|
200
|
-
program
|
|
201
|
-
.command('save-result')
|
|
202
|
-
.description('Save a Q/A pair into the graph memory for future runs')
|
|
203
|
-
.argument('<question>', 'The question that was asked')
|
|
204
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
205
|
-
.option('--answer <text>', 'The answer to record')
|
|
206
|
-
.option('--answer-file <path>', 'Read the answer from a file')
|
|
207
|
-
.option('--outcome <kind>', 'useful | dead_end | corrected')
|
|
208
|
-
.option('--correction <text>', 'Corrections to the recorded answer')
|
|
209
|
-
.option('--nodes <ids>', 'Comma-separated source node ids this answer cites')
|
|
210
|
-
.action(feedback_1.saveResultCommand);
|
|
211
|
-
program
|
|
212
|
-
.command('reflect')
|
|
213
|
-
.description('Aggregate memory outcomes into .astria/reflections/LESSONS.md')
|
|
214
|
-
.option('--graph <path>', 'Path to project root', '.')
|
|
215
|
-
.action(feedback_1.reflectCommand);
|
|
216
|
-
const globalCmd = program
|
|
217
|
-
.command('global')
|
|
218
|
-
.description('Cross-repo global graph: merge many repo graphs into one queryable store');
|
|
219
|
-
globalCmd
|
|
220
|
-
.command('add')
|
|
221
|
-
.description('Merge a repo graph into the global store (idempotent by tag)')
|
|
222
|
-
.argument('<path>', 'Repo root with a .astria directory')
|
|
223
|
-
.option('--as <tag>', 'Repo tag (defaults to the directory name)')
|
|
224
|
-
.action(global_1.globalAddCommand);
|
|
225
|
-
globalCmd
|
|
226
|
-
.command('remove')
|
|
227
|
-
.description('Remove a repo from the global graph')
|
|
228
|
-
.argument('<tag>', 'Repo tag')
|
|
229
|
-
.action(global_1.globalRemoveCommand);
|
|
230
|
-
globalCmd
|
|
231
|
-
.command('list')
|
|
232
|
-
.description('List repos registered in the global graph')
|
|
233
|
-
.action(() => (0, global_1.globalListCommand)());
|
|
234
|
-
globalCmd
|
|
235
|
-
.command('path')
|
|
236
|
-
.description('Shortest path across repos in the global graph')
|
|
237
|
-
.argument('<source>', 'Source node id or unique label')
|
|
238
|
-
.argument('<target>', 'Target node id or unique label')
|
|
239
|
-
.action(global_1.globalPathCommand);
|
|
240
|
-
program
|
|
241
|
-
.command('hook-guard')
|
|
242
|
-
.description('Editor PreToolUse guard (installed into .claude/settings.json) — internal use')
|
|
243
|
-
.argument('<mode>', 'search | read | gemini')
|
|
244
|
-
.allowUnknownOption(true)
|
|
245
|
-
.action((mode) => {
|
|
246
|
-
(0, hook_guard_1.hookGuard)(mode, process.argv.slice(4));
|
|
247
|
-
});
|
|
248
|
-
if (require.main === module) {
|
|
249
|
-
program.parse();
|
|
250
|
-
}
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.program = void 0;
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
const run_1 = require("./commands/run");
|
|
7
|
+
const stats_1 = require("./commands/stats");
|
|
8
|
+
const explain_1 = require("./commands/explain");
|
|
9
|
+
const export_1 = require("./commands/export");
|
|
10
|
+
const query_1 = require("./commands/query");
|
|
11
|
+
const path_1 = require("./commands/path");
|
|
12
|
+
const map_1 = require("./commands/map");
|
|
13
|
+
const affected_1 = require("./commands/affected");
|
|
14
|
+
const mcp_1 = require("./commands/mcp");
|
|
15
|
+
const tree_1 = require("./commands/tree");
|
|
16
|
+
const wiki_1 = require("./commands/wiki");
|
|
17
|
+
const prs_1 = require("./commands/prs");
|
|
18
|
+
const add_1 = require("./commands/add");
|
|
19
|
+
const diagnose_1 = require("./commands/diagnose");
|
|
20
|
+
const feedback_1 = require("./commands/feedback");
|
|
21
|
+
const global_1 = require("./commands/global");
|
|
22
|
+
const hook_guard_1 = require("./commands/hook-guard");
|
|
23
|
+
const migrate_1 = require("./commands/migrate");
|
|
24
|
+
const update_1 = require("./commands/update");
|
|
25
|
+
const watch_1 = require("./commands/watch");
|
|
26
|
+
const cluster_1 = require("./commands/cluster");
|
|
27
|
+
const merge_1 = require("./commands/merge");
|
|
28
|
+
const diff_1 = require("./commands/diff");
|
|
29
|
+
const history_1 = require("./commands/history");
|
|
30
|
+
const status_1 = require("./commands/status");
|
|
31
|
+
const install_1 = require("./commands/install");
|
|
32
|
+
const hook_1 = require("./commands/hook");
|
|
33
|
+
const program = new commander_1.Command();
|
|
34
|
+
exports.program = program;
|
|
35
|
+
program
|
|
36
|
+
.name('astria')
|
|
37
|
+
.description('Turn any folder into a queryable knowledge graph')
|
|
38
|
+
.version(require('../package.json').version);
|
|
39
|
+
program
|
|
40
|
+
.command('run')
|
|
41
|
+
.description('Run the full pipeline on a directory')
|
|
42
|
+
.argument('<path>', 'Directory to analyze')
|
|
43
|
+
.option('--no-dedup', 'Skip near-duplicate node merging')
|
|
44
|
+
.option('--backend <name>', 'Semantic LLM backend: claude, openai (any OpenAI-compatible), or gemini')
|
|
45
|
+
.option('--model <name>', 'Semantic LLM model name (backend-specific)')
|
|
46
|
+
.option('--wiki', 'Also export a markdown wiki to .astria/wiki')
|
|
47
|
+
.option('--embed', 'Compute local embeddings: similar_to edges + semantic query recall (downloads a small model on first use)')
|
|
48
|
+
.option('--global', 'After building, merge this repo into the cross-repo global graph')
|
|
49
|
+
.option('--as <tag>', 'Repo tag for --global (defaults to the directory name)')
|
|
50
|
+
.action((path, opts) => (0, run_1.runCommand)(path, { ...opts, global: opts.global, as: opts.as }));
|
|
51
|
+
program
|
|
52
|
+
.command('update')
|
|
53
|
+
.description('Run incremental AST-only rebuild')
|
|
54
|
+
.argument('<path>', 'Directory to update')
|
|
55
|
+
.option('--no-dedup', 'Skip near-duplicate node merging')
|
|
56
|
+
.option('--backend <name>', 'Semantic LLM backend: claude, openai (any OpenAI-compatible), or gemini')
|
|
57
|
+
.option('--model <name>', 'Semantic LLM model name (backend-specific)')
|
|
58
|
+
.option('--embed', 'Compute local embeddings: similar_to edges + semantic query recall (downloads a small model on first use)')
|
|
59
|
+
.action(update_1.updateCommand);
|
|
60
|
+
program
|
|
61
|
+
.command('watch')
|
|
62
|
+
.description('Watch for file changes and auto-rebuild')
|
|
63
|
+
.argument('<path>', 'Directory to watch')
|
|
64
|
+
.option('--debounce <ms>', 'Debounce interval in milliseconds', '3000')
|
|
65
|
+
.action(watch_1.watchCommand);
|
|
66
|
+
program
|
|
67
|
+
.command('explain')
|
|
68
|
+
.description('Explain a node and its connections')
|
|
69
|
+
.argument('<node>', 'Node ID or label')
|
|
70
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
71
|
+
.action(explain_1.explainCommand);
|
|
72
|
+
program
|
|
73
|
+
.command('query')
|
|
74
|
+
.description('BFS/DFS graph traversal for a question')
|
|
75
|
+
.argument('<question>', 'Search terms')
|
|
76
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
77
|
+
.option('--dfs', 'Use depth-first search instead of breadth-first')
|
|
78
|
+
.option('--depth <n>', 'Traversal depth', '2')
|
|
79
|
+
.option('--budget <n>', 'Token budget for output', '2000')
|
|
80
|
+
.option('--directed', 'Follow edges only in their stored direction (caller -> callee)')
|
|
81
|
+
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
82
|
+
.option('--cursor <n>', 'Continuation token from a previous truncated query', '0')
|
|
83
|
+
.action(query_1.queryCommand);
|
|
84
|
+
program
|
|
85
|
+
.command('path')
|
|
86
|
+
.description('Find shortest path between two nodes')
|
|
87
|
+
.argument('<source>', 'Source node label')
|
|
88
|
+
.argument('<target>', 'Target node label')
|
|
89
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
90
|
+
.option('--directed', 'Follow edges only in their stored direction (caller -> callee)')
|
|
91
|
+
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
92
|
+
.action(path_1.pathCommand);
|
|
93
|
+
program
|
|
94
|
+
.command('map')
|
|
95
|
+
.description('Repo map: PageRank-ranked files with top symbols, within a token budget')
|
|
96
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
97
|
+
.option('--budget <n>', 'Token budget for output', '2000')
|
|
98
|
+
.option('--detail <level>', 'Fidelity tier: "high" keeps only EXTRACTED/DECLARED facts')
|
|
99
|
+
.action(map_1.mapCommand);
|
|
100
|
+
program
|
|
101
|
+
.command('affected')
|
|
102
|
+
.description('Show the blast radius of a node — everything impacted by changing it')
|
|
103
|
+
.argument('<node>', 'Node ID, label, or source file path')
|
|
104
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
105
|
+
.option('--depth <n>', 'Maximum hops to traverse', '2')
|
|
106
|
+
.option('--relation <type>', 'Only follow one relation (e.g. calls, imports, uses)')
|
|
107
|
+
.action(affected_1.affectedCommand);
|
|
108
|
+
program
|
|
109
|
+
.command('stats')
|
|
110
|
+
.description('Show graph statistics')
|
|
111
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
112
|
+
.action(stats_1.statsCommand);
|
|
113
|
+
program
|
|
114
|
+
.command('export')
|
|
115
|
+
.description('Export graph to JSON, HTML, GraphML, or Cypher (Neo4j)')
|
|
116
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
117
|
+
.option('--out <file>', 'Output file', 'graph.json')
|
|
118
|
+
.option('--format <type>', 'Export format: json, html, graphml, cypher', 'json')
|
|
119
|
+
.option('--mode <mode>', 'HTML visualization mode: standard or large', 'standard')
|
|
120
|
+
.action(export_1.exportCommand);
|
|
121
|
+
program
|
|
122
|
+
.command('cluster-only')
|
|
123
|
+
.description('Run cluster + analyze + report only (no extract/build)')
|
|
124
|
+
.argument('<path>', 'Directory with existing graph')
|
|
125
|
+
.action(cluster_1.clusterCommand);
|
|
126
|
+
program
|
|
127
|
+
.command('merge')
|
|
128
|
+
.description('Merge two graphs into a new output graph')
|
|
129
|
+
.argument('<pathA>', 'First project root')
|
|
130
|
+
.argument('<pathB>', 'Second project root')
|
|
131
|
+
.argument('<outPath>', 'Output project root')
|
|
132
|
+
.action(merge_1.mergeCommand);
|
|
133
|
+
program
|
|
134
|
+
.command('diff')
|
|
135
|
+
.description('Compare two graphs and show differences')
|
|
136
|
+
.argument('<pathA>', 'First project root')
|
|
137
|
+
.argument('<pathB>', 'Second project root')
|
|
138
|
+
.action(diff_1.diffCommand);
|
|
139
|
+
program
|
|
140
|
+
.command('history')
|
|
141
|
+
.description('Show recent query history')
|
|
142
|
+
.option('--limit <n>', 'Number of entries to show', '20')
|
|
143
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
144
|
+
.action(history_1.historyCommand);
|
|
145
|
+
program
|
|
146
|
+
.command('mcp')
|
|
147
|
+
.description('Run an MCP stdio server exposing the graph to AI agents (Claude, etc.)')
|
|
148
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
149
|
+
.action(mcp_1.mcpCommand);
|
|
150
|
+
program
|
|
151
|
+
.command('tree')
|
|
152
|
+
.description('Export a collapsible filesystem tree of all graph symbols (self-contained HTML)')
|
|
153
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
154
|
+
.option('--out <file>', 'Output HTML file', 'tree.html')
|
|
155
|
+
.option('--max-children <n>', 'Max symbols shown per directory', '40')
|
|
156
|
+
.action(tree_1.treeCommand);
|
|
157
|
+
program
|
|
158
|
+
.command('wiki')
|
|
159
|
+
.description('Export a Wikipedia-style markdown wiki (index.md + one article per community and god node)')
|
|
160
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
161
|
+
.option('--out <dir>', 'Output directory', '.astria/wiki')
|
|
162
|
+
.option('--max-nodes <n>', 'Max key concepts listed per community article', '25')
|
|
163
|
+
.option('--format <type>', 'markdown (wiki articles) or obsidian (vault: per-node notes + canvas)', 'markdown')
|
|
164
|
+
.action(wiki_1.wikiCommand);
|
|
165
|
+
program
|
|
166
|
+
.command('prs')
|
|
167
|
+
.description('Map open pull requests onto the knowledge graph (impact + merge-order risk)')
|
|
168
|
+
.argument('[count]', 'Number of PRs to analyze', '20')
|
|
169
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
170
|
+
.option('--conflicts', 'Flag PRs sharing communities (merge-order risk)')
|
|
171
|
+
.action(prs_1.prsCommand);
|
|
172
|
+
program
|
|
173
|
+
.command('add')
|
|
174
|
+
.description('Fetch a URL (arXiv paper, tweet, webpage, image, PDF) into ./raw and update the graph')
|
|
175
|
+
.argument('[url]', 'URL to fetch (required unless --scip/--postgres is given)')
|
|
176
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
177
|
+
.option('--author <name>', 'Author recorded in the saved metadata')
|
|
178
|
+
.option('--contributor <name>', 'Contributor recorded in the saved metadata')
|
|
179
|
+
.option('--scip <file>', 'Ingest a simplified SCIP JSON index instead of fetching a URL')
|
|
180
|
+
.option('--postgres <dsn>', 'Introspect a live PostgreSQL schema (requires psql on PATH) instead of fetching a URL')
|
|
181
|
+
.action(add_1.addCommand);
|
|
182
|
+
program
|
|
183
|
+
.command('status')
|
|
184
|
+
.description('Check graph health and staleness')
|
|
185
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
186
|
+
.action(status_1.statusCommand);
|
|
187
|
+
program
|
|
188
|
+
.command('migrate')
|
|
189
|
+
.description('Migrate a pre-1.0 .graphify layout to .astria (renames the data folder, ignore file, and global store)')
|
|
190
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
191
|
+
.action(migrate_1.migrateCommand);
|
|
192
|
+
(0, install_1.registerInstallCommand)(program);
|
|
193
|
+
(0, hook_1.registerHookCommand)(program);
|
|
194
|
+
program
|
|
195
|
+
.command('diagnose')
|
|
196
|
+
.description('Read-only graph health report: dangling edges, self-loops, duplicates, stubs')
|
|
197
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
198
|
+
.option('--json', 'Machine-readable output')
|
|
199
|
+
.action(diagnose_1.diagnoseCommand);
|
|
200
|
+
program
|
|
201
|
+
.command('save-result')
|
|
202
|
+
.description('Save a Q/A pair into the graph memory for future runs')
|
|
203
|
+
.argument('<question>', 'The question that was asked')
|
|
204
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
205
|
+
.option('--answer <text>', 'The answer to record')
|
|
206
|
+
.option('--answer-file <path>', 'Read the answer from a file')
|
|
207
|
+
.option('--outcome <kind>', 'useful | dead_end | corrected')
|
|
208
|
+
.option('--correction <text>', 'Corrections to the recorded answer')
|
|
209
|
+
.option('--nodes <ids>', 'Comma-separated source node ids this answer cites')
|
|
210
|
+
.action(feedback_1.saveResultCommand);
|
|
211
|
+
program
|
|
212
|
+
.command('reflect')
|
|
213
|
+
.description('Aggregate memory outcomes into .astria/reflections/LESSONS.md')
|
|
214
|
+
.option('--graph <path>', 'Path to project root', '.')
|
|
215
|
+
.action(feedback_1.reflectCommand);
|
|
216
|
+
const globalCmd = program
|
|
217
|
+
.command('global')
|
|
218
|
+
.description('Cross-repo global graph: merge many repo graphs into one queryable store');
|
|
219
|
+
globalCmd
|
|
220
|
+
.command('add')
|
|
221
|
+
.description('Merge a repo graph into the global store (idempotent by tag)')
|
|
222
|
+
.argument('<path>', 'Repo root with a .astria directory')
|
|
223
|
+
.option('--as <tag>', 'Repo tag (defaults to the directory name)')
|
|
224
|
+
.action(global_1.globalAddCommand);
|
|
225
|
+
globalCmd
|
|
226
|
+
.command('remove')
|
|
227
|
+
.description('Remove a repo from the global graph')
|
|
228
|
+
.argument('<tag>', 'Repo tag')
|
|
229
|
+
.action(global_1.globalRemoveCommand);
|
|
230
|
+
globalCmd
|
|
231
|
+
.command('list')
|
|
232
|
+
.description('List repos registered in the global graph')
|
|
233
|
+
.action(() => (0, global_1.globalListCommand)());
|
|
234
|
+
globalCmd
|
|
235
|
+
.command('path')
|
|
236
|
+
.description('Shortest path across repos in the global graph')
|
|
237
|
+
.argument('<source>', 'Source node id or unique label')
|
|
238
|
+
.argument('<target>', 'Target node id or unique label')
|
|
239
|
+
.action(global_1.globalPathCommand);
|
|
240
|
+
program
|
|
241
|
+
.command('hook-guard')
|
|
242
|
+
.description('Editor PreToolUse guard (installed into .claude/settings.json) — internal use')
|
|
243
|
+
.argument('<mode>', 'search | read | gemini')
|
|
244
|
+
.allowUnknownOption(true)
|
|
245
|
+
.action((mode) => {
|
|
246
|
+
(0, hook_guard_1.hookGuard)(mode, process.argv.slice(4));
|
|
247
|
+
});
|
|
248
|
+
if (require.main === module) {
|
|
249
|
+
program.parse();
|
|
250
|
+
}
|
|
251
251
|
//# sourceMappingURL=index.js.map
|
package/dist/install/hooks.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
declare const LEGACY_HOOK_PREFIXES: ({
|
|
2
|
-
js: string;
|
|
3
|
-
shell?: undefined;
|
|
4
|
-
} | {
|
|
5
|
-
shell: string;
|
|
6
|
-
js?: undefined;
|
|
7
|
-
})[];
|
|
8
|
-
export declare function installGitHooks(projectDir: string): string[];
|
|
9
|
-
export declare function uninstallGitHooks(projectDir: string): string[];
|
|
10
|
-
export declare function statusGitHooks(projectDir: string): string[];
|
|
11
|
-
export { LEGACY_HOOK_PREFIXES };
|
|
1
|
+
declare const LEGACY_HOOK_PREFIXES: ({
|
|
2
|
+
js: string;
|
|
3
|
+
shell?: undefined;
|
|
4
|
+
} | {
|
|
5
|
+
shell: string;
|
|
6
|
+
js?: undefined;
|
|
7
|
+
})[];
|
|
8
|
+
export declare function installGitHooks(projectDir: string): string[];
|
|
9
|
+
export declare function uninstallGitHooks(projectDir: string): string[];
|
|
10
|
+
export declare function statusGitHooks(projectDir: string): string[];
|
|
11
|
+
export { LEGACY_HOOK_PREFIXES };
|
|
12
12
|
//# sourceMappingURL=hooks.d.ts.map
|