space-data-module-sdk 0.9.9 → 0.9.10

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 (58) hide show
  1. package/docs/_shell/consumer-assets.html +3 -3
  2. package/docs/assets/vendor/hd-wallet-ui/2.2.1/sdn-wallet-callback.0f2dee485c8f0d7afe5f70b4b42093a382c92d32af551bd71b41733336091c7a.js +1 -0
  3. package/docs/assets/vendor/hd-wallet-ui/2.2.1/sdn-wallet-public-client.9ab041131df957fcb6ef7e3d87bf9d19fe313bc5d7f1e53337752faf0ba354da.js +1 -0
  4. package/docs/assets/vendor/hd-wallet-ui/2.2.1/sdn-wallet-public-client.c3f68d1cfd88478f10d836a5e829d1dfc6a10157972cf0f7d4d319d0636f2cc4.css +32 -0
  5. package/docs/assets/vendor/sdn-stack-nav/1.0.1/sdn-stack-nav.24eb3001afc5448a90cef87e53bb4e599c0ae4dc9e14bafb6d1236e0233c6008.js +283 -0
  6. package/docs/assets/vendor/sdn-stack-nav/1.0.1/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css +118 -0
  7. package/docs/browser-wasmedge-isomorphic.html +3 -3
  8. package/docs/byo-wasm-quickstart.html +3 -3
  9. package/docs/conformance.html +3 -3
  10. package/docs/events-abi.html +3 -3
  11. package/docs/families/analytics.html +3 -3
  12. package/docs/families/attitude.html +3 -3
  13. package/docs/families/behavior.html +3 -3
  14. package/docs/families/breakup.html +3 -3
  15. package/docs/families/conjunction.html +3 -3
  16. package/docs/families/data-source.html +3 -3
  17. package/docs/families/effects.html +3 -3
  18. package/docs/families/environment.html +3 -3
  19. package/docs/families/estimation.html +3 -3
  20. package/docs/families/gnc.html +3 -3
  21. package/docs/families/maneuver.html +3 -3
  22. package/docs/families/obstruction.html +3 -3
  23. package/docs/families/propagator.html +3 -3
  24. package/docs/families/propulsion.html +3 -3
  25. package/docs/families/reentry.html +3 -3
  26. package/docs/families/rf.html +3 -3
  27. package/docs/families/scheduler.html +3 -3
  28. package/docs/families/sensor.html +3 -3
  29. package/docs/families/signature.html +3 -3
  30. package/docs/flatsql-host-contract.html +3 -3
  31. package/docs/flatsql-streaming-standard.html +3 -3
  32. package/docs/gpu-module-abi.html +3 -3
  33. package/docs/index.html +3 -3
  34. package/docs/isomorphic-pthreads.html +3 -3
  35. package/docs/isomorphic-sdn-runtime-plan.html +3 -3
  36. package/docs/language-runtime-matrix.html +3 -3
  37. package/docs/module-bundle-runtime-plan.html +3 -3
  38. package/docs/module-publication-standard.html +3 -3
  39. package/docs/node-red-default-node-parity.html +3 -3
  40. package/docs/protect-and-sign.html +3 -3
  41. package/docs/protocol-installation.html +3 -3
  42. package/docs/publication-submission.html +3 -3
  43. package/docs/secrets-capability.html +3 -3
  44. package/docs/testing-harness.html +3 -3
  45. package/docs/tri-runtime-parity-gate.html +3 -3
  46. package/docs/tri-runtime-parity.html +3 -3
  47. package/docs/wallet-callback.html +1 -1
  48. package/package.json +1 -1
  49. package/src/flow/flowRuntimeHost.js +2 -2
  50. package/src/host/abi.js +2 -3
  51. package/src/host/hostWorkerBundleSources.js +3 -3
  52. package/src/host/hostcallWire.js +3 -2
  53. package/src/host/providerAccess.js +2 -3
  54. package/src/host/typedDispatch.js +2 -2
  55. package/src/host/wasiShim.js +5 -1
  56. package/src/runtime-host/flatsqlRuntimeStore.js +2 -2
  57. package/src/testing/parityGate.js +14 -9
  58. package/src/utils/guestText.js +12 -0
