@sxl-studio/bridge 1.7.2 → 1.7.3
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 +342 -16
- package/dist/agent-recipes.d.ts +781 -11
- package/dist/agent-recipes.js +886 -13
- package/dist/agent-recipes.js.map +1 -1
- package/dist/agent-runbook.d.ts +50 -0
- package/dist/agent-runbook.js +243 -0
- package/dist/agent-runbook.js.map +1 -0
- package/dist/asset-upload.d.ts +63 -0
- package/dist/asset-upload.js +225 -0
- package/dist/asset-upload.js.map +1 -0
- package/dist/audit-store.d.ts +15 -0
- package/dist/audit-store.js +100 -0
- package/dist/audit-store.js.map +1 -0
- package/dist/audit.d.ts +4 -3
- package/dist/audit.js +37 -4
- package/dist/audit.js.map +1 -1
- package/dist/auth.d.ts +8 -1
- package/dist/auth.js +41 -1
- package/dist/auth.js.map +1 -1
- package/dist/bridge-agent-workflow-validation-cli.d.ts +2 -0
- package/dist/bridge-agent-workflow-validation-cli.js +68 -0
- package/dist/bridge-agent-workflow-validation-cli.js.map +1 -0
- package/dist/bridge-agent-workflow-validation.d.ts +42 -0
- package/dist/bridge-agent-workflow-validation.js +170 -0
- package/dist/bridge-agent-workflow-validation.js.map +1 -0
- package/dist/bridge-contract-audit.d.ts +45 -0
- package/dist/bridge-contract-audit.js +345 -0
- package/dist/bridge-contract-audit.js.map +1 -0
- package/dist/bridge-health-cli.d.ts +2 -0
- package/dist/bridge-health-cli.js +115 -0
- package/dist/bridge-health-cli.js.map +1 -0
- package/dist/bridge-health.d.ts +33 -0
- package/dist/bridge-health.js +594 -0
- package/dist/bridge-health.js.map +1 -0
- package/dist/bridge-live-validation-cli.d.ts +2 -0
- package/dist/bridge-live-validation-cli.js +114 -0
- package/dist/bridge-live-validation-cli.js.map +1 -0
- package/dist/bridge-live-validation.d.ts +39 -0
- package/dist/bridge-live-validation.js +1141 -0
- package/dist/bridge-live-validation.js.map +1 -0
- package/dist/bridge-performance-profile.d.ts +81 -0
- package/dist/bridge-performance-profile.js +227 -0
- package/dist/bridge-performance-profile.js.map +1 -0
- package/dist/bridge-readiness-cli.d.ts +30 -0
- package/dist/bridge-readiness-cli.js +242 -0
- package/dist/bridge-readiness-cli.js.map +1 -0
- package/dist/bridge-runtime-summary.d.ts +50 -0
- package/dist/bridge-runtime-summary.js +112 -0
- package/dist/bridge-runtime-summary.js.map +1 -0
- package/dist/bridge-workflow-smoke-cli.d.ts +2 -0
- package/dist/bridge-workflow-smoke-cli.js +126 -0
- package/dist/bridge-workflow-smoke-cli.js.map +1 -0
- package/dist/bridge-workflow-smoke.d.ts +39 -0
- package/dist/bridge-workflow-smoke.js +431 -0
- package/dist/bridge-workflow-smoke.js.map +1 -0
- package/dist/codeconnect-suggestions.d.ts +74 -0
- package/dist/codeconnect-suggestions.js +398 -0
- package/dist/codeconnect-suggestions.js.map +1 -0
- package/dist/codeconnect-template.d.ts +98 -0
- package/dist/codeconnect-template.js +280 -0
- package/dist/codeconnect-template.js.map +1 -0
- package/dist/command-queue.d.ts +11 -1
- package/dist/command-queue.js +200 -1
- package/dist/command-queue.js.map +1 -1
- package/dist/command-safety.d.ts +13 -0
- package/dist/command-safety.js +59 -0
- package/dist/command-safety.js.map +1 -0
- package/dist/enabled-library-search.d.ts +49 -0
- package/dist/enabled-library-search.js +151 -0
- package/dist/enabled-library-search.js.map +1 -0
- package/dist/figma-mcp-parity.d.ts +49 -0
- package/dist/figma-mcp-parity.js +368 -0
- package/dist/figma-mcp-parity.js.map +1 -0
- package/dist/figma-mcp-skills-parity.d.ts +61 -0
- package/dist/figma-mcp-skills-parity.js +434 -0
- package/dist/figma-mcp-skills-parity.js.map +1 -0
- package/dist/figma-rest-diagnostics.d.ts +50 -0
- package/dist/figma-rest-diagnostics.js +314 -0
- package/dist/figma-rest-diagnostics.js.map +1 -0
- package/dist/figma-rest.d.ts +27 -0
- package/dist/figma-rest.js +116 -0
- package/dist/figma-rest.js.map +1 -0
- package/dist/http-api.d.ts +14 -2
- package/dist/http-api.js +323 -17
- package/dist/http-api.js.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-factory.d.ts +6 -1
- package/dist/mcp-factory.js +23 -4
- package/dist/mcp-factory.js.map +1 -1
- package/dist/mcp-runtime-probe.d.ts +22 -0
- package/dist/mcp-runtime-probe.js +777 -0
- package/dist/mcp-runtime-probe.js.map +1 -0
- package/dist/mcp-server.d.ts +2 -1
- package/dist/mcp-server.js +2 -2
- package/dist/mcp-server.js.map +1 -1
- package/dist/sxl-mcp-instructions.js +97 -25
- package/dist/sxl-mcp-instructions.js.map +1 -1
- package/dist/tools/audit.d.ts +22 -6
- package/dist/tools/audit.js +49 -7
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/capability-matrix.d.ts +22 -0
- package/dist/tools/capability-matrix.js +38 -0
- package/dist/tools/capability-matrix.js.map +1 -0
- package/dist/tools/catalogue-bootstrap.d.ts +1 -0
- package/dist/tools/catalogue-bootstrap.js +665 -30
- package/dist/tools/catalogue-bootstrap.js.map +1 -1
- package/dist/tools/code-connect-context.d.ts +3 -0
- package/dist/tools/code-connect-context.js +319 -0
- package/dist/tools/code-connect-context.js.map +1 -0
- package/dist/tools/code-connect-template.d.ts +3 -0
- package/dist/tools/code-connect-template.js +111 -0
- package/dist/tools/code-connect-template.js.map +1 -0
- package/dist/tools/composition.js +13 -28
- package/dist/tools/composition.js.map +1 -1
- package/dist/tools/compositions-orchestration.d.ts +14 -14
- package/dist/tools/compositions-orchestration.js +2 -2
- package/dist/tools/compositions-orchestration.js.map +1 -1
- package/dist/tools/data.js +839 -27
- package/dist/tools/data.js.map +1 -1
- package/dist/tools/design-context.d.ts +3 -0
- package/dist/tools/design-context.js +197 -0
- package/dist/tools/design-context.js.map +1 -0
- package/dist/tools/destructive-confirmation.d.ts +10 -0
- package/dist/tools/destructive-confirmation.js +22 -0
- package/dist/tools/destructive-confirmation.js.map +1 -0
- package/dist/tools/diagnostics.js +76 -51
- package/dist/tools/diagnostics.js.map +1 -1
- package/dist/tools/figma-mcp-design.d.ts +3 -0
- package/dist/tools/figma-mcp-design.js +377 -0
- package/dist/tools/figma-mcp-design.js.map +1 -0
- package/dist/tools/figma-nodes.js +57 -43
- package/dist/tools/figma-nodes.js.map +1 -1
- package/dist/tools/figma-rc-extended.js +23 -6
- package/dist/tools/figma-rc-extended.js.map +1 -1
- package/dist/tools/figma-rest.d.ts +39 -0
- package/dist/tools/figma-rest.js +279 -0
- package/dist/tools/figma-rest.js.map +1 -0
- package/dist/tools/git.js +11 -7
- package/dist/tools/git.js.map +1 -1
- package/dist/tools/large-data.d.ts +14 -0
- package/dist/tools/large-data.js +189 -0
- package/dist/tools/large-data.js.map +1 -0
- package/dist/tools/meta.d.ts +6 -1
- package/dist/tools/meta.js +89 -11
- package/dist/tools/meta.js.map +1 -1
- package/dist/tools/metadata.d.ts +3 -0
- package/dist/tools/metadata.js +140 -0
- package/dist/tools/metadata.js.map +1 -0
- package/dist/tools/mockup.d.ts +15 -156
- package/dist/tools/mockup.js +54 -121
- package/dist/tools/mockup.js.map +1 -1
- package/dist/tools/orchestration.js +73 -45
- package/dist/tools/orchestration.js.map +1 -1
- package/dist/tools/prompts.d.ts +3 -0
- package/dist/tools/prompts.js +219 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/registry.d.ts +19 -1
- package/dist/tools/registry.js +4 -4
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/resources.d.ts +19 -2
- package/dist/tools/resources.js +149 -5
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/schema-contracts.d.ts +4763 -0
- package/dist/tools/schema-contracts.js +814 -0
- package/dist/tools/schema-contracts.js.map +1 -0
- package/dist/tools/screenshot.d.ts +3 -0
- package/dist/tools/screenshot.js +144 -0
- package/dist/tools/screenshot.js.map +1 -0
- package/dist/tools/shared.d.ts +11 -1
- package/dist/tools/shared.js +55 -2
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/styles-orchestration.d.ts +2 -2
- package/dist/tools/styles-orchestration.js +13 -5
- package/dist/tools/styles-orchestration.js.map +1 -1
- package/dist/tools/styles.js +22 -8
- package/dist/tools/styles.js.map +1 -1
- package/dist/tools/tokens.d.ts +31 -692
- package/dist/tools/tokens.js +175 -135
- package/dist/tools/tokens.js.map +1 -1
- package/dist/tools/variable-defs.d.ts +3 -0
- package/dist/tools/variable-defs.js +338 -0
- package/dist/tools/variable-defs.js.map +1 -0
- package/dist/tools/variables-orchestration.js +13 -5
- package/dist/tools/variables-orchestration.js.map +1 -1
- package/dist/tools/variables.js +18 -15
- package/dist/tools/variables.js.map +1 -1
- package/dist/types.d.ts +53 -0
- package/dist/ultimate-readiness-audit.d.ts +37 -0
- package/dist/ultimate-readiness-audit.js +431 -0
- package/dist/ultimate-readiness-audit.js.map +1 -0
- package/dist/workflow-planner.d.ts +57 -0
- package/dist/workflow-planner.js +464 -0
- package/dist/workflow-planner.js.map +1 -0
- package/dist/ws-server.js +16 -3
- package/dist/ws-server.js.map +1 -1
- package/package.json +18 -2
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const DESIGN_DSL_V1_SCHEMA_URI = "sxl://agent/schemas/design-dsl-v1";
|
|
3
|
+
export const DOC_SPEC_V2_SCHEMA_URI = "sxl://agent/schemas/doc-spec-v2";
|
|
4
|
+
export const TOKEN_DOC_SPEC_V1_SCHEMA_URI = "sxl://agent/schemas/token-doc-v1";
|
|
5
|
+
export const CODE_CONNECT_CONTEXT_V1_SCHEMA_URI = "sxl://agent/schemas/code-connect-context-v1";
|
|
6
|
+
export const CODE_CONNECT_TEMPLATE_V1_SCHEMA_URI = "sxl://agent/schemas/code-connect-template-v1";
|
|
7
|
+
const propertyValueZod = z.union([z.string(), z.boolean()]);
|
|
8
|
+
export const designDslPropertiesMapZod = z.record(z.string(), propertyValueZod);
|
|
9
|
+
export const designDslTextOverrideZod = z.object({
|
|
10
|
+
layerName: z.string().min(1).describe("TEXT layer name inside the instance to receive `value`."),
|
|
11
|
+
value: z.string().describe("New characters to write into that TEXT layer."),
|
|
12
|
+
});
|
|
13
|
+
export const designDslFillBindingZod = z.object({
|
|
14
|
+
layerName: z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Optional child-layer name to scope the binding. When omitted, the binding applies to the host node itself."),
|
|
19
|
+
variableId: z.string().min(1).describe("Figma Variable id (must resolve to COLOR)."),
|
|
20
|
+
paintIndex: z.number().int().min(0).optional().describe("Which existing fill index to bind. Default: 0."),
|
|
21
|
+
});
|
|
22
|
+
export const designDslSizingSpecZod = z.object({
|
|
23
|
+
mode: z.enum(["HUG", "FIXED", "FILL"]).optional(),
|
|
24
|
+
width: z.number().positive().optional(),
|
|
25
|
+
height: z.number().positive().optional(),
|
|
26
|
+
});
|
|
27
|
+
export const designDslPaddingSpecZod = z.union([
|
|
28
|
+
z.number().min(0),
|
|
29
|
+
z.object({
|
|
30
|
+
top: z.number().min(0).optional(),
|
|
31
|
+
right: z.number().min(0).optional(),
|
|
32
|
+
bottom: z.number().min(0).optional(),
|
|
33
|
+
left: z.number().min(0).optional(),
|
|
34
|
+
}),
|
|
35
|
+
]);
|
|
36
|
+
export const designDslLayoutBackgroundZod = z.union([
|
|
37
|
+
z.object({ hex: z.string().regex(/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/, "hex must be #rrggbb[aa]") }),
|
|
38
|
+
z.object({ variableId: z.string().min(1) }),
|
|
39
|
+
]);
|
|
40
|
+
export const designDslLayoutSpecZod = z.object({
|
|
41
|
+
mode: z.enum(["VERTICAL", "HORIZONTAL", "WRAP"]).optional(),
|
|
42
|
+
itemSpacing: z.number().min(0).optional(),
|
|
43
|
+
counterAxisSpacing: z.number().min(0).optional(),
|
|
44
|
+
padding: designDslPaddingSpecZod.optional(),
|
|
45
|
+
primaryAxis: z.enum(["MIN", "CENTER", "MAX", "SPACE_BETWEEN"]).optional(),
|
|
46
|
+
counterAxis: z.enum(["MIN", "CENTER", "MAX", "BASELINE"]).optional(),
|
|
47
|
+
width: z.number().positive().optional(),
|
|
48
|
+
height: z.number().positive().optional(),
|
|
49
|
+
background: designDslLayoutBackgroundZod.optional(),
|
|
50
|
+
});
|
|
51
|
+
export const designDslItemZod = z.lazy(() => z.discriminatedUnion("kind", [
|
|
52
|
+
z.object({
|
|
53
|
+
kind: z.literal("instance"),
|
|
54
|
+
componentId: z.string().min(1).optional(),
|
|
55
|
+
componentKey: z.string().min(1).optional(),
|
|
56
|
+
componentName: z.string().min(1).optional(),
|
|
57
|
+
name: z.string().optional().describe("Override the resulting instance.name."),
|
|
58
|
+
properties: designDslPropertiesMapZod.optional().describe("Component property overrides keyed by base name."),
|
|
59
|
+
textOverrides: z.array(designDslTextOverrideZod).optional(),
|
|
60
|
+
fillBindings: z.array(designDslFillBindingZod).optional(),
|
|
61
|
+
layoutSizing: designDslSizingSpecZod.optional(),
|
|
62
|
+
count: z.number().int().positive().max(500).optional().describe("Repeat the same instance N times."),
|
|
63
|
+
}),
|
|
64
|
+
z.object({
|
|
65
|
+
kind: z.literal("spacer"),
|
|
66
|
+
size: z.number().min(0).optional().describe("Square size when fillContainer is false. Default: 8."),
|
|
67
|
+
fillContainer: z.boolean().optional().describe("Stretch along the parent's primary axis."),
|
|
68
|
+
}),
|
|
69
|
+
z.object({
|
|
70
|
+
kind: z.literal("text"),
|
|
71
|
+
value: z.string(),
|
|
72
|
+
name: z.string().optional(),
|
|
73
|
+
fontSize: z.number().positive().optional(),
|
|
74
|
+
fontName: z.object({ family: z.string(), style: z.string() }).optional(),
|
|
75
|
+
textStyleId: z.string().optional(),
|
|
76
|
+
fillBindings: z.array(designDslFillBindingZod).optional(),
|
|
77
|
+
layoutSizing: designDslSizingSpecZod.optional(),
|
|
78
|
+
}),
|
|
79
|
+
z.object({
|
|
80
|
+
kind: z.literal("section"),
|
|
81
|
+
name: z.string().optional(),
|
|
82
|
+
layout: designDslLayoutSpecZod.optional(),
|
|
83
|
+
layoutSizing: designDslSizingSpecZod.optional(),
|
|
84
|
+
items: z.array(designDslItemZod).min(1),
|
|
85
|
+
}),
|
|
86
|
+
]));
|
|
87
|
+
export const designDslScreenSpecShape = {
|
|
88
|
+
version: z.literal("1").optional(),
|
|
89
|
+
name: z.string().optional(),
|
|
90
|
+
targetParentId: z.string().optional(),
|
|
91
|
+
targetRootId: z.string().optional(),
|
|
92
|
+
layout: designDslLayoutSpecZod.optional(),
|
|
93
|
+
items: z.array(designDslItemZod).min(1),
|
|
94
|
+
dryRun: z.boolean().optional(),
|
|
95
|
+
};
|
|
96
|
+
export const designDslScreenSpecV1Zod = z.object(designDslScreenSpecShape)
|
|
97
|
+
.superRefine((spec, ctx) => {
|
|
98
|
+
if (spec.targetParentId && spec.targetRootId) {
|
|
99
|
+
ctx.addIssue({
|
|
100
|
+
code: z.ZodIssueCode.custom,
|
|
101
|
+
message: "Design DSL v1 accepts targetParentId or targetRootId, not both.",
|
|
102
|
+
path: ["targetRootId"],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.describe("Design DSL v1. Optional version:'1' keeps compatibility with existing agents.");
|
|
107
|
+
export const designDslUpdateScreenSpecV1Zod = z.object({
|
|
108
|
+
version: z.literal("1").optional(),
|
|
109
|
+
name: z.string().optional(),
|
|
110
|
+
layout: designDslLayoutSpecZod.optional(),
|
|
111
|
+
items: z.array(designDslItemZod).min(1),
|
|
112
|
+
dryRun: z.boolean().optional(),
|
|
113
|
+
}).strict().describe("Design DSL v1 update payload. targetRootId is passed separately; targetParentId is not allowed.");
|
|
114
|
+
export const designDslBuildMockupArgs = designDslScreenSpecShape;
|
|
115
|
+
export const tokenDocSpecV1Zod = z.object({
|
|
116
|
+
version: z.literal("1"),
|
|
117
|
+
title: z.string().optional(),
|
|
118
|
+
groups: z.array(z.object({
|
|
119
|
+
id: z.string().min(1),
|
|
120
|
+
title: z.string().optional(),
|
|
121
|
+
rows: z.array(z.object({
|
|
122
|
+
layerName: z.string().min(1),
|
|
123
|
+
tokenPath: z.string().min(1),
|
|
124
|
+
show: z.enum(["resolved", "path", "both"]).optional(),
|
|
125
|
+
})),
|
|
126
|
+
})),
|
|
127
|
+
});
|
|
128
|
+
const tokenRowZod = z.object({
|
|
129
|
+
layerName: z.string().min(1),
|
|
130
|
+
tokenPath: z.string().min(1),
|
|
131
|
+
show: z.enum(["resolved", "path", "both"]).optional(),
|
|
132
|
+
});
|
|
133
|
+
const sectionTitleZod = z.object({
|
|
134
|
+
type: z.literal("title"),
|
|
135
|
+
id: z.string().optional(),
|
|
136
|
+
text: z.string(),
|
|
137
|
+
layerName: z.string().optional(),
|
|
138
|
+
});
|
|
139
|
+
const sectionDescriptionZod = z.object({
|
|
140
|
+
type: z.literal("description"),
|
|
141
|
+
id: z.string().optional(),
|
|
142
|
+
markdown: z.string(),
|
|
143
|
+
layerName: z.string().optional(),
|
|
144
|
+
});
|
|
145
|
+
const sectionVariantsZod = z.object({
|
|
146
|
+
type: z.literal("variants"),
|
|
147
|
+
id: z.string().optional(),
|
|
148
|
+
componentSetId: z.string().optional(),
|
|
149
|
+
componentId: z.string().optional(),
|
|
150
|
+
layout: z.enum(["matrix", "grid", "list"]).optional(),
|
|
151
|
+
groupBy: z.string().optional(),
|
|
152
|
+
limit: z.number().int().positive().optional(),
|
|
153
|
+
labelLayerName: z.string().optional(),
|
|
154
|
+
});
|
|
155
|
+
const sectionPropsZod = z.object({
|
|
156
|
+
type: z.literal("props"),
|
|
157
|
+
id: z.string().optional(),
|
|
158
|
+
componentId: z.string().optional(),
|
|
159
|
+
componentSetId: z.string().optional(),
|
|
160
|
+
include: z.array(z.enum(["VARIANT", "BOOLEAN", "TEXT", "INSTANCE_SWAP"])).optional(),
|
|
161
|
+
});
|
|
162
|
+
const sectionTokenTableZod = z.object({
|
|
163
|
+
type: z.literal("tokenTable"),
|
|
164
|
+
id: z.string().optional(),
|
|
165
|
+
title: z.string().optional(),
|
|
166
|
+
rows: z.array(tokenRowZod),
|
|
167
|
+
});
|
|
168
|
+
const sectionPaletteZod = z.object({
|
|
169
|
+
type: z.literal("palette"),
|
|
170
|
+
id: z.string().optional(),
|
|
171
|
+
collectionName: z.string().optional(),
|
|
172
|
+
collectionId: z.string().optional(),
|
|
173
|
+
variableType: z.enum(["COLOR", "FLOAT", "STRING", "BOOLEAN"]).optional(),
|
|
174
|
+
templateNodeId: z.string().min(1),
|
|
175
|
+
swatchLayerName: z.string().optional(),
|
|
176
|
+
labelLayerName: z.string().optional(),
|
|
177
|
+
valueLayerName: z.string().optional(),
|
|
178
|
+
namePrefix: z.string().optional(),
|
|
179
|
+
limit: z.number().int().positive().optional(),
|
|
180
|
+
});
|
|
181
|
+
const annotationPropertyZod = z.object({ type: z.string() });
|
|
182
|
+
const annotationZod = z.object({
|
|
183
|
+
label: z.string().optional(),
|
|
184
|
+
labelMarkdown: z.string().optional(),
|
|
185
|
+
categoryId: z.string().optional(),
|
|
186
|
+
properties: z.array(annotationPropertyZod).optional(),
|
|
187
|
+
});
|
|
188
|
+
const sectionMeasureZod = z.object({
|
|
189
|
+
type: z.literal("measure"),
|
|
190
|
+
id: z.string().optional(),
|
|
191
|
+
experimental: z.boolean().optional(),
|
|
192
|
+
nodeId: z.string().min(1),
|
|
193
|
+
annotations: z.array(annotationZod).optional(),
|
|
194
|
+
});
|
|
195
|
+
export const docSectionZod = z.discriminatedUnion("type", [
|
|
196
|
+
sectionTitleZod,
|
|
197
|
+
sectionDescriptionZod,
|
|
198
|
+
sectionVariantsZod,
|
|
199
|
+
sectionPropsZod,
|
|
200
|
+
sectionTokenTableZod,
|
|
201
|
+
sectionPaletteZod,
|
|
202
|
+
sectionMeasureZod,
|
|
203
|
+
]);
|
|
204
|
+
export const docSpecV2Zod = z.object({
|
|
205
|
+
version: z.literal("2"),
|
|
206
|
+
title: z.string().optional(),
|
|
207
|
+
frame: z.object({
|
|
208
|
+
targetParentId: z.string().optional(),
|
|
209
|
+
targetRootId: z.string().optional(),
|
|
210
|
+
createIfMissing: z.boolean().optional(),
|
|
211
|
+
name: z.string().optional(),
|
|
212
|
+
}).optional(),
|
|
213
|
+
sections: z.array(docSectionZod).min(1),
|
|
214
|
+
});
|
|
215
|
+
export const paletteSectionZod = sectionPaletteZod;
|
|
216
|
+
export const annotationItemZod = annotationZod;
|
|
217
|
+
const codeConnectFrameworkZod = z.enum(["react", "angular", "html", "swift", "kotlin", "vue3", "compose"]);
|
|
218
|
+
const codeConnectStatusZod = z.enum(["complete", "ready-for-dev", "in-progress", "backlog"]);
|
|
219
|
+
export const codeConnectTargetZod = z.object({
|
|
220
|
+
nodeId: z.string().optional(),
|
|
221
|
+
nodeName: z.string().min(1),
|
|
222
|
+
nodeType: z.string().optional(),
|
|
223
|
+
});
|
|
224
|
+
export const codeConnectComponentApiPropertyZod = z.object({
|
|
225
|
+
name: z.string().min(1),
|
|
226
|
+
kind: z.string().min(1),
|
|
227
|
+
defaultValue: z.union([z.string(), z.boolean()]).optional(),
|
|
228
|
+
options: z.array(z.string()).optional(),
|
|
229
|
+
}).passthrough();
|
|
230
|
+
export const codeConnectFileBindingZod = z.object({
|
|
231
|
+
id: z.string().min(1),
|
|
232
|
+
framework: codeConnectFrameworkZod,
|
|
233
|
+
filePath: z.string().min(1),
|
|
234
|
+
componentName: z.string().optional(),
|
|
235
|
+
importPath: z.string().optional(),
|
|
236
|
+
snippetTemplate: z.string().optional(),
|
|
237
|
+
instructions: z.string().optional(),
|
|
238
|
+
storybookDocsUrl: z.string().optional(),
|
|
239
|
+
}).passthrough();
|
|
240
|
+
export const codeConnectBindingZod = z.object({
|
|
241
|
+
gitlabUrl: z.string(),
|
|
242
|
+
displayName: z.string().min(1),
|
|
243
|
+
resourceType: z.enum(["source", "docs", "story", "package"]),
|
|
244
|
+
documentationUrl: z.string().optional(),
|
|
245
|
+
documentationDocsQuerySuffix: z.string().optional(),
|
|
246
|
+
documentationStoryPathTemplate: z.string().optional(),
|
|
247
|
+
importPath: z.string().optional(),
|
|
248
|
+
snippetTemplate: z.string().optional(),
|
|
249
|
+
files: z.array(codeConnectFileBindingZod).optional(),
|
|
250
|
+
storybook: z.object({
|
|
251
|
+
designEmbed: z.boolean().optional(),
|
|
252
|
+
figmaUrl: z.string().optional(),
|
|
253
|
+
compositionJson: z.boolean().optional(),
|
|
254
|
+
metadata: z.boolean().optional(),
|
|
255
|
+
description: z.string().optional(),
|
|
256
|
+
tokensReady: z.boolean().optional(),
|
|
257
|
+
status: codeConnectStatusZod.optional(),
|
|
258
|
+
compositionTokenFileId: z.string().optional(),
|
|
259
|
+
compositionName: z.string().optional(),
|
|
260
|
+
compositionFilePath: z.string().optional(),
|
|
261
|
+
componentApi: z.object({
|
|
262
|
+
properties: z.array(codeConnectComponentApiPropertyZod),
|
|
263
|
+
}).optional(),
|
|
264
|
+
}).passthrough().optional(),
|
|
265
|
+
}).passthrough();
|
|
266
|
+
export const codeConnectSuggestionZod = z.object({
|
|
267
|
+
score: z.number(),
|
|
268
|
+
confidence: z.enum(["high", "medium", "low"]),
|
|
269
|
+
reason: z.array(z.string()),
|
|
270
|
+
filePath: z.string(),
|
|
271
|
+
framework: codeConnectFrameworkZod,
|
|
272
|
+
componentName: z.string(),
|
|
273
|
+
importPath: z.string(),
|
|
274
|
+
binding: codeConnectBindingZod,
|
|
275
|
+
}).passthrough();
|
|
276
|
+
export const codeConnectContextV1Zod = z.object({
|
|
277
|
+
ok: z.literal(true),
|
|
278
|
+
source: z.literal("bridge-code-connect-context"),
|
|
279
|
+
generatedAt: z.string(),
|
|
280
|
+
targets: z.array(codeConnectTargetZod),
|
|
281
|
+
targetNodeIds: z.array(z.string()),
|
|
282
|
+
codegenLanguage: z.enum(["designer-json", "vue3", "swiftui", "kotlin"]),
|
|
283
|
+
viewMode: z.enum(["styled", "decomposed", "raw"]),
|
|
284
|
+
clientFrameworks: z.array(z.string()).nullable(),
|
|
285
|
+
mappedFrameworks: z.array(codeConnectFrameworkZod).nullable(),
|
|
286
|
+
clientLanguages: z.array(z.string()).nullable(),
|
|
287
|
+
context: z.object({
|
|
288
|
+
selection: z.unknown().optional(),
|
|
289
|
+
globalSettings: z.unknown().optional(),
|
|
290
|
+
registry: z.unknown().optional(),
|
|
291
|
+
selectionStatus: z.unknown().optional(),
|
|
292
|
+
nodeTree: z.record(z.string(), z.unknown()).optional(),
|
|
293
|
+
codegen: z.record(z.string(), z.unknown()).optional(),
|
|
294
|
+
compositionJson: z.record(z.string(), z.unknown()).optional(),
|
|
295
|
+
existingBindings: z.record(z.string(), z.unknown()).optional(),
|
|
296
|
+
nodeUiStatus: z.record(z.string(), z.unknown()).optional(),
|
|
297
|
+
componentDiscovery: z.unknown().optional(),
|
|
298
|
+
suggestions: z.object({
|
|
299
|
+
ok: z.literal(true),
|
|
300
|
+
targets: z.array(z.object({
|
|
301
|
+
nodeId: z.string().optional(),
|
|
302
|
+
nodeName: z.string(),
|
|
303
|
+
nodeType: z.string().optional(),
|
|
304
|
+
suggestions: z.array(codeConnectSuggestionZod),
|
|
305
|
+
}).passthrough()),
|
|
306
|
+
}).passthrough().optional(),
|
|
307
|
+
}).passthrough(),
|
|
308
|
+
warnings: z.array(z.string()),
|
|
309
|
+
limitations: z.array(z.string()),
|
|
310
|
+
templateGuidance: z.array(z.string()),
|
|
311
|
+
nextStep: z.string(),
|
|
312
|
+
}).passthrough();
|
|
313
|
+
export const codeConnectTemplateV1Zod = z.object({
|
|
314
|
+
ok: z.literal(true),
|
|
315
|
+
source: z.literal("bridge-code-connect-template"),
|
|
316
|
+
dryRun: z.boolean(),
|
|
317
|
+
generatedAt: z.string(),
|
|
318
|
+
target: codeConnectTargetZod.nullable(),
|
|
319
|
+
binding: codeConnectBindingZod,
|
|
320
|
+
template: z.object({
|
|
321
|
+
fileName: z.string().min(1),
|
|
322
|
+
outputPath: z.string().min(1),
|
|
323
|
+
content: z.string(),
|
|
324
|
+
bytes: z.number().int().nonnegative(),
|
|
325
|
+
componentName: z.string().min(1),
|
|
326
|
+
importPath: z.string().nullable(),
|
|
327
|
+
sourceFilePath: z.string().nullable(),
|
|
328
|
+
propertyAccessors: z.array(z.string()),
|
|
329
|
+
}),
|
|
330
|
+
write: z.object({
|
|
331
|
+
requested: z.boolean(),
|
|
332
|
+
written: z.boolean(),
|
|
333
|
+
overwritten: z.boolean(),
|
|
334
|
+
}),
|
|
335
|
+
warnings: z.array(z.string()),
|
|
336
|
+
nextStep: z.string(),
|
|
337
|
+
}).passthrough();
|
|
338
|
+
export const BRIDGE_SCHEMA_INDEX = {
|
|
339
|
+
version: 1,
|
|
340
|
+
schemas: [
|
|
341
|
+
{
|
|
342
|
+
id: "design-dsl-v1",
|
|
343
|
+
uri: DESIGN_DSL_V1_SCHEMA_URI,
|
|
344
|
+
toolEntrypoints: ["validate_screen_spec", "build_screen", "update_screen", "build_mockup"],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
id: "doc-spec-v2",
|
|
348
|
+
uri: DOC_SPEC_V2_SCHEMA_URI,
|
|
349
|
+
toolEntrypoints: ["apply_doc_spec"],
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
id: "token-doc-v1",
|
|
353
|
+
uri: TOKEN_DOC_SPEC_V1_SCHEMA_URI,
|
|
354
|
+
toolEntrypoints: ["build_token_documentation", "apply_token_doc_spec"],
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: "code-connect-context-v1",
|
|
358
|
+
uri: CODE_CONNECT_CONTEXT_V1_SCHEMA_URI,
|
|
359
|
+
toolEntrypoints: ["get_context_for_code_connect"],
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
id: "code-connect-template-v1",
|
|
363
|
+
uri: CODE_CONNECT_TEMPLATE_V1_SCHEMA_URI,
|
|
364
|
+
toolEntrypoints: ["generate_code_connect_template"],
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
};
|
|
368
|
+
export const DESIGN_DSL_V1_JSON_SCHEMA = {
|
|
369
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
370
|
+
$id: DESIGN_DSL_V1_SCHEMA_URI,
|
|
371
|
+
title: "SXL Design DSL v1",
|
|
372
|
+
type: "object",
|
|
373
|
+
required: ["items"],
|
|
374
|
+
additionalProperties: false,
|
|
375
|
+
properties: {
|
|
376
|
+
version: { const: "1" },
|
|
377
|
+
name: { type: "string" },
|
|
378
|
+
targetParentId: { type: "string" },
|
|
379
|
+
targetRootId: { type: "string" },
|
|
380
|
+
dryRun: { type: "boolean" },
|
|
381
|
+
layout: { $ref: "#/$defs/layout" },
|
|
382
|
+
items: { type: "array", minItems: 1, items: { $ref: "#/$defs/item" } },
|
|
383
|
+
},
|
|
384
|
+
allOf: [
|
|
385
|
+
{
|
|
386
|
+
not: {
|
|
387
|
+
required: ["targetParentId", "targetRootId"],
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
],
|
|
391
|
+
$defs: {
|
|
392
|
+
sizing: {
|
|
393
|
+
type: "object",
|
|
394
|
+
additionalProperties: false,
|
|
395
|
+
properties: {
|
|
396
|
+
mode: { enum: ["HUG", "FIXED", "FILL"] },
|
|
397
|
+
width: { type: "number", exclusiveMinimum: 0 },
|
|
398
|
+
height: { type: "number", exclusiveMinimum: 0 },
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
layout: {
|
|
402
|
+
type: "object",
|
|
403
|
+
additionalProperties: false,
|
|
404
|
+
properties: {
|
|
405
|
+
mode: { enum: ["VERTICAL", "HORIZONTAL", "WRAP"] },
|
|
406
|
+
itemSpacing: { type: "number", minimum: 0 },
|
|
407
|
+
counterAxisSpacing: { type: "number", minimum: 0 },
|
|
408
|
+
padding: {
|
|
409
|
+
oneOf: [
|
|
410
|
+
{ type: "number", minimum: 0 },
|
|
411
|
+
{
|
|
412
|
+
type: "object",
|
|
413
|
+
additionalProperties: false,
|
|
414
|
+
properties: {
|
|
415
|
+
top: { type: "number", minimum: 0 },
|
|
416
|
+
right: { type: "number", minimum: 0 },
|
|
417
|
+
bottom: { type: "number", minimum: 0 },
|
|
418
|
+
left: { type: "number", minimum: 0 },
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
},
|
|
423
|
+
primaryAxis: { enum: ["MIN", "CENTER", "MAX", "SPACE_BETWEEN"] },
|
|
424
|
+
counterAxis: { enum: ["MIN", "CENTER", "MAX", "BASELINE"] },
|
|
425
|
+
width: { type: "number", exclusiveMinimum: 0 },
|
|
426
|
+
height: { type: "number", exclusiveMinimum: 0 },
|
|
427
|
+
background: {
|
|
428
|
+
oneOf: [
|
|
429
|
+
{
|
|
430
|
+
type: "object",
|
|
431
|
+
required: ["hex"],
|
|
432
|
+
additionalProperties: false,
|
|
433
|
+
properties: { hex: { type: "string", pattern: "^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$" } },
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
type: "object",
|
|
437
|
+
required: ["variableId"],
|
|
438
|
+
additionalProperties: false,
|
|
439
|
+
properties: { variableId: { type: "string", minLength: 1 } },
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
textOverride: {
|
|
446
|
+
type: "object",
|
|
447
|
+
required: ["layerName", "value"],
|
|
448
|
+
additionalProperties: false,
|
|
449
|
+
properties: { layerName: { type: "string", minLength: 1 }, value: { type: "string" } },
|
|
450
|
+
},
|
|
451
|
+
fillBinding: {
|
|
452
|
+
type: "object",
|
|
453
|
+
required: ["variableId"],
|
|
454
|
+
additionalProperties: false,
|
|
455
|
+
properties: {
|
|
456
|
+
layerName: { type: "string", minLength: 1 },
|
|
457
|
+
variableId: { type: "string", minLength: 1 },
|
|
458
|
+
paintIndex: { type: "integer", minimum: 0 },
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
item: {
|
|
462
|
+
oneOf: [
|
|
463
|
+
{
|
|
464
|
+
type: "object",
|
|
465
|
+
required: ["kind"],
|
|
466
|
+
additionalProperties: false,
|
|
467
|
+
properties: {
|
|
468
|
+
kind: { const: "instance" },
|
|
469
|
+
componentId: { type: "string", minLength: 1 },
|
|
470
|
+
componentKey: { type: "string", minLength: 1 },
|
|
471
|
+
componentName: { type: "string", minLength: 1 },
|
|
472
|
+
name: { type: "string" },
|
|
473
|
+
properties: { type: "object", additionalProperties: { oneOf: [{ type: "string" }, { type: "boolean" }] } },
|
|
474
|
+
textOverrides: { type: "array", items: { $ref: "#/$defs/textOverride" } },
|
|
475
|
+
fillBindings: { type: "array", items: { $ref: "#/$defs/fillBinding" } },
|
|
476
|
+
layoutSizing: { $ref: "#/$defs/sizing" },
|
|
477
|
+
count: { type: "integer", minimum: 1, maximum: 500 },
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
type: "object",
|
|
482
|
+
required: ["kind", "items"],
|
|
483
|
+
additionalProperties: false,
|
|
484
|
+
properties: {
|
|
485
|
+
kind: { const: "section" },
|
|
486
|
+
name: { type: "string" },
|
|
487
|
+
layout: { $ref: "#/$defs/layout" },
|
|
488
|
+
layoutSizing: { $ref: "#/$defs/sizing" },
|
|
489
|
+
items: { type: "array", minItems: 1, items: { $ref: "#/$defs/item" } },
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
type: "object",
|
|
494
|
+
required: ["kind"],
|
|
495
|
+
additionalProperties: false,
|
|
496
|
+
properties: {
|
|
497
|
+
kind: { const: "spacer" },
|
|
498
|
+
size: { type: "number", minimum: 0 },
|
|
499
|
+
fillContainer: { type: "boolean" },
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
type: "object",
|
|
504
|
+
required: ["kind", "value"],
|
|
505
|
+
additionalProperties: false,
|
|
506
|
+
properties: {
|
|
507
|
+
kind: { const: "text" },
|
|
508
|
+
value: { type: "string" },
|
|
509
|
+
name: { type: "string" },
|
|
510
|
+
fontSize: { type: "number", exclusiveMinimum: 0 },
|
|
511
|
+
fontName: {
|
|
512
|
+
type: "object",
|
|
513
|
+
required: ["family", "style"],
|
|
514
|
+
additionalProperties: false,
|
|
515
|
+
properties: { family: { type: "string" }, style: { type: "string" } },
|
|
516
|
+
},
|
|
517
|
+
textStyleId: { type: "string" },
|
|
518
|
+
fillBindings: { type: "array", items: { $ref: "#/$defs/fillBinding" } },
|
|
519
|
+
layoutSizing: { $ref: "#/$defs/sizing" },
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
],
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
export const DOC_SPEC_V2_JSON_SCHEMA = {
|
|
527
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
528
|
+
$id: DOC_SPEC_V2_SCHEMA_URI,
|
|
529
|
+
title: "SXL Doc Spec v2",
|
|
530
|
+
type: "object",
|
|
531
|
+
required: ["version", "sections"],
|
|
532
|
+
additionalProperties: false,
|
|
533
|
+
properties: {
|
|
534
|
+
version: { const: "2" },
|
|
535
|
+
title: { type: "string" },
|
|
536
|
+
frame: {
|
|
537
|
+
type: "object",
|
|
538
|
+
additionalProperties: false,
|
|
539
|
+
properties: {
|
|
540
|
+
targetParentId: { type: "string" },
|
|
541
|
+
targetRootId: { type: "string" },
|
|
542
|
+
createIfMissing: { type: "boolean" },
|
|
543
|
+
name: { type: "string" },
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
sections: {
|
|
547
|
+
type: "array",
|
|
548
|
+
minItems: 1,
|
|
549
|
+
items: {
|
|
550
|
+
oneOf: [
|
|
551
|
+
{ type: "object", required: ["type", "text"], properties: { type: { const: "title" }, id: { type: "string" }, text: { type: "string" }, layerName: { type: "string" } }, additionalProperties: false },
|
|
552
|
+
{ type: "object", required: ["type", "markdown"], properties: { type: { const: "description" }, id: { type: "string" }, markdown: { type: "string" }, layerName: { type: "string" } }, additionalProperties: false },
|
|
553
|
+
{ type: "object", required: ["type"], properties: { type: { const: "variants" }, id: { type: "string" }, componentSetId: { type: "string" }, componentId: { type: "string" }, layout: { enum: ["matrix", "grid", "list"] }, groupBy: { type: "string" }, limit: { type: "integer", minimum: 1 }, labelLayerName: { type: "string" } }, additionalProperties: false },
|
|
554
|
+
{ type: "object", required: ["type"], properties: { type: { const: "props" }, id: { type: "string" }, componentId: { type: "string" }, componentSetId: { type: "string" }, include: { type: "array", items: { enum: ["VARIANT", "BOOLEAN", "TEXT", "INSTANCE_SWAP"] } } }, additionalProperties: false },
|
|
555
|
+
{ type: "object", required: ["type", "rows"], properties: { type: { const: "tokenTable" }, id: { type: "string" }, title: { type: "string" }, rows: { type: "array", items: { $ref: "#/$defs/tokenRow" } } }, additionalProperties: false },
|
|
556
|
+
{ type: "object", required: ["type", "templateNodeId"], properties: { type: { const: "palette" }, id: { type: "string" }, collectionName: { type: "string" }, collectionId: { type: "string" }, variableType: { enum: ["COLOR", "FLOAT", "STRING", "BOOLEAN"] }, templateNodeId: { type: "string", minLength: 1 }, swatchLayerName: { type: "string" }, labelLayerName: { type: "string" }, valueLayerName: { type: "string" }, namePrefix: { type: "string" }, limit: { type: "integer", minimum: 1 } }, additionalProperties: false },
|
|
557
|
+
{ type: "object", required: ["type", "nodeId"], properties: { type: { const: "measure" }, id: { type: "string" }, experimental: { type: "boolean" }, nodeId: { type: "string", minLength: 1 }, annotations: { type: "array", items: { type: "object" } } }, additionalProperties: false },
|
|
558
|
+
],
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
$defs: {
|
|
563
|
+
tokenRow: {
|
|
564
|
+
type: "object",
|
|
565
|
+
required: ["layerName", "tokenPath"],
|
|
566
|
+
additionalProperties: false,
|
|
567
|
+
properties: {
|
|
568
|
+
layerName: { type: "string", minLength: 1 },
|
|
569
|
+
tokenPath: { type: "string", minLength: 1 },
|
|
570
|
+
show: { enum: ["resolved", "path", "both"] },
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
export const TOKEN_DOC_SPEC_V1_JSON_SCHEMA = {
|
|
576
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
577
|
+
$id: TOKEN_DOC_SPEC_V1_SCHEMA_URI,
|
|
578
|
+
title: "SXL Token Doc Spec v1",
|
|
579
|
+
type: "object",
|
|
580
|
+
required: ["version", "groups"],
|
|
581
|
+
additionalProperties: false,
|
|
582
|
+
properties: {
|
|
583
|
+
version: { const: "1" },
|
|
584
|
+
title: { type: "string" },
|
|
585
|
+
groups: {
|
|
586
|
+
type: "array",
|
|
587
|
+
items: {
|
|
588
|
+
type: "object",
|
|
589
|
+
required: ["id", "rows"],
|
|
590
|
+
additionalProperties: false,
|
|
591
|
+
properties: {
|
|
592
|
+
id: { type: "string", minLength: 1 },
|
|
593
|
+
title: { type: "string" },
|
|
594
|
+
rows: {
|
|
595
|
+
type: "array",
|
|
596
|
+
items: {
|
|
597
|
+
type: "object",
|
|
598
|
+
required: ["layerName", "tokenPath"],
|
|
599
|
+
additionalProperties: false,
|
|
600
|
+
properties: {
|
|
601
|
+
layerName: { type: "string", minLength: 1 },
|
|
602
|
+
tokenPath: { type: "string", minLength: 1 },
|
|
603
|
+
show: { enum: ["resolved", "path", "both"] },
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
const CODE_CONNECT_JSON_DEFS = {
|
|
613
|
+
target: {
|
|
614
|
+
type: "object",
|
|
615
|
+
required: ["nodeName"],
|
|
616
|
+
additionalProperties: true,
|
|
617
|
+
properties: {
|
|
618
|
+
nodeId: { type: "string" },
|
|
619
|
+
nodeName: { type: "string", minLength: 1 },
|
|
620
|
+
nodeType: { type: "string" },
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
componentApiProperty: {
|
|
624
|
+
type: "object",
|
|
625
|
+
required: ["name", "kind"],
|
|
626
|
+
additionalProperties: true,
|
|
627
|
+
properties: {
|
|
628
|
+
name: { type: "string", minLength: 1 },
|
|
629
|
+
kind: { type: "string", minLength: 1 },
|
|
630
|
+
defaultValue: { oneOf: [{ type: "string" }, { type: "boolean" }] },
|
|
631
|
+
options: { type: "array", items: { type: "string" } },
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
fileBinding: {
|
|
635
|
+
type: "object",
|
|
636
|
+
required: ["id", "framework", "filePath"],
|
|
637
|
+
additionalProperties: true,
|
|
638
|
+
properties: {
|
|
639
|
+
id: { type: "string", minLength: 1 },
|
|
640
|
+
framework: { enum: ["react", "angular", "html", "swift", "kotlin", "vue3", "compose"] },
|
|
641
|
+
filePath: { type: "string", minLength: 1 },
|
|
642
|
+
componentName: { type: "string" },
|
|
643
|
+
importPath: { type: "string" },
|
|
644
|
+
snippetTemplate: { type: "string" },
|
|
645
|
+
instructions: { type: "string" },
|
|
646
|
+
storybookDocsUrl: { type: "string" },
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
binding: {
|
|
650
|
+
type: "object",
|
|
651
|
+
required: ["gitlabUrl", "displayName", "resourceType"],
|
|
652
|
+
additionalProperties: true,
|
|
653
|
+
properties: {
|
|
654
|
+
gitlabUrl: { type: "string" },
|
|
655
|
+
displayName: { type: "string", minLength: 1 },
|
|
656
|
+
resourceType: { enum: ["source", "docs", "story", "package"] },
|
|
657
|
+
documentationUrl: { type: "string" },
|
|
658
|
+
documentationDocsQuerySuffix: { type: "string" },
|
|
659
|
+
documentationStoryPathTemplate: { type: "string" },
|
|
660
|
+
importPath: { type: "string" },
|
|
661
|
+
snippetTemplate: { type: "string" },
|
|
662
|
+
files: { type: "array", items: { $ref: "#/$defs/fileBinding" } },
|
|
663
|
+
storybook: {
|
|
664
|
+
type: "object",
|
|
665
|
+
additionalProperties: true,
|
|
666
|
+
properties: {
|
|
667
|
+
designEmbed: { type: "boolean" },
|
|
668
|
+
figmaUrl: { type: "string" },
|
|
669
|
+
compositionJson: { type: "boolean" },
|
|
670
|
+
metadata: { type: "boolean" },
|
|
671
|
+
description: { type: "string" },
|
|
672
|
+
tokensReady: { type: "boolean" },
|
|
673
|
+
status: { enum: ["complete", "ready-for-dev", "in-progress", "backlog"] },
|
|
674
|
+
compositionTokenFileId: { type: "string" },
|
|
675
|
+
compositionName: { type: "string" },
|
|
676
|
+
compositionFilePath: { type: "string" },
|
|
677
|
+
componentApi: {
|
|
678
|
+
type: "object",
|
|
679
|
+
required: ["properties"],
|
|
680
|
+
additionalProperties: true,
|
|
681
|
+
properties: {
|
|
682
|
+
properties: { type: "array", items: { $ref: "#/$defs/componentApiProperty" } },
|
|
683
|
+
},
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
},
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
suggestion: {
|
|
690
|
+
type: "object",
|
|
691
|
+
required: ["score", "confidence", "filePath", "framework", "componentName", "importPath", "binding"],
|
|
692
|
+
additionalProperties: true,
|
|
693
|
+
properties: {
|
|
694
|
+
score: { type: "number" },
|
|
695
|
+
confidence: { enum: ["high", "medium", "low"] },
|
|
696
|
+
reason: { type: "array", items: { type: "string" } },
|
|
697
|
+
filePath: { type: "string" },
|
|
698
|
+
framework: { enum: ["react", "angular", "html", "swift", "kotlin", "vue3", "compose"] },
|
|
699
|
+
componentName: { type: "string" },
|
|
700
|
+
importPath: { type: "string" },
|
|
701
|
+
binding: { $ref: "#/$defs/binding" },
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
};
|
|
705
|
+
export const CODE_CONNECT_CONTEXT_V1_JSON_SCHEMA = {
|
|
706
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
707
|
+
$id: CODE_CONNECT_CONTEXT_V1_SCHEMA_URI,
|
|
708
|
+
title: "SXL Code Connect Context v1",
|
|
709
|
+
description: "Bridge response contract for get_context_for_code_connect. Use before saving SXL bindings or generating .figma.ts templates.",
|
|
710
|
+
type: "object",
|
|
711
|
+
required: ["ok", "source", "generatedAt", "targets", "targetNodeIds", "context", "warnings", "limitations", "templateGuidance", "nextStep"],
|
|
712
|
+
additionalProperties: true,
|
|
713
|
+
properties: {
|
|
714
|
+
ok: { const: true },
|
|
715
|
+
source: { const: "bridge-code-connect-context" },
|
|
716
|
+
generatedAt: { type: "string" },
|
|
717
|
+
targets: { type: "array", items: { $ref: "#/$defs/target" } },
|
|
718
|
+
targetNodeIds: { type: "array", items: { type: "string" } },
|
|
719
|
+
codegenLanguage: { enum: ["designer-json", "vue3", "swiftui", "kotlin"] },
|
|
720
|
+
viewMode: { enum: ["styled", "decomposed", "raw"] },
|
|
721
|
+
clientFrameworks: { oneOf: [{ type: "array", items: { type: "string" } }, { type: "null" }] },
|
|
722
|
+
mappedFrameworks: { oneOf: [{ type: "array", items: { enum: ["react", "angular", "html", "swift", "kotlin", "vue3", "compose"] } }, { type: "null" }] },
|
|
723
|
+
clientLanguages: { oneOf: [{ type: "array", items: { type: "string" } }, { type: "null" }] },
|
|
724
|
+
context: {
|
|
725
|
+
type: "object",
|
|
726
|
+
additionalProperties: true,
|
|
727
|
+
properties: {
|
|
728
|
+
selection: {},
|
|
729
|
+
globalSettings: {},
|
|
730
|
+
registry: {},
|
|
731
|
+
selectionStatus: {},
|
|
732
|
+
nodeTree: { type: "object", additionalProperties: true },
|
|
733
|
+
codegen: { type: "object", additionalProperties: true },
|
|
734
|
+
compositionJson: { type: "object", additionalProperties: true },
|
|
735
|
+
existingBindings: { type: "object", additionalProperties: true },
|
|
736
|
+
nodeUiStatus: { type: "object", additionalProperties: true },
|
|
737
|
+
componentDiscovery: {},
|
|
738
|
+
suggestions: {
|
|
739
|
+
type: "object",
|
|
740
|
+
required: ["ok", "targets"],
|
|
741
|
+
additionalProperties: true,
|
|
742
|
+
properties: {
|
|
743
|
+
ok: { const: true },
|
|
744
|
+
targets: {
|
|
745
|
+
type: "array",
|
|
746
|
+
items: {
|
|
747
|
+
type: "object",
|
|
748
|
+
required: ["nodeName", "suggestions"],
|
|
749
|
+
additionalProperties: true,
|
|
750
|
+
properties: {
|
|
751
|
+
nodeId: { type: "string" },
|
|
752
|
+
nodeName: { type: "string" },
|
|
753
|
+
nodeType: { type: "string" },
|
|
754
|
+
suggestions: { type: "array", items: { $ref: "#/$defs/suggestion" } },
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
},
|
|
758
|
+
},
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
},
|
|
762
|
+
warnings: { type: "array", items: { type: "string" } },
|
|
763
|
+
limitations: { type: "array", items: { type: "string" } },
|
|
764
|
+
templateGuidance: { type: "array", items: { type: "string" } },
|
|
765
|
+
nextStep: { type: "string" },
|
|
766
|
+
},
|
|
767
|
+
$defs: CODE_CONNECT_JSON_DEFS,
|
|
768
|
+
};
|
|
769
|
+
export const CODE_CONNECT_TEMPLATE_V1_JSON_SCHEMA = {
|
|
770
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
771
|
+
$id: CODE_CONNECT_TEMPLATE_V1_SCHEMA_URI,
|
|
772
|
+
title: "SXL Code Connect Template v1",
|
|
773
|
+
description: "Bridge response contract for generate_code_connect_template. Dry-run by default; file writes require writeFile=true.",
|
|
774
|
+
type: "object",
|
|
775
|
+
required: ["ok", "source", "dryRun", "generatedAt", "target", "binding", "template", "write", "warnings", "nextStep"],
|
|
776
|
+
additionalProperties: true,
|
|
777
|
+
properties: {
|
|
778
|
+
ok: { const: true },
|
|
779
|
+
source: { const: "bridge-code-connect-template" },
|
|
780
|
+
dryRun: { type: "boolean" },
|
|
781
|
+
generatedAt: { type: "string" },
|
|
782
|
+
target: { oneOf: [{ $ref: "#/$defs/target" }, { type: "null" }] },
|
|
783
|
+
binding: { $ref: "#/$defs/binding" },
|
|
784
|
+
template: {
|
|
785
|
+
type: "object",
|
|
786
|
+
required: ["fileName", "outputPath", "content", "bytes", "componentName", "importPath", "sourceFilePath", "propertyAccessors"],
|
|
787
|
+
additionalProperties: false,
|
|
788
|
+
properties: {
|
|
789
|
+
fileName: { type: "string", minLength: 1 },
|
|
790
|
+
outputPath: { type: "string", minLength: 1 },
|
|
791
|
+
content: { type: "string" },
|
|
792
|
+
bytes: { type: "integer", minimum: 0 },
|
|
793
|
+
componentName: { type: "string", minLength: 1 },
|
|
794
|
+
importPath: { oneOf: [{ type: "string" }, { type: "null" }] },
|
|
795
|
+
sourceFilePath: { oneOf: [{ type: "string" }, { type: "null" }] },
|
|
796
|
+
propertyAccessors: { type: "array", items: { type: "string" } },
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
write: {
|
|
800
|
+
type: "object",
|
|
801
|
+
required: ["requested", "written", "overwritten"],
|
|
802
|
+
additionalProperties: false,
|
|
803
|
+
properties: {
|
|
804
|
+
requested: { type: "boolean" },
|
|
805
|
+
written: { type: "boolean" },
|
|
806
|
+
overwritten: { type: "boolean" },
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
|
+
warnings: { type: "array", items: { type: "string" } },
|
|
810
|
+
nextStep: { type: "string" },
|
|
811
|
+
},
|
|
812
|
+
$defs: CODE_CONNECT_JSON_DEFS,
|
|
813
|
+
};
|
|
814
|
+
//# sourceMappingURL=schema-contracts.js.map
|