layermap 0.1.16 → 0.1.17

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/cli.mjs CHANGED
@@ -22606,11 +22606,10 @@ function mapChangeImpact(store, working, base, changes, project) {
22606
22606
  if (file2.status !== "DELETED") tracer.test(file2.path, void 0, "changed in this diff", 1);
22607
22607
  continue;
22608
22608
  }
22609
- if (!objects2.length) {
22610
- if (file2.status !== "DELETED" && kind)
22611
- unclear.push(`${file2.path} changed (${kind}): its effects are not mapped`);
22612
- continue;
22613
- }
22609
+ const analyzed = objects2.length > 0 && mapLanguageOf(file2.path) !== void 0;
22610
+ if (!analyzed && file2.status !== "DELETED" && kind)
22611
+ unclear.push(`${file2.path} changed (${kind}): its effects are not mapped`);
22612
+ if (!objects2.length) continue;
22614
22613
  const hits = /* @__PURE__ */ new Set();
22615
22614
  let topLevel = false;
22616
22615
  const inFile = declarations(graph, file2.path);
@@ -22641,7 +22640,7 @@ function mapChangeImpact(store, working, base, changes, project) {
22641
22640
  unclear.push(
22642
22641
  `the registration of ${JSON.stringify(relation.argument)} at ${relation.anchor.path}:${relation.anchor.startLine} changed; check that the route still reaches the right handler`
22643
22642
  );
22644
- if (topLevel && file2.status !== "ADDED")
22643
+ if (analyzed && topLevel && file2.status !== "ADDED")
22645
22644
  unclear.push(`top-level code of ${file2.path} changed (imports, constants or registrations)`);
22646
22645
  importerTests(graph, objects2, tracer);
22647
22646
  sameDirectoryTests(store, working, file2.path, tracer);
@@ -22887,6 +22886,22 @@ function routesIn(graph, path13) {
22887
22886
  return routes;
22888
22887
  }
22889
22888
  var routePath = (route) => route.slice(route.indexOf("/"));
22889
+ async function checkMapChanges(input, signal) {
22890
+ const { index, project, working } = input;
22891
+ const changes = await readMapChanges(project, input.base, signal);
22892
+ await index.ensureIndex(working, signal);
22893
+ const base = changes.files.some(
22894
+ (file2) => file2.basePath !== void 0 && (file2.baseLines.length || file2.baseText !== void 0)
22895
+ ) ? await input.baseVersion(changes.commit, signal) : void 0;
22896
+ const impact = mapChangeImpact(index.store, working, base, changes, project);
22897
+ return {
22898
+ text: mapChangesText(
22899
+ changes,
22900
+ impact,
22901
+ await mapRouteClients(project, index.store, working, impact, signal)
22902
+ )
22903
+ };
22904
+ }
22890
22905
  async function mapRouteClients(project, store, working, impact, signal) {
22891
22906
  const affected = impact.entries.filter(
22892
22907
  (entry) => entry.route && entry.certain && entry.chain.length <= 2
@@ -23176,19 +23191,16 @@ var LayerMap = class _LayerMap {
23176
23191
  * see. The base commit's map is built only when the diff removes or changes lines there.
23177
23192
  */
23178
23193
  async checkChanges(input, signal) {
23179
- const changes = await readMapChanges(this.project, input.base ?? "HEAD", signal);
23180
- const working = await this.refresh(signal);
23181
- const base = changes.files.some(
23182
- (file2) => file2.basePath !== void 0 && (file2.baseLines.length || file2.baseText !== void 0)
23183
- ) ? await this.versionAt(changes.commit, signal) : void 0;
23184
- const impact = mapChangeImpact(this.store, working, base, changes, this.project);
23185
- return {
23186
- text: mapChangesText(
23187
- changes,
23188
- impact,
23189
- await mapRouteClients(this.project, this.store, working, impact, signal)
23190
- )
23191
- };
23194
+ return checkMapChanges(
23195
+ {
23196
+ index: this.index,
23197
+ project: this.project,
23198
+ working: await this.refresh(signal),
23199
+ base: input.base ?? "HEAD",
23200
+ baseVersion: (commit, baseSignal) => this.versionAt(commit, baseSignal)
23201
+ },
23202
+ signal
23203
+ );
23192
23204
  }
23193
23205
  /**
23194
23206
  * Builds the map of a base commit (HEAD by default) ahead of a change check, so the check after an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layermap",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "mcpName": "io.github.coffeecoproject/layermap",
5
5
  "description": "A layered map of a codebase for coding agents: directories, modules and call chains across TypeScript, JavaScript, Go, Python and Java.",
6
6
  "license": "Apache-2.0",
package/pi/layermap.mjs CHANGED
@@ -128,7 +128,7 @@ export default function layermap(pi) {
128
128
  if (server && !server.dead) return server;
129
129
  starting ??= (async () => {
130
130
  const next = new MapServer(cwd);
131
- const tools = await next.start("0.1.16");
131
+ const tools = await next.start("0.1.17");
132
132
  for (const tool of tools) {
133
133
  if (registered.has(tool.name)) continue;
134
134
  registered.add(tool.name);