@applaunchflow/mcp 0.1.0 → 0.1.1

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.
@@ -109,13 +109,15 @@ export function registerLayoutTools(server, client) {
109
109
  server.registerTool("transform_layout", {
110
110
  title: "Transform Layout",
111
111
  description: "Apply transform operations to an existing layout. Primary editing tool for text, screenshots, colors, and structure changes. " +
112
+ "IMPORTANT: Always call get_layout FIRST to inspect the current layout state before using this tool. Never transform blindly. " +
112
113
  "RULES: " +
113
- "1. nodeType is REQUIRED in every operation target. The backend rejects operations without it. " +
114
- "2. Omit nodeId to update ALL nodes of that type in the target screens. This is the efficient way to do bulk changes (e.g. change all illustration colors: {nodeType:'illustration', screens:'all'} with changes {primaryColor:'#xxx'}). " +
114
+ "1. nodeType is REQUIRED in every operation target. " +
115
+ "2. Omit nodeId to update ALL nodes of that type in the target screens. " +
115
116
  "3. Use screens:'all' to target every screen at once. Do NOT send one operation per screen when the same change applies to all. " +
116
- "4. For add_node, changes MUST include an 'id' field. " +
117
- "5. To add new screens, first add empty screen containers, then populate them in a SECOND call using selector 'screenId:<id>'. " +
118
- "6. Default to layouts:['mobile']. Only include tablet/desktop if the user asks.",
117
+ "4. Dot-notation is supported for deep updates without replacing the whole object. Example: {'richContent.attrs.defaultFontSize': 96} updates only the font size inside richContent.attrs, preserving all other fields. Always use dot-notation for nested property changes. " +
118
+ "5. For add_node, changes MUST include an 'id' field. " +
119
+ "6. To add new screens, first add empty screen containers, then populate them in a SECOND call using selector 'screenId:<id>'. " +
120
+ "7. Default to layouts:['mobile']. Only include tablet/desktop if the user asks.",
119
121
  inputSchema: {
120
122
  generationId: z.string().uuid(),
121
123
  language: z.string(),
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from "node:crypto";
1
2
  import { z } from "zod";
2
3
  import { fail, ok } from "./utils.js";
3
4
  const contentTypeEnum = z.enum(["screenshots"]);
@@ -26,9 +27,27 @@ export function registerVariantTools(server, client) {
26
27
  label: z.string().optional(),
27
28
  setActive: z.boolean().optional(),
28
29
  },
29
- }, async (args) => {
30
+ }, async (args, extra) => {
30
31
  try {
31
- return ok(await client.createVariant(args), "Created variant");
32
+ const result = await client.createVariant(args);
33
+ const variantId = result?.variant?.id;
34
+ const generationId = args.generationId;
35
+ if (variantId && generationId) {
36
+ const editorUrl = `${client.credentials.baseUrl}/editor?projectId=${generationId}&variantId=${variantId}&device=phone`;
37
+ try {
38
+ await server.server.elicitInput({
39
+ mode: "url",
40
+ elicitationId: randomUUID(),
41
+ message: "Opening the new variant in the editor.",
42
+ url: editorUrl,
43
+ }, { signal: extra.signal });
44
+ }
45
+ catch {
46
+ // Client may not support URL elicitation — include URL in response
47
+ }
48
+ return ok({ ...result, editorUrl }, "Created variant");
49
+ }
50
+ return ok(result, "Created variant");
32
51
  }
33
52
  catch (error) {
34
53
  return fail(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applaunchflow/mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for AppLaunchFlow — create App Store & Google Play screenshots with AI.",
5
5
  "license": "MIT",
6
6
  "type": "module",