sagebrush-web 0.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.
@@ -0,0 +1,277 @@
1
+ A. HISTORY OF THE SOFTWARE
2
+ ==========================
3
+
4
+ Python was created in the early 1990s by Guido van Rossum at Stichting
5
+ Mathematisch Centrum (CWI, see https://www.cwi.nl) in the Netherlands
6
+ as a successor of a language called ABC. Guido remains Python's
7
+ principal author, although it includes many contributions from others.
8
+
9
+ In 1995, Guido continued his work on Python at the Corporation for
10
+ National Research Initiatives (CNRI, see https://www.cnri.reston.va.us)
11
+ in Reston, Virginia where he released several versions of the
12
+ software.
13
+
14
+ In May 2000, Guido and the Python core development team moved to
15
+ BeOpen.com to form the BeOpen PythonLabs team. In October of the same
16
+ year, the PythonLabs team moved to Digital Creations, which became
17
+ Zope Corporation. In 2001, the Python Software Foundation (PSF, see
18
+ https://www.python.org/psf/) was formed, a non-profit organization
19
+ created specifically to own Python-related Intellectual Property.
20
+ Zope Corporation was a sponsoring member of the PSF.
21
+
22
+ All Python releases are Open Source (see https://opensource.org for
23
+ the Open Source Definition). Historically, most, but not all, Python
24
+ releases have also been GPL-compatible; the table below summarizes
25
+ the various releases.
26
+
27
+ Release Derived Year Owner GPL-
28
+ from compatible? (1)
29
+
30
+ 0.9.0 thru 1.2 1991-1995 CWI yes
31
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
32
+ 1.6 1.5.2 2000 CNRI no
33
+ 2.0 1.6 2000 BeOpen.com no
34
+ 1.6.1 1.6 2001 CNRI yes (2)
35
+ 2.1 2.0+1.6.1 2001 PSF no
36
+ 2.0.1 2.0+1.6.1 2001 PSF yes
37
+ 2.1.1 2.1+2.0.1 2001 PSF yes
38
+ 2.1.2 2.1.1 2002 PSF yes
39
+ 2.1.3 2.1.2 2002 PSF yes
40
+ 2.2 and above 2.1.1 2001-now PSF yes
41
+
42
+ Footnotes:
43
+
44
+ (1) GPL-compatible doesn't mean that we're distributing Python under
45
+ the GPL. All Python licenses, unlike the GPL, let you distribute
46
+ a modified version without making your changes open source. The
47
+ GPL-compatible licenses make it possible to combine Python with
48
+ other software that is released under the GPL; the others don't.
49
+
50
+ (2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
51
+ because its license has a choice of law clause. According to
52
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
53
+ is "not incompatible" with the GPL.
54
+
55
+ Thanks to the many outside volunteers who have worked under Guido's
56
+ direction to make these releases possible.
57
+
58
+
59
+ B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
60
+ ===============================================================
61
+
62
+ Python software and documentation are licensed under the
63
+ Python Software Foundation License Version 2.
64
+
65
+ Starting with Python 3.8.6, examples, recipes, and other code in
66
+ the documentation are dual licensed under the PSF License Version 2
67
+ and the Zero-Clause BSD license.
68
+
69
+ Some software incorporated into Python is under different licenses.
70
+ The licenses are listed with code falling under that license.
71
+
72
+
73
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
74
+ --------------------------------------------
75
+
76
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
77
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
78
+ otherwise using this software ("Python") in source or binary form and
79
+ its associated documentation.
80
+
81
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
82
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
83
+ analyze, test, perform and/or display publicly, prepare derivative works,
84
+ distribute, and otherwise use Python alone or in any derivative version,
85
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
86
+ i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved"
87
+ are retained in Python alone or in any derivative version prepared by Licensee.
88
+
89
+ 3. In the event Licensee prepares a derivative work that is based on
90
+ or incorporates Python or any part thereof, and wants to make
91
+ the derivative work available to others as provided herein, then
92
+ Licensee hereby agrees to include in any such work a brief summary of
93
+ the changes made to Python.
94
+
95
+ 4. PSF is making Python available to Licensee on an "AS IS"
96
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
97
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
98
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
99
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
100
+ INFRINGE ANY THIRD PARTY RIGHTS.
101
+
102
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
103
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
104
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
105
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
106
+
107
+ 6. This License Agreement will automatically terminate upon a material
108
+ breach of its terms and conditions.
109
+
110
+ 7. Nothing in this License Agreement shall be deemed to create any
111
+ relationship of agency, partnership, or joint venture between PSF and
112
+ Licensee. This License Agreement does not grant permission to use PSF
113
+ trademarks or trade name in a trademark sense to endorse or promote
114
+ products or services of Licensee, or any third party.
115
+
116
+ 8. By copying, installing or otherwise using Python, Licensee
117
+ agrees to be bound by the terms and conditions of this License
118
+ Agreement.
119
+
120
+
121
+ BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
122
+ -------------------------------------------
123
+
124
+ BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
125
+
126
+ 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
127
+ office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
128
+ Individual or Organization ("Licensee") accessing and otherwise using
129
+ this software in source or binary form and its associated
130
+ documentation ("the Software").
131
+
132
+ 2. Subject to the terms and conditions of this BeOpen Python License
133
+ Agreement, BeOpen hereby grants Licensee a non-exclusive,
134
+ royalty-free, world-wide license to reproduce, analyze, test, perform
135
+ and/or display publicly, prepare derivative works, distribute, and
136
+ otherwise use the Software alone or in any derivative version,
137
+ provided, however, that the BeOpen Python License is retained in the
138
+ Software, alone or in any derivative version prepared by Licensee.
139
+
140
+ 3. BeOpen is making the Software available to Licensee on an "AS IS"
141
+ basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
142
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
143
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
144
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
145
+ INFRINGE ANY THIRD PARTY RIGHTS.
146
+
147
+ 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
148
+ SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
149
+ AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
150
+ DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
151
+
152
+ 5. This License Agreement will automatically terminate upon a material
153
+ breach of its terms and conditions.
154
+
155
+ 6. This License Agreement shall be governed by and interpreted in all
156
+ respects by the law of the State of California, excluding conflict of
157
+ law provisions. Nothing in this License Agreement shall be deemed to
158
+ create any relationship of agency, partnership, or joint venture
159
+ between BeOpen and Licensee. This License Agreement does not grant
160
+ permission to use BeOpen trademarks or trade names in a trademark
161
+ sense to endorse or promote products or services of Licensee, or any
162
+ third party. As an exception, the "BeOpen Python" logos available at
163
+ http://www.pythonlabs.com/logos.html may be used according to the
164
+ permissions granted on that web page.
165
+
166
+ 7. By copying, installing or otherwise using the software, Licensee
167
+ agrees to be bound by the terms and conditions of this License
168
+ Agreement.
169
+
170
+
171
+ CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
172
+ ---------------------------------------
173
+
174
+ 1. This LICENSE AGREEMENT is between the Corporation for National
175
+ Research Initiatives, having an office at 1895 Preston White Drive,
176
+ Reston, VA 20191 ("CNRI"), and the Individual or Organization
177
+ ("Licensee") accessing and otherwise using Python 1.6.1 software in
178
+ source or binary form and its associated documentation.
179
+
180
+ 2. Subject to the terms and conditions of this License Agreement, CNRI
181
+ hereby grants Licensee a nonexclusive, royalty-free, world-wide
182
+ license to reproduce, analyze, test, perform and/or display publicly,
183
+ prepare derivative works, distribute, and otherwise use Python 1.6.1
184
+ alone or in any derivative version, provided, however, that CNRI's
185
+ License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
186
+ 1995-2001 Corporation for National Research Initiatives; All Rights
187
+ Reserved" are retained in Python 1.6.1 alone or in any derivative
188
+ version prepared by Licensee. Alternately, in lieu of CNRI's License
189
+ Agreement, Licensee may substitute the following text (omitting the
190
+ quotes): "Python 1.6.1 is made available subject to the terms and
191
+ conditions in CNRI's License Agreement. This Agreement together with
192
+ Python 1.6.1 may be located on the internet using the following
193
+ unique, persistent identifier (known as a handle): 1895.22/1013. This
194
+ Agreement may also be obtained from a proxy server on the internet
195
+ using the following URL: http://hdl.handle.net/1895.22/1013".
196
+
197
+ 3. In the event Licensee prepares a derivative work that is based on
198
+ or incorporates Python 1.6.1 or any part thereof, and wants to make
199
+ the derivative work available to others as provided herein, then
200
+ Licensee hereby agrees to include in any such work a brief summary of
201
+ the changes made to Python 1.6.1.
202
+
203
+ 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
204
+ basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
205
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
206
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
207
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
208
+ INFRINGE ANY THIRD PARTY RIGHTS.
209
+
210
+ 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
211
+ 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
212
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
213
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
214
+
215
+ 6. This License Agreement will automatically terminate upon a material
216
+ breach of its terms and conditions.
217
+
218
+ 7. This License Agreement shall be governed by the federal
219
+ intellectual property law of the United States, including without
220
+ limitation the federal copyright law, and, to the extent such
221
+ U.S. federal law does not apply, by the law of the Commonwealth of
222
+ Virginia, excluding Virginia's conflict of law provisions.
223
+ Notwithstanding the foregoing, with regard to derivative works based
224
+ on Python 1.6.1 that incorporate non-separable material that was
225
+ previously distributed under the GNU General Public License (GPL), the
226
+ law of the Commonwealth of Virginia shall govern this License
227
+ Agreement only as to issues arising under or with respect to
228
+ Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
229
+ License Agreement shall be deemed to create any relationship of
230
+ agency, partnership, or joint venture between CNRI and Licensee. This
231
+ License Agreement does not grant permission to use CNRI trademarks or
232
+ trade name in a trademark sense to endorse or promote products or
233
+ services of Licensee, or any third party.
234
+
235
+ 8. By clicking on the "ACCEPT" button where indicated, or by copying,
236
+ installing or otherwise using Python 1.6.1, Licensee agrees to be
237
+ bound by the terms and conditions of this License Agreement.
238
+
239
+ ACCEPT
240
+
241
+
242
+ CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
243
+ --------------------------------------------------
244
+
245
+ Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
246
+ The Netherlands. All rights reserved.
247
+
248
+ Permission to use, copy, modify, and distribute this software and its
249
+ documentation for any purpose and without fee is hereby granted,
250
+ provided that the above copyright notice appear in all copies and that
251
+ both that copyright notice and this permission notice appear in
252
+ supporting documentation, and that the name of Stichting Mathematisch
253
+ Centrum or CWI not be used in advertising or publicity pertaining to
254
+ distribution of the software without specific, written prior
255
+ permission.
256
+
257
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
258
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
259
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
260
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
261
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
262
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
263
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
264
+
265
+ ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
266
+ ----------------------------------------------------------------------
267
+
268
+ Permission to use, copy, modify, and/or distribute this software for any
269
+ purpose with or without fee is hereby granted.
270
+
271
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
272
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
273
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
274
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
275
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
276
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
277
+ PERFORMANCE OF THIS SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,24 @@
1
+ # Licensing notice for sagebrush-web
2
+
3
+ This package bundles three components.
4
+
5
+ 1. **Sagebrush engines** (`sagebrush-engine.mjs`: Rust code from
6
+ github.com/sagemathinc/sagebrush compiled to WebAssembly).
7
+ Copyright (c) 2026 SageMath, Inc. **No license has been chosen yet,
8
+ so no rights are granted beyond viewing and running this package as
9
+ published.** A license, expected to be component-by-component, is
10
+ coming soon.
11
+
12
+ The a_p engine is a port of the genus-1 strategy of Andrew V. Sutherland's
13
+ smalljac, used with his permission (see `engine/ap/PROVENANCE.md` in the
14
+ repository).
15
+
16
+ 2. **pyparse** (`pyparse.mjs`): a Python 3.14 parser generated from CPython's
17
+ `Grammar/python.gram`, `Grammar/Tokens` and `Parser/Python.asdl`, with
18
+ TypeScript ports of parts of CPython's `Parser/` directory. These
19
+ portions are derived from CPython, Copyright (c) 2001 Python Software
20
+ Foundation, and are distributed under the PSF License Agreement; see
21
+ `LICENSE-CPython.txt`. The Unicode character-name table, when used, is
22
+ generated from Python's `unicodedata`.
23
+
24
+ 3. Generated glue code: the same terms as (1).
package/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Single-file ES modules for browsers and chat artifacts
2
+
3
+ Published to npm as **`sagebrush-web`** and served by jsdelivr (`/npm/` is
4
+ the only jsdelivr path Claude's artifact sandbox allows; `/gh/<repo>@<commit>/cdn/`
5
+ also works elsewhere):
6
+
7
+ ```js
8
+ const sb = await import("https://cdn.jsdelivr.net/npm/sagebrush-web@0.1.0/sagebrush-engine.mjs");
9
+ const py = await import("https://cdn.jsdelivr.net/npm/sagebrush-web@0.1.0/pyparse.mjs");
10
+ sb.charpoly({ n: 1, k: 12, q: 2, sign: 1 }); // proven, over Z[zeta_m]
11
+ py.parse("x = [1, 2 3]\n"); // throws CPython's SyntaxError
12
+ ```
13
+
14
+ | File | Raw | Gzipped (as served) | What |
15
+ |---|---|---|---|
16
+ | `sagebrush-engine.mjs` | 549 KB | 208 KB | the Rust engines (`engine/web`, wasm32) inlined as base64 |
17
+ | `pyparse.mjs` | 227 KB | 33 KB | CPython 3.14's parser (`pyparse/`) |
18
+
19
+ Why this shape: in the October 2026 smoke test, Claude's artifact sandbox
20
+ blocked `fetch()` to every CDN and `import()` from esm.sh, but allowed
21
+ `import()` from cdn.jsdelivr.net and `<script>` from cdnjs. ChatGPT allowed
22
+ more. WebAssembly from inline bytes worked in both; cross-origin isolation
23
+ (WASM threads) in neither. So the engines are single-threaded and ship
24
+ inside the JS module. Rebuild with `node cdn/build.mjs`; publish with
25
+ `bash cdn/publish.sh` (bump `version` in package.json first). Licensing:
26
+ see `NOTICE.md` (no license for Sagebrush's own code yet; the pyparse parts
27
+ derived from CPython are PSF-2.0).
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "sagebrush-web",
3
+ "version": "0.1.0",
4
+ "description": "Sagebrush engines (Rust -> WebAssembly, single-file ES modules) and CPython's parser in TypeScript, for browsers and chat artifacts",
5
+ "type": "module",
6
+ "exports": {
7
+ "./engine": "./sagebrush-engine.mjs",
8
+ "./pyparse": "./pyparse.mjs"
9
+ },
10
+ "files": [
11
+ "sagebrush-engine.mjs",
12
+ "pyparse.mjs",
13
+ "README.md",
14
+ "NOTICE.md",
15
+ "LICENSE-CPython.txt"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/sagemathinc/sagebrush.git",
20
+ "directory": "cdn"
21
+ },
22
+ "homepage": "https://github.com/sagemathinc/sagebrush/tree/main/cdn",
23
+ "license": "SEE LICENSE IN NOTICE.md",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ }
27
+ }