@vaernjs/vaern 0.0.3 → 0.0.5
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/README.md +48 -16
- package/bin/vaern.cjs +24 -23
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +11 -5
- package/scripts/postinstall.cjs +1 -1
package/README.md
CHANGED
|
@@ -1,26 +1,56 @@
|
|
|
1
1
|
# vaern
|
|
2
2
|
|
|
3
|
-
An agent-native JavaScript
|
|
3
|
+
**An agent-native JavaScript & TypeScript runtime.** Vaern runs TypeScript directly, with `fetch` and an HTTP server built in, on an embedded QuickJS-ng engine driven by Rust and Tokio. Capability sandboxing, tool-calling, MCP and replayable runs are being built into the engine itself.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[VaernJS](https://vaernjs.tech) is a [DevLogix](https://devlogix.com.pk) project · licensed MIT
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
> ### Status: v0.0.5, early native runtime
|
|
10
|
+
>
|
|
11
|
+
> This release ships the native `vaern` binary for Linux, macOS and Windows.
|
|
12
|
+
> The API surface is small and will change before v1.0.
|
|
13
|
+
|
|
14
|
+
**Works today**
|
|
15
|
+
|
|
16
|
+
- `vaern run <file>`: JavaScript and TypeScript, with types stripped at load time
|
|
17
|
+
- Relative ES module imports
|
|
18
|
+
- `console`, `setTimeout` / `setInterval`, `queueMicrotask`
|
|
19
|
+
- `process.argv`, `process.env`, `process.exit()`
|
|
20
|
+
- `fetch` with `Headers`, `Response`, `AbortController`, redirects and timeouts (hyper and rustls)
|
|
21
|
+
- `serve()` from `vaern:http`, an HTTP server with Web-standard `Request` / `Response` and streamed bodies
|
|
22
|
+
- Uncaught exceptions, unhandled rejections and throwing timers exit non-zero with a `file:line:col` location
|
|
23
|
+
|
|
24
|
+
**Not implemented yet**
|
|
25
|
+
|
|
26
|
+
- `node:*` modules and npm package imports
|
|
27
|
+
- Capability sandboxing (`vaern.toml`)
|
|
28
|
+
- `agent()`, `tool()`, MCP, budgets and `vaern replay`
|
|
29
|
+
|
|
30
|
+
TypeScript `enum`, `namespace` and decorators are rejected with a located error, because they emit runtime code that type stripping cannot produce.
|
|
31
|
+
|
|
32
|
+
---
|
|
10
33
|
|
|
11
34
|
## Install
|
|
12
35
|
|
|
13
36
|
```bash
|
|
14
|
-
npm install -g @vaernjs/vaern
|
|
15
|
-
|
|
16
|
-
cargo build --release
|
|
17
|
-
export VAERN_BINARY="$PWD/target/release/vaern"
|
|
18
|
-
vaern --version
|
|
37
|
+
npm install -g @vaernjs/vaern # global CLI
|
|
38
|
+
npx @vaernjs/vaern --version # without installing
|
|
19
39
|
```
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
npm installs one prebuilt binary for your platform through `optionalDependencies`, the same way `esbuild` does. Nothing is downloaded in a `postinstall` script; the platform packages are ordinary npm packages gated by `os` and `cpu`.
|
|
42
|
+
|
|
43
|
+
| Platform | Package |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Linux x86_64 | `@vaernjs/vaern-linux-x64` |
|
|
46
|
+
| Linux arm64 | `@vaernjs/vaern-linux-arm64` |
|
|
47
|
+
| macOS arm64 | `@vaernjs/vaern-darwin-arm64` |
|
|
48
|
+
| macOS x86_64 | `@vaernjs/vaern-darwin-x64` |
|
|
49
|
+
| Windows x86_64 | `@vaernjs/vaern-win32-x64` |
|
|
50
|
+
|
|
51
|
+
Linux binaries need glibc 2.35 or newer. On an unsupported platform, or when optional dependencies are skipped, `vaern` falls back to a small diagnostics CLI. Run `vaern doctor` there to see why.
|
|
22
52
|
|
|
23
|
-
##
|
|
53
|
+
## Quick start
|
|
24
54
|
|
|
25
55
|
```ts
|
|
26
56
|
// latest.ts
|
|
@@ -46,11 +76,6 @@ const { binaryPath, hasNativeBinary, vaern } = require("@vaernjs/vaern");
|
|
|
46
76
|
if (hasNativeBinary()) vaern(["run", "app.ts"]);
|
|
47
77
|
```
|
|
48
78
|
|
|
49
|
-
## Licence
|
|
50
|
-
|
|
51
|
-
MIT License. Copyright (c) 2026 DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED.
|
|
52
|
-
See [`LICENSE`](./LICENSE).
|
|
53
|
-
|
|
54
79
|
## Links
|
|
55
80
|
|
|
56
81
|
- Website: <a href="https://vaernjs.tech">vaernjs.tech</a>
|
|
@@ -59,6 +84,11 @@ See [`LICENSE`](./LICENSE).
|
|
|
59
84
|
- Issues: <a href="https://github.com/vaernjs/vaern/issues">github.com/vaernjs/vaern/issues</a>
|
|
60
85
|
- npm: <a href="https://www.npmjs.com/package/@vaernjs/vaern">@vaernjs/vaern</a>
|
|
61
86
|
|
|
87
|
+
## Licence
|
|
88
|
+
|
|
89
|
+
MIT License. Copyright (c) 2026 DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED ([DevLogix](https://devlogix.com.pk)).
|
|
90
|
+
See [`LICENSE`](./LICENSE).
|
|
91
|
+
|
|
62
92
|
## Development
|
|
63
93
|
|
|
64
94
|
```bash
|
|
@@ -67,3 +97,5 @@ cargo build --release
|
|
|
67
97
|
npm run check # pre-publish validation
|
|
68
98
|
npm run pack:dry # inspect exactly what would be published
|
|
69
99
|
```
|
|
100
|
+
|
|
101
|
+
Issues and pull requests welcome. We would rather be corrected now than wrong later.
|
package/bin/vaern.cjs
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Two modes, chosen at runtime:
|
|
8
8
|
*
|
|
9
|
-
* NATIVE A platform package (vaern-<os>-<arch>) shipped a real binary.
|
|
9
|
+
* NATIVE A platform package (@vaernjs/vaern-<os>-<arch>) shipped a real binary.
|
|
10
10
|
* We exec it and get out of the way, forwarding stdio, signals
|
|
11
|
-
* and the exit code. This is the normal path from v0.
|
|
11
|
+
* and the exit code. This is the normal path from v0.0.4.
|
|
12
12
|
*
|
|
13
|
-
* FALLBACK No binary for this platform
|
|
14
|
-
*
|
|
13
|
+
* FALLBACK No binary for this platform (an unsupported platform, or
|
|
14
|
+
* optional dependencies skipped with `npm i --omit=optional`).
|
|
15
15
|
* We serve a small built-in CLI so the command never dies with
|
|
16
16
|
* "command not found".
|
|
17
17
|
*
|
|
18
18
|
* Resolution order for the native binary:
|
|
19
19
|
* 1. $VAERN_BINARY (explicit override — used by CI and by `cargo run` during dev)
|
|
20
|
-
* 2. vaern-<os>-<arch>
|
|
20
|
+
* 2. @vaernjs/vaern-<os>-<arch> (the normal npm install path)
|
|
21
21
|
* 3. ../vendor/vaern (repo-local build dropped in by `just build`)
|
|
22
22
|
* 4. FALLBACK
|
|
23
23
|
*
|
|
@@ -36,7 +36,7 @@ const require_ = createRequire(__filename);
|
|
|
36
36
|
const pkg = require_("../package.json");
|
|
37
37
|
|
|
38
38
|
const EXE = process.platform === "win32" ? ".exe" : "";
|
|
39
|
-
const PLATFORM_PKG =
|
|
39
|
+
const PLATFORM_PKG = `@vaernjs/vaern-${process.platform}-${process.arch}`;
|
|
40
40
|
|
|
41
41
|
/* ------------------------------------------------------------------ */
|
|
42
42
|
/* native binary resolution */
|
|
@@ -138,24 +138,23 @@ function execNative(binary, args) {
|
|
|
138
138
|
/* ------------------------------------------------------------------ */
|
|
139
139
|
|
|
140
140
|
const BANNER = `vaern ${pkg.version} — an agent-native JavaScript & TypeScript runtime
|
|
141
|
-
|
|
141
|
+
VaernJS https://vaernjs.tech · a DevLogix project https://devlogix.com.pk · licensed MIT
|
|
142
142
|
`;
|
|
143
143
|
|
|
144
144
|
const ROADMAP = `
|
|
145
|
-
vaern
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
Manifesto: https://github.com/vaernjs/vaern
|
|
145
|
+
M1 vaern run hello.ts — TypeScript, fetch, timers, console, HTTP server (shipping in 0.0.x)
|
|
146
|
+
M2 capability enforcer + vaern.toml (deny by default)
|
|
147
|
+
M3 agent(), tool(), MCP client/server, budgets, effect journal, vaern replay
|
|
148
|
+
M4 sovereignty: residency guard, hash-chained audit, PK-PKI signing, ur-PK i18n
|
|
149
|
+
M5 honest public benchmarks, docs, first external production users
|
|
150
|
+
|
|
151
|
+
Website: https://vaernjs.tech
|
|
152
|
+
DevLogix: https://devlogix.com.pk
|
|
154
153
|
Repository: ${pkg.repository ? String(pkg.repository.url).replace(/^git\+/, "") : "https://github.com/vaernjs/vaern"}
|
|
155
154
|
Issues: ${pkg.bugs ? pkg.bugs.url : ""}
|
|
156
155
|
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
The native runtime ships in the platform package ${PLATFORM_PKG}. This message
|
|
157
|
+
means it is not installed. Run \`vaern doctor\` for details.
|
|
159
158
|
`;
|
|
160
159
|
|
|
161
160
|
function fallback(args) {
|
|
@@ -178,11 +177,13 @@ function fallback(args) {
|
|
|
178
177
|
platform: ${process.platform}-${process.arch}
|
|
179
178
|
expected package: ${PLATFORM_PKG}
|
|
180
179
|
node: ${process.version}
|
|
181
|
-
native binary: NOT
|
|
180
|
+
native binary: NOT FOUND
|
|
182
181
|
$VAERN_BINARY: ${process.env.VAERN_BINARY || "(unset)"}
|
|
183
182
|
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
Native binaries are published for linux-x64, linux-arm64, darwin-x64,
|
|
184
|
+
darwin-arm64 and win32-x64. If your platform is listed, optional dependencies
|
|
185
|
+
were probably skipped: reinstall without --omit=optional / --no-optional, or
|
|
186
|
+
point $VAERN_BINARY at a vaern binary.
|
|
186
187
|
`);
|
|
187
188
|
process.exit(0);
|
|
188
189
|
}
|
|
@@ -191,8 +192,8 @@ Until then, install is expected to fall back to this message.
|
|
|
191
192
|
`${BANNER}
|
|
192
193
|
vaern: unknown command '${a}'
|
|
193
194
|
|
|
194
|
-
The native runtime binary is not
|
|
195
|
-
|
|
195
|
+
The native runtime binary is not installed for ${process.platform}-${process.arch}.
|
|
196
|
+
Expected platform package: ${PLATFORM_PKG}.
|
|
196
197
|
|
|
197
198
|
Try: vaern doctor show install diagnostics
|
|
198
199
|
vaern roadmap what is being built and when
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ChildProcess, SpawnOptions } from "node:child_process";
|
|
2
2
|
|
|
3
|
-
/** Package version, e.g. "0.0.
|
|
3
|
+
/** Package version, e.g. "0.0.5". */
|
|
4
4
|
export declare const version: string;
|
|
5
5
|
|
|
6
|
-
/** Name of the platform package that carries the binary for this host, e.g. "vaern-linux-x64". */
|
|
6
|
+
/** Name of the platform package that carries the binary for this host, e.g. "@vaernjs/vaern-linux-x64". */
|
|
7
7
|
export declare const platformPackage: string;
|
|
8
8
|
|
|
9
9
|
/** Absolute path to the native vaern binary, or null when this release has none. */
|
package/index.js
CHANGED
|
@@ -16,9 +16,9 @@ const require_ = createRequire(__filename);
|
|
|
16
16
|
const pkg = require_("./package.json");
|
|
17
17
|
|
|
18
18
|
const EXE = process.platform === "win32" ? ".exe" : "";
|
|
19
|
-
const PLATFORM_PKG =
|
|
19
|
+
const PLATFORM_PKG = `@vaernjs/vaern-${process.platform}-${process.arch}`;
|
|
20
20
|
|
|
21
|
-
/** Package name that should carry the binary for this platform, e.g.
|
|
21
|
+
/** Package name that should carry the binary for this platform, e.g. `@vaernjs/vaern-linux-x64`. */
|
|
22
22
|
const platformPackage = PLATFORM_PKG;
|
|
23
23
|
|
|
24
24
|
/** Absolute path to the native binary, or null if this release has none. */
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaernjs/vaern",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Vaern — an agent-native JavaScript & TypeScript runtime
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Vaern — an agent-native JavaScript & TypeScript runtime. Runs TypeScript directly, with fetch and an HTTP server built in.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"runtime",
|
|
7
7
|
"javascript",
|
|
8
8
|
"typescript",
|
|
9
9
|
"agent",
|
|
10
10
|
"agents",
|
|
11
|
-
"mcp",
|
|
12
|
-
"sandbox",
|
|
13
11
|
"cli",
|
|
14
12
|
"vaern",
|
|
15
13
|
"devlogix"
|
|
16
14
|
],
|
|
17
15
|
"license": "MIT",
|
|
18
16
|
"author": {
|
|
19
|
-
"name": "DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED"
|
|
17
|
+
"name": "DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED",
|
|
18
|
+
"url": "https://devlogix.com.pk"
|
|
20
19
|
},
|
|
21
20
|
"repository": {
|
|
22
21
|
"type": "git",
|
|
@@ -51,6 +50,13 @@
|
|
|
51
50
|
"postinstall": "node scripts/postinstall.cjs",
|
|
52
51
|
"prepublishOnly": "node ../../scripts/check-publish.mjs"
|
|
53
52
|
},
|
|
53
|
+
"optionalDependencies": {
|
|
54
|
+
"@vaernjs/vaern-linux-x64": "0.0.5",
|
|
55
|
+
"@vaernjs/vaern-linux-arm64": "0.0.5",
|
|
56
|
+
"@vaernjs/vaern-darwin-arm64": "0.0.5",
|
|
57
|
+
"@vaernjs/vaern-darwin-x64": "0.0.5",
|
|
58
|
+
"@vaernjs/vaern-win32-x64": "0.0.5"
|
|
59
|
+
},
|
|
54
60
|
"engines": {
|
|
55
61
|
"node": ">=18.0.0"
|
|
56
62
|
},
|
package/scripts/postinstall.cjs
CHANGED
|
@@ -33,7 +33,7 @@ function main() {
|
|
|
33
33
|
if (process.platform === "win32") return done("windows — keeping the JS shim");
|
|
34
34
|
|
|
35
35
|
const require_ = createRequire(__filename);
|
|
36
|
-
const platformPkg =
|
|
36
|
+
const platformPkg = `@vaernjs/vaern-${process.platform}-${process.arch}`;
|
|
37
37
|
|
|
38
38
|
let binary;
|
|
39
39
|
try {
|