space-data-module-sdk 0.8.4 → 0.8.6

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 (354) hide show
  1. package/README.md +117 -20
  2. package/bin/space-data-module.js +263 -0
  3. package/docs/.nojekyll +1 -0
  4. package/docs/AGENTS.md +34 -0
  5. package/docs/architecture.svg +141 -0
  6. package/docs/browser-wasmedge-isomorphic.md +179 -0
  7. package/docs/flatsql-streaming-standard.md +341 -0
  8. package/docs/gpu-module-abi.md +193 -0
  9. package/docs/index.html +125 -0
  10. package/docs/isomorphic-pthreads.md +188 -0
  11. package/docs/isomorphic-sdn-runtime-plan.md +167 -0
  12. package/docs/language-runtime-matrix.md +82 -0
  13. package/docs/manifest-structure.svg +114 -0
  14. package/docs/module-bundle-runtime-plan.md +19 -0
  15. package/docs/module-lifecycle.svg +70 -0
  16. package/docs/module-publication-standard.md +540 -0
  17. package/docs/node-red-default-node-parity.md +88 -0
  18. package/docs/protocol-installation.md +196 -0
  19. package/docs/secrets-capability.md +152 -0
  20. package/docs/styles.css +288 -0
  21. package/docs/testing-harness.md +408 -0
  22. package/docs/tri-runtime-parity.md +132 -0
  23. package/docs/wallet-callback.html +2 -0
  24. package/package.json +25 -6
  25. package/schemas/HttpRequestAbi.fbs +41 -0
  26. package/schemas/HttpResponseAbi.fbs +36 -0
  27. package/schemas/PluginManifest.fbs +2 -1
  28. package/src/AGENTS.md +1 -1
  29. package/src/app/codec.js +548 -0
  30. package/src/app/index.js +6 -0
  31. package/src/browser.js +5 -0
  32. package/src/bundle/constants.js +1 -0
  33. package/src/bundle/index.js +15 -0
  34. package/src/bundle/sigdomain.js +179 -0
  35. package/src/bundle/signing.js +767 -0
  36. package/src/bundle/wasm.js +3 -2
  37. package/src/capabilities.js +3 -0
  38. package/src/compat/index.js +7 -0
  39. package/src/compat/sdnLegacy.js +449 -0
  40. package/src/compiler/compileModule.js +556 -55
  41. package/src/compiler/flatcSupport.js +41 -27
  42. package/src/compiler/index.d.ts +2 -0
  43. package/src/compiler/index.js +18 -0
  44. package/src/compiler/invokeGlue.js +1212 -183
  45. package/src/compiler/pthreadArtifactGuard.js +910 -0
  46. package/src/compiler/sdnShimGenerator.js +323 -0
  47. package/src/compiler/wasiThreadsToolchain.js +150 -0
  48. package/src/compliance/index.js +11 -1
  49. package/src/compliance/legacyWildcardPorts.js +228 -0
  50. package/src/compliance/pluginCompliance.js +1000 -96
  51. package/src/field-stream/index.d.ts +31 -0
  52. package/src/field-stream/index.js +119 -0
  53. package/src/flow/dependencyStreamBridge.js +234 -0
  54. package/src/flow/flatsqlLinkShim.js +304 -0
  55. package/src/flow/flowCodec.js +107 -0
  56. package/src/flow/flowCompiler.js +2900 -0
  57. package/src/flow/flowRuntimeHost.js +877 -0
  58. package/src/flow/index.d.ts +117 -0
  59. package/src/flow/index.js +31 -0
  60. package/src/flow/isomorphicFlowHost.js +384 -0
  61. package/src/flow/jsFlowRuntime.js +275 -0
  62. package/src/flow/normalize.js +294 -0
  63. package/src/flow/runtime-src/flow_runtime.cpp +1699 -0
  64. package/src/flow/vendor/sdn-flow/MethodRegistry.js +400 -0
  65. package/src/flow/vendor/sdn-flow/constants.js +39 -0
  66. package/src/flow/vendor/sdn-flow/index.js +29 -0
  67. package/src/flow/vendor/sdn-flow/normalize.js +506 -0
  68. package/src/flow/vendor/sdn-flow/wasmCompatibility.js +189 -0
  69. package/src/generated/http/cpp/HttpRequestAbi_generated.h +285 -0
  70. package/src/generated/http/cpp/HttpResponseAbi_generated.h +192 -0
  71. package/src/generated/http/sdn/http/http-header.js +53 -0
  72. package/src/generated/http/sdn/http/http-header.ts +67 -0
  73. package/src/generated/http/sdn/http/http-request.js +132 -0
  74. package/src/generated/http/sdn/http/http-request.ts +179 -0
  75. package/src/generated/http/sdn/http/http-response.js +144 -0
  76. package/src/generated/http/sdn/http/http-response.ts +168 -0
  77. package/src/generated/http/sdn/http.js +11 -0
  78. package/src/generated/http/sdn/http.ts +4 -0
  79. package/src/generated/orbpro/flow/backpressure-policy.d.ts +12 -0
  80. package/src/generated/orbpro/flow/backpressure-policy.d.ts.map +1 -0
  81. package/src/generated/orbpro/flow/backpressure-policy.js +17 -0
  82. package/src/generated/orbpro/flow/backpressure-policy.js.map +1 -0
  83. package/src/generated/orbpro/flow/backpressure-policy.ts +15 -0
  84. package/src/generated/orbpro/flow/flow-bundle-manifest.d.ts +142 -0
  85. package/src/generated/orbpro/flow/flow-bundle-manifest.d.ts.map +1 -0
  86. package/src/generated/orbpro/flow/flow-bundle-manifest.js +304 -0
  87. package/src/generated/orbpro/flow/flow-bundle-manifest.js.map +1 -0
  88. package/src/generated/orbpro/flow/flow-bundle-manifest.ts +399 -0
  89. package/src/generated/orbpro/flow/flow-edge.d.ts +113 -0
  90. package/src/generated/orbpro/flow/flow-edge.d.ts.map +1 -0
  91. package/src/generated/orbpro/flow/flow-edge.js +221 -0
  92. package/src/generated/orbpro/flow/flow-edge.js.map +1 -0
  93. package/src/generated/orbpro/flow/flow-edge.ts +292 -0
  94. package/src/generated/orbpro/flow/flow-node.d.ts +80 -0
  95. package/src/generated/orbpro/flow/flow-node.d.ts.map +1 -0
  96. package/src/generated/orbpro/flow/flow-node.js +158 -0
  97. package/src/generated/orbpro/flow/flow-node.js.map +1 -0
  98. package/src/generated/orbpro/flow/flow-node.ts +202 -0
  99. package/src/generated/orbpro/flow/flow-program.d.ts +164 -0
  100. package/src/generated/orbpro/flow/flow-program.d.ts.map +1 -0
  101. package/src/generated/orbpro/flow/flow-program.js +350 -0
  102. package/src/generated/orbpro/flow/flow-program.js.map +1 -0
  103. package/src/generated/orbpro/flow/flow-program.ts +477 -0
  104. package/src/generated/orbpro/flow/flow-trigger.d.ts +108 -0
  105. package/src/generated/orbpro/flow/flow-trigger.d.ts.map +1 -0
  106. package/src/generated/orbpro/flow/flow-trigger.js +207 -0
  107. package/src/generated/orbpro/flow/flow-trigger.js.map +1 -0
  108. package/src/generated/orbpro/flow/flow-trigger.ts +276 -0
  109. package/src/generated/orbpro/flow/node-kind.d.ts +13 -0
  110. package/src/generated/orbpro/flow/node-kind.d.ts.map +1 -0
  111. package/src/generated/orbpro/flow/node-kind.js +16 -0
  112. package/src/generated/orbpro/flow/node-kind.js.map +1 -0
  113. package/src/generated/orbpro/{invoke.ts → flow/node-kind.ts} +12 -2
  114. package/src/generated/orbpro/flow/plugin-version-binding.d.ts +52 -0
  115. package/src/generated/orbpro/flow/plugin-version-binding.d.ts.map +1 -0
  116. package/src/generated/orbpro/flow/plugin-version-binding.js +85 -0
  117. package/src/generated/orbpro/flow/plugin-version-binding.js.map +1 -0
  118. package/src/generated/orbpro/flow/plugin-version-binding.ts +121 -0
  119. package/src/generated/orbpro/flow/schema-hash-binding.d.ts +70 -0
  120. package/src/generated/orbpro/flow/schema-hash-binding.d.ts.map +1 -0
  121. package/src/generated/orbpro/flow/schema-hash-binding.js +143 -0
  122. package/src/generated/orbpro/flow/schema-hash-binding.js.map +1 -0
  123. package/src/generated/orbpro/flow/schema-hash-binding.ts +189 -0
  124. package/src/generated/orbpro/flow/trigger-binding.d.ts +71 -0
  125. package/src/generated/orbpro/flow/trigger-binding.d.ts.map +1 -0
  126. package/src/generated/orbpro/flow/trigger-binding.js +142 -0
  127. package/src/generated/orbpro/flow/trigger-binding.js.map +1 -0
  128. package/src/generated/orbpro/flow/trigger-binding.ts +181 -0
  129. package/src/generated/orbpro/flow/trigger-kind.d.ts +14 -0
  130. package/src/generated/orbpro/flow/trigger-kind.d.ts.map +1 -0
  131. package/src/generated/orbpro/flow/trigger-kind.js +17 -0
  132. package/src/generated/orbpro/flow/trigger-kind.js.map +1 -0
  133. package/src/generated/orbpro/flow/trigger-kind.ts +17 -0
  134. package/src/generated/orbpro/flow.d.ts +21 -0
  135. package/src/generated/orbpro/flow.d.ts.map +1 -0
  136. package/src/generated/orbpro/flow.js +23 -0
  137. package/src/generated/orbpro/flow.js.map +1 -0
  138. package/src/generated/orbpro/flow.ts +24 -0
  139. package/src/generated/orbpro/manifest/capability-kind.d.ts +2 -1
  140. package/src/generated/orbpro/manifest/capability-kind.js +1 -0
  141. package/src/generated/orbpro/manifest/capability-kind.ts +1 -0
  142. package/src/generated/orbpro/plugin/stream-invoke-request.d.ts +93 -0
  143. package/src/generated/orbpro/plugin/stream-invoke-request.js +160 -0
  144. package/src/generated/orbpro/plugin/stream-invoke-request.ts +211 -0
  145. package/src/generated/orbpro/plugin/stream-invoke-response.d.ts +99 -0
  146. package/src/generated/orbpro/plugin/stream-invoke-response.js +175 -0
  147. package/src/generated/orbpro/plugin/stream-invoke-response.ts +226 -0
  148. package/src/generated/orbpro/plugin.js +8 -0
  149. package/src/generated/orbpro/stream.d.ts +12 -0
  150. package/src/generated/orbpro/stream.js +14 -0
  151. package/src/generated/orbpro/stream.ts +15 -0
  152. package/src/generated/spacedatastandards/plg/EntryFunction.d.ts +52 -0
  153. package/src/generated/spacedatastandards/plg/EntryFunction.d.ts.map +1 -0
  154. package/src/generated/spacedatastandards/plg/EntryFunction.js +106 -0
  155. package/src/generated/spacedatastandards/plg/EntryFunction.ts +162 -0
  156. package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.d.ts +90 -0
  157. package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.d.ts.map +1 -0
  158. package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.js +189 -0
  159. package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.ts +270 -0
  160. package/src/generated/spacedatastandards/plg/PLG.d.ts +492 -0
  161. package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -0
  162. package/src/generated/spacedatastandards/plg/PLG.js +1139 -0
  163. package/src/generated/spacedatastandards/plg/PLG.ts +1600 -0
  164. package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.d.ts +63 -0
  165. package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.d.ts.map +1 -0
  166. package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.js +138 -0
  167. package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.ts +189 -0
  168. package/src/generated/spacedatastandards/plg/PLGBuildArtifact.d.ts +41 -0
  169. package/src/generated/spacedatastandards/plg/PLGBuildArtifact.d.ts.map +1 -0
  170. package/src/generated/spacedatastandards/plg/PLGBuildArtifact.js +104 -0
  171. package/src/generated/spacedatastandards/plg/PLGBuildArtifact.ts +151 -0
  172. package/src/generated/spacedatastandards/plg/PLGFlowEdge.d.ts +68 -0
  173. package/src/generated/spacedatastandards/plg/PLGFlowEdge.d.ts.map +1 -0
  174. package/src/generated/spacedatastandards/plg/PLGFlowEdge.js +124 -0
  175. package/src/generated/spacedatastandards/plg/PLGFlowEdge.ts +184 -0
  176. package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.d.ts +58 -0
  177. package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.d.ts.map +1 -0
  178. package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.js +126 -0
  179. package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.ts +161 -0
  180. package/src/generated/spacedatastandards/plg/PLGFlowNode.d.ts +82 -0
  181. package/src/generated/spacedatastandards/plg/PLGFlowNode.d.ts.map +1 -0
  182. package/src/generated/spacedatastandards/plg/PLGFlowNode.js +164 -0
  183. package/src/generated/spacedatastandards/plg/PLGFlowNode.ts +244 -0
  184. package/src/generated/spacedatastandards/plg/PLGFlowTrigger.d.ts +55 -0
  185. package/src/generated/spacedatastandards/plg/PLGFlowTrigger.d.ts.map +1 -0
  186. package/src/generated/spacedatastandards/plg/PLGFlowTrigger.js +105 -0
  187. package/src/generated/spacedatastandards/plg/PLGFlowTrigger.ts +162 -0
  188. package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.d.ts +42 -0
  189. package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.d.ts.map +1 -0
  190. package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.js +83 -0
  191. package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.ts +127 -0
  192. package/src/generated/spacedatastandards/plg/PLGHostCapability.d.ts +36 -0
  193. package/src/generated/spacedatastandards/plg/PLGHostCapability.d.ts.map +1 -0
  194. package/src/generated/spacedatastandards/plg/PLGHostCapability.js +90 -0
  195. package/src/generated/spacedatastandards/plg/PLGHostCapability.ts +127 -0
  196. package/src/generated/spacedatastandards/plg/PLGMethodManifest.d.ts +53 -0
  197. package/src/generated/spacedatastandards/plg/PLGMethodManifest.d.ts.map +1 -0
  198. package/src/generated/spacedatastandards/plg/PLGMethodManifest.js +153 -0
  199. package/src/generated/spacedatastandards/plg/PLGMethodManifest.ts +210 -0
  200. package/src/generated/spacedatastandards/plg/PLGPortManifest.d.ts +70 -0
  201. package/src/generated/spacedatastandards/plg/PLGPortManifest.d.ts.map +1 -0
  202. package/src/generated/spacedatastandards/plg/PLGPortManifest.js +149 -0
  203. package/src/generated/spacedatastandards/plg/PLGPortManifest.ts +212 -0
  204. package/src/generated/spacedatastandards/plg/PLGProtocolSpec.d.ts +73 -0
  205. package/src/generated/spacedatastandards/plg/PLGProtocolSpec.d.ts.map +1 -0
  206. package/src/generated/spacedatastandards/plg/PLGProtocolSpec.js +199 -0
  207. package/src/generated/spacedatastandards/plg/PLGProtocolSpec.ts +292 -0
  208. package/src/generated/spacedatastandards/plg/PLGTimerSpec.d.ts +40 -0
  209. package/src/generated/spacedatastandards/plg/PLGTimerSpec.d.ts.map +1 -0
  210. package/src/generated/spacedatastandards/plg/PLGTimerSpec.js +103 -0
  211. package/src/generated/spacedatastandards/plg/PLGTimerSpec.ts +148 -0
  212. package/src/generated/spacedatastandards/plg/PluginCapability.d.ts +41 -0
  213. package/src/generated/spacedatastandards/plg/PluginCapability.d.ts.map +1 -0
  214. package/src/generated/spacedatastandards/plg/PluginCapability.js +82 -0
  215. package/src/generated/spacedatastandards/plg/{plugin-capability.ts → PluginCapability.ts} +55 -18
  216. package/src/generated/spacedatastandards/plg/PluginDependency.d.ts +42 -0
  217. package/src/generated/spacedatastandards/plg/PluginDependency.d.ts.map +1 -0
  218. package/src/generated/spacedatastandards/plg/PluginDependency.js +80 -0
  219. package/src/generated/spacedatastandards/plg/PluginDependency.ts +124 -0
  220. package/src/generated/spacedatastandards/plg/TAB.d.ts +85 -0
  221. package/src/generated/spacedatastandards/plg/TAB.d.ts.map +1 -0
  222. package/src/generated/spacedatastandards/plg/TAB.js +173 -0
  223. package/src/generated/spacedatastandards/plg/TAB.ts +228 -0
  224. package/src/generated/spacedatastandards/plg/bufferMutability.d.ts +18 -0
  225. package/src/generated/spacedatastandards/plg/bufferMutability.d.ts.map +1 -0
  226. package/src/generated/spacedatastandards/plg/bufferMutability.js +20 -0
  227. package/src/generated/spacedatastandards/plg/bufferMutability.ts +23 -0
  228. package/src/generated/spacedatastandards/plg/bufferOwnership.d.ts +18 -0
  229. package/src/generated/spacedatastandards/plg/bufferOwnership.d.ts.map +1 -0
  230. package/src/generated/spacedatastandards/plg/bufferOwnership.js +20 -0
  231. package/src/generated/spacedatastandards/plg/bufferOwnership.ts +23 -0
  232. package/src/generated/spacedatastandards/plg/drainBehavior.d.ts +20 -0
  233. package/src/generated/spacedatastandards/plg/drainBehavior.d.ts.map +1 -0
  234. package/src/generated/spacedatastandards/plg/drainBehavior.js +22 -0
  235. package/src/generated/spacedatastandards/plg/drainBehavior.ts +25 -0
  236. package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.d.ts +10 -0
  237. package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.d.ts.map +1 -0
  238. package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.js +12 -0
  239. package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.ts +13 -0
  240. package/src/generated/spacedatastandards/plg/hostCapabilityKind.d.ts +51 -0
  241. package/src/generated/spacedatastandards/plg/hostCapabilityKind.d.ts.map +1 -0
  242. package/src/generated/spacedatastandards/plg/hostCapabilityKind.js +53 -0
  243. package/src/generated/spacedatastandards/plg/hostCapabilityKind.ts +55 -0
  244. package/src/generated/spacedatastandards/plg/invokeSurfaceKind.d.ts +15 -0
  245. package/src/generated/spacedatastandards/plg/invokeSurfaceKind.d.ts.map +1 -0
  246. package/src/generated/spacedatastandards/plg/invokeSurfaceKind.js +17 -0
  247. package/src/generated/spacedatastandards/plg/invokeSurfaceKind.ts +19 -0
  248. package/src/generated/spacedatastandards/plg/main.d.ts +29 -0
  249. package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -0
  250. package/src/generated/spacedatastandards/plg/main.js +30 -0
  251. package/src/generated/spacedatastandards/plg/main.ts +32 -0
  252. package/src/generated/spacedatastandards/plg/payloadWireFormat.d.ts +17 -0
  253. package/src/generated/spacedatastandards/plg/payloadWireFormat.d.ts.map +1 -0
  254. package/src/generated/spacedatastandards/plg/payloadWireFormat.js +19 -0
  255. package/src/generated/spacedatastandards/plg/payloadWireFormat.ts +21 -0
  256. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +82 -0
  257. package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -0
  258. package/src/generated/spacedatastandards/plg/pluginCategory.js +84 -0
  259. package/src/generated/spacedatastandards/plg/pluginCategory.ts +103 -0
  260. package/src/generated/spacedatastandards/plg/publicationState.d.ts +18 -0
  261. package/src/generated/spacedatastandards/plg/publicationState.d.ts.map +1 -0
  262. package/src/generated/spacedatastandards/plg/publicationState.js +20 -0
  263. package/src/generated/spacedatastandards/plg/purchaseTier.d.ts +18 -0
  264. package/src/generated/spacedatastandards/plg/purchaseTier.d.ts.map +1 -0
  265. package/src/generated/spacedatastandards/plg/purchaseTier.js +20 -0
  266. package/src/host/AGENTS.md +2 -2
  267. package/src/host/abi.js +53 -66
  268. package/src/host/browserHost.js +355 -8
  269. package/src/host/cpp/keyslotClient.hpp +231 -0
  270. package/src/host/cpp/secretsClient.hpp +583 -0
  271. package/src/host/hostcallWire.js +183 -0
  272. package/src/host/index.js +2 -0
  273. package/src/host/isomorphicLoader.js +44 -7
  274. package/src/host/nodeHost.js +227 -8
  275. package/src/host/sabHostcallChannel.js +206 -0
  276. package/src/host/timerDriver.js +203 -0
  277. package/src/host/wasiShim.js +41 -1
  278. package/src/host/wasiThreadBrowserWorker.mjs +48 -0
  279. package/src/host/wasiThreadHost.js +393 -0
  280. package/src/host/wasiThreadWorker.mjs +32 -0
  281. package/src/host/wasiThreadWorkerRuntime.js +93 -0
  282. package/src/http/index.js +339 -0
  283. package/src/index.d.ts +725 -11
  284. package/src/index.js +4 -0
  285. package/src/invoke/codec.js +1202 -128
  286. package/src/invoke/index.js +5 -1
  287. package/src/licensing/index.d.ts +2 -0
  288. package/src/licensing/index.js +2 -0
  289. package/src/licensing/records.js +287 -8
  290. package/src/manifest/codec.js +62 -14
  291. package/src/manifest/index.js +2 -0
  292. package/src/manifest/legacyToPlg.js +164 -25
  293. package/src/manifest/normalize.js +1 -0
  294. package/src/manifest/plgCodec.js +1303 -62
  295. package/src/manifest/typeRefs.js +162 -24
  296. package/src/runtime/compiledRuntimeAbi.js +47 -0
  297. package/src/runtime/compiledRuntimeAbi.json +33 -0
  298. package/src/runtime/index.d.ts +32 -0
  299. package/src/runtime/index.js +1 -0
  300. package/src/runtime-host/index.js +3 -0
  301. package/src/runtime-host/methodRegistry.js +55 -0
  302. package/src/standards/index.js +200 -56
  303. package/src/standards/sharedCatalog.js +16 -0
  304. package/src/testing/browserModuleHarness.js +604 -31
  305. package/src/testing/docker/wasmedge-parity.Dockerfile +39 -0
  306. package/src/testing/index.d.ts +151 -0
  307. package/src/testing/index.js +21 -0
  308. package/src/testing/native/wasmedge_emscripten_pthread_runner.c +25 -1
  309. package/src/testing/parityBrowserRunner.js +138 -0
  310. package/src/testing/parityHarness.js +616 -0
  311. package/src/testing/parityLanes.js +537 -0
  312. package/src/testing/processInvoke.js +29 -21
  313. package/src/testing/streamInvokeCodec.js +10 -175
  314. package/src/testing/wasmedgePin.json +6 -0
  315. package/src/testing/workerModuleHarness.js +242 -0
  316. package/src/testing/workerModuleHarnessWorker.js +176 -0
  317. package/src/transport/index.js +3 -0
  318. package/src/transport/pki.js +352 -14
  319. package/src/transport/records.js +16 -7
  320. package/src/utils/ecdsaDer.js +106 -0
  321. package/src/utils/wasmCrypto.js +0 -43
  322. package/templates/gpu-module/README.md +48 -0
  323. package/templates/gpu-module/include/space_data_gpu_abi.h +122 -0
  324. package/templates/gpu-module/manifest.json +84 -0
  325. package/schemas/PluginInvokeRequest.fbs +0 -18
  326. package/schemas/PluginInvokeResponse.fbs +0 -30
  327. package/schemas/spacedatastandards/PLG.fbs +0 -191
  328. package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts +0 -51
  329. package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts.map +0 -1
  330. package/src/generated/orbpro/invoke/plugin-invoke-request.js +0 -131
  331. package/src/generated/orbpro/invoke/plugin-invoke-request.js.map +0 -1
  332. package/src/generated/orbpro/invoke/plugin-invoke-request.ts +0 -173
  333. package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts +0 -76
  334. package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts.map +0 -1
  335. package/src/generated/orbpro/invoke/plugin-invoke-response.js +0 -184
  336. package/src/generated/orbpro/invoke/plugin-invoke-response.js.map +0 -1
  337. package/src/generated/orbpro/invoke/plugin-invoke-response.ts +0 -243
  338. package/src/generated/orbpro/invoke.d.ts +0 -3
  339. package/src/generated/orbpro/invoke.js +0 -5
  340. package/src/generated/spacedatastandards/plg/entry-function.js +0 -86
  341. package/src/generated/spacedatastandards/plg/entry-function.ts +0 -119
  342. package/src/generated/spacedatastandards/plg/index.js +0 -16
  343. package/src/generated/spacedatastandards/plg/index.ts +0 -11
  344. package/src/generated/spacedatastandards/plg/plg.js +0 -657
  345. package/src/generated/spacedatastandards/plg/plg.ts +0 -924
  346. package/src/generated/spacedatastandards/plg/plugin-capability.js +0 -66
  347. package/src/generated/spacedatastandards/plg/plugin-category.js +0 -15
  348. package/src/generated/spacedatastandards/plg/plugin-category.ts +0 -53
  349. package/src/generated/spacedatastandards/plg/plugin-dependency.js +0 -63
  350. package/src/generated/spacedatastandards/plg/plugin-dependency.ts +0 -86
  351. package/src/generated/spacedatastandards/plg/publication-state.js +0 -9
  352. package/src/generated/spacedatastandards/plg/purchase-tier.js +0 -9
  353. /package/src/generated/spacedatastandards/plg/{publication-state.ts → publicationState.ts} +0 -0
  354. /package/src/generated/spacedatastandards/plg/{purchase-tier.ts → purchaseTier.ts} +0 -0
