@framingui/mcp-server 0.6.8 → 0.6.10
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/README.md +52 -10
- package/dist/cli/commands.d.ts +2 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +20 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/help.d.ts +5 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +59 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +47 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +3 -13
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/package-manager.d.ts +5 -0
- package/dist/cli/package-manager.d.ts.map +1 -0
- package/dist/cli/package-manager.js +34 -0
- package/dist/cli/package-manager.js.map +1 -0
- package/dist/cli/update.d.ts +8 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +53 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/commands/slash-command-adapters.d.ts +9 -0
- package/dist/commands/slash-command-adapters.d.ts.map +1 -0
- package/dist/commands/slash-command-adapters.js +113 -0
- package/dist/commands/slash-command-adapters.js.map +1 -0
- package/dist/commands/slash-command-registry.d.ts +25 -0
- package/dist/commands/slash-command-registry.d.ts.map +1 -0
- package/dist/commands/slash-command-registry.js +330 -0
- package/dist/commands/slash-command-registry.js.map +1 -0
- package/dist/index.js +7 -22
- package/dist/index.js.map +1 -1
- package/dist/prompts/a11y-workflow.d.ts +10 -0
- package/dist/prompts/a11y-workflow.d.ts.map +1 -0
- package/dist/prompts/a11y-workflow.js +46 -0
- package/dist/prompts/a11y-workflow.js.map +1 -0
- package/dist/prompts/command-help.d.ts +10 -0
- package/dist/prompts/command-help.d.ts.map +1 -0
- package/dist/prompts/command-help.js +87 -0
- package/dist/prompts/command-help.js.map +1 -0
- package/dist/prompts/doctor-workflow.d.ts +10 -0
- package/dist/prompts/doctor-workflow.d.ts.map +1 -0
- package/dist/prompts/doctor-workflow.js +37 -0
- package/dist/prompts/doctor-workflow.js.map +1 -0
- package/dist/prompts/getting-started.d.ts.map +1 -1
- package/dist/prompts/getting-started.js +18 -1
- package/dist/prompts/getting-started.js.map +1 -1
- package/dist/prompts/prompt-catalog.d.ts +26 -0
- package/dist/prompts/prompt-catalog.d.ts.map +1 -0
- package/dist/prompts/prompt-catalog.js +82 -0
- package/dist/prompts/prompt-catalog.js.map +1 -0
- package/dist/prompts/responsive-workflow.d.ts +10 -0
- package/dist/prompts/responsive-workflow.d.ts.map +1 -0
- package/dist/prompts/responsive-workflow.js +52 -0
- package/dist/prompts/responsive-workflow.js.map +1 -0
- package/dist/prompts/slash-commands.d.ts +10 -0
- package/dist/prompts/slash-commands.d.ts.map +1 -0
- package/dist/prompts/slash-commands.js +31 -0
- package/dist/prompts/slash-commands.js.map +1 -0
- package/dist/prompts/theme-swap-workflow.d.ts +10 -0
- package/dist/prompts/theme-swap-workflow.d.ts.map +1 -0
- package/dist/prompts/theme-swap-workflow.js +35 -0
- package/dist/prompts/theme-swap-workflow.js.map +1 -0
- package/dist/prompts/update-workflow.d.ts +10 -0
- package/dist/prompts/update-workflow.d.ts.map +1 -0
- package/dist/prompts/update-workflow.js +36 -0
- package/dist/prompts/update-workflow.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { getSlashCommand } from '../commands/slash-command-registry.js';
|
|
2
|
+
function formatValues(values) {
|
|
3
|
+
if (!values || values.length === 0) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
return ` Values: ${values.join(', ')}`;
|
|
7
|
+
}
|
|
8
|
+
export function getCommandHelpPrompt(commandName) {
|
|
9
|
+
const command = commandName ? getSlashCommand(commandName) : undefined;
|
|
10
|
+
if (!command) {
|
|
11
|
+
return {
|
|
12
|
+
messages: [
|
|
13
|
+
{
|
|
14
|
+
role: 'user',
|
|
15
|
+
content: {
|
|
16
|
+
type: 'text',
|
|
17
|
+
text: `# FramingUI Command Help
|
|
18
|
+
|
|
19
|
+
No slash command matched \`${commandName ?? ''}\`.
|
|
20
|
+
|
|
21
|
+
Use the \`slash-commands\` prompt to inspect the full catalog, then call \`command-help\` again with one of:
|
|
22
|
+
- /screen
|
|
23
|
+
- /section
|
|
24
|
+
- /draft
|
|
25
|
+
- /responsive
|
|
26
|
+
- /a11y
|
|
27
|
+
- /theme-swap
|
|
28
|
+
- /doctor
|
|
29
|
+
- /install-check
|
|
30
|
+
- /export
|
|
31
|
+
- /update`,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const argLines = command.args.length > 0
|
|
38
|
+
? command.args
|
|
39
|
+
.map(arg => `- \`${arg.name}\`${arg.required ? ' (required)' : ''} - ${arg.description}`)
|
|
40
|
+
.join('\n')
|
|
41
|
+
: '- None';
|
|
42
|
+
const optionLines = command.options.length > 0
|
|
43
|
+
? command.options
|
|
44
|
+
.map(option => `- \`${option.name}\` - ${option.description}${formatValues(option.values)}`)
|
|
45
|
+
.join('\n')
|
|
46
|
+
: '- None';
|
|
47
|
+
const exampleLines = command.examples.map(example => `- \`${example}\``).join('\n');
|
|
48
|
+
const workflowLines = command.workflow.map(step => `- \`${step}\``).join('\n');
|
|
49
|
+
return {
|
|
50
|
+
messages: [
|
|
51
|
+
{
|
|
52
|
+
role: 'user',
|
|
53
|
+
content: {
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: `# ${command.name}
|
|
56
|
+
|
|
57
|
+
${command.summary}
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
\`${command.usage}\`
|
|
62
|
+
|
|
63
|
+
## Arguments
|
|
64
|
+
|
|
65
|
+
${argLines}
|
|
66
|
+
|
|
67
|
+
## Options
|
|
68
|
+
|
|
69
|
+
${optionLines}
|
|
70
|
+
|
|
71
|
+
## Examples
|
|
72
|
+
|
|
73
|
+
${exampleLines}
|
|
74
|
+
|
|
75
|
+
## MCP workflow
|
|
76
|
+
|
|
77
|
+
${workflowLines}
|
|
78
|
+
|
|
79
|
+
## Prompt fallback
|
|
80
|
+
|
|
81
|
+
\`${command.promptRecipe}\``,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=command-help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-help.js","sourceRoot":"","sources":["../../src/prompts/command-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,SAAS,YAAY,CAAC,MAAiB;IACrC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,WAAoB;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;6BAEW,WAAW,IAAI,EAAE;;;;;;;;;;;;UAYpC;qBACC;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QACrB,CAAC,CAAC,OAAO,CAAC,IAAI;aACT,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,CAAC,IA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,wBAAgB,uBAAuB;;;;;;;;EAmCtC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function getDoctorWorkflowPrompt() {
|
|
2
|
+
return {
|
|
3
|
+
messages: [
|
|
4
|
+
{
|
|
5
|
+
role: 'user',
|
|
6
|
+
content: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
text: `# FramingUI Doctor Workflow
|
|
9
|
+
|
|
10
|
+
Use this workflow when the user asks why FramingUI generation or styling is not working in their project.
|
|
11
|
+
|
|
12
|
+
## Primary commands
|
|
13
|
+
|
|
14
|
+
- \`/doctor [<project-path>] [--auth] [--tailwind] [--themes] [--fix-hints]\`
|
|
15
|
+
- \`/install-check [<project-path>] [--for <screen|section|file>] [--packages-only]\`
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
1. Inspect session status with \`whoami\` when auth or entitlement issues are suspected.
|
|
20
|
+
2. Confirm theme access with \`list-themes\`.
|
|
21
|
+
3. Run \`validate-environment\` for package presence and Tailwind compatibility.
|
|
22
|
+
4. Return the smallest set of fixes needed to restore a working FramingUI setup.
|
|
23
|
+
|
|
24
|
+
## Expected output
|
|
25
|
+
|
|
26
|
+
- auth status when relevant
|
|
27
|
+
- theme availability when relevant
|
|
28
|
+
- missing packages
|
|
29
|
+
- install commands
|
|
30
|
+
- Tailwind or style-import issues
|
|
31
|
+
- prioritized next actions`,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=doctor-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor-workflow.js","sourceRoot":"","sources":["../../src/prompts/doctor-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;2BAuBW;iBAClB;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getting-started.d.ts","sourceRoot":"","sources":["../../src/prompts/getting-started.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,uBAAuB;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getting-started.d.ts","sourceRoot":"","sources":["../../src/prompts/getting-started.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,uBAAuB;;;;;;;;EAyHtC"}
|
|
@@ -77,7 +77,24 @@ Before creating screen definitions:
|
|
|
77
77
|
3. Identify components needed for your screen
|
|
78
78
|
\`\`\`
|
|
79
79
|
|
|
80
|
-
## Step 5:
|
|
80
|
+
## Step 5: Discover Slash Commands (Optional but Recommended)
|
|
81
|
+
|
|
82
|
+
If your MCP client supports slash menus, tab completion, or command palettes, expose the FramingUI command registry:
|
|
83
|
+
|
|
84
|
+
- \`/screen\` - full screen generation
|
|
85
|
+
- \`/section\` - section generation or replacement
|
|
86
|
+
- \`/draft\` - structural screen draft before codegen
|
|
87
|
+
- \`/responsive\` - responsive optimization with density controls
|
|
88
|
+
- \`/a11y\` - accessibility review
|
|
89
|
+
- \`/theme-swap\` - reapply a screen under a different theme
|
|
90
|
+
- \`/doctor\` - setup diagnosis
|
|
91
|
+
- \`/install-check\` - dependency and environment checks
|
|
92
|
+
- \`/export\` - artifact export
|
|
93
|
+
- \`/update\` - refresh installed FramingUI packages in a project
|
|
94
|
+
|
|
95
|
+
If your client does not support native slash commands, use the \`slash-commands\` and \`command-help\` prompts as a fallback help surface.
|
|
96
|
+
|
|
97
|
+
## Step 6: Generate Your First Screen
|
|
81
98
|
|
|
82
99
|
Follow the 3-step workflow:
|
|
83
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getting-started.js","sourceRoot":"","sources":["../../src/prompts/getting-started.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE
|
|
1
|
+
{"version":3,"file":"getting-started.js","sourceRoot":"","sources":["../../src/prompts/getting-started.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEA6GkD;iBACzD;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface PromptArgumentDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PromptDefinition {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
arguments: PromptArgumentDefinition[];
|
|
10
|
+
getPrompt: (args?: Record<string, string>) => {
|
|
11
|
+
messages: Array<{
|
|
12
|
+
role: string;
|
|
13
|
+
content: {
|
|
14
|
+
type: string;
|
|
15
|
+
text: string;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function listPromptDefinitions(): Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
arguments: PromptArgumentDefinition[];
|
|
24
|
+
}>;
|
|
25
|
+
export declare function getPromptDefinition(name: string): PromptDefinition | undefined;
|
|
26
|
+
//# sourceMappingURL=prompt-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-catalog.d.ts","sourceRoot":"","sources":["../../src/prompts/prompt-catalog.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,wBAAwB,EAAE,CAAC;IACtC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK;QAC5C,QAAQ,EAAE,KAAK,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAC;gBACb,IAAI,EAAE,MAAM,CAAC;aACd,CAAC;SACH,CAAC,CAAC;KACJ,CAAC;CACH;AAkED,wBAAgB,qBAAqB,IAAI,KAAK,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,wBAAwB,EAAE,CAAC;CACvC,CAAC,CAMD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE9E"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { getA11yWorkflowPrompt } from './a11y-workflow.js';
|
|
2
|
+
import { getCommandHelpPrompt } from './command-help.js';
|
|
3
|
+
import { getDoctorWorkflowPrompt } from './doctor-workflow.js';
|
|
4
|
+
import { getGettingStartedPrompt } from './getting-started.js';
|
|
5
|
+
import { getResponsiveWorkflowPrompt } from './responsive-workflow.js';
|
|
6
|
+
import { getScreenWorkflowPrompt } from './screen-workflow.js';
|
|
7
|
+
import { getSlashCommandsPrompt } from './slash-commands.js';
|
|
8
|
+
import { getThemeSwapWorkflowPrompt } from './theme-swap-workflow.js';
|
|
9
|
+
import { getUpdateWorkflowPrompt } from './update-workflow.js';
|
|
10
|
+
const promptCatalog = [
|
|
11
|
+
{
|
|
12
|
+
name: 'getting-started',
|
|
13
|
+
description: 'Complete getting started guide for FramingUI including authentication, theme exploration, slash command discovery, and screen generation workflow',
|
|
14
|
+
arguments: [],
|
|
15
|
+
getPrompt: () => getGettingStartedPrompt(),
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'screen-workflow',
|
|
19
|
+
description: 'Detailed screen generation workflow for /screen, /section, and /draft flows',
|
|
20
|
+
arguments: [],
|
|
21
|
+
getPrompt: () => getScreenWorkflowPrompt(),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'responsive-workflow',
|
|
25
|
+
description: 'Responsive optimization workflow backing the /responsive command',
|
|
26
|
+
arguments: [],
|
|
27
|
+
getPrompt: () => getResponsiveWorkflowPrompt(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'a11y-workflow',
|
|
31
|
+
description: 'Accessibility audit workflow backing the /a11y command',
|
|
32
|
+
arguments: [],
|
|
33
|
+
getPrompt: () => getA11yWorkflowPrompt(),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'theme-swap-workflow',
|
|
37
|
+
description: 'Theme application workflow backing the /theme-swap command',
|
|
38
|
+
arguments: [],
|
|
39
|
+
getPrompt: () => getThemeSwapWorkflowPrompt(),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'doctor-workflow',
|
|
43
|
+
description: 'Environment and setup diagnosis workflow backing /doctor and /install-check',
|
|
44
|
+
arguments: [],
|
|
45
|
+
getPrompt: () => getDoctorWorkflowPrompt(),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'update-workflow',
|
|
49
|
+
description: 'Package update workflow backing the /update command',
|
|
50
|
+
arguments: [],
|
|
51
|
+
getPrompt: () => getUpdateWorkflowPrompt(),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'slash-commands',
|
|
55
|
+
description: 'Slash command catalog for FramingUI design workflows',
|
|
56
|
+
arguments: [],
|
|
57
|
+
getPrompt: () => getSlashCommandsPrompt(),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'command-help',
|
|
61
|
+
description: 'Detailed help metadata for one slash command',
|
|
62
|
+
arguments: [
|
|
63
|
+
{
|
|
64
|
+
name: 'command',
|
|
65
|
+
required: true,
|
|
66
|
+
description: 'Slash command name such as /screen, /responsive, or /update',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
getPrompt: args => getCommandHelpPrompt(args?.command),
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
export function listPromptDefinitions() {
|
|
73
|
+
return promptCatalog.map(({ name, description, arguments: args }) => ({
|
|
74
|
+
name,
|
|
75
|
+
description,
|
|
76
|
+
arguments: args,
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
export function getPromptDefinition(name) {
|
|
80
|
+
return promptCatalog.find(prompt => prompt.name === name);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=prompt-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-catalog.js","sourceRoot":"","sources":["../../src/prompts/prompt-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC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ACb,SAAS,EAAE,GAAG,EAAE,CAAC,sBAAsB,EAAE;KAC1C;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,8CAA8C;QAC3D,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,6DAA6D;aAC3E;SACF;QACD,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC;KACvD;CACF,CAAC;AAEF,MAAM,UAAU,qBAAqB;IAKnC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACpE,IAAI;QACJ,WAAW;QACX,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive-workflow.d.ts","sourceRoot":"","sources":["../../src/prompts/responsive-workflow.ts"],"names":[],"mappings":"AAAA,wBAAgB,2BAA2B;;;;;;;;EAkD1C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function getResponsiveWorkflowPrompt() {
|
|
2
|
+
return {
|
|
3
|
+
messages: [
|
|
4
|
+
{
|
|
5
|
+
role: 'user',
|
|
6
|
+
content: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
text: `# FramingUI Responsive Optimization Workflow
|
|
9
|
+
|
|
10
|
+
Use this workflow when the user asks to adapt an existing screen for smaller viewports, touch ergonomics, or density changes.
|
|
11
|
+
|
|
12
|
+
## Primary command
|
|
13
|
+
|
|
14
|
+
\`/responsive <target> [--mode mobile-first|tablet-safe|touch-optimized] [--density preserve|denser|lighter] [--breakpoint sm|md|lg]\`
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. Inspect the target screen or screen definition.
|
|
19
|
+
2. Call \`list_tokens\` to confirm breakpoint and layout token options when layout changes are needed.
|
|
20
|
+
3. Preserve the existing information architecture unless the current layout is clearly broken on smaller screens.
|
|
21
|
+
4. Apply one primary responsive strategy:
|
|
22
|
+
- \`mobile-first\`: prioritize stacked layouts, simplified nav, compressed controls
|
|
23
|
+
- \`tablet-safe\`: preserve layout intent while preventing breakage around medium widths
|
|
24
|
+
- \`touch-optimized\`: increase hit targets, action spacing, and gesture-safe layouts
|
|
25
|
+
5. Apply density refinement inside this command, not as a separate command:
|
|
26
|
+
- \`preserve\`: keep current information density, mainly reflow layout
|
|
27
|
+
- \`denser\`: preserve more information in constrained layouts
|
|
28
|
+
- \`lighter\`: reduce clutter and collapse secondary content
|
|
29
|
+
6. Validate the updated definition with \`validate-screen-definition\`.
|
|
30
|
+
7. If code output is requested, re-run \`generate_screen\`.
|
|
31
|
+
|
|
32
|
+
## Expected output
|
|
33
|
+
|
|
34
|
+
- Breakpoint-specific recommendations
|
|
35
|
+
- Layout changes by section
|
|
36
|
+
- Mobile/tablet nav strategy
|
|
37
|
+
- Table/card/list transformations where relevant
|
|
38
|
+
- Any overflow or cramped-interaction risks
|
|
39
|
+
- Updated definition or regenerated code when requested
|
|
40
|
+
|
|
41
|
+
## Important constraints
|
|
42
|
+
|
|
43
|
+
- Do not invent unsupported layout tokens.
|
|
44
|
+
- Do not split density into a standalone workflow; keep it under responsive optimization.
|
|
45
|
+
- Prefer safe reflow over aesthetic-only changes.
|
|
46
|
+
- If the current screen is already responsive, report that explicitly instead of forcing unnecessary edits.`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=responsive-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive-workflow.js","sourceRoot":"","sources":["../../src/prompts/responsive-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4GAsC4F;iBACnG;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/prompts/slash-commands.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB;;;;;;;;EA6BrC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { listSlashCommands } from '../commands/slash-command-registry.js';
|
|
2
|
+
export function getSlashCommandsPrompt() {
|
|
3
|
+
const commandLines = listSlashCommands()
|
|
4
|
+
.map(command => `- \`${command.name}\` - ${command.summary}\n Usage: \`${command.usage}\``)
|
|
5
|
+
.join('\n');
|
|
6
|
+
return {
|
|
7
|
+
messages: [
|
|
8
|
+
{
|
|
9
|
+
role: 'user',
|
|
10
|
+
content: {
|
|
11
|
+
type: 'text',
|
|
12
|
+
text: `# FramingUI Slash Commands
|
|
13
|
+
|
|
14
|
+
FramingUI exposes an intent-level command registry on top of MCP tools. Clients with slash menus or tab completion can render these commands directly. Clients without native command UX can use this registry for \`--help\` style guidance.
|
|
15
|
+
|
|
16
|
+
## Command catalog
|
|
17
|
+
|
|
18
|
+
${commandLines}
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
- \`/responsive\` includes density control via \`--density preserve|denser|lighter\`
|
|
23
|
+
- \`/update\` refreshes installed FramingUI packages in a target project
|
|
24
|
+
- There is no standalone \`/density\`, \`/hierarchy\`, \`/palette\`, or \`/tone\` command in this phase
|
|
25
|
+
- Use the \`command-help\` prompt with a command name to get detailed help for one command`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=slash-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/prompts/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,UAAU,sBAAsB;IACpC,MAAM,YAAY,GAAG,iBAAiB,EAAE;SACrC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,IAAI,QAAQ,OAAO,CAAC,OAAO,gBAAgB,OAAO,CAAC,KAAK,IAAI,CAAC;SAC3F,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;EAMd,YAAY;;;;;;;2FAO6E;iBAClF;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-swap-workflow.d.ts","sourceRoot":"","sources":["../../src/prompts/theme-swap-workflow.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B;;;;;;;;EAiCzC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function getThemeSwapWorkflowPrompt() {
|
|
2
|
+
return {
|
|
3
|
+
messages: [
|
|
4
|
+
{
|
|
5
|
+
role: 'user',
|
|
6
|
+
content: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
text: `# FramingUI Theme Swap Workflow
|
|
9
|
+
|
|
10
|
+
Use this workflow when the user wants to keep screen structure but change the visual system.
|
|
11
|
+
|
|
12
|
+
## Primary command
|
|
13
|
+
|
|
14
|
+
\`/theme-swap <target> --to <themeId> [--from <themeId>] [--output code|diff]\`
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. Confirm the target theme is available with \`list-themes\`.
|
|
19
|
+
2. Inspect the theme with \`preview-theme\` if recipe coverage or tone differences matter.
|
|
20
|
+
3. Re-run supported generation paths so the new theme is applied through recipes and contract-backed code generation.
|
|
21
|
+
4. Warn when a component-theme pairing lacks a supported recipe path.
|
|
22
|
+
5. If the user is applying the result inside a project, validate the environment when dependencies or setup requirements change.
|
|
23
|
+
|
|
24
|
+
## Expected output
|
|
25
|
+
|
|
26
|
+
- regenerated output or diff summary
|
|
27
|
+
- target theme id
|
|
28
|
+
- recipe coverage notes
|
|
29
|
+
- unsupported pairing warnings when relevant`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=theme-swap-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-swap-workflow.js","sourceRoot":"","sources":["../../src/prompts/theme-swap-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;6CAqB6B;iBACpC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-workflow.d.ts","sourceRoot":"","sources":["../../src/prompts/update-workflow.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB;;;;;;;;EAkCtC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function getUpdateWorkflowPrompt() {
|
|
2
|
+
return {
|
|
3
|
+
messages: [
|
|
4
|
+
{
|
|
5
|
+
role: 'user',
|
|
6
|
+
content: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
text: `# FramingUI Update Workflow
|
|
9
|
+
|
|
10
|
+
Use this workflow when the user wants to refresh installed FramingUI packages in a project.
|
|
11
|
+
|
|
12
|
+
## Primary command
|
|
13
|
+
|
|
14
|
+
\`/update [<project-path>] [--check]\`
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. Inspect the target project's package.json.
|
|
19
|
+
2. Detect which FramingUI packages are already installed.
|
|
20
|
+
3. Detect the package manager from lockfiles.
|
|
21
|
+
4. Build the correct update command for the detected package manager.
|
|
22
|
+
5. If the user requested a dry run, show the command only.
|
|
23
|
+
6. If no FramingUI packages are installed, stop and suggest \`framingui-mcp init\`.
|
|
24
|
+
|
|
25
|
+
## Expected output
|
|
26
|
+
|
|
27
|
+
- detected package manager
|
|
28
|
+
- installed FramingUI packages
|
|
29
|
+
- exact update command
|
|
30
|
+
- remediation hint when nothing is installed`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=update-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-workflow.js","sourceRoot":"","sources":["../../src/prompts/update-workflow.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;6CAsB6B;iBACpC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@framingui/mcp-server",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "Framingui MCP Server with Claude Code integration and timestamp-based preview system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@babel/traverse": "^7.28.6",
|
|
40
40
|
"@framingui/ui": "^0.6.5",
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
42
|
-
"@framingui/core": "^0.4.
|
|
42
|
+
"@framingui/core": "^0.4.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@babel/types": "^7.28.6",
|