@empiricalrun/test-gen 0.9.0 → 0.10.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 +10 -0
- package/README.md +61 -4
- package/dist/actions/goto.d.ts +4 -0
- package/dist/actions/goto.d.ts.map +1 -0
- package/dist/actions/goto.js +42 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +2 -0
- package/dist/agent/browsing/index.d.ts.map +1 -0
- package/dist/agent/{index.js → browsing/index.js} +10 -7
- package/dist/agent/browsing/run.d.ts +2 -0
- package/dist/agent/browsing/run.d.ts.map +1 -0
- package/dist/agent/browsing/run.js +38 -0
- package/dist/agent/browsing/utils.d.ts +4 -0
- package/dist/agent/browsing/utils.d.ts.map +1 -0
- package/dist/agent/browsing/utils.js +52 -0
- package/dist/agent/codegen/run.d.ts +3 -0
- package/dist/agent/codegen/run.d.ts.map +1 -0
- package/dist/agent/codegen/run.js +127 -0
- package/dist/bin/index.js +56 -167
- package/dist/bin/utils/platform/web/index.d.ts +2 -0
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +11 -1
- package/dist/index.js +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/agent/index.d.ts.map +0 -1
- /package/dist/agent/{index.d.ts → browsing/index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
1
|
# test-gen
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Our agents that generate Playwright tests. There are 2 agents
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- browsing agent
|
|
6
|
+
- code editing agent
|
|
6
7
|
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npx @empiricalrun/test-gen $args
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
where `$args` can be one of the following
|
|
15
|
+
|
|
16
|
+
### Add new test
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx @empiricalrun/test-gen base64string
|
|
7
20
|
```
|
|
8
|
-
|
|
21
|
+
|
|
22
|
+
- This will trigger browsing agent to write a new test for this scenario
|
|
23
|
+
- See [Base64 payload](#base64-payload)
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx @empiricalrun/test-gen delete.spec.ts
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- This will trigger browsing agent to write a new test in this file
|
|
30
|
+
- **Note** that the file must have `createTest(...)` where the scenario is specified
|
|
31
|
+
|
|
32
|
+
#### Bulk add
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npx @empiricalrun/test-gen scenarios.yml
|
|
36
|
+
|
|
37
|
+
# optional: filter for one scenario
|
|
38
|
+
npx @empiricalrun/test-gen scenarios.yml $scenario_name
|
|
9
39
|
```
|
|
10
40
|
|
|
11
|
-
|
|
41
|
+
Using yml or google spreadsheet. **Note** that this only runs the code editing agent
|
|
12
42
|
|
|
13
43
|
```yaml ./tests/scenarios.yaml
|
|
14
44
|
dir: ./tests/ # [optional] directory where you want to create tests. Default - ./tests
|
|
@@ -22,3 +52,30 @@ scenarios: # list of scenarios
|
|
|
22
52
|
- click on "Login Button"
|
|
23
53
|
assert: "Login successful" text should be visible # assertion
|
|
24
54
|
```
|
|
55
|
+
|
|
56
|
+
### Update existing test
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npx @empiricalrun/test-gen base64string -u
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- This will trigger code editing agent to write a new test for this scenario
|
|
63
|
+
- See [Base64 payload](#base64-payload)
|
|
64
|
+
|
|
65
|
+
### Base64 payload
|
|
66
|
+
|
|
67
|
+
Convert this object into a base64 payload - for new and update test.
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
const scenario = {
|
|
71
|
+
name: "incorrect password flow",
|
|
72
|
+
steps: [
|
|
73
|
+
"fill in the username as foobar@gmail.com",
|
|
74
|
+
"fill in the password as bazbaz",
|
|
75
|
+
"click on the login button"
|
|
76
|
+
],
|
|
77
|
+
assert: "",
|
|
78
|
+
group: "home"
|
|
79
|
+
};
|
|
80
|
+
btoa(JSON.stringify(scenario))
|
|
81
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goto.d.ts","sourceRoot":"","sources":["../../src/actions/goto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD,eAAO,MAAM,mBAAmB,EAAE,yBAoCjC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gotoActionGenerator = exports.PLAYWRIGHT_GOTO_ACTION_NAME = void 0;
|
|
4
|
+
exports.PLAYWRIGHT_GOTO_ACTION_NAME = "page_goto";
|
|
5
|
+
const gotoActionGenerator = (page) => {
|
|
6
|
+
return {
|
|
7
|
+
execute: async (args) => {
|
|
8
|
+
const url = args.url;
|
|
9
|
+
await page.goto(url);
|
|
10
|
+
await page.waitForTimeout(3000);
|
|
11
|
+
},
|
|
12
|
+
// TODO: args transformer to be kept at a single place
|
|
13
|
+
template: (args) => {
|
|
14
|
+
const url = args.url;
|
|
15
|
+
const templ = `await page.goto("${url}");`;
|
|
16
|
+
return templ;
|
|
17
|
+
},
|
|
18
|
+
name: exports.PLAYWRIGHT_GOTO_ACTION_NAME,
|
|
19
|
+
schema: {
|
|
20
|
+
type: "function",
|
|
21
|
+
function: {
|
|
22
|
+
name: exports.PLAYWRIGHT_GOTO_ACTION_NAME,
|
|
23
|
+
description: "navigate the page to a new URL",
|
|
24
|
+
parameters: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
url: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "URL to navigate page to",
|
|
30
|
+
},
|
|
31
|
+
reason: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "reason for calling this function",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: ["url", "reason"],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
exports.gotoActionGenerator = gotoActionGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAU,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAU,YAAY,EAAE,MAAM,UAAU,CAAC;AAOhD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,eAAe,CAAmC;gBAC9C,IAAI,EAAE,IAAI;IAWhB,aAAa,CAAC,IAAI,oBAAa,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAkBhE,gBAAgB,IAAI,YAAY,EAAE;IAIlC,YAAY;IAIZ,UAAU;CAMX"}
|
package/dist/actions/index.js
CHANGED
|
@@ -5,12 +5,14 @@ const assertTextVisibility_1 = require("./assertTextVisibility");
|
|
|
5
5
|
const click_1 = require("./click");
|
|
6
6
|
const done_1 = require("./done");
|
|
7
7
|
const fill_1 = require("./fill");
|
|
8
|
+
const goto_1 = require("./goto");
|
|
8
9
|
class PlaywrightActions {
|
|
9
10
|
actions;
|
|
10
11
|
recordedActions;
|
|
11
12
|
constructor(page) {
|
|
12
13
|
this.actions = [
|
|
13
14
|
(0, fill_1.fillActionGenerator)(page),
|
|
15
|
+
(0, goto_1.gotoActionGenerator)(page),
|
|
14
16
|
(0, click_1.clickActionGenerator)(page),
|
|
15
17
|
(0, done_1.doneActionGenerator)(page),
|
|
16
18
|
(0, assertTextVisibility_1.assertTextVisibilityActionGenerator)(page),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAWlC,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,GAAE;IACP,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CACE,mBA4DP"}
|
|
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.browsingAgent = void 0;
|
|
7
|
-
const actions_1 = require("
|
|
8
|
-
const ai_1 = require("
|
|
9
|
-
const provider_1 = require("
|
|
10
|
-
const trace_1 = __importDefault(require("
|
|
11
|
-
const
|
|
7
|
+
const actions_1 = require("../../actions");
|
|
8
|
+
const ai_1 = require("../../bin/ai");
|
|
9
|
+
const provider_1 = require("../../bin/ai/prompts/provider");
|
|
10
|
+
const trace_1 = __importDefault(require("../../bin/ai/trace"));
|
|
11
|
+
const logger_1 = require("../../bin/logger");
|
|
12
|
+
const html_1 = require("../../utils/html");
|
|
13
|
+
const logger = new logger_1.CustomLogger();
|
|
12
14
|
async function browsingAgent(task, page, options = {}) {
|
|
13
15
|
const trace = new trace_1.default({ name: "browsing-agent" });
|
|
14
16
|
const actions = new actions_1.PlaywrightActions(page);
|
|
@@ -54,14 +56,15 @@ async function browsingAgent(task, page, options = {}) {
|
|
|
54
56
|
catch (e) {
|
|
55
57
|
// TODO: implement feedback loop to llm
|
|
56
58
|
lastActionErrors.push(e.message);
|
|
57
|
-
|
|
59
|
+
logger.error(e);
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
isTaskDone = actions.isComplete();
|
|
61
63
|
}
|
|
62
64
|
const code = actions.generateCode();
|
|
63
65
|
trace.update({ input: { task }, output: { code } });
|
|
64
|
-
|
|
66
|
+
logger.success("Successfully generated code for the given task");
|
|
67
|
+
logger.log("Trace:", trace.url);
|
|
65
68
|
return code;
|
|
66
69
|
}
|
|
67
70
|
exports.browsingAgent = browsingAgent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAOA,wBAAsB,+BAA+B,CAAC,YAAY,EAAE,MAAM,iBAwBzE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.generateTestsUsingBrowsingAgent = void 0;
|
|
7
|
+
const detect_port_1 = __importDefault(require("detect-port"));
|
|
8
|
+
const web_1 = require("../../bin/utils/platform/web");
|
|
9
|
+
const server_1 = require("../../file/server");
|
|
10
|
+
const exec_1 = require("../../utils/exec");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
async function generateTestsUsingBrowsingAgent(testFilePath) {
|
|
13
|
+
(0, utils_1.canRunBrowsingAgent)(testFilePath);
|
|
14
|
+
const port = await (0, detect_port_1.default)(3030);
|
|
15
|
+
const fileService = new server_1.FileService({ port });
|
|
16
|
+
await fileService.startFileService();
|
|
17
|
+
try {
|
|
18
|
+
fileService.setFilePath(testFilePath);
|
|
19
|
+
//TODO: change this to per test
|
|
20
|
+
//TODO: support multiple projects (browsers)
|
|
21
|
+
const command = [`npx`, `playwright`, `test`, testFilePath];
|
|
22
|
+
if (!process.env.CI) {
|
|
23
|
+
command.push(`--headed`);
|
|
24
|
+
}
|
|
25
|
+
await (0, exec_1.cmd)(command, {
|
|
26
|
+
env: {
|
|
27
|
+
APP_PORT: port.toString(),
|
|
28
|
+
PW_TEST_HTML_REPORT_OPEN: "never",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
await (0, web_1.removeTestOnly)(testFilePath);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
// TODO: better error handling -- e.g. undo preparation work
|
|
35
|
+
console.error(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.generateTestsUsingBrowsingAgent = generateTestsUsingBrowsingAgent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,wBAAsB,2BAA2B,CAAC,SAAS,EAAE,aAAa,iBAiBzE;AAWD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,QA4BnD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.canRunBrowsingAgent = exports.prepareFileForBrowsingAgent = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const logger_1 = require("../../bin/logger");
|
|
10
|
+
const web_1 = require("../../bin/utils/platform/web");
|
|
11
|
+
async function prepareFileForBrowsingAgent(genConfig) {
|
|
12
|
+
const { specPath, scenarios } = genConfig;
|
|
13
|
+
const { name, steps, assert } = scenarios[0];
|
|
14
|
+
const mergedSteps = `${steps.join("\n")}\n${assert}`;
|
|
15
|
+
if (!fs_extra_1.default.existsSync(specPath)) {
|
|
16
|
+
await fs_extra_1.default.writeFile(specPath, (0, web_1.addNewImport)("", ["test", "expect"], "@playwright/test"));
|
|
17
|
+
}
|
|
18
|
+
// TODO: this assumes that test code repo has `page` as the main entrypoint fixture
|
|
19
|
+
const existingContents = await fs_extra_1.default.readFile(specPath, "utf-8");
|
|
20
|
+
const newContents = `${existingContents}\n\n${createTestGenBlock(name, mergedSteps)}`;
|
|
21
|
+
await fs_extra_1.default.writeFile(specPath, (0, web_1.addNewImport)(newContents, ["createTest"], "@empiricalrun/test-gen"));
|
|
22
|
+
}
|
|
23
|
+
exports.prepareFileForBrowsingAgent = prepareFileForBrowsingAgent;
|
|
24
|
+
function createTestGenBlock(name, steps) {
|
|
25
|
+
return `
|
|
26
|
+
test.only("${name}", async ({page}) => {
|
|
27
|
+
await createTest(\`
|
|
28
|
+
${steps}\`, page, test);
|
|
29
|
+
});
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
function canRunBrowsingAgent(filePath) {
|
|
33
|
+
if (!fs_extra_1.default.existsSync(filePath)) {
|
|
34
|
+
throw new Error(`File for browsing agent to run not found: ${filePath}`);
|
|
35
|
+
}
|
|
36
|
+
const { dependencies: installedPackages } = JSON.parse((0, child_process_1.execSync)("npm ls --json").toString());
|
|
37
|
+
const hasPwTestInstalled = installedPackages["@playwright/test"];
|
|
38
|
+
const testGenInstalled = installedPackages["@empiricalrun/test-gen"];
|
|
39
|
+
const linterInstalled = installedPackages["eslint"];
|
|
40
|
+
const testGenVersion = testGenInstalled.version;
|
|
41
|
+
const latestTestGenVersion = (0, child_process_1.execSync)("npm view @empiricalrun/test-gen version")
|
|
42
|
+
.toString()
|
|
43
|
+
.trim();
|
|
44
|
+
if (!hasPwTestInstalled || !testGenInstalled || !linterInstalled) {
|
|
45
|
+
throw new Error(`Missing packages: browsing agent requires playwright, linter, and @empiricalrun/test-gen to be installed`);
|
|
46
|
+
}
|
|
47
|
+
if (testGenVersion !== latestTestGenVersion) {
|
|
48
|
+
const logger = new logger_1.CustomLogger();
|
|
49
|
+
logger.warn(`Outdated @empiricalrun/test-gen package: expected ${latestTestGenVersion}, got ${testGenVersion}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.canRunBrowsingAgent = canRunBrowsingAgent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,wBAAsB,YAAY,CAChC,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,EAAE,CAAC,CA0HrB"}
|
|
@@ -0,0 +1,127 @@
|
|
|
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.generateTest = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const ai_1 = require("../../bin/ai");
|
|
9
|
+
const provider_1 = require("../../bin/ai/prompts/provider");
|
|
10
|
+
const trace_1 = __importDefault(require("../../bin/ai/trace"));
|
|
11
|
+
const logger_1 = require("../../bin/logger");
|
|
12
|
+
const context_1 = require("../../bin/utils/context");
|
|
13
|
+
const web_1 = require("../../bin/utils/platform/web");
|
|
14
|
+
const logger = new logger_1.CustomLogger();
|
|
15
|
+
async function generateTest(scenarios, file, isUpdate) {
|
|
16
|
+
const context = await (0, context_1.contextForGeneration)(file);
|
|
17
|
+
const { codePrompt, pomPrompt, testFileContent } = context;
|
|
18
|
+
const generatedScenarios = [];
|
|
19
|
+
for (const i in scenarios) {
|
|
20
|
+
logger.logEmptyLine();
|
|
21
|
+
const trace = new trace_1.default({ name: "generate-test" });
|
|
22
|
+
trace.event({
|
|
23
|
+
name: "collate-files-as-text",
|
|
24
|
+
output: {
|
|
25
|
+
codePrompt,
|
|
26
|
+
pomPrompt,
|
|
27
|
+
testFileContent,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const scenario = scenarios[i];
|
|
31
|
+
trace.update({ input: { scenario } });
|
|
32
|
+
logger.log("Generating test for scenario:", scenario?.name);
|
|
33
|
+
if (!isUpdate && testFileContent.includes(`test("${scenario?.name}"`)) {
|
|
34
|
+
logger.success("Test already exists for this scenario");
|
|
35
|
+
trace.event({ name: "test-already-exists" });
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const promptSpan = trace.startSpan(isUpdate ? "update-scenario-prompt" : "add-scenario-prompt");
|
|
39
|
+
const promptName = isUpdate ? "update-scenario" : "add-scenario";
|
|
40
|
+
const instruction = await (0, provider_1.getPrompt)(promptName, {
|
|
41
|
+
testFiles: codePrompt,
|
|
42
|
+
pageFiles: pomPrompt,
|
|
43
|
+
scenarioName: scenario.name,
|
|
44
|
+
scenarioSteps: scenario.steps.join("\n"),
|
|
45
|
+
assert: scenario.assert,
|
|
46
|
+
scenarioFile: file,
|
|
47
|
+
});
|
|
48
|
+
promptSpan.end({ output: { instruction } });
|
|
49
|
+
const firstShotMessage = await (0, ai_1.getLLMResult)({
|
|
50
|
+
messages: instruction,
|
|
51
|
+
trace,
|
|
52
|
+
});
|
|
53
|
+
let response = firstShotMessage?.content || "";
|
|
54
|
+
logger.success("Test generated successfully!");
|
|
55
|
+
const readWriteFileSpan = trace.startSpan("write-to-file");
|
|
56
|
+
let contents = fs_extra_1.default.readFileSync(file, "utf-8");
|
|
57
|
+
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response);
|
|
58
|
+
let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
|
|
59
|
+
if (isUpdate) {
|
|
60
|
+
const testBlock = (0, web_1.getTypescriptTestBlock)(scenario?.name, contents);
|
|
61
|
+
contents = contents.replace(testBlock[0], `\n\n${strippedContent}`);
|
|
62
|
+
updatedContent = prependContent + contents;
|
|
63
|
+
}
|
|
64
|
+
await fs_extra_1.default.writeFile(file, updatedContent, "utf-8");
|
|
65
|
+
readWriteFileSpan.end({ output: { updatedContent } });
|
|
66
|
+
logger.log("Linting generated code...");
|
|
67
|
+
trace.event({ name: "lint-file" });
|
|
68
|
+
await (0, web_1.lintErrors)(file);
|
|
69
|
+
const validateTypesSpan = trace.startSpan("detect-type-errors-in-file");
|
|
70
|
+
logger.log("Validating types...");
|
|
71
|
+
let errors = (0, web_1.validateTypescript)(file);
|
|
72
|
+
validateTypesSpan.end({ output: { errors } });
|
|
73
|
+
if (!errors.length) {
|
|
74
|
+
logger.success("Found no type issues!");
|
|
75
|
+
}
|
|
76
|
+
const maxIteration = 2;
|
|
77
|
+
let counter = 0;
|
|
78
|
+
while (errors.length > 0) {
|
|
79
|
+
const fileContent = fs_extra_1.default.readFileSync(file, "utf-8");
|
|
80
|
+
counter += 1;
|
|
81
|
+
if (counter > maxIteration) {
|
|
82
|
+
trace.event({ name: "code-fix-iteration-max-out" });
|
|
83
|
+
logger.error([
|
|
84
|
+
`Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
|
|
85
|
+
`Run the test-gen command again, once errors are fixed.`,
|
|
86
|
+
`Trace: ${trace.url}`,
|
|
87
|
+
].join("\n"));
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
trace.event({ name: "Found errors fixing" });
|
|
91
|
+
logger.warn("Found few errors while validating types:");
|
|
92
|
+
errors.forEach((e) => logger.warn(e));
|
|
93
|
+
logger.log("Trying to fix above errors...");
|
|
94
|
+
const promptSpan = trace.startSpan("fix-type-errors-prompt");
|
|
95
|
+
const instruction = await (0, provider_1.getPrompt)("fix-file-errors-ts", {
|
|
96
|
+
testFiles: codePrompt || "",
|
|
97
|
+
pageFiles: pomPrompt || "",
|
|
98
|
+
scenarioFile: file,
|
|
99
|
+
errors: errors,
|
|
100
|
+
fileContent: fileContent,
|
|
101
|
+
scenaioName: scenario.name,
|
|
102
|
+
});
|
|
103
|
+
promptSpan.end({ output: { instruction } });
|
|
104
|
+
const message = await (0, ai_1.getLLMResult)({ messages: instruction, trace });
|
|
105
|
+
response = message?.content || "";
|
|
106
|
+
const readWriteFileSpan = trace.startSpan("write-to-file");
|
|
107
|
+
await fs_extra_1.default.writeFile(file, response, "utf-8");
|
|
108
|
+
readWriteFileSpan.end({ output: { response } });
|
|
109
|
+
trace.event({ name: "lint-file" });
|
|
110
|
+
await (0, web_1.lintErrors)(file);
|
|
111
|
+
const validateTypesSpan = trace.startSpan("detect-type-errors-in-file");
|
|
112
|
+
errors = (0, web_1.validateTypescript)(file);
|
|
113
|
+
validateTypesSpan.end({ output: { errors } });
|
|
114
|
+
if (!errors.length) {
|
|
115
|
+
logger.success("Found no type issues!");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
trace.event({ name: "format-file" });
|
|
119
|
+
await (0, web_1.formatCode)(file);
|
|
120
|
+
logger.success("File formatted successfully!");
|
|
121
|
+
logger.log(`Trace: ${trace.url}`);
|
|
122
|
+
generatedScenarios.push(scenario);
|
|
123
|
+
trace.update({ input: { scenario }, output: { response } });
|
|
124
|
+
}
|
|
125
|
+
return generatedScenarios;
|
|
126
|
+
}
|
|
127
|
+
exports.generateTest = generateTest;
|
package/dist/bin/index.js
CHANGED
|
@@ -4,195 +4,84 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const detect_port_1 = __importDefault(require("detect-port"));
|
|
8
7
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const provider_1 = require("./ai/prompts/provider");
|
|
14
|
-
const trace_1 = __importDefault(require("./ai/trace"));
|
|
9
|
+
const run_1 = require("../agent/browsing/run");
|
|
10
|
+
const utils_1 = require("../agent/browsing/utils");
|
|
11
|
+
const run_2 = require("../agent/codegen/run");
|
|
15
12
|
const logger_1 = require("./logger");
|
|
16
13
|
const ci_1 = require("./reporter/ci");
|
|
17
14
|
const scenarios_1 = require("./scenarios");
|
|
18
|
-
const context_1 = require("./utils/context");
|
|
19
|
-
const web_1 = require("./utils/platform/web");
|
|
20
15
|
dotenv_1.default.config({
|
|
21
16
|
path: [".env.local", ".env"],
|
|
22
17
|
});
|
|
23
18
|
const logger = new logger_1.CustomLogger();
|
|
24
|
-
async function
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
output: {
|
|
34
|
-
codePrompt,
|
|
35
|
-
pomPrompt,
|
|
36
|
-
testFileContent,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
const scenario = scenarios[i];
|
|
40
|
-
trace.update({ input: { scenario } });
|
|
41
|
-
logger.log("Generating test for scenario:", scenario?.name);
|
|
42
|
-
if (!isUpdate && testFileContent.includes(`test("${scenario?.name}"`)) {
|
|
43
|
-
logger.success("Test already exists for this scenario");
|
|
44
|
-
trace.event({ name: "test-already-exists" });
|
|
45
|
-
continue;
|
|
19
|
+
async function runAgent(sourceFile, isUpdate, testGenConfigs) {
|
|
20
|
+
const compatibleWithBrowsing = !sourceFile.endsWith(".yaml") &&
|
|
21
|
+
!sourceFile.startsWith("https://docs.google.com/spreadsheets") &&
|
|
22
|
+
!isUpdate;
|
|
23
|
+
if (compatibleWithBrowsing) {
|
|
24
|
+
const testGenConfig = testGenConfigs[0];
|
|
25
|
+
let fileForBrowsingAgent;
|
|
26
|
+
if (sourceFile.endsWith(".ts")) {
|
|
27
|
+
fileForBrowsingAgent = sourceFile;
|
|
46
28
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
testFiles: codePrompt,
|
|
51
|
-
pageFiles: pomPrompt,
|
|
52
|
-
scenarioName: scenario.name,
|
|
53
|
-
scenarioSteps: scenario.steps.join("\n"),
|
|
54
|
-
assert: scenario.assert,
|
|
55
|
-
scenarioFile: file,
|
|
56
|
-
});
|
|
57
|
-
promptSpan.end({ output: { instruction } });
|
|
58
|
-
const firstShotMessage = await (0, ai_1.getLLMResult)({
|
|
59
|
-
messages: instruction,
|
|
60
|
-
trace,
|
|
61
|
-
});
|
|
62
|
-
let response = firstShotMessage?.content || "";
|
|
63
|
-
logger.success("Test generated successfully!");
|
|
64
|
-
const readWriteFileSpan = trace.startSpan("write-to-file");
|
|
65
|
-
let contents = fs_extra_1.default.readFileSync(file, "utf-8");
|
|
66
|
-
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(response);
|
|
67
|
-
let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
|
|
68
|
-
if (isUpdate) {
|
|
69
|
-
const testBlock = (0, web_1.getTypescriptTestBlock)(scenario?.name, contents);
|
|
70
|
-
contents = contents.replace(testBlock[0], `\n\n${strippedContent}`);
|
|
71
|
-
updatedContent = prependContent + contents;
|
|
29
|
+
else {
|
|
30
|
+
fileForBrowsingAgent = testGenConfig.specPath;
|
|
31
|
+
await (0, utils_1.prepareFileForBrowsingAgent)(testGenConfig);
|
|
72
32
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
await (0, web_1.lintErrors)(file);
|
|
78
|
-
const validateTypesSpan = trace.startSpan("detect-type-errors-in-file");
|
|
79
|
-
logger.log("Validating types...");
|
|
80
|
-
let errors = (0, web_1.validateTypescript)(file);
|
|
81
|
-
validateTypesSpan.end({ output: { errors } });
|
|
82
|
-
if (!errors.length) {
|
|
83
|
-
logger.success("Found no type issues!");
|
|
33
|
+
if (fileForBrowsingAgent) {
|
|
34
|
+
logger.success("Generating tests using browsing agent");
|
|
35
|
+
await (0, run_1.generateTestsUsingBrowsingAgent)(fileForBrowsingAgent);
|
|
36
|
+
process.exit(0);
|
|
84
37
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
logger.error([
|
|
93
|
-
`Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
|
|
94
|
-
`Run the test-gen command again, once errors are fixed.`,
|
|
95
|
-
`[Trace: ${trace.url}]`,
|
|
96
|
-
].join("\n"));
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
trace.event({ name: "Found errors fixing" });
|
|
100
|
-
logger.warn("Found few errors while validating types:");
|
|
101
|
-
errors.forEach((e) => logger.warn(e));
|
|
102
|
-
logger.log("Trying to fix above errors...");
|
|
103
|
-
const promptSpan = trace.startSpan("fix-type-errors-prompt");
|
|
104
|
-
const instruction = await (0, provider_1.getPrompt)("fix-file-errors-ts", {
|
|
105
|
-
testFiles: codePrompt || "",
|
|
106
|
-
pageFiles: pomPrompt || "",
|
|
107
|
-
scenarioFile: file,
|
|
108
|
-
errors: errors,
|
|
109
|
-
fileContent: fileContent,
|
|
110
|
-
scenaioName: scenario.name,
|
|
111
|
-
});
|
|
112
|
-
promptSpan.end({ output: { instruction } });
|
|
113
|
-
const message = await (0, ai_1.getLLMResult)({ messages: instruction, trace });
|
|
114
|
-
response = message?.content || "";
|
|
115
|
-
const readWriteFileSpan = trace.startSpan("write-to-file");
|
|
116
|
-
await fs_extra_1.default.writeFile(file, response, "utf-8");
|
|
117
|
-
readWriteFileSpan.end({ output: { response } });
|
|
118
|
-
trace.event({ name: "lint-file" });
|
|
119
|
-
await (0, web_1.lintErrors)(file);
|
|
120
|
-
const validateTypesSpan = trace.startSpan("detect-type-errors-in-file");
|
|
121
|
-
errors = (0, web_1.validateTypescript)(file);
|
|
122
|
-
validateTypesSpan.end({ output: { errors } });
|
|
123
|
-
if (!errors.length) {
|
|
124
|
-
logger.success("Found no type issues!");
|
|
125
|
-
}
|
|
38
|
+
}
|
|
39
|
+
const generatedTestScenarios = [];
|
|
40
|
+
for (const testGenConfig of testGenConfigs) {
|
|
41
|
+
const { specPath, scenarios } = testGenConfig;
|
|
42
|
+
if (!fs_extra_1.default.existsSync(specPath)) {
|
|
43
|
+
logger.log(`Creating a new spec file: ${specPath}`);
|
|
44
|
+
fs_extra_1.default.createFileSync(specPath);
|
|
126
45
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
logger.success("File formatted successfully!", `[Trace: ${trace.url}]`);
|
|
130
|
-
generatedScenarios.push(scenario);
|
|
131
|
-
trace.update({ input: { scenario }, output: { response } });
|
|
46
|
+
const gen = await (0, run_2.generateTest)(scenarios, specPath, isUpdate);
|
|
47
|
+
generatedTestScenarios.push(...gen);
|
|
132
48
|
}
|
|
133
|
-
return
|
|
49
|
+
return generatedTestScenarios;
|
|
134
50
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
console.error("test file path is required");
|
|
139
|
-
process.exit(1);
|
|
140
|
-
}
|
|
141
|
-
const port = await (0, detect_port_1.default)(3030);
|
|
142
|
-
const fileService = new server_1.FileService({ port });
|
|
143
|
-
await fileService.startFileService();
|
|
144
|
-
try {
|
|
145
|
-
fileService.setFilePath(testFilePath);
|
|
146
|
-
//TODO: change this to per test
|
|
147
|
-
await (0, exec_1.cmd)([`npx`, `playwright`, `test`, testFilePath, "--headed"], {
|
|
148
|
-
env: {
|
|
149
|
-
APP_PORT: port.toString(),
|
|
150
|
-
PW_TEST_HTML_REPORT_OPEN: "never",
|
|
151
|
-
},
|
|
152
|
-
});
|
|
153
|
-
process.exit(0);
|
|
51
|
+
function filterConfigsByScenarioName(testGenConfigs, scenarioName) {
|
|
52
|
+
if (!scenarioName) {
|
|
53
|
+
return testGenConfigs;
|
|
154
54
|
}
|
|
155
|
-
|
|
156
|
-
|
|
55
|
+
const filteredConfigs = testGenConfigs.filter((t) => t.scenarios.some((s) => s.name === scenarioName));
|
|
56
|
+
// if no config available then throw error
|
|
57
|
+
if (testGenConfigs.length == 0) {
|
|
58
|
+
logger.error("No scenarios found for the given scenario name", scenarioName);
|
|
157
59
|
process.exit(1);
|
|
158
60
|
}
|
|
61
|
+
filteredConfigs.map((config) => {
|
|
62
|
+
config.scenarios = config.scenarios.filter((s) => s.name === scenarioName);
|
|
63
|
+
return config;
|
|
64
|
+
});
|
|
65
|
+
return filteredConfigs;
|
|
66
|
+
}
|
|
67
|
+
async function parseArgs() {
|
|
68
|
+
const scenarioOrScenariosPath = process.argv[2];
|
|
69
|
+
const isUpdate = process.argv.includes("-u");
|
|
70
|
+
const scenarioToFilter = process.argv[3] === "-u" ? "" : process.argv[3];
|
|
71
|
+
const testGenConfigs = filterConfigsByScenarioName(await (0, scenarios_1.loadScenarios)(scenarioOrScenariosPath), scenarioToFilter);
|
|
72
|
+
return {
|
|
73
|
+
sourceFile: scenarioOrScenariosPath,
|
|
74
|
+
testGenConfigs,
|
|
75
|
+
isUpdate,
|
|
76
|
+
};
|
|
159
77
|
}
|
|
160
78
|
(async function main() {
|
|
161
79
|
if (process.argv.length < 3) {
|
|
162
80
|
logger.error("Please provide path to scenarios using command:", "npx @empiricalrun/test-gen <SCENARIOS_FILE_PATH> <SCENARIO_NAME> -u");
|
|
163
81
|
process.exit(1);
|
|
164
82
|
}
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
await generateTestsUsingBrowsingAgent();
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const scenario = process.argv[3] === "-u" ? "" : process.argv[3];
|
|
173
|
-
const isUpdate = process.argv.includes("-u");
|
|
174
|
-
let testGenConfigs = await (0, scenarios_1.loadScenarios)(scenariosPath);
|
|
175
|
-
if (scenario) {
|
|
176
|
-
// filter config
|
|
177
|
-
testGenConfigs = testGenConfigs.filter((t) => t.scenarios.some((s) => s.name === scenario));
|
|
178
|
-
// if no config available then throw error
|
|
179
|
-
if (testGenConfigs.length == 0) {
|
|
180
|
-
logger.error("No scenarios found for the given scenario name", scenario);
|
|
181
|
-
process.exit(1);
|
|
182
|
-
}
|
|
183
|
-
const [testGenConfig] = testGenConfigs;
|
|
184
|
-
// filter scenarios
|
|
185
|
-
testGenConfig.scenarios = testGenConfig.scenarios.filter((s) => s.name === scenario);
|
|
186
|
-
}
|
|
187
|
-
const generatedTestScenarios = [];
|
|
188
|
-
for (const testGenConfig of testGenConfigs) {
|
|
189
|
-
const { specPath, scenarios } = testGenConfig;
|
|
190
|
-
if (!fs_extra_1.default.existsSync(specPath)) {
|
|
191
|
-
logger.log(`Creating a new spec file: ${specPath}`);
|
|
192
|
-
fs_extra_1.default.createFileSync(specPath);
|
|
193
|
-
}
|
|
194
|
-
const gen = await generateTest(scenarios, specPath, isUpdate);
|
|
195
|
-
generatedTestScenarios.push(...gen);
|
|
196
|
-
}
|
|
197
|
-
await (0, ci_1.reportOnCI)(generatedTestScenarios);
|
|
83
|
+
const { sourceFile, testGenConfigs, isUpdate } = await parseArgs();
|
|
84
|
+
const generated = await runAgent(sourceFile, isUpdate, testGenConfigs);
|
|
85
|
+
// TODO: make this work with browsing agent
|
|
86
|
+
await (0, ci_1.reportOnCI)(generated);
|
|
198
87
|
})();
|
|
@@ -3,4 +3,6 @@ export declare function validateTypescript(filePath: string): string[];
|
|
|
3
3
|
export declare function stripAndPrependImports(content: string): Promise<string[]>;
|
|
4
4
|
export declare function lintErrors(filePath: string): Promise<void>;
|
|
5
5
|
export declare function formatCode(filePath: string): Promise<void>;
|
|
6
|
+
export declare function addNewImport(contents: string, modules: string[], pkg: string): string;
|
|
7
|
+
export declare function removeTestOnly(filePath: string): Promise<void>;
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAG3E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwC7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,qBAM3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAOhD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,0BAG3E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAwC7D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,qBAM3D;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAOhD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAIpD"}
|
|
@@ -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.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.getTypescriptTestBlock = void 0;
|
|
6
|
+
exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.getTypescriptTestBlock = void 0;
|
|
7
7
|
const eslint_1 = require("eslint");
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const prettier_1 = __importDefault(require("prettier"));
|
|
@@ -78,3 +78,13 @@ async function formatCode(filePath) {
|
|
|
78
78
|
fs_extra_1.default.writeFileSync(filePath, formattedContent);
|
|
79
79
|
}
|
|
80
80
|
exports.formatCode = formatCode;
|
|
81
|
+
function addNewImport(contents, modules, pkg) {
|
|
82
|
+
return `import { ${modules.join(", ")} } from "${pkg}";\n${contents}`;
|
|
83
|
+
}
|
|
84
|
+
exports.addNewImport = addNewImport;
|
|
85
|
+
async function removeTestOnly(filePath) {
|
|
86
|
+
const contents = await fs_extra_1.default.readFile(filePath, "utf8");
|
|
87
|
+
const updatedContent = contents.replace(/test\.only/, "test");
|
|
88
|
+
return fs_extra_1.default.writeFile(filePath, updatedContent);
|
|
89
|
+
}
|
|
90
|
+
exports.removeTestOnly = removeTestOnly;
|
package/dist/index.js
CHANGED
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createTest = void 0;
|
|
7
|
-
const
|
|
7
|
+
const browsing_1 = require("./agent/browsing");
|
|
8
8
|
const client_1 = __importDefault(require("./file/client"));
|
|
9
9
|
async function createTest(task, page, test) {
|
|
10
10
|
const port = process.env.APP_PORT || 3030;
|
|
11
11
|
const fileService = new client_1.default(Number(port));
|
|
12
12
|
test.setTimeout(900000);
|
|
13
|
-
const code = await (0,
|
|
13
|
+
const code = await (0, browsing_1.browsingAgent)(task, page, {
|
|
14
14
|
htmlSanitize: {
|
|
15
15
|
disallowedStrings: ["v-data-table__td v-data-table-column--align-start"],
|
|
16
16
|
},
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC;AAEtE,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,CACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACtB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IACrD,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAC1B,MAAM,CAAC;CACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQlC,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,GAAE;IACP,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CACE,mBAgEP"}
|
|
File without changes
|