@nodesify/astria 1.0.11 → 1.0.12
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/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 +200 -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 +84 -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,wCAiBC;AA3BD,8CAAgC;AAChC,sCAAwC;AASjC,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,OAA2B,EAAE;IAC9E,IAAI,CAAC;QACH,IAAI,UAA8B,CAAC;QACnC,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAClC,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACzC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;gBACrE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC;QACxE,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":"digest.d.ts","sourceRoot":"","sources":["../../src/commands/digest.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;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,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACzD,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,UAAU,CAAC;IAC9C,IAAI,OAAO,GAAG,EAAE,GAAG,EAAE;QAAE,O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AC,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":"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,MAAM,CAAC,mBAAmB,EAAE,aAAa,0BAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC;SAC/E,MAAM,CAAC,OAA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AC,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"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Git merge driver for the knowledge graph artifact. Parallel branches both
|
|
3
|
+
// rebuild the graph and both commit `.astria/graph.json` — plain git sees
|
|
4
|
+
// JSON line noise and conflicts. This driver performs a 3-way union merge
|
|
5
|
+
// over the graph structure so both branches' additions survive:
|
|
6
|
+
//
|
|
7
|
+
// nodes/edges/hyperedges: union by key with classic 3-way field
|
|
8
|
+
// resolution (unchanged side takes the changed side; both changed keeps
|
|
9
|
+
// ours); a side's deletion of an entry is respected.
|
|
10
|
+
// communities: derived data — take whichever side changed from base;
|
|
11
|
+
// the next `astria update` re-clusters anyway.
|
|
12
|
+
//
|
|
13
|
+
// Git wiring (done by `astria merge-driver install`):
|
|
14
|
+
// .gitattributes: .astria/graph.json merge=astria
|
|
15
|
+
// .git/config: merge.astria.driver = astria merge-driver run %O %A %B %P
|
|
16
|
+
//
|
|
17
|
+
// Exit 0 = merged cleanly (the merged graph is written over %A); exit 1 =
|
|
18
|
+
// unmergeable input (git falls back to a conflict).
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.threeWayUnion = threeWayUnion;
|
|
21
|
+
exports.mergeDriverRun = mergeDriverRun;
|
|
22
|
+
exports.mergeDriverInstall = mergeDriverInstall;
|
|
23
|
+
exports.mergeDriverUninstall = mergeDriverUninstall;
|
|
24
|
+
const fs_1 = require("fs");
|
|
25
|
+
const child_process_1 = require("child_process");
|
|
26
|
+
const path_1 = require("path");
|
|
27
|
+
const GRAPH_JSON_PATH = '.astria/graph.json';
|
|
28
|
+
const REPORT_PATH = '.astria/graph_report.md';
|
|
29
|
+
function loadJson(path, label) {
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse((0, fs_1.readFileSync)(path, 'utf-8'));
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
throw new Error(`cannot read ${label} (${path}): ${e.message || e}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/// Classic 3-way field resolution for two versions of one object.
|
|
38
|
+
/// Unchanged-on-both-sides, changed-on-one-side, and agree-on-both cases
|
|
39
|
+
/// collapse; genuine divergence keeps ours (git's own convention).
|
|
40
|
+
function mergeFields(base, ours, theirs) {
|
|
41
|
+
const out = {};
|
|
42
|
+
const keys = new Set([...Object.keys(ours), ...Object.keys(theirs)]);
|
|
43
|
+
for (const key of keys) {
|
|
44
|
+
const o = ours[key];
|
|
45
|
+
const t = theirs[key];
|
|
46
|
+
const b = base ? base[key] : undefined;
|
|
47
|
+
if (JSON.stringify(o) === JSON.stringify(t)) {
|
|
48
|
+
out[key] = o;
|
|
49
|
+
}
|
|
50
|
+
else if (JSON.stringify(o) === JSON.stringify(b)) {
|
|
51
|
+
out[key] = t; // only theirs changed
|
|
52
|
+
}
|
|
53
|
+
else if (JSON.stringify(t) === JSON.stringify(b)) {
|
|
54
|
+
out[key] = o; // only ours changed
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
out[key] = o; // both changed differently — ours wins
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
/// 3-way union over arrays of objects keyed by `key(entry)`. An entry that
|
|
63
|
+
/// exists only on one side and not in base is that side's addition; one in
|
|
64
|
+
/// base but missing from a side is that side's deletion.
|
|
65
|
+
function threeWayUnion(baseEntries, oursEntries, theirsEntries, keyOf) {
|
|
66
|
+
const index = (entries) => new Map(entries.map((e) => [keyOf(e), e]));
|
|
67
|
+
const base = index(baseEntries);
|
|
68
|
+
const ours = index(oursEntries);
|
|
69
|
+
const theirs = index(theirsEntries);
|
|
70
|
+
const keys = new Set([...base.keys(), ...ours.keys(), ...theirs.keys()]);
|
|
71
|
+
const merged = [];
|
|
72
|
+
for (const key of [...keys].sort()) {
|
|
73
|
+
const b = base.get(key);
|
|
74
|
+
const o = ours.get(key);
|
|
75
|
+
const t = theirs.get(key);
|
|
76
|
+
if (o && t) {
|
|
77
|
+
merged.push(mergeFields(b, o, t));
|
|
78
|
+
}
|
|
79
|
+
else if (o) {
|
|
80
|
+
if (!b)
|
|
81
|
+
merged.push(o); // ours added it
|
|
82
|
+
// else theirs deleted it — drop
|
|
83
|
+
}
|
|
84
|
+
else if (t) {
|
|
85
|
+
if (!b)
|
|
86
|
+
merged.push(t); // theirs added it
|
|
87
|
+
// else ours deleted it — drop
|
|
88
|
+
}
|
|
89
|
+
// both deleted, or vanished both sides — drop
|
|
90
|
+
}
|
|
91
|
+
return merged;
|
|
92
|
+
}
|
|
93
|
+
/// Communities are derived (re-clustered on every build): whichever side
|
|
94
|
+
/// moved away from base wins wholesale; identical sides stay identical.
|
|
95
|
+
function mergeCommunities(base, ours, theirs) {
|
|
96
|
+
if (base && JSON.stringify(ours) === JSON.stringify(base.communities))
|
|
97
|
+
return theirs;
|
|
98
|
+
return ours;
|
|
99
|
+
}
|
|
100
|
+
function mergeGraphs(base, ours, theirs) {
|
|
101
|
+
const arr = (graph, name) => Array.isArray(graph[name]) ? graph[name] : [];
|
|
102
|
+
return {
|
|
103
|
+
nodes: threeWayUnion(arr(base, 'nodes'), arr(ours, 'nodes'), arr(theirs, 'nodes'), (n) => String(n.id)),
|
|
104
|
+
edges: threeWayUnion(arr(base, 'edges'), arr(ours, 'edges'), arr(theirs, 'edges'), (e) => `${e.source}|${e.target}|${e.relation}`),
|
|
105
|
+
hyperedges: threeWayUnion(arr(base, 'hyperedges'), arr(ours, 'hyperedges'), arr(theirs, 'hyperedges'), (h) => String(h.id)),
|
|
106
|
+
communities: mergeCommunities(base, arr(ours, 'communities'), arr(theirs, 'communities')),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/// The `git merge` driver entry: base, ours (written in place), theirs,
|
|
110
|
+
/// then git's path argument.
|
|
111
|
+
function mergeDriverRun(basePath, oursPath, theirsPath) {
|
|
112
|
+
try {
|
|
113
|
+
const base = (0, fs_1.existsSync)(basePath) ? loadJson(basePath, 'base graph') : { nodes: [], edges: [], hyperedges: [], communities: [] };
|
|
114
|
+
const ours = loadJson(oursPath, 'ours');
|
|
115
|
+
const theirs = loadJson(theirsPath, 'theirs');
|
|
116
|
+
const merged = mergeGraphs(base, ours, theirs);
|
|
117
|
+
(0, fs_1.writeFileSync)(oursPath, JSON.stringify(merged, null, 2) + '\n');
|
|
118
|
+
const n = merged.nodes.length;
|
|
119
|
+
const e = merged.edges.length;
|
|
120
|
+
console.log(`astria merge-driver: union-merged graph.json (${n} nodes, ${e} edges)`);
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
console.error(`astria merge-driver: ${e.message || e}`);
|
|
125
|
+
console.error('falling back to a git conflict on .astria/graph.json');
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function gitConfigGet(key) {
|
|
130
|
+
try {
|
|
131
|
+
return (0, child_process_1.execFileSync)('git', ['config', '--get', key], { encoding: 'utf-8' }).trim() || null;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/// Idempotent install: .gitattributes entry + git config driver definition.
|
|
138
|
+
function mergeDriverInstall(projectDir) {
|
|
139
|
+
const messages = [];
|
|
140
|
+
const attributesPath = (0, path_1.join)(projectDir, '.gitattributes');
|
|
141
|
+
const graphEntry = `${GRAPH_JSON_PATH} merge=astria`;
|
|
142
|
+
const reportEntry = `${REPORT_PATH} merge=union`;
|
|
143
|
+
let attributes = (0, fs_1.existsSync)(attributesPath) ? (0, fs_1.readFileSync)(attributesPath, 'utf-8') : '';
|
|
144
|
+
let changed = false;
|
|
145
|
+
for (const entry of [graphEntry, reportEntry]) {
|
|
146
|
+
if (!attributes.split('\n').some((line) => line.trim() === entry)) {
|
|
147
|
+
if (attributes && !attributes.endsWith('\n'))
|
|
148
|
+
attributes += '\n';
|
|
149
|
+
attributes += entry + '\n';
|
|
150
|
+
changed = true;
|
|
151
|
+
messages.push(`.gitattributes: ${entry}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (changed)
|
|
155
|
+
(0, fs_1.writeFileSync)(attributesPath, attributes);
|
|
156
|
+
(0, child_process_1.execFileSync)('git', ['config', 'merge.astria.name', 'astria knowledge graph union-merge'], { cwd: projectDir });
|
|
157
|
+
(0, child_process_1.execFileSync)('git', ['config', 'merge.astria.driver', 'astria merge-driver run %O %A %B %P'], { cwd: projectDir });
|
|
158
|
+
messages.push('git config: merge.astria.driver = astria merge-driver run %O %A %B %P');
|
|
159
|
+
messages.push('committed .astria/graph.json files on parallel branches now union-merge automatically');
|
|
160
|
+
return messages;
|
|
161
|
+
}
|
|
162
|
+
function mergeDriverUninstall(projectDir) {
|
|
163
|
+
const messages = [];
|
|
164
|
+
const attributesPath = (0, path_1.join)(projectDir, '.gitattributes');
|
|
165
|
+
if ((0, fs_1.existsSync)(attributesPath)) {
|
|
166
|
+
const kept = (0, fs_1.readFileSync)(attributesPath, 'utf-8')
|
|
167
|
+
.split('\n')
|
|
168
|
+
.filter((line) => {
|
|
169
|
+
const t = line.trim();
|
|
170
|
+
return t !== `${GRAPH_JSON_PATH} merge=astria` && t !== `${REPORT_PATH} merge=union` && t !== '';
|
|
171
|
+
});
|
|
172
|
+
(0, fs_1.writeFileSync)(attributesPath, kept.length ? kept.join('\n') + '\n' : '');
|
|
173
|
+
messages.push('.gitattributes: astria merge entries removed');
|
|
174
|
+
}
|
|
175
|
+
for (const key of ['merge.astria.name', 'merge.astria.driver']) {
|
|
176
|
+
try {
|
|
177
|
+
(0, child_process_1.execFileSync)('git', ['config', '--unset', key], { cwd: projectDir, stdio: 'pipe' });
|
|
178
|
+
messages.push(`git config: ${key} removed`);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// never set — fine
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return messages;
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=merge-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-driver.js","sourceRoot":"","sources":["../../src/commands/merge-driver.ts"],"names":[],"mappings":";AAAA,4EAA4E;AAC5E,0EAA0E;A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eAAe,GAAG,UAAU,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,mBAAmB;QACrB,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface MergeGateOptions {
|
|
2
|
+
graph: string;
|
|
3
|
+
maxAgeHours?: string;
|
|
4
|
+
minHealth?: string;
|
|
5
|
+
maxRisk?: string;
|
|
6
|
+
staged?: boolean;
|
|
7
|
+
/** Score the committed diff `base...head` instead of the working tree (CI/PR mode). */
|
|
8
|
+
base?: string;
|
|
9
|
+
/** Head ref of the range; defaults to HEAD when --base is given. */
|
|
10
|
+
head?: string;
|
|
11
|
+
json?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function mergeGateCommand(opts: MergeGateOptions): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=merge-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-gate.d.ts","sourceRoot":"","sources":["../../src/commands/merge-gate.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAoCD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,iBAwJ5D"}
|