@wrongstack/tools 0.305.0 → 0.306.0
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/_shell-pick.d.ts +4 -5
- package/dist/_util.d.ts +22 -5
- package/dist/audit.d.ts +0 -1
- package/dist/audit.js +135 -46
- package/dist/bash.js +61 -37
- package/dist/browser/index.js +29 -9
- package/dist/browser/types.d.ts +7 -1
- package/dist/builtin.js +1280 -728
- package/dist/codebase-index/codebase-search-tool.d.ts +5 -0
- package/dist/codebase-index/index.d.ts +1 -0
- package/dist/codebase-index/index.js +225 -153
- package/dist/codebase-index/project-server-endpoint.d.ts +1 -2
- package/dist/codebase-index/project-server.js +19 -20
- package/dist/diff.d.ts +5 -0
- package/dist/diff.js +78 -12
- package/dist/document.js +18 -6
- package/dist/edit.js +69 -16
- package/dist/exec.js +44 -22
- package/dist/fetch.js +13 -1
- package/dist/format.d.ts +4 -2
- package/dist/format.js +81 -31
- package/dist/glob.js +12 -4
- package/dist/grep.d.ts +2 -0
- package/dist/grep.js +15 -4
- package/dist/index.js +1357 -765
- package/dist/install.js +96 -37
- package/dist/kanban-tool-types.d.ts +6 -1
- package/dist/kanban.js +60 -0
- package/dist/languages/index.js +28 -13
- package/dist/lint.js +28 -13
- package/dist/logs.d.ts +0 -1
- package/dist/logs.js +44 -13
- package/dist/memory.d.ts +8 -0
- package/dist/memory.js +23 -3
- package/dist/mode.d.ts +1 -1
- package/dist/mode.js +3 -0
- package/dist/next-steps.d.ts +2 -3
- package/dist/next-steps.js +3 -3
- package/dist/outdated.d.ts +0 -3
- package/dist/outdated.js +89 -48
- package/dist/pack.js +1280 -728
- package/dist/plan.js +76 -3
- package/dist/process-registry.d.ts +8 -2
- package/dist/process-registry.js +28 -13
- package/dist/ps-slash.js +22 -12
- package/dist/read.js +10 -4
- package/dist/replace.d.ts +4 -0
- package/dist/replace.js +104 -7
- package/dist/search.d.ts +6 -0
- package/dist/search.js +47 -26
- package/dist/session-kanban.d.ts +25 -0
- package/dist/session-kanban.js +16 -0
- package/dist/skill.d.ts +6 -0
- package/dist/skill.js +9 -10
- package/dist/task.js +66 -2
- package/dist/test.js +28 -13
- package/dist/todo.js +64 -2
- package/dist/tool-icons.js +4 -2
- package/dist/tool-summary.d.ts +1 -1
- package/dist/tool-summary.js +76 -1
- package/dist/tool-tier.js +1280 -728
- package/dist/tree.js +9 -10
- package/dist/typecheck.d.ts +0 -2
- package/dist/typecheck.js +98 -31
- package/dist/write.js +58 -10
- package/package.json +4 -3
package/dist/browser/index.js
CHANGED
|
@@ -329,8 +329,8 @@ var BrowserNetworkGuardProxy = class {
|
|
|
329
329
|
upstream.on("error", () => writeProxyError(response, 502, "Bad Gateway"));
|
|
330
330
|
request2.on("aborted", () => upstream.destroy());
|
|
331
331
|
request2.pipe(upstream);
|
|
332
|
-
} catch {
|
|
333
|
-
writeProxyError(response, 403,
|
|
332
|
+
} catch (error) {
|
|
333
|
+
writeProxyError(response, 403, policyBlockMessage(error));
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
async forwardConnect(request2, client, head) {
|
|
@@ -354,8 +354,8 @@ var BrowserNetworkGuardProxy = class {
|
|
|
354
354
|
pipeDuplexPair(upstream, client);
|
|
355
355
|
});
|
|
356
356
|
client.once("close", () => upstream.destroy());
|
|
357
|
-
} catch {
|
|
358
|
-
client.end(
|
|
357
|
+
} catch (error) {
|
|
358
|
+
client.end(rawForbiddenResponse(policyBlockMessage(error)));
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
async forwardUpgrade(request2, client, head) {
|
|
@@ -396,9 +396,9 @@ var BrowserNetworkGuardProxy = class {
|
|
|
396
396
|
});
|
|
397
397
|
client.once("close", () => upstream?.destroy());
|
|
398
398
|
upstream.end();
|
|
399
|
-
} catch {
|
|
399
|
+
} catch (error) {
|
|
400
400
|
upstream?.destroy();
|
|
401
|
-
client.end(
|
|
401
|
+
client.end(rawForbiddenResponse(policyBlockMessage(error)));
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
resolve(rawUrl) {
|
|
@@ -438,6 +438,18 @@ function writeProxyError(response, status, message) {
|
|
|
438
438
|
response.writeHead(status, { "content-type": "text/plain", connection: "close" });
|
|
439
439
|
response.end(message);
|
|
440
440
|
}
|
|
441
|
+
function policyBlockMessage(error) {
|
|
442
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
443
|
+
return reason ? `Blocked by browser network policy: ${reason}` : "Blocked by browser network policy";
|
|
444
|
+
}
|
|
445
|
+
function rawForbiddenResponse(message) {
|
|
446
|
+
return `HTTP/1.1 403 Forbidden\r
|
|
447
|
+
Content-Type: text/plain\r
|
|
448
|
+
Content-Length: ${Buffer.byteLength(message)}\r
|
|
449
|
+
Connection: close\r
|
|
450
|
+
\r
|
|
451
|
+
` + message;
|
|
452
|
+
}
|
|
441
453
|
|
|
442
454
|
// src/browser/manager.ts
|
|
443
455
|
var DEFAULT_OPERATION_TIMEOUT_MS = 3e4;
|
|
@@ -665,7 +677,15 @@ var BrowserSessionManager = class {
|
|
|
665
677
|
if (relative2.startsWith("..") || path2.isAbsolute(relative2)) {
|
|
666
678
|
throw new Error("browser: upload files must stay inside the project root");
|
|
667
679
|
}
|
|
668
|
-
|
|
680
|
+
let realFile;
|
|
681
|
+
try {
|
|
682
|
+
realFile = await fs2.realpath(absolute);
|
|
683
|
+
} catch (error) {
|
|
684
|
+
if (error?.code === "ENOENT") {
|
|
685
|
+
throw new Error(`browser: upload file not found: ${file}`);
|
|
686
|
+
}
|
|
687
|
+
throw error;
|
|
688
|
+
}
|
|
669
689
|
const realRelative = path2.relative(realRoot, realFile);
|
|
670
690
|
if (realRelative.startsWith("..") || path2.isAbsolute(realRelative)) {
|
|
671
691
|
throw new Error("browser: upload files must not escape the project root through a symlink");
|
|
@@ -930,7 +950,7 @@ var sessionIdSchema = {
|
|
|
930
950
|
};
|
|
931
951
|
var browserOpenTool = {
|
|
932
952
|
name: "browser_open",
|
|
933
|
-
description: "Open an isolated first-party Playwright browser session, optionally navigating to a URL.",
|
|
953
|
+
description: "Open an isolated first-party Playwright browser session, optionally navigating to a URL. Private/localhost origins are blocked by default; enable specific origins via the WRONGSTACK_BROWSER_PRIVATE_ORIGINS env allowlist.",
|
|
934
954
|
usageHint: "browser_open({ url?, width?, height?, trace? })",
|
|
935
955
|
permission: "confirm",
|
|
936
956
|
mutating: true,
|
|
@@ -983,7 +1003,7 @@ var browserStatusTool = {
|
|
|
983
1003
|
};
|
|
984
1004
|
var browserNavigateTool = {
|
|
985
1005
|
name: "browser_navigate",
|
|
986
|
-
description: "Navigate an owned browser session to an approved http(s) URL.",
|
|
1006
|
+
description: "Navigate an owned browser session to an approved http(s) URL. Private/localhost origins are blocked by default; enable specific origins via the WRONGSTACK_BROWSER_PRIVATE_ORIGINS env allowlist.",
|
|
987
1007
|
usageHint: "browser_navigate({ sessionId, url })",
|
|
988
1008
|
permission: "confirm",
|
|
989
1009
|
mutating: true,
|
package/dist/browser/types.d.ts
CHANGED
|
@@ -48,7 +48,13 @@ export interface BrowserOpenOptions {
|
|
|
48
48
|
}
|
|
49
49
|
export interface BrowserManagerOptions {
|
|
50
50
|
artifactRoot: string;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Allow navigation to private/loopback addresses (localhost, 127.0.0.1,
|
|
53
|
+
* etc.). FALSE by default (WS-074) — private targets are blocked unless
|
|
54
|
+
* individually allowlisted via `allowedPrivateOrigins`, which is populated
|
|
55
|
+
* from the WRONGSTACK_BROWSER_PRIVATE_ORIGINS env var (comma-separated
|
|
56
|
+
* origins, e.g. "http://localhost:3000,http://127.0.0.1:8080").
|
|
57
|
+
*/
|
|
52
58
|
allowPrivateHosts?: boolean | undefined;
|
|
53
59
|
allowedPrivateOrigins?: string[] | undefined;
|
|
54
60
|
headless?: boolean | undefined;
|