superbee 0.2.1-pre.1 → 0.2.1-pre.2

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.
@@ -30821,7 +30821,7 @@ var require_jsx_runtime = __commonJS({
30821
30821
  });
30822
30822
 
30823
30823
  // ../publication/src/capture.ts
30824
- import { createHash as createHash4 } from "node:crypto";
30824
+ import { createHash as createHash3 } from "node:crypto";
30825
30825
  import { lstat, readdir, realpath, stat } from "node:fs/promises";
30826
30826
  import path5 from "node:path";
30827
30827
 
@@ -32083,8 +32083,161 @@ var nodeFilesystemIdentityPort = Object.freeze({
32083
32083
  }
32084
32084
  });
32085
32085
 
32086
- // ../core/src/versioning.ts
32087
- import { createHash as createHash3 } from "node:crypto";
32086
+ // ../core/src/sha256.ts
32087
+ var K = new Uint32Array([
32088
+ 1116352408,
32089
+ 1899447441,
32090
+ 3049323471,
32091
+ 3921009573,
32092
+ 961987163,
32093
+ 1508970993,
32094
+ 2453635748,
32095
+ 2870763221,
32096
+ 3624381080,
32097
+ 310598401,
32098
+ 607225278,
32099
+ 1426881987,
32100
+ 1925078388,
32101
+ 2162078206,
32102
+ 2614888103,
32103
+ 3248222580,
32104
+ 3835390401,
32105
+ 4022224774,
32106
+ 264347078,
32107
+ 604807628,
32108
+ 770255983,
32109
+ 1249150122,
32110
+ 1555081692,
32111
+ 1996064986,
32112
+ 2554220882,
32113
+ 2821834349,
32114
+ 2952996808,
32115
+ 3210313671,
32116
+ 3336571891,
32117
+ 3584528711,
32118
+ 113926993,
32119
+ 338241895,
32120
+ 666307205,
32121
+ 773529912,
32122
+ 1294757372,
32123
+ 1396182291,
32124
+ 1695183700,
32125
+ 1986661051,
32126
+ 2177026350,
32127
+ 2456956037,
32128
+ 2730485921,
32129
+ 2820302411,
32130
+ 3259730800,
32131
+ 3345764771,
32132
+ 3516065817,
32133
+ 3600352804,
32134
+ 4094571909,
32135
+ 275423344,
32136
+ 430227734,
32137
+ 506948616,
32138
+ 659060556,
32139
+ 883997877,
32140
+ 958139571,
32141
+ 1322822218,
32142
+ 1537002063,
32143
+ 1747873779,
32144
+ 1955562222,
32145
+ 2024104815,
32146
+ 2227730452,
32147
+ 2361852424,
32148
+ 2428436474,
32149
+ 2756734187,
32150
+ 3204031479,
32151
+ 3329325298
32152
+ ]);
32153
+ var INITIAL_STATE = new Uint32Array([
32154
+ 1779033703,
32155
+ 3144134277,
32156
+ 1013904242,
32157
+ 2773480762,
32158
+ 1359893119,
32159
+ 2600822924,
32160
+ 528734635,
32161
+ 1541459225
32162
+ ]);
32163
+ var encoder = new TextEncoder();
32164
+ function rotr(value, bits) {
32165
+ return value >>> bits | value << 32 - bits;
32166
+ }
32167
+ function compress(h, w, view, offset) {
32168
+ for (let i = 0; i < 16; i++) {
32169
+ w[i] = view.getUint32(offset + i * 4);
32170
+ }
32171
+ for (let i = 16; i < 64; i++) {
32172
+ const w15 = w[i - 15];
32173
+ const w2 = w[i - 2];
32174
+ const s0 = rotr(w15, 7) ^ rotr(w15, 18) ^ w15 >>> 3;
32175
+ const s1 = rotr(w2, 17) ^ rotr(w2, 19) ^ w2 >>> 10;
32176
+ w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
32177
+ }
32178
+ let a = h[0];
32179
+ let b = h[1];
32180
+ let c = h[2];
32181
+ let d = h[3];
32182
+ let e = h[4];
32183
+ let f = h[5];
32184
+ let g = h[6];
32185
+ let hh = h[7];
32186
+ for (let i = 0; i < 64; i++) {
32187
+ const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
32188
+ const ch = e & f ^ ~e & g;
32189
+ const t1 = hh + S1 + ch + K[i] + w[i] >>> 0;
32190
+ const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
32191
+ const maj = a & b ^ a & c ^ b & c;
32192
+ const t2 = S0 + maj >>> 0;
32193
+ hh = g;
32194
+ g = f;
32195
+ f = e;
32196
+ e = d + t1 >>> 0;
32197
+ d = c;
32198
+ c = b;
32199
+ b = a;
32200
+ a = t1 + t2 >>> 0;
32201
+ }
32202
+ h[0] = h[0] + a >>> 0;
32203
+ h[1] = h[1] + b >>> 0;
32204
+ h[2] = h[2] + c >>> 0;
32205
+ h[3] = h[3] + d >>> 0;
32206
+ h[4] = h[4] + e >>> 0;
32207
+ h[5] = h[5] + f >>> 0;
32208
+ h[6] = h[6] + g >>> 0;
32209
+ h[7] = h[7] + hh >>> 0;
32210
+ }
32211
+ function sha256HexOfBytes(bytes) {
32212
+ const h = new Uint32Array(INITIAL_STATE);
32213
+ const w = new Uint32Array(64);
32214
+ const length = bytes.byteLength;
32215
+ const view = new DataView(bytes.buffer, bytes.byteOffset, length);
32216
+ const fullBlocks = length >>> 6;
32217
+ for (let block = 0; block < fullBlocks; block++) {
32218
+ compress(h, w, view, block * 64);
32219
+ }
32220
+ const remaining = length - fullBlocks * 64;
32221
+ const tail = new Uint8Array(remaining + 1 + 8 > 64 ? 128 : 64);
32222
+ tail.set(bytes.subarray(fullBlocks * 64));
32223
+ tail[remaining] = 128;
32224
+ const tailView = new DataView(tail.buffer);
32225
+ const bitLengthHigh = Math.floor(length / 536870912);
32226
+ const bitLengthLow = length << 3 >>> 0;
32227
+ tailView.setUint32(tail.length - 8, bitLengthHigh);
32228
+ tailView.setUint32(tail.length - 4, bitLengthLow);
32229
+ for (let offset = 0; offset < tail.length; offset += 64) {
32230
+ compress(h, w, tailView, offset);
32231
+ }
32232
+ let hex = "";
32233
+ for (let i = 0; i < 8; i++) {
32234
+ hex += h[i].toString(16).padStart(8, "0");
32235
+ }
32236
+ return hex;
32237
+ }
32238
+ function sha256HexOfUtf8(input) {
32239
+ return sha256HexOfBytes(encoder.encode(input));
32240
+ }
32088
32241
 