@@ -0,0 +1,82 @@
1
+ # SDN Module System — Language/Runtime Matrix and orbpro-integration Harness Port Plan (WS12.1)
2
+
3
+ Status: WS12.1 deliverable. Section 1 is the definitive language/runtime matrix. Section 2 is the per-file port/dedupe plan that WS12.2 executes. All source paths verified against the live trees on 2026-07-02, then adversarially fact-checked (two independent review passes); citations below are to the **0.8.5** SDK tree unless marked otherwise.
4
+
5
+ Source trees referenced:
6
+
7
+ - Harness under port: `/Users/tj/software/OrbPro/packages/orbpro-integration/sdk/src/runtime/` (10 files, 1789 lines)
8
+ - Port target (canonical SDK): `/Users/tj/software/orbpro-stack/repos/main-packages/OrbPro/packages/space-data-module-sdk` (**v0.8.5**, HEAD `0d53c54`)
9
+ - **Warning:** `/Users/tj/software/OrbPro/packages/space-data-module-sdk` is a **stale v0.8.4** copy (no `src/flow/`, no worker harness, no SAB channel, no timer driver). Do not port into it. sdn-js pins the SDK as a tarball directly at commit `53748bc92bdac04a2372fe4a6dafa0e4a0abd43d` (`sdn-js/package.json:100`) — **one commit behind** HEAD `0d53c54` (the workspace ROOT `space-data-network/package.json:84` carries a separate, older pin at `cfc9b538…`) (the commit that added `src/flow/` and the `"./flow"` export). The frozen-compat surface for sdn-js is therefore the *pinned commit's* exports, which do **not** include `./flow`.
10
+
11
+ ---
12
+
13
+ ## 1. Language/runtime matrix
14
+
15
+ Framing: **hosts** embed a runtime to execute SDN `.wasm` modules; **guests** are the languages modules are written in. All SDN modules are standalone-WASI wasm compiled from **C/C++ only** (emscripten `em++`/`emcc` selected in `selectCompiler`, `space-data-module-sdk/src/compiler/compileModule.js:78-84`; `STANDALONE_WASM=1` at `compileModule.js:130`). No Rust, AssemblyScript, TinyGo, or Python guests exist anywhere in the codebase.
16
+
17
+ | Host environment / language | Module runtime used | WasmEdge native? | Status in this codebase | Evidence |
18
+ |---|---|---|---|---|
19
+ | **Go node (`sdn-server`)** — Go | WasmEdge embedded in-process via CGO (`second-state/WasmEdge-go v0.14.0`) | **YES** (in-process, production) | **In use** — the production module runtime | `sdn-server/go.mod:27`; `internal/wasmrt/runtime.go:12,117-130` (`wasmedge.NewVMWithConfig`, THREADS/EXCEPTION_HANDLING/WASI); `internal/modulert/module.go:167-175` |
20
+ | **Browser** — JS/TS (sdn-js UI, OrbPro) | Plain `WebAssembly.instantiate` + pure-JS WASI shim + the `space_data_module_host` hostcall bridge (**the JS harness**) | **NO** — WasmEdge does not exist in browsers | **In use** — `createBrowserModuleHarness`, `createWorkerModuleHarness`, `createFlowRuntimeHost` | `sdn-js/src/ui/runtime/live-delivery.ts:2,204`; SDK `src/host/wasiShim.js:33`, `src/host/abi.js:10` (`DEFAULT_HOSTCALL_IMPORT_MODULE = "space_data_module_host"`, matching Go `internal/modulert/hostbridge.go:28`), `src/testing/browserModuleHarness.js:263,310,353`, `src/flow/flowRuntimeHost.js:36` |
21
+ | **Node.js — JS/TS, subprocess path** | WasmEdge **out-of-process**: `spawn("wasmedge", ...)` CLI, invoke request over stdin/stdout | Yes, but only as an external binary | **In use** (Node harness default for standalone artifacts) | SDK `src/host/isomorphicLoader.js:89,112`; `src/testing/processInvoke.js:111,131` |
22
+ | **Node.js — JS/TS, pure-JS path** | Plain V8 `WebAssembly` + the same browser harness (wasiShim + hostcall bridge) | NO | **In use** (vitest, isomorphic artifacts, no-wasmedge-binary environments) | `wasiShim.js:1-12` ("same .wasm that runs in WasmEdge … instantiated directly"); `browserModuleHarness.js:186,310` |
23
+ | **C** — native test runner | WasmEdge embedded via the C API (`wasmedge/wasmedge.h`) | **YES** (in-process, test-only) | **In use** (pthread module test runner only) | SDK `src/testing/native/wasmedge_emscripten_pthread_runner.c:9`; `src/testing/buildWasmEdgeRunner.js` |
24
+ | **C/C++** — as guest language | n/a (compiles to the wasm modules themselves) | n/a | **In use** — the *only* guest language | All module families (`propagator/*`, `foundation/*`, `comms/*`, closed-modules `*.cpp`); compiler supports exactly `.cpp → em++` / else `emcc` |
25
+ | **Rust** | WasmEdge Rust SDK (`wasmedge-sdk`) exists upstream | Would be native | **N/A — not used** (only vendored emsdk test fixtures contain `.rs`) | Zero `Cargo.toml` outside `deps/emsdk/.../test/rust/` |
26
+ | **Python** | WasmEdge Python SDK exists upstream (experimental) | Would be native | **N/A — not used** | No Python host or guest anywhere |
27
+ | **Java** | `wasmedge-java` exists upstream | Would be native | **N/A — not used** | No Java anywhere |
28
+ | **Node.js napi binding** (`wasmedge-core`) | — | — | **Deliberately not used** — project shells out to the CLI instead | No napi dep in SDK or `sdn-js/package.json` |
29
+
30
+ ### Definitive conclusion
31
+
32
+ - **Environments that NEED the JS-style harness** (WebAssembly.instantiate + `createBrowserWasiShim` + the `space_data_module_host` hostcall bridge): **the browser, always** (no WasmEdge exists there), and **Node.js** whenever the isomorphic/browser artifact path is used or no `wasmedge` binary is on PATH. This is the entire reason the harness exists and the reason the orbpro-integration runtime mirrors WasmEdge ABI semantics in JS.
33
+ - **Environments that run WasmEdge natively (in-process)**: **Go** (CGO bindings — the only production embedding) and **C** (C API — testing-only pthread runner). Nothing else.
34
+ - **Out-of-process WasmEdge**: Node.js via `spawn("wasmedge")` only.
35
+ - **Rust, Python, Java**: upstream WasmEdge SDKs exist but are not used and no work in this plan targets them. Any future host in those languages would embed WasmEdge natively and would **not** need the JS harness.
36
+ - The JS harness is therefore not a stopgap; it is the permanent execution tier for the browser and the WasmEdge-mirror reference for Node. That is why WS12.2 moves it into `space-data-module-sdk` (the package that already owns the browser/Node execution surface) rather than leaving it in orbpro-integration.
37
+
38
+ ---
39
+
40
+ ## 2. Port/dedupe plan — the 10 `orbpro-integration/sdk/src/runtime/` files
41
+
42
+ Conventions for WS12.2:
43
+
44
+ - Target base = the **0.8.5** SDK at `/Users/tj/software/orbpro-stack/repos/main-packages/OrbPro/packages/space-data-module-sdk`.
45
+ - **Generated-code precursor (corrected scope):** the harness imports `../generated/orbpro/{flow,manifest,stream,plugin}.js`. In the 0.8.5 SDK the **manifest namespace is already generated** (`src/generated/orbpro/manifest/plugin-manifest.js`, `PMAN` identifier at lines 30/248). What is **missing** is (a) the **flow namespace entirely** and (b) **`StreamInvokeRequest`/`StreamInvokeResponse` in the plugin namespace** (`src/generated/orbpro/plugin.js` exports only `RawDataPayload`). Regenerate both in the SDK tree as the WS12.2 precursor — do not import across packages. Note the SDK already hand-rolls StreamInvoke flatbuffer classes at `src/testing/streamInvokeCodec.js` (classes at lines 13/67/96): once the generated plugin namespace lands, `flowCodec.js` (#2) and `streamInvokeCodec.js` must converge on ONE implementation (the generated one), with `streamInvokeCodec.js` reduced to a re-export or deleted.
46
+ - The `sdn-flow` github pin: the harness's `sdk/package.json:83` pin is carried by `compiledFlowHost.js:1` and `MethodRegistry.js:1` (plus `tests/CompiledFlowHostSpec.js:4`). See #3/#6 — the pin **cannot be fully dropped in WS12.2** (production consumers of the bound-host API remain in orbpro-integration); the port removes the *SDK's* need for it and leaves a scoped follow-on.
47
+
48
+ | # | File (lines) | Verdict | Target / action |
49
+ |---|---|---|---|
50
+ | 1 | `bufferLike.js` (28) | **DROP** | Byte-identical twin already exists at SDK `src/runtime/bufferLike.js` (same three exports: `isArrayBufferLike`, `hasByteAddressableBuffer`, `toUint8Array`). Rewrite the two internal consumers (codec, streamBridge) to import from `../runtime/bufferLike.js`. Zero-risk deletion. |
51
+ | 2 | `codec.js` (94) | **PORT (split, with renames)** | The `StreamInvokeRequest/Response` + `FlowProgram` (`"FLOW"`) codecs are a **distinct envelope** from the SDK's existing `PluginInvokeRequest/Response` codec (`src/invoke/codec.js`) — do not conflate them. Port `encode/decodeFlowProgram` and `encode/decodeStreamInvoke{Request,Response}` to new SDK file `src/flow/flowCodec.js` (subsuming `src/testing/streamInvokeCodec.js`, see precursor). **The manifest codec does NOT merge**: the SDK's `encodePluginManifest` (`src/manifest/codec.js:258`) is `encodePlgManifest(legacyManifestToPlg(manifest))` — it emits a **`$PLG`**-identified buffer (`src/manifest/plgCodec.js:37`), consumed by `compileModule.js:830,889` and SDK `embeddedManifest.js:32` — while the harness's codec emits the **`PMAN`**-identified `PluginManifest` buffer that orbpro-integration's `sdk/src/embeddedManifest.js:5` depends on. These are different wire formats; both must exist. Port the PMAN pair with **renamed exports** `encodePluginManifestPman`/`decodePluginManifestPman` (avoids star-export collision with the PLG-flavored names in `src/manifest/index.js:7`/`browser.js:7` re-exported via `src/browser.js:1`), living in `src/flow/flowCodec.js` beside the flow codecs. Internal `toByteBuffer` moves with it. Browser-safe; only dep is `flatbuffers` (already an SDK dep). |
52
+ | 3 | `compiledFlowHost.js` (35) | **MERGE (option) + KEEP compat shim** | `createFlowRuntimeHost` (0.8.5 `src/flow/flowRuntimeHost.js`) already runs the compiled flow `runtime.wasm` with Go-parity ABI. Merge INTO it the one new behavior here: `withLegacyHostImportCompat` — the stub import module `sdn_flow_host` with `dispatch_current_invocation: () => 0` (caller entries win) so legacy artifacts instantiate under plain `WebAssembly.instantiate` — as an instantiate option (`legacyHostImportCompat: true` or an `extraImports` hook). **`bindCompiledFlowRuntimeHost` is NOT deleted**: it has production consumers — `orbpro-integration/default-suite.js:631,738` call `createDefaultPluginCompiledFlowHost` (`defaultRuntimeRegistry.js:164-166` → `bindOrbProCompiledFlowHost`), passing sdn-flow bound-host options and consuming the bound-host API (`host.runEntrypoint`, `host.dispatchNextReadyNodeWithHost`, `host.drainWithHost…`, `default-suite.js:668-700`) that the SDK host does not provide. The wrapper (and its `sdn-flow/host` import) stays in orbpro-integration as a compat adapter; migrating default-suite off the bound-host API onto the SDK flow host is a **follow-on task**, after which the sdk-package sdn-flow pin can go. |
53
+ | 4 | `FlowRuntime.js` (275) | **PORT** to `src/flow/jsFlowRuntime.js` | New capability: a **pure-JS FlowProgram interpreter** (no `runtime.wasm` needed) — the fallback/test-tier scheduler, complementing `flowRuntimeHost.js` which requires the compiled artifact. Port intact but **align contracts with the wasm host**: same backpressure policies (`queue`/`drop-oldest`/`drop-newest`, depth ≥1 or Infinity), same yield semantics (`response.yielded === true` breaks the drain), same default `maxInvocationsPerDrain = 1024`, and make `drain()`'s return shape (`{invocations, idle, queues}`) documented alongside `flowRuntimeHost.drain()`. It must invoke through the registry surface chosen in #6. Export as `space-data-module-sdk/flow` alongside `createFlowRuntimeHost`. Browser-safe; only sibling import is the normalizer (#8). |
54
+ | 5 | `index.js` (35) | **DROP** | The barrel is orbpro-integration packaging, not code. Its **18** names (8 codec fns + `bindOrbProCompiledFlowHost` + `createDependencyStreamBridge` + `MethodRegistry` + `FlowRuntime` + 5 sdnCompat exports + `generateLegacySdnShimSource`) get re-homed: flow pieces + flow/PMAN codecs → `./flow`, registry → `./runtime-host`, compat → new `./compat` (see #7), shim generator → `./compiler` (see #9); `bindOrbProCompiledFlowHost` stays in orbpro-integration (#3). The renamed PMAN exports (#2) prevent barrel collisions with the SDK's existing PLG-flavored `encodePluginManifest`/`decodePluginManifest`. Update the SDK `package.json` `exports` map and `src/browser.js` accordingly. orbpro-integration keeps a thin re-export barrel for back-compat (Section 3). |
55
+ | 6 | `MethodRegistry.js` (40) | **VENDOR sdn-flow's registry; wrapper stays thin** | The file itself is a 40-line wrapper, but the `sdn-flow/runtime` contract behind it is **not** small: at the pinned commit (`4dd28e2`, verified against the local baseline worktree) `sdn-flow/src/runtime/MethodRegistry.js` is 400 lines + `runtime/normalize.js` 506 lines, enforcing duplicate-pluginId and missing-per-method-handler rejection (:231/:245 — `defaultRuntimeRegistry.js:93-120` relies on these throws for its `registration-failed` reporting), required-input-port presence (:330), min/max distinct-stream bounds (:339-347), acceptedTypeSets frame-type rejection (:350-357), undeclared-input-port rejection (:362-367), internal-transport aligned-binary typeRef coercion with capability/interface exception sets (:10-28,:140-172), outputStreamCap overflow errors (:176-179), single-output portId defaulting (:181-188), and drainPolicy defaulting (:370-373). Reimplementing "lookup + call + normalization" would silently drop validation the ported specs assert. Plan: **vendor sdn-flow's `MethodRegistry.js` + `runtime/normalize.js` into the SDK** (`src/runtime-host/methodRegistry.js` + supporting normalize), preserving behavior verbatim (no github pin — vendored source), integrate with `createModuleRegistry` at the seams (manifest-aware `registerPlugin` accepting `PluginManifestT` \| flatbuffer bytes \| plain object via #8's normalizer), and keep the class-shaped `MethodRegistry` export. The five orbpro-integration spec files are the parity gate. |
56
+ | 7 | `sdnCompat.js` (449) | **PORT** to new `src/compat/sdnLegacy.js` (new `./compat` subpath) | No SDK equivalent exists for the legacy SDN metadata JSON envelope (`buildLegacySdnMetadata` — the exact snake_case JSON that `plugin_get_metadata` returns from a WasmEdge-loaded module) or the cron/protocol dispatch adapters (`SdnCompatAdapter.invokeCron/invokeProtocol` with `legacyBridge` context tagging, timer resolution by timerId-or-methodId, default-port stamping). This is the JS twin of the Go host's legacy surface and is consumed by the shim generator (#9). Port whole. Rewrites: generated imports (`manifest`, `stream` namespaces) → SDK generated tree; `decodePluginManifest` import → `decodePluginManifestPman` (#2); registry type → #6. Browser-safe (`TextEncoder` only). **Do not change any field name, enum casing (UPPER_SNAKE), or the BigInt `"<n>ms"` interval formatting — this JSON is a wire contract with the Go host.** |
57
+ | 8 | `sdnFlowAdapter.js` (276) | **PORT (internal)** to `src/flow/normalize.js` | Required by #4 and #6: `normalizeManifestForSdnFlow` / `normalizeProgramForSdnFlow` encode the ABI conventions (numeric flatbuffer enums → kebab-case strings, `maxBatch: 1` / `drain-until-yield` / `queue`/depth-1 defaults, schemaHash typed-array → plain array). Keep it **internal** — not in the exports map, exactly as it is today (never re-exported by the harness barrel). Since #6 vendors sdn-flow's registry (the sdn-flow reference stays meaningful), keep the exported names as-is. Rewrites: generated imports + `decodePluginManifestPman`/`decodeFlowProgram` from their new SDK homes. Browser-safe. |
58
+ | 9 | `sdnShimGenerator.js` (323) | **PORT** to `src/compiler/sdnShimGenerator.js` | The SDK-surface audit's confirmed gap: no hostcall/legacy-ABI codegen exists in the SDK (only build-side `compiler/invokeGlue.js`). This generates the C shim exporting the legacy WasmEdge-host ABI (`plugin_get_metadata` / `plugin_handle_request` / `plugin_cron`, caller-allocated buffers, int32 length-or-negative-error). Port whole into the compiler layer, next to its natural consumer (the build pipeline; orbpro-integration's `sdnArtifacts.js` writes its output as `sdn-compat-shim.c`). **The C template must be moved byte-identically**: error constants `-1..-5`, `EMSCRIPTEN_KEEPALIVE` exports, `\xNN` string escaping, memcmp method dispatch, and the single-protocol-method constraint of `resolveRequestMethodId` are all ABI/behavior contracts. Rewrites: generated manifest import, `decodePluginManifestPman` + `buildLegacySdnMetadata` from their new SDK homes (#2/#7). The file is browser-safe (pure string generation) even though it lives under the Node-leaning `./compiler` subpath — note that in the module docstring so a future browser build tool can import it. |
59
+ | 10 | `streamBridge.js` (234) | **PORT** to `src/flow/dependencyStreamBridge.js` | Fills the other confirmed gap: a flow host that can invoke **dependency wasm modules itself** (guest `malloc`/`free` arena staging, `TypedArenaBufferT` input framing with defaults alignment=8/BORROWED/IMMUTABLE, `invokeRawStream` with the `StreamInvokeRequest` envelope, copy-out of `(offset,size)` outputs via `cloneBytes` so bytes survive memory growth, guaranteed `release()` in `finally`, deduped output-pointer freeing). `flowRuntimeHost.drain()` currently delegates non-linked-direct nodes to caller-supplied JS handlers; this bridge is what turns a dependency descriptor's instantiated module into such a handler. Port whole; wire an optional integration in `flowRuntimeHost` so a caller can pass `{instantiatedDependency}` per dependencyId instead of a raw handler. Merge notes: import `toUint8Array`/`hasByteAddressableBuffer` from SDK `src/runtime/bufferLike.js` (#1), the StreamInvoke codecs from `src/flow/flowCodec.js` (#2), and converge its output-frame shape with `src/invoke/codec.js`'s TypedArenaBuffer materialization where field names differ (`traceToken` vs `traceId` — keep both readable, emit the harness's names for continuity). Do **not** replace it with the browser harness's direct surface: that speaks the *PluginInvokeRequest* envelope to `plugin_invoke_stream`; this speaks *StreamInvokeRequest* to `invokeRawStream`. They are different guest ABIs and both must exist. |
60
+
61
+ ### Summary of verdicts
62
+
63
+ - **DROP (2):** `bufferLike.js` (identical twin in SDK), `index.js` (packaging only; names re-homed on SDK subpaths, PMAN codecs renamed).
64
+ - **MERGE (1):** `compiledFlowHost.js` → its `withLegacyHostImportCompat` option merges into `src/flow/flowRuntimeHost.js`; the `bindCompiledFlowRuntimeHost` bound-host adapter **remains in orbpro-integration** (production consumers in `default-suite.js`).
65
+ - **VENDOR (1):** `MethodRegistry.js` — vendor sdn-flow's full registry + normalize into `src/runtime-host/` (validation semantics preserved verbatim).
66
+ - **PORT (6):** `codec.js` → `src/flow/flowCodec.js` (flow + StreamInvoke codecs; PMAN manifest codec as renamed `encode/decodePluginManifestPman`), `FlowRuntime.js` → `src/flow/jsFlowRuntime.js`, `sdnCompat.js` → `src/compat/sdnLegacy.js`, `sdnFlowAdapter.js` → `src/flow/normalize.js` (internal), `sdnShimGenerator.js` → `src/compiler/sdnShimGenerator.js`, `streamBridge.js` → `src/flow/dependencyStreamBridge.js`.
67
+ - Net effect: the SDK gains no new external dependencies (only `flatbuffers`, already present; sdn-flow arrives **vendored**, not pinned). The `sdn-flow` github pin at orbpro-integration `sdk/package.json:83` can be dropped only **after** the follow-on default-suite migration (#3); the root `orbpro-integration/package.json:94` pin and the `default-suite.js:99-100` lazy `sdn-flow/auth` + `sdn-flow/deploy` imports are out of scope for WS12.2 entirely.
68
+
69
+ ---
70
+
71
+ ## 3. Risks and constraints for WS12.2
72
+
73
+ 1. **Port into 0.8.5, not 0.8.4.** The copy at `/Users/tj/software/OrbPro/packages/space-data-module-sdk` is stale (v0.8.4, missing `src/flow/`, `workerModuleHarness`, `sabHostcallChannel.js`, `hostcallWire.js`, `timerDriver.js`). All merges above name 0.8.5-only files. Decide early whether the stale OrbPro copy gets synced or retired; do not let the two copies diverge further.
74
+ 2. **Do not disturb the existing SDK export surface.** sdn-js pins the SDK tarball directly at `53748bc92bdac04a2372fe4a6dafa0e4a0abd43d` (`sdn-js/package.json:100`; v0.8.5, one commit before `./flow` existed) and imports these subpaths: root, `/compiler`, `/host/timer-driver`, `/licensing`, `/runtime-host`, `/testing`, `/testing/browser`, `/testing/module-flatbuffer-stream-pump`, `/transport`. It does **not** import `./flow`. Additions to the exports map are fine; renames/removals of existing subpaths or `src/browser.js` re-exports are not.
75
+ 3. **orbpro-integration consumers must keep working.** Three surfaces depend on the harness today: (a) the public subpath `@orbpro/integration-sdk/runtime` (`sdk/package.json:18`) and the **18** names re-exported by `sdk/index.js:61-80` / `sdk/node.js`; (b) **deep imports** in `orbpro-integration/defaultRuntimeRegistry.js:1-2,12` (`FlowRuntime.js`, `MethodRegistry.js`, lazy `compiledFlowHost.js`); (c) in-SDK consumers `sdk/src/sdnArtifacts.js:3-6` and `sdk/src/embeddedManifest.js:5` (PMAN bytes — see #2). WS12.2 must leave **compat shims at the old file paths** (one-line re-exports from `space-data-module-sdk`) until OrbPro-side callers are migrated — especially the deep-imported files, which the barrel cannot cover.
76
+ 4. **Two invoke envelopes coexist; neither may change.** `PluginInvokeRequest/Response` (SDK `src/invoke/codec.js`, used by `plugin_invoke_stream` / `_start` surfaces, the worker harness, and the Go host) vs `StreamInvokeRequest/Response` (flow dependency `invokeRawStream` ABI). Keep them in separate files with distinct names; a unification refactor is out of scope and would break compiled artifacts.
77
+ 5. **Two manifest envelopes coexist; neither may change.** The SDK's `encodePluginManifest`/`decodePluginManifest` are **`$PLG`**-flavored (`src/manifest/codec.js:258` via `plgCodec.js`); the harness's are **`PMAN`**-flavored. The ported PMAN pair ships under the renamed `encodePluginManifestPman`/`decodePluginManifestPman` exports; consumers of each keep their exact bytes.
78
+ 6. **Wire/ABI contracts that must stay byte-identical:** the `"PMAN"` and `"FLOW"` flatbuffer file identifiers (and the fact that StreamInvoke envelopes have *no* identifier); the legacy metadata JSON field set/casing/`"<n>ms"` BigInt intervals (`buildLegacySdnMetadata`); the generated C shim template including error codes −1…−5 and export names; the `sdn_flow_host` import-module name and `dispatch_current_invocation` stub in the compat option; TypedArenaBuffer staging defaults (alignment 8, BORROWED, IMMUTABLE, generation 0); the `space_data_module_host` hostcall import-module name (`src/host/abi.js:10` = Go `hostbridge.go:28`).
79
+ 7. **Vendoring sdn-flow's registry — test parity is the gate.** The vendored `MethodRegistry` + `normalize` (#6) must behave identically to the pin; the five orbpro-integration spec files (`UnifiedRuntimeSpec`, `SdnCompatSpec`, `CompiledFlowHostSpec`, `StreamInvokeBridgeSpec`, `SdnShimGeneratorSpec`) must be ported alongside the code and pass against the SDK build before the shims land. `CompiledFlowHostSpec` imports layout constants from `sdn-flow/host` directly — rewrite those assertions against `flowRuntimeHost.js`'s own struct-layout constants (60/72/48/24/32/24-byte descriptors).
80
+ 8. **Browser-graph hygiene.** Everything ported is browser-safe (verified: zero `node:` imports across the 10 files). Keep it that way: `src/compat/sdnLegacy.js` and `src/flow/*` go into `src/browser.js`; the shim generator goes only under `./compiler` (Node-leaning) even though it is technically browser-safe; nothing ported may import `nodeHost.js`, `sdnArtifacts.js`-style `fs`/`path`, or the subprocess loaders.
81
+ 9. **Don't re-port what 0.8.5 already finished:** worker/SAB execution (`workerModuleHarness` + `sabHostcallChannel` + `hostcallWire`), cron/timer re-invocation (`timerDriver` + `cron.js`), isomorphic load/inspect (`isomorphicLoader`, `detectArtifactProfile`), and the compiled-flow wasm host's descriptor decoding (`flowRuntimeHost`). The port adds the JS interpreter tier, the dependency stream bridge, legacy compat, and the shim generator — nothing else.
82
+ 10. **Naming collision watch:** the SDK already exports `createModuleRegistry`; the vendored `MethodRegistry` must be documented as the flow-tier registry (validating, sdn-flow-derived) vs `createModuleRegistry` (module lifecycle) to avoid a third registry concept. Similarly `jsFlowRuntime` vs `createFlowRuntimeHost` need one doc page distinguishing "interpreter (no runtime.wasm)" from "compiled-artifact host (Go parity)".
@@ -0,0 +1,114 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 440" fill="none">
2
+ <defs>
3
+ <linearGradient id="bg2" x1="0" y1="0" x2="900" y2="440" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#0d1117"/>
5
+ <stop offset="1" stop-color="#161b22"/>
6
+ </linearGradient>
7
+ <marker id="arrow2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
8
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#484f58"/>
9
+ </marker>
10
+ <marker id="arrowBlue" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
11
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#58a6ff"/>
12
+ </marker>
13
+ <marker id="arrowGreen" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
14
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#3fb950"/>
15
+ </marker>
16
+ </defs>
17
+
18
+ <rect width="900" height="440" rx="12" fill="url(#bg2)"/>
19
+
20
+ <!-- Title -->
21
+ <text x="450" y="35" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="18" font-weight="700" fill="#e6edf3">Plugin Manifest &amp; Typed Streaming Ports</text>
22
+ <text x="450" y="55" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" fill="#8b949e">Modules declare typed I/O ports that accept FlatBuffer schemas from spacedatastandards.org</text>
23
+
24
+ <!-- Plugin Manifest Box -->
25
+ <rect x="30" y="75" width="250" height="340" rx="10" fill="#161b22" stroke="#58a6ff" stroke-width="1.5"/>
26
+ <rect x="30" y="75" width="250" height="30" rx="10" fill="#1f6feb" fill-opacity="0.15"/>
27
+ <text x="155" y="96" text-anchor="middle" font-family="monospace" font-size="12" font-weight="700" fill="#58a6ff">PluginManifest</text>
28
+
29
+ <!-- Manifest fields -->
30
+ <text x="50" y="128" font-family="monospace" font-size="10" fill="#f0883e">pluginId</text>
31
+ <text x="175" y="128" font-family="monospace" font-size="10" fill="#8b949e">"com.example.prop"</text>
32
+ <text x="50" y="148" font-family="monospace" font-size="10" fill="#f0883e">name</text>
33
+ <text x="175" y="148" font-family="monospace" font-size="10" fill="#8b949e">"Basic Propagator"</text>
34
+ <text x="50" y="168" font-family="monospace" font-size="10" fill="#f0883e">version</text>
35
+ <text x="175" y="168" font-family="monospace" font-size="10" fill="#8b949e">"0.1.0"</text>
36
+ <text x="50" y="188" font-family="monospace" font-size="10" fill="#f0883e">pluginFamily</text>
37
+ <text x="175" y="188" font-family="monospace" font-size="10" fill="#8b949e">"propagator"</text>
38
+ <text x="50" y="208" font-family="monospace" font-size="10" fill="#f0883e">capabilities</text>
39
+ <text x="175" y="208" font-family="monospace" font-size="10" fill="#8b949e">["clock"]</text>
40
+
41
+ <line x1="45" y1="220" x2="265" y2="220" stroke="#30363d" stroke-width="1"/>
42
+
43
+ <text x="50" y="240" font-family="monospace" font-size="10" fill="#bc8cff">methods[]</text>
44
+
45
+ <!-- Method box -->
46
+ <rect x="50" y="250" width="215" height="60" rx="6" fill="#1c2128" stroke="#bc8cff" stroke-width="1"/>
47
+ <text x="65" y="270" font-family="monospace" font-size="10" fill="#bc8cff">methodId</text>
48
+ <text x="155" y="270" font-family="monospace" font-size="10" fill="#8b949e">"propagate"</text>
49
+ <text x="65" y="290" font-family="monospace" font-size="10" fill="#bc8cff">drainPolicy</text>
50
+ <text x="155" y="290" font-family="monospace" font-size="10" fill="#8b949e">"drain-to-empty"</text>
51
+
52
+ <!-- Method detail: center area -->
53
+ <rect x="310" y="100" width="280" height="310" rx="10" fill="#161b22" stroke="#bc8cff" stroke-width="1.5"/>
54
+ <rect x="310" y="100" width="280" height="30" rx="10" fill="#8b5cf6" fill-opacity="0.1"/>
55
+ <text x="450" y="121" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="700" fill="#bc8cff">Method: propagate</text>
56
+
57
+ <!-- Input Port -->
58
+ <text x="330" y="155" font-family="system-ui, sans-serif" font-size="11" font-weight="600" fill="#58a6ff">inputPorts</text>
59
+
60
+ <rect x="330" y="165" width="240" height="80" rx="6" fill="#1c2128" stroke="#58a6ff" stroke-width="1"/>
61
+ <text x="345" y="185" font-family="monospace" font-size="10" fill="#58a6ff">portId: "request"</text>
62
+ <text x="345" y="205" font-family="monospace" font-size="10" fill="#8b949e">acceptedTypeSets:</text>
63
+ <rect x="355" y="212" width="200" height="22" rx="4" fill="#0d1117" stroke="#3fb950" stroke-width="1"/>
64
+ <text x="365" y="228" font-family="monospace" font-size="10" fill="#3fb950">OMM.fbs $OMM</text>
65
+
66
+ <!-- Output Port -->
67
+ <text x="330" y="270" font-family="system-ui, sans-serif" font-size="11" font-weight="600" fill="#f0883e">outputPorts</text>
68
+
69
+ <rect x="330" y="280" width="240" height="80" rx="6" fill="#1c2128" stroke="#f0883e" stroke-width="1"/>
70
+ <text x="345" y="300" font-family="monospace" font-size="10" fill="#f0883e">portId: "state"</text>
71
+ <text x="345" y="320" font-family="monospace" font-size="10" fill="#8b949e">acceptedTypeSets:</text>
72
+ <rect x="355" y="327" width="200" height="22" rx="4" fill="#0d1117" stroke="#3fb950" stroke-width="1"/>
73
+ <text x="365" y="343" font-family="monospace" font-size="10" fill="#3fb950">CAT.fbs $CAT</text>
74
+
75
+ <!-- Arrow: manifest -> method -->
76
+ <line x1="265" y1="280" x2="310" y2="230" stroke="#484f58" stroke-width="1.5" marker-end="url(#arrow2)"/>
77
+
78
+ <!-- Standards catalog -->
79
+ <rect x="630" y="100" width="240" height="310" rx="10" fill="#161b22" stroke="#3fb950" stroke-width="1.5"/>
80
+ <rect x="630" y="100" width="240" height="30" rx="10" fill="#238636" fill-opacity="0.1"/>
81
+ <text x="750" y="121" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="700" fill="#3fb950">spacedatastandards.org</text>
82
+
83
+ <!-- Standard entries -->
84
+ <rect x="650" y="145" width="200" height="35" rx="6" fill="#1c2128" stroke="#3fb950" stroke-width="1"/>
85
+ <text x="660" y="162" font-family="monospace" font-size="10" font-weight="600" fill="#3fb950">OMM</text>
86
+ <text x="700" y="162" font-family="monospace" font-size="9" fill="#8b949e">Orbit Mean-Elements Message</text>
87
+ <text x="660" y="174" font-family="monospace" font-size="9" fill="#484f58">file_identifier: "$OMM"</text>
88
+
89
+ <rect x="650" y="190" width="200" height="35" rx="6" fill="#1c2128" stroke="#3fb950" stroke-width="1"/>
90
+ <text x="660" y="207" font-family="monospace" font-size="10" font-weight="600" fill="#3fb950">CAT</text>
91
+ <text x="700" y="207" font-family="monospace" font-size="9" fill="#8b949e">Catalog (state vectors)</text>
92
+ <text x="660" y="219" font-family="monospace" font-size="9" fill="#484f58">file_identifier: "$CAT"</text>
93
+
94
+ <rect x="650" y="235" width="200" height="35" rx="6" fill="#1c2128" stroke="#3fb950" stroke-width="1"/>
95
+ <text x="660" y="252" font-family="monospace" font-size="10" font-weight="600" fill="#3fb950">EPM</text>
96
+ <text x="700" y="252" font-family="monospace" font-size="9" fill="#8b949e">Ephemeris Message</text>
97
+ <text x="660" y="264" font-family="monospace" font-size="9" fill="#484f58">file_identifier: "$EPM"</text>
98
+
99
+ <rect x="650" y="280" width="200" height="35" rx="6" fill="#1c2128" stroke="#3fb950" stroke-width="1"/>
100
+ <text x="660" y="297" font-family="monospace" font-size="10" font-weight="600" fill="#3fb950">CDM</text>
101
+ <text x="700" y="297" font-family="monospace" font-size="9" fill="#8b949e">Conjunction Data Message</text>
102
+ <text x="660" y="309" font-family="monospace" font-size="9" fill="#484f58">file_identifier: "$CDM"</text>
103
+
104
+ <rect x="650" y="325" width="200" height="35" rx="6" fill="#1c2128" stroke="#3fb950" stroke-width="1"/>
105
+ <text x="660" y="342" font-family="monospace" font-size="10" font-weight="600" fill="#3fb950">PLD</text>
106
+ <text x="700" y="342" font-family="monospace" font-size="9" fill="#8b949e">Planned Launch Data</text>
107
+ <text x="660" y="354" font-family="monospace" font-size="9" fill="#484f58">file_identifier: "$PLD"</text>
108
+
109
+ <text x="750" y="385" text-anchor="middle" font-family="monospace" font-size="10" fill="#484f58">... 40+ standards</text>
110
+
111
+ <!-- Arrows: ports -> standards -->
112
+ <line x1="555" y1="223" x2="650" y2="162" stroke="#3fb950" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrowGreen)"/>
113
+ <line x1="555" y1="338" x2="650" y2="297" stroke="#3fb950" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#arrowGreen)"/>
114
+ </svg>
@@ -0,0 +1,19 @@
1
+ # Superseded: Single-File Module Bundle Runtime Plan
2
+
3
+ This document is superseded by:
4
+
5
+ - [module-publication-standard.md](/Users/tj/software/OrbPro/packages/space-data-module-sdk/docs/module-publication-standard.md)
6
+ - [isomorphic-sdn-runtime-plan.md](/Users/tj/software/OrbPro/packages/space-data-module-sdk/docs/isomorphic-sdn-runtime-plan.md)
7
+
8
+ The old document is no longer current because:
9
+
10
+ - the canonical publication model now explicitly allows appended `REC` records carrying `PNM` and `ENC`
11
+ - the canonical runtime discussion has moved to the SDK runtime host model
12
+ - bundle/container concerns and runtime-host concerns are now documented separately
13
+
14
+ Current rule summary:
15
+
16
+ - the executable artifact is still canonical `.wasm`
17
+ - single-file bundle metadata is carried by an `MBL` record inside one appended `REC` trailer
18
+ - publication/signature/encryption metadata is carried in that same appended `REC` trailer when present
19
+ - runtime hosting is defined by the SDK runtime host, not by the bundle container itself
@@ -0,0 +1,70 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 200" fill="none">
2
+ <defs>
3
+ <linearGradient id="bg3" x1="0" y1="0" x2="900" y2="200" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#0d1117"/>
5
+ <stop offset="1" stop-color="#161b22"/>
6
+ </linearGradient>
7
+ <marker id="arrow3" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
8
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="#484f58"/>
9
+ </marker>
10
+ </defs>
11
+
12
+ <rect width="900" height="200" rx="12" fill="url(#bg3)"/>
13
+
14
+ <!-- Step 1: Author -->
15
+ <rect x="20" y="50" width="130" height="100" rx="10" fill="#161b22" stroke="#8b949e" stroke-width="1.5"/>
16
+ <circle cx="85" cy="80" r="14" fill="#1c2128" stroke="#8b949e" stroke-width="1.5"/>
17
+ <text x="85" y="85" text-anchor="middle" font-family="system-ui, sans-serif" font-size="14" fill="#8b949e">1</text>
18
+ <text x="85" y="112" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#e6edf3">Author</text>
19
+ <text x="85" y="130" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">manifest.json</text>
20
+ <text x="85" y="142" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">+ source code</text>
21
+
22
+ <line x1="150" y1="100" x2="175" y2="100" stroke="#484f58" stroke-width="2" marker-end="url(#arrow3)"/>
23
+
24
+ <!-- Step 2: Compile -->
25
+ <rect x="180" y="50" width="130" height="100" rx="10" fill="#161b22" stroke="#f0883e" stroke-width="1.5"/>
26
+ <circle cx="245" cy="80" r="14" fill="#1c2128" stroke="#f0883e" stroke-width="1.5"/>
27
+ <text x="245" y="85" text-anchor="middle" font-family="system-ui, sans-serif" font-size="14" fill="#f0883e">2</text>
28
+ <text x="245" y="112" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#e6edf3">Compile</text>
29
+ <text x="245" y="130" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">emcc/em++</text>
30
+ <text x="245" y="142" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">embed manifest</text>
31
+
32
+ <line x1="310" y1="100" x2="335" y2="100" stroke="#484f58" stroke-width="2" marker-end="url(#arrow3)"/>
33
+
34
+ <!-- Step 3: Validate -->
35
+ <rect x="340" y="50" width="130" height="100" rx="10" fill="#161b22" stroke="#3fb950" stroke-width="1.5"/>
36
+ <circle cx="405" cy="80" r="14" fill="#1c2128" stroke="#3fb950" stroke-width="1.5"/>
37
+ <text x="405" y="85" text-anchor="middle" font-family="system-ui, sans-serif" font-size="14" fill="#3fb950">3</text>
38
+ <text x="405" y="112" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#e6edf3">Validate</text>
39
+ <text x="405" y="130" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">compliance check</text>
40
+ <text x="405" y="142" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">+ ABI exports</text>
41
+
42
+ <line x1="470" y1="100" x2="495" y2="100" stroke="#484f58" stroke-width="2" marker-end="url(#arrow3)"/>
43
+
44
+ <!-- Step 4: Sign -->
45
+ <rect x="500" y="50" width="130" height="100" rx="10" fill="#161b22" stroke="#d29922" stroke-width="1.5"/>
46
+ <circle cx="565" cy="80" r="14" fill="#1c2128" stroke="#d29922" stroke-width="1.5"/>
47
+ <text x="565" y="85" text-anchor="middle" font-family="system-ui, sans-serif" font-size="14" fill="#d29922">4</text>
48
+ <text x="565" y="112" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#e6edf3">Sign</text>
49
+ <text x="565" y="130" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">HD wallet key</text>
50
+ <text x="565" y="142" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">deploy authz</text>
51
+
52
+ <line x1="630" y1="100" x2="655" y2="100" stroke="#484f58" stroke-width="2" marker-end="url(#arrow3)"/>
53
+
54
+ <!-- Step 5: Protect -->
55
+ <rect x="660" y="50" width="130" height="100" rx="10" fill="#161b22" stroke="#f778ba" stroke-width="1.5"/>
56
+ <circle cx="725" cy="80" r="14" fill="#1c2128" stroke="#f778ba" stroke-width="1.5"/>
57
+ <text x="725" y="85" text-anchor="middle" font-family="system-ui, sans-serif" font-size="14" fill="#f778ba">5</text>
58
+ <text x="725" y="112" text-anchor="middle" font-family="system-ui, sans-serif" font-size="12" font-weight="600" fill="#e6edf3">Protect</text>
59
+ <text x="725" y="130" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">X25519 encrypt</text>
60
+ <text x="725" y="142" text-anchor="middle" font-family="monospace" font-size="9" fill="#8b949e">for recipient</text>
61
+
62
+ <!-- Checkmark -->
63
+ <line x1="790" y1="100" x2="815" y2="100" stroke="#484f58" stroke-width="2" marker-end="url(#arrow3)"/>
64
+
65
+ <rect x="820" y="60" width="60" height="80" rx="10" fill="#238636" fill-opacity="0.15" stroke="#3fb950" stroke-width="1.5"/>
66
+ <text x="850" y="107" text-anchor="middle" font-family="system-ui, sans-serif" font-size="26" fill="#3fb950">&#x2713;</text>
67
+
68
+ <!-- Bottom label -->
69
+ <text x="450" y="185" text-anchor="middle" font-family="system-ui, sans-serif" font-size="11" fill="#484f58">Each step is independently usable via the SDK API or the CLI</text>
70
+ </svg>