@framingui/mcp-server 0.6.26 → 0.6.28

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 (146) hide show
  1. package/README.md +4 -3
  2. package/dist/__tests__/react-native-contract.test.d.ts +2 -0
  3. package/dist/__tests__/react-native-contract.test.d.ts.map +1 -0
  4. package/dist/__tests__/react-native-contract.test.js +50 -0
  5. package/dist/__tests__/react-native-contract.test.js.map +1 -0
  6. package/dist/auth/state.d.ts +16 -0
  7. package/dist/auth/state.d.ts.map +1 -1
  8. package/dist/auth/state.js +54 -15
  9. package/dist/auth/state.js.map +1 -1
  10. package/dist/auth/verify.d.ts +9 -0
  11. package/dist/auth/verify.d.ts.map +1 -1
  12. package/dist/auth/verify.js.map +1 -1
  13. package/dist/billing/quota-policy.d.ts +13 -0
  14. package/dist/billing/quota-policy.d.ts.map +1 -0
  15. package/dist/billing/quota-policy.js +32 -0
  16. package/dist/billing/quota-policy.js.map +1 -0
  17. package/dist/billing/tool-metering.d.ts +10 -0
  18. package/dist/billing/tool-metering.d.ts.map +1 -0
  19. package/dist/billing/tool-metering.js +126 -0
  20. package/dist/billing/tool-metering.js.map +1 -0
  21. package/dist/billing/usage-ledger.d.ts +61 -0
  22. package/dist/billing/usage-ledger.d.ts.map +1 -0
  23. package/dist/billing/usage-ledger.js +102 -0
  24. package/dist/billing/usage-ledger.js.map +1 -0
  25. package/dist/billing/usage-sync.d.ts +3 -0
  26. package/dist/billing/usage-sync.d.ts.map +1 -0
  27. package/dist/billing/usage-sync.js +40 -0
  28. package/dist/billing/usage-sync.js.map +1 -0
  29. package/dist/cli/agent-md-templates.d.ts.map +1 -1
  30. package/dist/cli/agent-md-templates.js +58 -38
  31. package/dist/cli/agent-md-templates.js.map +1 -1
  32. package/dist/cli/commands.d.ts +2 -0
  33. package/dist/cli/commands.d.ts.map +1 -0
  34. package/dist/cli/commands.js +20 -0
  35. package/dist/cli/commands.js.map +1 -0
  36. package/dist/cli/guide-template.d.ts.map +1 -1
  37. package/dist/cli/guide-template.js +20 -36
  38. package/dist/cli/guide-template.js.map +1 -1
  39. package/dist/cli/help.d.ts +5 -0
  40. package/dist/cli/help.d.ts.map +1 -0
  41. package/dist/cli/help.js +59 -0
  42. package/dist/cli/help.js.map +1 -0
  43. package/dist/cli/init.d.ts +2 -3
  44. package/dist/cli/init.d.ts.map +1 -1
  45. package/dist/cli/init.js +33 -48
  46. package/dist/cli/init.js.map +1 -1
  47. package/dist/cli/package-manager.d.ts +5 -0
  48. package/dist/cli/package-manager.d.ts.map +1 -0
  49. package/dist/cli/package-manager.js +34 -0
  50. package/dist/cli/package-manager.js.map +1 -0
  51. package/dist/cli/update.d.ts +8 -0
  52. package/dist/cli/update.d.ts.map +1 -0
  53. package/dist/cli/update.js +53 -0
  54. package/dist/cli/update.js.map +1 -0
  55. package/dist/commands/slash-command-adapters.d.ts +9 -0
  56. package/dist/commands/slash-command-adapters.d.ts.map +1 -0
  57. package/dist/commands/slash-command-adapters.js +116 -0
  58. package/dist/commands/slash-command-adapters.js.map +1 -0
  59. package/dist/data/component-fallback-catalog.d.ts +26 -0
  60. package/dist/data/component-fallback-catalog.d.ts.map +1 -0
  61. package/dist/data/component-fallback-catalog.js +149 -0
  62. package/dist/data/component-fallback-catalog.js.map +1 -0
  63. package/dist/data/component-props.d.ts +30 -0
  64. package/dist/data/component-props.d.ts.map +1 -0
  65. package/dist/data/component-props.js +537 -0
  66. package/dist/data/component-props.js.map +1 -0
  67. package/dist/data/component-registry.d.ts +30 -0
  68. package/dist/data/component-registry.d.ts.map +1 -0
  69. package/dist/data/component-registry.js +320 -0
  70. package/dist/data/component-registry.js.map +1 -0
  71. package/dist/data/examples/screen-examples.d.ts +38 -0
  72. package/dist/data/examples/screen-examples.d.ts.map +1 -0
  73. package/dist/data/examples/screen-examples.js +500 -0
  74. package/dist/data/examples/screen-examples.js.map +1 -0
  75. package/dist/data/react-native-runtime-catalog.d.ts +24 -0
  76. package/dist/data/react-native-runtime-catalog.d.ts.map +1 -0
  77. package/dist/data/react-native-runtime-catalog.js +265 -0
  78. package/dist/data/react-native-runtime-catalog.js.map +1 -0
  79. package/dist/index.js +225 -205
  80. package/dist/index.js.map +1 -1
  81. package/dist/platform-support.d.ts +22 -0
  82. package/dist/platform-support.d.ts.map +1 -0
  83. package/dist/platform-support.js +148 -0
  84. package/dist/platform-support.js.map +1 -0
  85. package/dist/project-context-resolution.d.ts +7 -0
  86. package/dist/project-context-resolution.d.ts.map +1 -0
  87. package/dist/project-context-resolution.js +21 -0
  88. package/dist/project-context-resolution.js.map +1 -0
  89. package/dist/project-context-state.d.ts +12 -0
  90. package/dist/project-context-state.d.ts.map +1 -0
  91. package/dist/project-context-state.js +14 -0
  92. package/dist/project-context-state.js.map +1 -0
  93. package/dist/project-context.d.ts +15 -0
  94. package/dist/project-context.d.ts.map +1 -0
  95. package/dist/project-context.js +78 -0
  96. package/dist/project-context.js.map +1 -0
  97. package/dist/prompts/doctor-workflow.js +1 -1
  98. package/dist/prompts/getting-started.d.ts.map +1 -1
  99. package/dist/prompts/getting-started.js +36 -15
  100. package/dist/prompts/getting-started.js.map +1 -1
  101. package/dist/prompts/screen-workflow.d.ts.map +1 -1
  102. package/dist/prompts/screen-workflow.js +54 -3
  103. package/dist/prompts/screen-workflow.js.map +1 -1
  104. package/dist/schemas/mcp-schemas.d.ts +954 -309
  105. package/dist/schemas/mcp-schemas.d.ts.map +1 -1
  106. package/dist/schemas/mcp-schemas.js +130 -1
  107. package/dist/schemas/mcp-schemas.js.map +1 -1
  108. package/dist/tools/detect-project-context.d.ts +5 -0
  109. package/dist/tools/detect-project-context.d.ts.map +1 -0
  110. package/dist/tools/detect-project-context.js +36 -0
  111. package/dist/tools/detect-project-context.js.map +1 -0
  112. package/dist/tools/get-screen-generation-context.d.ts +3 -1
  113. package/dist/tools/get-screen-generation-context.d.ts.map +1 -1
  114. package/dist/tools/get-screen-generation-context.js +120 -20
  115. package/dist/tools/get-screen-generation-context.js.map +1 -1
  116. package/dist/tools/list-components.d.ts.map +1 -1
  117. package/dist/tools/list-components.js +42 -3
  118. package/dist/tools/list-components.js.map +1 -1
  119. package/dist/tools/list-screen-templates.d.ts +3 -1
  120. package/dist/tools/list-screen-templates.d.ts.map +1 -1
  121. package/dist/tools/list-screen-templates.js +3 -3
  122. package/dist/tools/list-screen-templates.js.map +1 -1
  123. package/dist/tools/preview-component.d.ts.map +1 -1
  124. package/dist/tools/preview-component.js +57 -7
  125. package/dist/tools/preview-component.js.map +1 -1
  126. package/dist/tools/preview-theme.d.ts +3 -1
  127. package/dist/tools/preview-theme.d.ts.map +1 -1
  128. package/dist/tools/preview-theme.js +48 -21
  129. package/dist/tools/preview-theme.js.map +1 -1
  130. package/dist/tools/theme-authority.js +1 -1
  131. package/dist/tools/theme-authority.js.map +1 -1
  132. package/dist/tools/validate-environment.d.ts +3 -1
  133. package/dist/tools/validate-environment.d.ts.map +1 -1
  134. package/dist/tools/validate-environment.js +102 -9
  135. package/dist/tools/validate-environment.js.map +1 -1
  136. package/dist/tools/validate-screen-definition.d.ts.map +1 -1
  137. package/dist/tools/validate-screen-definition.js +41 -7
  138. package/dist/tools/validate-screen-definition.js.map +1 -1
  139. package/dist/tools/whoami.d.ts.map +1 -1
  140. package/dist/tools/whoami.js +27 -17
  141. package/dist/tools/whoami.js.map +1 -1
  142. package/dist/utils/style-contract-reader.d.ts +10 -0
  143. package/dist/utils/style-contract-reader.d.ts.map +1 -0
  144. package/dist/utils/style-contract-reader.js +67 -0
  145. package/dist/utils/style-contract-reader.js.map +1 -0
  146. package/package.json +3 -3
