@testsprite/testsprite-cli 0.4.0 → 0.6.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 (56) hide show
  1. package/README.md +27 -1
  2. package/dist/commands/agent.js +17 -6
  3. package/dist/commands/auth.d.ts +46 -0
  4. package/dist/commands/auth.js +37 -2
  5. package/dist/commands/completion.d.ts +36 -0
  6. package/dist/commands/completion.js +111 -0
  7. package/dist/commands/doctor.js +20 -2
  8. package/dist/commands/init.d.ts +32 -1
  9. package/dist/commands/init.js +40 -10
  10. package/dist/commands/project.d.ts +77 -3
  11. package/dist/commands/project.js +176 -43
  12. package/dist/commands/test.d.ts +200 -10
  13. package/dist/commands/test.js +1636 -351
  14. package/dist/commands/usage.d.ts +56 -17
  15. package/dist/commands/usage.js +144 -29
  16. package/dist/index.js +132 -26
  17. package/dist/lib/browser.d.ts +6 -0
  18. package/dist/lib/browser.js +54 -0
  19. package/dist/lib/bundle.d.ts +32 -31
  20. package/dist/lib/bundle.js +125 -83
  21. package/dist/lib/client-factory.d.ts +23 -0
  22. package/dist/lib/client-factory.js +33 -1
  23. package/dist/lib/config.js +7 -3
  24. package/dist/lib/credentials.d.ts +17 -1
  25. package/dist/lib/credentials.js +175 -16
  26. package/dist/lib/dry-run/samples.js +15 -1
  27. package/dist/lib/errors.d.ts +6 -1
  28. package/dist/lib/errors.js +70 -19
  29. package/dist/lib/flaky.d.ts +12 -1
  30. package/dist/lib/flaky.js +7 -12
  31. package/dist/lib/gh-output.d.ts +84 -0
  32. package/dist/lib/gh-output.js +202 -0
  33. package/dist/lib/http.d.ts +33 -15
  34. package/dist/lib/http.js +141 -7
  35. package/dist/lib/org-render.d.ts +52 -0
  36. package/dist/lib/org-render.js +59 -0
  37. package/dist/lib/poll.js +72 -36
  38. package/dist/lib/render-error.d.ts +14 -0
  39. package/dist/lib/render-error.js +30 -0
  40. package/dist/lib/response-schemas.d.ts +83 -0
  41. package/dist/lib/response-schemas.js +282 -0
  42. package/dist/lib/runs.types.d.ts +53 -8
  43. package/dist/lib/skill-nudge.d.ts +17 -0
  44. package/dist/lib/skill-nudge.js +19 -0
  45. package/dist/lib/telemetry.d.ts +90 -0
  46. package/dist/lib/telemetry.js +171 -0
  47. package/dist/lib/text-table.d.ts +14 -0
  48. package/dist/lib/text-table.js +45 -0
  49. package/dist/lib/v3-advisory.d.ts +30 -1
  50. package/dist/lib/v3-advisory.js +35 -4
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/package.json +17 -5
  54. package/schemas/plan.schema.json +61 -0
  55. package/skills/testsprite-verify.codex.md +2 -2
  56. package/skills/testsprite-verify.skill.md +3 -3
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/TestSprite/testsprite-cli/main/schemas/plan.schema.json",
4
+ "title": "TestSprite CLI plan file",
5
+ "description": "Shape ingested by `testsprite test create --plan-from <file>` (and, per-line, by `test create-batch --plans <file.jsonl>` / `--plan-from-dir <dir>`). One plan file describes exactly ONE test — a top-level JSON array is rejected; use create-batch for many. This schema is the machine-readable ground truth for THIS command (`--plan-from`), not for `assertPlanShape`'s raw structural check in isolation — where the two diverge (see `type` below), this schema encodes what `--plan-from` actually accepts end-to-end. It is asserted in `src/lib/plan-schema.spec.ts` against the real validator; if the two ever disagree, the validator's actual acceptance behavior is authoritative and this file is out of date. Not enforced by this schema (checked separately by the CLI as a pre-flight guard, not a structural JSON constraint): a plan file must be <= 256 KB total.",
6
+ "type": "object",
7
+ "required": ["projectId", "type", "name", "planSteps"],
8
+ "properties": {
9
+ "$schema": {
10
+ "description": "Optional. Point your editor at this file (e.g. the raw URL in the plan template, or a local path to a copy shipped in node_modules/@testsprite/testsprite-cli/schemas/plan.schema.json) to get inline validation and completion while authoring. Ignored by the CLI — plan files are not restricted to a fixed property set (see `additionalProperties`, implicitly true throughout this schema), and this property is deliberately left type-unconstrained here to match: assertPlanShape does not inspect `$schema` at all, so a non-string value here is exactly as valid to the CLI as a string one."
11
+ },
12
+ "projectId": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "pattern": "\\S",
16
+ "description": "Project id returned by `testsprite project list`. Must be non-empty and not whitespace-only."
17
+ },
18
+ "type": {
19
+ "type": "string",
20
+ "enum": ["frontend"],
21
+ "description": "Restricted to `frontend` — `--plan-from` rejects a `backend`-typed plan pre-flight with a `nextAction` pointing at `test create --type backend --code-file <path>` (backend tests are authored from a code file, not a plan). `assertPlanShape`'s own structural check is looser (it accepts `backend` as a bare shape check before that later rejection), but this schema is the ground truth for the `--plan-from` COMMAND as a whole, not for the isolated structural check — so it encodes the value that actually succeeds end-to-end."
22
+ },
23
+ "name": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "pattern": "\\S",
27
+ "description": "Human-readable test name. Write it as an assertable behavior statement (subject + verb + outcome), not a noun fragment."
28
+ },
29
+ "description": {
30
+ "type": "string",
31
+ "description": "Optional one-sentence elaboration of `name` — the condition plus the expected outcome. Any string is accepted (including empty), unlike `name`/`projectId`."
32
+ },
33
+ "priority": {
34
+ "type": "string",
35
+ "enum": ["p0", "p1", "p2", "p3"],
36
+ "description": "Optional. p0 = must-pass, p1 = important paths, p2 = edge cases, p3 = cosmetic."
37
+ },
38
+ "planSteps": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "maxItems": 200,
42
+ "description": "1-200 steps describing user intent in plain language, not selectors. `{{...}}`-style placeholders are NOT substituted by the CLI — a step containing one is structurally valid (passes this schema and assertPlanShape) but triggers a non-fatal `[advisory]` at `test create --plan-from` time; store login credentials on the project instead (`project update --username/--password`, or Portal -> Project Settings).",
43
+ "items": {
44
+ "type": "object",
45
+ "required": ["type", "description"],
46
+ "properties": {
47
+ "type": {
48
+ "type": "string",
49
+ "enum": ["action", "assertion"]
50
+ },
51
+ "description": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "pattern": "\\S",
55
+ "description": "One verb per step. Describe the outcome/intent, not a CSS selector or literal button label."
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -22,11 +22,11 @@ unverified-because-undeployed and stop. If the user explicitly named a tool
22
22
 
23
23
  ```bash
24
24
  testsprite --version # CLI installed?
25
- testsprite auth whoami # credentials valid?
25
+ testsprite auth status # credentials valid?
26
26
  ```
27
27
 
28
28
  If `--version` fails, tell the user to install the CLI and stop.
29
- If `auth whoami` fails, tell the user to run `testsprite auth configure` and stop.
29
+ If `auth status` fails, tell the user to run `testsprite setup` and stop.
30
30
 
31
31
  ### 2. Find the project
32
32
 
@@ -67,13 +67,13 @@ because <X>. Treat this as unverified until that's resolved." Don't claim done.
67
67
 
68
68
  ```bash
69
69
  testsprite --version # CLI installed?
70
- testsprite auth whoami # credentials configured?
70
+ testsprite auth status # credentials configured?
71
71
  ```
72
72
 
73
73
  - `--version` fails → the CLI isn't installed. Tell the user to install the
74
74
  TestSprite CLI (see the TestSprite docs) and stop; don't install it for them.
75
- - `auth whoami` fails → no credentials. Tell the user they can run
76
- `testsprite auth configure`, then stop.
75
+ - `auth status` fails → no credentials. Tell the user they can run
76
+ `testsprite setup`, then stop.
77
77
 
78
78
  ## 2. Find the project
79
79