@crossberryweb/mozhi 0.0.0-stage → 3.1.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,116 @@
1
+ PROPRIETARY LICENSE
2
+
3
+ Copyright (c) 2026 crossberry-in (https://github.com/crossberry-in)
4
+ All rights reserved.
5
+
6
+ 1. DEFINITIONS
7
+
8
+ "Software" refers to the Mozhi programming language interpreter binary,
9
+ its source code, and any accompanying documentation.
10
+
11
+ "Source Code" refers to the human-readable C source files of the Mozhi
12
+ interpreter, including but not limited to files under the src/ and
13
+ include/ directories of the private source repository.
14
+
15
+ "Binary" refers to the compiled, executable form of the Software,
16
+ distributed via the public releases at
17
+ https://github.com/crossberry-in/mozhi-doc/releases.
18
+
19
+ "Licensee" refers to any individual or entity that downloads, installs,
20
+ or uses the Software.
21
+
22
+ 2. SOURCE CODE AVAILABILITY
23
+
24
+ The Source Code of the Software is CLOSED-SOURCE and PROPRIETARY.
25
+ The Source Code is maintained in a private repository and is NOT
26
+ distributed to the public. Licensees receive only the Binary form
27
+ of the Software.
28
+
29
+ 3. GRANT OF LICENSE
30
+
31
+ Subject to the terms and conditions of this License, the licensor
32
+ hereby grants to the Licensee a non-exclusive, non-transferable,
33
+ non-sublicensable, worldwide, royalty-free license to:
34
+
35
+ a) Download, install, and use the Binary of the Software for any
36
+ lawful purpose, including personal, educational, and commercial use.
37
+
38
+ b) Write, distribute, and publicly share Mozhi scripts (source files
39
+ with the .mz extension) that are executed by the Software.
40
+
41
+ c) Distribute verbatim copies of the unmodified Binary to third parties,
42
+ provided that this License is included with such copies.
43
+
44
+ 4. RESTRICTIONS
45
+
46
+ The Licensee shall NOT:
47
+
48
+ a) Reverse engineer, decompile, disassemble, or otherwise attempt to
49
+ derive the Source Code from the Binary, except to the extent that
50
+ such activity is expressly permitted by applicable law.
51
+
52
+ b) Modify, adapt, translate, or create derivative works based on the
53
+ Software, in whole or in part, in source or binary form.
54
+
55
+ c) Redistribute, sell, rent, lease, or sublicense the Software, in
56
+ whole or in part, for a fee, without prior written permission from
57
+ the licensor.
58
+
59
+ d) Remove or alter any copyright, trademark, or other proprietary
60
+ notices on or in the Software.
61
+
62
+ e) Use the Software in any manner that violates applicable laws or
63
+ regulations.
64
+
65
+ 5. OWNERSHIP
66
+
67
+ The Software is licensed, not sold. The licensor retains all right,
68
+ title, and interest in and to the Software, including all intellectual
69
+ property rights therein. This License does not grant the Licensee any
70
+ rights to the Source Code.
71
+
72
+ 6. DISCLAIMER OF WARRANTY
73
+
74
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
75
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
76
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
77
+ IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES, OR
78
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE,
79
+ ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE
80
+ OR OTHER DEALINGS IN THE SOFTWARE.
81
+
82
+ 7. LIMITATION OF LIABILITY
83
+
84
+ IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
85
+ SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED
86
+ TO LOSS OF PROFITS, DATA, OR USE, ARISING OUT OF OR IN CONNECTION WITH
87
+ THIS LICENSE OR THE SOFTWARE, HOWEVER CAUSED AND UNDER ANY THEORY OF
88
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
89
+ NEGLIGENCE), EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY
90
+ OF SUCH DAMAGES.
91
+
92
+ 8. TERMINATION
93
+
94
+ This License is effective until terminated. The Licensee may terminate
95
+ this License at any time by ceasing all use of the Software and
96
+ destroying all copies in their possession. The licensor may terminate
97
+ this License immediately if the Licensee breaches any of its terms.
98
+ Upon termination, the Licensee must cease all use of the Software and
99
+ destroy all copies in their possession.
100
+
101
+ 9. GOVERNING LAW
102
+
103
+ This License shall be governed by and construed in accordance with the
104
+ laws of the jurisdiction in which the licensor resides, without regard
105
+ to its conflict of law provisions.
106
+
107
+ 10. ENTIRE AGREEMENT
108
+
109
+ This License constitutes the entire agreement between the licensor and
110
+ the Licensee with respect to the Software and supersedes all prior or
111
+ contemporaneous understandings regarding such subject matter.
112
+
113
+ ---
114
+
115
+ For inquiries regarding licensing, source code access, or commercial use,
116
+ please visit: https://github.com/crossberry-in/mozhi-doc/issues
package/README.md CHANGED
@@ -1,3 +1,90 @@
1
- # Temporary Holding Version
1
+ # Mozhi (official npm distribution)
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
+ **Mozhi** (மொழி — "language" in Tamil) is a fast, beginner-friendly scripting language with a **native full-stack platform**: HTTP server, template engine, JSON stack, sandboxed filesystem and SQLite — all built into the interpreter, zero external runtimes.
4
+
5
+ This package installs the official `mozhi` command with a **prebuilt, fully static Linux binary** bundled inside — no compilation, no postinstall downloads, works offline behind any proxy.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @crossberryweb/mozhi
11
+
12
+ # then:
13
+ mozhi --version
14
+ ```
15
+
16
+ Bundled platforms (v3.1.1, static musl binaries with SQLite vendored):
17
+
18
+ | Platform | Binary |
19
+ |----------|--------|
20
+ | Linux x86_64 | bundled |
21
+ | Linux arm64 (aarch64, incl. Android/Termux chroots) | bundled |
22
+ | macOS / Windows | use the [installer script](https://github.com/crossberry-in/mozhi-doc#installation) instead |
23
+
24
+ The binaries are fully static, so one build serves glibc distros (Ubuntu/Debian/Fedora/Arch), Alpine/musl, and Termux alike.
25
+
26
+ ## Quick start
27
+
28
+ `hello.mz`
29
+ ```mozhi
30
+ let name = "Mozhi"
31
+ echo("Hello from " + name + "!")
32
+
33
+ fn fib(n) {
34
+ if n < 2 {
35
+ return n
36
+ }
37
+ return fib(n - 1) + fib(n - 2)
38
+ }
39
+ echo("fib(10) = " + string(fib(10)))
40
+ ```
41
+
42
+ ```bash
43
+ mozhi run hello.mz # or simply: mozhi hello.mz
44
+ ```
45
+
46
+ **Full-stack web app** — `app.mz`:
47
+ ```mozhi
48
+ import web
49
+
50
+ let app = web.create({
51
+ log: true
52
+ })
53
+
54
+ app.get("/", fn(req, res) {
55
+ return res.html("<h1>Hello from Mozhi</h1>")
56
+ })
57
+
58
+ app.get("/api/health", fn(req, res) {
59
+ return res.json({
60
+ status: "ok",
61
+ language: "Mozhi",
62
+ version: web.version()
63
+ })
64
+ })
65
+
66
+ app.listen("127.0.0.1", 8080)
67
+ ```
68
+
69
+ ```bash
70
+ mozhi run app.mz
71
+ # then: curl http://127.0.0.1:8080/api/health
72
+ ```
73
+
74
+ ## What's inside
75
+
76
+ - `bin/mozhi-linux-x86_64`, `bin/mozhi-linux-arm64` — official v3.1.1 interpreter binaries, sha256-verified against the [v3.1.1 release](https://github.com/crossberry-in/mozhi-doc/releases/tag/v3.1.1)
77
+ - `bin/mozhi.js` — tiny launcher that picks the right binary and forwards arguments, stdio, exit codes and signals
78
+
79
+ Versioning: the npm package version always matches the bundled interpreter release (package 3.1.1 = Mozhi v3.1.1).
80
+
81
+ ## Docs
82
+
83
+ - [Documentation site](https://crossberry-in.github.io/mozhi-doc/)
84
+ - [Web Server Guide](https://github.com/crossberry-in/mozhi-doc/blob/main/docs/WEB_GUIDE.md)
85
+ - [Language Reference](https://github.com/crossberry-in/mozhi-doc/blob/main/LANGUAGE_REFERENCE.md)
86
+ - [Examples](https://github.com/crossberry-in/mozhi-doc/tree/main/examples)
87
+
88
+ ## License
89
+
90
+ Mozhi is proprietary (closed-source interpreter, publicly released binaries). This package redistributes **unmodified official release binaries** as permitted by the bundled [LICENSE](./LICENSE) (§3c "verbatim copies"). By installing you accept its terms.
@@ -0,0 +1,4 @@
1
+ e67ef15909da90c07e39d9a6e79f5575c4ae49a866962c44f33e35815c2c8703 mozhi-interpreter-linux-x86_64
2
+ 266eebb0c330264018e52c7a4dac17ed1c811af5a8cc3bfeefa13299a8ca78c7 mozhi-interpreter-linux-arm64
3
+ e67ef15909da90c07e39d9a6e79f5575c4ae49a866962c44f33e35815c2c8703 mozhi-interpreter-alpine-x86_64
4
+ 266eebb0c330264018e52c7a4dac17ed1c811af5a8cc3bfeefa13299a8ca78c7 mozhi-interpreter-alpine-arm64
Binary file
Binary file
package/bin/mozhi.js ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * Mozhi interpreter launcher (npm distribution).
4
+ *
5
+ * The official prebuilt interpreter binaries ship inside this package
6
+ * under bin/. This launcher picks the right one for the current
7
+ * platform and hands over the process — arguments, stdio, exit codes
8
+ * and signals all pass through, so `mozhi` behaves exactly like a
9
+ * native binary.
10
+ *
11
+ * Bundled (v3.1.1, fully static musl builds with SQLite vendored):
12
+ * bin/mozhi-linux-x86_64
13
+ * bin/mozhi-linux-arm64
14
+ *
15
+ * macOS / Windows / other platforms:
16
+ * see https://github.com/crossberry-in/mozhi-doc#installation
17
+ */
18
+ 'use strict';
19
+
20
+ const { spawn } = require('child_process');
21
+ const fs = require('fs');
22
+ const path = require('path');
23
+
24
+ // npm's process.arch uses "x64"; our asset naming uses "x86_64".
25
+ const arch = process.arch === 'x64' ? 'x86_64' : process.arch;
26
+ const bin = path.join(__dirname, 'mozhi-' + process.platform + '-' + arch);
27
+
28
+ if (!fs.existsSync(bin)) {
29
+ console.error('[mozhi] No bundled interpreter for ' + process.platform + '-' + process.arch + '.');
30
+ console.error('[mozhi] This package ships official v3.1.1 binaries for:');
31
+ console.error('[mozhi] linux-x86_64, linux-arm64 (fully static — works on glibc, Alpine, Termux)');
32
+ console.error('[mozhi] For macOS, Windows and other platforms use the installer:');
33
+ console.error('[mozhi] curl -fsSL https://github.com/crossberry-in/mozhi-doc/raw/main/install.sh | bash');
34
+ process.exit(1);
35
+ }
36
+
37
+ const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
38
+
39
+ child.on('error', (err) => {
40
+ console.error('[mozhi] Failed to start interpreter: ' + err.message);
41
+ process.exit(1);
42
+ });
43
+
44
+ child.on('exit', (code, signal) => {
45
+ if (signal) {
46
+ // propagate fatal signals (SIGINT/SIGTERM...) with the correct exit status
47
+ process.kill(process.pid, signal);
48
+ } else {
49
+ process.exit(code === null ? 0 : code);
50
+ }
51
+ });
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@crossberryweb/mozhi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "3.1.1",
4
+ "description": "Mozhi programming language — official npm distribution. Fast, beginner-friendly scripting language with a native HTTP server, template engine, JSON stack, sandboxed filesystem and SQLite. Bundles the official static Linux x86_64/arm64 binaries and installs the `mozhi` command.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "author": "crossberry-in <crossberryweb@gmail.com> (https://github.com/crossberry-in)",
7
+ "bin": {
8
+ "mozhi": "bin/mozhi.js"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "LICENSE",
13
+ "README.md"
14
+ ],
15
+ "keywords": [
16
+ "mozhi",
17
+ "language",
18
+ "interpreter",
19
+ "scripting",
20
+ "web",
21
+ "webserver",
22
+ "http",
23
+ "json",
24
+ "sqlite",
25
+ "templates",
26
+ "fullstack"
27
+ ],
28
+ "homepage": "https://crossberry-in.github.io/mozhi-doc/",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/crossberry-in/mozhi-doc.git",
32
+ "directory": "npm"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/crossberry-in/mozhi-doc/issues"
36
+ },
37
+ "engines": {
38
+ "node": ">=14"
39
+ }
40
+ }