mockpit 3.0.0 → 3.1.0
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 +11 -23
- package/bin/initDesign.js +11 -16
- package/bin/mockpit.js +242 -52
- package/bin/poster.js +64 -7
- package/dist/mcp/server.js +48 -6
- package/dist/server/apiViews.d.ts +562 -557
- package/dist/server/apiViews.js +18 -9
- package/dist/server/app.js +723 -206
- package/dist/server/cdnInline.js +6 -4
- package/dist/server/codeWorker.js +2 -2
- package/dist/server/contrast.d.ts +4 -0
- package/dist/server/contrast.js +157 -0
- package/dist/server/decisionList.d.ts +4 -1
- package/dist/server/decisionList.js +43 -5
- package/dist/server/designGuide.d.ts +13 -6
- package/dist/server/designGuide.js +206 -41
- package/dist/server/events.d.ts +6 -0
- package/dist/server/feedbackBatch.d.ts +4 -0
- package/dist/server/feedbackBatch.js +19 -1
- package/dist/server/guidance.d.ts +1 -1
- package/dist/server/guidance.js +2 -2
- package/dist/server/kits.d.ts +2 -2
- package/dist/server/kits.js +54 -1
- package/dist/server/mcpHttp.d.ts +2 -0
- package/dist/server/mcpHttp.js +13 -1
- package/dist/server/mcpSpec.d.ts +27 -27
- package/dist/server/mcpSpec.js +78 -10
- package/dist/server/run.js +22 -1
- package/dist/server/runApi.d.ts +2 -2
- package/dist/server/runApi.js +9 -2
- package/dist/server/sqlStore.d.ts +68 -39
- package/dist/server/sqlStore.js +163 -26
- package/dist/server/surfacePage.d.ts +4 -2
- package/dist/server/surfacePage.js +80 -32
- package/dist/server/system.d.ts +234 -0
- package/dist/server/system.js +1508 -0
- package/dist/server/systemChecks.d.ts +15 -0
- package/dist/server/systemChecks.js +224 -0
- package/dist/server/systemSpecimen.d.ts +2 -0
- package/dist/server/systemSpecimen.js +49 -0
- package/dist/server/themes.d.ts +9 -7
- package/dist/server/themes.js +43 -90
- package/dist/server/types.d.ts +43 -24
- package/dist/server/types.js +3 -1
- package/guide/AGENT_SETUP.md +3 -1
- package/guide/packs/foundations.md +35 -0
- package/guide/topics/asks.md +2 -1
- package/guide/topics/feedback.md +5 -3
- package/guide/topics/html.md +2 -2
- package/guide/topics/http.md +3 -1
- package/guide/topics/system.md +157 -0
- package/package.json +12 -12
- package/skills/mockpit/SKILL.md +7 -4
- package/viewer/dist/index.html +9 -8
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { CHROME_TOKENS } from "./themes.ts";
|
|
2
|
+
import type { AnswerStanding, Ask, AskAnswer, DesignFiles, IconSetRef, Knobs, KnobValue, ProjectKit } from "./types.ts";
|
|
3
|
+
export declare const CURRENT_CONTRACT = 2;
|
|
4
|
+
export declare const SYSTEM_LIMITS: {
|
|
5
|
+
readonly sheet: 128000;
|
|
6
|
+
readonly tokens: 400;
|
|
7
|
+
readonly palettes: 40;
|
|
8
|
+
readonly roles: 120;
|
|
9
|
+
readonly pairs: 200;
|
|
10
|
+
readonly revisions: 30;
|
|
11
|
+
readonly classes: 200;
|
|
12
|
+
readonly fonts: 12;
|
|
13
|
+
readonly scales: 12;
|
|
14
|
+
readonly steps: 16;
|
|
15
|
+
readonly note: 300;
|
|
16
|
+
readonly summary: 400;
|
|
17
|
+
};
|
|
18
|
+
export type ChromeRole = (typeof CHROME_TOKENS)[number];
|
|
19
|
+
export interface SystemClass {
|
|
20
|
+
name: string;
|
|
21
|
+
note: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SystemFont {
|
|
24
|
+
family: string;
|
|
25
|
+
href?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const TOKEN_TYPES: readonly ["color", "dimension", "font", "weight", "number", "shadow", "duration", "easing", "text"];
|
|
28
|
+
export type TokenType = (typeof TOKEN_TYPES)[number];
|
|
29
|
+
export declare const TEXT_FIELDS: readonly ["font", "size", "line", "weight", "tracking"];
|
|
30
|
+
export interface Token {
|
|
31
|
+
name: string;
|
|
32
|
+
type: TokenType;
|
|
33
|
+
value: string | Record<string, string>;
|
|
34
|
+
note?: string;
|
|
35
|
+
scale?: string;
|
|
36
|
+
owner?: "repo";
|
|
37
|
+
}
|
|
38
|
+
export interface Scale {
|
|
39
|
+
id: string;
|
|
40
|
+
family: "type" | "space";
|
|
41
|
+
prefix: string;
|
|
42
|
+
steps: string[];
|
|
43
|
+
zero: string;
|
|
44
|
+
base: number;
|
|
45
|
+
ratio: number;
|
|
46
|
+
fluid?: {
|
|
47
|
+
minWidth: number;
|
|
48
|
+
maxWidth: number;
|
|
49
|
+
maxBase: number;
|
|
50
|
+
maxRatio: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface Role {
|
|
54
|
+
name: string;
|
|
55
|
+
note: string;
|
|
56
|
+
owner?: "repo";
|
|
57
|
+
}
|
|
58
|
+
export type PaletteStatus = "default" | "kept" | "open" | "hidden";
|
|
59
|
+
export declare const PALETTE_STATUSES: readonly PaletteStatus[];
|
|
60
|
+
export interface Palette {
|
|
61
|
+
id: string;
|
|
62
|
+
label: string;
|
|
63
|
+
note: string;
|
|
64
|
+
light: Record<string, string>;
|
|
65
|
+
dark: Record<string, string>;
|
|
66
|
+
scheme?: {
|
|
67
|
+
light: "light" | "dark";
|
|
68
|
+
dark: "light" | "dark";
|
|
69
|
+
};
|
|
70
|
+
status: PaletteStatus;
|
|
71
|
+
owner?: "repo";
|
|
72
|
+
}
|
|
73
|
+
export interface SystemAddition {
|
|
74
|
+
knob: string;
|
|
75
|
+
value: string;
|
|
76
|
+
rev: number;
|
|
77
|
+
style: string;
|
|
78
|
+
}
|
|
79
|
+
export interface RepoRead {
|
|
80
|
+
detected: {
|
|
81
|
+
tailwind: boolean;
|
|
82
|
+
shadcn: boolean;
|
|
83
|
+
cssVars: number;
|
|
84
|
+
fonts: string[];
|
|
85
|
+
} | null;
|
|
86
|
+
cssVars: string;
|
|
87
|
+
tailwindCss: string;
|
|
88
|
+
strippedImports: string[];
|
|
89
|
+
designFiles: DesignFiles | null;
|
|
90
|
+
untyped?: string[];
|
|
91
|
+
}
|
|
92
|
+
export interface System {
|
|
93
|
+
project: string;
|
|
94
|
+
rev: number;
|
|
95
|
+
updatedAt: string;
|
|
96
|
+
sheet: {
|
|
97
|
+
css: string;
|
|
98
|
+
classes: SystemClass[];
|
|
99
|
+
} | null;
|
|
100
|
+
fonts: SystemFont[];
|
|
101
|
+
tokens: Token[];
|
|
102
|
+
scales: Scale[];
|
|
103
|
+
color: {
|
|
104
|
+
roles: Role[];
|
|
105
|
+
palettes: Palette[];
|
|
106
|
+
pairs: [string, string, number][];
|
|
107
|
+
as?: Partial<Record<ChromeRole, string>>;
|
|
108
|
+
};
|
|
109
|
+
knobs: Knobs;
|
|
110
|
+
settled: Record<string, KnobValue>;
|
|
111
|
+
additions: SystemAddition[];
|
|
112
|
+
kit: string;
|
|
113
|
+
projectKits: ProjectKit[];
|
|
114
|
+
iconSets: IconSetRef[];
|
|
115
|
+
repo: RepoRead | null;
|
|
116
|
+
}
|
|
117
|
+
export interface SystemRevisionHead {
|
|
118
|
+
rev: number;
|
|
119
|
+
at: string;
|
|
120
|
+
sessionId: string | null;
|
|
121
|
+
summary: string;
|
|
122
|
+
}
|
|
123
|
+
export declare const emptySystem: (project: string) => System;
|
|
124
|
+
export declare function normalizeSystem(project: string, raw: unknown): System;
|
|
125
|
+
export declare function checkName(name: unknown, what: string): string | null;
|
|
126
|
+
export declare const isSafeValue: (v: unknown) => v is string;
|
|
127
|
+
export declare function isColorValue(v: string): boolean;
|
|
128
|
+
export declare function scaleSteps(scale: Scale): {
|
|
129
|
+
step: string;
|
|
130
|
+
min: number;
|
|
131
|
+
max: number;
|
|
132
|
+
}[];
|
|
133
|
+
export declare function stepValue(scale: Scale, min: number, max: number): string;
|
|
134
|
+
export declare function expandScale(scale: Scale): Token[];
|
|
135
|
+
export declare function deriveRepoTokens(system: System): {
|
|
136
|
+
system: System;
|
|
137
|
+
clashes: string[];
|
|
138
|
+
};
|
|
139
|
+
export declare function systemFromDesignSettings(project: string, raw: unknown): System;
|
|
140
|
+
export interface SystemWrite {
|
|
141
|
+
sheet?: unknown;
|
|
142
|
+
classes?: unknown;
|
|
143
|
+
fonts?: unknown;
|
|
144
|
+
tokens?: unknown;
|
|
145
|
+
scales?: unknown;
|
|
146
|
+
roles?: unknown;
|
|
147
|
+
palettes?: unknown;
|
|
148
|
+
pairs?: unknown;
|
|
149
|
+
as?: unknown;
|
|
150
|
+
knobs?: unknown;
|
|
151
|
+
remove?: unknown;
|
|
152
|
+
repo?: unknown;
|
|
153
|
+
kit?: unknown;
|
|
154
|
+
projectKits?: unknown;
|
|
155
|
+
removeKits?: unknown;
|
|
156
|
+
iconSets?: unknown;
|
|
157
|
+
}
|
|
158
|
+
export declare const SYSTEM_WRITE_KEYS: readonly ["sheet", "classes", "fonts", "tokens", "scales", "roles", "palettes", "pairs", "as", "knobs", "remove", "repo", "kit", "projectKits", "removeKits", "iconSets"];
|
|
159
|
+
export declare const oneLine: (v: string) => string;
|
|
160
|
+
export declare function checkSheet(css: string): string | null;
|
|
161
|
+
export interface WriteContext {
|
|
162
|
+
checkUrl(url: string): string | null;
|
|
163
|
+
checkKnobs(raw: unknown): {
|
|
164
|
+
ok: true;
|
|
165
|
+
value: Knobs;
|
|
166
|
+
} | {
|
|
167
|
+
ok: false;
|
|
168
|
+
error: string;
|
|
169
|
+
};
|
|
170
|
+
checkKit(raw: unknown): ProjectKit | string;
|
|
171
|
+
kitIds: readonly string[];
|
|
172
|
+
designKnobPaths: Map<string, string>;
|
|
173
|
+
}
|
|
174
|
+
export declare function applySystemWrite(current: System, write: SystemWrite, ctx: WriteContext): {
|
|
175
|
+
system: System;
|
|
176
|
+
clashes: string[];
|
|
177
|
+
} | {
|
|
178
|
+
error: string;
|
|
179
|
+
};
|
|
180
|
+
export declare function restoreSystem(current: System, old: System, opts?: {
|
|
181
|
+
keepDecided?: boolean;
|
|
182
|
+
}): {
|
|
183
|
+
system: System;
|
|
184
|
+
kept: string[];
|
|
185
|
+
};
|
|
186
|
+
export declare function systemDiffers(before: System, after: System): boolean;
|
|
187
|
+
export declare function describeChange(before: System, after: System): string[];
|
|
188
|
+
export declare function defaultPalette(system: System): Palette | null;
|
|
189
|
+
export declare function activePalette(system: System, id: string | undefined): Palette | null;
|
|
190
|
+
export interface SystemCss {
|
|
191
|
+
sheet: string;
|
|
192
|
+
tokens: string;
|
|
193
|
+
fonts: string[];
|
|
194
|
+
attrs: {
|
|
195
|
+
scheme?: "light" | "dark";
|
|
196
|
+
palette?: string;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export declare function systemCss(system: System, opts: {
|
|
200
|
+
mode?: "light" | "dark";
|
|
201
|
+
palette?: string;
|
|
202
|
+
contract?: number;
|
|
203
|
+
}): SystemCss;
|
|
204
|
+
export declare function systemAfterAnswers(system: System, asks: Ask[], answers: Record<string, AskAnswer>, standings: Record<string, AnswerStanding>): {
|
|
205
|
+
system: System;
|
|
206
|
+
changes: string[];
|
|
207
|
+
} | null;
|
|
208
|
+
export declare function projectKnobValues(system: System | null): Record<string, KnobValue>;
|
|
209
|
+
export interface SystemExport {
|
|
210
|
+
project: string;
|
|
211
|
+
rev: number;
|
|
212
|
+
sheet: string;
|
|
213
|
+
css: string;
|
|
214
|
+
tokens: {
|
|
215
|
+
constants: Record<string, string | Record<string, string>>;
|
|
216
|
+
palettes: Record<string, {
|
|
217
|
+
label: string;
|
|
218
|
+
status: PaletteStatus;
|
|
219
|
+
light: Record<string, string>;
|
|
220
|
+
dark: Record<string, string>;
|
|
221
|
+
}>;
|
|
222
|
+
};
|
|
223
|
+
fonts: SystemFont[];
|
|
224
|
+
knobs: Record<string, KnobValue>;
|
|
225
|
+
additions: {
|
|
226
|
+
knob: string;
|
|
227
|
+
value: string;
|
|
228
|
+
style: string;
|
|
229
|
+
}[];
|
|
230
|
+
}
|
|
231
|
+
export declare function systemExport(system: System): SystemExport;
|
|
232
|
+
export declare function systemLine(system: System, failing: number): string;
|
|
233
|
+
export declare function declaredNames(system: System): Set<string>;
|
|
234
|
+
export declare const hasSystemContent: (s: System | null) => boolean;
|