@testsprite/testsprite-cli 0.6.0 → 0.8.0

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 (96) hide show
  1. package/README.md +52 -31
  2. package/dist/commands/agent.js +91 -45
  3. package/dist/commands/ci.d.ts +88 -0
  4. package/dist/commands/ci.js +429 -0
  5. package/dist/commands/doctor.d.ts +1 -1
  6. package/dist/commands/doctor.js +104 -8
  7. package/dist/commands/init.js +8 -0
  8. package/dist/commands/project.d.ts +78 -0
  9. package/dist/commands/project.js +429 -5
  10. package/dist/commands/schedule.d.ts +120 -0
  11. package/dist/commands/schedule.js +487 -0
  12. package/dist/commands/test.d.ts +176 -2
  13. package/dist/commands/test.js +2235 -609
  14. package/dist/commands/testlist.d.ts +88 -0
  15. package/dist/commands/testlist.js +753 -0
  16. package/dist/commands/tunnel.d.ts +72 -0
  17. package/dist/commands/tunnel.js +367 -0
  18. package/dist/index.js +113 -40
  19. package/dist/lib/agent-targets.d.ts +13 -4
  20. package/dist/lib/agent-targets.js +11 -2
  21. package/dist/lib/conflict-reason.d.ts +30 -0
  22. package/dist/lib/conflict-reason.js +45 -0
  23. package/dist/lib/credentials.js +42 -1
  24. package/dist/lib/cron.d.ts +40 -0
  25. package/dist/lib/cron.js +190 -0
  26. package/dist/lib/dry-run/samples.d.ts +9 -0
  27. package/dist/lib/dry-run/samples.js +293 -55
  28. package/dist/lib/errors.d.ts +9 -0
  29. package/dist/lib/errors.js +11 -0
  30. package/dist/lib/gh-output.d.ts +33 -1
  31. package/dist/lib/gh-output.js +97 -27
  32. package/dist/lib/http.d.ts +119 -0
  33. package/dist/lib/http.js +243 -2
  34. package/dist/lib/interrupt.d.ts +38 -13
  35. package/dist/lib/interrupt.js +130 -15
  36. package/dist/lib/junit-report.d.ts +20 -2
  37. package/dist/lib/junit-report.js +38 -5
  38. package/dist/lib/local-target.d.ts +95 -0
  39. package/dist/lib/local-target.js +184 -0
  40. package/dist/lib/plan-poll.d.ts +171 -0
  41. package/dist/lib/plan-poll.js +442 -0
  42. package/dist/lib/plans.types.d.ts +130 -0
  43. package/dist/lib/plans.types.js +31 -0
  44. package/dist/lib/poll-support.d.ts +26 -0
  45. package/dist/lib/poll-support.js +65 -0
  46. package/dist/lib/poll.d.ts +1 -0
  47. package/dist/lib/poll.js +2 -40
  48. package/dist/lib/proxy.d.ts +16 -0
  49. package/dist/lib/proxy.js +19 -1
  50. package/dist/lib/response-schemas.d.ts +20 -0
  51. package/dist/lib/response-schemas.js +55 -1
  52. package/dist/lib/run-progress.d.ts +41 -0
  53. package/dist/lib/run-progress.js +56 -0
  54. package/dist/lib/runs.types.d.ts +32 -3
  55. package/dist/lib/secret-file.d.ts +15 -0
  56. package/dist/lib/secret-file.js +82 -0
  57. package/dist/lib/target-url-preflight.d.ts +91 -0
  58. package/dist/lib/target-url-preflight.js +259 -0
  59. package/dist/lib/target-url.d.ts +63 -9
  60. package/dist/lib/target-url.js +283 -62
  61. package/dist/lib/telemetry.d.ts +11 -0
  62. package/dist/lib/telemetry.js +1 -0
  63. package/dist/lib/testlist.types.d.ts +77 -0
  64. package/dist/lib/testlist.types.js +9 -0
  65. package/dist/lib/ticker.d.ts +8 -0
  66. package/dist/lib/ticker.js +3 -0
  67. package/dist/lib/tunnel-session.d.ts +129 -0
  68. package/dist/lib/tunnel-session.js +232 -0
  69. package/dist/lib/tunnel.types.d.ts +54 -0
  70. package/dist/lib/tunnel.types.js +8 -0
  71. package/dist/lib/v3-advisory.d.ts +35 -22
  72. package/dist/lib/v3-advisory.js +44 -24
  73. package/dist/lib/wait-exit.d.ts +29 -0
  74. package/dist/lib/wait-exit.js +103 -0
  75. package/dist/vendor/tunnel-client/client.d.ts +83 -0
  76. package/dist/vendor/tunnel-client/client.js +871 -0
  77. package/dist/vendor/tunnel-client/config.d.ts +41 -0
  78. package/dist/vendor/tunnel-client/config.js +42 -0
  79. package/dist/vendor/tunnel-client/index.d.ts +9 -0
  80. package/dist/vendor/tunnel-client/index.js +9 -0
  81. package/dist/vendor/tunnel-client/lodash-lite.d.ts +14 -0
  82. package/dist/vendor/tunnel-client/lodash-lite.js +24 -0
  83. package/dist/vendor/tunnel-client/protocol.d.ts +60 -0
  84. package/dist/vendor/tunnel-client/protocol.js +143 -0
  85. package/dist/vendor/tunnel-client/types.d.ts +96 -0
  86. package/dist/vendor/tunnel-client/types.js +10 -0
  87. package/dist/vendor/tunnel-client/ws-compat.d.ts +206 -0
  88. package/dist/vendor/tunnel-client/ws-compat.js +316 -0
  89. package/dist/version-guard.d.ts +10 -7
  90. package/dist/version-guard.js +37 -9
  91. package/dist/version.d.ts +1 -1
  92. package/dist/version.js +1 -1
  93. package/package.json +2 -1
  94. package/skills/testsprite-onboard.skill.md +60 -4
  95. package/skills/testsprite-verify.codex.md +22 -16
  96. package/skills/testsprite-verify.skill.md +27 -18
