@nodesify/astria 1.0.0
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 -0
- package/README.md +65 -0
- package/dist/commands/add.d.ts +8 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +34 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/affected.d.ts +6 -0
- package/dist/commands/affected.d.ts.map +1 -0
- package/dist/commands/affected.js +30 -0
- package/dist/commands/affected.js.map +1 -0
- package/dist/commands/cluster.d.ts +2 -0
- package/dist/commands/cluster.d.ts.map +1 -0
- package/dist/commands/cluster.js +51 -0
- package/dist/commands/cluster.js.map +1 -0
- package/dist/commands/diagnose.d.ts +5 -0
- package/dist/commands/diagnose.d.ts.map +1 -0
- package/dist/commands/diagnose.js +20 -0
- package/dist/commands/diagnose.js.map +1 -0
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +36 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/explain.d.ts +4 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +38 -0
- package/dist/commands/explain.js.map +1 -0
- package/dist/commands/export.d.ts +7 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +33 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/feedback.d.ts +12 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +41 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/global.d.ts +7 -0
- package/dist/commands/global.d.ts.map +1 -0
- package/dist/commands/global.js +61 -0
- package/dist/commands/global.js.map +1 -0
- package/dist/commands/history.d.ts +5 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +28 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/hook-guard.d.ts +2 -0
- package/dist/commands/hook-guard.d.ts.map +1 -0
- package/dist/commands/hook-guard.js +145 -0
- package/dist/commands/hook-guard.js.map +1 -0
- package/dist/commands/hook.d.ts +3 -0
- package/dist/commands/hook.d.ts.map +1 -0
- package/dist/commands/hook.js +53 -0
- package/dist/commands/hook.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +40 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/map.d.ts +6 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +16 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/mcp.d.ts +4 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +15 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/merge.d.ts +2 -0
- package/dist/commands/merge.d.ts.map +1 -0
- package/dist/commands/merge.js +51 -0
- package/dist/commands/merge.js.map +1 -0
- package/dist/commands/migrate.d.ts +4 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +75 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/path.d.ts +6 -0
- package/dist/commands/path.d.ts.map +1 -0
- package/dist/commands/path.js +19 -0
- package/dist/commands/path.js.map +1 -0
- package/dist/commands/prs.d.ts +5 -0
- package/dist/commands/prs.d.ts.map +1 -0
- package/dist/commands/prs.js +133 -0
- package/dist/commands/prs.js.map +1 -0
- package/dist/commands/query.d.ts +10 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +22 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/run.d.ts +10 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +69 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/stats.d.ts +4 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +18 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +57 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tree.d.ts +6 -0
- package/dist/commands/tree.d.ts.map +1 -0
- package/dist/commands/tree.js +53 -0
- package/dist/commands/tree.js.map +1 -0
- package/dist/commands/update.d.ts +7 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +66 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/watch.d.ts +4 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +114 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/commands/wiki.d.ts +7 -0
- package/dist/commands/wiki.d.ts.map +1 -0
- package/dist/commands/wiki.js +60 -0
- package/dist/commands/wiki.js.map +1 -0
- package/dist/graphify.node +4 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +251 -0
- package/dist/index.js.map +1 -0
- package/dist/install/hooks.d.ts +12 -0
- package/dist/install/hooks.d.ts.map +1 -0
- package/dist/install/hooks.js +307 -0
- package/dist/install/hooks.js.map +1 -0
- package/dist/install/index.d.ts +3 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +362 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/markdown-inject.d.ts +7 -0
- package/dist/install/markdown-inject.d.ts.map +1 -0
- package/dist/install/markdown-inject.js +178 -0
- package/dist/install/markdown-inject.js.map +1 -0
- package/dist/install/platforms.d.ts +13 -0
- package/dist/install/platforms.d.ts.map +1 -0
- package/dist/install/platforms.js +130 -0
- package/dist/install/platforms.js.map +1 -0
- package/dist/install/settings-inject.d.ts +18 -0
- package/dist/install/settings-inject.d.ts.map +1 -0
- package/dist/install/settings-inject.js +425 -0
- package/dist/install/settings-inject.js.map +1 -0
- package/dist/native.d.ts +32 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +107 -0
- package/dist/native.js.map +1 -0
- package/package.json +72 -0
- package/skills/skill-aider.md +40 -0
- package/skills/skill-codex.md +46 -0
- package/skills/skill-copilot.md +46 -0
- package/skills/skill-cursor.md +39 -0
- package/skills/skill-gemini.md +46 -0
- package/skills/skill-kiro.md +39 -0
- package/skills/skill-opencode.md +44 -0
- package/skills/skill-trae.md +46 -0
- package/skills/skill.md +266 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nodesify
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @nodesify/astria
|
|
2
|
+
|
|
3
|
+
Turn any folder into a queryable knowledge graph.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @nodesify/astria
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js >= 20. No Rust toolchain needed — ships prebuilt native binaries for macOS, Linux, and Windows.
|
|
12
|
+
|
|
13
|
+
> **Migrating from `@nodesify/graphify`?** Run `astria migrate` once (renames `.graphify/` → `.astria/` and the global store), then `astria install` to refresh AI-tool skills and hooks. `GRAPHIFY_*` env vars keep working; `ASTRIA_*` takes precedence.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
astria run <path> # Full pipeline: detect → extract → build → cluster → analyze → report
|
|
19
|
+
astria update <path> # Incremental rebuild (only changed files)
|
|
20
|
+
astria watch <path> [--debounce 3000] # Watch for file changes, auto-rebuild
|
|
21
|
+
astria explain <node> [--graph .] # Explain a node and its connections
|
|
22
|
+
astria query <question> [--dfs] [--depth 2] [--budget 2000] [--graph .] # BFS/DFS traversal
|
|
23
|
+
astria path <A> <B> [--graph .] # Shortest path between two concepts
|
|
24
|
+
astria stats [--graph .] # Node/edge/community counts
|
|
25
|
+
astria export [--graph .] [--out graph.json] [--format json|html|graphml] [--mode standard|large] # Export graph; HTML defaults to standard
|
|
26
|
+
astria merge <pathA> <pathB> <outPath> # Merge two graphs
|
|
27
|
+
astria diff <pathA> <pathB> # Compare two graphs
|
|
28
|
+
astria history [--limit 20] [--graph .] # Show recent query history
|
|
29
|
+
astria install [--platform claude] # Install skill files for AI coding assistants
|
|
30
|
+
astria hook install # Install git post-commit/post-checkout hooks
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Running `astria run .` creates `.astria/` with:
|
|
34
|
+
|
|
35
|
+
- `db.sqlite` — the graph database
|
|
36
|
+
- `graph.json` — full graph export
|
|
37
|
+
- `graph_report.md` — report with hub nodes, communities, surprising connections
|
|
38
|
+
|
|
39
|
+
### HTML visualization modes
|
|
40
|
+
|
|
41
|
+
HTML export defaults to `--mode standard`, matching the original Graphify viewer's 5,000-node safety limit. Graphs above that limit require an explicit large-graph export:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
astria export --graph . --format html --mode large --out graph-view.html
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Large mode uses precomputed positions and disabled physics, starts with key nodes visible, and provides debounced search plus a “Show all nodes” toggle. The `--mode` option only affects HTML export; JSON and GraphML remain unchanged.
|
|
48
|
+
|
|
49
|
+
## Supported languages
|
|
50
|
+
|
|
51
|
+
Python, JavaScript, TypeScript, Rust, Go, Java, C, C++, Ruby, Swift, Scala, PHP, C#, Lua, Haskell, Elixir, Bash, Dart, Zig, CSS.
|
|
52
|
+
|
|
53
|
+
## AI platform integration
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
astria install --platform claude # or: codex, gemini, cursor, copilot, aider, opencode, kiro, trae, zcode
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## .astriaignore
|
|
60
|
+
|
|
61
|
+
Place a `.astriaignore` file in your project root (gitignore syntax) to exclude files from the graph.
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAEA,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,iBAiCA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addCommand = addCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function addCommand(url, opts) {
|
|
6
|
+
if (!url && !opts.scip && !opts.postgres) {
|
|
7
|
+
console.error('Error: provide a URL, or --scip <file>, or --postgres <dsn>');
|
|
8
|
+
process.exitCode = 1;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
if (opts.scip) {
|
|
13
|
+
const counts = (0, native_1.ingestScip)(opts.graph, opts.scip);
|
|
14
|
+
console.log(`SCIP index ingested: ${counts.nodesAdded} nodes, ${counts.edgesAdded} edges`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (opts.postgres) {
|
|
18
|
+
const counts = (0, native_1.ingestPostgres)(opts.graph, opts.postgres);
|
|
19
|
+
console.log(`Postgres schema ingested: ${counts.nodesAdded} nodes, ${counts.edgesAdded} edges`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(`Fetching ${url}...`);
|
|
23
|
+
const result = (0, native_1.ingestUrl)(opts.graph, url, opts.author, opts.contributor);
|
|
24
|
+
console.log(`Saved: ${result.savedPath}`);
|
|
25
|
+
if (result.graphUpdated) {
|
|
26
|
+
console.log('Graph updated with the new content.');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
console.error(`Error: ${e.message || e}`);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":";;AAEA,gCAuCC;AAzCD,sCAAkE;AAE3D,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,IAM7C;IACC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAEzC,OAAO,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAE7E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QA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AAEA,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,iBAuBA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.affectedCommand = affectedCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function affectedCommand(node, opts) {
|
|
6
|
+
try {
|
|
7
|
+
const depth = parseInt(opts.depth, 10) || 2;
|
|
8
|
+
const result = (0, native_1.affectedNode)(opts.graph, node, depth, opts.relation);
|
|
9
|
+
if (result.total === 0) {
|
|
10
|
+
console.log(`Nothing references "${result.seedLabel}" — no blast radius.`);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.log(`Blast radius of "${result.seedLabel}" (depth ≤ ${depth}): ${result.total} node(s)`);
|
|
14
|
+
console.log();
|
|
15
|
+
let lastDepth = 0;
|
|
16
|
+
for (const hit of result.hits) {
|
|
17
|
+
if (hit.depth !== lastDepth) {
|
|
18
|
+
lastDepth = hit.depth;
|
|
19
|
+
console.log(` depth ${hit.depth}:`);
|
|
20
|
+
}
|
|
21
|
+
const via = hit.viaFile ? ` [${hit.viaFile}]` : '';
|
|
22
|
+
console.log(` ${hit.label} (${hit.relation})${via}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error(`Error: ${e.message || e}`);
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=affected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affected.js","sourceRoot":"","sources":["../../src/commands/affected.ts"],"names":[],"mappings":";;AAEA,0CA2BC;AA7BD,sCAAyC;AAElC,KAAK,UAAU,eA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,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":"AAGA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,iBAUhD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.clusterCommand = clusterCommand;
|
|
37
|
+
const pathMod = __importStar(require("path"));
|
|
38
|
+
const native_1 = require("../native");
|
|
39
|
+
async function clusterCommand(path) {
|
|
40
|
+
try {
|
|
41
|
+
console.log(`Running cluster + analyze on: ${path}`);
|
|
42
|
+
const result = (0, native_1.clusterOnly)(path);
|
|
43
|
+
console.log(`Communities: ${result.communities}`);
|
|
44
|
+
console.log(`Report updated at: ${pathMod.join(path, '.astria', 'graph_report.md')}`);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
console.error(`Error: ${e.message || e}`);
|
|
48
|
+
process.exitCode = 1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=cluster.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wCAUC;AAbD,8CAAgC;AAChC,sCAAwC;AAEjC,KAAK,UAAU,cAAc,CAAC,IAAY;IAC/C,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,sBAAsB,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACxF,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAEA,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,iBAa5E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diagnoseCommand = diagnoseCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function diagnoseCommand(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const report = (0, native_1.diagnoseGraph)(opts.graph);
|
|
8
|
+
if (opts.json) {
|
|
9
|
+
const { text: _text, ...rest } = report;
|
|
10
|
+
console.log(JSON.stringify(rest, null, 2));
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.log(report.text);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.error(`Error: ${e.message || e}`);
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=diagnose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":";;AAEA,0CAaC;AAfD,sCAA0C;AAEnC,KAAK,UAAU,eAAe,CAAC,IAAuC;IAC3E,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3C,OAAO;QACT,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAEA,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBA+B7D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diffCommand = diffCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function diffCommand(pathA, pathB) {
|
|
6
|
+
try {
|
|
7
|
+
const result = (0, native_1.diffGraphs)(pathA, pathB);
|
|
8
|
+
console.log(`Nodes added: ${result.nodesAdded}`);
|
|
9
|
+
console.log(`Nodes removed: ${result.nodesRemoved}`);
|
|
10
|
+
console.log(`Edges added: ${result.edgesAdded}`);
|
|
11
|
+
console.log(`Edges removed: ${result.edgesRemoved}`);
|
|
12
|
+
if (result.addedNodeLabels.length > 0) {
|
|
13
|
+
console.log('\nAdded nodes:');
|
|
14
|
+
for (const label of result.addedNodeLabels.slice(0, 20)) {
|
|
15
|
+
console.log(` + ${label}`);
|
|
16
|
+
}
|
|
17
|
+
if (result.addedNodeLabels.length > 20) {
|
|
18
|
+
console.log(` ... and ${result.addedNodeLabels.length - 20} more`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (result.removedNodeLabels.length > 0) {
|
|
22
|
+
console.log('\nRemoved nodes:');
|
|
23
|
+
for (const label of result.removedNodeLabels.slice(0, 20)) {
|
|
24
|
+
console.log(` - ${label}`);
|
|
25
|
+
}
|
|
26
|
+
if (result.removedNodeLabels.length > 20) {
|
|
27
|
+
console.log(` ... and ${result.removedNodeLabels.length - 20} more`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
console.error(`Error: ${e.message || e}`);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":";;AAEA,kCA+BC;AAjCD,sCAAuC;AAEhC,KAAK,UAAU,WAAW,CAAC,KAAa,EAAE,KAAa;IAC5D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAErD,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YAC9B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,C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use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.explainCommand = explainCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function explainCommand(node, opts) {
|
|
6
|
+
try {
|
|
7
|
+
const result = (0, native_1.explainNode)(opts.graph, node);
|
|
8
|
+
if (!result) {
|
|
9
|
+
console.log(`Node "${node}" not found`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
console.log(`Node: ${result.label}`);
|
|
13
|
+
console.log(` ID: ${result.id}`);
|
|
14
|
+
console.log(` File: ${result.sourceFile}${result.sourceLine != null ? `:${result.sourceLine}` : ''}`);
|
|
15
|
+
if (result.community !== null && result.community !== undefined) {
|
|
16
|
+
console.log(` Community: ${result.community}`);
|
|
17
|
+
}
|
|
18
|
+
if (result.hyperedges && result.hyperedges.length > 0) {
|
|
19
|
+
console.log(` Hyperedges: ${result.hyperedges.join(', ')}`);
|
|
20
|
+
}
|
|
21
|
+
if (result.neighbors.length > 0) {
|
|
22
|
+
console.log(`\nConnections (${result.neighborCount}):`);
|
|
23
|
+
for (const n of result.neighbors) {
|
|
24
|
+
const loc = n.neighborLine != null ? ` (${n.neighborFile}:${n.neighborLine})` : '';
|
|
25
|
+
console.log(` --> ${n.neighborLabel} [${n.relation}] [${n.confidence}]${loc}`);
|
|
26
|
+
}
|
|
27
|
+
if (result.neighborCount > result.neighbors.length) {
|
|
28
|
+
const remaining = result.neighborCount - result.neighbors.length;
|
|
29
|
+
console.log(` ... and ${remaining} more`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
console.error(`Error: ${e.message || e}`);
|
|
35
|
+
process.exitCode = 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=explain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../src/commands/explain.ts"],"names":[],"m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,GAAG,CAAC,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnF,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,QAAQ,MAAM,CAAC,CAAC,UAAU,IAAI,GAAG,EAAE,CAAC,CAAC;YAClF,CAAC;YACD,IAAI,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;gBACnD,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;gBACjE,OAAO,CAAC,GAAG,CAAC,aAAa,SAAS,OAAO,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,iBAwBtG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportCommand = exportCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function exportCommand(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const format = opts.format || 'json';
|
|
8
|
+
if (format === 'html') {
|
|
9
|
+
const outPath = opts.out.replace(/\.json$/, '.html');
|
|
10
|
+
(0, native_1.exportHtmlCmd)(opts.graph, outPath, opts.mode || 'standard');
|
|
11
|
+
console.log(`Exported HTML to: ${outPath}`);
|
|
12
|
+
}
|
|
13
|
+
else if (format === 'graphml') {
|
|
14
|
+
const outPath = opts.out.replace(/\.json$/, '.graphml');
|
|
15
|
+
(0, native_1.exportGraphmlCmd)(opts.graph, outPath);
|
|
16
|
+
console.log(`Exported GraphML to: ${outPath}`);
|
|
17
|
+
}
|
|
18
|
+
else if (format === 'cypher') {
|
|
19
|
+
const outPath = opts.out.replace(/\.json$/, '.cypher');
|
|
20
|
+
const statements = (0, native_1.exportCypherCmd)(opts.graph, outPath);
|
|
21
|
+
console.log(`Exported Cypher to: ${outPath} (${statements} MERGE statements — idempotent, safe to re-run)`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
(0, native_1.exportJsonCmd)(opts.graph, opts.out);
|
|
25
|
+
console.log(`Exported JSON to: ${opts.out}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
console.error(`Error: ${e.message || e}`);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":";;AAEA,sCAwBC;AA1BD,sCAA4F;AAErF,KAAK,UAAU,aAAa,CAAC,IAAmE;IACrG,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAErC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACrD,IAAA,sBAAa,EAAC,IA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?: string;
|
|
5
|
+
outcome?: string;
|
|
6
|
+
correction?: string;
|
|
7
|
+
nodes?: string;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function reflectCommand(opts: {
|
|
10
|
+
graph: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/commands/feedback.ts"],"names":[],"mappings":"AAEA,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,iBA+BF;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,iBAQ3D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveResultCommand = saveResultCommand;
|
|
4
|
+
exports.reflectCommand = reflectCommand;
|
|
5
|
+
const native_1 = require("../native");
|
|
6
|
+
async function saveResultCommand(question, opts) {
|
|
7
|
+
try {
|
|
8
|
+
let answer = opts.answer;
|
|
9
|
+
if (!answer && opts.answerFile) {
|
|
10
|
+
answer = require('fs').readFileSync(opts.answerFile, 'utf-8');
|
|
11
|
+
}
|
|
12
|
+
if (!answer) {
|
|
13
|
+
console.error('Error: provide --answer or --answer-file');
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const sourceNodes = (opts.nodes || '')
|
|
18
|
+
.split(',')
|
|
19
|
+
.map((s) => s.trim())
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
const saved = (0, native_1.saveQueryResult)(opts.graph, question, answer, opts.outcome, opts.correction, sourceNodes.length > 0 ? sourceNodes : undefined);
|
|
22
|
+
console.log(`Memory saved: ${saved.memoryPath}`);
|
|
23
|
+
console.log(`Graph node: ${saved.nodeId}`);
|
|
24
|
+
console.log('Run `astria update .` to re-embed and re-cluster.');
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
console.error(`Error: ${e.message || e}`);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function reflectCommand(opts) {
|
|
32
|
+
try {
|
|
33
|
+
const lessons = (0, native_1.reflectGraph)(opts.graph);
|
|
34
|
+
console.log(lessons);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(`Error: ${e.message || e}`);
|
|
38
|
+
process.exitCode = 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=feedback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../../src/commands/feedback.ts"],"names":[],"mappings":";;AAEA,8CAwCC;AAED,wCAQC;AApDD,sCAA0D;AAEnD,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,IAOC;IAED,IAAI,CAAC;QACH,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/B,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAChE,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC1D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAC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
+
export declare function globalAddCommand(path: string, opts: {
|
|
2
|
+
as?: string;
|
|
3
|
+
}): Promise<void>;
|
|
4
|
+
export declare function globalRemoveCommand(tag: string): Promise<void>;
|
|
5
|
+
export declare function globalListCommand(): Promise<void>;
|
|
6
|
+
export declare function globalPathCommand(source: string, target: string): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=global.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/commands/global.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,iBAYzE;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,iBAQpD;AAED,wBAAsB,iBAAiB,kBAetC;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAYrE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.globalAddCommand = globalAddCommand;
|
|
4
|
+
exports.globalRemoveCommand = globalRemoveCommand;
|
|
5
|
+
exports.globalListCommand = globalListCommand;
|
|
6
|
+
exports.globalPathCommand = globalPathCommand;
|
|
7
|
+
const native_1 = require("../native");
|
|
8
|
+
async function globalAddCommand(path, opts) {
|
|
9
|
+
try {
|
|
10
|
+
const result = (0, native_1.globalAdd)(path, opts.as);
|
|
11
|
+
console.log(`Repo '${result.tag}' merged into the global graph.`);
|
|
12
|
+
console.log(`Nodes: ${result.nodesAdded} | Edges: ${result.edgesAdded} | ` +
|
|
13
|
+
`same_type_as: ${result.sameTypeEdges} | cross-repo calls: ${result.crossRepoCallEdges}`);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.error(`Error: ${e.message || e}`);
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function globalRemoveCommand(tag) {
|
|
21
|
+
try {
|
|
22
|
+
const removed = (0, native_1.globalRemove)(tag);
|
|
23
|
+
console.log(`Removed '${tag}' (${removed} nodes) from the global graph.`);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error(`Error: ${e.message || e}`);
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function globalListCommand() {
|
|
31
|
+
try {
|
|
32
|
+
const entries = (0, native_1.globalList)();
|
|
33
|
+
if (entries.length === 0) {
|
|
34
|
+
console.log('Global graph is empty. Add repos with: astria global add <path>');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
console.log('Global graph repos:');
|
|
38
|
+
for (const e of entries) {
|
|
39
|
+
console.log(` ${e.tag} — ${e.nodes} nodes, ${e.edges} edges`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
console.error(`Error: ${e.message || e}`);
|
|
44
|
+
process.exitCode = 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function globalPathCommand(source, target) {
|
|
48
|
+
try {
|
|
49
|
+
const result = (0, native_1.globalPath)(source, target);
|
|
50
|
+
if (!result) {
|
|
51
|
+
console.log(`No path found between '${source}' and '${target}'.`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
console.log(result.replace(/ --(?=[^\s])/g, ' --\n '));
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
console.error(`Error: ${e.message || e}`);
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/commands/global.ts"],"names":[],"mappings":";;AAEA,4CAYC;AAED,kDAQC;AAED,8CAeC;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
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.historyCommand = historyCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function historyCommand(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const limit = parseInt(opts.limit || '20', 10);
|
|
8
|
+
const entries = (0, native_1.graphHistory)(opts.graph, limit);
|
|
9
|
+
if (entries.length === 0) {
|
|
10
|
+
console.log('No query history found.');
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.log(`Recent queries (showing ${entries.length}):\n`);
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
console.log(`[#${entry.id}] ${entry.question}`);
|
|
16
|
+
if (entry.answer) {
|
|
17
|
+
const preview = entry.answer.split('\n')[0];
|
|
18
|
+
console.log(` ${preview.substring(0, 100)}${preview.length > 100 ? '...' : ''}`);
|
|
19
|
+
}
|
|
20
|
+
console.log();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(`Error: ${e.message || e}`);
|
|
25
|
+
process.exitCode = 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=history.js.map
|