@nodesify/astria 1.0.11 → 1.1.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/dist/commands/cluster.d.ts +7 -1
- package/dist/commands/cluster.d.ts.map +1 -1
- package/dist/commands/cluster.js +9 -2
- package/dist/commands/cluster.js.map +1 -1
- package/dist/commands/digest.d.ts +7 -0
- package/dist/commands/digest.d.ts.map +1 -0
- package/dist/commands/digest.js +161 -0
- package/dist/commands/digest.js.map +1 -0
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +14 -2
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/health.d.ts +1 -0
- package/dist/commands/health.d.ts.map +1 -1
- package/dist/commands/health.js +29 -19
- package/dist/commands/health.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +11 -1
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/map.d.ts.map +1 -1
- package/dist/commands/map.js +2 -1
- package/dist/commands/map.js.map +1 -1
- package/dist/commands/mcp.d.ts +17 -2
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +16 -0
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/merge-driver.d.ts +7 -0
- package/dist/commands/merge-driver.d.ts.map +1 -0
- package/dist/commands/merge-driver.js +186 -0
- package/dist/commands/merge-driver.js.map +1 -0
- package/dist/commands/merge-gate.d.ts +14 -0
- package/dist/commands/merge-gate.d.ts.map +1 -0
- package/dist/commands/merge-gate.js +220 -0
- package/dist/commands/merge-gate.js.map +1 -0
- package/dist/commands/merge.d.ts +4 -1
- package/dist/commands/merge.d.ts.map +1 -1
- package/dist/commands/merge.js +4 -3
- package/dist/commands/merge.js.map +1 -1
- package/dist/commands/prs.d.ts +3 -0
- package/dist/commands/prs.d.ts.map +1 -1
- package/dist/commands/prs.js +188 -13
- package/dist/commands/prs.js.map +1 -1
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +2 -1
- package/dist/commands/query.js.map +1 -1
- package/dist/commands/stats.d.ts.map +1 -1
- package/dist/commands/stats.js +1 -0
- package/dist/commands/stats.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +83 -49
- package/dist/commands/watch.js.map +1 -1
- package/dist/defaults.d.ts +2 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +7 -0
- package/dist/defaults.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -14
- package/dist/index.js.map +1 -1
- package/dist/install/index.d.ts +1 -0
- package/dist/install/index.d.ts.map +1 -1
- package/dist/install/index.js +64 -0
- package/dist/install/index.js.map +1 -1
- package/dist/install/settings-inject.d.ts.map +1 -1
- package/dist/install/settings-inject.js +3 -3
- package/dist/install/settings-inject.js.map +1 -1
- package/dist/native.d.ts +42 -40
- package/dist/native.d.ts.map +1 -1
- package/dist/native.js +56 -85
- package/dist/native.js.map +1 -1
- package/package.json +10 -8
- package/dist/commands/migrate.d.ts +0 -4
- package/dist/commands/migrate.d.ts.map +0 -1
- package/dist/commands/migrate.js +0 -75
- package/dist/commands/migrate.js.map +0 -1
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ClusterOnlyOptions {
|
|
2
|
+
/** Community granularity, 0.0–1.0. Higher → more, smaller communities. */
|
|
3
|
+
resolution?: string;
|
|
4
|
+
/** Keep high-degree hubs from gluing communities together. */
|
|
5
|
+
excludeHubs?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function clusterCommand(path: string, opts?: ClusterOnlyOptions): Promise<void>;
|
|
2
8
|
//# sourceMappingURL=cluster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":"AAGA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cluster.d.ts","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,iBAiB/E"}
|
package/dist/commands/cluster.js
CHANGED
|
@@ -36,10 +36,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.clusterCommand = clusterCommand;
|
|
37
37
|
const pathMod = __importStar(require("path"));
|
|
38
38
|
const native_1 = require("../native");
|
|
39
|
-
async function clusterCommand(path) {
|
|
39
|
+
async function clusterCommand(path, opts = {}) {
|
|
40
40
|
try {
|
|
41
|
+
let resolution;
|
|
42
|
+
if (opts.resolution !== undefined) {
|
|
43
|
+
resolution = parseFloat(opts.resolution);
|
|
44
|
+
if (!Number.isFinite(resolution) || resolution < 0 || resolution > 1) {
|
|
45
|
+
throw new Error('--resolution must be a number between 0.0 and 1.0');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
41
48
|
console.log(`Running cluster + analyze on: ${path}`);
|
|
42
|
-
const result = (0, native_1.clusterOnly)(path);
|
|
49
|
+
const result = (0, native_1.clusterOnly)(path, resolution, opts.excludeHubs === true);
|
|
43
50
|
console.log(`Communities: ${result.communities}`);
|
|
44
51
|
console.log(`Report updated at: ${pathMod.join(path, '.astria', 'graph_report.md')}`);
|
|
45
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../src/commands/cluster.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;CAChB;AAqBD,wBAAsB,aAAa,CAAC,IAAI,EAAE,aAAa,iBAgGtD"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Engineering digest: the OSS-side artifact of the hosted tier's "weekly
|
|
3
|
+
// engineering digest". Reads the current graph — stats, health, hub
|
|
4
|
+
// concentration, community sizes, build provenance, and the cost report —
|
|
5
|
+
// and renders a shareable markdown brief (stdout or .astria/digest.md).
|
|
6
|
+
// Deterministic and LLM-free; cron/CI friendly:
|
|
7
|
+
// astria digest --out .astria/digest.md
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.digestCommand = digestCommand;
|
|
43
|
+
const pathMod = __importStar(require("path"));
|
|
44
|
+
const fs_1 = require("fs");
|
|
45
|
+
const native_1 = require("../native");
|
|
46
|
+
function healthEmoji(grade) {
|
|
47
|
+
switch (grade.toUpperCase()) {
|
|
48
|
+
case 'A': return '🟢';
|
|
49
|
+
case 'B': return '🟢';
|
|
50
|
+
case 'C': return '🟡';
|
|
51
|
+
case 'D': return '🟠';
|
|
52
|
+
default: return '🔴';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function relativeTime(unixSeconds) {
|
|
56
|
+
const t = Number(unixSeconds);
|
|
57
|
+
if (!Number.isFinite(t) || t <= 0)
|
|
58
|
+
return 'unknown';
|
|
59
|
+
const minutes = Math.round((Date.now() / 1000 - t) / 60);
|
|
60
|
+
if (minutes < 60)
|
|
61
|
+
return `${minutes} min ago`;
|
|
62
|
+
if (minutes < 60 * 24)
|
|
63
|
+
return `${Math.round(minutes / 60)} h ago`;
|
|
64
|
+
return `${Math.round(minutes / (60 * 24))} days ago`;
|
|
65
|
+
}
|
|
66
|
+
async function digestCommand(opts) {
|
|
67
|
+
try {
|
|
68
|
+
const stats = (0, native_1.graphStats)(opts.graph);
|
|
69
|
+
const health = (0, native_1.healthReport)(opts.graph);
|
|
70
|
+
const hubs = (0, native_1.godNodes)(opts.graph);
|
|
71
|
+
const communities = (0, native_1.listCommunities)(opts.graph);
|
|
72
|
+
const build = (0, native_1.graphBuildInfo)(opts.graph);
|
|
73
|
+
const hubShare = stats.nodeCount > 0 ? hubs.length / stats.nodeCount : 0;
|
|
74
|
+
const topCommunities = (communities.communities || [])
|
|
75
|
+
.slice(0, 5)
|
|
76
|
+
.map((c) => `| ${c.label} | ${c.size} | ${c.cohesion ?? '-'} | ${c.labelSource === 'llm' ? 'LLM' : 'hub'} |`);
|
|
77
|
+
let costBlock = '';
|
|
78
|
+
const costPath = pathMod.join(opts.graph, '.astria', 'cost.json');
|
|
79
|
+
if ((0, fs_1.existsSync)(costPath)) {
|
|
80
|
+
try {
|
|
81
|
+
const cost = JSON.parse((0, fs_1.readFileSync)(costPath, 'utf-8'));
|
|
82
|
+
const cum = cost.cumulative || {};
|
|
83
|
+
costBlock = [
|
|
84
|
+
'',
|
|
85
|
+
'### LLM spend',
|
|
86
|
+
'',
|
|
87
|
+
`- Lifetime semantic enrichment: ${cum.input_tokens ?? 0} input + ${cum.output_tokens ?? 0} output tokens across ${cum.runs ?? 0} completed runs (${cum.api_calls ?? 0} API calls)`,
|
|
88
|
+
cost.estimated_cost_usd
|
|
89
|
+
? `- Estimated cost: $${Number(cost.estimated_cost_usd.cumulative).toFixed(4)} (operator-supplied rates)`
|
|
90
|
+
: '- Estimated cost: n/a (set ASTRIA_COST_*_PER_MTOK for a dollar estimate)',
|
|
91
|
+
].join('\n');
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// unreadable cost.json — omit the block
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const markdown = `# Engineering digest — ${new Date().toISOString().slice(0, 10)}
|
|
98
|
+
|
|
99
|
+
## Graph overview
|
|
100
|
+
|
|
101
|
+
| Metric | Value |
|
|
102
|
+
|--------|-------|
|
|
103
|
+
| Nodes | ${stats.nodeCount} |
|
|
104
|
+
| Edges | ${stats.edgeCount} |
|
|
105
|
+
| Communities | ${stats.communityCount} |
|
|
106
|
+
| Files tracked | ${stats.fileCount} |
|
|
107
|
+
| Last built | ${relativeTime(build?.graphPublishedAt)} by astria ${build?.astriaVersion ?? 'n/a'} |
|
|
108
|
+
|
|
109
|
+
## Code health
|
|
110
|
+
|
|
111
|
+
${healthEmoji(health.grade)} **Score ${health.score}/100 (grade ${health.grade})**
|
|
112
|
+
|
|
113
|
+
- Unreachable-symbol candidates: ${health.deadCode.length}
|
|
114
|
+
- Circular file dependencies: ${health.cycles.length}
|
|
115
|
+
- Hub concentration: ${hubs.length} hubs (${(hubShare * 100).toFixed(1)}% of nodes)
|
|
116
|
+
|
|
117
|
+
${health.cycles.length ? `- ⚠️ ${Math.min(health.cycles.length, 5)} cycle(s), e.g. ${health.cycles.slice(0, 3).join('; ')}` : '- No file cycles detected'}
|
|
118
|
+
|
|
119
|
+
## Where the complexity lives
|
|
120
|
+
|
|
121
|
+
Top hubs (what everything routes through — change with care):
|
|
122
|
+
|
|
123
|
+
${hubs.slice(0, 5).map((h) => `- \`${h.label}\` — degree ${h.degree}${h.community ? ` (${h.community})` : ''}`).join('\n') || '- none'}
|
|
124
|
+
|
|
125
|
+
Largest communities:
|
|
126
|
+
|
|
127
|
+
| Community | Size | Cohesion | Label source |
|
|
128
|
+
|-----------|------|----------|--------------|
|
|
129
|
+
${topCommunities.join('\n') || '| — | — | — | — |'}
|
|
130
|
+
${costBlock}
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
*Generated by \`astria digest\` — deterministic, from the local knowledge graph. Schedule it (cron/CI) for a weekly cadence, or read it via the hosted tier at app.graphify.com.*
|
|
134
|
+
`;
|
|
135
|
+
if (opts.json) {
|
|
136
|
+
console.log(JSON.stringify({
|
|
137
|
+
generated_at: new Date().toISOString(),
|
|
138
|
+
stats,
|
|
139
|
+
health: { score: health.score, grade: health.grade, dead_code: health.deadCode.length, cycles: health.cycles.length },
|
|
140
|
+
hubs: hubs.slice(0, 5),
|
|
141
|
+
communities: (communities.communities || []).slice(0, 5),
|
|
142
|
+
build,
|
|
143
|
+
}, null, 2));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (opts.out) {
|
|
147
|
+
const { writeFileSync, mkdirSync } = await Promise.resolve().then(() => __importStar(require('fs')));
|
|
148
|
+
mkdirSync(pathMod.dirname(opts.out), { recursive: true });
|
|
149
|
+
writeFileSync(opts.out, markdown);
|
|
150
|
+
console.log(`Digest written: ${opts.out}`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
console.log(markdown);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (e) {
|
|
157
|
+
console.error(`Error: ${e.message || e}`);
|
|
158
|
+
process.exitCode = 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../../src/commands/digest.ts"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,oEAAoE;AACpE,0EAA0E;AAC1E,wEAAwE;AACxE,gDAAgD;AAChD,0CAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+B1C,sCAgGC;AA7HD,8CAAgC;AAChC,2BAA8C;AAC9C,sCAAgG;AAQhG,SAAS,WAAW,CAAC,KAAa;IAChC,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QAC5B,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC;QACtB,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC;QACtB,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC;QACtB,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC;QACtB,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,WAAsC;IAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,E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E,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;gBACrH,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACtB,WAAW,EAAE,CAAC,WAAW,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACxD,KAAK;aACN,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACb,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,wDAAa,IAAI,GAAC,CAAC;YACxD,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../src/commands/explain.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../src/commands/explain.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,iBAoDzF"}
|
package/dist/commands/explain.js
CHANGED
|
@@ -15,7 +15,15 @@ async function explainCommand(node, opts) {
|
|
|
15
15
|
}
|
|
16
16
|
console.log(`Node: ${result.label}`);
|
|
17
17
|
console.log(` ID: ${result.id}`);
|
|
18
|
-
|
|
18
|
+
// An unresolved global name (a `stub` node) has no owning file. Printing
|
|
19
|
+
// whatever file referenced it first would name a file that does not
|
|
20
|
+
// define the symbol; say so instead.
|
|
21
|
+
if (result.sourceFile) {
|
|
22
|
+
console.log(` File: ${result.sourceFile}${result.sourceLine != null ? `:${result.sourceLine}` : ''}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log(' File: (no source locus — unresolved name, no single owner)');
|
|
26
|
+
}
|
|
19
27
|
if (result.community !== null && result.community !== undefined) {
|
|
20
28
|
console.log(` Community: ${result.community}`);
|
|
21
29
|
}
|
|
@@ -25,7 +33,11 @@ async function explainCommand(node, opts) {
|
|
|
25
33
|
if (result.neighbors.length > 0) {
|
|
26
34
|
console.log(`\nConnections (${result.neighborCount}):`);
|
|
27
35
|
for (const n of result.neighbors) {
|
|
28
|
-
const loc = n.
|
|
36
|
+
const loc = n.neighborFile
|
|
37
|
+
? n.neighborLine != null
|
|
38
|
+
? ` (${n.neighborFile}:${n.neighborLine})`
|
|
39
|
+
: ` (${n.neighborFile})`
|
|
40
|
+
: '';
|
|
29
41
|
// Direction is the stored edge's: `-->` this node calls/imports the
|
|
30
42
|
// neighbor; `<--` the neighbor calls/imports this node.
|
|
31
43
|
const arrow = n.outgoing === false ? '<--' : '-->';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../src/commands/explain.ts"],"names":[],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,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,iBAyCA"}
|
package/dist/commands/health.js
CHANGED
|
@@ -3,27 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.healthCommand = healthCommand;
|
|
4
4
|
const native_1 = require("../native");
|
|
5
5
|
async function healthCommand(opts) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const report = (0, native_1.healthReport)(opts.graph);
|
|
7
|
+
if (opts.json) {
|
|
8
|
+
console.log(JSON.stringify({
|
|
9
|
+
score: report.score,
|
|
10
|
+
grade: report.grade,
|
|
11
|
+
ageDays: report.ageDays,
|
|
12
|
+
nodeCount: report.nodeCount,
|
|
13
|
+
edgeCount: report.edgeCount,
|
|
14
|
+
deadCode: report.deadCode,
|
|
15
|
+
cycles: report.cycles,
|
|
16
|
+
hubs: report.hubs,
|
|
17
|
+
}, null, 2));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
console.log(report.text);
|
|
21
|
+
}
|
|
22
|
+
// CI gate: `astria health --min-score 70` must be able to fail a build.
|
|
23
|
+
// Without this the command always exited 0, so the obvious threshold gate
|
|
24
|
+
// silently never fired. The score is checked after the report is printed, so
|
|
25
|
+
// a failing gate still shows the operator why.
|
|
26
|
+
if (opts.minScore !== undefined) {
|
|
27
|
+
const min = Number(opts.minScore);
|
|
28
|
+
if (!Number.isFinite(min)) {
|
|
29
|
+
console.error(`Error: --min-score must be a number, got "${opts.minScore}"`);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
19
32
|
}
|
|
20
|
-
|
|
21
|
-
console.
|
|
33
|
+
if (report.score < min) {
|
|
34
|
+
console.error(`\nHealth score ${report.score} is below the required minimum of ${min}.`);
|
|
35
|
+
process.exitCode = 1;
|
|
22
36
|
}
|
|
23
37
|
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.error(`Error: ${e.message || e}`);
|
|
26
|
-
process.exitCode = 1;
|
|
27
|
-
}
|
|
28
38
|
}
|
|
29
39
|
//# sourceMappingURL=health.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/commands/health.ts"],"names":[],"mappings":";;AAEA,sCA6CC;AA/CD,sCAAyC;AAElC,KAAK,UAAU,aAAa,CAAC,IAInC;IACC,MAAM,MAAM,GAAG,IAAA,qBAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CACT,IAAI,CAAC,SAAS,CACZ;YACE,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,wEAAwE;IACxE,0EAA0E;IAC1E,6EAA6E;IAC7E,+CAA+C;IAC/C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,6CAA6C,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC7E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CACX,kBAAkB,MAAM,CAAC,KAAK,qCAAqC,GAAG,GAAG,CAC1E,CAAC;YACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAkEtD"}
|
package/dist/commands/install.js
CHANGED
|
@@ -38,11 +38,21 @@ function registerInstallCommand(program) {
|
|
|
38
38
|
});
|
|
39
39
|
program
|
|
40
40
|
.command('uninstall')
|
|
41
|
-
.description('Uninstall astria skill for an AI platform')
|
|
41
|
+
.description('Uninstall astria skill for an AI platform (--purge removes everything: hooks, merge driver, graph data, global store)')
|
|
42
42
|
.option('--platform <name>', `Platform: ${platforms_1.PLATFORM_NAMES.join(', ')}`, 'claude')
|
|
43
43
|
.option('--all', 'Uninstall from every supported platform')
|
|
44
|
+
.option('--purge', 'Deep clean: uninstall every platform, git hooks, merge driver, .astria/ graph data, and the ~/.astria global store')
|
|
44
45
|
.action(async (opts) => {
|
|
45
46
|
try {
|
|
47
|
+
if (opts.purge) {
|
|
48
|
+
// The flag is the consent: purge removes graph data and the
|
|
49
|
+
// global store, which no plain uninstall ever touches.
|
|
50
|
+
for (const msg of (0, index_1.purgeEverything)(process.cwd())) {
|
|
51
|
+
console.log(msg);
|
|
52
|
+
}
|
|
53
|
+
console.log('\nastria fully removed from this machine and project.');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
46
56
|
if (opts.all) {
|
|
47
57
|
for (const platform of platforms_1.PLATFORM_NAMES) {
|
|
48
58
|
for (const msg of (0, index_1.uninstallPlatform)(platform, process.cwd())) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":";;AAIA,wDAkEC;AArED,4CAAuF;AACvF,oDAAsD;AAEtD,SAAgB,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,kDAAkD,0BAAc,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC;SAC1G,MA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AAK,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;YAClC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,iBAaA"}
|
package/dist/commands/map.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapCommand = mapCommand;
|
|
4
4
|
const native_1 = require("../native");
|
|
5
|
+
const defaults_1 = require("../defaults");
|
|
5
6
|
async function mapCommand(opts) {
|
|
6
7
|
try {
|
|
7
|
-
const budget = parseInt(opts.budget ||
|
|
8
|
+
const budget = parseInt(opts.budget || String(defaults_1.DEFAULT_QUERY_BUDGET), 10);
|
|
8
9
|
const result = (0, native_1.repoMap)(opts.graph, budget, opts.detail);
|
|
9
10
|
if (opts.json) {
|
|
10
11
|
console.log(JSON.stringify({ filesShown: result.filesShown, text: result.text }, null, 2));
|
package/dist/commands/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../src/commands/map.ts"],"names":[],"mappings":";;AAGA,gCAkBC;AArBD,sCAAoC;AACpC,0CAAmD;AAE5C,KAAK,UAAU,UAAU,CAAC,IAKhC;IACC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,+BAAoB,CAAC,EAAE,EAAE,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,IAAA,gBAAO,EAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3F,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"}
|
package/dist/commands/mcp.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface McpOptions {
|
|
2
2
|
graph: string;
|
|
3
|
-
|
|
3
|
+
/** Serve MCP over HTTP (Streamable HTTP, JSON responses) instead of stdio. */
|
|
4
|
+
http?: boolean;
|
|
5
|
+
host?: string;
|
|
6
|
+
port?: string;
|
|
7
|
+
/** Bearer token for HTTP serving (falls back to ASTRIA_MCP_TOKEN). */
|
|
8
|
+
token?: string;
|
|
9
|
+
/** Additional projects: "name=path" or bare "path" entries. */
|
|
10
|
+
projects?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Browser origins allowed to send HTTP requests (exact match, e.g.
|
|
13
|
+
* "http://localhost:5173"). Requests carrying an Origin header are refused
|
|
14
|
+
* unless listed; native MCP clients send no Origin and always pass.
|
|
15
|
+
*/
|
|
16
|
+
allowOrigin?: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function mcpCommand(opts: McpOptions): Promise<void>;
|
|
4
19
|
//# sourceMappingURL=mcp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,iBAwBhD"}
|
package/dist/commands/mcp.js
CHANGED
|
@@ -4,6 +4,22 @@ exports.mcpCommand = mcpCommand;
|
|
|
4
4
|
const native_1 = require("../native");
|
|
5
5
|
async function mcpCommand(opts) {
|
|
6
6
|
try {
|
|
7
|
+
if (opts.http) {
|
|
8
|
+
const port = opts.port ? parseInt(opts.port, 10) : undefined;
|
|
9
|
+
if (port !== undefined && (!Number.isInteger(port) || port <= 0 || port > 65535)) {
|
|
10
|
+
throw new Error(`invalid port: ${opts.port}`);
|
|
11
|
+
}
|
|
12
|
+
// Blocks until the process is killed; one server, many project graphs.
|
|
13
|
+
(0, native_1.runMcpHttpServer)({
|
|
14
|
+
root: opts.graph,
|
|
15
|
+
host: opts.host,
|
|
16
|
+
port,
|
|
17
|
+
token: opts.token,
|
|
18
|
+
projects: opts.projects,
|
|
19
|
+
allowedOrigins: opts.allowOrigin,
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
7
23
|
// Blocks serving newline-delimited JSON-RPC on stdio until stdin closes
|
|
8
24
|
(0, native_1.runMcpServer)(opts.graph);
|
|
9
25
|
}
|
package/dist/commands/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":";;AAoBA,gCAwBC;AA5CD,sCAA2D;AAoBpD,KAAK,UAAU,UAAU,CAAC,IAAgB;IAC/C,IAAI,CAAC;QACH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC7D,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;gBACjF,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,uEAAuE;YACvE,IAAA,yBAAgB,EAAC;gBACf,IAAI,EAAE,IAAI,CAAC,KAAK;gBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI;gBACJ,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,cAAc,EAAE,IAAI,CAAC,WAAW;aACjC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QACD,wEAAwE;QACxE,IAAA,qBAAY,EAAC,IAAI,CAAC,KAAK,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,7 @@
|
|
|
1
|
+
type Json = Record<string, any>;
|
|
2
|
+
export declare function threeWayUnion(baseEntries: Json[], oursEntries: Json[], theirsEntries: Json[], keyOf: (entry: Json) => string): Json[];
|
|
3
|
+
export declare function mergeDriverRun(basePath: string, oursPath: string, theirsPath: string): number;
|
|
4
|
+
export declare function mergeDriverInstall(projectDir: string): string[];
|
|
5
|
+
export declare function mergeDriverUninstall(projectDir: string): string[];
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=merge-driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-driver.d.ts","sourceRoot":"","sources":["../../src/commands/merge-driver.ts"],"names":[],"mappings":"AAsBA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAuChC,wBAAgB,aAAa,CAC3B,WAAW,EAAE,IAAI,EAAE,EACnB,WAAW,EAAE,IAAI,EAAE,EACnB,aAAa,EAAE,IAAI,EAAE,EACrB,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,MAAM,GAC7B,IAAI,EAAE,CAuBR;AAgCD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAgB7F;AAWD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA0B/D;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAsBjE"}
|