space-data-module-sdk 0.5.21 → 0.5.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "space-data-module-sdk",
3
- "version": "0.5.21",
3
+ "version": "0.5.22",
4
4
  "description": "Module SDK for building, validating, signing, and deploying WebAssembly modules on the Space Data Network.",
5
5
  "type": "module",
6
6
  "types": "./src/index.d.ts",
package/src/AGENTS.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # AGENTS
2
2
 
3
- Apply the root `AGENTS.md` first. This file routes source edits to the correct
4
- subsystem.
3
+ Apply the root `AGENTS.md` first. This file is a map for module authors reading
4
+ the SDK source, not a prompt to edit SDK internals by default.
5
5
 
6
- ## Source Routing
6
+ ## Use `src/` As A Reference Map
7
7
 
8
8
  - `src/manifest`, `src/compliance`, `src/standards`: manifest shape, type refs,
9
9
  standards validation, and compliance warnings/errors.
@@ -23,11 +23,10 @@ subsystem.
23
23
  - `src/generated`: generated code. Do not hand-edit unless regeneration is part
24
24
  of the task and you update the generation path or fixtures as needed.
25
25
 
26
- ## Working Rules
26
+ ## Author Rules
27
27
 
28
- - Keep module contracts portable unless the task is explicitly runtime-specific.
29
- - Prefer changes in the smallest subsystem that owns the behavior.
30
- - If a change crosses compiler, host, and docs, update each owner explicitly
31
- rather than hiding policy in one layer.
32
- - Add or update tests near the owning subsystem and then wire them into the
33
- repo-level verification set in `test/AGENTS.md`.
28
+ - Prefer public APIs and examples over editing `src/*`.
29
+ - Read the nearest child `AGENTS.md` to understand which source files define the
30
+ contract you are using.
31
+ - Only edit internals here when the task explicitly says to change the SDK
32
+ standard for everyone.
@@ -1,15 +1,13 @@
1
1
  # AGENTS
2
2
 
3
- You are in `src/auth`, which owns deployment authorization, signing helpers,
4
- and related record handling used by module distribution.
3
+ This directory is the reference implementation for deployment authorization and
4
+ signing helpers used by compliant module distribution.
5
5
 
6
- ## Rules
6
+ ## What Authors Should Use It For
7
7
 
8
8
  - Keep signing and authorization flows deterministic and explicit.
9
9
  - Do not invent app-local signature records when a repo-level contract belongs
10
10
  here.
11
- - When auth changes affect transport or deployment plans, update the related
12
- surfaces together rather than splitting incompatible changes across repos.
13
11
 
14
12
  ## Related Surfaces
15
13
 
@@ -18,8 +16,7 @@ and related record handling used by module distribution.
18
16
  - `test/transport-records.test.js`
19
17
  - `test/deployment-plan.test.js`
20
18
 
21
- ## Check Before You Finish
19
+ ## Note
22
20
 
23
- - `npm test`
24
- - `npm run check:compliance`
25
- - `node --test test/transport-records.test.js test/deployment-plan.test.js`
21
+ Use the exported helpers here rather than inventing your own signing records.
22
+ Only edit this directory when you are intentionally changing the auth contract.
@@ -1,21 +1,17 @@
1
1
  # AGENTS
2
2
 
3
- You are in `src/bundle`, which owns `sds.bundle` and the wasm custom-section
4
- packaging rules.
3
+ This directory is the reference implementation for `sds.bundle` and wasm
4
+ custom-section packaging.
5
5
 
6
- ## Rules
6
+ ## What Authors Should Use It For
7
7
 
8
8
  - `sds.bundle` is the single-file delivery format.
9
9
  - Put bundle data in a wasm custom section; do not append raw bytes after the
10
10
  wasm binary.
11
- - Keep parser, encoder, CLI behavior, vectors, and cross-language fixtures in
12
- sync.
13
- - If the bundle contract changes, regenerate vectors and update the bundle docs
14
- and demos in the same change.
11
+ - Use the public bundle helpers and CLI from this repo rather than inventing a
12
+ custom one-file format.
15
13
 
16
- ## Check Before You Finish
14
+ ## Note
17
15
 
18
- - `npm test`
19
- - `npm run check:compliance`
20
- - `node --test test/module-bundle.test.js test/module-bundle-vectors.test.js test/module-bundle-cli.test.js test/module-bundle-go.test.js test/module-bundle-python.test.js`
21
- - `npm run generate:vectors` when vectors or the contract changed
16
+ Only edit this directory when you are intentionally changing bundle behavior for
17
+ all consumers.
@@ -1,13 +1,18 @@
1
1
  # AGENTS
2
2
 
3
- Apply the root and `src/AGENTS.md` files first.
3
+ Apply the root and `src/AGENTS.md` files first. This directory tells module
4
+ authors how the compiler behaves.
4
5
 
5
- ## Area Ownership
6
+ ## What Authors Should Take From This Directory
6
7
 
