space-data-module-sdk 0.8.27 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +5 -4
  2. package/docs/assembly.js +0 -18
  3. package/docs/assets/ai-credits/ai-credits.js +116 -0
  4. package/docs/assets/sdn-chrome/sdn-chrome.css +434 -0
  5. package/docs/assets/sdn-chrome/sdn-chrome.js +236 -0
  6. package/docs/browser-wasmedge-isomorphic.html +29 -41
  7. package/docs/byo-wasm-quickstart.html +29 -41
  8. package/docs/conformance.html +29 -41
  9. package/docs/events-abi.html +29 -41
  10. package/docs/families/analytics.html +29 -41
  11. package/docs/families/attitude.html +29 -41
  12. package/docs/families/behavior.html +29 -41
  13. package/docs/families/breakup.html +29 -41
  14. package/docs/families/conjunction.html +29 -41
  15. package/docs/families/data-source.html +29 -41
  16. package/docs/families/effects.html +29 -41
  17. package/docs/families/environment.html +29 -41
  18. package/docs/families/estimation.html +29 -41
  19. package/docs/families/gnc.html +29 -41
  20. package/docs/families/maneuver.html +29 -41
  21. package/docs/families/obstruction.html +29 -41
  22. package/docs/families/propagator.html +29 -41
  23. package/docs/families/propulsion.html +29 -41
  24. package/docs/families/reentry.html +29 -41
  25. package/docs/families/rf.html +29 -41
  26. package/docs/families/scheduler.html +29 -41
  27. package/docs/families/sensor.html +29 -41
  28. package/docs/families/signature.html +29 -41
  29. package/docs/flatsql-host-contract.html +29 -41
  30. package/docs/flatsql-streaming-standard.html +29 -41
  31. package/docs/gpu-module-abi.html +29 -41
  32. package/docs/index.html +43 -47
  33. package/docs/isomorphic-pthreads.html +29 -41
  34. package/docs/isomorphic-sdn-runtime-plan.html +29 -41
  35. package/docs/language-runtime-matrix.html +29 -41
  36. package/docs/media/module-sdk-reel-poster.webp +0 -0
  37. package/docs/media/module-sdk-reel.mp4 +0 -0
  38. package/docs/media/module-sdk-reel.webm +0 -0
  39. package/docs/media/reel/reel.css +53 -0
  40. package/docs/media/reel/reel.js +272 -0
  41. package/docs/module-bundle-runtime-plan.html +29 -41
  42. package/docs/module-publication-standard.html +29 -41
  43. package/docs/node-red-default-node-parity.html +29 -41
  44. package/docs/protect-and-sign.html +29 -41
  45. package/docs/protocol-installation.html +29 -41
  46. package/docs/publication-submission.html +29 -41
  47. package/docs/secrets-capability.html +29 -41
  48. package/docs/styles.css +89 -157
  49. package/docs/testing-harness.html +29 -41
  50. package/docs/tri-runtime-parity-gate.html +29 -41
  51. package/docs/tri-runtime-parity.html +29 -41
  52. package/package.json +5 -3
  53. package/schemas/runtime/FlowNotice.fbs +39 -0
  54. package/schemas/runtime/HostOps.fbs +455 -0
  55. package/schemas/runtime/HttpRequest.fbs +25 -0
  56. package/schemas/runtime/HttpResponse.fbs +24 -0
  57. package/schemas/runtime/IngestRequest.fbs +61 -0
  58. package/schemas/runtime/IngestResult.fbs +23 -0
  59. package/schemas/runtime/ModuleConfig.fbs +41 -0
  60. package/schemas/runtime/RuntimeCommon.fbs +33 -0
  61. package/schemas/runtime/TimerTick.fbs +18 -0
  62. package/src/capabilities.js +3 -0
  63. package/src/compiler/compileModule.js +20 -2
  64. package/src/generated/runtime/aligned/HostOps_aligned.js +3913 -0
  65. package/src/generated/runtime/aligned/HostOps_aligned.ts +4605 -0
  66. package/src/generated/runtime/aligned/HostOps_enums.js +12 -0
  67. package/src/generated/runtime/aligned/HostOps_enums.ts +6 -0
  68. package/src/generated/runtime/cpp/FlowNotice_generated.h +367 -0
  69. package/src/generated/runtime/cpp/HostOps_aligned.h +3540 -0
  70. package/src/generated/runtime/cpp/HttpRequest_generated.h +317 -0
  71. package/src/generated/runtime/cpp/HttpResponse_generated.h +315 -0
  72. package/src/generated/runtime/cpp/IngestRequest_generated.h +829 -0
  73. package/src/generated/runtime/cpp/IngestResult_generated.h +319 -0
  74. package/src/generated/runtime/cpp/ModuleConfig_generated.h +604 -0
  75. package/src/generated/runtime/cpp/RuntimeCommon_generated.h +410 -0
  76. package/src/generated/runtime/cpp/TimerTick_generated.h +229 -0
  77. package/src/generated/runtime/sdn/runtime/ArchiveTarget.js +78 -0
  78. package/src/generated/runtime/sdn/runtime/ArchiveTarget.ts +104 -0
  79. package/src/generated/runtime/sdn/runtime/ConfigEntry.js +202 -0
  80. package/src/generated/runtime/sdn/runtime/ConfigEntry.ts +251 -0
  81. package/src/generated/runtime/sdn/runtime/ConfigTable.js +80 -0
  82. package/src/generated/runtime/sdn/runtime/ConfigTable.ts +97 -0
  83. package/src/generated/runtime/sdn/runtime/FlowNotice.js +196 -0
  84. package/src/generated/runtime/sdn/runtime/FlowNotice.ts +254 -0
  85. package/src/generated/runtime/sdn/runtime/Header.js +79 -0
  86. package/src/generated/runtime/sdn/runtime/Header.ts +100 -0
  87. package/src/generated/runtime/sdn/runtime/HttpRequest.js +216 -0
  88. package/src/generated/runtime/sdn/runtime/HttpRequest.ts +265 -0
  89. package/src/generated/runtime/sdn/runtime/HttpResponse.js +216 -0
  90. package/src/generated/runtime/sdn/runtime/HttpResponse.ts +267 -0
  91. package/src/generated/runtime/sdn/runtime/IngestRequest.js +121 -0
  92. package/src/generated/runtime/sdn/runtime/IngestRequest.ts +155 -0
  93. package/src/generated/runtime/sdn/runtime/IngestResult.js +184 -0
  94. package/src/generated/runtime/sdn/runtime/IngestResult.ts +235 -0
  95. package/src/generated/runtime/sdn/runtime/ModuleConfig.js +92 -0
  96. package/src/generated/runtime/sdn/runtime/ModuleConfig.ts +114 -0
  97. package/src/generated/runtime/sdn/runtime/Provenance.js +320 -0
  98. package/src/generated/runtime/sdn/runtime/Provenance.ts +405 -0
  99. package/src/generated/runtime/sdn/runtime/SourceTags.js +181 -0
  100. package/src/generated/runtime/sdn/runtime/SourceTags.ts +253 -0
  101. package/src/generated/runtime/sdn/runtime/TimerTick.js +119 -0
  102. package/src/generated/runtime/sdn/runtime/TimerTick.ts +148 -0
  103. package/src/generated/runtime/sdn/runtime/configValueKind.js +12 -0
  104. package/src/generated/runtime/sdn/runtime/configValueKind.ts +19 -0
  105. package/src/generated/runtime/sdn/runtime/flowNoticeKind.js +11 -0
  106. package/src/generated/runtime/sdn/runtime/flowNoticeKind.ts +34 -0
  107. package/src/generated/runtime/sdn/runtime/reconcileMode.js +9 -0
  108. package/src/generated/runtime/sdn/runtime/reconcileMode.ts +23 -0
  109. package/src/generated/runtime/sdn/runtime.js +16 -0
  110. package/src/generated/runtime/sdn/runtime.ts +17 -0
  111. package/src/host/abi.js +32 -6
  112. package/src/host/adapterOperations.js +79 -0
  113. package/src/host/browserHost.js +65 -2
  114. package/src/host/cpp/typedHostcall.hpp +252 -0
  115. package/src/host/hostWorkerBundleSources.js +3 -3
  116. package/src/host/nodeHost.js +50 -0
  117. package/src/host/typedDispatch.js +582 -0
  118. package/src/index.d.ts +25 -2
  119. package/src/invoke/codec.js +3 -2
  120. package/src/standards/runtimeContracts.js +596 -0
  121. package/src/standards/sharedCatalog.js +27 -0
