testeiya 0.2.1 → 0.3.1-5.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/LICENSE +21 -0
- package/README.md +325 -171
- package/dist/prompt/context.js +79 -0
- package/dist/prompt/context.js.map +1 -0
- package/dist/prompt/index.js +60 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/print.js +30 -0
- package/dist/prompt/print.js.map +1 -0
- package/dist/prompt/project-info.js +2 -0
- package/dist/prompt/project-info.js.map +1 -0
- package/{src/prompt/system-prompt.ts → dist/prompt/system-prompt.js} +38 -25
- package/dist/prompt/system-prompt.js.map +1 -0
- package/dist/prompt/testomatio.js +264 -0
- package/dist/prompt/testomatio.js.map +1 -0
- package/dist/prompt/tools.js +70 -0
- package/dist/prompt/tools.js.map +1 -0
- package/dist/prompt/vocab.js +8 -0
- package/dist/prompt/vocab.js.map +1 -0
- package/dist/src/args.js +224 -0
- package/dist/src/args.js.map +1 -0
- package/dist/src/cli.js +105 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/doctor.js +171 -0
- package/dist/src/doctor.js.map +1 -0
- package/dist/src/env.js +103 -0
- package/dist/src/env.js.map +1 -0
- package/dist/src/mcp-extension.js +9 -0
- package/dist/src/mcp-extension.js.map +1 -0
- package/dist/src/mcp.js +139 -0
- package/dist/src/mcp.js.map +1 -0
- package/dist/src/model.js +71 -0
- package/dist/src/model.js.map +1 -0
- package/dist/src/models.js +38 -0
- package/dist/src/models.js.map +1 -0
- package/dist/src/output.js +216 -0
- package/dist/src/output.js.map +1 -0
- package/dist/src/result.js +41 -0
- package/dist/src/result.js.map +1 -0
- package/dist/src/run.js +313 -0
- package/dist/src/run.js.map +1 -0
- package/dist/src/session.js +98 -0
- package/dist/src/session.js.map +1 -0
- package/dist/src/sessions.js +72 -0
- package/dist/src/sessions.js.map +1 -0
- package/dist/src/skills.js +130 -0
- package/dist/src/skills.js.map +1 -0
- package/dist/vendor/mcp.js +14801 -0
- package/mcp-tools.json +2967 -0
- package/package.json +34 -43
- package/prompt/context.ts +101 -0
- package/prompt/index.ts +102 -0
- package/prompt/print.ts +32 -0
- package/prompt/project-info.ts +30 -0
- package/prompt/system-prompt.ts +187 -0
- package/{src/prompt → prompt}/testomatio.ts +120 -9
- package/prompt/tools.ts +72 -0
- package/prompt/vocab.ts +7 -0
- package/skills/codeceptjs/ci-fix-tests/SKILL.md +7 -8
- package/skills/codeceptjs/codeceptjs-auth/SKILL.md +47 -64
- package/skills/codeceptjs/codeceptjs-exploration/SKILL.md +56 -47
- package/skills/codeceptjs/codeceptjs-fundamentals/SKILL.md +144 -106
- package/skills/codeceptjs/codeceptjs-run-analysis/SKILL.md +50 -57
- package/skills/codeceptjs/debugging-codeceptjs-tests/SKILL.md +88 -196
- package/skills/codeceptjs/migrate-codeceptjs-4/SKILL.md +4 -5
- package/skills/codeceptjs/migrate-cypress-to-codeceptjs/SKILL.md +25 -36
- package/skills/codeceptjs/migrate-protractor-to-codeceptjs/SKILL.md +23 -36
- package/skills/codeceptjs/migrate-selenium-java-to-codeceptjs/SKILL.md +23 -36
- package/skills/codeceptjs/migrate-testcafe-to-codeceptjs/SKILL.md +23 -35
- package/skills/codeceptjs/refactoring-codeceptjs-tests/SKILL.md +50 -53
- package/skills/codeceptjs/writing-codeceptjs-tests/SKILL.md +87 -191
- package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/SKILL.md +1 -1
- package/{skills.lock.json → skills/skills.lock.json} +45 -37
- package/skills/skills.yaml +35 -0
- package/skills/testomatio/explorbot/explorbot-fundamentals/SKILL.md +49 -61
- package/skills/testomatio/explorbot/explorbot-fundamentals/references/no-install.md +36 -0
- package/skills/testomatio/explorbot/explorbot-plan/SKILL.md +20 -7
- package/skills/testomatio/explorbot/explorbot-setup/SKILL.md +41 -289
- package/skills/testomatio/explorbot/prima/SKILL.md +87 -0
- package/skills/testomatio/qa-process/qa-explain-behavior/SKILL.md +111 -0
- package/skills/testomatio/qa-process/qa-explain-behavior/references/answer-shapes.md +116 -0
- package/skills/testomatio/qa-process/qa-explain-behavior/references/examples.md +157 -0
- package/skills/testomatio/qa-process/qa-lead-strategy-advisor/SKILL.md +91 -0
- package/skills/testomatio/qa-process/qa-lead-strategy-advisor/references/output-format.md +71 -0
- package/skills/testomatio/qa-process/testing-workflow/SKILL.md +227 -0
- package/skills/testomatio/test-automation/qa-data-seeder/SKILL.md +83 -0
- package/skills/testomatio/test-automation/run-tests-with-testomatio-reporter/SKILL.md +5 -3
- package/skills/testomatio/test-automation/setup-change-aware-pr-testing/SKILL.md +190 -0
- package/skills/testomatio/test-automation/setup-ci-automation/SKILL.md +76 -0
- package/skills/testomatio/test-management/qa-split-testing-levels-pyramid/SKILL.md +55 -0
- package/skills/testomatio/test-management/qa-sprint-report-by-testomatio/SKILL.md +220 -0
- package/skills/testomatio/test-management/qa-sprint-report-by-testomatio/references/qa-sprint-report.md +126 -0
- package/skills/testomatio/test-management/qa-test-code-coverage/SKILL.md +1 -1
- package/skills/testomatio/test-management/qa-thinking/SKILL.md +25 -25
- package/skills/testomatio/test-management/testomatio-mcp/SKILL.md +14 -1
- package/skills/testomatio/test-management/testomatio-mcp/references/MCP_SETUP.md +8 -0
- package/assets/testeiya-logo-dark.svg +0 -16
- package/assets/testeiya-logo.svg +0 -15
- package/models.catalog.json +0 -6963
- package/skills/playwright-best-practices-skill/LICENSE.md +0 -7
- package/skills/playwright-best-practices-skill/README.md +0 -147
- package/skills/testeiya/README.md +0 -29
- package/skills/testeiya/answer-formatting/SKILL.md +0 -30
- package/skills/testeiya/check-cucumber/SKILL.md +0 -200
- package/skills/testeiya/check-tests/SKILL.md +0 -260
- package/skills/testeiya/manual-run-assistant/SKILL.md +0 -61
- package/skills/testeiya/testomatio-docs/INDEX.md +0 -175
- package/skills/testeiya/testomatio-docs/SKILL.md +0 -102
- package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-agents.md +0 -144
- package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-powered-features.md +0 -531
- package/skills/testeiya/testomatio-docs/docs/advanced/ai-powered-features/ai-requirements.md +0 -437
- package/skills/testeiya/testomatio-docs/docs/advanced/api-access/index.md +0 -191
- package/skills/testeiya/testomatio-docs/docs/advanced/branches-folder/index.md +0 -277
- package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/bulk-edit-demos.mdx +0 -39
- package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/bulk-edit-on-suite-and-test-level.md +0 -122
- package/skills/testeiya/testomatio-docs/docs/advanced/bulk-edit-folder/what-is-bulk-edit.md +0 -170
- package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/branches.md +0 -53
- package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/index.mdx +0 -98
- package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/jira-issue.md +0 -151
- package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/runs-and-reports.md +0 -377
- package/skills/testeiya/testomatio-docs/docs/advanced/jira-plugin/work-in-jira.md +0 -267
- package/skills/testeiya/testomatio-docs/docs/advanced/living-doc/index.md +0 -138
- package/skills/testeiya/testomatio-docs/docs/advanced/milestones/index.md +0 -220
- package/skills/testeiya/testomatio-docs/docs/advanced/shortcuts/index.md +0 -48
- package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/labels-and-custom-fields.md +0 -201
- package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/tags-or-labels.md +0 -94
- package/skills/testeiya/testomatio-docs/docs/advanced/tags-labels/tags.md +0 -243
- package/skills/testeiya/testomatio-docs/docs/advanced/test-artifacts/index.md +0 -135
- package/skills/testeiya/testomatio-docs/docs/advanced/tql/index.md +0 -394
- package/skills/testeiya/testomatio-docs/docs/getting-started/index.md +0 -290
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/azure.md +0 -96
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/bamboo.md +0 -94
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/bitbucket.md +0 -106
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/circle.md +0 -115
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/github.md +0 -120
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/gitlab.md +0 -88
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/index.mdx +0 -151
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/jenkins.md +0 -121
- package/skills/testeiya/testomatio-docs/docs/integrations/continuous-integration/teamcity.md +0 -96
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/azure.md +0 -31
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/clickup.md +0 -54
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/confluence.md +0 -34
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/github.md +0 -31
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/gitlab.md +0 -93
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/index.md +0 -131
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/jira.md +0 -164
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/linear.md +0 -29
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/shortcut.md +0 -67
- package/skills/testeiya/testomatio-docs/docs/integrations/issues-management/youtrack.md +0 -94
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/azure-devops.md +0 -53
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/email.md +0 -71
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/jira.md +0 -52
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/ms-teams.md +0 -60
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/rules.md +0 -267
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/slack.md +0 -82
- package/skills/testeiya/testomatio-docs/docs/integrations/report-notifications/telegram.md +0 -73
- package/skills/testeiya/testomatio-docs/docs/integrations/scim-provisioning/index.mdx +0 -207
- package/skills/testeiya/testomatio-docs/docs/integrations/scim-provisioning/okta.md +0 -204
- package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/azure.md +0 -95
- package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/google.md +0 -75
- package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/index.mdx +0 -33
- package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/okta.md +0 -108
- package/skills/testeiya/testomatio-docs/docs/integrations/single-sign-on/saml.md +0 -66
- package/skills/testeiya/testomatio-docs/docs/legal/compliance/gdpr.md +0 -95
- package/skills/testeiya/testomatio-docs/docs/legal/compliance/index.mdx +0 -94
- package/skills/testeiya/testomatio-docs/docs/legal/compliance/privacy.md +0 -26
- package/skills/testeiya/testomatio-docs/docs/legal/compliance/terms.md +0 -32
- package/skills/testeiya/testomatio-docs/docs/legal/security/index.mdx +0 -242
- package/skills/testeiya/testomatio-docs/docs/legal/security/jira.md +0 -140
- package/skills/testeiya/testomatio-docs/docs/legal/security/subprocessors.md +0 -76
- package/skills/testeiya/testomatio-docs/docs/management/company/administration.md +0 -363
- package/skills/testeiya/testomatio-docs/docs/management/company/audit-log.md +0 -41
- package/skills/testeiya/testomatio-docs/docs/management/company/plan-features-comparison.md +0 -240
- package/skills/testeiya/testomatio-docs/docs/management/company/subscriptions.md +0 -326
- package/skills/testeiya/testomatio-docs/docs/management/company/trials.md +0 -75
- package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/accountant.md +0 -49
- package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/index.mdx +0 -285
- package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/read-only-user.md +0 -67
- package/skills/testeiya/testomatio-docs/docs/management/company/users-and-permissions/teams.md +0 -138
- package/skills/testeiya/testomatio-docs/docs/management/project/settings.md +0 -87
- package/skills/testeiya/testomatio-docs/docs/management/project/templates.md +0 -546
- package/skills/testeiya/testomatio-docs/docs/project/analytics/index.md +0 -326
- package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/classical-tests-markdown-format.md +0 -386
- package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/download-manual-tests-as-files.md +0 -378
- package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/export-to-obsidian.md +0 -112
- package/skills/testeiya/testomatio-docs/docs/project/import-export/export-tests/export-to-spreadsheet.md +0 -127
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/auto-import.md +0 -63
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Allure-TestOps.md +0 -49
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-QTest.md +0 -41
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Qase.md +0 -39
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-Zephyr.md +0 -37
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-csv-xlsx.md +0 -117
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-cucumber.md +0 -93
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-qmetry.md +0 -44
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-source-code.md +0 -117
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testcaselabs.md +0 -44
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testmo.md +0 -47
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-testrail.md +0 -82
- package/skills/testeiya/testomatio-docs/docs/project/import-export/import/import-tests-from-xray.md +0 -55
- package/skills/testeiya/testomatio-docs/docs/project/plans/index.md +0 -334
- package/skills/testeiya/testomatio-docs/docs/project/pulse/index.md +0 -104
- package/skills/testeiya/testomatio-docs/docs/project/runs/archive-runs-and-groups.md +0 -176
- package/skills/testeiya/testomatio-docs/docs/project/runs/custom-statuses.md +0 -195
- package/skills/testeiya/testomatio-docs/docs/project/runs/environments.md +0 -203
- package/skills/testeiya/testomatio-docs/docs/project/runs/managing-runs.md +0 -455
- package/skills/testeiya/testomatio-docs/docs/project/runs/merge-strategies.md +0 -137
- package/skills/testeiya/testomatio-docs/docs/project/runs/reports.md +0 -329
- package/skills/testeiya/testomatio-docs/docs/project/runs/rungroups.md +0 -342
- package/skills/testeiya/testomatio-docs/docs/project/runs/running-automated-tests.md +0 -256
- package/skills/testeiya/testomatio-docs/docs/project/runs/running-manual-and-automated-tests.md +0 -331
- package/skills/testeiya/testomatio-docs/docs/project/runs/running-tests-manually.md +0 -633
- package/skills/testeiya/testomatio-docs/docs/project/runs/temporary-tests-notes.md +0 -223
- package/skills/testeiya/testomatio-docs/docs/project/steps-snippets/snippets.md +0 -68
- package/skills/testeiya/testomatio-docs/docs/project/steps-snippets/steps.md +0 -181
- package/skills/testeiya/testomatio-docs/docs/project/tests/bdd-test-case-editor.md +0 -98
- package/skills/testeiya/testomatio-docs/docs/project/tests/classical-test-case-editor.md +0 -354
- package/skills/testeiya/testomatio-docs/docs/project/tests/classical-vs-bdd.md +0 -169
- package/skills/testeiya/testomatio-docs/docs/project/tests/copy-and-move-your-tests.md +0 -156
- package/skills/testeiya/testomatio-docs/docs/project/tests/other-features-for-test-case-design.md +0 -412
- package/skills/testeiya/testomatio-docs/docs/project/tests/test-case-creation-and-editing.md +0 -527
- package/skills/testeiya/testomatio-docs/docs/support/index.md +0 -75
- package/skills/testeiya/testomatio-docs/docs/test-reporting/artifacts.md +0 -388
- package/skills/testeiya/testomatio-docs/docs/test-reporting/cli.md +0 -215
- package/skills/testeiya/testomatio-docs/docs/test-reporting/configuration.md +0 -247
- package/skills/testeiya/testomatio-docs/docs/test-reporting/frameworks.md +0 -490
- package/skills/testeiya/testomatio-docs/docs/test-reporting/functions.md +0 -144
- package/skills/testeiya/testomatio-docs/docs/test-reporting/index.mdx +0 -48
- package/skills/testeiya/testomatio-docs/docs/test-reporting/junit.md +0 -248
- package/skills/testeiya/testomatio-docs/docs/test-reporting/logger.md +0 -138
- package/skills/testeiya/testomatio-docs/docs/test-reporting/php.md +0 -77
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/bitbucket.md +0 -72
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/csv.md +0 -23
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/debug.md +0 -18
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/github.md +0 -63
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/gitlab.md +0 -29
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/html.md +0 -80
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/index.mdx +0 -57
- package/skills/testeiya/testomatio-docs/docs/test-reporting/pipes/testomatio.md +0 -331
- package/skills/testeiya/testomatio-docs/docs/test-reporting/python.md +0 -229
- package/skills/testeiya/testomatio-docs/docs/test-reporting/workflows.md +0 -325
- package/skills/testeiya/testomatio-docs/docs/tutorials/Interacting-via-API.md +0 -159
- package/skills/testeiya/testomatio-docs/docs/tutorials/Manual-Testing-Classic.md +0 -164
- package/skills/testeiya/testomatio-docs/docs/tutorials/Set-Up-Read-Only-Access.md +0 -85
- package/skills/testeiya/testomatio-docs/docs/tutorials/Using-AI-in-Testing.md +0 -163
- package/skills/testeiya/testomatio-docs/docs/tutorials/Working-with-Jira.md +0 -125
- package/skills/testeiya/testomatio-docs/docs/tutorials/java.md +0 -478
- package/skills/testeiya/testomatio-docs/docs/tutorials/playwright.md +0 -207
- package/skills/testeiya/testomatio-docs/docs/tutorials/webdriver.md +0 -218
- package/skills/testeiya/testomatio-docs/docs.lock.json +0 -6
- package/skills/testeiya/testomatio-reporter/SKILL.md +0 -307
- package/skills/testomatio/test-automation/setup-pr-testing/SKILL.md +0 -199
- package/skills.yaml +0 -21
- package/src/ai-debug.ts +0 -188
- package/src/api/agent-get.ts +0 -22
- package/src/api/agent-start.ts +0 -384
- package/src/api/client-log.ts +0 -29
- package/src/api/context.ts +0 -332
- package/src/api/debug-layout.ts +0 -47
- package/src/api/debug-report.ts +0 -29
- package/src/api/debug-snapshot.ts +0 -30
- package/src/api/debug-stream.ts +0 -52
- package/src/api/files-delete.ts +0 -184
- package/src/api/files-read.ts +0 -41
- package/src/api/files-rename.ts +0 -99
- package/src/api/files-tree.ts +0 -292
- package/src/api/files-write.ts +0 -41
- package/src/api/mcp.ts +0 -603
- package/src/api/memory.ts +0 -69
- package/src/api/open-external.ts +0 -39
- package/src/api/playwright-cli.ts +0 -606
- package/src/api/providers.ts +0 -457
- package/src/api/read-env-token.ts +0 -33
- package/src/api/sessions.ts +0 -79
- package/src/api/settings.ts +0 -120
- package/src/api/skills.ts +0 -58
- package/src/api/testomatio-attachment.ts +0 -89
- package/src/api/testomatio-auth.ts +0 -284
- package/src/api/testomatio-proxy.ts +0 -197
- package/src/api/testomatio-run-stats.ts +0 -81
- package/src/api/testomatio-target.ts +0 -225
- package/src/api/testomatio-transcription.ts +0 -82
- package/src/api/workspace-search.ts +0 -96
- package/src/api/workspace-sync.ts +0 -151
- package/src/api/workspace.ts +0 -165
- package/src/app-server.ts +0 -556
- package/src/bridge.ts +0 -251
- package/src/check-tests.ts +0 -156
- package/src/cli.ts +0 -17
- package/src/commands.ts +0 -244
- package/src/config.ts +0 -183
- package/src/connection.ts +0 -658
- package/src/context-store.ts +0 -265
- package/src/debug-bus.ts +0 -405
- package/src/extensions/tool-gate.ts +0 -220
- package/src/extensions/webui/ask-channel.ts +0 -52
- package/src/extensions/webui/index.ts +0 -184
- package/src/extensions/webui/tools/ask-question.ts +0 -88
- package/src/extensions/webui/tools/query-result.ts +0 -79
- package/src/extensions/webui/tools/render-chart.ts +0 -53
- package/src/extensions/webui/tools/render-item.ts +0 -61
- package/src/extensions/webui/tools/render-list.ts +0 -170
- package/src/extensions/webui/tools/render-result.ts +0 -85
- package/src/extensions/webui/tools/render-tree.ts +0 -71
- package/src/extensions/webui/tools/ui-widget.ts +0 -54
- package/src/extensions/webui/tools/widget-result.ts +0 -13
- package/src/extensions/webui/widget-channel.ts +0 -50
- package/src/file-log.ts +0 -196
- package/src/git-tracked.ts +0 -68
- package/src/gitignore.ts +0 -53
- package/src/json-store.ts +0 -43
- package/src/load-env.ts +0 -70
- package/src/loader-style.ts +0 -96
- package/src/main.ts +0 -140
- package/src/mcp-catalog.ts +0 -96
- package/src/models-catalog.ts +0 -72
- package/src/permissions.ts +0 -120
- package/src/project-dir.ts +0 -189
- package/src/project-info.ts +0 -108
- package/src/prompt/app-ui.ts +0 -59
- package/src/prompt/browser.ts +0 -27
- package/src/prompt/index.ts +0 -62
- package/src/prompt/tools.ts +0 -27
- package/src/server-info.ts +0 -62
- package/src/session-factory.ts +0 -442
- package/src/session-store.ts +0 -115
- package/src/shell-env.ts +0 -45
- package/src/skills.ts +0 -163
- package/src/sync-snapshot.ts +0 -140
- package/src/telemetry.ts +0 -239
- package/src/testomatio-auth.ts +0 -299
- package/src/testomatio.ts +0 -98
- package/src/theme.ts +0 -30
- package/src/user-env.ts +0 -94
- package/src/welcome.ts +0 -194
- package/src/workspace/safe-path.ts +0 -85
- package/src/workspace/test-md.ts +0 -70
- package/src/workspace-model.ts +0 -440
- package/testeiya.config.json +0 -14
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/authentication-flows.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/authentication.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/clock-mocking.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/mobile-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/multi-context.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/multi-user.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/network-advanced.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/advanced/third-party.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/pom-vs-fixtures.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/test-architecture.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/architecture/when-to-mock.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/browser-apis.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/iframes.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/service-workers.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/browser-apis/websockets.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/annotations.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/assertions-waiting.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/configuration.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/fixtures-hooks.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/global-setup.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/locators.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/page-object-model.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/projects-dependencies.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-data.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-suite-structure.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/core/test-tags.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/console-errors.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/debugging.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/error-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/debugging/flaky-tests.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/angular.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/nextjs.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/react.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/frameworks/vue.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/ci-cd.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/docker.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/github-actions.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/gitlab.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/other-providers.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/parallel-sharding.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/performance.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/reporting.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/infrastructure-ci-cd/test-coverage.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/accessibility.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/api-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/browser-extensions.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/canvas-webgl.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/component-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/drag-drop.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/electron.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/file-operations.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/file-upload-download.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/forms-validation.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/graphql-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/i18n.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/performance-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/security-testing.md +0 -0
- /package/skills/{playwright-best-practices-skill → playwright/playwright-best-practices}/testing-patterns/visual-regression.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/SKILL.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/element-attributes.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/playwright-tests.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/request-mocking.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/running-code.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/session-management.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/storage-state.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/test-generation.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/tracing.md +0 -0
- /package/skills/{playwright-cli → playwright/playwright-cli}/references/video-recording.md +0 -0
package/dist/src/env.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Testeiya's state directory, shared with the desktop app: a provider key saved
|
|
6
|
+
* in its Settings dialog works here with no extra step.
|
|
7
|
+
*/
|
|
8
|
+
export const TESTEIYA_HOME = join(homedir(), ".testeiya");
|
|
9
|
+
/**
|
|
10
|
+
* This package's root, found by walking up to package.json — `dist/src` when
|
|
11
|
+
* built, `src` when run from source. Bundled files resolve from here.
|
|
12
|
+
*/
|
|
13
|
+
export const PACKAGE_ROOT = packageRoot();
|
|
14
|
+
/** This package's version, read from the same package.json. */
|
|
15
|
+
export const VERSION = packageVersion();
|
|
16
|
+
/**
|
|
17
|
+
* Where pi keeps its own state for this CLI. Deliberately not `~/.pi` — running
|
|
18
|
+
* `npx testeiya` must not write into a user's own pi installation.
|
|
19
|
+
*/
|
|
20
|
+
export const PI_STATE_DIR = join(TESTEIYA_HOME, "pi");
|
|
21
|
+
// pi reads this at import time to place sessions and its MCP cache, and a
|
|
22
|
+
// SessionManager is built before any session exists to read it from.
|
|
23
|
+
process.env.PI_CODING_AGENT_DIR = PI_STATE_DIR;
|
|
24
|
+
/**
|
|
25
|
+
* Fill gaps in process.env from `~/.testeiya/.env`, then from any `.env` found
|
|
26
|
+
* walking up from the working directory — so running in a repo picks up that
|
|
27
|
+
* repo's key. Exported variables always win; this only fills gaps.
|
|
28
|
+
*
|
|
29
|
+
* The walk starts at cwd, never at this file: an installed package sits under
|
|
30
|
+
* some node_modules whose ancestors are none of the agent's business, and
|
|
31
|
+
* silently adopting a key from there is a surprise, not a convenience.
|
|
32
|
+
*
|
|
33
|
+
* Returns the file each variable came from, which is what `doctor` reports.
|
|
34
|
+
*/
|
|
35
|
+
export function loadEnvFiles() {
|
|
36
|
+
const sources = new Map();
|
|
37
|
+
loadFile(join(TESTEIYA_HOME, ".env"), sources);
|
|
38
|
+
let dir = process.cwd();
|
|
39
|
+
for (let i = 0; i < 8; i++) {
|
|
40
|
+
loadFile(join(dir, ".env"), sources);
|
|
41
|
+
const parent = dirname(dir);
|
|
42
|
+
if (parent === dir)
|
|
43
|
+
break;
|
|
44
|
+
dir = parent;
|
|
45
|
+
}
|
|
46
|
+
return sources;
|
|
47
|
+
}
|
|
48
|
+
export function parseEnv(content) {
|
|
49
|
+
const out = {};
|
|
50
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
51
|
+
const line = raw.trim();
|
|
52
|
+
if (!line || line.startsWith("#"))
|
|
53
|
+
continue;
|
|
54
|
+
const eq = line.indexOf("=");
|
|
55
|
+
if (eq === -1)
|
|
56
|
+
continue;
|
|
57
|
+
const key = line.slice(0, eq).trim();
|
|
58
|
+
let val = line.slice(eq + 1).trim();
|
|
59
|
+
if ((val.startsWith('"') && val.endsWith('"')) ||
|
|
60
|
+
(val.startsWith("'") && val.endsWith("'"))) {
|
|
61
|
+
val = val.slice(1, -1);
|
|
62
|
+
}
|
|
63
|
+
if (key)
|
|
64
|
+
out[key] = val;
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
function loadFile(path, sources) {
|
|
69
|
+
if (!existsSync(path))
|
|
70
|
+
return;
|
|
71
|
+
let vars;
|
|
72
|
+
try {
|
|
73
|
+
vars = parseEnv(readFileSync(path, "utf8"));
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
79
|
+
if (process.env[key] !== undefined)
|
|
80
|
+
continue;
|
|
81
|
+
process.env[key] = value;
|
|
82
|
+
sources.set(key, path);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function packageVersion() {
|
|
86
|
+
try {
|
|
87
|
+
return JSON.parse(readFileSync(join(PACKAGE_ROOT, "package.json"), "utf8")).version ?? "";
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return "";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function packageRoot() {
|
|
94
|
+
let dir = import.meta.dirname;
|
|
95
|
+
while (!existsSync(join(dir, "package.json"))) {
|
|
96
|
+
const parent = dirname(dir);
|
|
97
|
+
if (parent === dir)
|
|
98
|
+
return import.meta.dirname;
|
|
99
|
+
dir = parent;
|
|
100
|
+
}
|
|
101
|
+
return dir;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAE1C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAEtD,0EAA0E;AAC1E,qEAAqE;AACrE,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,YAAY,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAE/C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,C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M,CAAC,IAAI,CAAC,OAAO,CAAC;QAC/C,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { mcpConfig, seedMetadataCache, vendorBundle } from "./mcp.js";
|
|
2
|
+
/** The MCP adapter, configured from the environment, as a pi extension. */
|
|
3
|
+
export default async function mcpExtension(pi) {
|
|
4
|
+
const config = mcpConfig();
|
|
5
|
+
await seedMetadataCache(config);
|
|
6
|
+
const { createMcpAdapter } = (await import(vendorBundle()));
|
|
7
|
+
await createMcpAdapter({ config })(pi);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=mcp-extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-extension.js","sourceRoot":"","sources":["../../src/mcp-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEtE,2EAA2E;AAC3E,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY,CAAC,EAAW;IACpD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC,CAEzD,CAAC;IACF,MAAM,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/src/mcp.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { PACKAGE_ROOT, PI_STATE_DIR } from "./env.js";
|
|
6
|
+
const require_ = createRequire(import.meta.url);
|
|
7
|
+
export const SERVER = "testomatio";
|
|
8
|
+
/**
|
|
9
|
+
* Promoted to their own tools instead of going through the proxy: the reads the
|
|
10
|
+
* skills reach for constantly. @testomatio/mcp exposes 90 tools and registering
|
|
11
|
+
* them all would cost roughly 15k tokens of system prompt, which is the bloat
|
|
12
|
+
* the proxy exists to avoid. Everything else stays reachable through `mcp`.
|
|
13
|
+
*/
|
|
14
|
+
export const DIRECT_TOOLS = [
|
|
15
|
+
"tests_list",
|
|
16
|
+
"tests_get",
|
|
17
|
+
"tests_search",
|
|
18
|
+
"suites_list",
|
|
19
|
+
"suites_get",
|
|
20
|
+
"runs_list",
|
|
21
|
+
"runs_get",
|
|
22
|
+
"testruns_list",
|
|
23
|
+
"plans_list",
|
|
24
|
+
"plans_get",
|
|
25
|
+
"labels_list",
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* The Testomat.io MCP server needs a project id as well as a token — a token on
|
|
29
|
+
* its own does not identify a project to it. Without one the agent still reaches
|
|
30
|
+
* the project through `check-tests` and REST, which need only the token, so the
|
|
31
|
+
* prompt says exactly that instead of naming tools that are not there.
|
|
32
|
+
*/
|
|
33
|
+
export function tmsAccess() {
|
|
34
|
+
if (hasMcp())
|
|
35
|
+
return "mcp-proxy";
|
|
36
|
+
return "cli-only";
|
|
37
|
+
}
|
|
38
|
+
export function hasTestomatio() {
|
|
39
|
+
return Boolean(process.env.TESTOMATIO);
|
|
40
|
+
}
|
|
41
|
+
export function hasMcp() {
|
|
42
|
+
return Boolean(process.env.TESTOMATIO && projectId());
|
|
43
|
+
}
|
|
44
|
+
function projectId() {
|
|
45
|
+
return process.env.TESTOMATIO_PROJECT_ID ?? "";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* An in-memory server definition built from the environment. Deliberately not
|
|
49
|
+
* discovered from the checkout: a CI clone must not be able to point the agent
|
|
50
|
+
* at an MCP server of its own.
|
|
51
|
+
*/
|
|
52
|
+
export function mcpConfig() {
|
|
53
|
+
const args = [
|
|
54
|
+
require_.resolve("@testomatio/mcp/index.js"),
|
|
55
|
+
"--token",
|
|
56
|
+
process.env.TESTOMATIO ?? "",
|
|
57
|
+
"--project",
|
|
58
|
+
projectId(),
|
|
59
|
+
];
|
|
60
|
+
const env = {};
|
|
61
|
+
if (process.env.TESTOMATIO_URL)
|
|
62
|
+
env.TESTOMATIO_BASE_URL = process.env.TESTOMATIO_URL;
|
|
63
|
+
return {
|
|
64
|
+
mcpServers: {
|
|
65
|
+
[SERVER]: {
|
|
66
|
+
command: process.execPath,
|
|
67
|
+
args,
|
|
68
|
+
env,
|
|
69
|
+
lifecycle: "lazy",
|
|
70
|
+
directTools: DIRECT_TOOLS,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function metadataCachePath() {
|
|
76
|
+
return join(PI_STATE_DIR, "mcp-cache.json");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The MCP adapter, bundled at build time (see scripts/vendor-entry.ts). The
|
|
80
|
+
* specifier is built at runtime so it is never resolved at compile time — the
|
|
81
|
+
* bundle only exists after a build.
|
|
82
|
+
*/
|
|
83
|
+
export function vendorBundle() {
|
|
84
|
+
return pathToFileURL(join(PACKAGE_ROOT, "dist", "vendor", "mcp.js")).href;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Direct tools are registered from the adapter's metadata cache, which does not
|
|
88
|
+
* exist on a fresh CI runner — so a first run would degrade to proxy-only. The
|
|
89
|
+
* tool metadata ships with this package as mcp-tools.json (generated from
|
|
90
|
+
* @testomatio/mcp's own definitions), and this writes it as a cache entry.
|
|
91
|
+
*
|
|
92
|
+
* The entry is keyed by a hash of the resolved server definition, so the hash
|
|
93
|
+
* comes from the adapter's own bundled code rather than a copy of its logic — a
|
|
94
|
+
* mismatch would silently invalidate the seed. A failure here is not fatal: the
|
|
95
|
+
* run continues proxy-only, which still works.
|
|
96
|
+
*/
|
|
97
|
+
export async function seedMetadataCache(config) {
|
|
98
|
+
const cachePath = metadataCachePath();
|
|
99
|
+
if (existsSync(cachePath))
|
|
100
|
+
return;
|
|
101
|
+
const tools = readSeedTools();
|
|
102
|
+
if (tools.length === 0)
|
|
103
|
+
return;
|
|
104
|
+
const hash = await computeServerHash(config.mcpServers[SERVER]);
|
|
105
|
+
if (!hash)
|
|
106
|
+
return;
|
|
107
|
+
const cache = {
|
|
108
|
+
version: 1,
|
|
109
|
+
servers: {
|
|
110
|
+
[SERVER]: {
|
|
111
|
+
configHash: hash,
|
|
112
|
+
tools,
|
|
113
|
+
resources: [],
|
|
114
|
+
cachedAt: Date.now(),
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
mkdirSync(PI_STATE_DIR, { recursive: true });
|
|
119
|
+
writeFileSync(cachePath, `${JSON.stringify(cache, null, 2)}\n`, "utf8");
|
|
120
|
+
}
|
|
121
|
+
function readSeedTools() {
|
|
122
|
+
const path = join(PACKAGE_ROOT, "mcp-tools.json");
|
|
123
|
+
try {
|
|
124
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function computeServerHash(definition) {
|
|
131
|
+
try {
|
|
132
|
+
const vendor = (await import(vendorBundle()));
|
|
133
|
+
return vendor.computeServerHash(definition);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CA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CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,aAAa;IACpB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAClD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,UAAmB;IAClD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC,CAE3C,CAAC;QACF,OAAO,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Provider key env vars the CLI picks up from the environment. */
|
|
2
|
+
export const PROVIDER_KEYS = [
|
|
3
|
+
{ provider: "openrouter", env: "OPENROUTER_API_KEY" },
|
|
4
|
+
{ provider: "anthropic", env: "ANTHROPIC_API_KEY" },
|
|
5
|
+
{ provider: "openai", env: "OPENAI_API_KEY" },
|
|
6
|
+
{ provider: "google", env: "GEMINI_API_KEY" },
|
|
7
|
+
];
|
|
8
|
+
/** Bad usage — the caller prints the message and exits 2, never prompting. */
|
|
9
|
+
export class UsageError extends Error {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* --model, then TESTEIYA_MODEL, then the model a resumed session was running.
|
|
13
|
+
* CI often has no model configured, so TESTEIYA_MODEL is the channel there. The
|
|
14
|
+
* desktop app's `~/.testeiya/config.json` is not consulted — a CI run must not
|
|
15
|
+
* depend on a choice made in someone's GUI. Anything unresolvable throws, so a
|
|
16
|
+
* run never falls through to a prompt.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveModel(runtime, explicit, saved) {
|
|
19
|
+
const candidate = explicit || process.env.TESTEIYA_MODEL;
|
|
20
|
+
let parsed = null;
|
|
21
|
+
if (candidate) {
|
|
22
|
+
parsed = splitModelId(candidate);
|
|
23
|
+
if (!parsed) {
|
|
24
|
+
throw new UsageError(`a model must be <provider>/<model-id>, got "${candidate}"`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!parsed && saved)
|
|
28
|
+
parsed = { provider: saved.provider, id: saved.modelId };
|
|
29
|
+
if (!parsed) {
|
|
30
|
+
throw new UsageError("no model — pass --model <provider>/<id> or set TESTEIYA_MODEL");
|
|
31
|
+
}
|
|
32
|
+
const model = runtime.getModel(parsed.provider, parsed.id);
|
|
33
|
+
if (!model) {
|
|
34
|
+
throw new UsageError(`unknown model "${parsed.id}" for provider "${parsed.provider}"`);
|
|
35
|
+
}
|
|
36
|
+
return requireAuth(runtime, model);
|
|
37
|
+
}
|
|
38
|
+
/** Hand the runtime whichever provider keys the environment resolved. */
|
|
39
|
+
export async function applyEnvKeys(runtime) {
|
|
40
|
+
for (const { provider, env } of PROVIDER_KEYS) {
|
|
41
|
+
const key = process.env[env];
|
|
42
|
+
if (!key)
|
|
43
|
+
continue;
|
|
44
|
+
if (runtime.hasConfiguredAuth(provider))
|
|
45
|
+
continue;
|
|
46
|
+
await runtime.setRuntimeApiKey(provider, key);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Without this the run reaches pi's own credential error, which points at a
|
|
50
|
+
// `/login` command this CLI does not have and at paths inside node_modules.
|
|
51
|
+
function requireAuth(runtime, model) {
|
|
52
|
+
if (runtime.hasConfiguredAuth(model.provider))
|
|
53
|
+
return model;
|
|
54
|
+
const known = PROVIDER_KEYS.find((k) => k.provider === model.provider);
|
|
55
|
+
let how = `save a key for "${model.provider}" in ~/.testeiya/auth.json`;
|
|
56
|
+
if (known)
|
|
57
|
+
how = `set ${known.env} in the environment or ~/.testeiya/.env`;
|
|
58
|
+
throw new UsageError(`no API key for ${model.provider} (model ${model.id}) — ${how}`);
|
|
59
|
+
}
|
|
60
|
+
// Splits on the FIRST slash — OpenRouter model ids contain slashes themselves.
|
|
61
|
+
function splitModelId(value) {
|
|
62
|
+
const slash = value.indexOf("/");
|
|
63
|
+
if (slash <= 0)
|
|
64
|
+
return null;
|
|
65
|
+
const provider = value.slice(0, slash);
|
|
66
|
+
const id = value.slice(slash + 1);
|
|
67
|
+
if (!id)
|
|
68
|
+
return null;
|
|
69
|
+
return { provider, id };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/model.ts"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAA6C;IACrE,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,EAAE;IACrD,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,mBAAmB,EAAE;IACnD,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE;IAC7C,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE;CAC9C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAExC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAAqB,EAAE,QAAiB,EAAE,KAAyB;IAC9F,MAAM,SAAS,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IACzD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,UAAU,CAAC,+CAA+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E,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvE,IAAI,GAAG,GAAG,mBAAmB,KAAK,CAAC,QAAQ,4BAA4B,CAAC;IACxE,IAAI,KAAK;QAAE,GAAG,GAAG,OAAO,KAAK,CAAC,GAAG,yCAAyC,CAAC;IAC3E,MAAM,IAAI,UAAU,CAAC,kBAAkB,KAAK,CAAC,QAAQ,WAAW,KAAK,CAAC,EAAE,OAAO,GAAG,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,+EAA+E;AAC/E,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRuntime } from "./session.js";
|
|
2
|
+
export async function runModels(pattern, json) {
|
|
3
|
+
const runtime = await createRuntime();
|
|
4
|
+
// Providers with a key, from the SDK catalog. getAvailable() probes the
|
|
5
|
+
// network for every provider and one bad response takes the whole list down.
|
|
6
|
+
const available = runtime
|
|
7
|
+
.getProviders()
|
|
8
|
+
.filter((provider) => runtime.hasConfiguredAuth(provider.id))
|
|
9
|
+
.flatMap((provider) => runtime.getModels(provider.id));
|
|
10
|
+
const ids = available
|
|
11
|
+
.map((model) => `${model.provider}/${model.id}`)
|
|
12
|
+
.filter((id) => !pattern || id.toLowerCase().includes(pattern.toLowerCase()))
|
|
13
|
+
.sort();
|
|
14
|
+
if (json) {
|
|
15
|
+
process.stdout.write(`${JSON.stringify({ models: ids }, null, 2)}\n`);
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
if (ids.length === 0) {
|
|
19
|
+
if (available.length > 0) {
|
|
20
|
+
process.stdout.write(` no model matches "${pattern}"\n`);
|
|
21
|
+
return 1;
|
|
22
|
+
}
|
|
23
|
+
process.stdout.write(" no provider key found — see: testeiya doctor\n");
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
let provider = "";
|
|
27
|
+
for (const id of ids) {
|
|
28
|
+
const current = id.slice(0, id.indexOf("/"));
|
|
29
|
+
if (current !== provider) {
|
|
30
|
+
provider = current;
|
|
31
|
+
process.stdout.write(`\n ${provider}\n`);
|
|
32
|
+
}
|
|
33
|
+
process.stdout.write(` ${id}\n`);
|
|
34
|
+
}
|
|
35
|
+
process.stdout.write("\n Pass one with --model, or set TESTEIYA_MODEL.\n");
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAA2B,EAAE,IAAc;IACzE,MAAM,OAAO,GAAG,MAAM,aAAa,EAAE,CAAC;IACtC,wEAAwE;IACxE,6EAA6E;IAC7E,MAAM,SAAS,GAAG,OAAO;SACtB,YAAY,EAAE;SACd,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SAC5D,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAG,S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C,CAAC;IACtC,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC5E,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { access, constants, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
const GH_SCHEME = "gh:";
|
|
5
|
+
/**
|
|
6
|
+
* Where the report goes. Only known schemes are recognised: a generic
|
|
7
|
+
* `<word>:` test would swallow `C:\reports\out.md` on Windows.
|
|
8
|
+
*/
|
|
9
|
+
export function parseDestinations(values, json) {
|
|
10
|
+
const destinations = [];
|
|
11
|
+
for (const value of values) {
|
|
12
|
+
const destination = parseOne(value.trim());
|
|
13
|
+
if (typeof destination === "string")
|
|
14
|
+
return destination;
|
|
15
|
+
destinations.push(destination);
|
|
16
|
+
}
|
|
17
|
+
if (destinations.filter((d) => d.kind === "markdown").length > 1) {
|
|
18
|
+
return "only one markdown --output — the agent writes that file itself";
|
|
19
|
+
}
|
|
20
|
+
if (json)
|
|
21
|
+
destinations.push({ kind: "json" });
|
|
22
|
+
if (destinations.length === 0)
|
|
23
|
+
destinations.push({ kind: "stdout" });
|
|
24
|
+
return destinations;
|
|
25
|
+
}
|
|
26
|
+
/** The file the agent is told to write, if any. */
|
|
27
|
+
export function markdownPath(destinations) {
|
|
28
|
+
for (const destination of destinations) {
|
|
29
|
+
if (destination.kind === "markdown")
|
|
30
|
+
return destination.path;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check every destination before the run starts. A ten-minute run that then
|
|
36
|
+
* cannot post is the worst outcome, so this spends no tokens to find out.
|
|
37
|
+
*/
|
|
38
|
+
export async function preflight(destinations) {
|
|
39
|
+
for (const destination of destinations) {
|
|
40
|
+
const path = filePath(destination);
|
|
41
|
+
if (path) {
|
|
42
|
+
const dir = dirname(resolve(path));
|
|
43
|
+
const writable = await access(dir, constants.W_OK).then(pass, fail);
|
|
44
|
+
if (!writable)
|
|
45
|
+
return `cannot write to ${dir}`;
|
|
46
|
+
}
|
|
47
|
+
if (destination.kind !== "gh")
|
|
48
|
+
continue;
|
|
49
|
+
const gh = await run("gh", ["--version"]);
|
|
50
|
+
if (gh.code !== 0)
|
|
51
|
+
return "gh is not installed — see https://cli.github.com";
|
|
52
|
+
const pr = await resolvePullRequest(destination.pr);
|
|
53
|
+
if (!pr)
|
|
54
|
+
return "no pull request for this branch — pass gh:pr#<number>";
|
|
55
|
+
destination.pr = pr;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
/** Route the finished report. Returns a message when a destination failed. */
|
|
60
|
+
export async function deliver(destinations, envelope) {
|
|
61
|
+
for (const destination of destinations) {
|
|
62
|
+
const failure = await deliverOne(destination, envelope);
|
|
63
|
+
if (failure)
|
|
64
|
+
return failure;
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The report as delivered, header above it and footer under it. A footer is
|
|
70
|
+
* how a thread stays a thread: it tells the reader what to type to answer a
|
|
71
|
+
* posted comment.
|
|
72
|
+
*/
|
|
73
|
+
export function decorate(report, decoration) {
|
|
74
|
+
const header = decoration?.header?.trim();
|
|
75
|
+
const footer = decoration?.footer?.trim();
|
|
76
|
+
let body = report.trimEnd();
|
|
77
|
+
if (header)
|
|
78
|
+
body = `${header}\n\n${body}`;
|
|
79
|
+
if (footer)
|
|
80
|
+
body = `${body}\n\n${footer}`;
|
|
81
|
+
return `${body}\n`;
|
|
82
|
+
}
|
|
83
|
+
/** What signs the report when the caller writes no footer of their own. */
|
|
84
|
+
export function defaultFooter(model) {
|
|
85
|
+
return `*🧚🏻♀️ Provided by [Testeiya QA Agent](https://testomat.ai/testeiya) & ${modelName(model)}*`;
|
|
86
|
+
}
|
|
87
|
+
/** The model name you would recognise, without the provider namespace. */
|
|
88
|
+
export function modelName(model) {
|
|
89
|
+
return model.slice(model.lastIndexOf("/") + 1);
|
|
90
|
+
}
|
|
91
|
+
async function deliverOne(destination, envelope) {
|
|
92
|
+
// The agent wrote this file, so it is rewritten rather than written: what
|
|
93
|
+
// lands on disk is the same body every other destination gets.
|
|
94
|
+
if (destination.kind === "markdown") {
|
|
95
|
+
if (!envelope.report)
|
|
96
|
+
return null;
|
|
97
|
+
const written = await writeFile(destination.path, envelope.report, "utf8").then(pass, fail);
|
|
98
|
+
if (!written)
|
|
99
|
+
return `could not write ${destination.path}`;
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
if (destination.kind === "json") {
|
|
103
|
+
const body = `${JSON.stringify(envelope, null, 2)}\n`;
|
|
104
|
+
if (!destination.path) {
|
|
105
|
+
process.stdout.write(body);
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const written = await writeFile(destination.path, body, "utf8").then(pass, fail);
|
|
109
|
+
if (!written)
|
|
110
|
+
return `could not write ${destination.path}`;
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
if (!envelope.report)
|
|
114
|
+
return null;
|
|
115
|
+
if (destination.kind === "stdout") {
|
|
116
|
+
process.stdout.write(envelope.report);
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const result = await run("gh", ["pr", "comment", String(destination.pr), "--body-file", "-"], {
|
|
120
|
+
stdin: envelope.report,
|
|
121
|
+
});
|
|
122
|
+
if (result.code !== 0)
|
|
123
|
+
return `gh pr comment failed: ${result.stderr.trim() || result.code}`;
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
function parseOne(value) {
|
|
127
|
+
if (!value)
|
|
128
|
+
return "empty --output";
|
|
129
|
+
if (value.startsWith(GH_SCHEME))
|
|
130
|
+
return parseGithub(value.slice(GH_SCHEME.length));
|
|
131
|
+
if (value.endsWith(".json"))
|
|
132
|
+
return { kind: "json", path: value };
|
|
133
|
+
return { kind: "markdown", path: value };
|
|
134
|
+
}
|
|
135
|
+
function parseGithub(target) {
|
|
136
|
+
if (target === "pr" || target === "pr-comment")
|
|
137
|
+
return { kind: "gh" };
|
|
138
|
+
if (target.startsWith("pr#")) {
|
|
139
|
+
const number = Number(target.slice(3));
|
|
140
|
+
if (Number.isInteger(number) && number > 0)
|
|
141
|
+
return { kind: "gh", pr: number };
|
|
142
|
+
}
|
|
143
|
+
return `unknown output "gh:${target}" — use gh:pr-comment or gh:pr#123`;
|
|
144
|
+
}
|
|
145
|
+
function filePath(destination) {
|
|
146
|
+
if (destination.kind === "markdown")
|
|
147
|
+
return destination.path;
|
|
148
|
+
if (destination.kind === "json")
|
|
149
|
+
return destination.path;
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
async function resolvePullRequest(explicit) {
|
|
153
|
+
if (explicit)
|
|
154
|
+
return explicit;
|
|
155
|
+
const fromEvent = await pullRequestFromEvent();
|
|
156
|
+
if (fromEvent)
|
|
157
|
+
return fromEvent;
|
|
158
|
+
const fromRef = pullRequestFromRef();
|
|
159
|
+
if (fromRef)
|
|
160
|
+
return fromRef;
|
|
161
|
+
const view = await run("gh", ["pr", "view", "--json", "number", "-q", ".number"]);
|
|
162
|
+
if (view.code !== 0)
|
|
163
|
+
return null;
|
|
164
|
+
return positive(view.stdout.trim());
|
|
165
|
+
}
|
|
166
|
+
// GitHub Actions describes the event it triggered on in a file, and that is the
|
|
167
|
+
// only place a `pull_request_target` run states its number.
|
|
168
|
+
async function pullRequestFromEvent() {
|
|
169
|
+
const path = process.env.GITHUB_EVENT_PATH;
|
|
170
|
+
if (!path)
|
|
171
|
+
return null;
|
|
172
|
+
const raw = await readFile(path, "utf8").catch(() => "");
|
|
173
|
+
if (!raw)
|
|
174
|
+
return null;
|
|
175
|
+
let event;
|
|
176
|
+
try {
|
|
177
|
+
event = JSON.parse(raw);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return event.pull_request?.number ?? event.issue?.number ?? null;
|
|
183
|
+
}
|
|
184
|
+
function pullRequestFromRef() {
|
|
185
|
+
const ref = process.env.GITHUB_REF ?? "";
|
|
186
|
+
if (!ref.startsWith("refs/pull/"))
|
|
187
|
+
return null;
|
|
188
|
+
return positive(ref.split("/")[2] ?? "");
|
|
189
|
+
}
|
|
190
|
+
function positive(value) {
|
|
191
|
+
const number = Number(value);
|
|
192
|
+
if (Number.isInteger(number) && number > 0)
|
|
193
|
+
return number;
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
function run(command, args, options) {
|
|
197
|
+
return new Promise((done) => {
|
|
198
|
+
const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
|
|
199
|
+
let stdout = "";
|
|
200
|
+
let stderr = "";
|
|
201
|
+
child.stdout.on("data", (chunk) => (stdout += chunk));
|
|
202
|
+
child.stderr.on("data", (chunk) => (stderr += chunk));
|
|
203
|
+
child.on("error", (err) => done({ code: 127, stdout, stderr: err.message }));
|
|
204
|
+
child.on("close", (code) => done({ code: code ?? 1, stdout, stderr }));
|
|
205
|
+
if (options?.stdin)
|
|
206
|
+
child.stdin.write(options.stdin);
|
|
207
|
+
child.stdin.end();
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function pass() {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
function fail() {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C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";
|
|
2
|
+
export function createSetResultTool(runtime) {
|
|
3
|
+
return {
|
|
4
|
+
name: "set_result",
|
|
5
|
+
label: "Set run result",
|
|
6
|
+
description: "Set the outcome of this non-interactive run, which becomes the process " +
|
|
7
|
+
"exit code. Call once with status 'fail' when the verdict is negative — " +
|
|
8
|
+
"regressions found, a quality gate unmet, tests broken, or the task could " +
|
|
9
|
+
"not be completed. Do not call it on success: the run passes by default. " +
|
|
10
|
+
"This does not end the run; finish your work and write your report as usual.",
|
|
11
|
+
parameters: Type.Object({
|
|
12
|
+
status: Type.Union([Type.Literal("pass"), Type.Literal("fail")], {
|
|
13
|
+
description: "'fail' exits the process with code 1; 'pass' with code 0.",
|
|
14
|
+
}),
|
|
15
|
+
reason: Type.String({
|
|
16
|
+
description: "One line explaining the verdict, shown to whoever runs the command " +
|
|
17
|
+
"(e.g. '3 of 12 checkout tests have no assertions').",
|
|
18
|
+
}),
|
|
19
|
+
}),
|
|
20
|
+
async execute(_toolCallId, params) {
|
|
21
|
+
const p = params;
|
|
22
|
+
runtime.status = p.status;
|
|
23
|
+
runtime.reason = p.reason;
|
|
24
|
+
return {
|
|
25
|
+
content: [
|
|
26
|
+
{
|
|
27
|
+
type: "text",
|
|
28
|
+
text: `Recorded: ${p.status}. The command will exit ${exitFor(p.status)}.`,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
details: p,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function exitFor(status) {
|
|
37
|
+
if (status === "fail")
|
|
38
|
+
return 1;
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=result.js.map
|