@ject-5-fe/figma-plugin 0.1.4 → 0.1.5

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.
@@ -98,32 +98,44 @@ server.tool(
98
98
  }
99
99
  }
100
100
  );
101
+ server.registerResource(
102
+ "figma-selection",
103
+ new import_mcp.ResourceTemplate("figma://selection/{sessionId}", { list: void 0 }),
104
+ {
105
+ title: "Figma Selection Result",
106
+ description: "Stores the full Figma selection data when it's too large to return inline"
107
+ },
108
+ async (uri) => {
109
+ const result = await sendCommandToFigma("get_selection");
110
+ return {
111
+ contents: [
112
+ {
113
+ uri: uri.href,
114
+ mimeType: "application/json",
115
+ text: typeof result === "string" ? result : JSON.stringify(result, null, 2)
116
+ }
117
+ ]
118
+ };
119
+ }
120
+ );
101
121
  server.tool(
102
122
  "get_selection",
103
123
  "Get information about the current selection in Figma",
104
124
  {},
105
125
  async () => {
106
- try {
107
- const result = await sendCommandToFigma("get_selection");
108
- const compressed = compressData(result);
109
- return {
110
- content: [
111
- {
112
- type: "text",
113
- text: compressed
114
- }
115
- ]
116
- };
117
- } catch (error) {
118
- return {
119
- content: [
120
- {
121
- type: "text",
122
- text: `Error getting selection: ${error instanceof Error ? error.message : String(error)}`
123
- }
124
- ]
125
- };
126
- }
126
+ const resourceUri = "figma://selection/current";
127
+ return {
128
+ content: [
129
+ {
130
+ // 큰 데이터를 안 넣고, 링크만 넘겨줍니다
131
+ type: "resource_link",
132
+ uri: resourceUri,
133
+ name: "Current Figma Selection",
134
+ mimeType: "application/json",
135
+ description: "Full raw selection JSON from Figma"
136
+ }
137
+ ]
138
+ };
127
139
  }
128
140
  );
129
141
  server.tool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ject-5-fe/figma-plugin",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "plugma dev",