32089
32242
  // ../core/src/version-transport.ts
32090
32243
  var VersionConflict = class extends Error {
@@ -32104,16 +32257,17 @@ var VersionConflict = class extends Error {
32104
32257
 
32105
32258
  // ../core/src/versioning.ts
32106
32259
  function sha256Hex(input) {
32107
- return createHash3("sha256").update(input, "utf8").digest("hex");
32260
+ return sha256HexOfUtf8(input);
32108
32261
  }
32109
32262
  function versionOfBytes(raw) {
32110
32263
  return `sha256:${sha256Hex(raw)}`;
32111
32264
  }
32112
32265
  function blobVersion(bytes) {
32113
- return `sha256:${createHash3("sha256").update(bytes).digest("hex")}`;
32266
+ return `sha256:${sha256HexOfBytes(bytes)}`;
32114
32267
  }
32115
32268
  function defaultActor() {
32116
- return process.env.USER?.trim() || process.env.USERNAME?.trim() || process.env.LOGNAME?.trim() || "local";
32269
+ const env = typeof process !== "undefined" ? process.env : void 0;
32270
+ return env?.USER?.trim() || env?.USERNAME?.trim() || env?.LOGNAME?.trim() || "local";
32117
32271
  }
32118
32272
 
32119
32273
  // ../core/src/backend.ts
@@ -32390,9 +32544,19 @@ async function listFilesystemReservedObjects(backend) {
32390
32544
  }).sort((a, b) => reservedPath(a.dir, a.name).localeCompare(reservedPath(b.dir, b.name)));
32391
32545
  }