7
- This directory owns source-to-wasm compile behavior, manifest embedding, runtime
8
- target inference, toolchain integration, and canonical artifact layout.
8
+ - `compileModuleFromSource(...)` and the CLI are the canonical ways to produce a
9
+ compliant artifact.
10
+ - Manifest embedding and required exports are generated together with the wasm
11
+ bytes.
12
+ - Shared browser/WasmEdge artifacts should land at
13
+ `dist/isomorphic/module.wasm`.
9
14
 
10
- ## Compiler Rules
15
+ ## Compiler Rules Authors Should Follow
11
16
 
12
17
  - Preserve the canonical manifest accessor exports and validate them together
13
18
  with compiled wasm.
@@ -18,18 +23,15 @@ target inference, toolchain integration, and canonical artifact layout.
18
23
  imports.
19
24
  - Prefer repo-local Emscripten or `sdn-emception`. Do not assume Homebrew
20
25
  toolchains.
21
- - If you change runtime-target inference, keep the browser/WasmEdge shared path
22
- on the standalone profile unless the docs and tests are updated deliberately.
23
26
 
24
- ## Key Files
27
+ ## Key Files To Read
25
28
 
26
29
  - `compileModule.js`
27
30
  - `compileModuleFromSource.js`
28
31
  - `emception*.js`
29
32
  - `invokeGlue.js`
30
33
 
31
- ## Verification
34
+ ## Note
32
35
 
33
- - `node --test test/module-sdk.test.js test/compliance.test.js`
34
- - `node --test test/browser-harness.test.js test/isomorphic-loader.test.js`
35
- - `node --test test/compiler-emception-subpath-export.test.js`
36
+ Do not edit compiler internals just to build one module. Only change this
37
+ directory when you are intentionally changing the repo-wide compile contract.
@@ -1,18 +1,16 @@
1
1
  # AGENTS
2
2
 
3
- You are in `src/compliance`, which defines what counts as a compliant module or
3
+ This directory is the reference policy for what counts as a compliant module or
4
4
  artifact.
5
5
 
6
- ## Rules
6
+ ## What Authors Should Use It For
7
7
 
8
- - Treat this directory as policy, not convenience code.
9
- - When tightening validation, update tests and error messages together so the
10
- failure mode is actionable.
11
- - When relaxing validation, make sure the compiler, docs, and examples still
12
- describe the broader contract accurately.
8
+ - Use the CLI and public validation helpers to understand whether a manifest or
9
+ artifact is compliant.
10
+ - Read this directory when you need to know why a module was rejected.
11
+ - Prefer fixing your module manifest or build output before changing policy here.
13
12
 
14
- ## Check Before You Finish
13
+ ## Note
15
14
 
16
- - `npm test`
17
- - `npm run check:compliance`
18
- - `node --test test/module-sdk.test.js test/compliance.test.js`
15
+ Only edit this directory when you are intentionally changing the compliance
16
+ standard for all module authors.
@@ -1,14 +1,17 @@
1
1
  # AGENTS
2
2
 
3
- Apply the root and `src/AGENTS.md` files first.
3
+ Apply the root and `src/AGENTS.md` files first. This directory explains the
4
+ host/runtime boundary that compliant modules can rely on.
4
5
 
5
- ## Area Ownership
6
+ ## What Authors Should Take From This Directory
6
7
 
7
- This directory owns the Node reference host, browser host, browser edge shims,
8
- WASI shims, the sync `sdn_host` ABI bridge, WasmEdge launch planning, and the
9
- isomorphic loader path.
8
+ - The portable shared path is standalone WASI, optionally plus `sdn_host`.
9
+ - Browser helpers here are host-side shims and harnesses, not proof that raw
10
+ WasmEdge-native guest imports are browser-portable.
11
+ - The isomorphic loader and browser harness show how the same artifact is meant
12
+ to run in both places.
10
13
 
11
- ## Host Rules
14
+ ## Host Rules Authors Should Follow
12
15
 
13
16
  - Shared browser/WasmEdge artifacts must stay within standalone WASI plus the
14
17
  optional `sdn_host` bridge. Raw WasmEdge-native extension imports are not
@@ -20,7 +23,7 @@ isomorphic loader path.
20
23
  - Scope host capabilities tightly: filesystem roots, network allowlists, TLS,
21
24
  exec, timers, and crypto should stay explicit.
22
25
 
23
- ## Key Files
26
+ ## Key Files To Read
24
27
 
25
28
  - `abi.js`
26
29
  - `browserEdgeShims.js`
@@ -29,11 +32,7 @@ isomorphic loader path.
29
32
  - `nodeHost.js`
30
33
  - `wasiShim.js`
31
34
 
32
- ## Verification
35
+ ## Note
33
36
 
34
- - `node --test test/node-host.test.js test/host-abi.test.js`
35
- - `node --test test/browser-harness.test.js test/isomorphic-loader.test.js`
36
- - `node --test test/process-invoke.test.js`
37
- - `node --test test/wasmedge-runner-build.test.js`
38
- - `node --test test/wasmedge-runner-runtime.test.js` when WasmEdge behavior is
39
- part of the change
37
+ Prefer using the exported host and harness surfaces rather than editing these
38
+ files unless the task is explicitly to change the SDK host contract.
@@ -1,18 +1,15 @@
1
1
  # AGENTS
