@ufira/vibma 0.3.0 → 0.3.2-rc.2

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/dist/mcp.js CHANGED
@@ -246,7 +246,10 @@ var sectionItem = z6.object({
246
246
  y: yPos,
247
247
  width: z6.coerce.number().optional().describe("Width (default: 500)"),
248
248
  height: z6.coerce.number().optional().describe("Height (default: 500)"),
249
- parentId
249
+ parentId,
250
+ fillColor: flexJson(colorRgba).optional().describe("Fill color. Default: no fill (transparent)."),
251
+ fillStyleName: z6.string().optional().describe("Apply a fill paint style by name (case-insensitive)."),
252
+ fillVariableId: z6.string().optional().describe("Bind a color variable to the fill.")
250
253
  });
251
254
  var svgItem = z6.object({
252
255
  svg: z6.string().describe("SVG markup string"),
@@ -258,7 +261,7 @@ var svgItem = z6.object({
258
261
  var tools5 = [
259
262
  {
260
263
  name: "create_section",
261
- description: "Create section nodes to organize content on the canvas.",
264
+ description: "Create section nodes to organize content on the canvas. Default: no fill (transparent).",
262
265
  schema: { items: flexJson(z6.array(sectionItem)).describe("Array of sections to create"), depth },
263
266
  tier: "create"
264
267
  },
@@ -355,8 +358,8 @@ var textItem = z8.object({
355
358
  var tools7 = [
356
359
  {
357
360
  name: "create_text",
358
- description: "Create text nodes. Max 10 per batch. Prefer textStyleName for typography and fontColorStyleName or fontColorVariableId for color \u2014 hardcoded values skip design tokens. Supports custom fonts via fontFamily.",
359
- schema: { items: flexJson(z8.array(textItem).max(10)).describe("Array of text nodes to create (max 10)"), depth },
361
+ description: "Create text nodes. Prefer textStyleName for typography and fontColorStyleName or fontColorVariableId for color \u2014 hardcoded values skip design tokens. Supports custom fonts via fontFamily.",
362
+ schema: { items: flexJson(z8.array(textItem)).describe("Array of text nodes to create"), depth },
360
363
  tier: "create"
361
364
  }
362
365
  ];
@@ -419,8 +422,9 @@ var patchNodeItem = z10.object({
419
422
  // Appearance (nested)
420
423
  fill: flexJson(z10.object({
421
424
  color: flexJson(colorRgba).optional(),
422
- styleName: z10.string().optional().describe("Paint style name (preferred over color)")
423
- })).optional().describe("Fill color or style"),
425
+ styleName: z10.string().optional().describe("Paint style name (preferred over color)"),
426
+ clear: flexBool(z10.boolean()).optional().describe("Set true to remove all fills")
427
+ })).optional().describe("Fill color, style, or clear"),
424
428
  stroke: flexJson(z10.object({
425
429
  color: flexJson(colorRgba).optional(),
426
430
  weight: z10.coerce.number().positive().optional().describe("Stroke weight"),
@@ -881,7 +885,8 @@ var componentItem = z17.object({
881
885
  itemSpacing: z17.coerce.number().optional().describe("Spacing between children (default: 0)")
882
886
  });
883
887
  var fromNodeItem = z17.object({
884
- nodeId
888
+ nodeId,
889
+ exposeText: flexBool(z17.boolean()).default(true).describe("Auto-expose text children as editable TEXT properties and bind them (default: true). Set false to skip.")
885
890
  });
886
891
  var combineItem = z17.object({
887
892
  componentIds: flexJson(z17.array(z17.string())).describe("Component IDs to combine (min 2)"),
@@ -919,16 +924,16 @@ var tools15 = [
919
924
  description: `CRUD endpoint for components.
920
925
  create \u2192 {type, items, depth?} \u2192 {results: [{id}, ...]}
921
926
  type 'component': create from scratch with layout/style params
922
- type 'from_node': convert existing nodes to components
927
+ type 'from_node': convert existing nodes to components. Text children are auto-exposed as editable properties by default (exposeText: true) \u2014 instances can set text directly via properties.
923
928
  type 'variant_set': combine components into variant sets
924
929
  get \u2192 {id, fields?} \u2192 component object (full detail, field-filterable)
925
930
  list \u2192 {name?, setsOnly?, fields?, offset?, limit?} \u2192 paginated stubs
926
- update \u2192 {items: [{id, propertyName, type, defaultValue}]} \u2192 {results: ['ok', ...]}`,
931
+ update \u2192 {items: [{id, propertyName, type, defaultValue}]} \u2192 creates property AND binds matching text node automatically`,
927
932
  schema: (caps2) => endpointSchema(
928
933
  ["create", "get", "list", "update"],
929
934
  caps2,
930
935
  {
931
- items: flexJson(z17.array(z17.any())).optional().describe("create (component): [{name, parentId?, ...layout}]. create (from_node): [{nodeId}]. create (variant_set): [{componentIds, name?}]. update: [{id, propertyName, type, defaultValue}]."),
936
+ items: flexJson(z17.array(z17.any())).optional().describe("create (component): [{name, parentId?, ...layout}]. create (from_node): [{nodeId, exposeText?}]. create (variant_set): [{componentIds, name?}]. update: [{id, propertyName, type, defaultValue}]."),
932
937
  type: z17.enum(["component", "from_node", "variant_set"]).optional().describe("Create type. Required for create: 'component' (from scratch), 'from_node' (convert existing), 'variant_set' (combine as variants)."),
933
938
  depth,
934
939
  name: z17.string().optional().describe("Filter list by name (case-insensitive substring)."),
@@ -1207,6 +1212,45 @@ Transfer content overrides from a source instance to target instances.
1207
1212
  description: "Strategy for transferring overrides between component instances in Figma"
1208
1213
  })
1209
1214
  );
1215
+ server2.registerPrompt(
1216
+ "missing_tools",
1217
+ { description: "Why create or edit tools are missing and how to fix it" },
1218
+ () => ({
1219
+ messages: [{
1220
+ role: "assistant",
1221
+ content: {
1222
+ type: "text",
1223
+ text: `# Missing Create / Edit Tools
1224
+
1225
+ If the user asks you to create or modify something in Figma but you cannot find tools like \`create_frame\`, \`create_text\`, \`patch_nodes\`, \`delete_node\`, or \`set_text_content\`, the MCP server was started without the correct access tier flag.
1226
+
1227
+ Vibma filters tools at startup based on CLI flags passed in the MCP config \`args\` array:
1228
+
1229
+ | Flag | Tools available |
1230
+ |------|----------------|
1231
+ | _(none)_ | Read-only (inspect, search, export) |
1232
+ | \`--create\` | Read + creation tools |
1233
+ | \`--edit\` | All tools (read + create + edit + delete) |
1234
+
1235
+ Ask the user to add \`--edit\` (or \`--create\`) to their MCP config args:
1236
+
1237
+ \`\`\`json
1238
+ {
1239
+ "mcpServers": {
1240
+ "Vibma": {
1241
+ "command": "npx",
1242
+ "args": ["-y", "@ufira/vibma", "--edit"]
1243
+ }
1244
+ }
1245
+ }
1246
+ \`\`\`
1247
+
1248
+ After updating, the user must restart their AI tool or reload MCP servers \u2014 stdio-based servers cannot hot-reload.`
1249
+ }
1250
+ }],
1251
+ description: "Why create or edit tools are missing and how to fix it"
1252
+ })
1253
+ );
1210
1254
  }
1211
1255
 
1212
1256
  // src/tools/mcp-registry.ts
@@ -1243,6 +1287,13 @@ try {
1243
1287
  VIBMA_VERSION = pkg.version;
1244
1288
  break;
1245
1289
  }
1290
+ if (pkg.workspaces) {
1291
+ try {
1292
+ VIBMA_VERSION = JSON.parse(readFileSync(join(dir, "packages/core/package.json"), "utf8")).version;
1293
+ } catch {
1294
+ }
1295
+ break;
1296
+ }
1246
1297
  } catch {
1247
1298
  continue;
1248
1299
  }