@nanonets/graft 0.5.1 → 0.7.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.
Files changed (85) hide show
  1. package/README.md +29 -7
  2. package/dist/ask/ask.d.ts +52 -1
  3. package/dist/ask/ask.d.ts.map +1 -1
  4. package/dist/ask/ask.js +274 -83
  5. package/dist/ask/ask.js.map +1 -1
  6. package/dist/ask/fuse.d.ts +59 -17
  7. package/dist/ask/fuse.d.ts.map +1 -1
  8. package/dist/ask/fuse.js +51 -25
  9. package/dist/ask/fuse.js.map +1 -1
  10. package/dist/ask/graphrank.d.ts +6 -0
  11. package/dist/ask/graphrank.d.ts.map +1 -1
  12. package/dist/ask/graphrank.js +5 -1
  13. package/dist/ask/graphrank.js.map +1 -1
  14. package/dist/claude/format.js +1 -1
  15. package/dist/claude/format.js.map +1 -1
  16. package/dist/claude/hooks.d.ts +16 -0
  17. package/dist/claude/hooks.d.ts.map +1 -1
  18. package/dist/claude/hooks.js +57 -2
  19. package/dist/claude/hooks.js.map +1 -1
  20. package/dist/claude/init.d.ts +3 -0
  21. package/dist/claude/init.d.ts.map +1 -1
  22. package/dist/claude/init.js +6 -1
  23. package/dist/claude/init.js.map +1 -1
  24. package/dist/claude/skill-template.d.ts.map +1 -1
  25. package/dist/claude/skill-template.js +20 -9
  26. package/dist/claude/skill-template.js.map +1 -1
  27. package/dist/cli.d.ts +3 -14
  28. package/dist/cli.d.ts.map +1 -1
  29. package/dist/cli.js +99 -70
  30. package/dist/cli.js.map +1 -1
  31. package/dist/context/savings.d.ts +34 -0
  32. package/dist/context/savings.d.ts.map +1 -0
  33. package/dist/context/savings.js +49 -0
  34. package/dist/context/savings.js.map +1 -0
  35. package/dist/engine.d.ts +1 -0
  36. package/dist/engine.d.ts.map +1 -1
  37. package/dist/engine.js +7 -1
  38. package/dist/engine.js.map +1 -1
  39. package/dist/graph/build.d.ts.map +1 -1
  40. package/dist/graph/build.js +33 -0
  41. package/dist/graph/build.js.map +1 -1
  42. package/dist/graph/map.d.ts +38 -2
  43. package/dist/graph/map.d.ts.map +1 -1
  44. package/dist/graph/map.js +111 -24
  45. package/dist/graph/map.js.map +1 -1
  46. package/dist/graph/scopes.d.ts +15 -0
  47. package/dist/graph/scopes.d.ts.map +1 -1
  48. package/dist/graph/scopes.js +23 -0
  49. package/dist/graph/scopes.js.map +1 -1
  50. package/dist/graph/traverse-cli.d.ts +28 -18
  51. package/dist/graph/traverse-cli.d.ts.map +1 -1
  52. package/dist/graph/traverse-cli.js +68 -43
  53. package/dist/graph/traverse-cli.js.map +1 -1
  54. package/dist/graph/traverse.d.ts +35 -14
  55. package/dist/graph/traverse.d.ts.map +1 -1
  56. package/dist/graph/traverse.js +46 -20
  57. package/dist/graph/traverse.js.map +1 -1
  58. package/dist/graph/types.d.ts +12 -0
  59. package/dist/graph/types.d.ts.map +1 -1
  60. package/dist/graph/workspace-cli.d.ts +37 -0
  61. package/dist/graph/workspace-cli.d.ts.map +1 -0
  62. package/dist/graph/workspace-cli.js +70 -0
  63. package/dist/graph/workspace-cli.js.map +1 -0
  64. package/dist/graph/workspace.d.ts +128 -0
  65. package/dist/graph/workspace.d.ts.map +1 -0
  66. package/dist/graph/workspace.js +395 -0
  67. package/dist/graph/workspace.js.map +1 -0
  68. package/dist/hosts/instructions.d.ts.map +1 -1
  69. package/dist/hosts/instructions.js +7 -3
  70. package/dist/hosts/instructions.js.map +1 -1
  71. package/dist/hosts/mcp-config.d.ts +5 -0
  72. package/dist/hosts/mcp-config.d.ts.map +1 -1
  73. package/dist/hosts/mcp-config.js +2 -2
  74. package/dist/hosts/mcp-config.js.map +1 -1
  75. package/dist/mcp/tools.d.ts.map +1 -1
  76. package/dist/mcp/tools.js +94 -66
  77. package/dist/mcp/tools.js.map +1 -1
  78. package/dist/search/grep-cli.d.ts.map +1 -1
  79. package/dist/search/grep-cli.js +4 -0
  80. package/dist/search/grep-cli.js.map +1 -1
  81. package/dist/search/grep.d.ts +4 -0
  82. package/dist/search/grep.d.ts.map +1 -1
  83. package/dist/search/grep.js +2 -0
  84. package/dist/search/grep.js.map +1 -1
  85. package/package.json +1 -1
