@empiricalrun/test-gen 0.78.1 → 0.78.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/CHANGELOG.md +15 -0
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +1 -0
- package/dist/agent/chat/exports.d.ts +0 -1
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +1 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +2 -0
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +11 -8
- package/dist/agent/cua/pw-codegen/factory.d.ts +15 -0
- package/dist/agent/cua/pw-codegen/factory.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/factory.js +59 -0
- package/dist/agent/cua/pw-codegen/index.d.ts +7 -0
- package/dist/agent/cua/pw-codegen/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/index.js +14 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts +43 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.js +250 -0
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +6 -2
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts +15 -3
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/patch.js +38 -10
- package/dist/agent/cua/pw-codegen/version.d.ts +25 -0
- package/dist/agent/cua/pw-codegen/version.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/version.js +86 -0
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +2 -0
- package/dist/dashboard/client.d.ts +5 -0
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/client.js +28 -21
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +7 -2
- package/dist/tools/create-pull-request/utils.d.ts +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +2 -24
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
- package/dist/tools/definitions/delete-file.d.ts +1 -5
- package/dist/tools/definitions/delete-file.d.ts.map +1 -1
- package/dist/tools/definitions/download-build.d.ts +1 -5
- package/dist/tools/definitions/download-build.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts +1 -5
- package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
- package/dist/tools/definitions/run-test.d.ts +2 -14
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/safe-bash.d.ts +8 -0
- package/dist/tools/definitions/safe-bash.d.ts.map +1 -0
- package/dist/tools/definitions/safe-bash.js +32 -0
- package/dist/tools/definitions/test-gen-browser.d.ts +2 -14
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +3 -25
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
- package/dist/tools/definitions/utils.d.ts +2 -10
- package/dist/tools/definitions/utils.d.ts.map +1 -1
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +2 -0
- package/dist/tools/fetch-file/index.d.ts +1 -5
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/firecrawl-scrape/index.d.ts +9 -0
- package/dist/tools/firecrawl-scrape/index.d.ts.map +1 -0
- package/dist/tools/firecrawl-scrape/index.js +107 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +9 -1
- package/dist/tools/issues-v2/create-issue.d.ts.map +1 -1
- package/dist/tools/issues-v2/create-issue.js +2 -6
- package/dist/tools/issues-v2/set-issue-description.d.ts +3 -0
- package/dist/tools/issues-v2/set-issue-description.d.ts.map +1 -0
- package/dist/tools/issues-v2/set-issue-description.js +59 -0
- package/dist/tools/issues-v2/update-issue.d.ts.map +1 -1
- package/dist/tools/issues-v2/update-issue.js +7 -9
- package/dist/tools/safe-bash/index.d.ts +3 -0
- package/dist/tools/safe-bash/index.d.ts.map +1 -0
- package/dist/tools/safe-bash/index.js +128 -0
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +12 -5
- package/dist/tools/utils/validate-schema.d.ts.map +1 -1
- package/dist/tools/utils/validate-schema.js +9 -4
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +3 -8
- package/dist/utils/slug.d.ts +0 -1
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +1 -15
- package/package.json +6 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.preparePatchCodegen = preparePatchCodegen;
|
|
7
7
|
exports.getPathToRecorderApp = getPathToRecorderApp;
|
|
8
8
|
exports.runNpmList = runNpmList;
|
|
9
|
+
exports.getPlaywrightCorePath = getPlaywrightCorePath;
|
|
9
10
|
exports.getPlaywrightCoreFromNpmList = getPlaywrightCoreFromNpmList;
|
|
10
11
|
exports.hasPatchedRecorderApp = hasPatchedRecorderApp;
|
|
11
12
|
exports.revertToOriginalPwCode = revertToOriginalPwCode;
|
|
12
13
|
exports.createFileBackup = createFileBackup;
|
|
13
|
-
exports.patchPwCode = patchPwCode;
|
|
14
14
|
const child_process_1 = require("child_process");
|
|
15
15
|
const fs_1 = __importDefault(require("fs"));
|
|
16
16
|
const path_1 = __importDefault(require("path"));
|
|
@@ -27,7 +27,11 @@ const ipc_1 = require("./ipc");
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
const CUSTOM_PATCH_COMMENT = `// Custom patch code set by @empiricalrun/test-gen`;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Prepares Playwright 1.47/1.53 for patch-based codegen by patching
|
|
32
|
+
* setSources() to POST generated code to a local HTTP server.
|
|
33
|
+
*/
|
|
34
|
+
async function preparePatchCodegen(repoDir) {
|
|
31
35
|
try {
|
|
32
36
|
const npmListOutput = await runNpmList(repoDir);
|
|
33
37
|
if (!npmListOutput) {
|
|
@@ -68,10 +72,12 @@ async function runNpmList(repoDir) {
|
|
|
68
72
|
logger_1.logger.error(`npm ls failed with error: ${error.message} and status: ${error.status}`);
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Gets the path to playwright-core from npm list output.
|
|
77
|
+
* This is used by event-sink codegen which doesn't need version validation.
|
|
78
|
+
*/
|
|
79
|
+
function getPlaywrightCorePath(output) {
|
|
72
80
|
const result = JSON.parse(output);
|
|
73
|
-
// We expect to find playwright-core as a dependency of playwright, which is
|
|
74
|
-
// a dependency of @playwright/test
|
|
75
81
|
const { dependencies } = result;
|
|
76
82
|
const playwrightTest = dependencies["@playwright/test"];
|
|
77
83
|
if (!playwrightTest) {
|
|
@@ -82,6 +88,17 @@ function getPlaywrightCoreFromNpmList(output) {
|
|
|
82
88
|
if (!playwrightCoreDep) {
|
|
83
89
|
throw new Error("Could not find playwright-core in @playwright/test dependencies");
|
|
84
90
|
}
|
|
91
|
+
return playwrightCoreDep.path;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Gets the path and version for patch-based codegen (1.47/1.53 only).
|
|
95
|
+
*/
|
|
96
|
+
function getPlaywrightCoreFromNpmList(output) {
|
|
97
|
+
const corePath = getPlaywrightCorePath(output);
|
|
98
|
+
const result = JSON.parse(output);
|
|
99
|
+
const playwrightTest = result.dependencies["@playwright/test"];
|
|
100
|
+
const playwrightDeps = playwrightTest.dependencies["playwright"];
|
|
101
|
+
const playwrightCoreDep = playwrightDeps.dependencies["playwright-core"];
|
|
85
102
|
function extractMinorVersion(version) {
|
|
86
103
|
const minorVersion = version.split(".").slice(0, 2).join(".");
|
|
87
104
|
if (minorVersion === "1.47") {
|
|
@@ -91,11 +108,11 @@ function getPlaywrightCoreFromNpmList(output) {
|
|
|
91
108
|
return "1.53";
|
|
92
109
|
}
|
|
93
110
|
else {
|
|
94
|
-
throw new Error(`Unsupported Playwright version: ${minorVersion}`);
|
|
111
|
+
throw new Error(`Unsupported Playwright version for patch codegen: ${minorVersion}`);
|
|
95
112
|
}
|
|
96
113
|
}
|
|
97
114
|
return {
|
|
98
|
-
path:
|
|
115
|
+
path: corePath,
|
|
99
116
|
version: extractMinorVersion(playwrightCoreDep.version),
|
|
100
117
|
};
|
|
101
118
|
}
|
|
@@ -125,9 +142,12 @@ async function revertToOriginalPwCode(repoDir) {
|
|
|
125
142
|
if (!npmListOutput) {
|
|
126
143
|
return;
|
|
127
144
|
}
|
|
128
|
-
const
|
|
145
|
+
const pwCorePath = getPlaywrightCorePath(npmListOutput);
|
|
129
146
|
const pathToRecorderApp = path_1.default.join(pwCorePath, "lib", "server", "recorder", "recorderApp.js");
|
|
130
147
|
const backupPath = `${pathToRecorderApp}.backup`;
|
|
148
|
+
if (!fs_1.default.existsSync(backupPath)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
131
151
|
fs_1.default.copyFileSync(backupPath, pathToRecorderApp);
|
|
132
152
|
fs_1.default.unlinkSync(backupPath);
|
|
133
153
|
}
|
|
@@ -139,8 +159,16 @@ async function createFileBackup(pathToFile) {
|
|
|
139
159
|
const backupPath = `${pathToFile}.backup`;
|
|
140
160
|
fs_1.default.copyFileSync(pathToFile, backupPath);
|
|
141
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Patches setSources() for 1.47/1.53 to POST generated code to a local HTTP server.
|
|
164
|
+
*/
|
|
142
165
|
async function patchPwCode(pwVersion, pathToRecorderApp, port) {
|
|
143
166
|
const currentFileContents = fs_1.default.readFileSync(pathToRecorderApp, "utf-8");
|
|
167
|
+
// Check if already patched
|
|
168
|
+
if (currentFileContents.includes(CUSTOM_PATCH_COMMENT)) {
|
|
169
|
+
logger_1.logger.debug("Playwright recorder app already patched");
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
144
172
|
let original;
|
|
145
173
|
if (pwVersion === "1.47") {
|
|
146
174
|
original = `async setSources(sources) {}`;
|
|
@@ -149,7 +177,7 @@ async function patchPwCode(pwVersion, pathToRecorderApp, port) {
|
|
|
149
177
|
original = `async setSources(sources, primaryPageURL) {\n }`;
|
|
150
178
|
}
|
|
151
179
|
else {
|
|
152
|
-
throw new Error(`Unsupported Playwright version: ${pwVersion}`);
|
|
180
|
+
throw new Error(`Unsupported Playwright version for patch codegen: ${pwVersion}`);
|
|
153
181
|
}
|
|
154
182
|
const replacement = `async setSources(sources) {
|
|
155
183
|
${CUSTOM_PATCH_COMMENT}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playwright version detection utilities
|
|
3
|
+
*
|
|
4
|
+
* Supported codegen approaches by version:
|
|
5
|
+
* - 1.47.x, 1.53.x: Patch-based (patches recorderApp.js)
|
|
6
|
+
* - 1.57.0+: EventSink-based (uses _enableRecorder API)
|
|
7
|
+
*/
|
|
8
|
+
export type PlaywrightVersion = {
|
|
9
|
+
full: string;
|
|
10
|
+
major: number;
|
|
11
|
+
minor: number;
|
|
12
|
+
patch: number;
|
|
13
|
+
path: string;
|
|
14
|
+
};
|
|
15
|
+
export type CodegenApproach = "patch" | "event-sink" | "unsupported";
|
|
16
|
+
export declare function parseVersion(versionString: string): {
|
|
17
|
+
major: number;
|
|
18
|
+
minor: number;
|
|
19
|
+
patch: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function getCodegenApproach(version: PlaywrightVersion): CodegenApproach;
|
|
22
|
+
export declare function runNpmList(repoDir: string): Promise<string | undefined>;
|
|
23
|
+
export declare function getPlaywrightVersionFromNpmList(output: string): PlaywrightVersion;
|
|
24
|
+
export declare function detectPlaywrightVersion(repoDir: string): Promise<PlaywrightVersion | undefined>;
|
|
25
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../src/agent/cua/pw-codegen/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,YAAY,GAAG,aAAa,CAAC;AAErE,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAOA;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,GACzB,eAAe,CAWjB;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAiB7E;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,GACb,iBAAiB,CA+BnB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAYxC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseVersion = parseVersion;
|
|
4
|
+
exports.getCodegenApproach = getCodegenApproach;
|
|
5
|
+
exports.runNpmList = runNpmList;
|
|
6
|
+
exports.getPlaywrightVersionFromNpmList = getPlaywrightVersionFromNpmList;
|
|
7
|
+
exports.detectPlaywrightVersion = detectPlaywrightVersion;
|
|
8
|
+
/**
|
|
9
|
+
* Playwright version detection utilities
|
|
10
|
+
*
|
|
11
|
+
* Supported codegen approaches by version:
|
|
12
|
+
* - 1.47.x, 1.53.x: Patch-based (patches recorderApp.js)
|
|
13
|
+
* - 1.57.0+: EventSink-based (uses _enableRecorder API)
|
|
14
|
+
*/
|
|
15
|
+
const child_process_1 = require("child_process");
|
|
16
|
+
const logger_1 = require("../../../logger");
|
|
17
|
+
function parseVersion(versionString) {
|
|
18
|
+
const parts = versionString.split(".");
|
|
19
|
+
return {
|
|
20
|
+
major: parseInt(parts[0] || "0", 10),
|
|
21
|
+
minor: parseInt(parts[1] || "0", 10),
|
|
22
|
+
patch: parseInt(parts[2] || "0", 10),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function getCodegenApproach(version) {
|
|
26
|
+
const { major, minor } = version;
|
|
27
|
+
if (major >= 1 && minor >= 57) {
|
|
28
|
+
// 1.57.0+ supports RecorderEventSink
|
|
29
|
+
return "event-sink";
|
|
30
|
+
}
|
|
31
|
+
if (major === 1 && (minor === 47 || minor === 53)) {
|
|
32
|
+
// 1.47.x and 1.53.x support patch-based approach
|
|
33
|
+
return "patch";
|
|
34
|
+
}
|
|
35
|
+
return "unsupported";
|
|
36
|
+
}
|
|
37
|
+
async function runNpmList(repoDir) {
|
|
38
|
+
try {
|
|
39
|
+
const output = (0, child_process_1.execSync)("npm ls playwright-core --json --long --production=false", {
|
|
40
|
+
cwd: repoDir,
|
|
41
|
+
encoding: "utf-8",
|
|
42
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
43
|
+
});
|
|
44
|
+
return output;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
logger_1.logger.error(`npm ls failed with error: ${error.message} and status: ${error.status}`);
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function getPlaywrightVersionFromNpmList(output) {
|
|
52
|
+
const result = JSON.parse(output);
|
|
53
|
+
const { dependencies } = result;
|
|
54
|
+
const playwrightTest = dependencies["@playwright/test"];
|
|
55
|
+
if (!playwrightTest) {
|
|
56
|
+
throw new Error("Could not find @playwright/test in npm dependencies");
|
|
57
|
+
}
|
|
58
|
+
const playwrightDeps = playwrightTest.dependencies["playwright"];
|
|
59
|
+
if (!playwrightDeps) {
|
|
60
|
+
throw new Error("Could not find playwright in @playwright/test dependencies");
|
|
61
|
+
}
|
|
62
|
+
const playwrightCoreDep = playwrightDeps.dependencies["playwright-core"];
|
|
63
|
+
if (!playwrightCoreDep) {
|
|
64
|
+
throw new Error("Could not find playwright-core in playwright dependencies");
|
|
65
|
+
}
|
|
66
|
+
const versionString = playwrightCoreDep.version;
|
|
67
|
+
const parsed = parseVersion(versionString);
|
|
68
|
+
return {
|
|
69
|
+
full: versionString,
|
|
70
|
+
...parsed,
|
|
71
|
+
path: playwrightCoreDep.path,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
async function detectPlaywrightVersion(repoDir) {
|
|
75
|
+
const npmListOutput = await runNpmList(repoDir);
|
|
76
|
+
if (!npmListOutput) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
return getPlaywrightVersionFromNpmList(npmListOutput);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
logger_1.logger.error(`Failed to parse Playwright version: ${error}`);
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAepE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,QAAQ,IAAI,WAAW;cA0BjB,iBAAiB,CAC/B,eAAe,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC;CAgEnB"}
|
|
@@ -8,6 +8,7 @@ const diagnosis_fetcher_1 = require("../../tools/diagnosis-fetcher");
|
|
|
8
8
|
const fetch_file_1 = require("../../tools/fetch-file");
|
|
9
9
|
const list_issues_1 = require("../../tools/issues-v1/list-issues");
|
|
10
10
|
const create_issue_1 = require("../../tools/issues-v2/create-issue");
|
|
11
|
+
const set_issue_description_1 = require("../../tools/issues-v2/set-issue-description");
|
|
11
12
|
const update_issue_1 = require("../../tools/issues-v2/update-issue");
|
|
12
13
|
const list_environments_1 = require("../../tools/list-environments");
|
|
13
14
|
const test_run_fetcher_1 = require("../../tools/test-run-fetcher");
|
|
@@ -33,6 +34,7 @@ class TriageAgent extends base_1.BaseAgent {
|
|
|
33
34
|
// Tools to manage issues
|
|
34
35
|
list_issues_1.listIssuesTool,
|
|
35
36
|
create_issue_1.createIssueTool,
|
|
37
|
+
set_issue_description_1.setIssueDescriptionTool,
|
|
36
38
|
update_issue_1.updateIssueTool,
|
|
37
39
|
triage_summary_1.sendTriageSummaryTool,
|
|
38
40
|
];
|
|
@@ -17,6 +17,11 @@ export declare class DashboardAPIClient implements IDashboardAPIClient {
|
|
|
17
17
|
url: string;
|
|
18
18
|
body?: any;
|
|
19
19
|
}): Promise<T>;
|
|
20
|
+
callMailosaurProxy<T>({ method, path, body, }: {
|
|
21
|
+
method: "GET" | "POST" | "PATCH" | "PUT" | "DELETE";
|
|
22
|
+
path: string;
|
|
23
|
+
body?: any;
|
|
24
|
+
}): Promise<T>;
|
|
20
25
|
getBaseUrl(): string;
|
|
21
26
|
ensureUserIsAuthenticated(): Promise<void>;
|
|
22
27
|
private _makeRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/dashboard/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,EACf,MAAM,qCAAqC,CAAC;AAa7C,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,iBAAiB,GACjB,YAAY,CAAC;AAEjB,qBAAa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAS;gBAEf,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,GACR,EAAE;QACD,QAAQ,EAAE,kBAAkB,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAsBK,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/dashboard/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,cAAc,EACf,MAAM,qCAAqC,CAAC;AAa7C,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,iBAAiB,GACjB,YAAY,CAAC;AAEjB,qBAAa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAC,CAAS;gBAEf,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,OAAO,GACR,EAAE;QACD,QAAQ,EAAE,kBAAkB,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAsBK,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC;IA+CjE,eAAe,CAAC,CAAC,EAAE,EACvB,MAAM,EACN,GAAG,EACH,IAAI,GACL,EAAE;QACD,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;QACpD,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,GAAG,OAAO,CAAC,CAAC,CAAC;IAYR,kBAAkB,CAAC,CAAC,EAAE,EAC1B,MAAM,EACN,IAAI,EACJ,IAAI,GACL,EAAE;QACD,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;QACpD,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,GAAG,OAAO,CAAC,CAAC,CAAC;IAYd,UAAU,IAAI,MAAM;IAId,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC;YAelC,YAAY;YAoDZ,gBAAgB;CAyC/B;AAED,eAAO,MAAM,SAAS,oBAEpB,CAAC"}
|
package/dist/dashboard/client.js
CHANGED
|
@@ -34,17 +34,15 @@ class DashboardAPIClient {
|
|
|
34
34
|
async request(endpoint, options) {
|
|
35
35
|
let response;
|
|
36
36
|
if (this.secretKey) {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
"X-Empirical-Auth-TOTP":
|
|
40
|
-
};
|
|
41
|
-
response = await this._makeRequest(endpoint, options, authHeader);
|
|
37
|
+
const secretKey = this.secretKey;
|
|
38
|
+
response = await this._makeRequest(endpoint, options, async () => ({
|
|
39
|
+
"X-Empirical-Auth-TOTP": await (0, totp_1.getTOTP)(secretKey),
|
|
40
|
+
}));
|
|
42
41
|
}
|
|
43
42
|
else if (this.projectApiKey) {
|
|
44
|
-
|
|
43
|
+
response = await this._makeRequest(endpoint, options, async () => ({
|
|
45
44
|
Authorization: `Bearer ${this.projectApiKey}`,
|
|
46
|
-
};
|
|
47
|
-
response = await this._makeRequest(endpoint, options, authHeader);
|
|
45
|
+
}));
|
|
48
46
|
}
|
|
49
47
|
else {
|
|
50
48
|
await this.ensureUserIsAuthenticated();
|
|
@@ -52,20 +50,18 @@ class DashboardAPIClient {
|
|
|
52
50
|
if (!tokens) {
|
|
53
51
|
throw new Error("Not authenticated. Please run the login command first.");
|
|
54
52
|
}
|
|
55
|
-
|
|
53
|
+
response = await this._makeRequest(endpoint, options, async () => ({
|
|
56
54
|
Authorization: `Bearer ${tokens.access_token}`,
|
|
57
|
-
};
|
|
58
|
-
response = await this._makeRequest(endpoint, options, authHeader);
|
|
55
|
+
}));
|
|
59
56
|
if (response && response.status === 401) {
|
|
60
57
|
logger_1.logger.debug("Access token expired, attempting to refresh...");
|
|
61
58
|
const refreshed = await this.refreshUserToken();
|
|
62
59
|
if (refreshed) {
|
|
63
60
|
const newTokens = await (0, token_store_1.getStoredUserTokens)();
|
|
64
61
|
if (newTokens) {
|
|
65
|
-
|
|
62
|
+
response = this._makeRequest(endpoint, options, async () => ({
|
|
66
63
|
Authorization: `Bearer ${newTokens.access_token}`,
|
|
67
|
-
};
|
|
68
|
-
response = this._makeRequest(endpoint, options, authHeader);
|
|
64
|
+
}));
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
67
|
throw new Error("Authentication failed. Please run the login command again.");
|
|
@@ -87,6 +83,17 @@ class DashboardAPIClient {
|
|
|
87
83
|
body: requestBody,
|
|
88
84
|
});
|
|
89
85
|
}
|
|
86
|
+
async callMailosaurProxy({ method, path, body, }) {
|
|
87
|
+
const requestBody = {
|
|
88
|
+
method,
|
|
89
|
+
path,
|
|
90
|
+
body,
|
|
91
|
+
};
|
|
92
|
+
return await this.request(`/api/mailosaur/proxy`, {
|
|
93
|
+
method: "POST",
|
|
94
|
+
body: requestBody,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
90
97
|
getBaseUrl() {
|
|
91
98
|
return this.baseUrl;
|
|
92
99
|
}
|
|
@@ -102,7 +109,7 @@ class DashboardAPIClient {
|
|
|
102
109
|
}
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
|
-
async _makeRequest(endpoint, options,
|
|
112
|
+
async _makeRequest(endpoint, options, getAuthHeader) {
|
|
106
113
|
const method = options.method || "GET";
|
|
107
114
|
const url = new URL(endpoint, this.baseUrl);
|
|
108
115
|
if (options.params) {
|
|
@@ -110,12 +117,13 @@ class DashboardAPIClient {
|
|
|
110
117
|
url.searchParams.append(key, value);
|
|
111
118
|
});
|
|
112
119
|
}
|
|
113
|
-
const headers = {
|
|
114
|
-
...authHeader,
|
|
115
|
-
"Content-Type": "application/json",
|
|
116
|
-
"User-Agent": "@empiricalrun/test-gen",
|
|
117
|
-
};
|
|
118
120
|
return await (0, async_retry_1.default)(async (bail) => {
|
|
121
|
+
const authHeader = await getAuthHeader();
|
|
122
|
+
const headers = {
|
|
123
|
+
...authHeader,
|
|
124
|
+
"Content-Type": "application/json",
|
|
125
|
+
"User-Agent": "@empiricalrun/test-gen",
|
|
126
|
+
};
|
|
119
127
|
const response = await fetch(url, {
|
|
120
128
|
headers,
|
|
121
129
|
method: method,
|
|
@@ -125,7 +133,6 @@ class DashboardAPIClient {
|
|
|
125
133
|
let error;
|
|
126
134
|
const msg = `HTTP error in ${method} request to ${url}! Status code: ${response.status}. Response: ${await response.text()}`;
|
|
127
135
|
if (response.status < 500) {
|
|
128
|
-
// Don't retry for status codes less than 500 (client errors)
|
|
129
136
|
error = new types_1.NonRetryableHTTPError(msg, response.status);
|
|
130
137
|
bail(error);
|
|
131
138
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recorder/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/recorder/index.ts"],"names":[],"mappings":"AAwEA,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AA4TD,wBAAsB,WAAW,CAAC,EAChC,QAAQ,EACR,OAAO,EACP,GAAG,GACJ,EAAE,kBAAkB,iBAGpB"}
|
package/dist/recorder/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
11
11
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
13
|
const utils_1 = require("../agent/browsing/utils");
|
|
14
|
+
const pw_codegen_1 = require("../agent/cua/pw-codegen");
|
|
14
15
|
const pw_pause_1 = require("../agent/cua/pw-codegen/pw-pause");
|
|
15
16
|
const client_1 = require("../dashboard/client");
|
|
16
17
|
const server_1 = require("../file/server");
|
|
@@ -193,8 +194,12 @@ async function executeRecording(data, isFromUrl) {
|
|
|
193
194
|
process.exit(0);
|
|
194
195
|
});
|
|
195
196
|
try {
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
const version = await (0, pw_codegen_1.detectPlaywrightVersion)(data.repoDir);
|
|
198
|
+
if (version) {
|
|
199
|
+
const approach = (0, pw_codegen_1.getCodegenApproach)(version);
|
|
200
|
+
logger_1.logger.debug("[generateTestWithBrowserAgent] Preparing playwright for codegen", { version: version.full, approach });
|
|
201
|
+
await (0, pw_codegen_1.prepareCodegenIfNeeded)(data.repoDir, approach);
|
|
202
|
+
}
|
|
198
203
|
}
|
|
199
204
|
catch (err) {
|
|
200
205
|
logger_1.logger.warn("[generateTestWithBrowserAgent] Error preparing playwright for codegen", err);
|
|
@@ -8,7 +8,7 @@ export interface ValidatedInputs {
|
|
|
8
8
|
export declare function validateInputs({ input, apiClient, chatSession, }: any): Promise<ValidatedInputs>;
|
|
9
9
|
export declare function getRepoName(chatSession: ChatSessionInfo | null | undefined, apiClient: IDashboardAPIClient): Promise<string>;
|
|
10
10
|
export declare function getMergeableStateInfo(owner: string, repo: string, pullRequest: any, apiClient: any): Promise<{
|
|
11
|
-
mergeableState: "unknown" | "
|
|
11
|
+
mergeableState: "unknown" | "clean" | "dirty" | "unstable";
|
|
12
12
|
stateDescription: string;
|
|
13
13
|
}>;
|
|
14
14
|
export declare function handleExistingPullRequest(pullRequest: any, owner: string, repo: string, pullRequestDescription: string, chatSession: any, apiClient: any): Promise<{
|
|
@@ -6,29 +6,7 @@ export declare const analyseVideoSchema: z.ZodObject<{
|
|
|
6
6
|
startTime: z.ZodOptional<z.ZodString>;
|
|
7
7
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
model: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
startTime?: string | undefined;
|
|
12
|
-
duration?: number | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
model?: string | undefined;
|
|
15
|
-
startTime?: string | undefined;
|
|
16
|
-
duration?: number | undefined;
|
|
17
|
-
}>>;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
url: string;
|
|
20
|
-
params?: {
|
|
21
|
-
model?: string | undefined;
|
|
22
|
-
startTime?: string | undefined;
|
|
23
|
-
duration?: number | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
url: string;
|
|
27
|
-
params?: {
|
|
28
|
-
model?: string | undefined;
|
|
29
|
-
startTime?: string | undefined;
|
|
30
|
-
duration?: number | undefined;
|
|
31
|
-
} | undefined;
|
|
32
|
-
}>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
33
11
|
export declare const analyseVideo: ToolDefinition<z.infer<typeof analyseVideoSchema>>;
|
|
34
12
|
//# sourceMappingURL=analyse-video.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyse-video.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/analyse-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"analyse-video.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/analyse-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,kBAAkB;;;;;;;iBAqB7B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAoBzE,CAAC"}
|
|
@@ -2,10 +2,6 @@ import type { ToolDefinition } from "@empiricalrun/shared-types/chat-agent";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const DeleteFileInputSchema: z.ZodObject<{
|
|
4
4
|
path: z.ZodString;
|
|
5
|
-
},
|
|
6
|
-
path: string;
|
|
7
|
-
}, {
|
|
8
|
-
path: string;
|
|
9
|
-
}>;
|
|
5
|
+
}, z.core.$strip>;
|
|
10
6
|
export declare const deleteFileTool: ToolDefinition;
|
|
11
7
|
//# sourceMappingURL=delete-file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/delete-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/delete-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qBAAqB;;iBAMhC,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,cAU5B,CAAC"}
|
|
@@ -2,11 +2,7 @@ import type { ToolDefinition } from "@empiricalrun/shared-types/chat-agent";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const downloadBuildToolSchema: z.ZodObject<{
|
|
4
4
|
buildUrl: z.ZodString;
|
|
5
|
-
},
|
|
6
|
-
buildUrl: string;
|
|
7
|
-
}, {
|
|
8
|
-
buildUrl: string;
|
|
9
|
-
}>;
|
|
5
|
+
}, z.core.$strip>;
|
|
10
6
|
export type DownloadBuildToolInput = z.infer<typeof downloadBuildToolSchema>;
|
|
11
7
|
export declare const downloadBuildTool: ToolDefinition;
|
|
12
8
|
//# sourceMappingURL=download-build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download-build.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/download-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"download-build.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/download-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,eAAO,MAAM,iBAAiB,EAAE,cAU/B,CAAC"}
|
|
@@ -2,11 +2,7 @@ import { ToolDefinition } from "@empiricalrun/shared-types/chat-agent";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const ListTestsForProjectSchema: z.ZodObject<{
|
|
4
4
|
project: z.ZodString;
|
|
5
|
-
},
|
|
6
|
-
project: string;
|
|
7
|
-
}, {
|
|
8
|
-
project: string;
|
|
9
|
-
}>;
|
|
5
|
+
}, z.core.$strip>;
|
|
10
6
|
export declare const listProjectsTool: ToolDefinition;
|
|
11
7
|
export declare const listTestsForProjectTool: ToolDefinition;
|
|
12
8
|
//# sourceMappingURL=list-tests-and-projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-tests-and-projects.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/list-tests-and-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"list-tests-and-projects.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/list-tests-and-projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;;iBAEpC,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,cAS9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cASrC,CAAC"}
|
|
@@ -4,20 +4,8 @@ export declare const RunTestSchema: z.ZodObject<{
|
|
|
4
4
|
project: z.ZodString;
|
|
5
5
|
buildUrl: z.ZodOptional<z.ZodString>;
|
|
6
6
|
testName: z.ZodString;
|
|
7
|
-
suites: z.ZodArray<z.ZodString
|
|
7
|
+
suites: z.ZodArray<z.ZodString>;
|
|
8
8
|
filePath: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
suites: string[];
|
|
11
|
-
testName: string;
|
|
12
|
-
filePath: string;
|
|
13
|
-
project: string;
|
|
14
|
-
buildUrl?: string | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
suites: string[];
|
|
17
|
-
testName: string;
|
|
18
|
-
filePath: string;
|
|
19
|
-
project: string;
|
|
20
|
-
buildUrl?: string | undefined;
|
|
21
|
-
}>;
|
|
9
|
+
}, z.core.$strip>;
|
|
22
10
|
export declare const runTestTool: ToolDefinition;
|
|
23
11
|
//# sourceMappingURL=run-test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa;;;;;;iBAWxB,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,cAQzB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@empiricalrun/shared-types/chat-agent";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const SafeBashInputSchema: z.ZodObject<{
|
|
4
|
+
script: z.ZodString;
|
|
5
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const safeBashTool: ToolDefinition;
|
|
8
|
+
//# sourceMappingURL=safe-bash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-bash.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/safe-bash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;iBAM9B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,cAoB1B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeBashTool = exports.SafeBashInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.SafeBashInputSchema = zod_1.z.object({
|
|
6
|
+
script: zod_1.z.string().describe("The bash script to execute"),
|
|
7
|
+
timeout: zod_1.z
|
|
8
|
+
.number()
|
|
9
|
+
.optional()
|
|
10
|
+
.describe("Timeout in milliseconds (default: 60000)"),
|
|
11
|
+
});
|
|
12
|
+
exports.safeBashTool = {
|
|
13
|
+
schema: {
|
|
14
|
+
name: "safeBash",
|
|
15
|
+
description: `Execute a bash script with branch protection and controlled git operations.
|
|
16
|
+
|
|
17
|
+
This tool ensures safe execution by:
|
|
18
|
+
- Blocking branch-changing commands (git checkout, git switch, git reset --hard)
|
|
19
|
+
- Blocking git commit and git push commands (handled by the executor harness)
|
|
20
|
+
- Verifying the branch hasn't changed after execution
|
|
21
|
+
|
|
22
|
+
If the script modifies files that need to be pushed to the repo, the script MUST stage them using 'git add'.
|
|
23
|
+
The executor harness will automatically commit staged files and push to the remote.
|
|
24
|
+
|
|
25
|
+
For example, if you use this tool to upgrade NPM packages, you should stage package.json and package-lock.json files.
|
|
26
|
+
|
|
27
|
+
The tool returns stdout, stderr, staged files (will be committed), and unstaged files.`,
|
|
28
|
+
parameters: exports.SafeBashInputSchema,
|
|
29
|
+
},
|
|
30
|
+
needsBrowser: false,
|
|
31
|
+
isInlineTool: false,
|
|
32
|
+
};
|
|
@@ -4,20 +4,8 @@ export declare const BrowserAgentSchema: z.ZodObject<{
|
|
|
4
4
|
project: z.ZodString;
|
|
5
5
|
buildUrl: z.ZodOptional<z.ZodString>;
|
|
6
6
|
testName: z.ZodString;
|
|
7
|
-
suites: z.ZodArray<z.ZodString
|
|
7
|
+
suites: z.ZodArray<z.ZodString>;
|
|
8
8
|
filePath: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
suites: string[];
|
|
11
|
-
testName: string;
|
|
12
|
-
filePath: string;
|
|
13
|
-
project: string;
|
|
14
|
-
buildUrl?: string | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
suites: string[];
|
|
17
|
-
testName: string;
|
|
18
|
-
filePath: string;
|
|
19
|
-
project: string;
|
|
20
|
-
buildUrl?: string | undefined;
|
|
21
|
-
}>;
|
|
9
|
+
}, z.core.$strip>;
|
|
22
10
|
export declare const generateTestWithBrowserAgent: ToolDefinition;
|
|
23
11
|
//# sourceMappingURL=test-gen-browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,kBAAkB;;;;;;iBAe7B,CAAC;AAsFH,eAAO,MAAM,4BAA4B,EAAE,cAQ1C,CAAC"}
|