@@ -18,7 +18,8 @@
18
18
  * responses (meta = { ok, result } | { ok, error }).
19
19
  */
20
20
 
21
- const textDecoder = new TextDecoder();
21
+ import { decodeGuestText } from "../utils/guestText.js";
22
+
22
23
  const textEncoder = new TextEncoder();
23
24
 
24
25
  export const HOSTCALL_BINARY_REF_KEY = "$bin";
@@ -143,7 +144,7 @@ export function decodeHostcallEnvelope(bytes) {
143
144
  throw new RangeError("Hostcall envelope meta exceeds envelope bounds.");
144
145
  }
145
146
  const meta = JSON.parse(
146
- textDecoder.decode(bytes.subarray(offset, offset + metaLength)),
147
+ decodeGuestText(bytes.subarray(offset, offset + metaLength)),
147
148
  );
148
149
  offset += metaLength;
149
150
  const segmentCount = view.getUint32(offset, true);
@@ -29,8 +29,7 @@ import {
29
29
  providerErrorName,
30
30
  providerSourceId,
31
31
  } from "./providerAccessAbi.js";
32
-
33
- const textDecoder = new TextDecoder();
32
+ import { decodeGuestText } from "../utils/guestText.js";
34
33
 
35
34
  function isThenable(value) {
36
35
  return value !== null && typeof value?.then === "function";
@@ -588,7 +587,7 @@ export function createProviderAccessBridge(options = {}) {
588
587
  function acquire(reqPtr, reqLen, descPtr) {
589
588
  try {
590
589
  const request = JSON.parse(
591
- textDecoder.decode(guestView(getMemory, reqPtr, reqLen)),
590
+ decodeGuestText(guestView(getMemory, reqPtr, reqLen)),
592
591
  );
593
592
  // RASTER IN. A coverage field is 512x512 = 262,144 positions; encoding
594
593
  // those as JSON would be a multi-megabyte request string parsed per
@@ -13,10 +13,10 @@ import {
13
13
  import * as hostOps from "../generated/runtime/aligned/HostOps_aligned.js";
14
14
  import { cryptoAlgorithm, deliverMode, reconcileKind, sandboxWant } from "../generated/runtime/aligned/HostOps_enums.js";
15
15
  import { base64ToBytes, bytesToBase64 } from "../utils/encoding.js";
16
+ import { decodeGuestText } from "../utils/guestText.js";
16
17
 
17
- const textDecoder = new TextDecoder();
18
18
  const textEncoder = new TextEncoder();
19
- const text = (bytes) => (bytes === undefined ? undefined : textDecoder.decode(bytes));
19
+ const text = (bytes) => (bytes === undefined ? undefined : decodeGuestText(bytes));
20
20
  const bytesOf = (value) => (value === undefined || value === null ? undefined : value instanceof Uint8Array ? value : typeof value === "string" ? textEncoder.encode(value) : new Uint8Array(value));
21
21
  const items = (values) => (values || []).map((v) => ({ VALUE: String(v) }));
22
22
  const unix = (value) => BigInt(Math.round(value instanceof Date ? value.getTime() : Number(value)));
@@ -278,7 +278,11 @@ export function createBrowserWasiShim(options = {}) {
278
278
  if (!cryptoApi?.getRandomValues) {
279
279
  return ERRNO_NOSYS;
280
280
  }
281
- cryptoApi.getRandomValues(mem8().subarray(bufPtr, bufPtr + bufLen));
281
+ // A browser refuses crypto.getRandomValues on a view of shared memory (a threads guest): fill a private
282
+ // buffer, then copy it into the guest.
283
+ const random = new Uint8Array(bufLen);
284
+ cryptoApi.getRandomValues(random);
285
+ mem8().set(random, bufPtr);
282
286
  return ERRNO_SUCCESS;
283
287
  }
284
288
 
@@ -1,4 +1,5 @@
1
1
  import { DirectAccessor, FlatSQLDatabase } from "flatsql";
2
+ import { decodeGuestText } from "../utils/guestText.js";
2
3
 
3
4
  const RUNTIME_ROW_TABLE = "RuntimeHostRow";
4
5
  const RUNTIME_ROW_SCHEMA = `
@@ -9,7 +10,6 @@ table RuntimeHostRow {
9
10
  `;
10
11
 
11
12
  const encoder = new TextEncoder();
12
- const decoder = new TextDecoder();
13
13
 
14
14
  function clonePayload(payload) {
15
15
  if (payload === null || payload === undefined) {
@@ -151,7 +151,7 @@ function decodeRuntimeRowMetadata(data) {
151
151
  throw new Error("Invalid runtime row metadata layout.");
152
152
  }
153
153
  return {
154
- schemaFileId: decoder.decode(bytes.subarray(schemaStart, schemaEnd)),
154
+ schemaFileId: decodeGuestText(bytes.subarray(schemaStart, schemaEnd)),
155
155
  rowId: Number(view.getBigUint64(rowIdOffset, true)),
156
156
  };
157
157
  }
@@ -1216,15 +1216,20 @@ export async function runParityGate(options = {}) {
1216
1216
  const behavioral = [];
1217
1217
  for (const artifact of artifacts) {
1218
1218
  if (!artifact.fixture) continue;
1219
- // Behavioral lanes are scoped by the artifact's OWN declaration too: a
1220
- // WasmEdge-only artifact has no browser behaviour to compare, and running
1221
- // it there would score the harness's (correct) refusal as a divergence.
1222
- // The scoping is RECORDED — a skipped lane is evidence, never silence.
1223
- const harnessLanes = [
1224
- "browser",
1219
+ // Behavioral lanes are the gate's active lanes: a lane the caller did not
1220
+ // request is never compared (the Docker lane is optional; owner
1221
+ // 2026-10-22: "we don't need it for any of these tasks"), and a requested
1222
+ // lane that is not up already failed above as lane-unavailable. They are
1223
+ // scoped by the artifact's OWN declaration too: a WasmEdge-only artifact
1224
+ // has no browser behaviour to compare, and running it there would score
1225
+ // the harness's (correct) refusal as a divergence. The scoping is
1226
+ // RECORDED — a skipped lane is evidence, never silence.
1227
+ const requestedHarnessLanes = [
1228
+ ...(activeLanes.includes("browser") ? ["browser"] : []),
1225
1229
  ...(wasmedgeLanes.includes("wasmedge-native") ? ["wasmedge"] : []),
1226
- "docker-wasmedge",
1227
- ].filter((laneName) =>
1230
+ ...(wasmedgeLanes.includes("wasmedge-docker") ? ["docker-wasmedge"] : []),
1231
+ ];
1232
+ const harnessLanes = requestedHarnessLanes.filter((laneName) =>
1228
1233
  laneIsInDeclaredScope(
1229
1234
  laneName === "wasmedge"
1230
1235
  ? "wasmedge-native"
@@ -1235,7 +1240,7 @@ export async function runParityGate(options = {}) {
1235
1240
  artifact.declaredCapabilities,
1236
1241
  ),
1237
1242
  );
1238
- const outOfScopeLanes = ["browser", "wasmedge", "docker-wasmedge"].filter(
1243
+ const outOfScopeLanes = requestedHarnessLanes.filter(
1239
1244
  (laneName) => !harnessLanes.includes(laneName),
1240
1245
  );
1241
1246
  if (harnessLanes.length < 2) {
@@ -0,0 +1,12 @@
1
+ // The one place a JavaScript host turns bytes read out of a WebAssembly guest into text.
2
+ //
3
+ // A guest built for wasm32-wasip1-threads (the wasi-sequential modules too) owns a SharedArrayBuffer memory, so the
4
+ // views a host takes over it are shared. Chromium's TextDecoder refuses them ("The provided ArrayBufferView value
5
+ // must not be shared"); Node and WasmEdge accept them, so the browser alone failed. A shared view can also change
6
+ // under the decoder. Decode an owned copy, so every host reads the same bytes in every runtime.
7
+ const decoder = new TextDecoder();
8
+
9
+ /** The UTF-8 text of `bytes`, a Uint8Array that may be a view of shared guest memory. */
10
+ export function decodeGuestText(bytes) {
11
+ return decoder.decode(bytes.slice());
12
+ }