@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/commands/explain.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"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
|
-
}
|
|
1
|
+
"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
38
|
//# sourceMappingURL=explain.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function exportCommand(opts: {
|
|
2
|
-
graph: string;
|
|
3
|
-
out: string;
|
|
4
|
-
format: string;
|
|
5
|
-
mode?: string;
|
|
6
|
-
}): Promise<void>;
|
|
1
|
+
export declare function exportCommand(opts: {
|
|
2
|
+
graph: string;
|
|
3
|
+
out: string;
|
|
4
|
+
format: string;
|
|
5
|
+
mode?: string;
|
|
6
|
+
}): Promise<void>;
|
|
7
7
|
//# sourceMappingURL=export.d.ts.map
|
package/dist/commands/export.js
CHANGED
|
@@ -1,33 +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
|
-
}
|
|
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
33
|
//# sourceMappingURL=export.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare function saveResultCommand(question: string, opts: {
|
|
2
|
-
graph: string;
|
|
3
|
-
answer?: string;
|
|
4
|
-
answerFile?: 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>;
|
|
1
|
+
export declare function saveResultCommand(question: string, opts: {
|
|
2
|
+
graph: string;
|
|
3
|
+
answer?: string;
|
|
4
|
+
answerFile?: 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
12
|
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -1,41 +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
|
-
}
|
|
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
41
|
//# sourceMappingURL=feedback.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
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>;
|
|
1
|
+
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
7
|
//# sourceMappingURL=global.d.ts.map
|
package/dist/commands/global.js
CHANGED
|
@@ -1,61 +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
|
-
}
|
|
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
61
|
//# sourceMappingURL=global.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function historyCommand(opts: {
|
|
2
|
-
limit: string;
|
|
3
|
-
graph: string;
|
|
4
|
-
}): Promise<void>;
|
|
1
|
+
export declare function historyCommand(opts: {
|
|
2
|
+
limit: string;
|
|
3
|
+
graph: string;
|
|
4
|
+
}): Promise<void>;
|
|
5
5
|
//# sourceMappingURL=history.d.ts.map
|
package/dist/commands/history.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"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
|
-
}
|
|
1
|
+
"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
28
|
//# sourceMappingURL=history.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function hookGuard(mode: string, _args: string[]): void;
|
|
1
|
+
export declare function hookGuard(mode: string, _args: string[]): void;
|
|
2
2
|
//# sourceMappingURL=hook-guard.d.ts.map
|