@empiricalrun/test-gen 0.57.1 → 0.58.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 +24 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/skill.js +2 -2
- package/dist/actions/utils/index.js +2 -3
- package/dist/agent/browsing/index.js +1 -2
- package/dist/agent/browsing/run.js +2 -3
- package/dist/agent/browsing/utils.js +10 -10
- package/dist/agent/chat/agent-loop.d.ts +5 -3
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.js +3 -4
- package/dist/agent/chat/exports.d.ts +4 -4
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +19 -9
- package/dist/agent/chat/index.d.ts +1 -1
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +10 -7
- package/dist/agent/chat/prompt.d.ts +2 -1
- package/dist/agent/chat/prompt.d.ts.map +1 -1
- package/dist/agent/chat/prompt.js +3 -4
- package/dist/agent/chat/repo.d.ts +2 -1
- package/dist/agent/chat/repo.d.ts.map +1 -1
- package/dist/agent/chat/repo.js +32 -36
- package/dist/agent/chat/state.d.ts +1 -2
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +8 -8
- package/dist/agent/codegen/create-test-block.js +1 -2
- package/dist/agent/codegen/fix-ts-errors.js +1 -2
- package/dist/agent/codegen/generate-code-apply-changes.js +2 -3
- package/dist/agent/codegen/lexical-scoped-vars.js +1 -2
- package/dist/agent/codegen/repo-edit.js +2 -3
- package/dist/agent/codegen/run.js +2 -3
- package/dist/agent/codegen/skills-retriever.d.ts +3 -3
- package/dist/agent/codegen/skills-retriever.d.ts.map +1 -1
- package/dist/agent/codegen/skills-retriever.js +2 -2
- package/dist/agent/codegen/test-update-feedback.js +1 -2
- package/dist/agent/codegen/update-flow.js +4 -5
- package/dist/agent/codegen/use-skill.js +1 -2
- package/dist/agent/codegen/utils.js +9 -10
- package/dist/agent/cua/computer.js +3 -4
- package/dist/agent/cua/index.js +2 -3
- package/dist/agent/cua/model.js +1 -2
- package/dist/agent/diagnosis-agent/index.js +2 -3
- package/dist/agent/diagnosis-agent/strict-mode-violation.js +1 -2
- package/dist/agent/enrich-prompt/index.d.ts +1 -1
- package/dist/agent/enrich-prompt/index.d.ts.map +1 -1
- package/dist/agent/enrich-prompt/utils.js +1 -2
- package/dist/agent/infer-agent/index.js +1 -2
- package/dist/agent/master/action-tool-calls.js +3 -3
- package/dist/agent/master/element-annotation.js +2 -3
- package/dist/agent/master/execute-browser-action.d.ts +1 -1
- package/dist/agent/master/execute-browser-action.d.ts.map +1 -1
- package/dist/agent/master/execute-browser-action.js +1 -2
- package/dist/agent/master/execute-skill-action.js +1 -2
- package/dist/agent/master/icon-descriptor/index.js +6 -7
- package/dist/agent/master/icon-descriptor/normalize-svg.js +1 -2
- package/dist/agent/master/next-action.js +1 -2
- package/dist/agent/master/planner.d.ts.map +1 -1
- package/dist/agent/master/planner.js +1 -2
- package/dist/agent/master/run.js +3 -3
- package/dist/agent/master/scroller.js +1 -2
- package/dist/agent/master/with-hints.d.ts +1 -1
- package/dist/agent/master/with-hints.d.ts.map +1 -1
- package/dist/agent/planner/run-time-planner.d.ts.map +1 -1
- package/dist/agent/planner/run-time-planner.js +1 -2
- package/dist/agent/planner/run.js +1 -2
- package/dist/bin/logger/index.js +2 -2
- package/dist/bin/utils/context.js +5 -6
- package/dist/bin/utils/fs/index.d.ts.map +1 -1
- package/dist/bin/utils/fs/index.js +4 -5
- package/dist/bin/utils/index.js +2 -3
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +21 -21
- package/dist/bin/utils/scenarios/index.js +3 -4
- package/dist/constants/index.js +1 -1
- package/dist/file/server.js +2 -2
- package/dist/human-in-the-loop/cli.js +1 -2
- package/dist/human-in-the-loop/ipc.js +2 -3
- package/dist/index.js +1 -2
- package/dist/prompts/lib/ts-transformer.js +17 -7
- package/dist/reporter/index.js +3 -3
- package/dist/reporter/lib.js +1 -1
- package/dist/session/index.js +6 -7
- package/dist/test-build/index.js +2 -3
- package/dist/tool-call-service/index.d.ts +1 -2
- package/dist/tool-call-service/index.d.ts.map +1 -1
- package/dist/tools/commit-and-create-pr.js +2 -2
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +8 -4
- package/dist/tools/grep/ripgrep/index.d.ts +2 -2
- package/dist/tools/grep/ripgrep/index.d.ts.map +1 -1
- package/dist/tools/grep/ripgrep/index.js +25 -26
- package/dist/tools/grep/ripgrep/types.d.ts +1 -3
- package/dist/tools/grep/ripgrep/types.d.ts.map +1 -1
- package/dist/tools/str_replace_editor.js +3 -3
- package/dist/tools/test-run-fetcher/index.js +2 -2
- package/dist/tools/utils/index.js +2 -3
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/uploader/index.js +6 -6
- package/dist/uploader/utils.d.ts.map +1 -1
- package/dist/uploader/utils.js +2 -2
- package/dist/utils/checkpoint.js +2 -3
- package/dist/utils/env.js +1 -2
- package/dist/utils/exec.js +2 -2
- package/dist/utils/file-tree.d.ts +3 -0
- package/dist/utils/file-tree.d.ts.map +1 -0
- package/dist/utils/file-tree.js +42 -0
- package/dist/utils/file.js +1 -2
- package/dist/utils/git.d.ts +0 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +8 -15
- package/dist/utils/html.d.ts.map +1 -1
- package/dist/utils/pw-test.js +1 -2
- package/dist/utils/repo-tree.d.ts +2 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/repo-tree.js +62 -53
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +1 -1
- package/dist/utils/string.js +1 -2
- package/package.json +5 -5
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/agent/chat/model.d.ts +0 -4
- package/dist/agent/chat/model.d.ts.map +0 -1
- package/dist/agent/chat/model.js +0 -17
package/dist/session/index.js
CHANGED
|
@@ -3,7 +3,12 @@ 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.setSessionDetails = setSessionDetails;
|
|
7
|
+
exports.shouldStopSession = shouldStopSession;
|
|
8
|
+
exports.getSessionState = getSessionState;
|
|
9
|
+
exports.endSession = endSession;
|
|
10
|
+
exports.getSessionDetails = getSessionDetails;
|
|
11
|
+
exports.updateSessionStatus = updateSessionStatus;
|
|
7
12
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
8
13
|
const env_1 = require("../utils/env");
|
|
9
14
|
const sessionDetails = {
|
|
@@ -22,19 +27,16 @@ function getSessionDetails() {
|
|
|
22
27
|
version: package_json_1.default.version,
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
|
-
exports.getSessionDetails = getSessionDetails;
|
|
26
30
|
function setSessionDetails({ sessionId, generationId, testCaseId, projectRepoName, }) {
|
|
27
31
|
sessionDetails.sessionId = sessionId;
|
|
28
32
|
sessionDetails.generationId = generationId;
|
|
29
33
|
sessionDetails.testUrl = `${process.env.DASHBOARD_DOMAIN ?? ""}/${projectRepoName}/test-cases/${testCaseId}`;
|
|
30
34
|
}
|
|
31
|
-
exports.setSessionDetails = setSessionDetails;
|
|
32
35
|
async function shouldStopSession() {
|
|
33
36
|
const sessionState = await getSessionState();
|
|
34
37
|
const shouldStopSession = sessionState !== "started";
|
|
35
38
|
return shouldStopSession;
|
|
36
39
|
}
|
|
37
|
-
exports.shouldStopSession = shouldStopSession;
|
|
38
40
|
async function getSessionState() {
|
|
39
41
|
// if there is no dashboard domain to connect to or session details missing, then continue the generation session.
|
|
40
42
|
if (!DASHBOARD_DOMAIN ||
|
|
@@ -54,7 +56,6 @@ async function getSessionState() {
|
|
|
54
56
|
// TODO: fix this heirarchy
|
|
55
57
|
return generationStateData.data.state.state;
|
|
56
58
|
}
|
|
57
|
-
exports.getSessionState = getSessionState;
|
|
58
59
|
async function endSession() {
|
|
59
60
|
if (!DASHBOARD_DOMAIN) {
|
|
60
61
|
return;
|
|
@@ -82,7 +83,6 @@ async function endSession() {
|
|
|
82
83
|
console.error("Failed to end session:", error);
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
exports.endSession = endSession;
|
|
86
86
|
async function updateSessionStatus(sessionId, payload) {
|
|
87
87
|
if (!DASHBOARD_DOMAIN) {
|
|
88
88
|
return;
|
|
@@ -102,4 +102,3 @@ async function updateSessionStatus(sessionId, payload) {
|
|
|
102
102
|
console.error("Failed to update session status:", error);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
exports.updateSessionStatus = updateSessionStatus;
|
package/dist/test-build/index.js
CHANGED
|
@@ -3,7 +3,8 @@ 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.hasDownloadScript = hasDownloadScript;
|
|
7
|
+
exports.downloadBuild = downloadBuild;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const logger_1 = require("../bin/logger");
|
|
9
10
|
const exec_1 = require("../utils/exec");
|
|
@@ -16,7 +17,6 @@ async function hasDownloadScript() {
|
|
|
16
17
|
const packageJSON = await getPackageJSON();
|
|
17
18
|
return !!packageJSON.scripts["download"];
|
|
18
19
|
}
|
|
19
|
-
exports.hasDownloadScript = hasDownloadScript;
|
|
20
20
|
async function downloadBuild(buildUrl) {
|
|
21
21
|
const logger = new logger_1.CustomLogger({ useReporter: false });
|
|
22
22
|
const packageJSON = await getPackageJSON();
|
|
@@ -28,4 +28,3 @@ async function downloadBuild(buildUrl) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.downloadBuild = downloadBuild;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { PendingToolCall, Tool, ToolResult } from "@empiricalrun/llm/chat";
|
|
3
|
-
import { SupportedChatModels } from "../agent/chat/types";
|
|
2
|
+
import { PendingToolCall, SupportedChatModels, Tool, ToolResult } from "@empiricalrun/llm/chat";
|
|
4
3
|
export type { SupportedChatModels };
|
|
5
4
|
type ToolExecutors = {
|
|
6
5
|
[key: string]: (input: any, trace?: TraceClient) => Promise<ToolResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,IAAI,EACJ,UAAU,EACX,MAAM,wBAAwB,CAAC;AAgBhC,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,KAAK,aAAa,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACzE,CAAC;AA6BF,qBAAa,eAAe;IAC1B,KAAK,EAAE,IAAI,EAAE,CAAM;IACnB,aAAa,EAAE,aAAa,CAAM;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;gBAEjB,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,aAAa,EAAE,mBAAmB,EAClC,UAAU,EAAE,MAAM;IAiBd,QAAQ;;;IAaR,OAAO,CACX,SAAS,EAAE,eAAe,EAAE,EAC5B,QAAQ,EAAE,OAAO,EACjB,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,UAAU,EAAE,CAAC;CAyDzB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPullRequestTool =
|
|
3
|
+
exports.createPullRequestTool = void 0;
|
|
4
|
+
exports.parseGitHubUrl = parseGitHubUrl;
|
|
4
5
|
const child_process_1 = require("child_process");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
const git_1 = require("../utils/git");
|
|
@@ -19,7 +20,6 @@ function parseGitHubUrl(url) {
|
|
|
19
20
|
}
|
|
20
21
|
return { owner, repo };
|
|
21
22
|
}
|
|
22
|
-
exports.parseGitHubUrl = parseGitHubUrl;
|
|
23
23
|
const createPullRequestSchema = zod_1.z.object({
|
|
24
24
|
pullRequestTitle: zod_1.z
|
|
25
25
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,wBAAwB,CAAC;AAyH/D,eAAO,MAAM,QAAQ,EAAE,IAmBtB,CAAC"}
|
package/dist/tools/grep/index.js
CHANGED
|
@@ -11,7 +11,9 @@ const zod_1 = require("zod");
|
|
|
11
11
|
const repo_tree_1 = require("../../utils/repo-tree");
|
|
12
12
|
const ripgrep_1 = require("./ripgrep");
|
|
13
13
|
const GrepInputSchema = zod_1.z.object({
|
|
14
|
-
pattern: zod_1.z
|
|
14
|
+
pattern: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.describe("The pattern to search for. Case insensitive and regex patterns are not supported"),
|
|
15
17
|
directory: zod_1.z
|
|
16
18
|
.string()
|
|
17
19
|
.optional()
|
|
@@ -113,12 +115,14 @@ All paths are relative to the current working directory.`;
|
|
|
113
115
|
exports.grepTool = {
|
|
114
116
|
schema: {
|
|
115
117
|
name: "grep",
|
|
116
|
-
description:
|
|
118
|
+
description: `Search for a pattern in files using ripgrep.
|
|
119
|
+
If ripgrep is not available, it will fall back to using system grep.
|
|
120
|
+
|
|
121
|
+
Search is case insensitive and regex patterns are not supported.`,
|
|
117
122
|
parameters: GrepInputSchema,
|
|
118
123
|
},
|
|
119
124
|
execute: async (input) => {
|
|
120
|
-
|
|
121
|
-
if (isAvailable) {
|
|
125
|
+
if ((0, ripgrep_1.isRgAvailable)()) {
|
|
122
126
|
return usingRipgrep(input);
|
|
123
127
|
}
|
|
124
128
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Match, Options } from "./types";
|
|
2
2
|
export * from "./types";
|
|
3
|
-
export declare function isRgAvailable():
|
|
4
|
-
export declare function ripgrep(cwd: string, options: Options):
|
|
3
|
+
export declare function isRgAvailable(): boolean;
|
|
4
|
+
export declare function ripgrep(cwd: string, options: Options): Array<Match>;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/grep/ripgrep/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAEvD,cAAc,SAAS,CAAC;AAcxB,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/grep/ripgrep/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAEvD,cAAc,SAAS,CAAC;AAcxB,wBAAgB,aAAa,YAS5B;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAiDnE"}
|
|
@@ -14,7 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.isRgAvailable = isRgAvailable;
|
|
18
|
+
exports.ripgrep = ripgrep;
|
|
18
19
|
const child_process_1 = require("child_process");
|
|
19
20
|
const types_1 = require("./types");
|
|
20
21
|
__exportStar(require("./types"), exports);
|
|
@@ -30,26 +31,22 @@ function formatResults(stdout) {
|
|
|
30
31
|
.map((jsonLine) => jsonLine.data);
|
|
31
32
|
}
|
|
32
33
|
function isRgAvailable() {
|
|
33
|
-
|
|
34
|
+
try {
|
|
34
35
|
// Use 'where' on Windows and 'which' on Unix-like systems
|
|
35
36
|
const command = process.platform === "win32" ? "where rg" : "which rg";
|
|
36
|
-
(0, child_process_1.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
37
|
+
(0, child_process_1.execSync)(command);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
45
43
|
}
|
|
46
|
-
exports.isRgAvailable = isRgAvailable;
|
|
47
44
|
function ripgrep(cwd, options) {
|
|
48
45
|
if (!cwd) {
|
|
49
|
-
|
|
46
|
+
throw new Error("No `cwd` provided");
|
|
50
47
|
}
|
|
51
|
-
if (
|
|
52
|
-
|
|
48
|
+
if (!options) {
|
|
49
|
+
throw new Error("No search term provided");
|
|
53
50
|
}
|
|
54
51
|
let execString = "rg --json -i";
|
|
55
52
|
if ("regex" in options) {
|
|
@@ -76,15 +73,17 @@ function ripgrep(cwd, options) {
|
|
|
76
73
|
}
|
|
77
74
|
// https://github.com/alexlafroscia/ripgrep-js/pull/175/files
|
|
78
75
|
execString += ` -- ${cwd}`;
|
|
79
|
-
|
|
80
|
-
(0, child_process_1.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
try {
|
|
77
|
+
const stdout = (0, child_process_1.execSync)(execString, { cwd }).toString();
|
|
78
|
+
return formatResults(stdout);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (error.status === 1) {
|
|
82
|
+
// Exit code is 1 for no results found
|
|
83
|
+
// Ref: https://github.com/BurntSushi/ripgrep/issues/948
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const stderr = error.stderr?.toString() || "";
|
|
87
|
+
throw new types_1.RipGrepError(error, stderr);
|
|
88
|
+
}
|
|
89
89
|
}
|
|
90
|
-
exports.ripgrep = ripgrep;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types=".pnpm/@types+node@20.14.11/node_modules/@types/node/child_process" />
|
|
2
|
-
/// <reference types=".pnpm/@types+node@20.16.10/node_modules/@types/node/child_process" />
|
|
3
1
|
import { ExecException } from "child_process";
|
|
4
2
|
type StringSearchOptions = {
|
|
5
3
|
string: string;
|
|
@@ -36,7 +34,7 @@ export type RipGrepJsonMatch = {
|
|
|
36
34
|
};
|
|
37
35
|
export type Match = RipGrepJsonMatch["data"];
|
|
38
36
|
export declare class RipGrepError {
|
|
39
|
-
|
|
37
|
+
error: ExecException;
|
|
40
38
|
stderr: string;
|
|
41
39
|
constructor(error: ExecException, stderr: string);
|
|
42
40
|
get message(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/grep/ripgrep/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/tools/grep/ripgrep/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,cAAc,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAE/D,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,WAAW,EAAE,MAAM,CAAC;QACpB,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE7C,qBAAa,YAAY;IACvB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;gBAEH,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM;IAKhD,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF"}
|
|
@@ -3,7 +3,9 @@ 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.textEditorTools =
|
|
6
|
+
exports.textEditorTools = void 0;
|
|
7
|
+
exports.cleanupBackupFiles = cleanupBackupFiles;
|
|
8
|
+
exports.strReplaceEditorExecutor = strReplaceEditorExecutor;
|
|
7
9
|
const fs_1 = __importDefault(require("fs"));
|
|
8
10
|
const path_1 = __importDefault(require("path"));
|
|
9
11
|
const zod_1 = require("zod");
|
|
@@ -130,7 +132,6 @@ function cleanupBackupFiles(repoDir) {
|
|
|
130
132
|
}
|
|
131
133
|
return cleanedCount;
|
|
132
134
|
}
|
|
133
|
-
exports.cleanupBackupFiles = cleanupBackupFiles;
|
|
134
135
|
function escapeRegExp(text) {
|
|
135
136
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
136
137
|
}
|
|
@@ -291,7 +292,6 @@ async function strReplaceEditorExecutor(input) {
|
|
|
291
292
|
};
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
|
-
exports.strReplaceEditorExecutor = strReplaceEditorExecutor;
|
|
295
295
|
const fileViewTool = {
|
|
296
296
|
schema: {
|
|
297
297
|
name: "fileViewTool",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchTestRunReportTool =
|
|
3
|
+
exports.fetchTestRunReportTool = void 0;
|
|
4
|
+
exports.extractPathAfterSourceRepo = extractPathAfterSourceRepo;
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const TestRunSchema = zod_1.z.object({
|
|
@@ -17,7 +18,6 @@ function extractPathAfterSourceRepo(fullPath) {
|
|
|
17
18
|
return parts[1].replace(/^\/|\/$/g, "");
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
|
-
exports.extractPathAfterSourceRepo = extractPathAfterSourceRepo;
|
|
21
21
|
exports.fetchTestRunReportTool = {
|
|
22
22
|
schema: {
|
|
23
23
|
name: "fetchTestRunDetails",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeDashboardRequest = makeDashboardRequest;
|
|
4
|
+
exports.callGitHubProxy = callGitHubProxy;
|
|
4
5
|
async function makeDashboardRequest({ path, method = "GET", body, }) {
|
|
5
6
|
const API_KEY = process.env.EMPIRICALRUN_API_KEY;
|
|
6
7
|
if (!API_KEY) {
|
|
@@ -23,7 +24,6 @@ async function makeDashboardRequest({ path, method = "GET", body, }) {
|
|
|
23
24
|
}
|
|
24
25
|
return await response.json();
|
|
25
26
|
}
|
|
26
|
-
exports.makeDashboardRequest = makeDashboardRequest;
|
|
27
27
|
async function callGitHubProxy({ method, url, body, }) {
|
|
28
28
|
const githubApiPath = url.replace("https://api.github.com", "");
|
|
29
29
|
return makeDashboardRequest({
|
|
@@ -36,4 +36,3 @@ async function callGitHubProxy({ method, url, body, }) {
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
exports.callGitHubProxy = callGitHubProxy;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -65,5 +65,13 @@ export type SkillActionArgs = BaseActionArgs & {
|
|
|
65
65
|
skill: string;
|
|
66
66
|
action: string;
|
|
67
67
|
};
|
|
68
|
+
export type FileInfo = {
|
|
69
|
+
isDirectory: boolean;
|
|
70
|
+
isFile: boolean;
|
|
71
|
+
path: string;
|
|
72
|
+
name: string;
|
|
73
|
+
children: FileInfo[];
|
|
74
|
+
getContent: () => Promise<string>;
|
|
75
|
+
};
|
|
68
76
|
export type ActionArgs = ClickActionArgs | FillActionArgs | GotoActionArgs | PressActionArgs | AssertTextVisibilityActionArgs | TextContentActionArgs | HoverActionArgs | SkillActionArgs;
|
|
69
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,cAAc,GAAG,UAAU,IAAI,CAC7E,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE;IACP,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;CAClE,KACE,MAAM,CAAC,CAAC,CAAC,CAAC;AAEf,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;AAEtE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,cAAc,GAAG,UAAU,IAAI;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,CAAC,OAAO,EAAE;QACjB,IAAI,EAAE,CAAC,CAAC;QACR,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACjE,QA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AAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,cAAc,GACd,eAAe,GACf,8BAA8B,GAC9B,qBAAqB,GACrB,eAAe,GACf,eAAe,CAAC"}
|
package/dist/uploader/index.js
CHANGED
|
@@ -3,7 +3,12 @@ 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.UPLOAD_DOMAIN = exports.UPLOAD_BUCKET = void 0;
|
|
7
|
+
exports.getFullUploadPath = getFullUploadPath;
|
|
8
|
+
exports.getRelativeUploadPath = getRelativeUploadPath;
|
|
9
|
+
exports.uploadTestResultsUsingPrjRepo = uploadTestResultsUsingPrjRepo;
|
|
10
|
+
exports.getUploadPathForRun = getUploadPathForRun;
|
|
11
|
+
exports.checkIfResultsUploadAllowed = checkIfResultsUploadAllowed;
|
|
7
12
|
const r2_uploader_1 = require("@empiricalrun/r2-uploader");
|
|
8
13
|
const path_1 = __importDefault(require("path"));
|
|
9
14
|
const utils_1 = require("./utils");
|
|
@@ -21,11 +26,9 @@ function getFullUploadPath(repoDir, filePath, uploadDir) {
|
|
|
21
26
|
const relativeFilePath = getRelativeUploadPath(filePath, repoDir);
|
|
22
27
|
return `${exports.UPLOAD_DOMAIN}/${uploadDir}${relativeFilePath}`;
|
|
23
28
|
}
|
|
24
|
-
exports.getFullUploadPath = getFullUploadPath;
|
|
25
29
|
function getRelativeUploadPath(filePath, repoDir) {
|
|
26
30
|
return filePath.replace(path_1.default.join(repoDir, PLAYWRIGHT_REPORT_DATA), "");
|
|
27
31
|
}
|
|
28
|
-
exports.getRelativeUploadPath = getRelativeUploadPath;
|
|
29
32
|
/**
|
|
30
33
|
* Function to upload test results to R2 using the project repo name and test name.
|
|
31
34
|
* This function uploads both the JSON summary of test results and associated video files.
|
|
@@ -86,12 +89,10 @@ async function uploadTestResultsUsingPrjRepo({ projectRepoName, testName, repoDi
|
|
|
86
89
|
.filter((url) => !!url),
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
|
-
exports.uploadTestResultsUsingPrjRepo = uploadTestResultsUsingPrjRepo;
|
|
90
92
|
function getUploadPathForRun(projectRepoName) {
|
|
91
93
|
const uploadDir = `test-generation/${projectRepoName.replace("-tests", "")}/${uploadId}`;
|
|
92
94
|
return uploadDir;
|
|
93
95
|
}
|
|
94
|
-
exports.getUploadPathForRun = getUploadPathForRun;
|
|
95
96
|
function checkIfResultsUploadAllowed() {
|
|
96
97
|
// TODO: check for valid R2 credentials
|
|
97
98
|
// check for project repo name, and r2 creds
|
|
@@ -99,4 +100,3 @@ function checkIfResultsUploadAllowed() {
|
|
|
99
100
|
process.env.R2_ACCESS_KEY_ID &&
|
|
100
101
|
process.env.R2_SECRET_ACCESS_KEY);
|
|
101
102
|
}
|
|
102
|
-
exports.checkIfResultsUploadAllowed = checkIfResultsUploadAllowed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/uploader/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAErD;AAMD,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/uploader/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAErD;AAMD,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,eAAe,EAAE,KACxB,cAAc,EA4BhB,CAAC"}
|
package/dist/uploader/utils.js
CHANGED
|
@@ -3,12 +3,12 @@ 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.getFlattenedTestList =
|
|
6
|
+
exports.getFlattenedTestList = void 0;
|
|
7
|
+
exports.parseJsonReport = parseJsonReport;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
function parseJsonReport(srcFile) {
|
|
9
10
|
return JSON.parse(fs_1.default.readFileSync(srcFile, { encoding: "utf-8" }));
|
|
10
11
|
}
|
|
11
|
-
exports.parseJsonReport = parseJsonReport;
|
|
12
12
|
const getFlattenedTestList = (suites) => {
|
|
13
13
|
let flattenedSpecs = [];
|
|
14
14
|
const traverseSuites = (suite, nesting = []) => {
|
package/dist/utils/checkpoint.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCheckpoint =
|
|
3
|
+
exports.createCheckpoint = createCheckpoint;
|
|
4
4
|
const git_1 = require("./git");
|
|
5
5
|
async function createCheckpoint(toolCalls, branchName) {
|
|
6
6
|
const filesChanged = await (0, git_1.getFilesChanged)();
|
|
@@ -12,8 +12,7 @@ async function createCheckpoint(toolCalls, branchName) {
|
|
|
12
12
|
}));
|
|
13
13
|
const filesToCommit = toolsWithUpdatedFiles.map((tool) => tool.path);
|
|
14
14
|
if (toolsWithUpdatedFiles.length > 0) {
|
|
15
|
-
let commitMessage =
|
|
15
|
+
let commitMessage = `${toolsWithUpdatedFiles.map((tool) => `${tool.name} on ${tool.path}`).join(", ")}`;
|
|
16
16
|
await (0, git_1.commitFilesAndPushBranch)(commitMessage, branchName, filesToCommit);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
exports.createCheckpoint = createCheckpoint;
|
package/dist/utils/env.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRunningOnCloud =
|
|
3
|
+
exports.isRunningOnCloud = isRunningOnCloud;
|
|
4
4
|
function isRunningOnCloud() {
|
|
5
5
|
return (process.env.CI === "true" ||
|
|
6
6
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
7
7
|
!!process.env.RUNNING_BROWSER_TESTS_FOR_TEST_GEN);
|
|
8
8
|
}
|
|
9
|
-
exports.isRunningOnCloud = isRunningOnCloud;
|
package/dist/utils/exec.js
CHANGED
|
@@ -3,7 +3,8 @@ 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.ProcessManager = void 0;
|
|
7
|
+
exports.cmd = cmd;
|
|
7
8
|
const child_process_1 = require("child_process");
|
|
8
9
|
const process_1 = __importDefault(require("process"));
|
|
9
10
|
function isAcceptableExit(exitCode, signal) {
|
|
@@ -80,4 +81,3 @@ async function cmd(command, options) {
|
|
|
80
81
|
const manager = new ProcessManager();
|
|
81
82
|
return manager.execute(command, options);
|
|
82
83
|
}
|
|
83
|
-
exports.cmd = cmd;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-tree.d.ts","sourceRoot":"","sources":["../../src/utils/file-tree.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgC5E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.getFileInfoFromFS = getFileInfoFromFS;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
async function getFileInfoFromFS(directory) {
|
|
10
|
+
let currentDirName = path_1.default.basename(directory);
|
|
11
|
+
let currentDir = {
|
|
12
|
+
isDirectory: true,
|
|
13
|
+
isFile: false,
|
|
14
|
+
path: currentDirName,
|
|
15
|
+
name: currentDirName,
|
|
16
|
+
children: [],
|
|
17
|
+
getContent: async () => {
|
|
18
|
+
return "";
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const files = await promises_1.default.readdir(directory);
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
const filePath = path_1.default.join(directory, file);
|
|
24
|
+
const stats = await promises_1.default.stat(filePath);
|
|
25
|
+
if (stats.isDirectory()) {
|
|
26
|
+
currentDir.children.push(await getFileInfoFromFS(filePath));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
currentDir.children.push({
|
|
30
|
+
isDirectory: false,
|
|
31
|
+
isFile: true,
|
|
32
|
+
path: filePath,
|
|
33
|
+
name: file,
|
|
34
|
+
children: [],
|
|
35
|
+
getContent: async () => {
|
|
36
|
+
return await promises_1.default.readFile(filePath, "utf8");
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return currentDir;
|
|
42
|
+
}
|
package/dist/utils/file.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.findFileRecursively =
|
|
6
|
+
exports.findFileRecursively = findFileRecursively;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
function findFileRecursively(directory, fileName) {
|
|
@@ -22,4 +22,3 @@ function findFileRecursively(directory, fileName) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.findFileRecursively = findFileRecursively;
|
package/dist/utils/git.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare function getGitDiff(filepath: string): string;
|
|
2
2
|
export declare function checkoutBranch(branchName: string): Promise<void>;
|
|
3
3
|
export declare function commitAsBotUser(commitMessage: string): Promise<void>;
|
|
4
|
-
export declare function commitLocalAndPushBranchToRemote(branchName: string): Promise<void>;
|
|
5
4
|
export declare function getCurrentBranchName(): Promise<string>;
|
|
6
5
|
export declare function pullBranch(branchName: string): Promise<void>;
|
|
7
6
|
export declare function commitFilesAndPushBranch(commitMessage: string, branchName: string, files: string[]): Promise<void>;
|
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":"AAKA,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,iBAQtD;AAED,wBAAsB,eAAe,CAAC,aAAa,EAAE,MAAM,iBAS1D;AAED,wBAAsB,
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,iBAQtD;AAED,wBAAsB,eAAe,CAAC,aAAa,EAAE,MAAM,iBAS1D;AAED,wBAAsB,oBAAoB,oBAGzC;AAED,wBAAsB,UAAU,CAAC,UAAU,EAAE,MAAM,iBAElD;AAED,wBAAsB,wBAAwB,CAC5C,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,iBAKhB;AAED,wBAAsB,eAAe,sBAQpC"}
|
package/dist/utils/git.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGitDiff = getGitDiff;
|
|
4
|
+
exports.checkoutBranch = checkoutBranch;
|
|
5
|
+
exports.commitAsBotUser = commitAsBotUser;
|
|
6
|
+
exports.getCurrentBranchName = getCurrentBranchName;
|
|
7
|
+
exports.pullBranch = pullBranch;
|
|
8
|
+
exports.commitFilesAndPushBranch = commitFilesAndPushBranch;
|
|
9
|
+
exports.getFilesChanged = getFilesChanged;
|
|
4
10
|
const child_process_1 = require("child_process");
|
|
5
11
|
const GIT_USER_NAME = "empiricalrun[bot]";
|
|
6
12
|
const GIT_USER_EMAIL = "180257021+empiricalrun[bot]@users.noreply.github.com";
|
|
@@ -10,7 +16,6 @@ function getGitDiff(filepath) {
|
|
|
10
16
|
});
|
|
11
17
|
return diff;
|
|
12
18
|
}
|
|
13
|
-
exports.getGitDiff = getGitDiff;
|
|
14
19
|
async function checkoutBranch(branchName) {
|
|
15
20
|
// TODO: This assumes repoDir is process.cwd()
|
|
16
21
|
try {
|
|
@@ -21,7 +26,6 @@ async function checkoutBranch(branchName) {
|
|
|
21
26
|
(0, child_process_1.execSync)(`git checkout -b ${branchName}`);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
|
-
exports.checkoutBranch = checkoutBranch;
|
|
25
29
|
async function commitAsBotUser(commitMessage) {
|
|
26
30
|
const status = (0, child_process_1.execSync)("git status --porcelain", { encoding: "utf-8" });
|
|
27
31
|
if (!status) {
|
|
@@ -30,28 +34,18 @@ async function commitAsBotUser(commitMessage) {
|
|
|
30
34
|
const commitMessageWithSkipCi = `${commitMessage} [skip ci]`;
|
|
31
35
|
(0, child_process_1.execSync)(`git -c user.name="${GIT_USER_NAME}" -c user.email="${GIT_USER_EMAIL}" commit -m "${commitMessageWithSkipCi}"`);
|
|
32
36
|
}
|
|
33
|
-
exports.commitAsBotUser = commitAsBotUser;
|
|
34
|
-
async function commitLocalAndPushBranchToRemote(branchName) {
|
|
35
|
-
(0, child_process_1.execSync)(`git add .`);
|
|
36
|
-
await commitAsBotUser("Intermediate commit from @empiricalrun/test-gen");
|
|
37
|
-
(0, child_process_1.execSync)(`git push origin ${branchName}`);
|
|
38
|
-
}
|
|
39
|
-
exports.commitLocalAndPushBranchToRemote = commitLocalAndPushBranchToRemote;
|
|
40
37
|
async function getCurrentBranchName() {
|
|
41
38
|
const branchName = (0, child_process_1.execSync)("git branch --show-current").toString().trim();
|
|
42
39
|
return branchName;
|
|
43
40
|
}
|
|
44
|
-
exports.getCurrentBranchName = getCurrentBranchName;
|
|
45
41
|
async function pullBranch(branchName) {
|
|
46
42
|
(0, child_process_1.execSync)(`git pull origin ${branchName}`);
|
|
47
43
|
}
|
|
48
|
-
exports.pullBranch = pullBranch;
|
|
49
44
|
async function commitFilesAndPushBranch(commitMessage, branchName, files) {
|
|
50
45
|
(0, child_process_1.execSync)(`git add ${files.join(" ")}`);
|
|
51
|
-
await commitAsBotUser(commitMessage
|
|
46
|
+
await commitAsBotUser(commitMessage);
|
|
52
47
|
(0, child_process_1.execSync)(`git push origin ${branchName}`);
|
|
53
48
|
}
|
|
54
|
-
exports.commitFilesAndPushBranch = commitFilesAndPushBranch;
|
|
55
49
|
async function getFilesChanged() {
|
|
56
50
|
const output = (0, child_process_1.execSync)("git status --porcelain").toString();
|
|
57
51
|
let filesChanged = output
|
|
@@ -61,4 +55,3 @@ async function getFilesChanged() {
|
|
|
61
55
|
.filter((fileName) => fileName != "");
|
|
62
56
|
return filesChanged;
|
|
63
57
|
}
|
|
64
|
-
exports.getFilesChanged = getFilesChanged;
|
package/dist/utils/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/utils/html.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GACvB,KAAK,MAAM,EACX,UAAS;IACP,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,WAsCP,CAAC"}
|
package/dist/utils/pw-test.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.getTestFixtureModuleFromRepo =
|
|
6
|
+
exports.getTestFixtureModuleFromRepo = getTestFixtureModuleFromRepo;
|
|
7
7
|
const api_1 = __importDefault(require("tsx/cjs/api"));
|
|
8
8
|
async function getTestFixtureModuleFromRepo(repoDir) {
|
|
9
9
|
const [lastDir] = repoDir.split("/").reverse();
|
|
@@ -11,4 +11,3 @@ async function getTestFixtureModuleFromRepo(repoDir) {
|
|
|
11
11
|
const { test } = await api_1.default.require(`./tests/fixtures.ts`, dir);
|
|
12
12
|
return test;
|
|
13
13
|
}
|
|
14
|
-
exports.getTestFixtureModuleFromRepo = getTestFixtureModuleFromRepo;
|