@majeanson/lac 3.0.4 → 3.1.1

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/mcp.mjs CHANGED
@@ -8164,9 +8164,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
8164
8164
  type: "text",
8165
8165
  text: `Feature "${featureKey}" not found.`
8166
8166
  }] };
8167
+ const childrenOf = /* @__PURE__ */ new Map();
8168
+ for (const { feature } of features) {
8169
+ const parent = feature.lineage?.parent;
8170
+ if (parent) {
8171
+ const existing = childrenOf.get(parent) ?? [];
8172
+ existing.push(feature.featureKey);
8173
+ childrenOf.set(parent, existing);
8174
+ }
8175
+ }
8167
8176
  return { content: [{
8168
8177
  type: "text",
8169
- text: buildLineageTree(root, featureMap, 0)
8178
+ text: buildLineageTree(root, featureMap, childrenOf, 0)
8170
8179
  }] };
8171
8180
  }
8172
8181
  case "lint_workspace": {
@@ -8331,10 +8340,10 @@ function formatFeatureSummary(feature) {
8331
8340
  if (feature.lineage?.children?.length) lines.push(`Children : ${feature.lineage.children.join(", ")}`);
8332
8341
  return lines.join("\n");
8333
8342
  }
8334
- function buildLineageTree(feature, map, depth) {
8335
- return [`${" ".repeat(depth)}${statusIcon(feature.status)} ${feature.featureKey} (${feature.status}) — ${feature.title}`, ...(feature.lineage?.children ?? []).flatMap((key) => {
8343
+ function buildLineageTree(feature, map, childrenOf, depth) {
8344
+ return [`${" ".repeat(depth)}${statusIcon(feature.status)} ${feature.featureKey} (${feature.status}) — ${feature.title}`, ...(childrenOf.get(feature.featureKey) ?? feature.lineage?.children ?? []).flatMap((key) => {
8336
8345
  const child = map.get(key);
8337
- return child ? [buildLineageTree(child, map, depth + 1)] : [];
8346
+ return child ? [buildLineageTree(child, map, childrenOf, depth + 1)] : [];
8338
8347
  })].join("\n");
8339
8348
  }
8340
8349
  function statusIcon(status) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majeanson/lac",
3
- "version": "3.0.4",
3
+ "version": "3.1.1",
4
4
  "description": "CLI for life-as-code — feature provenance tracking from the terminal",
5
5
  "license": "MIT",
6
6
  "repository": {