grafta 0.0.0-stage → 0.1.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.
- package/README.md +14 -2
- package/bin/grafta.js +28 -0
- package/package.json +17 -4
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# grafta
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Figma's file format for your agent: an MCP server that lets a model read and
|
|
4
|
+
write `.fig` files, exactly and offline.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx -y grafta mcp # start the server on stdio
|
|
8
|
+
claude mcp add grafta -- npx -y grafta mcp # register it with Claude Code
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This package runs the prebuilt binary for your platform (macOS, Linux, Windows
|
|
12
|
+
on x64; macOS and Linux on arm64), installed as an optional dependency. Nothing
|
|
13
|
+
is downloaded at run time.
|
|
14
|
+
|
|
15
|
+
Documentation: https://github.com/n0ss4/grafta
|
package/bin/grafta.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs the grafta binary npm installed for this platform, as one of the
|
|
3
|
+
// optional grafta-<os>-<cpu> packages. Nothing is downloaded here: stdio passes
|
|
4
|
+
// straight through, which `grafta mcp` needs, and so does the exit code.
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
const { spawnSync } = require("node:child_process");
|
|
8
|
+
|
|
9
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
10
|
+
const executable = process.platform === "win32" ? "grafta.exe" : "grafta";
|
|
11
|
+
|
|
12
|
+
let binary;
|
|
13
|
+
try {
|
|
14
|
+
binary = require.resolve(`grafta-${platform}/bin/${executable}`);
|
|
15
|
+
} catch {
|
|
16
|
+
console.error(
|
|
17
|
+
`grafta: no prebuilt binary for ${platform}.\n` +
|
|
18
|
+
"Install one another way: https://github.com/n0ss4/grafta#install, or: cargo install grafta"
|
|
19
|
+
);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
24
|
+
if (result.error) {
|
|
25
|
+
console.error(`grafta: cannot run ${binary}: ${result.error.message}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grafta",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Figma's file format for your agent: an MCP server that reads and writes .fig files, exactly and offline.",
|
|
5
|
+
"keywords": ["figma", "fig", "mcp", "mcp-server", "design", "agent", "claude"],
|
|
6
|
+
"homepage": "https://n0ss4.github.io/grafta",
|
|
7
|
+
"repository": { "type": "git", "url": "git+https://github.com/n0ss4/grafta.git" },
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"bin": { "grafta": "bin/grafta.js" },
|
|
10
|
+
"files": ["bin"],
|
|
11
|
+
"engines": { "node": ">=18" },
|
|
12
|
+
"optionalDependencies": {
|
|
13
|
+
"grafta-darwin-arm64": "0.1.0",
|
|
14
|
+
"grafta-darwin-x64": "0.1.0",
|
|
15
|
+
"grafta-linux-arm64": "0.1.0",
|
|
16
|
+
"grafta-linux-x64": "0.1.0",
|
|
17
|
+
"grafta-win32-x64": "0.1.0"
|
|
18
|
+
}
|
|
19
|
+
}
|