@wrongstack/tools 0.317.0 → 0.318.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/_spawn-stream.d.ts +1 -1
- package/dist/audit.d.ts +37 -2
- package/dist/audit.js +4 -4
- package/dist/bash.js +1 -1
- package/dist/batch-tool-use.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/tools.d.ts +16 -1
- package/dist/builtin.js +43 -43
- package/dist/{chunk-SDLVH5RZ.js → chunk-3QQSBUXR.js} +6 -5
- package/dist/{chunk-YGG6X57C.js → chunk-3U4H6ZRF.js} +12 -9
- package/dist/{chunk-K3WNSHUF.js → chunk-45JPRMC2.js} +62 -36
- package/dist/{chunk-EJWSCQ6D.js → chunk-4AEZIFOW.js} +6 -5
- package/dist/{chunk-PQKK5JH7.js → chunk-4E42D7UF.js} +2 -2
- package/dist/{chunk-JRJJX3L5.js → chunk-5WNDJHT6.js} +3 -2
- package/dist/{chunk-7EY5DCRO.js → chunk-5ZYEGP2P.js} +4 -4
- package/dist/{chunk-VGBUDLW4.js → chunk-6GVXZCQV.js} +7 -6
- package/dist/{chunk-UNSKG6DC.js → chunk-6GZPSWP3.js} +10 -15
- package/dist/{chunk-5OAOKALG.js → chunk-AGUSOFNI.js} +4 -3
- package/dist/{chunk-TRDX25UH.js → chunk-BLCSYKNN.js} +293 -86
- package/dist/{chunk-U6DZWHBA.js → chunk-CIFAIIHI.js} +9 -7
- package/dist/{chunk-HPEO4EA7.js → chunk-CISOLTOP.js} +35 -17
- package/dist/{chunk-RGISBZBD.js → chunk-CPSAF2AU.js} +3 -2
- package/dist/{chunk-BSLVR56S.js → chunk-CPVLVQYT.js} +6 -5
- package/dist/{chunk-VJNHFZ7J.js → chunk-CVALEVGA.js} +6 -5
- package/dist/{chunk-PY2IOS7C.js → chunk-CWALNI6K.js} +5 -5
- package/dist/{chunk-LIJQMYYX.js → chunk-DTQ75VBC.js} +8 -3
- package/dist/{chunk-553IQUMO.js → chunk-EOOFNYIT.js} +7 -6
- package/dist/{chunk-JNNVRHMV.js → chunk-FJEQZHZN.js} +8 -8
- package/dist/{chunk-S5CCLZL3.js → chunk-FRN7TIAA.js} +2 -2
- package/dist/{chunk-NKJW5GFO.js → chunk-H6AWAZ2Y.js} +3 -3
- package/dist/{chunk-IVWV2UM6.js → chunk-HTYEO67J.js} +6 -5
- package/dist/{chunk-IYK7XGDZ.js → chunk-JJQB6R7Y.js} +7 -7
- package/dist/{chunk-DSEANA2W.js → chunk-K23JNFE3.js} +37 -36
- package/dist/{chunk-LWKUTMD5.js → chunk-MRZOVQ5D.js} +6 -5
- package/dist/{chunk-PCHQ6YRR.js → chunk-MX25MTDJ.js} +2 -2
- package/dist/{chunk-U4D5S3VQ.js → chunk-NWZ6XGBJ.js} +2 -1
- package/dist/{chunk-UKU2ZX4C.js → chunk-P7ZQ2FAJ.js} +27 -17
- package/dist/{chunk-4I4LWFOO.js → chunk-PQTONQ4P.js} +16 -11
- package/dist/{chunk-P7FYFZ6M.js → chunk-S2GBLQ5S.js} +11 -7
- package/dist/{chunk-OUBDL3WH.js → chunk-SOG7XIRF.js} +11 -8
- package/dist/{chunk-AHHDWNXC.js → chunk-TKA4VEX2.js} +2 -2
- package/dist/{chunk-5H4GSJAI.js → chunk-UE3UBMCP.js} +7 -6
- package/dist/{chunk-IXMNTNW5.js → chunk-UKGMDCXT.js} +4 -3
- package/dist/{chunk-QDQY7NQ2.js → chunk-VZLX2JZG.js} +5 -5
- package/dist/{chunk-T2F4S7U4.js → chunk-WI3VDXHD.js} +18 -8
- package/dist/{chunk-O4MBV4AX.js → chunk-WJYXMB2R.js} +6 -5
- package/dist/{chunk-U4VAATKP.js → chunk-WXJY3BKV.js} +16 -6
- package/dist/{chunk-DR7JOQTC.js → chunk-X5K3U6GI.js} +3 -3
- package/dist/{chunk-JQRIR762.js → chunk-YF3D5INN.js} +27 -19
- package/dist/{chunk-TEBQ4VPZ.js → chunk-YOHO4DVT.js} +6 -5
- package/dist/{chunk-RXISBFR5.js → chunk-ZE6KLBUO.js} +5 -4
- package/dist/{chunk-22B7GE5T.js → chunk-ZHH3BEWU.js} +13 -12
- package/dist/{chunk-XGHMUZ77.js → chunk-ZZT45EHF.js} +3 -3
- package/dist/codebase-index/bm25.d.ts +14 -1
- package/dist/codebase-index/index.d.ts +1 -0
- package/dist/codebase-index/index.js +13 -8
- package/dist/codebase-index/json-parser.d.ts +4 -0
- package/dist/codebase-index/parser-worker-script.js +2 -2
- package/dist/codebase-index/project-server.js +48 -9
- package/dist/codebase-index/worker.js +4 -4
- package/dist/codebase-index/writer-bulk-insert.d.ts +0 -1
- package/dist/codebase-index/writer-schema.d.ts +1 -1
- package/dist/codebase-index/writer.d.ts +38 -0
- package/dist/diff.js +1 -1
- package/dist/e2e.d.ts +40 -1
- package/dist/e2e.js +1 -1
- package/dist/edit.js +7 -7
- package/dist/exec.js +1 -1
- package/dist/fetch.js +1 -1
- package/dist/format.d.ts +42 -2
- package/dist/format.js +4 -4
- package/dist/git.d.ts +70 -1
- package/dist/git.js +1 -1
- package/dist/glob.js +3 -3
- package/dist/{go-parser-JXYKJHRC.js → go-parser-IKHW67WE.js} +2 -2
- package/dist/grep.js +3 -3
- package/dist/index.js +45 -45
- package/dist/install.d.ts +51 -2
- package/dist/install.js +4 -4
- package/dist/{json-parser-IBHZ4BZC.js → json-parser-2EOVP5MR.js} +81 -15
- package/dist/kanban.d.ts +19 -1
- package/dist/kanban.js +2 -2
- package/dist/languages/index.js +2 -2
- package/dist/{legacy-bridge-7M6QLUQN.js → legacy-bridge-SFNXIRAP.js} +4 -4
- package/dist/lint.js +4 -4
- package/dist/logs.js +1 -1
- package/dist/outdated.d.ts +25 -1
- package/dist/outdated.js +1 -1
- package/dist/pack.js +44 -44
- package/dist/{parser-dispatch-QH4XPGG6.js → parser-dispatch-X62UWXJS.js} +3 -3
- package/dist/patch.js +7 -7
- package/dist/plan.js +4 -4
- package/dist/{py-parser-IS4HKYMF.js → py-parser-TDXSQZBC.js} +2 -2
- package/dist/read.js +7 -7
- package/dist/replace.js +7 -7
- package/dist/{rs-parser-XHUUO2KZ.js → rs-parser-GIWPUA3T.js} +2 -2
- package/dist/scaffold.js +1 -1
- package/dist/search.js +1 -1
- package/dist/session-kanban.js +1 -1
- package/dist/task.js +4 -4
- package/dist/test.js +4 -4
- package/dist/todo.js +3 -3
- package/dist/tool-diff.js +1 -1
- package/dist/tool-tier.js +45 -45
- package/dist/tool-use.js +1 -1
- package/dist/{ts-parser-RCTYKSVI.js → ts-parser-7W26YB26.js} +2 -2
- package/dist/typecheck.js +4 -4
- package/dist/write.js +7 -7
- package/dist/{yaml-parser-4SAXV3PL.js → yaml-parser-RGBXEZE4.js} +2 -2
- package/package.json +5 -5
package/dist/_spawn-stream.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface SpawnStreamOptions {
|
|
|
14
14
|
cmd: string;
|
|
15
15
|
args: string[];
|
|
16
16
|
cwd: string;
|
|
17
|
-
signal
|
|
17
|
+
signal?: AbortSignal | undefined;
|
|
18
18
|
maxBytes?: number | undefined;
|
|
19
19
|
/** Bytes of new stdout/stderr to accumulate before yielding a `partial_output` event. */
|
|
20
20
|
flushBytes?: number | undefined;
|
package/dist/audit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from '@wrongstack/core/types';
|
|
1
|
+
import type { Tool, ToolStreamEvent } from '@wrongstack/core/types';
|
|
2
2
|
interface AuditInput {
|
|
3
3
|
cwd?: string | undefined;
|
|
4
4
|
level?: 'low' | 'moderate' | 'high' | 'critical' | undefined;
|
|
@@ -18,6 +18,41 @@ interface AuditOutput {
|
|
|
18
18
|
output: string;
|
|
19
19
|
truncated: boolean;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
type AuditContext = Parameters<Tool<AuditInput, AuditOutput>['execute']>[1];
|
|
22
|
+
export declare const auditTool: {
|
|
23
|
+
name: string;
|
|
24
|
+
category: string;
|
|
25
|
+
description: string;
|
|
26
|
+
usageHint: string;
|
|
27
|
+
permission: "confirm";
|
|
28
|
+
mutating: false;
|
|
29
|
+
capabilities: string[];
|
|
30
|
+
icon: "package";
|
|
31
|
+
timeoutMs: number;
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties: {
|
|
35
|
+
cwd: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
level: {
|
|
40
|
+
type: string;
|
|
41
|
+
enum: string[];
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
fix: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
execute(input: AuditInput, ctx: AuditContext, opts?: {
|
|
51
|
+
signal: AbortSignal;
|
|
52
|
+
}): Promise<AuditOutput>;
|
|
53
|
+
executeStream(input: AuditInput, ctx: AuditContext, opts?: {
|
|
54
|
+
signal: AbortSignal;
|
|
55
|
+
}): AsyncGenerator<ToolStreamEvent<AuditOutput>>;
|
|
56
|
+
};
|
|
22
57
|
export {};
|
|
23
58
|
//# sourceMappingURL=audit.d.ts.map
|
package/dist/audit.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
auditTool
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CVALEVGA.js";
|
|
4
|
+
import "./chunk-4E42D7UF.js";
|
|
5
|
+
import "./chunk-SOG7XIRF.js";
|
|
6
|
+
import "./chunk-ZHH3BEWU.js";
|
|
7
7
|
import "./chunk-2VSZC6QM.js";
|
|
8
8
|
import "./chunk-3PVYQFRQ.js";
|
|
9
9
|
import "./chunk-HFXSNKCV.js";
|
package/dist/bash.js
CHANGED
package/dist/batch-tool-use.js
CHANGED
package/dist/browser/index.js
CHANGED
package/dist/browser/tools.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Context } from '@wrongstack/core/agent';
|
|
1
2
|
import type { Tool } from '@wrongstack/core/types';
|
|
2
3
|
export declare const browserOpenTool: Tool<{
|
|
3
4
|
url?: string | undefined;
|
|
@@ -5,7 +6,21 @@ export declare const browserOpenTool: Tool<{
|
|
|
5
6
|
height?: number | undefined;
|
|
6
7
|
trace?: boolean | undefined;
|
|
7
8
|
}>;
|
|
8
|
-
export declare const browserListTool:
|
|
9
|
+
export declare const browserListTool: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
permission: "auto";
|
|
13
|
+
mutating: false;
|
|
14
|
+
riskTier: "safe";
|
|
15
|
+
capabilities: "net.outbound"[];
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties: {};
|
|
19
|
+
};
|
|
20
|
+
execute(_input: Record<string, never>, ctx: Context, _opts?: {
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
}): Promise<string>;
|
|
23
|
+
};
|
|
9
24
|
export declare const browserStatusTool: Tool<Record<string, never>>;
|
|
10
25
|
export declare const browserNavigateTool: Tool<{
|
|
11
26
|
sessionId: string;
|
package/dist/builtin.js
CHANGED
|
@@ -5,67 +5,67 @@ import {
|
|
|
5
5
|
TIER2_TOOLS,
|
|
6
6
|
TIER3_TOOLS,
|
|
7
7
|
builtinTools
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-K23JNFE3.js";
|
|
9
|
+
import "./chunk-5WNDJHT6.js";
|
|
10
|
+
import "./chunk-YF3D5INN.js";
|
|
11
11
|
import "./chunk-EEOFQDT6.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-H6AWAZ2Y.js";
|
|
13
|
+
import "./chunk-X5K3U6GI.js";
|
|
14
14
|
import "./chunk-RJZQWEMS.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-FRN7TIAA.js";
|
|
16
|
+
import "./chunk-WXJY3BKV.js";
|
|
17
17
|
import "./chunk-QBV725YG.js";
|
|
18
18
|
import "./chunk-6RNIFLG4.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-CPVLVQYT.js";
|
|
20
|
+
import "./chunk-UE3UBMCP.js";
|
|
21
|
+
import "./chunk-CVALEVGA.js";
|
|
22
|
+
import "./chunk-MRZOVQ5D.js";
|
|
23
|
+
import "./chunk-CPSAF2AU.js";
|
|
24
24
|
import "./chunk-EMRGN4KM.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-TKA4VEX2.js";
|
|
26
|
+
import "./chunk-ZE6KLBUO.js";
|
|
27
|
+
import "./chunk-AGUSOFNI.js";
|
|
28
28
|
import "./chunk-VB3MJGCV.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-P7ZQ2FAJ.js";
|
|
30
30
|
import "./chunk-J5SKD6LN.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-WJYXMB2R.js";
|
|
32
|
+
import "./chunk-3QQSBUXR.js";
|
|
33
|
+
import "./chunk-4AEZIFOW.js";
|
|
34
|
+
import "./chunk-4E42D7UF.js";
|
|
35
|
+
import "./chunk-SOG7XIRF.js";
|
|
36
|
+
import "./chunk-ZHH3BEWU.js";
|
|
37
|
+
import "./chunk-CISOLTOP.js";
|
|
38
|
+
import "./chunk-6GZPSWP3.js";
|
|
39
|
+
import "./chunk-EOOFNYIT.js";
|
|
40
40
|
import "./chunk-Q5JPPCZC.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-NWZ6XGBJ.js";
|
|
42
|
+
import "./chunk-HTYEO67J.js";
|
|
43
|
+
import "./chunk-WI3VDXHD.js";
|
|
44
44
|
import "./chunk-BTSFTGIL.js";
|
|
45
45
|
import "./chunk-NKNOBUBU.js";
|
|
46
46
|
import "./chunk-2VSZC6QM.js";
|
|
47
47
|
import "./chunk-3PVYQFRQ.js";
|
|
48
48
|
import "./chunk-HFXSNKCV.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-UKGMDCXT.js";
|
|
50
|
+
import "./chunk-PQTONQ4P.js";
|
|
51
51
|
import "./chunk-NBDZMMG2.js";
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-5ZYEGP2P.js";
|
|
53
|
+
import "./chunk-FJEQZHZN.js";
|
|
54
|
+
import "./chunk-CWALNI6K.js";
|
|
55
|
+
import "./chunk-45JPRMC2.js";
|
|
56
|
+
import "./chunk-3U4H6ZRF.js";
|
|
57
|
+
import "./chunk-S2GBLQ5S.js";
|
|
58
|
+
import "./chunk-CIFAIIHI.js";
|
|
59
59
|
import "./chunk-FQZOHLG3.js";
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-VZLX2JZG.js";
|
|
61
|
+
import "./chunk-6GVXZCQV.js";
|
|
62
|
+
import "./chunk-BLCSYKNN.js";
|
|
63
|
+
import "./chunk-JJQB6R7Y.js";
|
|
64
64
|
import "./chunk-ZLTFLC25.js";
|
|
65
65
|
import "./chunk-A6BRWIXN.js";
|
|
66
66
|
import "./chunk-UCYQTZ7F.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-YOHO4DVT.js";
|
|
68
|
+
import "./chunk-DTQ75VBC.js";
|
|
69
69
|
import "./chunk-V43EQ6VR.js";
|
|
70
70
|
import "./chunk-D33S4RQG.js";
|
|
71
71
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyCodeOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4E42D7UF.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZHH3BEWU.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeCommandOutput,
|
|
9
9
|
safeResolveReal
|
|
@@ -54,13 +54,14 @@ var formatTool = {
|
|
|
54
54
|
},
|
|
55
55
|
async *executeStream(input, ctx, opts) {
|
|
56
56
|
const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
|
|
57
|
+
const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
|
|
57
58
|
const fixer = input.fixer ?? "auto";
|
|
58
59
|
if (fixer === "auto" && !input.files) {
|
|
59
60
|
const op = input.check ? "format-check" : "format-write";
|
|
60
61
|
const bridge = await tryLegacyCodeOperation(op, {
|
|
61
62
|
cwd,
|
|
62
63
|
projectRoot: ctx.projectRoot,
|
|
63
|
-
signal
|
|
64
|
+
signal
|
|
64
65
|
});
|
|
65
66
|
if (bridge?.run) {
|
|
66
67
|
const run = bridge.run;
|
|
@@ -110,7 +111,7 @@ var formatTool = {
|
|
|
110
111
|
cmd: detected,
|
|
111
112
|
args,
|
|
112
113
|
cwd,
|
|
113
|
-
signal
|
|
114
|
+
signal,
|
|
114
115
|
maxBytes: 1e5
|
|
115
116
|
});
|
|
116
117
|
const combinedOut = `${result.stdout}
|
|
@@ -175,4 +176,4 @@ async function detectFixer(cwd) {
|
|
|
175
176
|
export {
|
|
176
177
|
formatTool
|
|
177
178
|
};
|
|
178
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-3QQSBUXR.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexState,
|
|
3
3
|
searchCodebaseIndex
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZLX2JZG.js";
|
|
5
5
|
import {
|
|
6
6
|
codebaseIndexDirOverride
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BLCSYKNN.js";
|
|
8
8
|
import {
|
|
9
9
|
isBinaryBuffer,
|
|
10
10
|
safeResolveReal,
|
|
@@ -68,6 +68,8 @@ var readTool = {
|
|
|
68
68
|
field: "path"
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
const signal = execOpts?.signal ?? ctx?.signal;
|
|
72
|
+
signal?.throwIfAborted();
|
|
71
73
|
const absPath = await safeResolveReal(input.path, ctx);
|
|
72
74
|
const shouldIncludeSymbols = input.includeSymbols === true || input.includeSymbols !== false && ctx.meta[ADVANCED_MODE_META_KEY] === true;
|
|
73
75
|
let stat2;
|
|
@@ -113,7 +115,7 @@ var readTool = {
|
|
|
113
115
|
const requestedEnd = prior ? Math.min(offset + limit - 1, prior.totalLines) : offset + limit - 1;
|
|
114
116
|
if (input.mode !== "summary" && limit > 0 && prior && coversRange(prior, stat2.mtimeMs, offset, requestedEnd)) {
|
|
115
117
|
ctx.recordRead(absPath, stat2.mtimeMs);
|
|
116
|
-
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx,
|
|
118
|
+
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx, signal) : void 0;
|
|
117
119
|
return {
|
|
118
120
|
text: `[unchanged since previous read: "${input.path}" mtime=${Math.round(stat2.mtimeMs)}; requested lines ${offset}-${requestedEnd} were already shown. Use offset/limit for a new range if needed.]`,
|
|
119
121
|
total_lines: prior.totalLines,
|
|
@@ -124,6 +126,7 @@ var readTool = {
|
|
|
124
126
|
...symResult2?.symbols ? { symbols: symResult2.symbols } : {}
|
|
125
127
|
};
|
|
126
128
|
}
|
|
129
|
+
signal?.throwIfAborted();
|
|
127
130
|
const buf = await fs.readFile(absPath);
|
|
128
131
|
if (isBinaryBuffer(buf)) {
|
|
129
132
|
throw new FsError({
|
|
@@ -135,12 +138,12 @@ var readTool = {
|
|
|
135
138
|
}
|
|
136
139
|
const text = buf.toString("utf8");
|
|
137
140
|
const contentHash = sha256hex(text);
|
|
138
|
-
const allLines = text.split(/\r
|
|
141
|
+
const allLines = text.split(/\r?\n/);
|
|
139
142
|
const total = allLines.length;
|
|
140
143
|
if (input.mode === "summary") {
|
|
141
144
|
ctx.recordRead(absPath, stat2.mtimeMs, "user", contentHash);
|
|
142
145
|
rememberReadRange(ctx, absPath, stat2.mtimeMs, total, 1, Math.min(total, 200));
|
|
143
|
-
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx,
|
|
146
|
+
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx, signal) : void 0;
|
|
144
147
|
return {
|
|
145
148
|
text: summarizeFile(input.path, stat2.size, allLines),
|
|
146
149
|
total_lines: total,
|
|
@@ -156,7 +159,7 @@ var readTool = {
|
|
|
156
159
|
if (limit === 0) {
|
|
157
160
|
ctx.recordRead(absPath, stat2.mtimeMs, "user", contentHash);
|
|
158
161
|
rememberReadRange(ctx, absPath, stat2.mtimeMs, total, 1, 0);
|
|
159
|
-
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx,
|
|
162
|
+
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx, signal) : void 0;
|
|
160
163
|
return {
|
|
161
164
|
text: "",
|
|
162
165
|
total_lines: total,
|
|
@@ -169,7 +172,7 @@ var readTool = {
|
|
|
169
172
|
if (offset > total) {
|
|
170
173
|
ctx.recordRead(absPath, stat2.mtimeMs, "user", contentHash);
|
|
171
174
|
rememberReadRange(ctx, absPath, stat2.mtimeMs, total, total + 1, total + 1);
|
|
172
|
-
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx,
|
|
175
|
+
const symResult2 = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx, signal) : void 0;
|
|
173
176
|
return {
|
|
174
177
|
text: `[offset ${offset} is past end of file "${input.path}" \u2014 file has ${total} line(s). Do not retry this offset.]`,
|
|
175
178
|
total_lines: total,
|
|
@@ -185,7 +188,7 @@ var readTool = {
|
|
|
185
188
|
const numbered = slice.map((line, i) => `${String(offset + i).padStart(width, " ")}\u2192${line}`).join("\n");
|
|
186
189
|
ctx.recordRead(absPath, stat2.mtimeMs, "user", contentHash);
|
|
187
190
|
rememberReadRange(ctx, absPath, stat2.mtimeMs, total, offset, offset + slice.length - 1);
|
|
188
|
-
const symResult = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx,
|
|
191
|
+
const symResult = shouldIncludeSymbols ? await fetchSymbolsForFile(absPath, ctx, signal) : void 0;
|
|
189
192
|
return {
|
|
190
193
|
text: numbered,
|
|
191
194
|
total_lines: total,
|
|
@@ -292,4 +295,4 @@ ${interesting.join("\n")}` : "symbols/imports: (none detected)"
|
|
|
292
295
|
export {
|
|
293
296
|
readTool
|
|
294
297
|
};
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
298
|
+
//# sourceMappingURL=chunk-3U4H6ZRF.js.map
|
|
@@ -509,11 +509,16 @@ var BrowserSessionManager = class {
|
|
|
509
509
|
},
|
|
510
510
|
() => void 0
|
|
511
511
|
);
|
|
512
|
+
const page = await context.newPage().catch(async (error) => {
|
|
513
|
+
await context.close().catch(() => void 0);
|
|
514
|
+
await this.closeBrowserIfIdle();
|
|
515
|
+
throw error;
|
|
516
|
+
});
|
|
512
517
|
const session = {
|
|
513
518
|
id: ulid2(),
|
|
514
519
|
ownerId,
|
|
515
520
|
context,
|
|
516
|
-
page
|
|
521
|
+
page,
|
|
517
522
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
518
523
|
lastUsedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
519
524
|
tracing: input.trace ?? true,
|
|
@@ -522,25 +527,25 @@ var BrowserSessionManager = class {
|
|
|
522
527
|
};
|
|
523
528
|
this.sessions.set(session.id, session);
|
|
524
529
|
this.attachEvidenceCollectors(session);
|
|
525
|
-
await context.route("**/*", async (route) => {
|
|
526
|
-
try {
|
|
527
|
-
await assertBrowserUrlAllowed(route.request().url(), {
|
|
528
|
-
allowPrivateHosts: this.allowPrivateHosts,
|
|
529
|
-
allowedPrivateOrigins: this.allowedPrivateOrigins,
|
|
530
|
-
navigation: false
|
|
531
|
-
});
|
|
532
|
-
await route.continue();
|
|
533
|
-
} catch {
|
|
534
|
-
this.pushNetwork(session, {
|
|
535
|
-
method: route.request().method(),
|
|
536
|
-
url: safeBrowserUrl(route.request().url()),
|
|
537
|
-
failed: true,
|
|
538
|
-
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
539
|
-
});
|
|
540
|
-
await route.abort("blockedbyclient");
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
530
|
try {
|
|
531
|
+
await context.route("**/*", async (route) => {
|
|
532
|
+
try {
|
|
533
|
+
await assertBrowserUrlAllowed(route.request().url(), {
|
|
534
|
+
allowPrivateHosts: this.allowPrivateHosts,
|
|
535
|
+
allowedPrivateOrigins: this.allowedPrivateOrigins,
|
|
536
|
+
navigation: false
|
|
537
|
+
});
|
|
538
|
+
await route.continue();
|
|
539
|
+
} catch {
|
|
540
|
+
this.pushNetwork(session, {
|
|
541
|
+
method: route.request().method(),
|
|
542
|
+
url: safeBrowserUrl(route.request().url()),
|
|
543
|
+
failed: true,
|
|
544
|
+
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
545
|
+
});
|
|
546
|
+
await route.abort("blockedbyclient");
|
|
547
|
+
}
|
|
548
|
+
});
|
|
544
549
|
if (session.tracing) {
|
|
545
550
|
await context.tracing.start({ screenshots: true, snapshots: true, sources: false });
|
|
546
551
|
}
|
|
@@ -901,8 +906,11 @@ import { ToolCapabilities } from "@wrongstack/core/security";
|
|
|
901
906
|
import { resolveWstackPaths } from "@wrongstack/core/utils";
|
|
902
907
|
var managers = /* @__PURE__ */ new Map();
|
|
903
908
|
var cleanupSignalByContext = /* @__PURE__ */ new WeakMap();
|
|
909
|
+
function signalFor(ctx, opts) {
|
|
910
|
+
return opts?.signal ?? ctx.signal ?? new AbortController().signal;
|
|
911
|
+
}
|
|
904
912
|
function managerFor(ctx) {
|
|
905
|
-
const root = path3.resolve(ctx.projectRoot);
|
|
913
|
+
const root = path3.resolve(ctx.projectRoot ?? ctx.cwd ?? process.cwd());
|
|
906
914
|
let manager = managers.get(root);
|
|
907
915
|
if (!manager) {
|
|
908
916
|
const wpaths = resolveWstackPaths({ projectRoot: root });
|
|
@@ -915,7 +923,7 @@ function managerFor(ctx) {
|
|
|
915
923
|
managers.set(root, manager);
|
|
916
924
|
}
|
|
917
925
|
const runSignal = ctx.signal;
|
|
918
|
-
if (cleanupSignalByContext.get(ctx) !== runSignal) {
|
|
926
|
+
if (runSignal && cleanupSignalByContext.get(ctx) !== runSignal) {
|
|
919
927
|
cleanupSignalByContext.set(ctx, runSignal);
|
|
920
928
|
const managerForRun = manager;
|
|
921
929
|
const rootForRun = root;
|
|
@@ -968,7 +976,7 @@ var browserOpenTool = {
|
|
|
968
976
|
await managerFor(ctx).open(
|
|
969
977
|
owner(ctx),
|
|
970
978
|
{ url: input.url, viewport, trace: input.trace },
|
|
971
|
-
opts
|
|
979
|
+
signalFor(ctx, opts)
|
|
972
980
|
)
|
|
973
981
|
);
|
|
974
982
|
}
|
|
@@ -981,7 +989,7 @@ var browserListTool = {
|
|
|
981
989
|
riskTier: "safe",
|
|
982
990
|
capabilities: [ToolCapabilities.NET_OUTBOUND],
|
|
983
991
|
inputSchema: { type: "object", properties: {} },
|
|
984
|
-
async execute(_input, ctx) {
|
|
992
|
+
async execute(_input, ctx, _opts) {
|
|
985
993
|
return json(await managerFor(ctx).list(owner(ctx)));
|
|
986
994
|
}
|
|
987
995
|
};
|
|
@@ -1013,7 +1021,7 @@ var browserNavigateTool = {
|
|
|
1013
1021
|
},
|
|
1014
1022
|
async execute(input, ctx, opts) {
|
|
1015
1023
|
return json(
|
|
1016
|
-
await managerFor(ctx).navigate(input.sessionId, owner(ctx), input.url, opts
|
|
1024
|
+
await managerFor(ctx).navigate(input.sessionId, owner(ctx), input.url, signalFor(ctx, opts))
|
|
1017
1025
|
);
|
|
1018
1026
|
}
|
|
1019
1027
|
};
|
|
@@ -1031,7 +1039,7 @@ var browserSnapshotTool = {
|
|
|
1031
1039
|
required: ["sessionId"]
|
|
1032
1040
|
},
|
|
1033
1041
|
async execute(input, ctx, opts) {
|
|
1034
|
-
return json(await managerFor(ctx).snapshot(input.sessionId, owner(ctx), opts
|
|
1042
|
+
return json(await managerFor(ctx).snapshot(input.sessionId, owner(ctx), signalFor(ctx, opts)));
|
|
1035
1043
|
}
|
|
1036
1044
|
};
|
|
1037
1045
|
var browserScreenshotTool = {
|
|
@@ -1060,7 +1068,7 @@ var browserScreenshotTool = {
|
|
|
1060
1068
|
input.sessionId,
|
|
1061
1069
|
owner(ctx),
|
|
1062
1070
|
{ fullPage: input.fullPage, selector: input.selector },
|
|
1063
|
-
opts
|
|
1071
|
+
signalFor(ctx, opts)
|
|
1064
1072
|
)
|
|
1065
1073
|
);
|
|
1066
1074
|
}
|
|
@@ -1083,7 +1091,7 @@ function selectorTool(name, description, run) {
|
|
|
1083
1091
|
required: ["sessionId", "selector"]
|
|
1084
1092
|
},
|
|
1085
1093
|
async execute(input, ctx, opts) {
|
|
1086
|
-
await run(managerFor(ctx), input, owner(ctx), opts
|
|
1094
|
+
await run(managerFor(ctx), input, owner(ctx), signalFor(ctx, opts));
|
|
1087
1095
|
return "ok";
|
|
1088
1096
|
}
|
|
1089
1097
|
};
|
|
@@ -1131,7 +1139,13 @@ var browserTypeTool = {
|
|
|
1131
1139
|
if (value === void 0) {
|
|
1132
1140
|
throw new Error(`browser: secret environment variable "${input.secretEnv ?? ""}" is not set`);
|
|
1133
1141
|
}
|
|
1134
|
-
await managerFor(ctx).type(
|
|
1142
|
+
await managerFor(ctx).type(
|
|
1143
|
+
input.sessionId,
|
|
1144
|
+
owner(ctx),
|
|
1145
|
+
input.selector,
|
|
1146
|
+
value,
|
|
1147
|
+
signalFor(ctx, opts)
|
|
1148
|
+
);
|
|
1135
1149
|
return "ok";
|
|
1136
1150
|
}
|
|
1137
1151
|
};
|
|
@@ -1161,7 +1175,7 @@ var browserSelectTool = {
|
|
|
1161
1175
|
owner(ctx),
|
|
1162
1176
|
input.selector,
|
|
1163
1177
|
input.value,
|
|
1164
|
-
opts
|
|
1178
|
+
signalFor(ctx, opts)
|
|
1165
1179
|
);
|
|
1166
1180
|
return "ok";
|
|
1167
1181
|
}
|
|
@@ -1183,7 +1197,7 @@ var browserPressTool = {
|
|
|
1183
1197
|
required: ["sessionId", "key"]
|
|
1184
1198
|
},
|
|
1185
1199
|
async execute(input, ctx, opts) {
|
|
1186
|
-
await managerFor(ctx).press(input.sessionId, owner(ctx), input.key, opts
|
|
1200
|
+
await managerFor(ctx).press(input.sessionId, owner(ctx), input.key, signalFor(ctx, opts));
|
|
1187
1201
|
return "ok";
|
|
1188
1202
|
}
|
|
1189
1203
|
};
|
|
@@ -1208,7 +1222,13 @@ var browserDragTool = {
|
|
|
1208
1222
|
required: ["sessionId", "from", "to"]
|
|
1209
1223
|
},
|
|
1210
1224
|
async execute(input, ctx, opts) {
|
|
1211
|
-
await managerFor(ctx).drag(
|
|
1225
|
+
await managerFor(ctx).drag(
|
|
1226
|
+
input.sessionId,
|
|
1227
|
+
owner(ctx),
|
|
1228
|
+
input.from,
|
|
1229
|
+
input.to,
|
|
1230
|
+
signalFor(ctx, opts)
|
|
1231
|
+
);
|
|
1212
1232
|
return "ok";
|
|
1213
1233
|
}
|
|
1214
1234
|
};
|
|
@@ -1234,7 +1254,7 @@ var browserWaitTool = {
|
|
|
1234
1254
|
input.sessionId,
|
|
1235
1255
|
owner(ctx),
|
|
1236
1256
|
{ selector: input.selector, timeoutMs: input.timeoutMs },
|
|
1237
|
-
opts
|
|
1257
|
+
signalFor(ctx, opts)
|
|
1238
1258
|
);
|
|
1239
1259
|
return "ok";
|
|
1240
1260
|
}
|
|
@@ -1260,7 +1280,12 @@ var browserEvaluateTool = {
|
|
|
1260
1280
|
},
|
|
1261
1281
|
async execute(input, ctx, opts) {
|
|
1262
1282
|
return json(
|
|
1263
|
-
await managerFor(ctx).evaluate(
|
|
1283
|
+
await managerFor(ctx).evaluate(
|
|
1284
|
+
input.sessionId,
|
|
1285
|
+
owner(ctx),
|
|
1286
|
+
input.expression,
|
|
1287
|
+
signalFor(ctx, opts)
|
|
1288
|
+
)
|
|
1264
1289
|
);
|
|
1265
1290
|
}
|
|
1266
1291
|
};
|
|
@@ -1285,13 +1310,14 @@ var browserUploadTool = {
|
|
|
1285
1310
|
required: ["sessionId", "selector", "files"]
|
|
1286
1311
|
},
|
|
1287
1312
|
async execute(input, ctx, opts) {
|
|
1313
|
+
const root = ctx.projectRoot ?? ctx.cwd ?? process.cwd();
|
|
1288
1314
|
await managerFor(ctx).upload(
|
|
1289
1315
|
input.sessionId,
|
|
1290
1316
|
owner(ctx),
|
|
1291
1317
|
input.selector,
|
|
1292
1318
|
input.files,
|
|
1293
|
-
|
|
1294
|
-
opts
|
|
1319
|
+
root,
|
|
1320
|
+
signalFor(ctx, opts)
|
|
1295
1321
|
);
|
|
1296
1322
|
return "ok";
|
|
1297
1323
|
}
|
|
@@ -1368,4 +1394,4 @@ export {
|
|
|
1368
1394
|
browserTools,
|
|
1369
1395
|
shutdownBrowserTools
|
|
1370
1396
|
};
|
|
1371
|
-
//# sourceMappingURL=chunk-
|
|
1397
|
+
//# sourceMappingURL=chunk-45JPRMC2.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryLegacyCodeOperation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4E42D7UF.js";
|
|
4
4
|
import {
|
|
5
5
|
spawnStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZHH3BEWU.js";
|
|
7
7
|
import {
|
|
8
8
|
detectPackageManager,
|
|
9
9
|
normalizeCommandOutput,
|
|
@@ -49,10 +49,11 @@ var typecheckTool = {
|
|
|
49
49
|
},
|
|
50
50
|
async *executeStream(input, ctx, opts) {
|
|
51
51
|
const cwd = input.cwd ? await safeResolveReal(input.cwd, ctx) : ctx.cwd;
|
|
52
|
+
const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
|
|
52
53
|
const bridge = await tryLegacyCodeOperation("semantic", {
|
|
53
54
|
cwd,
|
|
54
55
|
projectRoot: ctx.projectRoot,
|
|
55
|
-
signal
|
|
56
|
+
signal
|
|
56
57
|
});
|
|
57
58
|
if (bridge?.run) {
|
|
58
59
|
const run = bridge.run;
|
|
@@ -98,7 +99,7 @@ var typecheckTool = {
|
|
|
98
99
|
cmd,
|
|
99
100
|
args: cmdArgs,
|
|
100
101
|
cwd,
|
|
101
|
-
signal
|
|
102
|
+
signal,
|
|
102
103
|
maxBytes: 2e5
|
|
103
104
|
});
|
|
104
105
|
const combined = `${result.stdout}
|
|
@@ -134,4 +135,4 @@ async function findTsConfig(cwd) {
|
|
|
134
135
|
export {
|
|
135
136
|
typecheckTool
|
|
136
137
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-4AEZIFOW.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
executeLanguagePlan,
|
|
3
3
|
executePackagePlan,
|
|
4
4
|
planLanguageOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-SOG7XIRF.js";
|
|
6
6
|
|
|
7
7
|
// src/languages/legacy-bridge.ts
|
|
8
8
|
import * as fs from "node:fs/promises";
|
|
@@ -98,4 +98,4 @@ export {
|
|
|
98
98
|
tryLegacyCodeOperation,
|
|
99
99
|
tryLegacyPackageOperation
|
|
100
100
|
};
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-4E42D7UF.js.map
|
|
@@ -408,11 +408,12 @@ var e2ePlanTool = {
|
|
|
408
408
|
},
|
|
409
409
|
async execute(input, ctx, opts) {
|
|
410
410
|
const root = await safeResolveReal(input.cwd ?? ".", ctx);
|
|
411
|
+
const signal = opts?.signal ?? ctx.signal ?? new AbortController().signal;
|
|
411
412
|
return discoverE2EProjects(root, {
|
|
412
413
|
framework: input.framework,
|
|
413
414
|
maxDepth: input.maxDepth,
|
|
414
415
|
includeSpecs: input.includeSpecs,
|
|
415
|
-
signal
|
|
416
|
+
signal
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
};
|
|
@@ -421,4 +422,4 @@ export {
|
|
|
421
422
|
discoverE2EProjects,
|
|
422
423
|
e2ePlanTool
|
|
423
424
|
};
|
|
424
|
-
//# sourceMappingURL=chunk-
|
|
425
|
+
//# sourceMappingURL=chunk-5WNDJHT6.js.map
|