@taewooopark/agent-blackbox 0.46.1 → 0.46.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.
- package/dist/agent-blackbox.plugin.mjs +4 -1
- package/dist/cli.js +11 -1
- package/package.json +1 -1
|
@@ -1064,7 +1064,10 @@ function createOpenCodeEventFactory(options) {
|
|
|
1064
1064
|
const current = typeof output.output === "string" ? output.output : "";
|
|
1065
1065
|
if (!current)
|
|
1066
1066
|
return;
|
|
1067
|
-
const
|
|
1067
|
+
const args = input.args && typeof input.args === "object" ? input.args : {};
|
|
1068
|
+
const offset = typeof args.offset === "number" ? args.offset : "";
|
|
1069
|
+
const limit = typeof args.limit === "number" ? args.limit : "";
|
|
1070
|
+
const key = `${readString2(input, "sessionID") ?? "s"}::${path}::${offset}:${limit}`;
|
|
1068
1071
|
const hash = hashContent(current);
|
|
1069
1072
|
const decision = decideReadServe(readCache.get(key), { hash, content: current }, compactionGen, path);
|
|
1070
1073
|
readCache.set(key, { hash, content: current, gen: compactionGen });
|
package/dist/cli.js
CHANGED
|
@@ -1858,6 +1858,13 @@ async function handleRequest(request, response, eventsFile, clients, suggestConf
|
|
|
1858
1858
|
sendEmpty(response, 204);
|
|
1859
1859
|
return;
|
|
1860
1860
|
}
|
|
1861
|
+
if (request.method === "POST" || url.pathname === "/suggest") {
|
|
1862
|
+
const origin = request.headers.origin;
|
|
1863
|
+
if (typeof origin === "string" && !isLoopbackOrigin(origin)) {
|
|
1864
|
+
sendJson(response, 403, { ok: false, error: { message: "cross-site request blocked" } });
|
|
1865
|
+
return;
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1861
1868
|
const replay = parseReplayQuery(url);
|
|
1862
1869
|
if (request.method === "GET" && url.pathname === "/health") {
|
|
1863
1870
|
sendJson(response, 200, { ok: true, data: { status: "ok", eventsFile } });
|
|
@@ -2351,7 +2358,10 @@ function openInBrowser(url) {
|
|
|
2351
2358
|
const command = platform === "darwin" ? "open" : platform === "win32" ? "cmd" : "xdg-open";
|
|
2352
2359
|
const args2 = platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
2353
2360
|
try {
|
|
2354
|
-
spawn2(command, args2, { stdio: "ignore", detached: true })
|
|
2361
|
+
const child = spawn2(command, args2, { stdio: "ignore", detached: true });
|
|
2362
|
+
child.on("error", () => {
|
|
2363
|
+
});
|
|
2364
|
+
child.unref();
|
|
2355
2365
|
} catch {
|
|
2356
2366
|
}
|
|
2357
2367
|
}
|
package/package.json
CHANGED