space-data-module-sdk 0.9.12 → 0.9.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "space-data-module-sdk",
3
- "version": "0.9.12",
3
+ "version": "0.9.14",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Module SDK for building, validating, signing, and deploying WebAssembly modules on the Space Data Network.",
6
6
  "type": "module",
@@ -131,7 +131,7 @@
131
131
  "flatsql": "^2.0.0",
132
132
  "hd-wallet-wasm": "2.1.0",
133
133
  "sdn-emception": "1.0.0",
134
- "spacedatastandards.org": "1.206.0"
134
+ "spacedatastandards.org": "1.261.0"
135
135
  },
136
136
  "devDependencies": {
137
137
  "esbuild": "^0.28.0",
@@ -45,8 +45,10 @@ const execFileAsync = promisify(execFile);
45
45
  const require = createRequire(import.meta.url);
46
46
 
47
47
  // Bump when the entry layout or the meaning of a key changes.
48
- export const COMPILE_CACHE_FORMAT = "sdm-compile-cache-v1";
49
- const ENTRY_MAGIC = new TextEncoder().encode("SDMCC1\n");
48
+ export const COMPILE_CACHE_FORMAT = "sdm-compile-cache-v2";
49
+ // v2 (0.9.14): binary keys and a fixed binary entry layout. A v1 entry (0.9.12)
50
+ // has another magic and is a miss.
51
+ const ENTRY_MAGIC = new TextEncoder().encode("SDMCC2\n");
50
52
  const ENTRY_SUFFIX = ".entry";
51
53
  const DISABLED_VALUES = new Set(["0", "off", "false", "no", "disabled"]);
52
54
  const DEFAULT_MAX_BYTES = 4 * 1024 ** 3;
@@ -81,16 +83,60 @@ export function sha256Hex(bytes) {
81
83
  return createHash("sha256").update(bytes).digest("hex");
82
84
  }
83
85
 
84
- // A stable digest of a JSON-able value (object keys sorted).
85
- export function digestOf(value) {
86
- return sha256Hex(stableStringify(value));
86
+ // A stable digest of a value made of null, booleans, numbers, strings, byte
87
+ // arrays, arrays and plain objects. Each field is fed into the sha256 as a type
88
+ // tag and length-prefixed bytes (object keys sorted, undefined members
89
+ // skipped), so distinct values never share an encoding.
90
+ const DIGEST_TAG = Object.freeze({ NULL: 0, FALSE: 1, TRUE: 2, NUMBER: 3, STRING: 4, BYTES: 5, ARRAY: 6, OBJECT: 7 });
91
+ const textEncoder = new TextEncoder();
92
+
93
+ function u32(value) {
94
+ const out = Buffer.alloc(4);
95
+ out.writeUInt32LE(value >>> 0, 0);
96
+ return out;
97
+ }
98
+
99
+ function feedLengthPrefixed(hash, tag, bytes) {
100
+ hash.update(Uint8Array.of(tag));
101
+ hash.update(u32(bytes.length));
102
+ hash.update(bytes);
103
+ }
104
+
105
+ function feedDigestValue(hash, value) {
106
+ if (value === null || value === undefined) {
107
+ hash.update(Uint8Array.of(DIGEST_TAG.NULL));
108
+ } else if (typeof value === "boolean") {
109
+ hash.update(Uint8Array.of(value ? DIGEST_TAG.TRUE : DIGEST_TAG.FALSE));
110
+ } else if (typeof value === "number") {
111
+ const bytes = Buffer.alloc(8);
112
+ bytes.writeDoubleLE(value, 0);
113
+ hash.update(Uint8Array.of(DIGEST_TAG.NUMBER));
114
+ hash.update(bytes);
115
+ } else if (typeof value === "string") {
116
+ feedLengthPrefixed(hash, DIGEST_TAG.STRING, textEncoder.encode(value));
117
+ } else if (value instanceof Uint8Array) {
118
+ feedLengthPrefixed(hash, DIGEST_TAG.BYTES, value);
119
+ } else if (Array.isArray(value)) {
120
+ hash.update(Uint8Array.of(DIGEST_TAG.ARRAY));
121
+ hash.update(u32(value.length));
122
+ for (const item of value) feedDigestValue(hash, item);
123
+ } else if (typeof value === "object") {
124
+ const keys = Object.keys(value).filter((key) => value[key] !== undefined).sort();
125
+ hash.update(Uint8Array.of(DIGEST_TAG.OBJECT));
126
+ hash.update(u32(keys.length));
127
+ for (const key of keys) {
128
+ feedLengthPrefixed(hash, DIGEST_TAG.STRING, textEncoder.encode(key));
129
+ feedDigestValue(hash, value[key]);
130
+ }
131
+ } else {
132
+ throw new TypeError(`digestOf cannot encode a ${typeof value}.`);
133
+ }
87
134
  }
88
135
 
89
- function stableStringify(value) {
90
- if (value === null || typeof value !== "object") return JSON.stringify(value);
91
- if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
92
- const keys = Object.keys(value).filter((key) => value[key] !== undefined).sort();
93
- return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringify(value[key])}`).join(",")}}`;
136
+ export function digestOf(value) {
137
+ const hash = createHash("sha256");
138
+ feedDigestValue(hash, value);
139
+ return hash.digest("hex");
94
140
  }
95
141
 
96
142
  function toBytes(content) {
@@ -110,38 +156,91 @@ export function digestFiles(files) {
110
156
  return hash.digest("hex");
111
157
  }
112
158
 
113
- function encodeEntry(meta, blobs) {
159
+ // One entry, a fixed little-endian layout:
160
+ //
161
+ // magic "SDMCC2\n"
162
+ // key 32 bytes (the sha256 key the entry is stored under)
163
+ // u32 dependency count, then per dependency:
164
+ // u32 path length, path (utf-8), f64 size, f64 mtimeMs, 32-byte sha256
165
+ // u32 blob count, then per blob (sorted by name):
166
+ // u16 name length, name (utf-8), u32 size, 32-byte sha256
167
+ // blob bytes, in the same order
168
+ function encodeEntry(key, blobs, externalDeps = []) {
169
+ const parts = [ENTRY_MAGIC, Buffer.from(key, "hex"), u32(externalDeps.length)];
170
+ for (const dep of externalDeps) {
171
+ const pathBytes = textEncoder.encode(dep.path);
172
+ const stats = Buffer.alloc(16);
173
+ stats.writeDoubleLE(dep.size, 0);
174
+ stats.writeDoubleLE(dep.mtimeMs, 8);
175
+ parts.push(u32(pathBytes.length), pathBytes, stats, Buffer.from(dep.sha256, "hex"));
176
+ }
114
177
  const names = Object.keys(blobs).sort();
115
- const header = {
116
- format: COMPILE_CACHE_FORMAT,
117
- meta,
118
- blobs: names.map((name) => ({ name, size: blobs[name].length, sha256: sha256Hex(blobs[name]) })),
119
- };
120
- const headerBytes = new TextEncoder().encode(JSON.stringify(header));
121
- const lengthBytes = new Uint8Array(4);
122
- new DataView(lengthBytes.buffer).setUint32(0, headerBytes.length, true);
123
- return Buffer.concat([ENTRY_MAGIC, lengthBytes, headerBytes, ...names.map((name) => blobs[name])]);
178
+ parts.push(u32(names.length));
179
+ for (const name of names) {
180
+ const nameBytes = textEncoder.encode(name);
181
+ const nameLength = Buffer.alloc(2);
182
+ nameLength.writeUInt16LE(nameBytes.length, 0);
183
+ parts.push(nameLength, nameBytes, u32(blobs[name].length), Buffer.from(sha256Hex(blobs[name]), "hex"));
184
+ }
185
+ return Buffer.concat([...parts, ...names.map((name) => blobs[name])]);
124
186
  }
125
187
 
126
188
  function decodeEntry(bytes) {
127
- if (bytes.length < ENTRY_MAGIC.length + 4) return null;
189
+ const buffer = Buffer.from(bytes.buffer, bytes.byteOffset, bytes.length);
190
+ let offset = 0;
191
+ const need = (count) => {
192
+ if (offset + count > buffer.length) throw new RangeError("truncated cache entry");
193
+ };
194
+ need(ENTRY_MAGIC.length + 32);
128
195
  for (let index = 0; index < ENTRY_MAGIC.length; index += 1) {
129
- if (bytes[index] !== ENTRY_MAGIC[index]) return null;
196
+ if (buffer[index] !== ENTRY_MAGIC[index]) return null;
197
+ }
198
+ offset = ENTRY_MAGIC.length;
199
+ const key = buffer.subarray(offset, offset + 32).toString("hex");
200
+ offset += 32;
201
+ need(4);
202
+ const depCount = buffer.readUInt32LE(offset);
203
+ offset += 4;
204
+ const externalDeps = [];
205
+ for (let index = 0; index < depCount; index += 1) {
206
+ need(4);
207
+ const pathLength = buffer.readUInt32LE(offset);
208
+ offset += 4;
209
+ need(pathLength + 48);
210
+ const depPath = buffer.subarray(offset, offset + pathLength).toString("utf8");
211
+ offset += pathLength;
212
+ const size = buffer.readDoubleLE(offset);
213
+ const mtimeMs = buffer.readDoubleLE(offset + 8);
214
+ const sha256 = buffer.subarray(offset + 16, offset + 48).toString("hex");
215
+ offset += 48;
216
+ externalDeps.push({ path: depPath, size, mtimeMs, sha256 });
217
+ }
218
+ need(4);
219
+ const blobCount = buffer.readUInt32LE(offset);
220
+ offset += 4;
221
+ const index = [];
222
+ for (let blob = 0; blob < blobCount; blob += 1) {
223
+ need(2);
224
+ const nameLength = buffer.readUInt16LE(offset);
225
+ offset += 2;
226
+ need(nameLength + 36);
227
+ const name = buffer.subarray(offset, offset + nameLength).toString("utf8");
228
+ offset += nameLength;
229
+ const size = buffer.readUInt32LE(offset);
230
+ const sha256 = buffer.subarray(offset + 4, offset + 36).toString("hex");
231
+ offset += 36;
232
+ index.push({ name, size, sha256 });
130
233
  }
131
- const headerLength = new DataView(bytes.buffer, bytes.byteOffset + ENTRY_MAGIC.length, 4).getUint32(0, true);
132
- const headerStart = ENTRY_MAGIC.length + 4;
133
- const header = JSON.parse(new TextDecoder().decode(bytes.subarray(headerStart, headerStart + headerLength)));
134
- if (header?.format !== COMPILE_CACHE_FORMAT || !Array.isArray(header.blobs)) return null;
135
234
  const blobs = {};
136
- let offset = headerStart + headerLength;
137
- for (const { name, size, sha256 } of header.blobs) {
138
- const blob = new Uint8Array(bytes.subarray(offset, offset + size));
139
- if (blob.length !== size || sha256Hex(blob) !== sha256) return null;
235
+ for (const { name, size, sha256 } of index) {
236
+ need(size);
237
+ const blob = new Uint8Array(buffer.subarray(offset, offset + size));
238
+ if (sha256Hex(blob) !== sha256) return null;
140
239
  blobs[name] = blob;
141
240
  offset += size;
142
241
  }
143
- if (offset !== bytes.length) return null;
144
- return { meta: header.meta ?? {}, blobs };
242
+ if (offset !== buffer.length) return null;
243
+ return { key, externalDeps, blobs };
145
244
  }
146
245
 
147
246
  // Header dependencies outside the staged build dir: each is recorded with its
@@ -216,7 +315,7 @@ export class CompileCache {
216
315
  return path.join(this.entriesDir, key.slice(0, 2), `${key}${ENTRY_SUFFIX}`);
217
316
  }
218
317
 
219
- /** The stored entry for `key` ({ meta, blobs }), or null. */
318
+ /** The stored entry for `key` ({ key, externalDeps, blobs }), or null. */
220
319
  async get(key) {
221
320
  const file = this.entryPath(key);
222
321
  let bytes;
@@ -232,7 +331,7 @@ export class CompileCache {
232
331
  } catch {
233
332
  entry = null;
234
333
  }
235
- if (!entry || entry.meta?.key !== key || !(await externalDependenciesUnchanged(entry.meta?.externalDeps))) {
334
+ if (!entry || entry.key !== key || !(await externalDependenciesUnchanged(entry.externalDeps))) {
236
335
  this.stats.misses += 1;
237
336
  return null;
238
337
  }
@@ -243,14 +342,17 @@ export class CompileCache {
243
342
  return entry;
244
343
  }
245
344
 
246
- /** Store `blobs` ({ name: Uint8Array }) under `key`, atomically. */
247
- async put(key, blobs, meta = {}) {
345
+ /**
346
+ * Store `blobs` ({ name: Uint8Array }) under `key`, atomically, with the
347
+ * external header dependencies a lookup re-checks (`{ externalDeps }`).
348
+ */
349
+ async put(key, blobs, { externalDeps = [] } = {}) {
248
350
  const file = this.entryPath(key);
249
351
  const dir = path.dirname(file);
250
352
  try {
251
353
  await mkdir(dir, { recursive: true });
252
354
  const temp = path.join(dir, `.${key}.${process.pid}-${randomBytes(6).toString("hex")}.tmp`);
253
- await writeFile(temp, encodeEntry({ ...meta, key }, blobs));
355
+ await writeFile(temp, encodeEntry(key, blobs, externalDeps));
254
356
  try {
255
357
  await rename(temp, file);
256
358
  } catch (error) {
@@ -339,9 +441,7 @@ let sdkIdentityPromise = null;
339
441
  export function getSdkCompileIdentity() {
340
442
  sdkIdentityPromise ??= (async () => {
341
443
  const compilerDir = path.dirname(fileURLToPath(import.meta.url));
342
- const packageJson = JSON.parse(
343
- await readFile(path.join(compilerDir, "..", "..", "package.json"), "utf8"),
344
- );
444
+ const packageJson = require(path.join(compilerDir, "..", "..", "package.json"));
345
445
  const files = {};
346
446
  for (const name of (await readdir(compilerDir)).filter((entry) => entry.endsWith(".js")).sort()) {
347
447
  files[name] = await readFile(path.join(compilerDir, name));
@@ -385,7 +485,7 @@ const toolchainIdentityCache = new Map();
385
485
  * libraries.
386
486
  */
387
487
  export function getNativeClangIdentity({ drivers, toolchainArgs = [], roots = [] }) {
388
- const cacheKey = JSON.stringify({ drivers, toolchainArgs, roots });
488
+ const cacheKey = ["native-clang", drivers.join("\u0001"), toolchainArgs.join("\u0001"), roots.join("\u0001")].join("\u0000");
389
489
  if (!toolchainIdentityCache.has(cacheKey)) {
390
490
  toolchainIdentityCache.set(cacheKey, (async () => {
391
491
  const driverIds = [];
@@ -436,7 +536,7 @@ async function describeLibraries(root) {
436
536
 
437
537
  /** Identity of a system Emscripten (em++ / emcc on PATH). */
438
538
  export function getSystemEmscriptenIdentity(commands) {
439
- const cacheKey = JSON.stringify({ emscripten: commands });
539
+ const cacheKey = ["system-emscripten", ...commands].join("\u0000");
440
540
  if (!toolchainIdentityCache.has(cacheKey)) {
441
541
  toolchainIdentityCache.set(cacheKey, (async () => {
442
542
  const ids = [];
@@ -463,7 +563,7 @@ export function getEmceptionPackageIdentity(extra = "") {
463
563
  let version = "unknown";
464
564
  for (;;) {
465
565
  try {
466
- const pkg = JSON.parse(await readFile(path.join(packageRoot, "package.json"), "utf8"));
566
+ const pkg = require(path.join(packageRoot, "package.json"));
467
567
  if (pkg?.name === "sdn-emception") {
468
568
  version = String(pkg.version);
469
569
  break;
@@ -956,7 +956,7 @@ function normalizeLibraries(libraries) {
956
956
  if (!LIBRARY_NAME.test(name) || !LIBRARY_VERSION.test(version)) {
957
957
  throw new Error(
958
958
  `libraries[${index}] needs a name and a version of letters, digits, '.', '_' or '-' ` +
959
- `(got name ${JSON.stringify(library?.name)}, version ${JSON.stringify(library?.version)}).`,
959
+ `(got name "${String(library?.name)}", version "${String(library?.version)}").`,
960
960
  );
961
961
  }
962
962
  if (seen.has(name)) {
@@ -969,12 +969,12 @@ function normalizeLibraries(libraries) {
969
969
  }
970
970
  const language = String(library?.language ?? "c").trim().toLowerCase();
971
971
  if (!["c", "c++", "cpp", "cxx"].includes(language)) {
972
- throw new Error(`libraries[${index}] ("${name}"): language must be "c" or "c++", got ${JSON.stringify(library?.language)}.`);
972
+ throw new Error(`libraries[${index}] ("${name}"): language must be "c" or "c++", got "${String(library?.language)}".`);
973
973
  }
974
974
  const defines = (Array.isArray(library?.defines) ? library.defines : []).map((define) => {
975
975
  const text = String(define ?? "").trim();
976
976
  if (!PREPROCESSOR_DEFINE.test(text)) {
977
- throw new Error(`libraries[${index}] ("${name}"): define ${JSON.stringify(define)} is not NAME or NAME=VALUE.`);
977
+ throw new Error(`libraries[${index}] ("${name}"): define "${String(define)}" is not NAME or NAME=VALUE.`);
978
978
  }
979
979
  return text;
980
980
  });
@@ -16,6 +16,15 @@
16
16
  import path from "node:path";
17
17
  import { mkdir, rm, writeFile } from "node:fs/promises";
18
18
 
19
+ import { canonicalBytes } from "../auth/canonicalize.js";
20
+
21
+ function concatNewline(bytes) {
22
+ const out = new Uint8Array(bytes.length + 1);
23
+ out.set(bytes, 0);
24
+ out[bytes.length] = 0x0a;
25
+ return out;
26
+ }
27
+
19
28
  /**
20
29
  * Write a compilation's guest-link object, its library objects and
21
30
  * metadata.json into `dir` (usually `<package>/dist/guest-link`). `metadata`
@@ -55,6 +64,8 @@ export async function writeGuestLinkFiles(compilation, dir, metadata = {}) {
55
64
  ...(libraryEntries.length > 0 ? { libraries: libraryEntries } : {}),
56
65
  ...metadata,
57
66
  };
58
- await writeFile(path.join(dir, "metadata.json"), `${JSON.stringify(written, null, 2)}\n`);
67
+ // The SDK's one canonical writer of this metadata (the guest-link bundle entry
68
+ // encodes the same object the same way): sorted keys, no whitespace.
69
+ await writeFile(path.join(dir, "metadata.json"), concatNewline(canonicalBytes(written)));
59
70
  return written;
60
71
  }
@@ -46,6 +46,26 @@ export declare enum hostCapabilityKind {
46
46
  * single record without source attribution. Hosts gate
47
47
  * storage.ingest_with_source on this capability specifically.
48
48
  */
49
- STORAGE_INGEST = 36
49
+ STORAGE_INGEST = 36,
50
+ /**
51
+ * Read the node's view of its peer-to-peer network: known peers, the
52
+ * publication notices it has received and verified, and the latest
53
+ * dataset of a lane (p2p.* host operations).
54
+ */
55
+ P2P_READ = 37,
56
+ /**
57
+ * Read the node's own health: uptime, service state, storage and network
58
+ * figures (node_status_read.status).
59
+ */
60
+ NODE_STATUS_READ = 38,
61
+ /**
62
+ * Read the node's event log (node_activity_read.activity).
63
+ */
64
+ NODE_ACTIVITY_READ = 39,
65
+ /**
66
+ * Read and write operator-held secrets by identifier (credentials for
67
+ * upstream sources); the secret value is never persisted in a record.
68
+ */
69
+ SECRETS = 40
50
70
  }
51
71
  //# sourceMappingURL=hostCapabilityKind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hostCapabilityKind.d.ts","sourceRoot":"","sources":["../../../ts/PLG/hostCapabilityKind.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,KAAK,IAAI;IACT,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;IACV,MAAM,IAAI;IACV,aAAa,IAAI;IACjB,eAAe,IAAI;IACnB,aAAa,IAAI;IACjB,YAAY,IAAI;IAChB,aAAa,IAAI;IACjB,YAAY,KAAK;IACjB,IAAI,KAAK;IACT,UAAU,KAAK;IACf,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,eAAe,KAAK;IACpB,aAAa,KAAK;IAClB,WAAW,KAAK;IAChB,IAAI,KAAK;IACT,GAAG,KAAK;IACR,IAAI,KAAK;IACT,SAAS,KAAK;IACd,GAAG,KAAK;IACR,GAAG,KAAK;IACR,YAAY,KAAK;IACjB,YAAY,KAAK;IACjB,aAAa,KAAK;IAClB,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,aAAa,KAAK;IAClB,cAAc,KAAK;IACnB,cAAc,KAAK;IACnB,oBAAoB,KAAK;IACzB,UAAU,KAAK;IACf,aAAa,KAAK;IAElB;;;;;OAKG;IACH,cAAc,KAAK;CACpB"}
1
+ {"version":3,"file":"hostCapabilityKind.d.ts","sourceRoot":"","sources":["../../../ts/PLG/hostCapabilityKind.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,KAAK,IAAI;IACT,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;IACV,MAAM,IAAI;IACV,aAAa,IAAI;IACjB,eAAe,IAAI;IACnB,aAAa,IAAI;IACjB,YAAY,IAAI;IAChB,aAAa,IAAI;IACjB,YAAY,KAAK;IACjB,IAAI,KAAK;IACT,UAAU,KAAK;IACf,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,eAAe,KAAK;IACpB,aAAa,KAAK;IAClB,WAAW,KAAK;IAChB,IAAI,KAAK;IACT,GAAG,KAAK;IACR,IAAI,KAAK;IACT,SAAS,KAAK;IACd,GAAG,KAAK;IACR,GAAG,KAAK;IACR,YAAY,KAAK;IACjB,YAAY,KAAK;IACjB,aAAa,KAAK;IAClB,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,aAAa,KAAK;IAClB,cAAc,KAAK;IACnB,cAAc,KAAK;IACnB,oBAAoB,KAAK;IACzB,UAAU,KAAK;IACf,aAAa,KAAK;IAElB;;;;;OAKG;IACH,cAAc,KAAK;IAEnB;;;;OAIG;IACH,QAAQ,KAAK;IAEb;;;OAGG;IACH,gBAAgB,KAAK;IAErB;;OAEG;IACH,kBAAkB,KAAK;IAEvB;;;OAGG;IACH,OAAO,KAAK;CACb"}
@@ -50,4 +50,24 @@ export var hostCapabilityKind;
50
50
  * storage.ingest_with_source on this capability specifically.
51
51
  */
52
52
  hostCapabilityKind[hostCapabilityKind["STORAGE_INGEST"] = 36] = "STORAGE_INGEST";
53
+ /**
54
+ * Read the node's view of its peer-to-peer network: known peers, the
55
+ * publication notices it has received and verified, and the latest
56
+ * dataset of a lane (p2p.* host operations).
57
+ */
58
+ hostCapabilityKind[hostCapabilityKind["P2P_READ"] = 37] = "P2P_READ";
59
+ /**
60
+ * Read the node's own health: uptime, service state, storage and network
61
+ * figures (node_status_read.status).
62
+ */
63
+ hostCapabilityKind[hostCapabilityKind["NODE_STATUS_READ"] = 38] = "NODE_STATUS_READ";
64
+ /**
65
+ * Read the node's event log (node_activity_read.activity).
66
+ */
67
+ hostCapabilityKind[hostCapabilityKind["NODE_ACTIVITY_READ"] = 39] = "NODE_ACTIVITY_READ";
68
+ /**
69
+ * Read and write operator-held secrets by identifier (credentials for
70
+ * upstream sources); the secret value is never persisted in a record.
71
+ */
72
+ hostCapabilityKind[hostCapabilityKind["SECRETS"] = 40] = "SECRETS";
53
73
  })(hostCapabilityKind || (hostCapabilityKind = {}));
@@ -51,5 +51,29 @@ export enum hostCapabilityKind {
51
51
  * single record without source attribution. Hosts gate
52
52
  * storage.ingest_with_source on this capability specifically.
53
53
  */
54
- STORAGE_INGEST = 36
54
+ STORAGE_INGEST = 36,
55
+
56
+ /**
57
+ * Read the node's view of its peer-to-peer network: known peers, the
58
+ * publication notices it has received and verified, and the latest
59
+ * dataset of a lane (p2p.* host operations).
60
+ */
61
+ P2P_READ = 37,
62
+
63
+ /**
64
+ * Read the node's own health: uptime, service state, storage and network
65
+ * figures (node_status_read.status).
66
+ */
67
+ NODE_STATUS_READ = 38,
68
+
69
+ /**
70
+ * Read the node's event log (node_activity_read.activity).
71
+ */
72
+ NODE_ACTIVITY_READ = 39,
73
+
74
+ /**
75
+ * Read and write operator-held secrets by identifier (credentials for
76
+ * upstream sources); the secret value is never persisted in a record.
77
+ */
78
+ SECRETS = 40
55
79
  }