@inerrata-corporation/errata 2.0.22-dev.4074 → 2.0.22-dev.4121
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/errata.mjs
CHANGED
|
@@ -85053,7 +85053,7 @@ function createWatchBreaker(deps) {
|
|
|
85053
85053
|
}
|
|
85054
85054
|
|
|
85055
85055
|
// src/engine.ts
|
|
85056
|
-
var DAEMON_VERSION = true ? "2.0.22-dev.
|
|
85056
|
+
var DAEMON_VERSION = true ? "2.0.22-dev.4121" : "2.0.0-alpha.0";
|
|
85057
85057
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
85058
85058
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
85059
85059
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -87723,6 +87723,39 @@ B: ${b}`,
|
|
|
87723
87723
|
};
|
|
87724
87724
|
}
|
|
87725
87725
|
|
|
87726
|
+
// src/loopback-guard.ts
|
|
87727
|
+
var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
87728
|
+
function isLoopbackHost(host) {
|
|
87729
|
+
const h = host.trim().toLowerCase();
|
|
87730
|
+
const m = /^(\[[^\]]+\]|[^:]+)(?::(\d+))?$/.exec(h);
|
|
87731
|
+
return !!m && LOOPBACK_HOSTNAMES.has(m[1]);
|
|
87732
|
+
}
|
|
87733
|
+
function isLoopbackOrigin(origin) {
|
|
87734
|
+
try {
|
|
87735
|
+
const u = new URL(origin);
|
|
87736
|
+
return u.protocol === "http:" && LOOPBACK_HOSTNAMES.has(u.hostname);
|
|
87737
|
+
} catch {
|
|
87738
|
+
return false;
|
|
87739
|
+
}
|
|
87740
|
+
}
|
|
87741
|
+
function loopbackRefusal(headers) {
|
|
87742
|
+
const host = headers.get("host");
|
|
87743
|
+
if (host !== null && host !== "" && !isLoopbackHost(host)) return "non-loopback Host";
|
|
87744
|
+
const origin = headers.get("origin");
|
|
87745
|
+
if (origin !== null && !isLoopbackOrigin(origin)) return "non-loopback Origin";
|
|
87746
|
+
return null;
|
|
87747
|
+
}
|
|
87748
|
+
function withLoopbackGuard(fetchFn) {
|
|
87749
|
+
return (req) => {
|
|
87750
|
+
const refusal = loopbackRefusal(req.headers);
|
|
87751
|
+
if (refusal) return new Response(JSON.stringify({ error: "forbidden", reason: refusal }), {
|
|
87752
|
+
status: 403,
|
|
87753
|
+
headers: { "content-type": "application/json" }
|
|
87754
|
+
});
|
|
87755
|
+
return fetchFn(req);
|
|
87756
|
+
};
|
|
87757
|
+
}
|
|
87758
|
+
|
|
87726
87759
|
// src/daemon.ts
|
|
87727
87760
|
async function startDaemon(opts) {
|
|
87728
87761
|
const processStartedAt = Date.now();
|
|
@@ -87804,7 +87837,7 @@ async function startDaemon(opts) {
|
|
|
87804
87837
|
}
|
|
87805
87838
|
async function listenServer(fetchFn, port) {
|
|
87806
87839
|
return new Promise((resolve10, reject) => {
|
|
87807
|
-
const server = serve({ fetch: fetchFn, hostname: "127.0.0.1", port }, (info2) => {
|
|
87840
|
+
const server = serve({ fetch: withLoopbackGuard(fetchFn), hostname: "127.0.0.1", port }, (info2) => {
|
|
87808
87841
|
resolve10({ server, port: info2.port });
|
|
87809
87842
|
});
|
|
87810
87843
|
server.once(
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
9f7ae426e110baef3bb27e68785897f745b77ef23fd2ee4e73188e8e6047890d .codex-plugin/plugin.json
|
|
2
2
|
a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
|
|
3
3
|
fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
|
|
4
4
|
73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js
|