2
2
 
3
- You are in `src/manifest`, which owns the manifest schema codecs and
4
- normalization rules.
3
+ This directory is the reference implementation for manifest encoding,
4
+ normalization, and round-trip behavior.
5
5
 
6
- ## Rules
6
+ ## What Authors Should Use It For
7
7
 
8
8
  - Keep manifest encode/decode round-trips stable.
9
9
  - Prefer canonical SDS schema names and file identifiers; do not add repo-local
10
10
  aliases when a standards name already exists.
11
- - If you change a manifest field or normalization rule, update the compiler,
12
- compliance checks, and any affected examples/tests together.
13
11
 
14
- ## Check Before You Finish
12
+ ## Note
15
13
 
16
- - `npm test`
17
- - `npm run check:compliance`
18
- - `node --test test/module-sdk.test.js test/compliance.test.js`
14
+ Use the public manifest helpers from this repo to build manifests. Only edit
15
+ this directory when you are intentionally changing the manifest standard.
@@ -1,12 +1,15 @@
1
1
  # AGENTS
2
2
 
3
- Apply the root and `src/AGENTS.md` files first.
3
+ Apply the root and `src/AGENTS.md` files first. This directory shows the
4
+ host-owned storage and ingest path available to module authors.
4
5
 
5
- ## Area Ownership
6
+ ## What Authors Should Take From This Directory
6
7
 
7
- This directory owns the canonical runtime-host storage model: row handles,
8
- region handles, FlatSQL-backed storage, and binary FlatBuffer ingest on the host
9
- side.
8
+ - Host-owned durable identity is `(schemaFileId, rowId)` for rows and
9
+ `(regionId, recordIndex)` for aligned-binary regions.
10
+ - The canonical ingest path is direct FlatBuffer bytes, not JSON.
11
+ - If the host owns persistence, use these helpers. If a module owns state, keep
12
+ the stream binary and use the resident-module pump path from `src/testing`.
10
13
 
11
14
  ## Storage And Streaming Rules
12
15
 
@@ -19,14 +22,13 @@ side.
19
22
  - If a resident module owns state, keep the stream binary and push into the
20
23
  module through the harness/pump path rather than inventing JSON wrappers.
21
24
 
22
- ## Key Files
25
+ ## Key Files To Read
23
26
 
24
27
  - `flatbufferStreamIngestor.js`
25
28
  - `flatsqlRuntimeStore.js`
26
29
  - `index.js`
27
30
 
28
- ## Verification
31
+ ## Note
29
32
 
30
- - `npm run test:stream-ingest`
31
- - `node --test test/flatsql-local-node.test.js`
32
- - `npm run benchmark:stream-1gib` for large-stream changes
33
+ Do not edit this directory just to store data for one module. Use the exported
34
+ helpers unless you are intentionally changing the runtime-host contract.
@@ -1,12 +1,15 @@
1
1
  # AGENTS
2
2
 
3
- Apply the root and `src/AGENTS.md` files first.
3
+ Apply the root and `src/AGENTS.md` files first. This directory contains the
4
+ author-facing harnesses and streaming helpers.
4
5
 
5
- ## Area Ownership
6
+ ## What Authors Should Use From Here
6
7
 
7
- This directory owns SDK test harnesses and runtime-facing helper surfaces used
8
- by examples and downstream consumers: browser harnesses, generic process invoke
9
- clients, runtime-matrix helpers, and resident-module FlatBuffer pumps.
8
+ - `createBrowserModuleHarness(...)` is the browser-side proof path for shared
9
+ standalone artifacts.
10
+ - `createModuleHarness(...)` is the generic process-side harness.
11
+ - `createModuleFlatBufferStreamPump(...)` is the canonical no-JSON path for
12
+ streaming size-prefixed FlatBuffer frames into a resident module instance.
10
13
 
11
14
  ## Harness Rules
12
15
 
@@ -19,15 +22,13 @@ clients, runtime-matrix helpers, and resident-module FlatBuffer pumps.
19
22
  - Avoid hiding stateful behavior inside one-off demos; if a harness contract is
20
23
  real, test it here.
21
24
 
22
- ## Key Files
25
+ ## Key Files To Read
23
26
 
24
27
  - `browserModuleHarness.js`
25
28
  - `moduleFlatbufferStreamPump.js`
26
29
  - `processInvoke.js`
27
30
 
28
- ## Verification
31
+ ## Note
29
32
 
30
- - `node --test test/browser-harness.test.js`
31
- - `node --test test/isomorphic-loader.test.js`
32
- - `npm run test:module-stream`
33
- - `node --test test/process-invoke.test.js`
33
+ Use these helpers from your module repo or app harnesses. Only edit them when
34
+ you are intentionally changing the SDK testing/runtime contract.