@@ -0,0 +1,88 @@
1
+ import { Command } from 'commander';
2
+ import { type CommonOptions as FactoryCommonOptions } from '../lib/client-factory.js';
3
+ import { type FetchImpl } from '../lib/http.js';
4
+ import { type JUnitReportFormat } from '../lib/junit-report.js';
5
+ import type { CliDeleteTestListResponse, CliTestList, CliTestListDetail, CliTestListRunResponse } from '../lib/testlist.types.js';
6
+ export interface TestListDeps {
7
+ env?: NodeJS.ProcessEnv;
8
+ credentialsPath?: string;
9
+ fetchImpl?: FetchImpl;
10
+ stdout?: (line: string) => void;
11
+ stderr?: (line: string) => void;
12
+ /** Injectable sleep for the `--wait` poll (tests pass an instant sleep). */
13
+ sleep?: (ms: number) => Promise<void>;
14
+ }
15
+ type CommonOptions = FactoryCommonOptions;
16
+ export declare function runTestlistList(opts: CommonOptions & {
17
+ columns?: string;
18
+ noHeader?: boolean;
19
+ }, deps?: TestListDeps): Promise<CliTestList[]>;
20
+ export declare function runTestlistGet(opts: CommonOptions & {
21
+ listId: string;
22
+ }, deps?: TestListDeps): Promise<CliTestListDetail>;
23
+ export declare function runTestlistCreate(opts: CommonOptions & {
24
+ name?: string;
25
+ projectEnv?: string[];
26
+ idempotencyKey?: string;
27
+ }, deps?: TestListDeps): Promise<CliTestListDetail>;
28
+ export declare function runTestlistUpdate(opts: CommonOptions & {
29
+ listId: string;
30
+ name?: string;
31
+ projectEnv?: string[];
32
+ clearProjectEnv?: boolean;
33
+ idempotencyKey?: string;
34
+ }, deps?: TestListDeps): Promise<CliTestListDetail>;
35
+ export declare function runTestlistDelete(opts: CommonOptions & {
36
+ listId: string;
37
+ confirm?: boolean;
38
+ idempotencyKey?: string;
39
+ }, deps?: TestListDeps): Promise<CliDeleteTestListResponse>;
40
+ export declare const runTestlistAdd: (opts: CommonOptions & {
41
+ listId: string;
42
+ testIds: string[];
43
+ idempotencyKey?: string;
44
+ }, deps?: TestListDeps) => Promise<CliTestListDetail>;
45
+ export declare const runTestlistRemove: (opts: CommonOptions & {
46
+ listId: string;
47
+ testIds: string[];
48
+ idempotencyKey?: string;
49
+ }, deps?: TestListDeps) => Promise<CliTestListDetail>;
50
+ /**
51
+ * Under `--wait`, raise the per-request HTTP timeout to cover `--timeout` so a
52
+ * slow trigger / long-poll on a large list isn't cut short by the default 120s
53
+ * request deadline and mis-reported as a member timeout. Mirrors
54
+ * `test run`'s `resolveWaitRequestTimeoutMs` (reimplemented locally to keep this
55
+ * file off the `test.ts` module — see the security-lint note on `run`).
56
+ */
57
+ export declare function waitRequestTimeoutMs(opts: {
58
+ wait?: boolean;
59
+ timeoutSeconds?: number;
60
+ requestTimeoutMs?: number;
61
+ }): number | undefined;
62
+ export interface RunTestlistRunOptions extends CommonOptions {
63
+ listId: string;
64
+ /** --case (repeatable): run only this subset of the list's cases (== test ids). */
65
+ cases?: string[];
66
+ /** --wait: block until every dispatched run is terminal or --timeout. */
67
+ wait: boolean;
68
+ /** Shared poll deadline in seconds. */
69
+ timeoutSeconds: number;
70
+ /** --max-concurrency: bounds the --wait poll fan-out. */
71
+ maxConcurrency: number;
72
+ idempotencyKey?: string;
73
+ report?: JUnitReportFormat;
74
+ reportFile?: string;
75
+ reportSuiteName?: string;
76
+ /** --gh-output: force the GitHub-native output layer (::error:: + job summary) even off-Actions. */
77
+ ghOutput?: boolean;
78
+ /** --summary-file: also write the reduced machine summary JSON to this path. */
79
+ summaryFile?: string;
80
+ }
81
+ /**
82
+ * `testlist run` — dispatch the list's cases (optionally a `--case` subset) and,
83
+ * with `--wait`, poll every returned runId to a verdict, optionally writing a
84
+ * JUnit XML report (`--report junit`). testlist run is V3-only.
85
+ */
86
+ export declare function runTestlistRun(opts: RunTestlistRunOptions, deps?: TestListDeps): Promise<CliTestListRunResponse>;
87
+ export declare function createTestListCommand(deps?: TestListDeps): Command;
88
+ export {};