32392
32546
 
32393
- // ../core/src/bundle.ts
32547
+ // ../core/src/bundle-ops.ts
32548
+ var defaultBackendFactory;
32549
+ function setDefaultBackendFactory(factory) {
32550
+ defaultBackendFactory = factory;
32551
+ }
32394
32552
  function backendFor(bundle) {
32395
- return bundle.backend ?? new FilesystemBackend(bundle.root);
32553
+ if (bundle.backend) return bundle.backend;
32554
+ if (defaultBackendFactory === void 0) {
32555
+ throw new InvalidInputError(
32556
+ `Bundle '${bundle.root}' has no backend and this runtime installs no default: pass bundle.backend explicitly or register one with setDefaultBackendFactory.`
32557
+ );
32558
+ }
32559
+ return defaultBackendFactory(bundle.root);
32396
32560
  }
32397
32561
  async function readBundleOkfVersion2(bundle) {
32398
32562
  return readBundleOkfVersion(backendFor(bundle));
@@ -32410,6 +32574,9 @@ async function queryEdges2(bundle, filter = {}) {
32410
32574
  return queryEdges(backendFor(bundle), filter);
32411
32575
  }
32412
32576
 
32577
+ // ../core/src/bundle.ts
32578
+ setDefaultBackendFactory((root) => new FilesystemBackend(root));
32579
+
32413
32580
  // ../core/src/kinds.ts
32414
32581
  var CONVENTIONS_PREFIX = "conventions/";
32415
32582
  var CONVENTION_TYPE = "Convention";
@@ -35282,8 +35449,8 @@ function decodeNamedCharacterReference(value) {
35282
35449
  }
35283
35450
 
35284
35451
  // ../../node_modules/micromark-util-chunked/index.js
35285
- function splice(list2, start, remove, items) {
35286
- const end = list2.length;
35452
+ function splice(list3, start, remove, items) {
35453
+ const end = list3.length;
35287
35454
  let chunkStart = 0;
35288
35455
  let parameters;
35289
35456
  if (start < 0) {
@@ -35295,22 +35462,22 @@ function splice(list2, start, remove, items) {
35295
35462
  if (items.length < 1e4) {
35296
35463
  parameters = Array.from(items);
35297
35464
  parameters.unshift(start, remove);
35298
- list2.splice(...parameters);
35465
+ list3.splice(...parameters);
35299
35466
  } else {
35300
- if (remove) list2.splice(start, remove);
35467
+ if (remove) list3.splice(start, remove);
35301
35468
  while (chunkStart < items.length) {
35302
35469
  parameters = items.slice(chunkStart, chunkStart + 1e4);
35303
35470
  parameters.unshift(start, 0);
35304
- list2.splice(...parameters);
35471
+ list3.splice(...parameters);
35305
35472
  chunkStart += 1e4;
35306
35473
  start += 1e4;
35307
35474
  }
35308
35475
  }
35309
35476
  }
35310
- function push(list2, items) {
35311
- if (list2.length > 0) {
35312
- splice(list2, list2.length, 0, items);
35313
- return list2;
35477
+ function push(list3, items) {
35478
+ if (list3.length > 0) {
35479
+ splice(list3, list3.length, 0, items);
35480
+ return list3;
35314
35481
  }
35315
35482
  return items;
35316
35483
  }
@@ -35345,12 +35512,12 @@ function syntaxExtension(all2, extension2) {
35345
35512
  }
35346
35513
  }
35347
35514
  }
35348
- function constructs(existing, list2) {
35515
+ function constructs(existing, list3) {
35349
35516
  let index2 = -1;
35350
35517
  const before = [];
35351
- while (++index2 < list2.length) {
35518
+ while (++index2 < list3.length) {
35352
35519
  ;
35353
- (list2[index2].add === "after" ? existing : before).push(list2[index2]);
35520
+ (list3[index2].add === "after" ? existing : before).push(list3[index2]);
35354
35521
  }
35355
35522
  splice(existing, 0, 0, before);
35356
35523
  }
@@ -36627,13 +36794,13 @@ var SpliceBuffer = class {
36627
36794
  }
36628
36795
  }
36629
36796
  };
36630
- function chunkedPush(list2, right) {
36797
+ function chunkedPush(list3, right) {
36631
36798
  let chunkStart = 0;
36632
36799
  if (right.length < 1e4) {
36633
- list2.push(...right);
36800
+ list3.push(...right);
36634
36801
  } else {
36635
36802
  while (chunkStart < right.length) {
36636
- list2.push(...right.slice(chunkStart, chunkStart + 1e4));
36803
+ list3.push(...right.slice(chunkStart, chunkStart + 1e4));
36637
36804
  chunkStart += 1e4;
36638
36805
  }
36639
36806
  }
@@ -38381,7 +38548,7 @@ function tokenizeThematicBreak(effects, ok4, nok) {
38381
38548
  }
38382
38549
 
38383
38550
  // ../../node_modules/micromark-core-commonmark/lib/list.js
38384
- var list = {
38551
+ var list2 = {
38385
38552
  continuation: {
38386
38553
  tokenize: tokenizeListContinuation
38387
38554
  },
@@ -38487,7 +38654,7 @@ function tokenizeListContinuation(effects, ok4, nok) {
38487
38654
  function notInCurrentItem(code2) {
38488
38655
  self.containerState._closeFlow = true;
38489
38656
  self.interrupt = void 0;
38490
- return factorySpace(effects, effects.attempt(list, ok4, nok), "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
38657
+ return factorySpace(effects, effects.attempt(list2, ok4, nok), "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code2);
38491
38658
  }
38492
38659
  }
38493
38660
  function tokenizeIndent(effects, ok4, nok) {
@@ -38680,11 +38847,11 @@ function initializeFactory(field) {
38680
38847
  if (code2 === null) {
38681
38848
  return true;
38682
38849
  }
38683
- const list2 = constructs2[code2];
38850
+ const list3 = constructs2[code2];
38684
38851
  let index2 = -1;
38685
- if (list2) {
38686
- while (++index2 < list2.length) {
38687
- const item = list2[index2];
38852
+ if (list3) {
38853
+ while (++index2 < list3.length) {
38854
+ const item = list3[index2];
38688
38855
  if (!item.previous || item.previous.call(self, self.previous)) {
38689
38856
  return true;
38690
38857
  }
@@ -38793,19 +38960,19 @@ __export(constructs_exports, {
38793
38960
  text: () => text2
38794
38961
  });
38795
38962
  var document2 = {
38796
- [42]: list,
38797
- [43]: list,
38798
- [45]: list,
38799
- [48]: list,
38800
- [49]: list,
38801
- [50]: list,
38802
- [51]: list,
38803
- [52]: list,
38804
- [53]: list,
38805
- [54]: list,
38806
- [55]: list,
38807
- [56]: list,
38808
- [57]: list,
38963
+ [42]: list2,
38964
+ [43]: list2,
38965
+ [45]: list2,
38966
+ [48]: list2,
38967
+ [49]: list2,
38968
+ [50]: list2,
38969
+ [51]: list2,
38970
+ [52]: list2,
38971
+ [53]: list2,
38972
+ [54]: list2,
38973
+ [55]: list2,
38974
+ [56]: list2,
38975
+ [57]: list2,
38809
38976
  [62]: blockQuote
38810
38977
  };
38811
38978
  var contentInitial = {
@@ -39021,22 +39188,22 @@ function createTokenizer(parser, initialize, from) {
39021
39188
  function start(code2) {
39022
39189
  const left = code2 !== null && map[code2];
39023
39190
  const all2 = code2 !== null && map.null;
39024
- const list2 = [
39191
+ const list3 = [
39025
39192
  // To do: add more extension tests.
39026
39193
  /* c8 ignore next 2 */
39027
39194
  ...Array.isArray(left) ? left : left ? [left] : [],
39028
39195
  ...Array.isArray(all2) ? all2 : all2 ? [all2] : []
39029
39196
  ];
39030
- return handleListOfConstructs(list2)(code2);
39197
+ return handleListOfConstructs(list3)(code2);
39031
39198
  }
39032
39199
  }
39033
- function handleListOfConstructs(list2) {
39034
- listOfConstructs = list2;
39200
+ function handleListOfConstructs(list3) {
39201
+ listOfConstructs = list3;
39035
39202
  constructIndex = 0;
39036
- if (list2.length === 0) {
39203
+ if (list3.length === 0) {
39037
39204
  return bogusState;
39038
39205
  }
39039
- return handleConstruct(list2[constructIndex]);
39206
+ return handleConstruct(list3[constructIndex]);
39040
39207
  }
39041
39208
  function handleConstruct(construct) {
39042
39209
  return start;
@@ -39378,8 +39545,8 @@ function compiler(options) {
39378
39545
  link: opener(link),
39379
39546
  listItem: opener(listItem),
39380
39547
  listItemValue: onenterlistitemvalue,
39381
- listOrdered: opener(list2, onenterlistordered),
39382
- listUnordered: opener(list2),
39548
+ listOrdered: opener(list3, onenterlistordered),
39549
+ listUnordered: opener(list3),
39383
39550
  paragraph: opener(paragraph),
39384
39551
  reference: onenterreference,
39385
39552
  referenceString: buffer,
@@ -39935,7 +40102,7 @@ function compiler(options) {
39935
40102
  children: []
39936
40103
  };
39937
40104
  }
39938
- function list2(token) {
40105
+ function list3(token) {
39939
40106
  return {
39940
40107
  type: "list",
39941
40108
  ordered: token.type === "listOrdered",
@@ -41539,10 +41706,10 @@ function toResult(value) {
41539
41706
  }
41540
41707
 
41541
41708
  // ../../node_modules/mdast-util-find-and-replace/lib/index.js
41542
- function findAndReplace(tree, list2, options) {
41709
+ function findAndReplace(tree, list3, options) {
41543
41710
  const settings = options || {};
41544
41711
  const ignored = convert(settings.ignore || []);
41545
- const pairs = toPairs(list2);
41712
+ const pairs = toPairs(list3);
41546
41713
  let pairIndex = -1;
41547
41714
  while (++pairIndex < pairs.length) {
41548
41715
  visitParents(tree, "text", visitor);
@@ -41626,10 +41793,10 @@ function toPairs(tupleOrList) {
41626
41793
  if (!Array.isArray(tupleOrList)) {
41627
41794
  throw new TypeError("Expected find and replace tuple or list of tuples");
41628
41795
  }
41629
- const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
41796
+ const list3 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
41630
41797
  let index2 = -1;
41631
- while (++index2 < list2.length) {
41632
- const tuple = list2[index2];
41798
+ while (++index2 < list3.length) {
41799
+ const tuple = list3[index2];
41633
41800
  result.push([toExpression(tuple[0]), toFunction(tuple[1])]);
41634
41801
  }
41635
41802
  return result;
@@ -42825,7 +42992,7 @@ async function validatePublicationTree(root, relative = "") {
42825
42992
  }
42826
42993
  }
42827
42994
  function sha256(bytes) {
42828
- return `sha256:${createHash4("sha256").update(bytes).digest("hex")}`;
42995
+ return `sha256:${createHash3("sha256").update(bytes).digest("hex")}`;
42829
42996
  }
42830
42997
  function utf8(value) {
42831
42998
  return new TextEncoder().encode(value);
@@ -43195,7 +43362,7 @@ async function capturePublicationSnapshot(options) {
43195
43362
  }
43196
43363
 
43197
43364
  // ../publication/src/bridge.ts
43198
- import { createHash as createHash5 } from "node:crypto";
43365
+ import { createHash as createHash4 } from "node:crypto";
43199
43366
 
43200
43367
  // ../publication/src/snapshot-backend.ts
43201
43368
  function absent(id) {
@@ -43297,7 +43464,7 @@ var PublicationSnapshotBackend = class {
43297
43464
  // ../publication/src/bridge.ts
43298
43465
  var STATIC_LAUNCH_ID = "publication-snapshot";
43299
43466
  function digest(bytes) {
43300
- return `sha256:${createHash5("sha256").update(bytes).digest("hex")}`;
43467
+ return `sha256:${createHash4("sha256").update(bytes).digest("hex")}`;
43301
43468
  }
43302
43469
  function createPublicationBridge(options) {
43303
43470
  if (options.protocol !== PUBLICATION_BRIDGE_V0) {