@empiricalrun/test-gen 0.78.0 → 0.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +0 -10
- package/dist/agent/base/index.d.ts +28 -19
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +25 -14
- package/dist/agent/browsing/run.d.ts +1 -1
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.d.ts +5 -5
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/exports.d.ts +3 -3
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +5 -9
- package/dist/agent/chat/index.d.ts +4 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +10 -5
- package/dist/agent/chat/models.d.ts +1 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +3 -3
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +42 -0
- package/dist/agent/chat/prompt/repo.d.ts +2 -2
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +2 -2
- package/dist/agent/chat/state.d.ts +14 -19
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +10 -45
- package/dist/agent/chat/utils.d.ts +5 -5
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/cli.d.ts +2 -2
- package/dist/agent/cli.d.ts.map +1 -1
- package/dist/agent/cli.js +5 -6
- package/dist/agent/code-review/index.d.ts +4 -3
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +10 -4
- package/dist/agent/code-review/types.d.ts +2 -35
- package/dist/agent/code-review/types.d.ts.map +1 -1
- package/dist/agent/code-review/types.js +4 -11
- package/dist/agent/cua/index.d.ts +1 -1
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +13 -5
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +1 -1
- package/dist/agent/index.d.ts +1 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -11
- package/dist/agent/master/element-annotation.d.ts +1 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/next-action.d.ts +1 -1
- package/dist/agent/master/next-action.d.ts.map +1 -1
- package/dist/agent/master/next-action.js +1 -6
- package/dist/agent/master/run.d.ts +3 -2
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +0 -26
- package/dist/agent/triage/index.d.ts +4 -3
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +31 -20
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/utils.d.ts +1 -1
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/bin/environments.d.ts +1 -1
- package/dist/bin/environments.d.ts.map +1 -1
- package/dist/bin/index.js +2 -2
- package/dist/bin/setup.d.ts +1 -1
- package/dist/bin/setup.d.ts.map +1 -1
- package/dist/bin/utils/fs/index.d.ts +1 -1
- package/dist/bin/utils/fs/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.d.ts +2 -2
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +1 -1
- package/dist/bin/utils/scenarios/index.d.ts +1 -1
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -4
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +0 -6
- package/dist/dashboard/client.d.ts +1 -1
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -1
- package/dist/dashboard/tool-response.d.ts +5 -0
- package/dist/dashboard/tool-response.d.ts.map +1 -0
- package/dist/dashboard/tool-response.js +88 -0
- package/dist/dashboard/totp.js +1 -1
- package/dist/file/server.d.ts +1 -1
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +2 -1
- package/dist/file-info/adapters/file-system/index.d.ts +1 -1
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/index.d.ts +2 -1
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.d.ts +2 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +2 -1
- package/dist/recorder/upload.d.ts +1 -1
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.d.ts +1 -1
- package/dist/tools/analyse-video/index.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.js +20 -13
- package/dist/tools/create-pull-request/index.d.ts +1 -1
- package/dist/tools/create-pull-request/index.d.ts.map +1 -1
- package/dist/tools/create-pull-request/utils.d.ts +2 -1
- package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +9 -19
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.js +12 -25
- package/dist/tools/definitions/delete-file.d.ts +9 -1
- package/dist/tools/definitions/delete-file.d.ts.map +1 -1
- package/dist/tools/definitions/delete-file.js +3 -3
- package/dist/tools/definitions/download-build.d.ts +1 -1
- package/dist/tools/definitions/download-build.d.ts.map +1 -1
- package/dist/tools/definitions/grep.d.ts +1 -1
- package/dist/tools/definitions/grep.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.js +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
- package/dist/tools/definitions/merge-conflicts.js +2 -2
- package/dist/tools/definitions/rename-file.d.ts +1 -1
- package/dist/tools/definitions/rename-file.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.js +1 -1
- package/dist/tools/definitions/run-test.d.ts +1 -1
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
- package/dist/tools/definitions/utils.js +1 -1
- package/dist/tools/delete-file/index.d.ts +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +6 -2
- package/dist/tools/diagnosis-fetcher.d.ts +1 -1
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +92 -47
- package/dist/tools/download-build/index.d.ts +1 -1
- package/dist/tools/download-build/index.d.ts.map +1 -1
- package/dist/tools/executor/base.d.ts +3 -2
- package/dist/tools/executor/base.d.ts.map +1 -1
- package/dist/tools/executor/base.js +5 -8
- package/dist/tools/executor/index.d.ts +3 -0
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +10 -10
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
- package/dist/tools/executor/utils/checkpoint.js +0 -4
- package/dist/tools/executor/utils/git.d.ts +7 -1
- package/dist/tools/executor/utils/git.d.ts.map +1 -1
- package/dist/tools/executor/utils/git.js +10 -3
- package/dist/tools/executor/utils/index.d.ts +1 -2
- package/dist/tools/executor/utils/index.d.ts.map +1 -1
- package/dist/tools/executor/utils/index.js +0 -20
- package/dist/tools/executor/utils/pr-description.d.ts +1 -1
- package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.d.ts +1 -1
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +53 -13
- package/dist/tools/fetch-file/utils.d.ts +3 -0
- package/dist/tools/fetch-file/utils.d.ts.map +1 -0
- package/dist/tools/fetch-file/utils.js +136 -0
- package/dist/tools/fetch-session-diff/index.d.ts +1 -1
- package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
- package/dist/tools/fetch-session-diff/index.js +26 -2
- package/dist/tools/file-operations/create.d.ts +1 -1
- package/dist/tools/file-operations/create.d.ts.map +1 -1
- package/dist/tools/file-operations/index.d.ts +2 -1
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/insert.d.ts +1 -1
- package/dist/tools/file-operations/insert.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.d.ts +1 -1
- package/dist/tools/file-operations/replace.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.js +0 -1
- package/dist/tools/file-operations/view/index.d.ts +2 -1
- package/dist/tools/file-operations/view/index.d.ts.map +1 -1
- package/dist/tools/grep/index.d.ts +1 -1
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +15 -12
- package/dist/tools/index.d.ts +3 -24
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +13 -42
- package/dist/tools/issues-v1/create-issue.d.ts +3 -0
- package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
- package/dist/tools/issues-v1/index.d.ts.map +1 -0
- package/dist/tools/issues-v1/list-issues.d.ts +3 -0
- package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
- package/dist/tools/issues-v1/update-issue.d.ts +3 -0
- package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
- package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
- package/dist/tools/issues-v1/utils.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.d.ts +3 -0
- package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.js +86 -0
- package/dist/tools/issues-v2/update-issue.d.ts +3 -0
- package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/update-issue.js +87 -0
- package/dist/tools/list-environments.d.ts +1 -1
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.js +14 -4
- package/dist/tools/merge-conflicts/index.d.ts +1 -1
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +23 -10
- package/dist/tools/rename-file/index.d.ts +1 -1
- package/dist/tools/rename-file/index.d.ts.map +1 -1
- package/dist/tools/rename-file/index.js +0 -1
- package/dist/tools/review-pull-request/index.d.ts +1 -1
- package/dist/tools/review-pull-request/index.d.ts.map +1 -1
- package/dist/tools/review-pull-request/index.js +5 -4
- package/dist/tools/run-test.d.ts +1 -1
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.d.ts +1 -1
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +55 -19
- package/dist/tools/test-run-fetcher/index.d.ts +2 -2
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +67 -66
- package/dist/tools/trace-dot-zip/index.d.ts +1 -1
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
- package/dist/tools/triage-summary/index.d.ts +1 -1
- package/dist/tools/triage-summary/index.d.ts.map +1 -1
- package/dist/tools/triage-summary/index.js +5 -2
- package/dist/tools/triage-summary/utils.d.ts +1 -1
- package/dist/tools/triage-summary/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.d.ts +1 -1
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +14 -8
- package/dist/tools/upgrade-packages/utils.d.ts +9 -5
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/utils.js +56 -16
- package/dist/tools/utils/queue.d.ts +1 -1
- package/dist/tools/utils/queue.d.ts.map +1 -1
- package/dist/tools/utils/validate-schema.d.ts +3 -0
- package/dist/tools/utils/validate-schema.d.ts.map +1 -0
- package/dist/tools/utils/validate-schema.js +22 -0
- package/dist/utils/SQSClient.d.ts +1 -1
- package/dist/utils/SQSClient.d.ts.map +1 -1
- package/dist/utils/dedup/dedup-image.js +2 -2
- package/dist/utils/dedup/find-threshold.d.ts +1 -1
- package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
- package/dist/utils/dedup/find-threshold.js +2 -2
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +4 -3
- package/dist/utils/playwright-report-parser.d.ts +1 -1
- package/dist/utils/playwright-report-parser.d.ts.map +1 -1
- package/dist/utils/playwright-test-id.d.ts +8 -0
- package/dist/utils/playwright-test-id.d.ts.map +1 -0
- package/dist/utils/playwright-test-id.js +21 -0
- package/dist/utils/repo-tree.d.ts +1 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +15 -4
- package/dist/utils/url-validation.d.ts +2 -0
- package/dist/utils/url-validation.d.ts.map +1 -0
- package/dist/utils/url-validation.js +16 -0
- package/dist/video-core/index.d.ts +7 -24
- package/dist/video-core/index.d.ts.map +1 -1
- package/dist/video-core/index.js +32 -25
- package/dist/video-core/model-limits.d.ts +2 -2
- package/dist/video-core/model-limits.d.ts.map +1 -1
- package/dist/video-core/model-limits.js +9 -19
- package/dist/video-core/storage-manager.d.ts +2 -1
- package/dist/video-core/storage-manager.d.ts.map +1 -1
- package/dist/video-core/types.d.ts +1 -1
- package/dist/video-core/types.d.ts.map +1 -1
- package/dist/video-core/utils.d.ts +5 -7
- package/dist/video-core/utils.d.ts.map +1 -1
- package/dist/video-core/utils.js +39 -132
- package/package.json +8 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/actions/skill.d.ts +0 -21
- package/dist/actions/skill.d.ts.map +0 -1
- package/dist/actions/skill.js +0 -127
- package/dist/agent/chat/filesystem-cache.d.ts +0 -12
- package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
- package/dist/agent/chat/filesystem-cache.js +0 -101
- package/dist/agent/codegen/create-test-block.d.ts +0 -8
- package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
- package/dist/agent/codegen/create-test-block.js +0 -47
- package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
- package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
- package/dist/agent/codegen/fix-ts-errors.js +0 -78
- package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
- package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
- package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
- package/dist/agent/codegen/skills-retriever.d.ts +0 -26
- package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
- package/dist/agent/codegen/skills-retriever.js +0 -93
- package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
- package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
- package/dist/agent/codegen/test-update-feedback.js +0 -49
- package/dist/agent/codegen/types.d.ts +0 -25
- package/dist/agent/codegen/types.d.ts.map +0 -1
- package/dist/agent/codegen/types.js +0 -8
- package/dist/agent/codegen/update-flow.d.ts +0 -36
- package/dist/agent/codegen/update-flow.d.ts.map +0 -1
- package/dist/agent/codegen/update-flow.js +0 -259
- package/dist/agent/codegen/use-skill.d.ts +0 -11
- package/dist/agent/codegen/use-skill.d.ts.map +0 -1
- package/dist/agent/codegen/use-skill.js +0 -53
- package/dist/agent/codegen/utils.d.ts +0 -110
- package/dist/agent/codegen/utils.d.ts.map +0 -1
- package/dist/agent/codegen/utils.js +0 -376
- package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
- package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
- package/dist/agent/master/browser-tests/skills.spec.js +0 -112
- package/dist/agent/master/execute-skill-action.d.ts +0 -11
- package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
- package/dist/agent/master/execute-skill-action.js +0 -23
- package/dist/agent/video-analysis/executor/index.d.ts +0 -5
- package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/executor/index.js +0 -10
- package/dist/agent/video-analysis/index.d.ts +0 -7
- package/dist/agent/video-analysis/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/index.js +0 -60
- package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
- package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
- package/dist/evals/append-create-test-agent.evals.js +0 -117
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
- package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
- package/dist/evals/master-agent.evals.d.ts +0 -4
- package/dist/evals/master-agent.evals.d.ts.map +0 -1
- package/dist/evals/master-agent.evals.js +0 -35
- package/dist/evals/type.d.ts +0 -12
- package/dist/evals/type.d.ts.map +0 -1
- package/dist/evals/type.js +0 -2
- package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
- package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
- package/dist/evals/update-scenario-agent.evals.js +0 -47
- package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
- package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
- package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
- package/dist/tools/issues/create-issue.d.ts +0 -3
- package/dist/tools/issues/create-issue.d.ts.map +0 -1
- package/dist/tools/issues/index.d.ts.map +0 -1
- package/dist/tools/issues/list-issues.d.ts +0 -3
- package/dist/tools/issues/list-issues.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.d.ts +0 -24
- package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.js +0 -22
- package/dist/tools/issues/update-issue.d.ts +0 -3
- package/dist/tools/issues/update-issue.d.ts.map +0 -1
- package/dist/tools/issues/utils.d.ts.map +0 -1
- package/dist/tools/utils/urls.d.ts +0 -5
- package/dist/tools/utils/urls.d.ts.map +0 -1
- package/dist/tools/utils/urls.js +0 -19
- package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
- package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
- package/dist/tools/view-failed-test-run-report/index.js +0 -151
- package/dist/video-core/agent-orchestrator.d.ts +0 -13
- package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
- package/dist/video-core/agent-orchestrator.js +0 -59
- package/dist/video-core/xml-parser.d.ts +0 -3
- package/dist/video-core/xml-parser.d.ts.map +0 -1
- package/dist/video-core/xml-parser.js +0 -27
- /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
- /package/dist/tools/{issues → issues-v1}/index.js +0 -0
- /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
- /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
package/dist/video-core/utils.js
CHANGED
|
@@ -1,103 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
3
|
+
exports.getR2BaseUrlByHash = void 0;
|
|
4
|
+
exports.formatSecondsToTimestamp = formatSecondsToTimestamp;
|
|
5
|
+
exports.formatTimestampToSeconds = formatTimestampToSeconds;
|
|
8
6
|
exports.createInterleavedResults = createInterleavedResults;
|
|
9
7
|
exports.validateVideoAccess = validateVideoAccess;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const sections = [];
|
|
19
|
-
try {
|
|
20
|
-
// Find the summary block first to limit parsing scope
|
|
21
|
-
const summaryMatch = xmlContent.match(/<summary>([\s\S]*?)<\/summary>/);
|
|
22
|
-
if (!summaryMatch) {
|
|
23
|
-
return sections;
|
|
24
|
-
}
|
|
25
|
-
const summaryContent = summaryMatch[1];
|
|
26
|
-
if (!summaryContent) {
|
|
27
|
-
return sections;
|
|
28
|
-
}
|
|
29
|
-
// Extract all section blocks using matchAll to avoid infinite loop
|
|
30
|
-
const sectionMatches = Array.from(summaryContent.matchAll(/<section>([\s\S]*?)<\/section>/g) || []);
|
|
31
|
-
for (const sectionMatch of sectionMatches) {
|
|
32
|
-
const sectionContent = sectionMatch?.[1];
|
|
33
|
-
if (!sectionContent)
|
|
34
|
-
continue;
|
|
35
|
-
const keyFrameMatch = sectionContent.match(/<key_frame>(.*?)<\/key_frame>/);
|
|
36
|
-
const descriptionMatch = sectionContent.match(/<description>(.*?)<\/description>/);
|
|
37
|
-
if (keyFrameMatch?.[1] && descriptionMatch?.[1]) {
|
|
38
|
-
sections.push({
|
|
39
|
-
key_frame: keyFrameMatch[1].trim(),
|
|
40
|
-
description: descriptionMatch[1].trim(),
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (error) { }
|
|
46
|
-
return sections;
|
|
47
|
-
};
|
|
48
|
-
exports.parseXmlSummaryToJson = parseXmlSummaryToJson;
|
|
49
|
-
async function fileExists(filePath) {
|
|
50
|
-
return fs_1.promises
|
|
51
|
-
.access(filePath)
|
|
52
|
-
.then(() => true)
|
|
53
|
-
.catch(() => false);
|
|
54
|
-
}
|
|
55
|
-
// Try unique_frames directory first, then consolidated_frames as fallback
|
|
56
|
-
async function findFramePath(frameId, baseDir) {
|
|
57
|
-
const uniqueFramePath = path_1.default.join(baseDir, "unique_frames", `${frameId}.png`);
|
|
58
|
-
const consolidatedFramePath = path_1.default.join(baseDir, "frames", `${frameId}.png`);
|
|
59
|
-
if (await fileExists(uniqueFramePath)) {
|
|
60
|
-
return uniqueFramePath;
|
|
8
|
+
function formatSecondsToTimestamp(seconds) {
|
|
9
|
+
if (seconds === undefined)
|
|
10
|
+
return "N/A";
|
|
11
|
+
const hours = Math.floor(seconds / 3600);
|
|
12
|
+
const minutes = Math.floor((seconds % 3600) / 60);
|
|
13
|
+
const secs = Math.floor(seconds % 60);
|
|
14
|
+
if (hours > 0) {
|
|
15
|
+
return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
61
16
|
}
|
|
62
|
-
|
|
63
|
-
return consolidatedFramePath;
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
async function loadFrameImage(framePath) {
|
|
68
|
-
const imageBuffer = await fs_1.promises.readFile(framePath);
|
|
69
|
-
const base64Data = imageBuffer.toString("base64");
|
|
70
|
-
return {
|
|
71
|
-
type: "image/png",
|
|
72
|
-
base64Data: base64Data,
|
|
73
|
-
};
|
|
17
|
+
return `${minutes}:${secs.toString().padStart(2, "0")}`;
|
|
74
18
|
}
|
|
75
|
-
|
|
19
|
+
function formatTimestampToSeconds(timestamp) {
|
|
76
20
|
try {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
21
|
+
const parts = timestamp.split(":").map((value) => {
|
|
22
|
+
const num = parseFloat(value);
|
|
23
|
+
if (isNaN(num)) {
|
|
24
|
+
throw new Error(`Invalid numeric value in timestamp: "${value}"`);
|
|
25
|
+
}
|
|
26
|
+
return num;
|
|
27
|
+
});
|
|
28
|
+
if (parts.length === 1) {
|
|
29
|
+
// Just seconds: "30" or "30.5"
|
|
30
|
+
return parts[0] ?? 0;
|
|
80
31
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
32
|
+
else if (parts.length === 2) {
|
|
33
|
+
// MM:SS format: "1:30" or "1:30.5"
|
|
34
|
+
const [minutes, seconds] = parts;
|
|
35
|
+
return (minutes ?? 0) * 60 + (seconds ?? 0);
|
|
36
|
+
}
|
|
37
|
+
else if (parts.length === 3) {
|
|
38
|
+
// HH:MM:SS format: "1:30:45" or "1:30:45.5"
|
|
39
|
+
const [hours, minutes, seconds] = parts;
|
|
40
|
+
return (hours ?? 0) * 3600 + (minutes ?? 0) * 60 + (seconds ?? 0);
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`Invalid timestamp format: ${timestamp}. Expected format: SS, MM:SS, or HH:MM:SS`);
|
|
86
43
|
}
|
|
87
44
|
catch (error) {
|
|
88
|
-
|
|
45
|
+
throw new Error(`Invalid timestamp format: ${timestamp}. Expected format: SS, MM:SS, or HH:MM:SS`);
|
|
89
46
|
}
|
|
90
47
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.filter((part) => part !== null)
|
|
96
|
-
.forEach(({ frameId, imageData }) => {
|
|
97
|
-
frameImageMap.set(frameId, imageData);
|
|
98
|
-
});
|
|
99
|
-
return frameImageMap;
|
|
100
|
-
}
|
|
48
|
+
const getR2BaseUrlByHash = (videoUrlHash) => {
|
|
49
|
+
return `https://video-analysis.empirical.run/${videoUrlHash}/`;
|
|
50
|
+
};
|
|
51
|
+
exports.getR2BaseUrlByHash = getR2BaseUrlByHash;
|
|
101
52
|
function createInterleavedResults(parsedAnalysis, uniqueFrameInfos) {
|
|
102
53
|
const interleavedResults = [];
|
|
103
54
|
if (parsedAnalysis && Array.isArray(parsedAnalysis)) {
|
|
@@ -148,47 +99,3 @@ async function validateVideoAccess(videoUrl) {
|
|
|
148
99
|
};
|
|
149
100
|
}
|
|
150
101
|
}
|
|
151
|
-
async function downloadVideo(videoUrl, outputPath) {
|
|
152
|
-
if (await fileExists(outputPath)) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
const response = await fetch(videoUrl);
|
|
156
|
-
if (!response.ok) {
|
|
157
|
-
throw new Error(`Failed to download video: ${response.statusText}`);
|
|
158
|
-
}
|
|
159
|
-
const contentLength = response.headers.get("content-length");
|
|
160
|
-
const totalSize = contentLength ? parseInt(contentLength, 10) : 0;
|
|
161
|
-
if (!response.body) {
|
|
162
|
-
throw new Error("Response body is null");
|
|
163
|
-
}
|
|
164
|
-
const reader = response.body.getReader();
|
|
165
|
-
const chunks = [];
|
|
166
|
-
let downloadedSize = 0;
|
|
167
|
-
const startTime = Date.now();
|
|
168
|
-
while (true) {
|
|
169
|
-
const { done, value } = await reader.read();
|
|
170
|
-
if (done)
|
|
171
|
-
break;
|
|
172
|
-
chunks.push(value);
|
|
173
|
-
downloadedSize += value.length;
|
|
174
|
-
const elapsedSeconds = (Date.now() - startTime) / 1000;
|
|
175
|
-
const speed = elapsedSeconds > 0 ? downloadedSize / elapsedSeconds : 0;
|
|
176
|
-
const speedMBps = (speed / 1024 / 1024).toFixed(1);
|
|
177
|
-
if (totalSize > 0) {
|
|
178
|
-
const percentage = Math.round((downloadedSize / totalSize) * 100);
|
|
179
|
-
const progressBar = "█".repeat(Math.floor(percentage / 5)) +
|
|
180
|
-
"░".repeat(20 - Math.floor(percentage / 5));
|
|
181
|
-
process.stdout.write(`\r[${progressBar}] ${percentage}% (${(downloadedSize / 1024 / 1024).toFixed(1)} MB) ${speedMBps} MB/s`);
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
process.stdout.write(`\rDownloaded: ${(downloadedSize / 1024 / 1024).toFixed(1)} MB @ ${speedMBps} MB/s`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const buffer = new Uint8Array(downloadedSize);
|
|
188
|
-
let offset = 0;
|
|
189
|
-
for (const chunk of chunks) {
|
|
190
|
-
buffer.set(chunk, offset);
|
|
191
|
-
offset += chunk.length;
|
|
192
|
-
}
|
|
193
|
-
await fs_1.promises.writeFile(outputPath, buffer);
|
|
194
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.78.
|
|
3
|
+
"version": "0.78.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@babel/parser": "^7.26.3",
|
|
57
57
|
"@epic-web/totp": "^4.0.1",
|
|
58
|
+
"@jsquash/jpeg": "^1.6.0",
|
|
59
|
+
"@jsquash/png": "^3.1.1",
|
|
60
|
+
"@jsquash/resize": "^2.1.0",
|
|
61
|
+
"@jsquash/webp": "^1.5.0",
|
|
58
62
|
"@types/sanitize-html": "^2.11.0",
|
|
59
63
|
"async-retry": "^1.3.3",
|
|
60
64
|
"commander": "^12.1.0",
|
|
@@ -81,13 +85,13 @@
|
|
|
81
85
|
"ts-morph": "^23.0.0",
|
|
82
86
|
"tsx": "^4.16.2",
|
|
83
87
|
"typescript": "^5.3.3",
|
|
84
|
-
"videostil": "^0.1.2",
|
|
85
88
|
"yauzl": "^3.1.3",
|
|
86
89
|
"zod": "^3.23.8",
|
|
87
90
|
"@empiricalrun/ast-parser": "^0.0.10",
|
|
88
|
-
"@empiricalrun/llm": "^0.
|
|
91
|
+
"@empiricalrun/llm": "^0.25.0",
|
|
89
92
|
"@empiricalrun/r2-uploader": "^0.4.0",
|
|
90
|
-
"@empiricalrun/test-run": "^0.11.1"
|
|
93
|
+
"@empiricalrun/test-run": "^0.11.1",
|
|
94
|
+
"videostil": "0.3.2"
|
|
91
95
|
},
|
|
92
96
|
"devDependencies": {
|
|
93
97
|
"@playwright/test": "1.53.2",
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/logger.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/
|
|
1
|
+
{"root":["./src/index.ts","./src/logger.ts","./src/actions/assert.ts","./src/actions/click.ts","./src/actions/done.ts","./src/actions/fill.ts","./src/actions/goto.ts","./src/actions/hover.ts","./src/actions/index.ts","./src/actions/next-task.ts","./src/actions/press.ts","./src/actions/text-content.ts","./src/actions/constants/index.ts","./src/actions/utils/index.ts","./src/agent/cli.ts","./src/agent/index.ts","./src/agent/base/index.ts","./src/agent/browsing/index.ts","./src/agent/browsing/run.ts","./src/agent/browsing/utils.ts","./src/agent/chat/agent-loop.ts","./src/agent/chat/exports.ts","./src/agent/chat/index.ts","./src/agent/chat/models.ts","./src/agent/chat/state.ts","./src/agent/chat/types.ts","./src/agent/chat/utils.ts","./src/agent/chat/prompt/pw-utils-docs.ts","./src/agent/chat/prompt/repo.ts","./src/agent/chat/prompt/test-case-def.ts","./src/agent/code-review/index.ts","./src/agent/code-review/parser.ts","./src/agent/code-review/types.ts","./src/agent/code-review/executor/index.ts","./src/agent/cua/computer.ts","./src/agent/cua/index.ts","./src/agent/cua/model.ts","./src/agent/cua/pw-codegen/element-from-point.ts","./src/agent/cua/pw-codegen/types.ts","./src/agent/cua/pw-codegen/pw-pause/for-recorder.ts","./src/agent/cua/pw-codegen/pw-pause/index.ts","./src/agent/cua/pw-codegen/pw-pause/ipc.ts","./src/agent/cua/pw-codegen/pw-pause/patch.ts","./src/agent/cua/pw-codegen/pw-pause/types.ts","./src/agent/cua/pw-codegen/pw-pause/utils.ts","./src/agent/master/action-tool-calls.ts","./src/agent/master/element-annotation.ts","./src/agent/master/execute-browser-action.ts","./src/agent/master/next-action.ts","./src/agent/master/planner.ts","./src/agent/master/run.ts","./src/agent/master/scroller.ts","./src/agent/master/with-hints.ts","./src/agent/master/browser-tests/cua.spec.ts","./src/agent/master/browser-tests/fixtures.ts","./src/agent/master/browser-tests/index.spec.ts","./src/agent/master/icon-descriptor/index.ts","./src/agent/master/icon-descriptor/normalize-svg.ts","./src/agent/planner/run-time-planner.ts","./src/agent/planner/run.ts","./src/agent/triage/index.ts","./src/artifacts/index.ts","./src/artifacts/utils.ts","./src/auth/cli-auth.ts","./src/auth/index.ts","./src/auth/token-store.ts","./src/bin/environments.ts","./src/bin/index.ts","./src/bin/setup.ts","./src/bin/logger/index.ts","./src/bin/utils/context.ts","./src/bin/utils/index.ts","./src/bin/utils/fs/index.ts","./src/bin/utils/platform/web/index.ts","./src/bin/utils/platform/web/test-files/ts-path-import-validate.ts","./src/bin/utils/scenarios/index.ts","./src/browser-injected-scripts/annotate-elements.spec.ts","./src/constants/index.ts","./src/dashboard/client.ts","./src/dashboard/index.ts","./src/dashboard/tool-response.ts","./src/dashboard/totp.ts","./src/dashboard/types.ts","./src/errors/index.ts","./src/file/client.ts","./src/file/server.ts","./src/file-info/index.ts","./src/file-info/adapters/file-system/index.ts","./src/file-info/adapters/file-system/reader.ts","./src/file-info/adapters/github/index.ts","./src/file-info/adapters/github/reader.ts","./src/human-in-the-loop/cli.ts","./src/human-in-the-loop/index.ts","./src/human-in-the-loop/ipc.ts","./src/page/index.ts","./src/prompts/lib/ts-transformer.ts","./src/recorder/env-variables.ts","./src/recorder/index.ts","./src/recorder/request.ts","./src/recorder/temp-files.ts","./src/recorder/upload.ts","./src/recorder/validation.ts","./src/test-build/index.ts","./src/tools/diagnosis-fetcher.ts","./src/tools/index.ts","./src/tools/list-environments.ts","./src/tools/run-test.ts","./src/tools/test-gen-browser.ts","./src/tools/analyse-video/index.ts","./src/tools/create-pull-request/index.ts","./src/tools/create-pull-request/utils.ts","./src/tools/definitions/analyse-video.ts","./src/tools/definitions/delete-file.ts","./src/tools/definitions/download-build.ts","./src/tools/definitions/grep.ts","./src/tools/definitions/list-tests-and-projects.ts","./src/tools/definitions/merge-conflicts.ts","./src/tools/definitions/rename-file.ts","./src/tools/definitions/review-pull-request.ts","./src/tools/definitions/run-test.ts","./src/tools/definitions/str_replace_editor.ts","./src/tools/definitions/test-gen-browser.ts","./src/tools/definitions/upgrade-packages.ts","./src/tools/definitions/utils.ts","./src/tools/delete-file/index.ts","./src/tools/download-build/index.ts","./src/tools/executor/base.ts","./src/tools/executor/index.ts","./src/tools/executor/utils/checkpoint.ts","./src/tools/executor/utils/git.ts","./src/tools/executor/utils/index.ts","./src/tools/executor/utils/pr-description.ts","./src/tools/fetch-file/index.ts","./src/tools/fetch-file/utils.ts","./src/tools/fetch-session-diff/index.ts","./src/tools/file-operations/create.ts","./src/tools/file-operations/index.ts","./src/tools/file-operations/insert.ts","./src/tools/file-operations/replace.ts","./src/tools/file-operations/shared/helpers.ts","./src/tools/file-operations/view/index.ts","./src/tools/grep/index.ts","./src/tools/grep/types.ts","./src/tools/grep/ripgrep/index.ts","./src/tools/issues-v1/create-issue.ts","./src/tools/issues-v1/index.ts","./src/tools/issues-v1/list-issues.ts","./src/tools/issues-v1/update-issue.ts","./src/tools/issues-v1/utils.ts","./src/tools/issues-v2/create-issue.ts","./src/tools/issues-v2/update-issue.ts","./src/tools/list-tests-and-projects/index.ts","./src/tools/merge-conflicts/index.ts","./src/tools/rename-file/index.ts","./src/tools/review-pull-request/index.ts","./src/tools/test-run-fetcher/index.ts","./src/tools/test-run-fetcher/types.ts","./src/tools/trace-dot-zip/index.ts","./src/tools/trace-dot-zip/types.ts","./src/tools/trace-dot-zip/utils/console-trace.ts","./src/tools/trace-dot-zip/utils/extract-zip.ts","./src/tools/trace-dot-zip/utils/network-trace.ts","./src/tools/triage-summary/index.ts","./src/tools/triage-summary/types.ts","./src/tools/triage-summary/utils.ts","./src/tools/upgrade-packages/index.ts","./src/tools/upgrade-packages/utils.ts","./src/tools/utils/queue.ts","./src/tools/utils/validate-schema.ts","./src/trace-utils/index.ts","./src/types/handlebars.d.ts","./src/types/index.ts","./src/utils/SQSClient.ts","./src/utils/env.ts","./src/utils/exec.ts","./src/utils/file.ts","./src/utils/hash.ts","./src/utils/html.ts","./src/utils/index.ts","./src/utils/json.ts","./src/utils/model.ts","./src/utils/playwright-report-parser.ts","./src/utils/playwright-test-id.ts","./src/utils/repo-tree.ts","./src/utils/slug.ts","./src/utils/string.ts","./src/utils/stripAnsi.ts","./src/utils/url-validation.ts","./src/utils/dedup/dedup-image.ts","./src/utils/dedup/find-threshold.ts","./src/video-core/index.ts","./src/video-core/model-limits.ts","./src/video-core/storage-manager.ts","./src/video-core/types.ts","./src/video-core/utils.ts"],"version":"5.8.3"}
|
package/dist/actions/skill.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PlaywrightActionGenerator, SkillActionArgs } from "../types";
|
|
2
|
-
export declare const SKILL_USAGE = "skill_usage";
|
|
3
|
-
export type Skill = {
|
|
4
|
-
testStep: string;
|
|
5
|
-
filePath: string;
|
|
6
|
-
usageExample: string;
|
|
7
|
-
reason: string;
|
|
8
|
-
};
|
|
9
|
-
declare class TestCaseSkills {
|
|
10
|
-
private skills;
|
|
11
|
-
constructor(skills: Skill[]);
|
|
12
|
-
getAvailableSkills(): Skill[];
|
|
13
|
-
updateSkills(skills: Skill[]): void;
|
|
14
|
-
}
|
|
15
|
-
export declare const testCaseSkills: TestCaseSkills;
|
|
16
|
-
export declare function extractSkillFromArgs(args: Record<string, any>): {
|
|
17
|
-
skillDetails: Skill | undefined;
|
|
18
|
-
};
|
|
19
|
-
export declare const skillActionGenerator: PlaywrightActionGenerator<SkillActionArgs>;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/actions/skill.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtE,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,cAAM,cAAc;IACN,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,KAAK,EAAE;IAEnC,kBAAkB;IAIlB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE;CAG7B;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;EAO7D;AAED,eAAO,MAAM,oBAAoB,EAAE,yBAAyB,CAC1D,eAAe,CAkHhB,CAAC"}
|
package/dist/actions/skill.js
DELETED
|
@@ -1,127 +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.skillActionGenerator = exports.testCaseSkills = exports.SKILL_USAGE = void 0;
|
|
7
|
-
exports.extractSkillFromArgs = extractSkillFromArgs;
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
-
const api_1 = __importDefault(require("tsx/cjs/api"));
|
|
10
|
-
const use_skill_1 = require("../agent/codegen/use-skill");
|
|
11
|
-
const web_1 = require("../bin/utils/platform/web");
|
|
12
|
-
exports.SKILL_USAGE = "skill_usage";
|
|
13
|
-
class TestCaseSkills {
|
|
14
|
-
skills;
|
|
15
|
-
constructor(skills) {
|
|
16
|
-
this.skills = skills;
|
|
17
|
-
}
|
|
18
|
-
getAvailableSkills() {
|
|
19
|
-
return this.skills;
|
|
20
|
-
}
|
|
21
|
-
updateSkills(skills) {
|
|
22
|
-
this.skills = skills;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.testCaseSkills = new TestCaseSkills([]);
|
|
26
|
-
function extractSkillFromArgs(args) {
|
|
27
|
-
const availableSkills = exports.testCaseSkills.getAvailableSkills();
|
|
28
|
-
const { skill } = args;
|
|
29
|
-
const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
|
|
30
|
-
return { skillDetails };
|
|
31
|
-
}
|
|
32
|
-
const skillActionGenerator = (page, options) => {
|
|
33
|
-
const availableSkills = exports.testCaseSkills.getAvailableSkills();
|
|
34
|
-
return {
|
|
35
|
-
execute: async ({ args, trace }) => {
|
|
36
|
-
const { skill, action } = args;
|
|
37
|
-
const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
|
|
38
|
-
if (!skillDetails) {
|
|
39
|
-
throw new Error(`No skill found for ${skill}`);
|
|
40
|
-
}
|
|
41
|
-
const skillFilePath = skillDetails.filePath;
|
|
42
|
-
// This assumes repoDir is process.cwd()
|
|
43
|
-
const [lastDir] = process.cwd().split("/").reverse();
|
|
44
|
-
const dir = `${process.cwd()}/${lastDir}`;
|
|
45
|
-
const module = await api_1.default.require(`./${skillFilePath}`, dir);
|
|
46
|
-
const skillFile = await promises_1.default.readFile(skillFilePath, "utf-8");
|
|
47
|
-
const imports = Object.keys(module);
|
|
48
|
-
const code = await (0, use_skill_1.generateSkillUsageCode)({
|
|
49
|
-
task: action,
|
|
50
|
-
sampleUsageMethod: skillDetails.usageExample,
|
|
51
|
-
importPathForSkill: skillFilePath,
|
|
52
|
-
scopeVariablesMapStr: JSON.stringify(options.stateVariables || {}, null, 2),
|
|
53
|
-
pageVariableName: page.name,
|
|
54
|
-
skillMethodDefinition: skillFile,
|
|
55
|
-
trace,
|
|
56
|
-
});
|
|
57
|
-
console.log("Usage code generated", code);
|
|
58
|
-
const stateVarKeys = Object.keys(options.stateVariables || {});
|
|
59
|
-
const newVariablesSpan = trace?.span({
|
|
60
|
-
name: "new-state-variables",
|
|
61
|
-
});
|
|
62
|
-
const newVariables = (0, web_1.getVariableDeclarationsFromCode)(code);
|
|
63
|
-
newVariablesSpan?.end({
|
|
64
|
-
output: {
|
|
65
|
-
newVariables,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
const exec = new Function(page.name, ...imports, ...stateVarKeys,
|
|
69
|
-
// assuming all POMs are async methods and the LLM should respond with await keyword
|
|
70
|
-
`
|
|
71
|
-
return (async () => {
|
|
72
|
-
${code}
|
|
73
|
-
return {
|
|
74
|
-
${newVariables.join(",")}
|
|
75
|
-
}
|
|
76
|
-
})()`);
|
|
77
|
-
// extract the state variables after execution
|
|
78
|
-
const newStateVariables = await exec(page.pwPageInstance, ...imports.map((i) => module[i]), ...stateVarKeys.map((s) => options.stateVariables[s]));
|
|
79
|
-
options.setStateVariables({
|
|
80
|
-
...options.stateVariables,
|
|
81
|
-
...newStateVariables,
|
|
82
|
-
});
|
|
83
|
-
return {
|
|
84
|
-
locator: code,
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
template: (args, options) => {
|
|
88
|
-
const code = `${options.locator}`;
|
|
89
|
-
const skill = args.skill;
|
|
90
|
-
const [skillDetails] = availableSkills.filter((skillDetails) => skillDetails.testStep === skill);
|
|
91
|
-
return {
|
|
92
|
-
code,
|
|
93
|
-
importPath: skillDetails?.filePath,
|
|
94
|
-
};
|
|
95
|
-
},
|
|
96
|
-
name: exports.SKILL_USAGE,
|
|
97
|
-
schema: {
|
|
98
|
-
type: "function",
|
|
99
|
-
function: {
|
|
100
|
-
name: exports.SKILL_USAGE,
|
|
101
|
-
description: "Ability to use already defined skills in the form of page object models to execute a particular task.",
|
|
102
|
-
parameters: {
|
|
103
|
-
type: "object",
|
|
104
|
-
properties: {
|
|
105
|
-
reason: {
|
|
106
|
-
type: "string",
|
|
107
|
-
description: "Explain how this action will help to complete the task. The reason should align with the task provided",
|
|
108
|
-
},
|
|
109
|
-
action: {
|
|
110
|
-
type: "string",
|
|
111
|
-
description: "Explain the action for which this skill needs to be used. Mention all details about the action so that it could be used by the skill",
|
|
112
|
-
},
|
|
113
|
-
skill: {
|
|
114
|
-
type: "string",
|
|
115
|
-
enum: availableSkills.map((skill) => skill.testStep),
|
|
116
|
-
description: `skill to use. Choose one of the available skills: ${availableSkills
|
|
117
|
-
.map((skill) => skill.testStep)
|
|
118
|
-
.join(", ")}`,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
required: ["reason", "action", "skill"],
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
exports.skillActionGenerator = skillActionGenerator;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LLMCache } from "@empiricalrun/llm/chat";
|
|
2
|
-
export declare class FilesystemLLMCache implements LLMCache {
|
|
3
|
-
private cacheDir;
|
|
4
|
-
constructor(cacheDir?: string);
|
|
5
|
-
private ensureCacheDir;
|
|
6
|
-
private getCacheFilePath;
|
|
7
|
-
get(key: string): Promise<string | null>;
|
|
8
|
-
set(key: string, value: string): Promise<void>;
|
|
9
|
-
clear(): Promise<void>;
|
|
10
|
-
size(): Promise<number>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=filesystem-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-cache.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/filesystem-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKlD,qBAAa,kBAAmB,YAAW,QAAQ;IACjD,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,CAAC,EAAE,MAAM;YAIf,cAAc;IAQ5B,OAAO,CAAC,gBAAgB;IAKlB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAWxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IActB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;CAS9B"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.FilesystemLLMCache = void 0;
|
|
37
|
-
const crypto = __importStar(require("crypto"));
|
|
38
|
-
const fs = __importStar(require("fs/promises"));
|
|
39
|
-
const path = __importStar(require("path"));
|
|
40
|
-
class FilesystemLLMCache {
|
|
41
|
-
cacheDir;
|
|
42
|
-
constructor(cacheDir) {
|
|
43
|
-
this.cacheDir = cacheDir || path.join(process.cwd(), ".llm-cache");
|
|
44
|
-
}
|
|
45
|
-
async ensureCacheDir() {
|
|
46
|
-
try {
|
|
47
|
-
await fs.access(this.cacheDir);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
await fs.mkdir(this.cacheDir, { recursive: true });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
getCacheFilePath(key) {
|
|
54
|
-
const hash = crypto.createHash("sha256").update(key).digest("hex");
|
|
55
|
-
return path.join(this.cacheDir, `${hash}.json`);
|
|
56
|
-
}
|
|
57
|
-
async get(key) {
|
|
58
|
-
try {
|
|
59
|
-
await this.ensureCacheDir();
|
|
60
|
-
const filePath = this.getCacheFilePath(key);
|
|
61
|
-
const data = await fs.readFile(filePath, "utf-8");
|
|
62
|
-
return data;
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async set(key, value) {
|
|
69
|
-
try {
|
|
70
|
-
await this.ensureCacheDir();
|
|
71
|
-
const filePath = this.getCacheFilePath(key);
|
|
72
|
-
await fs.writeFile(filePath, value, "utf-8");
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
console.warn("Failed to write to LLM cache:", error);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
async clear() {
|
|
79
|
-
try {
|
|
80
|
-
await this.ensureCacheDir();
|
|
81
|
-
const files = await fs.readdir(this.cacheDir);
|
|
82
|
-
await Promise.all(files
|
|
83
|
-
.filter((file) => file.endsWith(".json"))
|
|
84
|
-
.map((file) => fs.unlink(path.join(this.cacheDir, file))));
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
console.warn("Failed to clear LLM cache:", error);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async size() {
|
|
91
|
-
try {
|
|
92
|
-
await this.ensureCacheDir();
|
|
93
|
-
const files = await fs.readdir(this.cacheDir);
|
|
94
|
-
return files.filter((file) => file.endsWith(".json")).length;
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return 0;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.FilesystemLLMCache = FilesystemLLMCache;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import type { TestCase } from "@empiricalrun/shared-types";
|
|
3
|
-
export declare function createEmptyTestCaseBlock({ testCase, file, trace, }: {
|
|
4
|
-
testCase: TestCase;
|
|
5
|
-
file: string;
|
|
6
|
-
trace?: TraceClient;
|
|
7
|
-
}): Promise<string | undefined>;
|
|
8
|
-
//# sourceMappingURL=create-test-block.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-test-block.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/create-test-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAa3D,wBAAsB,wBAAwB,CAAC,EAC7C,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,+BAsCA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createEmptyTestCaseBlock = createEmptyTestCaseBlock;
|
|
4
|
-
const llm_1 = require("@empiricalrun/llm");
|
|
5
|
-
const logger_1 = require("../../bin/logger");
|
|
6
|
-
const context_1 = require("../../bin/utils/context");
|
|
7
|
-
const web_1 = require("../../bin/utils/platform/web");
|
|
8
|
-
const constants_1 = require("../../constants");
|
|
9
|
-
const promptTemplate_0 = "{{#section \"system\"}}\nYou are a software test engineer who is given a task to write an empty test block.\nBased on the inputs you need to create an empty playwright test block with correctly imported fixture.\n\nThe test will contain a test name which you will need to use to build the empty test case block.\n\nYou will be provided with current tests, fixtures and page object models for you to use and create test case block as\nper the task provided to you.\n\nBefore responding you need to ensure that the code change is minimal and the change is reusable across tests. You need\nto ensure the code follows DRY principle.\n\nHere is the list of current tests and fixtures:\n\n{{testFiles}}\n\nHere is the list of current page object models:\n\n{{pageFiles}}\n{{/section}}\n\n{{#section \"user\"}}\nFollowing is the test scenario for which you need to write the empty test case block:\ntest name:\n{{scenarioName}}\n\ntask:\ncreate an empty test case block for the following test steps:\n{{scenario}}\n\ntest file path: {{scenarioFile}}\n\n------\n\nYou also need to ensure that the empty test case block has a starting page to begin test.\n\nIn order to identify the right page with which the test should start, follow the steps:\n- based on the similarities with other test cases mentioned in the file, identify the right page fixture to be imported\n- Read the page fixture methods step by step. Identify whether the fixture handles navigating to a page.\n- Identify whether other tests using the page fixture had to add separate steps for navigation or not\n- Based on the above analysis there will be following cases and choose either for the given test scenario:\n-- Case 1: if the test case scenario provided inside the task mentions about page navigation, then use that page\nnavigation. skip other cases if this case is satisfied.\n-- Case 2: refer other test cases which import similar fixtures and infer the first page navigation of this test case.\nYou should prefer tests which are in the same file. Tests within same file have higher overlaps in first page\nnavigation.\n- Once the page fixture is decided, look for userContext fixture in files. If its available then add \"userContext\" to\nthe test case block\n\n\n\nFollow these instructions before responding with output:\n- Read the code line by line and achieve the task provided to you\n- Read the dependencies of the code block by scanning through file paths and file provided to you. refer the same file\npath while responding with update\n- Focus only on the test case provided and associated JS methods called from the test case.\n- Respond only with the new empty test case block to be created and nothing else.\n- DO NOT respond with any backticks or markdown syntax\n- If \"userContext\" fixture is available in fixtures file, ensure importing that fixture in the test case block.\n- Provide a reason based on the test steps provided to you on why you chose the fixture or page.goto statement. The\nreason should be one of the list steps provided to you and mention why the case was chosen\n{{/section}}";
|
|
10
|
-
async function createEmptyTestCaseBlock({ testCase, file, trace, }) {
|
|
11
|
-
const logger = new logger_1.CustomLogger({ useReporter: false });
|
|
12
|
-
logger.log("Creating new test block");
|
|
13
|
-
const context = await (0, context_1.contextForGeneration)(file);
|
|
14
|
-
const promptSpan = trace?.span({
|
|
15
|
-
name: "build-create-empty-test-case-prompt",
|
|
16
|
-
});
|
|
17
|
-
const prompt = (0, llm_1.compilePrompt)(promptTemplate_0, {
|
|
18
|
-
testFiles: context.codePrompt,
|
|
19
|
-
pageFiles: context.pomPrompt,
|
|
20
|
-
scenarioName: testCase.name,
|
|
21
|
-
scenario: testCase.steps.join("\n"),
|
|
22
|
-
scenarioFile: file,
|
|
23
|
-
});
|
|
24
|
-
promptSpan?.end({ output: { prompt } });
|
|
25
|
-
const llm = new llm_1.LLM({
|
|
26
|
-
trace,
|
|
27
|
-
provider: constants_1.DEFAULT_MODEL_PROVIDER,
|
|
28
|
-
defaultModel: constants_1.DEFAULT_MODEL,
|
|
29
|
-
providerApiKey: constants_1.MODEL_API_KEYS[constants_1.DEFAULT_MODEL_PROVIDER],
|
|
30
|
-
});
|
|
31
|
-
const firstShotMessage = await llm.createChatCompletion({
|
|
32
|
-
messages: prompt,
|
|
33
|
-
modelParameters: {
|
|
34
|
-
...constants_1.DEFAULT_MODEL_PARAMETERS,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
const markdownRemoverSpan = trace?.span({
|
|
38
|
-
name: "remove-markdown-span",
|
|
39
|
-
});
|
|
40
|
-
let response = firstShotMessage?.content || "";
|
|
41
|
-
markdownRemoverSpan?.end({ output: { response } });
|
|
42
|
-
const { testBlock } = (0, web_1.getTypescriptTestBlock)({
|
|
43
|
-
scenarioName: testCase.name,
|
|
44
|
-
content: response,
|
|
45
|
-
});
|
|
46
|
-
return testBlock;
|
|
47
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TraceClient } from "@empiricalrun/llm";
|
|
2
|
-
import type { TestCase } from "@empiricalrun/shared-types";
|
|
3
|
-
import { CustomLogger } from "../../bin/logger";
|
|
4
|
-
export declare function validateAndFixTypescriptErrors({ trace, logger, file, pomCode, nonSpecFileCode, testCase, }: {
|
|
5
|
-
trace?: TraceClient;
|
|
6
|
-
logger?: CustomLogger;
|
|
7
|
-
file: string;
|
|
8
|
-
pomCode: string;
|
|
9
|
-
nonSpecFileCode: string;
|
|
10
|
-
testCase: TestCase;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=fix-ts-errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-ts-errors.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/fix-ts-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,MAA2B,EAC3B,IAAI,EACJ,OAAO,EACP,eAAe,EACf,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;CACpB,iBAsEA"}
|