space-data-module-sdk 0.9.0 → 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.
- package/package.json +1 -1
- package/schemas/runtime/HostOps.fbs +24 -22
- package/schemas/runtime/IngestRequest.fbs +3 -0
- package/src/capabilities.js +3 -0
- package/src/generated/runtime/aligned/HostOps_aligned.js +133 -144
- package/src/generated/runtime/aligned/HostOps_aligned.ts +138 -153
- package/src/generated/runtime/aligned/HostOps_enums.js +1 -3
- package/src/generated/runtime/aligned/HostOps_enums.ts +0 -1
- package/src/generated/runtime/cpp/HostOps_aligned.h +111 -118
- package/src/generated/runtime/cpp/IngestRequest_generated.h +70 -5
- package/src/generated/runtime/sdn/runtime/Provenance.js +37 -5
- package/src/generated/runtime/sdn/runtime/Provenance.ts +42 -5
- package/src/host/abi.js +12 -3
- package/src/host/adapterOperations.js +79 -0
- package/src/host/browserHost.js +63 -2
- package/src/host/cpp/typedHostcall.hpp +51 -0
- package/src/host/hostWorkerBundleSources.js +3 -3
- package/src/host/nodeHost.js +49 -0
- package/src/host/typedDispatch.js +353 -1
- package/src/index.d.ts +25 -2
- package/src/standards/runtimeContracts.js +67 -7
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
// - a list port (e.g. "entries"): a run of aligned records of one table, back to back at a fixed stride;
|
|
12
12
|
// - a raw port (e.g. "body", "records", "url", "sql", "path"): unbounded bytes, verbatim - bodies, keys, record
|
|
13
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.
|
|
14
18
|
// Aligned strings hold at most 255 bytes; a value that does not fit is refused, never truncated. Times are Unix
|
|
15
19
|
// milliseconds UTC. A zero or an empty string means "not given" and the host applies the documented default: aligned records have no
|
|
16
20
|
// schema defaults (an unset field reads zero), so every field here is phrased so that zero is the default.
|
|
@@ -86,7 +90,7 @@ table StoredRecordMeta {
|
|
|
86
90
|
SOURCE_NAME: string (aligned_max_length: 128);
|
|
87
91
|
BATCH_ID: string (aligned_max_length: 128);
|
|
88
92
|
PRODUCER_PEER_ID: string (aligned_max_length: 128);
|
|
89
|
-
LICENSE: string (aligned_max_length:
|
|
93
|
+
LICENSE: string (aligned_max_length: 128);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
/// One record on raw "data"; the result names its CID.
|
|
@@ -110,16 +114,17 @@ table StorageExpireResult { DELETED: uint64; MISSING: uint64; CAPPED: bool; }
|
|
|
110
114
|
|
|
111
115
|
enum reconcileKind : ubyte { Duplicates, None, Current }
|
|
112
116
|
/// One batch: raw "records" (size-prefixed record stream), optional raw "archive" (the source document, kept under
|
|
113
|
-
/// ARCHIVE_SOURCE/ARCHIVE_NAME when the host has an archive root), optional "provenance"
|
|
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).
|
|
114
119
|
table StorageIngestParams {
|
|
115
120
|
SCHEMA: string (aligned_max_length: 64);
|
|
116
121
|
PROVIDER_ID: string (aligned_max_length: 128);
|
|
117
122
|
SOURCE_NAME: string (aligned_max_length: 128);
|
|
118
123
|
BATCH_ID: string (aligned_max_length: 128);
|
|
119
124
|
SOURCE_URL: string (aligned_max_length: 255);
|
|
120
|
-
CONTENT_KEY_ID: string (aligned_max_length:
|
|
125
|
+
CONTENT_KEY_ID: string (aligned_max_length: 128);
|
|
121
126
|
SOURCE_PEER: string (aligned_max_length: 128);
|
|
122
|
-
LICENSE: string (aligned_max_length:
|
|
127
|
+
LICENSE: string (aligned_max_length: 128);
|
|
123
128
|
LICENSE_URL: string (aligned_max_length: 255);
|
|
124
129
|
CITATION: string (aligned_max_length: 255);
|
|
125
130
|
SHARE_ALIKE: bool;
|
|
@@ -130,17 +135,23 @@ table StorageIngestParams {
|
|
|
130
135
|
table Provenance {
|
|
131
136
|
SOURCE_URL: string (aligned_max_length: 255);
|
|
132
137
|
HTTP_STATUS: int32;
|
|
133
|
-
ETAG: string (aligned_max_length:
|
|
138
|
+
ETAG: string (aligned_max_length: 255);
|
|
134
139
|
LAST_MODIFIED: string (aligned_max_length: 64);
|
|
135
140
|
CONTENT_TYPE: string (aligned_max_length: 128);
|
|
136
141
|
RETRIEVED_MS: uint64;
|
|
137
|
-
PARSER: string (aligned_max_length:
|
|
138
|
-
PARSER_VERSION: string (aligned_max_length:
|
|
142
|
+
PARSER: string (aligned_max_length: 128);
|
|
143
|
+
PARSER_VERSION: string (aligned_max_length: 64);
|
|
139
144
|
SOURCE_SHA256: string (aligned_max_length: 64);
|
|
140
145
|
NORMALIZED_SHA256: string (aligned_max_length: 64);
|
|
141
146
|
NORMALIZED_COUNT: uint64;
|
|
142
147
|
FROM_CACHE: bool;
|
|
143
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
|
+
}
|
|
144
155
|
table StorageIngestResult {
|
|
145
156
|
SCHEMA: string (aligned_max_length: 64);
|
|
146
157
|
BATCH_ID: string (aligned_max_length: 128);
|
|
@@ -151,16 +162,7 @@ table StorageIngestResult {
|
|
|
151
162
|
PROVENANCE_FILE: string (aligned_max_length: 255);
|
|
152
163
|
}
|
|
153
164
|
|
|
154
|
-
|
|
155
|
-
/// One SQL parameter (list "sql_params") or result cell (list "cells", row-major).
|
|
156
|
-
table SqlValue {
|
|
157
|
-
KIND: sqlValueKind;
|
|
158
|
-
BOOL_VALUE: bool;
|
|
159
|
-
I64_VALUE: int64;
|
|
160
|
-
F64_VALUE: double;
|
|
161
|
-
STR_VALUE: string (aligned_max_length: 255);
|
|
162
|
-
}
|
|
163
|
-
/// raw "sql", list "sql_params"; the answer: a StreamResult with raw "stream" (deliver Inline) or its BodyRef.
|
|
165
|
+
/// raw "sql", raw "params" (tagged SQL values); the answer: a StreamResult with raw "stream" (deliver Inline) or its BodyRef.
|
|
164
166
|
table SqlStreamParams { DELIVER: deliverMode; }
|
|
165
167
|
table StreamResult {
|
|
166
168
|
ROWS: uint64;
|
|
@@ -176,8 +178,8 @@ table EpochStreamParams {
|
|
|
176
178
|
DELIVER: deliverMode;
|
|
177
179
|
}
|
|
178
180
|
enum sandboxWant : ubyte { Stream, Rows, Auto }
|
|
179
|
-
/// raw "sql",
|
|
180
|
-
/// "cells" (
|
|
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).
|
|
181
183
|
table SandboxQueryParams { WANT: sandboxWant; DELIVER: deliverMode; }
|
|
182
184
|
table SandboxQueryResult { KIND: sandboxWant; ROWS: uint64; COLUMNS: uint32; REF: BodyRef; }
|
|
183
185
|
/// storage.query_surface: list "tables", list "columns".
|
|
@@ -193,7 +195,7 @@ table SurfaceColumn {
|
|
|
193
195
|
PLACEHOLDER: bool;
|
|
194
196
|
}
|
|
195
197
|
table QuerySurfaceLimits { TIMEOUT_MS: uint32; MAX_ROWS: uint64; MAX_BYTES: uint64; }
|
|
196
|
-
/// raw "sql",
|
|
198
|
+
/// raw "sql", raw "params" (tagged SQL values), list "projection" (TextValue); the key comes back as a TextValue.
|
|
197
199
|
table CacheKeyParams {
|
|
198
200
|
SCHEMA_NAME: string (aligned_max_length: 64);
|
|
199
201
|
SCHEMA_VERSION: string (aligned_max_length: 32);
|
|
@@ -302,7 +304,7 @@ table P2pPnmEntry {
|
|
|
302
304
|
GOSSIP_PEER_ID: string (aligned_max_length: 128);
|
|
303
305
|
STANDARD: string (aligned_max_length: 16);
|
|
304
306
|
SCHEMA: string (aligned_max_length: 64);
|
|
305
|
-
FILE_ID: string (aligned_max_length:
|
|
307
|
+
FILE_ID: string (aligned_max_length: 255);
|
|
306
308
|
FILE_NAME: string (aligned_max_length: 255);
|
|
307
309
|
CID: string (aligned_max_length: 128);
|
|
308
310
|
PUBLISH_MS: uint64;
|
|
@@ -324,7 +326,7 @@ table P2pLatestDataset {
|
|
|
324
326
|
STANDARD: string (aligned_max_length: 16);
|
|
325
327
|
SCHEMA: string (aligned_max_length: 64);
|
|
326
328
|
PNM_CID: string (aligned_max_length: 128);
|
|
327
|
-
PNM_FILE_ID: string (aligned_max_length:
|
|
329
|
+
PNM_FILE_ID: string (aligned_max_length: 255);
|
|
328
330
|
PNM_PUBLISH_MS: uint64;
|
|
329
331
|
PNM_SIGNATURE_VERIFIED: bool;
|
|
330
332
|
PNM_ATTRIBUTION: string (aligned_max_length: 16);
|
|
@@ -40,6 +40,9 @@ table Provenance {
|
|
|
40
40
|
SCHEMA_COUNTS: [uint64];
|
|
41
41
|
WARNINGS: [string];
|
|
42
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];
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
/// A request to store one batch of records with its source tags (the storage-ingest host connector). The records
|
package/src/capabilities.js
CHANGED
|
@@ -17,6 +17,8 @@ export const RecommendedCapabilityIds = Object.freeze([
|
|
|
17
17
|
"protocol_handle",
|
|
18
18
|
"protocol_dial",
|
|
19
19
|
"p2p_read",
|
|
20
|
+
"node_status_read",
|
|
21
|
+
"node_activity_read",
|
|
20
22
|
"database",
|
|
21
23
|
"storage_adapter",
|
|
22
24
|
"storage_query",
|
|
@@ -24,6 +26,7 @@ export const RecommendedCapabilityIds = Object.freeze([
|
|
|
24
26
|
"storage_ingest",
|
|
25
27
|
"context_read",
|
|
26
28
|
"context_write",
|
|
29
|
+
"secrets",
|
|
27
30
|
"process_exec",
|
|
28
31
|
"crypto_hash",
|
|
29
32
|
"crypto_sign",
|