@empiricalrun/test-gen 0.78.0 → 0.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +0 -10
- package/dist/agent/base/index.d.ts +28 -19
- package/dist/agent/base/index.d.ts.map +1 -1
- package/dist/agent/base/index.js +25 -14
- package/dist/agent/browsing/run.d.ts +1 -1
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/chat/agent-loop.d.ts +5 -5
- package/dist/agent/chat/agent-loop.d.ts.map +1 -1
- package/dist/agent/chat/exports.d.ts +3 -3
- package/dist/agent/chat/exports.d.ts.map +1 -1
- package/dist/agent/chat/exports.js +5 -9
- package/dist/agent/chat/index.d.ts +4 -3
- package/dist/agent/chat/index.d.ts.map +1 -1
- package/dist/agent/chat/index.js +10 -5
- package/dist/agent/chat/models.d.ts +1 -1
- package/dist/agent/chat/models.d.ts.map +1 -1
- package/dist/agent/chat/models.js +3 -3
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.d.ts.map +1 -1
- package/dist/agent/chat/prompt/pw-utils-docs.js +42 -0
- package/dist/agent/chat/prompt/repo.d.ts +2 -2
- package/dist/agent/chat/prompt/repo.d.ts.map +1 -1
- package/dist/agent/chat/prompt/repo.js +2 -2
- package/dist/agent/chat/state.d.ts +14 -19
- package/dist/agent/chat/state.d.ts.map +1 -1
- package/dist/agent/chat/state.js +10 -45
- package/dist/agent/chat/utils.d.ts +5 -5
- package/dist/agent/chat/utils.d.ts.map +1 -1
- package/dist/agent/cli.d.ts +2 -2
- package/dist/agent/cli.d.ts.map +1 -1
- package/dist/agent/cli.js +5 -6
- package/dist/agent/code-review/index.d.ts +4 -3
- package/dist/agent/code-review/index.d.ts.map +1 -1
- package/dist/agent/code-review/index.js +10 -4
- package/dist/agent/code-review/types.d.ts +2 -35
- package/dist/agent/code-review/types.d.ts.map +1 -1
- package/dist/agent/code-review/types.js +4 -11
- package/dist/agent/cua/index.d.ts +1 -1
- package/dist/agent/cua/index.d.ts.map +1 -1
- package/dist/agent/cua/index.js +13 -5
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.d.ts.map +1 -1
- package/dist/agent/cua/pw-codegen/pw-pause/for-recorder.js +0 -3
- package/dist/agent/cua/pw-codegen/pw-pause/index.js +1 -1
- package/dist/agent/index.d.ts +1 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -11
- package/dist/agent/master/element-annotation.d.ts +1 -1
- package/dist/agent/master/element-annotation.d.ts.map +1 -1
- package/dist/agent/master/next-action.d.ts +1 -1
- package/dist/agent/master/next-action.d.ts.map +1 -1
- package/dist/agent/master/next-action.js +1 -6
- package/dist/agent/master/run.d.ts +3 -2
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +0 -26
- package/dist/agent/triage/index.d.ts +4 -3
- package/dist/agent/triage/index.d.ts.map +1 -1
- package/dist/agent/triage/index.js +31 -20
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/utils.d.ts +1 -1
- package/dist/artifacts/utils.d.ts.map +1 -1
- package/dist/bin/environments.d.ts +1 -1
- package/dist/bin/environments.d.ts.map +1 -1
- package/dist/bin/index.js +2 -2
- package/dist/bin/setup.d.ts +1 -1
- package/dist/bin/setup.d.ts.map +1 -1
- package/dist/bin/utils/fs/index.d.ts +1 -1
- package/dist/bin/utils/fs/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.d.ts +2 -2
- package/dist/bin/utils/platform/web/index.d.ts.map +1 -1
- package/dist/bin/utils/platform/web/index.js +1 -1
- package/dist/bin/utils/scenarios/index.d.ts +1 -1
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -4
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +0 -6
- package/dist/dashboard/client.d.ts +1 -1
- package/dist/dashboard/client.d.ts.map +1 -1
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -1
- package/dist/dashboard/tool-response.d.ts +5 -0
- package/dist/dashboard/tool-response.d.ts.map +1 -0
- package/dist/dashboard/tool-response.js +88 -0
- package/dist/dashboard/totp.js +1 -1
- package/dist/file/server.d.ts +1 -1
- package/dist/file/server.d.ts.map +1 -1
- package/dist/file/server.js +2 -1
- package/dist/file-info/adapters/file-system/index.d.ts +1 -1
- package/dist/file-info/adapters/file-system/index.d.ts.map +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts +1 -1
- package/dist/file-info/adapters/file-system/reader.d.ts.map +1 -1
- package/dist/file-info/adapters/github/index.d.ts +2 -1
- package/dist/file-info/adapters/github/index.d.ts.map +1 -1
- package/dist/file-info/adapters/github/reader.d.ts +2 -1
- package/dist/file-info/adapters/github/reader.d.ts.map +1 -1
- package/dist/recorder/index.d.ts.map +1 -1
- package/dist/recorder/index.js +2 -1
- package/dist/recorder/upload.d.ts +1 -1
- package/dist/recorder/upload.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.d.ts +1 -1
- package/dist/tools/analyse-video/index.d.ts.map +1 -1
- package/dist/tools/analyse-video/index.js +20 -13
- package/dist/tools/create-pull-request/index.d.ts +1 -1
- package/dist/tools/create-pull-request/index.d.ts.map +1 -1
- package/dist/tools/create-pull-request/utils.d.ts +2 -1
- package/dist/tools/create-pull-request/utils.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.d.ts +9 -19
- package/dist/tools/definitions/analyse-video.d.ts.map +1 -1
- package/dist/tools/definitions/analyse-video.js +12 -25
- package/dist/tools/definitions/delete-file.d.ts +9 -1
- package/dist/tools/definitions/delete-file.d.ts.map +1 -1
- package/dist/tools/definitions/delete-file.js +3 -3
- package/dist/tools/definitions/download-build.d.ts +1 -1
- package/dist/tools/definitions/download-build.d.ts.map +1 -1
- package/dist/tools/definitions/grep.d.ts +1 -1
- package/dist/tools/definitions/grep.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts +1 -1
- package/dist/tools/definitions/list-tests-and-projects.d.ts.map +1 -1
- package/dist/tools/definitions/list-tests-and-projects.js +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts +1 -1
- package/dist/tools/definitions/merge-conflicts.d.ts.map +1 -1
- package/dist/tools/definitions/merge-conflicts.js +2 -2
- package/dist/tools/definitions/rename-file.d.ts +1 -1
- package/dist/tools/definitions/rename-file.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts +1 -1
- package/dist/tools/definitions/review-pull-request.d.ts.map +1 -1
- package/dist/tools/definitions/review-pull-request.js +1 -1
- package/dist/tools/definitions/run-test.d.ts +1 -1
- package/dist/tools/definitions/run-test.d.ts.map +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts +1 -1
- package/dist/tools/definitions/str_replace_editor.d.ts.map +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts +1 -1
- package/dist/tools/definitions/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts +1 -1
- package/dist/tools/definitions/upgrade-packages.d.ts.map +1 -1
- package/dist/tools/definitions/utils.js +1 -1
- package/dist/tools/delete-file/index.d.ts +1 -1
- package/dist/tools/delete-file/index.d.ts.map +1 -1
- package/dist/tools/delete-file/index.js +6 -2
- package/dist/tools/diagnosis-fetcher.d.ts +1 -1
- package/dist/tools/diagnosis-fetcher.d.ts.map +1 -1
- package/dist/tools/diagnosis-fetcher.js +92 -47
- package/dist/tools/download-build/index.d.ts +1 -1
- package/dist/tools/download-build/index.d.ts.map +1 -1
- package/dist/tools/executor/base.d.ts +3 -2
- package/dist/tools/executor/base.d.ts.map +1 -1
- package/dist/tools/executor/base.js +5 -8
- package/dist/tools/executor/index.d.ts +3 -0
- package/dist/tools/executor/index.d.ts.map +1 -1
- package/dist/tools/executor/index.js +10 -10
- package/dist/tools/executor/utils/checkpoint.d.ts.map +1 -1
- package/dist/tools/executor/utils/checkpoint.js +0 -4
- package/dist/tools/executor/utils/git.d.ts +7 -1
- package/dist/tools/executor/utils/git.d.ts.map +1 -1
- package/dist/tools/executor/utils/git.js +10 -3
- package/dist/tools/executor/utils/index.d.ts +1 -2
- package/dist/tools/executor/utils/index.d.ts.map +1 -1
- package/dist/tools/executor/utils/index.js +0 -20
- package/dist/tools/executor/utils/pr-description.d.ts +1 -1
- package/dist/tools/executor/utils/pr-description.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.d.ts +1 -1
- package/dist/tools/fetch-file/index.d.ts.map +1 -1
- package/dist/tools/fetch-file/index.js +53 -13
- package/dist/tools/fetch-file/utils.d.ts +3 -0
- package/dist/tools/fetch-file/utils.d.ts.map +1 -0
- package/dist/tools/fetch-file/utils.js +136 -0
- package/dist/tools/fetch-session-diff/index.d.ts +1 -1
- package/dist/tools/fetch-session-diff/index.d.ts.map +1 -1
- package/dist/tools/fetch-session-diff/index.js +26 -2
- package/dist/tools/file-operations/create.d.ts +1 -1
- package/dist/tools/file-operations/create.d.ts.map +1 -1
- package/dist/tools/file-operations/index.d.ts +2 -1
- package/dist/tools/file-operations/index.d.ts.map +1 -1
- package/dist/tools/file-operations/insert.d.ts +1 -1
- package/dist/tools/file-operations/insert.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.d.ts +1 -1
- package/dist/tools/file-operations/replace.d.ts.map +1 -1
- package/dist/tools/file-operations/replace.js +0 -1
- package/dist/tools/file-operations/view/index.d.ts +2 -1
- package/dist/tools/file-operations/view/index.d.ts.map +1 -1
- package/dist/tools/grep/index.d.ts +1 -1
- package/dist/tools/grep/index.d.ts.map +1 -1
- package/dist/tools/grep/index.js +15 -12
- package/dist/tools/index.d.ts +3 -24
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +13 -42
- package/dist/tools/issues-v1/create-issue.d.ts +3 -0
- package/dist/tools/issues-v1/create-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/create-issue.js +5 -9
- package/dist/tools/issues-v1/index.d.ts.map +1 -0
- package/dist/tools/issues-v1/list-issues.d.ts +3 -0
- package/dist/tools/issues-v1/list-issues.d.ts.map +1 -0
- package/dist/tools/issues-v1/update-issue.d.ts +3 -0
- package/dist/tools/issues-v1/update-issue.d.ts.map +1 -0
- package/dist/tools/{issues → issues-v1}/update-issue.js +1 -9
- package/dist/tools/{issues → issues-v1}/utils.d.ts +2 -1
- package/dist/tools/issues-v1/utils.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.d.ts +3 -0
- package/dist/tools/issues-v2/create-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/create-issue.js +86 -0
- package/dist/tools/issues-v2/update-issue.d.ts +3 -0
- package/dist/tools/issues-v2/update-issue.d.ts.map +1 -0
- package/dist/tools/issues-v2/update-issue.js +87 -0
- package/dist/tools/list-environments.d.ts +1 -1
- package/dist/tools/list-environments.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts +1 -1
- package/dist/tools/list-tests-and-projects/index.d.ts.map +1 -1
- package/dist/tools/list-tests-and-projects/index.js +14 -4
- package/dist/tools/merge-conflicts/index.d.ts +1 -1
- package/dist/tools/merge-conflicts/index.d.ts.map +1 -1
- package/dist/tools/merge-conflicts/index.js +23 -10
- package/dist/tools/rename-file/index.d.ts +1 -1
- package/dist/tools/rename-file/index.d.ts.map +1 -1
- package/dist/tools/rename-file/index.js +0 -1
- package/dist/tools/review-pull-request/index.d.ts +1 -1
- package/dist/tools/review-pull-request/index.d.ts.map +1 -1
- package/dist/tools/review-pull-request/index.js +5 -4
- package/dist/tools/run-test.d.ts +1 -1
- package/dist/tools/run-test.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.d.ts +1 -1
- package/dist/tools/test-gen-browser.d.ts.map +1 -1
- package/dist/tools/test-gen-browser.js +55 -19
- package/dist/tools/test-run-fetcher/index.d.ts +2 -2
- package/dist/tools/test-run-fetcher/index.d.ts.map +1 -1
- package/dist/tools/test-run-fetcher/index.js +67 -66
- package/dist/tools/trace-dot-zip/index.d.ts +1 -1
- package/dist/tools/trace-dot-zip/index.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.d.ts.map +1 -1
- package/dist/tools/trace-dot-zip/utils/network-trace.js +5 -10
- package/dist/tools/triage-summary/index.d.ts +1 -1
- package/dist/tools/triage-summary/index.d.ts.map +1 -1
- package/dist/tools/triage-summary/index.js +5 -2
- package/dist/tools/triage-summary/utils.d.ts +1 -1
- package/dist/tools/triage-summary/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.d.ts +1 -1
- package/dist/tools/upgrade-packages/index.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/index.js +14 -8
- package/dist/tools/upgrade-packages/utils.d.ts +9 -5
- package/dist/tools/upgrade-packages/utils.d.ts.map +1 -1
- package/dist/tools/upgrade-packages/utils.js +56 -16
- package/dist/tools/utils/queue.d.ts +1 -1
- package/dist/tools/utils/queue.d.ts.map +1 -1
- package/dist/tools/utils/validate-schema.d.ts +3 -0
- package/dist/tools/utils/validate-schema.d.ts.map +1 -0
- package/dist/tools/utils/validate-schema.js +22 -0
- package/dist/utils/SQSClient.d.ts +1 -1
- package/dist/utils/SQSClient.d.ts.map +1 -1
- package/dist/utils/dedup/dedup-image.js +2 -2
- package/dist/utils/dedup/find-threshold.d.ts +1 -1
- package/dist/utils/dedup/find-threshold.d.ts.map +1 -1
- package/dist/utils/dedup/find-threshold.js +2 -2
- package/dist/utils/model.d.ts +1 -1
- package/dist/utils/model.d.ts.map +1 -1
- package/dist/utils/model.js +4 -3
- package/dist/utils/playwright-report-parser.d.ts +1 -1
- package/dist/utils/playwright-report-parser.d.ts.map +1 -1
- package/dist/utils/playwright-test-id.d.ts +8 -0
- package/dist/utils/playwright-test-id.d.ts.map +1 -0
- package/dist/utils/playwright-test-id.js +21 -0
- package/dist/utils/repo-tree.d.ts +1 -1
- package/dist/utils/repo-tree.d.ts.map +1 -1
- package/dist/utils/slug.d.ts.map +1 -1
- package/dist/utils/slug.js +15 -4
- package/dist/utils/url-validation.d.ts +2 -0
- package/dist/utils/url-validation.d.ts.map +1 -0
- package/dist/utils/url-validation.js +16 -0
- package/dist/video-core/index.d.ts +7 -24
- package/dist/video-core/index.d.ts.map +1 -1
- package/dist/video-core/index.js +32 -25
- package/dist/video-core/model-limits.d.ts +2 -2
- package/dist/video-core/model-limits.d.ts.map +1 -1
- package/dist/video-core/model-limits.js +9 -19
- package/dist/video-core/storage-manager.d.ts +2 -1
- package/dist/video-core/storage-manager.d.ts.map +1 -1
- package/dist/video-core/types.d.ts +1 -1
- package/dist/video-core/types.d.ts.map +1 -1
- package/dist/video-core/utils.d.ts +5 -7
- package/dist/video-core/utils.d.ts.map +1 -1
- package/dist/video-core/utils.js +39 -132
- package/package.json +8 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/actions/skill.d.ts +0 -21
- package/dist/actions/skill.d.ts.map +0 -1
- package/dist/actions/skill.js +0 -127
- package/dist/agent/chat/filesystem-cache.d.ts +0 -12
- package/dist/agent/chat/filesystem-cache.d.ts.map +0 -1
- package/dist/agent/chat/filesystem-cache.js +0 -101
- package/dist/agent/codegen/create-test-block.d.ts +0 -8
- package/dist/agent/codegen/create-test-block.d.ts.map +0 -1
- package/dist/agent/codegen/create-test-block.js +0 -47
- package/dist/agent/codegen/fix-ts-errors.d.ts +0 -12
- package/dist/agent/codegen/fix-ts-errors.d.ts.map +0 -1
- package/dist/agent/codegen/fix-ts-errors.js +0 -78
- package/dist/agent/codegen/lexical-scoped-vars.d.ts +0 -9
- package/dist/agent/codegen/lexical-scoped-vars.d.ts.map +0 -1
- package/dist/agent/codegen/lexical-scoped-vars.js +0 -55
- package/dist/agent/codegen/skills-retriever.d.ts +0 -26
- package/dist/agent/codegen/skills-retriever.d.ts.map +0 -1
- package/dist/agent/codegen/skills-retriever.js +0 -93
- package/dist/agent/codegen/test-update-feedback.d.ts +0 -12
- package/dist/agent/codegen/test-update-feedback.d.ts.map +0 -1
- package/dist/agent/codegen/test-update-feedback.js +0 -49
- package/dist/agent/codegen/types.d.ts +0 -25
- package/dist/agent/codegen/types.d.ts.map +0 -1
- package/dist/agent/codegen/types.js +0 -8
- package/dist/agent/codegen/update-flow.d.ts +0 -36
- package/dist/agent/codegen/update-flow.d.ts.map +0 -1
- package/dist/agent/codegen/update-flow.js +0 -259
- package/dist/agent/codegen/use-skill.d.ts +0 -11
- package/dist/agent/codegen/use-skill.d.ts.map +0 -1
- package/dist/agent/codegen/use-skill.js +0 -53
- package/dist/agent/codegen/utils.d.ts +0 -110
- package/dist/agent/codegen/utils.d.ts.map +0 -1
- package/dist/agent/codegen/utils.js +0 -376
- package/dist/agent/master/browser-tests/skills.spec.d.ts +0 -2
- package/dist/agent/master/browser-tests/skills.spec.d.ts.map +0 -1
- package/dist/agent/master/browser-tests/skills.spec.js +0 -112
- package/dist/agent/master/execute-skill-action.d.ts +0 -11
- package/dist/agent/master/execute-skill-action.d.ts.map +0 -1
- package/dist/agent/master/execute-skill-action.js +0 -23
- package/dist/agent/video-analysis/executor/index.d.ts +0 -5
- package/dist/agent/video-analysis/executor/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/executor/index.js +0 -10
- package/dist/agent/video-analysis/index.d.ts +0 -7
- package/dist/agent/video-analysis/index.d.ts.map +0 -1
- package/dist/agent/video-analysis/index.js +0 -60
- package/dist/evals/append-create-test-agent.evals.d.ts +0 -4
- package/dist/evals/append-create-test-agent.evals.d.ts.map +0 -1
- package/dist/evals/append-create-test-agent.evals.js +0 -117
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts +0 -4
- package/dist/evals/fetch-pom-skills-agent.evals.d.ts.map +0 -1
- package/dist/evals/fetch-pom-skills-agent.evals.js +0 -36
- package/dist/evals/master-agent.evals.d.ts +0 -4
- package/dist/evals/master-agent.evals.d.ts.map +0 -1
- package/dist/evals/master-agent.evals.js +0 -35
- package/dist/evals/type.d.ts +0 -12
- package/dist/evals/type.d.ts.map +0 -1
- package/dist/evals/type.js +0 -2
- package/dist/evals/update-scenario-agent.evals.d.ts +0 -4
- package/dist/evals/update-scenario-agent.evals.d.ts.map +0 -1
- package/dist/evals/update-scenario-agent.evals.js +0 -47
- package/dist/tools/fetch-last-successful-test-run/index.d.ts +0 -3
- package/dist/tools/fetch-last-successful-test-run/index.d.ts.map +0 -1
- package/dist/tools/fetch-last-successful-test-run/index.js +0 -60
- package/dist/tools/issues/create-issue.d.ts +0 -3
- package/dist/tools/issues/create-issue.d.ts.map +0 -1
- package/dist/tools/issues/index.d.ts.map +0 -1
- package/dist/tools/issues/list-issues.d.ts +0 -3
- package/dist/tools/issues/list-issues.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.d.ts +0 -24
- package/dist/tools/issues/metadata-schema.d.ts.map +0 -1
- package/dist/tools/issues/metadata-schema.js +0 -22
- package/dist/tools/issues/update-issue.d.ts +0 -3
- package/dist/tools/issues/update-issue.d.ts.map +0 -1
- package/dist/tools/issues/utils.d.ts.map +0 -1
- package/dist/tools/utils/urls.d.ts +0 -5
- package/dist/tools/utils/urls.d.ts.map +0 -1
- package/dist/tools/utils/urls.js +0 -19
- package/dist/tools/view-failed-test-run-report/index.d.ts +0 -12
- package/dist/tools/view-failed-test-run-report/index.d.ts.map +0 -1
- package/dist/tools/view-failed-test-run-report/index.js +0 -151
- package/dist/video-core/agent-orchestrator.d.ts +0 -13
- package/dist/video-core/agent-orchestrator.d.ts.map +0 -1
- package/dist/video-core/agent-orchestrator.js +0 -59
- package/dist/video-core/xml-parser.d.ts +0 -3
- package/dist/video-core/xml-parser.d.ts.map +0 -1
- package/dist/video-core/xml-parser.js +0 -27
- /package/dist/tools/{issues → issues-v1}/index.d.ts +0 -0
- /package/dist/tools/{issues → issues-v1}/index.js +0 -0
- /package/dist/tools/{issues → issues-v1}/list-issues.js +0 -0
- /package/dist/tools/{issues → issues-v1}/utils.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fetchTestRunDetailsTool = void 0;
|
|
4
4
|
exports.extractPathAfterSourceRepo = extractPathAfterSourceRepo;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const urls_1 = require("../utils/urls");
|
|
7
6
|
const TestRunSchema = zod_1.z.object({
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
.describe("
|
|
7
|
+
testRunId: zod_1.z
|
|
8
|
+
.number()
|
|
9
|
+
.describe("Numeric identifier (e.g. 20269) for a test run"),
|
|
10
|
+
projectSlug: zod_1.z.string().describe("Slug for the project of the test run"),
|
|
11
11
|
});
|
|
12
12
|
function extractPathAfterSourceRepo(fullPath) {
|
|
13
13
|
const parts = fullPath.split("source-repo");
|
|
@@ -18,10 +18,24 @@ function extractPathAfterSourceRepo(fullPath) {
|
|
|
18
18
|
return parts[1].replace(/^\/|\/$/g, "");
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
exports.
|
|
21
|
+
exports.fetchTestRunDetailsTool = {
|
|
22
22
|
schema: {
|
|
23
23
|
name: "fetchTestRunDetails",
|
|
24
|
-
description:
|
|
24
|
+
description: `Fetch details about a test run using its numeric identifier.
|
|
25
|
+
This tool returns the status of the test run, along with information about the environment
|
|
26
|
+
(e.g. "staging") or build that was used for the test run.
|
|
27
|
+
|
|
28
|
+
## How to use this tool?
|
|
29
|
+
|
|
30
|
+
When you are given a URL like https://dash.empirical.run/<project-slug>/test-runs/20269?query=params
|
|
31
|
+
- "testRunId": Extract the numeric id from the URL - in this case #20269
|
|
32
|
+
- "projectSlug": Extract the project-slug from the URL
|
|
33
|
+
|
|
34
|
+
## Related tools
|
|
35
|
+
|
|
36
|
+
- To learn more about a particular test case that failed in the test, you can use the fetch diagnosis tool
|
|
37
|
+
with the diagnosis id (which is passed to the test run URL as the ?detail= query parameter)
|
|
38
|
+
`,
|
|
25
39
|
parameters: TestRunSchema,
|
|
26
40
|
},
|
|
27
41
|
needsBrowser: false,
|
|
@@ -30,9 +44,11 @@ exports.fetchTestRunReportTool = {
|
|
|
30
44
|
if (!apiClient) {
|
|
31
45
|
throw new Error("Dashboard API client is not available.");
|
|
32
46
|
}
|
|
33
|
-
const {
|
|
47
|
+
const { testRunId: runId, projectSlug } = input;
|
|
34
48
|
let data = null;
|
|
35
|
-
const
|
|
49
|
+
const repoName = projectSlug.includes("-tests")
|
|
50
|
+
? projectSlug
|
|
51
|
+
: `${projectSlug}-tests`;
|
|
36
52
|
try {
|
|
37
53
|
data = await apiClient.request(`/api/test-runs/${runId}?repo_name=${repoName}`, { method: "GET" });
|
|
38
54
|
}
|
|
@@ -42,79 +58,64 @@ exports.fetchTestRunReportTool = {
|
|
|
42
58
|
result: `Failed to fetch test run details: ${error instanceof Error ? error.message : String(error)}`,
|
|
43
59
|
};
|
|
44
60
|
}
|
|
45
|
-
// To efficiently use input_tokens, we
|
|
46
|
-
// 1. Truncate stack trace to last 300 characters
|
|
47
|
-
// 2. Remove request/response headers from network metadata
|
|
48
|
-
// 3. Focus on failed tests only
|
|
49
61
|
const testRun = data.data?.test_run;
|
|
50
|
-
if (testRun
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// TODO: change to last 10 lines
|
|
56
|
-
detail.failed_run_metadata.stack =
|
|
57
|
-
stack.length > 300 ? `...${stack.slice(-300)}` : stack;
|
|
58
|
-
}
|
|
59
|
-
// Remove headers from network metadata
|
|
60
|
-
if (detail.network_metadata?.failed_calls) {
|
|
61
|
-
detail.network_metadata.failed_calls =
|
|
62
|
-
detail.network_metadata.failed_calls.map((call) => ({
|
|
63
|
-
...call,
|
|
64
|
-
request: { ...call.request, headers: [] },
|
|
65
|
-
response: { ...call.response, headers: [] },
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
if (detail.network_metadata?.failed_calls_within_time_range) {
|
|
69
|
-
detail.network_metadata.failed_calls_within_time_range =
|
|
70
|
-
detail.network_metadata.failed_calls_within_time_range.map((call) => ({
|
|
71
|
-
...call,
|
|
72
|
-
request: { ...call.request, headers: [] },
|
|
73
|
-
response: { ...call.response, headers: [] },
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
return detail;
|
|
77
|
-
});
|
|
62
|
+
if (!testRun) {
|
|
63
|
+
return {
|
|
64
|
+
isError: true,
|
|
65
|
+
result: `Test run not found.`,
|
|
66
|
+
};
|
|
78
67
|
}
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
const buildInfoIfAvailable = testRun.testRun.build_url
|
|
69
|
+
? `
|
|
70
|
+
## Build info
|
|
71
|
+
- Build URL: ${testRun.testRun.build_url}
|
|
72
|
+
- Git branch: ${testRun.testRun.build_branch}
|
|
73
|
+
- Git commit: ${testRun.testRun.commit}
|
|
74
|
+
`
|
|
75
|
+
: ``;
|
|
76
|
+
const failedTestsInMarkdown = (testRun.flattenedSummaryDetails || [])
|
|
77
|
+
.filter((detail) => detail.status === "failed")
|
|
78
|
+
.map((detail) => {
|
|
82
79
|
const { nesting } = detail.failed_run_metadata;
|
|
83
80
|
return {
|
|
84
81
|
testName: nesting.slice(1).join(" > "),
|
|
85
82
|
fileName: extractPathAfterSourceRepo(detail.failed_run_metadata.location.file),
|
|
86
83
|
project: detail.test_project,
|
|
87
|
-
detail,
|
|
84
|
+
diagnosisId: detail.slug,
|
|
88
85
|
};
|
|
89
86
|
})
|
|
90
|
-
.map((res) => {
|
|
87
|
+
.map((res, idx) => {
|
|
91
88
|
return `
|
|
92
|
-
###
|
|
93
|
-
File: ${res.fileName}
|
|
94
|
-
Project: ${res.project}
|
|
89
|
+
### Failed test ${idx + 1}
|
|
95
90
|
|
|
96
|
-
|
|
91
|
+
Test case name: ${res.testName}
|
|
92
|
+
File: ${res.fileName}
|
|
93
|
+
Project: ${res.project}
|
|
94
|
+
Diagnosis ID: ${res.diagnosisId}
|
|
97
95
|
|
|
98
|
-
|
|
99
|
-
${JSON.stringify(res.detail, null, 2)}
|
|
100
|
-
\`\`\`
|
|
101
|
-
`;
|
|
96
|
+
`;
|
|
102
97
|
})
|
|
103
|
-
.join("\n
|
|
98
|
+
.join("\n");
|
|
104
99
|
const markdownResponse = `
|
|
105
|
-
|
|
100
|
+
Test run #${testRun.testRun.id}
|
|
101
|
+
|
|
102
|
+
## Info
|
|
103
|
+
- Run ID: ${runId}
|
|
104
|
+
- Status: ${testRun.testRun.state}
|
|
105
|
+
- Started at: ${testRun.testRun.run_started_at}
|
|
106
|
+
- Ended at: ${testRun.testRun.run_ended_at}
|
|
107
|
+
- Duration: ${testRun.testRun.duration} seconds
|
|
108
|
+
|
|
109
|
+
## Environment
|
|
110
|
+
- Name: ${testRun?.testRun.environment_name}
|
|
111
|
+
- Slug: ${testRun?.testRun.environment_slug}
|
|
112
|
+
|
|
113
|
+
${buildInfoIfAvailable}
|
|
106
114
|
|
|
107
|
-
##
|
|
108
|
-
- Run ID: ${runId}
|
|
109
|
-
- Repository: ${repoName}
|
|
110
|
-
- Started at: ${testRun?.testRun.run_started_at}
|
|
111
|
-
- Ended at: ${testRun?.testRun.run_ended_at}
|
|
112
|
-
- Duration: ${testRun?.testRun.duration} seconds
|
|
113
|
-
- Environment name: ${testRun?.testRun.environment_name}
|
|
115
|
+
## Failed tests
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
`;
|
|
117
|
+
${failedTestsInMarkdown.length > 0 ? failedTestsInMarkdown : "None"}
|
|
118
|
+
`;
|
|
118
119
|
return {
|
|
119
120
|
result: markdownResponse,
|
|
120
121
|
isError: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/trace-dot-zip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/trace-dot-zip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,uCAAuC,CAAC;AAazE,eAAO,MAAM,eAAe,EAAE,IAwD7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-trace.d.ts","sourceRoot":"","sources":["../../../../src/tools/trace-dot-zip/utils/network-trace.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAUlB,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EACJ;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,GACD,SAAS,CAAC;KACf,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,8BAIxC,KAAK,KAAG,OAAO,CAAC;IACjB,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,0BAA0B,EAAE,sBAAsB,EAAE,CAAC;CACtD,CA+KA,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAU,UAElD,KAAK,KAAG,OAAO,CAAC;IACjB,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;CAC/C,
|
|
1
|
+
{"version":3,"file":"network-trace.d.ts","sourceRoot":"","sources":["../../../../src/tools/trace-dot-zip/utils/network-trace.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAUlB,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EACJ;YACE,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,GACD,SAAS,CAAC;KACf,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,8BAIxC,KAAK,KAAG,OAAO,CAAC;IACjB,cAAc,EAAE,sBAAsB,EAAE,CAAC;IACzC,0BAA0B,EAAE,sBAAsB,EAAE,CAAC;CACtD,CA+KA,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAU,UAElD,KAAK,KAAG,OAAO,CAAC;IACjB,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;IAC9C,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;CAC/C,CAkEA,CAAC;AAsBF,eAAO,MAAM,0CAA0C,GACrD,UAAU,sBAAsB,EAAE,KACjC,OAAO,CAAC,sBAAsB,CAAC,EAoBjC,CAAC;AAmCF,eAAO,MAAM,iBAAiB,GAC5B,UAAU,sBAAsB,EAAE,EAClC,QAAQ,MAAM,KACb,OAAO,CAAC,sBAAsB,EAAE,CA+BlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,0CAA0C,sBAAsB,EAAE,KACjE,sBAAsB,EA2BxB,CAAC"}
|
|
@@ -147,10 +147,10 @@ const generateNetworkTraceFromZipUrl = async ({ url, }) => {
|
|
|
147
147
|
const hasValidResponseStatus = !!parsedNetworkTrace?.snapshot?.response?.status;
|
|
148
148
|
const responseStatus = Number(parsedNetworkTrace?.snapshot?.response?.status);
|
|
149
149
|
allNetworkCalls.push(parsedNetworkTrace);
|
|
150
|
-
// only failures
|
|
150
|
+
// only failures for detailed analysis
|
|
151
151
|
if (hasValidResponseStatus &&
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
400 <= responseStatus &&
|
|
153
|
+
responseStatus < 600) {
|
|
154
154
|
relevantNetworkCalls.push(parsedNetworkTrace);
|
|
155
155
|
}
|
|
156
156
|
});
|
|
@@ -165,13 +165,8 @@ const generateNetworkTraceFromZipUrl = async ({ url, }) => {
|
|
|
165
165
|
const sequenceCalls = allNetworkCalls.filter((c) => {
|
|
166
166
|
const hasValidResponseStatus = !!c.snapshot.response.status;
|
|
167
167
|
const status = Number(c.snapshot.response.status);
|
|
168
|
-
return
|
|
169
|
-
|
|
170
|
-
status === 307 ||
|
|
171
|
-
status === 308 ||
|
|
172
|
-
status === 301 ||
|
|
173
|
-
status === 302));
|
|
174
|
-
// excluding: 304 (cached), 2xx success
|
|
168
|
+
return hasValidResponseStatus && 400 <= status && status < 600;
|
|
169
|
+
// excluding: 304 (cached), 2xx success, 3xx redirects
|
|
175
170
|
});
|
|
176
171
|
const networkCallSequence = (0, exports.buildNetworkCallSequence)(sequenceCalls);
|
|
177
172
|
const formattedFailedCalls = failedCalls.map(formatNetworkFailure);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEL,MAAM,uCAAuC,CAAC;AAmB/C,eAAO,MAAM,qBAAqB,EAAE,IA0DnC,CAAC"}
|
|
@@ -19,7 +19,7 @@ exports.sendTriageSummaryTool = {
|
|
|
19
19
|
},
|
|
20
20
|
needsBrowser: false,
|
|
21
21
|
isInlineTool: true,
|
|
22
|
-
execute: async ({ input, apiClient, chatSession }) => {
|
|
22
|
+
execute: async ({ input, apiClient, chatSession, logger, }) => {
|
|
23
23
|
try {
|
|
24
24
|
const triagedIssuesList = input.issues;
|
|
25
25
|
if (!triagedIssuesList) {
|
|
@@ -41,7 +41,10 @@ exports.sendTriageSummaryTool = {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
catch (error) {
|
|
44
|
-
|
|
44
|
+
logger.error("Error sending triage summary to slack", {
|
|
45
|
+
tool: "sendTriageSummaryTool",
|
|
46
|
+
error,
|
|
47
|
+
});
|
|
45
48
|
return {
|
|
46
49
|
isError: true,
|
|
47
50
|
result: error instanceof Error ? error.message : String(error),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDashboardAPIClient } from "@empiricalrun/shared-types";
|
|
1
|
+
import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
|
|
2
2
|
import { TriagedIssue } from "./types";
|
|
3
3
|
export declare const triggerSlackMessageWithTriageSummary: (issues: TriagedIssue[], apiClient: IDashboardAPIClient, chatSessionId: number) => Promise<string>;
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/triage-summary/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,eAAO,MAAM,oCAAoC,GAC/C,QAAQ,YAAY,EAAE,EACtB,WAAW,mBAAmB,EAC9B,eAAe,MAAM,KACpB,OAAO,CAAC,MAAM,CAahB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAmBlE,eAAO,MAAM,mBAAmB,EAAE,IAqIjC,CAAC"}
|
|
@@ -14,13 +14,13 @@ const pr_description_1 = require("../executor/utils/pr-description");
|
|
|
14
14
|
const utils_2 = require("./utils");
|
|
15
15
|
exports.upgradePackagesTool = {
|
|
16
16
|
...upgrade_packages_1.upgradePackagesTool,
|
|
17
|
-
execute: async ({ input, repoPath, apiClient, chatSession }) => {
|
|
17
|
+
execute: async ({ input, repoPath, apiClient, chatSession, logger }) => {
|
|
18
18
|
const { packages: packagesToUpdate } = input;
|
|
19
19
|
try {
|
|
20
|
-
const repoName = path_1.default.basename(repoPath);
|
|
21
20
|
const branchName = await (0, git_1.getCurrentBranchName)(repoPath);
|
|
22
21
|
const packageJsonPath = path_1.default.join(repoPath, "package.json");
|
|
23
22
|
const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, "utf-8"));
|
|
23
|
+
const repoName = packageJson.name;
|
|
24
24
|
const changes = [];
|
|
25
25
|
for (let { name: pkgName, version } of packagesToUpdate) {
|
|
26
26
|
const isDevDep = !!packageJson.devDependencies?.[pkgName];
|
|
@@ -30,11 +30,12 @@ exports.upgradePackagesTool = {
|
|
|
30
30
|
pkgName,
|
|
31
31
|
version,
|
|
32
32
|
isDevDep,
|
|
33
|
+
logger: logger,
|
|
33
34
|
});
|
|
34
35
|
changes.push(updatedPackage);
|
|
35
36
|
}
|
|
36
37
|
catch (err) {
|
|
37
|
-
|
|
38
|
+
logger.error("Failed to upgrade package", { pkgName, error: err });
|
|
38
39
|
return {
|
|
39
40
|
result: `Failed to upgrade ${pkgName}: ${err.message}`,
|
|
40
41
|
isError: true,
|
|
@@ -83,9 +84,14 @@ exports.upgradePackagesTool = {
|
|
|
83
84
|
if (!pr.number) {
|
|
84
85
|
throw new Error("Failed to create PR");
|
|
85
86
|
}
|
|
86
|
-
shouldMerge = await (0, utils_2.shouldMergePR)({
|
|
87
|
+
shouldMerge = await (0, utils_2.shouldMergePR)({
|
|
88
|
+
repoName,
|
|
89
|
+
prNumber,
|
|
90
|
+
apiClient,
|
|
91
|
+
logger: logger,
|
|
92
|
+
});
|
|
87
93
|
if (shouldMerge) {
|
|
88
|
-
|
|
94
|
+
logger.info("All changes are patch updates, proceeding with merge");
|
|
89
95
|
merged = await (0, git_1.mergePullRequest)({
|
|
90
96
|
repoName,
|
|
91
97
|
prNumber,
|
|
@@ -93,11 +99,11 @@ exports.upgradePackagesTool = {
|
|
|
93
99
|
});
|
|
94
100
|
}
|
|
95
101
|
else {
|
|
96
|
-
|
|
102
|
+
logger.info("PR created but not merged - contains non-patch updates", { prNumber });
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
catch (error) {
|
|
100
|
-
|
|
106
|
+
logger.error("Failed to handle PR operations", { error });
|
|
101
107
|
const prLink = prNumber
|
|
102
108
|
? ` PR: https://github.com/empirical-run/${repoName}/pull/${prNumber}`
|
|
103
109
|
: "";
|
|
@@ -118,7 +124,7 @@ exports.upgradePackagesTool = {
|
|
|
118
124
|
};
|
|
119
125
|
}
|
|
120
126
|
catch (error) {
|
|
121
|
-
|
|
127
|
+
logger.error("Failed to upgrade packages", { error });
|
|
122
128
|
return {
|
|
123
129
|
result: `Failed to upgrade packages: ${error.message}`,
|
|
124
130
|
isError: true,
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { IDashboardAPIClient } from "@empiricalrun/shared-types";
|
|
1
|
+
import { IDashboardAPIClient } from "@empiricalrun/shared-types/api/base";
|
|
2
|
+
import { Logger } from "@empiricalrun/shared-types/chat-agent";
|
|
2
3
|
export declare function isPatchUpdate(currentVersion: string | undefined, newVersion: string | undefined): boolean;
|
|
3
|
-
export declare function getLatestVersion(packageName: string): Promise<any>;
|
|
4
|
-
export declare function parsePackageJsonDiff({ diff, }: {
|
|
4
|
+
export declare function getLatestVersion(packageName: string, logger: Logger): Promise<any>;
|
|
5
|
+
export declare function parsePackageJsonDiff({ diff, logger, }: {
|
|
5
6
|
diff: string;
|
|
7
|
+
logger: Logger;
|
|
6
8
|
}): Record<string, {
|
|
7
9
|
old?: string;
|
|
8
10
|
new?: string;
|
|
9
11
|
}>;
|
|
10
|
-
export declare function shouldMergePR({ repoName, prNumber, apiClient, }: {
|
|
12
|
+
export declare function shouldMergePR({ repoName, prNumber, apiClient, logger, }: {
|
|
11
13
|
repoName: string;
|
|
12
14
|
prNumber: number;
|
|
13
15
|
apiClient: IDashboardAPIClient;
|
|
16
|
+
logger: Logger;
|
|
14
17
|
}): Promise<boolean>;
|
|
15
|
-
export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }: {
|
|
18
|
+
export declare function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, logger, }: {
|
|
16
19
|
repoPath: string;
|
|
17
20
|
pkgName: string;
|
|
18
21
|
version?: string;
|
|
19
22
|
isDevDep: boolean;
|
|
23
|
+
logger: Logger;
|
|
20
24
|
}): Promise<{
|
|
21
25
|
name: string;
|
|
22
26
|
version: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/upgrade-packages/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAG/D,wBAAgB,aAAa,CAC3B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAWT;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBA0BzE;AAkCD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,MAAM,GACP,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA0BjD;AAED,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,oBAkDA;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;;;GAqBA"}
|
|
@@ -16,7 +16,7 @@ function isPatchUpdate(currentVersion, newVersion) {
|
|
|
16
16
|
const next = newVersion.replace(/^[\^~]/, "").split(".");
|
|
17
17
|
return (current[0] === next[0] && current[1] === next[1] && current[2] !== next[2]);
|
|
18
18
|
}
|
|
19
|
-
async function getLatestVersion(packageName) {
|
|
19
|
+
async function getLatestVersion(packageName, logger) {
|
|
20
20
|
const url = `https://registry.npmjs.org/${packageName}/latest`;
|
|
21
21
|
try {
|
|
22
22
|
const response = await fetch(url);
|
|
@@ -27,15 +27,23 @@ async function getLatestVersion(packageName) {
|
|
|
27
27
|
throw new Error(errorMsg);
|
|
28
28
|
}
|
|
29
29
|
const packageInfo = await response.json();
|
|
30
|
-
|
|
30
|
+
logger.info(`Latest version of ${packageName}: ${packageInfo.version}`, {
|
|
31
|
+
tool: "upgradePackages",
|
|
32
|
+
packageName,
|
|
33
|
+
version: packageInfo.version,
|
|
34
|
+
});
|
|
31
35
|
return packageInfo.version;
|
|
32
36
|
}
|
|
33
37
|
catch (error) {
|
|
34
|
-
|
|
38
|
+
logger.error(`Error fetching package info: ${error.message}`, {
|
|
39
|
+
tool: "upgradePackages",
|
|
40
|
+
packageName,
|
|
41
|
+
error,
|
|
42
|
+
});
|
|
35
43
|
throw error;
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
|
-
async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, }) {
|
|
46
|
+
async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, logger, }) {
|
|
39
47
|
const files = await apiClient.callGitHubProxy({
|
|
40
48
|
method: "GET",
|
|
41
49
|
url: `/repos/empirical-run/${repoName}/pulls/${prNumber}/files`,
|
|
@@ -45,12 +53,16 @@ async function getGitDiffForPackageJson({ repoName, prNumber, apiClient, }) {
|
|
|
45
53
|
}
|
|
46
54
|
const packageJsonChanges = files.find((file) => file.filename === "package.json");
|
|
47
55
|
if (!packageJsonChanges) {
|
|
48
|
-
|
|
56
|
+
logger.info("No package.json changes found in PR", {
|
|
57
|
+
tool: "upgradePackages",
|
|
58
|
+
repoName,
|
|
59
|
+
prNumber,
|
|
60
|
+
});
|
|
49
61
|
return null;
|
|
50
62
|
}
|
|
51
63
|
return packageJsonChanges.patch;
|
|
52
64
|
}
|
|
53
|
-
function parsePackageJsonDiff({ diff, }) {
|
|
65
|
+
function parsePackageJsonDiff({ diff, logger, }) {
|
|
54
66
|
const patchLines = diff.split("\n");
|
|
55
67
|
const changes = {};
|
|
56
68
|
for (let i = 0; i < patchLines.length; i++) {
|
|
@@ -60,7 +72,10 @@ function parsePackageJsonDiff({ diff, }) {
|
|
|
60
72
|
if (match) {
|
|
61
73
|
const [, pkg, version] = match;
|
|
62
74
|
if (!pkg) {
|
|
63
|
-
|
|
75
|
+
logger.warn("No package name found in line:", {
|
|
76
|
+
tool: "upgradePackages",
|
|
77
|
+
line,
|
|
78
|
+
});
|
|
64
79
|
continue;
|
|
65
80
|
}
|
|
66
81
|
const changeType = line.startsWith("+") ? "new" : "old";
|
|
@@ -72,38 +87,63 @@ function parsePackageJsonDiff({ diff, }) {
|
|
|
72
87
|
}
|
|
73
88
|
return changes;
|
|
74
89
|
}
|
|
75
|
-
async function shouldMergePR({ repoName, prNumber, apiClient, }) {
|
|
90
|
+
async function shouldMergePR({ repoName, prNumber, apiClient, logger, }) {
|
|
76
91
|
const gitDiff = await getGitDiffForPackageJson({
|
|
77
92
|
repoName,
|
|
78
93
|
prNumber,
|
|
79
94
|
apiClient,
|
|
95
|
+
logger,
|
|
80
96
|
});
|
|
81
97
|
if (!gitDiff) {
|
|
82
|
-
|
|
98
|
+
logger.info("No package.json changes found, skipping merge", {
|
|
99
|
+
tool: "upgradePackages",
|
|
100
|
+
repoName,
|
|
101
|
+
prNumber,
|
|
102
|
+
});
|
|
83
103
|
return false;
|
|
84
104
|
}
|
|
85
|
-
const changes = parsePackageJsonDiff({ diff: gitDiff });
|
|
105
|
+
const changes = parsePackageJsonDiff({ diff: gitDiff, logger });
|
|
86
106
|
if (Object.keys(changes).length === 0) {
|
|
87
|
-
|
|
107
|
+
logger.info("No package.json changes found, skipping merge", {
|
|
108
|
+
tool: "upgradePackages",
|
|
109
|
+
repoName,
|
|
110
|
+
prNumber,
|
|
111
|
+
});
|
|
88
112
|
return false;
|
|
89
113
|
}
|
|
90
114
|
let allPatchUpdates = true;
|
|
91
115
|
for (const [pkg, versions] of Object.entries(changes)) {
|
|
92
116
|
const { old: oldVersion, new: newVersion } = versions;
|
|
93
117
|
if (!isPatchUpdate(oldVersion, newVersion)) {
|
|
94
|
-
|
|
118
|
+
logger.info(`${pkg}: ${oldVersion} -> ${newVersion} is not a patch update`, {
|
|
119
|
+
tool: "upgradePackages",
|
|
120
|
+
package: pkg,
|
|
121
|
+
oldVersion,
|
|
122
|
+
newVersion,
|
|
123
|
+
});
|
|
95
124
|
allPatchUpdates = false;
|
|
96
125
|
}
|
|
97
126
|
else {
|
|
98
|
-
|
|
127
|
+
logger.info(`${pkg}: ${oldVersion} -> ${newVersion} is a patch update`, {
|
|
128
|
+
tool: "upgradePackages",
|
|
129
|
+
package: pkg,
|
|
130
|
+
oldVersion,
|
|
131
|
+
newVersion,
|
|
132
|
+
});
|
|
99
133
|
}
|
|
100
134
|
}
|
|
101
135
|
return allPatchUpdates;
|
|
102
136
|
}
|
|
103
|
-
async function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, }) {
|
|
104
|
-
const pkgVersion = version ?? (await getLatestVersion(pkgName));
|
|
137
|
+
async function upgradeAndStagePackage({ repoPath, pkgName, version, isDevDep, logger, }) {
|
|
138
|
+
const pkgVersion = version ?? (await getLatestVersion(pkgName, logger));
|
|
105
139
|
(0, child_process_1.execSync)(`npm i ${pkgName}@${pkgVersion} ${isDevDep ? "--save-dev" : "--save"}`, { cwd: repoPath });
|
|
106
|
-
|
|
140
|
+
logger.info(`Updated package: ${pkgName} version to ${pkgVersion} in ${repoPath}`, {
|
|
141
|
+
tool: "upgradePackages",
|
|
142
|
+
pkgName,
|
|
143
|
+
pkgVersion,
|
|
144
|
+
repoPath,
|
|
145
|
+
isDevDep,
|
|
146
|
+
});
|
|
107
147
|
(0, child_process_1.execSync)("git add package.json package-lock.json", { cwd: repoPath });
|
|
108
148
|
return {
|
|
109
149
|
name: pkgName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PendingToolCall } from "@empiricalrun/shared-types";
|
|
1
|
+
import { PendingToolCall } from "@empiricalrun/shared-types/chat-agent";
|
|
2
2
|
export declare function appendSuffixToQueueUrl(queueUrl: string, suffix: string): string;
|
|
3
3
|
export declare function replaceRegionInUrl(url: string, newRegion: string): string;
|
|
4
4
|
export declare function getQueueUrl(toolCalls: PendingToolCall[], needsBrowser: boolean): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzE;AAkBD,wBAAgB,WAAW,CACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,YAAY,EAAE,OAAO,GACpB,MAAM,CAeR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-schema.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/validate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,uCAAuC,CAAC;AAE/C,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,CAAC,GACR,UAAU,GAAG,IAAI,CAwBnB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateToolInput = validateToolInput;
|
|
4
|
+
function validateToolInput(toolCall, schema) {
|
|
5
|
+
const { name: toolName, input } = toolCall;
|
|
6
|
+
const strictSchema = schema._def?.typeName === "ZodObject"
|
|
7
|
+
? schema.strict()
|
|
8
|
+
: schema;
|
|
9
|
+
const validation = strictSchema.safeParse(input);
|
|
10
|
+
if (!validation.success) {
|
|
11
|
+
const errorMessage = [
|
|
12
|
+
`Schema validation failed for tool "${toolName}".`,
|
|
13
|
+
`\nValidation errors: ${JSON.stringify(validation.error.issues, null, 2)}`,
|
|
14
|
+
].join("\n");
|
|
15
|
+
return {
|
|
16
|
+
isError: true,
|
|
17
|
+
result: errorMessage,
|
|
18
|
+
artifacts: null,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQSClient.d.ts","sourceRoot":"","sources":["../../src/utils/SQSClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SQSClient.d.ts","sourceRoot":"","sources":["../../src/utils/SQSClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM;YAQT,MAAM;YAON,UAAU;YAkBV,eAAe;YAgBf,IAAI;IASZ,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAyG5E"}
|
|
@@ -16,8 +16,8 @@ async function deduplicateImages({ base64Images, threshold, logPrefix = "dedup-i
|
|
|
16
16
|
previousImage = currentImage.image;
|
|
17
17
|
continue;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
19
|
+
const diffFraction = await (0, find_threshold_1.findDiffFraction)(previousImage, currentImage.image);
|
|
20
|
+
if (diffFraction > threshold) {
|
|
21
21
|
uniqueImages.push(currentImage);
|
|
22
22
|
previousImage = currentImage.image;
|
|
23
23
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function findDiffFraction(base64Image1: string, base64Image2: string): Promise<number>;
|
|
2
2
|
//# sourceMappingURL=find-threshold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-threshold.d.ts","sourceRoot":"","sources":["../../../src/utils/dedup/find-threshold.ts"],"names":[],"mappings":"AAsCA,wBAAsB,
|
|
1
|
+
{"version":3,"file":"find-threshold.d.ts","sourceRoot":"","sources":["../../../src/utils/dedup/find-threshold.ts"],"names":[],"mappings":"AAsCA,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.findDiffFraction = findDiffFraction;
|
|
7
7
|
const pixelmatch_1 = __importDefault(require("pixelmatch"));
|
|
8
8
|
const sharp_1 = __importDefault(require("sharp"));
|
|
9
9
|
async function compareImageBuffers(buffer1, buffer2, pixelmatchThreshold) {
|
|
@@ -29,7 +29,7 @@ async function compareImageBuffers(buffer1, buffer2, pixelmatchThreshold) {
|
|
|
29
29
|
const diffFraction = diffPixels / totalPixels;
|
|
30
30
|
return { diffPixels, totalPixels, diffFraction };
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
32
|
+
async function findDiffFraction(base64Image1, base64Image2) {
|
|
33
33
|
try {
|
|
34
34
|
const buffer1 = Buffer.from(base64Image1, "base64");
|
|
35
35
|
const buffer2 = Buffer.from(base64Image2, "base64");
|