@tendrilapp/cli 0.1.47 → 0.1.48

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 (2) hide show
  1. package/dist/tendril.js +24 -7
  2. package/package.json +1 -1
package/dist/tendril.js CHANGED
@@ -842,9 +842,12 @@ import { existsSync } from "node:fs";
842
842
  import path from "node:path";
843
843
  import { z as z4 } from "zod";
844
844
  function resolveRepEnvelopePath(setDir, slug, kind) {
845
- const mcp = path.join(setDir, slug, kind === "metadata" ? "get_metadata.json" : "get_screenshot.json");
845
+ return resolveRepEnvelopePathIn(path.join(setDir, slug), kind);
846
+ }
847
+ function resolveRepEnvelopePathIn(repDir, kind) {
848
+ const mcp = path.join(repDir, kind === "metadata" ? "get_metadata.json" : "get_screenshot.json");
846
849
  if (existsSync(mcp)) return mcp;
847
- const rest = path.join(setDir, slug, kind === "metadata" ? REST_METADATA_FILE : REST_SCREENSHOT_FILE);
850
+ const rest = path.join(repDir, kind === "metadata" ? REST_METADATA_FILE : REST_SCREENSHOT_FILE);
848
851
  return existsSync(rest) ? rest : mcp;
849
852
  }
850
853
  function repEnvelopeExists(setDir, slug, kind) {
@@ -1670,7 +1673,7 @@ function effectivelyInvisible(node) {
1670
1673
  return false;
1671
1674
  }
1672
1675
  function repVisibility(setDir, slug) {
1673
- const file = path3.join(setDir, slug, "get_metadata.json");
1676
+ const file = resolveRepEnvelopePathIn(path3.join(setDir, slug), "metadata");
1674
1677
  if (!existsSync3(file)) return void 0;
1675
1678
  let roots;
1676
1679
  try {
@@ -1721,6 +1724,7 @@ var init_visibility = __esm({
1721
1724
  "packages/figma/src/recording/visibility.ts"() {
1722
1725
  "use strict";
1723
1726
  init_normalize();
1727
+ init_rest_envelopes();
1724
1728
  init_session();
1725
1729
  normalizedLayerName = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, "");
1726
1730
  invisibleInEveryPose = (v) => v.presentIn.length > 0 && v.visibleIn.length === 0;
@@ -1778,7 +1782,7 @@ function buildComposeIndex(roots, depth = 3) {
1778
1782
  for (const rep of manifest.reps) {
1779
1783
  variantNodeIds.add(rep.nodeId);
1780
1784
  repSlugByVariantNode.set(rep.nodeId, rep.slug);
1781
- const metaFile = path4.join(dir, rep.slug, "get_metadata.json");
1785
+ const metaFile = resolveRepEnvelopePathIn(path4.join(dir, rep.slug), "metadata");
1782
1786
  if (!existsSync4(metaFile)) continue;
1783
1787
  try {
1784
1788
  const text = envelopeTextContent(JSON.parse(readFileSync3(metaFile, "utf8")));
@@ -1838,7 +1842,7 @@ function emissionTails(setDir, repSlug) {
1838
1842
  return byHead;
1839
1843
  }
1840
1844
  function hostInstances(setDir, repSlug) {
1841
- const metaFile = path4.join(setDir, repSlug, "get_metadata.json");
1845
+ const metaFile = resolveRepEnvelopePathIn(path4.join(setDir, repSlug), "metadata");
1842
1846
  if (!existsSync4(metaFile)) return [];
1843
1847
  try {
1844
1848
  const text = envelopeTextContent(JSON.parse(readFileSync3(metaFile, "utf8")));
@@ -2117,6 +2121,7 @@ var init_compose = __esm({
2117
2121
  "packages/figma/src/recording/compose.ts"() {
2118
2122
  "use strict";
2119
2123
  init_session();
2124
+ init_rest_envelopes();
2120
2125
  init_normalize();
2121
2126
  init_visibility();
2122
2127
  CompositionEntrySchema = z6.object({
@@ -11631,7 +11636,8 @@ var init_brief = __esm({
11631
11636
  import { existsSync as existsSync29, readFileSync as readFileSync26, readdirSync as readdirSync10 } from "node:fs";
11632
11637
  import path36 from "node:path";
11633
11638
  function repText(set, rep, tool) {
11634
- const env = JSON.parse(readFileSync26(path36.join(set, rep, `${tool}.json`), "utf8"));
11639
+ const file = tool === "get_metadata" ? resolveRepEnvelopePath(set, rep, "metadata") : tool === "get_screenshot" ? resolveRepEnvelopePath(set, rep, "screenshot") : path36.join(set, rep, `${tool}.json`);
11640
+ const env = JSON.parse(readFileSync26(file, "utf8"));
11635
11641
  return tool === "get_design_context" ? envelopeFirstTextPart(env) : envelopeTextContent(env);
11636
11642
  }
11637
11643
  function refPngDims(set, rep) {
@@ -11791,7 +11797,6 @@ var init_segments = __esm({
11791
11797
  "packages/generate/src/segments.ts"() {
11792
11798
  "use strict";
11793
11799
  init_src();
11794
- init_src();
11795
11800
  cssIdent = (name) => name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
11796
11801
  }
11797
11802
  });
@@ -17246,6 +17251,17 @@ function resolveEngineTask(opts, callerCwd) {
17246
17251
  const registry = TASKS[opts.taskOrSet];
17247
17252
  if (registry !== void 0 && !isSet) return { task: registry, name: opts.taskOrSet, ref: opts.taskOrSet, disclosures: [], interactionEvidence: void 0 };
17248
17253
  if (isSet) {
17254
+ const manifest = loadManifest(asPath);
17255
+ const missing = manifest.reps.filter(
17256
+ (r) => !repEnvelopeExists(asPath, r.slug, "metadata") || !existsSync40(path50.join(asPath, r.slug, "get_design_context.json"))
17257
+ );
17258
+ if (missing.length > 0) {
17259
+ fail(opts, ExitCode.RecordingIncomplete, {
17260
+ error: `recording set ${asPath} is missing envelopes for ${missing.length} rep(s): ${missing.slice(0, 3).map((r) => r.slug).join(", ")}${missing.length > 3 ? ", \u2026" : ""}`,
17261
+ code: "recording-incomplete",
17262
+ remediation: `Resume the recording (\`${tendrilCommand(`record next --set ${asPath}`)}\`) until \`${tendrilCommand(`record status --set ${asPath}`)}\` reports the set complete, then re-run this.`
17263
+ });
17264
+ }
17249
17265
  try {
17250
17266
  const authored = authorTaskFromSet(asPath);
17251
17267
  for (const d of authored.disclosures) warn(opts, d);
@@ -17702,6 +17718,7 @@ var init_engine2 = __esm({
17702
17718
  "packages/cli/src/commands/engine.ts"() {
17703
17719
  "use strict";
17704
17720
  init_src3();
17721
+ init_src();
17705
17722
  init_src7();
17706
17723
  init_src4();
17707
17724
  init_environment();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tendrilapp/cli",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "description": "Figma design systems → verified React components. CLI ruler + MCP server.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",