@penpair/core 0.2.0 → 0.3.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.
Files changed (101) hide show
  1. package/dist/adapters.js +58 -11
  2. package/dist/approvals.js +143 -29
  3. package/dist/atomic-output.js +9 -4
  4. package/dist/audit-rules.js +345 -79
  5. package/dist/backup-note.js +29 -8
  6. package/dist/baseline-coverage.js +169 -35
  7. package/dist/baselines-config.js +119 -29
  8. package/dist/baselines.js +280 -57
  9. package/dist/cli-arguments.js +18 -6
  10. package/dist/cli-main.js +1621 -392
  11. package/dist/client.d.ts +5 -2
  12. package/dist/client.js +127 -28
  13. package/dist/command-result.js +341 -52
  14. package/dist/coordination.js +91 -29
  15. package/dist/credentials.js +57 -13
  16. package/dist/deep-check.js +56 -12
  17. package/dist/design-spec.js +189 -49
  18. package/dist/endpoint.js +102 -34
  19. package/dist/export.js +86 -18
  20. package/dist/file-archive.js +33 -7
  21. package/dist/file-guard.js +29 -11
  22. package/dist/formats.js +215 -14
  23. package/dist/index.d.ts +8 -7
  24. package/dist/index.js +8 -7
  25. package/dist/inspection.d.ts +1 -1
  26. package/dist/inspection.js +378 -65
  27. package/dist/instance/config-schema.js +400 -41
  28. package/dist/instance/config.js +101 -30
  29. package/dist/instance/connect.js +151 -44
  30. package/dist/instance/connection.d.ts +26 -5
  31. package/dist/instance/connection.js +194 -21
  32. package/dist/instance/gitignore.js +5 -2
  33. package/dist/instance/init.js +32 -7
  34. package/dist/instance/runner.js +32 -10
  35. package/dist/instance/setup.js +46 -13
  36. package/dist/instance/tty.js +26 -8
  37. package/dist/journal.d.ts +10 -0
  38. package/dist/journal.js +212 -49
  39. package/dist/kit-smoke.js +82 -20
  40. package/dist/kit-source.js +10 -40
  41. package/dist/kit.js +102 -34
  42. package/dist/layout-policy.d.ts +2 -0
  43. package/dist/layout-policy.js +86 -0
  44. package/dist/layout.d.ts +7 -1
  45. package/dist/layout.js +27 -70
  46. package/dist/live-smoke.js +13 -4
  47. package/dist/local-profile.js +2 -1
  48. package/dist/mcp-server.js +360 -47
  49. package/dist/native-api.js +47 -11
  50. package/dist/onboard.js +33 -7
  51. package/dist/operation.d.ts +2 -2
  52. package/dist/operation.js +279 -69
  53. package/dist/page-session.d.ts +23 -0
  54. package/dist/page-session.js +142 -0
  55. package/dist/png.js +18 -3
  56. package/dist/portable-tokens.js +254 -57
  57. package/dist/probe.d.ts +1 -1
  58. package/dist/probe.js +48 -11
  59. package/dist/project-input.js +24 -10
  60. package/dist/project-snippets.js +18 -6
  61. package/dist/project-status.js +133 -24
  62. package/dist/registry.js +217 -60
  63. package/dist/run-file.js +129 -30
  64. package/dist/shots.js +108 -26
  65. package/dist/skill-instructions.js +91 -22
  66. package/dist/skills.js +129 -39
  67. package/dist/snippet.js +27 -7
  68. package/dist/snippets/read.js +8 -2
  69. package/dist/structure-snapshot.d.ts +12 -0
  70. package/dist/structure-snapshot.js +439 -85
  71. package/dist/token-edit.js +219 -64
  72. package/dist/token-projection.d.ts +56 -0
  73. package/dist/token-projection.js +286 -0
  74. package/dist/tokens-diff.js +125 -32
  75. package/dist/version.d.ts +1 -1
  76. package/dist/version.js +1 -1
  77. package/package.json +1 -1
  78. package/skills/penpair-design/SKILL.md +3 -0
  79. package/skills/penpair-design/references/penpot-plugin-gotchas.md +2 -2
  80. package/skills/penpair-design/references/project-facts.md +2 -0
  81. package/skills/penpair-handoff/SKILL.md +2 -0
  82. package/skills/penpair-handoff/references/comparison-companion.md +13 -0
  83. package/skills/penpair-handoff/references/handoff-flow.md +2 -0
  84. package/skills/penpair-recipes/SKILL.md +5 -0
  85. package/skills/penpair-setup/SKILL.md +3 -1
  86. package/dist/cli.d.ts +0 -2
  87. package/dist/cli.js +0 -3
  88. package/dist/docker/lifecycle.d.ts +0 -96
  89. package/dist/docker/lifecycle.js +0 -273
  90. package/dist/docker/secrets.d.ts +0 -11
  91. package/dist/docker/secrets.js +0 -38
  92. package/dist/docker/template.d.ts +0 -8
  93. package/dist/docker/template.js +0 -158
  94. package/dist/docker-profile.d.ts +0 -114
  95. package/dist/docker-profile.js +0 -18
  96. package/dist/instance/lifecycle.d.ts +0 -129
  97. package/dist/instance/lifecycle.js +0 -336
  98. package/dist/instance/secrets.d.ts +0 -11
  99. package/dist/instance/secrets.js +0 -38
  100. package/dist/instance/template.d.ts +0 -8
  101. package/dist/instance/template.js +0 -158
