ptywright 0.1.0 → 0.2.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 (68) hide show
  1. package/README.md +459 -116
  2. package/dist/agent.mjs +2 -0
  3. package/dist/bin/ptywright.mjs +6 -0
  4. package/dist/cli-DIUx2w6X.mjs +3587 -0
  5. package/dist/cli.mjs +2 -0
  6. package/{src/index.ts → dist/index.mjs} +7 -9
  7. package/dist/mcp.mjs +2 -0
  8. package/dist/pty-cassette.mjs +24 -0
  9. package/dist/pty_like-Cpkh_O9B.mjs +404 -0
  10. package/dist/runner-DzZlFrt1.mjs +1897 -0
  11. package/dist/runner-zApMYWZx.mjs +3257 -0
  12. package/dist/script.mjs +2 -0
  13. package/dist/server-VHuEWWj_.mjs +3068 -0
  14. package/dist/session.mjs +2 -0
  15. package/dist/terminal_session-DopC7Xg6.mjs +893 -0
  16. package/package.json +28 -21
  17. package/schemas/ptywright-agent-cassette.schema.json +57 -0
  18. package/schemas/ptywright-agent-check.schema.json +122 -0
  19. package/schemas/ptywright-agent-manifest.schema.json +107 -0
  20. package/schemas/ptywright-agent-promote.schema.json +146 -0
  21. package/schemas/ptywright-agent-replay-summary.schema.json +140 -0
  22. package/schemas/ptywright-agent-run.schema.json +126 -0
  23. package/schemas/ptywright-agent.schema.json +182 -0
  24. package/schemas/ptywright-pty-cassette.schema.json +86 -0
  25. package/schemas/ptywright-script-manifest.schema.json +75 -0
  26. package/schemas/ptywright-script-run-summary.schema.json +114 -0
  27. package/schemas/ptywright-script.schema.json +55 -3
  28. package/skills/ptywright-testing/SKILL.md +53 -33
  29. package/bin/ptywright +0 -4
  30. package/src/cli.ts +0 -414
  31. package/src/generator/doc_parser.ts +0 -341
  32. package/src/generator/generate.ts +0 -161
  33. package/src/generator/index.ts +0 -10
  34. package/src/generator/script_generator.ts +0 -209
  35. package/src/generator/step_extractor.ts +0 -397
  36. package/src/mcp/http_server.ts +0 -174
  37. package/src/mcp/script_recording.ts +0 -238
  38. package/src/mcp/server.ts +0 -1348
  39. package/src/pty/bun_pty_adapter.ts +0 -34
  40. package/src/pty/bun_terminal_adapter.ts +0 -149
  41. package/src/pty/pty_adapter.ts +0 -31
  42. package/src/script/dsl.ts +0 -188
  43. package/src/script/module.ts +0 -43
  44. package/src/script/path.ts +0 -151
  45. package/src/script/run.ts +0 -108
  46. package/src/script/run_all.ts +0 -229
  47. package/src/script/runner.ts +0 -983
  48. package/src/script/schema.ts +0 -237
  49. package/src/script/steps/assert_snapshot_equals.ts +0 -21
  50. package/src/script/steps/index.ts +0 -2
  51. package/src/script/suite_report.ts +0 -626
  52. package/src/session/session_manager.ts +0 -145
  53. package/src/session/terminal_session.ts +0 -473
  54. package/src/terminal/ansi.ts +0 -142
  55. package/src/terminal/keys.ts +0 -180
  56. package/src/terminal/mask.ts +0 -70
  57. package/src/terminal/mouse.ts +0 -75
  58. package/src/terminal/snapshot.ts +0 -196
  59. package/src/terminal/style.ts +0 -121
  60. package/src/terminal/view.ts +0 -49
  61. package/src/trace/asciicast.ts +0 -20
  62. package/src/trace/asciinema_player_assets.ts +0 -44
  63. package/src/trace/cast_to_txt.ts +0 -116
  64. package/src/trace/recorder.ts +0 -110
  65. package/src/trace/report.ts +0 -2092
  66. package/src/types.ts +0 -86
  67. package/src/util/hash.ts +0 -8
  68. package/src/util/sleep.ts +0 -5
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ptywright.local/schemas/ptywright-agent-run.schema.json",
4
+ "title": "ptywright agent run record",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "version",
9
+ "name",
10
+ "ok",
11
+ "startedAt",
12
+ "durationMs",
13
+ "mode",
14
+ "artifactsDir",
15
+ "snapshotDir",
16
+ "reportPath",
17
+ "cassetteFrameCount",
18
+ "replayCommand",
19
+ "commands",
20
+ "steps",
21
+ "artifacts",
22
+ "errors"
23
+ ],
24
+ "anyOf": [
25
+ { "required": ["cassettePath"] },
26
+ { "required": ["flowPath"] },
27
+ { "required": ["spec"] }
28
+ ],
29
+ "properties": {
30
+ "$schema": { "type": "string" },
31
+ "version": { "const": 1 },
32
+ "name": { "type": "string", "minLength": 1 },
33
+ "ok": { "type": "boolean" },
34
+ "startedAt": { "type": "string", "minLength": 1 },
35
+ "durationMs": { "type": "integer", "minimum": 0 },
36
+ "mode": { "type": "string", "enum": ["live", "replay"] },
37
+ "spec": { "$ref": "./ptywright-agent.schema.json" },
38
+ "flowPath": { "type": "string", "minLength": 1 },
39
+ "artifactsDir": { "type": "string", "minLength": 1 },
40
+ "snapshotDir": { "type": "string", "minLength": 1 },
41
+ "reportPath": { "type": "string", "minLength": 1 },
42
+ "cassettePath": { "type": "string", "minLength": 1 },
43
+ "cassetteFrameCount": { "type": "integer", "minimum": 0 },
44
+ "replayCommand": { "type": "string", "minLength": 1 },
45
+ "commands": { "$ref": "#/$defs/commands" },
46
+ "steps": {
47
+ "type": "array",
48
+ "items": { "$ref": "#/$defs/step" }
49
+ },
50
+ "artifacts": {
51
+ "type": "array",
52
+ "items": { "$ref": "#/$defs/artifact" }
53
+ },
54
+ "errors": {
55
+ "type": "array",
56
+ "items": { "type": "string" }
57
+ }
58
+ },
59
+ "$defs": {
60
+ "replayCommand": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["argv"],
64
+ "properties": {
65
+ "argv": { "$ref": "#/$defs/replayArgv" }
66
+ }
67
+ },
68
+ "replayUpdateCommand": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["argv"],
72
+ "properties": {
73
+ "argv": {
74
+ "allOf": [
75
+ { "$ref": "#/$defs/replayArgv" },
76
+ { "contains": { "const": "--update-snapshots" } }
77
+ ]
78
+ }
79
+ }
80
+ },
81
+ "replayArgv": {
82
+ "type": "array",
83
+ "minItems": 4,
84
+ "prefixItems": [{ "const": "ptywright" }, { "const": "agent" }, { "const": "replay" }],
85
+ "items": { "type": "string", "minLength": 1 }
86
+ },
87
+ "commands": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["replay", "updateSnapshots"],
91
+ "properties": {
92
+ "replay": { "$ref": "#/$defs/replayCommand" },
93
+ "updateSnapshots": { "$ref": "#/$defs/replayUpdateCommand" }
94
+ }
95
+ },
96
+ "step": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "required": ["index", "type", "label", "durationMs", "ok"],
100
+ "properties": {
101
+ "index": { "type": "integer", "minimum": 0 },
102
+ "type": { "type": "string", "minLength": 1 },
103
+ "label": { "type": "string" },
104
+ "durationMs": { "type": "integer", "minimum": 0 },
105
+ "ok": { "type": "boolean" },
106
+ "error": { "type": "string" }
107
+ }
108
+ },
109
+ "artifact": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["name", "viewport", "kind", "path", "ok"],
113
+ "properties": {
114
+ "name": { "type": "string", "minLength": 1 },
115
+ "viewport": { "type": "string", "minLength": 1 },
116
+ "kind": { "type": "string", "enum": ["terminal", "dom", "screenshot"] },
117
+ "path": { "type": "string", "minLength": 1 },
118
+ "baselinePath": { "type": "string", "minLength": 1 },
119
+ "diffPath": { "type": "string", "minLength": 1 },
120
+ "hash": { "type": "string", "minLength": 1 },
121
+ "ok": { "type": "boolean" },
122
+ "error": { "type": "string" }
123
+ }
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,182 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ptywright.local/schemas/ptywright-agent.schema.json",
4
+ "title": "ptywright agent browser flow",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["launch", "steps"],
8
+ "properties": {
9
+ "$schema": { "type": "string" },
10
+ "name": { "type": "string", "minLength": 1 },
11
+ "artifactsDir": { "type": "string" },
12
+ "snapshotDir": { "type": "string" },
13
+ "launch": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "properties": {
17
+ "mode": { "type": "string", "enum": ["aitty", "url"] },
18
+ "agentFlavor": { "type": "string", "enum": ["codex", "claude", "droid", "generic"] },
19
+ "command": { "type": "string", "minLength": 1 },
20
+ "args": { "type": "array", "items": { "type": "string" } },
21
+ "cwd": { "type": "string" },
22
+ "env": { "type": "object", "additionalProperties": { "type": "string" } },
23
+ "url": { "type": "string" },
24
+ "aitty": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "properties": {
28
+ "command": { "type": "string", "minLength": 1 },
29
+ "args": { "type": "array", "items": { "type": "string" } },
30
+ "project": { "type": "string", "minLength": 1 },
31
+ "label": { "type": "string", "minLength": 1 },
32
+ "title": { "type": "string", "minLength": 1 },
33
+ "subtitle": { "type": "string", "minLength": 1 },
34
+ "theme": { "type": "string", "enum": ["dark", "light", "auto"] },
35
+ "fontSize": { "type": "integer", "minimum": 11, "maximum": 24 },
36
+ "screenMode": { "type": "string", "enum": ["termvision"] },
37
+ "port": { "type": "integer", "minimum": 0, "maximum": 65535 },
38
+ "host": { "type": "string", "minLength": 1 },
39
+ "waitForUrlMs": { "type": "integer", "minimum": 1 }
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "viewports": {
45
+ "type": "array",
46
+ "minItems": 1,
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["name", "width", "height"],
51
+ "properties": {
52
+ "name": { "type": "string", "minLength": 1 },
53
+ "width": { "type": "integer", "minimum": 1 },
54
+ "height": { "type": "integer", "minimum": 1 },
55
+ "deviceScaleFactor": { "type": "number", "exclusiveMinimum": 0 },
56
+ "isMobile": { "type": "boolean" },
57
+ "hasTouch": { "type": "boolean" }
58
+ }
59
+ }
60
+ },
61
+ "defaults": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "properties": {
65
+ "timeoutMs": { "type": "integer", "minimum": 1 },
66
+ "screenshot": { "type": "boolean" },
67
+ "mask": {
68
+ "type": "array",
69
+ "items": { "$ref": "#/$defs/maskRule" }
70
+ }
71
+ }
72
+ },
73
+ "steps": {
74
+ "type": "array",
75
+ "minItems": 1,
76
+ "items": {
77
+ "oneOf": [
78
+ {
79
+ "type": "object",
80
+ "additionalProperties": false,
81
+ "required": ["type"],
82
+ "properties": {
83
+ "type": { "const": "waitForText" },
84
+ "text": { "type": "string" },
85
+ "regex": { "type": "string" },
86
+ "timeoutMs": { "type": "integer", "minimum": 1 }
87
+ }
88
+ },
89
+ {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["type", "text"],
93
+ "properties": {
94
+ "type": { "const": "typeText" },
95
+ "text": { "type": "string" },
96
+ "enter": { "type": "boolean" },
97
+ "delayMs": { "type": "integer", "minimum": 0 }
98
+ }
99
+ },
100
+ {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": ["type", "key"],
104
+ "properties": {
105
+ "type": { "const": "pressKey" },
106
+ "key": { "type": "string", "minLength": 1 }
107
+ }
108
+ },
109
+ {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["type"],
113
+ "properties": {
114
+ "type": { "const": "click" },
115
+ "selector": { "type": "string", "minLength": 1 },
116
+ "text": { "type": "string", "minLength": 1 },
117
+ "x": { "type": "integer", "minimum": 0 },
118
+ "y": { "type": "integer", "minimum": 0 }
119
+ }
120
+ },
121
+ {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["type"],
125
+ "properties": {
126
+ "type": { "const": "waitForStableDom" },
127
+ "timeoutMs": { "type": "integer", "minimum": 1 },
128
+ "quietMs": { "type": "integer", "minimum": 1 },
129
+ "intervalMs": { "type": "integer", "minimum": 1 }
130
+ }
131
+ },
132
+ {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["type", "name"],
136
+ "properties": {
137
+ "type": { "const": "snapshot" },
138
+ "name": { "type": "string", "minLength": 1 },
139
+ "compare": { "type": "boolean" },
140
+ "targets": {
141
+ "type": "array",
142
+ "items": { "type": "string", "enum": ["terminal", "dom", "screenshot"] }
143
+ },
144
+ "fullPage": { "type": "boolean" }
145
+ }
146
+ },
147
+ {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": ["type"],
151
+ "properties": {
152
+ "type": { "const": "mark" },
153
+ "label": { "type": "string" }
154
+ }
155
+ },
156
+ {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "required": ["type", "ms"],
160
+ "properties": {
161
+ "type": { "const": "sleep" },
162
+ "ms": { "type": "integer", "minimum": 0 }
163
+ }
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ },
169
+ "$defs": {
170
+ "maskRule": {
171
+ "type": "object",
172
+ "additionalProperties": false,
173
+ "required": ["regex"],
174
+ "properties": {
175
+ "regex": { "type": "string", "minLength": 1 },
176
+ "flags": { "type": "string" },
177
+ "replacement": { "type": "string" },
178
+ "preserveLength": { "type": "boolean" }
179
+ }
180
+ }
181
+ }
182
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ptywright.local/schemas/ptywright-pty-cassette.schema.json",
4
+ "title": "ptywright raw PTY cassette",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "createdAt", "durationMs", "terminal", "events"],
8
+ "properties": {
9
+ "$schema": { "type": "string" },
10
+ "version": { "const": 1 },
11
+ "createdAt": { "type": "string", "minLength": 1 },
12
+ "durationMs": { "type": "integer", "minimum": 0 },
13
+ "terminal": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["cols", "rows"],
17
+ "properties": {
18
+ "cols": { "type": "integer", "minimum": 1 },
19
+ "rows": { "type": "integer", "minimum": 1 },
20
+ "term": { "type": "string", "minLength": 1 }
21
+ }
22
+ },
23
+ "command": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "required": ["file"],
27
+ "properties": {
28
+ "file": { "type": "string", "minLength": 1 },
29
+ "args": { "type": "array", "items": { "type": "string" } },
30
+ "cwd": { "type": "string" },
31
+ "env": {
32
+ "type": "object",
33
+ "additionalProperties": { "type": "string" }
34
+ }
35
+ }
36
+ },
37
+ "metadata": {
38
+ "type": "object",
39
+ "additionalProperties": {
40
+ "type": ["string", "number", "boolean", "null"]
41
+ }
42
+ },
43
+ "events": {
44
+ "type": "array",
45
+ "items": {
46
+ "oneOf": [
47
+ {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["atMs", "type", "dataBase64"],
51
+ "properties": {
52
+ "atMs": { "type": "integer", "minimum": 0 },
53
+ "type": { "enum": ["output", "input"] },
54
+ "dataBase64": {
55
+ "type": "string",
56
+ "pattern": "^[A-Za-z0-9+/]*={0,2}$"
57
+ }
58
+ }
59
+ },
60
+ {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["atMs", "type", "cols", "rows"],
64
+ "properties": {
65
+ "atMs": { "type": "integer", "minimum": 0 },
66
+ "type": { "const": "resize" },
67
+ "cols": { "type": "integer", "minimum": 1 },
68
+ "rows": { "type": "integer", "minimum": 1 }
69
+ }
70
+ },
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["atMs", "type", "exitCode"],
75
+ "properties": {
76
+ "atMs": { "type": "integer", "minimum": 0 },
77
+ "type": { "const": "exit" },
78
+ "exitCode": { "type": "integer" },
79
+ "signal": { "type": ["integer", "string", "null"] }
80
+ }
81
+ }
82
+ ]
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ptywright.local/schemas/ptywright-script-manifest.schema.json",
4
+ "title": "ptywright script artifact manifest",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "version",
9
+ "kind",
10
+ "ok",
11
+ "generatedAt",
12
+ "rootDir",
13
+ "primaryPath",
14
+ "commands",
15
+ "totalCount",
16
+ "failureCount",
17
+ "files"
18
+ ],
19
+ "properties": {
20
+ "$schema": { "type": "string" },
21
+ "version": { "const": 1 },
22
+ "kind": { "const": "run-suite" },
23
+ "ok": { "type": "boolean" },
24
+ "generatedAt": { "type": "string", "minLength": 1 },
25
+ "rootDir": { "type": "string", "minLength": 1 },
26
+ "primaryPath": { "type": "string", "minLength": 1 },
27
+ "commands": {
28
+ "type": "object",
29
+ "additionalProperties": { "$ref": "#/$defs/command" },
30
+ "minProperties": 1
31
+ },
32
+ "totalCount": { "type": "integer", "minimum": 0 },
33
+ "failureCount": { "type": "integer", "minimum": 0 },
34
+ "files": {
35
+ "type": "array",
36
+ "items": { "$ref": "#/$defs/file" }
37
+ }
38
+ },
39
+ "$defs": {
40
+ "command": {
41
+ "type": "object",
42
+ "additionalProperties": false,
43
+ "required": ["argv"],
44
+ "properties": {
45
+ "argv": { "$ref": "#/$defs/runAllArgv" }
46
+ }
47
+ },
48
+ "runAllArgv": {
49
+ "type": "array",
50
+ "minItems": 2,
51
+ "prefixItems": [{ "const": "ptywright" }, { "const": "run-all" }],
52
+ "items": { "type": "string", "minLength": 1 }
53
+ },
54
+ "file": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["path", "kind", "bytes", "sha256"],
58
+ "properties": {
59
+ "path": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "description": "Path to the artifact file, relative to the manifest directory when the file is inside the artifact root."
63
+ },
64
+ "kind": {
65
+ "type": "string",
66
+ "enum": ["run-summary", "report", "cast", "data", "failure"]
67
+ },
68
+ "role": { "type": "string", "minLength": 1 },
69
+ "ok": { "type": "boolean" },
70
+ "bytes": { "type": "integer", "minimum": 0 },
71
+ "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
72
+ }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ptywright.local/schemas/ptywright-script-run-summary.schema.json",
4
+ "title": "ptywright script run summary",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "version",
9
+ "ok",
10
+ "dir",
11
+ "suiteDir",
12
+ "commands",
13
+ "totalCount",
14
+ "failureCount",
15
+ "durationMs",
16
+ "reportPath",
17
+ "summaryPath",
18
+ "entries"
19
+ ],
20
+ "properties": {
21
+ "$schema": { "type": "string" },
22
+ "version": { "const": 1 },
23
+ "ok": { "type": "boolean" },
24
+ "dir": { "type": "string", "minLength": 1 },
25
+ "suiteDir": { "type": "string", "minLength": 1 },
26
+ "commands": { "$ref": "#/$defs/commands" },
27
+ "totalCount": { "type": "integer", "minimum": 0 },
28
+ "failureCount": { "type": "integer", "minimum": 0 },
29
+ "durationMs": { "type": "integer", "minimum": 0 },
30
+ "reportPath": { "type": "string", "minLength": 1 },
31
+ "summaryPath": { "type": "string", "minLength": 1 },
32
+ "entries": {
33
+ "type": "array",
34
+ "items": { "$ref": "#/$defs/entry" }
35
+ }
36
+ },
37
+ "$defs": {
38
+ "command": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["argv"],
42
+ "properties": {
43
+ "argv": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "items": { "type": "string", "minLength": 1 }
47
+ }
48
+ }
49
+ },
50
+ "runAllArgv": {
51
+ "type": "array",
52
+ "minItems": 5,
53
+ "prefixItems": [{ "const": "ptywright" }, { "const": "run-all" }],
54
+ "contains": { "const": "--artifacts-root" },
55
+ "items": { "type": "string", "minLength": 1 }
56
+ },
57
+ "updateGoldensArgv": {
58
+ "allOf": [{ "$ref": "#/$defs/runAllArgv" }, { "contains": { "const": "--update-goldens" } }]
59
+ },
60
+ "commands": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["runAll", "updateGoldens"],
64
+ "properties": {
65
+ "runAll": {
66
+ "allOf": [
67
+ { "$ref": "#/$defs/command" },
68
+ {
69
+ "type": "object",
70
+ "properties": { "argv": { "$ref": "#/$defs/runAllArgv" } }
71
+ }
72
+ ]
73
+ },
74
+ "updateGoldens": {
75
+ "allOf": [
76
+ { "$ref": "#/$defs/command" },
77
+ {
78
+ "type": "object",
79
+ "properties": { "argv": { "$ref": "#/$defs/updateGoldensArgv" } }
80
+ }
81
+ ]
82
+ }
83
+ }
84
+ },
85
+ "entry": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": ["filePath", "filePathRel", "scriptName", "ok", "durationMs"],
89
+ "properties": {
90
+ "filePath": { "type": "string", "minLength": 1 },
91
+ "filePathRel": { "type": "string", "minLength": 1 },
92
+ "scriptName": { "type": "string", "minLength": 1 },
93
+ "ok": { "type": "boolean" },
94
+ "durationMs": { "type": "integer", "minimum": 0 },
95
+ "artifactsDir": { "type": "string", "minLength": 1 },
96
+ "reportPath": { "type": "string", "minLength": 1 },
97
+ "castPath": { "type": "string", "minLength": 1 },
98
+ "error": { "type": "string" },
99
+ "failureArtifacts": { "$ref": "#/$defs/failureArtifacts" }
100
+ }
101
+ },
102
+ "failureArtifacts": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["lastTextPath", "lastViewPath", "stepPath", "errorPath"],
106
+ "properties": {
107
+ "lastTextPath": { "type": "string", "minLength": 1 },
108
+ "lastViewPath": { "type": "string", "minLength": 1 },
109
+ "stepPath": { "type": "string", "minLength": 1 },
110
+ "errorPath": { "type": "string", "minLength": 1 }
111
+ }
112
+ }
113
+ }
114
+ }
@@ -31,8 +31,12 @@
31
31
  "launch": {
32
32
  "type": "object",
33
33
  "additionalProperties": false,
34
- "required": ["command"],
35
34
  "properties": {
35
+ "backend": {
36
+ "type": "string",
37
+ "enum": ["pty", "frames", "ink", "ratatui"],
38
+ "default": "pty"
39
+ },
36
40
  "command": { "type": "string", "minLength": 1 },
37
41
  "args": { "type": "array", "items": { "type": "string" } },
38
42
  "cwd": { "type": "string" },
@@ -42,8 +46,56 @@
42
46
  },
43
47
  "cols": { "type": "integer", "minimum": 1 },
44
48
  "rows": { "type": "integer", "minimum": 1 },
45
- "name": { "type": "string" }
46
- }
49
+ "name": { "type": "string" },
50
+ "frame": { "type": "string" },
51
+ "frames": {
52
+ "type": "array",
53
+ "items": {
54
+ "oneOf": [
55
+ { "type": "string" },
56
+ {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "name": { "type": "string" },
61
+ "text": { "type": "string" },
62
+ "frame": { "type": "string" },
63
+ "snapshot": { "type": "string" },
64
+ "lastFrame": { "type": "string" }
65
+ },
66
+ "anyOf": [
67
+ { "required": ["text"] },
68
+ { "required": ["frame"] },
69
+ { "required": ["snapshot"] },
70
+ { "required": ["lastFrame"] }
71
+ ]
72
+ }
73
+ ]
74
+ }
75
+ },
76
+ "framePath": { "type": "string" },
77
+ "frameModule": { "type": "string" },
78
+ "advanceOnInput": { "type": "boolean" }
79
+ },
80
+ "allOf": [
81
+ {
82
+ "if": {
83
+ "anyOf": [
84
+ { "not": { "required": ["backend"] } },
85
+ { "properties": { "backend": { "const": "pty" } }, "required": ["backend"] }
86
+ ]
87
+ },
88
+ "then": { "required": ["command"] },
89
+ "else": {
90
+ "anyOf": [
91
+ { "required": ["frame"] },
92
+ { "required": ["frames"] },
93
+ { "required": ["framePath"] },
94
+ { "required": ["frameModule"] }
95
+ ]
96
+ }
97
+ }
98
+ ]
47
99
  },
48
100
  "trace": {
49
101
  "type": "object",