@markii/lua 0.11.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/require.d.ts +20 -16
  2. package/package.json +3 -3
package/dist/require.d.ts CHANGED
@@ -1,17 +1,19 @@
1
1
  import type { ScriptView } from '@markii/bundle';
2
2
  /**
3
3
  * Sandboxed `require` (spec §8 "Long scripts and shared code", docs/
4
- * scripting.md): exactly two of the spec's three sources are implemented
5
- * here — bundle-local modules and the SEAM for pack modules (the pack
6
- * loader itself, and the third source, the vault library, are later
7
- * phases: packs need the pack-installation machinery from packs.md, and
8
- * the vault library needs a host-side namespace-to-folder mapping neither
9
- * of which exists yet). Both implemented sources, and the not-yet-wired
10
- * one, share ONE property: every require target this module resolves is
11
- * PURE LUA SOURCE TEXT, loaded as a fresh PROTECTED CHUNK on the SAME
12
- * thread as the rest of the run, so it shares that run's globals,
13
- * capabilities, and instruction/wall-clock/memory budget a module can
14
- * never grant itself more than the script that required it already had.
4
+ * scripting.md): there are exactly TWO sources of shared Lua, and this
5
+ * module implements both — bundle-local modules, and pack modules (the
6
+ * `PackModuleResolver` seam below, which a host wires to its own installed
7
+ * packs, e.g. `@markii/host`'s `createPackModuleResolver`). There is no
8
+ * third source: a folder of shared Lua with nothing to render is simply a
9
+ * pack whose manifest declares no components (`"components": {}`) and
10
+ * carries its own `scripts/*.lua` it is a pack module like any other, not
11
+ * a separate mechanism. Both sources share ONE property: every require
12
+ * target this module resolves is PURE LUA SOURCE TEXT, loaded as a fresh
13
+ * PROTECTED CHUNK on the SAME thread as the rest of the run, so it shares
14
+ * that run's globals, capabilities, and instruction/wall-clock/memory
15
+ * budget — a module can never grant itself more than the script that
16
+ * required it already had.
15
17
  *
16
18
  * ## Two sources, told apart by the first path segment (docs/scripting.md)
17
19
  *
@@ -28,11 +30,13 @@ import type { ScriptView } from '@markii/bundle';
28
30
  * no separate tier gate to apply on top of what `bundle.read` already
29
31
  * enforces.
30
32
  * - **Pack-namespaced**: `require "ana/http"` (first segment anything
31
- * else). This phase implements ONLY the seam: an optional injected
32
- * `PackModuleResolver`. With no resolver configured (packs are not
33
- * wired into any host yet), a pack-namespaced `require` fails cleanly
34
- * as a capability denial — never a crash, never a fallthrough into
35
- * filesystem or network access.
33
+ * else). This package only defines the seam: an optional injected
34
+ * `PackModuleResolver`. A host that has wired up pack installation
35
+ * (`@markii/host`'s `discoverPacks` + `loadPackModules` +
36
+ * `createPackModuleResolver`) passes a real resolver in; with none
37
+ * configured, a pack-namespaced `require` fails cleanly as a capability
38
+ * denial — never a crash, never a fallthrough into filesystem or network
39
+ * access.
36
40
  *
37
41
  * ## Why a real `require` needs `load` back, carefully
38
42
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markii/lua",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
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.11.0",
48
- "@markii/runtime": "0.11.0",
47
+ "@markii/bundle": "^0.12.1",
48
+ "@markii/runtime": "^0.12.1",
49
49
  "wasmoon": "^1.16.0"
50
50
  }
51
51
  }