@empiricalrun/test-gen 0.73.1 → 0.74.1
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 +94 -0
- package/dist/actions/utils/index.d.ts.map +1 -1
- package/dist/actions/utils/index.js +1 -2
- package/dist/agent/browsing/index.d.ts.map +1 -1
- package/dist/agent/browsing/index.js +9 -7
- package/dist/agent/browsing/utils.d.ts.map +1 -1
- package/dist/agent/browsing/utils.js +3 -4
- package/dist/agent/chat/agent-loop.d.ts +7 -8
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.js +13 -17
- package/dist/agent/chat/exports.d.ts +5 -4
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +9 -4
- package/dist/agent/chat/filesystem-cache.d.ts +12 -0
- package/dist/agent/chat/filesystem-cache.d.ts.map +1 -0
- package/dist/agent/chat/filesystem-cache.js +101 -0
- package/dist/agent/chat/index.d.ts +4 -1
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +44 -22
- package/dist/agent/chat/models.d.ts +2 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +25 -3
- package/dist/agent/chat/prompt/index.d.ts +3 -1
- package/dist/agent/chat/prompt/index.d.ts.map +1 -1
- package/dist/agent/chat/prompt/index.js +77 -2
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +1 -0
- package/dist/agent/chat/state.d.ts +6 -5
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +35 -5
- package/dist/agent/chat/utils.d.ts +1 -0
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/chat/utils.js +16 -3
- package/dist/agent/cua/index.js +1 -1
- package/dist/agent/cua/model.js +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +0 -1
- package/dist/agent/master/browser-tests/fixtures.d.ts.map +1 -1
- package/dist/agent/master/browser-tests/fixtures.js +0 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/element-annotation.js +1 -2
- package/dist/agent/master/execute-browser-action.d.ts.map +1 -1
- package/dist/agent/master/execute-browser-action.js +8 -6
- package/dist/agent/master/icon-descriptor/index.js +2 -2
- package/dist/agent/master/next-action.js +1 -1
- package/dist/agent/master/planner.js +1 -1
- package/dist/agent/master/scroller.js +2 -2
- package/dist/agent/master/with-hints.d.ts.map +1 -1
- package/dist/agent/master/with-hints.js +6 -5
- package/dist/agent/planner/run-time-planner.js +1 -1
- package/dist/agent/planner/run.d.ts.map +1 -1
- package/dist/agent/planner/run.js +4 -2
- package/dist/auth/cli-auth.js +1 -1
- package/dist/auth/token-store.d.ts.map +1 -1
- package/dist/auth/token-store.js +4 -6
- package/dist/bin/index.js +30 -163
- package/dist/bin/utils/context.js +1 -1
- package/dist/bin/utils/index.d.ts +0 -12
- package/dist/bin/utils/index.d.ts.map +1 -1
- package/dist/bin/utils/index.js +0 -70
- package/dist/bin/utils/platform/web/index.d.ts +2 -2
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +7 -5
- package/dist/bin/utils/scenarios/index.d.ts +11 -3
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/browser-injected-scripts/annotate-elements.spec.js +0 -5
- package/dist/browser-injected-scripts/annotate-elements.spec.ts +0 -5
- package/dist/dashboard/client.d.ts +2 -2
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/client.js +4 -1
- package/dist/file-info/adapters/file-system/index.d.ts +9 -0
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -0
- package/dist/file-info/adapters/file-system/index.js +25 -0
- package/dist/file-info/adapters/file-system/reader.d.ts +6 -0
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -0
- package/dist/file-info/{file-system.js → adapters/file-system/reader.js} +16 -0
- package/dist/file-info/adapters/github/index.d.ts +11 -0
- package/dist/file-info/adapters/github/index.d.ts.map +1 -0
- package/dist/file-info/adapters/github/index.js +29 -0
- package/dist/file-info/adapters/github/reader.d.ts +16 -0
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -0
- package/dist/file-info/adapters/github/reader.js +185 -0
- package/dist/file-info/index.d.ts +4 -0
- package/dist/file-info/index.d.ts.map +1 -0
- package/dist/file-info/index.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/recorder/index.d.ts +7 -3
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +181 -64
- package/dist/recorder/temp-files.d.ts +1 -1
- package/dist/recorder/temp-files.d.ts.map +1 -1
- package/dist/recorder/temp-files.js +2 -2
- package/dist/recorder/upload.d.ts +1 -1
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/recorder/upload.js +3 -3
- package/dist/tools/{commit-and-create-pr.d.ts → commit-and-create-pr/index.d.ts} +1 -1
- package/dist/tools/commit-and-create-pr/index.d.ts.map +1 -0
- package/dist/tools/{commit-and-create-pr.js → commit-and-create-pr/index.js} +8 -28
- package/dist/tools/definitions/commit-and-create-pr.d.ts +3 -0
- package/dist/tools/definitions/commit-and-create-pr.d.ts.map +1 -0
- package/dist/tools/definitions/commit-and-create-pr.js +31 -0
- package/dist/tools/definitions/delete-file.d.ts +3 -0
- package/dist/tools/definitions/delete-file.d.ts.map +1 -0
- package/dist/tools/definitions/delete-file.js +20 -0
- package/dist/tools/{download-build.d.ts → definitions/download-build.d.ts} +2 -2
- package/dist/tools/definitions/download-build.d.ts.map +1 -0
- package/dist/tools/definitions/download-build.js +18 -0
- package/dist/tools/definitions/fetch-video-analysis.d.ts +11 -0
- package/dist/tools/definitions/fetch-video-analysis.d.ts.map +1 -0
- package/dist/tools/definitions/fetch-video-analysis.js +26 -0
- package/dist/tools/definitions/grep.d.ts +3 -0
- package/dist/tools/definitions/grep.d.ts.map +1 -0
- package/dist/tools/definitions/grep.js +29 -0
- package/dist/tools/definitions/merge-conflicts.d.ts +3 -0
- package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -0
- package/dist/tools/definitions/merge-conflicts.js +24 -0
- package/dist/tools/definitions/run-test.d.ts +2 -2
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/run-test.js +4 -7
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/str_replace_editor.js +9 -5
- package/dist/tools/definitions/test-gen-browser.d.ts +5 -5
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.js +4 -7
- package/dist/tools/definitions/upgrade-packages.d.ts +36 -0
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -0
- package/dist/tools/definitions/upgrade-packages.js +21 -0
- package/dist/tools/definitions/utils.d.ts +15 -0
- package/dist/tools/definitions/utils.d.ts.map +1 -0
- package/dist/tools/definitions/utils.js +16 -0
- package/dist/tools/{delete-file.d.ts → delete-file/index.d.ts} +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -0
- package/dist/tools/{delete-file.js → delete-file/index.js} +4 -16
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +13 -11
- package/dist/tools/download-build/index.d.ts +3 -0
- package/dist/tools/download-build/index.d.ts.map +1 -0
- package/dist/tools/{download-build.js → download-build/index.js} +4 -14
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +19 -4
- package/dist/tools/executor/utils/git.js +1 -1
- package/dist/tools/executor/utils/pr-description.d.ts +1 -1
- package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
- package/dist/tools/fetch-image/index.d.ts +10 -1
- package/dist/tools/fetch-image/index.d.ts.map +1 -1
- package/dist/tools/fetch-image/index.js +1 -0
- package/dist/tools/fetch-last-successful-test-run/index.d.ts +3 -0
- package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +1 -0
- package/dist/tools/fetch-last-successful-test-run/index.js +60 -0
- package/dist/tools/fetch-video-analysis/index.d.ts +5 -0
- package/dist/tools/fetch-video-analysis/index.d.ts.map +1 -0
- package/dist/tools/fetch-video-analysis/index.js +89 -0
- package/dist/tools/fetch-video-analysis/local-ffmpeg-client.d.ts +24 -0
- package/dist/tools/fetch-video-analysis/local-ffmpeg-client.d.ts.map +1 -0
- package/dist/tools/fetch-video-analysis/local-ffmpeg-client.js +209 -0
- package/dist/tools/fetch-video-analysis/utils.d.ts +10 -0
- package/dist/tools/fetch-video-analysis/utils.d.ts.map +1 -0
- package/dist/tools/fetch-video-analysis/utils.js +72 -0
- package/dist/tools/fetch-video-analysis/video-analysis.d.ts +7 -0
- package/dist/tools/fetch-video-analysis/video-analysis.d.ts.map +1 -0
- package/dist/tools/fetch-video-analysis/video-analysis.js +54 -0
- package/dist/tools/file-operations/create.d.ts +11 -0
- package/dist/tools/file-operations/create.d.ts.map +1 -0
- package/dist/tools/file-operations/create.js +60 -0
- package/dist/tools/file-operations/index.d.ts +15 -0
- package/dist/tools/file-operations/index.d.ts.map +1 -0
- package/dist/tools/file-operations/index.js +143 -0
- package/dist/tools/file-operations/insert.d.ts +11 -0
- package/dist/tools/file-operations/insert.d.ts.map +1 -0
- package/dist/tools/file-operations/insert.js +61 -0
- package/dist/tools/file-operations/replace.d.ts +11 -0
- package/dist/tools/file-operations/replace.d.ts.map +1 -0
- package/dist/tools/file-operations/replace.js +80 -0
- package/dist/tools/file-operations/shared/git-helper.d.ts +4 -0
- package/dist/tools/file-operations/shared/git-helper.d.ts.map +1 -0
- package/dist/tools/file-operations/shared/git-helper.js +29 -0
- package/dist/tools/file-operations/shared/helpers.d.ts +19 -0
- package/dist/tools/file-operations/shared/helpers.d.ts.map +1 -0
- package/dist/tools/file-operations/shared/helpers.js +133 -0
- package/dist/tools/file-operations/view/index.d.ts +14 -0
- package/dist/tools/file-operations/view/index.d.ts.map +1 -0
- package/dist/tools/file-operations/view/index.js +56 -0
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +2 -9
- package/dist/tools/grep/ripgrep/index.d.ts +2 -2
- package/dist/tools/grep/ripgrep/index.d.ts.map +1 -1
- package/dist/tools/grep/ripgrep/index.js +3 -3
- package/dist/tools/grep/types.d.ts.map +1 -0
- package/dist/tools/index.d.ts +7 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +66 -22
- package/dist/tools/issues/create-issue.d.ts +3 -0
- package/dist/tools/issues/create-issue.d.ts.map +1 -0
- package/dist/tools/issues/create-issue.js +76 -0
- package/dist/tools/issues/index.d.ts +4 -0
- package/dist/tools/issues/index.d.ts.map +1 -0
- package/dist/tools/issues/index.js +9 -0
- package/dist/tools/issues/list-issues.d.ts +3 -0
- package/dist/tools/issues/list-issues.d.ts.map +1 -0
- package/dist/tools/issues/list-issues.js +32 -0
- package/dist/tools/issues/metadata-schema.d.ts +24 -0
- package/dist/tools/issues/metadata-schema.d.ts.map +1 -0
- package/dist/tools/issues/metadata-schema.js +22 -0
- package/dist/tools/issues/update-issue.d.ts +3 -0
- package/dist/tools/issues/update-issue.d.ts.map +1 -0
- package/dist/tools/issues/update-issue.js +75 -0
- package/dist/tools/issues/utils.d.ts +5 -0
- package/dist/tools/issues/utils.d.ts.map +1 -0
- package/dist/tools/issues/utils.js +26 -0
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-environments.js +4 -0
- package/dist/tools/{merge-conflicts.d.ts → merge-conflicts/index.d.ts} +1 -1
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -0
- package/dist/tools/{merge-conflicts.js → merge-conflicts/index.js} +3 -19
- package/dist/tools/test-gen-browser.js +4 -4
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +4 -0
- package/dist/tools/trace-dot-zip/index.d.ts +3 -0
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/index.js +48 -0
- package/dist/tools/trace-dot-zip/types.d.ts +86 -0
- package/dist/tools/trace-dot-zip/types.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/types.js +2 -0
- package/dist/tools/trace-dot-zip/utils/console-trace.d.ts +7 -0
- package/dist/tools/trace-dot-zip/utils/console-trace.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/utils/console-trace.js +34 -0
- package/dist/tools/trace-dot-zip/utils/extract-zip.d.ts +21 -0
- package/dist/tools/trace-dot-zip/utils/extract-zip.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/utils/extract-zip.js +174 -0
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts +21 -0
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -0
- package/dist/tools/trace-dot-zip/utils/network-trace.js +189 -0
- package/dist/tools/triage-summary/index.d.ts +3 -0
- package/dist/tools/triage-summary/index.d.ts.map +1 -0
- package/dist/tools/triage-summary/index.js +51 -0
- package/dist/tools/triage-summary/types.d.ts +5 -0
- package/dist/tools/triage-summary/types.d.ts.map +1 -0
- package/dist/tools/triage-summary/types.js +2 -0
- package/dist/tools/triage-summary/utils.d.ts +4 -0
- package/dist/tools/triage-summary/utils.d.ts.map +1 -0
- package/dist/tools/triage-summary/utils.js +16 -0
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +5 -15
- package/dist/tools/view-failed-test-run-report/index.d.ts +12 -0
- package/dist/tools/view-failed-test-run-report/index.d.ts.map +1 -0
- package/dist/tools/view-failed-test-run-report/index.js +163 -0
- package/dist/trace-utils/index.d.ts +4 -0
- package/dist/trace-utils/index.d.ts.map +1 -0
- package/dist/trace-utils/index.js +10 -0
- package/dist/utils/dedup-image-fs.d.ts +27 -0
- package/dist/utils/dedup-image-fs.d.ts.map +1 -0
- package/dist/utils/dedup-image-fs.js +88 -0
- package/dist/utils/dedup-image.d.ts +25 -0
- package/dist/utils/dedup-image.d.ts.map +1 -0
- package/dist/utils/dedup-image.js +80 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +0 -1
- package/dist/utils/json.js +1 -1
- package/dist/utils/model.d.ts +3 -0
- package/dist/utils/model.d.ts.map +1 -0
- package/dist/utils/model.js +18 -0
- package/dist/utils/playwright-report-parser.d.ts +13 -0
- package/dist/utils/playwright-report-parser.d.ts.map +1 -0
- package/dist/utils/playwright-report-parser.js +138 -0
- package/dist/utils/slug.d.ts +1 -0
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +9 -1
- package/dist/utils/stripAnsi.d.ts.map +1 -1
- package/dist/utils/stripAnsi.js +1 -3
- package/eslint.config.mjs +43 -0
- package/package.json +22 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/agent/codegen/generate-code-apply-changes.d.ts +0 -13
- package/dist/agent/codegen/generate-code-apply-changes.d.ts.map +0 -1
- package/dist/agent/codegen/generate-code-apply-changes.js +0 -379
- package/dist/agent/codegen/repo-edit.d.ts +0 -23
- package/dist/agent/codegen/repo-edit.d.ts.map +0 -1
- package/dist/agent/codegen/repo-edit.js +0 -81
- package/dist/agent/codegen/run.d.ts +0 -20
- package/dist/agent/codegen/run.d.ts.map +0 -1
- package/dist/agent/codegen/run.js +0 -116
- package/dist/agent/enrich-prompt/index.d.ts +0 -12
- package/dist/agent/enrich-prompt/index.d.ts.map +0 -1
- package/dist/agent/enrich-prompt/index.js +0 -80
- package/dist/agent/enrich-prompt/utils.d.ts +0 -6
- package/dist/agent/enrich-prompt/utils.d.ts.map +0 -1
- package/dist/agent/enrich-prompt/utils.js +0 -11
- package/dist/agent/infer-agent/index.d.ts +0 -10
- package/dist/agent/infer-agent/index.d.ts.map +0 -1
- package/dist/agent/infer-agent/index.js +0 -60
- package/dist/evals/add-scenario-agent.evals.d.ts +0 -4
- package/dist/evals/add-scenario-agent.evals.d.ts.map +0 -1
- package/dist/evals/add-scenario-agent.evals.js +0 -44
- package/dist/evals/infer-master-or-code-agent.evals.d.ts +0 -4
- package/dist/evals/infer-master-or-code-agent.evals.d.ts.map +0 -1
- package/dist/evals/infer-master-or-code-agent.evals.js +0 -22
- package/dist/file-info/file-system.d.ts +0 -3
- package/dist/file-info/file-system.d.ts.map +0 -1
- package/dist/file-info/github.d.ts +0 -3
- package/dist/file-info/github.d.ts.map +0 -1
- package/dist/file-info/github.js +0 -107
- package/dist/tools/commit-and-create-pr.d.ts.map +0 -1
- package/dist/tools/delete-file.d.ts.map +0 -1
- package/dist/tools/download-build.d.ts.map +0 -1
- package/dist/tools/grep/ripgrep/types.d.ts.map +0 -1
- package/dist/tools/merge-conflicts.d.ts.map +0 -1
- package/dist/tools/str_replace_editor.d.ts +0 -22
- package/dist/tools/str_replace_editor.d.ts.map +0 -1
- package/dist/tools/str_replace_editor.js +0 -429
- /package/dist/tools/grep/{ripgrep/types.d.ts → types.d.ts} +0 -0
- /package/dist/tools/grep/{ripgrep/types.js → types.js} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeConflictsTool = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const mergeConflictsToolScheme = zod_1.z.object({});
|
|
6
|
+
exports.mergeConflictsTool = {
|
|
7
|
+
schema: {
|
|
8
|
+
name: "checkForMergeConflicts",
|
|
9
|
+
description: `This tool runs the git merge command to merge main into your
|
|
10
|
+
current working branch with the following command.
|
|
11
|
+
|
|
12
|
+
\`\`\`
|
|
13
|
+
git merge --no-ff origin/main
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
If this commands fails with merge conflicts, it will still create a dirty commit
|
|
17
|
+
that has merge conflicts, which can be resolved with the file editing tools that you are
|
|
18
|
+
provided with.
|
|
19
|
+
`,
|
|
20
|
+
parameters: mergeConflictsToolScheme,
|
|
21
|
+
},
|
|
22
|
+
needsBrowser: false,
|
|
23
|
+
isInlineTool: false,
|
|
24
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ToolDefinition } from "@empiricalrun/shared-types";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const RunTestSchema: z.ZodObject<{
|
|
4
|
+
project: z.ZodString;
|
|
5
|
+
buildUrl: z.ZodOptional<z.ZodString>;
|
|
4
6
|
testName: z.ZodString;
|
|
5
7
|
suites: z.ZodArray<z.ZodString, "many">;
|
|
6
8
|
filePath: z.ZodString;
|
|
7
|
-
project: z.ZodString;
|
|
8
|
-
buildUrl: z.ZodOptional<z.ZodString>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
10
|
suites: string[];
|
|
11
11
|
testName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAWxB,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,cAQzB,CAAC"}
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runTestTool = exports.RunTestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const commonTestDetailsSchema = (0, utils_1.getCommonTestNameSuitesFilePathSchema)().shape;
|
|
5
7
|
exports.RunTestSchema = zod_1.z.object({
|
|
6
|
-
|
|
7
|
-
suites: zod_1.z
|
|
8
|
-
.array(zod_1.z.string())
|
|
9
|
-
.describe("The suites (describe blocks) where the test is located."),
|
|
10
|
-
filePath: zod_1.z
|
|
11
|
-
.string()
|
|
12
|
-
.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"),
|
|
8
|
+
...commonTestDetailsSchema,
|
|
13
9
|
project: zod_1.z.string().describe("The project to run the test on"),
|
|
14
10
|
buildUrl: zod_1.z
|
|
15
11
|
.string()
|
|
@@ -25,4 +21,5 @@ exports.runTestTool = {
|
|
|
25
21
|
parameters: exports.RunTestSchema,
|
|
26
22
|
},
|
|
27
23
|
needsBrowser: true,
|
|
24
|
+
isInlineTool: false,
|
|
28
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/str_replace_editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/str_replace_editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA6E5D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAK1D,CAAC"}
|
|
@@ -20,6 +20,7 @@ File contents are returned with line numbers, starting from 1.
|
|
|
20
20
|
}),
|
|
21
21
|
},
|
|
22
22
|
needsBrowser: false,
|
|
23
|
+
isInlineTool: false,
|
|
23
24
|
};
|
|
24
25
|
const fileCreateTool = {
|
|
25
26
|
schema: {
|
|
@@ -34,6 +35,7 @@ directories "tests", "tests/example", and "tests/example/foo.spec.ts".`,
|
|
|
34
35
|
}),
|
|
35
36
|
},
|
|
36
37
|
needsBrowser: false,
|
|
38
|
+
isInlineTool: false,
|
|
37
39
|
};
|
|
38
40
|
const stringReplaceTool = {
|
|
39
41
|
schema: {
|
|
@@ -47,24 +49,26 @@ in the file. If old_str is not unique, the tool will return an error.`,
|
|
|
47
49
|
}),
|
|
48
50
|
},
|
|
49
51
|
needsBrowser: false,
|
|
52
|
+
isInlineTool: false,
|
|
50
53
|
};
|
|
51
54
|
const stringInsertTool = {
|
|
52
55
|
schema: {
|
|
53
56
|
name: "stringInsertTool",
|
|
54
|
-
description: "A tool to insert a string at a specific line in a file.
|
|
57
|
+
description: "A tool to insert a string at a specific line in a file.",
|
|
55
58
|
parameters: zod_1.z.object({
|
|
56
59
|
path: zod_1.z.string().describe("The path to the file."),
|
|
57
60
|
insert_line: zod_1.z
|
|
58
61
|
.number()
|
|
59
62
|
.int()
|
|
60
63
|
.min(1)
|
|
61
|
-
.describe(`The line number
|
|
62
|
-
|
|
63
|
-
To insert a string at the end of the file, you should use insert_line = (total lines
|
|
64
|
-
|
|
64
|
+
.describe(`The line number after which to insert the text (use 0 for beginning of file).
|
|
65
|
+
Line numbers are 0-indexed, so to insert at the beginning of the file you should use insert_line = 0.
|
|
66
|
+
To insert a string at the end of the file, you should use insert_line = (total lines).`),
|
|
67
|
+
insert_text: zod_1.z.string().describe("The string to insert."),
|
|
65
68
|
}),
|
|
66
69
|
},
|
|
67
70
|
needsBrowser: false,
|
|
71
|
+
isInlineTool: false,
|
|
68
72
|
};
|
|
69
73
|
exports.textEditorTools = {
|
|
70
74
|
fileViewTool: fileViewTool,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ToolDefinition } from "@empiricalrun/shared-types";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const BrowserAgentSchema: z.ZodObject<{
|
|
4
|
-
testName: z.ZodString;
|
|
5
|
-
testSuites: z.ZodArray<z.ZodString, "many">;
|
|
6
|
-
filePath: z.ZodString;
|
|
7
4
|
project: z.ZodString;
|
|
8
5
|
buildUrl: z.ZodOptional<z.ZodString>;
|
|
9
6
|
changeToMake: z.ZodString;
|
|
7
|
+
testName: z.ZodString;
|
|
8
|
+
suites: z.ZodArray<z.ZodString, "many">;
|
|
9
|
+
filePath: z.ZodString;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
suites: string[];
|
|
11
12
|
testName: string;
|
|
12
|
-
testSuites: string[];
|
|
13
13
|
filePath: string;
|
|
14
14
|
project: string;
|
|
15
15
|
changeToMake: string;
|
|
16
16
|
buildUrl?: string | undefined;
|
|
17
17
|
}, {
|
|
18
|
+
suites: string[];
|
|
18
19
|
testName: string;
|
|
19
|
-
testSuites: string[];
|
|
20
20
|
filePath: string;
|
|
21
21
|
project: string;
|
|
22
22
|
changeToMake: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/test-gen-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAgB7B,CAAC;AA4DH,eAAO,MAAM,4BAA4B,EAAE,cAQ1C,CAAC"}
|
|
@@ -2,14 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateTestWithBrowserAgent = exports.BrowserAgentSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const commonTestDetailsSchema = (0, utils_1.getCommonTestNameSuitesFilePathSchema)("The name of the test to create or modify").shape;
|
|
5
7
|
exports.BrowserAgentSchema = zod_1.z.object({
|
|
6
|
-
|
|
7
|
-
testSuites: zod_1.z
|
|
8
|
-
.array(zod_1.z.string())
|
|
9
|
-
.describe("The suites (describe blocks) where the test is located"),
|
|
10
|
-
filePath: zod_1.z
|
|
11
|
-
.string()
|
|
12
|
-
.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"),
|
|
8
|
+
...commonTestDetailsSchema,
|
|
13
9
|
project: zod_1.z
|
|
14
10
|
.string()
|
|
15
11
|
.describe("The Playwright project to run tests against (e.g. 'chromium' or 'firefox')"),
|
|
@@ -85,4 +81,5 @@ exports.generateTestWithBrowserAgent = {
|
|
|
85
81
|
parameters: exports.BrowserAgentSchema,
|
|
86
82
|
},
|
|
87
83
|
needsBrowser: true,
|
|
84
|
+
isInlineTool: false,
|
|
88
85
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ToolDefinition } from "@empiricalrun/shared-types";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const packageSpecSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
version: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}, {
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const upgradePackagesSchema: z.ZodObject<{
|
|
14
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
version: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
}, {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
}>, "many">;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
packages: {
|
|
26
|
+
name: string;
|
|
27
|
+
version: string;
|
|
28
|
+
}[];
|
|
29
|
+
}, {
|
|
30
|
+
packages: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
export declare const upgradePackagesTool: ToolDefinition;
|
|
36
|
+
//# sourceMappingURL=upgrade-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade-packages.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/upgrade-packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;EAG5B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAEhC,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,cASjC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upgradePackagesTool = exports.upgradePackagesSchema = exports.packageSpecSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.packageSpecSchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string(),
|
|
7
|
+
version: zod_1.z.string(),
|
|
8
|
+
});
|
|
9
|
+
exports.upgradePackagesSchema = zod_1.z.object({
|
|
10
|
+
packages: zod_1.z.array(exports.packageSpecSchema).min(1),
|
|
11
|
+
});
|
|
12
|
+
exports.upgradePackagesTool = {
|
|
13
|
+
schema: {
|
|
14
|
+
name: "upgradePackages",
|
|
15
|
+
description: `This tool can be used to upgrade NPM packages in this repository. To run this tool, specify a list of packages with their names and version strings. At least one package must be specified.
|
|
16
|
+
This tool handles the entire workflow: editing the package.json file, running "npm install", generating lockfile, committing the changes and creating a pull request. For patch updates (e.g., 1.0.1 → 1.0.2), the tool will automatically merge the PR for minor updates. For major updates, the user needs to review the PR and merge it manually.`,
|
|
17
|
+
parameters: exports.upgradePackagesSchema,
|
|
18
|
+
},
|
|
19
|
+
needsBrowser: false,
|
|
20
|
+
isInlineTool: false,
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const getCommonTestNameSuitesFilePathSchema: (testNameDescription?: string) => z.ZodObject<{
|
|
3
|
+
testName: z.ZodString;
|
|
4
|
+
suites: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
filePath: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
suites: string[];
|
|
8
|
+
testName: string;
|
|
9
|
+
filePath: string;
|
|
10
|
+
}, {
|
|
11
|
+
suites: string[];
|
|
12
|
+
testName: string;
|
|
13
|
+
filePath: string;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/definitions/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qCAAqC,GAChD,sBAAsB,MAAM;;;;;;;;;;;;EAgB1B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCommonTestNameSuitesFilePathSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const getCommonTestNameSuitesFilePathSchema = (testNameDescription) => zod_1.z.object({
|
|
6
|
+
testName: zod_1.z
|
|
7
|
+
.string()
|
|
8
|
+
.describe(testNameDescription ?? "The name of the test to run"),
|
|
9
|
+
suites: zod_1.z
|
|
10
|
+
.array(zod_1.z.string())
|
|
11
|
+
.describe("The suites (describe blocks) where the test is located. If the test is not in any describe block, provide an empty array."),
|
|
12
|
+
filePath: zod_1.z
|
|
13
|
+
.string()
|
|
14
|
+
.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"),
|
|
15
|
+
});
|
|
16
|
+
exports.getCommonTestNameSuitesFilePathSchema = getCommonTestNameSuitesFilePathSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/delete-file/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAOpC,eAAO,MAAM,cAAc,EAAE,IAiE5B,CAAC"}
|
|
@@ -6,22 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.deleteFileTool = void 0;
|
|
7
7
|
const promises_1 = require("fs/promises");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const
|
|
10
|
-
const git_1 = require("
|
|
11
|
-
const DeleteFileInputSchema = zod_1.z.object({
|
|
12
|
-
path: zod_1.z
|
|
13
|
-
.string()
|
|
14
|
-
.describe("The path to the file to delete (relative to the repository root). For example, tests/foo.spec.ts"),
|
|
15
|
-
});
|
|
9
|
+
const delete_file_1 = require("../definitions/delete-file");
|
|
10
|
+
const git_1 = require("../executor/utils/git");
|
|
16
11
|
exports.deleteFileTool = {
|
|
17
|
-
|
|
18
|
-
name: "deleteFile",
|
|
19
|
-
description: `Delete a file from the filesystem.
|
|
20
|
-
This tool will permanently remove the specified file.
|
|
21
|
-
Use with caution as deleted files cannot be recovered.`,
|
|
22
|
-
parameters: DeleteFileInputSchema,
|
|
23
|
-
},
|
|
24
|
-
needsBrowser: false,
|
|
12
|
+
...delete_file_1.deleteFileTool,
|
|
25
13
|
execute: async ({ input, repoPath, collectArtifacts, }) => {
|
|
26
14
|
try {
|
|
27
15
|
const filePath = path_1.default.join(repoPath, input.path);
|
|
@@ -35,7 +23,7 @@ Use with caution as deleted files cannot be recovered.`,
|
|
|
35
23
|
};
|
|
36
24
|
}
|
|
37
25
|
}
|
|
38
|
-
catch
|
|
26
|
+
catch {
|
|
39
27
|
return {
|
|
40
28
|
isError: true,
|
|
41
29
|
result: `Error: File '${input.path}' does not exist.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnosis-fetcher.d.ts","sourceRoot":"","sources":["../../src/tools/diagnosis-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"diagnosis-fetcher.d.ts","sourceRoot":"","sources":["../../src/tools/diagnosis-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAcvD,eAAO,MAAM,wBAAwB,EAAE,IA+EtC,CAAC"}
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchDiagnosisReportTool = void 0;
|
|
7
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
7
|
const path_1 = __importDefault(require("path"));
|
|
9
8
|
const zod_1 = require("zod");
|
|
9
|
+
const slug_1 = require("../utils/slug");
|
|
10
10
|
const DiagnosisSchema = zod_1.z.object({
|
|
11
11
|
diagnosisUrl: zod_1.z
|
|
12
12
|
.string()
|
|
@@ -15,21 +15,27 @@ const DiagnosisSchema = zod_1.z.object({
|
|
|
15
15
|
exports.fetchDiagnosisReportTool = {
|
|
16
16
|
schema: {
|
|
17
17
|
name: "fetchDiagnosisDetails",
|
|
18
|
-
description: "Fetch details about a test case diagnosis using its URL or slug",
|
|
18
|
+
description: "Fetch details about a test case diagnosis using its URL or slug. Returns diagnosis data including test metadata, error details, and file path. Use fileViewTool separately to read the actual test source code if needed.",
|
|
19
19
|
parameters: DiagnosisSchema,
|
|
20
20
|
},
|
|
21
21
|
needsBrowser: false,
|
|
22
|
+
isInlineTool: true,
|
|
22
23
|
execute: async ({ input, repoPath, apiClient }) => {
|
|
23
24
|
const { diagnosisUrl } = input;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
let slug;
|
|
26
|
+
try {
|
|
27
|
+
slug = (0, slug_1.extractSlugFromDiagnosisUrl)(diagnosisUrl);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
27
30
|
return {
|
|
28
31
|
isError: true,
|
|
29
|
-
result:
|
|
32
|
+
result: `Invalid diagnosis URL - could not extract slug: ${error instanceof Error ? error.message : String(error)}`,
|
|
30
33
|
};
|
|
31
34
|
}
|
|
32
35
|
let data = null;
|
|
36
|
+
if (!apiClient) {
|
|
37
|
+
throw new Error("Dashboard API client is not available.");
|
|
38
|
+
}
|
|
33
39
|
try {
|
|
34
40
|
data = await apiClient.request(`/api/diagnosis/${slug}/detailed`, {
|
|
35
41
|
method: "GET",
|
|
@@ -43,7 +49,6 @@ exports.fetchDiagnosisReportTool = {
|
|
|
43
49
|
}
|
|
44
50
|
const { test_case, diagnosis } = data.data;
|
|
45
51
|
const project = diagnosis?.test_project || "unknown";
|
|
46
|
-
const sourceContext = await promises_1.default.readFile(path_1.default.join(repoPath, "tests", test_case.file_path), "utf-8");
|
|
47
52
|
const repoName = path_1.default.basename(repoPath);
|
|
48
53
|
const cleanErrorStack = diagnosis?.failed_run_metadata?.stack?.replace(`"/runner/_work/${repoName}/${repoName}/source-repo/"`, "");
|
|
49
54
|
// Format the response as markdown
|
|
@@ -53,12 +58,9 @@ exports.fetchDiagnosisReportTool = {
|
|
|
53
58
|
## Test Case Information
|
|
54
59
|
- **Test Case Name**: ${test_case.name}
|
|
55
60
|
- **Test Suite**: ${test_case.suites}
|
|
56
|
-
- **File
|
|
61
|
+
- **File Path**: tests/${test_case.file_path}
|
|
57
62
|
- **Project**: ${project}
|
|
58
63
|
|
|
59
|
-
## Source Context
|
|
60
|
-
${sourceContext}
|
|
61
|
-
|
|
62
64
|
## What Happened in the Test Run
|
|
63
65
|
|
|
64
66
|
### Failure Details
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/download-build/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAC;AAQpE,eAAO,MAAM,iBAAiB,EAAE,IA4B/B,CAAC"}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.downloadBuildTool =
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
exports.downloadBuildToolSchema = zod_1.z.object({
|
|
7
|
-
buildUrl: zod_1.z.string().describe("The URL of the build to download"),
|
|
8
|
-
});
|
|
3
|
+
exports.downloadBuildTool = void 0;
|
|
4
|
+
const test_build_1 = require("../../test-build");
|
|
5
|
+
const download_build_1 = require("../definitions/download-build");
|
|
9
6
|
exports.downloadBuildTool = {
|
|
10
|
-
|
|
11
|
-
name: "downloadBuild",
|
|
12
|
-
description: `Download a build from a build URL. If you do not have
|
|
13
|
-
have a build URL, you can try getting the environment details with the getEnvironment tool.
|
|
14
|
-
Environment details will include the build URL.`,
|
|
15
|
-
parameters: exports.downloadBuildToolSchema,
|
|
16
|
-
},
|
|
17
|
-
needsBrowser: false,
|
|
7
|
+
...download_build_1.downloadBuildTool,
|
|
18
8
|
execute: async (params) => {
|
|
19
9
|
const { input } = params;
|
|
20
10
|
const { repoPath } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAEL,eAAe,EACf,mBAAmB,EACnB,WAAW,EACZ,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAEL,eAAe,EACf,mBAAmB,EACnB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAwBpC,qBAAa,YAAY;IACvB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAM;IAChD,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEjC,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,KAAK,EACL,YAAY,EACZ,oBAAyB,GAC1B,EAAE;QACD,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;QACpC,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,mBAAmB,CAAC;QAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/C;IA4CK,OAAO,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAqEnE"}
|
|
@@ -7,14 +7,20 @@ const delete_file_1 = require("../delete-file");
|
|
|
7
7
|
const diagnosis_fetcher_1 = require("../diagnosis-fetcher");
|
|
8
8
|
const download_build_1 = require("../download-build");
|
|
9
9
|
const fetch_image_1 = require("../fetch-image");
|
|
10
|
+
const fetch_last_successful_test_run_1 = require("../fetch-last-successful-test-run");
|
|
11
|
+
const fetch_video_analysis_1 = require("../fetch-video-analysis");
|
|
12
|
+
const file_operations_1 = require("../file-operations");
|
|
10
13
|
const grep_1 = require("../grep");
|
|
14
|
+
const issues_1 = require("../issues");
|
|
11
15
|
const list_environments_1 = require("../list-environments");
|
|
12
16
|
const merge_conflicts_1 = require("../merge-conflicts");
|
|
13
17
|
const run_test_1 = require("../run-test");
|
|
14
|
-
const str_replace_editor_1 = require("../str_replace_editor");
|
|
15
18
|
const test_gen_browser_1 = require("../test-gen-browser");
|
|
16
19
|
const test_run_fetcher_1 = require("../test-run-fetcher");
|
|
20
|
+
const trace_dot_zip_1 = require("../trace-dot-zip");
|
|
21
|
+
const triage_summary_1 = require("../triage-summary");
|
|
17
22
|
const upgrade_packages_1 = require("../upgrade-packages");
|
|
23
|
+
const view_failed_test_run_report_1 = require("../view-failed-test-run-report");
|
|
18
24
|
const checkpoint_1 = require("./utils/checkpoint");
|
|
19
25
|
class ToolExecutor {
|
|
20
26
|
toolExecutors = {};
|
|
@@ -33,6 +39,7 @@ class ToolExecutor {
|
|
|
33
39
|
this.apiClient = apiClient;
|
|
34
40
|
this.featureFlags = featureFlags;
|
|
35
41
|
this.environmentOverrides = environmentOverrides;
|
|
42
|
+
// Found for "Tool Executor Tools List" and add any new tools to the list
|
|
36
43
|
const tools = [
|
|
37
44
|
grep_1.grepTool,
|
|
38
45
|
run_test_1.runTestTool,
|
|
@@ -42,11 +49,19 @@ class ToolExecutor {
|
|
|
42
49
|
commit_and_create_pr_1.createPullRequestTool,
|
|
43
50
|
merge_conflicts_1.mergeConflictsTool,
|
|
44
51
|
list_environments_1.listEnvironmentsTool,
|
|
52
|
+
issues_1.listIssuesTool,
|
|
53
|
+
issues_1.createIssueTool,
|
|
45
54
|
download_build_1.downloadBuildTool,
|
|
46
55
|
upgrade_packages_1.upgradePackagesTool,
|
|
47
56
|
fetch_image_1.fetchImageTool,
|
|
57
|
+
fetch_video_analysis_1.fetchVideoAnalysis,
|
|
48
58
|
delete_file_1.deleteFileTool,
|
|
49
|
-
|
|
59
|
+
trace_dot_zip_1.traceDotZipTool,
|
|
60
|
+
view_failed_test_run_report_1.viewFailedTestRunReportTool,
|
|
61
|
+
issues_1.updateIssueTool,
|
|
62
|
+
fetch_last_successful_test_run_1.fetchLastSuccessfulTestRunTool,
|
|
63
|
+
triage_summary_1.sendTriageSummaryTool,
|
|
64
|
+
...file_operations_1.textEditorTools,
|
|
50
65
|
];
|
|
51
66
|
tools.forEach((tool) => {
|
|
52
67
|
this.toolExecutors[tool.schema.name] = tool.execute;
|
|
@@ -54,8 +69,8 @@ class ToolExecutor {
|
|
|
54
69
|
this.toolExecutors = {
|
|
55
70
|
...this.toolExecutors,
|
|
56
71
|
// Support for Claude 3x and 4: They use different tool names
|
|
57
|
-
str_replace_editor:
|
|
58
|
-
str_replace_based_edit_tool:
|
|
72
|
+
str_replace_editor: file_operations_1.strReplaceEditorExecutor,
|
|
73
|
+
str_replace_based_edit_tool: file_operations_1.strReplaceEditorExecutor,
|
|
59
74
|
};
|
|
60
75
|
}
|
|
61
76
|
async execute(toolCalls) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ChatSessionInfo } from "@empiricalrun/shared-types";
|
|
2
2
|
export declare function generateSessionMetadata(chatSession: ChatSessionInfo | null): string;
|
|
3
|
-
export declare function addMetadataToPRDescription(description: string, chatSession: ChatSessionInfo | null): string;
|
|
3
|
+
export declare function addMetadataToPRDescription(description: string, chatSession: ChatSessionInfo | null | undefined): string;
|
|
4
4
|
//# sourceMappingURL=pr-description.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-description.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/pr-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,GAAG,IAAI,GAClC,MAAM,CASR;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"pr-description.d.ts","sourceRoot":"","sources":["../../../../src/tools/executor/utils/pr-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,GAAG,IAAI,GAClC,MAAM,CASR;AAED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC9C,MAAM,CAWR"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { Tool } from "@empiricalrun/shared-types";
|
|
2
|
-
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
declare const fetchImageSchema: z.ZodObject<{
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
url: string;
|
|
7
|
+
}, {
|
|
8
|
+
url: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const fetchImageTool: Tool<z.infer<typeof fetchImageSchema>>;
|
|
11
|
+
export {};
|
|
3
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA8B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-image/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA8B,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,gBAAgB;;;;;;EAEpB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAuDjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-last-successful-test-run/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAQ5E,eAAO,MAAM,8BAA8B,EAAE,IAgE5C,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchLastSuccessfulTestRunTool = void 0;
|
|
4
|
+
const utils_1 = require("../definitions/utils");
|
|
5
|
+
const FetchLastSuccessfulTestRunSchema = (0, utils_1.getCommonTestNameSuitesFilePathSchema)("The name of the test to find the last successful run for");
|
|
6
|
+
exports.fetchLastSuccessfulTestRunTool = {
|
|
7
|
+
schema: {
|
|
8
|
+
name: "fetchLastSuccessfulTestRun",
|
|
9
|
+
description: "Fetch details about the last successful test run for a specific test. Tool response is a JSON of key-value pairs, where the key is the Playwright project name and the value is the object containing the test run id, summary url, timestamp, and test case from the last successful test run data",
|
|
10
|
+
parameters: FetchLastSuccessfulTestRunSchema,
|
|
11
|
+
},
|
|
12
|
+
needsBrowser: false,
|
|
13
|
+
isInlineTool: true,
|
|
14
|
+
execute: async ({ input, apiClient }) => {
|
|
15
|
+
try {
|
|
16
|
+
const { testName, suites, filePath } = input;
|
|
17
|
+
if (!apiClient) {
|
|
18
|
+
throw new Error("Dashboard API client is not available.");
|
|
19
|
+
}
|
|
20
|
+
const formattedSuites = suites.length
|
|
21
|
+
? suites.filter((suite) => suite !== filePath).join("~~")
|
|
22
|
+
: "~~";
|
|
23
|
+
const response = await apiClient.request(`/api/test-cases/last-successful-run`, {
|
|
24
|
+
method: "GET",
|
|
25
|
+
params: {
|
|
26
|
+
test_case_name: testName,
|
|
27
|
+
file_path: filePath,
|
|
28
|
+
suites: formattedSuites,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
if (!response?.data) {
|
|
32
|
+
return {
|
|
33
|
+
isError: true,
|
|
34
|
+
result: `Failed to fetch last successful test run: ${response?.error?.message || "No data received"}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const last_successful_run = response.data.last_successful_run;
|
|
38
|
+
if (Object.keys(last_successful_run).length === 0) {
|
|
39
|
+
return {
|
|
40
|
+
isError: false,
|
|
41
|
+
result: `No last successful test run found for ${testName}`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
result: `
|
|
46
|
+
Note: the paths in the test run report are relative to the tests directory and not the repo directory.
|
|
47
|
+
|
|
48
|
+
Last successful test run details: ${JSON.stringify(last_successful_run, null, 2)}`,
|
|
49
|
+
isError: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error("Error in fetchLastSuccessfulTestRun:", error);
|
|
54
|
+
return {
|
|
55
|
+
isError: true,
|
|
56
|
+
result: `Failed to fetch last successful test run: ${error instanceof Error ? error.message : String(error)}`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tool } from "@empiricalrun/shared-types";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { videoAnalysisSchema } from "../definitions/fetch-video-analysis";
|
|
4
|
+
export declare const fetchVideoAnalysis: Tool<z.infer<typeof videoAnalysisSchema>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/fetch-video-analysis/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAqB,MAAM,4BAA4B,CAAC;AAErE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,mBAAmB,EACpB,MAAM,qCAAqC,CAAC;AAK7C,eAAO,MAAM,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAiHxE,CAAC"}
|