@tracecode/harness 0.16.1 → 0.16.3

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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{browser-runtime-provider-NQNCL6HE.js → browser-runtime-provider-C53ZJH3D.js} +4 -4
  3. package/dist/{chunk-MMQLUTPP.js → chunk-53ROKKGU.js} +2 -2
  4. package/dist/{chunk-KYTMGAFA.js → chunk-6SWX35P2.js} +2 -2
  5. package/dist/{chunk-4W6MUXZE.js → chunk-BXUGUGWL.js} +9 -9
  6. package/dist/{chunk-AWHLLSEH.js → chunk-DI7WIHES.js} +3 -3
  7. package/dist/chunk-EJE2EJDI.js +193 -0
  8. package/dist/{chunk-DQMPICNS.js → chunk-TXDHVV6B.js} +193 -345
  9. package/dist/{chunk-57WKRSIB.js → chunk-YID2AAYD.js} +2 -2
  10. package/dist/cli.cjs +5 -0
  11. package/dist/cli.js +5 -0
  12. package/dist/core.cjs +8 -8
  13. package/dist/core.d.cts +2 -2
  14. package/dist/core.d.ts +2 -2
  15. package/dist/core.js +1 -1
  16. package/dist/{cpp-worker-client-A2ULEW5T.js → cpp-worker-client-FLJ2YLSW.js} +3 -3
  17. package/dist/{csharp-worker-client-RA47P77F.js → csharp-worker-client-S4U6MCVF.js} +3 -3
  18. package/dist/internal/tracekernel-workspace.cjs +171 -31
  19. package/dist/internal/tracekernel-workspace.d.cts +8 -2
  20. package/dist/internal/tracekernel-workspace.d.ts +8 -2
  21. package/dist/internal/tracekernel-workspace.js +164 -24
  22. package/dist/{java-project-BTAANBJH.js → java-project-GK6MHT3I.js} +2 -2
  23. package/dist/{java-project-client-R7CKC72F.js → java-project-client-PEQKFTH6.js} +11 -2
  24. package/dist/judge.cjs +420 -214
  25. package/dist/judge.d.cts +1 -1
  26. package/dist/judge.d.ts +1 -1
  27. package/dist/judge.js +9 -7
  28. package/dist/{project-browser-GBSPIYEW.js → project-browser-3I5FVB5N.js} +2 -2
  29. package/dist/{project-browser-U3YK43H4.js → project-browser-ADXGG5RZ.js} +2 -2
  30. package/dist/{project-browser-J6LVPVDC.js → project-browser-B5T7WJWP.js} +2 -2
  31. package/dist/{project-browser-QMZCUVJA.js → project-browser-JXJ74RDZ.js} +2 -2
  32. package/dist/{project-browser-PC7TRROQ.js → project-browser-TDL4LMJJ.js} +2 -2
  33. package/dist/{python-worker-client-NEBS6V63.js → python-worker-client-2RF6IYIN.js} +3 -3
  34. package/dist/{runtime-environment-D7mZm8SA.d.cts → runtime-environment-BO5I1fAC.d.cts} +5 -0
  35. package/dist/{runtime-environment-Q60S0pUa.d.ts → runtime-environment-Dfg6ZoCj.d.ts} +5 -0
  36. package/dist/{runtime-open-source-info-BQtIRJ9F.d.cts → runtime-open-source-info-CaBpNicy.d.cts} +4 -2
  37. package/dist/{runtime-open-source-info-FkIxlAcm.d.ts → runtime-open-source-info-D0OJc4zH.d.ts} +4 -2
  38. package/dist/tracecc-runtime-assets-G3BFH7LY.js +19 -0
  39. package/dist/tracekernel.cjs +585 -235
  40. package/dist/tracekernel.d.cts +14 -5
  41. package/dist/tracekernel.d.ts +14 -5
  42. package/dist/tracekernel.js +175 -31
  43. package/package.json +44 -32
  44. package/runtime-assets.lock.json +7 -7
  45. package/workers/javascript/javascript-project-worker.js +7 -7
@@ -1,7 +1,7 @@
1
1
  var define = undefined;
