@empiricalrun/test-gen 0.78.0 → 0.78.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +0 -10
- package/dist/agent/base/index.d.ts +28 -19
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +25 -14
- package/dist/agent/browsing/run.d.ts +1 -1
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.d.ts +5 -5
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/exports.d.ts +3 -4
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +5 -11
- package/dist/agent/chat/index.d.ts +4 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +12 -5
- package/dist/agent/chat/models.d.ts +1 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +3 -3
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +42 -0
- package/dist/agent/chat/prompt/repo.d.ts +2 -2
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +2 -2
- package/dist/agent/chat/state.d.ts +14 -19
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +10 -45
- package/dist/agent/chat/utils.d.ts +5 -5
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/cli.d.ts +2 -2
- package/dist/agent/cli.d.ts.map +1 -1
- package/dist/agent/cli.js +5 -6
- package/dist/agent/code-review/index.d.ts +4 -3
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +10 -4
- package/dist/agent/code-review/types.d.ts +2 -35
- package/dist/agent/code-review/types.d.ts.map +1 -1
- package/dist/agent/code-review/types.js +4 -11
- package/dist/agent/cua/index.d.ts +1 -1
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +24 -13
- package/dist/agent/cua/pw-codegen/factory.d.ts +15 -0
- package/dist/agent/cua/pw-codegen/factory.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/factory.js +59 -0
- package/dist/agent/cua/pw-codegen/index.d.ts +7 -0
- package/dist/agent/cua/pw-codegen/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/index.js +14 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts +43 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/pw-event-sink/index.js +250 -0
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +7 -3
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts +15 -3
- package/dist/agent/cua/pw-codegen/pw-pause/patch.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/patch.js +38 -10
- package/dist/agent/cua/pw-codegen/version.d.ts +25 -0
- package/dist/agent/cua/pw-codegen/version.d.ts.map +1 -0
- package/dist/agent/cua/pw-codegen/version.js +86 -0
- package/dist/agent/index.d.ts +1 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -11
- package/dist/agent/master/element-annotation.d.ts +1 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/next-action.d.ts +1 -1
- package/dist/agent/master/next-action.d.ts.map +1 -1
- package/dist/agent/master/next-action.js +1 -6
- package/dist/agent/master/run.d.ts +3 -2
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +0 -26
- package/dist/agent/triage/index.d.ts +4 -3
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +33 -20
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/utils.d.ts +1 -1
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/bin/environments.d.ts +1 -1
- package/dist/bin/environments.d.ts.map +1 -1
- package/dist/bin/index.js +2 -2
- package/dist/bin/setup.d.ts +1 -1
- package/dist/bin/setup.d.ts.map +1 -1
- package/dist/bin/utils/fs/index.d.ts +1 -1
- package/dist/bin/utils/fs/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.d.ts +2 -2
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +1 -1
- package/dist/bin/utils/scenarios/index.d.ts +1 -1
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -4
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +0 -6
- package/dist/dashboard/client.d.ts +1 -1
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -1
- package/dist/dashboard/tool-response.d.ts +5 -0
- package/dist/dashboard/tool-response.d.ts.map +1 -0
- package/dist/dashboard/tool-response.js +88 -0
- package/dist/dashboard/totp.js +1 -1
- package/dist/file/server.d.ts +1 -1
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +2 -1
- package/dist/file-info/adapters/file-system/index.d.ts +1 -1
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/index.d.ts +2 -1
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.d.ts +2 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +9 -3
- package/dist/recorder/upload.d.ts +1 -1
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.d.ts +1 -1
- package/dist/tools/analyse-video/index.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.js +20 -13
- package/dist/tools/create-pull-request/index.d.ts +1 -1
- package/dist/tools/create-pull-request/index.d.ts.map +1 -1
- package/dist/tools/create-pull-request/utils.d.ts +3 -2
- package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +5 -37
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.js +12 -25
- package/dist/tools/definitions/delete-file.d.ts +5 -1
- package/dist/tools/definitions/delete-file.d.ts.map +1 -1
- package/dist/tools/definitions/delete-file.js +3 -3
- package/dist/tools/definitions/download-build.d.ts +2 -6
- package/dist/tools/definitions/download-build.d.ts.map +1 -1
- package/dist/tools/definitions/grep.d.ts +1 -1
- package/dist/tools/definitions/grep.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts +2 -6
- package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.js +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
- package/dist/tools/definitions/merge-conflicts.js +2 -2
- package/dist/tools/definitions/rename-file.d.ts +1 -1
- package/dist/tools/definitions/rename-file.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.js +1 -1
- package/dist/tools/definitions/run-test.d.ts +3 -15
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/safe-bash.d.ts +8 -0
- package/dist/tools/definitions/safe-bash.d.ts.map +1 -0
- package/dist/tools/definitions/safe-bash.js +32 -0
- package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts +3 -15
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +4 -26
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
- package/dist/tools/definitions/utils.d.ts +2 -10
- package/dist/tools/definitions/utils.d.ts.map +1 -1
- package/dist/tools/definitions/utils.js +1 -1
- package/dist/tools/delete-file/index.d.ts +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +6 -2
- package/dist/tools/diagnosis-fetcher.d.ts +1 -1
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +92 -47
- package/dist/tools/download-build/index.d.ts +1 -1
- package/dist/tools/download-build/index.d.ts.map +1 -1
- package/dist/tools/executor/base.d.ts +3 -2
- package/dist/tools/executor/base.d.ts.map +1 -1
- package/dist/tools/executor/base.js +5 -8
- package/dist/tools/executor/index.d.ts +3 -0
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +12 -10
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
- package/dist/tools/executor/utils/checkpoint.js +0 -4
- package/dist/tools/executor/utils/git.d.ts +7 -1
- package/dist/tools/executor/utils/git.d.ts.map +1 -1
- package/dist/tools/executor/utils/git.js +10 -3
- package/dist/tools/executor/utils/index.d.ts +1 -2
- package/dist/tools/executor/utils/index.d.ts.map +1 -1
- package/dist/tools/executor/utils/index.js +0 -20
- package/dist/tools/executor/utils/pr-description.d.ts +1 -1
- package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.d.ts +2 -6
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +53 -13
- package/dist/tools/fetch-file/utils.d.ts +3 -0
- package/dist/tools/fetch-file/utils.d.ts.map +1 -0
- package/dist/tools/fetch-file/utils.js +136 -0
- package/dist/tools/fetch-session-diff/index.d.ts +1 -1
- package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
- package/dist/tools/fetch-session-diff/index.js +26 -2
- package/dist/tools/file-operations/create.d.ts +1 -1
- package/dist/tools/file-operations/create.d.ts.map +1 -1
- package/dist/tools/file-operations/index.d.ts +2 -1
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/insert.d.ts +1 -1
- package/dist/tools/file-operations/insert.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.d.ts +1 -1
- package/dist/tools/file-operations/replace.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.js +0 -1
- package/dist/tools/file-operations/view/index.d.ts +2 -1
- package/dist/tools/file-operations/view/index.d.ts.map +1 -1
- package/dist/tools/firecrawl-scrape/index.d.ts +9 -0
- package/dist/tools/firecrawl-scrape/index.d.ts.map +1 -0
- package/dist/tools/firecrawl-scrape/index.js +107 -0
- package/dist/tools/grep/index.d.ts +1 -1
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +15 -12
- package/dist/tools/index.d.ts +5 -24
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +21 -42
- package/dist/tools/issues-v1/create-issue.d.ts +3 -0
- package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
- package/dist/tools/issues-v1/index.d.ts.map +1 -0
- package/dist/tools/issues-v1/list-issues.d.ts +3 -0
- package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
- package/dist/tools/issues-v1/update-issue.d.ts +3 -0
- package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
- package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
- package/dist/tools/issues-v1/utils.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.d.ts +3 -0
- package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.js +82 -0
- package/dist/tools/issues-v2/set-issue-description.d.ts +3 -0
- package/dist/tools/issues-v2/set-issue-description.d.ts.map +1 -0
- package/dist/tools/issues-v2/set-issue-description.js +59 -0
- package/dist/tools/issues-v2/update-issue.d.ts +3 -0
- package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/update-issue.js +85 -0
- package/dist/tools/list-environments.d.ts +1 -1
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.js +14 -4
- package/dist/tools/merge-conflicts/index.d.ts +1 -1
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +23 -10
- package/dist/tools/rename-file/index.d.ts +1 -1
- package/dist/tools/rename-file/index.d.ts.map +1 -1
- package/dist/tools/rename-file/index.js +0 -1
- package/dist/tools/review-pull-request/index.d.ts +1 -1
- package/dist/tools/review-pull-request/index.d.ts.map +1 -1
- package/dist/tools/review-pull-request/index.js +5 -4
- package/dist/tools/run-test.d.ts +1 -1
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/safe-bash/index.d.ts +3 -0
- package/dist/tools/safe-bash/index.d.ts.map +1 -0
- package/dist/tools/safe-bash/index.js +128 -0
- package/dist/tools/test-gen-browser.d.ts +1 -1
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +64 -21
- package/dist/tools/test-run-fetcher/index.d.ts +2 -2
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +67 -66
- package/dist/tools/trace-dot-zip/index.d.ts +1 -1
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
- package/dist/tools/triage-summary/index.d.ts +1 -1
- package/dist/tools/triage-summary/index.d.ts.map +1 -1
- package/dist/tools/triage-summary/index.js +5 -2
- package/dist/tools/triage-summary/utils.d.ts +1 -1
- package/dist/tools/triage-summary/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.d.ts +1 -1
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +14 -8
- package/dist/tools/upgrade-packages/utils.d.ts +9 -5
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/utils.js +56 -16
- package/dist/tools/utils/queue.d.ts +1 -1
- package/dist/tools/utils/queue.d.ts.map +1 -1
- package/dist/tools/utils/validate-schema.d.ts +3 -0
- package/dist/tools/utils/validate-schema.d.ts.map +1 -0
- package/dist/tools/utils/validate-schema.js +27 -0
- package/dist/utils/SQSClient.d.ts +1 -1
- package/dist/utils/SQSClient.d.ts.map +1 -1
- package/dist/utils/dedup/dedup-image.js +2 -2
- package/dist/utils/dedup/find-threshold.d.ts +1 -1
- package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
- package/dist/utils/dedup/find-threshold.js +2 -2
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +6 -10
- package/dist/utils/playwright-report-parser.d.ts +1 -1
- package/dist/utils/playwright-report-parser.d.ts.map +1 -1
- package/dist/utils/playwright-test-id.d.ts +8 -0
- package/dist/utils/playwright-test-id.d.ts.map +1 -0
- package/dist/utils/playwright-test-id.js +21 -0
- package/dist/utils/repo-tree.d.ts +1 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +15 -4
- package/dist/utils/url-validation.d.ts +2 -0
- package/dist/utils/url-validation.d.ts.map +1 -0
- package/dist/utils/url-validation.js +16 -0
- package/dist/video-core/index.d.ts +7 -24
- package/dist/video-core/index.d.ts.map +1 -1
- package/dist/video-core/index.js +32 -25
- package/dist/video-core/model-limits.d.ts +2 -2
- package/dist/video-core/model-limits.d.ts.map +1 -1
- package/dist/video-core/model-limits.js +9 -19
- package/dist/video-core/storage-manager.d.ts +2 -1
- package/dist/video-core/storage-manager.d.ts.map +1 -1
- package/dist/video-core/types.d.ts +1 -1
- package/dist/video-core/types.d.ts.map +1 -1
- package/dist/video-core/utils.d.ts +5 -7
- package/dist/video-core/utils.d.ts.map +1 -1
- package/dist/video-core/utils.js +39 -132
- package/package.json +10 -6
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/actions/skill.d.ts +0 -21
- package/dist/actions/skill.d.ts.map +0 -1
- package/dist/actions/skill.js +0 -127
- package/dist/agent/chat/filesystem-cache.d.ts +0 -12
- package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
- package/dist/agent/chat/filesystem-cache.js +0 -101
- package/dist/agent/codegen/create-test-block.d.ts +0 -8
- package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
- package/dist/agent/codegen/create-test-block.js +0 -47
- package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
- package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
- package/dist/agent/codegen/fix-ts-errors.js +0 -78
- package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
- package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
- package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
- package/dist/agent/codegen/skills-retriever.d.ts +0 -26
- package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
- package/dist/agent/codegen/skills-retriever.js +0 -93
- package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
- package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
- package/dist/agent/codegen/test-update-feedback.js +0 -49
- package/dist/agent/codegen/types.d.ts +0 -25
- package/dist/agent/codegen/types.d.ts.map +0 -1
- package/dist/agent/codegen/types.js +0 -8
- package/dist/agent/codegen/update-flow.d.ts +0 -36
- package/dist/agent/codegen/update-flow.d.ts.map +0 -1
- package/dist/agent/codegen/update-flow.js +0 -259
- package/dist/agent/codegen/use-skill.d.ts +0 -11
- package/dist/agent/codegen/use-skill.d.ts.map +0 -1
- package/dist/agent/codegen/use-skill.js +0 -53
- package/dist/agent/codegen/utils.d.ts +0 -110
- package/dist/agent/codegen/utils.d.ts.map +0 -1
- package/dist/agent/codegen/utils.js +0 -376
- package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
- package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
- package/dist/agent/master/browser-tests/skills.spec.js +0 -112
- package/dist/agent/master/execute-skill-action.d.ts +0 -11
- package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
- package/dist/agent/master/execute-skill-action.js +0 -23
- package/dist/agent/video-analysis/executor/index.d.ts +0 -5
- package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/executor/index.js +0 -10
- package/dist/agent/video-analysis/index.d.ts +0 -7
- package/dist/agent/video-analysis/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/index.js +0 -60
- package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
- package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
- package/dist/evals/append-create-test-agent.evals.js +0 -117
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
- package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
- package/dist/evals/master-agent.evals.d.ts +0 -4
- package/dist/evals/master-agent.evals.d.ts.map +0 -1
- package/dist/evals/master-agent.evals.js +0 -35
- package/dist/evals/type.d.ts +0 -12
- package/dist/evals/type.d.ts.map +0 -1
- package/dist/evals/type.js +0 -2
- package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
- package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
- package/dist/evals/update-scenario-agent.evals.js +0 -47
- package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
- package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
- package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
- package/dist/tools/issues/create-issue.d.ts +0 -3
- package/dist/tools/issues/create-issue.d.ts.map +0 -1
- package/dist/tools/issues/index.d.ts.map +0 -1
- package/dist/tools/issues/list-issues.d.ts +0 -3
- package/dist/tools/issues/list-issues.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.d.ts +0 -24
- package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.js +0 -22
- package/dist/tools/issues/update-issue.d.ts +0 -3
- package/dist/tools/issues/update-issue.d.ts.map +0 -1
- package/dist/tools/issues/utils.d.ts.map +0 -1
- package/dist/tools/utils/urls.d.ts +0 -5
- package/dist/tools/utils/urls.d.ts.map +0 -1
- package/dist/tools/utils/urls.js +0 -19
- package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
- package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
- package/dist/tools/view-failed-test-run-report/index.js +0 -151
- package/dist/video-core/agent-orchestrator.d.ts +0 -13
- package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
- package/dist/video-core/agent-orchestrator.js +0 -59
- package/dist/video-core/xml-parser.d.ts +0 -3
- package/dist/video-core/xml-parser.d.ts.map +0 -1
- package/dist/video-core/xml-parser.js +0 -27
- /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
- /package/dist/tools/{issues → issues-v1}/index.js +0 -0
- /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
- /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
|
@@ -1,376 +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.extractTestUpdates = extractTestUpdates;
|
|
7
|
-
exports.extractCreateTestUpdates = extractCreateTestUpdates;
|
|
8
|
-
exports.extractAppendTestUpdates = extractAppendTestUpdates;
|
|
9
|
-
exports.extractTestStepsSuggestions = extractTestStepsSuggestions;
|
|
10
|
-
exports.validateTypesAndFormatCode = validateTypesAndFormatCode;
|
|
11
|
-
exports.applyFileChangesUsingStrReplace = applyFileChangesUsingStrReplace;
|
|
12
|
-
exports.applyFileChangesForCreateTest = applyFileChangesForCreateTest;
|
|
13
|
-
exports.searchAndReplaceCode = searchAndReplaceCode;
|
|
14
|
-
exports.applyFileChanges = applyFileChanges;
|
|
15
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const ts_morph_1 = require("ts-morph");
|
|
18
|
-
const web_1 = require("../../bin/utils/platform/web");
|
|
19
|
-
const fix_ts_errors_1 = require("./fix-ts-errors");
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* method to extract file path and code updates for the LLM response of update flow
|
|
23
|
-
* @export
|
|
24
|
-
* @param {string} input
|
|
25
|
-
* @return {*} {({
|
|
26
|
-
* filePath: string | undefined;
|
|
27
|
-
* oldCode: string | undefined;
|
|
28
|
-
* newCode: string | undefined;
|
|
29
|
-
* reason: string | undefined;
|
|
30
|
-
* }[])}
|
|
31
|
-
*/
|
|
32
|
-
function extractTestUpdates(input) {
|
|
33
|
-
const result = [];
|
|
34
|
-
// TODO: use better structure for this. Do not kill me for this please.
|
|
35
|
-
const regex = /<file_path>(.*?)<\/file_path>[\s\S]*?<old_code_block>([\s\S]*?)<\/old_code_block>[\s\S]*?<new_code_block>([\s\S]*?)<\/new_code_block>[\s\S]*?<change>([\s\S]*?)<\/change>/g;
|
|
36
|
-
let match;
|
|
37
|
-
while ((match = regex.exec(input)) !== null) {
|
|
38
|
-
const [, filePath, oldCode, newCode, reason] = match;
|
|
39
|
-
result.push({
|
|
40
|
-
filePath: filePath?.trim(),
|
|
41
|
-
oldCode: oldCode?.trim(),
|
|
42
|
-
newCode: newCode?.trim(),
|
|
43
|
-
reason: reason?.trim(),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* method to extract file path and code updates for the LLM response of create flow
|
|
51
|
-
* @export
|
|
52
|
-
* @param {string} input
|
|
53
|
-
* @return {*} {({
|
|
54
|
-
* filePath: string | undefined;
|
|
55
|
-
* code: string | undefined;
|
|
56
|
-
* reason: string | undefined;
|
|
57
|
-
* }[])}
|
|
58
|
-
*/
|
|
59
|
-
function extractCreateTestUpdates(input) {
|
|
60
|
-
const result = [];
|
|
61
|
-
// TODO: use better structure for this. Do not kill me for this please.
|
|
62
|
-
const regex = /<file_path>(.*?)<\/file_path>[\s\S]*?<code_block>([\s\S]*?)<\/code_block>[\s\S]*?<change>([\s\S]*?)<\/change>/g;
|
|
63
|
-
let match;
|
|
64
|
-
while ((match = regex.exec(input)) !== null) {
|
|
65
|
-
const [, filePath, code, reason] = match;
|
|
66
|
-
result.push({
|
|
67
|
-
filePath: filePath?.trim(),
|
|
68
|
-
code: code?.trim(),
|
|
69
|
-
reason: reason?.trim(),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* method to extract append create test updates
|
|
77
|
-
* @export
|
|
78
|
-
* @param {string} input
|
|
79
|
-
* @return {*} {({
|
|
80
|
-
* intent: string | undefined,
|
|
81
|
-
* updateLocation: string | undefined,
|
|
82
|
-
* filePath: string | undefined;
|
|
83
|
-
* oldCode: string | undefined;
|
|
84
|
-
* newCode: string | undefined;
|
|
85
|
-
* reason: string | undefined;
|
|
86
|
-
* }[])}
|
|
87
|
-
*/
|
|
88
|
-
function extractAppendTestUpdates(input) {
|
|
89
|
-
const result = [];
|
|
90
|
-
// TODO: use better structure for this. Do not kill me for this please.
|
|
91
|
-
const regex = /<reason_for_intent>(.*?)<\/reason_for_intent>[\s\S]*?<intent>(.*?)<\/intent>[\s\S]*?<location_of_update>([\s\S]*?)<\/location_of_update>[\s\S]*?<file_path>([\s\S]*?)<\/file_path>[\s\S]*?<old_code_block>([\s\S]*?)<\/old_code_block>[\s\S]*?<new_code_block>([\s\S]*?)<\/new_code_block>[\s\S]*?<change>([\s\S]*?)<\/change>/g;
|
|
92
|
-
let match;
|
|
93
|
-
while ((match = regex.exec(input)) !== null) {
|
|
94
|
-
const [, reasonForIntent, intent, updateLocation, filePath, oldCode, newCode, reason,] = match;
|
|
95
|
-
result.push({
|
|
96
|
-
reasonForIntent: reasonForIntent?.trim(),
|
|
97
|
-
intent: intent?.trim(),
|
|
98
|
-
updateLocation: updateLocation?.trim(),
|
|
99
|
-
filePath: filePath?.trim(),
|
|
100
|
-
oldCode: oldCode?.trim(),
|
|
101
|
-
newCode: newCode?.trim(),
|
|
102
|
-
reason: reason?.trim(),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
return result;
|
|
106
|
-
}
|
|
107
|
-
function extractTestStepsSuggestions(input) {
|
|
108
|
-
const result = [];
|
|
109
|
-
// Extract all sections with their subtask tags first
|
|
110
|
-
const subtaskRegex = /<subtask>([\s\S]*?)<\/subtask>([\s\S]*?)(?=<subtask>|$)/g;
|
|
111
|
-
let subtaskMatch;
|
|
112
|
-
while ((subtaskMatch = subtaskRegex.exec(input)) !== null) {
|
|
113
|
-
const [, testStepText = "", content = ""] = subtaskMatch;
|
|
114
|
-
// Extract individual tag content regardless of order
|
|
115
|
-
const reasonMatch = /<reason>([\s\S]*?)<\/reason>/i.exec(content);
|
|
116
|
-
const filePathMatch = /<file_import_path>([\s\S]*?)<\/file_import_path>/i.exec(content);
|
|
117
|
-
const usageExampleMatch = /<usage_example>([\s\S]*?)<\/usage_example>/i.exec(content);
|
|
118
|
-
const methodNameMatch = /<method_name>([\s\S]*?)<\/method_name>/i.exec(content);
|
|
119
|
-
// Extract values or use empty strings if not found
|
|
120
|
-
const reasonText = reasonMatch?.[1] || "";
|
|
121
|
-
const filePathText = filePathMatch?.[1] || "";
|
|
122
|
-
const usageExampleText = usageExampleMatch?.[1] || "";
|
|
123
|
-
const methodNameText = methodNameMatch?.[1] || "";
|
|
124
|
-
result.push({
|
|
125
|
-
testStep: testStepText.trim(),
|
|
126
|
-
filePath: filePathText.trim(),
|
|
127
|
-
usageExample: usageExampleText.trim(),
|
|
128
|
-
reason: reasonText.trim(),
|
|
129
|
-
methodName: methodNameText.trim(),
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return result.filter((r) => !!r.filePath && !!r.usageExample);
|
|
133
|
-
}
|
|
134
|
-
async function validateTypesAndFormatCode({ validateTypes = true, trace, testCase, filePaths, logger, pomPrompt, nonSpecFilePrompt, }) {
|
|
135
|
-
for (let filePath of filePaths) {
|
|
136
|
-
if (!filePath) {
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
if (validateTypes) {
|
|
141
|
-
await (0, fix_ts_errors_1.validateAndFixTypescriptErrors)({
|
|
142
|
-
trace,
|
|
143
|
-
logger,
|
|
144
|
-
file: filePath,
|
|
145
|
-
pomCode: pomPrompt ?? "",
|
|
146
|
-
nonSpecFileCode: nonSpecFilePrompt ?? "",
|
|
147
|
-
testCase: testCase,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
trace?.event({ name: "format-file" });
|
|
151
|
-
await (0, web_1.formatCode)(filePath, trace);
|
|
152
|
-
logger?.success(`${filePath} file formatted successfully!`);
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
console.error(`Error while formatting the file ${filePath}`, e);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
await (0, llm_1.flushAllTraces)();
|
|
159
|
-
}
|
|
160
|
-
async function applyFileChangesUsingStrReplace({ trace, fileChanges, logger, }) {
|
|
161
|
-
const repoEditFileChangesSpan = trace?.span({
|
|
162
|
-
name: "repo-edit-file-changes",
|
|
163
|
-
});
|
|
164
|
-
const results = [];
|
|
165
|
-
for (const fileChange of fileChanges) {
|
|
166
|
-
if (!fileChange.filePath) {
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
|
-
const readWriteFileSpan = repoEditFileChangesSpan?.span({
|
|
171
|
-
name: "write-to-file",
|
|
172
|
-
input: {
|
|
173
|
-
fileChange,
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
const { result, updatedContent } = await searchAndReplaceCode({
|
|
177
|
-
logger,
|
|
178
|
-
fileChange,
|
|
179
|
-
});
|
|
180
|
-
if (result.error) {
|
|
181
|
-
logger?.error(`Unable to find the code to update in ${result.filePath}, full error:`, result);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
fs_1.default.writeFileSync(fileChange.filePath, updatedContent, "utf-8");
|
|
185
|
-
readWriteFileSpan?.end({ output: { updatedContent } });
|
|
186
|
-
}
|
|
187
|
-
results.push(result);
|
|
188
|
-
}
|
|
189
|
-
catch (e) {
|
|
190
|
-
trace?.event({
|
|
191
|
-
name: "repo-edit-file-changes-error",
|
|
192
|
-
output: {
|
|
193
|
-
filePath: fileChange.filePath,
|
|
194
|
-
error: e,
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
|
-
console.error(`Error while applying changes to file ${fileChange.filePath}`, e);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return results;
|
|
201
|
-
}
|
|
202
|
-
async function applyFileChangesForCreateTest({ trace, fileChanges, }) {
|
|
203
|
-
const repoEditFileChangesSpan = trace?.span({
|
|
204
|
-
name: "create-test-file-changes",
|
|
205
|
-
});
|
|
206
|
-
for (const fileChange of fileChanges) {
|
|
207
|
-
if (!fileChange.filePath) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
try {
|
|
211
|
-
const readWriteFileSpan = repoEditFileChangesSpan?.span({
|
|
212
|
-
name: "write-to-file",
|
|
213
|
-
input: {
|
|
214
|
-
fileChange,
|
|
215
|
-
},
|
|
216
|
-
});
|
|
217
|
-
if (fileChange.code) {
|
|
218
|
-
const currentContent = fs_1.default.existsSync(fileChange.filePath)
|
|
219
|
-
? fs_1.default.readFileSync(fileChange.filePath, "utf-8")
|
|
220
|
-
: "";
|
|
221
|
-
fs_1.default.writeFileSync(fileChange.filePath, currentContent
|
|
222
|
-
? `${currentContent}\n\n${fileChange.code}`
|
|
223
|
-
: fileChange.code, "utf-8");
|
|
224
|
-
const updatedFileContent = fs_1.default.readFileSync(fileChange.filePath, "utf-8");
|
|
225
|
-
readWriteFileSpan?.end({
|
|
226
|
-
output: { fileChange, updatedFile: updatedFileContent },
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
catch (e) {
|
|
231
|
-
trace?.event({
|
|
232
|
-
name: "create-test-file-changes-error",
|
|
233
|
-
output: {
|
|
234
|
-
filePath: fileChange.filePath,
|
|
235
|
-
error: e,
|
|
236
|
-
},
|
|
237
|
-
});
|
|
238
|
-
console.error(`Error while applying changes to file ${fileChange.filePath}`, e);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
async function searchAndReplaceCode({ logger, fileChange, }) {
|
|
243
|
-
let contents = fs_1.default.readFileSync(fileChange.filePath, "utf-8");
|
|
244
|
-
// since we dont know what is getting updated,
|
|
245
|
-
// we believe that the patch is correct and contains few before and after lines
|
|
246
|
-
// to make the change unique for search & replace
|
|
247
|
-
if (contents.includes(fileChange.oldCode)) {
|
|
248
|
-
const updatedContent = contents.replace(fileChange.oldCode, `\n\n${fileChange.newCode}`);
|
|
249
|
-
return {
|
|
250
|
-
result: {
|
|
251
|
-
error: false,
|
|
252
|
-
errorMessage: "",
|
|
253
|
-
filePath: fileChange.filePath,
|
|
254
|
-
},
|
|
255
|
-
updatedContent,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
logger?.error(`Unable to find the code to update in ${fileChange.filePath}`);
|
|
259
|
-
return {
|
|
260
|
-
result: {
|
|
261
|
-
error: true,
|
|
262
|
-
// TODO: old_code_block should be replaced with oldCode
|
|
263
|
-
errorMessage: `The content of "old_code_block" corresponding to file path "${fileChange.filePath}" did not match the current content of the file "${fileChange.filePath}"`,
|
|
264
|
-
filePath: fileChange.filePath,
|
|
265
|
-
},
|
|
266
|
-
updatedContent: contents,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
async function applyFileChanges({ trace, testCase, fileChanges, logger, }) {
|
|
270
|
-
const results = [];
|
|
271
|
-
for (const fileChange of fileChanges) {
|
|
272
|
-
if (!fileChange.filePath) {
|
|
273
|
-
continue;
|
|
274
|
-
}
|
|
275
|
-
try {
|
|
276
|
-
const hasTestCaseAsUpdateContext = !!testCase?.name;
|
|
277
|
-
let testBlockUpdate = undefined;
|
|
278
|
-
if (hasTestCaseAsUpdateContext) {
|
|
279
|
-
const applyFileChangesSpan = trace?.span({
|
|
280
|
-
name: "apply-file-changes",
|
|
281
|
-
});
|
|
282
|
-
const block = (0, web_1.getTypescriptTestBlock)({
|
|
283
|
-
scenarioName: testCase?.name,
|
|
284
|
-
content: fileChange.newCode || "",
|
|
285
|
-
suites: [], // // suites should be empty here since we ask LLM to send immediate parent AST node for the code update. so there won't be any nesting here, just the test block
|
|
286
|
-
});
|
|
287
|
-
testBlockUpdate = block.testBlock;
|
|
288
|
-
applyFileChangesSpan?.end({ output: { testBlock: testBlockUpdate } });
|
|
289
|
-
}
|
|
290
|
-
if (testBlockUpdate) {
|
|
291
|
-
// assuming the test case getting updated
|
|
292
|
-
// maintaining the previous accuracy of the test case update
|
|
293
|
-
const readWriteFileSpan = trace?.span({ name: "write-to-file" });
|
|
294
|
-
let contents = fs_1.default.readFileSync(fileChange.filePath, "utf-8");
|
|
295
|
-
const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(fileChange.newCode, testCase?.name);
|
|
296
|
-
let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
|
|
297
|
-
const { testBlock } = (0, web_1.getTypescriptTestBlock)({
|
|
298
|
-
scenarioName: testCase?.name,
|
|
299
|
-
content: contents,
|
|
300
|
-
suites: testCase?.suites,
|
|
301
|
-
});
|
|
302
|
-
contents = contents.replace(testBlock, `\n\n${strippedContent}`);
|
|
303
|
-
updatedContent = prependContent + contents;
|
|
304
|
-
fs_1.default.writeFileSync(fileChange.filePath, updatedContent, "utf-8");
|
|
305
|
-
readWriteFileSpan?.end({ output: { updatedContent } });
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
const readWriteFileSpan = trace?.span({ name: "write-to-file" });
|
|
309
|
-
let contents = fs_1.default.readFileSync(fileChange.filePath, "utf-8");
|
|
310
|
-
const project = new ts_morph_1.Project();
|
|
311
|
-
const sourceFile = project.createSourceFile("updated-code.ts", fileChange.newCode);
|
|
312
|
-
const functions = sourceFile.getFunctions();
|
|
313
|
-
const checkForMethodSrc = project.createSourceFile("check-method.ts", `class A {
|
|
314
|
-
${fileChange.newCode}
|
|
315
|
-
}`);
|
|
316
|
-
const methods = checkForMethodSrc.getDescendantsOfKind(ts_morph_1.SyntaxKind.MethodDeclaration);
|
|
317
|
-
const originalSource = project.createSourceFile("current-code.ts", contents);
|
|
318
|
-
// if there is a single function update in the file
|
|
319
|
-
if (functions.length === 1 &&
|
|
320
|
-
functions[0]?.getText() === fileChange.newCode) {
|
|
321
|
-
const updatedCodeFuncNames = functions.map((f) => f.getName());
|
|
322
|
-
const funcName = updatedCodeFuncNames[0];
|
|
323
|
-
const matchingNodes = originalSource
|
|
324
|
-
.getDescendantsOfKind(ts_morph_1.SyntaxKind.FunctionDeclaration)
|
|
325
|
-
.filter((node) => node.getName() === funcName);
|
|
326
|
-
matchingNodes[0]?.replaceWithText(functions[0]?.getText());
|
|
327
|
-
contents = originalSource.getFullText();
|
|
328
|
-
}
|
|
329
|
-
else if (
|
|
330
|
-
// if there is a update in method of a class in the file
|
|
331
|
-
methods.length === 1 &&
|
|
332
|
-
methods[0]?.getText() === fileChange.newCode) {
|
|
333
|
-
const method = methods[0];
|
|
334
|
-
const funcName = method?.getName();
|
|
335
|
-
const matchingNodes = originalSource
|
|
336
|
-
.getDescendantsOfKind(ts_morph_1.SyntaxKind.MethodDeclaration)
|
|
337
|
-
.filter((node) => node.getName() === funcName);
|
|
338
|
-
matchingNodes[0]?.replaceWithText(method?.getText());
|
|
339
|
-
contents = originalSource.getFullText();
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
const { result, updatedContent } = await searchAndReplaceCode({
|
|
343
|
-
logger,
|
|
344
|
-
fileChange,
|
|
345
|
-
});
|
|
346
|
-
if (result.error) {
|
|
347
|
-
logger?.error(`Unable to find the code to update in ${fileChange.filePath}`);
|
|
348
|
-
results.push(result);
|
|
349
|
-
continue;
|
|
350
|
-
}
|
|
351
|
-
else {
|
|
352
|
-
contents = updatedContent;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
fs_1.default.writeFileSync(fileChange.filePath, contents, "utf-8");
|
|
356
|
-
readWriteFileSpan?.end({ output: { contents } });
|
|
357
|
-
results.push({
|
|
358
|
-
filePath: fileChange.filePath,
|
|
359
|
-
error: false,
|
|
360
|
-
errorMessage: "",
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
catch (e) {
|
|
365
|
-
trace?.event({
|
|
366
|
-
name: "apply-file-changes-error",
|
|
367
|
-
output: {
|
|
368
|
-
filePath: fileChange.filePath,
|
|
369
|
-
error: e,
|
|
370
|
-
},
|
|
371
|
-
});
|
|
372
|
-
console.error(`Error while applying changes to file ${fileChange.filePath}`, e);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return results;
|
|
376
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent/master/browser-tests/skills.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,112 +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
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const run_1 = require("../run");
|
|
8
|
-
const fixtures_1 = require("./fixtures");
|
|
9
|
-
fixtures_1.test.describe.configure({ mode: "default" });
|
|
10
|
-
fixtures_1.test.beforeEach(async () => {
|
|
11
|
-
// Setup repo with POM file
|
|
12
|
-
fs_1.default.mkdirSync("pages");
|
|
13
|
-
const pomContent = `
|
|
14
|
-
import type { Page } from "@playwright/test";
|
|
15
|
-
|
|
16
|
-
export async function subscribeToBlog({ page, email }: { page: Page; email: string }) {
|
|
17
|
-
await page.getByPlaceholder("Enter your email").fill(email);
|
|
18
|
-
await page.getByRole("button", { name: "Subscribe" }).click();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function extractTitleForPost({ page, nth }: { page: Page; nth: number }) {
|
|
22
|
-
// nth is zero-indexed
|
|
23
|
-
const title = await page.locator("h2").nth(nth).textContent();
|
|
24
|
-
return title;
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
fs_1.default.writeFileSync("pages/blog.ts", pomContent);
|
|
28
|
-
});
|
|
29
|
-
fixtures_1.test.afterEach(async () => {
|
|
30
|
-
// Clean up the repo in cwd
|
|
31
|
-
fs_1.default.rmSync("pages", { recursive: true });
|
|
32
|
-
});
|
|
33
|
-
(0, fixtures_1.test)("use skills to subscribe to blog", async ({ page, server }) => {
|
|
34
|
-
fixtures_1.test.skip(!run_1.IS_ALLOWED_TO_USE_SKILLS, "Skills are disabled");
|
|
35
|
-
await page.goto(`${server.baseURL}/blog-page.html`);
|
|
36
|
-
const response = await (0, run_1.createTestUsingMasterAgent)({
|
|
37
|
-
task: `subscribe as user@example.com`,
|
|
38
|
-
page,
|
|
39
|
-
testCase: {
|
|
40
|
-
id: 1,
|
|
41
|
-
name: "subscribe to blog",
|
|
42
|
-
steps: ["subscribe as user@example.com"],
|
|
43
|
-
filePath: "blog.spec.ts",
|
|
44
|
-
suites: [],
|
|
45
|
-
},
|
|
46
|
-
options: {},
|
|
47
|
-
});
|
|
48
|
-
// Assert execution was successful
|
|
49
|
-
await (0, fixtures_1.expect)(page.getByText("Thanks for subscribing")).toBeVisible();
|
|
50
|
-
// Assert code generated is correct
|
|
51
|
-
console.log(response);
|
|
52
|
-
(0, fixtures_1.expect)(response.importPaths.length).toBeGreaterThan(0);
|
|
53
|
-
(0, fixtures_1.expect)(response.importPaths[0]).toBe("pages/blog.ts");
|
|
54
|
-
(0, fixtures_1.expect)(response.code.length).toBeGreaterThan(0);
|
|
55
|
-
(0, fixtures_1.expect)(response.code).toMatch(/await.*subscribeToBlog.*page.*email.*user@example\.com/);
|
|
56
|
-
});
|
|
57
|
-
(0, fixtures_1.test)("use skills to extract blog post title", async ({ page, server }) => {
|
|
58
|
-
fixtures_1.test.skip(!run_1.IS_ALLOWED_TO_USE_SKILLS, "Skills are disabled");
|
|
59
|
-
await page.goto(`${server.baseURL}/blog-page.html`);
|
|
60
|
-
const response = await (0, run_1.createTestUsingMasterAgent)({
|
|
61
|
-
// TODO: Extend this to click on "read more" and verify generated code
|
|
62
|
-
// uses the state variable created by the skill
|
|
63
|
-
task: `extract title of 2nd blog post`,
|
|
64
|
-
page,
|
|
65
|
-
testCase: {
|
|
66
|
-
id: 1,
|
|
67
|
-
name: "extract blog post title",
|
|
68
|
-
steps: ["extract title of 2nd blog post"],
|
|
69
|
-
filePath: "blog.spec.ts",
|
|
70
|
-
suites: [],
|
|
71
|
-
},
|
|
72
|
-
options: {},
|
|
73
|
-
});
|
|
74
|
-
// Assert code generated is correct
|
|
75
|
-
console.log(response);
|
|
76
|
-
(0, fixtures_1.expect)(response.importPaths.length).toBeGreaterThan(0);
|
|
77
|
-
(0, fixtures_1.expect)(response.importPaths[0]).toBe("pages/blog.ts");
|
|
78
|
-
(0, fixtures_1.expect)(response.code.length).toBeGreaterThan(0);
|
|
79
|
-
(0, fixtures_1.expect)(response.code).toMatch(/^const.*=.*await extractTitleForPost.*page.*nth:.*1/);
|
|
80
|
-
});
|
|
81
|
-
(0, fixtures_1.test)("use skills to subscribe with multiple pages", async ({ page, server, }) => {
|
|
82
|
-
fixtures_1.test.skip(!run_1.IS_ALLOWED_TO_USE_SKILLS, "Skills are disabled");
|
|
83
|
-
await page.goto(`${server.baseURL}/icons-navbar.html`);
|
|
84
|
-
const blogPage = await page.context().newPage();
|
|
85
|
-
await blogPage.goto(`${server.baseURL}/blog-page.html`);
|
|
86
|
-
const response = await (0, run_1.createTestUsingMasterAgent)({
|
|
87
|
-
task: `we have 2 pages open inside a web browser, and your task is to subscribe as user@example.com on the blogPage`,
|
|
88
|
-
page,
|
|
89
|
-
testCase: {
|
|
90
|
-
id: 1,
|
|
91
|
-
name: "subscribe to blog",
|
|
92
|
-
steps: [
|
|
93
|
-
"we have 2 pages open inside a web browser, and your task is to subscribe as user@example.com on the blogPage",
|
|
94
|
-
],
|
|
95
|
-
filePath: "blog.spec.ts",
|
|
96
|
-
suites: [],
|
|
97
|
-
},
|
|
98
|
-
scopeVars: {
|
|
99
|
-
page,
|
|
100
|
-
blogPage,
|
|
101
|
-
},
|
|
102
|
-
options: {},
|
|
103
|
-
});
|
|
104
|
-
// Assert execution was successful
|
|
105
|
-
await (0, fixtures_1.expect)(blogPage.getByText("Thanks for subscribing")).toBeVisible();
|
|
106
|
-
// Assert code generated is correct
|
|
107
|
-
console.log(response);
|
|
108
|
-
(0, fixtures_1.expect)(response.importPaths.length).toBeGreaterThan(0);
|
|
109
|
-
(0, fixtures_1.expect)(response.importPaths[0]).toBe("pages/blog.ts");
|
|
110
|
-
(0, fixtures_1.expect)(response.code.length).toBeGreaterThan(0);
|
|
111
|
-
(0, fixtures_1.expect)(response.code).toMatch(/await.*subscribeToBlog.*blogPage.*email.*user@example\.com/);
|
|
112
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import { PlaywrightActions } from "../../actions";
|
|
3
|
-
export declare function executeSkillAction({ actions, nextAction, trace, }: {
|
|
4
|
-
actions: PlaywrightActions;
|
|
5
|
-
nextAction: {
|
|
6
|
-
actionType: string;
|
|
7
|
-
toolCallArgs: string;
|
|
8
|
-
};
|
|
9
|
-
trace?: TraceClient | undefined;
|
|
10
|
-
}): Promise<string | undefined>;
|
|
11
|
-
//# sourceMappingURL=execute-skill-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute-skill-action.d.ts","sourceRoot":"","sources":["../../../src/agent/master/execute-skill-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMlD,wBAAsB,kBAAkB,CAAC,EACvC,OAAO,EACP,UAAU,EACV,KAAK,GACN,EAAE;IACD,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACjC,+BAeA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.executeSkillAction = executeSkillAction;
|
|
4
|
-
const skill_1 = require("../../actions/skill");
|
|
5
|
-
const errors_1 = require("../../errors");
|
|
6
|
-
const human_in_the_loop_1 = require("../../human-in-the-loop");
|
|
7
|
-
const env_1 = require("../../utils/env");
|
|
8
|
-
async function executeSkillAction({ actions, nextAction, trace, }) {
|
|
9
|
-
const args = JSON.parse(nextAction.toolCallArgs);
|
|
10
|
-
if (!(0, env_1.isRunningOnCloud)()) {
|
|
11
|
-
const { skillDetails } = (0, skill_1.extractSkillFromArgs)(args);
|
|
12
|
-
const feedback = await human_in_the_loop_1.humanLoop.getFeedback({
|
|
13
|
-
message: `Should I use this skill?\n\n${skillDetails?.usageExample}\n\nfrom: ${skillDetails?.filePath}\n\nAnswer with "yes" or "no"`,
|
|
14
|
-
});
|
|
15
|
-
if (feedback.toLowerCase().trim().includes("no")) {
|
|
16
|
-
throw new errors_1.HumanApprovalDenied("Skill usage approval not provided");
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const code = await actions.executeAction(nextAction.actionType, args, trace);
|
|
20
|
-
if (code) {
|
|
21
|
-
return code;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/agent/video-analysis/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAEtC,qBAAa,yBAA0B,SAAQ,gBAAgB;gBACjD,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,CAAC;CAGzD"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VideoAnalysisToolExecutor = void 0;
|
|
4
|
-
const base_1 = require("../../../tools/executor/base");
|
|
5
|
-
class VideoAnalysisToolExecutor extends base_1.BaseToolExecutor {
|
|
6
|
-
constructor(params) {
|
|
7
|
-
super({ ...params, tools: [] });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.VideoAnalysisToolExecutor = VideoAnalysisToolExecutor;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ToolsForLLM } from "@empiricalrun/shared-types";
|
|
2
|
-
import { BaseAgent } from "../base";
|
|
3
|
-
export declare class VideoAnalysisAgent extends BaseAgent {
|
|
4
|
-
protected getTools(): ToolsForLLM;
|
|
5
|
-
protected buildSystemPrompt(): Promise<string>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/video-analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,SAAS,CAAC,QAAQ,IAAI,WAAW;cAOjB,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;CA+CrD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VideoAnalysisAgent = void 0;
|
|
4
|
-
const base_1 = require("../base");
|
|
5
|
-
class VideoAnalysisAgent extends base_1.BaseAgent {
|
|
6
|
-
getTools() {
|
|
7
|
-
return {
|
|
8
|
-
custom: [],
|
|
9
|
-
builtInTextEditor: false,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async buildSystemPrompt() {
|
|
13
|
-
return `
|
|
14
|
-
You are a video analysis agent specialized in analyzing screen recordings and user interface interactions.
|
|
15
|
-
|
|
16
|
-
You will receive individual video frames with their Frame IDs as user input for detailed visual analysis.
|
|
17
|
-
|
|
18
|
-
When analyzing the provided frames:
|
|
19
|
-
1. Analyze each frame for UI elements, user actions, and state changes
|
|
20
|
-
2. Provide specific observations about what's happening in each frame
|
|
21
|
-
3. The Summary should be in the given XML format
|
|
22
|
-
|
|
23
|
-
Your analysis should be:
|
|
24
|
-
- Detailed and specific about UI elements and interactions
|
|
25
|
-
- Sequential, following the flow of actions in the video
|
|
26
|
-
|
|
27
|
-
CRITICAL: You MUST use the EXACT frame IDs that are provided with each frame. Each frame will be labeled with text like "Frame ID: frame_000000" - use this exact ID in your <key_frame> tags.
|
|
28
|
-
|
|
29
|
-
Note: The Last frame from the attachments should always be included in the <key_frame> tag
|
|
30
|
-
|
|
31
|
-
# Output format
|
|
32
|
-
<summary>
|
|
33
|
-
<section>
|
|
34
|
-
<key_frame>frame_id</key_frame>
|
|
35
|
-
<description>text description of the frame</description>
|
|
36
|
-
</section>
|
|
37
|
-
<section>
|
|
38
|
-
<key_frame>frame_id</key_frame>
|
|
39
|
-
<description>text description of the frame</description>
|
|
40
|
-
</section>
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
<section>
|
|
45
|
-
<key_frame>frame_id</key_frame>
|
|
46
|
-
<description>text description of the frame</description>
|
|
47
|
-
</section>
|
|
48
|
-
</summary>
|
|
49
|
-
|
|
50
|
-
## Example
|
|
51
|
-
If the attachments include "frame_000000.png", "frame_000078.png", and "frame_000156.png", then:
|
|
52
|
-
- To reference the first frame, use: <key_frame>frame_000000</key_frame>
|
|
53
|
-
- To reference the second frame, use: <key_frame>frame_000078</key_frame>
|
|
54
|
-
- To reference the third frame, use: <key_frame>frame_000156</key_frame>
|
|
55
|
-
|
|
56
|
-
WRONG: <key_frame>frame_000001</key_frame> (unless there's actually a file named frame_000001.png in the attachments)
|
|
57
|
-
`;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.VideoAnalysisAgent = VideoAnalysisAgent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"append-create-test-agent.evals.d.ts","sourceRoot":"","sources":["../../src/evals/append-create-test-agent.evals.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA8GpC,QAAA,MAAM,6BAA6B,EAAE,UAsCpC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
|