@reposkein/mcp 0.3.0 → 0.5.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/README.md +76 -1
- package/binary-digests.json +4 -4
- package/dist/SKILL.md +19 -0
- package/dist/cli/agentAdapters.d.ts +68 -0
- package/dist/cli/agentAdapters.js +223 -0
- package/dist/cli/agentAdapters.js.map +1 -0
- package/dist/cli/ansi.d.ts +24 -0
- package/dist/cli/ansi.js +40 -0
- package/dist/cli/ansi.js.map +1 -0
- package/dist/cli/doctor.d.ts +34 -2
- package/dist/cli/doctor.js +51 -6
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/doctorFreshness.d.ts +43 -0
- package/dist/cli/doctorFreshness.js +111 -0
- package/dist/cli/doctorFreshness.js.map +1 -0
- package/dist/cli/doctorSummaries.d.ts +2 -0
- package/dist/cli/doctorSummaries.js +95 -0
- package/dist/cli/doctorSummaries.js.map +1 -0
- package/dist/cli/federatedDiscovery.d.ts +16 -0
- package/dist/cli/federatedDiscovery.js +75 -0
- package/dist/cli/federatedDiscovery.js.map +1 -0
- package/dist/cli/init.d.ts +69 -6
- package/dist/cli/init.js +194 -28
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/sourceSlices.d.ts +17 -0
- package/dist/cli/sourceSlices.js +59 -0
- package/dist/cli/sourceSlices.js.map +1 -0
- package/dist/cli/stats.d.ts +29 -0
- package/dist/cli/stats.js +180 -0
- package/dist/cli/stats.js.map +1 -0
- package/dist/cli/view.d.ts +71 -3
- package/dist/cli/view.js +170 -14
- package/dist/cli/view.js.map +1 -1
- package/dist/index.d.ts +8 -48
- package/dist/index.js +94 -295
- package/dist/index.js.map +1 -1
- package/dist/indexer/fetchBinary.d.ts +14 -0
- package/dist/indexer/fetchBinary.js +81 -40
- package/dist/indexer/fetchBinary.js.map +1 -1
- package/dist/indexer/indexLock.d.ts +13 -0
- package/dist/indexer/indexLock.js +66 -0
- package/dist/indexer/indexLock.js.map +1 -0
- package/dist/indexer/runIndexer.d.ts +8 -2
- package/dist/indexer/runIndexer.js +20 -4
- package/dist/indexer/runIndexer.js.map +1 -1
- package/dist/serve/serve.d.ts +95 -0
- package/dist/serve/serve.js +581 -0
- package/dist/serve/serve.js.map +1 -0
- package/dist/serve/tokens.d.ts +49 -0
- package/dist/serve/tokens.js +108 -0
- package/dist/serve/tokens.js.map +1 -0
- package/dist/serve/watch.d.ts +73 -0
- package/dist/serve/watch.js +135 -0
- package/dist/serve/watch.js.map +1 -0
- package/dist/server/createMcpServer.d.ts +129 -0
- package/dist/server/createMcpServer.js +464 -0
- package/dist/server/createMcpServer.js.map +1 -0
- package/dist/store/JsonlGraphStore.d.ts +18 -4
- package/dist/store/JsonlGraphStore.js +61 -19
- package/dist/store/JsonlGraphStore.js.map +1 -1
- package/dist/store/decisions.d.ts +20 -2
- package/dist/store/decisions.js +35 -2
- package/dist/store/decisions.js.map +1 -1
- package/dist/store/indexedAt.d.ts +18 -0
- package/dist/store/indexedAt.js +56 -0
- package/dist/store/indexedAt.js.map +1 -0
- package/dist/store/instrumentTool.d.ts +40 -0
- package/dist/store/instrumentTool.js +82 -0
- package/dist/store/instrumentTool.js.map +1 -0
- package/dist/store/repoContextCache.d.ts +15 -0
- package/dist/store/repoContextCache.js +26 -0
- package/dist/store/repoContextCache.js.map +1 -0
- package/dist/store/repoSession.d.ts +63 -0
- package/dist/store/repoSession.js +123 -0
- package/dist/store/repoSession.js.map +1 -0
- package/dist/store/resolveRepoPath.d.ts +31 -0
- package/dist/store/resolveRepoPath.js +85 -0
- package/dist/store/resolveRepoPath.js.map +1 -0
- package/dist/store/sessionLog.d.ts +98 -0
- package/dist/store/sessionLog.js +216 -0
- package/dist/store/sessionLog.js.map +1 -0
- package/dist/store/sessionStats.d.ts +55 -0
- package/dist/store/sessionStats.js +140 -0
- package/dist/store/sessionStats.js.map +1 -0
- package/dist/store/sidecar.d.ts +39 -3
- package/dist/store/sidecar.js +89 -5
- package/dist/store/sidecar.js.map +1 -1
- package/dist/store/summaryShards.d.ts +117 -0
- package/dist/store/summaryShards.js +291 -0
- package/dist/store/summaryShards.js.map +1 -0
- package/dist/store/teamConfig.d.ts +17 -0
- package/dist/store/teamConfig.js +55 -0
- package/dist/store/teamConfig.js.map +1 -0
- package/dist/tools/indexerTools.d.ts +14 -2
- package/dist/tools/indexerTools.js +17 -5
- package/dist/tools/indexerTools.js.map +1 -1
- package/dist/tools/recordDecision.d.ts +3 -0
- package/dist/tools/recordDecision.js +7 -2
- package/dist/tools/recordDecision.js.map +1 -1
- package/dist/tools/writeSemanticSummary.d.ts +4 -1
- package/dist/tools/writeSemanticSummary.js +5 -2
- package/dist/tools/writeSemanticSummary.js.map +1 -1
- package/dist/viz/assets/{graph.worker-CC7BeE-8.js → graph.worker-DkH6-lMU.js} +1 -1
- package/dist/viz/assets/index-BnqIVYFE.css +1 -0
- package/dist/viz/assets/index-IhtszTp0.js +5 -0
- package/dist/viz/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/viz/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/viz/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
- package/dist/viz/assets/r3f-Bn9htB92.js +336 -0
- package/dist/viz/assets/tanstack-CSzx6NDA.js +62 -0
- package/dist/viz/assets/three-Cpu5RUEM.js +4116 -0
- package/dist/viz/index.html +5 -4
- package/package.json +5 -4
- package/dist/viz/assets/index-C_8UkiJ8.js +0 -9
- package/dist/viz/assets/r3f-Cku1OhB-.js +0 -277
- package/dist/viz/assets/tanstack-DyXcNRWk.js +0 -77
- package/dist/viz/assets/three-Z8XaLGmf.js +0 -3839
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { basename, join } from "node:path";
|
|
3
|
+
export function summariesDir(repoPath) {
|
|
4
|
+
return join(repoPath, ".reposkein", "summaries");
|
|
5
|
+
}
|
|
6
|
+
/** The pre-sharding committed file. Still read (dual-read) for one release. */
|
|
7
|
+
export function legacySummariesPath(repoPath) {
|
|
8
|
+
return join(repoPath, ".reposkein", "summaries.jsonl");
|
|
9
|
+
}
|
|
10
|
+
export function conflictsPath(repoPath) {
|
|
11
|
+
return join(repoPath, ".reposkein", "local", "conflicts.jsonl");
|
|
12
|
+
}
|
|
13
|
+
/** Mirrors the Rust `is_shard_file_name`: exactly two lowercase hex chars. */
|
|
14
|
+
export function isShardFileName(name) {
|
|
15
|
+
return /^[0-9a-f]{2}\.jsonl$/.test(name);
|
|
16
|
+
}
|
|
17
|
+
/** A line git left behind from an unresolved textual merge. A canonical
|
|
18
|
+
* summary line always starts with `{`, so a marker run is damage, not data. */
|
|
19
|
+
export function isConflictMarker(line) {
|
|
20
|
+
return (line.startsWith("<<<<<<<") ||
|
|
21
|
+
line.startsWith("=======") ||
|
|
22
|
+
line.startsWith(">>>>>>>") ||
|
|
23
|
+
line.startsWith("|||||||"));
|
|
24
|
+
}
|
|
25
|
+
/** True for a value that is actually authored prose: a non-empty string.
|
|
26
|
+
* `null`, a number, or `""` all mean "the field is present but says nothing". */
|
|
27
|
+
function isProse(v) {
|
|
28
|
+
return typeof v === "string" && v !== "";
|
|
29
|
+
}
|
|
30
|
+
/** Whether these props carry an authored summary worth keeping.
|
|
31
|
+
*
|
|
32
|
+
* Deliberately identical to the Rust `has_summary`. The two languages read the
|
|
33
|
+
* same committed shards, so a record one accepts and the other rejects is a
|
|
34
|
+
* divergence between what the server serves and what the indexer writes — and
|
|
35
|
+
* a record with nothing in it must never displace one that has prose, in
|
|
36
|
+
* either language. Pinned by the `null-valued`/`non-string` fixture vectors. */
|
|
37
|
+
export function hasSummary(props) {
|
|
38
|
+
return isProse(props.semantic_summary) || isProse(props.purpose_summary);
|
|
39
|
+
}
|
|
40
|
+
function summaryAt(rec) {
|
|
41
|
+
const v = rec.props.summary_at;
|
|
42
|
+
return typeof v === "string" ? v : "";
|
|
43
|
+
}
|
|
44
|
+
/** Byte-lexicographic comparison. JavaScript's `<` compares UTF-16 code units,
|
|
45
|
+
* which orders some astral/BMP pairs differently from the UTF-8 byte order
|
|
46
|
+
* Rust uses. Comparing the encoded bytes is what makes the two languages
|
|
47
|
+
* agree on every input, not just ASCII ones. */
|
|
48
|
+
function lineIsSmaller(a, b) {
|
|
49
|
+
return Buffer.compare(Buffer.from(a, "utf8"), Buffer.from(b, "utf8")) < 0;
|
|
50
|
+
}
|
|
51
|
+
/** Deterministic winner between two records claiming the same node id, when
|
|
52
|
+
* nothing is known about where either came from:
|
|
53
|
+
* newer `summary_at`, then smaller raw line by UTF-8 byte order. Both are
|
|
54
|
+
* pure functions of bytes on disk, so every machine — and the Rust indexer —
|
|
55
|
+
* picks the same winner without coordinating. Kept in lockstep with the Rust
|
|
56
|
+
* `beats` by the shared vectors in `fixtures/summary-shard-vectors.json`.
|
|
57
|
+
*
|
|
58
|
+
* This is the rule for records found in the SAME source (two lines of one
|
|
59
|
+
* merged shard, two agents' sidecars). Across sources of known provenance,
|
|
60
|
+
* use `supersedes`. */
|
|
61
|
+
export function beats(candidate, incumbent) {
|
|
62
|
+
const ca = summaryAt(candidate);
|
|
63
|
+
const ia = summaryAt(incumbent);
|
|
64
|
+
if (ca !== ia)
|
|
65
|
+
return ca > ia;
|
|
66
|
+
return lineIsSmaller(candidate.line, incumbent.line);
|
|
67
|
+
}
|
|
68
|
+
/** Whether a record from a strictly NEWER-provenance source displaces one
|
|
69
|
+
* already held from an older source.
|
|
70
|
+
*
|
|
71
|
+
* `summary_at` is day-precision (PRD §6.2.5 keeps wall-clock time out of
|
|
72
|
+
* committed bytes), so re-summarising a node already summarised today TIES.
|
|
73
|
+
* Resolving that tie by byte order would silently discard the rewrite. A
|
|
74
|
+
* newer source therefore wins unless it is *strictly older* — which is the
|
|
75
|
+
* case that matters, because that is a stale local record about to clobber a
|
|
76
|
+
* teammate's newer one. Mirrors the Rust `supersedes`. */
|
|
77
|
+
export function supersedes(candidate, incumbent) {
|
|
78
|
+
return summaryAt(candidate) >= summaryAt(incumbent);
|
|
79
|
+
}
|
|
80
|
+
export function emptyAccumulator() {
|
|
81
|
+
return { summaries: new Map(), conflicts: [], warnings: [] };
|
|
82
|
+
}
|
|
83
|
+
/** Folds one candidate in, keeping whichever record `wins` selects and
|
|
84
|
+
* preserving the other. The single place a record can be displaced, so no
|
|
85
|
+
* caller can bypass conflict recording by accident. */
|
|
86
|
+
function offer(acc, rec, wins) {
|
|
87
|
+
const existing = acc.summaries.get(rec.id);
|
|
88
|
+
if (!existing) {
|
|
89
|
+
acc.summaries.set(rec.id, rec);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
// A union merge duplicating an unchanged line is not a conflict.
|
|
93
|
+
if (existing.line === rec.line)
|
|
94
|
+
return;
|
|
95
|
+
if (wins(rec, existing)) {
|
|
96
|
+
acc.summaries.set(rec.id, rec);
|
|
97
|
+
acc.conflicts.push(existing);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
acc.conflicts.push(rec);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Folds a whole source of strictly NEWER provenance into `acc`. Mirrors the
|
|
104
|
+
* Rust `absorb_source`: displacement uses `supersedes`, and every displaced
|
|
105
|
+
* record is preserved. */
|
|
106
|
+
export function absorbSummarySource(acc, other) {
|
|
107
|
+
for (const rec of other.summaries.values())
|
|
108
|
+
offer(acc, rec, supersedes);
|
|
109
|
+
acc.conflicts.push(...other.conflicts);
|
|
110
|
+
acc.warnings.push(...other.warnings);
|
|
111
|
+
}
|
|
112
|
+
/** Folds one file's text in, resolving same-source records with `beats`.
|
|
113
|
+
* Exported for the shared vectors. */
|
|
114
|
+
export function absorbSummaryLines(acc, source, text) {
|
|
115
|
+
let markers = 0;
|
|
116
|
+
let malformed = 0;
|
|
117
|
+
for (const raw of text.split("\n")) {
|
|
118
|
+
const line = raw.endsWith("\r") ? raw.slice(0, -1) : raw;
|
|
119
|
+
if (line.trim() === "")
|
|
120
|
+
continue;
|
|
121
|
+
if (isConflictMarker(line)) {
|
|
122
|
+
markers++;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
let obj;
|
|
126
|
+
try {
|
|
127
|
+
const parsed = JSON.parse(line);
|
|
128
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
129
|
+
malformed++;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
obj = parsed;
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
malformed++;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const id = obj.id;
|
|
139
|
+
if (typeof id !== "string" || id === "") {
|
|
140
|
+
malformed++;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
const { id: _drop, ...props } = obj;
|
|
144
|
+
// A line with no authored prose is not a summary. Letting it into the map
|
|
145
|
+
// would let it WIN a tiebreak against a real summary and evict it — see
|
|
146
|
+
// `hasSummary` for the null-valued case that did exactly that.
|
|
147
|
+
if (!hasSummary(props)) {
|
|
148
|
+
malformed++;
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
offer(acc, { id, props, line }, beats);
|
|
152
|
+
}
|
|
153
|
+
if (markers > 0) {
|
|
154
|
+
acc.warnings.push(`${source}: skipped ${markers} git conflict-marker line(s); run \`reposkein-indexer index\` to rewrite the shard cleanly`);
|
|
155
|
+
}
|
|
156
|
+
if (malformed > 0) {
|
|
157
|
+
acc.warnings.push(`${source}: skipped ${malformed} malformed line(s)`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/** Reads every committed shard plus the pre-sharding file, tolerantly.
|
|
161
|
+
* A missing directory is the normal state for a repo with no authored prose,
|
|
162
|
+
* and returns an empty result rather than an error. */
|
|
163
|
+
export function loadSummaryShards(repoPath) {
|
|
164
|
+
const acc = emptyAccumulator();
|
|
165
|
+
const dir = summariesDir(repoPath);
|
|
166
|
+
let names = [];
|
|
167
|
+
try {
|
|
168
|
+
names = readdirSync(dir).filter(isShardFileName).sort();
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
names = [];
|
|
172
|
+
}
|
|
173
|
+
for (const name of names) {
|
|
174
|
+
try {
|
|
175
|
+
absorbSummaryLines(acc, `summaries/${name}`, readFileSync(join(dir, name), "utf8"));
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
acc.warnings.push(`summaries/${name}: unreadable`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const legacy = legacySummariesPath(repoPath);
|
|
182
|
+
const legacyFilePresent = existsSync(legacy);
|
|
183
|
+
if (legacyFilePresent) {
|
|
184
|
+
try {
|
|
185
|
+
absorbSummaryLines(acc, "summaries.jsonl", readFileSync(legacy, "utf8"));
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
acc.warnings.push("summaries.jsonl: unreadable");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// Sorted by id so callers iterate deterministically.
|
|
192
|
+
const summaries = new Map([...acc.summaries.entries()].sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0)));
|
|
193
|
+
return { summaries, conflicts: acc.conflicts, warnings: acc.warnings, legacyFilePresent };
|
|
194
|
+
}
|
|
195
|
+
/** A cheap fingerprint of everything the summary overlay reads on disk.
|
|
196
|
+
*
|
|
197
|
+
* The store keys its reload on this, so a `git pull` that brings in a
|
|
198
|
+
* teammate's shards — or another agent's sidecar write on this machine — is
|
|
199
|
+
* visible without restarting the process. Stat calls only, O(shards +
|
|
200
|
+
* sidecars), no content read, because this runs on every read and not just on
|
|
201
|
+
* change. mtime alone is not enough on filesystems with coarse timestamps, so
|
|
202
|
+
* size rides along.
|
|
203
|
+
*
|
|
204
|
+
* `sidecarFiles` is injected rather than imported to keep this module free of
|
|
205
|
+
* a cycle with sidecar.ts, which imports the fold from here. */
|
|
206
|
+
export function summaryShardsStamp(repoPath, sidecarFiles = () => []) {
|
|
207
|
+
const parts = [];
|
|
208
|
+
const dir = summariesDir(repoPath);
|
|
209
|
+
let names = [];
|
|
210
|
+
try {
|
|
211
|
+
names = readdirSync(dir).filter(isShardFileName).sort();
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
names = [];
|
|
215
|
+
}
|
|
216
|
+
for (const name of names) {
|
|
217
|
+
try {
|
|
218
|
+
const s = statSync(join(dir, name));
|
|
219
|
+
parts.push(`${name}:${s.mtimeMs}:${s.size}`);
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
parts.push(`${name}:?`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const s = statSync(legacySummariesPath(repoPath));
|
|
227
|
+
parts.push(`legacy:${s.mtimeMs}:${s.size}`);
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// absent, which is the post-migration norm
|
|
231
|
+
}
|
|
232
|
+
// Sidecars too. Without them a second agent's write on the same checkout was
|
|
233
|
+
// invisible to an already-open server for the life of the process — which
|
|
234
|
+
// the overlay explicitly promises to surface.
|
|
235
|
+
for (const p of sidecarFiles(repoPath)) {
|
|
236
|
+
try {
|
|
237
|
+
const s = statSync(p);
|
|
238
|
+
parts.push(`sc/${basename(p)}:${s.mtimeMs}:${s.size}`);
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
parts.push(`sc/${basename(p)}:?`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return parts.join("|");
|
|
245
|
+
}
|
|
246
|
+
/** Merges divergence losers into the git-ignored `local/conflicts.jsonl`.
|
|
247
|
+
*
|
|
248
|
+
* Deduped and sorted, so repeated reads converge instead of growing the file,
|
|
249
|
+
* and never truncating: a loser recorded by an earlier run (or by the indexer)
|
|
250
|
+
* stays. Best-effort — failing to record a conflict must not break a tool
|
|
251
|
+
* call. Mirrors the Rust `conflicts_to_jsonl`. */
|
|
252
|
+
export function recordSummaryConflicts(repoPath, losers) {
|
|
253
|
+
if (losers.length === 0)
|
|
254
|
+
return;
|
|
255
|
+
const path = conflictsPath(repoPath);
|
|
256
|
+
const lines = new Set();
|
|
257
|
+
try {
|
|
258
|
+
for (const raw of readFileSync(path, "utf8").split("\n")) {
|
|
259
|
+
const line = raw.endsWith("\r") ? raw.slice(0, -1) : raw;
|
|
260
|
+
if (line.trim() !== "" && !isConflictMarker(line))
|
|
261
|
+
lines.add(line);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
// no existing file
|
|
266
|
+
}
|
|
267
|
+
const before = lines.size;
|
|
268
|
+
for (const l of losers)
|
|
269
|
+
lines.add(l.line);
|
|
270
|
+
if (lines.size === before)
|
|
271
|
+
return;
|
|
272
|
+
try {
|
|
273
|
+
mkdirSync(join(repoPath, ".reposkein", "local"), { recursive: true });
|
|
274
|
+
writeFileSync(path, [...lines].sort().join("\n") + "\n");
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
// best-effort
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/** How many divergence losers are on record. Doctor surfaces this. */
|
|
281
|
+
export function countRecordedConflicts(repoPath) {
|
|
282
|
+
try {
|
|
283
|
+
return readFileSync(conflictsPath(repoPath), "utf8")
|
|
284
|
+
.split("\n")
|
|
285
|
+
.filter((l) => l.trim() !== "").length;
|
|
286
|
+
}
|
|
287
|
+
catch {
|
|
288
|
+
return 0;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=summaryShards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summaryShards.js","sourceRoot":"","sources":["../../src/store/summaryShards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM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,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,mBAAmB;IACrB,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC;IAC1B,KAAK,MAAM,CAAC,IAAI,MAAM;QAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO;IAClC,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,aAAa,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3D,CAAC;IAAC,MAAM,CAAC;QACP,cAAc;IAChB,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;aACjD,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Reads one `key = "value"` from one `[section]` of `.reposkein/config.toml`,
|
|
2
|
+
* or null when the file, section, key, or quoting is absent.
|
|
3
|
+
*
|
|
4
|
+
* A deliberate ~25-line scanner rather than a TOML dependency — mirrors
|
|
5
|
+
* `config_bool` in indexer/crates/cli/src/main.rs: this reads a handful of
|
|
6
|
+
* scalar settings out of a file `reposkein-indexer init` writes. Unquoted
|
|
7
|
+
* values yield null on purpose (the writer always quotes; an unquoted value
|
|
8
|
+
* is a hand-edit we refuse to guess at). */
|
|
9
|
+
export declare function readConfigString(repoPath: string, section: string, key: string): string | null;
|
|
10
|
+
/** Reads `pages_url` from the `[team]` section of `.reposkein/config.toml`,
|
|
11
|
+
* or null when the file/section/key is absent (the common case — this is
|
|
12
|
+
* an opt-in field a team adds after publishing a hosted constellation, see
|
|
13
|
+
* docs/HOSTING.md). Points the viewer's header at wherever the team's
|
|
14
|
+
* canonical/CI-published constellation lives (e.g. a GitHub Pages URL),
|
|
15
|
+
* distinct from whatever ad-hoc `view`/`view --export` a given machine
|
|
16
|
+
* happens to be looking at right now. */
|
|
17
|
+
export declare function readTeamPagesUrl(repoPath: string): string | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/** Reads one `key = "value"` from one `[section]` of `.reposkein/config.toml`,
|
|
4
|
+
* or null when the file, section, key, or quoting is absent.
|
|
5
|
+
*
|
|
6
|
+
* A deliberate ~25-line scanner rather than a TOML dependency — mirrors
|
|
7
|
+
* `config_bool` in indexer/crates/cli/src/main.rs: this reads a handful of
|
|
8
|
+
* scalar settings out of a file `reposkein-indexer init` writes. Unquoted
|
|
9
|
+
* values yield null on purpose (the writer always quotes; an unquoted value
|
|
10
|
+
* is a hand-edit we refuse to guess at). */
|
|
11
|
+
export function readConfigString(repoPath, section, key) {
|
|
12
|
+
const path = join(repoPath, ".reposkein", "config.toml");
|
|
13
|
+
if (!existsSync(path))
|
|
14
|
+
return null;
|
|
15
|
+
let text;
|
|
16
|
+
try {
|
|
17
|
+
text = readFileSync(path, "utf8");
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const header = `[${section}]`;
|
|
23
|
+
let inSection = false;
|
|
24
|
+
for (const rawLine of text.split(/\r?\n/)) {
|
|
25
|
+
const line = rawLine.trim();
|
|
26
|
+
if (line === "" || line.startsWith("#"))
|
|
27
|
+
continue;
|
|
28
|
+
if (line.startsWith("[")) {
|
|
29
|
+
inSection = line === header;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (!inSection)
|
|
33
|
+
continue;
|
|
34
|
+
const eq = line.indexOf("=");
|
|
35
|
+
if (eq === -1)
|
|
36
|
+
continue;
|
|
37
|
+
if (line.slice(0, eq).trim() !== key)
|
|
38
|
+
continue;
|
|
39
|
+
const rawValue = line.slice(eq + 1).split("#")[0].trim();
|
|
40
|
+
const quoted = rawValue.match(/^"([^"]*)"$/) ?? rawValue.match(/^'([^']*)'$/);
|
|
41
|
+
return quoted ? quoted[1] : null;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
/** Reads `pages_url` from the `[team]` section of `.reposkein/config.toml`,
|
|
46
|
+
* or null when the file/section/key is absent (the common case — this is
|
|
47
|
+
* an opt-in field a team adds after publishing a hosted constellation, see
|
|
48
|
+
* docs/HOSTING.md). Points the viewer's header at wherever the team's
|
|
49
|
+
* canonical/CI-published constellation lives (e.g. a GitHub Pages URL),
|
|
50
|
+
* distinct from whatever ad-hoc `view`/`view --export` a given machine
|
|
51
|
+
* happens to be looking at right now. */
|
|
52
|
+
export function readTeamPagesUrl(repoPath) {
|
|
53
|
+
return readConfigString(repoPath, "team", "pages_url");
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=teamConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teamConfig.js","sourceRoot":"","sources":["../../src/store/teamConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE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AE,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC9E,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;0CAM0C;AAC1C,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -22,8 +22,20 @@ export interface InitArgs {
|
|
|
22
22
|
path?: string;
|
|
23
23
|
full?: boolean;
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/** `path` (the repo to index) MUST come from the caller's already-resolved
|
|
26
|
+
* active repo (mcp/src/store/repoSession.ts), not re-derived here — this
|
|
27
|
+
* tool used to default to REPOSKEIN_REPO_PATH/cwd internally via
|
|
28
|
+
* runIndexer.js's `repoPath()`, which bypassed session.select_repo entirely
|
|
29
|
+
* and could index the wrong repo in workspace mode. Args-supplied `path`
|
|
30
|
+
* still wins, matching the original "explicit arg beats everything" rule. */
|
|
31
|
+
export declare function makeInitCpgSkeleton(repoId: string, repoPath: string, deps?: Partial<IndexerDeps>): (args: InitArgs) => Promise<ToolResult>;
|
|
26
32
|
export interface ReindexArgs {
|
|
27
33
|
path: string;
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
/** `path` has no override — `reindex_file`'s args only carry the file being
|
|
36
|
+
* reindexed, not a repo root — so this ALWAYS targets the caller's resolved
|
|
37
|
+
* active repo. Same reasoning as `makeInitCpgSkeleton` above: previously
|
|
38
|
+
* this read REPOSKEIN_REPO_PATH/cwd internally, independent of
|
|
39
|
+
* session.select_repo — the exact "reindex the wrong repo" bug class this
|
|
40
|
+
* parameter exists to close. */
|
|
41
|
+
export declare function makeReindexFile(repoId: string, repoPath: string, deps?: Partial<IndexerDeps>): (args: ReindexArgs) => Promise<ToolResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawnIndexer, parseJsonStats,
|
|
1
|
+
import { spawnIndexer, parseJsonStats, shouldLoadNeo4j, } from "../indexer/runIndexer.js";
|
|
2
2
|
import { ensureIndexerBinary } from "../indexer/fetchBinary.js";
|
|
3
3
|
import { decisionsAffectedBy, mergeDeltas, readPendingDelta, } from "../indexer/decisionsAffected.js";
|
|
4
4
|
/** Default runner: run the index/reindex verb with --json, then load into Neo4j
|
|
@@ -58,10 +58,16 @@ function makeRunner(repoId, deps) {
|
|
|
58
58
|
const run = deps?.run ?? ((id, path, opts) => defaultRun(id, path, opts));
|
|
59
59
|
return run;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
/** `path` (the repo to index) MUST come from the caller's already-resolved
|
|
62
|
+
* active repo (mcp/src/store/repoSession.ts), not re-derived here — this
|
|
63
|
+
* tool used to default to REPOSKEIN_REPO_PATH/cwd internally via
|
|
64
|
+
* runIndexer.js's `repoPath()`, which bypassed session.select_repo entirely
|
|
65
|
+
* and could index the wrong repo in workspace mode. Args-supplied `path`
|
|
66
|
+
* still wins, matching the original "explicit arg beats everything" rule. */
|
|
67
|
+
export function makeInitCpgSkeleton(repoId, repoPath, deps) {
|
|
62
68
|
const run = makeRunner(repoId, deps);
|
|
63
69
|
return async (args) => {
|
|
64
|
-
const indexPath = args?.path ?? repoPath
|
|
70
|
+
const indexPath = args?.path ?? repoPath;
|
|
65
71
|
const start = Date.now();
|
|
66
72
|
const r = await run(repoId, indexPath);
|
|
67
73
|
if (!r.ok) {
|
|
@@ -83,13 +89,19 @@ export function makeInitCpgSkeleton(repoId, deps) {
|
|
|
83
89
|
};
|
|
84
90
|
};
|
|
85
91
|
}
|
|
86
|
-
|
|
92
|
+
/** `path` has no override — `reindex_file`'s args only carry the file being
|
|
93
|
+
* reindexed, not a repo root — so this ALWAYS targets the caller's resolved
|
|
94
|
+
* active repo. Same reasoning as `makeInitCpgSkeleton` above: previously
|
|
95
|
+
* this read REPOSKEIN_REPO_PATH/cwd internally, independent of
|
|
96
|
+
* session.select_repo — the exact "reindex the wrong repo" bug class this
|
|
97
|
+
* parameter exists to close. */
|
|
98
|
+
export function makeReindexFile(repoId, repoPath, deps) {
|
|
87
99
|
const run = makeRunner(repoId, deps);
|
|
88
100
|
return async (args) => {
|
|
89
101
|
if (!args || !args.path) {
|
|
90
102
|
return { content: [{ type: "text", text: "reindex_file requires a 'path'" }], isError: true };
|
|
91
103
|
}
|
|
92
|
-
const indexPath = repoPath
|
|
104
|
+
const indexPath = repoPath;
|
|
93
105
|
const start = Date.now();
|
|
94
106
|
const r = await run(repoId, indexPath, { verb: "reindex", file: args.path });
|
|
95
107
|
if (!r.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexerTools.js","sourceRoot":"","sources":["../../src/tools/indexerTools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"indexerTools.js","sourceRoot":"","sources":["../../src/tools/indexerTools.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,gBAAgB,GAGjB,MAAM,iCAAiC,CAAC;AAsBzC;gEACgE;AAChE,SAAS,UAAU,CAAC,MAAc,EAAE,SAAiB,EAAE,IAAc;IACnE,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC;IACnC,OAAO,CAAC,KAAK,IAAwB,EAAE;QACrC,MAAM,GAAG,GAAG,MAAM,mBAAmB,EAAE,CAAC;QACxC,MAAM,QAAQ,GACZ,IAAI,KAAK,SAAS;YAChB,C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AAC"}
|
|
@@ -20,5 +20,8 @@ export interface DecisionToolDeps {
|
|
|
20
20
|
* index snapshot). Failures are swallowed — recording must not break. */
|
|
21
21
|
refresh?: () => Promise<void>;
|
|
22
22
|
today?: () => string;
|
|
23
|
+
/** Writer identity for `decided_by` (REP-17: a remote connection's
|
|
24
|
+
* bearer-token name). Omitted over stdio, where REPOSKEIN_AGENT stands. */
|
|
25
|
+
decidedBy?: string;
|
|
23
26
|
}
|
|
24
27
|
export declare function makeRecordDecision(store: GraphStore, repoId: string, repoPath: string, deps?: DecisionToolDeps): (args: RecordDecisionArgs) => Promise<ToolResult>;
|
|
@@ -78,7 +78,12 @@ export function makeRecordDecision(store, repoId, repoPath, deps = {}) {
|
|
|
78
78
|
const date = today();
|
|
79
79
|
// Filename-aware taken set: a damaged file's id must not be re-minted,
|
|
80
80
|
// or writeDecision would rename over the hand-recoverable record.
|
|
81
|
-
|
|
81
|
+
//
|
|
82
|
+
// The salt is the decision's own prose, so two branches recording a
|
|
83
|
+
// same-day decision under the same title mint DIFFERENT ids (and
|
|
84
|
+
// therefore different files) instead of colliding on `<slug>.1` — which
|
|
85
|
+
// would put the conflict right back into a store that exists to avoid it.
|
|
86
|
+
const id = mintDecisionId(date, prose.value.title, takenDecisionIds(repoPath), `${prose.value.context}\n${prose.value.decision}`);
|
|
82
87
|
const trigger = { kind: "manual" };
|
|
83
88
|
const rec = {
|
|
84
89
|
id,
|
|
@@ -90,7 +95,7 @@ export function makeRecordDecision(store, repoId, repoPath, deps = {}) {
|
|
|
90
95
|
paths,
|
|
91
96
|
supersedes,
|
|
92
97
|
decided_at: date,
|
|
93
|
-
decided_by: process.env.REPOSKEIN_AGENT ?? "agent",
|
|
98
|
+
decided_by: deps.decidedBy ?? process.env.REPOSKEIN_AGENT ?? "agent",
|
|
94
99
|
trigger,
|
|
95
100
|
body_hash: "",
|
|
96
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordDecision.js","sourceRoot":"","sources":["../../src/tools/recordDecision.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,aAAa,GAId,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"recordDecision.js","sourceRoot":"","sources":["../../src/tools/recordDecision.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,aAAa,GAId,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AA4BzE,SAAS,QAAQ;IACf,2EAA2E;IAC3E,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,GAAG,GAAG,CAAC,IAAY,EAAc,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACjG,MAAM,EAAE,GAAG,CAAC,GAAY,EAAc,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEtG;gEACgE;AAChE,SAAS,WAAW,CAAC,CAAS;IAC5B,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG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AC"}
|
|
@@ -5,4 +5,7 @@ export interface WriteSummaryArgs {
|
|
|
5
5
|
summary: string;
|
|
6
6
|
model?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
/** `identity` names the writer for `summary_by` (REP-17: a remote connection's
|
|
9
|
+
* bearer-token name, which is more specific than the process-wide
|
|
10
|
+
* REPOSKEIN_AGENT). Omitted over stdio, where the env fallback stands. */
|
|
11
|
+
export declare function makeWriteSemanticSummary(store: GraphStore, repoId: string, identity?: string): (args: WriteSummaryArgs) => Promise<ToolResult>;
|
|
@@ -3,7 +3,10 @@ function today() {
|
|
|
3
3
|
// Day-precision ISO date (PRD §6.2.5: no wall-clock timestamps in output).
|
|
4
4
|
return new Date().toISOString().slice(0, 10);
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/** `identity` names the writer for `summary_by` (REP-17: a remote connection's
|
|
7
|
+
* bearer-token name, which is more specific than the process-wide
|
|
8
|
+
* REPOSKEIN_AGENT). Omitted over stdio, where the env fallback stands. */
|
|
9
|
+
export function makeWriteSemanticSummary(store, repoId, identity) {
|
|
7
10
|
return async (args) => {
|
|
8
11
|
const v = sanitizeSummary(args.summary);
|
|
9
12
|
if (!v.ok) {
|
|
@@ -14,7 +17,7 @@ export function makeWriteSemanticSummary(store, repoId) {
|
|
|
14
17
|
summary: v.value,
|
|
15
18
|
model: args.model ?? "unknown",
|
|
16
19
|
at: today(),
|
|
17
|
-
by: process.env.REPOSKEIN_AGENT ?? "agent",
|
|
20
|
+
by: identity ?? process.env.REPOSKEIN_AGENT ?? "agent",
|
|
18
21
|
});
|
|
19
22
|
if (res.kind === "not_found") {
|
|
20
23
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeSemanticSummary.js","sourceRoot":"","sources":["../../src/tools/writeSemanticSummary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAShE,SAAS,KAAK;IACZ,2EAA2E;IAC3E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