testeiya 0.10.0 โ†’ 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.
Files changed (241) hide show
  1. package/PIPELINES.md +3 -0
  2. package/README.md +10 -20
  3. package/dist/prompt/clis.d.ts +7 -0
  4. package/dist/prompt/pipeline-report.d.ts +1 -0
  5. package/dist/prompt/report.d.ts +10 -0
  6. package/dist/prompt/system-prompt.d.ts +22 -0
  7. package/dist/prompt/system-prompt.js +1 -1
  8. package/dist/prompt/system-prompt.js.map +1 -1
  9. package/dist/prompt/testomat.io.d.ts +19 -0
  10. package/dist/prompt/thread.d.ts +73 -0
  11. package/dist/src/args.d.ts +39 -0
  12. package/dist/src/attribution-extension.d.ts +3 -0
  13. package/dist/src/checkpoint.d.ts +30 -0
  14. package/dist/src/cli.d.ts +2 -0
  15. package/dist/src/cli.js +27 -32
  16. package/dist/src/cli.js.map +1 -1
  17. package/dist/src/doctor.d.ts +11 -0
  18. package/dist/src/env.d.ts +30 -0
  19. package/dist/src/exec.d.ts +11 -0
  20. package/dist/src/git.d.ts +41 -0
  21. package/dist/src/git.js +10 -0
  22. package/dist/src/git.js.map +1 -1
  23. package/dist/src/langfuse-extension.d.ts +7 -0
  24. package/dist/src/langfuse.d.ts +67 -0
  25. package/dist/src/mcp.d.ts +19 -0
  26. package/dist/src/model.d.ts +20 -0
  27. package/dist/src/model.js +2 -0
  28. package/dist/src/model.js.map +1 -1
  29. package/dist/src/models.d.ts +1 -0
  30. package/dist/src/output.d.ts +84 -0
  31. package/dist/src/pipeline/command-stage.d.ts +12 -0
  32. package/dist/src/pipeline/crash-guard.d.ts +12 -0
  33. package/dist/src/pipeline/crash-guard.js +21 -0
  34. package/dist/src/pipeline/crash-guard.js.map +1 -0
  35. package/dist/src/pipeline/diagram.d.ts +24 -0
  36. package/dist/src/pipeline/gate.d.ts +21 -0
  37. package/dist/src/pipeline/launcher.d.ts +33 -0
  38. package/dist/src/pipeline/launcher.js +16 -3
  39. package/dist/src/pipeline/launcher.js.map +1 -1
  40. package/dist/src/pipeline/log.d.ts +29 -0
  41. package/dist/src/pipeline/log.js +9 -0
  42. package/dist/src/pipeline/log.js.map +1 -1
  43. package/dist/src/pipeline/overlay.d.ts +29 -0
  44. package/dist/src/pipeline/pipeline-file.d.ts +44 -0
  45. package/dist/src/pipeline/pipeline-file.js +16 -8
  46. package/dist/src/pipeline/pipeline-file.js.map +1 -1
  47. package/dist/src/pipeline/pipeline.d.ts +78 -0
  48. package/dist/src/pipeline/pipeline.js +33 -7
  49. package/dist/src/pipeline/pipeline.js.map +1 -1
  50. package/dist/src/pipeline/report.d.ts +26 -0
  51. package/dist/src/pipeline/report.js +13 -0
  52. package/dist/src/pipeline/report.js.map +1 -1
  53. package/dist/src/pipeline/spec.d.ts +63 -0
  54. package/dist/src/pipeline/stage-env.d.ts +13 -0
  55. package/dist/src/pipeline/stage-env.js +31 -0
  56. package/dist/src/pipeline/stage-env.js.map +1 -0
  57. package/dist/src/pipeline/stage.d.ts +71 -0
  58. package/dist/src/pipeline/stage.js.map +1 -1
  59. package/dist/src/pipeline/state.d.ts +63 -0
  60. package/dist/src/pipeline/summary-stage.d.ts +24 -0
  61. package/dist/src/pipeline/task-stage.d.ts +24 -0
  62. package/dist/src/pipeline/task-stage.js +86 -2
  63. package/dist/src/pipeline/task-stage.js.map +1 -1
  64. package/dist/src/pipeline/variables.d.ts +20 -0
  65. package/dist/src/result.d.ts +6 -0
  66. package/dist/src/run.d.ts +69 -0
  67. package/dist/src/run.js +116 -60
  68. package/dist/src/run.js.map +1 -1
  69. package/dist/src/session.d.ts +43 -0
  70. package/dist/src/session.js +3 -1
  71. package/dist/src/session.js.map +1 -1
  72. package/dist/src/sessions.d.ts +23 -0
  73. package/dist/src/skills.d.ts +29 -0
  74. package/package.json +11 -2
  75. package/pipelines/api-testing.yml +16 -5
  76. package/pipelines/issue-test-cases.yml +3 -4
  77. package/pipelines/pr-review.yml +14 -5
  78. package/pipelines/regression.yml +1 -0
  79. package/pipelines/web-testing.yml +1 -0
  80. package/prompt/system-prompt.ts +1 -1
  81. package/scripts/vendor-skills.js +62 -0
  82. package/skills/codeceptjs/ci-fix-tests/SKILL.md +0 -119
  83. package/skills/codeceptjs/codeceptjs-auth/SKILL.md +0 -141
  84. package/skills/codeceptjs/codeceptjs-exploration/SKILL.md +0 -100
  85. package/skills/codeceptjs/codeceptjs-fundamentals/SKILL.md +0 -196
  86. package/skills/codeceptjs/codeceptjs-run-analysis/SKILL.md +0 -83
  87. package/skills/codeceptjs/debugging-codeceptjs-tests/SKILL.md +0 -126
  88. package/skills/codeceptjs/lint-codeceptjs-tests/SKILL.md +0 -104
  89. package/skills/codeceptjs/migrate-codeceptjs-4/SKILL.md +0 -109
  90. package/skills/codeceptjs/migrate-cypress-to-codeceptjs/SKILL.md +0 -295
  91. package/skills/codeceptjs/migrate-protractor-to-codeceptjs/SKILL.md +0 -339
  92. package/skills/codeceptjs/migrate-selenium-java-to-codeceptjs/SKILL.md +0 -459
  93. package/skills/codeceptjs/migrate-testcafe-to-codeceptjs/SKILL.md +0 -338
  94. package/skills/codeceptjs/refactoring-codeceptjs-tests/SKILL.md +0 -78
  95. package/skills/codeceptjs/writing-codeceptjs-tests/SKILL.md +0 -102
  96. package/skills/playwright/playwright-best-practices/SKILL.md +0 -303
  97. package/skills/playwright/playwright-best-practices/advanced/authentication-flows.md +0 -360
  98. package/skills/playwright/playwright-best-practices/advanced/authentication.md +0 -871
  99. package/skills/playwright/playwright-best-practices/advanced/clock-mocking.md +0 -364
  100. package/skills/playwright/playwright-best-practices/advanced/mobile-testing.md +0 -409
  101. package/skills/playwright/playwright-best-practices/advanced/multi-context.md +0 -288
  102. package/skills/playwright/playwright-best-practices/advanced/multi-user.md +0 -393
  103. package/skills/playwright/playwright-best-practices/advanced/network-advanced.md +0 -452
  104. package/skills/playwright/playwright-best-practices/advanced/third-party.md +0 -464
  105. package/skills/playwright/playwright-best-practices/architecture/pom-vs-fixtures.md +0 -363
  106. package/skills/playwright/playwright-best-practices/architecture/test-architecture.md +0 -369
  107. package/skills/playwright/playwright-best-practices/architecture/when-to-mock.md +0 -383
  108. package/skills/playwright/playwright-best-practices/browser-apis/browser-apis.md +0 -391
  109. package/skills/playwright/playwright-best-practices/browser-apis/iframes.md +0 -403
  110. package/skills/playwright/playwright-best-practices/browser-apis/service-workers.md +0 -504
  111. package/skills/playwright/playwright-best-practices/browser-apis/websockets.md +0 -403
  112. package/skills/playwright/playwright-best-practices/core/annotations.md +0 -424
  113. package/skills/playwright/playwright-best-practices/core/assertions-waiting.md +0 -361
  114. package/skills/playwright/playwright-best-practices/core/configuration.md +0 -452
  115. package/skills/playwright/playwright-best-practices/core/fixtures-hooks.md +0 -417
  116. package/skills/playwright/playwright-best-practices/core/global-setup.md +0 -434
  117. package/skills/playwright/playwright-best-practices/core/locators.md +0 -242
  118. package/skills/playwright/playwright-best-practices/core/page-object-model.md +0 -315
  119. package/skills/playwright/playwright-best-practices/core/projects-dependencies.md +0 -453
  120. package/skills/playwright/playwright-best-practices/core/test-data.md +0 -492
  121. package/skills/playwright/playwright-best-practices/core/test-suite-structure.md +0 -361
  122. package/skills/playwright/playwright-best-practices/core/test-tags.md +0 -298
  123. package/skills/playwright/playwright-best-practices/debugging/console-errors.md +0 -420
  124. package/skills/playwright/playwright-best-practices/debugging/debugging.md +0 -504
  125. package/skills/playwright/playwright-best-practices/debugging/error-testing.md +0 -360
  126. package/skills/playwright/playwright-best-practices/debugging/flaky-tests.md +0 -496
  127. package/skills/playwright/playwright-best-practices/frameworks/angular.md +0 -530
  128. package/skills/playwright/playwright-best-practices/frameworks/nextjs.md +0 -469
  129. package/skills/playwright/playwright-best-practices/frameworks/react.md +0 -531
  130. package/skills/playwright/playwright-best-practices/frameworks/vue.md +0 -574
  131. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/ci-cd.md +0 -468
  132. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/docker.md +0 -283
  133. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/github-actions.md +0 -546
  134. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/gitlab.md +0 -397
  135. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/other-providers.md +0 -521
  136. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/parallel-sharding.md +0 -371
  137. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/performance.md +0 -453
  138. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/reporting.md +0 -424
  139. package/skills/playwright/playwright-best-practices/infrastructure-ci-cd/test-coverage.md +0 -497
  140. package/skills/playwright/playwright-best-practices/testing-patterns/accessibility.md +0 -359
  141. package/skills/playwright/playwright-best-practices/testing-patterns/api-testing.md +0 -719
  142. package/skills/playwright/playwright-best-practices/testing-patterns/browser-extensions.md +0 -506
  143. package/skills/playwright/playwright-best-practices/testing-patterns/canvas-webgl.md +0 -493
  144. package/skills/playwright/playwright-best-practices/testing-patterns/component-testing.md +0 -500
  145. package/skills/playwright/playwright-best-practices/testing-patterns/drag-drop.md +0 -576
  146. package/skills/playwright/playwright-best-practices/testing-patterns/electron.md +0 -509
  147. package/skills/playwright/playwright-best-practices/testing-patterns/file-operations.md +0 -377
  148. package/skills/playwright/playwright-best-practices/testing-patterns/file-upload-download.md +0 -562
  149. package/skills/playwright/playwright-best-practices/testing-patterns/forms-validation.md +0 -561
  150. package/skills/playwright/playwright-best-practices/testing-patterns/graphql-testing.md +0 -331
  151. package/skills/playwright/playwright-best-practices/testing-patterns/i18n.md +0 -508
  152. package/skills/playwright/playwright-best-practices/testing-patterns/performance-testing.md +0 -476
  153. package/skills/playwright/playwright-best-practices/testing-patterns/security-testing.md +0 -430
  154. package/skills/playwright/playwright-best-practices/testing-patterns/visual-regression.md +0 -634
  155. package/skills/playwright/playwright-cli/SKILL.md +0 -489
  156. package/skills/playwright/playwright-cli/references/element-attributes.md +0 -23
  157. package/skills/playwright/playwright-cli/references/playwright-tests.md +0 -39
  158. package/skills/playwright/playwright-cli/references/pr-attachments.md +0 -60
  159. package/skills/playwright/playwright-cli/references/request-mocking.md +0 -87
  160. package/skills/playwright/playwright-cli/references/running-code.md +0 -245
  161. package/skills/playwright/playwright-cli/references/session-management.md +0 -227
  162. package/skills/playwright/playwright-cli/references/storage-state.md +0 -275
  163. package/skills/playwright/playwright-cli/references/test-generation.md +0 -433
  164. package/skills/playwright/playwright-cli/references/tracing.md +0 -139
  165. package/skills/playwright/playwright-cli/references/video-recording.md +0 -216
  166. package/skills/skills.lock.json +0 -89
  167. package/skills/skills.yaml +0 -35
  168. /package/skills/{testomatio/explorbot โ†’ explorbot}/explorbot-fundamentals/SKILL.md +0 -0
  169. /package/skills/{testomatio/explorbot โ†’ explorbot}/explorbot-fundamentals/references/no-install.md +0 -0
  170. /package/skills/{testomatio/explorbot โ†’ explorbot}/explorbot-plan/SKILL.md +0 -0
  171. /package/skills/{testomatio/explorbot โ†’ explorbot}/explorbot-setup/SKILL.md +0 -0
  172. /package/skills/{testomatio/explorbot โ†’ explorbot}/prima/SKILL.md +0 -0
  173. /package/skills/{testomatio/qa-process โ†’ qa-process}/qa-lead-strategy-advisor/SKILL.md +0 -0
  174. /package/skills/{testomatio/qa-process โ†’ qa-process}/qa-lead-strategy-advisor/references/output-format.md +0 -0
  175. /package/skills/{testomatio/qa-process โ†’ qa-process}/qa-review-pr/SKILL.md +0 -0
  176. /package/skills/{testomatio/qa-process โ†’ qa-process}/testing-workflow/SKILL.md +0 -0
  177. /package/skills/{testomatio/requirements โ†’ requirements}/catalog-features/SKILL.md +0 -0
  178. /package/skills/{testomatio/requirements โ†’ requirements}/catalog-features/references/layout.md +0 -0
  179. /package/skills/{testomatio/requirements โ†’ requirements}/detect-product-mismatches/SKILL.md +0 -0
  180. /package/skills/{testomatio/requirements โ†’ requirements}/detect-product-mismatches/references/features.md +0 -0
  181. /package/skills/{testomatio/requirements โ†’ requirements}/detect-product-mismatches/references/layout.md +0 -0
  182. /package/skills/{testomatio/requirements โ†’ requirements}/pull-request-diff-analyzer/SKILL.md +0 -0
  183. /package/skills/{testomatio/requirements โ†’ requirements}/qa-explain-behavior/SKILL.md +0 -0
  184. /package/skills/{testomatio/requirements โ†’ requirements}/qa-explain-behavior/references/answer-shapes.md +0 -0
  185. /package/skills/{testomatio/requirements โ†’ requirements}/qa-explain-behavior/references/examples.md +0 -0
  186. /package/skills/{testomatio/requirements โ†’ requirements}/qa-pr-requirements-analyzer/SKILL.md +0 -0
  187. /package/skills/{testomatio/requirements โ†’ requirements}/qa-pr-requirements-analyzer/references/summary-example.md +0 -0
  188. /package/skills/{testomatio/requirements โ†’ requirements}/qa-requirement-reviewer/SKILL.md +0 -0
  189. /package/skills/{testomatio/requirements โ†’ requirements}/qa-requirement-reviewer/references/requirements_reviewer_examples.md +0 -0
  190. /package/skills/{testomatio/requirements โ†’ requirements}/qa-thinking/SKILL.md +0 -0
  191. /package/skills/{testomatio/requirements โ†’ requirements}/wiki-from-code/SKILL.md +0 -0
  192. /package/skills/{testomatio/requirements โ†’ requirements}/wiki-from-code/references/behaviors.md +0 -0
  193. /package/skills/{testomatio/requirements โ†’ requirements}/wiki-from-code/references/layout.md +0 -0
  194. /package/skills/{testomatio/requirements โ†’ requirements}/write-user-story/SKILL.md +0 -0
  195. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/CLAUDE.md +0 -0
  196. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/SKILL.md +0 -0
  197. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/references/CODECEPTJS_BEST_PRACTICES.md +0 -0
  198. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/references/FINAL_SUMMARY_TEMPLATE.md +0 -0
  199. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/references/PLAYWRIGHT_BEST_PRACTICES.md +0 -0
  200. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/references/POM_BEST_PRACTICES.md +0 -0
  201. /package/skills/{testomatio/test-automation โ†’ test-automation}/automate-manual-test-cases/references/TEST_DATA_MANAGEMENT.md +0 -0
  202. /package/skills/{testomatio/test-automation โ†’ test-automation}/debug-fix-failed-flaky-autotests/SKILL.md +0 -0
  203. /package/skills/{testomatio/test-automation โ†’ test-automation}/debug-fix-failed-flaky-autotests/references/DEBUGGING_QUICK_REFERENCE.md +0 -0
  204. /package/skills/{testomatio/test-automation โ†’ test-automation}/epic-requirements-specification/SKILL.md +0 -0
  205. /package/skills/{testomatio/test-automation โ†’ test-automation}/qa-automation-test-consolidation/SKILL.md +0 -0
  206. /package/skills/{testomatio/test-automation โ†’ test-automation}/qa-data-seeder/SKILL.md +0 -0
  207. /package/skills/{testomatio/test-automation โ†’ test-automation}/run-tests-with-testomatio-reporter/SKILL.md +0 -0
  208. /package/skills/{testomatio/test-automation โ†’ test-automation}/setup-change-aware-pr-testing/SKILL.md +0 -0
  209. /package/skills/{testomatio/test-automation โ†’ test-automation}/setup-ci-automation/SKILL.md +0 -0
  210. /package/skills/{testomatio/test-automation โ†’ test-automation}/testomat-allure-adapter/SKILL.md +0 -0
  211. /package/skills/{testomatio/test-management โ†’ test-management}/detect-duplicate-test-cases/SKILL.md +0 -0
  212. /package/skills/{testomatio/test-management โ†’ test-management}/detect-duplicate-test-cases/references/DUPLICATE_INSTRUCTIONS.md +0 -0
  213. /package/skills/{testomatio/test-management โ†’ test-management}/detect-useless-tests/SKILL.md +0 -0
  214. /package/skills/{testomatio/test-management โ†’ test-management}/improve-test-cases/SKILL.md +0 -0
  215. /package/skills/{testomatio/test-management โ†’ test-management}/improve-test-cases/references/TESTOMAT_MARKDOWN_EXAMPLE.md +0 -0
  216. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/SKILL.md +0 -0
  217. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/references/CSV_MIGRATION.md +0 -0
  218. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/references/CUSTOM_MIGRATION.md +0 -0
  219. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/references/TESTMO_MIGRATION.md +0 -0
  220. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/references/TESTRAIL_MIGRATION.md +0 -0
  221. /package/skills/{testomatio/test-management โ†’ test-management}/migrate-to-testomatio/references/XRAY_MIGRATION.md +0 -0
  222. /package/skills/{testomatio/test-management โ†’ test-management}/qa-e2e-tests-reporting/SKILL.md +0 -0
  223. /package/skills/{testomatio/test-management โ†’ test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_ARTIFACTS.md +0 -0
  224. /package/skills/{testomatio/test-management โ†’ test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_HTML_REPORT.md +0 -0
  225. /package/skills/{testomatio/test-management โ†’ test-management}/qa-e2e-tests-reporting/references/TESTOMATIO_REPORTERS_CONFIG.md +0 -0
  226. /package/skills/{testomatio/test-management โ†’ test-management}/qa-split-testing-levels-pyramid/SKILL.md +0 -0
  227. /package/skills/{testomatio/test-management โ†’ test-management}/qa-sprint-report-by-testomatio/SKILL.md +0 -0
  228. /package/skills/{testomatio/test-management โ†’ test-management}/qa-sprint-report-by-testomatio/references/qa-sprint-report.md +0 -0
  229. /package/skills/{testomatio/test-management โ†’ test-management}/qa-test-code-coverage/SKILL.md +0 -0
  230. /package/skills/{testomatio/test-management โ†’ test-management}/qa-test-code-coverage/references/COVERAGE_FILE_FORMAT.md +0 -0
  231. /package/skills/{testomatio/test-management โ†’ test-management}/qa-test-code-coverage/references/E2E_FRAMEWORKS.md +0 -0
  232. /package/skills/{testomatio/test-management โ†’ test-management}/qa-test-code-coverage/scripts/check-coverage.mjs +0 -0
  233. /package/skills/{testomatio/test-management โ†’ test-management}/qa-write-test-cases/SKILL.md +0 -0
  234. /package/skills/{testomatio/test-management โ†’ test-management}/qa-write-test-cases/references/test-case-format.md +0 -0
  235. /package/skills/{testomatio/test-management โ†’ test-management}/qa-write-test-cases/references/testomat-tms-guide.md +0 -0
  236. /package/skills/{testomatio/test-management โ†’ test-management}/qa-write-test-cases/references/writing-rule.md +0 -0
  237. /package/skills/{testomatio/test-management โ†’ test-management}/scan-automation-project/SKILL.md +0 -0
  238. /package/skills/{testomatio/test-management โ†’ test-management}/sync-test-cases-with-tms/SKILL.md +0 -0
  239. /package/skills/{testomatio/test-management โ†’ test-management}/sync-test-cases-with-tms/references/TESTOMATIO_CLI.md +0 -0
  240. /package/skills/{testomatio/test-management โ†’ test-management}/testomatio-mcp/SKILL.md +0 -0
  241. /package/skills/{testomatio/test-management โ†’ test-management}/testomatio-mcp/references/MCP_SETUP.md +0 -0
@@ -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>;
package/dist/src/model.js CHANGED
@@ -4,6 +4,8 @@ export const PROVIDER_KEYS = [
4
4
  { provider: "anthropic", env: "ANTHROPIC_API_KEY" },
5
5
  { provider: "openai", env: "OPENAI_API_KEY" },
6
6
  { provider: "google", env: "GEMINI_API_KEY" },
7
+ { provider: "cloudflare-ai-gateway", env: "CLOUDFLARE_API_KEY" },
8
+ { provider: "cloudflare-workers-ai", env: "CLOUDFLARE_API_KEY" },
7
9
  ];
8
10
  /** Bad usage โ€” the caller prints the message and exits 2, never prompting. */
9
11
  export class UsageError extends Error {
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/model.ts"],"names":[],"mappings":"AAGA,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAA6C;IACrE,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,EAAE;IACrD,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,mBAAmB,EAAE;IACnD,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE;IAC7C,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE;CAC9C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAExC;;;;;;G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C;IACjC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function runModels(pattern: string | undefined, json?: boolean): Promise<number>;
@@ -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
- file?.end();
54
- done({ code, timedOut, interrupted: this.interrupted });
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;AAE5B;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAIU;IAH7B,WAAW,GAAG,KAAK,CAAC;IACZ,OAAO,GAAwB,IAAI,CAAC;IAE5C,YAA6B,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAE5C,cAAc;QACZ,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,IAAI,CAAC,OAAO;gBAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kFAAkF;IAClF,KAAK,CAAC,MAAc;QAClB,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC1B,MAAM,OAAO,GAAiB,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;YAC7H,IAAI,KAAmB,CAAC;YACxB,IAAI,MAAM,CAAC,IAAI;gBAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;gBAChE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,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AAI,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 {};
@@ -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,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAClB,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;CACvB,CAAC;AAEF,sEAAsE;AACtE,MAAM,OAAO,WAAW;IACtB,MAAM,CAAC,IAAY,EAAE,KAAa,EAAE,OAAgB,EAAE,GAAW;QAC/D,IAAI,OAAO,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,wBAAwB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC1F,IAAI,CAAC,OAAO,CAAC,KAAK;YAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,OAAO,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,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;;YACnD,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,OAAsB;QAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,oCAAoC;IACpC,IAAI,CAAC,EAAU,EAAE,IAAc,EAAE,IAAY;QAC3C,MAAM,KAAK,GAA6B,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9G,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,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
+ }
@@ -9,9 +9,10 @@ import { Variables } from "./variables.js";
9
9
  const BUNDLED_DIR = join(PACKAGE_ROOT, "pipelines");
10
10
  /** `pipeline.json` and the summary's own files live beside the stages' files. */
11
11
  const RESERVED_IDS = ["pipeline", "summary"];
12
- const TOP_KEYS = ["name", "description", "summary", "env", "gates", "when", "stages"];
12
+ const TOP_KEYS = ["name", "description", "target", "summary", "env", "gates", "when", "stages"];
13
13
  const GATE_KEYS = ["env", "file", "run", "changes", "message"];
14
14
  const CHANGES_KEYS = ["paths", "ignore", "min_files"];
15
+ const STAGE_EMOJIS = ["๐Ÿ”น", "๐Ÿ”ธ", "๐Ÿงช", "๐Ÿ”", "๐Ÿ› ๏ธ", "๐Ÿ“‹", "๐Ÿš€", "๐Ÿงญ", "๐Ÿ“ฆ", "๐Ÿงฉ", "๐ŸŽฏ", "โš™๏ธ"];
15
16
  const STAGE_KEYS = ["id", "title", "emoji", "task", "run", "session", "inputs", "outputs", "when", "stopOn", "timeout", "each_line", "each_file"];
16
17
  /**
17
18
  * A pipeline file: found by path or bundled name, then parsed and validated
@@ -41,7 +42,7 @@ export class PipelineFile {
41
42
  const files = readdirSync(BUNDLED_DIR).filter((file) => file.endsWith(".yml")).sort();
42
43
  return files.map((file) => {
43
44
  const spec = new PipelineFile(join(BUNDLED_DIR, file)).read();
44
- return { name: basename(file, ".yml"), description: spec.description };
45
+ return { name: basename(file, ".yml"), description: spec.description, target: spec.target };
45
46
  });
46
47
  }
47
48
  text() {
@@ -102,6 +103,7 @@ export class PipelineFile {
102
103
  const spec = {
103
104
  name: this.string(raw.name, "name") ?? basename(this.path).replace(/\.ya?ml$/, ""),
104
105
  description: this.string(raw.description, "description") ?? "",
106
+ target: this.string(raw.target, "target"),
105
107
  summary: this.string(raw.summary, "summary"),
106
108
  env: this.map(raw.env, "env"),
107
109
  gates,
@@ -166,12 +168,8 @@ export class PipelineFile {
166
168
  if (value.each_line !== undefined && value.each_file !== undefined) {
167
169
  this.fail(`${where} can loop over each_line or each_file, not both`);
168
170
  }
169
- const title = this.string(value.title, `${where} title`);
170
- if (!title)
171
- this.fail(`${where} needs a title`);
172
- const emoji = this.string(value.emoji, `${where} emoji`);
173
- if (!emoji)
174
- this.fail(`${where} needs an emoji`);
171
+ const title = this.string(value.title, `${where} title`) || PipelineFile.titleOf(id);
172
+ const emoji = this.string(value.emoji, `${where} emoji`) || PipelineFile.emojiOf(id);
175
173
  const stage = {
176
174
  id,
177
175
  title,
@@ -292,6 +290,16 @@ export class PipelineFile {
292
290
  static isRecord(value) {
293
291
  return typeof value === "object" && value !== null && !Array.isArray(value);
294
292
  }
293
+ // `browser-testing` reads as "Browser testing".
294
+ static titleOf(id) {
295
+ const words = id.split("-").join(" ");
296
+ return words.charAt(0).toUpperCase() + words.slice(1);
297
+ }
298
+ // Picked from the id, so a stage keeps its emoji across runs.
299
+ static emojiOf(id) {
300
+ const sum = [...id].reduce((total, char) => total + char.charCodeAt(0), 0);
301
+ return STAGE_EMOJIS[sum % STAGE_EMOJIS.length];
302
+ }
295
303
  static isSlug(value) {
296
304
  if (!value || value.startsWith("-") || value.endsWith("-") || value.includes("--"))
297
305
  return false;