2
2
  import {
3
3
  normalizeRuntimeProjectPath
4
- } from "./chunk-4W6MUXZE.js";
4
+ } from "./chunk-BXUGUGWL.js";
5
5
  import {
6
6
  _await,
7
7
  bounded,
@@ -143,11 +143,11 @@ var TraceKernelFileSystemError = class extends TaggedError(
143
143
  ) {
144
144
  };
145
145
  var openDescriptionStatuses = /* @__PURE__ */ new WeakMap();
146
- function statusFor(descriptor2) {
147
- let status = openDescriptionStatuses.get(descriptor2);
146
+ function statusFor(descriptor) {
147
+ let status = openDescriptionStatuses.get(descriptor);
148
148
  if (!status) {
149
149
  status = { nonblocking: false };
150
- openDescriptionStatuses.set(descriptor2, status);
150
+ openDescriptionStatuses.set(descriptor, status);
151
151
  }
152
152
  return status;
153
153
  }
@@ -166,7 +166,7 @@ var TraceKernelDescriptorTable = class {
166
166
  this.maxDescriptors = Number.isFinite(requested) && requested > 0 ? Math.floor(requested) : 1024;
167
167
  this.operationContext = options.operationContext;
168
168
  }
169
- install(descriptor2, options = {}) {
169
+ install(descriptor, options = {}) {
170
170
  if (this.descriptors.size >= this.maxDescriptors) {
171
171
  throw new TraceKernelDescriptorLimitError({
172
172
  code: "EMFILE",
@@ -176,8 +176,8 @@ var TraceKernelDescriptorTable = class {
176
176
  }
177
177
  let fd = this.nextFd;
178
178
  while (this.descriptors.has(fd)) fd += 1;
179
- this.descriptors.set(fd, descriptor2);
180
- if (options.nonblocking) statusFor(descriptor2).nonblocking = true;
179
+ this.descriptors.set(fd, descriptor);
180
+ if (options.nonblocking) statusFor(descriptor).nonblocking = true;
181
181
  if (options.closeOnExec) this.closeOnExecDescriptors.add(fd);
182
182
  this.nextFd = fd + 1;
183
183
  return fd;
@@ -189,7 +189,7 @@ var TraceKernelDescriptorTable = class {
189
189
  * to establish fd 0/1/2 before a runtime lease starts, while ordinary
190
190
  * runtime opens continue to allocate from fd 3 upward.
191
191
  */
192
- installAt(fd, descriptor2, options = {}) {
192
+ installAt(fd, descriptor, options = {}) {
193
193
  const targetFd = Math.floor(fd);
194
194
  if (!Number.isSafeInteger(fd) || targetFd < 0) {
195
195
  throw new TraceKernelBadFileDescriptorError({
@@ -212,8 +212,8 @@ var TraceKernelDescriptorTable = class {
212
212
  message: `EMFILE: target descriptor ${targetFd} is already occupied`
213
213
  });
214
214
  }
215
- this.descriptors.set(targetFd, descriptor2);
216
- if (options.nonblocking) statusFor(descriptor2).nonblocking = true;
215
+ this.descriptors.set(targetFd, descriptor);
216
+ if (options.nonblocking) statusFor(descriptor).nonblocking = true;
217
217
  if (options.closeOnExec) this.closeOnExecDescriptors.add(targetFd);
218
218
  if (targetFd === this.nextFd) this.resetNextFd();
219
219
  return targetFd;
@@ -233,7 +233,7 @@ var TraceKernelDescriptorTable = class {
233
233
  if (!Number.isSafeInteger(replacement.fd) || fd < 0 || targets.has(fd)) {
234
234
  yield* forEach(
235
235
  replacements,
236
- ({ descriptor: descriptor2 }) => descriptor2.close(),
236
+ ({ descriptor }) => descriptor.close(),
237
237
  { concurrency: "unbounded", discard: true }
238
238
  );
239
239
  return yield* fail2(new TraceKernelBadFileDescriptorError({
@@ -251,7 +251,7 @@ var TraceKernelDescriptorTable = class {
251
251
  if (resultingSize > this.maxDescriptors) {
252
252
  yield* forEach(
253
253
  replacements,
254
- ({ descriptor: descriptor2 }) => descriptor2.close(),
254
+ ({ descriptor }) => descriptor.close(),
255
255
  { concurrency: "unbounded", discard: true }
256
256
  );
257
257
  return yield* fail2(new TraceKernelDescriptorLimitError({
@@ -261,8 +261,8 @@ var TraceKernelDescriptorTable = class {
261
261
  }));
262
262
  }
263
263
  const replaced = replacements.flatMap(({ fd }) => {
264
- const descriptor2 = this.descriptors.get(fd);
265
- return descriptor2 ? [descriptor2] : [];
264
+ const descriptor = this.descriptors.get(fd);
265
+ return descriptor ? [descriptor] : [];
266
266
  });
267
267
  for (const replacement of replacements) {
268
268
  this.descriptors.set(replacement.fd, replacement.descriptor);
@@ -276,23 +276,23 @@ var TraceKernelDescriptorTable = class {
276
276
  this.resetNextFd();
277
277
  yield* forEach(
278
278
  replaced,
279
- (descriptor2) => descriptor2.close(),
279
+ (descriptor) => descriptor.close(),
280
280
  { concurrency: "unbounded", discard: true }
281
281
  );
282
282
  });
283
283
  }
284
284
  snapshots() {
285
- return [...this.descriptors.entries()].map(([fd, descriptor2]) => Object.freeze({
285
+ return [...this.descriptors.entries()].map(([fd, descriptor]) => Object.freeze({
286
286
  fd,
287
- kind: descriptor2.kind,
288
- resourceId: descriptor2.resourceId,
287
+ kind: descriptor.kind,
288
+ resourceId: descriptor.resourceId,
289
289
  closeOnExec: this.closeOnExecDescriptors.has(fd),
290
- nonblocking: statusFor(descriptor2).nonblocking
290
+ nonblocking: statusFor(descriptor).nonblocking
291
291
  })).sort((left, right) => left.fd - right.fd);
292
292
  }
293
293
  lookup(fd) {
294
- const descriptor2 = this.descriptors.get(fd);
295
- return descriptor2 ? succeed2(descriptor2) : fail2(new TraceKernelBadFileDescriptorError({
294
+ const descriptor = this.descriptors.get(fd);
295
+ return descriptor ? succeed2(descriptor) : fail2(new TraceKernelBadFileDescriptorError({
296
296
  fd,
297
297
  operation: "stat",
298
298
  message: `EBADF: bad file descriptor ${fd}`
@@ -318,36 +318,36 @@ var TraceKernelDescriptorTable = class {
318
318
  return _void;
319
319
  }
320
320
  getNonblocking(fd) {
321
- const descriptor2 = this.descriptors.get(fd);
322
- return descriptor2 ? succeed2(statusFor(descriptor2).nonblocking) : fail2(new TraceKernelBadFileDescriptorError({
321
+ const descriptor = this.descriptors.get(fd);
322
+ return descriptor ? succeed2(statusFor(descriptor).nonblocking) : fail2(new TraceKernelBadFileDescriptorError({
323
323
  fd,
324
324
  operation: "fcntl",
325
325
  message: `EBADF: bad file descriptor, fcntl ${fd}`
326
326
  }));
327
327
  }
328
328
  setNonblocking(fd, nonblocking) {
329
- const descriptor2 = this.descriptors.get(fd);
330
- if (!descriptor2) {
329
+ const descriptor = this.descriptors.get(fd);
330
+ if (!descriptor) {
331
331
  return fail2(new TraceKernelBadFileDescriptorError({
332
332
  fd,
333
333
  operation: "fcntl",
334
334
  message: `EBADF: bad file descriptor, fcntl ${fd}`
335
335
  }));
336
336
  }
337
- statusFor(descriptor2).nonblocking = nonblocking;
337
+ statusFor(descriptor).nonblocking = nonblocking;
338
338
  return _void;
339
339
  }
340
340
  readiness(fd, events) {
341
- const descriptor2 = this.descriptors.get(fd);
342
- if (!descriptor2) {
341
+ const descriptor = this.descriptors.get(fd);
342
+ if (!descriptor) {
343
343
  return fail2(new TraceKernelBadFileDescriptorError({
344
344
  fd,
345
345
  operation: "poll",
346
346
  message: `EBADF: bad file descriptor, poll ${fd}`
347
347
  }));
348
348
  }
349
- if (descriptor2.readiness) {
350
- return descriptor2.readiness(events, this.operationContext?.()).pipe(
349
+ if (descriptor.readiness) {
350
+ return descriptor.readiness(events, this.operationContext?.()).pipe(
351
351
  mapError((error) => new TraceKernelBadFileDescriptorError({
352
352
  fd,
353
353
  operation: "poll",
@@ -356,23 +356,23 @@ var TraceKernelDescriptorTable = class {
356
356
  );
357
357
  }
358
358
  return succeed2(Object.freeze({
359
- read: events.read && descriptor2.kind === "file" && Boolean(descriptor2.read),
360
- write: events.write && descriptor2.kind === "file" && Boolean(descriptor2.write),
359
+ read: events.read && descriptor.kind === "file" && Boolean(descriptor.read),
360
+ write: events.write && descriptor.kind === "file" && Boolean(descriptor.write),
361
361
  hangup: false,
362
362
  error: false
363
363
  }));
364
364
  }
365
365
  awaitReadiness(fd, events) {
366
- const descriptor2 = this.descriptors.get(fd);
367
- if (!descriptor2) {
366
+ const descriptor = this.descriptors.get(fd);
367
+ if (!descriptor) {
368
368
  return fail2(new TraceKernelBadFileDescriptorError({
369
369
  fd,
370
370
  operation: "poll",
371
371
  message: `EBADF: bad file descriptor, poll ${fd}`
372
372
  }));
373
373
  }
374
- if (descriptor2.awaitReadiness) {
375
- return descriptor2.awaitReadiness(events, this.operationContext?.()).pipe(
374
+ if (descriptor.awaitReadiness) {
375
+ return descriptor.awaitReadiness(events, this.operationContext?.()).pipe(
376
376
  mapError((error) => new TraceKernelBadFileDescriptorError({
377
377
  fd,
378
378
  operation: "poll",
@@ -380,26 +380,26 @@ var TraceKernelDescriptorTable = class {
380
380
  }))
381
381
  );
382
382
  }
383
- if (descriptor2.kind === "file") return this.readiness(fd, events);
383
+ if (descriptor.kind === "file") return this.readiness(fd, events);
384
384
  return never;
385
385
  }
386
386
  read(fd, maxBytes, position) {
387
- const descriptor2 = this.descriptors.get(fd);
388
- if (!descriptor2) {
387
+ const descriptor = this.descriptors.get(fd);
388
+ if (!descriptor) {
389
389
  return fail2(new TraceKernelBadFileDescriptorError({
390
390
  fd,
391
391
  operation: "read",
392
392
  message: `EBADF: bad file descriptor, read ${fd}`
393
393
  }));
394
394
  }
395
- if (!descriptor2.read) {
395
+ if (!descriptor.read) {
396
396
  return fail2(new TraceKernelInvalidDescriptorOperationError({
397
397
  fd,
398
398
  operation: "read",
399
399
  message: `EBADF: descriptor ${fd} is not readable`
400
400
  }));
401
401
  }
402
- const read = statusFor(descriptor2).nonblocking && descriptor2.readNonblocking ? descriptor2.readNonblocking : descriptor2.read;
402
+ const read = statusFor(descriptor).nonblocking && descriptor.readNonblocking ? descriptor.readNonblocking : descriptor.read;
403
403
  return read(
404
404
  Math.max(0, Math.floor(maxBytes)),
405
405
  position === void 0 ? void 0 : Math.max(0, Math.floor(position)),
@@ -413,22 +413,22 @@ var TraceKernelDescriptorTable = class {
413
413
  );
414
414
  }
415
415
  write(fd, bytes, position) {
416
- const descriptor2 = this.descriptors.get(fd);
417
- if (!descriptor2) {
416
+ const descriptor = this.descriptors.get(fd);
417
+ if (!descriptor) {
418
418
  return fail2(new TraceKernelBadFileDescriptorError({
419
419
  fd,
420
420
  operation: "write",
421
421
  message: `EBADF: bad file descriptor, write ${fd}`
422
422
  }));
423
423
  }
424
- if (!descriptor2.write) {
424
+ if (!descriptor.write) {
425
425
  return fail2(new TraceKernelInvalidDescriptorOperationError({
426
426
  fd,
427
427
  operation: "write",
428
428
  message: `EBADF: descriptor ${fd} is not writable`
429
429
  }));
430
430
  }
431
- const write = statusFor(descriptor2).nonblocking && descriptor2.writeNonblocking ? descriptor2.writeNonblocking : descriptor2.write;
431
+ const write = statusFor(descriptor).nonblocking && descriptor.writeNonblocking ? descriptor.writeNonblocking : descriptor.write;
432
432
  return write(
433
433
  Uint8Array.from(bytes),
434
434
  position === void 0 ? void 0 : Math.max(0, Math.floor(position)),
@@ -442,8 +442,8 @@ var TraceKernelDescriptorTable = class {
442
442
  );
443
443
  }
444
444
  seek(fd, offset, whence) {
445
- const descriptor2 = this.descriptors.get(fd);
446
- if (!descriptor2?.seek) {
445
+ const descriptor = this.descriptors.get(fd);
446
+ if (!descriptor?.seek) {
447
447
  return fail2(new TraceKernelBadFileDescriptorError({
448
448
  fd,
449
449
  operation: "seek",
@@ -457,7 +457,7 @@ var TraceKernelDescriptorTable = class {
457
457
  message: `EINVAL: invalid seek offset ${offset}`
458
458
  }));
459
459
  }
460
- return descriptor2.seek(offset, whence).pipe(
460
+ return descriptor.seek(offset, whence).pipe(
461
461
  mapError((error) => error instanceof TraceKernelInvalidArgumentError ? error : new TraceKernelBadFileDescriptorError({
462
462
  fd,
463
463
  operation: "seek",
@@ -466,15 +466,15 @@ var TraceKernelDescriptorTable = class {
466
466
  );
467
467
  }
468
468
  stat(fd) {
469
- const descriptor2 = this.descriptors.get(fd);
470
- if (!descriptor2?.stat) {
469
+ const descriptor = this.descriptors.get(fd);
470
+ if (!descriptor?.stat) {
471
471
  return fail2(new TraceKernelBadFileDescriptorError({
472
472
  fd,
473
473
  operation: "stat",
474
474
  message: `EBADF: descriptor ${fd} does not support fstat`
475
475
  }));
476
476
  }
477
- return descriptor2.stat().pipe(
477
+ return descriptor.stat().pipe(
478
478
  mapError((error) => new TraceKernelBadFileDescriptorError({
479
479
  fd,
480
480
  operation: "stat",
@@ -483,15 +483,15 @@ var TraceKernelDescriptorTable = class {
483
483
  );
484
484
  }
485
485
  truncate(fd, length) {
486
- const descriptor2 = this.descriptors.get(fd);
487
- if (!descriptor2?.truncate) {
486
+ const descriptor = this.descriptors.get(fd);
487
+ if (!descriptor?.truncate) {
488
488
  return fail2(new TraceKernelBadFileDescriptorError({
489
489
  fd,
490
490
  operation: "truncate",
491
491
  message: `EBADF: descriptor ${fd} does not support ftruncate`
492
492
  }));
493
493
  }
494
- return descriptor2.truncate(
494
+ return descriptor.truncate(
495
495
  Math.max(0, Math.floor(length)),
496
496
  this.operationContext?.()
497
497
  ).pipe(
@@ -503,16 +503,16 @@ var TraceKernelDescriptorTable = class {
503
503
  );
504
504
  }
505
505
  dup(fd) {
506
- const descriptor2 = this.descriptors.get(fd);
507
- if (!descriptor2) {
506
+ const descriptor = this.descriptors.get(fd);
507
+ if (!descriptor) {
508
508
  return fail2(new TraceKernelBadFileDescriptorError({
509
509
  fd,
510
510
  operation: "dup",
511
511
  message: `EBADF: bad file descriptor, dup ${fd}`
512
512
  }));
513
513
  }
514
- return descriptor2.duplicate().pipe(
515
- map((duplicate) => shareStatus(descriptor2, duplicate)),
514
+ return descriptor.duplicate().pipe(
515
+ map((duplicate) => shareStatus(descriptor, duplicate)),
516
516
  mapError((error) => new TraceKernelBadFileDescriptorError({
517
517
  fd,
518
518
  operation: "dup",
@@ -528,8 +528,8 @@ var TraceKernelDescriptorTable = class {
528
528
  return this.duplicateTo(fd, targetFd, closeOnExec, false);
529
529
  }
530
530
  duplicateTo(fd, targetFd, closeOnExec, allowSameDescriptor) {
531
- const descriptor2 = this.descriptors.get(fd);
532
- if (!descriptor2) {
531
+ const descriptor = this.descriptors.get(fd);
532
+ if (!descriptor) {
533
533
  return fail2(new TraceKernelBadFileDescriptorError({
534
534
  fd,
535
535
  operation: allowSameDescriptor ? "dup2" : "dup3",
@@ -559,8 +559,8 @@ var TraceKernelDescriptorTable = class {
559
559
  message: `EMFILE: process descriptor limit ${this.maxDescriptors} reached`
560
560
  }));
561
561
  }
562
- return descriptor2.duplicate().pipe(
563
- map((duplicate) => shareStatus(descriptor2, duplicate)),
562
+ return descriptor.duplicate().pipe(
563
+ map((duplicate) => shareStatus(descriptor, duplicate)),
564
564
  mapError((error) => new TraceKernelBadFileDescriptorError({
565
565
  fd,
566
566
  operation: allowSameDescriptor ? "dup2" : "dup3",
@@ -592,15 +592,15 @@ var TraceKernelDescriptorTable = class {
592
592
  try: () => {
593
593
  const selectedFds = fds === void 0 ? [...source.descriptors.keys()].filter((fd) => !source.closeOnExecDescriptors.has(fd)).sort((left, right) => left - right) : [...new Set(fds.map((fd) => Math.floor(fd)))].sort((left, right) => left - right);
594
594
  return selectedFds.map((fd) => {
595
- const descriptor2 = source.descriptors.get(fd);
596
- if (!descriptor2) {
595
+ const descriptor = source.descriptors.get(fd);
596
+ if (!descriptor) {
597
597
  throw new TraceKernelBadFileDescriptorError({
598
598
  fd,
599
599
  operation: "inherit",
600
600
  message: `EBADF: bad file descriptor, inherit ${fd}`
601
601
  });
602
602
  }
603
- return [fd, descriptor2];
603
+ return [fd, descriptor];
604
604
  });
605
605
  },
606
606
  catch: (error) => this.inheritanceError(error)
@@ -630,15 +630,15 @@ var TraceKernelDescriptorTable = class {
630
630
  });
631
631
  }
632
632
  targets.add(targetNumber);
633
- const descriptor2 = source.descriptors.get(sourceNumber);
634
- if (!descriptor2) {
633
+ const descriptor = source.descriptors.get(sourceNumber);
634
+ if (!descriptor) {
635
635
  throw new TraceKernelBadFileDescriptorError({
636
636
  fd: sourceNumber,
637
637
  operation: "inherit",
638
638
  message: `EBADF: bad parent descriptor, inherit ${sourceNumber}`
639
639
  });
640
640
  }
641
- return [targetNumber, descriptor2];
641
+ return [targetNumber, descriptor];
642
642
  });
643
643
  },
644
644
  catch: (error) => this.inheritanceError(error)
@@ -667,8 +667,8 @@ var TraceKernelDescriptorTable = class {
667
667
  const duplicates = [];
668
668
  yield* forEach(
669
669
  selected,
670
- ([fd, descriptor2]) => descriptor2.duplicate().pipe(
671
- map((duplicate) => shareStatus(descriptor2, duplicate)),
670
+ ([fd, descriptor]) => descriptor.duplicate().pipe(
671
+ map((duplicate) => shareStatus(descriptor, duplicate)),
672
672
  tap((duplicate) => sync(() => {
673
673
  duplicates.push([fd, duplicate]);
674
674
  })),
@@ -702,8 +702,8 @@ var TraceKernelDescriptorTable = class {
702
702
  });
703
703
  }
704
704
  close(fd) {
705
- const descriptor2 = this.descriptors.get(fd);
706
- if (!descriptor2) {
705
+ const descriptor = this.descriptors.get(fd);
706
+ if (!descriptor) {
707
707
  return fail2(new TraceKernelBadFileDescriptorError({
708
708
  fd,
709
709
  operation: "close",
@@ -713,7 +713,7 @@ var TraceKernelDescriptorTable = class {
713
713
  this.descriptors.delete(fd);
714
714
  this.closeOnExecDescriptors.delete(fd);
715
715
  if (fd < this.nextFd) this.nextFd = fd;
716
- return descriptor2.close();
716
+ return descriptor.close();
717
717
  }
718
718
  closeAll() {
719
719
  return suspend(() => {
@@ -723,7 +723,7 @@ var TraceKernelDescriptorTable = class {
723
723
  this.nextFd = 3;
724
724
  return forEach(
725
725
  descriptors,
726
- (descriptor2) => descriptor2.close(),
726
+ (descriptor) => descriptor.close(),
727
727
  { concurrency: "unbounded", discard: true }
728
728
  );
729
729
  });
@@ -732,16 +732,16 @@ var TraceKernelDescriptorTable = class {
732
732
  this.nextFd = 3;
733
733
  while (this.descriptors.has(this.nextFd)) this.nextFd += 1;
734
734
  }
735
- installEffect(descriptor2) {
735
+ installEffect(descriptor) {
736
736
  return try_({
737
- try: () => this.install(descriptor2),
737
+ try: () => this.install(descriptor),
738
738
  catch: (error) => error instanceof TraceKernelDescriptorLimitError ? error : new TraceKernelDescriptorLimitError({
739
739
  code: "EMFILE",
740
740
  maxDescriptors: this.maxDescriptors,
741
741
  message: error instanceof Error ? error.message : String(error)
742
742
  })
743
743
  }).pipe(
744
- tapError(() => descriptor2.close())
744
+ tapError(() => descriptor.close())
745
745
  );
746
746
  }
747
747
  };
@@ -1169,7 +1169,7 @@ var NULL_STAT = Object.freeze({
1169
1169
  changedAt: 0
1170
1170
  });
1171
1171
  function makeTraceKernelNullDescriptor(resourceId, access) {
1172
- const descriptor2 = () => ({
1172
+ const descriptor = () => ({
1173
1173
  kind: "device",
1174
1174
  resourceId,
1175
1175
  ...access === "write" ? {} : {
@@ -1193,10 +1193,10 @@ function makeTraceKernelNullDescriptor(resourceId, access) {
1193
1193
  error: false
1194
1194
  }),
1195
1195
  stat: () => succeed2(NULL_STAT),
1196
- duplicate: () => succeed2(descriptor2()),
1196
+ duplicate: () => succeed2(descriptor()),
1197
1197
  close: () => _void
1198
1198
  });
1199
- return descriptor2();
1199
+ return descriptor();
1200
1200
  }
1201
1201
  var SYSTEM_PRINCIPAL = Object.freeze({
1202
1202
  id: "system",
@@ -5422,7 +5422,7 @@ var TraceKernelTerminals = class {
5422
5422
  isTerminal(process, fd) {
5423
5423
  return this.processTable.assertOwned(process).pipe(
5424
5424
  andThen(process.descriptors.lookup(fd)),
5425
- map((descriptor2) => descriptor2.resource instanceof TraceKernelTerminal)
5425
+ map((descriptor) => descriptor.resource instanceof TraceKernelTerminal)
5426
5426
  );
5427
5427
  }
5428
5428
  terminalForegroundProcessGroup(process, fd) {
@@ -5602,21 +5602,21 @@ var TraceKernelTerminals = class {
5602
5602
  controllingTerminalForDescriptor(process, fd) {
5603
5603
  return gen(this, function* () {
5604
5604
  yield* this.processTable.assertOwned(process);
5605
- const descriptor2 = yield* process.descriptors.lookup(fd);
5606
- if (!(descriptor2.resource instanceof TraceKernelTerminal)) {
5605
+ const descriptor = yield* process.descriptors.lookup(fd);
5606
+ if (!(descriptor.resource instanceof TraceKernelTerminal)) {
5607
5607
  return yield* fail2(new TraceKernelTerminalError({
5608
5608
  code: "ENOTTY",
5609
5609
  message: `ENOTTY: descriptor ${fd} is not a terminal`
5610
5610
  }));
5611
5611
  }
5612
5612
  const snapshot = process.snapshot();
5613
- if (snapshot.sid !== descriptor2.resource.sessionId || snapshot.controllingTerminalId !== descriptor2.resource.id) {
5613
+ if (snapshot.sid !== descriptor.resource.sessionId || snapshot.controllingTerminalId !== descriptor.resource.id) {
5614
5614
  return yield* fail2(new TraceKernelTerminalError({
5615
5615
  code: "ENOTTY",
5616
5616
  message: `ENOTTY: terminal descriptor ${fd} is not controlling process ${process.pid}`
5617
5617
  }));
5618
5618
  }
5619
- return descriptor2.resource;
5619
+ return descriptor.resource;
5620
5620
  });
5621
5621
  }
5622
5622
  };
@@ -5648,7 +5648,7 @@ var TraceKernelSession = class {
5648
5648
  this.processTable,
5649
5649
  this.resources,
5650
5650
  controllingTerminalsBySession,
5651
- (process, descriptor2, fd, options) => this.installDescriptor(process, descriptor2, fd, options)
5651
+ (process, descriptor, fd, options) => this.installDescriptor(process, descriptor, fd, options)
5652
5652
  );
5653
5653
  this.processWatchdogs = new TraceKernelProcessWatchdogs(scope);
5654
5654
  this.stopWatchingFileSystemMutations = fileSystem.watchMutations((mutation) => {
@@ -5950,7 +5950,7 @@ var TraceKernelSession = class {
5950
5950
  return gen(this, function* () {
5951
5951
  yield* this.processTable.assertOwned(process);
5952
5952
  const existing = new Set(
5953
- process.descriptors.snapshots().map((descriptor2) => descriptor2.fd)
5953
+ process.descriptors.snapshots().map((descriptor) => descriptor.fd)
5954
5954
  );
5955
5955
  const installed = [];
5956
5956
  return yield* gen(this, function* () {
@@ -6305,12 +6305,12 @@ var TraceKernelSession = class {
6305
6305
  yield* this.processTable.assertOwned(process);
6306
6306
  const resolved = yield* this.fileSystem.resolve(path, process.snapshot().cwd);
6307
6307
  const stat = yield* this.fileSystem.stat(resolved, "/");
6308
- const descriptor2 = yield* this.watchRegistry.create(
6308
+ const descriptor = yield* this.watchRegistry.create(
6309
6309
  resolved,
6310
6310
  stat.kind === "directory",
6311
6311
  options
6312
6312
  );
6313
- return yield* this.installDescriptor(process, descriptor2);
6313
+ return yield* this.installDescriptor(process, descriptor);
6314
6314
  });
6315
6315
  }
6316
6316
  readFile(path) {
@@ -6477,22 +6477,22 @@ var TraceKernelSession = class {
6477
6477
  tcpSocketFor(process, fd) {
6478
6478
  return this.processTable.assertOwned(process).pipe(
6479
6479
  andThen(process.descriptors.lookup(fd)),
6480
- flatMap((descriptor2) => descriptor2.resource instanceof TraceKernelTcpSocket ? succeed2(descriptor2.resource) : fail2(new TraceKernelNetworkError({
6480
+ flatMap((descriptor) => descriptor.resource instanceof TraceKernelTcpSocket ? succeed2(descriptor.resource) : fail2(new TraceKernelNetworkError({
6481
6481
  code: "EOPNOTSUPP",
6482
6482
  message: `EOPNOTSUPP: descriptor ${fd} is not a TCP socket`
6483
6483
  })))
6484
6484
  );
6485
6485
  }
6486
- installDescriptor(process, descriptor2, fd, options = {}) {
6486
+ installDescriptor(process, descriptor, fd, options = {}) {
6487
6487
  return try_({
6488
- try: () => fd === void 0 ? process.descriptors.install(descriptor2, options) : process.descriptors.installAt(fd, descriptor2, options),
6488
+ try: () => fd === void 0 ? process.descriptors.install(descriptor, options) : process.descriptors.installAt(fd, descriptor, options),
6489
6489
  catch: (error) => error instanceof TraceKernelDescriptorLimitError ? error : new TraceKernelDescriptorLimitError({
6490
6490
  code: "EMFILE",
6491
6491
  maxDescriptors: process.descriptors.maxDescriptors,
6492
6492
  message: error instanceof Error ? error.message : String(error)
6493
6493
  })
6494
6494
  }).pipe(
6495
- tapError(() => descriptor2.close())
6495
+ tapError(() => descriptor.close())
6496
6496
  );
6497
6497
  }
6498
6498
  };
@@ -9693,14 +9693,14 @@ function normalizeAssetDescriptorCollection(runtime, collectionName, value, base
9693
9693
  throw manifestError(runtime, `asset collection "${collectionName}" must not be empty.`);
9694
9694
  }
9695
9695
  const normalized = /* @__PURE__ */ Object.create(null);
9696
- for (const [name, descriptor2] of entries) {
9696
+ for (const [name, descriptor] of entries) {
9697
9697
  if (name.trim() === "" || name !== name.trim() || /[\u0000-\u001f\u007f]/u.test(name) || name === "__proto__" || name === "prototype" || name === "constructor") {
9698
9698
  throw manifestError(runtime, `asset collection "${collectionName}" contains an invalid key.`);
9699
9699
  }
9700
9700
  normalized[name] = normalizeAssetDescriptor(
9701
9701
  runtime,
9702
9702
  `${collectionName}.${name}`,
9703
- descriptor2,
9703
+ descriptor,
9704
9704
  baseUrl,
9705
9705
  manifestOriginPolicy
9706
9706
  );
@@ -9757,11 +9757,11 @@ function normalizePythonRuntimeImage(value, baseUrl, manifestOriginPolicy) {
9757
9757
  baseUrl,
9758
9758
  manifestOriginPolicy
9759
9759
  );
9760
- for (const [name, descriptor2] of [
9760
+ for (const [name, descriptor] of [
9761
9761
  ["wasm", wasm],
9762
9762
  ["snapshot", snapshot]
9763
9763
  ]) {
9764
- if (descriptor2.delivery?.mutability !== "immutable" || descriptor2.integrity === void 0 || descriptor2.size === void 0) {
9764
+ if (descriptor.delivery?.mutability !== "immutable" || descriptor.integrity === void 0 || descriptor.size === void 0) {
9765
9765
  throw manifestError(
9766
9766
  "python",
9767
9767
  `asset "runtimeImage.${name}" must declare immutable delivery, integrity, and size.`
@@ -9792,7 +9792,7 @@ function assertPythonDistributionManifestCompatibility(assets) {
9792
9792
  const indexUrl = new URL(runtimeIndex, `${syntheticOrigin}/`);
9793
9793
  if (!indexUrl.pathname.endsWith("/")) indexUrl.pathname += "/";
9794
9794
  const seenUrls = /* @__PURE__ */ new Set();
9795
- for (const [path, descriptor2] of Object.entries(assets.distribution)) {
9795
+ for (const [path, descriptor] of Object.entries(assets.distribution)) {
9796
9796
  if (path.startsWith("/") || path.includes("\\") || path.split("/").some((segment) => segment === "" || segment === "." || segment === "..")) {
9797
9797
  throw manifestError(
9798
9798
  "python",
@@ -9800,7 +9800,7 @@ function assertPythonDistributionManifestCompatibility(assets) {
9800
9800
  );
9801
9801
  }
9802
9802
  const expectedUrl = new URL(path, indexUrl).href;
9803
- const descriptorUrl = new URL(descriptor2.url, `${syntheticOrigin}/`).href;
9803
+ const descriptorUrl = new URL(descriptor.url, `${syntheticOrigin}/`).href;
9804
9804
  if (descriptorUrl !== expectedUrl) {
9805
9805
  throw manifestError(
9806
9806
  "python",
@@ -9843,10 +9843,10 @@ function decodeSha256Base64(value) {
9843
9843
  if (bytes.length !== 32) return void 0;
9844
9844
  return bytes.map((byte) => byte.toString(16).padStart(2, "0")).join("");
9845
9845
  }
9846
- function descriptorSha256(assetName, descriptor2) {
9847
- if (!descriptor2.integrity) return void 0;
9846
+ function descriptorSha256(assetName, descriptor) {
9847
+ if (!descriptor.integrity) return void 0;
9848
9848
  const digests = /* @__PURE__ */ new Set();
9849
- for (const token of descriptor2.integrity.trim().split(/\s+/u)) {
9849
+ for (const token of descriptor.integrity.trim().split(/\s+/u)) {
9850
9850
  const match2 = /^sha256-([A-Za-z0-9+/]+={0,2})(?:\?.*)?$/u.exec(token);
9851
9851
  if (!match2) continue;
9852
9852
  const hex = decodeSha256Base64(match2[1]);
@@ -9866,19 +9866,19 @@ function descriptorSha256(assetName, descriptor2) {
9866
9866
  function cppCompilerDescriptors(assets) {
9867
9867
  const descriptors = [];
9868
9868
  for (const name of CPP_DIRECT_COMPILER_ASSET_NAMES) {
9869
- const descriptor2 = assets[name];
9870
- if (descriptor2) descriptors.push({ name, descriptor: descriptor2 });
9869
+ const descriptor = assets[name];
9870
+ if (descriptor) descriptors.push({ name, descriptor });
9871
9871
  }
9872
- for (const [name, descriptor2] of Object.entries(assets.compilerResources ?? {})) {
9873
- descriptors.push({ name: `compilerResources.${name}`, descriptor: descriptor2 });
9872
+ for (const [name, descriptor] of Object.entries(assets.compilerResources ?? {})) {
9873
+ descriptors.push({ name: `compilerResources.${name}`, descriptor });
9874
9874
  }
9875
9875
  return descriptors;
9876
9876
  }
9877
9877
  function assertCppCompilerManifestCompatibility(assets) {
9878
9878
  const compilerOrigin = assetOriginKey(assets.worker.url);
9879
- for (const { name, descriptor: descriptor2 } of cppCompilerDescriptors(assets)) {
9880
- const sha256 = descriptorSha256(name, descriptor2);
9881
- if (assetOriginKey(descriptor2.url) !== compilerOrigin && !sha256) {
9879
+ for (const { name, descriptor } of cppCompilerDescriptors(assets)) {
9880
+ const sha256 = descriptorSha256(name, descriptor);
9881
+ if (assetOriginKey(descriptor.url) !== compilerOrigin && !sha256) {
9882
9882
  throw manifestError(
9883
9883
  "cpp",
9884
9884
  `cross-origin asset "${name}" must include an exact sha256 SRI token for compiler pinning.`
@@ -9890,21 +9890,21 @@ function derivedCppCompilerIntegrity(manifests) {
9890
9890
  const manifest = manifests.cpp;
9891
9891
  if (!manifest) return void 0;
9892
9892
  const entries = /* @__PURE__ */ new Map();
9893
- for (const { name, descriptor: descriptor2 } of cppCompilerDescriptors(manifest.assets)) {
9894
- const sha256 = descriptorSha256(name, descriptor2);
9893
+ for (const { name, descriptor } of cppCompilerDescriptors(manifest.assets)) {
9894
+ const sha256 = descriptorSha256(name, descriptor);
9895
9895
  if (!sha256) continue;
9896
- const existing = entries.get(descriptor2.url);
9897
- if (existing && (existing.sha256.toLowerCase() !== sha256.toLowerCase() || existing.size !== void 0 && descriptor2.size !== void 0 && existing.size !== descriptor2.size)) {
9896
+ const existing = entries.get(descriptor.url);
9897
+ if (existing && (existing.sha256.toLowerCase() !== sha256.toLowerCase() || existing.size !== void 0 && descriptor.size !== void 0 && existing.size !== descriptor.size)) {
9898
9898
  throw manifestError(
9899
9899
  "cpp",
9900
- `conflicting exact integrity pins were derived for ${JSON.stringify(descriptor2.url)}.`
9900
+ `conflicting exact integrity pins were derived for ${JSON.stringify(descriptor.url)}.`
9901
9901
  );
9902
9902
  }
9903
- entries.set(descriptor2.url, {
9903
+ entries.set(descriptor.url, {
9904
9904
  ...existing,
9905
- url: descriptor2.url,
9905
+ url: descriptor.url,
9906
9906
  sha256,
9907
- ...descriptor2.size === void 0 ? {} : { size: descriptor2.size }
9907
+ ...descriptor.size === void 0 ? {} : { size: descriptor.size }
9908
9908
  });
9909
9909
  }
9910
9910
  return entries.size > 0 ? Object.freeze({ assets: Object.freeze(Array.from(entries.values())) }) : void 0;
@@ -10058,22 +10058,22 @@ function normalizeManifest(expectedRuntime, value, globalAssetBaseUrl) {
10058
10058
  const assets = {};
10059
10059
  const assetCollectionNames = new Set(RUNTIME_ASSET_COLLECTION_NAMES[expectedRuntime]);
10060
10060
  for (const assetName of RUNTIME_ASSET_NAMES[expectedRuntime]) {
10061
- const descriptor2 = value.assets[assetName];
10062
- if (descriptor2 !== void 0) {
10061
+ const descriptor = value.assets[assetName];
10062
+ if (descriptor !== void 0) {
10063
10063
  assets[assetName] = expectedRuntime === "python" && assetName === "runtimeImage" ? normalizePythonRuntimeImage(
10064
- descriptor2,
10064
+ descriptor,
10065
10065
  assetBaseUrl,
10066
10066
  originPolicy
10067
10067
  ) : assetCollectionNames.has(assetName) ? normalizeAssetDescriptorCollection(
10068
10068
  expectedRuntime,
10069
10069
  assetName,
10070
- descriptor2,
10070
+ descriptor,
10071
10071
  assetBaseUrl,
10072
10072
  originPolicy
10073
10073
  ) : normalizeAssetDescriptor(
10074
10074
  expectedRuntime,
10075
10075
  assetName,
10076
- descriptor2,
10076
+ descriptor,
10077
10077
  assetBaseUrl,
10078
10078
  originPolicy
10079
10079
  );
@@ -10129,8 +10129,8 @@ function assertNoAmbiguousLegacyOverrides(assets, manifests) {
10129
10129
  }
10130
10130
  function manifestAssetUrl(manifests, runtime, assetName) {
10131
10131
  const manifest = manifests[runtime];
10132
- const descriptor2 = manifest?.assets?.[assetName];
10133
- return descriptor2?.url;
10132
+ const descriptor = manifest?.assets?.[assetName];
10133
+ return descriptor?.url;
10134
10134
  }
10135
10135
  function optionalManifestAssetUrl(manifests, runtime, assetName) {
10136
10136
  if (!manifests[runtime]) return void 0;
@@ -10773,19 +10773,19 @@ function resolveRuntimeUrl(url, baseUrl) {
10773
10773
  return void 0;
10774
10774
  }
10775
10775
  }
10776
- function assertRuntimeOriginPolicy(runtime, assetName, descriptor2, manifestPolicy, pageUrl) {
10777
- const policy = descriptor2.originPolicy ?? manifestPolicy;
10776
+ function assertRuntimeOriginPolicy(runtime, assetName, descriptor, manifestPolicy, pageUrl) {
10777
+ const policy = descriptor.originPolicy ?? manifestPolicy;
10778
10778
  if (!policy || policy.mode === "any") return;
10779
- const parsed = resolveRuntimeUrl(descriptor2.url, pageUrl);
10779
+ const parsed = resolveRuntimeUrl(descriptor.url, pageUrl);
10780
10780
  if (!parsed) {
10781
- throw preflightError(runtime, assetName, `URL ${JSON.stringify(descriptor2.url)} could not be resolved.`);
10781
+ throw preflightError(runtime, assetName, `URL ${JSON.stringify(descriptor.url)} could not be resolved.`);
10782
10782
  }
10783
10783
  if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
10784
10784
  throw preflightError(runtime, assetName, `origin policy does not permit the ${parsed.protocol} scheme.`);
10785
10785
  }
10786
10786
  if (policy.mode === "same-origin") {
10787
10787
  if (!pageUrl) {
10788
- if (/^https?:/iu.test(descriptor2.url)) {
10788
+ if (/^https?:/iu.test(descriptor.url)) {
10789
10789
  throw preflightError(runtime, assetName, "same-origin could not be verified without a browser document URL.");
10790
10790
  }
10791
10791
  return;
@@ -10901,10 +10901,10 @@ async function assertIntegrity(runtime, assetName, integrity, bytes) {
10901
10901
  }
10902
10902
  throw preflightError(runtime, assetName, "response bytes did not match the declared integrity metadata.");
10903
10903
  }
10904
- async function verifyDescriptor(runtime, assetName, descriptor2, manifestPolicy, options) {
10904
+ async function verifyDescriptor(runtime, assetName, descriptor, manifestPolicy, options) {
10905
10905
  const pageUrl = documentUrl(options);
10906
- assertRuntimeOriginPolicy(runtime, assetName, descriptor2, manifestPolicy, pageUrl);
10907
- const requiresResponseVerification = descriptor2.integrity !== void 0 || descriptor2.mediaType !== void 0 || descriptor2.size !== void 0;
10906
+ assertRuntimeOriginPolicy(runtime, assetName, descriptor, manifestPolicy, pageUrl);
10907
+ const requiresResponseVerification = descriptor.integrity !== void 0 || descriptor.mediaType !== void 0 || descriptor.size !== void 0;
10908
10908
  if (!requiresResponseVerification) return;
10909
10909
  const fetchImplementation = options.fetch ?? globalThis.fetch;
10910
10910
  if (typeof fetchImplementation !== "function") {
@@ -10912,11 +10912,11 @@ async function verifyDescriptor(runtime, assetName, descriptor2, manifestPolicy,
10912
10912
  }
10913
10913
  let response;
10914
10914
  try {
10915
- response = await fetchImplementation(descriptor2.url, {
10915
+ response = await fetchImplementation(descriptor.url, {
10916
10916
  cache: "force-cache",
10917
10917
  credentials: "omit",
10918
10918
  redirect: "error",
10919
- ...descriptor2.integrity ? { integrity: descriptor2.integrity } : {}
10919
+ ...descriptor.integrity ? { integrity: descriptor.integrity } : {}
10920
10920
  });
10921
10921
  } catch (error) {
10922
10922
  throw preflightError(
@@ -10928,9 +10928,9 @@ async function verifyDescriptor(runtime, assetName, descriptor2, manifestPolicy,
10928
10928
  if (!response.ok || response.type === "opaque") {
10929
10929
  throw preflightError(runtime, assetName, `verification request returned HTTP ${response.status}.`);
10930
10930
  }
10931
- if (descriptor2.mediaType !== void 0) {
10931
+ if (descriptor.mediaType !== void 0) {
10932
10932
  const actualMediaType = normalizeMediaType(response.headers.get("content-type") ?? "");
10933
- const expectedMediaType = normalizeMediaType(descriptor2.mediaType);
10933
+ const expectedMediaType = normalizeMediaType(descriptor.mediaType);
10934
10934
  if (actualMediaType !== expectedMediaType) {
10935
10935
  throw preflightError(
10936
10936
  runtime,
@@ -10939,20 +10939,20 @@ async function verifyDescriptor(runtime, assetName, descriptor2, manifestPolicy,
10939
10939
  );
10940
10940
  }
10941
10941
  }
10942
- if (descriptor2.integrity === void 0 && descriptor2.size === void 0) {
10942
+ if (descriptor.integrity === void 0 && descriptor.size === void 0) {
10943
10943
  await response.body?.cancel().catch(() => void 0);
10944
10944
  return;
10945
10945
  }
10946
- const bytes = await readVerifiedResponseBytes(runtime, assetName, response, descriptor2.size);
10947
- if (descriptor2.size !== void 0 && bytes.byteLength !== descriptor2.size) {
10946
+ const bytes = await readVerifiedResponseBytes(runtime, assetName, response, descriptor.size);
10947
+ if (descriptor.size !== void 0 && bytes.byteLength !== descriptor.size) {
10948
10948
  throw preflightError(
10949
10949
  runtime,
10950
10950
  assetName,
10951
- `decoded size ${bytes.byteLength} did not match declared size ${descriptor2.size}.`
10951
+ `decoded size ${bytes.byteLength} did not match declared size ${descriptor.size}.`
10952
10952
  );
10953
10953
  }
10954
- if (descriptor2.integrity !== void 0) {
10955
- await assertIntegrity(runtime, assetName, descriptor2.integrity, bytes);
10954
+ if (descriptor.integrity !== void 0) {
10955
+ await assertIntegrity(runtime, assetName, descriptor.integrity, bytes);
10956
10956
  }
10957
10957
  }
10958
10958
  function createBrowserRuntimeAssetPreflight(manifests, options = {}) {
@@ -10963,19 +10963,19 @@ function createBrowserRuntimeAssetPreflight(manifests, options = {}) {
10963
10963
  if (!manifest) return;
10964
10964
  const selectedNames = assetNames ? new Set(assetNames) : void 0;
10965
10965
  const entries = descriptorEntries(manifest).filter(({ name }) => !selectedNames || selectedNames.has(name) || selectedNames.has(name.split(".", 1)[0] ?? name));
10966
- await Promise.all(entries.map(({ name, descriptor: descriptor2 }) => {
10966
+ await Promise.all(entries.map(({ name, descriptor }) => {
10967
10967
  const cacheKey = [
10968
10968
  runtime,
10969
- descriptor2.url,
10970
- descriptor2.integrity ?? "",
10971
- descriptor2.size ?? "",
10972
- descriptor2.mediaType ?? ""
10969
+ descriptor.url,
10970
+ descriptor.integrity ?? "",
10971
+ descriptor.size ?? "",
10972
+ descriptor.mediaType ?? ""
10973
10973
  ].join("\0");
10974
10974
  let promise2 = verificationPromises.get(cacheKey);
10975
10975
  if (!promise2) {
10976
10976
  let trackedPromise;
10977
- trackedPromise = verifyDescriptor(runtime, name, descriptor2, manifest.originPolicy, options).then(() => {
10978
- if (descriptor2.delivery?.mutability !== "immutable" && verificationPromises.get(cacheKey) === trackedPromise) {
10977
+ trackedPromise = verifyDescriptor(runtime, name, descriptor, manifest.originPolicy, options).then(() => {
10978
+ if (descriptor.delivery?.mutability !== "immutable" && verificationPromises.get(cacheKey) === trackedPromise) {
10979
10979
  verificationPromises.delete(cacheKey);
10980
10980
  }
10981
10981
  }).catch((error) => {
@@ -11040,6 +11040,18 @@ var BROWSER_PROJECT_PREWARM_PROVIDERS = Object.freeze([
11040
11040
  "cpp"
11041
11041
  ]);
11042
11042
  var BROWSER_PROJECT_INJECTED_PROVIDERS = Object.freeze(["python", "java", "csharp", "cpp"]);
11043
+ var CPP_LEGACY_ASSET_KEYS = Object.freeze([
11044
+ "cppWorker",
11045
+ "cppCompilerWasm",
11046
+ "cppLinkerWasm",
11047
+ "cppSysroot",
11048
+ "cppRuntimeHeader",
11049
+ "cppCompilerIntegrity"
11050
+ ]);
11051
+ function hasConfiguredCppRuntimeAssets(assets) {
11052
+ if (assets?.runtimeManifests?.cpp) return true;
11053
+ return CPP_LEGACY_ASSET_KEYS.some((key) => assets?.[key] !== void 0);
11054
+ }
11043
11055
  function normalizeBrowserProjectProviders(providers) {
11044
11056
  const normalized = [];
11045
11057
  for (const provider of providers ?? DEFAULT_BROWSER_PROJECT_PROVIDERS) {
@@ -11500,27 +11512,41 @@ async function createBrowserProjectWorkspace(options = {}) {
11500
11512
  const hasProvider = (provider) => providers.includes(provider);
11501
11513
  const [pythonProvider, javascriptProvider, javaProvider, csharpProvider, cppProvider] = await Promise.all([
11502
11514
  hasProvider("python") ? Promise.all([
11503
- import("./project-browser-J6LVPVDC.js"),
11504
- import("./python-worker-client-NEBS6V63.js")
11515
+ import("./project-browser-B5T7WJWP.js"),
11516
+ import("./python-worker-client-2RF6IYIN.js")
11505
11517
  ]) : void 0,
11506
- hasProvider("javascript") || hasProvider("typescript") ? import("./project-browser-QMZCUVJA.js") : void 0,
11518
+ hasProvider("javascript") || hasProvider("typescript") ? import("./project-browser-JXJ74RDZ.js") : void 0,
11507
11519
  hasProvider("java") ? Promise.all([
11508
- import("./project-browser-PC7TRROQ.js"),
11509
- import("./java-project-BTAANBJH.js"),
11510
- import("./java-project-client-R7CKC72F.js")
11520
+ import("./project-browser-TDL4LMJJ.js"),
11521
+ import("./java-project-GK6MHT3I.js"),
11522
+ import("./java-project-client-PEQKFTH6.js")
11511
11523
  ]) : void 0,
11512
11524
  hasProvider("csharp") ? Promise.all([
11513
- import("./project-browser-U3YK43H4.js"),
11514
- import("./csharp-worker-client-RA47P77F.js")
11525
+ import("./project-browser-ADXGG5RZ.js"),
11526
+ import("./csharp-worker-client-S4U6MCVF.js")
11515
11527
  ]) : void 0,
11516
11528
  hasProvider("cpp") ? Promise.all([
11517
- import("./project-browser-GBSPIYEW.js"),
11518
- import("./cpp-worker-client-A2ULEW5T.js"),
11519
- import("./browser-runtime-provider-NQNCL6HE.js")
11529
+ import("./project-browser-3I5FVB5N.js"),
11530
+ import("./cpp-worker-client-FLJ2YLSW.js"),
11531
+ import("./browser-runtime-provider-C53ZJH3D.js"),
11532
+ import("./tracecc-runtime-assets-G3BFH7LY.js")
11520
11533
  ]) : void 0
11521
11534
  ]);
11522
11535
  const { createRuntimeWorkspace } = await projectRuntimePromise;
11523
- const assets = resolveBrowserRuntimeAssets(options);
11536
+ const configuredAssets = options.assets;
11537
+ const assets = resolveBrowserRuntimeAssets({
11538
+ ...options,
11539
+ ...cppProvider && runtimeProviders.cpp === void 0 && !hasConfiguredCppRuntimeAssets(configuredAssets) ? {
11540
+ assets: {
11541
+ ...configuredAssets,
11542
+ runtimeAssetProvider(runtime) {
11543
+ return configuredAssets?.runtimeAssetProvider?.(runtime) ?? (runtime === "cpp" ? cppProvider[3].resolveBuiltInTraceCCProjectRuntimeManifest(
11544
+ options.assetBaseUrl ?? "/workers"
11545
+ ) : void 0);
11546
+ }
11547
+ }
11548
+ } : {}
11549
+ });
11524
11550
  const runtimeAssetPreflight = createBrowserRuntimeAssetPreflight(assets.runtimeManifests);
11525
11551
  const pythonManifest = assets.runtimeManifests?.python;
11526
11552
  const pythonAsset = (name) => {
@@ -11545,6 +11571,7 @@ async function createBrowserProjectWorkspace(options = {}) {
11545
11571
  runtimeProviders: _runtimeProviders,
11546
11572
  java,
11547
11573
  javaRuntimeAssetBaseUrl,
11574
+ javaProjectWorkerUrl,
11548
11575
  executionHost: executionHostOptions,
11549
11576
  nodeProject,
11550
11577
  typescriptProject,
@@ -11712,7 +11739,8 @@ async function createBrowserProjectWorkspace(options = {}) {
11712
11739
  const builtInJavaFactory = hasProvider("java") && !java && !injectedJavaProvider && builtInJavaAvailable && javaProvider ? javaProvider[2].createJavaProjectClientFactory({
11713
11740
  runtimeAssetBaseUrl: javaRuntimeAssetBaseUrl ?? javaProvider[2].resolveBuiltInTraceJVMRuntimeAssetBaseUrl(
11714
11741
  options.assetBaseUrl ?? "/workers"
11715
- )
11742
+ ),
11743
+ workerUrl: javaProjectWorkerUrl ?? `${javaProvider[2].resolveBuiltInTraceJVMRuntimeAssetBaseUrl()}/browser-worker.js`
11716
11744
  }) : void 0;
11717
11745
  if (builtInJavaFactory) ownedWorkers.push(builtInJavaFactory);
11718
11746
  const builtInJava = builtInJavaFactory ? {
@@ -11741,7 +11769,7 @@ async function createBrowserProjectWorkspace(options = {}) {
11741
11769
  ...pythonManifest?.loaderFormat ? { loaderFormat: pythonManifest.loaderFormat } : {},
11742
11770
  ...pythonPackageDescriptors ? {
11743
11771
  packageUrls: Object.fromEntries(
11744
- Object.entries(pythonPackageDescriptors).map(([name, descriptor2]) => [name, descriptor2.url])
11772
+ Object.entries(pythonPackageDescriptors).map(([name, descriptor]) => [name, descriptor.url])
11745
11773
  )
11746
11774
  } : {}
11747
11775
  }
@@ -11760,7 +11788,7 @@ async function createBrowserProjectWorkspace(options = {}) {
11760
11788
  ]),
11761
11789
  ...csharpDependencyDescriptors ? {
11762
11790
  runtimeDependencies: Object.fromEntries(
11763
- Object.entries(csharpDependencyDescriptors).map(([name, descriptor2]) => [name, descriptor2.url])
11791
+ Object.entries(csharpDependencyDescriptors).map(([name, descriptor]) => [name, descriptor.url])
11764
11792
  )
11765
11793
  } : {}
11766
11794
  };
@@ -11942,181 +11970,6 @@ async function createBrowserProjectWorkspace(options = {}) {
11942
11970
  }
11943
11971
  }
11944
11972
 
11945
- // packages/runtime-cpp/src/tracecc-runtime-assets.generated.ts
11946
- var TRACECC_RUNTIME_CONTENT_HASH = "fb4b6f41f9e9b7db89b6c8425bb2c6218979219a4150f96619b6461b4b78d294";
11947
- var TRACECC_RUNTIME_ASSETS = Object.freeze({
11948
- "runtimeHeader": {
11949
- "fileName": "tracecode_runtime.hpp",
11950
- "integrity": "sha256-WEbB8mLN8cwKIWPf25UL7yoTSM9nCqWs8MkE0B14EtE=",
11951
- "mediaType": "text/plain",
11952
- "size": 263083
11953
- },
11954
- "compilerWasm": {
11955
- "fileName": "tracecc-reactor.wasm",
11956
- "integrity": "sha256-At40hCU4Rmvynp1s8UzQ1eX/UZybo5BWHMsVgQXUTUE=",
11957
- "mediaType": "application/wasm",
11958
- "size": 33478188
11959
- },
11960
- "sysroot": {
11961
- "fileName": "llvm-resources.tar",
11962
- "integrity": "sha256-2V0qK8hAihbAdEmWrEfJG7PGO7cblDFcl5YIm23ahVU=",
11963
- "mediaType": "application/x-tar",
11964
- "size": 29112320
11965
- },
11966
- "narrowPch": {
11967
- "fileName": "narrow.pch",
11968
- "integrity": "sha256-rbuVm7YeO+HwDpSJPAqGGNrrPKeJveazS/juUWXs5/A=",
11969
- "mediaType": "application/octet-stream",
11970
- "size": 21322216
11971
- },
11972
- "narrowPchSource": {
11973
- "fileName": "narrow.source.hpp",
11974
- "integrity": "sha256-SMqxQfcMBSUHUcAz+7Cp4vkWyOtgv7mNB09JE1cOEAU=",
11975
- "mediaType": "text/plain",
11976
- "size": 815
11977
- },
11978
- "narrowRuntimeObject": {
11979
- "fileName": "narrow.o",
11980
- "integrity": "sha256-il/wX66FvAU9SJSiDepMuEZ00CipED4EEEfqcdxEg8c=",
11981
- "mediaType": "application/wasm",
11982
- "size": 1042570
11983
- },
11984
- "broadPch": {
11985
- "fileName": "broad.pch",
11986
- "integrity": "sha256-ktKxBSglo50GPM9GJJwBpqyYDcFHkKGjoyEtsUmLMrI=",
11987
- "mediaType": "application/octet-stream",
11988
- "size": 24543552
11989
- },
11990
- "broadPchSource": {
11991
- "fileName": "broad.source.hpp",
11992
- "integrity": "sha256-MOayycWl5KYaLS8vP2MoJh4kazsDhg0kH9Bi6dvsy0s=",
11993
- "mediaType": "text/plain",
11994
- "size": 7095
11995
- },
11996
- "broadRuntimeObject": {
11997
- "fileName": "broad.o",
11998
- "integrity": "sha256-f69Oe7kRn9JEIUEPgM1cuYbf50oph4IxEnVP7VIZGp4=",
11999
- "mediaType": "application/wasm",
12000
- "size": 1892879
12001
- },
12002
- "mapPch": {
12003
- "fileName": "map.pch",
12004
- "integrity": "sha256-fX7zTmJXnRJ2acbDiJ4Wu7/xf1G510SB2fLzkTgr2Uc=",
12005
- "mediaType": "application/octet-stream",
12006
- "size": 29951380
12007
- },
12008
- "mapPchSource": {
12009
- "fileName": "map.source.hpp",
12010
- "integrity": "sha256-WHaMpx3nG/h1ro6CppBseoDIkgqahbYnFxShHLGT9/c=",
12011
- "mediaType": "text/plain",
12012
- "size": 10708
12013
- },
12014
- "mapRuntimeObject": {
12015
- "fileName": "map.o",
12016
- "integrity": "sha256-02ktvX6uqV05it5kdBEm/ncOszBeO43wX93Yk079E4U=",
12017
- "mediaType": "application/wasm",
12018
- "size": 3372458
12019
- }
12020
- });
12021
-
12022
- // packages/runtime-cpp/src/tracecc-runtime-assets.ts
12023
- var TRACECC_RUNTIME_ASSET_RELATIVE_PATH = `cpp/tracecc/${TRACECC_RUNTIME_CONTENT_HASH}`;
12024
- var typedTraceCCRuntimeAssets = TRACECC_RUNTIME_ASSETS;
12025
- function stripTrailingSlash2(value) {
12026
- return value.replace(/\/+$/, "");
12027
- }
12028
- function normalizeAssetBaseUrl(value) {
12029
- const normalized = stripTrailingSlash2(value.trim());
12030
- if (!normalized) {
12031
- throw new TypeError("TraceCC requires a non-empty asset base URL.");
12032
- }
12033
- if (/[?#]/u.test(normalized)) {
12034
- throw new TypeError(
12035
- "TraceCC asset base URL must be a directory without a query or fragment."
12036
- );
12037
- }
12038
- return normalized;
12039
- }
12040
- function normalizeWorkerUrl(value) {
12041
- const normalized = value.trim();
12042
- if (!normalized) {
12043
- throw new TypeError("TraceCC worker URL must not be empty.");
12044
- }
12045
- return normalized;
12046
- }
12047
- function descriptor(asset) {
12048
- return {
12049
- url: asset.fileName,
12050
- integrity: asset.integrity,
12051
- mediaType: asset.mediaType,
12052
- size: asset.size,
12053
- delivery: {
12054
- mutability: "immutable",
12055
- address: "content"
12056
- }
12057
- };
12058
- }
12059
- function createTraceCCRuntimeManifest(assetBaseUrl, options = {}) {
12060
- const normalizedAssetBaseUrl = normalizeAssetBaseUrl(assetBaseUrl);
12061
- const workerUrl = normalizeWorkerUrl(
12062
- options.workerUrl ?? "/workers/cpp-worker.js"
12063
- );
12064
- const compilerWasm = descriptor(
12065
- typedTraceCCRuntimeAssets.compilerWasm
12066
- );
12067
- return {
12068
- runtime: "cpp",
12069
- runtimeVersion: `tracecc-${TRACECC_RUNTIME_CONTENT_HASH.slice(0, 12)}`,
12070
- protocolVersion: "browser-runtime-assets-v1",
12071
- assetBaseUrl: `${normalizedAssetBaseUrl}/`,
12072
- workerFormat: "module",
12073
- assets: {
12074
- worker: { url: workerUrl },
12075
- runtimeHeader: descriptor(typedTraceCCRuntimeAssets.runtimeHeader),
12076
- compilerWasm,
12077
- linkerWasm: compilerWasm,
12078
- sysroot: descriptor(typedTraceCCRuntimeAssets.sysroot),
12079
- compilerResources: {
12080
- "tracecc-narrow-pch": descriptor(
12081
- typedTraceCCRuntimeAssets.narrowPch
12082
- ),
12083
- "tracecc-narrow-pch-source": descriptor(
12084
- typedTraceCCRuntimeAssets.narrowPchSource
12085
- ),
12086
- "tracecc-narrow-runtime-object": descriptor(
12087
- typedTraceCCRuntimeAssets.narrowRuntimeObject
12088
- ),
12089
- "tracecc-broad-pch": descriptor(
12090
- typedTraceCCRuntimeAssets.broadPch
12091
- ),
12092
- "tracecc-broad-pch-source": descriptor(
12093
- typedTraceCCRuntimeAssets.broadPchSource
12094
- ),
12095
- "tracecc-broad-runtime-object": descriptor(
12096
- typedTraceCCRuntimeAssets.broadRuntimeObject
12097
- ),
12098
- "tracecc-map-pch": descriptor(
12099
- typedTraceCCRuntimeAssets.mapPch
12100
- ),
12101
- "tracecc-map-pch-source": descriptor(
12102
- typedTraceCCRuntimeAssets.mapPchSource
12103
- ),
12104
- "tracecc-map-runtime-object": descriptor(
12105
- typedTraceCCRuntimeAssets.mapRuntimeObject
12106
- )
12107
- }
12108
- }
12109
- };
12110
- }
12111
- function resolveBuiltInTraceCCRuntimeManifest(assetBaseUrl = "/workers") {
12112
- const normalizedAssetBaseUrl = normalizeAssetBaseUrl(assetBaseUrl);
12113
- return createTraceCCRuntimeManifest(
12114
- `${normalizedAssetBaseUrl}/${TRACECC_RUNTIME_ASSET_RELATIVE_PATH}`,
12115
- { workerUrl: `${normalizedAssetBaseUrl}/cpp-worker.js` }
12116
- );
12117
- }
12118
- var TRACECC_RUNTIME_MANIFEST = resolveBuiltInTraceCCRuntimeManifest();
12119
-
12120
11973
  // packages/runtime-browser/src/runtime-environment.ts
12121
11974
  function preflightAssets(language, surface, csharpPreparedAuthority) {
12122
11975
  switch (language) {
@@ -12326,11 +12179,6 @@ export {
12326
12179
  createBrowserRuntimeAssetPreflight,
12327
12180
  createIndexedDbKernelStorage,
12328
12181
  createBrowserProjectWorkspace,
12329
- TRACECC_RUNTIME_CONTENT_HASH,
12330
- TRACECC_RUNTIME_ASSET_RELATIVE_PATH,
12331
- createTraceCCRuntimeManifest,
12332
- resolveBuiltInTraceCCRuntimeManifest,
12333
- TRACECC_RUNTIME_MANIFEST,
12334
12182
  createBrowserRuntimeEnvironment
12335
12183
  };
12336
- //# sourceMappingURL=chunk-DQMPICNS.js.map
12184
+ //# sourceMappingURL=chunk-TXDHVV6B.js.map