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
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the report goes. Only known schemes are recognised: a generic
|
|
3
|
+
* `<word>:` test would swallow `C:\reports\out.md` on Windows.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseDestinations(values: string[], json?: boolean): Destination[] | string;
|
|
6
|
+
/** The file the agent is told to write, if any. */
|
|
7
|
+
export declare function markdownPath(destinations: Destination[]): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Check every destination before the run starts. A ten-minute run that then
|
|
10
|
+
* cannot post is the worst outcome, so this spends no tokens to find out.
|
|
11
|
+
*/
|
|
12
|
+
export declare function preflight(destinations: Destination[]): Promise<string | null>;
|
|
13
|
+
/** Route the finished report. Returns a message when a destination failed. */
|
|
14
|
+
export declare function deliver(destinations: Destination[], envelope: RunEnvelope, thread?: ThreadState): Promise<string | null>;
|
|
15
|
+
/**
|
|
16
|
+
* This thread's comments, read before the run. Collapsing them afterwards needs
|
|
17
|
+
* no judgement: the answer posted in between cannot be in a list taken before
|
|
18
|
+
* it existed, which is the one thing an agent working the thread cannot know.
|
|
19
|
+
*/
|
|
20
|
+
export declare function threadComments(pr: number | undefined, thread?: string): Promise<string[]>;
|
|
21
|
+
/**
|
|
22
|
+
* The report as delivered, header above it and footer under it. The marker goes
|
|
23
|
+
* on top only in a thread: it is how a later round finds the comments we posted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function decorate(report: string, decoration?: Decoration): string;
|
|
26
|
+
/**
|
|
27
|
+
* What signs the text as ours. An HTML comment is invisible wherever markdown
|
|
28
|
+
* renders, and a later round reading the thread back knows which comments it
|
|
29
|
+
* wrote, which conversation they belong to, and what they were written against.
|
|
30
|
+
* Key=value, so a round with nothing restored can still parse it with `split`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function marker(fields?: MarkerFields): string;
|
|
33
|
+
/** A thread name safe inside an HTML comment, which cannot contain `--`. */
|
|
34
|
+
export declare function threadName(value?: string): string;
|
|
35
|
+
/** What a posted comment opens with when the caller writes no header of their own. */
|
|
36
|
+
export declare function defaultHeader(): string;
|
|
37
|
+
/** What signs the report when the caller writes no footer of their own. */
|
|
38
|
+
export declare function defaultFooter(model: string): string;
|
|
39
|
+
/** The pull request `preflight` resolved, when the report is posted to one. */
|
|
40
|
+
export declare function pullRequestNumber(destinations: Destination[]): number | undefined;
|
|
41
|
+
/** The model name you would recognise, without the provider namespace. */
|
|
42
|
+
export declare function modelName(model: string): string;
|
|
43
|
+
export interface Decoration extends MarkerFields {
|
|
44
|
+
header?: string;
|
|
45
|
+
footer?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface MarkerFields {
|
|
48
|
+
/** Which conversation this comment belongs to, so parallel runs never mix. */
|
|
49
|
+
thread?: string;
|
|
50
|
+
/** The commit the review was written against, read by the next round. */
|
|
51
|
+
commit?: string;
|
|
52
|
+
/** Short session id. Omitted on an unsaved run. */
|
|
53
|
+
session?: string;
|
|
54
|
+
}
|
|
55
|
+
/** This thread's comments as they were before the run. */
|
|
56
|
+
export interface ThreadState {
|
|
57
|
+
earlier: string[];
|
|
58
|
+
}
|
|
59
|
+
export type Destination = {
|
|
60
|
+
kind: "stdout";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "markdown";
|
|
63
|
+
path: string;
|
|
64
|
+
} | {
|
|
65
|
+
kind: "json";
|
|
66
|
+
path?: string;
|
|
67
|
+
} | {
|
|
68
|
+
kind: "gh";
|
|
69
|
+
pr?: number;
|
|
70
|
+
};
|
|
71
|
+
export interface RunEnvelope {
|
|
72
|
+
status: "pass" | "fail";
|
|
73
|
+
reason: string | null;
|
|
74
|
+
report: string | null;
|
|
75
|
+
reportPath: string | null;
|
|
76
|
+
model: string;
|
|
77
|
+
steps: number;
|
|
78
|
+
tokens: {
|
|
79
|
+
input: number;
|
|
80
|
+
output: number;
|
|
81
|
+
};
|
|
82
|
+
durationMs: number;
|
|
83
|
+
sessionId: string | null;
|
|
84
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Stage, type Item, type StageContext } from "./stage.js";
|
|
2
|
+
import type { StageResult } from "./state.js";
|
|
3
|
+
import type { Variables } from "./variables.js";
|
|
4
|
+
/** A shell command. Exit 0 passes, anything else fails. Its output goes to `<id>.log` in its folder. */
|
|
5
|
+
export declare class CommandStage extends Stage {
|
|
6
|
+
protected readonly result: {
|
|
7
|
+
field: "log";
|
|
8
|
+
extension: string;
|
|
9
|
+
};
|
|
10
|
+
files(): string[];
|
|
11
|
+
protected runItem(context: StageContext, item: Item, vars: Variables): Promise<StageResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* While an agent stage runs in this process, an error nobody caught (an
|
|
3
|
+
* extension, a tool) would kill the pipeline without a word in its state.
|
|
4
|
+
* The guard hands it to `onCrash`, which records the stage and exits.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CrashGuard {
|
|
7
|
+
private readonly onCrash;
|
|
8
|
+
private readonly listener;
|
|
9
|
+
constructor(onCrash: (err: unknown) => void);
|
|
10
|
+
arm(): void;
|
|
11
|
+
disarm(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* While an agent stage runs in this process, an error nobody caught (an
|
|
3
|
+
* extension, a tool) would kill the pipeline without a word in its state.
|
|
4
|
+
* The guard hands it to `onCrash`, which records the stage and exits.
|
|
5
|
+
*/
|
|
6
|
+
export class CrashGuard {
|
|
7
|
+
onCrash;
|
|
8
|
+
listener = (err) => this.onCrash(err);
|
|
9
|
+
constructor(onCrash) {
|
|
10
|
+
this.onCrash = onCrash;
|
|
11
|
+
}
|
|
12
|
+
arm() {
|
|
13
|
+
process.on("uncaughtException", this.listener);
|
|
14
|
+
process.on("unhandledRejection", this.listener);
|
|
15
|
+
}
|
|
16
|
+
disarm() {
|
|
17
|
+
process.off("uncaughtException", this.listener);
|
|
18
|
+
process.off("unhandledRejection", this.listener);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=crash-guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crash-guard.js","sourceRoot":"","sources":["../../../src/pipeline/crash-guard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,UAAU;IAGQ;IAFZ,QAAQ,GAAG,CAAC,GAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEhE,YAA6B,OAA+B;QAA/B,YAAO,GAAP,OAAO,CAAwB;IAAG,CAAC;IAEhE,GAAG;QACD,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PipelineSpec } from "./spec.js";
|
|
2
|
+
import type { Stage } from "./stage.js";
|
|
3
|
+
/**
|
|
4
|
+
* A pipeline as a Mermaid flowchart: stages in order, the files they hand
|
|
5
|
+
* each other, and the gates each one needs, coloured by the check.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Diagram {
|
|
8
|
+
private readonly spec;
|
|
9
|
+
private readonly stages;
|
|
10
|
+
private readonly results;
|
|
11
|
+
private readonly lines;
|
|
12
|
+
private readonly gateIds;
|
|
13
|
+
constructor(spec: PipelineSpec, stages: Stage[], results: Map<string, boolean>);
|
|
14
|
+
toMarkdown(): string;
|
|
15
|
+
toMermaid(): string;
|
|
16
|
+
private flow;
|
|
17
|
+
/** An input from an earlier stage is a dotted edge; one nobody writes is a file node. */
|
|
18
|
+
private files;
|
|
19
|
+
private gates;
|
|
20
|
+
private gate;
|
|
21
|
+
private stageShape;
|
|
22
|
+
private node;
|
|
23
|
+
private label;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Changes } from "../git.js";
|
|
2
|
+
import type { GateSpec } from "./spec.js";
|
|
3
|
+
import type { Variables } from "./variables.js";
|
|
4
|
+
/** A named check. It passes only when every check it has passes. */
|
|
5
|
+
export declare class Gate {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
private readonly spec;
|
|
8
|
+
constructor(name: string, spec: GateSpec);
|
|
9
|
+
/** A gate the CI job adds with `--gate NAME:COMMAND`. */
|
|
10
|
+
static command(name: string, run: string): Gate;
|
|
11
|
+
get message(): string;
|
|
12
|
+
get readsChanges(): boolean;
|
|
13
|
+
passes(context: GateContext): Promise<boolean>;
|
|
14
|
+
private matchesChanges;
|
|
15
|
+
private succeeds;
|
|
16
|
+
}
|
|
17
|
+
export interface GateContext {
|
|
18
|
+
cwd: string;
|
|
19
|
+
vars: Variables;
|
|
20
|
+
changes: Changes;
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Variables } from "./variables.js";
|
|
2
|
+
export declare const KILL_GRACE_MS = 5000;
|
|
3
|
+
/**
|
|
4
|
+
* Starts one stage process at a time, streams its output, and stops its whole
|
|
5
|
+
* process group on a timeout or Ctrl-C.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Launcher {
|
|
8
|
+
private readonly cwd;
|
|
9
|
+
interrupted: boolean;
|
|
10
|
+
private current;
|
|
11
|
+
private task;
|
|
12
|
+
constructor(cwd: string);
|
|
13
|
+
watchInterrupt(): void;
|
|
14
|
+
/** An agent stage running in this process: Ctrl-C aborts it. */
|
|
15
|
+
track(task: AbortController): void;
|
|
16
|
+
untrack(): void;
|
|
17
|
+
/** A shell command when `args` is null, otherwise a program and its arguments. */
|
|
18
|
+
start(launch: Launch): Promise<Launched>;
|
|
19
|
+
private kill;
|
|
20
|
+
}
|
|
21
|
+
export interface Launch {
|
|
22
|
+
command: string;
|
|
23
|
+
args: string[] | null;
|
|
24
|
+
vars: Variables;
|
|
25
|
+
/** Where to copy the output, besides the console. */
|
|
26
|
+
log: string | null;
|
|
27
|
+
timeout?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface Launched {
|
|
30
|
+
code: number;
|
|
31
|
+
timedOut: boolean;
|
|
32
|
+
interrupted: boolean;
|
|
33
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { createWriteStream } from "node:fs";
|
|
3
|
-
const KILL_GRACE_MS = 5_000;
|
|
3
|
+
export const KILL_GRACE_MS = 5_000;
|
|
4
4
|
/**
|
|
5
5
|
* Starts one stage process at a time, streams its output, and stops its whole
|
|
6
6
|
* process group on a timeout or Ctrl-C.
|
|
@@ -9,6 +9,7 @@ export class Launcher {
|
|
|
9
9
|
cwd;
|
|
10
10
|
interrupted = false;
|
|
11
11
|
current = null;
|
|
12
|
+
task = null;
|
|
12
13
|
constructor(cwd) {
|
|
13
14
|
this.cwd = cwd;
|
|
14
15
|
}
|
|
@@ -17,8 +18,18 @@ export class Launcher {
|
|
|
17
18
|
this.interrupted = true;
|
|
18
19
|
if (this.current)
|
|
19
20
|
this.kill(this.current, "SIGINT");
|
|
21
|
+
this.task?.abort("interrupted");
|
|
20
22
|
});
|
|
21
23
|
}
|
|
24
|
+
/** An agent stage running in this process: Ctrl-C aborts it. */
|
|
25
|
+
track(task) {
|
|
26
|
+
this.task = task;
|
|
27
|
+
if (this.interrupted)
|
|
28
|
+
task.abort("interrupted");
|
|
29
|
+
}
|
|
30
|
+
untrack() {
|
|
31
|
+
this.task = null;
|
|
32
|
+
}
|
|
22
33
|
/** A shell command when `args` is null, otherwise a program and its arguments. */
|
|
23
34
|
start(launch) {
|
|
24
35
|
return new Promise((done) => {
|
|
@@ -50,8 +61,10 @@ export class Launcher {
|
|
|
50
61
|
const finish = (code) => {
|
|
51
62
|
clearTimeout(timer);
|
|
52
63
|
this.current = null;
|
|
53
|
-
|
|
54
|
-
|
|
64
|
+
const result = { code, timedOut, interrupted: this.interrupted };
|
|
65
|
+
if (!file)
|
|
66
|
+
return done(result);
|
|
67
|
+
file.end(() => done(result));
|
|
55
68
|
};
|
|
56
69
|
child.on("error", (err) => {
|
|
57
70
|
forward(Buffer.from(`${err.message}\n`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../src/pipeline/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAwC,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAI9D,MAAM,aAAa,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../src/pipeline/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAwC,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAI9D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;AAEnC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAKU;IAJ7B,WAAW,GAAG,KAAK,CAAC;IACZ,OAAO,GAAwB,IAAI,CAAC;IACpC,IAAI,GAA2B,IAAI,CAAC;IAE5C,YAA6B,GAAW;QAAX,QAAG,GAAH,GAAG,CA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AC;YACF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;gBACzC,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,IAAI,CAAC,KAAmB,EAAE,MAAsB;QACtD,IAAI,CAAC,KAAK,CAAC,GAAG;YAAE,OAAO;QACvB,IAAI,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Changes } from "../git.js";
|
|
2
|
+
import type { Overlay } from "./overlay.js";
|
|
3
|
+
import type { StageRecord } from "./state.js";
|
|
4
|
+
/** What a pipeline prints while it runs. All of it goes to stderr. */
|
|
5
|
+
export declare class PipelineLog {
|
|
6
|
+
header(name: string, round: number, changes: Changes, dir: string): void;
|
|
7
|
+
valid(name: string, path: string): void;
|
|
8
|
+
/** One line per override: where it came from and the keys it changes. */
|
|
9
|
+
overlays(overlays: Overlay[]): void;
|
|
10
|
+
checked(failed: number): void;
|
|
11
|
+
skipped(reason: string): void;
|
|
12
|
+
interrupted(): void;
|
|
13
|
+
/** One line per stage: its mark, time, and status or a note. */
|
|
14
|
+
stage(record: StageRecord, detail?: string): void;
|
|
15
|
+
starting(name: string, item?: string): void;
|
|
16
|
+
/** An agent stage starting in this process. */
|
|
17
|
+
task(id: string, model: string | undefined, session: string | null, task: string): void;
|
|
18
|
+
/** A task that did not stop when asked: it runs on, its result is ignored. */
|
|
19
|
+
abandoned(id: string): void;
|
|
20
|
+
command(text: string): void;
|
|
21
|
+
gate(name: string, passed: boolean, message: string, mark?: string): void;
|
|
22
|
+
aiGate(problem: string | null): void;
|
|
23
|
+
/** A dry run's line for a stage. */
|
|
24
|
+
plan(id: string, mark: PlanMark, text: string): void;
|
|
25
|
+
note(message: string): void;
|
|
26
|
+
}
|
|
27
|
+
export declare const log: PipelineLog;
|
|
28
|
+
type PlanMark = "runs" | "skipped" | "not-run";
|
|
29
|
+
export {};
|
package/dist/src/pipeline/log.js
CHANGED
|
@@ -50,6 +50,15 @@ export class PipelineLog {
|
|
|
50
50
|
line += ` ${item}`;
|
|
51
51
|
this.note(c.dim(line));
|
|
52
52
|
}
|
|
53
|
+
/** An agent stage starting in this process. */
|
|
54
|
+
task(id, model, session, task) {
|
|
55
|
+
this.note(` ${c.dim("→")} ${id} ${c.dim("·")} ${model ?? "default model"} ${c.dim("·")} ${session ? `session ${session}` : "no session"}`);
|
|
56
|
+
this.note(c.dim(` ${task.split("\n")[0]}`));
|
|
57
|
+
}
|
|
58
|
+
/** A task that did not stop when asked: it runs on, its result is ignored. */
|
|
59
|
+
abandoned(id) {
|
|
60
|
+
this.note(c.yellow(` ⨯ ${id} did not stop, left running`));
|
|
61
|
+
}
|
|
53
62
|
command(text) {
|
|
54
63
|
this.note(c.dim(` $ ${text}`));
|
|
55
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/pipeline/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC;AAMzC,MAAM,KAAK,GAA2B;IACpC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAClB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChB,MAAM,EA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,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACvC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type Raw = Record<string, unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* Changes laid over a raw pipeline before it is validated. A plain key
|
|
4
|
+
* replaces, `append_` and `prepend_` add, `remove_` drops. Stages match by id,
|
|
5
|
+
* gates by name. PIPELINES.md documents every rule.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Overlay {
|
|
8
|
+
readonly source: string;
|
|
9
|
+
readonly raw: Raw;
|
|
10
|
+
constructor(source: string, raw: Raw);
|
|
11
|
+
/** `--pipeline YAML`: keys of the pipeline itself. */
|
|
12
|
+
static pipeline(text: string): Overlay;
|
|
13
|
+
/** `--stage ID:YAML`: keys of one stage. */
|
|
14
|
+
static stage(value: string): Overlay;
|
|
15
|
+
/** The keys this overlay changes, for logs: `requirements.append_task`. */
|
|
16
|
+
keys(): string[];
|
|
17
|
+
apply(base: Raw): Raw;
|
|
18
|
+
private stages;
|
|
19
|
+
private gates;
|
|
20
|
+
private merge;
|
|
21
|
+
private field;
|
|
22
|
+
private fail;
|
|
23
|
+
private static read;
|
|
24
|
+
private static split;
|
|
25
|
+
private static join;
|
|
26
|
+
private static list;
|
|
27
|
+
private static isRecord;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Overlay } from "./overlay.js";
|
|
2
|
+
import type { PipelineSpec } from "./spec.js";
|
|
3
|
+
/**
|
|
4
|
+
* A pipeline file: found by path or bundled name, then parsed and validated
|
|
5
|
+
* into a `PipelineSpec`. Every mistake is bad usage, found before a token is
|
|
6
|
+
* spent, and every message names the file.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PipelineFile {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
constructor(path: string);
|
|
11
|
+
/** A path when it looks like one, otherwise a bundled pipeline's name. */
|
|
12
|
+
static find(name: string): PipelineFile;
|
|
13
|
+
static bundled(): Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
}>;
|
|
18
|
+
text(): string;
|
|
19
|
+
read(overlays?: Overlay[]): PipelineSpec;
|
|
20
|
+
/** The spec with `extends` and every overlay applied, and the same as YAML, which needs neither. */
|
|
21
|
+
resolve(overlays?: Overlay[]): {
|
|
22
|
+
spec: PipelineSpec;
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
/** Parse text as this file, so a copy keeps the file's name. */
|
|
26
|
+
parse(text: string): PipelineSpec;
|
|
27
|
+
private raw;
|
|
28
|
+
private validate;
|
|
29
|
+
private gate;
|
|
30
|
+
private changes;
|
|
31
|
+
private stage;
|
|
32
|
+
private checkReferences;
|
|
33
|
+
private checkFilters;
|
|
34
|
+
private unknownKeys;
|
|
35
|
+
private string;
|
|
36
|
+
private list;
|
|
37
|
+
private map;
|
|
38
|
+
private fail;
|
|
39
|
+
private static isRecord;
|
|
40
|
+
private static titleOf;
|
|
41
|
+
private static emojiOf;
|
|
42
|
+
private static isSlug;
|
|
43
|
+
private static isPath;
|
|
44
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type TaskRunner } from "../run.js";
|
|
2
|
+
/**
|
|
3
|
+
* One run of a pipeline file. It picks the round, checks the gates, runs the
|
|
4
|
+
* stages in order through one folder, then a summary that is the only report.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Pipeline {
|
|
7
|
+
private readonly options;
|
|
8
|
+
private readonly cwd;
|
|
9
|
+
private readonly git;
|
|
10
|
+
private readonly launcher;
|
|
11
|
+
private readonly cli;
|
|
12
|
+
private readonly runTask;
|
|
13
|
+
private readonly overlays;
|
|
14
|
+
constructor(options: PipelineOptions);
|
|
15
|
+
static list(json?: boolean): number;
|
|
16
|
+
run(): Promise<number>;
|
|
17
|
+
/** Validates the file, then checks every gate it declares. Runs no stage. */
|
|
18
|
+
check(): Promise<number>;
|
|
19
|
+
private runStages;
|
|
20
|
+
/** The summary reads every stage and writes the one report that is posted. */
|
|
21
|
+
private summarize;
|
|
22
|
+
private context;
|
|
23
|
+
/** The process is in an unknown state after an uncaught error: save what ran, stop. */
|
|
24
|
+
private crashed;
|
|
25
|
+
private interrupted;
|
|
26
|
+
/** A retry finishes the round it started, so a file edited since cannot reorder the stages half-way through. */
|
|
27
|
+
private spec;
|
|
28
|
+
private gates;
|
|
29
|
+
/**
|
|
30
|
+
* Each stage gets a numbered folder, padded so they sort in order. An output may
|
|
31
|
+
* not take the stage's own file names, nor be one of its inputs: those are links
|
|
32
|
+
* to another stage's files.
|
|
33
|
+
*/
|
|
34
|
+
private stages;
|
|
35
|
+
private variables;
|
|
36
|
+
/** Each gate once. A shallow clone cannot say what changed, and a silent skip would look like a quiet pull request. */
|
|
37
|
+
private checkGates;
|
|
38
|
+
/** Every input comes from an earlier stage, the runner, or the folder itself. */
|
|
39
|
+
private checkInputs;
|
|
40
|
+
private inputsSkipped;
|
|
41
|
+
/** The last stage before the reader that wrote the input, else the top of the folder. */
|
|
42
|
+
private locate;
|
|
43
|
+
private whyMissing;
|
|
44
|
+
private keptRecord;
|
|
45
|
+
/** The summary is an agent, so a pipeline with one needs a model. */
|
|
46
|
+
private needsAi;
|
|
47
|
+
private aiProblem;
|
|
48
|
+
private folder;
|
|
49
|
+
private dryRun;
|
|
50
|
+
}
|
|
51
|
+
export interface PipelineOptions {
|
|
52
|
+
name: string;
|
|
53
|
+
dir?: string;
|
|
54
|
+
dryRun?: boolean;
|
|
55
|
+
/** pipeline-check also writes a Mermaid diagram to the current folder. */
|
|
56
|
+
diagram?: boolean;
|
|
57
|
+
sets?: Record<string, string>;
|
|
58
|
+
/** Gate name to a shell check, from --gate. */
|
|
59
|
+
gates?: Record<string, string>;
|
|
60
|
+
/** YAML laid over the pipeline, from --pipeline. */
|
|
61
|
+
pipelineOverrides?: string[];
|
|
62
|
+
/** ID:YAML laid over one stage, from --stage. */
|
|
63
|
+
stageOverrides?: string[];
|
|
64
|
+
outputs?: string[];
|
|
65
|
+
thread?: string;
|
|
66
|
+
header?: string;
|
|
67
|
+
footer?: string;
|
|
68
|
+
noDefaultFooter?: boolean;
|
|
69
|
+
model?: string;
|
|
70
|
+
exitZero?: boolean;
|
|
71
|
+
json?: boolean;
|
|
72
|
+
/** The CLI a stage spawns under TESTEIYA_PIPELINE_SPAWN=1. Tests swap in a fake. */
|
|
73
|
+
cli?: string;
|
|
74
|
+
/** Runs an agent stage. Tests swap in a fake. */
|
|
75
|
+
runTask?: TaskRunner;
|
|
76
|
+
/** Throws when no model or key resolves. */
|
|
77
|
+
checkAi?: (model?: string) => Promise<void>;
|
|
78
|
+
}
|
|
@@ -5,7 +5,9 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
import { chalkStderr as c } from "chalk";
|
|
6
6
|
import { Git } from "../git.js";
|
|
7
7
|
import { UsageError } from "../model.js";
|
|
8
|
+
import { runTask } from "../run.js";
|
|
8
9
|
import { CommandStage } from "./command-stage.js";
|
|
10
|
+
import { CrashGuard } from "./crash-guard.js";
|
|
9
11
|
import { Diagram } from "./diagram.js";
|
|
10
12
|
import { Gate } from "./gate.js";
|
|
11
13
|
import { Launcher } from "./launcher.js";
|
|
@@ -30,10 +32,12 @@ export class Pipeline {
|
|
|
30
32
|
git = new Git(this.cwd);
|
|
31
33
|
launcher = new Launcher(this.cwd);
|
|
32
34
|
cli;
|
|
35
|
+
runTask;
|
|
33
36
|
overlays;
|
|
34
37
|
constructor(options) {
|
|
35
38
|
this.options = options;
|
|
36
39
|
this.cli = options.cli ?? fileURLToPath(new URL("../cli.js", import.meta.url));
|
|
40
|
+
this.runTask = options.runTask ?? runTask;
|
|
37
41
|
// --pipeline first, so --stage can change a stage it adds.
|
|
38
42
|
this.overlays = [...(options.pipelineOverrides ?? []).map(Overlay.pipeline), ...(options.stageOverrides ?? []).map(Overlay.stage)];
|
|
39
43
|
}
|
|
@@ -250,12 +254,30 @@ export class Pipeline {
|
|
|
250
254
|
vars: run.vars,
|
|
251
255
|
launcher: this.launcher,
|
|
252
256
|
cli: this.cli,
|
|
257
|
+
runTask: this.runTask,
|
|
258
|
+
guard: new CrashGuard((err) => this.crashed(run.state, err)),
|
|
253
259
|
model: this.options.model,
|
|
254
260
|
report,
|
|
255
261
|
missing: (input) => this.whyMissing(input, run),
|
|
256
262
|
locate: (input, reader) => this.locate(input, reader, run),
|
|
257
263
|
};
|
|
258
264
|
}
|
|
265
|
+
/** The process is in an unknown state after an uncaught error: save what ran, stop. */
|
|
266
|
+
crashed(state, err) {
|
|
267
|
+
let message = String(err);
|
|
268
|
+
if (err instanceof Error)
|
|
269
|
+
message = err.message;
|
|
270
|
+
for (const record of state.record.stages) {
|
|
271
|
+
if (record.status !== "running")
|
|
272
|
+
continue;
|
|
273
|
+
record.status = "broken";
|
|
274
|
+
record.reason = `crashed: ${message}`;
|
|
275
|
+
log.stage(record);
|
|
276
|
+
}
|
|
277
|
+
state.record.status = "broken";
|
|
278
|
+
state.save();
|
|
279
|
+
process.exit(1);
|
|
280
|
+
}
|
|
259
281
|
interrupted(state) {
|
|
260
282
|
state.record.status = "interrupted";
|
|
261
283
|
for (const record of state.record.stages)
|