riteshjs 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jarrod Baumann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,69 @@
1
- # Temporary Holding Version
1
+ # ritesh
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `rite` is a shell for the browser, built on [xterm.js](https://xtermjs.org). Embed it in a page, give it your own files and commands, and optionally connect it to a server.
4
+
5
+ rite has its own small language: quoting, `|`, `&&`, `||`, `;`, redirects into an in-memory filesystem, `$VARS`, globs, and aliases. It is not bash; see [docs/language.md](https://github.com/jarrodb/ritesh/blob/master/docs/language.md).
6
+
7
+ > Status: in development. Not published yet.
8
+
9
+ ## Use
10
+
11
+ ```sh
12
+ npm install riteshjs
13
+ ```
14
+
15
+ ```ts
16
+ import { createRite, defineCommand } from "riteshjs"
17
+ import "riteshjs/rite.css"
18
+
19
+ const hello = defineCommand({
20
+ name: "hello",
21
+ summary: "say hello",
22
+ usage: "hello [name]",
23
+ run: async (p) => { await p.out(`hello, ${p.args[0] ?? "world"}\n`) },
24
+ })
25
+
26
+ createRite({
27
+ element: document.getElementById("term")!,
28
+ hostname: "example",
29
+ motd: "type help",
30
+ files: { "/home/guest/about.txt": "about this site\n" },
31
+ commands: [hello],
32
+ })
33
+ ```
34
+
35
+ From a CDN, with no build step:
36
+
37
+ ```html
38
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/riteshjs@VERSION/dist/rite.css">
39
+ <script src="https://cdn.jsdelivr.net/npm/riteshjs@VERSION/dist/rite.bundle.min.js"></script>
40
+ <script>Rite.createRite({ element: document.getElementById("term") })</script>
41
+ ```
42
+
43
+ Release notes list the SRI hashes for each version.
44
+
45
+ ## Server
46
+
47
+ `github.com/jarrodb/ritesh/server` serves a read-only filesystem and commands to rite over the [rite.1 protocol](https://github.com/jarrodb/ritesh/blob/master/docs/protocol.md).
48
+
49
+ ```mermaid
50
+ flowchart LR
51
+ page[page with rite] <-->|WebSocket, rite.1| server[ritesh/server]
52
+ server --> fs[fs.FS]
53
+ server --> cmds[commands]
54
+ ```
55
+
56
+ ## Develop
57
+
58
+ ```sh
59
+ npm ci
60
+ npm run build
61
+ npm run lint
62
+ npm test
63
+ npm run check:package
64
+ (cd server && go test -race ./...)
65
+ ```
66
+
67
+ ## License
68
+
69
+ MIT. See [LICENSE](https://github.com/jarrodb/ritesh/blob/master/LICENSE). The bundle includes xterm.js; see [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES).
@@ -0,0 +1,337 @@
1
+ ritesh bundles the following third-party software in dist/. The net and jq add-ons (dist/net.js, dist/jq-worker.js, dist/jq.wasm) carry ipaddr.js, jq-wasm, and jq.
2
+
3
+ ================================================================
4
+ @xterm/xterm 6.0.0
5
+ https://github.com/xtermjs/xterm.js
6
+ ================================================================
7
+
8
+ Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
9
+ Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)
10
+ Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in
20
+ all copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ THE SOFTWARE.
29
+
30
+ ================================================================
31
+ @xterm/addon-fit 0.11.0
32
+ https://github.com/xtermjs/xterm.js
33
+ ================================================================
34
+
35
+ Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy
38
+ of this software and associated documentation files (the "Software"), to deal
39
+ in the Software without restriction, including without limitation the rights
40
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
+ copies of the Software, and to permit persons to whom the Software is
42
+ furnished to do so, subject to the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be included in
45
+ all copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
53
+ THE SOFTWARE.
54
+
55
+ ================================================================
56
+ @xterm/addon-unicode11 0.9.0
57
+ https://github.com/xtermjs/xterm.js
58
+ ================================================================
59
+
60
+ Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
61
+
62
+ Permission is hereby granted, free of charge, to any person obtaining a copy
63
+ of this software and associated documentation files (the "Software"), to deal
64
+ in the Software without restriction, including without limitation the rights
65
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
+ copies of the Software, and to permit persons to whom the Software is
67
+ furnished to do so, subject to the following conditions:
68
+
69
+ The above copyright notice and this permission notice shall be included in
70
+ all copies or substantial portions of the Software.
71
+
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78
+ THE SOFTWARE.
79
+
80
+ ================================================================
81
+ @xterm/addon-web-links 0.12.0
82
+ https://github.com/xtermjs/xterm.js
83
+ ================================================================
84
+
85
+ Copyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js)
86
+
87
+ Permission is hereby granted, free of charge, to any person obtaining a copy
88
+ of this software and associated documentation files (the "Software"), to deal
89
+ in the Software without restriction, including without limitation the rights
90
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
91
+ copies of the Software, and to permit persons to whom the Software is
92
+ furnished to do so, subject to the following conditions:
93
+
94
+ The above copyright notice and this permission notice shall be included in
95
+ all copies or substantial portions of the Software.
96
+
97
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
99
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
101
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
102
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
103
+ THE SOFTWARE.
104
+
105
+
106
+ ================================================================
107
+ ipaddr.js 2.5.0
108
+ https://github.com/whitequark/ipaddr.js
109
+ ================================================================
110
+
111
+
112
+ Copyright (C) 2011-2017 whitequark <whitequark@whitequark.org>
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining a copy
115
+ of this software and associated documentation files (the "Software"), to deal
116
+ in the Software without restriction, including without limitation the rights
117
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in
122
+ all copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
130
+ THE SOFTWARE.
131
+
132
+ ================================================================
133
+ jq-wasm 3.0.0-jq-1.8.2 (in dist/jq-worker.js)
134
+ https://github.com/owenthereal/jq-wasm
135
+ ================================================================
136
+
137
+ Copyright (c) 2024 Owen Ou
138
+
139
+ Permission is hereby granted, free of charge, to any person obtaining a copy
140
+ of this software and associated documentation files (the "Software"), to deal
141
+ in the Software without restriction, including without limitation the rights
142
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
143
+ copies of the Software, and to permit persons to whom the Software is
144
+ furnished to do so, subject to the following conditions:
145
+
146
+ The above copyright notice and this permission notice shall be included in all
147
+ copies or substantial portions of the Software.
148
+
149
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
150
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
151
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
152
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
153
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
154
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
155
+ SOFTWARE.
156
+
157
+ ================================================================
158
+ jq 1.8.2 (dist/jq.wasm), with the libraries compiled into it
159
+ https://github.com/jqlang/jq (COPYING)
160
+ ================================================================
161
+
162
+ jq is copyright (C) 2012 Stephen Dolan
163
+
164
+ Permission is hereby granted, free of charge, to any person obtaining
165
+ a copy of this software and associated documentation files (the
166
+ "Software"), to deal in the Software without restriction, including
167
+ without limitation the rights to use, copy, modify, merge, publish,
168
+ distribute, sublicense, and/or sell copies of the Software, and to
169
+ permit persons to whom the Software is furnished to do so, subject to
170
+ the following conditions:
171
+
172
+ The above copyright notice and this permission notice shall be
173
+ included in all copies or substantial portions of the Software.
174
+
175
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
176
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
177
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
178
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
179
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
180
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
181
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
182
+
183
+
184
+
185
+ jq's documentation (everything found under the docs/ subdirectory in
186
+ the source tree) is licensed under the Creative Commons CC BY 3.0
187
+ license, which can be found at:
188
+
189
+ https://creativecommons.org/licenses/by/3.0/
190
+
191
+ The documentation website includes a copy of Twitter's Bootstrap and
192
+ relies on Bonsai, Liquid templates and various other projects, look
193
+ them up for detailed licensing conditions.
194
+
195
+
196
+
197
+ jq incorporates David M. Gay's dtoa.c and g_fmt.c, which bear the
198
+ following notices:
199
+
200
+ dtoa.c:
201
+ The author of this software is David M. Gay.
202
+
203
+ Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
204
+
205
+ Permission to use, copy, modify, and distribute this software for any
206
+ purpose without fee is hereby granted, provided that this entire notice
207
+ is included in all copies of any software which is or includes a copy
208
+ or modification of this software and in all copies of the supporting
209
+ documentation for such software.
210
+
211
+ THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
212
+ WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
213
+ REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
214
+ OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
215
+
216
+ g_fmt.c:
217
+ The author of this software is David M. Gay.
218
+
219
+ Copyright (c) 1991, 1996 by Lucent Technologies.
220
+
221
+ Permission to use, copy, modify, and distribute this software for any
222
+ purpose without fee is hereby granted, provided that this entire notice
223
+ is included in all copies of any software which is or includes a copy
224
+ or modification of this software and in all copies of the supporting
225
+ documentation for such software.
226
+
227
+ THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
228
+ WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
229
+ REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
230
+ OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
231
+
232
+
233
+
234
+ jq uses parts of the open source C library "decNumber", which is distributed
235
+ under the following license:
236
+
237
+
238
+ ICU License - ICU 1.8.1 and later
239
+
240
+ COPYRIGHT AND PERMISSION NOTICE
241
+
242
+ Copyright (c) 1995-2005 International Business Machines Corporation and others
243
+ All rights reserved.
244
+
245
+ Permission is hereby granted, free of charge, to any person obtaining a
246
+ copy of this software and associated documentation files (the
247
+ "Software"), to deal in the Software without restriction, including
248
+ without limitation the rights to use, copy, modify, merge, publish,
249
+ distribute, and/or sell copies of the Software, and to permit persons
250
+ to whom the Software is furnished to do so, provided that the above
251
+ copyright notice(s) and this permission notice appear in all copies of
252
+ the Software and that both the above copyright notice(s) and this
253
+ permission notice appear in supporting documentation.
254
+
255
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
256
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
257
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
258
+ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
259
+ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
260
+ INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
261
+ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
262
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
263
+ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
264
+
265
+ Except as contained in this notice, the name of a copyright holder
266
+ shall not be used in advertising or otherwise to promote the sale, use
267
+ or other dealings in this Software without prior written authorization
268
+ of the copyright holder.
269
+
270
+ --------------------------------------------------------------------------------
271
+ All trademarks and registered trademarks mentioned herein are the property of their respective owners.
272
+
273
+
274
+
275
+ jv_thread.h is copied from Heimdal's lib/base/heimbase.h and some code
276
+ in jv.c is copied from Heimdal's lib/base/dll.c:
277
+
278
+
279
+ Portions Copyright (c) 2016 Kungliga Tekniska Högskolan
280
+ (Royal Institute of Technology, Stockholm, Sweden).
281
+ All rights reserved.
282
+
283
+ Redistribution and use in source and binary forms, with or without
284
+ modification, are permitted provided that the following conditions
285
+ are met:
286
+
287
+ 1. Redistributions of source code must retain the above copyright
288
+ notice, this list of conditions and the following disclaimer.
289
+
290
+ 2. Redistributions in binary form must reproduce the above copyright
291
+ notice, this list of conditions and the following disclaimer in the
292
+ documentation and/or other materials provided with the distribution.
293
+
294
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
295
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
296
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
297
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
298
+ COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
299
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
300
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
301
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
302
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
303
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
304
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
305
+ OF THE POSSIBILITY OF SUCH DAMAGE.
306
+
307
+
308
+
309
+ jq uses a modified version of NetBSD implementation strptime(),
310
+ which is distributed under the following license:
311
+
312
+ Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
313
+ All rights reserved.
314
+
315
+ This code was contributed to The NetBSD Foundation by Klaus Klein.
316
+ Heavily optimised by David Laight
317
+
318
+ Redistribution and use in source and binary forms, with or without
319
+ modification, are permitted provided that the following conditions
320
+ are met:
321
+ 1. Redistributions of source code must retain the above copyright
322
+ notice, this list of conditions and the following disclaimer.
323
+ 2. Redistributions in binary form must reproduce the above copyright
324
+ notice, this list of conditions and the following disclaimer in the
325
+ documentation and/or other materials provided with the distribution.
326
+
327
+ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
328
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
329
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
330
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
331
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
332
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
333
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
334
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
335
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
336
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
337
+ POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,65 @@
1
+ /*! ritesh | MIT | Copyright (c) 2026 Jarrod Baumann | bundles xterm.js and ipaddr.js (MIT, see THIRD_PARTY_NOTICES) */
2
+ // src/contracts.ts
3
+ const ERRNOS = [
4
+ "ENOENT",
5
+ "ENOTDIR",
6
+ "EISDIR",
7
+ "EACCES",
8
+ "EPERM",
9
+ "EEXIST",
10
+ "ENOTEMPTY",
11
+ "EROFS",
12
+ "ELOOP",
13
+ "EINVAL",
14
+ "ENOTSUP",
15
+ "ENOSPC",
16
+ "EIO",
17
+ "EPIPE",
18
+ "ECANCELED",
19
+ "ETIMEDOUT",
20
+ "ENOTCONN"
21
+ ];
22
+ const ERRNO_MESSAGES = {
23
+ ENOENT: "no such file or directory",
24
+ ENOTDIR: "not a directory",
25
+ EISDIR: "is a directory",
26
+ EACCES: "permission denied",
27
+ EPERM: "operation not permitted",
28
+ EEXIST: "file exists",
29
+ ENOTEMPTY: "directory not empty",
30
+ EROFS: "read-only file system",
31
+ ELOOP: "too many levels of symbolic links",
32
+ EINVAL: "invalid argument",
33
+ ENOTSUP: "operation not supported",
34
+ ENOSPC: "no space left on device",
35
+ EIO: "input/output error",
36
+ EPIPE: "broken pipe",
37
+ ECANCELED: "operation canceled",
38
+ ETIMEDOUT: "operation timed out",
39
+ ENOTCONN: "transport endpoint is not connected"
40
+ };
41
+ /** The one error type that crosses module boundaries. */
42
+ var RiteError = class extends Error {
43
+ errno;
44
+ path;
45
+ constructor(errno, path, message) {
46
+ super(message ?? ERRNO_MESSAGES[errno]);
47
+ this.name = "RiteError";
48
+ this.errno = errno;
49
+ this.path = path;
50
+ }
51
+ };
52
+ /** Exit codes with fixed meanings (docs/language.md). Others are 0-255. */
53
+ const EXIT = {
54
+ OK: 0,
55
+ FAILURE: 1,
56
+ USAGE: 2,
57
+ NOT_EXECUTABLE: 126,
58
+ NOT_FOUND: 127,
59
+ INTERRUPTED: 130,
60
+ CONNECTION_LOST: 255
61
+ };
62
+ const PASS = Symbol("rite.pass");
63
+ export { RiteError as a, PASS as i, ERRNO_MESSAGES as n, EXIT as r, ERRNOS as t };
64
+
65
+ //# sourceMappingURL=contracts-0hnYHcIF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts-0hnYHcIF.js","names":[],"sources":["../src/contracts.ts"],"sourcesContent":["// Cross-module contracts. Every module talks to every other through these\n// types. They are frozen for each implementation wave: a unit that finds a\n// gap reports it instead of editing this file.\n\n// ---------------------------------------------------------------- errors\n\nexport const ERRNOS = [\n \"ENOENT\", \"ENOTDIR\", \"EISDIR\", \"EACCES\", \"EPERM\", \"EEXIST\", \"ENOTEMPTY\",\n \"EROFS\", \"ELOOP\", \"EINVAL\", \"ENOTSUP\", \"ENOSPC\", \"EIO\", \"EPIPE\",\n \"ECANCELED\", \"ETIMEDOUT\", \"ENOTCONN\",\n] as const\nexport type Errno = (typeof ERRNOS)[number]\n\nexport const ERRNO_MESSAGES: Record<Errno, string> = {\n ENOENT: \"no such file or directory\",\n ENOTDIR: \"not a directory\",\n EISDIR: \"is a directory\",\n EACCES: \"permission denied\",\n EPERM: \"operation not permitted\",\n EEXIST: \"file exists\",\n ENOTEMPTY: \"directory not empty\",\n EROFS: \"read-only file system\",\n ELOOP: \"too many levels of symbolic links\",\n EINVAL: \"invalid argument\",\n ENOTSUP: \"operation not supported\",\n ENOSPC: \"no space left on device\",\n EIO: \"input/output error\",\n EPIPE: \"broken pipe\",\n ECANCELED: \"operation canceled\",\n ETIMEDOUT: \"operation timed out\",\n ENOTCONN: \"transport endpoint is not connected\",\n}\n\n/** The one error type that crosses module boundaries. */\nexport class RiteError extends Error {\n readonly errno: Errno\n readonly path: string | undefined\n constructor(errno: Errno, path?: string, message?: string) {\n super(message ?? ERRNO_MESSAGES[errno])\n this.name = \"RiteError\"\n this.errno = errno\n this.path = path\n }\n}\n\n/** Exit codes with fixed meanings (docs/language.md). Others are 0-255. */\nexport const EXIT = {\n OK: 0,\n FAILURE: 1,\n USAGE: 2,\n NOT_EXECUTABLE: 126,\n NOT_FOUND: 127,\n INTERRUPTED: 130,\n CONNECTION_LOST: 255,\n} as const\n\n// ---------------------------------------------------------------- parser\n\nexport type TokenKind =\n | \"word\" | \"operator\" | \"redirect\" | \"comment\" | \"whitespace\" | \"reserved\"\n\n/** [start, end) offsets into the source line, in UTF-16 code units. */\nexport type Span = readonly [start: number, end: number]\n\nexport interface Token {\n kind: TokenKind\n text: string\n span: Span\n}\n\n/** One piece of a word, before expansion. */\nexport type WordPart =\n | { kind: \"literal\"; text: string; quoted: boolean }\n | { kind: \"param\"; name: string; quoted: boolean }\n | { kind: \"tilde\"; text: string }\n | { kind: \"glob\"; text: string }\n\nexport interface Word {\n parts: WordPart[]\n span: Span\n}\n\nexport type RedirectOp = \">\" | \">>\" | \"<\" | \"2>\" | \"2>>\" | \"2>&1\" | \">&2\"\n\nexport interface Redirect {\n op: RedirectOp\n /** Absent for the duplication forms 2>&1 and >&2. */\n target?: Word\n span: Span\n}\n\nexport interface Assignment {\n name: string\n value: Word\n span: Span\n}\n\nexport interface SimpleCommand {\n type: \"command\"\n assignments: Assignment[]\n words: Word[]\n redirects: Redirect[]\n span: Span\n}\n\nexport interface Pipeline {\n type: \"pipeline\"\n commands: SimpleCommand[]\n span: Span\n}\n\nexport interface List {\n type: \"list\"\n /** First pipeline, then (operator, pipeline) pairs, left-associative. */\n first: Pipeline\n rest: Array<{ op: \";\" | \"&&\" | \"||\"; pipeline: Pipeline }>\n span: Span\n}\n\nexport type ParseResult =\n | { ok: true; ast: List | null; tokens: Token[] }\n | { ok: false; incomplete: true; tokens: Token[] }\n | { ok: false; incomplete: false; error: SyntaxErrorInfo; tokens: Token[] }\n\nexport interface SyntaxErrorInfo {\n message: string\n span: Span\n}\n\nexport interface ParseOptions {\n /** Returns an alias body for a name in command position, if defined. */\n alias?: (name: string) => string | undefined\n}\n\nexport interface Parser {\n parse(line: string, options?: ParseOptions): ParseResult\n /** Tokens only, for highlighting. Never throws. */\n tokenize(line: string): Token[]\n /** Quote a value so it parses back as one literal word. */\n quoteWord(value: string, context: \"bare\" | \"double\" | \"single\"): string\n /** The version string printed in \"not supported in rite <version>\". */\n readonly version: string\n}\n\n// ---------------------------------------------------------------- vfs\n\nexport type InodeType = \"dir\" | \"file\" | \"cmd\" | \"link\" | \"action\" | \"dev\"\n\nexport interface Stat {\n type: InodeType\n /** Permission bits, e.g. 0o755. */\n mode: number\n uid: number\n gid: number\n size: number\n /** Milliseconds since the epoch. */\n mtime: number\n /** Set when the path is inside a mount. */\n mount?: string\n}\n\nexport interface Entry {\n name: string\n type: InodeType\n}\n\nexport type ActionDef =\n | { navigate: string }\n | { open: string }\n | { event: string; detail?: unknown }\n | { print: string }\n\nexport type ActionVia = \"cd\" | \"open\" | \"cat\"\n\nexport interface ActionEvent {\n kind: \"navigate\" | \"open\" | \"event\" | \"print\"\n path: string\n via: ActionVia\n href?: string\n url?: string\n name?: string\n detail?: unknown\n /** The host calls this to stop rite's default handling. */\n preventDefault(): void\n readonly defaultPrevented: boolean\n}\n\nexport interface ActionResult {\n event: ActionEvent\n /** Text the command prints (print actions, or the URL when a popup is blocked). */\n output?: string\n}\n\nexport type FileContent = string | (() => string | Promise<string>)\n\nexport type InodeSpec =\n | { type: \"dir\"; mode?: number; uid?: number }\n | { type: \"file\"; content: FileContent; mode?: number; uid?: number }\n | { type: \"cmd\"; command: CommandDef; mode?: number }\n | { type: \"link\"; target: string }\n | { type: \"action\"; action: ActionDef; mode?: number }\n | { type: \"dev\"; read?: () => string; write?: (data: string) => void; mode?: number }\n\n/** What the editor may read synchronously from the vfs cache. */\nexport interface Inode {\n type: InodeType\n mode: number\n uid: number\n /** Present for cmd inodes. */\n command?: CommandInfo\n}\n\nexport interface CallOptions {\n signal?: AbortSignal\n}\n\nexport interface WriteOptions extends CallOptions {\n mode: \"truncate\" | \"append\"\n}\n\n/**\n * Paths given to the vfs are absolute or relative to `cwd`. Tilde is a\n * kernel expansion and never reaches the vfs. `..` resolves lexically.\n */\nexport interface Vfs {\n stat(path: string, cwd: string, o?: CallOptions): Promise<Stat>\n list(path: string, cwd: string, o?: CallOptions): Promise<Entry[]>\n read(path: string, cwd: string, o?: CallOptions): Promise<string>\n write(path: string, cwd: string, data: string, o: WriteOptions): Promise<void>\n mkdir(path: string, cwd: string, o?: CallOptions & { parents?: boolean }): Promise<void>\n remove(path: string, cwd: string, o?: CallOptions & { recursive?: boolean }): Promise<void>\n /** Only cd, open, and cat call this. stat and list never trigger actions. */\n activate(path: string, cwd: string, via: ActionVia): Promise<ActionResult | null>\n /** Absolute, normalized path. Does not check existence. */\n resolve(path: string, cwd: string): string\n /** Cache only, synchronous, never does I/O. The editor uses only this. */\n peek(path: string, cwd: string): Inode | undefined\n /** Create or replace an inode (host setup and kernel use). */\n put(path: string, spec: InodeSpec): void\n mount(path: string, provider: MountProvider): void\n unmount(path: string): void\n /** Permission check for the given uid: r, w, or x. Root bypasses. */\n access(path: string, cwd: string, uid: number, want: \"r\" | \"w\" | \"x\"): Promise<boolean>\n}\n\n/** A subtree served by a host object or a remote server. Paths are relative to the mount root, \"\" is the root. */\nexport interface MountProvider {\n readonly readonly: boolean\n stat(rel: string, o: CallOptions): Promise<Stat>\n list(rel: string, o: CallOptions): Promise<Entry[]>\n read(rel: string, o: CallOptions): Promise<string>\n write?(rel: string, data: string, o: WriteOptions): Promise<void>\n mkdir?(rel: string, o: CallOptions): Promise<void>\n remove?(rel: string, o: CallOptions): Promise<void>\n /** Called with a relative path when something under the mount changes. Returns an unsubscribe. */\n watch?(onChange: (rel: string) => void): () => void\n}\n\n// ---------------------------------------------------------------- processes\n\nexport type Env = Record<string, string>\n\nexport interface Tty {\n readonly cols: number\n readonly rows: number\n /** Read one line from the terminal. echo:false for passwords. Never recorded in history. */\n read(options?: { echo?: boolean; prompt?: string; signal?: AbortSignal }): Promise<string | null>\n /** Unfiltered output. Local commands only (clear, egg animations). */\n raw(data: string): Promise<void>\n}\n\nexport type StdioKind = \"tty\" | \"pipe\" | \"file\" | \"null\"\n\nexport interface Stdio {\n stdin: StdioKind\n stdout: StdioKind\n stderr: StdioKind\n}\n\nexport type FlagValue = boolean | string | number | Array<string | number>\nexport type Flags = Record<string, FlagValue | undefined>\n\nexport interface Proc {\n /** argv[0] is the name the command was invoked by. */\n readonly argv: readonly string[]\n /** Parsed flags, keyed by the long name when one exists, else the short name. */\n readonly flags: Flags\n /** Operands after flag parsing; argv.slice(1) when the command declares no flags. */\n readonly args: readonly string[]\n /** The resolved subcommand path, e.g. [\"devices\", \"ls\"]. Empty when none. */\n readonly subcommand: readonly string[]\n readonly stdin: ReadableStream<string>\n readonly stdout: WritableStream<string>\n readonly stderr: WritableStream<string>\n /** Write to stdout or stderr; resolves when the sink accepted the chunk. Commands write \"\\n\". */\n out(text: string): Promise<void>\n err(text: string): Promise<void>\n /** stdin split into lines, without terminators. */\n lines(): AsyncIterable<string>\n readonly env: Readonly<Env>\n readonly cwd: string\n readonly uid: number\n readonly fs: Vfs\n /** Aborted on ^C (reason \"INT\") or when a downstream reader exits (reason \"EPIPE\"). */\n readonly signal: AbortSignal\n /** Null when stdout is not the terminal. */\n readonly tty: Tty | null\n readonly stdio: Stdio\n readonly sys: Sys\n}\n\n/** A command's body. void means exit 0. A throw is exit 1 with one stderr line. */\nexport type Run = (p: Proc) => Promise<number | void>\n\nexport type Resolution =\n | { kind: \"alias\"; name: string; body: string }\n | { kind: \"builtin\"; name: string; info: CommandInfo }\n | { kind: \"command\"; name: string; path: string; info: CommandInfo }\n | { kind: \"egg\"; name: string; id: string }\n | { kind: \"not-found\"; name: string }\n\nexport interface SessionView {\n readonly user: string\n readonly uid: number\n readonly cwd: string\n readonly hostname: string\n readonly home: string\n readonly lastStatus: number\n}\n\n/** The kernel facade a command may use. */\nexport interface Sys {\n resolve(name: string): Resolution\n commands(): CommandInfo[]\n /** Run argv as a child. stdio defaults to the caller's. */\n spawn(argv: readonly string[], options?: { uid?: number; env?: Env; stdio?: Partial<StdioStreams> }): Promise<number>\n /** Run a full line (rite -c, source). */\n run(line: string, options?: { env?: Env }): Promise<number>\n readonly session: SessionView\n /** Host configuration for sudo. */\n readonly sudo: SudoPolicy\n history(): readonly string[]\n}\n\nexport interface StdioStreams {\n stdin: ReadableStream<string>\n stdout: WritableStream<string>\n stderr: WritableStream<string>\n}\n\nexport type SudoPolicy = boolean | ((password: string) => boolean | Promise<boolean>)\n\n/** Builtins also receive the mutable session. In a pipeline the changes do not persist. */\nexport interface Session {\n user: string\n uid: number\n cwd: string\n oldCwd: string\n hostname: string\n home: string\n env: Env\n /** Names exported to child processes. */\n exported: Set<string>\n aliases: Map<string, string>\n lastStatus: number\n /** Set by the exit builtin. */\n exitRequested: number | null\n}\n\nexport type BuiltinRun = (p: Proc, session: Session) => Promise<number | void>\n\n// ---------------------------------------------------------------- commands\n\nexport interface FlagDef {\n long?: string\n short?: string\n type: \"boolean\" | \"string\" | \"number\"\n /** Repeatable flags collect into an array. */\n repeat?: boolean\n default?: FlagValue\n description?: string\n}\n\nexport interface Candidate {\n value: string\n display?: string\n description?: string\n /** Appended after insertion: \" \" by default, \"/\" for directories, \"\" to keep typing. */\n suffix?: string\n}\n\nexport interface CompleteContext {\n argv: readonly string[]\n /** Index into argv of the word being completed. */\n index: number\n prefix: string\n env: Readonly<Env>\n cwd: string\n fs: Vfs\n signal: AbortSignal\n}\n\nexport type Completer = (ctx: CompleteContext) => Promise<Candidate[]>\n\nexport interface CommandDef {\n name: string\n summary: string\n usage: string\n /** Keyed by the canonical name (long when present). Omit to receive raw argv. */\n flags?: Record<string, FlagDef>\n subcommands?: Record<string, Omit<CommandDef, \"name\">>\n complete?: Completer\n run?: Run\n /** Longer text for man. */\n manual?: string\n}\n\nexport interface CommandInfo {\n name: string\n summary: string\n usage: string\n /** Longer text for man, when the definition has one. */\n manual?: string\n flags?: Record<string, FlagDef>\n subcommands?: Record<string, { summary: string; usage: string }>\n builtin: boolean\n remote: boolean\n}\n\n/** Supplies commands from outside the vfs tree (the remote client). */\nexport interface CommandSource {\n /** Names known before connecting, so completion and which work early. */\n names(): string[]\n info(name: string): CommandInfo | undefined\n run(name: string, p: Proc): Promise<number>\n complete?(argv: readonly string[], index: number, signal: AbortSignal): Promise<Candidate[]>\n}\n\n// ---------------------------------------------------------------- eggs\n\nexport const PASS: unique symbol = Symbol(\"rite.pass\")\nexport type EggResult = number | void | typeof PASS\n\nexport type EggTrigger =\n | { command: string; when?: (argv: readonly string[], session: SessionView) => boolean }\n | { input: RegExp }\n | { keys: string }\n\nexport interface EggDef {\n id: string\n trigger: EggTrigger\n run: (p: Proc) => Promise<EggResult>\n}\n\n// ---------------------------------------------------------------- completion\n\nexport interface Completion {\n /** The span of the line the candidates replace. */\n span: Span\n candidates: Candidate[]\n}\n\n// ---------------------------------------------------------------- terminal\n\nexport type OutputPolicy = \"plain\" | \"sgr\" | \"raw\"\n\nexport interface TermSize {\n cols: number\n rows: number\n}\n\n/** The only boundary to xterm. The editor renders through it; tests back it with @xterm/headless. */\nexport interface Term {\n /**\n * Write complete text with a policy; resolves once xterm has parsed it.\n * \"\\n\" becomes \"\\r\\n\". Each call is filtered on its own: an escape\n * sequence cut off at the end of the data is dropped.\n */\n write(data: string, policy: OutputPolicy): Promise<void>\n /**\n * A writer for one stream (a process's stdout): its filter keeps an escape\n * sequence split across chunks until it completes, apart from every other\n * writer.\n */\n writer(policy: OutputPolicy): (chunk: string) => Promise<void>\n /** Key input, already decoded into strings, terminal replies discarded. Returns an unsubscribe. */\n onInput(listener: (data: string) => void): () => void\n onResize(listener: (size: TermSize) => void): () => void\n readonly size: TermSize\n /** Replace the terminal's colors (xterm ITheme keys). */\n setTheme(theme: Theme): void\n /** Display width of one code point: 0, 1, or 2. */\n width(codePoint: number): 0 | 1 | 2\n focus(): void\n fit(): void\n dispose(): void\n}\n\n// ---------------------------------------------------------------- kernel\n\nexport interface Kernel {\n readonly session: SessionView\n /** Run one line as if typed. Queued behind any running job. */\n exec(line: string, stdio?: Partial<StdioStreams>): Promise<number>\n /** Run one egg directly (a key trigger), queued like a line. */\n runEgg(egg: EggDef): Promise<number>\n complete(line: string, cursor: number, o: { signal: AbortSignal }): Promise<Completion>\n /** Abort the foreground job (^C). */\n interrupt(): void\n readonly running: boolean\n register(def: CommandDef, at?: string): void\n registerEgg(def: EggDef): void\n /** Eggs with key triggers, for the editor. */\n keyEggs(): readonly EggDef[]\n addCommandSource(at: string, source: CommandSource): void\n readonly vfs: Vfs\n readonly parser: Parser\n}\n\n// ---------------------------------------------------------------- host\n\nexport type HistoryMode = \"local\" | \"memory\" | false\n\n/** Terminal colors: xterm's ITheme keys (strings, and extendedAnsi as a list). */\nexport interface Theme {\n [key: string]: string | readonly string[] | undefined\n extendedAnsi?: readonly string[]\n}\n\nexport interface HostOptions {\n element: HTMLElement\n hostname?: string\n user?: string\n /** Printed before the first prompt; SGR colors are kept, every other escape sequence is dropped. */\n motd?: string\n files?: Record<string, FileContent>\n inodes?: Record<string, InodeSpec>\n mounts?: Array<{ path: string; provider: MountProvider }>\n commands?: CommandDef[]\n eggs?: EggDef[] | false\n remote?: RemoteHandle\n sudo?: SudoPolicy\n history?: HistoryMode\n /** xterm ITheme keys; `themes` has brass, tide, dusk (dark) and paper (light) ready-made. */\n theme?: Theme\n /** The terminal's font. Load web fonts before createRite so the cell size is measured right. */\n font?: { family?: string; size?: number }\n screenReaderMode?: boolean\n onAction?: (e: ActionEvent) => void\n}\n\n/** What rite/remote hands to createRite. Core never imports the remote module. */\nexport interface RemoteHandle {\n readonly at: string\n readonly bin: string\n readonly provider: MountProvider\n readonly commands: CommandSource\n connect(): Promise<void>\n /** The terminal's size changed: tell the server (tty.resize) if connected. */\n resize(cols: number, rows: number): void\n dispose(): void\n onNotify(listener: (text: string, level: \"info\" | \"warn\" | \"error\") => void): () => void\n}\n\nexport interface Rite {\n readonly ready: Promise<void>\n exec(line: string): Promise<{ code: number }>\n print(text: string): void\n focus(): void\n fit(): void\n /** The terminal's size in cells. */\n readonly size: TermSize\n /** Called after the terminal changes size (a fit, a resize). Returns an unsubscribe. */\n onResize(listener: (size: TermSize) => void): () => void\n /** Replace the terminal's colors, such as `themes.paper`. */\n setTheme(theme: Theme): void\n dispose(): void\n}\n"],"mappings":";;AAMA,MAAa,SAAS;CACpB;CAAU;CAAW;CAAU;CAAU;CAAS;CAAU;CAC5D;CAAS;CAAS;CAAU;CAAW;CAAU;CAAO;CACxD;CAAa;CAAa;AAC5B;AAGA,MAAa,iBAAwC;CACnD,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,KAAK;CACL,OAAO;CACP,WAAW;CACX,WAAW;CACX,UAAU;AACZ;;AAGA,IAAa,YAAb,cAA+B,MAAM;CAC1B;CACA;CACT,YAAY,OAAc,MAAe,SAAkB;EACzD,MAAM,WAAW,eAAe,MAAM;EACtC,KAAK,OAAO;EACZ,KAAK,QAAQ;EACb,KAAK,OAAO;CACd;AACF;;AAGA,MAAa,OAAO;CAClB,IAAI;CACJ,SAAS;CACT,OAAO;CACP,gBAAgB;CAChB,WAAW;CACX,aAAa;CACb,iBAAiB;AACnB;AAkYA,MAAa,OAAsB,OAAO,WAAW"}