@empiricalrun/test-gen 0.78.0 → 0.78.2
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 +19 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +0 -10
- package/dist/agent/base/index.d.ts +28 -19
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +25 -14
- package/dist/agent/browsing/run.d.ts +1 -1
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.d.ts +5 -5
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/exports.d.ts +3 -4
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +5 -11
- package/dist/agent/chat/index.d.ts +4 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +12 -5
- package/dist/agent/chat/models.d.ts +1 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +3 -3
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +42 -0
- 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 +2 -2
- package/dist/agent/chat/state.d.ts +14 -19
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +10 -45
- package/dist/agent/chat/utils.d.ts +5 -5
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/cli.d.ts +2 -2
- package/dist/agent/cli.d.ts.map +1 -1
- package/dist/agent/cli.js +5 -6
- package/dist/agent/code-review/index.d.ts +4 -3
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +10 -4
- package/dist/agent/code-review/types.d.ts +2 -35
- package/dist/agent/code-review/types.d.ts.map +1 -1
- package/dist/agent/code-review/types.js +4 -11
- package/dist/agent/cua/index.d.ts +1 -1
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +24 -13
- package/dist/agent/cua/pw-codegen/factory.d.ts +15 -0
- package/dist/agent/cua/pw-codegen/factory.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/factory.js +59 -0
- package/dist/agent/cua/pw-codegen/index.d.ts +7 -0
- package/dist/agent/cua/pw-codegen/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/index.js +14 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts +43 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.js +250 -0
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +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 +7 -3
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts +15 -3
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/patch.js +38 -10
- package/dist/agent/cua/pw-codegen/version.d.ts +25 -0
- package/dist/agent/cua/pw-codegen/version.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/version.js +86 -0
- package/dist/agent/index.d.ts +1 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -11
- package/dist/agent/master/element-annotation.d.ts +1 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/next-action.d.ts +1 -1
- package/dist/agent/master/next-action.d.ts.map +1 -1
- package/dist/agent/master/next-action.js +1 -6
- package/dist/agent/master/run.d.ts +3 -2
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +0 -26
- package/dist/agent/triage/index.d.ts +4 -3
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +33 -20
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/utils.d.ts +1 -1
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/bin/environments.d.ts +1 -1
- package/dist/bin/environments.d.ts.map +1 -1
- package/dist/bin/index.js +2 -2
- package/dist/bin/setup.d.ts +1 -1
- package/dist/bin/setup.d.ts.map +1 -1
- package/dist/bin/utils/fs/index.d.ts +1 -1
- package/dist/bin/utils/fs/index.d.ts.map +1 -1
- 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 +1 -1
- package/dist/bin/utils/scenarios/index.d.ts +1 -1
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -4
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +0 -6
- package/dist/dashboard/client.d.ts +1 -1
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -1
- package/dist/dashboard/tool-response.d.ts +5 -0
- package/dist/dashboard/tool-response.d.ts.map +1 -0
- package/dist/dashboard/tool-response.js +88 -0
- package/dist/dashboard/totp.js +1 -1
- package/dist/file/server.d.ts +1 -1
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +2 -1
- package/dist/file-info/adapters/file-system/index.d.ts +1 -1
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/index.d.ts +2 -1
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.d.ts +2 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +9 -3
- package/dist/recorder/upload.d.ts +1 -1
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.d.ts +1 -1
- package/dist/tools/analyse-video/index.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.js +20 -13
- package/dist/tools/create-pull-request/index.d.ts +1 -1
- package/dist/tools/create-pull-request/index.d.ts.map +1 -1
- package/dist/tools/create-pull-request/utils.d.ts +3 -2
- package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +5 -37
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.js +12 -25
- package/dist/tools/definitions/delete-file.d.ts +5 -1
- package/dist/tools/definitions/delete-file.d.ts.map +1 -1
- package/dist/tools/definitions/delete-file.js +3 -3
- package/dist/tools/definitions/download-build.d.ts +2 -6
- package/dist/tools/definitions/download-build.d.ts.map +1 -1
- package/dist/tools/definitions/grep.d.ts +1 -1
- package/dist/tools/definitions/grep.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts +2 -6
- package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.js +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
- package/dist/tools/definitions/merge-conflicts.js +2 -2
- package/dist/tools/definitions/rename-file.d.ts +1 -1
- package/dist/tools/definitions/rename-file.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.js +1 -1
- package/dist/tools/definitions/run-test.d.ts +3 -15
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/safe-bash.d.ts +8 -0
- package/dist/tools/definitions/safe-bash.d.ts.map +1 -0
- package/dist/tools/definitions/safe-bash.js +32 -0
- package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts +3 -15
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +4 -26
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
- package/dist/tools/definitions/utils.d.ts +2 -10
- package/dist/tools/definitions/utils.d.ts.map +1 -1
- package/dist/tools/definitions/utils.js +1 -1
- package/dist/tools/delete-file/index.d.ts +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +6 -2
- package/dist/tools/diagnosis-fetcher.d.ts +1 -1
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +92 -47
- package/dist/tools/download-build/index.d.ts +1 -1
- package/dist/tools/download-build/index.d.ts.map +1 -1
- package/dist/tools/executor/base.d.ts +3 -2
- package/dist/tools/executor/base.d.ts.map +1 -1
- package/dist/tools/executor/base.js +5 -8
- package/dist/tools/executor/index.d.ts +3 -0
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +12 -10
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
- package/dist/tools/executor/utils/checkpoint.js +0 -4
- package/dist/tools/executor/utils/git.d.ts +7 -1
- package/dist/tools/executor/utils/git.d.ts.map +1 -1
- package/dist/tools/executor/utils/git.js +10 -3
- package/dist/tools/executor/utils/index.d.ts +1 -2
- package/dist/tools/executor/utils/index.d.ts.map +1 -1
- package/dist/tools/executor/utils/index.js +0 -20
- 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-file/index.d.ts +2 -6
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +53 -13
- package/dist/tools/fetch-file/utils.d.ts +3 -0
- package/dist/tools/fetch-file/utils.d.ts.map +1 -0
- package/dist/tools/fetch-file/utils.js +136 -0
- package/dist/tools/fetch-session-diff/index.d.ts +1 -1
- package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
- package/dist/tools/fetch-session-diff/index.js +26 -2
- package/dist/tools/file-operations/create.d.ts +1 -1
- package/dist/tools/file-operations/create.d.ts.map +1 -1
- package/dist/tools/file-operations/index.d.ts +2 -1
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/insert.d.ts +1 -1
- package/dist/tools/file-operations/insert.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.d.ts +1 -1
- package/dist/tools/file-operations/replace.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.js +0 -1
- package/dist/tools/file-operations/view/index.d.ts +2 -1
- package/dist/tools/file-operations/view/index.d.ts.map +1 -1
- package/dist/tools/firecrawl-scrape/index.d.ts +9 -0
- package/dist/tools/firecrawl-scrape/index.d.ts.map +1 -0
- package/dist/tools/firecrawl-scrape/index.js +107 -0
- package/dist/tools/grep/index.d.ts +1 -1
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +15 -12
- package/dist/tools/index.d.ts +5 -24
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +21 -42
- package/dist/tools/issues-v1/create-issue.d.ts +3 -0
- package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
- package/dist/tools/issues-v1/index.d.ts.map +1 -0
- package/dist/tools/issues-v1/list-issues.d.ts +3 -0
- package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
- package/dist/tools/issues-v1/update-issue.d.ts +3 -0
- package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
- package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
- package/dist/tools/issues-v1/utils.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.d.ts +3 -0
- package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.js +82 -0
- package/dist/tools/issues-v2/set-issue-description.d.ts +3 -0
- package/dist/tools/issues-v2/set-issue-description.d.ts.map +1 -0
- package/dist/tools/issues-v2/set-issue-description.js +59 -0
- package/dist/tools/issues-v2/update-issue.d.ts +3 -0
- package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/update-issue.js +85 -0
- package/dist/tools/list-environments.d.ts +1 -1
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.js +14 -4
- package/dist/tools/merge-conflicts/index.d.ts +1 -1
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +23 -10
- package/dist/tools/rename-file/index.d.ts +1 -1
- package/dist/tools/rename-file/index.d.ts.map +1 -1
- package/dist/tools/rename-file/index.js +0 -1
- package/dist/tools/review-pull-request/index.d.ts +1 -1
- package/dist/tools/review-pull-request/index.d.ts.map +1 -1
- package/dist/tools/review-pull-request/index.js +5 -4
- package/dist/tools/run-test.d.ts +1 -1
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/safe-bash/index.d.ts +3 -0
- package/dist/tools/safe-bash/index.d.ts.map +1 -0
- package/dist/tools/safe-bash/index.js +128 -0
- package/dist/tools/test-gen-browser.d.ts +1 -1
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +64 -21
- package/dist/tools/test-run-fetcher/index.d.ts +2 -2
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +67 -66
- package/dist/tools/trace-dot-zip/index.d.ts +1 -1
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
- package/dist/tools/triage-summary/index.d.ts +1 -1
- package/dist/tools/triage-summary/index.d.ts.map +1 -1
- package/dist/tools/triage-summary/index.js +5 -2
- package/dist/tools/triage-summary/utils.d.ts +1 -1
- package/dist/tools/triage-summary/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.d.ts +1 -1
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +14 -8
- package/dist/tools/upgrade-packages/utils.d.ts +9 -5
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/utils.js +56 -16
- package/dist/tools/utils/queue.d.ts +1 -1
- package/dist/tools/utils/queue.d.ts.map +1 -1
- package/dist/tools/utils/validate-schema.d.ts +3 -0
- package/dist/tools/utils/validate-schema.d.ts.map +1 -0
- package/dist/tools/utils/validate-schema.js +27 -0
- package/dist/utils/SQSClient.d.ts +1 -1
- package/dist/utils/SQSClient.d.ts.map +1 -1
- package/dist/utils/dedup/dedup-image.js +2 -2
- package/dist/utils/dedup/find-threshold.d.ts +1 -1
- package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
- package/dist/utils/dedup/find-threshold.js +2 -2
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +6 -10
- package/dist/utils/playwright-report-parser.d.ts +1 -1
- package/dist/utils/playwright-report-parser.d.ts.map +1 -1
- package/dist/utils/playwright-test-id.d.ts +8 -0
- package/dist/utils/playwright-test-id.d.ts.map +1 -0
- package/dist/utils/playwright-test-id.js +21 -0
- package/dist/utils/repo-tree.d.ts +1 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +15 -4
- package/dist/utils/url-validation.d.ts +2 -0
- package/dist/utils/url-validation.d.ts.map +1 -0
- package/dist/utils/url-validation.js +16 -0
- package/dist/video-core/index.d.ts +7 -24
- package/dist/video-core/index.d.ts.map +1 -1
- package/dist/video-core/index.js +32 -25
- package/dist/video-core/model-limits.d.ts +2 -2
- package/dist/video-core/model-limits.d.ts.map +1 -1
- package/dist/video-core/model-limits.js +9 -19
- package/dist/video-core/storage-manager.d.ts +2 -1
- package/dist/video-core/storage-manager.d.ts.map +1 -1
- package/dist/video-core/types.d.ts +1 -1
- package/dist/video-core/types.d.ts.map +1 -1
- package/dist/video-core/utils.d.ts +5 -7
- package/dist/video-core/utils.d.ts.map +1 -1
- package/dist/video-core/utils.js +39 -132
- package/package.json +10 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/actions/skill.d.ts +0 -21
- package/dist/actions/skill.d.ts.map +0 -1
- package/dist/actions/skill.js +0 -127
- package/dist/agent/chat/filesystem-cache.d.ts +0 -12
- package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
- package/dist/agent/chat/filesystem-cache.js +0 -101
- package/dist/agent/codegen/create-test-block.d.ts +0 -8
- package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
- package/dist/agent/codegen/create-test-block.js +0 -47
- package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
- package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
- package/dist/agent/codegen/fix-ts-errors.js +0 -78
- package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
- package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
- package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
- package/dist/agent/codegen/skills-retriever.d.ts +0 -26
- package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
- package/dist/agent/codegen/skills-retriever.js +0 -93
- package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
- package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
- package/dist/agent/codegen/test-update-feedback.js +0 -49
- package/dist/agent/codegen/types.d.ts +0 -25
- package/dist/agent/codegen/types.d.ts.map +0 -1
- package/dist/agent/codegen/types.js +0 -8
- package/dist/agent/codegen/update-flow.d.ts +0 -36
- package/dist/agent/codegen/update-flow.d.ts.map +0 -1
- package/dist/agent/codegen/update-flow.js +0 -259
- package/dist/agent/codegen/use-skill.d.ts +0 -11
- package/dist/agent/codegen/use-skill.d.ts.map +0 -1
- package/dist/agent/codegen/use-skill.js +0 -53
- package/dist/agent/codegen/utils.d.ts +0 -110
- package/dist/agent/codegen/utils.d.ts.map +0 -1
- package/dist/agent/codegen/utils.js +0 -376
- package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
- package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
- package/dist/agent/master/browser-tests/skills.spec.js +0 -112
- package/dist/agent/master/execute-skill-action.d.ts +0 -11
- package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
- package/dist/agent/master/execute-skill-action.js +0 -23
- package/dist/agent/video-analysis/executor/index.d.ts +0 -5
- package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/executor/index.js +0 -10
- package/dist/agent/video-analysis/index.d.ts +0 -7
- package/dist/agent/video-analysis/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/index.js +0 -60
- package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
- package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
- package/dist/evals/append-create-test-agent.evals.js +0 -117
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
- package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
- package/dist/evals/master-agent.evals.d.ts +0 -4
- package/dist/evals/master-agent.evals.d.ts.map +0 -1
- package/dist/evals/master-agent.evals.js +0 -35
- package/dist/evals/type.d.ts +0 -12
- package/dist/evals/type.d.ts.map +0 -1
- package/dist/evals/type.js +0 -2
- package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
- package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
- package/dist/evals/update-scenario-agent.evals.js +0 -47
- package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
- package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
- package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
- package/dist/tools/issues/create-issue.d.ts +0 -3
- package/dist/tools/issues/create-issue.d.ts.map +0 -1
- package/dist/tools/issues/index.d.ts.map +0 -1
- package/dist/tools/issues/list-issues.d.ts +0 -3
- package/dist/tools/issues/list-issues.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.d.ts +0 -24
- package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.js +0 -22
- package/dist/tools/issues/update-issue.d.ts +0 -3
- package/dist/tools/issues/update-issue.d.ts.map +0 -1
- package/dist/tools/issues/utils.d.ts.map +0 -1
- package/dist/tools/utils/urls.d.ts +0 -5
- package/dist/tools/utils/urls.d.ts.map +0 -1
- package/dist/tools/utils/urls.js +0 -19
- package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
- package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
- package/dist/tools/view-failed-test-run-report/index.js +0 -151
- package/dist/video-core/agent-orchestrator.d.ts +0 -13
- package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
- package/dist/video-core/agent-orchestrator.js +0 -59
- package/dist/video-core/xml-parser.d.ts +0 -3
- package/dist/video-core/xml-parser.d.ts.map +0 -1
- package/dist/video-core/xml-parser.js +0 -27
- /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
- /package/dist/tools/{issues → issues-v1}/index.js +0 -0
- /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
- /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
|
@@ -9,9 +9,9 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const merge_conflicts_1 = require("../definitions/merge-conflicts");
|
|
11
11
|
const git_1 = require("../executor/utils/git");
|
|
12
|
-
function
|
|
12
|
+
function runMerge(repoPath, targetBranch) {
|
|
13
13
|
try {
|
|
14
|
-
(0, child_process_1.execSync)(
|
|
14
|
+
(0, child_process_1.execSync)(`git merge --no-ff origin/${targetBranch} -m 'Merge remote-tracking branch origin/${targetBranch} [skip ci]'`, { stdio: "pipe", cwd: repoPath });
|
|
15
15
|
return "CLEAN";
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
@@ -42,26 +42,39 @@ function getConflictedFilesWithContents(repoPath) {
|
|
|
42
42
|
}
|
|
43
43
|
exports.mergeConflictsTool = {
|
|
44
44
|
...merge_conflicts_1.mergeConflictsTool,
|
|
45
|
-
execute: async ({ repoPath }) => {
|
|
45
|
+
execute: async ({ repoPath, chatSession }) => {
|
|
46
|
+
const targetBranch = chatSession?.baseBranchName || "main";
|
|
46
47
|
try {
|
|
47
48
|
// Fetch main branch (git clone runs --single-branch), and then run merge
|
|
48
|
-
(0, child_process_1.execSync)(
|
|
49
|
-
|
|
49
|
+
(0, child_process_1.execSync)(`git remote set-branches --add origin ${targetBranch}`, {
|
|
50
|
+
cwd: repoPath,
|
|
51
|
+
});
|
|
52
|
+
(0, child_process_1.execSync)(`git fetch origin ${targetBranch}`, { cwd: repoPath });
|
|
53
|
+
// Configure git user for merge
|
|
54
|
+
(0, child_process_1.execSync)(`git config user.name "${git_1.GIT_USER_NAME}"`, { cwd: repoPath });
|
|
55
|
+
(0, child_process_1.execSync)(`git config user.email "${git_1.GIT_USER_EMAIL}"`, { cwd: repoPath });
|
|
50
56
|
// Run merge command and commit (with or without conflict)
|
|
51
|
-
const mergeResult =
|
|
57
|
+
const mergeResult = runMerge(repoPath, targetBranch);
|
|
52
58
|
const branchName = await (0, git_1.getCurrentBranchName)(repoPath);
|
|
53
59
|
if (mergeResult === "CLEAN") {
|
|
54
60
|
(0, child_process_1.execSync)(`git push origin ${branchName}`, { cwd: repoPath });
|
|
55
61
|
return {
|
|
56
62
|
isError: false,
|
|
57
|
-
result: `Merge from
|
|
63
|
+
result: `Merge from ${targetBranch} was successful, without any conflicts.`,
|
|
58
64
|
};
|
|
59
65
|
}
|
|
60
66
|
else if (mergeResult === "CONFLICTS") {
|
|
61
67
|
const files = getConflictedFilesWithContents(repoPath);
|
|
68
|
+
const filePaths = Object.keys(files);
|
|
69
|
+
if (filePaths.length === 0) {
|
|
70
|
+
return {
|
|
71
|
+
isError: true,
|
|
72
|
+
result: `Merge failed with exit code 1, but no conflicted files were found.`,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
62
75
|
(0, git_1.stageAndCommitFilesAsBotUser)({
|
|
63
|
-
commitMessage:
|
|
64
|
-
files:
|
|
76
|
+
commitMessage: `Merge from ${targetBranch} with conflicts`,
|
|
77
|
+
files: filePaths,
|
|
65
78
|
repoPath,
|
|
66
79
|
});
|
|
67
80
|
(0, child_process_1.execSync)(`git push origin ${branchName}`, { cwd: repoPath });
|
|
@@ -71,7 +84,7 @@ exports.mergeConflictsTool = {
|
|
|
71
84
|
.join("\n\n");
|
|
72
85
|
return {
|
|
73
86
|
isError: false,
|
|
74
|
-
result: `Merge from
|
|
87
|
+
result: `Merge from ${targetBranch} is committed, with conflicts. Use text edit tools to resolve them.\n\n${filesResult}`,
|
|
75
88
|
};
|
|
76
89
|
}
|
|
77
90
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/rename-file/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/rename-file/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,uCAAuC,CAAC;AAQ9E,eAAO,MAAM,cAAc,EAAE,IA4E5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/review-pull-request/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/review-pull-request/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEL,MAAM,uCAAuC,CAAC;AAU/C,eAAO,MAAM,qBAAqB,EAAE,IA0FnC,CAAC"}
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reviewPullRequestTool = void 0;
|
|
4
4
|
const code_review_1 = require("../../agent/code-review");
|
|
5
5
|
const executor_1 = require("../../agent/code-review/executor");
|
|
6
|
+
const file_info_1 = require("../../file-info");
|
|
6
7
|
const review_pull_request_1 = require("../definitions/review-pull-request");
|
|
7
|
-
const CODE_REVIEW_MODEL = "claude-sonnet-4-
|
|
8
|
+
const CODE_REVIEW_MODEL = "claude-sonnet-4-5-20250929";
|
|
8
9
|
exports.reviewPullRequestTool = {
|
|
9
10
|
...review_pull_request_1.reviewPullRequestTool,
|
|
10
|
-
execute: async ({ input, apiClient,
|
|
11
|
+
execute: async ({ input, apiClient, environmentOverrides, trace, featureFlags, repoPath, }) => {
|
|
11
12
|
try {
|
|
12
13
|
const { sessionUrl } = input;
|
|
13
14
|
if (!sessionUrl) {
|
|
@@ -29,7 +30,7 @@ exports.reviewPullRequestTool = {
|
|
|
29
30
|
},
|
|
30
31
|
});
|
|
31
32
|
const codeReviewToolExecutor = new executor_1.CodeReviewToolExecutor({
|
|
32
|
-
chatSession:
|
|
33
|
+
chatSession: null,
|
|
33
34
|
repoPath,
|
|
34
35
|
apiClient,
|
|
35
36
|
trace: span,
|
|
@@ -42,6 +43,7 @@ exports.reviewPullRequestTool = {
|
|
|
42
43
|
chatState: undefined,
|
|
43
44
|
toolExecutor: codeReviewToolExecutor,
|
|
44
45
|
trace: span,
|
|
46
|
+
repoInfoBuilder: () => (0, file_info_1.getFileInfoFromFS)(repoPath),
|
|
45
47
|
};
|
|
46
48
|
const agent = new code_review_1.CodeReviewAgent({ ...agentParams });
|
|
47
49
|
// Push the review prompt to the agent
|
|
@@ -50,7 +52,6 @@ exports.reviewPullRequestTool = {
|
|
|
50
52
|
while (!agent.askUserForInput) {
|
|
51
53
|
await agent.runLoop({
|
|
52
54
|
reporter: async () => { },
|
|
53
|
-
trace: span,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
const agentResult = agent.getResult();
|
package/dist/tools/run-test.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../src/tools/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"run-test.d.ts","sourceRoot":"","sources":["../../src/tools/run-test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,uCAAuC,CAAC;AA0C/C,eAAO,MAAM,WAAW,EAAE,IA4GzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/safe-bash/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,uCAAuC,CAAC;AA4G9E,eAAO,MAAM,YAAY,EAAE,IAuE1B,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeBashTool = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const util_1 = require("util");
|
|
6
|
+
const safe_bash_1 = require("../definitions/safe-bash");
|
|
7
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
8
|
+
const DANGEROUS_PATTERNS = [
|
|
9
|
+
/git\s+checkout/i,
|
|
10
|
+
/git\s+switch/i,
|
|
11
|
+
/git\s+reset\s+--hard/i,
|
|
12
|
+
/git\s+push/i,
|
|
13
|
+
/git\s+commit/i,
|
|
14
|
+
/\.git\/HEAD/i,
|
|
15
|
+
/symbolic-ref\s+HEAD/i,
|
|
16
|
+
];
|
|
17
|
+
async function getCurrentBranch(cwd) {
|
|
18
|
+
try {
|
|
19
|
+
const { stdout } = await execAsync("git rev-parse --abbrev-ref HEAD", {
|
|
20
|
+
cwd,
|
|
21
|
+
});
|
|
22
|
+
return stdout.trim();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function getGitStatus(cwd) {
|
|
29
|
+
try {
|
|
30
|
+
const { stdout: stagedOutput } = await execAsync("git diff --cached --name-status", { cwd });
|
|
31
|
+
const { stdout: unstagedOutput } = await execAsync("git diff --name-status", { cwd });
|
|
32
|
+
const { stdout: untrackedOutput } = await execAsync("git ls-files --others --exclude-standard", { cwd });
|
|
33
|
+
const staged = stagedOutput.trim() || "No staged changes";
|
|
34
|
+
const unstagedLines = unstagedOutput.trim();
|
|
35
|
+
const untrackedLines = untrackedOutput
|
|
36
|
+
.trim()
|
|
37
|
+
.split("\n")
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.map((f) => `??\t${f}`)
|
|
40
|
+
.join("\n");
|
|
41
|
+
const unstaged = [unstagedLines, untrackedLines].filter(Boolean).join("\n") ||
|
|
42
|
+
"No unstaged changes";
|
|
43
|
+
return { staged, unstaged };
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return { staged: "Unable to get status", unstaged: "Unable to get status" };
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function containsDangerousPattern(script) {
|
|
50
|
+
for (const pattern of DANGEROUS_PATTERNS) {
|
|
51
|
+
if (pattern.test(script)) {
|
|
52
|
+
return pattern.source;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function formatResult({ stdout, stderr, gitStatus, }) {
|
|
58
|
+
const parts = [];
|
|
59
|
+
if (stdout.trim()) {
|
|
60
|
+
parts.push(`## stdout\n\`\`\`\n${stdout.trim()}\n\`\`\``);
|
|
61
|
+
}
|
|
62
|
+
if (stderr.trim()) {
|
|
63
|
+
parts.push(`## stderr\n\`\`\`\n${stderr.trim()}\n\`\`\``);
|
|
64
|
+
}
|
|
65
|
+
parts.push(`## Staged (will be committed)\n\`\`\`\n${gitStatus.staged}\n\`\`\``);
|
|
66
|
+
parts.push(`## Unstaged\n\`\`\`\n${gitStatus.unstaged}\n\`\`\``);
|
|
67
|
+
return parts.join("\n\n");
|
|
68
|
+
}
|
|
69
|
+
exports.safeBashTool = {
|
|
70
|
+
...safe_bash_1.safeBashTool,
|
|
71
|
+
execute: async ({ input, repoPath, logger }) => {
|
|
72
|
+
const { script, timeout = 60000 } = input;
|
|
73
|
+
const initialBranch = await getCurrentBranch(repoPath);
|
|
74
|
+
if (!initialBranch) {
|
|
75
|
+
return {
|
|
76
|
+
isError: true,
|
|
77
|
+
result: "Not in a git repository or unable to determine branch",
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const dangerousPattern = containsDangerousPattern(script);
|
|
81
|
+
if (dangerousPattern) {
|
|
82
|
+
return {
|
|
83
|
+
isError: true,
|
|
84
|
+
result: `Script rejected: contains forbidden pattern '${dangerousPattern}'`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
let stdout = "";
|
|
88
|
+
let stderr = "";
|
|
89
|
+
try {
|
|
90
|
+
const result = await execAsync(script, {
|
|
91
|
+
cwd: repoPath,
|
|
92
|
+
timeout,
|
|
93
|
+
shell: "/bin/bash",
|
|
94
|
+
});
|
|
95
|
+
stdout = result.stdout;
|
|
96
|
+
stderr = result.stderr;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const execError = error;
|
|
100
|
+
logger?.error("Error executing safe bash", {
|
|
101
|
+
tool: "safeBashTool",
|
|
102
|
+
error: execError.message || String(error),
|
|
103
|
+
});
|
|
104
|
+
const gitStatus = await getGitStatus(repoPath);
|
|
105
|
+
return {
|
|
106
|
+
isError: true,
|
|
107
|
+
result: formatResult({
|
|
108
|
+
stdout: execError.stdout || "",
|
|
109
|
+
stderr: execError.stderr || execError.message || "Unknown error",
|
|
110
|
+
gitStatus,
|
|
111
|
+
}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const finalBranch = await getCurrentBranch(repoPath);
|
|
115
|
+
if (finalBranch !== initialBranch) {
|
|
116
|
+
const gitStatus = await getGitStatus(repoPath);
|
|
117
|
+
return {
|
|
118
|
+
isError: true,
|
|
119
|
+
result: `Branch changed from '${initialBranch}' to '${finalBranch}' - execution rejected\n\n${formatResult({ stdout, stderr, gitStatus })}`,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const gitStatus = await getGitStatus(repoPath);
|
|
123
|
+
return {
|
|
124
|
+
isError: false,
|
|
125
|
+
result: formatResult({ stdout, stderr, gitStatus }),
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,IAAI,EACL,MAAM,uCAAuC,CAAC;AAuB/C,eAAO,MAAM,4BAA4B,EAAE,IAyO1C,CAAC"}
|
|
@@ -9,6 +9,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const run_1 = require("../agent/browsing/run");
|
|
11
11
|
const utils_1 = require("../agent/browsing/utils");
|
|
12
|
+
const pw_codegen_1 = require("../agent/cua/pw-codegen");
|
|
12
13
|
const pw_pause_1 = require("../agent/cua/pw-codegen/pw-pause");
|
|
13
14
|
const utils_2 = require("../artifacts/utils");
|
|
14
15
|
const web_1 = require("../bin/utils/platform/web");
|
|
@@ -16,7 +17,7 @@ const scenarios_1 = require("../bin/utils/scenarios");
|
|
|
16
17
|
const test_gen_browser_1 = require("./definitions/test-gen-browser");
|
|
17
18
|
exports.generateTestWithBrowserAgent = {
|
|
18
19
|
...test_gen_browser_1.generateTestWithBrowserAgent,
|
|
19
|
-
execute: async ({ input, repoPath, trace, collectArtifacts, environmentOverrides = {}, featureFlags, }) => {
|
|
20
|
+
execute: async ({ input, repoPath, trace, collectArtifacts, environmentOverrides = {}, featureFlags, logger, }) => {
|
|
20
21
|
const { filePath, project } = input;
|
|
21
22
|
const absoluteFilePath = path_1.default.join(repoPath, filePath);
|
|
22
23
|
if (!fs_1.default.existsSync(absoluteFilePath)) {
|
|
@@ -35,7 +36,7 @@ exports.generateTestWithBrowserAgent = {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
38
|
-
|
|
39
|
+
logger.error("Error reading playwright config:", { error });
|
|
39
40
|
return {
|
|
40
41
|
isError: true,
|
|
41
42
|
result: `Error reading playwright config: ${error}`,
|
|
@@ -67,12 +68,23 @@ exports.generateTestWithBrowserAgent = {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
try {
|
|
70
|
-
// Prepare playwright for codegen
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
// Prepare playwright for codegen (only needed for patch-based approach)
|
|
72
|
+
const version = await (0, pw_codegen_1.detectPlaywrightVersion)(repoPath);
|
|
73
|
+
if (version) {
|
|
74
|
+
const approach = (0, pw_codegen_1.getCodegenApproach)(version);
|
|
75
|
+
logger.info("Preparing playwright for codegen", {
|
|
76
|
+
tool: "generateTestWithBrowserAgent",
|
|
77
|
+
version: version.full,
|
|
78
|
+
approach,
|
|
79
|
+
});
|
|
80
|
+
await (0, pw_codegen_1.prepareCodegenIfNeeded)(repoPath, approach);
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
catch (err) {
|
|
75
|
-
|
|
84
|
+
logger.warn("Error preparing playwright for codegen", {
|
|
85
|
+
tool: "generateTestWithBrowserAgent",
|
|
86
|
+
error: err,
|
|
87
|
+
});
|
|
76
88
|
}
|
|
77
89
|
let envOverrides = {
|
|
78
90
|
...environmentOverrides,
|
|
@@ -86,7 +98,11 @@ exports.generateTestWithBrowserAgent = {
|
|
|
86
98
|
};
|
|
87
99
|
}
|
|
88
100
|
const testGenToken = (0, scenarios_1.buildTokenFromOptions)({ name: testName, file: filePath }, { useComputerUseAgent: true });
|
|
89
|
-
|
|
101
|
+
logger.info("Validations passed, starting agent", {
|
|
102
|
+
tool: "generateTestWithBrowserAgent",
|
|
103
|
+
testName,
|
|
104
|
+
filePath,
|
|
105
|
+
});
|
|
90
106
|
const agentResult = await (0, run_1.runBrowsingAgent)({
|
|
91
107
|
testCaseName: testName,
|
|
92
108
|
testCaseSuites: suites,
|
|
@@ -103,15 +119,7 @@ exports.generateTestWithBrowserAgent = {
|
|
|
103
119
|
await (0, pw_pause_1.revertToOriginalPwCode)(repoPath);
|
|
104
120
|
fs_1.default.writeFileSync(absoluteFilePath, fileBackup, "utf-8");
|
|
105
121
|
const { isError, error, result: toolResult, usage } = agentResult;
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
isError,
|
|
109
|
-
result: `Browser agent failed to run successfully. Here is the error:
|
|
110
|
-
${error}
|
|
111
|
-
`,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const screenshotArtifacts = toolResult
|
|
122
|
+
const screenshotArtifacts = (toolResult || [])
|
|
115
123
|
.filter((item) => item.type === "screenshot")
|
|
116
124
|
.map((item) => item.screenshot)
|
|
117
125
|
.map((artifact) => ({
|
|
@@ -124,6 +132,43 @@ ${error}
|
|
|
124
132
|
...((0, utils_2.findPlaywrightArtifacts)(repoPath) || []),
|
|
125
133
|
...screenshotArtifacts,
|
|
126
134
|
];
|
|
135
|
+
const artifactUrlMap = new Map();
|
|
136
|
+
const pathToUrlMap = new Map();
|
|
137
|
+
if (collectArtifacts && artifactsInput.length > 0) {
|
|
138
|
+
const uploadedArtifacts = await collectArtifacts(artifactsInput);
|
|
139
|
+
artifactsInput.forEach((input, index) => {
|
|
140
|
+
const uploadedArtifact = uploadedArtifacts[index];
|
|
141
|
+
if (uploadedArtifact?.url) {
|
|
142
|
+
artifactUrlMap.set(input, uploadedArtifact.url);
|
|
143
|
+
if ("path" in input) {
|
|
144
|
+
const relativePath = path_1.default.relative(repoPath, input.path);
|
|
145
|
+
pathToUrlMap.set(relativePath, uploadedArtifact.url);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (isError || !toolResult) {
|
|
151
|
+
let errorMessage = `Browser agent failed to run successfully. Here is the error:
|
|
152
|
+
${error}
|
|
153
|
+
`;
|
|
154
|
+
if (typeof error === "string" && pathToUrlMap.size > 0) {
|
|
155
|
+
for (const [artifactPath, url] of pathToUrlMap.entries()) {
|
|
156
|
+
// Escape special regex characters in the path before using it in RegExp
|
|
157
|
+
const regex = new RegExp(artifactPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g");
|
|
158
|
+
const matchCount = (errorMessage.match(regex) || []).length;
|
|
159
|
+
if (matchCount === 0) {
|
|
160
|
+
logger.info("No matches found for artifact path", {
|
|
161
|
+
artifactPath,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
errorMessage = errorMessage.replace(regex, url);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
isError: true,
|
|
169
|
+
result: errorMessage,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
127
172
|
const summaryResult = `Browser agent has finished running.
|
|
128
173
|
TODO comment which it worked on: ${todoContent}
|
|
129
174
|
Summary of actions it took, and the generated Playwright code:`;
|
|
@@ -137,8 +182,6 @@ Summary of actions it took, and the generated Playwright code:`;
|
|
|
137
182
|
];
|
|
138
183
|
return { isError, result, usage };
|
|
139
184
|
}
|
|
140
|
-
const uploadedArtifacts = await collectArtifacts(artifactsInput);
|
|
141
|
-
const artifactUrlMap = new Map(uploadedArtifacts.map((a) => [a.name, a.url]));
|
|
142
185
|
let screenshotIndex = 0;
|
|
143
186
|
const result = [
|
|
144
187
|
{ type: "text", text: summaryResult },
|
|
@@ -147,9 +190,9 @@ Summary of actions it took, and the generated Playwright code:`;
|
|
|
147
190
|
return { type: "text", text: item.text };
|
|
148
191
|
}
|
|
149
192
|
else if (item.type === "screenshot") {
|
|
150
|
-
const
|
|
151
|
-
const url =
|
|
152
|
-
? artifactUrlMap.get(
|
|
193
|
+
const screenshotArtifact = screenshotArtifacts[screenshotIndex];
|
|
194
|
+
const url = screenshotArtifact
|
|
195
|
+
? artifactUrlMap.get(screenshotArtifact)
|
|
153
196
|
: undefined;
|
|
154
197
|
screenshotIndex++;
|
|
155
198
|
return url
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Tool } from "@empiricalrun/shared-types";
|
|
1
|
+
import type { Tool } from "@empiricalrun/shared-types/chat-agent";
|
|
2
2
|
export declare function extractPathAfterSourceRepo(fullPath: string): string;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const fetchTestRunDetailsTool: Tool;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,
|
|
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,uCAAuC,CAAC;AAYlE,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,eAAO,MAAM,uBAAuB,EAAE,IAgHrC,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchTestRunDetailsTool = void 0;
|
|
4
4
|
exports.extractPathAfterSourceRepo = extractPathAfterSourceRepo;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const urls_1 = require("../utils/urls");
|
|
7
6
|
const TestRunSchema = zod_1.z.object({
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
.describe("
|
|
7
|
+
testRunId: zod_1.z
|
|
8
|
+
.number()
|
|
9
|
+
.describe("Numeric identifier (e.g. 20269) for a test run"),
|
|
10
|
+
projectSlug: zod_1.z.string().describe("Slug for the project of the test run"),
|
|
11
11
|
});
|
|
12
12
|
function extractPathAfterSourceRepo(fullPath) {
|
|
13
13
|
const parts = fullPath.split("source-repo");
|
|
@@ -18,10 +18,24 @@ function extractPathAfterSourceRepo(fullPath) {
|
|
|
18
18
|
return parts[1].replace(/^\/|\/$/g, "");
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.
|
|
21
|
+
exports.fetchTestRunDetailsTool = {
|
|
22
22
|
schema: {
|
|
23
23
|
name: "fetchTestRunDetails",
|
|
24
|
-
description:
|
|
24
|
+
description: `Fetch details about a test run using its numeric identifier.
|
|
25
|
+
This tool returns the status of the test run, along with information about the environment
|
|
26
|
+
(e.g. "staging") or build that was used for the test run.
|
|
27
|
+
|
|
28
|
+
## How to use this tool?
|
|
29
|
+
|
|
30
|
+
When you are given a URL like https://dash.empirical.run/<project-slug>/test-runs/20269?query=params
|
|
31
|
+
- "testRunId": Extract the numeric id from the URL - in this case #20269
|
|
32
|
+
- "projectSlug": Extract the project-slug from the URL
|
|
33
|
+
|
|
34
|
+
## Related tools
|
|
35
|
+
|
|
36
|
+
- To learn more about a particular test case that failed in the test, you can use the fetch diagnosis tool
|
|
37
|
+
with the diagnosis id (which is passed to the test run URL as the ?detail= query parameter)
|
|
38
|
+
`,
|
|
25
39
|
parameters: TestRunSchema,
|
|
26
40
|
},
|
|
27
41
|
needsBrowser: false,
|
|
@@ -30,9 +44,11 @@ exports.fetchTestRunReportTool = {
|
|
|
30
44
|
if (!apiClient) {
|
|
31
45
|
throw new Error("Dashboard API client is not available.");
|
|
32
46
|
}
|
|
33
|
-
const {
|
|
47
|
+
const { testRunId: runId, projectSlug } = input;
|
|
34
48
|
let data = null;
|
|
35
|
-
const
|
|
49
|
+
const repoName = projectSlug.includes("-tests")
|
|
50
|
+
? projectSlug
|
|
51
|
+
: `${projectSlug}-tests`;
|
|
36
52
|
try {
|
|
37
53
|
data = await apiClient.request(`/api/test-runs/${runId}?repo_name=${repoName}`, { method: "GET" });
|
|
38
54
|
}
|
|
@@ -42,79 +58,64 @@ exports.fetchTestRunReportTool = {
|
|
|
42
58
|
result: `Failed to fetch test run details: ${error instanceof Error ? error.message : String(error)}`,
|
|
43
59
|
};
|
|
44
60
|
}
|
|
45
|
-
// To efficiently use input_tokens, we
|
|
46
|
-
// 1. Truncate stack trace to last 300 characters
|
|
47
|
-
// 2. Remove request/response headers from network metadata
|
|
48
|
-
// 3. Focus on failed tests only
|
|
49
61
|
const testRun = data.data?.test_run;
|
|
50
|
-
if (testRun
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// TODO: change to last 10 lines
|
|
56
|
-
detail.failed_run_metadata.stack =
|
|
57
|
-
stack.length > 300 ? `...${stack.slice(-300)}` : stack;
|
|
58
|
-
}
|
|
59
|
-
// Remove headers from network metadata
|
|
60
|
-
if (detail.network_metadata?.failed_calls) {
|
|
61
|
-
detail.network_metadata.failed_calls =
|
|
62
|
-
detail.network_metadata.failed_calls.map((call) => ({
|
|
63
|
-
...call,
|
|
64
|
-
request: { ...call.request, headers: [] },
|
|
65
|
-
response: { ...call.response, headers: [] },
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
if (detail.network_metadata?.failed_calls_within_time_range) {
|
|
69
|
-
detail.network_metadata.failed_calls_within_time_range =
|
|
70
|
-
detail.network_metadata.failed_calls_within_time_range.map((call) => ({
|
|
71
|
-
...call,
|
|
72
|
-
request: { ...call.request, headers: [] },
|
|
73
|
-
response: { ...call.response, headers: [] },
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
return detail;
|
|
77
|
-
});
|
|
62
|
+
if (!testRun) {
|
|
63
|
+
return {
|
|
64
|
+
isError: true,
|
|
65
|
+
result: `Test run not found.`,
|
|
66
|
+
};
|
|
78
67
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
const buildInfoIfAvailable = testRun.testRun.build_url
|
|
69
|
+
? `
|
|
70
|
+
## Build info
|
|
71
|
+
- Build URL: ${testRun.testRun.build_url}
|
|
72
|
+
- Git branch: ${testRun.testRun.build_branch}
|
|
73
|
+
- Git commit: ${testRun.testRun.commit}
|
|
74
|
+
`
|
|
75
|
+
: ``;
|
|
76
|
+
const failedTestsInMarkdown = (testRun.flattenedSummaryDetails || [])
|
|
77
|
+
.filter((detail) => detail.status === "failed")
|
|
78
|
+
.map((detail) => {
|
|
82
79
|
const { nesting } = detail.failed_run_metadata;
|
|
83
80
|
return {
|
|
84
81
|
testName: nesting.slice(1).join(" > "),
|
|
85
82
|
fileName: extractPathAfterSourceRepo(detail.failed_run_metadata.location.file),
|
|
86
83
|
project: detail.test_project,
|
|
87
|
-
detail,
|
|
84
|
+
diagnosisId: detail.slug,
|
|
88
85
|
};
|
|
89
86
|
})
|
|
90
|
-
.map((res) => {
|
|
87
|
+
.map((res, idx) => {
|
|
91
88
|
return `
|
|
92
|
-
###
|
|
93
|
-
File: ${res.fileName}
|
|
94
|
-
Project: ${res.project}
|
|
89
|
+
### Failed test ${idx + 1}
|
|
95
90
|
|
|
96
|
-
|
|
91
|
+
Test case name: ${res.testName}
|
|
92
|
+
File: ${res.fileName}
|
|
93
|
+
Project: ${res.project}
|
|
94
|
+
Diagnosis ID: ${res.diagnosisId}
|
|
97
95
|
|
|
98
|
-
|
|
99
|
-
${JSON.stringify(res.detail, null, 2)}
|
|
100
|
-
\`\`\`
|
|
101
|
-
`;
|
|
96
|
+
`;
|
|
102
97
|
})
|
|
103
|
-
.join("\n
|
|
98
|
+
.join("\n");
|
|
104
99
|
const markdownResponse = `
|
|
105
|
-
|
|
100
|
+
Test run #${testRun.testRun.id}
|
|
101
|
+
|
|
102
|
+
## Info
|
|
103
|
+
- Run ID: ${runId}
|
|
104
|
+
- Status: ${testRun.testRun.state}
|
|
105
|
+
- Started at: ${testRun.testRun.run_started_at}
|
|
106
|
+
- Ended at: ${testRun.testRun.run_ended_at}
|
|
107
|
+
- Duration: ${testRun.testRun.duration} seconds
|
|
108
|
+
|
|
109
|
+
## Environment
|
|
110
|
+
- Name: ${testRun?.testRun.environment_name}
|
|
111
|
+
- Slug: ${testRun?.testRun.environment_slug}
|
|
112
|
+
|
|
113
|
+
${buildInfoIfAvailable}
|
|
106
114
|
|
|
107
|
-
##
|
|
108
|
-
- Run ID: ${runId}
|
|
109
|
-
- Repository: ${repoName}
|
|
110
|
-
- Started at: ${testRun?.testRun.run_started_at}
|
|
111
|
-
- Ended at: ${testRun?.testRun.run_ended_at}
|
|
112
|
-
- Duration: ${testRun?.testRun.duration} seconds
|
|
113
|
-
- Environment name: ${testRun?.testRun.environment_name}
|
|
115
|
+
## Failed tests
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`;
|
|
117
|
+
${failedTestsInMarkdown.length > 0 ? failedTestsInMarkdown : "None"}
|
|
118
|
+
`;
|
|
118
119
|
return {
|
|
119
120
|
result: markdownResponse,
|
|
120
121
|
isError: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/trace-dot-zip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/trace-dot-zip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,uCAAuC,CAAC;AAazE,eAAO,MAAM,eAAe,EAAE,IAwD7B,CAAC"}
|