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.
- package/README.md +117 -20
- package/bin/space-data-module.js +263 -0
- package/docs/.nojekyll +1 -0
- package/docs/AGENTS.md +34 -0
- package/docs/architecture.svg +141 -0
- package/docs/browser-wasmedge-isomorphic.md +179 -0
- package/docs/flatsql-streaming-standard.md +341 -0
- package/docs/gpu-module-abi.md +193 -0
- package/docs/index.html +125 -0
- package/docs/isomorphic-pthreads.md +188 -0
- package/docs/isomorphic-sdn-runtime-plan.md +167 -0
- package/docs/language-runtime-matrix.md +82 -0
- package/docs/manifest-structure.svg +114 -0
- package/docs/module-bundle-runtime-plan.md +19 -0
- package/docs/module-lifecycle.svg +70 -0
- package/docs/module-publication-standard.md +540 -0
- package/docs/node-red-default-node-parity.md +88 -0
- package/docs/protocol-installation.md +196 -0
- package/docs/secrets-capability.md +152 -0
- package/docs/styles.css +288 -0
- package/docs/testing-harness.md +408 -0
- package/docs/tri-runtime-parity.md +132 -0
- package/docs/wallet-callback.html +2 -0
- package/package.json +25 -6
- package/schemas/HttpRequestAbi.fbs +41 -0
- package/schemas/HttpResponseAbi.fbs +36 -0
- package/schemas/PluginManifest.fbs +2 -1
- package/src/AGENTS.md +1 -1
- package/src/app/codec.js +548 -0
- package/src/app/index.js +6 -0
- package/src/browser.js +5 -0
- package/src/bundle/constants.js +1 -0
- package/src/bundle/index.js +15 -0
- package/src/bundle/sigdomain.js +179 -0
- package/src/bundle/signing.js +767 -0
- package/src/bundle/wasm.js +3 -2
- package/src/capabilities.js +3 -0
- package/src/compat/index.js +7 -0
- package/src/compat/sdnLegacy.js +449 -0
- package/src/compiler/compileModule.js +556 -55
- package/src/compiler/flatcSupport.js +41 -27
- package/src/compiler/index.d.ts +2 -0
- package/src/compiler/index.js +18 -0
- package/src/compiler/invokeGlue.js +1212 -183
- package/src/compiler/pthreadArtifactGuard.js +910 -0
- package/src/compiler/sdnShimGenerator.js +323 -0
- package/src/compiler/wasiThreadsToolchain.js +150 -0
- package/src/compliance/index.js +11 -1
- package/src/compliance/legacyWildcardPorts.js +228 -0
- package/src/compliance/pluginCompliance.js +1000 -96
- package/src/field-stream/index.d.ts +31 -0
- package/src/field-stream/index.js +119 -0
- package/src/flow/dependencyStreamBridge.js +234 -0
- package/src/flow/flatsqlLinkShim.js +304 -0
- package/src/flow/flowCodec.js +107 -0
- package/src/flow/flowCompiler.js +2900 -0
- package/src/flow/flowRuntimeHost.js +877 -0
- package/src/flow/index.d.ts +117 -0
- package/src/flow/index.js +31 -0
- package/src/flow/isomorphicFlowHost.js +384 -0
- package/src/flow/jsFlowRuntime.js +275 -0
- package/src/flow/normalize.js +294 -0
- package/src/flow/runtime-src/flow_runtime.cpp +1699 -0
- package/src/flow/vendor/sdn-flow/MethodRegistry.js +400 -0
- package/src/flow/vendor/sdn-flow/constants.js +39 -0
- package/src/flow/vendor/sdn-flow/index.js +29 -0
- package/src/flow/vendor/sdn-flow/normalize.js +506 -0
- package/src/flow/vendor/sdn-flow/wasmCompatibility.js +189 -0
- package/src/generated/http/cpp/HttpRequestAbi_generated.h +285 -0
- package/src/generated/http/cpp/HttpResponseAbi_generated.h +192 -0
- package/src/generated/http/sdn/http/http-header.js +53 -0
- package/src/generated/http/sdn/http/http-header.ts +67 -0
- package/src/generated/http/sdn/http/http-request.js +132 -0
- package/src/generated/http/sdn/http/http-request.ts +179 -0
- package/src/generated/http/sdn/http/http-response.js +144 -0
- package/src/generated/http/sdn/http/http-response.ts +168 -0
- package/src/generated/http/sdn/http.js +11 -0
- package/src/generated/http/sdn/http.ts +4 -0
- package/src/generated/orbpro/flow/backpressure-policy.d.ts +12 -0
- package/src/generated/orbpro/flow/backpressure-policy.d.ts.map +1 -0
- package/src/generated/orbpro/flow/backpressure-policy.js +17 -0
- package/src/generated/orbpro/flow/backpressure-policy.js.map +1 -0
- package/src/generated/orbpro/flow/backpressure-policy.ts +15 -0
- package/src/generated/orbpro/flow/flow-bundle-manifest.d.ts +142 -0
- package/src/generated/orbpro/flow/flow-bundle-manifest.d.ts.map +1 -0
- package/src/generated/orbpro/flow/flow-bundle-manifest.js +304 -0
- package/src/generated/orbpro/flow/flow-bundle-manifest.js.map +1 -0
- package/src/generated/orbpro/flow/flow-bundle-manifest.ts +399 -0
- package/src/generated/orbpro/flow/flow-edge.d.ts +113 -0
- package/src/generated/orbpro/flow/flow-edge.d.ts.map +1 -0
- package/src/generated/orbpro/flow/flow-edge.js +221 -0
- package/src/generated/orbpro/flow/flow-edge.js.map +1 -0
- package/src/generated/orbpro/flow/flow-edge.ts +292 -0
- package/src/generated/orbpro/flow/flow-node.d.ts +80 -0
- package/src/generated/orbpro/flow/flow-node.d.ts.map +1 -0
- package/src/generated/orbpro/flow/flow-node.js +158 -0
- package/src/generated/orbpro/flow/flow-node.js.map +1 -0
- package/src/generated/orbpro/flow/flow-node.ts +202 -0
- package/src/generated/orbpro/flow/flow-program.d.ts +164 -0
- package/src/generated/orbpro/flow/flow-program.d.ts.map +1 -0
- package/src/generated/orbpro/flow/flow-program.js +350 -0
- package/src/generated/orbpro/flow/flow-program.js.map +1 -0
- package/src/generated/orbpro/flow/flow-program.ts +477 -0
- package/src/generated/orbpro/flow/flow-trigger.d.ts +108 -0
- package/src/generated/orbpro/flow/flow-trigger.d.ts.map +1 -0
- package/src/generated/orbpro/flow/flow-trigger.js +207 -0
- package/src/generated/orbpro/flow/flow-trigger.js.map +1 -0
- package/src/generated/orbpro/flow/flow-trigger.ts +276 -0
- package/src/generated/orbpro/flow/node-kind.d.ts +13 -0
- package/src/generated/orbpro/flow/node-kind.d.ts.map +1 -0
- package/src/generated/orbpro/flow/node-kind.js +16 -0
- package/src/generated/orbpro/flow/node-kind.js.map +1 -0
- package/src/generated/orbpro/{invoke.ts → flow/node-kind.ts} +12 -2
- package/src/generated/orbpro/flow/plugin-version-binding.d.ts +52 -0
- package/src/generated/orbpro/flow/plugin-version-binding.d.ts.map +1 -0
- package/src/generated/orbpro/flow/plugin-version-binding.js +85 -0
- package/src/generated/orbpro/flow/plugin-version-binding.js.map +1 -0
- package/src/generated/orbpro/flow/plugin-version-binding.ts +121 -0
- package/src/generated/orbpro/flow/schema-hash-binding.d.ts +70 -0
- package/src/generated/orbpro/flow/schema-hash-binding.d.ts.map +1 -0
- package/src/generated/orbpro/flow/schema-hash-binding.js +143 -0
- package/src/generated/orbpro/flow/schema-hash-binding.js.map +1 -0
- package/src/generated/orbpro/flow/schema-hash-binding.ts +189 -0
- package/src/generated/orbpro/flow/trigger-binding.d.ts +71 -0
- package/src/generated/orbpro/flow/trigger-binding.d.ts.map +1 -0
- package/src/generated/orbpro/flow/trigger-binding.js +142 -0
- package/src/generated/orbpro/flow/trigger-binding.js.map +1 -0
- package/src/generated/orbpro/flow/trigger-binding.ts +181 -0
- package/src/generated/orbpro/flow/trigger-kind.d.ts +14 -0
- package/src/generated/orbpro/flow/trigger-kind.d.ts.map +1 -0
- package/src/generated/orbpro/flow/trigger-kind.js +17 -0
- package/src/generated/orbpro/flow/trigger-kind.js.map +1 -0
- package/src/generated/orbpro/flow/trigger-kind.ts +17 -0
- package/src/generated/orbpro/flow.d.ts +21 -0
- package/src/generated/orbpro/flow.d.ts.map +1 -0
- package/src/generated/orbpro/flow.js +23 -0
- package/src/generated/orbpro/flow.js.map +1 -0
- package/src/generated/orbpro/flow.ts +24 -0
- package/src/generated/orbpro/manifest/capability-kind.d.ts +2 -1
- package/src/generated/orbpro/manifest/capability-kind.js +1 -0
- package/src/generated/orbpro/manifest/capability-kind.ts +1 -0
- package/src/generated/orbpro/plugin/stream-invoke-request.d.ts +93 -0
- package/src/generated/orbpro/plugin/stream-invoke-request.js +160 -0
- package/src/generated/orbpro/plugin/stream-invoke-request.ts +211 -0
- package/src/generated/orbpro/plugin/stream-invoke-response.d.ts +99 -0
- package/src/generated/orbpro/plugin/stream-invoke-response.js +175 -0
- package/src/generated/orbpro/plugin/stream-invoke-response.ts +226 -0
- package/src/generated/orbpro/plugin.js +8 -0
- package/src/generated/orbpro/stream.d.ts +12 -0
- package/src/generated/orbpro/stream.js +14 -0
- package/src/generated/orbpro/stream.ts +15 -0
- package/src/generated/spacedatastandards/plg/EntryFunction.d.ts +52 -0
- package/src/generated/spacedatastandards/plg/EntryFunction.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/EntryFunction.js +106 -0
- package/src/generated/spacedatastandards/plg/EntryFunction.ts +162 -0
- package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.d.ts +90 -0
- package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.js +189 -0
- package/src/generated/spacedatastandards/plg/FlatBufferTypeRef.ts +270 -0
- package/src/generated/spacedatastandards/plg/PLG.d.ts +492 -0
- package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLG.js +1139 -0
- package/src/generated/spacedatastandards/plg/PLG.ts +1600 -0
- package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.d.ts +63 -0
- package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.js +138 -0
- package/src/generated/spacedatastandards/plg/PLGAcceptedTypeSet.ts +189 -0
- package/src/generated/spacedatastandards/plg/PLGBuildArtifact.d.ts +41 -0
- package/src/generated/spacedatastandards/plg/PLGBuildArtifact.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGBuildArtifact.js +104 -0
- package/src/generated/spacedatastandards/plg/PLGBuildArtifact.ts +151 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdge.d.ts +68 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdge.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdge.js +124 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdge.ts +184 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.d.ts +58 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.js +126 -0
- package/src/generated/spacedatastandards/plg/PLGFlowEdgeContract.ts +161 -0
- package/src/generated/spacedatastandards/plg/PLGFlowNode.d.ts +82 -0
- package/src/generated/spacedatastandards/plg/PLGFlowNode.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGFlowNode.js +164 -0
- package/src/generated/spacedatastandards/plg/PLGFlowNode.ts +244 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTrigger.d.ts +55 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTrigger.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTrigger.js +105 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTrigger.ts +162 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.d.ts +42 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.js +83 -0
- package/src/generated/spacedatastandards/plg/PLGFlowTriggerBinding.ts +127 -0
- package/src/generated/spacedatastandards/plg/PLGHostCapability.d.ts +36 -0
- package/src/generated/spacedatastandards/plg/PLGHostCapability.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGHostCapability.js +90 -0
- package/src/generated/spacedatastandards/plg/PLGHostCapability.ts +127 -0
- package/src/generated/spacedatastandards/plg/PLGMethodManifest.d.ts +53 -0
- package/src/generated/spacedatastandards/plg/PLGMethodManifest.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGMethodManifest.js +153 -0
- package/src/generated/spacedatastandards/plg/PLGMethodManifest.ts +210 -0
- package/src/generated/spacedatastandards/plg/PLGPortManifest.d.ts +70 -0
- package/src/generated/spacedatastandards/plg/PLGPortManifest.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGPortManifest.js +149 -0
- package/src/generated/spacedatastandards/plg/PLGPortManifest.ts +212 -0
- package/src/generated/spacedatastandards/plg/PLGProtocolSpec.d.ts +73 -0
- package/src/generated/spacedatastandards/plg/PLGProtocolSpec.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGProtocolSpec.js +199 -0
- package/src/generated/spacedatastandards/plg/PLGProtocolSpec.ts +292 -0
- package/src/generated/spacedatastandards/plg/PLGTimerSpec.d.ts +40 -0
- package/src/generated/spacedatastandards/plg/PLGTimerSpec.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PLGTimerSpec.js +103 -0
- package/src/generated/spacedatastandards/plg/PLGTimerSpec.ts +148 -0
- package/src/generated/spacedatastandards/plg/PluginCapability.d.ts +41 -0
- package/src/generated/spacedatastandards/plg/PluginCapability.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PluginCapability.js +82 -0
- package/src/generated/spacedatastandards/plg/{plugin-capability.ts → PluginCapability.ts} +55 -18
- package/src/generated/spacedatastandards/plg/PluginDependency.d.ts +42 -0
- package/src/generated/spacedatastandards/plg/PluginDependency.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/PluginDependency.js +80 -0
- package/src/generated/spacedatastandards/plg/PluginDependency.ts +124 -0
- package/src/generated/spacedatastandards/plg/TAB.d.ts +85 -0
- package/src/generated/spacedatastandards/plg/TAB.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/TAB.js +173 -0
- package/src/generated/spacedatastandards/plg/TAB.ts +228 -0
- package/src/generated/spacedatastandards/plg/bufferMutability.d.ts +18 -0
- package/src/generated/spacedatastandards/plg/bufferMutability.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/bufferMutability.js +20 -0
- package/src/generated/spacedatastandards/plg/bufferMutability.ts +23 -0
- package/src/generated/spacedatastandards/plg/bufferOwnership.d.ts +18 -0
- package/src/generated/spacedatastandards/plg/bufferOwnership.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/bufferOwnership.js +20 -0
- package/src/generated/spacedatastandards/plg/bufferOwnership.ts +23 -0
- package/src/generated/spacedatastandards/plg/drainBehavior.d.ts +20 -0
- package/src/generated/spacedatastandards/plg/drainBehavior.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/drainBehavior.js +22 -0
- package/src/generated/spacedatastandards/plg/drainBehavior.ts +25 -0
- package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.d.ts +10 -0
- package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.js +12 -0
- package/src/generated/spacedatastandards/plg/flowEdgeRoutePolicy.ts +13 -0
- package/src/generated/spacedatastandards/plg/hostCapabilityKind.d.ts +51 -0
- package/src/generated/spacedatastandards/plg/hostCapabilityKind.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/hostCapabilityKind.js +53 -0
- package/src/generated/spacedatastandards/plg/hostCapabilityKind.ts +55 -0
- package/src/generated/spacedatastandards/plg/invokeSurfaceKind.d.ts +15 -0
- package/src/generated/spacedatastandards/plg/invokeSurfaceKind.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/invokeSurfaceKind.js +17 -0
- package/src/generated/spacedatastandards/plg/invokeSurfaceKind.ts +19 -0
- package/src/generated/spacedatastandards/plg/main.d.ts +29 -0
- package/src/generated/spacedatastandards/plg/main.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/main.js +30 -0
- package/src/generated/spacedatastandards/plg/main.ts +32 -0
- package/src/generated/spacedatastandards/plg/payloadWireFormat.d.ts +17 -0
- package/src/generated/spacedatastandards/plg/payloadWireFormat.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/payloadWireFormat.js +19 -0
- package/src/generated/spacedatastandards/plg/payloadWireFormat.ts +21 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts +82 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.js +84 -0
- package/src/generated/spacedatastandards/plg/pluginCategory.ts +103 -0
- package/src/generated/spacedatastandards/plg/publicationState.d.ts +18 -0
- package/src/generated/spacedatastandards/plg/publicationState.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/publicationState.js +20 -0
- package/src/generated/spacedatastandards/plg/purchaseTier.d.ts +18 -0
- package/src/generated/spacedatastandards/plg/purchaseTier.d.ts.map +1 -0
- package/src/generated/spacedatastandards/plg/purchaseTier.js +20 -0
- package/src/host/AGENTS.md +2 -2
- package/src/host/abi.js +53 -66
- package/src/host/browserHost.js +355 -8
- package/src/host/cpp/keyslotClient.hpp +231 -0
- package/src/host/cpp/secretsClient.hpp +583 -0
- package/src/host/hostcallWire.js +183 -0
- package/src/host/index.js +2 -0
- package/src/host/isomorphicLoader.js +44 -7
- package/src/host/nodeHost.js +227 -8
- package/src/host/sabHostcallChannel.js +206 -0
- package/src/host/timerDriver.js +203 -0
- package/src/host/wasiShim.js +41 -1
- package/src/host/wasiThreadBrowserWorker.mjs +48 -0
- package/src/host/wasiThreadHost.js +393 -0
- package/src/host/wasiThreadWorker.mjs +32 -0
- package/src/host/wasiThreadWorkerRuntime.js +93 -0
- package/src/http/index.js +339 -0
- package/src/index.d.ts +725 -11
- package/src/index.js +4 -0
- package/src/invoke/codec.js +1202 -128
- package/src/invoke/index.js +5 -1
- package/src/licensing/index.d.ts +2 -0
- package/src/licensing/index.js +2 -0
- package/src/licensing/records.js +287 -8
- package/src/manifest/codec.js +62 -14
- package/src/manifest/index.js +2 -0
- package/src/manifest/legacyToPlg.js +164 -25
- package/src/manifest/normalize.js +1 -0
- package/src/manifest/plgCodec.js +1303 -62
- package/src/manifest/typeRefs.js +162 -24
- package/src/runtime/compiledRuntimeAbi.js +47 -0
- package/src/runtime/compiledRuntimeAbi.json +33 -0
- package/src/runtime/index.d.ts +32 -0
- package/src/runtime/index.js +1 -0
- package/src/runtime-host/index.js +3 -0
- package/src/runtime-host/methodRegistry.js +55 -0
- package/src/standards/index.js +200 -56
- package/src/standards/sharedCatalog.js +16 -0
- package/src/testing/browserModuleHarness.js +604 -31
- package/src/testing/docker/wasmedge-parity.Dockerfile +39 -0
- package/src/testing/index.d.ts +151 -0
- package/src/testing/index.js +21 -0
- package/src/testing/native/wasmedge_emscripten_pthread_runner.c +25 -1
- package/src/testing/parityBrowserRunner.js +138 -0
- package/src/testing/parityHarness.js +616 -0
- package/src/testing/parityLanes.js +537 -0
- package/src/testing/processInvoke.js +29 -21
- package/src/testing/streamInvokeCodec.js +10 -175
- package/src/testing/wasmedgePin.json +6 -0
- package/src/testing/workerModuleHarness.js +242 -0
- package/src/testing/workerModuleHarnessWorker.js +176 -0
- package/src/transport/index.js +3 -0
- package/src/transport/pki.js +352 -14
- package/src/transport/records.js +16 -7
- package/src/utils/ecdsaDer.js +106 -0
- package/src/utils/wasmCrypto.js +0 -43
- package/templates/gpu-module/README.md +48 -0
- package/templates/gpu-module/include/space_data_gpu_abi.h +122 -0
- package/templates/gpu-module/manifest.json +84 -0
- package/schemas/PluginInvokeRequest.fbs +0 -18
- package/schemas/PluginInvokeResponse.fbs +0 -30
- package/schemas/spacedatastandards/PLG.fbs +0 -191
- package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts +0 -51
- package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts.map +0 -1
- package/src/generated/orbpro/invoke/plugin-invoke-request.js +0 -131
- package/src/generated/orbpro/invoke/plugin-invoke-request.js.map +0 -1
- package/src/generated/orbpro/invoke/plugin-invoke-request.ts +0 -173
- package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts +0 -76
- package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts.map +0 -1
- package/src/generated/orbpro/invoke/plugin-invoke-response.js +0 -184
- package/src/generated/orbpro/invoke/plugin-invoke-response.js.map +0 -1
- package/src/generated/orbpro/invoke/plugin-invoke-response.ts +0 -243
- package/src/generated/orbpro/invoke.d.ts +0 -3
- package/src/generated/orbpro/invoke.js +0 -5
- package/src/generated/spacedatastandards/plg/entry-function.js +0 -86
- package/src/generated/spacedatastandards/plg/entry-function.ts +0 -119
- package/src/generated/spacedatastandards/plg/index.js +0 -16
- package/src/generated/spacedatastandards/plg/index.ts +0 -11
- package/src/generated/spacedatastandards/plg/plg.js +0 -657
- package/src/generated/spacedatastandards/plg/plg.ts +0 -924
- package/src/generated/spacedatastandards/plg/plugin-capability.js +0 -66
- package/src/generated/spacedatastandards/plg/plugin-category.js +0 -15
- package/src/generated/spacedatastandards/plg/plugin-category.ts +0 -53
- package/src/generated/spacedatastandards/plg/plugin-dependency.js +0 -63
- package/src/generated/spacedatastandards/plg/plugin-dependency.ts +0 -86
- package/src/generated/spacedatastandards/plg/publication-state.js +0 -9
- package/src/generated/spacedatastandards/plg/purchase-tier.js +0 -9
- /package/src/generated/spacedatastandards/plg/{publication-state.ts → publicationState.ts} +0 -0
- /package/src/generated/spacedatastandards/plg/{purchase-tier.ts → purchaseTier.ts} +0 -0
package/src/standards/index.js
CHANGED
|
@@ -3,31 +3,78 @@ import path from "node:path";
|
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
|
|
5
5
|
import { sharedModuleCatalog } from "./sharedCatalog.js";
|
|
6
|
+
import { normalizePayloadSchemaHash } from "../manifest/typeRefs.js";
|
|
6
7
|
|
|
7
8
|
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
const standardsCatalogPromises = new Map();
|
|
10
|
+
const knownTypeCatalogPromises = new Map();
|
|
11
|
+
const requiredCurrentScvTokens = Object.freeze([
|
|
12
|
+
"SENSOR_LOCAL",
|
|
13
|
+
"table SCVResult",
|
|
14
|
+
"table SCVSensorShapeContract",
|
|
15
|
+
"SAR_ANNULAR_SECTOR",
|
|
16
|
+
"enum scvSensorRangeBoundaryKind",
|
|
17
|
+
"table SCVAggregateStatistics",
|
|
18
|
+
"AGGREGATE_STATISTICS:SCVAggregateStatistics",
|
|
19
|
+
"table SCVPackedRasterProducts",
|
|
20
|
+
"table SCVPackedRasterBand",
|
|
21
|
+
"RASTER_PRODUCTS:SCVPackedRasterProducts",
|
|
22
|
+
"enum scvRasterProductKind",
|
|
23
|
+
]);
|
|
24
|
+
const currentScvResultFields = Object.freeze(
|
|
25
|
+
new Set([
|
|
26
|
+
"JOB_ID",
|
|
27
|
+
"TRACE_ID",
|
|
28
|
+
"STATUS",
|
|
29
|
+
"TIME_GRID",
|
|
30
|
+
"TARGET_BODY",
|
|
31
|
+
"TOTAL_SENSORS",
|
|
32
|
+
"TOTAL_WINDOWS",
|
|
33
|
+
"CELL_STATS",
|
|
34
|
+
"INTERVALS",
|
|
35
|
+
"LATITUDE_BANDS",
|
|
36
|
+
"TIME_SERIES",
|
|
37
|
+
"HISTOGRAMS",
|
|
38
|
+
"CONTRIBUTIONS",
|
|
39
|
+
"GEOMETRY",
|
|
40
|
+
"RASTER_PRODUCTS",
|
|
41
|
+
"MESSAGE",
|
|
42
|
+
"AGGREGATE_STATISTICS",
|
|
43
|
+
"TARGET_RESULTS",
|
|
44
|
+
]),
|
|
45
|
+
);
|
|
10
46
|
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!trimmed) {
|
|
18
|
-
return "";
|
|
47
|
+
function collectFlatbufferTableFields(idl, tableName) {
|
|
48
|
+
const match = String(idl ?? "").match(
|
|
49
|
+
new RegExp(`\\btable\\s+${tableName}\\s*\\{([\\s\\S]*?)\\n\\}`, "m"),
|
|
50
|
+
);
|
|
51
|
+
if (!match) {
|
|
52
|
+
return [];
|
|
19
53
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
return match[1]
|
|
55
|
+
.split("\n")
|
|
56
|
+
.map((line) => line.replace(/\/\/.*$/, "").trim())
|
|
57
|
+
.map((line) => line.match(/^([A-Z0-9_]+)\s*:/)?.[1] ?? null)
|
|
58
|
+
.filter(Boolean);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function resolveStandardsManifestPath(options = {}) {
|
|
62
|
+
const standardsRoot =
|
|
63
|
+
options.standardsRoot ?? process.env.SPACE_DATA_STANDARDS_ROOT;
|
|
64
|
+
if (typeof standardsRoot === "string" && standardsRoot.trim().length > 0) {
|
|
65
|
+
return path.join(standardsRoot, "dist", "manifest.json");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const packageEntry = require.resolve("spacedatastandards.org");
|
|
69
|
+
return path.join(path.dirname(packageEntry), "dist", "manifest.json");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function normalizeSchemaName(value) {
|
|
73
|
+
return value === undefined || value === null ? "" : String(value);
|
|
24
74
|
}
|
|
25
75
|
|
|
26
76
|
function normalizeFileIdentifier(value) {
|
|
27
|
-
return
|
|
28
|
-
.trim()
|
|
29
|
-
.replace(/^\$/, "")
|
|
30
|
-
.toUpperCase();
|
|
77
|
+
return value === undefined || value === null ? "" : String(value);
|
|
31
78
|
}
|
|
32
79
|
|
|
33
80
|
function parseStandardsEntry([schemaCode, entry]) {
|
|
@@ -35,6 +82,7 @@ function parseStandardsEntry([schemaCode, entry]) {
|
|
|
35
82
|
const fileIdentifierMatch = idl.match(/file_identifier\s+"([^"]+)"/i);
|
|
36
83
|
const hashMatch = idl.match(/\/\/ Hash:\s*([a-f0-9]+)/i);
|
|
37
84
|
const versionMatch = idl.match(/\/\/ Version:\s*([^\n]+)/i);
|
|
85
|
+
const rootTypeMatch = idl.match(/root_type\s+([A-Za-z_][A-Za-z0-9_.]*)\s*;/i);
|
|
38
86
|
return {
|
|
39
87
|
schemaCode: schemaCode.toUpperCase(),
|
|
40
88
|
schemaName: `${schemaCode.toUpperCase()}.fbs`,
|
|
@@ -42,55 +90,106 @@ function parseStandardsEntry([schemaCode, entry]) {
|
|
|
42
90
|
? normalizeFileIdentifier(fileIdentifierMatch[1])
|
|
43
91
|
: null,
|
|
44
92
|
hash: hashMatch ? hashMatch[1].toLowerCase() : null,
|
|
93
|
+
rootTypeName: rootTypeMatch ? rootTypeMatch[1] : null,
|
|
94
|
+
idl,
|
|
45
95
|
version: versionMatch ? versionMatch[1].trim() : null,
|
|
46
96
|
files: Array.isArray(entry?.files) ? entry.files : [],
|
|
47
97
|
};
|
|
48
98
|
}
|
|
49
99
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
100
|
+
function validateStandardsCatalogFreshness(catalog, sourceName) {
|
|
101
|
+
const issues = [];
|
|
102
|
+
const scvEntry = catalog.find((entry) => entry.schemaCode === "SCV");
|
|
103
|
+
if (!scvEntry) {
|
|
104
|
+
return issues;
|
|
105
|
+
}
|
|
106
|
+
const missingTokens = requiredCurrentScvTokens.filter(
|
|
107
|
+
(token) => !scvEntry.idl.includes(token),
|
|
108
|
+
);
|
|
109
|
+
if (missingTokens.length > 0) {
|
|
110
|
+
issues.push({
|
|
111
|
+
severity: "error",
|
|
112
|
+
code: "stale-scv-contract",
|
|
113
|
+
message:
|
|
114
|
+
"The loaded spacedatastandards.org SCV catalog is stale and does not " +
|
|
115
|
+
`include required current coverage fields: ${missingTokens.join(", ")}.`,
|
|
116
|
+
location: `${sourceName}.standards.SCV`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
const unsupportedResultFields = collectFlatbufferTableFields(
|
|
120
|
+
scvEntry.idl,
|
|
121
|
+
"SCVResult",
|
|
122
|
+
).filter((field) => !currentScvResultFields.has(field));
|
|
123
|
+
if (unsupportedResultFields.length > 0) {
|
|
124
|
+
issues.push({
|
|
125
|
+
severity: "error",
|
|
126
|
+
code: "stale-scv-contract",
|
|
127
|
+
message:
|
|
128
|
+
"The loaded spacedatastandards.org SCV catalog contains unsupported " +
|
|
129
|
+
`SCVResult fields that are not part of the current contract: ${unsupportedResultFields.join(", ")}.`,
|
|
130
|
+
location: `${sourceName}.standards.SCV`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return issues;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function loadStandardsCatalog(options = {}) {
|
|
137
|
+
const manifestPath = resolveStandardsManifestPath(options);
|
|
138
|
+
if (!standardsCatalogPromises.has(manifestPath)) {
|
|
139
|
+
standardsCatalogPromises.set(
|
|
140
|
+
manifestPath,
|
|
141
|
+
(async () => {
|
|
142
|
+
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
143
|
+
return Object.entries(manifest?.STANDARDS ?? {})
|
|
144
|
+
.map(parseStandardsEntry)
|
|
145
|
+
.sort((left, right) => left.schemaCode.localeCompare(right.schemaCode));
|
|
146
|
+
})(),
|
|
147
|
+
);
|
|
61
148
|
}
|
|
62
|
-
return
|
|
149
|
+
return standardsCatalogPromises.get(manifestPath);
|
|
63
150
|
}
|
|
64
151
|
|
|
65
|
-
export async function loadKnownTypeCatalog() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
152
|
+
export async function loadKnownTypeCatalog(options = {}) {
|
|
153
|
+
const manifestPath = resolveStandardsManifestPath(options);
|
|
154
|
+
if (!knownTypeCatalogPromises.has(manifestPath)) {
|
|
155
|
+
knownTypeCatalogPromises.set(
|
|
156
|
+
manifestPath,
|
|
157
|
+
loadStandardsCatalog(options).then((catalog) => [
|
|
158
|
+
...catalog,
|
|
159
|
+
...sharedModuleCatalog,
|
|
160
|
+
]),
|
|
161
|
+
);
|
|
71
162
|
}
|
|
72
|
-
return
|
|
163
|
+
return knownTypeCatalogPromises.get(manifestPath);
|
|
73
164
|
}
|
|
74
165
|
|
|
75
166
|
export function resolveStandardsTypeRef(typeRef, catalog = []) {
|
|
76
|
-
const
|
|
167
|
+
const schemaName = normalizeSchemaName(typeRef?.schemaName);
|
|
77
168
|
const fileIdentifier = normalizeFileIdentifier(typeRef?.fileIdentifier);
|
|
78
|
-
if (!
|
|
169
|
+
if (!schemaName && !fileIdentifier) {
|
|
79
170
|
return null;
|
|
80
171
|
}
|
|
81
172
|
return (
|
|
82
|
-
catalog.find(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
return false;
|
|
90
|
-
}) ?? null
|
|
173
|
+
catalog.find(
|
|
174
|
+
(entry) =>
|
|
175
|
+
(!schemaName || normalizeSchemaName(entry.schemaName) === schemaName) &&
|
|
176
|
+
(!fileIdentifier ||
|
|
177
|
+
normalizeFileIdentifier(entry.fileIdentifier) === fileIdentifier),
|
|
178
|
+
) ?? null
|
|
91
179
|
);
|
|
92
180
|
}
|
|
93
181
|
|
|
182
|
+
function schemaHashMatchesCatalog(typeRefHash, catalogHash) {
|
|
183
|
+
if (typeRefHash === undefined || typeRefHash === null) return true;
|
|
184
|
+
const declared = normalizePayloadSchemaHash(typeRefHash);
|
|
185
|
+
if (!declared) return true;
|
|
186
|
+
const canonical = normalizePayloadSchemaHash(catalogHash);
|
|
187
|
+
if (!canonical || declared.length !== canonical.length) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
return declared.every((byte, index) => byte === canonical[index]);
|
|
191
|
+
}
|
|
192
|
+
|
|
94
193
|
function collectTypeRefs(manifest) {
|
|
95
194
|
const refs = [];
|
|
96
195
|
for (const method of Array.isArray(manifest?.methods) ? manifest.methods : []) {
|
|
@@ -126,22 +225,67 @@ export async function validateManifestAgainstStandardsCatalog(
|
|
|
126
225
|
manifest,
|
|
127
226
|
options = {},
|
|
128
227
|
) {
|
|
129
|
-
const catalog = options.catalog ?? (await loadKnownTypeCatalog());
|
|
228
|
+
const catalog = options.catalog ?? (await loadKnownTypeCatalog(options));
|
|
130
229
|
const sourceName = options.sourceName ?? "manifest";
|
|
131
|
-
const issues =
|
|
230
|
+
const issues = validateStandardsCatalogFreshness(catalog, sourceName);
|
|
132
231
|
for (const { source, typeRef } of collectTypeRefs(manifest)) {
|
|
133
232
|
if (typeRef?.acceptsAnyFlatbuffer === true) {
|
|
134
233
|
continue;
|
|
135
234
|
}
|
|
136
235
|
const resolved = resolveStandardsTypeRef(typeRef, catalog);
|
|
137
236
|
if (!resolved) {
|
|
237
|
+
const schemaName = normalizeSchemaName(typeRef?.schemaName);
|
|
238
|
+
const fileIdentifier = normalizeFileIdentifier(typeRef?.fileIdentifier);
|
|
239
|
+
const partiallyKnown = catalog.some(
|
|
240
|
+
(entry) =>
|
|
241
|
+
(schemaName && normalizeSchemaName(entry.schemaName) === schemaName) ||
|
|
242
|
+
(fileIdentifier &&
|
|
243
|
+
normalizeFileIdentifier(entry.fileIdentifier) === fileIdentifier),
|
|
244
|
+
);
|
|
245
|
+
issues.push({
|
|
246
|
+
severity: "error",
|
|
247
|
+
code: partiallyKnown
|
|
248
|
+
? "standards-type-identity-mismatch"
|
|
249
|
+
: "unresolved-standards-type",
|
|
250
|
+
message: partiallyKnown
|
|
251
|
+
? `Type reference from ${source} mixes a known schemaName or exact four-byte fileIdentifier with a different standards entry.`
|
|
252
|
+
: `Type reference from ${source} does not resolve to a known shared-module or \`spacedatastandards.org\` schema by its exact schemaName and fileIdentifier.`,
|
|
253
|
+
location: `${sourceName}.${source}`,
|
|
254
|
+
});
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (
|
|
258
|
+
typeRef?.rootTypeName &&
|
|
259
|
+
resolved.rootTypeName &&
|
|
260
|
+
typeRef.rootTypeName !== resolved.rootTypeName
|
|
261
|
+
) {
|
|
262
|
+
issues.push({
|
|
263
|
+
severity: "error",
|
|
264
|
+
code: "standards-root-type-mismatch",
|
|
265
|
+
message: `Type reference from ${source} declares rootTypeName ${JSON.stringify(typeRef.rootTypeName)} but the canonical SDS root is ${JSON.stringify(resolved.rootTypeName)}.`,
|
|
266
|
+
location: `${sourceName}.${source}`,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
if (
|
|
270
|
+
typeRef?.schemaVersion &&
|
|
271
|
+
resolved.version &&
|
|
272
|
+
typeRef.schemaVersion !== resolved.version
|
|
273
|
+
) {
|
|
274
|
+
issues.push({
|
|
275
|
+
severity: "error",
|
|
276
|
+
code: "standards-schema-version-mismatch",
|
|
277
|
+
message: `Type reference from ${source} declares schemaVersion ${JSON.stringify(typeRef.schemaVersion)} but the canonical SDS version is ${JSON.stringify(resolved.version)}.`,
|
|
278
|
+
location: `${sourceName}.${source}`,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (
|
|
282
|
+
resolved.hash &&
|
|
283
|
+
!schemaHashMatchesCatalog(typeRef?.schemaHash, resolved.hash)
|
|
284
|
+
) {
|
|
138
285
|
issues.push({
|
|
139
|
-
severity: "
|
|
140
|
-
code: "
|
|
141
|
-
message:
|
|
142
|
-
`Type reference from ${source} does not resolve to a known ` +
|
|
143
|
-
"shared-module or `spacedatastandards.org` schema by schemaName " +
|
|
144
|
-
"or fileIdentifier.",
|
|
286
|
+
severity: "error",
|
|
287
|
+
code: "standards-schema-hash-mismatch",
|
|
288
|
+
message: `Type reference from ${source} declares a schemaHash that differs from the canonical SDS schema hash.`,
|
|
145
289
|
location: `${sourceName}.${source}`,
|
|
146
290
|
});
|
|
147
291
|
}
|
|
@@ -5,6 +5,22 @@ const sharedModuleCatalogEntries = [
|
|
|
5
5
|
fileIdentifier: "TICK",
|
|
6
6
|
source: "shared-module-runtime",
|
|
7
7
|
},
|
|
8
|
+
// Canonical WASM-served HTTP envelope ABI (module-sdk schemas/HttpRequestAbi.fbs
|
|
9
|
+
// + HttpResponseAbi.fbs). The manifest refs carry the "$"-prefixed 4-char
|
|
10
|
+
// identifiers ("$HTQ"/"$HTR"); retain those exact identities in the
|
|
11
|
+
// catalog so a different four-byte identifier cannot alias either ABI.
|
|
12
|
+
{
|
|
13
|
+
schemaCode: "HTTPREQUESTABI",
|
|
14
|
+
schemaName: "HttpRequestAbi.fbs",
|
|
15
|
+
fileIdentifier: "$HTQ",
|
|
16
|
+
source: "module-sdk-host-abi",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
schemaCode: "HTTPRESPONSEABI",
|
|
20
|
+
schemaName: "HttpResponseAbi.fbs",
|
|
21
|
+
fileIdentifier: "$HTR",
|
|
22
|
+
source: "module-sdk-host-abi",
|
|
23
|
+
},
|
|
8
24
|
{
|
|
9
25
|
schemaCode: "HTTPREQUEST",
|
|
10
26
|
schemaName: "HttpRequest.fbs",
|