@empiricalrun/test-gen 0.78.0 → 0.78.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 +11 -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 -3
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +5 -9
- 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 +10 -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 +13 -5
- 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.js +1 -1
- 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 +31 -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 +2 -1
- 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 +2 -1
- package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +9 -19
- 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 +9 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- 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 +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +1 -1
- package/dist/tools/definitions/upgrade-packages.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 +10 -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 +1 -1
- 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/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 +3 -24
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +13 -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 +86 -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 +87 -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/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 +55 -19
- 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 +22 -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 +4 -3
- 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 +8 -4
- 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
package/dist/agent/chat/state.js
CHANGED
|
@@ -4,11 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CHAT_STATE_PATH = exports.LATEST_CHAT_STATE_VERSION = exports.CHAT_STATE_VERSIONS_MIGRATIONS_MAP = void 0;
|
|
7
|
-
exports.createChatStateForMessages = createChatStateForMessages;
|
|
8
7
|
exports.chatStateFromModel = chatStateFromModel;
|
|
9
8
|
exports.getUsageSummary = getUsageSummary;
|
|
10
9
|
exports.loadChatState = loadChatState;
|
|
11
|
-
exports.migrateChatState = migrateChatState;
|
|
12
10
|
exports.saveToDisk = saveToDisk;
|
|
13
11
|
exports.getLatestDownloadBuildUrl = getLatestDownloadBuildUrl;
|
|
14
12
|
exports.fetchToolCallFromId = fetchToolCallFromId;
|
|
@@ -19,27 +17,20 @@ exports.CHAT_STATE_VERSIONS_MIGRATIONS_MAP = {
|
|
|
19
17
|
};
|
|
20
18
|
exports.LATEST_CHAT_STATE_VERSION = "0.1";
|
|
21
19
|
exports.CHAT_STATE_PATH = path_1.default.join(process.cwd(), ".empiricalrun", "last-chat.json");
|
|
22
|
-
function
|
|
23
|
-
// TODO: Add better types for messages
|
|
20
|
+
function chatStateFromModel({ chatModel, error, }) {
|
|
24
21
|
return {
|
|
25
22
|
version: exports.LATEST_CHAT_STATE_VERSION,
|
|
26
|
-
model: selectedModel,
|
|
27
|
-
messages: messages,
|
|
28
|
-
askUserForInput: askUserForInput,
|
|
29
|
-
error: error,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function chatStateFromModel({ chatModel, error, }) {
|
|
33
|
-
return createChatStateForMessages({
|
|
23
|
+
model: chatModel.selectedModel,
|
|
34
24
|
messages: chatModel.messages,
|
|
35
|
-
selectedModel: chatModel.selectedModel,
|
|
36
25
|
askUserForInput: chatModel.askUserForInput,
|
|
37
|
-
error,
|
|
38
|
-
}
|
|
26
|
+
error: error,
|
|
27
|
+
};
|
|
39
28
|
}
|
|
40
29
|
function getUsageSummary(chatState) {
|
|
41
30
|
const messages = chatState.messages;
|
|
42
|
-
const messageUsages = messages
|
|
31
|
+
const messageUsages = messages
|
|
32
|
+
.map((msg) => "usage" in msg && msg.usage)
|
|
33
|
+
.filter(Boolean);
|
|
43
34
|
const inputTokens = messageUsages.reduce((sum, usage) => sum + (usage?.tokens?.input || 0), 0);
|
|
44
35
|
const outputTokens = messageUsages.reduce((sum, usage) => sum + (usage?.tokens?.output || 0), 0);
|
|
45
36
|
const costs = messageUsages
|
|
@@ -71,37 +62,11 @@ function loadChatState({ resetChat, }) {
|
|
|
71
62
|
}
|
|
72
63
|
const raw = fs_1.default.readFileSync(exports.CHAT_STATE_PATH, "utf8");
|
|
73
64
|
let state = JSON.parse(raw);
|
|
74
|
-
// Always migrate to the latest version after loading
|
|
75
|
-
const migratedState = migrateChatState(state);
|
|
76
65
|
// Only save if migration actually changed the state
|
|
77
|
-
if (JSON.stringify(state) !== JSON.stringify(
|
|
78
|
-
fs_1.default.writeFileSync(exports.CHAT_STATE_PATH, JSON.stringify(
|
|
66
|
+
if (JSON.stringify(state) !== JSON.stringify(state)) {
|
|
67
|
+
fs_1.default.writeFileSync(exports.CHAT_STATE_PATH, JSON.stringify(state, null, 2));
|
|
79
68
|
}
|
|
80
|
-
return
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Migrates a chat state object from an old version to the latest version.
|
|
84
|
-
* Add migration logic for each version as needed.
|
|
85
|
-
*/
|
|
86
|
-
function migrateChatState(oldState) {
|
|
87
|
-
if (!oldState || Object.keys(oldState).length === 0) {
|
|
88
|
-
return oldState;
|
|
89
|
-
}
|
|
90
|
-
if (!oldState.version) {
|
|
91
|
-
throw new Error("No version found in chat state");
|
|
92
|
-
}
|
|
93
|
-
if (!exports.CHAT_STATE_VERSIONS_MIGRATIONS_MAP[oldState.version]) {
|
|
94
|
-
throw new Error(`No migration function found for version: ${oldState.version}`);
|
|
95
|
-
}
|
|
96
|
-
if (oldState.version === exports.LATEST_CHAT_STATE_VERSION) {
|
|
97
|
-
return oldState;
|
|
98
|
-
}
|
|
99
|
-
const migrateFn = exports.CHAT_STATE_VERSIONS_MIGRATIONS_MAP[oldState.version];
|
|
100
|
-
const migrated = migrateFn(oldState);
|
|
101
|
-
return {
|
|
102
|
-
version: exports.LATEST_CHAT_STATE_VERSION,
|
|
103
|
-
...migrated,
|
|
104
|
-
};
|
|
69
|
+
return state;
|
|
105
70
|
}
|
|
106
71
|
function saveToDisk(chatState) {
|
|
107
72
|
const statePath = exports.CHAT_STATE_PATH;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import {
|
|
3
|
-
import { Attachment, ReporterFunction } from "@empiricalrun/shared-types";
|
|
2
|
+
import { IChatModel } from "@empiricalrun/llm/chat";
|
|
3
|
+
import { Attachment, ReporterFunction } from "@empiricalrun/shared-types/chat-agent";
|
|
4
4
|
export declare const log: (...args: any[]) => void;
|
|
5
5
|
export declare function getModelName(model: string): string;
|
|
6
|
-
export declare function handleAgentError({ error, chatModel, reporter, trace, }: {
|
|
6
|
+
export declare function handleAgentError<T>({ error, chatModel, reporter, trace, }: {
|
|
7
7
|
error: unknown;
|
|
8
|
-
chatModel: IChatModel<
|
|
9
|
-
reporter: ReporterFunction
|
|
8
|
+
chatModel: IChatModel<T>;
|
|
9
|
+
reporter: ReporterFunction<T>;
|
|
10
10
|
trace?: TraceClient;
|
|
11
11
|
}): Promise<void>;
|
|
12
12
|
export declare function extractAttachments(userPrompt: string): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAGL,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,UAAU,EAEV,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAK/C,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,GAAG,EAAE,SAEjC,CAAC;AAcF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,EACxC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,KAAK,GACN,EAAE;IACD,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,iBAaA;AASD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CA4BA"}
|
package/dist/agent/cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AgentModeEnum, SupportedChatModels } from "@empiricalrun/shared-types";
|
|
1
|
+
import { AgentModeEnum, SupportedChatModels } from "@empiricalrun/shared-types/chat-agent";
|
|
2
2
|
export declare function fetchEnvironmentVariables(): Promise<Record<string, string>>;
|
|
3
|
-
export declare function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialPromptContent, agentMode, resetChat, useFSCache, }: {
|
|
3
|
+
export declare function runChatAgentForCLI<T>({ useDiskForChatState, selectedModel, initialPromptContent, agentMode, resetChat, useFSCache, }: {
|
|
4
4
|
selectedModel: SupportedChatModels;
|
|
5
5
|
useDiskForChatState: boolean;
|
|
6
6
|
initialPromptContent: string | undefined;
|
package/dist/agent/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/agent/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/agent/cli.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAIb,mBAAmB,EACpB,MAAM,uCAAuC,CAAC;AA6B/C,wBAAsB,yBAAyB,IAAI,OAAO,CACxD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACvB,CAkCA;AAED,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,EAC1C,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,UAAU,GACX,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB,iBA+JA"}
|
package/dist/agent/cli.js
CHANGED
|
@@ -53,8 +53,6 @@ async function fetchEnvironmentVariables() {
|
|
|
53
53
|
}
|
|
54
54
|
async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialPromptContent, agentMode, resetChat, useFSCache, }) {
|
|
55
55
|
const enableStreaming = !useFSCache;
|
|
56
|
-
// TODO: Implement cache support in BaseAgent
|
|
57
|
-
// const cache = useFSCache ? new FilesystemLLMCache() : undefined;
|
|
58
56
|
// TODO: Store branch name in chat state so that we don't recreate it every time
|
|
59
57
|
const randomId = crypto.randomUUID().substring(0, 8);
|
|
60
58
|
const branchName = `branch-${randomId}`;
|
|
@@ -94,7 +92,7 @@ async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialP
|
|
|
94
92
|
});
|
|
95
93
|
if (trace) {
|
|
96
94
|
const traceUrl = trace.getTraceUrl();
|
|
97
|
-
console.log(`Starting ${selectedModel}: ${traceUrl}`);
|
|
95
|
+
console.log(`Starting Model: ${selectedModel} \nTrace URL: ${traceUrl}`);
|
|
98
96
|
}
|
|
99
97
|
let authType = "user-access-token";
|
|
100
98
|
if (process.env.EMPIRICALRUN_API_KEY) {
|
|
@@ -117,8 +115,11 @@ async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialP
|
|
|
117
115
|
featureFlags: [],
|
|
118
116
|
chatState,
|
|
119
117
|
toolExecutor,
|
|
118
|
+
repoInfoBuilder: fileInfoBuilder,
|
|
120
119
|
};
|
|
121
|
-
const agent =
|
|
120
|
+
const agent = agentMode === "triage"
|
|
121
|
+
? new index_1.TriageAgent(agentParams)
|
|
122
|
+
: new index_1.ChatAgent(agentParams);
|
|
122
123
|
// If we have an initial prompt and no existing chat state, push it to the agent
|
|
123
124
|
if (initialPromptContent && !chatState) {
|
|
124
125
|
const { text, attachments } = (0, utils_1.extractAttachments)(initialPromptContent);
|
|
@@ -185,8 +186,6 @@ async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialP
|
|
|
185
186
|
}
|
|
186
187
|
};
|
|
187
188
|
})(),
|
|
188
|
-
trace,
|
|
189
|
-
repoInfoBuilder: fileInfoBuilder,
|
|
190
189
|
onPendingToolCall: async (toolCalls) => {
|
|
191
190
|
const { toolResults, checkpoint } = await toolExecutor.execute(toolCalls);
|
|
192
191
|
agent.processToolResults(toolCalls, toolResults, checkpoint);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { ToolsForLLM } from "@empiricalrun/shared-types";
|
|
1
|
+
import type { ToolsForLLM } from "@empiricalrun/shared-types/chat-agent";
|
|
2
|
+
import type { FileInfo } from "@empiricalrun/shared-types/test-gen";
|
|
2
3
|
import { BaseAgent } from "../base";
|
|
3
4
|
import { type CodeReviewResultV0, type CodeReviewResultV1, type CodeReviewResultV2, CodeReviewSeverity, CodeReviewVerdict } from "./types";
|
|
4
5
|
export type { CodeReviewResultV1, CodeReviewResultV0, CodeReviewResultV2 };
|
|
5
6
|
export { CodeReviewVerdict, CodeReviewSeverity };
|
|
6
7
|
export type CodeReviewVersionedResult = CodeReviewResultV0 | CodeReviewResultV1 | CodeReviewResultV2;
|
|
7
|
-
export declare class CodeReviewAgent extends BaseAgent {
|
|
8
|
+
export declare class CodeReviewAgent<T> extends BaseAgent<T> {
|
|
8
9
|
protected getTools(): ToolsForLLM;
|
|
9
10
|
getResult(): CodeReviewVersionedResult | undefined;
|
|
10
|
-
protected buildSystemPrompt(
|
|
11
|
+
protected buildSystemPrompt(repoInfoBuilder: () => Promise<FileInfo>): Promise<string>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/code-review/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/code-review/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAGpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AAEjD,MAAM,MAAM,yBAAyB,GACjC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,CAAC;AAEvB,qBAAa,eAAe,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAClD,SAAS,CAAC,QAAQ,IAAI,WAAW;IAWjC,SAAS,IAAI,yBAAyB,GAAG,SAAS;cAmBlC,iBAAiB,CAC/B,eAAe,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC;CAiInB"}
|
|
@@ -4,6 +4,7 @@ exports.CodeReviewAgent = exports.CodeReviewSeverity = exports.CodeReviewVerdict
|
|
|
4
4
|
const tools_1 = require("../../tools");
|
|
5
5
|
const fetch_session_diff_1 = require("../../tools/fetch-session-diff");
|
|
6
6
|
const base_1 = require("../base");
|
|
7
|
+
const repo_1 = require("../chat/prompt/repo");
|
|
7
8
|
const parser_1 = require("./parser");
|
|
8
9
|
const types_1 = require("./types");
|
|
9
10
|
Object.defineProperty(exports, "CodeReviewSeverity", { enumerable: true, get: function () { return types_1.CodeReviewSeverity; } });
|
|
@@ -25,9 +26,7 @@ class CodeReviewAgent extends base_1.BaseAgent {
|
|
|
25
26
|
? messages[messages.length - 1]
|
|
26
27
|
: undefined;
|
|
27
28
|
const lastMessageTextPart = lastMessage
|
|
28
|
-
? lastMessage.parts
|
|
29
|
-
.filter((p) => "text" in p)
|
|
30
|
-
.find((p) => "text" in p && !!p.text)
|
|
29
|
+
? lastMessage.parts.find((p) => "text" in p && !!p.text && !("thinking" in p))
|
|
31
30
|
: undefined;
|
|
32
31
|
const textPart = lastMessageTextPart;
|
|
33
32
|
const text = textPart?.text.trim();
|
|
@@ -36,7 +35,9 @@ class CodeReviewAgent extends base_1.BaseAgent {
|
|
|
36
35
|
}
|
|
37
36
|
return (0, parser_1.convertXmlToV2Format)(text);
|
|
38
37
|
}
|
|
39
|
-
async buildSystemPrompt(
|
|
38
|
+
async buildSystemPrompt(repoInfoBuilder) {
|
|
39
|
+
const repoInfo = await repoInfoBuilder();
|
|
40
|
+
const repoContext = await (0, repo_1.getRepoContextPrompt)(repoInfo);
|
|
40
41
|
return `
|
|
41
42
|
You are an expert code reviewer that specializes in reviewing Playwright test code. You are
|
|
42
43
|
provided with tools to fetch diff and pull-request metadata for a code review, where a test has been added, test modified,
|
|
@@ -122,6 +123,8 @@ Return these as XML tags with markdown inside them
|
|
|
122
123
|
- Use locators instead of selectors: waitForSelector, $, $$ are bad - use locators instead (e.g. locator.waitFor)
|
|
123
124
|
- If the test relies on some Playwright APIs that do not auto-wait (e.g. isVisible(), count()), we need to ensure
|
|
124
125
|
they are used AFTER some action that ensures the page has loaded. If nothing, at least it should have a waitForTimeout
|
|
126
|
+
- For checkbox elements, use \`setChecked(true or false)\` instead of clicks. Click action on checkbox toggles the state and requires
|
|
127
|
+
a conditional, whereas \`setChecked\` allows specifying the end expected state, which is easier to maintain.
|
|
125
128
|
|
|
126
129
|
## Deprecated patterns
|
|
127
130
|
- test.describe.serial(...) is not prefered: use test.describe.configure({ mode: "serial" }) if the tests need to be serial
|
|
@@ -156,6 +159,9 @@ Return these as XML tags with markdown inside them
|
|
|
156
159
|
|
|
157
160
|
# Repo context
|
|
158
161
|
${repoContext}
|
|
162
|
+
|
|
163
|
+
# Reference
|
|
164
|
+
Today's date is ${new Date().toDateString()}
|
|
159
165
|
`;
|
|
160
166
|
}
|
|
161
167
|
}
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
Rejected = "Rejected"
|
|
4
|
-
}
|
|
5
|
-
export declare enum CodeReviewSeverity {
|
|
6
|
-
MergeBlocking = "merge-blocking",
|
|
7
|
-
Warning = "warning"
|
|
8
|
-
}
|
|
9
|
-
export type CodeReviewLineComment = {
|
|
10
|
-
file: string;
|
|
11
|
-
line_start: number;
|
|
12
|
-
line_end: number;
|
|
13
|
-
severity: CodeReviewSeverity;
|
|
14
|
-
message: string;
|
|
15
|
-
};
|
|
16
|
-
export type CodeReviewResultV2 = {
|
|
17
|
-
version: "2.0";
|
|
18
|
-
last_commit: string;
|
|
19
|
-
describe_code_change: string;
|
|
20
|
-
line_comments: CodeReviewLineComment[];
|
|
21
|
-
verdict: CodeReviewVerdict;
|
|
22
|
-
};
|
|
23
|
-
export type CodeReviewResultV1 = {
|
|
24
|
-
version: "1.0";
|
|
25
|
-
last_commit: string | null;
|
|
26
|
-
code_review_comments: string | null;
|
|
27
|
-
describe_code_change: string | null;
|
|
28
|
-
merge_blocking_issues: string | null;
|
|
29
|
-
best_practices_and_warnings: string | null;
|
|
30
|
-
verdict: "Approved" | "Rejected" | null;
|
|
31
|
-
};
|
|
32
|
-
export type CodeReviewResultV0 = {
|
|
33
|
-
version: "0.1";
|
|
34
|
-
result: string;
|
|
35
|
-
};
|
|
1
|
+
export type { CodeReviewLineComment, CodeReviewResultV0, CodeReviewResultV1, CodeReviewResultV2, } from "@empiricalrun/shared-types/code-review";
|
|
2
|
+
export { CodeReviewSeverity, CodeReviewVerdict, } from "@empiricalrun/shared-types/code-review";
|
|
36
3
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agent/code-review/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agent/code-review/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wCAAwC,CAAC"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
CodeReviewVerdict["Rejected"] = "Rejected";
|
|
8
|
-
})(CodeReviewVerdict || (exports.CodeReviewVerdict = CodeReviewVerdict = {}));
|
|
9
|
-
var CodeReviewSeverity;
|
|
10
|
-
(function (CodeReviewSeverity) {
|
|
11
|
-
CodeReviewSeverity["MergeBlocking"] = "merge-blocking";
|
|
12
|
-
CodeReviewSeverity["Warning"] = "warning";
|
|
13
|
-
})(CodeReviewSeverity || (exports.CodeReviewSeverity = CodeReviewSeverity = {}));
|
|
3
|
+
exports.CodeReviewVerdict = exports.CodeReviewSeverity = void 0;
|
|
4
|
+
var code_review_1 = require("@empiricalrun/shared-types/code-review");
|
|
5
|
+
Object.defineProperty(exports, "CodeReviewSeverity", { enumerable: true, get: function () { return code_review_1.CodeReviewSeverity; } });
|
|
6
|
+
Object.defineProperty(exports, "CodeReviewVerdict", { enumerable: true, get: function () { return code_review_1.CodeReviewVerdict; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { ArtifactInputData, Usage } from "@empiricalrun/shared-types";
|
|
2
|
+
import { ArtifactInputData, Usage } from "@empiricalrun/shared-types/chat-agent";
|
|
3
3
|
import { Page } from "playwright";
|
|
4
4
|
export type BrowserAgentResult = Array<{
|
|
5
5
|
type: "text";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/cua/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/cua/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EACL,iBAAiB,EACjB,KAAK,EACN,MAAM,uCAAuC,CAAC;AAS/C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA6DlC,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAClC;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,iBAAiB,CAAC;CAC/B,CACJ,CAAC;AAEF,wBAAsB,+BAA+B,CAAC,EACpD,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,8BAAsC,GACvC,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C,GAAG,OAAO,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC,CAuND"}
|
package/dist/agent/cua/index.js
CHANGED
|
@@ -28,21 +28,29 @@ function artifact(screenshot, name) {
|
|
|
28
28
|
data: Buffer.from(screenshot, "base64"),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
async function tabsSummary(pages) {
|
|
32
|
+
let lines = [];
|
|
33
|
+
for (const p of pages) {
|
|
34
|
+
lines.push(` - ${p.url()} - ${await p.title()}`);
|
|
35
|
+
}
|
|
36
|
+
return lines.join("\n");
|
|
37
|
+
}
|
|
38
|
+
async function stateOfTheBrowser(page) {
|
|
32
39
|
const browserContext = page.context();
|
|
33
40
|
const pages = browserContext.pages();
|
|
41
|
+
const allPagesSummary = await tabsSummary(pages);
|
|
34
42
|
return `
|
|
35
43
|
## Browser window
|
|
36
44
|
|
|
37
45
|
### Current page (what you are working on)
|
|
38
46
|
Current page URL: ${page.url()}
|
|
39
|
-
Current page title: ${page.title()}
|
|
47
|
+
Current page title: ${await page.title()}
|
|
40
48
|
|
|
41
49
|
### All pages
|
|
42
50
|
Number of open pages: ${pages.length}
|
|
43
51
|
|
|
44
52
|
URLs and titles:
|
|
45
|
-
${
|
|
53
|
+
${allPagesSummary}`;
|
|
46
54
|
}
|
|
47
55
|
async function createTestUsingComputerUseAgent({ page, task, trace, prefersElementFromPointCodegen = false, }) {
|
|
48
56
|
const codegen = await getCodegenInstance(prefersElementFromPointCodegen);
|
|
@@ -69,7 +77,7 @@ async function createTestUsingComputerUseAgent({ page, task, trace, prefersEleme
|
|
|
69
77
|
content: [
|
|
70
78
|
{
|
|
71
79
|
type: "input_text",
|
|
72
|
-
text: `Task to execute: ${task}\n\n${stateOfTheBrowser(page)}`,
|
|
80
|
+
text: `Task to execute: ${task}\n\n${await stateOfTheBrowser(page)}`,
|
|
73
81
|
},
|
|
74
82
|
{
|
|
75
83
|
type: "input_image",
|
|
@@ -193,7 +201,7 @@ async function createTestUsingComputerUseAgent({ page, task, trace, prefersEleme
|
|
|
193
201
|
content: [
|
|
194
202
|
{
|
|
195
203
|
type: "input_text",
|
|
196
|
-
text: `Action executed: ${executedActionSummary || "None"}\n\n${stateOfTheBrowser(page)}`,
|
|
204
|
+
text: `Action executed: ${executedActionSummary || "None"}\n\n${await stateOfTheBrowser(page)}`,
|
|
197
205
|
},
|
|
198
206
|
],
|
|
199
207
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"for-recorder.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/for-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,qBAAa,iCAAiC;IAO1C,OAAO,CAAC,eAAe;IANzB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;gBAGpC,eAAe,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;YAKtD,QAAQ;
|
|
1
|
+
{"version":3,"file":"for-recorder.d.ts","sourceRoot":"","sources":["../../../../../src/agent/cua/pw-codegen/pw-pause/for-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,qBAAa,iCAAiC;IAO1C,OAAO,CAAC,eAAe;IANzB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,iBAAiB,CAAqB;gBAGpC,eAAe,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;YAKtD,QAAQ;IAQhB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrC,sBAAsB,CAAC,IAAI,EAAE,IAAI;CA0CxC"}
|
|
@@ -21,9 +21,6 @@ class PlaywrightPauseCodegenForRecorder {
|
|
|
21
21
|
async saveCode(code) {
|
|
22
22
|
const generatedCode = code.map((c) => c.actions.join("\n")).join("\n");
|
|
23
23
|
if (generatedCode) {
|
|
24
|
-
// console.log(
|
|
25
|
-
// `[PlaywrightPauseCodegen] Received code from Playwright: ${generatedCode}`,
|
|
26
|
-
// );
|
|
27
24
|
this.codeForLastAction = generatedCode;
|
|
28
25
|
await this.sourcesCallback(code);
|
|
29
26
|
}
|
|
@@ -101,7 +101,7 @@ class PlaywrightPauseCodegen {
|
|
|
101
101
|
}
|
|
102
102
|
async getCodeForLastAction() {
|
|
103
103
|
// Wait for the server to send the code
|
|
104
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
104
|
+
await new Promise((resolve) => setTimeout(resolve, 1_500));
|
|
105
105
|
let codeToReturn = this.codeForLastAction;
|
|
106
106
|
this.codeForLastAction = undefined;
|
|
107
107
|
if (!codeToReturn) {
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { AgentModeEnum } from "@empiricalrun/shared-types";
|
|
2
1
|
import { type AgentParams, BaseAgent } from "./base";
|
|
3
2
|
import { ChatAgent } from "./chat";
|
|
4
|
-
import { CodeReviewAgent } from "./code-review";
|
|
5
3
|
import { TriageAgent } from "./triage";
|
|
6
|
-
|
|
7
|
-
export declare const MODE_TO_AGENT_MAP: Record<AgentModeEnum, (params: AgentParams) => BaseAgent>;
|
|
8
|
-
export { BaseAgent, ChatAgent, CodeReviewAgent, TriageAgent, VideoAnalysisAgent, };
|
|
4
|
+
export { BaseAgent, ChatAgent, TriageAgent };
|
|
9
5
|
export type { AgentParams };
|
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/agent/index.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TriageAgent = exports.ChatAgent = exports.BaseAgent = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
Object.defineProperty(exports, "BaseAgent", { enumerable: true, get: function () { return base_1.BaseAgent; } });
|
|
6
6
|
const chat_1 = require("./chat");
|
|
7
7
|
Object.defineProperty(exports, "ChatAgent", { enumerable: true, get: function () { return chat_1.ChatAgent; } });
|
|
8
|
-
const code_review_1 = require("./code-review");
|
|
9
|
-
Object.defineProperty(exports, "CodeReviewAgent", { enumerable: true, get: function () { return code_review_1.CodeReviewAgent; } });
|
|
10
8
|
const triage_1 = require("./triage");
|
|
11
9
|
Object.defineProperty(exports, "TriageAgent", { enumerable: true, get: function () { return triage_1.TriageAgent; } });
|
|
12
|
-
const video_analysis_1 = require("./video-analysis");
|
|
13
|
-
Object.defineProperty(exports, "VideoAnalysisAgent", { enumerable: true, get: function () { return video_analysis_1.VideoAnalysisAgent; } });
|
|
14
|
-
exports.MODE_TO_AGENT_MAP = {
|
|
15
|
-
triage: (params) => new triage_1.TriageAgent(params),
|
|
16
|
-
chat: (params) => new chat_1.ChatAgent(params),
|
|
17
|
-
video: (params) => new video_analysis_1.VideoAnalysisAgent(params),
|
|
18
|
-
"code-review": (params) => new code_review_1.CodeReviewAgent(params),
|
|
19
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LLM, TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { TestGenConfigOptions } from "@empiricalrun/shared-types";
|
|
2
|
+
import { TestGenConfigOptions } from "@empiricalrun/shared-types/agent-workflow";
|
|
3
3
|
import { Page } from "playwright";
|
|
4
4
|
import { ActionType } from "./action-tool-calls";
|
|
5
5
|
export declare function getElementAnnotation({ elementDescription, annotations, annotatedScreenshot, trace, llm, options, preference, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-annotation.d.ts","sourceRoot":"","sources":["../../../src/agent/master/element-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"element-annotation.d.ts","sourceRoot":"","sources":["../../../src/agent/master/element-annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA2DjD,wBAAsB,oBAAoB,CAAC,EACzC,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,KAAK,EACL,GAAG,EACH,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,EAAE,oBAAoB,CAAC;CAClC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA8C9B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,EACN,KAAK,GACL,UAAU,CAAC,IAAI,GACf,UAAU,CAAC,WAAW,GACtB,UAAU,CAAC,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAgBF,wBAAsB,iBAAiB,CAAC,EACtC,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC;IACV,cAAc,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,MAAM,CAAC;CACjC,CAAC,CAmFD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LLM, TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { TestGenConfigOptions } from "@empiricalrun/shared-types";
|
|
2
|
+
import { TestGenConfigOptions } from "@empiricalrun/shared-types/agent-workflow";
|
|
3
3
|
import { Page } from "playwright";
|
|
4
4
|
import { PlaywrightActions } from "../../actions";
|
|
5
5
|
import { CustomLogger } from "../../bin/logger";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-action.d.ts","sourceRoot":"","sources":["../../../src/agent/master/next-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"next-action.d.ts","sourceRoot":"","sources":["../../../src/agent/master/next-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,wBAAsB,aAAa,CAAC,EAClC,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,eAAe,EACf,aAAa,EACb,KAAK,EACL,GAAG,EACH,OAAO,EACP,OAAO,EACP,aAAa,EACb,MAAM,GACP,EAAE;IACD,IAAI,EAAE,IAAI,CAAC;IACX,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,OAAO,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,GAAG,OAAO,CACP;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,GACD,SAAS,CACZ,CAwFA"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNextAction = getNextAction;
|
|
4
4
|
const llm_1 = require("@empiricalrun/llm");
|
|
5
|
-
const skill_1 = require("../../actions/skill");
|
|
6
5
|
const constants_1 = require("../../constants");
|
|
7
6
|
const promptTemplate_0 = "{{#section \"system\"}}\nYou are a web automation tool which is given a task to complete. You need to execute the\ntask provided to you with the help of web page screenshot, a browser automation tool or skills\nwhich are learnt while writing previous tests. \n \nBrowser automation tool is a tool which uses Playwright and browser to execute action using\nnext_action tool call.\nSkill usage is a tool which helps to execute previously known pieces of code to achieve a task.\n\nYou will be provided with a screenshot of the webpage which you will use to extract the action\nthat needs to be taken.\n\nYou will be provided with previously executed actions by the browser automation tool and based\non the current screenshot and previously executed actions, you need to predict the next action\nto be taken.\n\nYou will also be provided with failed next action predicted by you, so that you can avoid\nsuggesting the same action again - which failed.\n\nThe next action should be as atomic as possible. e.g: scroll, click on an element, fill an input\nelement, assert, extract text from an element are valid next action as they are atomic in nature.\n\nYou also need to provide the action type using the list below, action type which is not present in\nthe list is invalid: {{validActionTypes}}\n\nYou will also be provided with skill usage tool which you can use to execute action. These skills\nare compound functions which helps you to complete your action.\n\nYou need to respond with either:\n- Next action to be taken by a browser automation tool \n- Use previously learnt skills in the form of tool call.\n \nYou need to make a decision whether the given skill can be reused if \"YES\" respond with the\nskill else respond with the next action.\n{{/section}}\n\n{{#section \"user\"}}\nTask:\n{{task}}\n\n-----\n\nPrevious executed actions:\n{{executedActions}}\n\n-----\n\nPrevious failed actions:\n{{failedActions}}\n\n-----\n\nYou are also provided with a page screenshot for you to decide the next action.\n\nCurrent page URL: {{pageUrl}}\n\nFollow the instructions before responding:\n- Divide the task into sub tasks\n- Using previously executed actions, identify tasks are complete and which tasks needs to be executed next.\n- You will be provided a skill usage action, if the testStep matches the next action then respond with the skill usage.\n- If responding with next action, ensure next action to be detailed and explicit about what action needs to be done. Provide all the information which can be extracted from the screenshot as a part of next action.\n- Mark task as complete only when executed actions provided to you indicates that the task is done.\n- Refer to the text and references available in the screenshot to create the next action.\n- Do not take any extra actions which are not required for the execution of the task\n- If there are no further actions required based on the task, then respond with task as done.\n- Do not recommend actions which are not available in the screenshot\n\nScreenshots:\n{{images pageScreenshots}}\n\n{{/section}}\n";
|
|
8
7
|
const action_tool_calls_1 = require("./action-tool-calls");
|
|
@@ -19,7 +18,6 @@ async function getNextAction({ page, pageScreenshot, task, executedActions, fail
|
|
|
19
18
|
options,
|
|
20
19
|
pageScreenshot,
|
|
21
20
|
disableSkills,
|
|
22
|
-
skills: skill_1.testCaseSkills.getAvailableSkills(),
|
|
23
21
|
},
|
|
24
22
|
});
|
|
25
23
|
const messages = (0, llm_1.compilePrompt)(promptTemplate_0, {
|
|
@@ -30,10 +28,7 @@ async function getNextAction({ page, pageScreenshot, task, executedActions, fail
|
|
|
30
28
|
pageUrl,
|
|
31
29
|
pageScreenshots: pageScreenshot,
|
|
32
30
|
});
|
|
33
|
-
const
|
|
34
|
-
? []
|
|
35
|
-
: actions.getSkillsActionSchemas();
|
|
36
|
-
const tools = [...(0, action_tool_calls_1.getActionToolCalls)(), ...actionSchemas];
|
|
31
|
+
const tools = [...(0, action_tool_calls_1.getActionToolCalls)()];
|
|
37
32
|
llm =
|
|
38
33
|
llm ||
|
|
39
34
|
new llm_1.LLM({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TestGenConfigOptions } from "@empiricalrun/shared-types/agent-workflow";
|
|
2
|
+
import type { TestCaseWithSuitesAsArray } from "@empiricalrun/shared-types/api/test-cases";
|
|
2
3
|
import { Page } from "playwright";
|
|
3
4
|
import { ScopeVars } from "../../types";
|
|
4
5
|
export { createTestUsingComputerUseAgent } from "../cua";
|
|
@@ -6,7 +7,7 @@ export declare const IS_ALLOWED_TO_USE_SKILLS = false;
|
|
|
6
7
|
export declare function createTestUsingMasterAgent({ task, page, testCase, specPath, options, scopeVars, }: {
|
|
7
8
|
task: string;
|
|
8
9
|
page: Page;
|
|
9
|
-
testCase?:
|
|
10
|
+
testCase?: TestCaseWithSuitesAsArray;
|
|
10
11
|
specPath?: string;
|
|
11
12
|
options: Partial<TestGenConfigOptions>;
|
|
12
13
|
scopeVars?: ScopeVars;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAYlC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAKzD,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAqB9C,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;;;GAwJA"}
|
package/dist/agent/master/run.js
CHANGED
|
@@ -4,19 +4,16 @@ exports.IS_ALLOWED_TO_USE_SKILLS = exports.createTestUsingComputerUseAgent = voi
|
|
|
4
4
|
exports.createTestUsingMasterAgent = createTestUsingMasterAgent;
|
|
5
5
|
const llm_1 = require("@empiricalrun/llm");
|
|
6
6
|
const actions_1 = require("../../actions");
|
|
7
|
-
const skill_1 = require("../../actions/skill");
|
|
8
7
|
const utils_1 = require("../../actions/utils");
|
|
9
8
|
const logger_1 = require("../../bin/logger");
|
|
10
9
|
const constants_1 = require("../../constants");
|
|
11
10
|
const errors_1 = require("../../errors");
|
|
12
11
|
const page_1 = require("../../page");
|
|
13
12
|
const utils_2 = require("../browsing/utils");
|
|
14
|
-
const skills_retriever_1 = require("../codegen/skills-retriever");
|
|
15
13
|
const run_1 = require("../planner/run");
|
|
16
14
|
const run_time_planner_1 = require("../planner/run-time-planner");
|
|
17
15
|
const action_tool_calls_1 = require("./action-tool-calls");
|
|
18
16
|
const execute_browser_action_1 = require("./execute-browser-action");
|
|
19
|
-
const execute_skill_action_1 = require("./execute-skill-action");
|
|
20
17
|
const next_action_1 = require("./next-action");
|
|
21
18
|
var cua_1 = require("../cua");
|
|
22
19
|
Object.defineProperty(exports, "createTestUsingComputerUseAgent", { enumerable: true, get: function () { return cua_1.createTestUsingComputerUseAgent; } });
|
|
@@ -47,15 +44,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, specPath, opti
|
|
|
47
44
|
// we will be using google model for larger context window, in such cases 1 million tokens is not enough
|
|
48
45
|
maxTokens: options.modelProvider === "google" ? 3_000_000 : 1_000_000,
|
|
49
46
|
});
|
|
50
|
-
let skills = [];
|
|
51
|
-
if (testCase && exports.IS_ALLOWED_TO_USE_SKILLS) {
|
|
52
|
-
skills = await (0, skills_retriever_1.getAppropriateSkills)({
|
|
53
|
-
testCase,
|
|
54
|
-
//@ts-ignore
|
|
55
|
-
options,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
skill_1.testCaseSkills.updateSkills(skills);
|
|
59
47
|
if (usePlannerInMaster && testCase && specPath) {
|
|
60
48
|
logger.log(`Planner is working on task: ${task}`);
|
|
61
49
|
const plan = await (0, run_1.planTask)({
|
|
@@ -122,16 +110,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, specPath, opti
|
|
|
122
110
|
try {
|
|
123
111
|
logger.log(`Next Action: ${output.action}`);
|
|
124
112
|
switch (nextAction.actionType) {
|
|
125
|
-
case skill_1.SKILL_USAGE: {
|
|
126
|
-
const code = await (0, execute_skill_action_1.executeSkillAction)({
|
|
127
|
-
actions,
|
|
128
|
-
nextAction,
|
|
129
|
-
});
|
|
130
|
-
if (code) {
|
|
131
|
-
generatedCodeSteps.push(code);
|
|
132
|
-
}
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
113
|
case action_tool_calls_1.ActionType.OBSERVATION: {
|
|
136
114
|
output.action = args.observation;
|
|
137
115
|
logger.log("Observation: ", output.action);
|
|
@@ -159,10 +137,6 @@ async function createTestUsingMasterAgent({ task, page, testCase, specPath, opti
|
|
|
159
137
|
disableSkills = false;
|
|
160
138
|
}
|
|
161
139
|
catch (e) {
|
|
162
|
-
if (nextAction.actionType === skill_1.SKILL_USAGE) {
|
|
163
|
-
logger.log("Disabling skill usage for next retry");
|
|
164
|
-
disableSkills = true;
|
|
165
|
-
}
|
|
166
140
|
if (!(e instanceof errors_1.HumanApprovalDenied)) {
|
|
167
141
|
logger.error("Failed to run master agent's next task", JSON.stringify(nextAction, null, 2), e);
|
|
168
142
|
failedActions.push(output.action);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ToolsForLLM } from "@empiricalrun/shared-types";
|
|
1
|
+
import type { ToolsForLLM } from "@empiricalrun/shared-types/chat-agent";
|
|
2
|
+
import type { FileInfo } from "@empiricalrun/shared-types/test-gen";
|
|
2
3
|
import { BaseAgent } from "../base";
|
|
3
|
-
export declare class TriageAgent extends BaseAgent {
|
|
4
|
+
export declare class TriageAgent<T> extends BaseAgent<T> {
|
|
4
5
|
protected getTools(): ToolsForLLM;
|
|
5
|
-
protected buildSystemPrompt(
|
|
6
|
+
protected buildSystemPrompt(repoInfoBuilder: () => Promise<FileInfo>): Promise<string>;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/triage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAcpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIpC,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC9C,SAAS,CAAC,QAAQ,IAAI,WAAW;cAyBjB,iBAAiB,CAC/B,eAAe,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GACvC,OAAO,CAAC,MAAM,CAAC;CAgEnB"}
|