@@ -0,0 +1,395 @@
1
+ /**
2
+ * Workspace federation — a "workspace" is a parent directory that holds two or
3
+ * more immediate git-repo children and has no source graph of its own. Instead
4
+ * of one mega-graph pooling every repo, each child keeps its OWN committable
5
+ * `graft/` (byte-identical to building that child standalone), and the parent
6
+ * holds a single `graft/workspace.json` index:
7
+ *
8
+ * { "version": 1, "children": ["repoA", "repoB"] }
9
+ *
10
+ * Queries run at the parent federate across the children: `ask` fuses every
11
+ * child's ranked hits with the same RRF `fuseScopes` used inside a single
12
+ * multi-scope repo (so the big repo can't drown the small one), `grep`/`map`/
13
+ * `check`/`callers` run per child and merge, always labeled `<child>/`.
14
+ *
15
+ * This module owns the pure/core pieces (the format, its readers/writers, graph
16
+ * loading, and the federated command bodies that return renderable data). The
17
+ * CLI print/exit wrappers and the per-child build orchestration live in
18
+ * `workspace-cli.ts`; `mcp/tools.ts` calls the federate* functions directly.
19
+ */
20
+ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
21
+ import { join } from "node:path";
22
+ import { contextDirFor } from "../context/node-file.js";
23
+ import { checkGraph } from "./check.js";
24
+ import { loadGraphCached } from "./load.js";
25
+ import { buildRepoMap, formatRepoMap } from "./map.js";
26
+ import { discoverWorkspaceChildren } from "./scopes.js";
27
+ import { callersSavings, headerOf, hitLine, looseNoteFor, } from "./traverse-cli.js";
28
+ import { edgeWalk, resolveSymbol } from "./traverse.js";
29
+ import { wiringPath } from "./write.js";
30
+ import { ask } from "../ask/ask.js";
31
+ import { fuseScopes, STRONG_FLOOR, HIGH_FLOOR } from "../ask/fuse.js";
32
+ import { grepGraph } from "../search/grep.js";
33
+ import { formatGrepResult, zeroHitNote } from "../search/grep-cli.js";
34
+ import { savingsFooter } from "../context/savings.js";
35
+ const WORKSPACE_FILE = "workspace.json";
36
+ /** Absolute path to the workspace index for a parent root (`<dir>/graft/workspace.json`). */
37
+ export function workspacePath(root, override) {
38
+ return join(contextDirFor(root, override), WORKSPACE_FILE);
39
+ }
40
+ /** Read the workspace index, or null when the parent has none (not a workspace,
41
+ * or unparseable/foreign json — treated the same as absent). */
42
+ export function readWorkspace(root, override) {
43
+ const path = workspacePath(root, override);
44
+ try {
45
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
46
+ if (parsed.version !== 1 || !Array.isArray(parsed.children))
47
+ return null;
48
+ return { version: 1, children: parsed.children.map(String) };
49
+ }
50
+ catch {
51
+ return null;
52
+ }
53
+ }
54
+ /** Write the workspace index, sorting children for a stable, minimal git diff. */
55
+ export function writeWorkspace(root, ws, override) {
56
+ const dir = contextDirFor(root, override);
57
+ mkdirSync(dir, { recursive: true });
58
+ const path = join(dir, WORKSPACE_FILE);
59
+ const sorted = { version: 1, children: [...ws.children].sort() };
60
+ writeFileSync(path, JSON.stringify(sorted, null, 2) + "\n");
61
+ return path;
62
+ }
63
+ /** A parent is a workspace BUILD target when it has no own `.git` and ≥2 git
64
+ * children — or it was already split (a `workspace.json` is present). The
65
+ * no-own-`.git` guard keeps a normal repo with git submodules from being
66
+ * mistaken for a workspace. */
67
+ export function isWorkspaceBuildRoot(root, override) {
68
+ if (readWorkspace(root, override))
69
+ return true;
70
+ if (existsSync(join(root, ".git")))
71
+ return false;
72
+ return discoverWorkspaceChildren(root).length >= 2;
73
+ }
74
+ /** True when the parent has a mega-graph from an older single-graph build
75
+ * (`graft/.graph/wiring.json`) — the thing a workspace build migrates away. */
76
+ export function hasMegaGraph(root, override) {
77
+ return existsSync(wiringPath(contextDirFor(root, override)));
78
+ }
79
+ /** The EXACT split warning printed once, when a mega-graph parent is first
80
+ * built as a workspace. Templated on the child list so it names the real repos. */
81
+ export function migrationNote(children) {
82
+ const dirs = children.map((c) => `${c}/graft/`).join(", ");
83
+ return (`⚠ this folder contains ${children.length} separate git repos — splitting: ` +
84
+ `each repo now gets its own committable graft/ (${dirs}); the combined graph ` +
85
+ `here is replaced by a workspace index. Queries from here now search all repos, fairly.`);
86
+ }
87
+ /** Remove the parent's entire `graft/` tree — the mega-graph, its `.cache`, and
88
+ * any stale cards — so after `writeWorkspace` the parent holds ONLY
89
+ * workspace.json. Child graphs live in sibling `<child>/graft/`, never under
90
+ * this dir, so they are untouched. */
91
+ export function clearParentGraft(root, override) {
92
+ rmSync(contextDirFor(root, override), { recursive: true, force: true });
93
+ }
94
+ /** Load each child's graph via `loadGraphCached`. Children come from
95
+ * workspace.json when present, otherwise from live git-child discovery (a
96
+ * not-yet-built workspace). A child without a built graph is counted into
97
+ * `missing`, not dropped. */
98
+ export function loadWorkspaceGraphs(root, override) {
99
+ const ws = readWorkspace(root, override);
100
+ const children = (ws ? ws.children : discoverWorkspaceChildren(root)).slice().sort();
101
+ const loaded = [];
102
+ const missing = [];
103
+ for (const child of children) {
104
+ const graph = loadGraphCached(contextDirFor(join(root, child)));
105
+ if (graph)
106
+ loaded.push({ child, graph });
107
+ else
108
+ missing.push(child);
109
+ }
110
+ return { loaded, missing };
111
+ }
112
+ /** "2 of 3 workspace repos have graphs; run graft build to cover repoC" — the
113
+ * coverage line federated commands append when some listed child is unbuilt.
114
+ * Empty string when every child has a graph. */
115
+ export function coverageNote(g) {
116
+ if (g.missing.length === 0)
117
+ return "";
118
+ const total = g.loaded.length + g.missing.length;
119
+ return `${g.loaded.length} of ${total} workspace repos have graphs; run graft build to cover ${g.missing.join(", ")}`;
120
+ }
121
+ /** Prefix a hit pointer with its child dir so a `path:span` (or concept path
122
+ * list) opens correctly from the parent. Leaves free-text fragments alone. */
123
+ function prefixPointer(child, pointer) {
124
+ return pointer
125
+ .split(",")
126
+ .map((part) => {
127
+ const t = part.trim();
128
+ if (!t || t.includes(" "))
129
+ return part;
130
+ return `${child}/${t}`;
131
+ })
132
+ .join(", ");
133
+ }
134
+ // STRONG_FLOOR / HIGH_FLOOR (a child federates if its top hit matched a
135
+ // query term in a NAME/PATH field ≥ STRONG_FLOOR, OR its overall name+path+
136
+ // body coverage is broad enough to be real even body-only, ≥ HIGH_FLOOR) are
137
+ // defined ONCE in `../ask/fuse.js` and imported here — `rankScopesAndFuse`
138
+ // (single-graph multi-scope, `src/ask/fuse.ts`) gates on the exact same two
139
+ // floors, so the two paths that solve the identical "a weak scope must not
140
+ // federate beside a strong one" problem can never drift apart again.
141
+ /**
142
+ * Federated `ask` across a workspace: run each child's own per-scope ask
143
+ * pipeline, then fuse ALL the children's scope lists with the same
144
+ * `fuseScopes` used inside a single multi-scope repo. Each child contributes
145
+ * one fusion scope per intra-child scope, labeled `<child>/<scope>` (or just
146
+ * `<child>` for a child's root scope), so a big repo can't drown a small one —
147
+ * rank positions are comparable across repos where raw scores are not.
148
+ *
149
+ * Returns a normal `AskResult`; `formatAsk` renders it unchanged, labeling each
150
+ * hit `[<child>/…]` via the standard multi-scope path.
151
+ */
152
+ export function federateAsk(root, override, query, opts = {}) {
153
+ const wg = loadWorkspaceGraphs(root, override);
154
+ const limit = opts.limit ?? 8;
155
+ // `--in` scopes to a single child (and, past the first segment, a sub-scope
156
+ // within it). A prefix naming no known child at all is a caller mistake.
157
+ let onlyChild;
158
+ let childIn;
159
+ if (opts.in) {
160
+ const prefix = opts.in.replace(/\/+$/, "");
161
+ const [name, ...rest] = prefix.split("/");
162
+ const allChildren = [...wg.loaded.map((l) => l.child), ...wg.missing].sort();
163
+ if (!allChildren.includes(name)) {
164
+ throw new Error(`no workspace repo "${name}" - repos: ${allChildren.join(", ")}`);
165
+ }
166
+ onlyChild = name;
167
+ childIn = rest.length ? rest.join("/") : undefined;
168
+ }
169
+ // Pass 1: run each child's ask; keep its hits + RAW top-hit coverage.
170
+ const runs = [];
171
+ for (const { child } of wg.loaded) {
172
+ if (onlyChild && child !== onlyChild)
173
+ continue;
174
+ let r;
175
+ try {
176
+ // Over-fetch per child so cross-child fusion has enough candidates to
177
+ // rank before the final `limit` slice.
178
+ r = ask(join(root, child), query, {
179
+ limit: Math.max(limit * 4, 20),
180
+ source: opts.source,
181
+ full: opts.full,
182
+ graphRank: opts.graphRank,
183
+ in: childIn,
184
+ });
185
+ }
186
+ catch {
187
+ continue; // corrupt child, or a sub-scope --in matching nothing here
188
+ }
189
+ if (r.hits.length === 0)
190
+ continue;
191
+ runs.push({ child, hits: r.hits, coverage: r.coverage ?? 0, coverageStrong: r.coverageStrong ?? 0 });
192
+ }
193
+ // Cross-child participation gate on match STRENGTH, not a lenient ratio.
194
+ // Per-child hit scores are each per-child-normalized (top ~1.0 everywhere),
195
+ // so feeding them to fuseScopes makes its gate vacuous across repos — a junk
196
+ // body-token collision would federate beside another repo's genuine hits.
197
+ // Gate: a child federates iff its top hit matched a query term in a NAME/PATH
198
+ // field (coverageStrong ≥ STRONG_FLOOR — not just an incidental body token)
199
+ // OR its overall coverage is broad enough to be real (≥ HIGH_FLOOR). A
200
+ // body-only collision has coverageStrong 0 and coverage ~0.3 → gated to
201
+ // alsoMatched. Both floors are absolute + scale-invariant (see their docs).
202
+ // The gate is a cross-child FAIRNESS mechanism: it stops a weak body-token
203
+ // collision in one repo from federating beside another repo's genuine hits.
204
+ // An explicit `--in <child>` removes all cross-child competition — the caller
205
+ // has already chosen the scope — so the gate must NOT apply there, or the
206
+ // `also matched: <child> — narrow with --in <child>` hint would lead to an
207
+ // empty result for exactly the weak child it points at. With `onlyChild` set,
208
+ // every run (there is at most one) survives, matching a standalone child ask.
209
+ const gatedOut = [];
210
+ const survivors = [];
211
+ for (const run of runs) {
212
+ if (onlyChild || run.coverageStrong >= STRONG_FLOOR || run.coverage >= HIGH_FLOOR)
213
+ survivors.push(run);
214
+ else
215
+ gatedOut.push({ scope: run.child, bestId: prefixPointer(run.child, run.hits[0].pointer) });
216
+ }
217
+ // Fuse the survivors' scope lists (within-child fusion is left untouched —
218
+ // each child already ran its own per-scope RRF).
219
+ const docs = [];
220
+ const back = new Map();
221
+ for (const { child, hits } of survivors) {
222
+ hits.forEach((hit, i) => {
223
+ const scope = hit.scope ? `${child}/${hit.scope}` : child;
224
+ const id = `${child} ${i}`;
225
+ docs.push({ id, scope, score: hit.score });
226
+ back.set(id, { child, hit });
227
+ });
228
+ }
229
+ const fused = fuseScopes(docs);
230
+ const hits = fused.ranked.slice(0, limit).map((rd) => {
231
+ const { child, hit } = back.get(rd.id);
232
+ return { ...hit, score: rd.score, scope: rd.scope, pointer: prefixPointer(child, hit.pointer) };
233
+ });
234
+ const alsoMatched = [...fused.alsoMatched, ...gatedOut];
235
+ const note = coverageNote(wg);
236
+ const result = { query, mode: hits.length ? "lexical" : "empty", hits };
237
+ if (hits.length) {
238
+ const federated = fused.federated.length ? fused.federated : [...new Set(hits.map((h) => h.scope))];
239
+ result.scopes = { federated, alsoMatched };
240
+ }
241
+ else {
242
+ result.note = `no matching nodes across ${wg.loaded.length} workspace repo(s) — try different words, or \`graft build\` at a child`;
243
+ }
244
+ if (note)
245
+ result.note = result.note ? `${result.note}\n${note}` : note;
246
+ return result;
247
+ }
248
+ /** Merge every child's `GrepResult` into one, prefixing group paths with the
249
+ * child dir and re-sorting by coupling (inDegree desc, path asc) across repos.
250
+ * In-degree stays each child's own — it comes from that child's graph. */
251
+ export function federateGrep(root, override, pattern, opts = {}) {
252
+ const wg = loadWorkspaceGraphs(root, override);
253
+ const groups = [];
254
+ let filesSearched = 0;
255
+ let totalHits = 0;
256
+ const truncated = { files: 0, hits: 0 };
257
+ let savedFiles = 0;
258
+ let savedChars = 0;
259
+ for (const { child, graph } of wg.loaded) {
260
+ const r = grepGraph(graph, join(root, child), pattern, {
261
+ ignoreCase: opts.ignoreCase,
262
+ fixed: opts.fixed,
263
+ });
264
+ filesSearched += r.filesSearched;
265
+ totalHits += r.totalHits;
266
+ truncated.files += r.truncated.files;
267
+ truncated.hits += r.truncated.hits;
268
+ if (r.saved) {
269
+ savedFiles += r.saved.files;
270
+ savedChars += r.saved.baselineChars;
271
+ }
272
+ for (const g of r.groups) {
273
+ groups.push({
274
+ ...g,
275
+ path: `${child}/${g.path}`,
276
+ symbol: g.symbol ? { ...g.symbol, path: `${child}/${g.symbol.path}` } : null,
277
+ });
278
+ }
279
+ }
280
+ groups.sort((a, b) => b.inDegree - a.inDegree || a.path.localeCompare(b.path));
281
+ const saved = savedChars > 0 ? { files: savedFiles, baselineChars: savedChars } : undefined;
282
+ const result = { pattern, filesSearched, totalHits, groups, truncated, saved };
283
+ return { result, coverage: coverageNote(wg) };
284
+ }
285
+ /** One `graft map` section per child (each child's own map, budget split evenly
286
+ * across the loaded children), joined under `<child>/` headers. */
287
+ export function federateMap(root, override, opts = {}) {
288
+ const wg = loadWorkspaceGraphs(root, override);
289
+ const perChild = opts.maxDirs !== undefined && wg.loaded.length > 0
290
+ ? Math.max(1, Math.floor(opts.maxDirs / wg.loaded.length))
291
+ : undefined;
292
+ const sections = wg.loaded.map(({ child, graph }) => {
293
+ const map = buildRepoMap(graph, perChild !== undefined ? { maxDirs: perChild } : {});
294
+ return `## ${child}/\n${formatRepoMap(map).trimEnd()}`;
295
+ });
296
+ const head = `workspace map — ${wg.loaded.length} repo(s)`;
297
+ const parts = [head, "", sections.join("\n\n")];
298
+ const cov = coverageNote(wg);
299
+ if (cov)
300
+ parts.push("", cov);
301
+ return parts.join("\n") + "\n";
302
+ }
303
+ /** Per-child drift status. `ok` is false when any BUILT child is stale — an
304
+ * unbuilt child is surfaced (coverage), never a failure. */
305
+ export function federateCheck(root, override) {
306
+ const wg = loadWorkspaceGraphs(root, override);
307
+ const lines = [`workspace check — ${wg.loaded.length + wg.missing.length} repo(s)`, ""];
308
+ let ok = true;
309
+ for (const { child } of wg.loaded) {
310
+ const g = checkGraph(join(root, child));
311
+ if (g.ok) {
312
+ lines.push(`${child}/: OK`);
313
+ }
314
+ else {
315
+ ok = false;
316
+ const bits = [];
317
+ if (g.added.length)
318
+ bits.push(`${g.added.length} added`);
319
+ if (g.removed.length)
320
+ bits.push(`${g.removed.length} removed`);
321
+ if (g.changed.length)
322
+ bits.push(`${g.changed.length} changed`);
323
+ if (g.stale.length)
324
+ bits.push(`${g.stale.length} stale`);
325
+ lines.push(`${child}/: STALE (${bits.join(", ")})`);
326
+ }
327
+ }
328
+ for (const child of wg.missing)
329
+ lines.push(`${child}/: not built (run graft build)`);
330
+ const cov = coverageNote(wg);
331
+ if (cov)
332
+ lines.push("", cov);
333
+ return { text: lines.join("\n") + "\n", ok };
334
+ }
335
+ /** Resolve a symbol across every child, grouped per child. Reuses the shared
336
+ * traverse-cli formatters so each block reads exactly like `graft callers`. */
337
+ export function federateCallers(root, override, symbol, opts = {}) {
338
+ const wg = loadWorkspaceGraphs(root, override);
339
+ const direction = opts.direction ?? "in";
340
+ const depth = opts.depth && opts.depth >= 1 ? Math.floor(opts.depth) : 1;
341
+ const showDepth = depth > 1;
342
+ const blocks = [];
343
+ let found = false;
344
+ for (const { child, graph } of wg.loaded) {
345
+ const matches = resolveSymbol(graph, symbol, opts.in ? { in: opts.in } : {});
346
+ if (matches.length === 0)
347
+ continue;
348
+ found = true;
349
+ const results = matches.map((m) => ({ symbol: m, hits: edgeWalk(graph, m, direction, depth) }));
350
+ const lines = [`## ${child}/`];
351
+ for (const { symbol: sym, hits } of results) {
352
+ lines.push(headerOf(sym));
353
+ if (hits.length === 0)
354
+ lines.push(looseNoteFor(direction, sym.name));
355
+ else
356
+ for (const h of hits)
357
+ lines.push(hitLine(direction, h, showDepth));
358
+ }
359
+ const body = lines.join("\n");
360
+ blocks.push(body + savingsFooter(body, callersSavings(graph, results)));
361
+ }
362
+ const cov = coverageNote(wg);
363
+ if (!found) {
364
+ const base = `no symbol "${symbol}" in any of the ${wg.loaded.length} workspace repo(s) — check spelling or run graft build`;
365
+ return { text: cov ? `${base}\n${cov}` : base, found: false };
366
+ }
367
+ let text = blocks.join("\n\n");
368
+ if (cov)
369
+ text += `\n\n${cov}`;
370
+ return { text, found: true };
371
+ }
372
+ /**
373
+ * Split a parent into a workspace: build each git child (via the supplied
374
+ * `buildChild` callback, so this stays free of any engine/LLM dependency),
375
+ * then REPLACE the parent's `graft/` with just `workspace.json`. `onStart`
376
+ * fires once — before any child is built — carrying whether this build is a
377
+ * mega-graph migration, so the caller can print the one-time split warning
378
+ * first, exactly as the spec requires.
379
+ *
380
+ * The child build writes into `<child>/graft/` and is byte-identical to
381
+ * building that child standalone (`buildChild` is just `buildGraph(childDir)`),
382
+ * because nothing about the parent path enters the child's build.
383
+ */
384
+ export async function splitWorkspace(root, override, buildChild, onStart) {
385
+ const children = discoverWorkspaceChildren(root).slice().sort();
386
+ const migrated = hasMegaGraph(root, override);
387
+ onStart?.({ children, migrated });
388
+ for (const child of children)
389
+ await buildChild(join(root, child), child);
390
+ clearParentGraft(root, override); // drop the mega-graph/.cache/cards…
391
+ writeWorkspace(root, { version: 1, children }, override); // …leaving ONLY workspace.json
392
+ return { children, migrated };
393
+ }
394
+ export { formatGrepResult, zeroHitNote };
395
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/graph/workspace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,cAAc,EACd,QAAQ,EACR,OAAO,EACP,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAkB,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,UA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B,YAAY,IAAI,MAAM,CAMrC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAGrC"}
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/hosts/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,eAAe,IAAI,MAAM,CAwCxC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAOnC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAMrC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAGrC"}
@@ -26,10 +26,14 @@ hotspots), no LLM, no key.
26
26
  to raw \`grep -rn\` only for unindexed files.
27
27
  - \`graft skeleton <file>\` → every definition's signature + span, ~10× cheaper
28
28
  than reading the file; use it to skim an API surface.
29
- - \`graft callers/callees <symbol>\` and \`graft impact <symbol> [-d N]\` give
30
- precomputed, exact edges — who calls/is called by a symbol, and the full
31
- blast radius — for structural questions, skip ranking and use these directly.
29
+ - \`graft callers <symbol>\` gives precomputed, exact edges — who calls this.
30
+ Add \`--direction out\` for what it calls, or \`--depth N\` to walk
31
+ transitively for the full blast radius. For structural questions, skip
32
+ ranking and use this directly.
32
33
  - Or browse: \`graft/INDEX.md\` lists every node; follow the links.
34
+ - Monorepos and folders of multiple repos rank fairly across sub-projects —
35
+ hits carry \`[scope/]\` labels naming which one they're from. Narrow with
36
+ \`graft ask "<task>" --in <scope>/\` once you know where you're working.
33
37
 
34
38
  If a returned span is truncated ("+N more lines"), open the file at that exact
35
39
  range before finalizing. Only open source files when a node genuinely lacks a
@@ -1 +1 @@
1
- {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/hosts/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;;;;EAIP,eAAe,EAAE;CAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO;;;EAGP,eAAe,EAAE;CAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,GAAG,eAAe,EAAE;CAC5B,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/hosts/instructions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,eAAe;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO;;;;EAIP,eAAe,EAAE;CAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO;;;EAGP,eAAe,EAAE;CAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,GAAG,eAAe,EAAE;CAC5B,CAAC;AACF,CAAC"}
@@ -3,6 +3,11 @@ export interface McpWrite {
3
3
  path: string;
4
4
  action: 'created' | 'updated' | 'unchanged' | 'skipped-unparseable';
5
5
  }
6
+ export declare const SERVER_ENTRY: {
7
+ command: string;
8
+ args: string[];
9
+ };
10
+ export declare function mergeJsonKey(id: string, path: string, topKey: string, entry: object): McpWrite;
6
11
  export declare function registerMcpConfigs(repo: string, ids: string[], opts?: {
7
12
  home?: string;
8
13
  }): McpWrite[];
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/hosts/mcp-config.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,qBAAqB,CAAC;CACrE;AA0CD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3B,QAAQ,EAAE,CA2BZ"}
1
+ {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/hosts/mcp-config.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,qBAAqB,CAAC;CACrE;AAED,eAAO,MAAM,YAAY;;;CAA6D,CAAC;AAOvF,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAoB9F;AAaD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3B,QAAQ,EAAE,CA2BZ"}
@@ -6,7 +6,7 @@
6
6
  import { readFileSync, writeFileSync, mkdirSync, existsSync, statSync } from 'node:fs';
7
7
  import { dirname, join } from 'node:path';
8
8
  import { homedir } from 'node:os';
9
- const SERVER_ENTRY = { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] };
9
+ export const SERVER_ENTRY = { command: 'npx', args: ['-y', '@nanonets/graft', 'mcp'] };
10
10
  const OPENCODE_ENTRY = { type: 'local', command: ['npx', '-y', '@nanonets/graft', 'mcp'], enabled: true };
11
11
  function dirExists(p) {
12
12
  try {
@@ -16,7 +16,7 @@ function dirExists(p) {
16
16
  return false;
17
17
  }
18
18
  }
19
- function mergeJsonKey(id, path, topKey, entry) {
19
+ export function mergeJsonKey(id, path, topKey, entry) {
20
20
  let root = {};
21
21
  const existed = existsSync(path);
22
22
  if (existed) {
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-config.js","sourceRoot":"","sources":["../../src/hosts/mcp-config.ts"],"names":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AM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAWD,eAAO,MAAM,KAAK,EAAE,OAAO,EAmG1B,CAAC;AAiBF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAwFpC"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAQD,eAAO,MAAM,KAAK,EAAE,OAAO,EAoF1B,CAAC;AA2EF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,CAAC,EAAE,MAAM,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAiFpC"}