@vadenai/mcp-server 0.2.1 → 0.3.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.
- package/dist/api-client.d.ts +3 -0
- package/dist/api-client.js +13 -3
- package/dist/index.js +235 -3
- package/dist/tools/components.js +149 -0
- package/dist/tools/concept.d.ts +12 -0
- package/dist/tools/concept.js +147 -1
- package/dist/tools/wireframes.d.ts +26 -0
- package/dist/tools/wireframes.js +39 -1
- package/dist/tools/write-components.d.ts +18 -0
- package/dist/tools/write-components.js +17 -0
- package/dist/tools/write-tokens.d.ts +17 -0
- package/dist/tools/write-tokens.js +16 -0
- package/dist/utils/tailwind-resolver.d.ts +35 -0
- package/dist/utils/tailwind-resolver.js +632 -0
- package/dist/validation.d.ts +42 -0
- package/dist/validation.js +83 -0
- package/package.json +1 -1
|
@@ -5,6 +5,32 @@
|
|
|
5
5
|
* 画面詳細 API: GET /api/projects/{projectId}/wireframe/{screenId}
|
|
6
6
|
*/
|
|
7
7
|
import type { VadenMcpApiClient } from "../api-client.js";
|
|
8
|
+
/**
|
|
9
|
+
* ワイヤーフレームの特定フィールドを更新する
|
|
10
|
+
*
|
|
11
|
+
* @param client - Vaden MCP API クライアント
|
|
12
|
+
* @param projectId - プロジェクトID
|
|
13
|
+
* @param fieldPath - ドット区切りのフィールドパス(例: 'screens.0.name')
|
|
14
|
+
* @param value - 新しい値
|
|
15
|
+
*/
|
|
16
|
+
export declare function handleUpdateWireframe(client: VadenMcpApiClient, projectId: string, fieldPath: string, value: unknown, operation?: "update" | "add" | "remove"): Promise<{
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
/**
|
|
21
|
+
* UXIR ファイルを一括プッシュしてワイヤーフレームを更新する
|
|
22
|
+
*
|
|
23
|
+
* @param client - Vaden MCP API クライアント
|
|
24
|
+
* @param projectId - プロジェクトID
|
|
25
|
+
* @param files - UXIR ファイル一覧 [{ filename, content }]
|
|
26
|
+
*/
|
|
27
|
+
export declare function handlePushWireframes(client: VadenMcpApiClient, projectId: string, files: Array<{
|
|
28
|
+
filename: string;
|
|
29
|
+
content: string;
|
|
30
|
+
}>): Promise<{
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[]>;
|
|
8
34
|
/**
|
|
9
35
|
* ワイヤーフレーム一覧を返す
|
|
10
36
|
*
|
package/dist/tools/wireframes.js
CHANGED
|
@@ -168,7 +168,45 @@ function generateWireframeDetailGuide(screen) {
|
|
|
168
168
|
}
|
|
169
169
|
return lines.join("\n");
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
/**
|
|
172
|
+
* ワイヤーフレームの特定フィールドを更新する
|
|
173
|
+
*
|
|
174
|
+
* @param client - Vaden MCP API クライアント
|
|
175
|
+
* @param projectId - プロジェクトID
|
|
176
|
+
* @param fieldPath - ドット区切りのフィールドパス(例: 'screens.0.name')
|
|
177
|
+
* @param value - 新しい値
|
|
178
|
+
*/
|
|
179
|
+
export async function handleUpdateWireframe(client, projectId, fieldPath, value, operation = "update") {
|
|
180
|
+
await client.patch(`/api/projects/${encodeURIComponent(projectId)}/wireframe`, { fieldPath, value, operation });
|
|
181
|
+
const actionLabel = operation === "add"
|
|
182
|
+
? "added to"
|
|
183
|
+
: operation === "remove"
|
|
184
|
+
? "removed from"
|
|
185
|
+
: "updated in";
|
|
186
|
+
return [
|
|
187
|
+
{
|
|
188
|
+
type: "text",
|
|
189
|
+
text: `Wireframe: element ${actionLabel} "${fieldPath}"${operation !== "remove" ? ` — ${JSON.stringify(value)}` : ""}`,
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* UXIR ファイルを一括プッシュしてワイヤーフレームを更新する
|
|
195
|
+
*
|
|
196
|
+
* @param client - Vaden MCP API クライアント
|
|
197
|
+
* @param projectId - プロジェクトID
|
|
198
|
+
* @param files - UXIR ファイル一覧 [{ filename, content }]
|
|
199
|
+
*/
|
|
200
|
+
export async function handlePushWireframes(client, projectId, files) {
|
|
201
|
+
const result = await client.post(`/api/projects/${encodeURIComponent(projectId)}/uxir`, { files });
|
|
202
|
+
return [
|
|
203
|
+
{
|
|
204
|
+
type: "text",
|
|
205
|
+
text: `Wireframes pushed successfully.\n- Files accepted: ${String(result.accepted)}\n- Screens: ${String(result.screens)}\n- Transitions: ${String(result.transitions)}`,
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
// --- Read ハンドラー ---
|
|
172
210
|
/**
|
|
173
211
|
* ワイヤーフレーム一覧を返す
|
|
174
212
|
*
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* コンポーネントスタイル更新 MCP ツールハンドラー
|
|
3
|
+
*
|
|
4
|
+
* PATCH /api/projects/{projectId}/design-system/component-styles/{component}
|
|
5
|
+
*/
|
|
6
|
+
import type { VadenMcpApiClient } from "../api-client.js";
|
|
7
|
+
/**
|
|
8
|
+
* コンポーネントスタイルオーバーライドを更新する
|
|
9
|
+
*
|
|
10
|
+
* @param client - Vaden MCP API クライアント
|
|
11
|
+
* @param projectId - プロジェクトID
|
|
12
|
+
* @param component - コンポーネント名(例: button, card)
|
|
13
|
+
* @param updatedStyleConfig - 更新するスタイル設定
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleUpdateComponentStyle(client: VadenMcpApiClient, projectId: string, component: string, updatedStyleConfig: Record<string, unknown>): Promise<{
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* コンポーネントスタイルオーバーライドを更新する
|
|
3
|
+
*
|
|
4
|
+
* @param client - Vaden MCP API クライアント
|
|
5
|
+
* @param projectId - プロジェクトID
|
|
6
|
+
* @param component - コンポーネント名(例: button, card)
|
|
7
|
+
* @param updatedStyleConfig - 更新するスタイル設定
|
|
8
|
+
*/
|
|
9
|
+
export async function handleUpdateComponentStyle(client, projectId, component, updatedStyleConfig) {
|
|
10
|
+
const result = await client.patch(`/api/projects/${encodeURIComponent(projectId)}/design-system/component-styles/${encodeURIComponent(component)}`, { updatedStyleConfig });
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
type: "text",
|
|
14
|
+
text: `Component style for "${result.component}" updated successfully. Override applied: ${String(result.overrideApplied)}`,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* デザイントークン更新 MCP ツールハンドラー
|
|
3
|
+
*
|
|
4
|
+
* PATCH /api/projects/{projectId}/design-system/tokens
|
|
5
|
+
*/
|
|
6
|
+
import type { VadenMcpApiClient } from "../api-client.js";
|
|
7
|
+
/**
|
|
8
|
+
* デザイントークンを部分更新する
|
|
9
|
+
*
|
|
10
|
+
* @param client - Vaden MCP API クライアント
|
|
11
|
+
* @param projectId - プロジェクトID
|
|
12
|
+
* @param tokens - 更新するトークン(deep merge)
|
|
13
|
+
*/
|
|
14
|
+
export declare function handleUpdateDesignTokens(client: VadenMcpApiClient, projectId: string, tokens: Record<string, unknown>): Promise<{
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
}[]>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* デザイントークンを部分更新する
|
|
3
|
+
*
|
|
4
|
+
* @param client - Vaden MCP API クライアント
|
|
5
|
+
* @param projectId - プロジェクトID
|
|
6
|
+
* @param tokens - 更新するトークン(deep merge)
|
|
7
|
+
*/
|
|
8
|
+
export async function handleUpdateDesignTokens(client, projectId, tokens) {
|
|
9
|
+
const result = await client.patch(`/api/projects/${encodeURIComponent(projectId)}/design-system/tokens`, { tokens });
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
type: "text",
|
|
13
|
+
text: `Design tokens updated successfully.\n\n\`\`\`json\n${JSON.stringify(result.tokens, null, 2)}\n\`\`\``,
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ResolvedVisualProperties {
|
|
2
|
+
width?: string;
|
|
3
|
+
height?: string;
|
|
4
|
+
borderRadius?: string;
|
|
5
|
+
border?: {
|
|
6
|
+
width: string;
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
fontWeight?: string;
|
|
12
|
+
fontSize?: string;
|
|
13
|
+
overflow?: string;
|
|
14
|
+
objectFit?: string;
|
|
15
|
+
aspectRatio?: string;
|
|
16
|
+
display?: string;
|
|
17
|
+
alignItems?: string;
|
|
18
|
+
justifyContent?: string;
|
|
19
|
+
opacity?: string;
|
|
20
|
+
boxShadow?: string;
|
|
21
|
+
padding?: string;
|
|
22
|
+
paddingX?: string;
|
|
23
|
+
paddingY?: string;
|
|
24
|
+
paddingTop?: string;
|
|
25
|
+
paddingBottom?: string;
|
|
26
|
+
paddingLeft?: string;
|
|
27
|
+
paddingRight?: string;
|
|
28
|
+
gap?: string;
|
|
29
|
+
letterSpacing?: string;
|
|
30
|
+
flexShrink?: string;
|
|
31
|
+
borderStyle?: string;
|
|
32
|
+
fontFamily?: string;
|
|
33
|
+
gradient?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function resolveVisualProperties(classes: string, resolvedColors: Record<string, unknown>): ResolvedVisualProperties;
|