wesper 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ import {
2
+ CONTEXT_VERSION,
3
+ SCHEMA_URL,
4
+ canonicalize,
5
+ collect,
6
+ formatSummaryMarkdown,
7
+ parseThemeJsonSettings,
8
+ redactSecrets,
9
+ siteContextJsonSchema,
10
+ siteContextSchema,
11
+ sourceHash,
12
+ summarize,
13
+ validate
14
+ } from "./chunk-44KKIZUQ.js";
15
+ export {
16
+ CONTEXT_VERSION,
17
+ SCHEMA_URL,
18
+ canonicalize,
19
+ collect,
20
+ formatSummaryMarkdown,
21
+ parseThemeJsonSettings,
22
+ redactSecrets,
23
+ siteContextJsonSchema,
24
+ siteContextSchema,
25
+ sourceHash,
26
+ summarize,
27
+ validate
28
+ };
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "wesper",
3
+ "version": "0.0.1",
4
+ "description": "The primitive that reads a WordPress site's world model — block registry, theme tokens, binding sources, fields, patterns, abilities — into one portable, provenanced context manifest for agents and Block Runner passes. CLI + library.",
5
+ "type": "module",
6
+ "license": "GPL-2.0-or-later",
7
+ "keywords": [
8
+ "wordpress",
9
+ "gutenberg",
10
+ "block-editor",
11
+ "block-bindings",
12
+ "theme-json",
13
+ "site-context",
14
+ "introspection",
15
+ "wp-cli",
16
+ "mcp",
17
+ "ai",
18
+ "agent"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/humanmade/wesper.git"
23
+ },
24
+ "homepage": "https://github.com/humanmade/wesper#readme",
25
+ "bugs": "https://github.com/humanmade/wesper/issues",
26
+ "bin": {
27
+ "wesper": "./dist/cli.js"
28
+ },
29
+ "main": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "default": "./dist/index.js"
36
+ }
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "schemas",
41
+ "README.md",
42
+ "LICENSE"
43
+ ],
44
+ "engines": {
45
+ "node": ">=18.12.0"
46
+ },
47
+ "scripts": {
48
+ "build": "tsup",
49
+ "clean": "rm -rf dist",
50
+ "dev": "tsx src/cli.ts",
51
+ "prepack": "npm run build",
52
+ "test": "vitest run",
53
+ "typecheck": "tsc --noEmit",
54
+ "verify": "npm run typecheck && npm test && npm run build"
55
+ },
56
+ "dependencies": {
57
+ "commander": "12.1.0",
58
+ "zod": "^3.25.76",
59
+ "zod-to-json-schema": "^3.25.2"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "22.10.2",
63
+ "tsup": "8.3.5",
64
+ "tsx": "4.19.2",
65
+ "typescript": "5.7.2",
66
+ "vitest": "2.1.8"
67
+ }
68
+ }
@@ -0,0 +1,465 @@
1
+ {
2
+ "$ref": "#/definitions/WesperSiteContextV1",
3
+ "definitions": {
4
+ "WesperSiteContextV1": {
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string",
9
+ "format": "uri",
10
+ "default": "https://humanmade.github.io/wesper/schemas/site-context-v1.schema.json"
11
+ },
12
+ "contextVersion": {
13
+ "type": "number",
14
+ "const": 1
15
+ },
16
+ "site": {
17
+ "type": "object",
18
+ "properties": {
19
+ "url": {
20
+ "type": "string"
21
+ },
22
+ "name": {
23
+ "type": "string"
24
+ },
25
+ "environment": {
26
+ "type": "string",
27
+ "enum": [
28
+ "local",
29
+ "staging",
30
+ "production",
31
+ "unknown"
32
+ ],
33
+ "default": "unknown"
34
+ },
35
+ "isMultisite": {
36
+ "type": "boolean",
37
+ "default": false
38
+ }
39
+ },
40
+ "additionalProperties": true
41
+ },
42
+ "provenance": {
43
+ "type": "object",
44
+ "properties": {
45
+ "collectedAt": {
46
+ "type": "string",
47
+ "format": "date-time"
48
+ },
49
+ "collector": {
50
+ "type": "string",
51
+ "enum": [
52
+ "wp-cli",
53
+ "fixture"
54
+ ]
55
+ },
56
+ "collectorVersion": {
57
+ "type": "string",
58
+ "minLength": 1
59
+ },
60
+ "sourceHash": {
61
+ "type": "string",
62
+ "pattern": "^sha256:[a-f0-9]{64}$"
63
+ },
64
+ "partial": {
65
+ "type": "boolean",
66
+ "default": false
67
+ }
68
+ },
69
+ "required": [
70
+ "collectedAt",
71
+ "collector",
72
+ "collectorVersion",
73
+ "sourceHash"
74
+ ],
75
+ "additionalProperties": true
76
+ },
77
+ "wordpress": {
78
+ "type": "object",
79
+ "properties": {
80
+ "version": {
81
+ "type": "string"
82
+ },
83
+ "locale": {
84
+ "type": "string"
85
+ },
86
+ "permalinkStructure": {
87
+ "type": "string"
88
+ },
89
+ "features": {
90
+ "type": "object",
91
+ "additionalProperties": {
92
+ "type": "boolean"
93
+ },
94
+ "default": {}
95
+ }
96
+ },
97
+ "additionalProperties": true
98
+ },
99
+ "theme": {
100
+ "type": "object",
101
+ "properties": {
102
+ "stylesheet": {
103
+ "type": "string"
104
+ },
105
+ "template": {
106
+ "type": "string"
107
+ },
108
+ "name": {
109
+ "type": "string"
110
+ },
111
+ "version": {
112
+ "type": "string"
113
+ },
114
+ "isBlockTheme": {
115
+ "type": "boolean"
116
+ },
117
+ "themeJsonHash": {
118
+ "type": "string"
119
+ },
120
+ "settingsOrigin": {
121
+ "type": "string",
122
+ "enum": [
123
+ "merged",
124
+ "theme"
125
+ ],
126
+ "default": "merged"
127
+ },
128
+ "tokens": {
129
+ "type": "object",
130
+ "properties": {
131
+ "colors": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "object",
135
+ "properties": {
136
+ "slug": {
137
+ "type": "string",
138
+ "minLength": 1
139
+ },
140
+ "name": {
141
+ "type": "string"
142
+ },
143
+ "value": {
144
+ "type": "string",
145
+ "minLength": 1
146
+ }
147
+ },
148
+ "required": [
149
+ "slug",
150
+ "value"
151
+ ],
152
+ "additionalProperties": true
153
+ },
154
+ "default": []
155
+ },
156
+ "spacing": {
157
+ "type": "array",
158
+ "items": {
159
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/tokens/properties/colors/items"
160
+ },
161
+ "default": []
162
+ },
163
+ "typography": {
164
+ "type": "array",
165
+ "items": {
166
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/tokens/properties/colors/items"
167
+ },
168
+ "default": []
169
+ }
170
+ },
171
+ "additionalProperties": false,
172
+ "default": {
173
+ "colors": [],
174
+ "spacing": [],
175
+ "typography": []
176
+ }
177
+ },
178
+ "settings": {
179
+ "anyOf": [
180
+ {
181
+ "type": "string"
182
+ },
183
+ {
184
+ "type": "number"
185
+ },
186
+ {
187
+ "type": "boolean"
188
+ },
189
+ {
190
+ "type": "null"
191
+ },
192
+ {
193
+ "type": "array",
194
+ "items": {
195
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
196
+ }
197
+ },
198
+ {
199
+ "type": "object",
200
+ "additionalProperties": {
201
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
202
+ }
203
+ }
204
+ ]
205
+ }
206
+ },
207
+ "additionalProperties": true
208
+ },
209
+ "plugins": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "object",
213
+ "additionalProperties": {
214
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
215
+ }
216
+ },
217
+ "default": []
218
+ },
219
+ "blocks": {
220
+ "type": "object",
221
+ "properties": {
222
+ "types": {
223
+ "type": "array",
224
+ "items": {
225
+ "type": "object",
226
+ "additionalProperties": {
227
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
228
+ }
229
+ },
230
+ "default": []
231
+ }
232
+ },
233
+ "additionalProperties": true
234
+ },
235
+ "bindings": {
236
+ "type": "object",
237
+ "properties": {
238
+ "available": {
239
+ "type": "boolean",
240
+ "default": false
241
+ },
242
+ "sources": {
243
+ "type": "array",
244
+ "items": {
245
+ "type": "object",
246
+ "properties": {
247
+ "name": {
248
+ "type": "string",
249
+ "minLength": 1
250
+ },
251
+ "label": {
252
+ "type": [
253
+ "string",
254
+ "null"
255
+ ]
256
+ },
257
+ "usesContext": {
258
+ "type": "array",
259
+ "items": {
260
+ "type": "string"
261
+ },
262
+ "default": []
263
+ },
264
+ "argsSchema": {
265
+ "anyOf": [
266
+ {
267
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
268
+ },
269
+ {
270
+ "type": "null"
271
+ }
272
+ ],
273
+ "default": null
274
+ }
275
+ },
276
+ "required": [
277
+ "name"
278
+ ],
279
+ "additionalProperties": true
280
+ },
281
+ "default": []
282
+ },
283
+ "supportedAttributes": {
284
+ "type": "object",
285
+ "additionalProperties": {
286
+ "type": "array",
287
+ "items": {
288
+ "type": "string"
289
+ }
290
+ },
291
+ "default": {}
292
+ },
293
+ "warnings": {
294
+ "type": "array",
295
+ "items": {
296
+ "type": "object",
297
+ "properties": {
298
+ "code": {
299
+ "type": "string",
300
+ "minLength": 1
301
+ },
302
+ "severity": {
303
+ "type": "string",
304
+ "enum": [
305
+ "info",
306
+ "warning",
307
+ "error"
308
+ ]
309
+ },
310
+ "message": {
311
+ "type": "string",
312
+ "minLength": 1
313
+ },
314
+ "surface": {
315
+ "type": "string",
316
+ "minLength": 1
317
+ }
318
+ },
319
+ "required": [
320
+ "code",
321
+ "severity",
322
+ "message",
323
+ "surface"
324
+ ],
325
+ "additionalProperties": false
326
+ },
327
+ "default": []
328
+ }
329
+ },
330
+ "additionalProperties": true
331
+ },
332
+ "contentModel": {
333
+ "type": "object",
334
+ "properties": {
335
+ "postTypes": {
336
+ "type": "array",
337
+ "items": {
338
+ "type": "object",
339
+ "properties": {
340
+ "name": {
341
+ "type": "string",
342
+ "minLength": 1
343
+ },
344
+ "label": {
345
+ "type": "string"
346
+ },
347
+ "public": {
348
+ "type": "boolean"
349
+ },
350
+ "showInRest": {
351
+ "type": "boolean"
352
+ },
353
+ "taxonomies": {
354
+ "type": "array",
355
+ "items": {
356
+ "type": "string"
357
+ },
358
+ "default": []
359
+ },
360
+ "fields": {
361
+ "type": "array",
362
+ "items": {
363
+ "type": "object",
364
+ "properties": {
365
+ "key": {
366
+ "type": "string",
367
+ "minLength": 1
368
+ },
369
+ "source": {
370
+ "type": "string",
371
+ "minLength": 1
372
+ },
373
+ "type": {
374
+ "type": "string"
375
+ },
376
+ "single": {
377
+ "type": "boolean"
378
+ },
379
+ "showInRest": {
380
+ "type": "boolean"
381
+ },
382
+ "bindable": {
383
+ "type": "boolean",
384
+ "default": true
385
+ }
386
+ },
387
+ "required": [
388
+ "key",
389
+ "source"
390
+ ],
391
+ "additionalProperties": true
392
+ },
393
+ "default": []
394
+ }
395
+ },
396
+ "required": [
397
+ "name"
398
+ ],
399
+ "additionalProperties": true
400
+ },
401
+ "default": []
402
+ }
403
+ },
404
+ "additionalProperties": true
405
+ },
406
+ "patterns": {
407
+ "type": "object",
408
+ "properties": {
409
+ "items": {
410
+ "type": "array",
411
+ "items": {
412
+ "type": "object",
413
+ "additionalProperties": {
414
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
415
+ }
416
+ },
417
+ "default": []
418
+ }
419
+ },
420
+ "additionalProperties": true
421
+ },
422
+ "media": {
423
+ "type": "object",
424
+ "properties": {
425
+ "imageSizes": {
426
+ "type": "array",
427
+ "items": {
428
+ "type": "object",
429
+ "additionalProperties": {
430
+ "$ref": "#/definitions/WesperSiteContextV1/properties/theme/properties/settings"
431
+ }
432
+ },
433
+ "default": []
434
+ },
435
+ "maxUploadSize": {
436
+ "type": "number"
437
+ }
438
+ },
439
+ "additionalProperties": true
440
+ },
441
+ "warnings": {
442
+ "type": "array",
443
+ "items": {
444
+ "$ref": "#/definitions/WesperSiteContextV1/properties/bindings/properties/warnings/items"
445
+ },
446
+ "default": []
447
+ }
448
+ },
449
+ "required": [
450
+ "contextVersion",
451
+ "site",
452
+ "provenance",
453
+ "wordpress",
454
+ "theme",
455
+ "blocks",
456
+ "bindings",
457
+ "contentModel",
458
+ "patterns",
459
+ "media"
460
+ ],
461
+ "additionalProperties": true
462
+ }
463
+ },
464
+ "$schema": "http://json-schema.org/draft-07/schema#"
465
+ }