testeiya 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -19
- package/dist/prompt/clis.d.ts +7 -0
- package/dist/prompt/pipeline-report.d.ts +1 -0
- package/dist/prompt/report.d.ts +10 -0
- package/dist/prompt/system-prompt.d.ts +22 -0
- package/dist/prompt/testomat.io.d.ts +19 -0
- package/dist/prompt/thread.d.ts +73 -0
- package/dist/src/args.d.ts +39 -0
- package/dist/src/attribution-extension.d.ts +3 -0
- package/dist/src/checkpoint.d.ts +30 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +27 -32
- package/dist/src/cli.js.map +1 -1
- package/dist/src/doctor.d.ts +11 -0
- package/dist/src/env.d.ts +30 -0
- package/dist/src/exec.d.ts +11 -0
- package/dist/src/git.d.ts +41 -0
- package/dist/src/langfuse-extension.d.ts +7 -0
- package/dist/src/langfuse.d.ts +67 -0
- package/dist/src/mcp.d.ts +19 -0
- package/dist/src/model.d.ts +20 -0
- package/dist/src/models.d.ts +1 -0
- package/dist/src/output.d.ts +84 -0
- package/dist/src/pipeline/command-stage.d.ts +12 -0
- package/dist/src/pipeline/crash-guard.d.ts +12 -0
- package/dist/src/pipeline/crash-guard.js +21 -0
- package/dist/src/pipeline/crash-guard.js.map +1 -0
- package/dist/src/pipeline/diagram.d.ts +24 -0
- package/dist/src/pipeline/gate.d.ts +21 -0
- package/dist/src/pipeline/launcher.d.ts +33 -0
- package/dist/src/pipeline/launcher.js +16 -3
- package/dist/src/pipeline/launcher.js.map +1 -1
- package/dist/src/pipeline/log.d.ts +29 -0
- package/dist/src/pipeline/log.js +9 -0
- package/dist/src/pipeline/log.js.map +1 -1
- package/dist/src/pipeline/overlay.d.ts +29 -0
- package/dist/src/pipeline/pipeline-file.d.ts +44 -0
- package/dist/src/pipeline/pipeline.d.ts +78 -0
- package/dist/src/pipeline/pipeline.js +22 -0
- package/dist/src/pipeline/pipeline.js.map +1 -1
- package/dist/src/pipeline/report.d.ts +26 -0
- package/dist/src/pipeline/report.js +13 -0
- package/dist/src/pipeline/report.js.map +1 -1
- package/dist/src/pipeline/spec.d.ts +63 -0
- package/dist/src/pipeline/stage-env.d.ts +13 -0
- package/dist/src/pipeline/stage-env.js +31 -0
- package/dist/src/pipeline/stage-env.js.map +1 -0
- package/dist/src/pipeline/stage.d.ts +71 -0
- package/dist/src/pipeline/stage.js.map +1 -1
- package/dist/src/pipeline/state.d.ts +63 -0
- package/dist/src/pipeline/summary-stage.d.ts +24 -0
- package/dist/src/pipeline/task-stage.d.ts +24 -0
- package/dist/src/pipeline/task-stage.js +86 -2
- package/dist/src/pipeline/task-stage.js.map +1 -1
- package/dist/src/pipeline/variables.d.ts +20 -0
- package/dist/src/result.d.ts +6 -0
- package/dist/src/run.d.ts +69 -0
- package/dist/src/run.js +116 -60
- package/dist/src/run.js.map +1 -1
- package/dist/src/session.d.ts +43 -0
- package/dist/src/sessions.d.ts +23 -0
- package/dist/src/skills.d.ts +29 -0
- package/package.json +11 -2
- package/pipelines/api-testing.yml +1 -1
- package/scripts/vendor-skills.js +62 -0
- package/skills/codeceptjs/ci-fix-tests/SKILL.md +0 -119
- package/skills/codeceptjs/codeceptjs-auth/SKILL.md +0 -141
- package/skills/codeceptjs/codeceptjs-exploration/SKILL.md +0 -100
- package/skills/codeceptjs/codeceptjs-fundamentals/SKILL.md +0 -196
- package/skills/codeceptjs/codeceptjs-run-analysis/SKILL.md +0 -83
- package/skills/codeceptjs/debugging-codeceptjs-tests/SKILL.md +0 -126
- package/skills/codeceptjs/lint-codeceptjs-tests/SKILL.md +0 -104
- package/skills/codeceptjs/migrate-codeceptjs-4/SKILL.md +0 -109
- package/skills/codeceptjs/migrate-cypress-to-codeceptjs/SKILL.md +0 -295
- package/skills/codeceptjs/migrate-protractor-to-codeceptjs/SKILL.md +0 -339
- package/skills/codeceptjs/migrate-selenium-java-to-codeceptjs/SKILL.md +0 -459
- package/skills/codeceptjs/migrate-testcafe-to-codeceptjs/SKILL.md +0 -338
- package/skills/codeceptjs/refactoring-codeceptjs-tests/SKILL.md +0 -78
- package/skills/codeceptjs/writing-codeceptjs-tests/SKILL.md +0 -102
- package/skills/playwright/playwright-best-practices/SKILL.md +0 -303
- package/skills/playwright/playwright-best-practices/advanced/authentication-flows.md +0 -360
- package/skills/playwright/playwright-best-practices/advanced/authentication.md +0 -871
- package/skills/playwright/playwright-best-practices/advanced/clock-mocking.md +0 -364
- package/skills/playwright/playwright-best-practices/advanced/mobile-testing.md +0 -409
- package/skills/playwright/playwright-best-practices/advanced/multi-context.md +0 -288
- package/skills/playwright/playwright-best-practices/advanced/multi-user.md +0 -393
- package/skills/playwright/playwright-best-practices/advanced/network-advanced.md +0 -452
- package/skills/playwright/playwright-best-practices/advanced/third-party.md +0 -464
- package/skills/playwright/playwright-best-practices/architecture/pom-vs-fixtures.md +0 -363
- package/skills/playwright/playwright-best-practices/architecture/test-architecture.md +0 -369
- package/skills/playwright/playwright-best-practices/architecture/when-to-mock.md +0 -383
- package/skills/playwright/playwright-best-practices/browser-apis/browser-apis.md +0 -391
- package/skills/playwright/playwright-best-practices/browser-apis/iframes.md +0 -403
- package/skills/playwright/playwright-best-practices/browser-apis/service-workers.md +0 -504
- package/skills/playwright/playwright-best-practices/browser-apis/websockets.md +0 -403
- package/skills/playwright/playwright-best-practices/core/annotations.md +0 -424
- package/skills/playwright/playwright-best-practices/core/assertions-waiting.md +0 -361
- package/skills/playwright/playwright-best-practices/core/configuration.md +0 -452
- package/skills/playwright/playwright-best-practices/core/fixtures-hooks.md +0 -417
- package/skills/playwright/playwright-best-practices/core/global-setup.md +0 -434
- package/skills/playwright/playwright-best-practices/core/locators.md +0 -242
- package/skills/playwright/playwright-best-practices/core/page-object-model.md +0 -315
- package/skills/playwright/playwright-best-practices/core/projects-dependencies.md +0 -453
- package/skills/playwright/playwright-best-practices/core/test-data.md +0 -492
- package/skills/playwright/playwright-best-practices/core/test-suite-structure.md +0 -361
- package/skills/playwright/playwright-best-practices/core/test-tags.md +0 -298
- package/skills/playwright/playwright-best-practices/debugging/console-errors.md +0 -420
- package/skills/playwright/playwright-best-practices/debugging/debugging.md +0 -504
- package/skills/playwright/playwright-best-practices/debugging/error-testing.md +0 -360
- package/skills/playwright/playwright-best-practices/debugging/flaky-tests.md +0 -496
- package/skills/playwright/playwright-best-practices/frameworks/angular.md +0 -530
- package/skills/playwright/playwright-best-practices/frameworks/nextjs.md +0 -469
- package/skills/playwright/playwright-best-practices/frameworks/react.md +0 -531
- package/skills/playwright/playwright-best-practices/frameworks/vue.md +0 -574
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/ci-cd.md +0 -468
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/docker.md +0 -283
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/github-actions.md +0 -546
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/gitlab.md +0 -397
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/other-providers.md +0 -521
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/parallel-sharding.md +0 -371
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/performance.md +0 -453
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/reporting.md +0 -424
- package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/test-coverage.md +0 -497
- package/skills/playwright/playwright-best-practices/testing-patterns/accessibility.md +0 -359
- package/skills/playwright/playwright-best-practices/testing-patterns/api-testing.md +0 -719
- package/skills/playwright/playwright-best-practices/testing-patterns/browser-extensions.md +0 -506
- package/skills/playwright/playwright-best-practices/testing-patterns/canvas-webgl.md +0 -493
- package/skills/playwright/playwright-best-practices/testing-patterns/component-testing.md +0 -500
- package/skills/playwright/playwright-best-practices/testing-patterns/drag-drop.md +0 -576
- package/skills/playwright/playwright-best-practices/testing-patterns/electron.md +0 -509
- package/skills/playwright/playwright-best-practices/testing-patterns/file-operations.md +0 -377
- package/skills/playwright/playwright-best-practices/testing-patterns/file-upload-download.md +0 -562
- package/skills/playwright/playwright-best-practices/testing-patterns/forms-validation.md +0 -561
- package/skills/playwright/playwright-best-practices/testing-patterns/graphql-testing.md +0 -331
- package/skills/playwright/playwright-best-practices/testing-patterns/i18n.md +0 -508
- package/skills/playwright/playwright-best-practices/testing-patterns/performance-testing.md +0 -476
- package/skills/playwright/playwright-best-practices/testing-patterns/security-testing.md +0 -430
- package/skills/playwright/playwright-best-practices/testing-patterns/visual-regression.md +0 -634
- package/skills/playwright/playwright-cli/SKILL.md +0 -489
- package/skills/playwright/playwright-cli/references/element-attributes.md +0 -23
- package/skills/playwright/playwright-cli/references/playwright-tests.md +0 -39
- package/skills/playwright/playwright-cli/references/pr-attachments.md +0 -60
- package/skills/playwright/playwright-cli/references/request-mocking.md +0 -87
- package/skills/playwright/playwright-cli/references/running-code.md +0 -245
- package/skills/playwright/playwright-cli/references/session-management.md +0 -227
- package/skills/playwright/playwright-cli/references/storage-state.md +0 -275
- package/skills/playwright/playwright-cli/references/test-generation.md +0 -433
- package/skills/playwright/playwright-cli/references/tracing.md +0 -139
- package/skills/playwright/playwright-cli/references/video-recording.md +0 -216
- package/skills/skills.lock.json +0 -89
- package/skills/skills.yaml +0 -35
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-fundamentals/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-fundamentals/references/no-install.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-plan/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/explorbot-setup/SKILL.md +0 -0
- /package/skills/{testomatio/explorbot → explorbot}/prima/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-lead-strategy-advisor/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-lead-strategy-advisor/references/output-format.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/qa-review-pr/SKILL.md +0 -0
- /package/skills/{testomatio/qa-process → qa-process}/testing-workflow/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/catalog-features/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/catalog-features/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/references/features.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/detect-product-mismatches/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/pull-request-diff-analyzer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/references/answer-shapes.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-explain-behavior/references/examples.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-pr-requirements-analyzer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-pr-requirements-analyzer/references/summary-example.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-requirement-reviewer/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-requirement-reviewer/references/requirements_reviewer_examples.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/qa-thinking/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/SKILL.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/references/behaviors.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/wiki-from-code/references/layout.md +0 -0
- /package/skills/{testomatio/requirements → requirements}/write-user-story/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/CLAUDE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/CODECEPTJS_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/FINAL_SUMMARY_TEMPLATE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/PLAYWRIGHT_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/POM_BEST_PRACTICES.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/automate-manual-test-cases/references/TEST_DATA_MANAGEMENT.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/debug-fix-failed-flaky-autotests/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/debug-fix-failed-flaky-autotests/references/DEBUGGING_QUICK_REFERENCE.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/epic-requirements-specification/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/qa-automation-test-consolidation/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/qa-data-seeder/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/run-tests-with-testomatio-reporter/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/setup-change-aware-pr-testing/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/setup-ci-automation/SKILL.md +0 -0
- /package/skills/{testomatio/test-automation → test-automation}/testomat-allure-adapter/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-duplicate-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-duplicate-test-cases/references/DUPLICATE_INSTRUCTIONS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/detect-useless-tests/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/improve-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/improve-test-cases/references/TESTOMAT_MARKDOWN_EXAMPLE.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/CSV_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/CUSTOM_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/TESTMO_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/TESTRAIL_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/migrate-to-testomatio/references/XRAY_MIGRATION.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_ARTIFACTS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_HTML_REPORT.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_REPORTERS_CONFIG.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-split-testing-levels-pyramid/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-sprint-report-by-testomatio/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-sprint-report-by-testomatio/references/qa-sprint-report.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/references/COVERAGE_FILE_FORMAT.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/references/E2E_FRAMEWORKS.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-test-code-coverage/scripts/check-coverage.mjs +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/test-case-format.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/testomat-tms-guide.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/qa-write-test-cases/references/writing-rule.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/scan-automation-project/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/sync-test-cases-with-tms/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/sync-test-cases-with-tms/references/TESTOMATIO_CLI.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/testomatio-mcp/SKILL.md +0 -0
- /package/skills/{testomatio/test-management → test-management}/testomatio-mcp/references/MCP_SETUP.md +0 -0
package/README.md
CHANGED
|
@@ -168,16 +168,6 @@ testeiya task "Run explorbot against https://staging.example.com, max 10 tests,
|
|
|
168
168
|
--output explorbot-report.md
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
### Repair failing tests after a red build
|
|
172
|
-
|
|
173
|
-
On a failed CodeceptJS run, the `ci-fix-tests` skill attempts safe fixes only —
|
|
174
|
-
locator drift, missing waits — reruns just the failing scenarios, rolls back any
|
|
175
|
-
edit that did not help, and always writes `output/ci-fix.md` for the next job:
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
testeiya task "Fix the failed CodeceptJS tests using ci-fix-tests. No refactors."
|
|
179
|
-
```
|
|
180
|
-
|
|
181
171
|
### Audit the test suite on a schedule
|
|
182
172
|
|
|
183
173
|
Nightly, the agent walks the Testomat.io project and reports gaps — suites with
|
|
@@ -730,21 +720,19 @@ testeiya skills playwright # filter by name, category or description
|
|
|
730
720
|
testeiya skills --json # [{name, group, description}]
|
|
731
721
|
```
|
|
732
722
|
|
|
733
|
-
Categories today:
|
|
734
|
-
|
|
723
|
+
Categories today: requirements, test management, test automation, QA process,
|
|
724
|
+
Explorbot. One per plugin of
|
|
725
|
+
[testomatio/skills](https://github.com/testomatio/skills).
|
|
735
726
|
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
and nothing else; `node scripts/vendor-skills.js` fills the tree. Every release
|
|
740
|
-
runs it, so the published `testeiya` package ships each skill as current on
|
|
741
|
-
release day.
|
|
727
|
+
The skills are not committed here. `node scripts/vendor-skills.js` clones
|
|
728
|
+
testomatio/skills and copies them into `skills/`. Every release runs it, so the
|
|
729
|
+
published `testeiya` package ships each skill as current on release day.
|
|
742
730
|
|
|
743
731
|
`skillsOverride` in `src/session.ts` keeps only what is found under that tree,
|
|
744
732
|
so an arbitrary clone cannot hand the model its own skills. To add yours, point
|
|
745
733
|
`additionalSkillPaths` at your folder. [EXTENDING.md](EXTENDING.md) covers both hooks.
|
|
746
734
|
|
|
747
|
-
To
|
|
735
|
+
To change a skill, send a pull request to [testomatio/skills](https://github.com/testomatio/skills).
|
|
748
736
|
|
|
749
737
|
## Building your own agent
|
|
750
738
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a tracker question goes when a CLI is on PATH next to the MCP server.
|
|
3
|
+
* Never names a binary this machine lacks.
|
|
4
|
+
*/
|
|
5
|
+
export declare function cliRouting(): string;
|
|
6
|
+
/** The CLIs Testeiya knows, as the connections list names them. */
|
|
7
|
+
export declare function pathClis(): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pipelineReport: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const verdict: string;
|
|
2
|
+
export declare function report(options: ReportOptions): string[];
|
|
3
|
+
export declare function finalReport(path: string): string;
|
|
4
|
+
export declare const briefAnswer: string;
|
|
5
|
+
export interface ReportOptions {
|
|
6
|
+
/** Absolute path the agent must write its final report to (`--output`). */
|
|
7
|
+
outputFile?: string;
|
|
8
|
+
/** Answer a question instead of doing a task and reporting (`testeiya ask`). */
|
|
9
|
+
brief?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReportOptions } from "./report.js";
|
|
2
|
+
import { type TestomatioOptions } from "./testomat.io.js";
|
|
3
|
+
import { type ThreadOptions } from "./thread.js";
|
|
4
|
+
/**
|
|
5
|
+
* The system prompt of the `testeiya` command: a one-shot worker fired by a
|
|
6
|
+
* trigger. The prompt is the text below, top to bottom. What varies per run is
|
|
7
|
+
* filled in at the bottom of this file: how Testomat.io is reached, the
|
|
8
|
+
* sections a run adds (a comment thread), and the answer contract.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildSystemPrompt(options: SystemPromptOptions): string;
|
|
11
|
+
export type { TmsAccess } from "./testomat.io.js";
|
|
12
|
+
export interface SystemPromptOptions extends TestomatioOptions, ThreadOptions, ReportOptions {
|
|
13
|
+
cwd?: string;
|
|
14
|
+
/** CLI tools on PATH and signed in (e.g. `gh`, `acli`). */
|
|
15
|
+
connectedClis?: string[];
|
|
16
|
+
/** MCP servers connected for this run. */
|
|
17
|
+
connectedMcps?: string[];
|
|
18
|
+
/** Whole sections this run adds, such as the comment-thread rules. */
|
|
19
|
+
sections?: string[];
|
|
20
|
+
/** False when the pulled manual tests folder is switched off, so no rule points at it. */
|
|
21
|
+
manualTestsHint?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the agent works on the Testomat.io project. The rules are the same in
|
|
3
|
+
* every run; only the way to reach the dynamic data differs, so `tms` picks
|
|
4
|
+
* that one line.
|
|
5
|
+
*/
|
|
6
|
+
export declare function testomatio(options: TestomatioOptions): string;
|
|
7
|
+
/**
|
|
8
|
+
* `mcp-tools`: one tool per entity, named `mcp__testomatio__<tool>`. `cli-only`: no
|
|
9
|
+
* tools at all; `check-tests` and REST through the shell. `mcp-direct`: one tool
|
|
10
|
+
* per entity, prefixed `testomatio-<slug>`; the desktop app's one-shot mode.
|
|
11
|
+
*/
|
|
12
|
+
export type TmsAccess = "mcp-direct" | "mcp-tools" | "cli-only";
|
|
13
|
+
export interface TestomatioOptions {
|
|
14
|
+
/** How the agent reaches Testomat.io in this run. */
|
|
15
|
+
tms: TmsAccess;
|
|
16
|
+
/** A Testomat.io token is in the environment. */
|
|
17
|
+
connected?: boolean;
|
|
18
|
+
backendUrl?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this run continues, said as the three states a run can be in. A thread
|
|
3
|
+
* round knows its history from the checkpoint: "Since your last round" is in
|
|
4
|
+
* the task when there is one, so the prompt only names the state and the
|
|
5
|
+
* reading order. A first thread round and a standalone run share the rule that
|
|
6
|
+
* there is nothing to catch up on; the thread one adds that the thread starts
|
|
7
|
+
* with this answer.
|
|
8
|
+
*/
|
|
9
|
+
export declare function thread(options: ThreadOptions): string;
|
|
10
|
+
export type ThreadMode = "first" | "continuing";
|
|
11
|
+
export interface ThreadOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Where this run sits in its thread. `continuing` is a later round with
|
|
14
|
+
* history to catch up on; `first` opens a thread; undefined is a standalone
|
|
15
|
+
* run with no thread at all.
|
|
16
|
+
*/
|
|
17
|
+
threadMode?: ThreadMode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* How a host collapses a comment. The round is the same everywhere, so a host
|
|
21
|
+
* adds one line of mechanism, never a round of its own.
|
|
22
|
+
*
|
|
23
|
+
* The host comes from the environment, never from the remote: a remote says
|
|
24
|
+
* where the code lives, CI variables say we have a thread to answer in.
|
|
25
|
+
*/
|
|
26
|
+
declare const HOSTS: {
|
|
27
|
+
github: {
|
|
28
|
+
env: string[];
|
|
29
|
+
collapse: string;
|
|
30
|
+
};
|
|
31
|
+
gitlab: {
|
|
32
|
+
env: string[];
|
|
33
|
+
collapse: string;
|
|
34
|
+
};
|
|
35
|
+
bitbucket: {
|
|
36
|
+
env: string[];
|
|
37
|
+
collapse: string;
|
|
38
|
+
};
|
|
39
|
+
generic: {
|
|
40
|
+
env: never[];
|
|
41
|
+
collapse: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Which host this job belongs to. `generic` when it is CI and nothing claims it,
|
|
46
|
+
* nothing at all when it is not CI — a developer's own checkout has no thread.
|
|
47
|
+
*/
|
|
48
|
+
export declare function threadHost(env: Environment): ThreadHost | null;
|
|
49
|
+
/** What a comment of this thread opens with, and so what identifies it. */
|
|
50
|
+
export declare function threadMarker(thread: string): string;
|
|
51
|
+
export declare function commentThread(options: CommentThreadOptions): string;
|
|
52
|
+
export type ThreadHost = keyof typeof HOSTS;
|
|
53
|
+
type Environment = Record<string, string | undefined>;
|
|
54
|
+
export interface CommentThreadOptions extends ThreadOptions {
|
|
55
|
+
host: ThreadHost;
|
|
56
|
+
/** Which conversation this run is, so parallel runs never touch each other. */
|
|
57
|
+
thread: string;
|
|
58
|
+
/**
|
|
59
|
+
* The exact marker line a comment opens with. Built by the CLI so a comment
|
|
60
|
+
* the agent posts itself is stamped the same way as one the CLI delivers —
|
|
61
|
+
* the next round finds both by the same prefix.
|
|
62
|
+
*/
|
|
63
|
+
marker: string;
|
|
64
|
+
/** The report file, so the comment body is the report and not a remark. */
|
|
65
|
+
reportFile?: string;
|
|
66
|
+
/** The heading the CLI would have opened the report with, if any. */
|
|
67
|
+
header?: string;
|
|
68
|
+
/** The line the CLI would have signed the report with, if any. */
|
|
69
|
+
footer?: string;
|
|
70
|
+
/** True when the command posts the answer and collapses the older ones. */
|
|
71
|
+
delivered?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const WELCOME = "\n Testeiya, an AI testing agent.\n\n testeiya task \"analyze this pr and find inconsistencies\"\n testeiya ask \"is this feature ready\"\n testeiya pipeline web-testing\n\n testeiya doctor check your setup\n testeiya --help options and environment\n testeiya help the full guide\n";
|
|
2
|
+
export declare const USAGE = "testeiya, an AI testing agent\n\nUsage:\n testeiya task \"<task>\" run one task and write a report\n testeiya ask \"<question>\" answer a question\n testeiya pipeline <name> run a multi-stage pipeline, or list them with no name\n testeiya pipeline-check <name> check a pipeline file and its gates, run nothing\n testeiya doctor check what a run would resolve\n testeiya models [pattern] list the models your key can reach\n testeiya skills [pattern] list the skills bundled with this package\n testeiya sessions list saved sessions for this folder\n\nOptions:\n -o, --output <dest> report destination, repeatable: file.md, file.json, gh:pr-comment\n --model <id> provider/model to run\n --project <id> Testomat.io project id\n --followup <text> the user's reply, added to the task as a new message\n --thread <name> which conversation this is, for posted comments\n -c, --continue continue the last session in this folder\n --resume <id> continue that session\n --session <label> continue the session with that name, or start it\n --session-file <path> keep the session in that file, for CI caches\n --name <label> name the session\n --no-session do not save the session\n --exit-zero a negative verdict exits 0\n --header <text> line added above the report\n --footer <text> line added under the report\n --no-default-footer do not sign the report\n --no-thread keep out of the comment thread: post nothing, read no comments\n --json machine-readable output\n --probe doctor only: test the key with one request\n\nPipeline options:\n --dir <path> the pipeline folder; keep it between runs for rounds\n --dry-run show gates and stages, spend no tokens\n --set KEY=VALUE set a variable for every stage, repeatable\n --gate NAME:COMMAND skip the whole run unless COMMAND exits 0, repeatable\n --stage ID:YAML change one stage, e.g. 'plan:append_task: Be brief.'\n --pipeline YAML change the pipeline, e.g. 'append_summary: Be brief.'\n -h, --help show this\n -v, --version show version\n\nEnvironment:\n TESTEIYA_MODEL model to run, e.g. openrouter/anthropic/claude-sonnet-5\n TESTEIYA_FOLLOW_UP the user's reply, same as --followup\n TESTEIYA_THREAD which conversation this is, same as --thread\n TESTEIYA_SESSION_FILE where to keep the session, same as --session-file\n TESTEIYA_NO_DEFAULT_FOOTER do not sign the report\n OPENROUTER_API_KEY provider key, also ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY\n TESTOMATIO Testomat.io project API key\n TESTOMATIO_PROJECT_ID Testomat.io project id, same as --project\n TESTOMATIO_URL Testomat.io base url, for self-hosted\n\nRun \"testeiya help\" for the full guide.";
|
|
3
|
+
export declare const HELP = "testeiya, an AI testing agent\n\nUsage:\n testeiya task \"<task>\" run one task and write a report\n testeiya ask \"<question>\" answer a question\n testeiya pipeline <name> run a multi-stage pipeline, or list them with no name\n testeiya pipeline-check <name> check a pipeline file and its gates, run nothing\n testeiya doctor check what a run would resolve\n testeiya models [pattern] list the models your key can reach\n testeiya skills [pattern] list the skills bundled with this package\n testeiya sessions list saved sessions for this folder\n\nOptions:\n -o, --output <dest> report destination, repeatable: file.md, file.json, gh:pr-comment\n --model <id> provider/model to run\n --project <id> Testomat.io project id\n --followup <text> the user's reply, added to the task as a new message\n --thread <name> which conversation this is, for posted comments\n -c, --continue continue the last session in this folder\n --resume <id> continue that session\n --session <label> continue the session with that name, or start it\n --session-file <path> keep the session in that file, for CI caches\n --name <label> name the session\n --no-session do not save the session\n --exit-zero a negative verdict exits 0\n --header <text> line added above the report\n --footer <text> line added under the report\n --no-default-footer do not sign the report\n --no-thread keep out of the comment thread: post nothing, read no comments\n --json machine-readable output\n --probe doctor only: test the key with one request\n\nPipeline options:\n --dir <path> the pipeline folder; keep it between runs for rounds\n --dry-run show gates and stages, spend no tokens\n --set KEY=VALUE set a variable for every stage, repeatable\n --gate NAME:COMMAND skip the whole run unless COMMAND exits 0, repeatable\n --stage ID:YAML change one stage, e.g. 'plan:append_task: Be brief.'\n --pipeline YAML change the pipeline, e.g. 'append_summary: Be brief.'\n -h, --help show this\n -v, --version show version\n\nEnvironment:\n TESTEIYA_MODEL model to run, e.g. openrouter/anthropic/claude-sonnet-5\n TESTEIYA_FOLLOW_UP the user's reply, same as --followup\n TESTEIYA_THREAD which conversation this is, same as --thread\n TESTEIYA_SESSION_FILE where to keep the session, same as --session-file\n TESTEIYA_NO_DEFAULT_FOOTER do not sign the report\n OPENROUTER_API_KEY provider key, also ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY\n TESTOMATIO Testomat.io project API key\n TESTOMATIO_PROJECT_ID Testomat.io project id, same as --project\n TESTOMATIO_URL Testomat.io base url, for self-hosted\n\nRun \"testeiya help\" for the full guide.\n\nRunning a task\n\n The agent runs one task and exits. There is no interactive mode. Progress and\n errors go to stderr, so a run drops into CI as-is.\n\n A task can also come from stdin: cat task.md | testeiya task\n A task starting with \"-\" must follow \"--\": testeiya task -- \"-weird task\"\n\n Exit codes: 0 pass, 1 failed run or negative verdict, 2 bad usage, 130 interrupted.\n\n --exit-zero keeps a negative verdict from failing the command: a broken run\n still exits 1 and bad usage still exits 2. The verdict is still in the report\n and in the run envelope, so a pipeline can gate on it when it wants to.\n\nWhere the report goes\n\n --output names a destination and can repeat. Without one the report goes to\n stdout. --json prints the run envelope to stdout instead.\n\n report.md the agent writes the report there\n run.json the run envelope: verdict, reason, report, tokens, session id\n gh:pr-comment posted on this branch's pull request, through the GitHub CLI\n gh:pr#123 posted on that pull request\n\n --footer adds a line under the report and --header adds one above. Both go\n wherever the report goes: stdout, the file, the posted comment. Use --footer\n to say how to answer a comment, e.g. --footer \"> Reply with /testeiya\".\n\n The report is signed, unless you write your own footer:\n\n *\uD83E\uDDDA\uD83C\uDFFB\u200D\u2640\uFE0F Provided by [Testeiya QA Agent](https://testomat.ai/testeiya) & <model>*\n\n A posted comment also opens with the Testeiya logo and heading, unless you\n write your own --header.\n\n --no-default-footer drops the signature and the heading, so does\n TESTEIYA_NO_DEFAULT_FOOTER.\n\n Every destination is checked before the run starts, so a missing gh costs no\n tokens.\n\nComment threads\n\n In a thread the agent looks after its own comments instead of piling them up.\n A thread is any subject it posts into: a pull request, a merge request, an\n issue. Every comment it writes opens with an invisible marker naming the\n conversation and the commit it answered, so the next round finds its earlier\n work even when nothing was cached.\n\n Each round writes the complete current answer and makes the earlier ones\n recede. GitHub folds them, Bitbucket resolves them, GitLab keeps one note and\n rewrites it. Nothing is ever deleted. The host comes from the CI job, so a\n local run is never in a thread.\n\n --thread <name> says which conversation this is. Run two jobs on one pull\n request, say one grilling it and one writing test cases, and give each its own\n name so neither touches the other's comments. The default is \"default\".\n\n testeiya task \"Review this pull request\" --thread qa-review -o gh:pr-comment\n\nModels and keys\n\n There is no default model. Pass --model or set TESTEIYA_MODEL. A resumed run\n reuses its session's model. \"testeiya models\" lists what your key can reach.\n\n The provider key comes from the environment, from ~/.testeiya/.env, or from\n ~/.testeiya/auth.json. The desktop app reads ~/.testeiya/.env too, so a key\n there works in both.\n\nAnswering a reply\n\n --followup carries what the user said back to the agent. The task stays the\n standing instruction and the reply is added under it as a new user message,\n so one command serves both the first round and every answer after it.\n\n Set TESTEIYA_FOLLOW_UP instead when the text is a comment body: an empty\n value is ignored, so the same job runs unchanged when nobody replied.\n\n TESTEIYA_FOLLOW_UP=\"${{ github.event.comment.body || '' }}\" \\\n testeiya task \"Review this pull request\" --session pr-42 -o gh:pr-comment\n\n Pair it with --session <label> and the agent answers with its earlier work in\n front of it. Without a session the reply is still delivered, just without the\n thread behind it.\n\nSessions\n\n Runs are saved under ~/.testeiya, so a follow-up picks up where the last one\n stopped. -c continues the last session in this folder, --resume <id> picks\n another, --name labels one, and --no-session saves nothing.\n\n --session <label> is for a job that runs again and again on the same machine:\n it continues the session with that name, and starts it the first time. Give\n each thread its own label and they never mix.\n\n --session-file <path> is the one for CI. The whole session is that one file,\n so a runner that keeps nothing carries it between rounds as a cache or an\n artifact. It is written the first time and continued after that, with no\n \"does it exist yet\" branch. Keep it out of the working tree, or ignore it\n there, so the agent does not read its own transcript back as a file.\n\n testeiya task \"Review this pull request\" --session-file .cache/pr-42.jsonl\n\n A saved session also records the commit it ran on, its branch and origin, and\n the pull request it posted to. When the next round opens it on a newer commit,\n the agent is told the range it has not read and reads that first. On a pull\n request it is also told to read the comments added since. A round that broke\n records nothing, so the one after it still catches up from where work stopped.\n That history rides inside the session, so restoring it is all a round needs.\n The checkout still needs enough history to reach the commit it stopped on.\n\nSkills\n\n The package ships the skills the agent reads, and only those: skills found in\n the folder it runs in are ignored, so a checkout cannot hand it its own.\n \"testeiya skills\" lists them. Name one in the task with a slash and it is\n loaded before the run, e.g. \"/qa-thinking\". A name we do not ship is left\n alone, so a stray \"/word\" in the task is just a word.\n\nPipelines\n\n A pipeline is several stages in one YAML file: agent tasks and shell commands,\n run in order, passing files through one folder. \"testeiya pipeline\" lists the\n bundled ones; pass a path to run your own.\n\n testeiya pipeline web-testing -o gh:pr-comment\n testeiya pipeline .github/testeiya/regression.yml --set TEST_COMMAND=\"npx playwright test\"\n\n --gate adds a check from the CI job, e.g. --gate 'pr:test -n \"$PR_NUMBER\"'.\n When it fails the whole run is skipped and exits 0.\n\n --stage and --pipeline change a pipeline without copying it. Their value is\n YAML: a plain key replaces, append_ and prepend_ add, remove_ drops.\n\n testeiya pipeline issue-test-cases --stage 'requirements:append_task: Never assume credentials.'\n testeiya pipeline web-testing --stage 'explore:{timeout: 45m, append_when: [staging]}'\n\n A file of your own can start with \"extends: <name>\" and hold only the changes.\n\n A stage whose gate fails is skipped with the gate's message. A final summary\n reads every stage and is the only thing posted. Keep --dir between runs, as a\n CI cache per pull request, and a re-run on the same commit retries from the\n stage that stopped, while a new commit starts a round that updates the last one.\n --dry-run shows the plan and spends nothing. \"testeiya pipeline-check\" checks\n the file and every gate it declares, and prints the message of each gate that\n does not pass. It exits 1 when one does not, 2 when the file is invalid.\n --diagram also writes <name>.diagram.md: a Mermaid chart of the stages, the\n files they pass on, and the gates, coloured by the check.\n\nTestomat.io\n\n Set TESTOMATIO to a project API key and the agent reads and writes that\n project's tests, suites, runs and plans through check-tests and the REST API.\n Add the project id, with --project or TESTOMATIO_PROJECT_ID, and it also gets\n the Testomat.io tools. The MCP server needs the id: a token alone does not say\n which project to talk to.";
|
|
4
|
+
export declare const COMMANDS: readonly ["task", "ask", "pipeline", "pipeline-check", "models", "skills", "doctor", "sessions", "help"];
|
|
5
|
+
export declare function parseCliArgs(argv: string[]): CliArgs;
|
|
6
|
+
export type Command = (typeof COMMANDS)[number];
|
|
7
|
+
export interface CliArgs {
|
|
8
|
+
command?: Command | "welcome" | "usage" | "version";
|
|
9
|
+
prompt?: string;
|
|
10
|
+
pattern?: string;
|
|
11
|
+
outputs?: string[];
|
|
12
|
+
json?: boolean;
|
|
13
|
+
probe?: boolean;
|
|
14
|
+
model?: string;
|
|
15
|
+
project?: string;
|
|
16
|
+
followUp?: string;
|
|
17
|
+
thread?: string;
|
|
18
|
+
continueLast?: boolean;
|
|
19
|
+
resume?: string;
|
|
20
|
+
session?: string;
|
|
21
|
+
sessionFile?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
noSession?: boolean;
|
|
24
|
+
exitZero?: boolean;
|
|
25
|
+
header?: string;
|
|
26
|
+
footer?: string;
|
|
27
|
+
noDefaultFooter?: boolean;
|
|
28
|
+
noThread?: boolean;
|
|
29
|
+
pipeline?: string;
|
|
30
|
+
dir?: string;
|
|
31
|
+
dryRun?: boolean;
|
|
32
|
+
diagram?: boolean;
|
|
33
|
+
sets?: Record<string, string>;
|
|
34
|
+
gates?: Record<string, string>;
|
|
35
|
+
pipelineOverrides?: string[];
|
|
36
|
+
stageOverrides?: string[];
|
|
37
|
+
/** Set when argv was malformed; the caller prints the message and exits 2. */
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SessionManager } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { Repo } from "./git.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where the checkout stood when a round finished. A resumed session carries the
|
|
5
|
+
* conversation but not the world it happened in: CI hands the next round a new
|
|
6
|
+
* commit and a thread of comments the transcript has never seen, and an agent
|
|
7
|
+
* that does not know that answers about code nobody is looking at any more.
|
|
8
|
+
*/
|
|
9
|
+
export declare function readCheckpoint(repo: Repo, pr?: number): Checkpoint | null;
|
|
10
|
+
/** The checkpoint the last round left behind, if this session has one. */
|
|
11
|
+
export declare function lastCheckpoint(manager: SessionManager): Checkpoint | null;
|
|
12
|
+
/**
|
|
13
|
+
* Written only when the round produced something, so a broken run leaves the
|
|
14
|
+
* older commit standing and the next one still reads everything since.
|
|
15
|
+
*/
|
|
16
|
+
export declare function saveCheckpoint(manager: SessionManager, checkpoint: Checkpoint): void;
|
|
17
|
+
/**
|
|
18
|
+
* What the agent has to catch up on, as a procedure it can run. Nothing moved
|
|
19
|
+
* means nothing is said — an unchanged checkout on a fresh comment still gets
|
|
20
|
+
* the pull request line, which is the whole point of a comment round.
|
|
21
|
+
*/
|
|
22
|
+
export declare function describeUpdate(previous: Checkpoint | null, current: Checkpoint | null): string | null;
|
|
23
|
+
export interface Checkpoint {
|
|
24
|
+
commit: string;
|
|
25
|
+
/** ISO timestamp of the round that wrote it — the cut-off for "new comments". */
|
|
26
|
+
at: string;
|
|
27
|
+
branch?: string;
|
|
28
|
+
remote?: string;
|
|
29
|
+
pr?: number;
|
|
30
|
+
}
|
package/dist/src/cli.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { chalkStderr as c } from "chalk";
|
|
2
3
|
import { HELP, parseCliArgs, USAGE, WELCOME } from "./args.js";
|
|
3
4
|
import { runDoctor } from "./doctor.js";
|
|
4
5
|
import { loadEnvFiles, VERSION } from "./env.js";
|
|
5
6
|
import { resolveModel, UsageError } from "./model.js";
|
|
6
7
|
import { runModels } from "./models.js";
|
|
7
8
|
import { runSkills } from "./skills.js";
|
|
8
|
-
import { parseDestinations, preflight } from "./output.js";
|
|
9
9
|
import { Pipeline } from "./pipeline/pipeline.js";
|
|
10
|
-
import {
|
|
10
|
+
import { runTask } from "./run.js";
|
|
11
11
|
import { createRuntime } from "./session.js";
|
|
12
|
-
import {
|
|
12
|
+
import { runSessions } from "./sessions.js";
|
|
13
13
|
main(process.argv.slice(2)).catch((err) => {
|
|
14
14
|
process.stderr.write(`${err?.message ?? err}\n`);
|
|
15
15
|
process.exit(1);
|
|
@@ -72,42 +72,37 @@ async function task(args) {
|
|
|
72
72
|
process.stderr.write(` ${args.command} needs something to work on\n\n${USAGE}\n`);
|
|
73
73
|
process.exit(2);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
throw new UsageError(unreachable);
|
|
82
|
-
// A job-level TESTEIYA_SESSION_FILE must not quietly redirect a run that named
|
|
83
|
-
// its own session on the command line.
|
|
84
|
-
if (!args.session && !args.resume && !args.continueLast) {
|
|
85
|
-
args.sessionFile ??= process.env.TESTEIYA_SESSION_FILE;
|
|
86
|
-
}
|
|
87
|
-
const sessionManager = await openSessionManager(process.cwd(), args);
|
|
88
|
-
if (typeof sessionManager === "string")
|
|
89
|
-
throw new UsageError(sessionManager);
|
|
90
|
-
if (args.name)
|
|
91
|
-
sessionManager.appendSessionInfo(args.name);
|
|
92
|
-
let sessionId = null;
|
|
93
|
-
if (!args.noSession)
|
|
94
|
-
sessionId = sessionManager.getSessionId();
|
|
95
|
-
const brief = args.command === "ask";
|
|
96
|
-
return runPrint({
|
|
75
|
+
const controller = new AbortController();
|
|
76
|
+
process.on("SIGINT", () => {
|
|
77
|
+
process.stderr.write(`${c.yellow("\n ⨯ interrupted")}\n`);
|
|
78
|
+
controller.abort("interrupted");
|
|
79
|
+
});
|
|
80
|
+
const { envelope, code, undelivered } = await runTask({
|
|
97
81
|
prompt,
|
|
98
82
|
followUp,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
83
|
+
outputs: args.outputs ?? [],
|
|
84
|
+
json: args.json,
|
|
85
|
+
brief: args.command === "ask",
|
|
86
|
+
continueLast: args.continueLast,
|
|
87
|
+
resume: args.resume,
|
|
88
|
+
session: args.session,
|
|
89
|
+
sessionFile: args.sessionFile,
|
|
90
|
+
noSession: args.noSession,
|
|
91
|
+
name: args.name,
|
|
104
92
|
model: args.model,
|
|
105
|
-
|
|
93
|
+
thread: args.thread,
|
|
106
94
|
header: args.header,
|
|
107
95
|
footer: args.footer,
|
|
108
96
|
noDefaultFooter: args.noDefaultFooter,
|
|
109
97
|
noThread: args.noThread,
|
|
110
|
-
|
|
98
|
+
exitZero: args.exitZero,
|
|
99
|
+
}, { signal: controller.signal });
|
|
100
|
+
// The report is worth more than the destination: never lose it.
|
|
101
|
+
if (undelivered && envelope.report)
|
|
102
|
+
process.stdout.write(envelope.report);
|
|
103
|
+
if (controller.signal.aborted)
|
|
104
|
+
return 130;
|
|
105
|
+
return code;
|
|
111
106
|
}
|
|
112
107
|
async function pipeline(args) {
|
|
113
108
|
if (!args.pipeline)
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAgB,MAAM,WAAW,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C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KAAe,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything a run resolves silently: which key file won, whether skills loaded,
|
|
3
|
+
* whether MCP is on. Reads config only — `--probe` is the one check that spends.
|
|
4
|
+
*/
|
|
5
|
+
export declare function runDoctor(options: DoctorOptions): Promise<number>;
|
|
6
|
+
export interface DoctorOptions {
|
|
7
|
+
envSources: Map<string, string>;
|
|
8
|
+
json?: boolean;
|
|
9
|
+
probe?: boolean;
|
|
10
|
+
model?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Testeiya's state directory, shared with the desktop app: a provider key saved
|
|
3
|
+
* in its Settings dialog works here with no extra step.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TESTEIYA_HOME: string;
|
|
6
|
+
/**
|
|
7
|
+
* This package's root, found by walking up to package.json — `dist/src` when
|
|
8
|
+
* built, `src` when run from source. Bundled files resolve from here.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PACKAGE_ROOT: string;
|
|
11
|
+
/** This package's version, read from the same package.json. */
|
|
12
|
+
export declare const VERSION: string;
|
|
13
|
+
/**
|
|
14
|
+
* Where pi keeps its own state for this CLI. Deliberately not `~/.pi` — running
|
|
15
|
+
* `npx testeiya` must not write into a user's own pi installation.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PI_STATE_DIR: string;
|
|
18
|
+
/**
|
|
19
|
+
* Fill gaps in process.env from `~/.testeiya/.env`, then from any `.env` found
|
|
20
|
+
* walking up from the working directory — so running in a repo picks up that
|
|
21
|
+
* repo's key. Exported variables always win; this only fills gaps.
|
|
22
|
+
*
|
|
23
|
+
* The walk starts at cwd, never at this file: an installed package sits under
|
|
24
|
+
* some node_modules whose ancestors are none of the agent's business, and
|
|
25
|
+
* silently adopting a key from there is a surprise, not a convenience.
|
|
26
|
+
*
|
|
27
|
+
* Returns the file each variable came from, which is what `doctor` reports.
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadEnvFiles(): Map<string, string>;
|
|
30
|
+
export declare function parseEnv(content: string): Record<string, string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Run a command and collect it. Never throws: a missing binary is code 127. */
|
|
2
|
+
export declare function run(command: string, args: string[], options?: RunOptions): Promise<Executed>;
|
|
3
|
+
export interface RunOptions {
|
|
4
|
+
cwd?: string;
|
|
5
|
+
stdin?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Executed {
|
|
8
|
+
code: number;
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** The git questions the CLI asks about its checkout. */
|
|
2
|
+
export declare class Git {
|
|
3
|
+
private readonly cwd;
|
|
4
|
+
constructor(cwd: string);
|
|
5
|
+
headCommit(): Promise<string | null>;
|
|
6
|
+
/** The PR source branch in CI, or the checked-out branch locally. */
|
|
7
|
+
branch(env?: Env): Promise<string | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Where the checkout stands, read once. The marker stamps the commit on a
|
|
10
|
+
* comment, the pull request section picks its host from the remote, and the
|
|
11
|
+
* checkpoint keeps both for the next round — one set of git calls for all three.
|
|
12
|
+
*/
|
|
13
|
+
repo(): Promise<Repo>;
|
|
14
|
+
/**
|
|
15
|
+
* The files this change touched. A later round counts from the commit the last
|
|
16
|
+
* round ran on; the first round, or a `since` the checkout cannot reach (a
|
|
17
|
+
* force-push), counts from the merge base with the target branch.
|
|
18
|
+
*/
|
|
19
|
+
changes(since: string | null, env: Env): Promise<Changes>;
|
|
20
|
+
/** The target branch, as the CI names it. */
|
|
21
|
+
private baseBranch;
|
|
22
|
+
private diff;
|
|
23
|
+
private reachable;
|
|
24
|
+
/** Trimmed stdout, or null when git fails or says nothing. */
|
|
25
|
+
private read;
|
|
26
|
+
private git;
|
|
27
|
+
}
|
|
28
|
+
type Env = Record<string, string | undefined>;
|
|
29
|
+
export interface Repo {
|
|
30
|
+
commit: string | null;
|
|
31
|
+
branch: string | null;
|
|
32
|
+
remote: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface Changes {
|
|
35
|
+
/** Null when git could not say. */
|
|
36
|
+
files: string[] | null;
|
|
37
|
+
/** The commit or branch they were counted from. */
|
|
38
|
+
from: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* The run as a Langfuse trace: one agent observation per prompt, a generation
|
|
4
|
+
* per LLM call with tokens and cost, a tool observation per tool call. Off
|
|
5
|
+
* unless LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY are both set.
|
|
6
|
+
*/
|
|
7
|
+
export default function langfuseExtension(pi: ExtensionAPI): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Langfuse keys, or null when this run is not traced. */
|
|
2
|
+
export declare function langfuseConfig(env?: NodeJS.ProcessEnv): LangfuseConfig | null;
|
|
3
|
+
/**
|
|
4
|
+
* Spans held in memory, shipped as one OTLP request. Langfuse reads OTLP over
|
|
5
|
+
* plain JSON, so a trace costs no dependency: an install of this CLI carries no
|
|
6
|
+
* OpenTelemetry SDK for a feature most runs never turn on.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createTracer(config: LangfuseConfig): Tracer;
|
|
9
|
+
export declare function otlpPayload(spans: OtlpSpan[]): OtlpPayload;
|
|
10
|
+
export declare function spanAttributes(name: string, fields: SpanFields, root: boolean): OtlpAttribute[];
|
|
11
|
+
export interface LangfuseConfig {
|
|
12
|
+
publicKey: string;
|
|
13
|
+
secretKey: string;
|
|
14
|
+
baseUrl: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Tracer {
|
|
17
|
+
/** Opens a trace of its own. Everything below it hangs off this span. */
|
|
18
|
+
trace(name: string, fields: SpanFields): Span;
|
|
19
|
+
flush(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface Span {
|
|
22
|
+
child(name: string, fields: SpanFields): Span;
|
|
23
|
+
update(fields: SpanFields): void;
|
|
24
|
+
end(fields?: SpanFields): void;
|
|
25
|
+
}
|
|
26
|
+
export interface SpanFields {
|
|
27
|
+
type?: "agent" | "generation" | "tool" | "span";
|
|
28
|
+
input?: unknown;
|
|
29
|
+
output?: unknown;
|
|
30
|
+
model?: string;
|
|
31
|
+
usage?: Record<string, number>;
|
|
32
|
+
cost?: Record<string, number>;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
level?: "DEFAULT" | "WARNING" | "ERROR";
|
|
35
|
+
tags?: string[];
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface OtlpSpan {
|
|
39
|
+
traceId: string;
|
|
40
|
+
spanId: string;
|
|
41
|
+
parentSpanId?: string;
|
|
42
|
+
name: string;
|
|
43
|
+
kind: number;
|
|
44
|
+
startTimeUnixNano: string;
|
|
45
|
+
endTimeUnixNano: string;
|
|
46
|
+
attributes: OtlpAttribute[];
|
|
47
|
+
status: Record<string, never>;
|
|
48
|
+
}
|
|
49
|
+
export interface OtlpAttribute {
|
|
50
|
+
key: string;
|
|
51
|
+
value: {
|
|
52
|
+
stringValue: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface OtlpPayload {
|
|
56
|
+
resourceSpans: Array<{
|
|
57
|
+
resource: {
|
|
58
|
+
attributes: OtlpAttribute[];
|
|
59
|
+
};
|
|
60
|
+
scopeSpans: Array<{
|
|
61
|
+
scope: {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
spans: OtlpSpan[];
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LoadedMcpConfig } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { TmsAccess } from "../prompt/testomat.io.js";
|
|
3
|
+
export declare const SERVER = "testomatio";
|
|
4
|
+
/**
|
|
5
|
+
* The Testomat.io MCP server needs a project id as well as a token — a token on
|
|
6
|
+
* its own does not identify a project to it. Without one the agent still reaches
|
|
7
|
+
* the project through `check-tests` and REST, which need only the token, so the
|
|
8
|
+
* prompt says exactly that instead of naming tools that are not there.
|
|
9
|
+
*/
|
|
10
|
+
export declare function tmsAccess(): TmsAccess;
|
|
11
|
+
export declare function hasTestomatio(): boolean;
|
|
12
|
+
export declare function hasMcp(): boolean;
|
|
13
|
+
export declare function mcpServerScript(): string;
|
|
14
|
+
/**
|
|
15
|
+
* The one server pi's MCP extension connects, built from the environment.
|
|
16
|
+
* Replaces pi's own config loading, so a CI clone cannot point the agent at an
|
|
17
|
+
* MCP server of its own through `.pi/mcp.json`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function mcpConfig(): LoadedMcpConfig;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import type { SavedModel } from "./sessions.js";
|
|
3
|
+
/** Provider key env vars the CLI picks up from the environment. */
|
|
4
|
+
export declare const PROVIDER_KEYS: Array<{
|
|
5
|
+
provider: string;
|
|
6
|
+
env: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Bad usage — the caller prints the message and exits 2, never prompting. */
|
|
9
|
+
export declare 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 declare function resolveModel(runtime: ModelRuntime, explicit?: string, saved?: SavedModel | null): import("@earendil-works/pi-ai").Model<import("@earendil-works/pi-ai").Api>;
|
|
19
|
+
/** Hand the runtime whichever provider keys the environment resolved. */
|
|
20
|
+
export declare function applyEnvKeys(runtime: ModelRuntime): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runModels(pattern: string | undefined, json?: boolean): Promise<number>;
|