claude-figjam 1.0.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/tools.js +21 -9
  2. package/package.json +1 -1
package/dist/tools.js CHANGED
@@ -45,7 +45,7 @@ export const deleteNodesSchema = z.object({
45
45
  node_ids: z.union([z.string(), z.array(z.string())]),
46
46
  });
47
47
  export function registerTools(server, bridge) {
48
- server.tool("figjam_read_board", "Returns full board state: all nodes with IDs, types, positions, content, and colors.", {}, async () => {
48
+ server.tool("figjam_read_board", "Returns full board state: all nodes with IDs, types, positions, content, and colors. ALWAYS call this before making any changes to understand the current state of the board. After a page switch, call this again to confirm you are on the correct page before writing.", {}, async () => {
49
49
  try {
50
50
  const result = await bridge.execute("read_board", {});
51
51
  return {
@@ -62,7 +62,7 @@ export function registerTools(server, bridge) {
62
62
  };
63
63
  }
64
64
  });
65
- server.tool("figjam_create_node", "Creates any FigJam node (sticky, shape, text, section, table, code_block). Returns the new node ID.", {
65
+ server.tool("figjam_create_node", "Creates any FigJam node (sticky, shape, text, section, table, code_block). Returns the new node ID. IMPORTANT: For multi-line content, use actual newline characters in the string — do NOT use \\n escape sequences, as they will render literally. LAYOUT RULES: Use a 4px grid — all x/y positions and width/height values must be multiples of 4. Minimum vertical gap between stacked nodes = 80px. Minimum horizontal gap between pipeline stages = 328px. Use shape nodes as group containers instead of sections (sections cannot be resized programmatically). Container pattern: create container shape first (color #f0f2ff, 48px padding all sides), then child nodes on top. When a node connects both up and down in a column, place the upstream target ABOVE the hub node to separate TOP/BOTTOM slot usage. width+height must both be passed together to resize — passing only one is silently ignored. Decision nodes (branching logic) should use shape=diamond and be positioned as fan-out hubs far to the left of all their branch targets.", {
66
66
  type: z.enum([
67
67
  "sticky",
68
68
  "shape",
@@ -71,14 +71,22 @@ export function registerTools(server, bridge) {
71
71
  "table",
72
72
  "code_block",
73
73
  ]),
74
- content: z.string().optional().describe("Text content"),
74
+ content: z
75
+ .string()
76
+ .optional()
77
+ .describe("Text content. Use real newline characters for line breaks, not \\n."),
75
78
  x: z.number().optional().describe("Canvas x position"),
76
79
  y: z.number().optional().describe("Canvas y position"),
77
80
  width: z.number().optional(),
78
81
  height: z.number().optional(),
79
82
  color: z.string().optional().describe("Hex color"),
83
+ font_size: z
84
+ .number()
85
+ .optional()
86
+ .describe("Font size in pixels (text nodes only)"),
80
87
  shape: z
81
88
  .enum([
89
+ "rounded_rectangle",
82
90
  "square",
83
91
  "rectangle",
84
92
  "ellipse",
@@ -89,7 +97,7 @@ export function registerTools(server, bridge) {
89
97
  "cross",
90
98
  ])
91
99
  .optional()
92
- .describe("Required when type=shape"),
100
+ .describe("Shape style when type=shape. Defaults to rounded_rectangle if omitted."),
93
101
  rows: z
94
102
  .number()
95
103
  .int()
@@ -122,7 +130,7 @@ export function registerTools(server, bridge) {
122
130
  };
123
131
  }
124
132
  });
125
- server.tool("figjam_create_connector", "Draws a connector (arrow/line) between two existing nodes by their IDs.", {
133
+ server.tool("figjam_create_connector", "Draws a connector (arrow/line) between two existing nodes by their IDs. LAYOUT RULES: Always use style=elbowed (default) — elbowed connectors route around nodes better than curved. For fan-out from a hub node, place the hub far enough left/right that |dx| > |dy| for ALL targets, forcing clean horizontal routing. When adding a node to an existing column, restack ALL column nodes with even 80px gaps. Cross-layer connectors that would cut through container shapes are a layout problem — fix by repositioning nodes or using annotation instead of drawing the connector. CONNECTOR SEMANTICS: only use connectors for data flow relationships. Configuration or contextual relationships should be annotated in the node label instead (e.g. '⚙ configures X') — connectors imply flow. CONNECTOR LABELS: always label decision branch connectors with the branch condition (e.g. '2D image', 'video', '>250MB'). Label key flow transitions to describe what changed (e.g. 'registers asset', 'thumbnail_path set'). Labels are not needed on obvious convergence arrows where multiple paths merge to a single result node.", {
126
134
  from_id: z.string().describe("Source node ID"),
127
135
  to_id: z.string().describe("Target node ID"),
128
136
  style: z
@@ -155,11 +163,15 @@ export function registerTools(server, bridge) {
155
163
  server.tool("figjam_update_node", "Edit any property of an existing node. Pass only the fields that need to change.", {
156
164
  node_id: z.string().describe("ID of the node to update"),
157
165
  content: z.string().optional(),
158
- x: z.number().optional(),
159
- y: z.number().optional(),
160
- width: z.number().optional(),
161
- height: z.number().optional(),
166
+ x: z.coerce.number().optional(),
167
+ y: z.coerce.number().optional(),
168
+ width: z.coerce.number().optional(),
169
+ height: z.coerce.number().optional(),
162
170
  color: z.string().optional().describe("Hex color"),
171
+ font_size: z.coerce
172
+ .number()
173
+ .optional()
174
+ .describe("Font size in pixels (text nodes only)"),
163
175
  }, async (params) => {
164
176
  try {
165
177
  const result = await bridge.execute("update_node", params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-figjam",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server for live FigJam board editing from Claude Code",
5
5
  "type": "module",
6
6
  "bin": {