@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
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateAndFixTypescriptErrors = validateAndFixTypescriptErrors;
|
|
7
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const logger_1 = require("../../bin/logger");
|
|
10
|
-
const web_1 = require("../../bin/utils/platform/web");
|
|
11
|
-
const constants_1 = require("../../constants");
|
|
12
|
-
const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software engineer who is given a task to fix semantic and syntactical errors in a typescript file\n'{{scenarioFile}}' provided to you.\nYou will be provided with fixtures and page object models to use and fix errors.\n\nHere is the list of fixtures available:\n\n{{fixtureFiles}}\n\nHere is the list of current page object models available to you:\n\n{{pageFiles}}\n\nUse the above files to fix the errors.\n\nFollow these guidelines before responding with output\n- Ensure there are no type issues in the given {{scenarioFile}} file\n- For the given file respond with only the code\n- Do not respond with markdown syntax or backticks\n- Do not modify anything else apart from the code required to fix typescript error\n- Do not modify any other scenarios apart from the provided scenario name\n- Do not respond with any explanation. Respond only with the updated code.\n{{/section}}\n\n{{#section \"user\"}}\n'{{scenarioFile}}' with scenario name '{{scenarioName}}', has following typescript errors which you need to fix:\n{{errors}}\n\nHere is the content of the '{{scenarioFile}}':\n\n{{fileContent}}\n{{/section}}";
|
|
13
|
-
async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.CustomLogger(), file, pomCode, nonSpecFileCode, testCase, }) {
|
|
14
|
-
const validateTypesSpan = trace?.span({ name: "detect-type-errors-in-file" });
|
|
15
|
-
logger.log("Validating types...");
|
|
16
|
-
let errors = (0, web_1.validateTypescript)(file);
|
|
17
|
-
validateTypesSpan?.end({ output: { errors } });
|
|
18
|
-
if (!errors.length) {
|
|
19
|
-
logger.success("Found no type issues!");
|
|
20
|
-
}
|
|
21
|
-
const maxIteration = 2;
|
|
22
|
-
let counter = 0;
|
|
23
|
-
while (errors.length > 0) {
|
|
24
|
-
const fileContent = fs_1.default.readFileSync(file, "utf-8");
|
|
25
|
-
counter += 1;
|
|
26
|
-
if (counter > maxIteration) {
|
|
27
|
-
trace?.event({ name: "code-fix-iteration-max-out" });
|
|
28
|
-
logger.error([
|
|
29
|
-
`Unable to fix typescript errors. Please review ${file} manually and fix the typescript errors.`,
|
|
30
|
-
`View [trace](${trace?.getTraceUrl()})`,
|
|
31
|
-
].join("\n"));
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
trace?.event({ name: "Found errors fixing" });
|
|
35
|
-
logger.warn("Found few errors while validating types. Trying to fix errors...");
|
|
36
|
-
errors.forEach((e) => console.warn(e));
|
|
37
|
-
const promptSpan = trace?.span({ name: "fix-type-errors-prompt" });
|
|
38
|
-
const instruction = (0, llm_1.compilePrompt)(promptTemplate_0, {
|
|
39
|
-
pageFiles: pomCode || "",
|
|
40
|
-
fixtureFiles: nonSpecFileCode || "",
|
|
41
|
-
scenarioFile: file,
|
|
42
|
-
errors: errors,
|
|
43
|
-
fileContent: fileContent,
|
|
44
|
-
scenarioName: testCase.name,
|
|
45
|
-
});
|
|
46
|
-
promptSpan?.end({ output: { instruction } });
|
|
47
|
-
const llm = new llm_1.LLM({
|
|
48
|
-
trace,
|
|
49
|
-
provider: constants_1.DEFAULT_MODEL_PROVIDER,
|
|
50
|
-
defaultModel: constants_1.DEFAULT_MODEL,
|
|
51
|
-
providerApiKey: constants_1.MODEL_API_KEYS[constants_1.DEFAULT_MODEL_PROVIDER],
|
|
52
|
-
});
|
|
53
|
-
const message = await llm.createChatCompletion({
|
|
54
|
-
messages: instruction,
|
|
55
|
-
modelParameters: {
|
|
56
|
-
...constants_1.DEFAULT_MODEL_PARAMETERS,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
const response = message?.content || "";
|
|
60
|
-
const readWriteFileSpan = trace?.span({ name: "write-to-file" });
|
|
61
|
-
fs_1.default.writeFileSync(file, response, "utf-8");
|
|
62
|
-
readWriteFileSpan?.end({ output: { response } });
|
|
63
|
-
trace?.event({ name: "lint-file" });
|
|
64
|
-
await (0, web_1.lintErrors)(file);
|
|
65
|
-
const validateTypesSpan = trace?.span({
|
|
66
|
-
name: "detect-type-errors-in-file",
|
|
67
|
-
input: {
|
|
68
|
-
filePath: file,
|
|
69
|
-
content: response,
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
errors = (0, web_1.validateTypescript)(file);
|
|
73
|
-
validateTypesSpan?.end({ output: { errors } });
|
|
74
|
-
if (!errors.length) {
|
|
75
|
-
logger.success("Found no type issues!");
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import type { TestGenConfigOptions } from "@empiricalrun/shared-types";
|
|
3
|
-
export declare function getLexicalScopedVars({ trace, file, referencePoint, options, }: {
|
|
4
|
-
trace?: TraceClient;
|
|
5
|
-
file: string;
|
|
6
|
-
referencePoint: string;
|
|
7
|
-
options?: TestGenConfigOptions;
|
|
8
|
-
}): Promise<string[]>;
|
|
9
|
-
//# sourceMappingURL=lexical-scoped-vars.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scoped-vars.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/lexical-scoped-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AASvE,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,IAAI,EACJ,cAAc,EACd,OAAO,GACR,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,qBAoDA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLexicalScopedVars = getLexicalScopedVars;
|
|
4
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
6
|
-
const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software engineer tasked with analysing Typescript code to identify all variables available in the lexical\nscope at a specific reference point within a file. You will be given a file that contains multiple Playwright tests or\npage object models, along with a reference point inside the file. Your goal is to evaluate the list of all variables\navailable in the lexical scope at that reference point.\n\nTo accomplish this, you need to evaluate the Abstract Syntax Tree (AST) and accumulate all variables that are in the\nlexical scope, which includes:\n1. Variables declared within the test before the reference point.\n2. Arguments of the function.\n3. Variables defined in the parent scope. Identify all variables available in the lexical scope at a specific execution\nreference point within a file, considering only those variables that have been declared and assigned prior to the\nexecution of this point in the code.\n4. Global variables defined in the file.\n\nBefore responding:\n- Ignore variables imported from the `\"./pages\"` path.\n- keep in mind temporal dead zone phenomenon before responding with variables\n{{/section}}\n\n{{#section \"user\"}}\nFile:\n{{testFile}}\n\nReference point:\n{{referencePoint}}\n{{/section}}";
|
|
7
|
-
async function getLexicalScopedVars({ trace, file, referencePoint, options, }) {
|
|
8
|
-
const fetchLexicalScopedVarsSpan = trace?.span({
|
|
9
|
-
name: "lexical-scoped-vars",
|
|
10
|
-
});
|
|
11
|
-
const messages = (0, llm_1.compilePrompt)(promptTemplate_0, {
|
|
12
|
-
testFile: file || "",
|
|
13
|
-
referencePoint: referencePoint || "",
|
|
14
|
-
});
|
|
15
|
-
const llm = new llm_1.LLM({
|
|
16
|
-
trace: fetchLexicalScopedVarsSpan,
|
|
17
|
-
provider: options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
|
|
18
|
-
defaultModel: options?.model || "o3-mini-2025-01-31",
|
|
19
|
-
providerApiKey: constants_1.MODEL_API_KEYS[options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
|
|
20
|
-
});
|
|
21
|
-
const message = await llm.createChatCompletion({
|
|
22
|
-
messages,
|
|
23
|
-
modelParameters: {
|
|
24
|
-
max_completion_tokens: constants_1.DEFAULT_O1_MODEL_PARAMETERS.max_completion_tokens,
|
|
25
|
-
},
|
|
26
|
-
responseFormat: {
|
|
27
|
-
type: "json_schema",
|
|
28
|
-
json_schema: {
|
|
29
|
-
name: "reasoning_with_variables",
|
|
30
|
-
strict: true,
|
|
31
|
-
schema: {
|
|
32
|
-
type: "object",
|
|
33
|
-
properties: {
|
|
34
|
-
reason: {
|
|
35
|
-
type: "string",
|
|
36
|
-
description: "The reason or explanation.",
|
|
37
|
-
},
|
|
38
|
-
variables: {
|
|
39
|
-
type: "array",
|
|
40
|
-
description: "A list of variables.",
|
|
41
|
-
items: {
|
|
42
|
-
type: "string",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
required: ["reason", "variables"],
|
|
47
|
-
additionalProperties: false,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
const response = JSON.parse(message?.content || "{}");
|
|
53
|
-
fetchLexicalScopedVarsSpan?.end({ output: { response } });
|
|
54
|
-
return response.variables;
|
|
55
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import type { TestCase, TestGenConfigOptions } from "@empiricalrun/shared-types";
|
|
3
|
-
export declare const fetchPomSkills: ({ testCase, pomFiles, options, trace, }: {
|
|
4
|
-
testCase: TestCase;
|
|
5
|
-
pomFiles?: string;
|
|
6
|
-
trace?: TraceClient;
|
|
7
|
-
options?: TestGenConfigOptions;
|
|
8
|
-
}) => Promise<{
|
|
9
|
-
testStep: string;
|
|
10
|
-
filePath: string;
|
|
11
|
-
usageExample: string;
|
|
12
|
-
reason: string;
|
|
13
|
-
methodName: string;
|
|
14
|
-
}[]>;
|
|
15
|
-
export declare function getAppropriateSkills({ testCase, options, trace, }: {
|
|
16
|
-
testCase: TestCase;
|
|
17
|
-
options?: TestGenConfigOptions;
|
|
18
|
-
trace?: TraceClient;
|
|
19
|
-
}): Promise<{
|
|
20
|
-
testStep: string;
|
|
21
|
-
filePath: string;
|
|
22
|
-
usageExample: string;
|
|
23
|
-
reason: string;
|
|
24
|
-
methodName: string;
|
|
25
|
-
}[]>;
|
|
26
|
-
//# sourceMappingURL=skills-retriever.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-retriever.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/skills-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAmBpC,eAAO,MAAM,cAAc,GAAU,yCAKlC;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;;;;;;IAoDA,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,EACzC,QAAQ,EACR,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;;;;;;KA6BA"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchPomSkills = void 0;
|
|
7
|
-
exports.getAppropriateSkills = getAppropriateSkills;
|
|
8
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
9
|
-
const fs_1 = __importDefault(require("fs"));
|
|
10
|
-
const logger_1 = require("../../bin/logger");
|
|
11
|
-
const context_1 = require("../../bin/utils/context");
|
|
12
|
-
const fs_2 = require("../../bin/utils/fs");
|
|
13
|
-
const constants_1 = require("../../constants");
|
|
14
|
-
const promptTemplate_0 = "{{#section \"system\"}}\nYou are provided with usage examples of page object models of a Playwright test\nrepository and you are given a task to update the usage example of the page object\nmodels with the usage of them in tests. \n\nYou need to ensure all the pre-requisites of calling the method is also mentioned\nin the usage example. Use the tests code for same\n\n{{/section}}\n\n{{#section \"user\"}}\nUsage examples of page object models:\n\n{{response}}\n\nTests files:\n\n{{codePrompt}}\n\n\nBefore responding: \n- ensure responding in the same format as provided to you in the usage example of page object models.\n- respond only with the methods and not any test block\n- respond with the same format provided to you in task. <subtask></subtask>, <reason></reason>, <file_import_path></file_import_path>, <usage_example></usage_example> and\n<method_name></method_name>\n- do not respond with test blocks or page or fixture extraction as its already available at the time of execution\n- do not respond with backticks or markdown at all \n- do not respond with import statements and assume the imports are already available at the time of execution\n{{/section}}\n";
|
|
15
|
-
const promptTemplate_1 = "{{#section \"system\"}}\nYou are a software test engineer who is given a goal to pick re-usable page object model methods for a given UI\nautomation test.\n\nYou will be provided with a test scenario as task and also the page object model methods available in the automation\ntest repository. The page object models acts as skills to execute a particular sub task of a given task.\n\nYou need to break down the task into sub tasks and identify which sub_task can be solved with the help of page object\nmodel methods. Once identified, you need to return with an usage API example for same. You need to pick methods only\nfrom the provided page object models.\n\nHere is the list of current page object models:\n\n{{pageFiles}}\n\n{{/section}}\n\n{{#section \"user\"}}\nFollowing is the test scenario for which you need to figure out the skills:\n\n**Task:**\n{{scenario}}\n\nBefore responding follow the instructions:\n- You need to break down the task into subtask and respond with the code of sub tasks for which there are methods\nexposed from page object models\n- Only use methods that are explicitly defined and exported in the provided page object models. Do not create, infer, or\nassume any methods or code that are not exported from the page object model files.\n- Do not respond with any methods or code that are not available in the list of page object models.\n- Ensure there are no type issues in the code generated.\n- Do not respond with markdown syntax or backticks.\n- Respond only with the code\n- Read steps one by one and generate the test code\n- Do not write any extra code than instructed in the steps\n- You need to respond with `<subtask></subtask>`, `<reason></reason>`, `<file_import_path></file_import_path>`, `\n<usage_example></usage_example>` and `<method_name></method_name>`\n- You should respond with methods exported from the page object models\n- Do not respond with any import statements.\n- Do not respond with sub_task for which there is no explicit method found\n- Always pick the page object model method matching the task provided. If there is no matching method, then ignore it.\nDo not attempt to generate or use any non existent methods for such instances.\n- Respond with the usage_example so that it can be directly copy pasted inside the test\n- Do not set the parameters for the method. Keep it as is with the interface parameters\n{{/section}}";
|
|
16
|
-
const utils_1 = require("./utils");
|
|
17
|
-
const fetchPomSkills = async ({ testCase, pomFiles, options, trace, }) => {
|
|
18
|
-
const fetchSkillsUsingPOMFilesSpan = trace?.span({
|
|
19
|
-
name: "fetch-pom-skills",
|
|
20
|
-
input: {
|
|
21
|
-
pomFiles,
|
|
22
|
-
testCase,
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
const promptSpan = fetchSkillsUsingPOMFilesSpan?.span({
|
|
26
|
-
name: "fetch-pom-skills-prompt",
|
|
27
|
-
});
|
|
28
|
-
const prompt = (0, llm_1.compilePrompt)(promptTemplate_1, {
|
|
29
|
-
pageFiles: pomFiles,
|
|
30
|
-
scenarioName: testCase.name,
|
|
31
|
-
scenario: testCase.steps.join("\n"),
|
|
32
|
-
});
|
|
33
|
-
promptSpan?.end({ output: { prompt } });
|
|
34
|
-
const llm = new llm_1.LLM({
|
|
35
|
-
trace: fetchSkillsUsingPOMFilesSpan,
|
|
36
|
-
provider: options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
|
|
37
|
-
defaultModel: options?.model || constants_1.DEFAULT_MODEL,
|
|
38
|
-
providerApiKey: constants_1.MODEL_API_KEYS[options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
|
|
39
|
-
});
|
|
40
|
-
const firstShotMessage = await llm.createChatCompletion({
|
|
41
|
-
messages: prompt,
|
|
42
|
-
traceName: "fetch-pom-skills-llm",
|
|
43
|
-
modelParameters: {
|
|
44
|
-
...constants_1.DEFAULT_MODEL_PARAMETERS,
|
|
45
|
-
...options?.modelParameters,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
let response = firstShotMessage?.content || "";
|
|
49
|
-
const { codePrompt } = await (0, context_1.contextForGeneration)();
|
|
50
|
-
const updatedUsageExampleMessage = await llm.createChatCompletion({
|
|
51
|
-
messages: (0, llm_1.compilePrompt)(promptTemplate_0, {
|
|
52
|
-
response,
|
|
53
|
-
codePrompt,
|
|
54
|
-
}),
|
|
55
|
-
traceName: "fetch-pom-skills-usage-eg-update-llm",
|
|
56
|
-
modelParameters: {
|
|
57
|
-
...constants_1.DEFAULT_MODEL_PARAMETERS,
|
|
58
|
-
...options?.modelParameters,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
const skills = (0, utils_1.extractTestStepsSuggestions)(updatedUsageExampleMessage?.content || "");
|
|
62
|
-
fetchSkillsUsingPOMFilesSpan?.end({ output: { skills } });
|
|
63
|
-
return skills;
|
|
64
|
-
};
|
|
65
|
-
exports.fetchPomSkills = fetchPomSkills;
|
|
66
|
-
async function getAppropriateSkills({ testCase, options, trace, }) {
|
|
67
|
-
const logger = new logger_1.CustomLogger({ useReporter: false });
|
|
68
|
-
logger.log("getting skill set for the repository");
|
|
69
|
-
const filter = await (0, context_1.createGitIgnoreFileFilter)();
|
|
70
|
-
const pomFiles = await (0, fs_2.generatePromptFromDirectory)("./pages", filter);
|
|
71
|
-
const fetchSkillsSpan = trace?.span({
|
|
72
|
-
name: "get-appropriate-skills",
|
|
73
|
-
input: {
|
|
74
|
-
testCase,
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
const skills = await (0, exports.fetchPomSkills)({
|
|
78
|
-
testCase,
|
|
79
|
-
pomFiles,
|
|
80
|
-
trace: fetchSkillsSpan,
|
|
81
|
-
options,
|
|
82
|
-
});
|
|
83
|
-
const validateSkillsSpan = fetchSkillsSpan?.span({
|
|
84
|
-
name: "validate-skills",
|
|
85
|
-
input: {
|
|
86
|
-
skills,
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
const validatedSkills = skills.filter((skill) => fs_1.default.existsSync(skill.filePath));
|
|
90
|
-
validateSkillsSpan?.end({ output: { validatedSkills } });
|
|
91
|
-
fetchSkillsSpan?.end({ output: { validatedSkills } });
|
|
92
|
-
return validatedSkills;
|
|
93
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { ChatCompletionMessageParam } from "openai/resources/index.mjs";
|
|
3
|
-
export declare function applyTestUpdateFeedbacks({ trace, oldPrompt, feedbacks, agentResponse, }: {
|
|
4
|
-
oldPrompt: ChatCompletionMessageParam[];
|
|
5
|
-
agentResponse: string;
|
|
6
|
-
feedbacks: {
|
|
7
|
-
filePath: string | undefined;
|
|
8
|
-
errorMessage: string;
|
|
9
|
-
}[];
|
|
10
|
-
trace?: TraceClient;
|
|
11
|
-
}): Promise<import("./types").CodeUpdate[]>;
|
|
12
|
-
//# sourceMappingURL=test-update-feedback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-update-feedback.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/test-update-feedback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAKxE,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,SAAS,EACT,SAAS,EACT,aAAa,GACd,EAAE;IACD,SAAS,EAAE,0BAA0B,EAAE,CAAC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC;KACtB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,2CA4CA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyTestUpdateFeedbacks = applyTestUpdateFeedbacks;
|
|
4
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
5
|
-
const constants_1 = require("../../constants");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
7
|
-
async function applyTestUpdateFeedbacks({ trace, oldPrompt, feedbacks, agentResponse, }) {
|
|
8
|
-
const applyTestUpdateFeedbacksSpan = trace?.span({
|
|
9
|
-
name: "apply-test-update-feedbacks",
|
|
10
|
-
input: {
|
|
11
|
-
oldPrompt,
|
|
12
|
-
feedbacks,
|
|
13
|
-
agentResponse,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
const llm = new llm_1.LLM({
|
|
17
|
-
trace: applyTestUpdateFeedbacksSpan,
|
|
18
|
-
provider: "openai",
|
|
19
|
-
defaultModel: "gpt-4o",
|
|
20
|
-
providerApiKey: constants_1.MODEL_API_KEYS["openai"],
|
|
21
|
-
});
|
|
22
|
-
const response = await llm.createChatCompletion({
|
|
23
|
-
traceName: "test-update-feedbacks-llm",
|
|
24
|
-
modelParameters: {
|
|
25
|
-
...constants_1.DEFAULT_MODEL_PARAMETERS,
|
|
26
|
-
temperature: 1,
|
|
27
|
-
},
|
|
28
|
-
messages: [
|
|
29
|
-
...oldPrompt,
|
|
30
|
-
{
|
|
31
|
-
role: "assistant",
|
|
32
|
-
content: agentResponse,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
role: "user",
|
|
36
|
-
content: `
|
|
37
|
-
Following errors were found in the previous response
|
|
38
|
-
${feedbacks.map((f) => `- ${f.errorMessage}`).join("\n")}
|
|
39
|
-
|
|
40
|
-
Fix the above failures and respond with same format as the previous response`,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
});
|
|
44
|
-
const updatedResponse = response?.content || "";
|
|
45
|
-
const fileChanges = (0, utils_1.extractTestUpdates)(updatedResponse);
|
|
46
|
-
const filteredFileChanges = fileChanges.filter((f) => feedbacks.some((e) => e?.filePath === f.filePath));
|
|
47
|
-
applyTestUpdateFeedbacksSpan?.end({ output: { fileChanges } });
|
|
48
|
-
return filteredFileChanges;
|
|
49
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { TestCase } from "@empiricalrun/shared-types";
|
|
2
|
-
export type CodeUpdate = {
|
|
3
|
-
filePath: string | undefined;
|
|
4
|
-
oldCode: string | undefined;
|
|
5
|
-
newCode: string | undefined;
|
|
6
|
-
reason: string | undefined;
|
|
7
|
-
};
|
|
8
|
-
export type CreateTestCodeUpdate = {
|
|
9
|
-
filePath: string | undefined;
|
|
10
|
-
code: string | undefined;
|
|
11
|
-
reason: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type FileUpdateResponse = {
|
|
14
|
-
error: boolean;
|
|
15
|
-
errorMessage: string;
|
|
16
|
-
filePath: string;
|
|
17
|
-
};
|
|
18
|
-
export type UpdatedTestCase = TestCase & {
|
|
19
|
-
updatedFiles: string[];
|
|
20
|
-
};
|
|
21
|
-
export declare enum CodeEditorToolCall {
|
|
22
|
-
STR_REPLACE = "str_replace",
|
|
23
|
-
CREATE_FILE = "create_file"
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IACvC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,oBAAY,kBAAkB;IAC5B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;CAC5B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CodeEditorToolCall = void 0;
|
|
4
|
-
var CodeEditorToolCall;
|
|
5
|
-
(function (CodeEditorToolCall) {
|
|
6
|
-
CodeEditorToolCall["STR_REPLACE"] = "str_replace";
|
|
7
|
-
CodeEditorToolCall["CREATE_FILE"] = "create_file";
|
|
8
|
-
})(CodeEditorToolCall || (exports.CodeEditorToolCall = CodeEditorToolCall = {}));
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import type { TestCase, TestGenConfigOptions } from "@empiricalrun/shared-types";
|
|
3
|
-
import { ChatCompletionMessageParam } from "openai/resources/index.mjs";
|
|
4
|
-
import { CodeUpdate, UpdatedTestCase } from "./types";
|
|
5
|
-
export declare function getUpdateTestCodeCompletion({ testCase, testFileContent, testFiles, pageFiles, testFilePath, options, trace, }: {
|
|
6
|
-
testCase: TestCase;
|
|
7
|
-
testFiles: string;
|
|
8
|
-
pageFiles: string;
|
|
9
|
-
testFilePath: string;
|
|
10
|
-
testFileContent: string;
|
|
11
|
-
trace?: TraceClient;
|
|
12
|
-
options?: TestGenConfigOptions;
|
|
13
|
-
}): Promise<{
|
|
14
|
-
prompt: ChatCompletionMessageParam[];
|
|
15
|
-
agentResponse: string;
|
|
16
|
-
fileChanges: CodeUpdate[];
|
|
17
|
-
}>;
|
|
18
|
-
export declare function updateTest({ testCase, file, trace, }: {
|
|
19
|
-
testCase: TestCase;
|
|
20
|
-
file: string;
|
|
21
|
-
trace?: TraceClient;
|
|
22
|
-
}): Promise<UpdatedTestCase[]>;
|
|
23
|
-
export declare function getAppendCreateTestBlockCompletion({ testFiles, pageFiles, testCase, testFilePath, trace, }: {
|
|
24
|
-
trace?: TraceClient;
|
|
25
|
-
pageFiles?: string;
|
|
26
|
-
testFiles: string;
|
|
27
|
-
testCase: TestCase;
|
|
28
|
-
testFilePath: string;
|
|
29
|
-
}): Promise<string>;
|
|
30
|
-
export declare function appendCreateTestBlock({ testCase, file, trace, validateTypes, }: {
|
|
31
|
-
testCase: TestCase;
|
|
32
|
-
file: string;
|
|
33
|
-
trace?: TraceClient;
|
|
34
|
-
validateTypes?: boolean;
|
|
35
|
-
}): Promise<UpdatedTestCase[]>;
|
|
36
|
-
//# sourceMappingURL=update-flow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,QAAQ,EACR,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAcxE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQtD,wBAAsB,2BAA2B,CAAC,EAChD,QAAQ,EACR,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC,CAkDD;AAED,wBAAsB,UAAU,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA8E7B;AAED,wBAAsB,kCAAkC,CAAC,EACvD,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,mBAkFA;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA8C7B"}
|