@defai.digital/ax-cli 3.14.9 → 3.14.11
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 +17 -2
- package/dist/agent/execution/tool-executor.d.ts +6 -0
- package/dist/agent/execution/tool-executor.js +72 -0
- package/dist/agent/execution/tool-executor.js.map +1 -1
- package/dist/commands/design.d.ts +18 -0
- package/dist/commands/design.js +495 -0
- package/dist/commands/design.js.map +1 -0
- package/dist/commands/vscode.js +1 -1
- package/dist/commands/vscode.js.map +1 -1
- package/dist/design/figma-alias.d.ts +88 -0
- package/dist/design/figma-alias.js +324 -0
- package/dist/design/figma-alias.js.map +1 -0
- package/dist/design/figma-audit.d.ts +40 -0
- package/dist/design/figma-audit.js +375 -0
- package/dist/design/figma-audit.js.map +1 -0
- package/dist/design/figma-client.d.ts +123 -0
- package/dist/design/figma-client.js +316 -0
- package/dist/design/figma-client.js.map +1 -0
- package/dist/design/figma-map.d.ts +29 -0
- package/dist/design/figma-map.js +274 -0
- package/dist/design/figma-map.js.map +1 -0
- package/dist/design/figma-tokens.d.ts +73 -0
- package/dist/design/figma-tokens.js +431 -0
- package/dist/design/figma-tokens.js.map +1 -0
- package/dist/design/index.d.ts +13 -0
- package/dist/design/index.js +18 -0
- package/dist/design/index.js.map +1 -0
- package/dist/design/types.d.ts +89 -0
- package/dist/design/types.js +9 -0
- package/dist/design/types.js.map +1 -0
- package/dist/hooks/hook-runner.js +2 -2
- package/dist/hooks/hook-runner.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/ipc/vscode-client.js +1 -1
- package/dist/ipc/vscode-client.js.map +1 -1
- package/dist/llm/tools.js +170 -0
- package/dist/llm/tools.js.map +1 -1
- package/dist/mcp/client-v2.js +1 -1
- package/dist/mcp/client-v2.js.map +1 -1
- package/dist/mcp/validation.js +1 -1
- package/dist/mcp/validation.js.map +1 -1
- package/dist/permissions/permission-manager.js +2 -2
- package/dist/permissions/permission-manager.js.map +1 -1
- package/dist/tools/design-tool.d.ts +59 -0
- package/dist/tools/design-tool.js +258 -0
- package/dist/tools/design-tool.js.map +1 -0
- package/dist/ui/hooks/use-input-history.js +1 -1
- package/dist/ui/hooks/use-input-history.js.map +1 -1
- package/dist/ui/utils/image-handler.js +1 -1
- package/dist/ui/utils/image-handler.js.map +1 -1
- package/dist/utils/path-security.js +2 -2
- package/dist/utils/path-security.js.map +1 -1
- package/dist/utils/progress-tracker.js +1 -1
- package/dist/utils/progress-tracker.js.map +1 -1
- package/dist/utils/settings-manager.js +8 -3
- package/dist/utils/settings-manager.js.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/index.d.ts +1 -0
- package/node_modules/@ax-cli/schemas/dist/index.d.ts.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/index.js +2 -2
- package/node_modules/@ax-cli/schemas/dist/index.js.map +1 -1
- package/node_modules/@ax-cli/schemas/dist/public/design/alias-types.d.ts +346 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/alias-types.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/alias-types.js +171 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/alias-types.js.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/audit-types.d.ts +545 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/audit-types.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/audit-types.js +307 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/audit-types.js.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/figma-types.d.ts +1306 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/figma-types.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/figma-types.js +428 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/figma-types.js.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/index.d.ts +13 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/index.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/index.js +82 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/index.js.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/token-types.d.ts +1245 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/token-types.d.ts.map +1 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/token-types.js +282 -0
- package/node_modules/@ax-cli/schemas/dist/public/design/token-types.js.map +1 -0
- package/package.json +2 -2
- package/packages/schemas/dist/index.d.ts +1 -0
- package/packages/schemas/dist/index.d.ts.map +1 -1
- package/packages/schemas/dist/index.js +2 -2
- package/packages/schemas/dist/index.js.map +1 -1
- package/packages/schemas/dist/public/design/alias-types.d.ts +346 -0
- package/packages/schemas/dist/public/design/alias-types.d.ts.map +1 -0
- package/packages/schemas/dist/public/design/alias-types.js +171 -0
- package/packages/schemas/dist/public/design/alias-types.js.map +1 -0
- package/packages/schemas/dist/public/design/audit-types.d.ts +545 -0
- package/packages/schemas/dist/public/design/audit-types.d.ts.map +1 -0
- package/packages/schemas/dist/public/design/audit-types.js +307 -0
- package/packages/schemas/dist/public/design/audit-types.js.map +1 -0
- package/packages/schemas/dist/public/design/figma-types.d.ts +1306 -0
- package/packages/schemas/dist/public/design/figma-types.d.ts.map +1 -0
- package/packages/schemas/dist/public/design/figma-types.js +428 -0
- package/packages/schemas/dist/public/design/figma-types.js.map +1 -0
- package/packages/schemas/dist/public/design/index.d.ts +13 -0
- package/packages/schemas/dist/public/design/index.d.ts.map +1 -0
- package/packages/schemas/dist/public/design/index.js +82 -0
- package/packages/schemas/dist/public/design/index.js.map +1 -0
- package/packages/schemas/dist/public/design/token-types.d.ts +1245 -0
- package/packages/schemas/dist/public/design/token-types.d.ts.map +1 -0
- package/packages/schemas/dist/public/design/token-types.js +282 -0
- package/packages/schemas/dist/public/design/token-types.js.map +1 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design Audit Schemas
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for rule-based design audit results.
|
|
5
|
+
*
|
|
6
|
+
* @module design/audit-types
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/**
|
|
10
|
+
* Audit rule severity levels
|
|
11
|
+
*/
|
|
12
|
+
export declare const AuditSeveritySchema: z.ZodEnum<["error", "warning", "info"]>;
|
|
13
|
+
export type AuditSeverity = z.infer<typeof AuditSeveritySchema>;
|
|
14
|
+
/**
|
|
15
|
+
* Available audit rule IDs
|
|
16
|
+
*/
|
|
17
|
+
export declare const AuditRuleIdSchema: z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>;
|
|
18
|
+
export type AuditRuleId = z.infer<typeof AuditRuleIdSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Audit rule definition
|
|
21
|
+
*/
|
|
22
|
+
export declare const AuditRuleSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
description: z.ZodString;
|
|
26
|
+
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
27
|
+
category: z.ZodEnum<["consistency", "accessibility", "naming", "performance", "best-practices"]>;
|
|
28
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
id: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
31
|
+
name: string;
|
|
32
|
+
description: string;
|
|
33
|
+
severity: "error" | "warning" | "info";
|
|
34
|
+
category: "consistency" | "accessibility" | "naming" | "performance" | "best-practices";
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
id: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
severity: "error" | "warning" | "info";
|
|
41
|
+
category: "consistency" | "accessibility" | "naming" | "performance" | "best-practices";
|
|
42
|
+
enabled?: boolean | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export type AuditRule = z.infer<typeof AuditRuleSchema>;
|
|
45
|
+
/**
|
|
46
|
+
* Location of an issue within the design
|
|
47
|
+
*/
|
|
48
|
+
export declare const AuditIssueLocationSchema: z.ZodObject<{
|
|
49
|
+
nodeId: z.ZodString;
|
|
50
|
+
nodeName: z.ZodString;
|
|
51
|
+
nodePath: z.ZodString;
|
|
52
|
+
nodeType: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
nodeId: string;
|
|
55
|
+
nodeName: string;
|
|
56
|
+
nodePath: string;
|
|
57
|
+
nodeType: string;
|
|
58
|
+
}, {
|
|
59
|
+
nodeId: string;
|
|
60
|
+
nodeName: string;
|
|
61
|
+
nodePath: string;
|
|
62
|
+
nodeType: string;
|
|
63
|
+
}>;
|
|
64
|
+
export type AuditIssueLocation = z.infer<typeof AuditIssueLocationSchema>;
|
|
65
|
+
/**
|
|
66
|
+
* Single audit issue
|
|
67
|
+
*/
|
|
68
|
+
export declare const AuditIssueSchema: z.ZodObject<{
|
|
69
|
+
ruleId: z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>;
|
|
70
|
+
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
71
|
+
message: z.ZodString;
|
|
72
|
+
location: z.ZodObject<{
|
|
73
|
+
nodeId: z.ZodString;
|
|
74
|
+
nodeName: z.ZodString;
|
|
75
|
+
nodePath: z.ZodString;
|
|
76
|
+
nodeType: z.ZodString;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
nodeId: string;
|
|
79
|
+
nodeName: string;
|
|
80
|
+
nodePath: string;
|
|
81
|
+
nodeType: string;
|
|
82
|
+
}, {
|
|
83
|
+
nodeId: string;
|
|
84
|
+
nodeName: string;
|
|
85
|
+
nodePath: string;
|
|
86
|
+
nodeType: string;
|
|
87
|
+
}>;
|
|
88
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
89
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
90
|
+
expected: z.ZodOptional<z.ZodUnknown>;
|
|
91
|
+
actual: z.ZodOptional<z.ZodUnknown>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
message: string;
|
|
94
|
+
severity: "error" | "warning" | "info";
|
|
95
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
96
|
+
location: {
|
|
97
|
+
nodeId: string;
|
|
98
|
+
nodeName: string;
|
|
99
|
+
nodePath: string;
|
|
100
|
+
nodeType: string;
|
|
101
|
+
};
|
|
102
|
+
expected?: unknown;
|
|
103
|
+
details?: Record<string, unknown> | undefined;
|
|
104
|
+
suggestion?: string | undefined;
|
|
105
|
+
actual?: unknown;
|
|
106
|
+
}, {
|
|
107
|
+
message: string;
|
|
108
|
+
severity: "error" | "warning" | "info";
|
|
109
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
110
|
+
location: {
|
|
111
|
+
nodeId: string;
|
|
112
|
+
nodeName: string;
|
|
113
|
+
nodePath: string;
|
|
114
|
+
nodeType: string;
|
|
115
|
+
};
|
|
116
|
+
expected?: unknown;
|
|
117
|
+
details?: Record<string, unknown> | undefined;
|
|
118
|
+
suggestion?: string | undefined;
|
|
119
|
+
actual?: unknown;
|
|
120
|
+
}>;
|
|
121
|
+
export type AuditIssue = z.infer<typeof AuditIssueSchema>;
|
|
122
|
+
/**
|
|
123
|
+
* Summary statistics for an audit
|
|
124
|
+
*/
|
|
125
|
+
export declare const AuditSummarySchema: z.ZodObject<{
|
|
126
|
+
totalNodes: z.ZodNumber;
|
|
127
|
+
nodesAudited: z.ZodNumber;
|
|
128
|
+
issueCount: z.ZodObject<{
|
|
129
|
+
error: z.ZodNumber;
|
|
130
|
+
warning: z.ZodNumber;
|
|
131
|
+
info: z.ZodNumber;
|
|
132
|
+
total: z.ZodNumber;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
error: number;
|
|
135
|
+
total: number;
|
|
136
|
+
warning: number;
|
|
137
|
+
info: number;
|
|
138
|
+
}, {
|
|
139
|
+
error: number;
|
|
140
|
+
total: number;
|
|
141
|
+
warning: number;
|
|
142
|
+
info: number;
|
|
143
|
+
}>;
|
|
144
|
+
passRate: z.ZodNumber;
|
|
145
|
+
rulesRun: z.ZodArray<z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>, "many">;
|
|
146
|
+
duration: z.ZodNumber;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
duration: number;
|
|
149
|
+
totalNodes: number;
|
|
150
|
+
nodesAudited: number;
|
|
151
|
+
issueCount: {
|
|
152
|
+
error: number;
|
|
153
|
+
total: number;
|
|
154
|
+
warning: number;
|
|
155
|
+
info: number;
|
|
156
|
+
};
|
|
157
|
+
passRate: number;
|
|
158
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
159
|
+
}, {
|
|
160
|
+
duration: number;
|
|
161
|
+
totalNodes: number;
|
|
162
|
+
nodesAudited: number;
|
|
163
|
+
issueCount: {
|
|
164
|
+
error: number;
|
|
165
|
+
total: number;
|
|
166
|
+
warning: number;
|
|
167
|
+
info: number;
|
|
168
|
+
};
|
|
169
|
+
passRate: number;
|
|
170
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
171
|
+
}>;
|
|
172
|
+
export type AuditSummary = z.infer<typeof AuditSummarySchema>;
|
|
173
|
+
/**
|
|
174
|
+
* Full audit result
|
|
175
|
+
*/
|
|
176
|
+
export declare const AuditResultSchema: z.ZodObject<{
|
|
177
|
+
fileKey: z.ZodString;
|
|
178
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
179
|
+
targetNodeId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
targetAlias: z.ZodOptional<z.ZodString>;
|
|
181
|
+
timestamp: z.ZodString;
|
|
182
|
+
summary: z.ZodObject<{
|
|
183
|
+
totalNodes: z.ZodNumber;
|
|
184
|
+
nodesAudited: z.ZodNumber;
|
|
185
|
+
issueCount: z.ZodObject<{
|
|
186
|
+
error: z.ZodNumber;
|
|
187
|
+
warning: z.ZodNumber;
|
|
188
|
+
info: z.ZodNumber;
|
|
189
|
+
total: z.ZodNumber;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
error: number;
|
|
192
|
+
total: number;
|
|
193
|
+
warning: number;
|
|
194
|
+
info: number;
|
|
195
|
+
}, {
|
|
196
|
+
error: number;
|
|
197
|
+
total: number;
|
|
198
|
+
warning: number;
|
|
199
|
+
info: number;
|
|
200
|
+
}>;
|
|
201
|
+
passRate: z.ZodNumber;
|
|
202
|
+
rulesRun: z.ZodArray<z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>, "many">;
|
|
203
|
+
duration: z.ZodNumber;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
duration: number;
|
|
206
|
+
totalNodes: number;
|
|
207
|
+
nodesAudited: number;
|
|
208
|
+
issueCount: {
|
|
209
|
+
error: number;
|
|
210
|
+
total: number;
|
|
211
|
+
warning: number;
|
|
212
|
+
info: number;
|
|
213
|
+
};
|
|
214
|
+
passRate: number;
|
|
215
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
216
|
+
}, {
|
|
217
|
+
duration: number;
|
|
218
|
+
totalNodes: number;
|
|
219
|
+
nodesAudited: number;
|
|
220
|
+
issueCount: {
|
|
221
|
+
error: number;
|
|
222
|
+
total: number;
|
|
223
|
+
warning: number;
|
|
224
|
+
info: number;
|
|
225
|
+
};
|
|
226
|
+
passRate: number;
|
|
227
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
228
|
+
}>;
|
|
229
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
230
|
+
ruleId: z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>;
|
|
231
|
+
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
232
|
+
message: z.ZodString;
|
|
233
|
+
location: z.ZodObject<{
|
|
234
|
+
nodeId: z.ZodString;
|
|
235
|
+
nodeName: z.ZodString;
|
|
236
|
+
nodePath: z.ZodString;
|
|
237
|
+
nodeType: z.ZodString;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
nodeId: string;
|
|
240
|
+
nodeName: string;
|
|
241
|
+
nodePath: string;
|
|
242
|
+
nodeType: string;
|
|
243
|
+
}, {
|
|
244
|
+
nodeId: string;
|
|
245
|
+
nodeName: string;
|
|
246
|
+
nodePath: string;
|
|
247
|
+
nodeType: string;
|
|
248
|
+
}>;
|
|
249
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
250
|
+
suggestion: z.ZodOptional<z.ZodString>;
|
|
251
|
+
expected: z.ZodOptional<z.ZodUnknown>;
|
|
252
|
+
actual: z.ZodOptional<z.ZodUnknown>;
|
|
253
|
+
}, "strip", z.ZodTypeAny, {
|
|
254
|
+
message: string;
|
|
255
|
+
severity: "error" | "warning" | "info";
|
|
256
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
257
|
+
location: {
|
|
258
|
+
nodeId: string;
|
|
259
|
+
nodeName: string;
|
|
260
|
+
nodePath: string;
|
|
261
|
+
nodeType: string;
|
|
262
|
+
};
|
|
263
|
+
expected?: unknown;
|
|
264
|
+
details?: Record<string, unknown> | undefined;
|
|
265
|
+
suggestion?: string | undefined;
|
|
266
|
+
actual?: unknown;
|
|
267
|
+
}, {
|
|
268
|
+
message: string;
|
|
269
|
+
severity: "error" | "warning" | "info";
|
|
270
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
271
|
+
location: {
|
|
272
|
+
nodeId: string;
|
|
273
|
+
nodeName: string;
|
|
274
|
+
nodePath: string;
|
|
275
|
+
nodeType: string;
|
|
276
|
+
};
|
|
277
|
+
expected?: unknown;
|
|
278
|
+
details?: Record<string, unknown> | undefined;
|
|
279
|
+
suggestion?: string | undefined;
|
|
280
|
+
actual?: unknown;
|
|
281
|
+
}>, "many">;
|
|
282
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
figmaVersion: z.ZodOptional<z.ZodString>;
|
|
284
|
+
axCliVersion: z.ZodOptional<z.ZodString>;
|
|
285
|
+
configPath: z.ZodOptional<z.ZodString>;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
figmaVersion?: string | undefined;
|
|
288
|
+
axCliVersion?: string | undefined;
|
|
289
|
+
configPath?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
figmaVersion?: string | undefined;
|
|
292
|
+
axCliVersion?: string | undefined;
|
|
293
|
+
configPath?: string | undefined;
|
|
294
|
+
}>>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
issues: {
|
|
297
|
+
message: string;
|
|
298
|
+
severity: "error" | "warning" | "info";
|
|
299
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
300
|
+
location: {
|
|
301
|
+
nodeId: string;
|
|
302
|
+
nodeName: string;
|
|
303
|
+
nodePath: string;
|
|
304
|
+
nodeType: string;
|
|
305
|
+
};
|
|
306
|
+
expected?: unknown;
|
|
307
|
+
details?: Record<string, unknown> | undefined;
|
|
308
|
+
suggestion?: string | undefined;
|
|
309
|
+
actual?: unknown;
|
|
310
|
+
}[];
|
|
311
|
+
summary: {
|
|
312
|
+
duration: number;
|
|
313
|
+
totalNodes: number;
|
|
314
|
+
nodesAudited: number;
|
|
315
|
+
issueCount: {
|
|
316
|
+
error: number;
|
|
317
|
+
total: number;
|
|
318
|
+
warning: number;
|
|
319
|
+
info: number;
|
|
320
|
+
};
|
|
321
|
+
passRate: number;
|
|
322
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
323
|
+
};
|
|
324
|
+
timestamp: string;
|
|
325
|
+
fileKey: string;
|
|
326
|
+
fileName?: string | undefined;
|
|
327
|
+
targetNodeId?: string | undefined;
|
|
328
|
+
targetAlias?: string | undefined;
|
|
329
|
+
metadata?: {
|
|
330
|
+
figmaVersion?: string | undefined;
|
|
331
|
+
axCliVersion?: string | undefined;
|
|
332
|
+
configPath?: string | undefined;
|
|
333
|
+
} | undefined;
|
|
334
|
+
}, {
|
|
335
|
+
issues: {
|
|
336
|
+
message: string;
|
|
337
|
+
severity: "error" | "warning" | "info";
|
|
338
|
+
ruleId: "spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow";
|
|
339
|
+
location: {
|
|
340
|
+
nodeId: string;
|
|
341
|
+
nodeName: string;
|
|
342
|
+
nodePath: string;
|
|
343
|
+
nodeType: string;
|
|
344
|
+
};
|
|
345
|
+
expected?: unknown;
|
|
346
|
+
details?: Record<string, unknown> | undefined;
|
|
347
|
+
suggestion?: string | undefined;
|
|
348
|
+
actual?: unknown;
|
|
349
|
+
}[];
|
|
350
|
+
summary: {
|
|
351
|
+
duration: number;
|
|
352
|
+
totalNodes: number;
|
|
353
|
+
nodesAudited: number;
|
|
354
|
+
issueCount: {
|
|
355
|
+
error: number;
|
|
356
|
+
total: number;
|
|
357
|
+
warning: number;
|
|
358
|
+
info: number;
|
|
359
|
+
};
|
|
360
|
+
passRate: number;
|
|
361
|
+
rulesRun: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[];
|
|
362
|
+
};
|
|
363
|
+
timestamp: string;
|
|
364
|
+
fileKey: string;
|
|
365
|
+
fileName?: string | undefined;
|
|
366
|
+
targetNodeId?: string | undefined;
|
|
367
|
+
targetAlias?: string | undefined;
|
|
368
|
+
metadata?: {
|
|
369
|
+
figmaVersion?: string | undefined;
|
|
370
|
+
axCliVersion?: string | undefined;
|
|
371
|
+
configPath?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
}>;
|
|
374
|
+
export type AuditResult = z.infer<typeof AuditResultSchema>;
|
|
375
|
+
/**
|
|
376
|
+
* Rule-specific configuration overrides
|
|
377
|
+
*/
|
|
378
|
+
export declare const RuleConfigOverrideSchema: z.ZodObject<{
|
|
379
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
+
severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
|
|
381
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
382
|
+
}, "strip", z.ZodTypeAny, {
|
|
383
|
+
options?: Record<string, unknown> | undefined;
|
|
384
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
385
|
+
enabled?: boolean | undefined;
|
|
386
|
+
}, {
|
|
387
|
+
options?: Record<string, unknown> | undefined;
|
|
388
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
389
|
+
enabled?: boolean | undefined;
|
|
390
|
+
}>;
|
|
391
|
+
export type RuleConfigOverride = z.infer<typeof RuleConfigOverrideSchema>;
|
|
392
|
+
/**
|
|
393
|
+
* Audit configuration options
|
|
394
|
+
*/
|
|
395
|
+
export declare const AuditConfigSchema: z.ZodObject<{
|
|
396
|
+
/** Which rules to run (default: all) */
|
|
397
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>, "many">>;
|
|
398
|
+
/** Exclude specific rules */
|
|
399
|
+
excludeRules: z.ZodOptional<z.ZodArray<z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>, "many">>;
|
|
400
|
+
/** Per-rule configuration */
|
|
401
|
+
ruleConfig: z.ZodOptional<z.ZodRecord<z.ZodEnum<["spacing-consistency", "color-contrast", "naming-convention", "token-usage", "missing-autolayout", "font-consistency", "layer-naming", "component-usage", "image-resolution", "text-overflow"]>, z.ZodObject<{
|
|
402
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
403
|
+
severity: z.ZodOptional<z.ZodEnum<["error", "warning", "info"]>>;
|
|
404
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
405
|
+
}, "strip", z.ZodTypeAny, {
|
|
406
|
+
options?: Record<string, unknown> | undefined;
|
|
407
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
408
|
+
enabled?: boolean | undefined;
|
|
409
|
+
}, {
|
|
410
|
+
options?: Record<string, unknown> | undefined;
|
|
411
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
412
|
+
enabled?: boolean | undefined;
|
|
413
|
+
}>>>;
|
|
414
|
+
/** Maximum depth to traverse */
|
|
415
|
+
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
416
|
+
/** Fail on error-level issues */
|
|
417
|
+
failOnError: z.ZodDefault<z.ZodBoolean>;
|
|
418
|
+
/** Fail on warning-level issues */
|
|
419
|
+
failOnWarning: z.ZodDefault<z.ZodBoolean>;
|
|
420
|
+
/** Include hidden nodes */
|
|
421
|
+
includeHidden: z.ZodDefault<z.ZodBoolean>;
|
|
422
|
+
/** Reference tokens file for token-usage rule */
|
|
423
|
+
tokensPath: z.ZodOptional<z.ZodString>;
|
|
424
|
+
}, "strip", z.ZodTypeAny, {
|
|
425
|
+
failOnError: boolean;
|
|
426
|
+
failOnWarning: boolean;
|
|
427
|
+
includeHidden: boolean;
|
|
428
|
+
rules?: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[] | undefined;
|
|
429
|
+
excludeRules?: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[] | undefined;
|
|
430
|
+
ruleConfig?: Partial<Record<"spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow", {
|
|
431
|
+
options?: Record<string, unknown> | undefined;
|
|
432
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
433
|
+
enabled?: boolean | undefined;
|
|
434
|
+
}>> | undefined;
|
|
435
|
+
maxDepth?: number | undefined;
|
|
436
|
+
tokensPath?: string | undefined;
|
|
437
|
+
}, {
|
|
438
|
+
rules?: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[] | undefined;
|
|
439
|
+
excludeRules?: ("spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow")[] | undefined;
|
|
440
|
+
ruleConfig?: Partial<Record<"spacing-consistency" | "color-contrast" | "naming-convention" | "token-usage" | "missing-autolayout" | "font-consistency" | "layer-naming" | "component-usage" | "image-resolution" | "text-overflow", {
|
|
441
|
+
options?: Record<string, unknown> | undefined;
|
|
442
|
+
severity?: "error" | "warning" | "info" | undefined;
|
|
443
|
+
enabled?: boolean | undefined;
|
|
444
|
+
}>> | undefined;
|
|
445
|
+
maxDepth?: number | undefined;
|
|
446
|
+
failOnError?: boolean | undefined;
|
|
447
|
+
failOnWarning?: boolean | undefined;
|
|
448
|
+
includeHidden?: boolean | undefined;
|
|
449
|
+
tokensPath?: string | undefined;
|
|
450
|
+
}>;
|
|
451
|
+
export type AuditConfig = z.infer<typeof AuditConfigSchema>;
|
|
452
|
+
/**
|
|
453
|
+
* Color contrast rule options
|
|
454
|
+
*/
|
|
455
|
+
export declare const ColorContrastOptionsSchema: z.ZodObject<{
|
|
456
|
+
/** WCAG level to check */
|
|
457
|
+
level: z.ZodDefault<z.ZodEnum<["AA", "AAA"]>>;
|
|
458
|
+
/** Minimum contrast ratio for normal text */
|
|
459
|
+
normalTextRatio: z.ZodDefault<z.ZodNumber>;
|
|
460
|
+
/** Minimum contrast ratio for large text */
|
|
461
|
+
largeTextRatio: z.ZodDefault<z.ZodNumber>;
|
|
462
|
+
/** Font size threshold for "large text" (px) */
|
|
463
|
+
largeTextSize: z.ZodDefault<z.ZodNumber>;
|
|
464
|
+
}, "strip", z.ZodTypeAny, {
|
|
465
|
+
level: "AA" | "AAA";
|
|
466
|
+
normalTextRatio: number;
|
|
467
|
+
largeTextRatio: number;
|
|
468
|
+
largeTextSize: number;
|
|
469
|
+
}, {
|
|
470
|
+
level?: "AA" | "AAA" | undefined;
|
|
471
|
+
normalTextRatio?: number | undefined;
|
|
472
|
+
largeTextRatio?: number | undefined;
|
|
473
|
+
largeTextSize?: number | undefined;
|
|
474
|
+
}>;
|
|
475
|
+
export type ColorContrastOptions = z.infer<typeof ColorContrastOptionsSchema>;
|
|
476
|
+
/**
|
|
477
|
+
* Spacing consistency rule options
|
|
478
|
+
*/
|
|
479
|
+
export declare const SpacingConsistencyOptionsSchema: z.ZodObject<{
|
|
480
|
+
/** Allowed spacing values (px) */
|
|
481
|
+
allowedValues: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
482
|
+
/** Base spacing unit */
|
|
483
|
+
baseUnit: z.ZodDefault<z.ZodNumber>;
|
|
484
|
+
/** Allow multiples of base unit */
|
|
485
|
+
allowMultiples: z.ZodDefault<z.ZodBoolean>;
|
|
486
|
+
}, "strip", z.ZodTypeAny, {
|
|
487
|
+
baseUnit: number;
|
|
488
|
+
allowMultiples: boolean;
|
|
489
|
+
allowedValues?: number[] | undefined;
|
|
490
|
+
}, {
|
|
491
|
+
allowedValues?: number[] | undefined;
|
|
492
|
+
baseUnit?: number | undefined;
|
|
493
|
+
allowMultiples?: boolean | undefined;
|
|
494
|
+
}>;
|
|
495
|
+
export type SpacingConsistencyOptions = z.infer<typeof SpacingConsistencyOptionsSchema>;
|
|
496
|
+
/**
|
|
497
|
+
* Naming convention rule options
|
|
498
|
+
*/
|
|
499
|
+
export declare const NamingConventionOptionsSchema: z.ZodObject<{
|
|
500
|
+
/** Pattern for frame names */
|
|
501
|
+
framePattern: z.ZodOptional<z.ZodString>;
|
|
502
|
+
/** Pattern for component names */
|
|
503
|
+
componentPattern: z.ZodOptional<z.ZodString>;
|
|
504
|
+
/** Pattern for layer names */
|
|
505
|
+
layerPattern: z.ZodOptional<z.ZodString>;
|
|
506
|
+
/** Disallowed names */
|
|
507
|
+
disallowed: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
508
|
+
}, "strip", z.ZodTypeAny, {
|
|
509
|
+
disallowed: string[];
|
|
510
|
+
framePattern?: string | undefined;
|
|
511
|
+
componentPattern?: string | undefined;
|
|
512
|
+
layerPattern?: string | undefined;
|
|
513
|
+
}, {
|
|
514
|
+
framePattern?: string | undefined;
|
|
515
|
+
componentPattern?: string | undefined;
|
|
516
|
+
layerPattern?: string | undefined;
|
|
517
|
+
disallowed?: string[] | undefined;
|
|
518
|
+
}>;
|
|
519
|
+
export type NamingConventionOptions = z.infer<typeof NamingConventionOptionsSchema>;
|
|
520
|
+
/**
|
|
521
|
+
* Exit code mapping for CI/CD
|
|
522
|
+
*/
|
|
523
|
+
export declare const AuditExitCodeSchema: z.ZodObject<{
|
|
524
|
+
code: z.ZodNumber;
|
|
525
|
+
reason: z.ZodEnum<["success", "warnings", "errors", "fatal"]>;
|
|
526
|
+
summary: z.ZodString;
|
|
527
|
+
}, "strip", z.ZodTypeAny, {
|
|
528
|
+
code: number;
|
|
529
|
+
summary: string;
|
|
530
|
+
reason: "success" | "warnings" | "errors" | "fatal";
|
|
531
|
+
}, {
|
|
532
|
+
code: number;
|
|
533
|
+
summary: string;
|
|
534
|
+
reason: "success" | "warnings" | "errors" | "fatal";
|
|
535
|
+
}>;
|
|
536
|
+
export type AuditExitCode = z.infer<typeof AuditExitCodeSchema>;
|
|
537
|
+
/**
|
|
538
|
+
* Compute exit code from audit result
|
|
539
|
+
*/
|
|
540
|
+
export declare function computeAuditExitCode(result: AuditResult, config: Pick<AuditConfig, 'failOnError' | 'failOnWarning'>): AuditExitCode;
|
|
541
|
+
/**
|
|
542
|
+
* Default audit rules configuration
|
|
543
|
+
*/
|
|
544
|
+
export declare const DEFAULT_AUDIT_RULES: AuditRule[];
|
|
545
|
+
//# sourceMappingURL=audit-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-types.d.ts","sourceRoot":"","sources":["../../../src/public/design/audit-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,mBAAmB,yCAAuC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,iBAAiB,4MAW5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;EAO1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAMxD;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAKnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B,wCAAwC;;IAExC,6BAA6B;;IAE7B,6BAA6B;;;;;;;;;;;;;;IAE7B,gCAAgC;;IAEhC,iCAAiC;;IAEjC,mCAAmC;;IAEnC,2BAA2B;;IAE3B,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjD,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACrC,0BAA0B;;IAE1B,6CAA6C;;IAE7C,4CAA4C;;IAE5C,gDAAgD;;;;;;;;;;;;EAEhD,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,+BAA+B;IAC1C,kCAAkC;;IAElC,wBAAwB;;IAExB,mCAAmC;;;;;;;;;;EAEnC,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,6BAA6B;IACxC,8BAA8B;;IAE9B,kCAAkC;;IAElC,8BAA8B;;IAE9B,uBAAuB;;;;;;;;;;;;EAEvB,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAMpF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,GAAG,eAAe,CAAC,GACzD,aAAa,CAgCf;AAMD;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,EAiF1C,CAAC"}
|