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/LICENSE ADDED
@@ -0,0 +1,276 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Library General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
+
61
+ 0. This License applies to any program or other work which contains a
62
+ notice placed by the copyright holder saying it may be distributed
63
+ under the terms of this General Public License. The "Program", below,
64
+ refers to any such program or work, and a "work based on the Program"
65
+ means either the Program or any derivative work under copyright law:
66
+ that is to say, a work containing the Program or a portion of it,
67
+ either verbatim or with modifications and/or translated into another
68
+ language. (Hereinafter, translation is included without limitation in
69
+ the term "modification".) Each licensee is addressed as "you".
70
+
71
+ Activities other than copying, distribution and modification are not
72
+ covered by this License; they are outside its scope. The act of running
73
+ the Program is not restricted, and the output from the Program is
74
+ covered only if its contents constitute a work based on the Program
75
+ (independent of having been made by running the Program). Whether that
76
+ is true depends on what the Program does.
77
+
78
+ 1. You may copy and distribute verbatim copies of the Program's source
79
+ code as you receive it, in any medium, provided that you conspicuously
80
+ and appropriately publish on each copy an appropriate copyright notice
81
+ and disclaimer of warranty; keep intact all the notices that refer to
82
+ this License and to the absence of any warranty; and give any other
83
+ recipients of the Program a copy of this License along with the
84
+ Program.
85
+
86
+ You may charge a fee for the physical act of transferring a copy, and
87
+ you may at your option offer warranty protection in exchange for a fee.
88
+
89
+ 2. You may modify your copy or copies of the Program or any portion of
90
+ it, thus forming a work based on the Program, and copy and distribute
91
+ such modifications or work under the terms of Section 1 above, provided
92
+ that you also meet all of these conditions:
93
+
94
+ a) You must cause the modified files to carry prominent notices stating
95
+ that you changed the files and the date of any change.
96
+
97
+ b) You must cause any work that you distribute or publish, that in
98
+ whole or in part contains or is derived from the Program or any part
99
+ thereof, to be licensed as a whole at no charge to all third parties
100
+ under the terms of this License.
101
+
102
+ c) If the modified program normally reads commands interactively when
103
+ run, you must cause it, when started running for such interactive use in
104
+ the most ordinary way, to print or display an announcement including an
105
+ appropriate copyright notice and a notice that there is no warranty (or
106
+ else, saying that you provide a warranty) and that users may redistribute
107
+ the program under these conditions, and telling the user how to view a
108
+ copy of this License. (Exception: if the Program itself is interactive
109
+ but does not normally print such an announcement, your work based on
110
+ the Program is not required to print an announcement.)
111
+
112
+ These requirements apply to the modified work as a whole. If
113
+ identifiable sections of that work are not derived from the Program,
114
+ and can be reasonably considered independent and separate works in
115
+ themselves, then this License, and its terms, do not apply to those
116
+ sections when you distribute them as separate works. But when you
117
+ distribute the same sections as part of a whole which is a work based
118
+ on the Program, the distribution of the whole must be on the terms of
119
+ this License, whose permissions for other licensees extend to the
120
+ entire whole, and thus to each and every part regardless of who wrote it.
121
+
122
+ Thus, it is not the intent of this section to claim rights or contest
123
+ your rights to work written entirely by you; rather, the intent is to
124
+ exercise the right to control the distribution of derivative or
125
+ collective works based on the Program.
126
+
127
+ In addition, mere aggregation of another work not based on the Program
128
+ with the Program (or with a work based on the Program) on a volume of a
129
+ storage or distribution medium does not bring the other work under the
130
+ scope of this License.
131
+
132
+ 3. You may copy and distribute the Program (or a work based on it,
133
+ under Section 2) in object code or executable form under the terms of
134
+ Sections 1 and 2 above provided that you also do one of the following:
135
+
136
+ a) Accompany it with the complete corresponding machine-readable source
137
+ code, which must be distributed under the terms of Sections 1 and 2
138
+ above on a medium customarily used for software interchange; or,
139
+
140
+ b) Accompany it with a written offer, valid for at least three years, to
141
+ give any third party, for a charge no more than your cost of physically
142
+ performing source distribution, a complete machine-readable copy of the
143
+ corresponding source code, to be distributed under the terms of Sections
144
+ 1 and 2 above on a medium customarily used for software interchange; or,
145
+
146
+ c) Accompany it with the information you received as to the offer to
147
+ distribute corresponding source code. (This alternative is allowed only
148
+ for noncommercial distribution and only if you received the program in
149
+ object code or executable form with such an offer, in accord with
150
+ Subsection b above.)
151
+
152
+ The source code for a work means the preferred form of the work for
153
+ making modifications to it. For an executable work, complete source code
154
+ means all the source code for all modules it contains, plus any
155
+ associated interface definition files, plus the scripts used to control
156
+ compilation and installation of the executable. However, as a special
157
+ exception, the source code distributed need not include anything that is
158
+ normally distributed (in either source or binary form) with the major
159
+ components (compiler, kernel, and so on) of the operating system on
160
+ which the executable runs, unless that component itself accompanies the
161
+ executable.
162
+
163
+ If distribution of executable or object code is made by offering access
164
+ to copy from a designated place, then offering equivalent access to copy
165
+ the source code from the same place counts as distribution of the source
166
+ code, even though third parties are not compelled to copy the source
167
+ along with the object code.
168
+
169
+ 4. You may not copy, modify, sublicense, or distribute the Program
170
+ except as expressly provided under this License. Any attempt otherwise
171
+ to copy, modify, sublicense or distribute the Program is void, and will
172
+ automatically terminate your rights under this License. However, parties
173
+ who have received copies, or rights, from you under this License will
174
+ not have their licenses terminated so long as such parties remain in
175
+ full compliance.
176
+
177
+ 5. You are not required to accept this License, since you have not
178
+ signed it. However, nothing else grants you permission to modify or
179
+ distribute the Program or its derivative works. These actions are
180
+ prohibited by law if you do not accept this License. Therefore, by
181
+ modifying or distributing the Program (or any work based on the
182
+ Program), you indicate your acceptance of this License to do so, and all
183
+ its terms and conditions for copying, distributing or modifying the
184
+ Program or works based on it.
185
+
186
+ 6. Each time you redistribute the Program (or any work based on the
187
+ Program), the recipient automatically receives a license from the
188
+ original licensor to copy, distribute or modify the Program subject to
189
+ these terms and conditions. You may not impose any further restrictions
190
+ on the recipients' exercise of the rights granted herein. You are not
191
+ responsible for enforcing compliance by third parties to this License.
192
+
193
+ 7. If, as a consequence of a court judgment or allegation of patent
194
+ infringement or for any other reason (not limited to patent issues),
195
+ conditions are imposed on you (whether by court order, agreement or
196
+ otherwise) that contradict the conditions of this License, they do not
197
+ excuse you from the conditions of this License. If you cannot distribute
198
+ so as to satisfy simultaneously your obligations under this License and
199
+ any other pertinent obligations, then as a consequence you may not
200
+ distribute the Program at all. For example, if a patent license would
201
+ not permit royalty-free redistribution of the Program by all those who
202
+ receive copies directly or indirectly through you, then the only way you
203
+ could satisfy both it and this License would be to refrain entirely from
204
+ distribution of the Program.
205
+
206
+ If any portion of this section is held invalid or unenforceable under
207
+ any particular circumstance, the balance of the section is intended to
208
+ apply and the section as a whole is intended to apply in other
209
+ circumstances.
210
+
211
+ It is not the purpose of this section to induce you to infringe any
212
+ patents or other property right claims or to contest validity of any
213
+ such claims; this section has the sole purpose of protecting the
214
+ integrity of the free software distribution system, which is
215
+ implemented by public license practices. Many people have made generous
216
+ contributions to the wide range of software distributed through that
217
+ system in reliance on consistent application of that system; it is up
218
+ to the author/donor to decide if he or she is willing to distribute
219
+ software through any other system and a licensee cannot impose that
220
+ choice.
221
+
222
+ This section is intended to make thoroughly clear what is believed to
223
+ be a consequence of the rest of this License.
224
+
225
+ 8. If the distribution and/or use of the Program is restricted in
226
+ certain countries either by patents or by copyrighted interfaces, the
227
+ original copyright holder who places the Program under this License may
228
+ add an explicit geographical distribution limitation excluding those
229
+ countries, so that distribution is permitted only in or among countries
230
+ not thus excluded. In such case, this License incorporates the
231
+ limitation as if written in the body of this License.
232
+
233
+ 9. The Free Software Foundation may publish revised and/or new versions
234
+ of the General Public License from time to time. Such new versions will
235
+ be similar in spirit to the present version, but may differ in detail to
236
+ address new problems or concerns.
237
+
238
+ Each version is given a distinguishing version number. If the Program
239
+ specifies a version number of this License which applies to it and "any
240
+ later version", you have the option of following the terms and
241
+ conditions either of that version or of any later version published by
242
+ the Free Software Foundation. If the Program does not specify a version
243
+ number of this License, you may choose any version ever published by the
244
+ Free Software Foundation.
245
+
246
+ 10. If you wish to incorporate parts of the Program into other free
247
+ programs whose distribution conditions are different, write to the
248
+ author to ask for permission. For software which is copyrighted by the
249
+ Free Software Foundation, write to the Free Software Foundation; we
250
+ sometimes make exceptions for this. Our decision will be guided by the
251
+ two goals of preserving the free status of all derivatives of our free
252
+ software and of promoting the sharing and reuse of software generally.
253
+
254
+ NO WARRANTY
255
+
256
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
257
+ WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
258
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
259
+ OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
260
+ EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
261
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
262
+ ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
263
+ YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
264
+ NECESSARY SERVICING, REPAIR OR CORRECTION.
265
+
266
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
267
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
268
+ AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
269
+ DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
270
+ DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
271
+ (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
272
+ INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
273
+ THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
274
+ OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
275
+
276
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # Wesper
2
+
3
+ **The primitive that reads what a WordPress site can accept.**
4
+
5
+ [![license](https://img.shields.io/github/license/humanmade/wesper.svg)](./LICENSE)
6
+
7
+ > Status: early scaffold. The manifest schema and the WP-CLI collector are the first build (see milestones in the spec). The shape below is the target.
8
+
9
+ Agents and tools generate content for WordPress, but they generate it *blind* — inventing
10
+ block attributes, binding to meta keys that do not exist, ignoring the theme's tokens,
11
+ emitting blocks the site cannot render, and overclaiming portability. Wesper reads a
12
+ WordPress site and emits one portable, provenanced **context manifest** that answers a single
13
+ question:
14
+
15
+ > What can this specific WordPress site safely accept, reference, and bind to?
16
+
17
+ It captures the block registry, theme tokens, **Block Bindings sources and fields**, post
18
+ types, patterns, media rules, and the capability surface — normalized into one
19
+ `site.context.json`, with provenance and freshness, and every gap recorded as a warning
20
+ rather than a guess. Deliberately a primitive rather than a platform: it reads, it does not
21
+ write, and it ships native data nothing proprietary has to stay installed to read.
22
+
23
+ ```sh
24
+ # read a site into a manifest (local WP-CLI)
25
+ wesper collect --wp-path ./public --out site.context.json
26
+
27
+ # then feed it to a consumer — e.g. Block Runner's binding pass
28
+ block-runner convert hero.html --bind --context site.context.json
29
+ ```
30
+
31
+ ## Why it exists
32
+
33
+ It is the read half of the agentic-WordPress loop: **read the site (wesper) → author native
34
+ blocks ([block-runner](https://github.com/humanmade/block-runner)) → wire them to the site's
35
+ real data (the binding pass).** Block Runner already reaches into WordPress for theme tokens
36
+ via a built-in resolver; Wesper is that pattern lifted out, widened to the whole world model
37
+ (binding sources, fields, registry, patterns, abilities), and made a reusable artifact every
38
+ consumer can share — instead of each agent re-deriving brittle introspection of its own.
39
+
40
+ ## What it does
41
+
42
+ - **One normalized manifest.** A stable, versioned `site.context.json` schema, so every
43
+ consumer reads one known shape instead of hand-rolling `wp eval` scrapes.
44
+ - **A transport ladder, not one method.** Collect via WP-CLI (local/SSH), authenticated
45
+ REST/Abilities/MCP (no-shell hosts), or a hand-authored fixture (tests/CI). The schema is
46
+ independent of how it was gathered.
47
+ - **Binding-ready.** Surfaces registered Block Bindings sources, their argument schemas, and
48
+ the fields/meta keys reachable per post type — the slice the binding pass cannot function
49
+ without.
50
+ - **Provenance + freshness.** Every manifest is stamped (`collectedAt`, collector, source
51
+ hash, TTL) so consumers can detect stale context and diff it in CI.
52
+ - **Honest about gaps.** A thin manifest is allowed, but it must say *where* it is thin.
53
+ Warnings are first-class output; absent data is never invented.
54
+ - **Untrusted by contract.** Consumers validate the manifest against the schema and never
55
+ eval anything from it. Wesper reads; it does not register sources, create fields, or run a
56
+ service.
57
+
58
+ ## CLI (target)
59
+
60
+ ```sh
61
+ wesper collect --wp-path <path> --out site.context.json # local WP-CLI
62
+ wesper collect --url <url> --auth <profile> --out site.context.json # remote REST/Abilities/MCP
63
+ wesper validate site.context.json
64
+ wesper summarize site.context.json
65
+ wesper diff old.context.json new.context.json
66
+ ```
67
+
68
+ ## License
69
+
70
+ GPL-2.0-or-later.