figma-relai 0.7.1 → 0.7.3

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.
@@ -16,7 +16,7 @@ function createServer() {
16
16
  return new McpServer(
17
17
  {
18
18
  name: "Relai",
19
- version: "0.7.1"
19
+ version: "0.7.3"
20
20
  },
21
21
  {
22
22
  instructions: `
@@ -889,11 +889,7 @@ async function resolveFileIdentity(sendCommand) {
889
889
  statuses.push(res.status);
890
890
  const meta = res.json.meta ?? {};
891
891
  if (res.ok && typeof meta.file_key === "string") {
892
- main = {
893
- fileKey: meta.file_key,
894
- fileName: meta.file_name ?? rootName,
895
- via: c.key
896
- };
892
+ main = { fileKey: meta.file_key, via: c.key };
897
893
  break;
898
894
  }
899
895
  }
@@ -905,16 +901,18 @@ async function resolveFileIdentity(sendCommand) {
905
901
  denied ? "Figma rejected the token on every probe (401/403) \u2014 it is expired or lacks the file content read scope. Re-run `npx -y figma-relai@latest login`." : "None of this file's published component keys resolved."
906
902
  );
907
903
  }
908
- const identity = { fileKey: main.fileKey, fileName: main.fileName };
909
- if (rootName && rootName !== main.fileName) {
910
- const res = await figmaApi(token, `/files/${main.fileKey}?branch_data=true&depth=1`);
911
- const branches = res.json.branches ?? [];
904
+ const file = await figmaApi(token, `/files/${main.fileKey}?branch_data=true&depth=1`);
905
+ const identity = {
906
+ fileKey: main.fileKey,
907
+ fileName: typeof file.json.name === "string" ? file.json.name : rootName
908
+ };
909
+ if (rootName && rootName !== identity.fileName) {
910
+ const branches = file.json.branches ?? [];
912
911
  const hit = branches.find((b) => b.name === rootName);
913
912
  if (hit?.key) {
914
913
  identity.branchKey = hit.key;
915
914
  identity.branchName = hit.name;
916
915
  }
917
- if (typeof res.json.name === "string") identity.fileName = res.json.name;
918
916
  }
919
917
  try {
920
918
  await sendCommand("set_file_identity", { identity, componentKey: main.via });
@@ -4446,4 +4444,4 @@ export {
4446
4444
  listToolCatalog,
4447
4445
  registerPrompts
4448
4446
  };
4449
- //# sourceMappingURL=chunk-DPDMRY72.js.map
4447
+ //# sourceMappingURL=chunk-BEGACSIP.js.map