@markii/lua 0.2.0 → 0.3.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.
@@ -95,7 +95,7 @@ export declare function luaStringToBytes(s: string): Uint8Array;
95
95
  /**
96
96
  * Builds the raw, host-facing async functions to inject as flat globals,
97
97
  * and the trusted Lua prelude that wraps them into the ergonomic `net` /
98
- * `cache` / `bundle` tables the DESIGN.md host API documents (`net.fetch_json(url)`,
98
+ * `cache` / `bundle` tables the docs/spec.md host API documents (`net.fetch_json(url)`,
99
99
  * `cache.get(key, ttl, fn)`, `bundle.read/write/exists(path)`).
100
100
  *
101
101
  * ## Why "raw flat globals + a Lua prelude" instead of `global.set('net', {...})`
@@ -126,7 +126,7 @@ export declare function luaStringToBytes(s: string): Uint8Array;
126
126
  * `js_promise` userdata with `:await()`/`:next()`/`:catch()` methods; the
127
127
  * CALLER must explicitly invoke `:await()` to get the resolved value
128
128
  * (verified empirically: without it, a script sees the raw promise
129
- * userdata, not the awaited result). Since `DESIGN.md`'s example script
129
+ * userdata, not the awaited result). Since `docs/spec.md`'s example script
130
130
  * (`local repo = net.fetch_json(url)`) is written as if this were
131
131
  * synchronous, the awaiting is done for the author, once, HERE — inside
132
132
  * the prelude's Lua wrapper — never exposed to the untrusted script.
@@ -50,7 +50,7 @@ export function luaStringToBytes(s) {
50
50
  /**
51
51
  * Builds the raw, host-facing async functions to inject as flat globals,
52
52
  * and the trusted Lua prelude that wraps them into the ergonomic `net` /
53
- * `cache` / `bundle` tables the DESIGN.md host API documents (`net.fetch_json(url)`,
53
+ * `cache` / `bundle` tables the docs/spec.md host API documents (`net.fetch_json(url)`,
54
54
  * `cache.get(key, ttl, fn)`, `bundle.read/write/exists(path)`).
55
55
  *
56
56
  * ## Why "raw flat globals + a Lua prelude" instead of `global.set('net', {...})`
@@ -81,7 +81,7 @@ export function luaStringToBytes(s) {
81
81
  * `js_promise` userdata with `:await()`/`:next()`/`:catch()` methods; the
82
82
  * CALLER must explicitly invoke `:await()` to get the resolved value
83
83
  * (verified empirically: without it, a script sees the raw promise
84
- * userdata, not the awaited result). Since `DESIGN.md`'s example script
84
+ * userdata, not the awaited result). Since `docs/spec.md`'s example script
85
85
  * (`local repo = net.fetch_json(url)`) is written as if this were
86
86
  * synchronous, the awaiting is done for the author, once, HERE — inside
87
87
  * the prelude's Lua wrapper — never exposed to the untrusted script.
@@ -1,7 +1,7 @@
1
1
  import type { ScriptExecutor } from '@markii/runtime';
2
2
  import { type RunScriptOptions } from './sandbox.js';
3
3
  /**
4
- * Slice 2 of the scripting-usability layer (DESIGN.md §8): the reusable
4
+ * Slice 2 of the scripting-usability layer (docs/scripting.md): the reusable
5
5
  * adapter from this package's `runScript` to `@markii/runtime`'s
6
6
  * language-agnostic `ScriptExecutor` shape, so `runDocumentScripts` can run
7
7
  * a document's script blocks through the real Lua sandbox without
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @markii/lua: the sandboxed Lua 5.4 (wasmoon) execution primitive backing
2
2
  // spec §8 (scripting), §10 (capability security), and §11 (bundle-scoped
3
- // filesystem). No React, no @markii/core, no @markii/react — see CLAUDE.md's
3
+ // filesystem). No React, no @markii/core, no @markii/react — see AGENTS.md's
4
4
  // import rule and the ESLint guard in the root config. May depend on
5
5
  // @markii/bundle for the `ScriptView` capability type only.
6
6
  export { CAPABILITY_ERROR_TAG, MARSHAL_ERROR_TAG, ScriptLimitError, } from './errors.js';
package/dist/limits.d.ts CHANGED
@@ -112,7 +112,7 @@ export interface LimitHandle {
112
112
  * AUTHORITATIVE kill for that class of failure is not this hook at all —
113
113
  * it's the host's EXTERNAL, terminatable-isolate watchdog (dedicated Web
114
114
  * Worker/`worker_thread` + an outside wall-clock timer calling
115
- * `terminate()`), now normative in DESIGN.md §10 ("In-process limits are
115
+ * `terminate()`), now normative in docs/security.md ("In-process limits are
116
116
  * best-effort; the terminatable isolate is the real guarantee"). This
117
117
  * module's hook reduces how often that external kill is needed and gives
118
118
  * fast, precise, in-band error classification for the common compute-bound
package/dist/limits.js CHANGED
@@ -93,7 +93,7 @@ export const DEFAULT_LIMITS = {
93
93
  * AUTHORITATIVE kill for that class of failure is not this hook at all —
94
94
  * it's the host's EXTERNAL, terminatable-isolate watchdog (dedicated Web
95
95
  * Worker/`worker_thread` + an outside wall-clock timer calling
96
- * `terminate()`), now normative in DESIGN.md §10 ("In-process limits are
96
+ * `terminate()`), now normative in docs/security.md ("In-process limits are
97
97
  * best-effort; the terminatable isolate is the real guarantee"). This
98
98
  * module's hook reduces how often that external kill is needed and gives
99
99
  * fast, precise, in-band error classification for the common compute-bound
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markii/lua",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Sandboxed Lua 5.4 (wasmoon) execution runtime for Mark's document scripting: an empty-env global whitelist, two-tier capability-gated net/cache/bundle access, instruction-count/wall-clock/memory limits, and depth/size-capped Lua<->JS marshaling.",
5
5
  "keywords": [
6
6
  "markdown",
@@ -44,8 +44,8 @@
44
44
  "lint": "eslint ."
45
45
  },
46
46
  "dependencies": {
47
- "@markii/bundle": "0.2.0",
48
- "@markii/runtime": "0.2.0",
47
+ "@markii/bundle": "0.3.0",
48
+ "@markii/runtime": "0.3.0",
49
49
  "wasmoon": "^1.16.0"
50
50
  }
51
51
  }