tesseract-agent 0.4.5 → 0.4.7
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/dist-bundle/cli.js +36 -17
- package/package.json +1 -1
package/dist-bundle/cli.js
CHANGED
|
@@ -21145,6 +21145,14 @@ CRITICAL RULES:
|
|
|
21145
21145
|
live.query = query({
|
|
21146
21146
|
prompt: pump,
|
|
21147
21147
|
options: {
|
|
21148
|
+
// Tell the SDK exactly which executable to use. The SDK resolves this
|
|
21149
|
+
// UNCONDITIONALLY at query() setup and, when it is INLINED into the daemon/CLI
|
|
21150
|
+
// esbuild bundle, its internal `require.resolve('./cli.js')` resolves relative to
|
|
21151
|
+
// the BUNDLE (not the SDK package dir) → MODULE_NOT_FOUND → it throws "Native CLI
|
|
21152
|
+
// binary for <plat>-<arch> not found". findClaudeCliJs() resolves cli.js BY PACKAGE
|
|
21153
|
+
// NAME (works bundled AND in dev), so passing it here makes the SDK skip its broken
|
|
21154
|
+
// self-resolution; spawnClaudeCodeProcess below still runs that same cli.js under node.
|
|
21155
|
+
pathToClaudeCodeExecutable: findClaudeCliJs(),
|
|
21148
21156
|
// Permission allowlist (auto-approve in gated modes) — NOT the tool registry.
|
|
21149
21157
|
// TodoWrite is pre-approved so the plan-sidebar checklist updates never prompt.
|
|
21150
21158
|
// ExitPlanMode is deliberately NOT here, so plan approval still routes through
|
|
@@ -45578,6 +45586,11 @@ var PeerLinkManager = class {
|
|
|
45578
45586
|
quicSrflx = null;
|
|
45579
45587
|
quicInitP = null;
|
|
45580
45588
|
quicKeepalive = null;
|
|
45589
|
+
/** Set once if the QUIC native dep (@matrixai/quic) can't be loaded on this host —
|
|
45590
|
+
* e.g. the desktop app doesn't ship it, or an arch with no prebuilt binding. The
|
|
45591
|
+
* QUIC tier then no-ops permanently and the TCP tiers carry every link (fail-closed,
|
|
45592
|
+
* exactly what the lazy-load design in quic-transport.ts promises). */
|
|
45593
|
+
quicUnavailable = false;
|
|
45581
45594
|
constructor(certPath, keyPath) {
|
|
45582
45595
|
this.certPath = certPath;
|
|
45583
45596
|
this.keyPath = keyPath;
|
|
@@ -45624,22 +45637,28 @@ var PeerLinkManager = class {
|
|
|
45624
45637
|
return;
|
|
45625
45638
|
const stunPort = Number(process.env.CCB_STUN_PORT ?? 3478);
|
|
45626
45639
|
const identity = await this.identity();
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45630
|
-
|
|
45631
|
-
|
|
45632
|
-
|
|
45633
|
-
|
|
45634
|
-
|
|
45635
|
-
|
|
45636
|
-
|
|
45637
|
-
|
|
45638
|
-
|
|
45639
|
-
|
|
45640
|
-
|
|
45641
|
-
|
|
45642
|
-
|
|
45640
|
+
try {
|
|
45641
|
+
const q = await Promise.resolve().then(() => (init_quic_transport(), quic_transport_exports));
|
|
45642
|
+
const socket2 = await q.makeQuicSocket(this.udpPort);
|
|
45643
|
+
this.quicSocket = socket2;
|
|
45644
|
+
await q.startQuicServerOnSocket({ socket: socket2, identity, onStream: (bs) => this.acceptInbound(bs, "punch") });
|
|
45645
|
+
const refresh = async () => {
|
|
45646
|
+
try {
|
|
45647
|
+
const s = await q.discoverSrflx(socket2, stunHost, stunPort);
|
|
45648
|
+
const i = s.lastIndexOf(":");
|
|
45649
|
+
this.quicSrflx = { type: "srflx", ip: s.slice(0, i), port: Number(s.slice(i + 1)), proto: "udp", priority: 40 };
|
|
45650
|
+
} catch {
|
|
45651
|
+
}
|
|
45652
|
+
};
|
|
45653
|
+
await refresh();
|
|
45654
|
+
this.quicKeepalive = setInterval(() => {
|
|
45655
|
+
void refresh();
|
|
45656
|
+
}, 2e4);
|
|
45657
|
+
} catch (e) {
|
|
45658
|
+
this.quicUnavailable = true;
|
|
45659
|
+
this.quicSocket = null;
|
|
45660
|
+
console.warn(`[peer-link] QUIC tier unavailable \u2014 using TCP tiers only: ${e?.message ?? e}`);
|
|
45661
|
+
}
|
|
45643
45662
|
}
|
|
45644
45663
|
async nudgeQuic(peer) {
|
|
45645
45664
|
if (!this.quicSocket)
|
|
@@ -45755,7 +45774,7 @@ var PeerLinkManager = class {
|
|
|
45755
45774
|
async handleGo(msg) {
|
|
45756
45775
|
const token = Buffer.from(msg.token, "hex");
|
|
45757
45776
|
const udp = msg.peerCandidates.filter((c) => c.proto === "udp");
|
|
45758
|
-
const quicOn = this.quicEnabled() && udp.length > 0;
|
|
45777
|
+
const quicOn = this.quicEnabled() && udp.length > 0 && !this.quicUnavailable;
|
|
45759
45778
|
if (msg.role === "listen") {
|
|
45760
45779
|
if (quicOn) {
|
|
45761
45780
|
await this.initQuic();
|