@@ -0,0 +1,455 @@
1
+ // The payloads of the host operations a module calls, in the FlatBuffers ALIGNED BINARY layout (fixed-size records,
2
+ // read in place by advancing a fixed stride; generated with --aligned). Typed contracts 1.0, owner 2026-10-13: only
3
+ // the JSON interface changes.
4
+ //
5
+ // A hostcall is an SDS $PIV invocation in the module -> host direction (the SDK's documented invoke ABI):
6
+ // PIVRequest.METHOD_ID is the operation (HOST_OPERATIONS in src/standards/runtimeContracts.js names its frames), and
7
+ // the PIVResponse answers with the result frames, or STATUS FAILED with ERROR_CODE / ERROR_MESSAGE. Frames live in
8
+ // PAYLOAD_ARENA and are named by TAB.PORT_ID:
9
+ // - "params" / "result": one aligned record of the operation's table here (TAB WIRE_FORMAT ALIGNED_BINARY, TYPE_REF
10
+ // SCHEMA_NAME "HostOps.fbs", ROOT_TYPE the table, BYTE_LENGTH its size);
11
+ // - a list port (e.g. "entries"): a run of aligned records of one table, back to back at a fixed stride;
12
+ // - a raw port (e.g. "body", "records", "url", "sql", "path"): unbounded bytes, verbatim - bodies, keys, record
13
+ // streams (size-prefixed frames concatenated), and text that may exceed an aligned string (UTF-8).
14
+ // - SQL values (raw "params" in, raw "cells" out) use FlatSQL's own tagged parameter encoding (flatsql capi
15
+ // decodeParamsNoThrow), value after value with no count: u8 tag, u32 little-endian payload length, payload.
16
+ // Tags: 0 null (length 0), 1 bool (1 byte, 0 / 1), 2 i64 (8 bytes LE), 3 f64 (8 bytes LE), 4 string (UTF-8),
17
+ // 5 bytes.
18
+ // Aligned strings hold at most 255 bytes; a value that does not fit is refused, never truncated. Times are Unix
19
+ // milliseconds UTC. A zero or an empty string means "not given" and the host applies the documented default: aligned records have no
20
+ // schema defaults (an unset field reads zero), so every field here is phrased so that zero is the default.
21
+ namespace sdn.runtime;
22
+
23
+ // ---- shared values -------------------------------------------------------------------------------------------------
24
+
25
+ table BoolValue { VALUE: bool; }
26
+ table NumberValue { VALUE: double; }
27
+ table TimeValue { UNIX_MS: uint64; }
28
+ table CountValue { VALUE: uint64; }
29
+ /// A list item of text (list ports such as "capabilities", "topics", "keys").
30
+ table TextValue { VALUE: string (aligned_max_length: 255); }
31
+
32
+ /// Bytes a host keeps and a flow egress resolves later by TOKEN (deliver Ref): single use.
33
+ table BodyRef { TOKEN: uint64; SIZE: uint64; FRAMES: int64; FNV1A64: string (aligned_max_length: 16); } // FRAMES -1 = none (the host always writes it)
34
+
35
+ enum deliverMode : ubyte { Inline, Ref }
36
+
37
+ // ---- host, random, config ------------------------------------------------------------------------------------------
38
+
39
+ table HasCapabilityParams { CAPABILITY: string (aligned_max_length: 64); }
40
+
41
+ /// LENGTH 1..8192 (0 = 32); the bytes come back on raw "data".
42
+ table RandomBytesParams { LENGTH: uint32; }
43
+
44
+ enum configEntryKind : ubyte { String, Number, Bool }
45
+ /// One configured value; nested tables and lists are flattened into dotted paths ("targets.0.provider_id",
46
+ /// "widths.1"). plugin.getConfig answers with a run of these on list "entries".
47
+ table ConfigEntry {
48
+ KEY: string (aligned_max_length: 255);
49
+ KIND: configEntryKind;
50
+ STRING_VALUE: string (aligned_max_length: 255);
51
+ NUMBER_VALUE: double;
52
+ BOOL_VALUE: bool;
53
+ }
54
+
55
+ // ---- http (raw in: "url", "headers" (an HTTP header block, "name: value" lines), "body"; raw out: the same) --------
56
+
57
+ table HttpParams {
58
+ /// Empty = GET.
59
+ METHOD: string (aligned_max_length: 16);
60
+ /// 0 = the host's default.
61
+ TIMEOUT_MS: uint32;
62
+ /// Response body budget; the host errors past it, never truncates. 0 = the host's limit.
63
+ MAX_BYTES: uint64;
64
+ /// Redirects are followed unless set.
65
+ NO_REDIRECTS: bool;
66
+ }
67
+ table HttpResult {
68
+ STATUS: int32;
69
+ RETRIEVED_MS: uint64;
70
+ }
71
+
72
+ // ---- storage -------------------------------------------------------------------------------------------------------
73
+
74
+ table StorageQueryParams {
75
+ SCHEMA: string (aligned_max_length: 64);
76
+ DAY: string (aligned_max_length: 16);
77
+ ENTITY_ID: string (aligned_max_length: 255);
78
+ NORAD_CAT_ID: uint32;
79
+ LIMIT: uint32;
80
+ }
81
+ /// One stored record's metadata (list "records_meta"); its bytes are the same-index frame of raw "records".
82
+ table StoredRecordMeta {
83
+ CID: string (aligned_max_length: 128);
84
+ ROW_ID: int64;
85
+ PEER_ID: string (aligned_max_length: 128);
86
+ TIMESTAMP_MS: int64;
87
+ MATERIALIZED_MS: int64;
88
+ LENGTH: uint32;
89
+ PROVIDER_ID: string (aligned_max_length: 128);
90
+ SOURCE_NAME: string (aligned_max_length: 128);
91
+ BATCH_ID: string (aligned_max_length: 128);
92
+ PRODUCER_PEER_ID: string (aligned_max_length: 128);
93
+ LICENSE: string (aligned_max_length: 128);
94
+ }
95
+
96
+ /// One record on raw "data"; the result names its CID.
97
+ table StorageWriteParams { SCHEMA: string (aligned_max_length: 64); }
98
+ table StorageWriteResult { CID: string (aligned_max_length: 128); }
99
+
100
+ table StorageDeleteParams { SCHEMA: string (aligned_max_length: 64); CID: string (aligned_max_length: 128); }
101
+
102
+ /// A lane's records that arrived before BEFORE_MS, deleted through the store's record index.
103
+ table StorageExpireParams {
104
+ SCHEMA: string (aligned_max_length: 64);
105
+ PROVIDER_ID: string (aligned_max_length: 128);
106
+ SOURCE_NAME: string (aligned_max_length: 128);
107
+ BEFORE_MS: uint64;
108
+ /// Index page size; 0 = 500.
109
+ BATCH: uint32;
110
+ /// 0 = 100000.
111
+ MAX_DELETES: uint32;
112
+ }
113
+ table StorageExpireResult { DELETED: uint64; MISSING: uint64; CAPPED: bool; }
114
+
115
+ enum reconcileKind : ubyte { Duplicates, None, Current }
116
+ /// One batch: raw "records" (size-prefixed record stream), optional raw "archive" (the source document, kept under
117
+ /// ARCHIVE_SOURCE/ARCHIVE_NAME when the host has an archive root), optional list "provenance" (one Provenance) and
118
+ /// optional list "provenance_attributes" (ProvenanceAttribute, in order).
119
+ table StorageIngestParams {
120
+ SCHEMA: string (aligned_max_length: 64);
121
+ PROVIDER_ID: string (aligned_max_length: 128);
122
+ SOURCE_NAME: string (aligned_max_length: 128);
123
+ BATCH_ID: string (aligned_max_length: 128);
124
+ SOURCE_URL: string (aligned_max_length: 255);
125
+ CONTENT_KEY_ID: string (aligned_max_length: 128);
126
+ SOURCE_PEER: string (aligned_max_length: 128);
127
+ LICENSE: string (aligned_max_length: 128);
128
+ LICENSE_URL: string (aligned_max_length: 255);
129
+ CITATION: string (aligned_max_length: 255);
130
+ SHARE_ALIKE: bool;
131
+ RECONCILE: reconcileKind;
132
+ ARCHIVE_SOURCE: string (aligned_max_length: 128);
133
+ ARCHIVE_NAME: string (aligned_max_length: 255);
134
+ }
135
+ table Provenance {
136
+ SOURCE_URL: string (aligned_max_length: 255);
137
+ HTTP_STATUS: int32;
138
+ ETAG: string (aligned_max_length: 255);
139
+ LAST_MODIFIED: string (aligned_max_length: 64);
140
+ CONTENT_TYPE: string (aligned_max_length: 128);
141
+ RETRIEVED_MS: uint64;
142
+ PARSER: string (aligned_max_length: 128);
143
+ PARSER_VERSION: string (aligned_max_length: 64);
144
+ SOURCE_SHA256: string (aligned_max_length: 64);
145
+ NORMALIZED_SHA256: string (aligned_max_length: 64);
146
+ NORMALIZED_COUNT: uint64;
147
+ FROM_CACHE: bool;
148
+ }
149
+ /// Descriptive provenance a parser has no Provenance field for (method, units, date range, counts), as name / value
150
+ /// pairs in order (list "provenance_attributes"; the runtime IngestRequest's Provenance.ATTRIBUTES).
151
+ table ProvenanceAttribute {
152
+ NAME: string (aligned_max_length: 128);
153
+ VALUE: string (aligned_max_length: 255);
154
+ }
155
+ table StorageIngestResult {
156
+ SCHEMA: string (aligned_max_length: 64);
157
+ BATCH_ID: string (aligned_max_length: 128);
158
+ INSERTED: uint64;
159
+ RECONCILED_DUPLICATES: uint64;
160
+ RECONCILED_OLD_BATCHES: uint64;
161
+ ARCHIVED: string (aligned_max_length: 255);
162
+ PROVENANCE_FILE: string (aligned_max_length: 255);
163
+ }
164
+
165
+ /// raw "sql", raw "params" (tagged SQL values); the answer: a StreamResult with raw "stream" (deliver Inline) or its BodyRef.
166
+ table SqlStreamParams { DELIVER: deliverMode; }
167
+ table StreamResult {
168
+ ROWS: uint64;
169
+ COLUMNS: uint32;
170
+ REF: BodyRef;
171
+ }
172
+ table EpochStreamParams {
173
+ SCHEMA: string (aligned_max_length: 64);
174
+ SOURCE: string (aligned_max_length: 128);
175
+ PROFILE: string (aligned_max_length: 32);
176
+ EPOCH: double;
177
+ LIMIT: uint32;
178
+ DELIVER: deliverMode;
179
+ }
180
+ enum sandboxWant : ubyte { Stream, Rows, Auto }
181
+ /// raw "sql", raw "params" (tagged SQL values); Stream answers like SqlStream, Rows with list "columns" (TextValue)
182
+ /// and raw "cells" (tagged SQL values, row-major: ROWS x COLUMNS of them).
183
+ table SandboxQueryParams { WANT: sandboxWant; DELIVER: deliverMode; }
184
+ table SandboxQueryResult { KIND: sandboxWant; ROWS: uint64; COLUMNS: uint32; REF: BodyRef; }
185
+ /// storage.query_surface: list "tables", list "columns".
186
+ table SurfaceTable {
187
+ NAME: string (aligned_max_length: 128);
188
+ KIND: string (aligned_max_length: 16);
189
+ SOURCE: string (aligned_max_length: 128);
190
+ RECORDS: int64;
191
+ }
192
+ table SurfaceColumn {
193
+ TABLE: string (aligned_max_length: 128);
194
+ NAME: string (aligned_max_length: 128);
195
+ PLACEHOLDER: bool;
196
+ }
197
+ table QuerySurfaceLimits { TIMEOUT_MS: uint32; MAX_ROWS: uint64; MAX_BYTES: uint64; }
198
+ /// raw "sql", raw "params" (tagged SQL values), list "projection" (TextValue); the key comes back as a TextValue.
199
+ table CacheKeyParams {
200
+ SCHEMA_NAME: string (aligned_max_length: 64);
201
+ SCHEMA_VERSION: string (aligned_max_length: 32);
202
+ FORMAT: string (aligned_max_length: 32);
203
+ PUBLISH_EVENT_KEY: string (aligned_max_length: 128);
204
+ }
205
+
206
+ // ---- crypto, keyslot (keys, data, signatures, nonces as raw frames) -----------------------------------------------
207
+
208
+ enum cryptoAlgorithm : ubyte {
209
+ Default,
210
+ Ed25519,
211
+ /// ECDSA over secp256k1, signing SHA-256(data); DER signatures.
212
+ Secp256k1,
213
+ /// ECDSA over secp256k1, "data" is the 32-byte digest.
214
+ Secp256k1Digest,
215
+ X25519,
216
+ Sha256,
217
+ Sha512,
218
+ Aes256Gcm,
219
+ HkdfSha256
220
+ }
221
+ /// Every crypto operation's parameters. Raw in, by operation: "data", "key", "private_key", "public_key", "signature",
222
+ /// "nonce", "aad", "ikm", "salt", "info", "envelope"; raw out: "data" (a hash, signature, plaintext, ciphertext with
223
+ /// its tag, shared secret, derived key, public key), and "nonce", "private_key", "public_key" where an operation
224
+ /// makes them.
225
+ table CryptoParams { ALGORITHM: cryptoAlgorithm; LENGTH: uint32; }
226
+
227
+ table KeyslotParams { SLOT_ID: string (aligned_max_length: 128); ALGORITHM: cryptoAlgorithm; }
228
+
229
+ // ---- secrets (the secret itself on raw "secret") -------------------------------------------------------------------
230
+
231
+ table SecretParams { ID: string (aligned_max_length: 128); USERNAME: string (aligned_max_length: 255); }
232
+ table SecretResult {
233
+ ID: string (aligned_max_length: 128);
234
+ USERNAME: string (aligned_max_length: 255);
235
+ CONFIGURED: bool;
236
+ USERNAME_MASKED: string (aligned_max_length: 255);
237
+ UPDATED_MS: uint64;
238
+ VERIFIED_MS: uint64;
239
+ }
240
+
241
+ // ---- ipfs, pubsub, protocol ----------------------------------------------------------------------------------------
242
+
243
+ table IpfsParams {
244
+ CID: string (aligned_max_length: 128);
245
+ NAME: string (aligned_max_length: 255);
246
+ TYPE: string (aligned_max_length: 32);
247
+ LIFETIME: string (aligned_max_length: 32);
248
+ TTL: string (aligned_max_length: 32);
249
+ /// The added content is pinned unless set.
250
+ NO_PIN: bool;
251
+ }
252
+ table IpfsResult {
253
+ CID: string (aligned_max_length: 128);
254
+ NAME: string (aligned_max_length: 255);
255
+ VALUE: string (aligned_max_length: 255);
256
+ SIZE: uint64;
257
+ AGENT_VERSION: string (aligned_max_length: 128);
258
+ PROTOCOL_VERSION: string (aligned_max_length: 64);
259
+ }
260
+ /// ipfs.ls list "links", ipfs.pin_ls list "pins", ipfs.swarm_peers list "peers".
261
+ table IpfsLink { NAME: string (aligned_max_length: 255); CID: string (aligned_max_length: 128); SIZE: uint64; TYPE: int32; }
262
+ table IpfsPin { CID: string (aligned_max_length: 128); TYPE: string (aligned_max_length: 32); }
263
+ table IpfsSwarmPeer { PEER_ID: string (aligned_max_length: 128); ADDRESS: string (aligned_max_length: 255); LATENCY_MS: double; }
264
+
265
+ /// raw "data" for a publish.
266
+ table PubsubParams { TOPIC: string (aligned_max_length: 255); }
267
+ table PubsubSubscribed { ALREADY: bool; }
268
+
269
+ /// raw "payload" in, raw "data" out.
270
+ table ProtocolParams {
271
+ TARGET: string (aligned_max_length: 255);
272
+ PROTOCOL_ID: string (aligned_max_length: 128);
273
+ PEER_ID: string (aligned_max_length: 128);
274
+ TIMEOUT_MS: uint32;
275
+ }
276
+
277
+ // ---- p2p (the $EPM / $PNM frames, size-prefixed and concatenated, on raw "records") -------------------------------
278
+
279
+ table P2pParams {
280
+ PEER_ID: string (aligned_max_length: 128);
281
+ LIMIT: uint32;
282
+ STANDARD: string (aligned_max_length: 16);
283
+ DELIVER: deliverMode;
284
+ }
285
+ table P2pSummary {
286
+ SELF: string (aligned_max_length: 128);
287
+ PEER_ID: string (aligned_max_length: 128);
288
+ PUBLISHER_KEY_AVAILABLE: bool;
289
+ GOSSIP_ONLY_EXCLUDED: uint32;
290
+ }
291
+ /// list "peers"; a peer's addresses and standards are list "peer_addresses" / "peer_standards" rows (PEER_ID, VALUE).
292
+ table P2pPeer {
293
+ PEER_ID: string (aligned_max_length: 128);
294
+ CONNECTED: bool;
295
+ SELF: bool;
296
+ EPM_INDEX: int32; // -1 = none (the host always writes it)
297
+ AGENT_VERSION: string (aligned_max_length: 128);
298
+ }
299
+ table P2pPeerValue { PEER_ID: string (aligned_max_length: 128); VALUE: string (aligned_max_length: 255); }
300
+ /// list "entries" (standards_snapshot, pnm_history).
301
+ table P2pPnmEntry {
302
+ PEER_ID: string (aligned_max_length: 128);
303
+ PUBLISHER_PEER_ID: string (aligned_max_length: 128);
304
+ GOSSIP_PEER_ID: string (aligned_max_length: 128);
305
+ STANDARD: string (aligned_max_length: 16);
306
+ SCHEMA: string (aligned_max_length: 64);
307
+ FILE_ID: string (aligned_max_length: 255);
308
+ FILE_NAME: string (aligned_max_length: 255);
309
+ CID: string (aligned_max_length: 128);
310
+ PUBLISH_MS: uint64;
311
+ SIGNATURE_TYPE: string (aligned_max_length: 32);
312
+ SIGNATURE_HEX: string (aligned_max_length: 255);
313
+ SIGNATURE_VERIFIED: bool;
314
+ ATTRIBUTION: string (aligned_max_length: 16);
315
+ PNM_INDEX: int32; // -1 = none (the host always writes it)
316
+ PUBLISHER_KEY_HEX: string (aligned_max_length: 128);
317
+ PUBLISHER_KEY_SOURCE: string (aligned_max_length: 64);
318
+ }
319
+ /// p2p.latest_dataset; the batch on raw "stream" (deliver Inline) or REF.
320
+ table P2pLatestDataset {
321
+ KNOWN: bool;
322
+ REASON: string (aligned_max_length: 64);
323
+ PINNED: bool;
324
+ SELF: bool;
325
+ FRESH: bool;
326
+ STANDARD: string (aligned_max_length: 16);
327
+ SCHEMA: string (aligned_max_length: 64);
328
+ PNM_CID: string (aligned_max_length: 128);
329
+ PNM_FILE_ID: string (aligned_max_length: 255);
330
+ PNM_PUBLISH_MS: uint64;
331
+ PNM_SIGNATURE_VERIFIED: bool;
332
+ PNM_ATTRIBUTION: string (aligned_max_length: 16);
333
+ BATCH_ID: string (aligned_max_length: 128);
334
+ PROVIDER_ID: string (aligned_max_length: 128);
335
+ SOURCE_NAME: string (aligned_max_length: 128);
336
+ RECORD_COUNT: uint64;
337
+ BYTE_COUNT: uint64;
338
+ PARTS: uint32;
339
+ PUBLISHED_MS: uint64;
340
+ ETAG_FNV1A64: string (aligned_max_length: 16);
341
+ REF: BodyRef;
342
+ }
343
+
344
+ // ---- node status and activity --------------------------------------------------------------------------------------
345
+
346
+ table NodeStatusReport {
347
+ UPTIME_S: uint64;
348
+ STARTED_MS: uint64;
349
+ STORE_TOTAL_BYTES: uint64;
350
+ STORE_TOTAL_RECORDS: uint64;
351
+ STORAGE_PATH: string (aligned_max_length: 255);
352
+ HAS_DISK: bool;
353
+ DISK_CAPACITY_BYTES: uint64;
354
+ DISK_FREE_BYTES: uint64;
355
+ DISK_AVAILABLE_BYTES: uint64;
356
+ SERVICE_STATE: string (aligned_max_length: 32);
357
+ SERVICE_MODE: string (aligned_max_length: 32);
358
+ HAS_BANDWIDTH: bool;
359
+ TOTAL_IN_BYTES: uint64;
360
+ TOTAL_OUT_BYTES: uint64;
361
+ RATE_IN_BPS: double;
362
+ RATE_OUT_BPS: double;
363
+ }
364
+ /// list "bandwidth_history".
365
+ table NodeBandwidthSample { TS_MS: uint64; TOTAL_IN_BYTES: uint64; TOTAL_OUT_BYTES: uint64; RATE_IN_BPS: double; RATE_OUT_BPS: double; }
366
+ /// LIMIT 0 = 50, at most 256; list "events".
367
+ table NodeActivityParams { LIMIT: uint32; }
368
+ table NodeActivityEvent {
369
+ TS_MS: uint64;
370
+ KIND: string (aligned_max_length: 32);
371
+ DETAIL: string (aligned_max_length: 255);
372
+ PEER_ID: string (aligned_max_length: 128);
373
+ }
374
+
375
+ // ---- timers, schedule (SDK JS hosts) -------------------------------------------------------------------------------
376
+
377
+ table TimersDelayParams { MS: uint32; }
378
+ /// schedule.parse answers with list "fields" (CronField); matches with BoolValue; next with TimeValue.
379
+ table ScheduleParams { EXPRESSION: string (aligned_max_length: 128); AT_MS: uint64; }
380
+ table CronField {
381
+ NAME: string (aligned_max_length: 16);
382
+ SOURCE: string (aligned_max_length: 64);
383
+ HAS_WILDCARD: bool;
384
+ VALUES: [int32] (aligned_max_count: 60);
385
+ }
386
+
387
+ // ---- websocket, mqtt, sockets (SDK JS hosts) -----------------------------------------------------------------------
388
+
389
+ /// raw "url", "protocols" (comma-separated), "message"; raw out "url", "body".
390
+ table WebsocketParams { TIMEOUT_MS: uint32; NO_RESPONSE: bool; MESSAGE_IS_TEXT: bool; }
391
+ table WebsocketResult {
392
+ PROTOCOL: string (aligned_max_length: 64);
393
+ EXTENSIONS: string (aligned_max_length: 255);
394
+ CLOSE_CODE: int32; // -1 = none (the host always writes it)
395
+ CLOSE_REASON: string (aligned_max_length: 255);
396
+ BODY_IS_TEXT: bool;
397
+ }
398
+ /// raw "payload" and "password" in; raw "body" out (subscribe_once).
399
+ table MqttParams {
400
+ HOST: string (aligned_max_length: 255);
401
+ PORT: uint16;
402
+ CLIENT_ID: string (aligned_max_length: 128);
403
+ TOPIC: string (aligned_max_length: 255);
404
+ USERNAME: string (aligned_max_length: 128);
405
+ KEEP_ALIVE_S: uint16;
406
+ TIMEOUT_MS: uint32;
407
+ PACKET_ID: uint16;
408
+ }
409
+ table MqttResult {
410
+ HOST: string (aligned_max_length: 255);
411
+ PORT: uint16;
412
+ CLIENT_ID: string (aligned_max_length: 128);
413
+ TOPIC: string (aligned_max_length: 255);
414
+ PAYLOAD_BYTES: uint64;
415
+ }
416
+ /// tcp/udp/tls: raw "data", and "ca" / "cert" / "key" for TLS; raw "body" out.
417
+ table SocketParams {
418
+ HOST: string (aligned_max_length: 255);
419
+ PORT: uint16;
420
+ TIMEOUT_MS: uint32;
421
+ /// A response is awaited unless set.
422
+ NO_RESPONSE: bool;
423
+ BIND_ADDRESS: string (aligned_max_length: 64);
424
+ BIND_PORT: uint16;
425
+ UDP_TYPE: string (aligned_max_length: 8);
426
+ /// Unverified TLS peers are refused unless set.
427
+ ALLOW_UNAUTHORIZED: bool;
428
+ SERVER_NAME: string (aligned_max_length: 255);
429
+ }
430
+ table SocketResult {
431
+ HOST: string (aligned_max_length: 255);
432
+ PORT: uint16;
433
+ LOCAL_ADDRESS: string (aligned_max_length: 64);
434
+ LOCAL_PORT: uint16;
435
+ REMOTE_ADDRESS: string (aligned_max_length: 64);
436
+ REMOTE_PORT: uint16;
437
+ AUTHORIZED: bool;
438
+ AUTHORIZATION_ERROR: string (aligned_max_length: 255);
439
+ }
440
+
441
+ // ---- filesystem, exec, context (SDK JS hosts) ----------------------------------------------------------------------
442
+
443
+ /// raw "path" (and "to_path" for rename, "data" for writes); raw "path" / "data" out; readdir list "entries".
444
+ /// mkdir creates parents unless NOT_RECURSIVE.
445
+ table FsParams { NOT_RECURSIVE: bool; }
446
+ table FsEntry { NAME: string (aligned_max_length: 255); IS_FILE: bool; IS_DIRECTORY: bool; }
447
+ table FsStat { SIZE: uint64; IS_FILE: bool; IS_DIRECTORY: bool; CTIME_MS: double; MTIME_MS: double; }
448
+
449
+ /// raw "file", "cwd", "input"; list "args" (TextValue), list "env" (EnvVar); raw "stdout", "stderr" out.
450
+ table ExecParams { TIMEOUT_MS: uint32; }
451
+ table EnvVar { NAME: string (aligned_max_length: 128); VALUE: string (aligned_max_length: 255); }
452
+ table ExecResult { EXIT_CODE: int32; SIGNAL: string (aligned_max_length: 16); } // EXIT_CODE -1 = none (the host always writes it)
453
+
454
+ /// raw "value" (a typed FlatBuffer the module chooses) in for set, out for get.
455
+ table ContextParams { SCOPE: string (aligned_max_length: 128); KEY: string (aligned_max_length: 255); }
@@ -0,0 +1,25 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// An outbound HTTP request a module asks the host to make (the http host connector). Replaces the
5
+ /// hostcap/http-request JSON request. The host presents the validators it holds for URL (If-None-Match,
6
+ /// If-Modified-Since) unless the module set either itself.
7
+ table HttpRequest {
8
+ /// Verb, upper-case; empty means GET.
9
+ METHOD: string;
10
+ URL: string (required);
11
+ /// Request headers, sorted by NAME (e.g. "range": "bytes=0-1023").
12
+ HEADERS: [Header];
13
+ BODY: [ubyte];
14
+ /// Give up after this many milliseconds; 0 = the host's default.
15
+ TIMEOUT_MS: uint32;
16
+ /// Response body budget in bytes: the host errors past it, never truncates; 0 = the host's limit.
17
+ MAX_BYTES: uint64;
18
+ /// The module's own state for this request, echoed verbatim in the HttpResponse: one size-prefixed
19
+ /// FlatBuffer, identified by its own file identifier (an SDS record such as a $WXF header naming the wanted
20
+ /// field, or another runtime type). Never JSON.
21
+ CONTEXT: [ubyte];
22
+ }
23
+
24
+ root_type HttpRequest;
25
+ file_identifier "HREQ";
@@ -0,0 +1,24 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// The host's answer to one HttpRequest. Replaces the hostcap/http-request JSON response and the $HRB raw-body
5
+ /// frame. A 304 means the host presented validators and the publisher has nothing new.
6
+ table HttpResponse {
7
+ /// The URL answered (after redirects).
8
+ URL: string;
9
+ /// HTTP status; 0 when the request failed before a status (ERROR says why).
10
+ STATUS: int32;
11
+ /// Response headers, sorted by NAME.
12
+ HEADERS: [Header];
13
+ /// The body verbatim (never re-encoded).
14
+ BODY: [ubyte];
15
+ /// The request's CONTEXT, verbatim.
16
+ CONTEXT: [ubyte];
17
+ /// Why the exchange failed (timeout, budget exceeded, refused by policy); empty on an answered request.
18
+ ERROR: string;
19
+ /// When the body was received, Unix milliseconds UTC.
20
+ RETRIEVED_MS: uint64;
21
+ }
22
+
23
+ root_type HttpResponse;
24
+ file_identifier "HRSP";
@@ -0,0 +1,61 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// How a stored batch relates to what the lane already holds.
5
+ enum reconcileMode : ubyte {
6
+ /// Duplicates of records already held are dropped (the default).
7
+ Duplicates,
8
+ /// Store as given.
9
+ None,
10
+ /// The batch is the lane's whole current set: older batches of the lane are retired.
11
+ Current
12
+ }
13
+
14
+ /// The raw document a batch was made from, kept by the host when it has an archive root.
15
+ table ArchiveTarget {
16
+ /// Archive folder (normally the provider).
17
+ SOURCE: string;
18
+ /// File name within it.
19
+ NAME: string;
20
+ }
21
+
22
+ /// How a batch was produced: what was fetched, what came of it.
23
+ table Provenance {
24
+ SOURCE_URL: string;
25
+ HTTP_STATUS: int32;
26
+ ETAG: string;
27
+ LAST_MODIFIED: string;
28
+ CONTENT_TYPE: string;
29
+ /// When the source was retrieved, Unix milliseconds UTC.
30
+ RETRIEVED_MS: uint64;
31
+ /// The producing module and its version.
32
+ PARSER: string;
33
+ PARSER_VERSION: string;
34
+ /// SHA-256 (hex) of the source bytes, and of the normalized record stream.
35
+ SOURCE_SHA256: string;
36
+ NORMALIZED_SHA256: string;
37
+ NORMALIZED_COUNT: uint64;
38
+ /// Records per standard, as "SCHEMA" entries with their counts (parallel vectors).
39
+ SCHEMAS: [string];
40
+ SCHEMA_COUNTS: [uint64];
41
+ WARNINGS: [string];
42
+ FROM_CACHE: bool;
43
+ /// Descriptive provenance the parser has no field above for - the method, units, the date range covered, counts
44
+ /// of what was dropped or filled - as name / value pairs, kept in order (a name may repeat). Values are text.
45
+ ATTRIBUTES: [Header];
46
+ }
47
+
48
+ /// A request to store one batch of records with its source tags (the storage-ingest host connector). The records
49
+ /// themselves travel beside it as the size-prefixed FlatBuffer record stream, the raw document (when archived) as
50
+ /// raw bytes. Replaces the storage.ingest_with_source meta JSON.
51
+ table IngestRequest {
52
+ /// The records' standard, e.g. "WXF.fbs".
53
+ SCHEMA: string (required);
54
+ TAGS: SourceTags (required);
55
+ RECONCILE: reconcileMode = Duplicates;
56
+ ARCHIVE: ArchiveTarget;
57
+ PROVENANCE: Provenance;
58
+ }
59
+
60
+ root_type IngestRequest;
61
+ file_identifier "INGQ";
@@ -0,0 +1,23 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// What the host did with one IngestRequest. Replaces the storage.ingest_with_source result JSON.
5
+ table IngestResult {
6
+ SCHEMA: string;
7
+ PROVIDER_ID: string;
8
+ SOURCE_NAME: string;
9
+ BATCH_ID: string;
10
+ /// Records newly stored.
11
+ INSERTED: uint64;
12
+ /// Records already held, dropped (reconcile Duplicates).
13
+ RECONCILED_DUPLICATES: uint64;
14
+ /// Older records of the lane retired (reconcile Current).
15
+ RECONCILED_OLD_BATCHES: uint64;
16
+ /// Where the raw document was archived; empty when it was not.
17
+ ARCHIVED: string;
18
+ /// Why the batch was refused (quota, licence, policy); empty when it was stored.
19
+ REFUSED: string;
20
+ }
21
+
22
+ root_type IngestResult;
23
+ file_identifier "INGR";
@@ -0,0 +1,41 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// What a config value is.
5
+ enum configValueKind : ubyte {
6
+ String,
7
+ Number,
8
+ Bool,
9
+ StringList,
10
+ NumberList,
11
+ /// A list of nested tables (e.g. retention targets: each a table of schema, provider_id, sources).
12
+ TableList
13
+ }
14
+
15
+ /// One configured value, typed. Readers check KIND and read the matching field.
16
+ table ConfigEntry {
17
+ KEY: string (key);
18
+ KIND: configValueKind;
19
+ STRING_VALUE: string;
20
+ NUMBER_VALUE: double;
21
+ BOOL_VALUE: bool;
22
+ STRINGS: [string];
23
+ NUMBERS: [double];
24
+ TABLES: [ConfigTable];
25
+ }
26
+
27
+ /// A nested table of entries, sorted by KEY.
28
+ table ConfigTable {
29
+ ENTRIES: [ConfigEntry];
30
+ }
31
+
32
+ /// A module node's configuration as the host delivers it (the node config file's flows.services[].config,
33
+ /// typed). PLG defines node CONFIG as "FlatBuffer or raw bytes; never JSON": this is that FlatBuffer.
34
+ /// Replaces the plugin.getConfig JSON.
35
+ table ModuleConfig {
36
+ /// Entries sorted by KEY.
37
+ ENTRIES: [ConfigEntry];
38
+ }
39
+
40
+ root_type ModuleConfig;
41
+ file_identifier "MCFG";
@@ -0,0 +1,33 @@
1
+ // Shared tables of the module runtime ABI (sdn.runtime). The typed frames that cross a module port, a host
2
+ // connector or the flow runtime are FlatBuffers: SDS standards for data, these runtime types for the host/runtime
3
+ // contract itself (typed-contracts 1.0, owner 2026-10-13: "flatbuffer SDS only"; no JSON forms).
4
+ namespace sdn.runtime;
5
+
6
+ /// One header of an outbound HTTP exchange. NAME is lower-cased and a FlatBuffers key, so a header vector is
7
+ /// sorted and binary-searchable; encoders sort by NAME.
8
+ table Header {
9
+ NAME: string (key);
10
+ VALUE: string;
11
+ }
12
+
13
+ /// Where a batch of records comes from and how it may be used: the source tags SDN stores beside every record
14
+ /// (they are metadata about a record, never bytes inside it).
15
+ table SourceTags {
16
+ /// Publisher identity, e.g. "noaa-ncep".
17
+ PROVIDER_ID: string;
18
+ /// The source lane within the provider, e.g. "gfs-0p25-sea".
19
+ SOURCE_NAME: string;
20
+ /// The batch the records belong to.
21
+ BATCH_ID: string;
22
+ /// The document the records were made from.
23
+ SOURCE_URL: string;
24
+ /// Content key the records are sealed under ("public" when not sealed).
25
+ CONTENT_KEY_ID: string;
26
+ /// Producer peer the records are attributed to, e.g. "source:noaa".
27
+ SOURCE_PEER: string;
28
+ /// SPDX licence identifier.
29
+ LICENSE: string;
30
+ LICENSE_URL: string;
31
+ CITATION: string;
32
+ SHARE_ALIKE: bool;
33
+ }
@@ -0,0 +1,18 @@
1
+ include "RuntimeCommon.fbs";
2
+ namespace sdn.runtime;
3
+
4
+ /// A trigger firing: what the host's scheduler hands a flow's timer-bound node. Replaces the untyped
5
+ /// sdn-timer-tick frame.
6
+ table TimerTick {
7
+ /// The flow trigger that fired (PLG trigger id).
8
+ TRIGGER_ID: string;
9
+ /// When it was due, Unix milliseconds UTC.
10
+ SCHEDULED_MS: uint64;
11
+ /// When the host fired it, Unix milliseconds UTC.
12
+ FIRED_MS: uint64;
13
+ /// How many times this trigger has fired since the flow started (0-based).
14
+ SEQUENCE: uint64;
15
+ }
16
+
17
+ root_type TimerTick;
18
+ file_identifier "TICK";