@empiricalrun/test-gen 0.71.2 → 0.73.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 +57 -0
- package/dist/agent/chat/agent-loop.d.ts +11 -9
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.js +20 -10
- package/dist/agent/chat/exports.d.ts +2 -2
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +6 -1
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +53 -28
- package/dist/agent/chat/prompt/index.d.ts +2 -2
- package/dist/agent/chat/prompt/index.d.ts.map +1 -1
- package/dist/agent/chat/prompt/index.js +5 -4
- package/dist/agent/chat/prompt/repo.d.ts +2 -2
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +20 -11
- package/dist/agent/chat/state.d.ts +2 -2
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/types.d.ts +0 -6
- package/dist/agent/chat/types.d.ts.map +1 -1
- package/dist/agent/chat/utils/tool-calls.d.ts +21 -0
- package/dist/agent/chat/utils/tool-calls.d.ts.map +1 -0
- package/dist/agent/chat/utils/tool-calls.js +64 -0
- package/dist/agent/chat/utils.d.ts +2 -4
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/chat/utils.js +5 -11
- package/dist/agent/code-review/prompt.d.ts +2 -0
- package/dist/agent/code-review/prompt.d.ts.map +1 -0
- package/dist/agent/code-review/prompt.js +19 -0
- package/dist/agent/codegen/create-test-block.d.ts.map +1 -1
- package/dist/agent/codegen/create-test-block.js +0 -10
- package/dist/agent/diagnosis-agent/index.d.ts.map +1 -1
- package/dist/agent/diagnosis-agent/index.js +0 -9
- package/dist/agent/master/browser-tests/index.spec.js +1 -1
- 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-skill-action.d.ts +1 -1
- package/dist/agent/master/execute-skill-action.d.ts.map +1 -1
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +0 -74
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/index.js +18 -6
- package/dist/artifacts/utils.d.ts +2 -2
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/artifacts/utils.js +16 -5
- package/dist/auth/cli-auth.d.ts.map +1 -1
- package/dist/auth/cli-auth.js +3 -7
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -4
- package/dist/auth/token-store.d.ts +1 -1
- package/dist/auth/token-store.d.ts.map +1 -1
- package/dist/auth/token-store.js +3 -3
- package/dist/bin/environments.d.ts +5 -1
- package/dist/bin/environments.d.ts.map +1 -1
- package/dist/bin/environments.js +76 -44
- package/dist/bin/index.js +33 -74
- package/dist/bin/setup.d.ts +3 -1
- package/dist/bin/setup.d.ts.map +1 -1
- package/dist/bin/setup.js +16 -20
- package/dist/dashboard/client.d.ts +26 -0
- package/dist/dashboard/client.d.ts.map +1 -0
- package/dist/dashboard/client.js +185 -0
- package/dist/dashboard/index.d.ts +3 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +9 -0
- package/dist/dashboard/totp.d.ts +2 -0
- package/dist/dashboard/totp.d.ts.map +1 -0
- package/dist/dashboard/totp.js +14 -0
- package/dist/dashboard/types.d.ts +9 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +17 -0
- package/dist/file-info/file-system.d.ts +3 -0
- package/dist/file-info/file-system.d.ts.map +1 -0
- package/dist/{utils/file-tree.js → file-info/file-system.js} +2 -8
- package/dist/file-info/github.d.ts +3 -0
- package/dist/file-info/github.d.ts.map +1 -0
- package/dist/file-info/github.js +107 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -9
- package/dist/recorder/env-variables.d.ts.map +1 -1
- package/dist/recorder/env-variables.js +3 -7
- package/dist/recorder/index.js +5 -5
- package/dist/recorder/request.js +4 -9
- package/dist/recorder/upload.d.ts +3 -2
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/recorder/upload.js +20 -22
- package/dist/tools/commit-and-create-pr.d.ts.map +1 -1
- package/dist/tools/commit-and-create-pr.js +44 -37
- package/dist/tools/definitions/run-test.d.ts +23 -0
- package/dist/tools/definitions/run-test.d.ts.map +1 -0
- package/dist/tools/definitions/run-test.js +28 -0
- package/dist/tools/definitions/str_replace_editor.d.ts +3 -0
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -0
- package/dist/tools/definitions/str_replace_editor.js +74 -0
- package/dist/tools/definitions/test-gen-browser.d.ts +26 -0
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -0
- package/dist/tools/definitions/test-gen-browser.js +88 -0
- package/dist/tools/delete-file.d.ts +3 -0
- package/dist/tools/delete-file.d.ts.map +1 -0
- package/dist/tools/delete-file.js +83 -0
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +3 -7
- package/dist/tools/executor/index.d.ts +24 -0
- package/dist/tools/executor/index.d.ts.map +1 -0
- package/dist/{tool-call-service → tools/executor}/index.js +38 -58
- package/dist/tools/executor/utils/checkpoint.d.ts +7 -0
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -0
- package/dist/{utils → tools/executor/utils}/checkpoint.js +6 -5
- package/dist/{utils → tools/executor/utils}/git.d.ts +7 -12
- package/dist/tools/executor/utils/git.d.ts.map +1 -0
- package/dist/{utils → tools/executor/utils}/git.js +11 -36
- package/dist/tools/executor/utils/index.d.ts +77 -0
- package/dist/tools/executor/utils/index.d.ts.map +1 -0
- package/dist/tools/executor/utils/index.js +121 -0
- package/dist/tools/executor/utils/pr-description.d.ts +4 -0
- package/dist/tools/executor/utils/pr-description.d.ts.map +1 -0
- package/dist/tools/executor/utils/pr-description.js +24 -0
- package/dist/tools/fetch-image/index.d.ts +3 -0
- package/dist/tools/fetch-image/index.d.ts.map +1 -0
- package/dist/tools/fetch-image/index.js +56 -0
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +1 -1
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +60 -0
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-environments.js +2 -5
- package/dist/tools/merge-conflicts.d.ts +3 -0
- package/dist/tools/merge-conflicts.d.ts.map +1 -0
- package/dist/tools/merge-conflicts.js +107 -0
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/run-test.js +4 -25
- package/dist/tools/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/str_replace_editor.js +6 -58
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +2 -83
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +2 -6
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +12 -13
- package/dist/tools/upgrade-packages/utils.d.ts +3 -2
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/utils.js +5 -8
- package/dist/tools/utils/queue.d.ts +5 -0
- package/dist/tools/utils/queue.d.ts.map +1 -0
- package/dist/tools/utils/queue.js +41 -0
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/SQSClient.d.ts +14 -0
- package/dist/utils/SQSClient.d.ts.map +1 -0
- package/dist/utils/SQSClient.js +116 -0
- package/dist/utils/repo-tree.d.ts +1 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/repo-tree.js +7 -7
- package/package.json +16 -8
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/auth/api-client.d.ts +0 -13
- package/dist/auth/api-client.d.ts.map +0 -1
- package/dist/auth/api-client.js +0 -103
- package/dist/session/index.d.ts +0 -20
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js +0 -104
- package/dist/tool-call-service/index.d.ts +0 -32
- package/dist/tool-call-service/index.d.ts.map +0 -1
- package/dist/tool-call-service/utils.d.ts +0 -6
- package/dist/tool-call-service/utils.d.ts.map +0 -1
- package/dist/tool-call-service/utils.js +0 -57
- package/dist/tools/utils/index.d.ts +0 -61
- package/dist/tools/utils/index.d.ts.map +0 -1
- package/dist/tools/utils/index.js +0 -122
- package/dist/utils/checkpoint.d.ts +0 -7
- package/dist/utils/checkpoint.d.ts.map +0 -1
- package/dist/utils/file-tree.d.ts +0 -3
- package/dist/utils/file-tree.d.ts.map +0 -1
- package/dist/utils/git.d.ts.map +0 -1
package/dist/tools/run-test.js
CHANGED
|
@@ -7,26 +7,10 @@ exports.runTestTool = void 0;
|
|
|
7
7
|
const test_run_1 = require("@empiricalrun/test-run");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const zod_1 = require("zod");
|
|
11
10
|
const artifacts_1 = require("../artifacts");
|
|
12
11
|
const utils_1 = require("../artifacts/utils");
|
|
13
12
|
const utils_2 = require("../utils");
|
|
14
|
-
const
|
|
15
|
-
testName: zod_1.z.string().describe("The name of the test to run"),
|
|
16
|
-
suites: zod_1.z
|
|
17
|
-
.array(zod_1.z.string())
|
|
18
|
-
.describe("The suites (describe blocks) where the test is located."),
|
|
19
|
-
filePath: zod_1.z
|
|
20
|
-
.string()
|
|
21
|
-
.describe("Path of the file where the test is located. Path must be relative to the root of the repository. File name must end with .spec.ts. For example: tests/lesson.spec.ts"),
|
|
22
|
-
project: zod_1.z.string().describe("The project to run the test on"),
|
|
23
|
-
buildUrl: zod_1.z
|
|
24
|
-
.string()
|
|
25
|
-
.optional()
|
|
26
|
-
.describe(`The URL of the build to run the test on.
|
|
27
|
-
This is ONLY useful for preview deployments that are dynamically created on every pull request, like Vercel preview deployments.
|
|
28
|
-
For all other cases, the build url does not need to be provided, since it is already hard coded in the test repo.`),
|
|
29
|
-
});
|
|
13
|
+
const run_test_1 = require("./definitions/run-test");
|
|
30
14
|
function buildReportUrl(projectName, testRunId) {
|
|
31
15
|
return `https://reports.empirical.run/${projectName}/${testRunId}/index.html`;
|
|
32
16
|
}
|
|
@@ -44,12 +28,7 @@ ${JSON.stringify(truncatedSummaryJson)}
|
|
|
44
28
|
`;
|
|
45
29
|
}
|
|
46
30
|
exports.runTestTool = {
|
|
47
|
-
|
|
48
|
-
name: "runTest",
|
|
49
|
-
description: "Run a test",
|
|
50
|
-
parameters: RunTestSchema,
|
|
51
|
-
},
|
|
52
|
-
needsBrowser: true,
|
|
31
|
+
...run_test_1.runTestTool,
|
|
53
32
|
execute: async ({ input, repoPath, collectArtifacts, environmentOverrides = {}, }) => {
|
|
54
33
|
let reportUrl = undefined;
|
|
55
34
|
let envOverrides = { ...environmentOverrides };
|
|
@@ -89,8 +68,8 @@ exports.runTestTool = {
|
|
|
89
68
|
projects: [input.project],
|
|
90
69
|
envOverrides,
|
|
91
70
|
});
|
|
92
|
-
const
|
|
93
|
-
void collectArtifacts?.(
|
|
71
|
+
const artifacts = (0, utils_1.extractAttachmentsFromPlaywrightJSONReport)(result.summaryJson);
|
|
72
|
+
void collectArtifacts?.(artifacts);
|
|
94
73
|
return {
|
|
95
74
|
isError: false,
|
|
96
75
|
result: buildResult({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../src/tools/str_replace_editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,IAAI,EAEJ,UAAU,EACX,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../src/tools/str_replace_editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,IAAI,EAEJ,UAAU,EACX,MAAM,4BAA4B,CAAC;AAuCpC,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiWD;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,QAAQ,EACR,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,GAAG,OAAO,CAAC,UAAU,CAAC,CA8CtB;AA8ED,eAAO,MAAM,eAAe,EAAE,IAAI,EAKjC,CAAC"}
|
|
@@ -7,9 +7,9 @@ exports.textEditorTools = void 0;
|
|
|
7
7
|
exports.strReplaceEditorExecutor = strReplaceEditorExecutor;
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const zod_1 = require("zod");
|
|
11
10
|
const web_1 = require("../bin/utils/platform/web");
|
|
12
|
-
const
|
|
11
|
+
const str_replace_editor_1 = require("./definitions/str_replace_editor");
|
|
12
|
+
const git_1 = require("./executor/utils/git");
|
|
13
13
|
/**
|
|
14
14
|
* Helper function to collect git patch artifacts for file modifications
|
|
15
15
|
*/
|
|
@@ -358,23 +358,7 @@ async function strReplaceEditorExecutor({ input, repoPath, collectArtifacts, })
|
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
const fileViewTool = {
|
|
361
|
-
|
|
362
|
-
name: "fileViewTool",
|
|
363
|
-
description: `A tool to view the content of a file or directory. If the path points
|
|
364
|
-
to a directory, the tool will return a list of files in the directory, separated by line breaks.
|
|
365
|
-
If the path points to a file, the tool will return the content of the file.
|
|
366
|
-
|
|
367
|
-
File contents are returned with line numbers, starting from 1.
|
|
368
|
-
|
|
369
|
-
1: line 1
|
|
370
|
-
2: line 2
|
|
371
|
-
...`,
|
|
372
|
-
parameters: zod_1.z.object({
|
|
373
|
-
// Does not support view_range for now
|
|
374
|
-
path: zod_1.z.string().describe("The path to the file or directory to view."),
|
|
375
|
-
}),
|
|
376
|
-
},
|
|
377
|
-
needsBrowser: false,
|
|
361
|
+
...str_replace_editor_1.textEditorTools["fileViewTool"],
|
|
378
362
|
execute: async (params) => {
|
|
379
363
|
const { input } = params;
|
|
380
364
|
const { repoPath } = params;
|
|
@@ -388,18 +372,7 @@ File contents are returned with line numbers, starting from 1.
|
|
|
388
372
|
},
|
|
389
373
|
};
|
|
390
374
|
const fileCreateTool = {
|
|
391
|
-
|
|
392
|
-
name: "fileCreateTool",
|
|
393
|
-
description: `A tool to create a new file with given contents.
|
|
394
|
-
This tool will also create parent directories that do not exist.
|
|
395
|
-
For example, for path "tests/example/foo.spec.ts", the tool will create
|
|
396
|
-
directories "tests", "tests/example", and "tests/example/foo.spec.ts".`,
|
|
397
|
-
parameters: zod_1.z.object({
|
|
398
|
-
path: zod_1.z.string().describe("The path to the new file."),
|
|
399
|
-
file_text: zod_1.z.string().describe("The contents of the new file."),
|
|
400
|
-
}),
|
|
401
|
-
},
|
|
402
|
-
needsBrowser: false,
|
|
375
|
+
...str_replace_editor_1.textEditorTools["fileCreateTool"],
|
|
403
376
|
execute: async (params) => {
|
|
404
377
|
const { input } = params;
|
|
405
378
|
const { repoPath, collectArtifacts } = params;
|
|
@@ -415,17 +388,7 @@ directories "tests", "tests/example", and "tests/example/foo.spec.ts".`,
|
|
|
415
388
|
},
|
|
416
389
|
};
|
|
417
390
|
const stringReplaceTool = {
|
|
418
|
-
|
|
419
|
-
name: "stringReplaceTool",
|
|
420
|
-
description: `A tool to replace a string in a file. This tool requires old_str to be unique
|
|
421
|
-
in the file. If old_str is not unique, the tool will return an error.`,
|
|
422
|
-
parameters: zod_1.z.object({
|
|
423
|
-
path: zod_1.z.string().describe("The path to the file."),
|
|
424
|
-
old_str: zod_1.z.string().describe("The string to be replaced."),
|
|
425
|
-
new_str: zod_1.z.string().describe("The string to replace old_str with."),
|
|
426
|
-
}),
|
|
427
|
-
},
|
|
428
|
-
needsBrowser: false,
|
|
391
|
+
...str_replace_editor_1.textEditorTools["stringReplaceTool"],
|
|
429
392
|
execute: async (params) => {
|
|
430
393
|
const { input } = params;
|
|
431
394
|
const { repoPath, collectArtifacts } = params;
|
|
@@ -442,22 +405,7 @@ in the file. If old_str is not unique, the tool will return an error.`,
|
|
|
442
405
|
},
|
|
443
406
|
};
|
|
444
407
|
const stringInsertTool = {
|
|
445
|
-
|
|
446
|
-
name: "stringInsertTool",
|
|
447
|
-
description: "A tool to insert a string at a specific line in a file. Line numbers are 1-indexed, just like the file view tool.",
|
|
448
|
-
parameters: zod_1.z.object({
|
|
449
|
-
path: zod_1.z.string().describe("The path to the file."),
|
|
450
|
-
insert_line: zod_1.z
|
|
451
|
-
.number()
|
|
452
|
-
.int()
|
|
453
|
-
.min(1)
|
|
454
|
-
.describe(`The line number on which to insert the text (1 for beginning of file).
|
|
455
|
-
To insert a string at the beginning of the file, you should use insert_line = 1.
|
|
456
|
-
To insert a string at the end of the file, you should use insert_line = (total lines + 1).`),
|
|
457
|
-
new_str: zod_1.z.string().describe("The string to insert."),
|
|
458
|
-
}),
|
|
459
|
-
},
|
|
460
|
-
needsBrowser: false,
|
|
408
|
+
...str_replace_editor_1.textEditorTools["stringInsertTool"],
|
|
461
409
|
execute: async (params) => {
|
|
462
410
|
const { input } = params;
|
|
463
411
|
const { repoPath, collectArtifacts } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAoBpC,eAAO,MAAM,4BAA4B,EAAE,IA0L1C,CAAC"}
|
|
@@ -7,95 +7,14 @@ exports.generateTestWithBrowserAgent = void 0;
|
|
|
7
7
|
const test_run_1 = require("@empiricalrun/test-run");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const zod_1 = require("zod");
|
|
11
10
|
const run_1 = require("../agent/browsing/run");
|
|
12
11
|
const utils_1 = require("../agent/browsing/utils");
|
|
13
12
|
const pw_pause_1 = require("../agent/cua/pw-codegen/pw-pause");
|
|
14
13
|
const web_1 = require("../bin/utils/platform/web");
|
|
15
14
|
const scenarios_1 = require("../bin/utils/scenarios");
|
|
16
|
-
const
|
|
17
|
-
testName: zod_1.z.string().describe("The name of the test to create or modify"),
|
|
18
|
-
testSuites: zod_1.z
|
|
19
|
-
.array(zod_1.z.string())
|
|
20
|
-
.describe("The suites (describe blocks) where the test is located"),
|
|
21
|
-
filePath: zod_1.z
|
|
22
|
-
.string()
|
|
23
|
-
.describe("Path of the file where the test is located. Path must be relative to the root of the repository. File name must end with .spec.ts. For example: tests/lesson.spec.ts"),
|
|
24
|
-
project: zod_1.z
|
|
25
|
-
.string()
|
|
26
|
-
.describe("The Playwright project to run tests against (e.g. 'chromium' or 'firefox')"),
|
|
27
|
-
buildUrl: zod_1.z
|
|
28
|
-
.string()
|
|
29
|
-
.optional()
|
|
30
|
-
.describe(`The URL of the build to run the test on.
|
|
31
|
-
This is ONLY useful for preview deployments that are dynamically created on every pull request, like Vercel preview deployments.
|
|
32
|
-
For all other cases, the build url does not need to be provided, since it is already hard coded in the test repo.`),
|
|
33
|
-
changeToMake: zod_1.z.string().describe("The change to make to the test"),
|
|
34
|
-
});
|
|
35
|
-
const BROWSER_AGENT_DESCRIPTION = `
|
|
36
|
-
Create or modify a test case with browser agent. The browser agent can take user interactions in a web browser
|
|
37
|
-
and generate Playwright code for that actions. This is a useful tool when the modifications require knowing the
|
|
38
|
-
locator/selector for an element on the page.
|
|
39
|
-
|
|
40
|
-
IMPORTANT: Before you invoke this tool, you need to ensure that the test code is correctly prepared for this
|
|
41
|
-
agent. Preparation involves adding a TODO comment that describes the change that needs to be made, and the page
|
|
42
|
-
variable name where the actions must be performed. The content of the TODO comment calls out the element and browser
|
|
43
|
-
interactions it must take. The TODO comment also has (agent on pageName) next to it, to clearly label that the change
|
|
44
|
-
is for the agent to make on the given page (pageName in this case).
|
|
45
|
-
|
|
46
|
-
To choose the page variable name, go through the test code and find available page variables. If you are replacing some
|
|
47
|
-
existing test code, use the same page variable name as in the existing test code. If you are adding steps to the test,
|
|
48
|
-
use the page variable name that is appropriate for the new steps. The page variable represents the browser page (or tab) that
|
|
49
|
-
the agent is supposed to interact with.
|
|
50
|
-
|
|
51
|
-
For example, this is a good TODO comment:
|
|
52
|
-
|
|
53
|
-
\`\`\`
|
|
54
|
-
test("Example test code", async ({ page }) => {
|
|
55
|
-
await page.goto("https://example.com");
|
|
56
|
-
// TODO(agent on page): Click on the login button
|
|
57
|
-
});
|
|
58
|
-
\`\`\`
|
|
59
|
-
|
|
60
|
-
For the above file, the browser environment will execute the steps before the TODO comment and hand-over the control
|
|
61
|
-
to the browser agent. The agent will do the actions described in the TODO comment and then resume control back to the
|
|
62
|
-
test code.
|
|
63
|
-
|
|
64
|
-
Note that you CANNOT add TODO comments in the middle of a multi-line statement. This will break the tool.
|
|
65
|
-
|
|
66
|
-
For example, this is invalid:
|
|
67
|
-
|
|
68
|
-
\`\`\`
|
|
69
|
-
await extPage
|
|
70
|
-
.getByTestId("virtuoso-item-list")
|
|
71
|
-
// TODO(agent on extPage): Click on the STARS button
|
|
72
|
-
.getByText("STARS", { exact: true })
|
|
73
|
-
.click();
|
|
74
|
-
// This is invalid, because the TODO is in the middle of a multi-line statement
|
|
75
|
-
// Instead, add the TODO before or after the multi-line statement
|
|
76
|
-
\`\`\`
|
|
77
|
-
|
|
78
|
-
The TODO comment must be inside a test block, not outside of it. For example, this is invalid:
|
|
79
|
-
|
|
80
|
-
\`\`\`
|
|
81
|
-
// --- BEGIN INVALID EXAMPLE ---
|
|
82
|
-
test("Example test code", async ({ page }) => {
|
|
83
|
-
await page.goto("https://example.com");
|
|
84
|
-
});
|
|
85
|
-
// TODO(agent on page): Click on the login button
|
|
86
|
-
// --- END INVALID EXAMPLE ---
|
|
87
|
-
\`\`\`
|
|
88
|
-
|
|
89
|
-
After execution, the browser agent will return a summary of actions that it took, and the generated Playwright code for them.
|
|
90
|
-
You can then use the text editor tool to replace the TODO comment with the generated Playwright code.
|
|
91
|
-
`;
|
|
15
|
+
const test_gen_browser_1 = require("./definitions/test-gen-browser");
|
|
92
16
|
exports.generateTestWithBrowserAgent = {
|
|
93
|
-
|
|
94
|
-
name: "generateTestWithBrowserAgent",
|
|
95
|
-
description: BROWSER_AGENT_DESCRIPTION,
|
|
96
|
-
parameters: BrowserAgentSchema,
|
|
97
|
-
},
|
|
98
|
-
needsBrowser: true,
|
|
17
|
+
...test_gen_browser_1.generateTestWithBrowserAgent,
|
|
99
18
|
execute: async ({ input, repoPath, trace, collectArtifacts, environmentOverrides = {}, featureFlags, }) => {
|
|
100
19
|
const { filePath, project } = input;
|
|
101
20
|
const absoluteFilePath = path_1.default.join(repoPath, filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/test-run-fetcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/test-run-fetcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAavD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,eAAO,MAAM,sBAAsB,EAAE,IA0HpC,CAAC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchTestRunReportTool = void 0;
|
|
4
4
|
exports.extractPathAfterSourceRepo = extractPathAfterSourceRepo;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
6
|
const TestRunSchema = zod_1.z.object({
|
|
8
7
|
testRunUrl: zod_1.z
|
|
9
8
|
.string()
|
|
@@ -25,7 +24,7 @@ exports.fetchTestRunReportTool = {
|
|
|
25
24
|
parameters: TestRunSchema,
|
|
26
25
|
},
|
|
27
26
|
needsBrowser: false,
|
|
28
|
-
execute: async ({ input,
|
|
27
|
+
execute: async ({ input, apiClient }) => {
|
|
29
28
|
const { testRunUrl } = input;
|
|
30
29
|
// Remove query parameters if they exist
|
|
31
30
|
const urlWithoutParams = testRunUrl.split("?")[0] || testRunUrl;
|
|
@@ -41,10 +40,7 @@ exports.fetchTestRunReportTool = {
|
|
|
41
40
|
}
|
|
42
41
|
let data = null;
|
|
43
42
|
try {
|
|
44
|
-
data = await (
|
|
45
|
-
path: `/api/test-runs/${runId}?repo_name=${repoName}`,
|
|
46
|
-
apiKey,
|
|
47
|
-
});
|
|
43
|
+
data = await apiClient.request(`/api/test-runs/${runId}?repo_name=${repoName}`, { method: "GET" });
|
|
48
44
|
}
|
|
49
45
|
catch (error) {
|
|
50
46
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAyBvD,eAAO,MAAM,mBAAmB,EAAE,IA2HjC,CAAC"}
|
|
@@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.upgradePackagesTool = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const zod_1 = require("zod");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
11
|
+
const utils_1 = require("../executor/utils");
|
|
12
|
+
const git_1 = require("../executor/utils/git");
|
|
13
|
+
const pr_description_1 = require("../executor/utils/pr-description");
|
|
12
14
|
const utils_2 = require("./utils");
|
|
13
15
|
const packageSpecSchema = zod_1.z.object({
|
|
14
16
|
name: zod_1.z.string(),
|
|
@@ -25,7 +27,7 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
25
27
|
parameters: upgradePackagesSchema,
|
|
26
28
|
},
|
|
27
29
|
needsBrowser: false,
|
|
28
|
-
execute: async ({ input, repoPath,
|
|
30
|
+
execute: async ({ input, repoPath, apiClient, chatSession }) => {
|
|
29
31
|
const { packages: packagesToUpdate } = input;
|
|
30
32
|
try {
|
|
31
33
|
const repoName = path_1.default.basename(repoPath);
|
|
@@ -52,7 +54,7 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
const filesChanged =
|
|
57
|
+
const filesChanged = (0, git_1.getFilesChanged)(repoPath);
|
|
56
58
|
const hasChanges = filesChanged.length > 0;
|
|
57
59
|
if (!hasChanges) {
|
|
58
60
|
return {
|
|
@@ -61,17 +63,14 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
61
63
|
};
|
|
62
64
|
}
|
|
63
65
|
const updateMessage = `upgrade ${changes.length} package${changes.length === 1 ? "" : "s"}`;
|
|
64
|
-
|
|
66
|
+
(0, git_1.commitFilesAsBotUser)({
|
|
65
67
|
commitMessage: `[upgrade-packages] ${updateMessage}`,
|
|
66
|
-
branchName,
|
|
67
68
|
files: ["package.json", "package-lock.json"],
|
|
68
69
|
repoPath,
|
|
69
70
|
});
|
|
71
|
+
(0, child_process_1.execSync)(`git push origin ${branchName}`, { cwd: repoPath });
|
|
70
72
|
await new Promise((resolve) => setTimeout(resolve, 5_000));
|
|
71
73
|
const prBody = `Upgraded the following packages:\n\n${changes.map((c) => `- \`${c.name}\` → ${c.version ? c.version : "latest"}`).join("\n")}`;
|
|
72
|
-
const sessionMetadata = chatSessionId
|
|
73
|
-
? `PR created from session #${chatSessionId}`
|
|
74
|
-
: ``;
|
|
75
74
|
const prTitle = `chore: ${updateMessage}`;
|
|
76
75
|
let shouldMerge = false;
|
|
77
76
|
let prNumber = null;
|
|
@@ -80,23 +79,23 @@ This tool handles the entire workflow: editing the package.json file, running "n
|
|
|
80
79
|
const { pr } = await (0, utils_1.findOrCreatePullRequest)({
|
|
81
80
|
owner: "empirical-run",
|
|
82
81
|
repo: repoName,
|
|
83
|
-
|
|
82
|
+
apiClient,
|
|
84
83
|
branchName,
|
|
85
84
|
title: prTitle,
|
|
86
|
-
body:
|
|
85
|
+
body: (0, pr_description_1.addMetadataToPRDescription)(prBody, chatSession),
|
|
87
86
|
labels: ["automated"],
|
|
88
87
|
});
|
|
89
88
|
prNumber = pr.number;
|
|
90
89
|
if (!pr.number) {
|
|
91
90
|
throw new Error("Failed to create PR");
|
|
92
91
|
}
|
|
93
|
-
shouldMerge = await (0, utils_2.shouldMergePR)({ repoName, prNumber,
|
|
92
|
+
shouldMerge = await (0, utils_2.shouldMergePR)({ repoName, prNumber, apiClient });
|
|
94
93
|
if (shouldMerge) {
|
|
95
94
|
console.log("All changes are patch updates, proceeding with merge");
|
|
96
95
|
merged = await (0, git_1.mergePullRequest)({
|
|
97
96
|
repoName,
|
|
98
97
|
prNumber,
|
|
99
|
-
|
|
98
|
+
apiClient,
|
|
100
99
|
});
|
|
101
100
|
}
|
|
102
101
|
else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IDashboardAPIClient } from "@empiricalrun/shared-types";
|
|
1
2
|
export declare function getLatestVersion(packageName: string): Promise<any>;
|
|
2
3
|
export declare function parsePackageJsonDiff({ diff, }: {
|
|
3
4
|
diff: string;
|
|
@@ -5,10 +6,10 @@ export declare function parsePackageJsonDiff({ diff, }: {
|
|
|
5
6
|
old?: string;
|
|
6
7
|
new?: string;
|
|
7
8
|
}>;
|
|
8
|
-
export declare function shouldMergePR({ repoName, prNumber,
|
|
9
|
+
export declare function shouldMergePR({ repoName, prNumber, apiClient, }: {
|
|
9
10
|
repoName: string;
|
|
10
11
|
prNumber: number;
|
|
11
|
-
|
|
12
|
+
apiClient: IDashboardAPIClient;
|
|
12
13
|
}): Promise<boolean>;
|
|
13
14
|
export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }: {
|
|
14
15
|
repoPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAmBjE,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,gBAkBzD;AA4BD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuBjD;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;CAChC,oBA8BA;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;;;GAcA"}
|
|
@@ -5,7 +5,6 @@ exports.parsePackageJsonDiff = parsePackageJsonDiff;
|
|
|
5
5
|
exports.shouldMergePR = shouldMergePR;
|
|
6
6
|
exports.upgradeAndStagePackage = upgradeAndStagePackage;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
8
|
function isPatchUpdate(currentVersion, newVersion) {
|
|
10
9
|
if (!currentVersion || !newVersion) {
|
|
11
10
|
// If current is undefined, we might be installing a new package
|
|
@@ -35,12 +34,10 @@ async function getLatestVersion(packageName) {
|
|
|
35
34
|
throw error;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
async function getGitDiffForPackageJson({ repoName, prNumber,
|
|
39
|
-
const
|
|
40
|
-
const files = await (0, utils_1.callGitHubProxy)({
|
|
37
|
+
async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, }) {
|
|
38
|
+
const files = await apiClient.callGitHubProxy({
|
|
41
39
|
method: "GET",
|
|
42
|
-
url:
|
|
43
|
-
apiKey,
|
|
40
|
+
url: `/repos/empirical-run/${repoName}/pulls/${prNumber}/files`,
|
|
44
41
|
});
|
|
45
42
|
if (!files) {
|
|
46
43
|
throw new Error("Failed to fetch PR files via proxy");
|
|
@@ -74,11 +71,11 @@ function parsePackageJsonDiff({ diff, }) {
|
|
|
74
71
|
}
|
|
75
72
|
return changes;
|
|
76
73
|
}
|
|
77
|
-
async function shouldMergePR({ repoName, prNumber,
|
|
74
|
+
async function shouldMergePR({ repoName, prNumber, apiClient, }) {
|
|
78
75
|
const gitDiff = await getGitDiffForPackageJson({
|
|
79
76
|
repoName,
|
|
80
77
|
prNumber,
|
|
81
|
-
|
|
78
|
+
apiClient,
|
|
82
79
|
});
|
|
83
80
|
if (!gitDiff) {
|
|
84
81
|
console.log("No package.json changes found, skipping merge");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PendingToolCall } from "@empiricalrun/shared-types";
|
|
2
|
+
export declare function appendSuffixToQueueUrl(queueUrl: string, suffix: string): string;
|
|
3
|
+
export declare function replaceRegionInUrl(url: string, newRegion: string): string;
|
|
4
|
+
export declare function getQueueUrl(toolCalls: PendingToolCall[], needsBrowser: boolean): string;
|
|
5
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE;AAkBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,YAAY,EAAE,OAAO,GACpB,MAAM,CAeR"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appendSuffixToQueueUrl = appendSuffixToQueueUrl;
|
|
4
|
+
exports.replaceRegionInUrl = replaceRegionInUrl;
|
|
5
|
+
exports.getQueueUrl = getQueueUrl;
|
|
6
|
+
function appendSuffixToQueueUrl(queueUrl, suffix) {
|
|
7
|
+
const parts = queueUrl.split("/");
|
|
8
|
+
const queueName = parts.pop();
|
|
9
|
+
const queueNameWithoutFifo = queueName?.replace(/\.fifo$/, "");
|
|
10
|
+
return `${parts.join("/")}/${queueNameWithoutFifo}-${suffix}.fifo`;
|
|
11
|
+
}
|
|
12
|
+
function replaceRegionInUrl(url, newRegion) {
|
|
13
|
+
const parsedUrl = new URL(url);
|
|
14
|
+
parsedUrl.hostname = parsedUrl.hostname.replace(/\.([a-z0-9-]+)\.amazonaws\.com$/, `.${newRegion}.amazonaws.com`);
|
|
15
|
+
return parsedUrl.toString();
|
|
16
|
+
}
|
|
17
|
+
function buildQueueUrlsForPreview(baseQueueUrl) {
|
|
18
|
+
const buildHash = process.env.TOOL_EXECUTION_SERVICE_BUILD_HASH;
|
|
19
|
+
if (!buildHash) {
|
|
20
|
+
throw new Error("TOOL_EXECUTION_SERVICE_BUILD_HASH is not set");
|
|
21
|
+
}
|
|
22
|
+
const updatedRegionForQueue = replaceRegionInUrl(baseQueueUrl, process.env.AWS_REGION);
|
|
23
|
+
const queueUrl = appendSuffixToQueueUrl(updatedRegionForQueue, buildHash);
|
|
24
|
+
console.log("queueUrl for preview", queueUrl);
|
|
25
|
+
return queueUrl;
|
|
26
|
+
}
|
|
27
|
+
function getQueueUrl(toolCalls, needsBrowser) {
|
|
28
|
+
const browserSqsQueueUrl = process.env.TOOL_EXECUTION_SQS_URL_BROWSER;
|
|
29
|
+
const baseSqsQueueUrl = process.env.TOOL_EXECUTION_SQS_URL;
|
|
30
|
+
const queueUrl = needsBrowser ? browserSqsQueueUrl : baseSqsQueueUrl;
|
|
31
|
+
if (!queueUrl) {
|
|
32
|
+
throw new Error("No queue URL found");
|
|
33
|
+
}
|
|
34
|
+
const vercelEnv = process.env.VERCEL_ENV || "";
|
|
35
|
+
if (vercelEnv !== "preview") {
|
|
36
|
+
return queueUrl;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return buildQueueUrlsForPreview(queueUrl);
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -65,13 +65,5 @@ 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
|
-
};
|
|
76
68
|
export type ActionArgs = ClickActionArgs | FillActionArgs | GotoActionArgs | PressActionArgs | AssertTextVisibilityActionArgs | TextContentActionArgs | HoverActionArgs | SkillActionArgs;
|
|
77
69
|
//# 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,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C;CACtB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,cAAc,GAAG;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,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,UAAU,GAClB,eAAe,GACf,cAAc,GACd,cAAc,GACd,eAAe,GACf,8BAA8B,GAC9B,qBAAqB,GACrB,eAAe,GACf,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ServicePayload } from "@empiricalrun/shared-types";
|
|
2
|
+
export declare class SQSClient {
|
|
3
|
+
private region;
|
|
4
|
+
private accessKeyId;
|
|
5
|
+
private secretAccessKey;
|
|
6
|
+
private sessionToken?;
|
|
7
|
+
constructor(region: string, accessKeyId: string, secretAccessKey: string, sessionToken?: string);
|
|
8
|
+
private sha256;
|
|
9
|
+
private hmacSha256;
|
|
10
|
+
private getSignatureKey;
|
|
11
|
+
private sign;
|
|
12
|
+
sendMessage(queueUrl: string, payload: ServicePayload): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SQSClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SQSClient.d.ts","sourceRoot":"","sources":["../../src/utils/SQSClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM;YAQT,MAAM;YAON,UAAU;YAkBV,eAAe;YAgBf,IAAI;IASZ,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyG5E"}
|