@@ -1,44 +1,359 @@
1
- const viewportSchema = { type: "object", required: ["width", "height"], additionalProperties: false, properties: { width: { type: "integer", minimum: 1, maximum: 16384 }, height: { type: "integer", minimum: 1, maximum: 16384 } } };
2
- const caseFields = { viewport: viewportSchema, theme: { type: "string", minLength: 1, maxLength: 200 }, state: { type: "string", minLength: 1, maxLength: 200 }, fixture: { type: "string", minLength: 1, maxLength: 200 } };
3
- const baselineCaseSchema = { type: "object", required: ["viewport", "theme", "state", "fixture"], additionalProperties: false, properties: { ...caseFields, fonts: { type: "array", maxItems: 100, uniqueItems: true, items: { type: "string", minLength: 1 } }, activeThemeIds: { type: "array", maxItems: 100, uniqueItems: true, items: { type: "string", minLength: 1 } } } };
4
- const requiredCaseSchema = { type: "object", required: ["route", "viewport", "theme", "state", "fixture"], additionalProperties: false, properties: { route: { type: "string", minLength: 1 }, ...caseFields } };
1
+ const viewportSchema = {
2
+ type: "object",
3
+ required: [
4
+ "width",
5
+ "height",
6
+ ],
7
+ additionalProperties: false,
8
+ properties: {
9
+ width: {
10
+ type: "integer",
11
+ minimum: 1,
12
+ maximum: 16384,
13
+ },
14
+ height: {
15
+ type: "integer",
16
+ minimum: 1,
17
+ maximum: 16384,
18
+ },
19
+ },
20
+ };
21
+ const caseFields = {
22
+ viewport: viewportSchema,
23
+ theme: {
24
+ type: "string",
25
+ minLength: 1,
26
+ maxLength: 200,
27
+ },
28
+ state: {
29
+ type: "string",
30
+ minLength: 1,
31
+ maxLength: 200,
32
+ },
33
+ fixture: {
34
+ type: "string",
35
+ minLength: 1,
36
+ maxLength: 200,
37
+ },
38
+ };
39
+ const baselineCaseSchema = {
40
+ type: "object",
41
+ required: [
42
+ "viewport",
43
+ "theme",
44
+ "state",
45
+ "fixture",
46
+ ],
47
+ additionalProperties: false,
48
+ properties: {
49
+ ...caseFields,
50
+ fonts: {
51
+ type: "array",
52
+ maxItems: 100,
53
+ uniqueItems: true,
54
+ items: {
55
+ type: "string",
56
+ minLength: 1,
57
+ },
58
+ },
59
+ activeThemeIds: {
60
+ type: "array",
61
+ maxItems: 100,
62
+ uniqueItems: true,
63
+ items: {
64
+ type: "string",
65
+ minLength: 1,
66
+ },
67
+ },
68
+ },
69
+ };
70
+ const requiredCaseSchema = {
71
+ type: "object",
72
+ required: [
73
+ "route",
74
+ "viewport",
75
+ "theme",
76
+ "state",
77
+ "fixture",
78
+ ],
79
+ additionalProperties: false,
80
+ properties: {
81
+ route: {
82
+ type: "string",
83
+ minLength: 1,
84
+ },
85
+ ...caseFields,
86
+ },
87
+ };
5
88
  /** Editor hints for the core settings. Adapter-owned properties remain open; `config check` also checks semantic constraints. */
