@empiricalrun/test-gen 0.57.2 → 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 +16 -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 +1 -2
- 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 -6
- 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/ripgrep/index.js +2 -3
- package/dist/tools/grep/ripgrep/types.d.ts +0 -2
- 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 +1 -2
- 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.js +7 -8
- 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/agent/master/run.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.IS_ALLOWED_TO_USE_SKILLS = exports.createTestUsingComputerUseAgent = void 0;
|
|
4
|
+
exports.createTestUsingMasterAgent = createTestUsingMasterAgent;
|
|
4
5
|
const llm_1 = require("@empiricalrun/llm");
|
|
5
6
|
const actions_1 = require("../../actions");
|
|
6
7
|
const skill_1 = require("../../actions/skill");
|
|
@@ -68,7 +69,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, specPath, opti
|
|
|
68
69
|
defaultModel: options.model || constants_1.DEFAULT_MODEL,
|
|
69
70
|
providerApiKey: constants_1.MODEL_API_KEYS[options.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
|
|
70
71
|
// we will be using google model for larger context window, in such cases 1 million tokens is not enough
|
|
71
|
-
maxTokens: options.modelProvider === "google" ?
|
|
72
|
+
maxTokens: options.modelProvider === "google" ? 3_000_000 : 1_000_000,
|
|
72
73
|
});
|
|
73
74
|
let skills = [];
|
|
74
75
|
if (testCase && exports.IS_ALLOWED_TO_USE_SKILLS) {
|
|
@@ -274,4 +275,3 @@ async function createTestUsingMasterAgent({ task, page, testCase, specPath, opti
|
|
|
274
275
|
importPaths,
|
|
275
276
|
};
|
|
276
277
|
}
|
|
277
|
-
exports.createTestUsingMasterAgent = createTestUsingMasterAgent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.scroller =
|
|
3
|
+
exports.scroller = scroller;
|
|
4
4
|
const llm_1 = require("@empiricalrun/llm");
|
|
5
5
|
const vision_1 = require("@empiricalrun/llm/vision");
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
@@ -371,4 +371,3 @@ async function scroller({ elementDescription, page, trace, frameReference, logge
|
|
|
371
371
|
await (0, llm_1.flushAllTraces)();
|
|
372
372
|
return referenceImages;
|
|
373
373
|
}
|
|
374
|
-
exports.scroller = scroller;
|
|
@@ -9,7 +9,7 @@ export declare const triggerHintsFlow: ({ outputFromGetNextAction, generatedAnno
|
|
|
9
9
|
generatedAnnotations: Record<string, any>;
|
|
10
10
|
actions: PlaywrightActions;
|
|
11
11
|
llm: LLM;
|
|
12
|
-
trace?: TraceClient
|
|
12
|
+
trace?: TraceClient;
|
|
13
13
|
}) => Promise<{
|
|
14
14
|
shouldTriggerHintsFlow: boolean;
|
|
15
15
|
hintsExecutionCompletion: OpenAI.ChatCompletionMessage | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-hints.d.ts","sourceRoot":"","sources":["../../../src/agent/master/with-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOlD,eAAO,MAAM,gBAAgB;
|
|
1
|
+
{"version":3,"file":"with-hints.d.ts","sourceRoot":"","sources":["../../../src/agent/master/with-hints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAOlD,eAAO,MAAM,gBAAgB,GAAU,yEAMpC;IACD,uBAAuB,EAAE;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,KAAG,OAAO,CAAC;IACV,sBAAsB,EAAE,OAAO,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC;CACpE,CAyGA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-time-planner.d.ts","sourceRoot":"","sources":["../../../src/agent/planner/run-time-planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,iBAAiB,EACjB,KAAK,EACL,WAAW,GACZ,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC;CAC1B
|
|
1
|
+
{"version":3,"file":"run-time-planner.d.ts","sourceRoot":"","sources":["../../../src/agent/planner/run-time-planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,iBAAiB,EACjB,KAAK,EACL,WAAW,GACZ,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC;CAC1B;cA6EoC,MAAM;YACV,OAAO;YACP,MAAM;GAgBtC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runtimePlanner =
|
|
3
|
+
exports.runtimePlanner = runtimePlanner;
|
|
4
4
|
const llm_1 = require("@empiricalrun/llm");
|
|
5
5
|
const promptTemplate_0 = "{{#section \"system\"}}\nYou are given a list of successfully executed actions that are done towards completing a task (which\nis also provided to you). Your goal is to analyse the list and determine if the task is completed.\n\nIf the task is not fully completed, identify which specific actions are missing\nand suggest next steps to complete the task. Assume that the conversation provided\nis entirely truthful and no additional actions were performed beyond those listed.\n\nThese actions were executed by AI agents using Playwright on a browser. These agents\nalready have access to browser tabs to execute actions. If there is a pending action,\none of the agents will execute it in the browser. However, they need your help to\nchoose which browser tab (= page) to use for the next action.\n\nTo fulfil your goal, follow these steps:\n- Divide the task into individual actions.\n- Compare each task action against the actions listed in the successfully executed actions list.\n- Identify which actions have been executed and which have not.\n- If all actions are executed, respond with the task as done.\n- If any actions are missing, respond with the task as not done, listing all actions\n and specifying which are complete and which are missing.\n- If provided with list of pages, based on the next pending action and previously executed\n action, identify the page on which next action needs to be taken\n{{/section}}\n\n{{#section \"user\"}}\nTask:\n{{task}}\n\n----\n\nSuccessfully executed actions:\n{{successfulActions}}\n\n----\n\nList of pages with their current URLs:\n{{pagesSummary}}\n\n\n{{/section}}\n";
|
|
6
6
|
async function runtimePlanner({ trace, task, successfulActions, pages, currentPage, }) {
|
|
@@ -96,4 +96,3 @@ async function runtimePlanner({ trace, task, successfulActions, pages, currentPa
|
|
|
96
96
|
});
|
|
97
97
|
return output;
|
|
98
98
|
}
|
|
99
|
-
exports.runtimePlanner = runtimePlanner;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.planTask =
|
|
3
|
+
exports.planTask = planTask;
|
|
4
4
|
const llm_1 = require("@empiricalrun/llm");
|
|
5
5
|
const context_1 = require("../../bin/utils/context");
|
|
6
6
|
const human_in_the_loop_1 = require("../../human-in-the-loop");
|
|
@@ -124,4 +124,3 @@ ${pomPrompt}
|
|
|
124
124
|
});
|
|
125
125
|
return "";
|
|
126
126
|
}
|
|
127
|
-
exports.planTask = planTask;
|
package/dist/bin/logger/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CustomLogger = void 0;
|
|
4
|
+
exports.waitForLogsToFlush = waitForLogsToFlush;
|
|
4
5
|
const picocolors_1 = require("picocolors");
|
|
5
6
|
const reporter_1 = require("../../reporter");
|
|
6
7
|
const lib_1 = require("../../reporter/lib");
|
|
@@ -54,4 +55,3 @@ async function waitForLogsToFlush() {
|
|
|
54
55
|
return Promise.resolve();
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
exports.waitForLogsToFlush = waitForLogsToFlush;
|
|
@@ -3,7 +3,11 @@ 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.createGitIgnoreFileFilter = createGitIgnoreFileFilter;
|
|
7
|
+
exports.contextForGeneration = contextForGeneration;
|
|
8
|
+
exports.createRepoEditFilter = createRepoEditFilter;
|
|
9
|
+
exports.generateTxtForRepository = generateTxtForRepository;
|
|
10
|
+
exports.fetchAppKnowledge = fetchAppKnowledge;
|
|
7
11
|
const fs_1 = __importDefault(require("fs"));
|
|
8
12
|
const ignore_1 = __importDefault(require("ignore"));
|
|
9
13
|
const fs_2 = require("./fs");
|
|
@@ -23,7 +27,6 @@ package-lock.json
|
|
|
23
27
|
const filter = ignoreFn.createFilter();
|
|
24
28
|
return filter;
|
|
25
29
|
}
|
|
26
|
-
exports.createGitIgnoreFileFilter = createGitIgnoreFileFilter;
|
|
27
30
|
async function contextForGeneration(file) {
|
|
28
31
|
const filter = await createGitIgnoreFileFilter();
|
|
29
32
|
return {
|
|
@@ -33,7 +36,6 @@ async function contextForGeneration(file) {
|
|
|
33
36
|
testFileContent: file ? fs_1.default.readFileSync(file, "utf-8") : "",
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
|
-
exports.contextForGeneration = contextForGeneration;
|
|
37
39
|
async function createRepoEditFilter() {
|
|
38
40
|
const allowedExtensions = /\.(ts|js|mjs|json|md)$/i;
|
|
39
41
|
const gitIgnoreFilter = await createGitIgnoreFileFilter();
|
|
@@ -42,14 +44,12 @@ async function createRepoEditFilter() {
|
|
|
42
44
|
(fs_1.default.statSync(filePath).isDirectory() || allowedExtensions.test(filePath)));
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
|
-
exports.createRepoEditFilter = createRepoEditFilter;
|
|
46
47
|
async function generateTxtForRepository() {
|
|
47
48
|
const filter = await createRepoEditFilter();
|
|
48
49
|
return {
|
|
49
50
|
prompt: await (0, fs_2.generatePromptFromDirectory)(".", filter),
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
|
-
exports.generateTxtForRepository = generateTxtForRepository;
|
|
53
53
|
async function fetchAppKnowledge() {
|
|
54
54
|
let fileExists = true;
|
|
55
55
|
const appKnowledgePath = "./app_knowledge.md";
|
|
@@ -64,4 +64,3 @@ async function fetchAppKnowledge() {
|
|
|
64
64
|
}
|
|
65
65
|
return fs_1.default.readFileSync(appKnowledgePath, "utf-8");
|
|
66
66
|
}
|
|
67
|
-
exports.fetchAppKnowledge = fetchAppKnowledge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/fs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,wBAAsB,oBAAoB,CACxC,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/fs/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,YAAK,EAChB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,0BAgBtC;AAED,wBAAgB,2BAA2B,CAAC,KAAK,GAAE,WAAW,EAAO,UAQpE;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,oBAAK,EACR,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,+BAStC;AAED,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,YAAK,EAChB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,+BAgBtC"}
|
|
@@ -3,7 +3,10 @@ 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.readFilesInDirectory = readFilesInDirectory;
|
|
7
|
+
exports.convertFileContentsToString = convertFileContentsToString;
|
|
8
|
+
exports.generatePromptFromDirectory = generatePromptFromDirectory;
|
|
9
|
+
exports.generatePromptFromNonSpecFiles = generatePromptFromNonSpecFiles;
|
|
7
10
|
const fs_1 = __importDefault(require("fs"));
|
|
8
11
|
const path_1 = __importDefault(require("path"));
|
|
9
12
|
async function readFilesInDirectory(dir = "", filterFunc) {
|
|
@@ -22,7 +25,6 @@ async function readFilesInDirectory(dir = "", filterFunc) {
|
|
|
22
25
|
}
|
|
23
26
|
return files;
|
|
24
27
|
}
|
|
25
|
-
exports.readFilesInDirectory = readFilesInDirectory;
|
|
26
28
|
function convertFileContentsToString(files = []) {
|
|
27
29
|
let prompt = "";
|
|
28
30
|
files.forEach((file) => {
|
|
@@ -32,7 +34,6 @@ function convertFileContentsToString(files = []) {
|
|
|
32
34
|
});
|
|
33
35
|
return prompt;
|
|
34
36
|
}
|
|
35
|
-
exports.convertFileContentsToString = convertFileContentsToString;
|
|
36
37
|
async function generatePromptFromDirectory(dir = "", filterFunc) {
|
|
37
38
|
try {
|
|
38
39
|
const files = await readFilesInDirectory(dir, filterFunc);
|
|
@@ -43,7 +44,6 @@ async function generatePromptFromDirectory(dir = "", filterFunc) {
|
|
|
43
44
|
console.error("Error reading directory:", error);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
exports.generatePromptFromDirectory = generatePromptFromDirectory;
|
|
47
47
|
async function generatePromptFromNonSpecFiles(dir = "", filterFunc) {
|
|
48
48
|
try {
|
|
49
49
|
let nonSpecFiles = [];
|
|
@@ -60,4 +60,3 @@ async function generatePromptFromNonSpecFiles(dir = "", filterFunc) {
|
|
|
60
60
|
console.error("Error reading directory:", error);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
exports.generatePromptFromNonSpecFiles = generatePromptFromNonSpecFiles;
|
package/dist/bin/utils/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.validateAndCompleteCliOptions = validateAndCompleteCliOptions;
|
|
7
|
+
exports.printBanner = printBanner;
|
|
7
8
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
9
|
async function validateAndCompleteCliOptions(options) {
|
|
9
10
|
// For existing flow between dashboard <> test-gen (via ci-worker)
|
|
@@ -60,7 +61,6 @@ async function validateAndCompleteCliOptions(options) {
|
|
|
60
61
|
}
|
|
61
62
|
return options;
|
|
62
63
|
}
|
|
63
|
-
exports.validateAndCompleteCliOptions = validateAndCompleteCliOptions;
|
|
64
64
|
function printBanner() {
|
|
65
65
|
const gray = "\x1b[90m";
|
|
66
66
|
const reset = "\x1b[0m";
|
|
@@ -96,4 +96,3 @@ function printBanner() {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
exports.printBanner = printBanner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAK3D,OAAO,EAGL,IAAI,EAEJ,UAAU,EAEX,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAK3D,OAAO,EAGL,IAAI,EAEJ,UAAU,EAEX,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,gCAAgC,GAC3C,YAAY,UAAU,KACrB,MAgBF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB,CA2CA;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,WAUA;AAwBD,wBAAsB,0CAA0C,CAC9D,QAAQ,EAAE,MAAM,oBA+BjB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,IAAI,GAAG,SAAS,CA4BlB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C7D;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,mCAWjB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAShD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,iBAgBrE;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAMpD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,UAcpD;AAED,wBAAsB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,+BAoBvE;AA+CD,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,UAoCtB;AAED,eAAO,MAAM,6BAA6B,GAAI,2CAI3C;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,WA0DA,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,SAAS,MAAM,EACf,WAAW,MAAM,EAAE,EACnB,cAAc,MAAM,sBAyBrB,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,EAC1C,YAAY,EACZ,QAAQ,EACR,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,iBAgDA;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,iBAsBzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,WAYA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,UAOA;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQnD"}
|
|
@@ -3,7 +3,27 @@ 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.importAllExportsStmtFromFilePaths = exports.injectCodeSnippetBySuiteChain = exports.getTestModuleAliasFromSourceFile = void 0;
|
|
7
|
+
exports.getTypescriptTestBlock = getTypescriptTestBlock;
|
|
8
|
+
exports.hasTestBlock = hasTestBlock;
|
|
9
|
+
exports.hasTopLevelDescribeConfigureWithSerialMode = hasTopLevelDescribeConfigureWithSerialMode;
|
|
10
|
+
exports.findFirstSerialDescribeBlock = findFirstSerialDescribeBlock;
|
|
11
|
+
exports.appendToTestBlock = appendToTestBlock;
|
|
12
|
+
exports.validateTypescript = validateTypescript;
|
|
13
|
+
exports.stripAndPrependImports = stripAndPrependImports;
|
|
14
|
+
exports.lintErrors = lintErrors;
|
|
15
|
+
exports.formatCode = formatCode;
|
|
16
|
+
exports.addNewImport = addNewImport;
|
|
17
|
+
exports.removeTestOnly = removeTestOnly;
|
|
18
|
+
exports.getFixtureImportPath = getFixtureImportPath;
|
|
19
|
+
exports.getPageVariableNameFromCreateTest = getPageVariableNameFromCreateTest;
|
|
20
|
+
exports.replaceCreateTestWithNewCode = replaceCreateTestWithNewCode;
|
|
21
|
+
exports.addUserContextFixture = addUserContextFixture;
|
|
22
|
+
exports.appendScopeToCreateTest = appendScopeToCreateTest;
|
|
23
|
+
exports.isTestPresent = isTestPresent;
|
|
24
|
+
exports.buildTestNamePrompt = buildTestNamePrompt;
|
|
25
|
+
exports.getVariableDeclarationsFromCode = getVariableDeclarationsFromCode;
|
|
26
|
+
exports.isSyntaxValid = isSyntaxValid;
|
|
7
27
|
const parser_1 = require("@babel/parser");
|
|
8
28
|
const eslint_1 = require("eslint");
|
|
9
29
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -71,7 +91,6 @@ function getTypescriptTestBlock({ scenarioName, suites, content, }) {
|
|
|
71
91
|
testAlias,
|
|
72
92
|
};
|
|
73
93
|
}
|
|
74
|
-
exports.getTypescriptTestBlock = getTypescriptTestBlock;
|
|
75
94
|
function hasTestBlock({ testName, testSuites, filePath, }) {
|
|
76
95
|
if (!fs_1.default.existsSync(filePath)) {
|
|
77
96
|
return false;
|
|
@@ -83,7 +102,6 @@ function hasTestBlock({ testName, testSuites, filePath, }) {
|
|
|
83
102
|
});
|
|
84
103
|
return Boolean(testBlock);
|
|
85
104
|
}
|
|
86
|
-
exports.hasTestBlock = hasTestBlock;
|
|
87
105
|
// get the names of parent describe blocks
|
|
88
106
|
function getParentDescribeNames(node) {
|
|
89
107
|
const names = [];
|
|
@@ -132,7 +150,6 @@ async function hasTopLevelDescribeConfigureWithSerialMode(filePath) {
|
|
|
132
150
|
}
|
|
133
151
|
return false;
|
|
134
152
|
}
|
|
135
|
-
exports.hasTopLevelDescribeConfigureWithSerialMode = hasTopLevelDescribeConfigureWithSerialMode;
|
|
136
153
|
/**
|
|
137
154
|
* Function to find the first 'describe' block configured with 'serial: true'
|
|
138
155
|
*
|
|
@@ -179,12 +196,10 @@ function findFirstSerialDescribeBlock(node) {
|
|
|
179
196
|
}
|
|
180
197
|
return undefined; // Return undefined if no 'describe' with serial: true is found
|
|
181
198
|
}
|
|
182
|
-
exports.findFirstSerialDescribeBlock = findFirstSerialDescribeBlock;
|
|
183
199
|
function appendToTestBlock(testBlock, content) {
|
|
184
200
|
const updateTestBlock = testBlock.replace(/\}\)$/, `\n\n${content}\n\n })`);
|
|
185
201
|
return updateTestBlock;
|
|
186
202
|
}
|
|
187
|
-
exports.appendToTestBlock = appendToTestBlock;
|
|
188
203
|
function validateTypescript(filePath) {
|
|
189
204
|
// Create a compiler host to read files
|
|
190
205
|
const compilerHost = typescript_1.default.createCompilerHost({});
|
|
@@ -225,7 +240,6 @@ function validateTypescript(filePath) {
|
|
|
225
240
|
}
|
|
226
241
|
return errors;
|
|
227
242
|
}
|
|
228
|
-
exports.validateTypescript = validateTypescript;
|
|
229
243
|
async function stripAndPrependImports(content, testName) {
|
|
230
244
|
const importRegexp = /import\s+\{[^}]*\}\s+from\s+["'][^"']+["'];?/g;
|
|
231
245
|
const imports = content.match(importRegexp);
|
|
@@ -237,7 +251,6 @@ async function stripAndPrependImports(content, testName) {
|
|
|
237
251
|
const prependContent = (imports?.join("\n") || "") + "\n\n";
|
|
238
252
|
return [prependContent, strippedContent];
|
|
239
253
|
}
|
|
240
|
-
exports.stripAndPrependImports = stripAndPrependImports;
|
|
241
254
|
async function lintErrors(filePath) {
|
|
242
255
|
const eslint = new eslint_1.ESLint({
|
|
243
256
|
fix: true,
|
|
@@ -248,7 +261,6 @@ async function lintErrors(filePath) {
|
|
|
248
261
|
fs_1.default.writeFileSync(filePath, result.output);
|
|
249
262
|
}
|
|
250
263
|
}
|
|
251
|
-
exports.lintErrors = lintErrors;
|
|
252
264
|
async function formatCode(filePath, trace) {
|
|
253
265
|
const fileContent = fs_1.default.readFileSync(filePath, "utf8");
|
|
254
266
|
if (!fileContent) {
|
|
@@ -266,11 +278,9 @@ async function formatCode(filePath, trace) {
|
|
|
266
278
|
trace?.span({ name: "prettier-format-output", output: formattedContent });
|
|
267
279
|
fs_1.default.writeFileSync(filePath, formattedContent);
|
|
268
280
|
}
|
|
269
|
-
exports.formatCode = formatCode;
|
|
270
281
|
function addNewImport(contents, modules, pkg) {
|
|
271
282
|
return `import { ${modules.join(", ")} } from "${pkg}";\n${contents}`;
|
|
272
283
|
}
|
|
273
|
-
exports.addNewImport = addNewImport;
|
|
274
284
|
async function removeTestOnly(filePath) {
|
|
275
285
|
const contents = fs_1.default.readFileSync(filePath, "utf8");
|
|
276
286
|
const updatedContent = contents
|
|
@@ -278,7 +288,6 @@ async function removeTestOnly(filePath) {
|
|
|
278
288
|
.replace("test.describe.only(", "test.describe(");
|
|
279
289
|
fs_1.default.writeFileSync(filePath, updatedContent);
|
|
280
290
|
}
|
|
281
|
-
exports.removeTestOnly = removeTestOnly;
|
|
282
291
|
function getFixtureImportPath(filePath) {
|
|
283
292
|
// get the depth from the tests folder
|
|
284
293
|
// assumption fixtures are always int the folder tests/fixtures
|
|
@@ -294,7 +303,6 @@ function getFixtureImportPath(filePath) {
|
|
|
294
303
|
].join("");
|
|
295
304
|
return fixturesPath;
|
|
296
305
|
}
|
|
297
|
-
exports.getFixtureImportPath = getFixtureImportPath;
|
|
298
306
|
async function getPageVariableNameFromCreateTest(filePath) {
|
|
299
307
|
const contents = fs_1.default.readFileSync(filePath, "utf-8");
|
|
300
308
|
const project = new ts_morph_1.Project();
|
|
@@ -311,7 +319,6 @@ async function getPageVariableNameFromCreateTest(filePath) {
|
|
|
311
319
|
// handle cases like "page as Page"
|
|
312
320
|
return pageVariableName?.split(" ")[0];
|
|
313
321
|
}
|
|
314
|
-
exports.getPageVariableNameFromCreateTest = getPageVariableNameFromCreateTest;
|
|
315
322
|
function resolveImportsFromFixtures({ fixtureImportNode, testAlias, filePath, updatedTestFile, }) {
|
|
316
323
|
const imports = {};
|
|
317
324
|
const importClause = fixtureImportNode.getImportClause();
|
|
@@ -365,7 +372,6 @@ function replaceCreateTestWithNewCode(filePath, contents, generatedCode) {
|
|
|
365
372
|
}
|
|
366
373
|
return updatedTestFile;
|
|
367
374
|
}
|
|
368
|
-
exports.replaceCreateTestWithNewCode = replaceCreateTestWithNewCode;
|
|
369
375
|
const injectCodeSnippetBySuiteChain = ({ testFileContent, codeSnippet, suites, }) => {
|
|
370
376
|
const project = new ts_morph_1.Project();
|
|
371
377
|
// Add the source file content directly into memory
|
|
@@ -474,7 +480,6 @@ async function addUserContextFixture({ scenarioName, filePath, suites, }) {
|
|
|
474
480
|
}
|
|
475
481
|
}
|
|
476
482
|
}
|
|
477
|
-
exports.addUserContextFixture = addUserContextFixture;
|
|
478
483
|
async function appendScopeToCreateTest(filePath, scopeVariables) {
|
|
479
484
|
const contents = fs_1.default.readFileSync(filePath, "utf-8");
|
|
480
485
|
const project = new ts_morph_1.Project();
|
|
@@ -493,7 +498,6 @@ async function appendScopeToCreateTest(filePath, scopeVariables) {
|
|
|
493
498
|
createTestNode.insertArgument(args.length, scopeArgStr);
|
|
494
499
|
fs_1.default.writeFileSync(filePath, sourceFile.getFullText());
|
|
495
500
|
}
|
|
496
|
-
exports.appendScopeToCreateTest = appendScopeToCreateTest;
|
|
497
501
|
function isTestPresent({ specPath, testCase, }) {
|
|
498
502
|
let isTestPresent = true;
|
|
499
503
|
isTestPresent = fs_1.default.existsSync(specPath);
|
|
@@ -507,7 +511,6 @@ function isTestPresent({ specPath, testCase, }) {
|
|
|
507
511
|
}
|
|
508
512
|
return isTestPresent;
|
|
509
513
|
}
|
|
510
|
-
exports.isTestPresent = isTestPresent;
|
|
511
514
|
function buildTestNamePrompt({ testName, suites, }) {
|
|
512
515
|
return suites?.length
|
|
513
516
|
? suites.reduce((text, suite) => {
|
|
@@ -516,7 +519,6 @@ function buildTestNamePrompt({ testName, suites, }) {
|
|
|
516
519
|
}, "") + testName
|
|
517
520
|
: testName;
|
|
518
521
|
}
|
|
519
|
-
exports.buildTestNamePrompt = buildTestNamePrompt;
|
|
520
522
|
function getVariableDeclarationsFromCode(sourceCode) {
|
|
521
523
|
const project = new ts_morph_1.Project();
|
|
522
524
|
const sourceFile = project.createSourceFile("temp.ts", sourceCode);
|
|
@@ -542,7 +544,6 @@ function getVariableDeclarationsFromCode(sourceCode) {
|
|
|
542
544
|
const allVariables = variables.flatMap((variable) => extractVariables(variable));
|
|
543
545
|
return allVariables;
|
|
544
546
|
}
|
|
545
|
-
exports.getVariableDeclarationsFromCode = getVariableDeclarationsFromCode;
|
|
546
547
|
function isSyntaxValid(code) {
|
|
547
548
|
let isSyntaxValid = true;
|
|
548
549
|
try {
|
|
@@ -553,4 +554,3 @@ function isSyntaxValid(code) {
|
|
|
553
554
|
}
|
|
554
555
|
return isSyntaxValid;
|
|
555
556
|
}
|
|
556
|
-
exports.isSyntaxValid = isSyntaxValid;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildTokenFromOptions = buildTokenFromOptions;
|
|
4
|
+
exports.buildTestConfigFromOptions = buildTestConfigFromOptions;
|
|
5
|
+
exports.loadTestConfigs = loadTestConfigs;
|
|
4
6
|
function buildTokenFromOptions(options, featureFlags) {
|
|
5
7
|
const genConfig = buildTestConfigFromOptions(options);
|
|
6
8
|
const requestConfig = {
|
|
@@ -23,7 +25,6 @@ function buildTokenFromOptions(options, featureFlags) {
|
|
|
23
25
|
};
|
|
24
26
|
return btoa(encodeURIComponent(JSON.stringify(requestConfig)));
|
|
25
27
|
}
|
|
26
|
-
exports.buildTokenFromOptions = buildTokenFromOptions;
|
|
27
28
|
function buildTestConfigFromOptions(options) {
|
|
28
29
|
return {
|
|
29
30
|
specPath: `./tests/${options.file}`,
|
|
@@ -38,7 +39,6 @@ function buildTestConfigFromOptions(options) {
|
|
|
38
39
|
},
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
exports.buildTestConfigFromOptions = buildTestConfigFromOptions;
|
|
42
42
|
function loadTestConfigs(testGenToken) {
|
|
43
43
|
const str = decodeURIComponent(atob(testGenToken));
|
|
44
44
|
const config = JSON.parse(str);
|
|
@@ -59,4 +59,3 @@ function loadTestConfigs(testGenToken) {
|
|
|
59
59
|
environment: config.environment,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
exports.loadTestConfigs = loadTestConfigs;
|
package/dist/constants/index.js
CHANGED
package/dist/file/server.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.FileServiceServer = void 0;
|
|
7
|
+
exports.startFileService = startFileService;
|
|
7
8
|
const express_1 = __importDefault(require("express"));
|
|
8
9
|
const fs_1 = __importDefault(require("fs"));
|
|
9
10
|
const path_1 = __importDefault(require("path"));
|
|
@@ -83,4 +84,3 @@ class FileServiceServer {
|
|
|
83
84
|
}
|
|
84
85
|
exports.FileServiceServer = FileServiceServer;
|
|
85
86
|
async function startFileService() { }
|
|
86
|
-
exports.startFileService = startFileService;
|
|
@@ -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.getFeedbackUsingCli =
|
|
6
|
+
exports.getFeedbackUsingCli = getFeedbackUsingCli;
|
|
7
7
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
8
|
async function getFeedbackUsingCli(message) {
|
|
9
9
|
const answers = await inquirer_1.default.prompt([
|
|
@@ -21,4 +21,3 @@ async function getFeedbackUsingCli(message) {
|
|
|
21
21
|
]);
|
|
22
22
|
return answers.feedback;
|
|
23
23
|
}
|
|
24
|
-
exports.getFeedbackUsingCli = getFeedbackUsingCli;
|
|
@@ -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.humanLoopRoute = humanLoopRoute;
|
|
7
|
+
exports.getFeedbackUsingIPC = getFeedbackUsingIPC;
|
|
7
8
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
9
|
const client_1 = __importDefault(require("../file/client"));
|
|
9
10
|
function humanLoopRoute(app) {
|
|
@@ -32,7 +33,6 @@ function humanLoopRoute(app) {
|
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
exports.humanLoopRoute = humanLoopRoute;
|
|
36
36
|
async function getFeedbackUsingIPC(message) {
|
|
37
37
|
const fileService = new client_1.default();
|
|
38
38
|
try {
|
|
@@ -44,4 +44,3 @@ async function getFeedbackUsingIPC(message) {
|
|
|
44
44
|
throw e;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
exports.getFeedbackUsingIPC = getFeedbackUsingIPC;
|
package/dist/index.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.createTest =
|
|
6
|
+
exports.createTest = createTest;
|
|
7
7
|
const llm_1 = require("@empiricalrun/llm");
|
|
8
8
|
const cua_1 = require("./agent/cua");
|
|
9
9
|
const run_1 = require("./agent/master/run");
|
|
@@ -95,4 +95,3 @@ async function createTest(task, pageRef, scope) {
|
|
|
95
95
|
await flushEvents();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
exports.createTest = createTest;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const fs = __importStar(require("fs"));
|
|
27
37
|
const path = __importStar(require("path"));
|
package/dist/reporter/index.js
CHANGED
|
@@ -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.TestGenUpdatesReporter =
|
|
6
|
+
exports.TestGenUpdatesReporter = void 0;
|
|
7
|
+
exports.getReporter = getReporter;
|
|
8
|
+
exports.setReporterConfig = setReporterConfig;
|
|
7
9
|
const r2_uploader_1 = require("@empiricalrun/r2-uploader");
|
|
8
10
|
const fs_1 = __importDefault(require("fs"));
|
|
9
11
|
const path_1 = __importDefault(require("path"));
|
|
@@ -23,7 +25,6 @@ function getReporter() {
|
|
|
23
25
|
}
|
|
24
26
|
return reporterInstance;
|
|
25
27
|
}
|
|
26
|
-
exports.getReporter = getReporter;
|
|
27
28
|
/**
|
|
28
29
|
* function will upload videos and json summary of test results to r2 and report them to reporter.
|
|
29
30
|
* method won't throw error if it fails to report
|
|
@@ -31,7 +32,6 @@ exports.getReporter = getReporter;
|
|
|
31
32
|
function setReporterConfig(config) {
|
|
32
33
|
reporterConfig = config;
|
|
33
34
|
}
|
|
34
|
-
exports.setReporterConfig = setReporterConfig;
|
|
35
35
|
class TestGenUpdatesReporter {
|
|
36
36
|
repoDir;
|
|
37
37
|
constructor() {
|
package/dist/reporter/lib.js
CHANGED
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;
|