@vaernjs/vaern 0.0.2 → 0.0.4

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 CHANGED
@@ -1,16 +1,33 @@
1
1
  # vaern
2
2
 
3
- **An agent-native JavaScript & TypeScript runtime** — capability sandboxing, tool-calling, MCP, deterministic replay and sovereignty enforcement built into the engine, not bolted on as a library.
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
- A DevLogix project · licensed MIT
5
+ [VaernJS](https://vaernjs.tech) is a [DevLogix](https://devlogix.com.pk) project · licensed MIT
6
6
 
7
7
  ---
8
8
 
9
- > ### Status: pre-release placeholder (v0.0.x)
9
+ > ### Status: v0.0.4, early native runtime
10
10
  >
11
- > This version reserves the name and provides a working CLI entry point.
12
- >
13
- > Running `vaern` today prints the roadmap. That is expected, not a bug. Run `vaern doctor` for install diagnostics.
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.
14
31
 
15
32
  ---
16
33
 
@@ -21,53 +38,34 @@ npm install -g @vaernjs/vaern # global CLI
21
38
  npx @vaernjs/vaern --version # without installing
22
39
  ```
23
40
 
24
- From **v0.1.0** this pulls a single prebuilt binary for your platform via
25
- `optionalDependencies`, the same way `bun` and `esbuild` do. Nothing is
26
- downloaded in a `postinstall` script; the platform packages are ordinary npm
27
- packages gated by `os` and `cpu`.
28
-
29
- Supported platforms (v0.1.0+):
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`.
30
42
 
31
43
  | Platform | Package |
32
44
  |---|---|
33
- | Linux x86_64 | `vaern-linux-x64` |
34
- | Linux arm64 | `vaern-linux-arm64` |
35
- | macOS arm64 | `vaern-darwin-arm64` |
36
- | macOS x86_64 | `vaern-darwin-x64` |
37
- | Windows x86_64 | `vaern-win32-x64` |
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` |
38
50
 
39
- Install with `--no-optional` or on an unsupported platform and you get the JS
40
- fallback, which explains itself instead of failing silently.
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.
41
52
 
42
- ## What vaern will do
53
+ ## Quick start
43
54
 
44
55
  ```ts
45
- // courier.ts
46
- import { agent, tool } from "vaern:agent";
47
-
48
- const traffic = tool({
49
- name: "traffic",
50
- schema: { city: "string", at: "string" },
51
- run: async ({ city, at }) =>
52
- (await fetch(`https://api.example.pk/v2/${city}?at=${at}`)).json(),
53
- });
54
-
55
- const courier = agent({
56
- name: "courier-copilot",
57
- model: "any-openai-compatible-endpoint",
58
- tools: [traffic],
59
- sandbox: "vaern.toml", // capability policy, enforced by the engine
60
- replay: "deterministic", // every effect journalled at the engine boundary
61
- budget: { tokens: 250_000, usd: 5 }, // hard stop — not an alert
62
- });
63
-
64
- console.log(await courier.run("Reroute today's Lahore deliveries around the fog."));
56
+ // latest.ts
57
+ interface Manifest {
58
+ name: string;
59
+ version: string;
60
+ }
61
+
62
+ const res = await fetch("https://registry.npmjs.org/@vaernjs/vaern/latest");
63
+ const pkg = (await res.json()) as Manifest;
64
+ console.log(`${pkg.name} ${pkg.version}, HTTP ${res.status}`);
65
65
  ```
66
66
 
67
67
  ```bash
68
- vaern run courier.ts
69
- vaern audit export --run 7f3a --format sbp --sign
70
- vaern replay 7f3a --diff
68
+ vaern run latest.ts
71
69
  ```
72
70
 
73
71
  ## Programmatic use
@@ -78,30 +76,26 @@ const { binaryPath, hasNativeBinary, vaern } = require("@vaernjs/vaern");
78
76
  if (hasNativeBinary()) vaern(["run", "app.ts"]);
79
77
  ```
80
78
 
81
- ## Roadmap
82
-
83
- | | Milestone |
84
- |---|---|
85
- | **M1** | `vaern run hello.ts` — TypeScript, `fetch`, timers, `console`, HTTP server |
86
- | **M2** | capability enforcer + `vaern.toml`; `node:fs` / `node:http` / `node:path` subset |
87
- | **M3** | `agent()`, `tool()`, MCP client/server, budgets, effect journal, `vaern replay` |
88
- | **M4** | residency egress guard, hash-chained audit, PK-PKI signing, `ur-PK` i18n |
89
- | **M5** | honest public benchmarks (including losses), docs site, external production users |
79
+ ## Links
90
80
 
91
- We publish benchmarks we lose. A runtime that hides a benchmark is hiding something else.
81
+ - Website: <a href="https://vaernjs.tech">vaernjs.tech</a>
82
+ - DevLogix: <a href="https://devlogix.com.pk">devlogix.com.pk</a>
83
+ - Repository: <a href="https://github.com/vaernjs/vaern">github.com/vaernjs/vaern</a>
84
+ - Issues: <a href="https://github.com/vaernjs/vaern/issues">github.com/vaernjs/vaern/issues</a>
85
+ - npm: <a href="https://www.npmjs.com/package/@vaernjs/vaern">@vaernjs/vaern</a>
92
86
 
93
87
  ## Licence
94
88
 
95
- MIT License. Copyright (c) 2026 DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED.
89
+ MIT License. Copyright (c) 2026 DEVLOGIX TECHNOLOGY (PRIVATE) LIMITED ([DevLogix](https://devlogix.com.pk)).
96
90
  See [`LICENSE`](./LICENSE).
97
91
 
98
92
  ## Development
99
93
 
100
94
  ```bash
101
95
  git clone https://github.com/vaernjs/vaern.git && cd vaern
102
- npm install
96
+ cargo build --release
103
97
  npm run check # pre-publish validation
104
98
  npm run pack:dry # inspect exactly what would be published
105
99
  ```
106
100
 
107
- Issues and pull requests welcome — we would rather be corrected now than wrong later.
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.1.0.
11
+ * and the exit code. This is the normal path from v0.0.4.
12
12
  *
13
- * FALLBACK No binary for this platform yet (the v0.0.x placeholder
14
- * releases, an unsupported platform, or `npm i --no-optional`).
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> package (the normal npm install path)
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 = `vaern-${process.platform}-${process.arch}`;
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
- A DevLogix project · licensed MIT
141
+ VaernJS https://vaernjs.tech · a DevLogix project https://devlogix.com.pk · licensed MIT
142
142
  `;
143
143
 
144
144
  const ROADMAP = `
145
- vaern is in active development.
146
-
147
- M1 weeks 3-6 vaern run hello.ts — TypeScript, fetch, timers, console, HTTP server
148
- M2 weeks 7-10 capability enforcer + vaern.toml (deny by default)
149
- M3 weeks 11-14 agent(), tool(), MCP client/server, budgets, effect journal, vaern replay
150
- M4 weeks 15-20 sovereignty: residency guard, hash-chained audit, PK-PKI signing, ur-PK i18n
151
- M5 weeks 21-26 honest public benchmarks, docs, first external production users
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
- This placeholder release exists to reserve the name on npm and to give the CLI
158
- a working entry point. The native runtime binary lands in M1 (v0.1.0).
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 PRESENT (placeholder release)
180
+ native binary: NOT FOUND
182
181
  $VAERN_BINARY: ${process.env.VAERN_BINARY || "(unset)"}
183
182
 
184
- Nothing is wrong. The native binary ships in v0.1.0 (milestone M1).
185
- Until then, install is expected to fall back to this message.
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 available for ${process.platform}-${process.arch}
195
- in this release. Expected platform package: ${PLATFORM_PKG}.
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.1". */
3
+ /** Package version, e.g. "0.0.4". */
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 = `vaern-${process.platform}-${process.arch}`;
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. `vaern-linux-x64`. */
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.2",
4
- "description": "Vaern — an agent-native JavaScript & TypeScript runtime with capability sandboxing, deterministic replay and sovereignty enforcement.",
3
+ "version": "0.0.4",
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.4",
55
+ "@vaernjs/vaern-linux-arm64": "0.0.4",
56
+ "@vaernjs/vaern-darwin-arm64": "0.0.4",
57
+ "@vaernjs/vaern-darwin-x64": "0.0.4",
58
+ "@vaernjs/vaern-win32-x64": "0.0.4"
59
+ },
54
60
  "engines": {
55
61
  "node": ">=18.0.0"
56
62
  },
@@ -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 = `vaern-${process.platform}-${process.arch}`;
36
+ const platformPkg = `@vaernjs/vaern-${process.platform}-${process.arch}`;
37
37
 
38
38
  let binary;
39
39
  try {