6
89
  export const projectConfigSchema = {
7
90
  $schema: "https://json-schema.org/draft/2020-12/schema",
8
91
  title: "penpair project configuration",
9
92
  type: "object",
10
- required: ["instance"],
93
+ required: [
94
+ "instance",
95
+ ],
11
96
  properties: {
12
- schemaVersion: { const: 1 },
13
- connection: { type: "object", additionalProperties: false, required: ["credential"], properties: { credential: { oneOf: [
14
- { type: "object", additionalProperties: false, required: ["type", "path"], properties: { type: { const: "file" }, path: { type: "string", minLength: 1 } } },
15
- { type: "object", additionalProperties: false, required: ["type", "service", "account"], properties: { type: { const: "keychain" }, service: { type: "string", minLength: 1 }, account: { type: "string", minLength: 1 } } },
16
- ] } } },
17
- audit: { type: "object", additionalProperties: false, properties: {
18
- contrast: { type: "boolean" }, library: { type: "boolean" }, touchTargets: { type: "boolean" }, names: { type: "boolean" }, blankText: { type: "boolean" },
19
- interactiveIds: { type: "array", maxItems: 1000, items: { type: "string" } }, allowBlank: { type: "array", maxItems: 1000, items: { type: "string" } }, nameSegments: { type: "integer", minimum: 1, maximum: 10 },
20
- suppressions: { type: "array", maxItems: 1000, items: { type: "object", required: ["rule", "nodeId", "reason"], properties: { rule: { enum: ["contrast", "library", "touch-target", "names", "blank-text"] }, nodeId: { type: "string" }, reason: { type: "string", minLength: 1 } } } },
21
- } },
22
- backup: { type: "object", required: ["noteFile", "remindAfterDays"], properties: { noteFile: { type: "string", minLength: 1, pattern: "^(?![/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$" }, remindAfterDays: { type: "integer", minimum: 1 } } },
23
- file: { type: "object", required: ["id"], properties: { id: { type: "string", minLength: 1, pattern: "\\S" }, name: { type: "string" } } },
24
- instance: { type: "string", pattern: "^[a-z][a-z0-9-]{0,30}$" },
25
- snippets: { type: "array", items: { type: "string", minLength: 1, pattern: "^(?![/\\\\])(?![A-Za-z]:[/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$" } },
26
- adapters: { type: "array", items: { type: "string", minLength: 1 } },
97
+ schemaVersion: {
98
+ const: 1,
99
+ },
100
+ connection: {
101
+ type: "object",
102
+ additionalProperties: false,
103
+ required: [
104
+ "credential",
105
+ ],
106
+ properties: {
107
+ credential: {
108
+ oneOf: [
109
+ {
110
+ type: "object",
111
+ additionalProperties: false,
112
+ required: [
113
+ "type",
114
+ "path",
115
+ ],
116
+ properties: {
117
+ type: {
118
+ const: "file",
119
+ },
120
+ path: {
121
+ type: "string",
122
+ minLength: 1,
123
+ },
124
+ },
125
+ },
126
+ {
127
+ type: "object",
128
+ additionalProperties: false,
129
+ required: [
130
+ "type",
131
+ "service",
132
+ "account",
133
+ ],
134
+ properties: {
135
+ type: {
136
+ const: "keychain",
137
+ },
138
+ service: {
139
+ type: "string",
140
+ minLength: 1,
141
+ },
142
+ account: {
143
+ type: "string",
144
+ minLength: 1,
145
+ },
146
+ },
147
+ },
148
+ ],
149
+ },
150
+ },
151
+ },
152
+ audit: {
153
+ type: "object",
154
+ additionalProperties: false,
155
+ properties: {
156
+ contrast: {
157
+ type: "boolean",
158
+ },
159
+ library: {
160
+ type: "boolean",
161
+ },
162
+ touchTargets: {
163
+ type: "boolean",
164
+ },
165
+ names: {
166
+ type: "boolean",
167
+ },
168
+ blankText: {
169
+ type: "boolean",
170
+ },
171
+ interactiveIds: {
172
+ type: "array",
173
+ maxItems: 1000,
174
+ items: {
175
+ type: "string",
176
+ },
177
+ },
178
+ allowBlank: {
179
+ type: "array",
180
+ maxItems: 1000,
181
+ items: {
182
+ type: "string",
183
+ },
184
+ },
185
+ nameSegments: {
186
+ type: "integer",
187
+ minimum: 1,
188
+ maximum: 10,
189
+ },
190
+ suppressions: {
191
+ type: "array",
192
+ maxItems: 1000,
193
+ items: {
194
+ type: "object",
195
+ required: [
196
+ "rule",
197
+ "nodeId",
198
+ "reason",
199
+ ],
200
+ properties: {
201
+ rule: {
202
+ enum: [
203
+ "contrast",
204
+ "library",
205
+ "touch-target",
206
+ "names",
207
+ "blank-text",
208
+ ],
209
+ },
210
+ nodeId: {
211
+ type: "string",
212
+ },
213
+ reason: {
214
+ type: "string",
215
+ minLength: 1,
216
+ },
217
+ },
218
+ },
219
+ },
220
+ },
221
+ },
222
+ backup: {
223
+ type: "object",
224
+ required: [
225
+ "noteFile",
226
+ "remindAfterDays",
227
+ ],
228
+ properties: {
229
+ noteFile: {
230
+ type: "string",
231
+ minLength: 1,
232
+ pattern: "^(?![/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$",
233
+ },
234
+ remindAfterDays: {
235
+ type: "integer",
236
+ minimum: 1,
237
+ },
238
+ },
239
+ },
240
+ file: {
241
+ type: "object",
242
+ required: [
243
+ "id",
244
+ ],
245
+ properties: {
246
+ id: {
247
+ type: "string",
248
+ minLength: 1,
249
+ pattern: "\\S",
250
+ },
251
+ name: {
252
+ type: "string",
253
+ },
254
+ },
255
+ },
256
+ instance: {
257
+ type: "string",
258
+ pattern: "^[a-z][a-z0-9-]{0,30}$",
259
+ },
260
+ snippets: {
261
+ type: "array",
262
+ items: {
263
+ type: "string",
264
+ minLength: 1,
265
+ pattern: "^(?![/\\\\])(?![A-Za-z]:[/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$",
266
+ },
267
+ },
268
+ adapters: {
269
+ type: "array",
270
+ items: {
271
+ type: "string",
272
+ minLength: 1,
273
+ },
274
+ },
27
275
  baselines: {
28
- type: "object", required: ["page", "root", "frames"],
276
+ type: "object",
277
+ required: [
278
+ "page",
279
+ "root",
280
+ "frames",
281
+ ],
29
282
  properties: {
30
- page: { type: "string", minLength: 1 },
31
- root: { type: "string", minLength: 1, pattern: "^(?![/\\\\])(?![A-Za-z]:[/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$" },
32
- coverage: { type: "object", required: ["required"], properties: { required: { type: "array", minItems: 1, maxItems: 1000, items: requiredCaseSchema }, unsupported: { type: "array", maxItems: 1000, items: { ...requiredCaseSchema, required: [...requiredCaseSchema.required, "reason"], properties: { ...requiredCaseSchema.properties, reason: { type: "string", minLength: 1 } } } } } },
33
- threshold: { type: "number", minimum: 0, maximum: 1 },
283
+ page: {
284
+ type: "string",
285
+ minLength: 1,
286
+ },
287
+ root: {
288
+ type: "string",
289
+ minLength: 1,
290
+ pattern: "^(?![/\\\\])(?![A-Za-z]:[/\\\\])(?!.*(?:^|[/\\\\])\\.\\.(?:[/\\\\]|$)).+$",
291
+ },
292
+ coverage: {
293
+ type: "object",
294
+ required: [
295
+ "required",
296
+ ],
297
+ properties: {
298
+ required: {
299
+ type: "array",
300
+ minItems: 1,
301
+ maxItems: 1000,
302
+ items: requiredCaseSchema,
303
+ },
304
+ unsupported: {
305
+ type: "array",
306
+ maxItems: 1000,
307
+ items: {
308
+ ...requiredCaseSchema,
309
+ required: [
310
+ ...requiredCaseSchema.required,
311
+ "reason",
312
+ ],
313
+ properties: {
314
+ ...requiredCaseSchema.properties,
315
+ reason: {
316
+ type: "string",
317
+ minLength: 1,
318
+ },
319
+ },
320
+ },
321
+ },
322
+ },
323
+ },
324
+ threshold: {
325
+ type: "number",
326
+ minimum: 0,
327
+ maximum: 1,
328
+ },
34
329
  frames: {
35
- type: "array", minItems: 1, maxItems: 1000,
330
+ type: "array",
331
+ minItems: 1,
332
+ maxItems: 1000,
36
333
  items: {
37
- type: "object", required: ["frame", "id"], dependentRequired: { case: ["route"] },
334
+ type: "object",
335
+ required: [
336
+ "frame",
337
+ "id",
338
+ ],
339
+ dependentRequired: {
340
+ case: [
341
+ "route",
342
+ ],
343
+ },
38
344
  properties: {
39
- frame: { type: "string", minLength: 1 },
40
- id: { type: "string", pattern: "^[a-z0-9][a-z0-9_-]{0,63}$" },
41
- route: { type: "string", minLength: 1 },
345
+ frame: {
346
+ type: "string",
347
+ minLength: 1,
348
+ },
349
+ id: {
350
+ type: "string",
351
+ pattern: "^[a-z0-9][a-z0-9_-]{0,63}$",
352
+ },
353
+ route: {
354
+ type: "string",
355
+ minLength: 1,
356
+ },
42
357
  case: baselineCaseSchema,
43
358
  },
44
359
  },
@@ -48,28 +363,72 @@ export const projectConfigSchema = {
48
363
  },
49
364
  oneOf: [
50
365
  {
51
- required: ["profile"],
366
+ required: [
367
+ "profile",
368
+ ],
52
369
  properties: {
53
370
  profile: {
54
- type: "object", required: ["type", "origin"],
55
- properties: { type: { const: "external" }, origin: { type: "string", pattern: "^https?://[^/?#]+$" } },
371
+ type: "object",
372
+ required: [
373
+ "type",
374
+ "origin",
375
+ ],
376
+ properties: {
377
+ type: {
378
+ const: "external",
379
+ },
380
+ origin: {
381
+ type: "string",
382
+ pattern: "^https?://[^/?#]+$",
383
+ },
384
+ },
56
385
  },
57
386
  },
58
387
  },
59
388
  {
60
- required: ["penpotVersion", "ports", "directory"],
61
- not: { required: ["profile"] },
389
+ required: [
390
+ "penpotVersion",
391
+ "ports",
392
+ "directory",
393
+ ],
394
+ not: {
395
+ required: [
396
+ "profile",
397
+ ],
398
+ },
62
399
  properties: {
63
- penpotVersion: { type: "string", pattern: "^\\d+\\.\\d+(\\.\\d+)?$" },
400
+ penpotVersion: {
401
+ type: "string",
402
+ pattern: "^\\d+\\.\\d+(\\.\\d+)?$",
403
+ },
64
404
  ports: {
65
- type: "object", required: ["frontend", "mail"],
405
+ type: "object",
406
+ required: [
407
+ "frontend",
408
+ "mail",
409
+ ],
66
410
  properties: {
67
- frontend: { type: "integer", minimum: 1024, maximum: 65535 },
68
- mail: { type: "integer", minimum: 1024, maximum: 65535 },
411
+ frontend: {
412
+ type: "integer",
413
+ minimum: 1024,
414
+ maximum: 65535,
415
+ },
416
+ mail: {
417
+ type: "integer",
418
+ minimum: 1024,
419
+ maximum: 65535,
420
+ },
69
421
  },
70
422
  },
71
- directory: { type: "string", minLength: 1, pattern: "^(?!/).+$" },
72
- composeProject: { type: "string", pattern: "^[a-z0-9][a-z0-9_-]*$" },
423
+ directory: {
424
+ type: "string",
425
+ minLength: 1,
426
+ pattern: "^(?!/).+$",
427
+ },
428
+ composeProject: {
429
+ type: "string",
430
+ pattern: "^[a-z0-9][a-z0-9_-]*$",
431
+ },
73
432
  },
74
433
  },
75
434
  ],