@@ -14,7 +14,7 @@ export function getScreenWorkflowPrompt() {
14
14
  This is the current production workflow for building screens with FramingUI.
15
15
 
16
16
  Prerequisite: authenticate with \`framingui-mcp login\` or provide \`FRAMINGUI_API_KEY\`.
17
- Optional: call \`whoami\` to inspect licensed themes before starting.
17
+ Optional: call \`whoami\` to inspect entitled themes and the current shadow quota snapshot before starting.
18
18
 
19
19
  ## Overview
20
20
 
@@ -24,10 +24,29 @@ The production workflow is **guarded direct write**:
24
24
  - ✅ Write React code directly using FramingUI components and props from context
25
25
  - ✅ Verify dependencies, Tailwind setup, and raw HTML/style escapes before delivery
26
26
 
27
+ React Native is also supported through a **direct-write contract path**:
28
+ - ✅ Prefer \`detect-project-context\` once when the project path is known
29
+ - ✅ Gather platform-aware component guidance without repeating platform flags
30
+ - ✅ Write Expo / React Native code directly using \`@framingui/react-native\` where available, then host primitives or app abstractions for the rest
31
+ - ✅ Use \`validate-environment\` with \`sourceFiles\` for package checks and QC
32
+ - 🚫 Do not import \`@framingui/ui\` into React Native projects
33
+
27
34
  This is **not** the old \`generate_screen\`-first workflow.
28
35
  \`generate_screen\` may still be used as an optional helper, but the default production path is:
29
36
 
30
- \`preview-theme\` \`get-screen-generation-context\` \`preview-component\` / \`list-icon-libraries\` when needed → \`validate-screen-definition\` → write code directly → \`validate-environment\`
37
+ If the project path is known:
38
+
39
+ \`detect-project-context\` → \`preview-theme\` → \`get-screen-generation-context\` → \`preview-component\` / \`list-icon-libraries\` when needed → \`validate-screen-definition\` → write code directly → \`validate-environment\`
40
+
41
+ If the project path is not known, start at \`get-screen-generation-context\` and use explicit platform overrides only when needed.
42
+
43
+ ## React Native Note
44
+
45
+ For Expo or React Native projects:
46
+ - pass \`"platform": "react-native"\` to \`get-screen-generation-context\`
47
+ - prefer \`@framingui/react-native\` exports over app-local wrappers for common UI
48
+ - write code directly with \`StyleSheet.create\`
49
+ - run \`validate-environment\` with \`sourceFiles\` to catch web-only imports, \`className\`, and raw token drift
31
50
 
32
51
  ## Step 1/4: Gather Context
33
52
 
@@ -46,6 +65,15 @@ Use this at the start of every screen task.
46
65
 
47
66
  Set \`includeExamples: false\` when you want a smaller response and do not need example screen definitions.
48
67
 
68
+ For React Native direct-write work without a detected session default, pass:
69
+ \`\`\`json
70
+ {
71
+ "description": "Profile screen with subscription card and settings actions",
72
+ "platform": "react-native",
73
+ "includeExamples": false
74
+ }
75
+ \`\`\`
76
+
49
77
  **What to review from the response:**
50
78
  - \`templateMatch\` as a layout hint only
51
79
  - \`components\` as the source of truth for imports, props, and variants
@@ -136,15 +164,38 @@ Use it to verify:
136
164
 
137
165
  If the tool reports missing setup or raw primitive drift, fix the code before delivery.
138
166
 
167
+ ## React Native Direct-Write Path
168
+
169
+ Use this instead of the web screen-definition path when the target app is Expo or React Native.
170
+
171
+ 1. Call \`detect-project-context\` with \`projectPath\` when the app path is available
172
+ 2. Call \`get-screen-generation-context\` and let the stored session default pick React Native automatically
173
+ 3. If the project path is not available, call \`get-screen-generation-context\` with \`platform: "react-native"\`
174
+ 4. Review React Native compatible components and hints
175
+ 5. Write the screen directly using \`@framingui/react-native\` exports where available, then \`react-native\` primitives or local app abstractions
176
+ 6. Run \`validate-environment\` with:
177
+ - \`platform: "react-native"\`
178
+ - \`projectPath\`
179
+ - \`requiredPackages\`
180
+ - \`sourceFiles\`
181
+ 7. Fix missing packages, hardcoded color/spacing/radius values, and web-only patterns such as \`className\`
182
+
183
+ React Native rules:
184
+ - Do **not** import \`@framingui/ui\`
185
+ - Do **not** require Tailwind or CSS imports
186
+ - Prefer \`StyleSheet\` plus \`@framingui/react-native\` helpers or host app token helpers over raw style literals
187
+ - Treat \`@framingui/react-native\` as a minimal runtime, not as full \`@framingui/ui\` parity or code generation
188
+
139
189
  ## Best Practices
140
190
 
141
- 1. Start with \`get-screen-generation-context\`
191
+ 1. Start with \`detect-project-context\` when project path is known
142
192
  2. Use \`includeExamples: false\` unless examples are actually needed
143
193
  3. Treat \`templateMatch\` as a hint, not a hard constraint
144
194
  4. Treat \`components\` as the source of truth
145
195
  5. Validate the definition before writing JSX
146
196
  6. Never parse MCP transcript text with shell or Python JSON tooling
147
197
  7. Run \`validate-environment\` before handoff
198
+ 8. Use the React Native direct-write path when the target project is Expo or React Native
148
199
 
149
200
  ## Optional Helper Path
150
201
 
@@ -1 +1 @@
1
- {"version":3,"file":"screen-workflow.js","sourceRoot":"","sources":["../../src/prompts/screen-workflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gMA2IgL;iBACvL;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"screen-workflow.js","sourceRoot":"","sources":["../../src/prompts/screen-workflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gMA8LgL;iBACvL;aACF;SACF;KACF,CAAC;AACJ,CAAC"}