tesseract-agent 0.5.1 → 0.5.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.
Files changed (2) hide show
  1. package/dist-bundle/cli.js +45 -1
  2. package/package.json +1 -1
@@ -43882,12 +43882,33 @@ __export(quic_transport_exports, {
43882
43882
  discoverSrflx: () => discoverSrflx,
43883
43883
  makeQuicSocket: () => makeQuicSocket,
43884
43884
  nudgePunch: () => nudgePunch,
43885
+ quicBindingUsable: () => quicBindingUsable,
43885
43886
  quicDialLink: () => quicDialLink,
43886
43887
  startQuicServerOnSocket: () => startQuicServerOnSocket
43887
43888
  });
43888
43889
  import { webcrypto } from "node:crypto";
43889
43890
  import { createHmac } from "node:crypto";
43890
43891
  import { EventEmitter } from "node:events";
43892
+ function quicBindingUsable() {
43893
+ return quicUsableP ??= probeQuicBinding();
43894
+ }
43895
+ async function probeQuicBinding() {
43896
+ let quiche;
43897
+ try {
43898
+ quiche = (await loadQuic()).native.quiche;
43899
+ } catch {
43900
+ return false;
43901
+ }
43902
+ if (typeof quiche?.Header?.fromSlice !== "function")
43903
+ return true;
43904
+ const pkt = new Uint8Array([192, 0, 0, 0, 1, 8, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0]);
43905
+ try {
43906
+ quiche.Header.fromSlice(pkt, quiche.MAX_CONN_ID_LEN);
43907
+ return true;
43908
+ } catch (e) {
43909
+ return !/external arraybuffer/i.test(e?.message ?? "");
43910
+ }
43911
+ }
43891
43912
  function serverCrypto() {
43892
43913
  const key2 = webcrypto.getRandomValues(new Uint8Array(32));
43893
43914
  return {
@@ -44053,7 +44074,7 @@ async function nudgePunch(socket2, peerIp, peerPort, count = 12, intervalMs = 10
44053
44074
  await new Promise((r) => setTimeout(r, intervalMs));
44054
44075
  }
44055
44076
  }
44056
- var ALPN, quicModP, loadQuic, clientCrypto;
44077
+ var ALPN, quicModP, loadQuic, quicUsableP, clientCrypto;
44057
44078
  var init_quic_transport = __esm({
44058
44079
  "../../packages/host-core/dist/peer-link/quic-transport.js"() {
44059
44080
  "use strict";
@@ -44063,6 +44084,7 @@ var init_quic_transport = __esm({
44063
44084
  ALPN = ["tesseract-peer"];
44064
44085
  quicModP = null;
44065
44086
  loadQuic = () => quicModP ??= import("@matrixai/quic");
44087
+ quicUsableP = null;
44066
44088
  clientCrypto = {
44067
44089
  ops: { randomBytes: async (data) => {
44068
44090
  webcrypto.getRandomValues(new Uint8Array(data));
@@ -47576,6 +47598,21 @@ function uiFile(name) {
47576
47598
  function notReady(what) {
47577
47599
  throw new Error(`${what} requires the on-screen co-worker (the GUI daemon) \u2014 it isn't active. Enable it (CCB_FORCE_DAEMON_GUI=1) on a signed build.`);
47578
47600
  }
47601
+ function wireWindowDiagnostics(win, label) {
47602
+ try {
47603
+ win.webContents.on("did-finish-load", () => log2(`${label} window loaded`));
47604
+ win.webContents.on("console-message", (...a) => {
47605
+ const o = a[0] && typeof a[0] === "object" && "message" in a[0] ? a[0] : { level: a[1], message: a[2] };
47606
+ if (o.message && (o.level === "error" || o.level === "warning" || typeof o.level === "number" && o.level >= 2))
47607
+ log2(`${label} renderer:`, String(o.message));
47608
+ });
47609
+ win.webContents.on("render-process-gone", (...a) => {
47610
+ const d = a[1] && typeof a[1] === "object" ? a[1] : a[0];
47611
+ log2(`${label} renderer CRASHED:`, d?.reason ? String(d.reason) : JSON.stringify(d ?? {}));
47612
+ });
47613
+ } catch {
47614
+ }
47615
+ }
47579
47616
  var overlayWins = null;
47580
47617
  var screenWired = false;
47581
47618
  function sendOverlay(ow, channel, payload) {
@@ -47801,6 +47838,7 @@ async function overlayChoice(spec) {
47801
47838
  win.setAlwaysOnTop(true, "screen-saver");
47802
47839
  win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
47803
47840
  void win.loadFile(uiFile("choice.html"));
47841
+ wireWindowDiagnostics(win, "choice");
47804
47842
  win.webContents.on("did-finish-load", () => {
47805
47843
  win.webContents.send("choice:show", { reqId, prompt: spec.prompt, options: spec.options });
47806
47844
  win.show();
@@ -50489,6 +50527,12 @@ var PeerLinkManager = class {
50489
50527
  const identity = await this.identity();
50490
50528
  try {
50491
50529
  const q = await Promise.resolve().then(() => (init_quic_transport(), quic_transport_exports));
50530
+ if (!await q.quicBindingUsable()) {
50531
+ this.quicUnavailable = true;
50532
+ this.quicSocket = null;
50533
+ console.warn("[peer-link] QUIC tier disabled \u2014 the native @matrixai/quic binding is incompatible with this runtime (V8 sandbox rejects its external ArrayBuffers). Rebuild it sandbox-safe to re-enable; using TCP tiers meanwhile.");
50534
+ return;
50535
+ }
50492
50536
  const socket2 = await q.makeQuicSocket(this.udpPort);
50493
50537
  this.quicSocket = socket2;
50494
50538
  await q.startQuicServerOnSocket({ socket: socket2, identity, onStream: (bs2) => this.acceptInbound(bs2, "punch") });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tesseract-agent",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "license": "UNLICENSED",
5
5
  "publishConfig": {
6
6
  "access": "public",