@createlex/figgen 1.4.9 → 1.5.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/companion/mcp-server.mjs +1 -9
- package/package.json +1 -1
package/companion/mcp-server.mjs
CHANGED
|
@@ -965,7 +965,6 @@ server.registerTool('figma_to_swiftui', {
|
|
|
965
965
|
context,
|
|
966
966
|
generationMode,
|
|
967
967
|
includeOverflow,
|
|
968
|
-
imageNames,
|
|
969
968
|
});
|
|
970
969
|
if (response.ok && data?.handled) {
|
|
971
970
|
llmResult = {
|
|
@@ -988,14 +987,7 @@ server.registerTool('figma_to_swiftui', {
|
|
|
988
987
|
// -------------------------------------------------------------------------
|
|
989
988
|
if (llmResult) {
|
|
990
989
|
const parsed = parseClaudeResponse(llmResult.code || '');
|
|
991
|
-
const
|
|
992
|
-
// If the hosted provider returned a generic template that doesn't reference any exported
|
|
993
|
-
// assets, fall back to the plugin-generated code which has correct Image("name") calls.
|
|
994
|
-
const hostedMissedAssets =
|
|
995
|
-
llmResult.provider === 'createlex-hosted' &&
|
|
996
|
-
imageNames.length > 0 &&
|
|
997
|
-
!imageNames.some((n) => llmCode.includes(`Image("${n}")`));
|
|
998
|
-
const finalCode = hostedMissedAssets ? (generated.code || llmCode) : (llmCode || generated.code);
|
|
990
|
+
const finalCode = parsed.code || llmResult.code || generated.code;
|
|
999
991
|
const effectiveStructName = inferStructName({
|
|
1000
992
|
code: finalCode,
|
|
1001
993
|
selectionNames: generated.selection?.names ?? [],
|