@empiricalrun/test-gen 0.64.3 → 0.66.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/CHANGELOG.md +49 -0
- package/dist/agent/browsing/run.d.ts +6 -4
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/browsing/run.js +10 -9
- package/dist/agent/chat/agent-loop.d.ts +2 -1
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/exports.d.ts +2 -2
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/index.d.ts +2 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +23 -5
- package/dist/agent/chat/models.d.ts +1 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/state.d.ts +2 -2
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/utils.d.ts +2 -1
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/cua/computer.js +1 -1
- package/dist/agent/cua/index.d.ts +10 -3
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +71 -34
- package/dist/agent/cua/model.d.ts +7 -0
- package/dist/agent/cua/model.d.ts.map +1 -1
- package/dist/agent/cua/model.js +10 -0
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +7 -5
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +57 -29
- package/dist/agent/cua/pw-codegen/pw-pause/ipc.d.ts +3 -0
- package/dist/agent/cua/pw-codegen/pw-pause/ipc.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-pause/ipc.js +13 -0
- package/dist/agent/cua/pw-codegen/pw-pause/{utils.d.ts → patch.d.ts} +4 -11
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-pause/{utils.js → patch.js} +49 -3
- package/dist/bin/index.js +3 -5
- package/dist/bin/utils/index.d.ts +1 -2
- package/dist/bin/utils/index.d.ts.map +1 -1
- package/dist/bin/utils/index.js +5 -3
- package/dist/file/client.d.ts +2 -8
- package/dist/file/client.d.ts.map +1 -1
- package/dist/file/client.js +2 -23
- package/dist/file/server.d.ts +15 -3
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +17 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -13
- package/dist/tool-call-service/index.d.ts +3 -3
- package/dist/tool-call-service/index.d.ts.map +1 -1
- package/dist/tool-call-service/index.js +6 -3
- package/dist/tool-call-service/utils.d.ts +4 -10
- package/dist/tool-call-service/utils.d.ts.map +1 -1
- package/dist/tool-call-service/utils.js +28 -5
- package/dist/tools/commit-and-create-pr.d.ts +0 -6
- package/dist/tools/commit-and-create-pr.d.ts.map +1 -1
- package/dist/tools/commit-and-create-pr.js +21 -40
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +1 -0
- package/dist/tools/download-build.d.ts.map +1 -1
- package/dist/tools/download-build.js +1 -0
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +1 -0
- package/dist/tools/list-environments.d.ts +3 -0
- package/dist/tools/list-environments.d.ts.map +1 -0
- package/dist/tools/list-environments.js +49 -0
- package/dist/tools/str_replace_editor.d.ts +3 -2
- package/dist/tools/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/str_replace_editor.js +48 -7
- package/dist/tools/test-gen-browser.d.ts +1 -1
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +58 -12
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +1 -0
- package/dist/tools/test-run.d.ts.map +1 -1
- package/dist/tools/test-run.js +1 -0
- package/dist/tools/upgrade-packages/index.d.ts +3 -0
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -0
- package/dist/tools/upgrade-packages/index.js +124 -0
- package/dist/tools/upgrade-packages/utils.d.ts +13 -0
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -0
- package/dist/tools/upgrade-packages/utils.js +106 -0
- package/dist/tools/utils/index.d.ts +50 -2
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +87 -0
- package/dist/utils/git.d.ts +12 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +66 -1
- package/package.json +4 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/utils.d.ts.map +0 -1
- package/dist/tools/environment-crud.d.ts +0 -4
- package/dist/tools/environment-crud.d.ts.map +0 -1
- package/dist/tools/environment-crud.js +0 -100
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.upgradePackagesTool = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const git_1 = require("../../utils/git");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
12
|
+
const utils_2 = require("./utils");
|
|
13
|
+
const pkgs = [
|
|
14
|
+
"@empiricalrun/playwright-utils",
|
|
15
|
+
"@empiricalrun/eslint-config",
|
|
16
|
+
"@empiricalrun/typescript-config",
|
|
17
|
+
];
|
|
18
|
+
const packageSpecSchema = zod_1.z.union([
|
|
19
|
+
zod_1.z.string(),
|
|
20
|
+
zod_1.z.object({
|
|
21
|
+
name: zod_1.z.string(),
|
|
22
|
+
version: zod_1.z.string().optional(),
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
25
|
+
const upgradePackagesSchema = zod_1.z.object({
|
|
26
|
+
packages: zod_1.z.array(packageSpecSchema),
|
|
27
|
+
});
|
|
28
|
+
exports.upgradePackagesTool = {
|
|
29
|
+
schema: {
|
|
30
|
+
name: "upgradePackages",
|
|
31
|
+
description: `Automatically upgrades specific packages. You can optionally specify a version for each package. If a version is not provided, the package will be upgraded to the latest version. The tool handles the entire workflow: updating package files, committing changes, creating/updating PRs, and managing merges. For patch updates (e.g., 1.0.1 → 1.0.2), it automatically merges the PR and cleans up. For minor/major updates, it leaves the PR open for review. Returns a success message with the PR URL and merge status.`,
|
|
32
|
+
parameters: upgradePackagesSchema,
|
|
33
|
+
},
|
|
34
|
+
needsBrowser: false,
|
|
35
|
+
execute: async ({ input, repoPath, apiKey, }) => {
|
|
36
|
+
const { packages } = input;
|
|
37
|
+
let packagesToUpdate = packages.length ? packages : pkgs;
|
|
38
|
+
const packageSpecs = packagesToUpdate.map((p) => typeof p === "string" ? { name: p, version: undefined } : p);
|
|
39
|
+
try {
|
|
40
|
+
const repoName = path_1.default.basename(repoPath);
|
|
41
|
+
const branchName = await (0, git_1.getCurrentBranchName)(repoPath);
|
|
42
|
+
const packageJsonPath = path_1.default.join(repoPath, "package.json");
|
|
43
|
+
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, "utf-8"));
|
|
44
|
+
for (let { name: pkgName, version } of packageSpecs) {
|
|
45
|
+
const isDevDep = !!packageJson.devDependencies?.[pkgName];
|
|
46
|
+
try {
|
|
47
|
+
await (0, utils_2.upgradeAndStagePackage)({
|
|
48
|
+
repoPath,
|
|
49
|
+
pkgName,
|
|
50
|
+
version,
|
|
51
|
+
isDevDep,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.error(`Failed to upgrade ${pkgName}:`, err);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
await (0, git_1.commitFilesAndPushBranch)({
|
|
59
|
+
commitMessage: "[create-pull-request] automated change [skip ci]",
|
|
60
|
+
branchName,
|
|
61
|
+
files: ["package.json", "package-lock.json"],
|
|
62
|
+
repoPath,
|
|
63
|
+
});
|
|
64
|
+
await new Promise((resolve) => setTimeout(resolve, 5_000));
|
|
65
|
+
let shouldMerge = false;
|
|
66
|
+
let prNumber = null;
|
|
67
|
+
let merged = false;
|
|
68
|
+
try {
|
|
69
|
+
const { pr } = await (0, utils_1.findOrCreatePullRequest)({
|
|
70
|
+
owner: "empirical-run",
|
|
71
|
+
repo: repoName,
|
|
72
|
+
apiKey,
|
|
73
|
+
branchName,
|
|
74
|
+
title: "Upgrade packages",
|
|
75
|
+
body: "Upgrade packages to specified versions",
|
|
76
|
+
labels: ["automated"],
|
|
77
|
+
});
|
|
78
|
+
prNumber = pr.number;
|
|
79
|
+
if (!pr.number) {
|
|
80
|
+
throw new Error("Failed to create PR");
|
|
81
|
+
}
|
|
82
|
+
shouldMerge = await (0, utils_2.shouldMergePR)({ repoName, prNumber, apiKey });
|
|
83
|
+
if (shouldMerge) {
|
|
84
|
+
console.log("All changes are patch updates, proceeding with merge");
|
|
85
|
+
merged = await (0, git_1.mergePullRequest)({
|
|
86
|
+
repoName,
|
|
87
|
+
prNumber,
|
|
88
|
+
apiKey,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
console.log(`PR #${prNumber} created but not merged - contains non-patch updates`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error("Failed to handle PR operations:", error);
|
|
97
|
+
const prLink = prNumber
|
|
98
|
+
? ` PR: https://github.com/empirical-run/${repoName}/pull/${prNumber}`
|
|
99
|
+
: "";
|
|
100
|
+
return {
|
|
101
|
+
result: `Failed to handle PR operations: ${error}.${prLink}`,
|
|
102
|
+
isError: true,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const prLink = `https://github.com/empirical-run/${repoName}/pull/${prNumber}`;
|
|
106
|
+
const status = merged
|
|
107
|
+
? "merged successfully"
|
|
108
|
+
: shouldMerge
|
|
109
|
+
? "created but merge failed"
|
|
110
|
+
: "created but not merged (non-patch updates)";
|
|
111
|
+
return {
|
|
112
|
+
result: `Success: PR ${status}. Link: ${prLink}`,
|
|
113
|
+
isError: false,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error("Failed to upgrade packages:", error);
|
|
118
|
+
return {
|
|
119
|
+
result: `Failed to upgrade packages: ${error.message}`,
|
|
120
|
+
isError: true,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getLatestVersion(packageName: string): Promise<any>;
|
|
2
|
+
export declare function shouldMergePR({ repoName, prNumber, apiKey, }: {
|
|
3
|
+
repoName: string;
|
|
4
|
+
prNumber: number;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
}): Promise<boolean>;
|
|
7
|
+
export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }: {
|
|
8
|
+
repoPath: string;
|
|
9
|
+
pkgName: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
isDevDep: boolean;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAYA,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,gBAczD;AAmED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,oBA6BA;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,iBAUA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLatestVersion = getLatestVersion;
|
|
4
|
+
exports.shouldMergePR = shouldMergePR;
|
|
5
|
+
exports.upgradeAndStagePackage = upgradeAndStagePackage;
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
function isPatchUpdate(currentVersion, newVersion) {
|
|
9
|
+
const current = currentVersion.replace(/^[\^~]/, "").split(".");
|
|
10
|
+
const next = newVersion.replace(/^[\^~]/, "").split(".");
|
|
11
|
+
return (current[0] === next[0] && current[1] === next[1] && current[2] !== next[2]);
|
|
12
|
+
}
|
|
13
|
+
async function getLatestVersion(packageName) {
|
|
14
|
+
const url = `https://registry.npmjs.org/${packageName}/latest`;
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(url);
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
throw new Error(`Failed to fetch data for package: ${packageName}`);
|
|
19
|
+
}
|
|
20
|
+
const packageInfo = await response.json();
|
|
21
|
+
console.log(`Latest version of ${packageName}: ${packageInfo.version}`);
|
|
22
|
+
return packageInfo.version;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error(`Error fetching package info: ${error.message}`);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function getPackageJsonChanges({ repoName, prNumber, apiKey, }) {
|
|
30
|
+
const url = `${utils_1.GITHUB_API_BASE}/${repoName}/pulls/${prNumber}/files`;
|
|
31
|
+
try {
|
|
32
|
+
const files = await (0, utils_1.callGitHubProxy)({
|
|
33
|
+
method: "GET",
|
|
34
|
+
url: url,
|
|
35
|
+
apiKey,
|
|
36
|
+
});
|
|
37
|
+
if (!files) {
|
|
38
|
+
throw new Error("Failed to fetch PR files via proxy");
|
|
39
|
+
}
|
|
40
|
+
const packageJsonChanges = files.find((file) => file.filename === "package.json");
|
|
41
|
+
if (!packageJsonChanges) {
|
|
42
|
+
console.log("No package.json changes found in PR");
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const patchLines = packageJsonChanges.patch.split("\n");
|
|
46
|
+
const changes = {};
|
|
47
|
+
// Process the patch lines to find version changes
|
|
48
|
+
for (let i = 0; i < patchLines.length; i++) {
|
|
49
|
+
const line = patchLines[i];
|
|
50
|
+
// Look for lines that change version numbers
|
|
51
|
+
const match = line.match(/^[-+]\s*"([^"]+)":\s*"([^"]+)"/);
|
|
52
|
+
if (match) {
|
|
53
|
+
const [, pkg, version] = match;
|
|
54
|
+
const changeType = line.startsWith("+") ? "new" : "old";
|
|
55
|
+
if (!changes[pkg]) {
|
|
56
|
+
changes[pkg] = {};
|
|
57
|
+
}
|
|
58
|
+
changes[pkg][changeType] = version;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Filter out any packages that don't have both old and new versions
|
|
62
|
+
const validChanges = {};
|
|
63
|
+
for (const [pkg, versions] of Object.entries(changes)) {
|
|
64
|
+
if (versions.old && versions.new) {
|
|
65
|
+
validChanges[pkg] = {
|
|
66
|
+
oldVersion: versions.old,
|
|
67
|
+
newVersion: versions.new,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return validChanges;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error(`Error fetching PR changes: ${error.message}`);
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function shouldMergePR({ repoName, prNumber, apiKey, }) {
|
|
79
|
+
const changes = await getPackageJsonChanges({
|
|
80
|
+
repoName,
|
|
81
|
+
prNumber,
|
|
82
|
+
apiKey,
|
|
83
|
+
});
|
|
84
|
+
if (!changes) {
|
|
85
|
+
console.log("No package.json changes found, skipping merge");
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
let allPatchUpdates = true;
|
|
89
|
+
for (const [pkg, versions] of Object.entries(changes)) {
|
|
90
|
+
const { oldVersion, newVersion } = versions;
|
|
91
|
+
if (!isPatchUpdate(oldVersion, newVersion)) {
|
|
92
|
+
console.log(`${pkg}: ${oldVersion} -> ${newVersion} is not a patch update`);
|
|
93
|
+
allPatchUpdates = false;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
console.log(`${pkg}: ${oldVersion} -> ${newVersion} is a patch update`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return allPatchUpdates;
|
|
100
|
+
}
|
|
101
|
+
async function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }) {
|
|
102
|
+
const pkgVersion = version ?? (await getLatestVersion(pkgName));
|
|
103
|
+
(0, child_process_1.execSync)(`npm i ${pkgName}@${pkgVersion} ${isDevDep ? "--save-dev" : "--save"}`, { cwd: repoPath });
|
|
104
|
+
console.log(`Updated package: ${pkgName} version to ${pkgVersion} in ${repoPath}`);
|
|
105
|
+
(0, child_process_1.execSync)("git add package.json package-lock.json", { cwd: repoPath });
|
|
106
|
+
}
|
|
@@ -4,10 +4,58 @@ export declare function makeDashboardRequest<T>({ path, method, body, apiKey, }:
|
|
|
4
4
|
body?: any;
|
|
5
5
|
apiKey: string;
|
|
6
6
|
}): Promise<T>;
|
|
7
|
-
export declare function callGitHubProxy({ method, url, body, apiKey, }: {
|
|
7
|
+
export declare function callGitHubProxy<T>({ method, url, body, apiKey, }: {
|
|
8
8
|
method: string;
|
|
9
9
|
url: string;
|
|
10
10
|
body?: any;
|
|
11
11
|
apiKey: string;
|
|
12
|
-
}): Promise<
|
|
12
|
+
}): Promise<T>;
|
|
13
|
+
export declare const GITHUB_API_BASE = "https://api.github.com/repos/empirical-run";
|
|
14
|
+
export interface GitHubRepoInfo {
|
|
15
|
+
owner: string;
|
|
16
|
+
repo: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function parseGitHubUrl(url: string): GitHubRepoInfo;
|
|
19
|
+
export interface PullRequestInfo {
|
|
20
|
+
number: number;
|
|
21
|
+
html_url: string;
|
|
22
|
+
head: {
|
|
23
|
+
ref: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function findExistingPR({ owner, repo, branchName, apiKey, }: {
|
|
27
|
+
owner: string;
|
|
28
|
+
repo: string;
|
|
29
|
+
branchName: string;
|
|
30
|
+
apiKey: string;
|
|
31
|
+
}): Promise<PullRequestInfo | null>;
|
|
32
|
+
export declare function createPullRequest({ owner, repo, title, head, base, body, labels, apiKey, }: {
|
|
33
|
+
owner: string;
|
|
34
|
+
repo: string;
|
|
35
|
+
title: string;
|
|
36
|
+
head: string;
|
|
37
|
+
base?: string;
|
|
38
|
+
body: string;
|
|
39
|
+
labels?: string[];
|
|
40
|
+
apiKey: string;
|
|
41
|
+
}): Promise<PullRequestInfo>;
|
|
42
|
+
export declare function updatePullRequest({ owner, repo, prNumber, body, apiKey, }: {
|
|
43
|
+
owner: string;
|
|
44
|
+
repo: string;
|
|
45
|
+
prNumber: number;
|
|
46
|
+
body?: string;
|
|
47
|
+
apiKey: string;
|
|
48
|
+
}): Promise<PullRequestInfo>;
|
|
49
|
+
export declare function findOrCreatePullRequest({ owner, repo, branchName, title, body, labels, apiKey, }: {
|
|
50
|
+
owner: string;
|
|
51
|
+
repo: string;
|
|
52
|
+
branchName: string;
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
labels?: string[];
|
|
56
|
+
apiKey: string;
|
|
57
|
+
}): Promise<{
|
|
58
|
+
pr: PullRequestInfo;
|
|
59
|
+
isNew: boolean;
|
|
60
|
+
}>;
|
|
13
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,EAC5C,IAAI,EACJ,MAAc,EACd,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmBb;AAED,wBAAsB,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/index.ts"],"names":[],"mappings":"AAAA,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,EAC5C,IAAI,EACJ,MAAc,EACd,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmBb;AAED,wBAAsB,eAAe,CAAC,CAAC,EAAE,EACvC,MAAM,EACN,GAAG,EACH,IAAI,EACJ,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAGD,eAAO,MAAM,eAAe,+CAA+C,CAAC;AAG5E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiB1D;AAGD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACvB;AAED,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,UAAU,EACV,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAYlC;AAED,wBAAsB,iBAAiB,CAAC,EACtC,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAa,EACb,IAAI,EACJ,MAAM,EACN,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,eAAe,CAAC,CAqB3B;AAED,wBAAsB,iBAAiB,CAAC,EACtC,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,eAAe,CAAC,CAU3B;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,KAAK,EACL,IAAI,EACJ,UAAU,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAyBnD"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GITHUB_API_BASE = void 0;
|
|
3
4
|
exports.makeDashboardRequest = makeDashboardRequest;
|
|
4
5
|
exports.callGitHubProxy = callGitHubProxy;
|
|
6
|
+
exports.parseGitHubUrl = parseGitHubUrl;
|
|
7
|
+
exports.findExistingPR = findExistingPR;
|
|
8
|
+
exports.createPullRequest = createPullRequest;
|
|
9
|
+
exports.updatePullRequest = updatePullRequest;
|
|
10
|
+
exports.findOrCreatePullRequest = findOrCreatePullRequest;
|
|
5
11
|
async function makeDashboardRequest({ path, method = "GET", body, apiKey, }) {
|
|
6
12
|
const requestHeaders = {
|
|
7
13
|
"Content-Type": "application/json",
|
|
@@ -33,3 +39,84 @@ async function callGitHubProxy({ method, url, body, apiKey, }) {
|
|
|
33
39
|
apiKey,
|
|
34
40
|
});
|
|
35
41
|
}
|
|
42
|
+
// Common GitHub constants
|
|
43
|
+
exports.GITHUB_API_BASE = "https://api.github.com/repos/empirical-run";
|
|
44
|
+
function parseGitHubUrl(url) {
|
|
45
|
+
const githubIndex = url.indexOf("github.com");
|
|
46
|
+
if (githubIndex === -1) {
|
|
47
|
+
throw new Error("Invalid GitHub repository URL");
|
|
48
|
+
}
|
|
49
|
+
const [owner, repo] = url
|
|
50
|
+
.substring(githubIndex + "github.com/".length)
|
|
51
|
+
.replace(".git", "")
|
|
52
|
+
.split("/");
|
|
53
|
+
if (!owner || !repo) {
|
|
54
|
+
throw new Error("Invalid GitHub repository URL format - missing owner or repo");
|
|
55
|
+
}
|
|
56
|
+
return { owner, repo };
|
|
57
|
+
}
|
|
58
|
+
async function findExistingPR({ owner, repo, branchName, apiKey, }) {
|
|
59
|
+
const prs = (await callGitHubProxy({
|
|
60
|
+
method: "GET",
|
|
61
|
+
url: `https://api.github.com/repos/${owner}/${repo}/pulls`,
|
|
62
|
+
body: {
|
|
63
|
+
head: `${owner}:${branchName}`,
|
|
64
|
+
state: "open",
|
|
65
|
+
},
|
|
66
|
+
apiKey,
|
|
67
|
+
}));
|
|
68
|
+
return prs?.find((pr) => pr.head.ref === branchName) || null;
|
|
69
|
+
}
|
|
70
|
+
async function createPullRequest({ owner, repo, title, head, base = "main", body, labels, apiKey, }) {
|
|
71
|
+
const createPrBody = {
|
|
72
|
+
title,
|
|
73
|
+
head,
|
|
74
|
+
base,
|
|
75
|
+
body,
|
|
76
|
+
...(labels && { labels }),
|
|
77
|
+
};
|
|
78
|
+
const pr = (await callGitHubProxy({
|
|
79
|
+
method: "POST",
|
|
80
|
+
url: `https://api.github.com/repos/${owner}/${repo}/pulls`,
|
|
81
|
+
body: createPrBody,
|
|
82
|
+
apiKey,
|
|
83
|
+
}));
|
|
84
|
+
if (!pr || !("number" in pr)) {
|
|
85
|
+
throw new Error(`Failed to create PR or PR number missing in response.`);
|
|
86
|
+
}
|
|
87
|
+
return pr;
|
|
88
|
+
}
|
|
89
|
+
async function updatePullRequest({ owner, repo, prNumber, body, apiKey, }) {
|
|
90
|
+
const updateBody = {};
|
|
91
|
+
if (body)
|
|
92
|
+
updateBody.body = body;
|
|
93
|
+
return (await callGitHubProxy({
|
|
94
|
+
method: "PATCH",
|
|
95
|
+
url: `https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}`,
|
|
96
|
+
body: updateBody,
|
|
97
|
+
apiKey,
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
async function findOrCreatePullRequest({ owner, repo, branchName, title, body, labels, apiKey, }) {
|
|
101
|
+
// Check for existing PR
|
|
102
|
+
const existingPR = await findExistingPR({
|
|
103
|
+
owner,
|
|
104
|
+
repo,
|
|
105
|
+
branchName,
|
|
106
|
+
apiKey,
|
|
107
|
+
});
|
|
108
|
+
if (existingPR) {
|
|
109
|
+
return { pr: existingPR, isNew: false };
|
|
110
|
+
}
|
|
111
|
+
// Create new PR
|
|
112
|
+
const newPR = await createPullRequest({
|
|
113
|
+
owner,
|
|
114
|
+
repo,
|
|
115
|
+
title,
|
|
116
|
+
head: branchName,
|
|
117
|
+
body,
|
|
118
|
+
labels,
|
|
119
|
+
apiKey,
|
|
120
|
+
});
|
|
121
|
+
return { pr: newPR, isNew: true };
|
|
122
|
+
}
|
package/dist/utils/git.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function getGitDiff(filepath: string, cwd: string): string;
|
|
2
|
+
export declare function getGitDiffForNewFile(filepath: string, cwd: string): string;
|
|
2
3
|
export declare function checkoutBranch(branchName: string, cwd: string): Promise<void>;
|
|
3
|
-
export declare function commitAsBotUser(commitMessage: string, cwd: string): Promise<
|
|
4
|
+
export declare function commitAsBotUser(commitMessage: string, cwd: string): Promise<boolean>;
|
|
4
5
|
export declare function getCurrentBranchName(repoPath: string): Promise<string>;
|
|
5
6
|
export declare function pullBranch(branchName: string, cwd: string): Promise<void>;
|
|
6
7
|
export declare function commitFilesAndPushBranch({ commitMessage, branchName, files, repoPath, }: {
|
|
@@ -10,4 +11,14 @@ export declare function commitFilesAndPushBranch({ commitMessage, branchName, fi
|
|
|
10
11
|
repoPath: string;
|
|
11
12
|
}): Promise<void>;
|
|
12
13
|
export declare function getFilesChanged(cwd: string): Promise<string[]>;
|
|
14
|
+
export declare function mergePullRequest({ repoName, prNumber, apiKey, }: {
|
|
15
|
+
repoName: string;
|
|
16
|
+
prNumber: number;
|
|
17
|
+
apiKey: string;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
export declare function deleteBranch({ repoName, branchName, apiKey, }: {
|
|
20
|
+
repoName: string;
|
|
21
|
+
branchName: string;
|
|
22
|
+
apiKey: string;
|
|
23
|
+
}): Promise<void>;
|
|
13
24
|
//# sourceMappingURL=git.d.ts.map
|
package/dist/utils/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAOA,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAe1E;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAQnE;AAED,wBAAsB,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,oBAcvE;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,mBAO1D;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAE/D;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,aAAa,EACb,UAAU,EACV,KAAK,EACL,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAIA;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,qBAUhD;AAED,wBAAsB,gBAAgB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,oBA+BA;AAED,wBAAsB,YAAY,CAAC,EACjC,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,iBAoBA"}
|
package/dist/utils/git.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGitDiff = getGitDiff;
|
|
4
|
+
exports.getGitDiffForNewFile = getGitDiffForNewFile;
|
|
4
5
|
exports.checkoutBranch = checkoutBranch;
|
|
5
6
|
exports.commitAsBotUser = commitAsBotUser;
|
|
6
7
|
exports.getCurrentBranchName = getCurrentBranchName;
|
|
7
8
|
exports.pullBranch = pullBranch;
|
|
8
9
|
exports.commitFilesAndPushBranch = commitFilesAndPushBranch;
|
|
9
10
|
exports.getFilesChanged = getFilesChanged;
|
|
11
|
+
exports.mergePullRequest = mergePullRequest;
|
|
12
|
+
exports.deleteBranch = deleteBranch;
|
|
10
13
|
const child_process_1 = require("child_process");
|
|
14
|
+
const utils_1 = require("../tools/utils");
|
|
11
15
|
const GIT_USER_NAME = "empiricalrun[bot]";
|
|
12
16
|
const GIT_USER_EMAIL = "180257021+empiricalrun[bot]@users.noreply.github.com";
|
|
13
17
|
function getGitDiff(filepath, cwd) {
|
|
@@ -17,6 +21,23 @@ function getGitDiff(filepath, cwd) {
|
|
|
17
21
|
});
|
|
18
22
|
return diff;
|
|
19
23
|
}
|
|
24
|
+
function getGitDiffForNewFile(filepath, cwd) {
|
|
25
|
+
try {
|
|
26
|
+
const diff = (0, child_process_1.execSync)(`git diff --no-index /dev/null ${filepath}`, {
|
|
27
|
+
encoding: "utf-8",
|
|
28
|
+
cwd,
|
|
29
|
+
});
|
|
30
|
+
return diff;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
// git diff returns exit code 1 when files differ, which is expected for new files
|
|
34
|
+
if (error.status === 1 && error.stdout) {
|
|
35
|
+
return error.stdout;
|
|
36
|
+
}
|
|
37
|
+
// Re-throw for other errors (exit code 2, etc.)
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
20
41
|
async function checkoutBranch(branchName, cwd) {
|
|
21
42
|
// TODO: This assumes repoDir is process.cwd()
|
|
22
43
|
try {
|
|
@@ -33,10 +54,11 @@ async function commitAsBotUser(commitMessage, cwd) {
|
|
|
33
54
|
cwd,
|
|
34
55
|
});
|
|
35
56
|
if (!status) {
|
|
36
|
-
return; // Nothing to commit
|
|
57
|
+
return false; // Nothing to commit
|
|
37
58
|
}
|
|
38
59
|
const commitMessageWithSkipCi = `${commitMessage} [skip ci]`;
|
|
39
60
|
(0, child_process_1.execSync)(`git -c user.name="${GIT_USER_NAME}" -c user.email="${GIT_USER_EMAIL}" commit -m "${commitMessageWithSkipCi}"`, { cwd });
|
|
61
|
+
return true;
|
|
40
62
|
}
|
|
41
63
|
async function getCurrentBranchName(repoPath) {
|
|
42
64
|
const branchName = (0, child_process_1.execSync)("git branch --show-current", {
|
|
@@ -65,3 +87,46 @@ async function getFilesChanged(cwd) {
|
|
|
65
87
|
.filter((fileName) => fileName != "");
|
|
66
88
|
return filesChanged;
|
|
67
89
|
}
|
|
90
|
+
async function mergePullRequest({ repoName, prNumber, apiKey, }) {
|
|
91
|
+
const url = `${utils_1.GITHUB_API_BASE}/${repoName}/pulls/${prNumber}/merge`;
|
|
92
|
+
const mergeBody = {
|
|
93
|
+
merge_method: "squash",
|
|
94
|
+
};
|
|
95
|
+
try {
|
|
96
|
+
const response = await (0, utils_1.callGitHubProxy)({
|
|
97
|
+
method: "PUT",
|
|
98
|
+
url: url,
|
|
99
|
+
body: mergeBody,
|
|
100
|
+
apiKey,
|
|
101
|
+
});
|
|
102
|
+
if (!response?.merged) {
|
|
103
|
+
console.log(`PR #${prNumber} for ${repoName} could not be merged: ${response.message}`);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
console.log(`Merged PR #${prNumber} for ${repoName} via proxy`);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error(`Error merging PR #${prNumber} for ${repoName} via proxy: ${error.message}`);
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function deleteBranch({ repoName, branchName, apiKey, }) {
|
|
115
|
+
const url = `${utils_1.GITHUB_API_BASE}/${repoName}/git/refs/heads/${branchName}`;
|
|
116
|
+
try {
|
|
117
|
+
await (0, utils_1.callGitHubProxy)({
|
|
118
|
+
method: "DELETE",
|
|
119
|
+
url: url,
|
|
120
|
+
apiKey,
|
|
121
|
+
});
|
|
122
|
+
console.log(`Deleted branch ${branchName} from ${repoName} via proxy`);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (error.message?.includes("422")) {
|
|
126
|
+
console.log(`Branch ${branchName} likely already deleted or never existed on ${repoName}.`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.error(`Error deleting branch ${branchName} from ${repoName} via proxy: ${error.message}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"tsx": "^4.16.2",
|
|
63
63
|
"typescript": "^5.3.3",
|
|
64
64
|
"zod": "^3.23.8",
|
|
65
|
-
"@empiricalrun/llm": "^0.
|
|
65
|
+
"@empiricalrun/llm": "^0.18.1",
|
|
66
66
|
"@empiricalrun/r2-uploader": "^0.3.9",
|
|
67
|
-
"@empiricalrun/test-run": "^0.10.
|
|
67
|
+
"@empiricalrun/test-run": "^0.10.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@playwright/test": "1.47.1",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"playwright": "1.47.1",
|
|
80
80
|
"serve-handler": "^6.1.6",
|
|
81
81
|
"ts-patch": "^3.3.0",
|
|
82
|
-
"@empiricalrun/shared-types": "0.
|
|
82
|
+
"@empiricalrun/shared-types": "0.5.1"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"dev": "tspc --build --watch",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/skill.ts","./src/actions/text-content.ts","./src/actions/constants/index.ts","./src/actions/utils/index.ts","./src/agent/browsing/index.ts","./src/agent/browsing/run.ts","./src/agent/browsing/utils.ts","./src/agent/chat/agent-loop.ts","./src/agent/chat/exports.ts","./src/agent/chat/index.ts","./src/agent/chat/models.ts","./src/agent/chat/prompt.ts","./src/agent/chat/repo.ts","./src/agent/chat/state.ts","./src/agent/chat/types.ts","./src/agent/chat/utils.ts","./src/agent/codegen/create-test-block.ts","./src/agent/codegen/fix-ts-errors.ts","./src/agent/codegen/generate-code-apply-changes.ts","./src/agent/codegen/lexical-scoped-vars.ts","./src/agent/codegen/repo-edit.ts","./src/agent/codegen/run.ts","./src/agent/codegen/skills-retriever.ts","./src/agent/codegen/test-update-feedback.ts","./src/agent/codegen/types.ts","./src/agent/codegen/update-flow.ts","./src/agent/codegen/use-skill.ts","./src/agent/codegen/utils.ts","./src/agent/cua/computer.ts","./src/agent/cua/index.ts","./src/agent/cua/model.ts","./src/agent/cua/pw-codegen/element-from-point.ts","./src/agent/cua/pw-codegen/types.ts","./src/agent/cua/pw-codegen/pw-pause/index.ts","./src/agent/cua/pw-codegen/pw-pause/
|
|
1
|
+
{"root":["./src/index.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/skill.ts","./src/actions/text-content.ts","./src/actions/constants/index.ts","./src/actions/utils/index.ts","./src/agent/browsing/index.ts","./src/agent/browsing/run.ts","./src/agent/browsing/utils.ts","./src/agent/chat/agent-loop.ts","./src/agent/chat/exports.ts","./src/agent/chat/index.ts","./src/agent/chat/models.ts","./src/agent/chat/prompt.ts","./src/agent/chat/repo.ts","./src/agent/chat/state.ts","./src/agent/chat/types.ts","./src/agent/chat/utils.ts","./src/agent/codegen/create-test-block.ts","./src/agent/codegen/fix-ts-errors.ts","./src/agent/codegen/generate-code-apply-changes.ts","./src/agent/codegen/lexical-scoped-vars.ts","./src/agent/codegen/repo-edit.ts","./src/agent/codegen/run.ts","./src/agent/codegen/skills-retriever.ts","./src/agent/codegen/test-update-feedback.ts","./src/agent/codegen/types.ts","./src/agent/codegen/update-flow.ts","./src/agent/codegen/use-skill.ts","./src/agent/codegen/utils.ts","./src/agent/cua/computer.ts","./src/agent/cua/index.ts","./src/agent/cua/model.ts","./src/agent/cua/pw-codegen/element-from-point.ts","./src/agent/cua/pw-codegen/types.ts","./src/agent/cua/pw-codegen/pw-pause/index.ts","./src/agent/cua/pw-codegen/pw-pause/ipc.ts","./src/agent/cua/pw-codegen/pw-pause/patch.ts","./src/agent/diagnosis-agent/index.ts","./src/agent/diagnosis-agent/strict-mode-violation.ts","./src/agent/enrich-prompt/index.ts","./src/agent/enrich-prompt/utils.ts","./src/agent/infer-agent/index.ts","./src/agent/master/action-tool-calls.ts","./src/agent/master/element-annotation.ts","./src/agent/master/execute-browser-action.ts","./src/agent/master/execute-skill-action.ts","./src/agent/master/next-action.ts","./src/agent/master/planner.ts","./src/agent/master/run.ts","./src/agent/master/scroller.ts","./src/agent/master/with-hints.ts","./src/agent/master/browser-tests/cua.spec.ts","./src/agent/master/browser-tests/fixtures.ts","./src/agent/master/browser-tests/index.spec.ts","./src/agent/master/browser-tests/skills.spec.ts","./src/agent/master/icon-descriptor/index.ts","./src/agent/master/icon-descriptor/normalize-svg.ts","./src/agent/planner/run-time-planner.ts","./src/agent/planner/run.ts","./src/artifacts/index.ts","./src/artifacts/utils.ts","./src/bin/index.ts","./src/bin/logger/index.ts","./src/bin/utils/context.ts","./src/bin/utils/index.ts","./src/bin/utils/fs/index.ts","./src/bin/utils/platform/web/index.ts","./src/bin/utils/platform/web/test-files/ts-path-import-validate.ts","./src/bin/utils/scenarios/index.ts","./src/browser-injected-scripts/annotate-elements.spec.ts","./src/constants/index.ts","./src/errors/index.ts","./src/evals/add-scenario-agent.evals.ts","./src/evals/append-create-test-agent.evals.ts","./src/evals/fetch-pom-skills-agent.evals.ts","./src/evals/infer-master-or-code-agent.evals.ts","./src/evals/master-agent.evals.ts","./src/evals/type.ts","./src/evals/update-scenario-agent.evals.ts","./src/file/client.ts","./src/file/server.ts","./src/human-in-the-loop/cli.ts","./src/human-in-the-loop/index.ts","./src/human-in-the-loop/ipc.ts","./src/page/index.ts","./src/prompts/lib/ts-transformer.ts","./src/reporter/index.ts","./src/reporter/lib.ts","./src/session/index.ts","./src/test-build/index.ts","./src/tool-call-service/index.ts","./src/tool-call-service/utils.ts","./src/tools/commit-and-create-pr.ts","./src/tools/diagnosis-fetcher.ts","./src/tools/download-build.ts","./src/tools/list-environments.ts","./src/tools/str_replace_editor.ts","./src/tools/test-gen-browser.ts","./src/tools/test-run.ts","./src/tools/grep/index.ts","./src/tools/grep/ripgrep/index.ts","./src/tools/grep/ripgrep/types.ts","./src/tools/test-run-fetcher/index.ts","./src/tools/test-run-fetcher/types.ts","./src/tools/upgrade-packages/index.ts","./src/tools/upgrade-packages/utils.ts","./src/tools/utils/index.ts","./src/types/handlebars.d.ts","./src/types/index.ts","./src/uploader/index.ts","./src/uploader/utils.ts","./src/utils/checkpoint.ts","./src/utils/env.ts","./src/utils/exec.ts","./src/utils/file-tree.ts","./src/utils/file.ts","./src/utils/git.ts","./src/utils/html.ts","./src/utils/index.ts","./src/utils/json.ts","./src/utils/repo-tree.ts","./src/utils/slug.ts","./src/utils/string.ts","./src/utils/stripAnsi.ts"],"version":"5.8.3"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/utils.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,+BAiB/C;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,OAuB1D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,iBAoB3D;AAED,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,iBAGxD;AAED,wBAAsB,WAAW,CAAC,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAkBxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment-crud.d.ts","sourceRoot":"","sources":["../../src/tools/environment-crud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AA6DpC,eAAO,MAAM,kBAAkB,EAAE,IAoFhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAAyB,CAAC"}
|