@relauts/spotcheck-service 1.0.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 (124) hide show
  1. package/LICENSE +661 -0
  2. package/NOTICE +19 -0
  3. package/README.md +169 -0
  4. package/dist/api/auth.d.ts +11 -0
  5. package/dist/api/auth.js +32 -0
  6. package/dist/api/auth.js.map +1 -0
  7. package/dist/api/history.d.ts +46 -0
  8. package/dist/api/history.js +172 -0
  9. package/dist/api/history.js.map +1 -0
  10. package/dist/api/saved-run.d.ts +35 -0
  11. package/dist/api/saved-run.js +234 -0
  12. package/dist/api/saved-run.js.map +1 -0
  13. package/dist/api/saved.d.ts +33 -0
  14. package/dist/api/saved.js +209 -0
  15. package/dist/api/saved.js.map +1 -0
  16. package/dist/api/server.d.ts +23 -0
  17. package/dist/api/server.js +852 -0
  18. package/dist/api/server.js.map +1 -0
  19. package/dist/computer-use/actions.d.ts +14 -0
  20. package/dist/computer-use/actions.js +212 -0
  21. package/dist/computer-use/actions.js.map +1 -0
  22. package/dist/computer-use/args.d.ts +11 -0
  23. package/dist/computer-use/args.js +74 -0
  24. package/dist/computer-use/args.js.map +1 -0
  25. package/dist/computer-use/cli.d.ts +1 -0
  26. package/dist/computer-use/cli.js +8 -0
  27. package/dist/computer-use/cli.js.map +1 -0
  28. package/dist/computer-use/client.d.ts +3 -0
  29. package/dist/computer-use/client.js +68 -0
  30. package/dist/computer-use/client.js.map +1 -0
  31. package/dist/computer-use/coords.d.ts +5 -0
  32. package/dist/computer-use/coords.js +21 -0
  33. package/dist/computer-use/coords.js.map +1 -0
  34. package/dist/computer-use/history.d.ts +11 -0
  35. package/dist/computer-use/history.js +59 -0
  36. package/dist/computer-use/history.js.map +1 -0
  37. package/dist/computer-use/index.d.ts +17 -0
  38. package/dist/computer-use/index.js +75 -0
  39. package/dist/computer-use/index.js.map +1 -0
  40. package/dist/computer-use/keys.d.ts +3 -0
  41. package/dist/computer-use/keys.js +50 -0
  42. package/dist/computer-use/keys.js.map +1 -0
  43. package/dist/computer-use/loop.d.ts +22 -0
  44. package/dist/computer-use/loop.js +90 -0
  45. package/dist/computer-use/loop.js.map +1 -0
  46. package/dist/computer-use/safety.d.ts +15 -0
  47. package/dist/computer-use/safety.js +45 -0
  48. package/dist/computer-use/safety.js.map +1 -0
  49. package/dist/computer-use/screenshot.d.ts +5 -0
  50. package/dist/computer-use/screenshot.js +16 -0
  51. package/dist/computer-use/screenshot.js.map +1 -0
  52. package/dist/computer-use/system-prompt.d.ts +11 -0
  53. package/dist/computer-use/system-prompt.js +41 -0
  54. package/dist/computer-use/system-prompt.js.map +1 -0
  55. package/dist/computer-use/types.d.ts +83 -0
  56. package/dist/computer-use/types.js +31 -0
  57. package/dist/computer-use/types.js.map +1 -0
  58. package/dist/playwright/actions.d.ts +81 -0
  59. package/dist/playwright/actions.js +170 -0
  60. package/dist/playwright/actions.js.map +1 -0
  61. package/dist/playwright/chromium.d.ts +10 -0
  62. package/dist/playwright/chromium.js +27 -0
  63. package/dist/playwright/chromium.js.map +1 -0
  64. package/dist/playwright/index.d.ts +2 -0
  65. package/dist/playwright/index.js +64 -0
  66. package/dist/playwright/index.js.map +1 -0
  67. package/dist/playwright/processed.d.ts +11 -0
  68. package/dist/playwright/processed.js +183 -0
  69. package/dist/playwright/processed.js.map +1 -0
  70. package/dist/playwright/session.d.ts +28 -0
  71. package/dist/playwright/session.js +165 -0
  72. package/dist/playwright/session.js.map +1 -0
  73. package/dist/shared/config.d.ts +38 -0
  74. package/dist/shared/config.js +227 -0
  75. package/dist/shared/config.js.map +1 -0
  76. package/dist/shared/cost.d.ts +15 -0
  77. package/dist/shared/cost.js +40 -0
  78. package/dist/shared/cost.js.map +1 -0
  79. package/dist/shared/logger.d.ts +4 -0
  80. package/dist/shared/logger.js +10 -0
  81. package/dist/shared/logger.js.map +1 -0
  82. package/dist/shared/main-module.d.ts +1 -0
  83. package/dist/shared/main-module.js +19 -0
  84. package/dist/shared/main-module.js.map +1 -0
  85. package/dist/shared/models.d.ts +12 -0
  86. package/dist/shared/models.js +40 -0
  87. package/dist/shared/models.js.map +1 -0
  88. package/dist/shared/telemetry.d.ts +9 -0
  89. package/dist/shared/telemetry.js +43 -0
  90. package/dist/shared/telemetry.js.map +1 -0
  91. package/files/model.json +26 -0
  92. package/files/system_prompt.txt +15 -0
  93. package/openapi.yaml +901 -0
  94. package/package.json +60 -0
  95. package/relauts-spotcheck-service-config.example.json +19 -0
  96. package/src/api/auth.ts +40 -0
  97. package/src/api/history.ts +251 -0
  98. package/src/api/saved-run.ts +346 -0
  99. package/src/api/saved.ts +275 -0
  100. package/src/api/server.ts +1198 -0
  101. package/src/computer-use/actions.ts +273 -0
  102. package/src/computer-use/args.ts +97 -0
  103. package/src/computer-use/cli.ts +8 -0
  104. package/src/computer-use/client.ts +81 -0
  105. package/src/computer-use/coords.ts +26 -0
  106. package/src/computer-use/history.ts +80 -0
  107. package/src/computer-use/index.ts +121 -0
  108. package/src/computer-use/keys.ts +54 -0
  109. package/src/computer-use/loop.ts +140 -0
  110. package/src/computer-use/safety.ts +59 -0
  111. package/src/computer-use/screenshot.ts +20 -0
  112. package/src/computer-use/system-prompt.ts +65 -0
  113. package/src/computer-use/types.ts +126 -0
  114. package/src/playwright/actions.ts +332 -0
  115. package/src/playwright/chromium.ts +30 -0
  116. package/src/playwright/index.ts +77 -0
  117. package/src/playwright/processed.ts +253 -0
  118. package/src/playwright/session.ts +220 -0
  119. package/src/shared/config.ts +320 -0
  120. package/src/shared/cost.ts +58 -0
  121. package/src/shared/logger.ts +9 -0
  122. package/src/shared/main-module.ts +20 -0
  123. package/src/shared/models.ts +62 -0
  124. package/src/shared/telemetry.ts +63 -0
package/openapi.yaml ADDED
@@ -0,0 +1,901 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Spotcheck Service API
4
+ description: |
5
+ Local Gemini computer-use + Playwright API. Listens on `127.0.0.1` only.
6
+
7
+ All `/v1/*` routes except `GET /v1/health` require
8
+ `Authorization: Bearer <apiToken>`.
9
+
10
+ Errors are JSON: `{ "error": "message" }`. Wrong methods return `405` with
11
+ an `Allow` header and a plain-text body.
12
+ version: 1.0.0
13
+ license:
14
+ name: AGPL-3.0-or-later
15
+ identifier: AGPL-3.0-or-later
16
+
17
+ servers:
18
+ - url: http://127.0.0.1:18732
19
+
20
+ security:
21
+ - bearerAuth: []
22
+
23
+ tags:
24
+ - name: health
25
+ - name: models
26
+ - name: agent
27
+ - name: session
28
+ - name: screenshot
29
+ - name: saved
30
+ - name: history
31
+
32
+ paths:
33
+ /v1/health:
34
+ get:
35
+ tags: [health]
36
+ security: []
37
+ summary: Liveness check
38
+ responses:
39
+ "200":
40
+ description: Service is up
41
+ content:
42
+ application/json:
43
+ schema:
44
+ $ref: "#/components/schemas/OkResponse"
45
+ "405":
46
+ $ref: "#/components/responses/MethodNotAllowed"
47
+
48
+ /v1/models:
49
+ get:
50
+ tags: [models]
51
+ summary: List allowed models
52
+ responses:
53
+ "200":
54
+ description: Models from `files/model.json`
55
+ content:
56
+ application/json:
57
+ schema:
58
+ type: array
59
+ items:
60
+ $ref: "#/components/schemas/ModelEntry"
61
+ "401":
62
+ $ref: "#/components/responses/Unauthorized"
63
+ "405":
64
+ $ref: "#/components/responses/MethodNotAllowed"
65
+
66
+ /v1/agent:
67
+ post:
68
+ tags: [agent]
69
+ summary: Run an agent task
70
+ description: |
71
+ Streams NDJSON events (`intent`, `safety_confirm`, `done`, `error`).
72
+ Each event also includes `session` and `screenshot`.
73
+ Disconnecting the client aborts the run.
74
+ requestBody:
75
+ required: true
76
+ content:
77
+ application/json:
78
+ schema:
79
+ $ref: "#/components/schemas/AgentRequest"
80
+ responses:
81
+ "200":
82
+ description: NDJSON event stream
83
+ content:
84
+ application/x-ndjson:
85
+ schema:
86
+ $ref: "#/components/schemas/AgentEvent"
87
+ "400":
88
+ $ref: "#/components/responses/Error"
89
+ "401":
90
+ $ref: "#/components/responses/Unauthorized"
91
+ "409":
92
+ $ref: "#/components/responses/Error"
93
+ "413":
94
+ $ref: "#/components/responses/Error"
95
+ "405":
96
+ $ref: "#/components/responses/MethodNotAllowed"
97
+
98
+ /v1/agent/safety:
99
+ post:
100
+ tags: [agent]
101
+ summary: Confirm or deny a pending safety prompt
102
+ requestBody:
103
+ required: true
104
+ content:
105
+ application/json:
106
+ schema:
107
+ $ref: "#/components/schemas/SafetyConfirmRequest"
108
+ responses:
109
+ "200":
110
+ description: Confirmation accepted
111
+ content:
112
+ application/json:
113
+ schema:
114
+ $ref: "#/components/schemas/OkResponse"
115
+ "400":
116
+ $ref: "#/components/responses/Error"
117
+ "401":
118
+ $ref: "#/components/responses/Unauthorized"
119
+ "404":
120
+ $ref: "#/components/responses/Error"
121
+ "405":
122
+ $ref: "#/components/responses/MethodNotAllowed"
123
+
124
+ /v1/session:
125
+ get:
126
+ tags: [session]
127
+ summary: Browser session status
128
+ responses:
129
+ "200":
130
+ description: Current session
131
+ content:
132
+ application/json:
133
+ schema:
134
+ $ref: "#/components/schemas/SessionStatus"
135
+ "401":
136
+ $ref: "#/components/responses/Unauthorized"
137
+ "405":
138
+ $ref: "#/components/responses/MethodNotAllowed"
139
+
140
+ /v1/session/back:
141
+ post:
142
+ tags: [session]
143
+ summary: Navigate back
144
+ responses:
145
+ "200":
146
+ description: Updated session
147
+ content:
148
+ application/json:
149
+ schema:
150
+ $ref: "#/components/schemas/SessionStatus"
151
+ "401":
152
+ $ref: "#/components/responses/Unauthorized"
153
+ "409":
154
+ $ref: "#/components/responses/Error"
155
+ "405":
156
+ $ref: "#/components/responses/MethodNotAllowed"
157
+
158
+ /v1/session/forward:
159
+ post:
160
+ tags: [session]
161
+ summary: Navigate forward
162
+ responses:
163
+ "200":
164
+ description: Updated session
165
+ content:
166
+ application/json:
167
+ schema:
168
+ $ref: "#/components/schemas/SessionStatus"
169
+ "401":
170
+ $ref: "#/components/responses/Unauthorized"
171
+ "409":
172
+ $ref: "#/components/responses/Error"
173
+ "405":
174
+ $ref: "#/components/responses/MethodNotAllowed"
175
+
176
+ /v1/session/reload:
177
+ post:
178
+ tags: [session]
179
+ summary: Reload the page
180
+ responses:
181
+ "200":
182
+ description: Updated session
183
+ content:
184
+ application/json:
185
+ schema:
186
+ $ref: "#/components/schemas/SessionStatus"
187
+ "401":
188
+ $ref: "#/components/responses/Unauthorized"
189
+ "409":
190
+ $ref: "#/components/responses/Error"
191
+ "405":
192
+ $ref: "#/components/responses/MethodNotAllowed"
193
+
194
+ /v1/screenshot:
195
+ get:
196
+ tags: [screenshot]
197
+ summary: Latest processed screenshot name
198
+ responses:
199
+ "200":
200
+ description: Image file name
201
+ content:
202
+ application/json:
203
+ schema:
204
+ $ref: "#/components/schemas/ScreenshotName"
205
+ "401":
206
+ $ref: "#/components/responses/Unauthorized"
207
+ "404":
208
+ $ref: "#/components/responses/Error"
209
+ "405":
210
+ $ref: "#/components/responses/MethodNotAllowed"
211
+
212
+ /v1/saved:
213
+ get:
214
+ tags: [saved]
215
+ summary: List saved flows
216
+ description: Does not include `create-default.json`.
217
+ responses:
218
+ "200":
219
+ description: File names
220
+ content:
221
+ application/json:
222
+ schema:
223
+ $ref: "#/components/schemas/FileList"
224
+ "401":
225
+ $ref: "#/components/responses/Unauthorized"
226
+ "405":
227
+ $ref: "#/components/responses/MethodNotAllowed"
228
+ post:
229
+ tags: [saved]
230
+ summary: Create a saved flow
231
+ requestBody:
232
+ required: true
233
+ content:
234
+ application/json:
235
+ schema:
236
+ $ref: "#/components/schemas/SavedCreateRequest"
237
+ responses:
238
+ "201":
239
+ description: Created
240
+ content:
241
+ application/json:
242
+ schema:
243
+ $ref: "#/components/schemas/FileNameResponse"
244
+ "400":
245
+ $ref: "#/components/responses/Error"
246
+ "401":
247
+ $ref: "#/components/responses/Unauthorized"
248
+ "409":
249
+ $ref: "#/components/responses/Error"
250
+ "405":
251
+ $ref: "#/components/responses/MethodNotAllowed"
252
+
253
+ /v1/saved/running:
254
+ get:
255
+ tags: [saved]
256
+ summary: List currently running saved flows
257
+ responses:
258
+ "200":
259
+ description: Running file names
260
+ content:
261
+ application/json:
262
+ schema:
263
+ $ref: "#/components/schemas/FileList"
264
+ "401":
265
+ $ref: "#/components/responses/Unauthorized"
266
+ "405":
267
+ $ref: "#/components/responses/MethodNotAllowed"
268
+
269
+ /v1/saved/run:
270
+ post:
271
+ tags: [saved]
272
+ summary: Start a saved flow
273
+ requestBody:
274
+ required: true
275
+ content:
276
+ application/json:
277
+ schema:
278
+ $ref: "#/components/schemas/FileNameRequest"
279
+ responses:
280
+ "202":
281
+ description: Run started
282
+ content:
283
+ application/json:
284
+ schema:
285
+ $ref: "#/components/schemas/HistoryFileResponse"
286
+ "400":
287
+ $ref: "#/components/responses/Error"
288
+ "401":
289
+ $ref: "#/components/responses/Unauthorized"
290
+ "404":
291
+ $ref: "#/components/responses/Error"
292
+ "409":
293
+ $ref: "#/components/responses/Error"
294
+ "405":
295
+ $ref: "#/components/responses/MethodNotAllowed"
296
+
297
+ /v1/saved/create-default.json:
298
+ get:
299
+ tags: [saved]
300
+ summary: Get create-tab default items
301
+ responses:
302
+ "200":
303
+ description: Default flow (empty items if missing)
304
+ content:
305
+ application/json:
306
+ schema:
307
+ $ref: "#/components/schemas/SavedFile"
308
+ "401":
309
+ $ref: "#/components/responses/Unauthorized"
310
+ "405":
311
+ $ref: "#/components/responses/MethodNotAllowed"
312
+ put:
313
+ tags: [saved]
314
+ summary: Replace create-tab default items
315
+ requestBody:
316
+ required: true
317
+ content:
318
+ application/json:
319
+ schema:
320
+ $ref: "#/components/schemas/SavedItemsBody"
321
+ responses:
322
+ "200":
323
+ description: Saved
324
+ content:
325
+ application/json:
326
+ schema:
327
+ $ref: "#/components/schemas/FileNameResponse"
328
+ "400":
329
+ $ref: "#/components/responses/Error"
330
+ "401":
331
+ $ref: "#/components/responses/Unauthorized"
332
+ "405":
333
+ $ref: "#/components/responses/MethodNotAllowed"
334
+
335
+ /v1/saved/{fileName}:
336
+ parameters:
337
+ - $ref: "#/components/parameters/fileName"
338
+ get:
339
+ tags: [saved]
340
+ summary: Get a saved flow
341
+ responses:
342
+ "200":
343
+ description: Saved flow
344
+ content:
345
+ application/json:
346
+ schema:
347
+ $ref: "#/components/schemas/SavedFile"
348
+ "400":
349
+ $ref: "#/components/responses/Error"
350
+ "401":
351
+ $ref: "#/components/responses/Unauthorized"
352
+ "404":
353
+ $ref: "#/components/responses/Error"
354
+ "405":
355
+ $ref: "#/components/responses/MethodNotAllowed"
356
+ put:
357
+ tags: [saved]
358
+ summary: Replace a saved flow
359
+ requestBody:
360
+ required: true
361
+ content:
362
+ application/json:
363
+ schema:
364
+ $ref: "#/components/schemas/SavedItemsBody"
365
+ responses:
366
+ "200":
367
+ description: Saved
368
+ content:
369
+ application/json:
370
+ schema:
371
+ $ref: "#/components/schemas/FileNameResponse"
372
+ "400":
373
+ $ref: "#/components/responses/Error"
374
+ "401":
375
+ $ref: "#/components/responses/Unauthorized"
376
+ "404":
377
+ $ref: "#/components/responses/Error"
378
+ "405":
379
+ $ref: "#/components/responses/MethodNotAllowed"
380
+ delete:
381
+ tags: [saved]
382
+ summary: Delete a saved flow
383
+ responses:
384
+ "200":
385
+ description: Deleted
386
+ content:
387
+ application/json:
388
+ schema:
389
+ $ref: "#/components/schemas/FileNameResponse"
390
+ "400":
391
+ $ref: "#/components/responses/Error"
392
+ "401":
393
+ $ref: "#/components/responses/Unauthorized"
394
+ "404":
395
+ $ref: "#/components/responses/Error"
396
+ "405":
397
+ $ref: "#/components/responses/MethodNotAllowed"
398
+
399
+ /v1/history:
400
+ get:
401
+ tags: [history]
402
+ summary: List history runs
403
+ responses:
404
+ "200":
405
+ description: All runs
406
+ content:
407
+ application/json:
408
+ schema:
409
+ $ref: "#/components/schemas/HistoryList"
410
+ "401":
411
+ $ref: "#/components/responses/Unauthorized"
412
+ "405":
413
+ $ref: "#/components/responses/MethodNotAllowed"
414
+
415
+ /v1/history/detail:
416
+ post:
417
+ tags: [history]
418
+ summary: Get one history run with screenshots
419
+ requestBody:
420
+ required: true
421
+ content:
422
+ application/json:
423
+ schema:
424
+ $ref: "#/components/schemas/HistoryFileRequest"
425
+ responses:
426
+ "200":
427
+ description: Run detail
428
+ content:
429
+ application/json:
430
+ schema:
431
+ $ref: "#/components/schemas/HistoryDetail"
432
+ "400":
433
+ $ref: "#/components/responses/Error"
434
+ "401":
435
+ $ref: "#/components/responses/Unauthorized"
436
+ "404":
437
+ $ref: "#/components/responses/Error"
438
+ "405":
439
+ $ref: "#/components/responses/MethodNotAllowed"
440
+
441
+ /v1/history/status:
442
+ post:
443
+ tags: [history]
444
+ summary: Latest run status for a saved flow
445
+ requestBody:
446
+ required: true
447
+ content:
448
+ application/json:
449
+ schema:
450
+ $ref: "#/components/schemas/FileNameRequest"
451
+ responses:
452
+ "200":
453
+ description: Latest run
454
+ content:
455
+ application/json:
456
+ schema:
457
+ $ref: "#/components/schemas/HistoryStatus"
458
+ "400":
459
+ $ref: "#/components/responses/Error"
460
+ "401":
461
+ $ref: "#/components/responses/Unauthorized"
462
+ "404":
463
+ $ref: "#/components/responses/Error"
464
+ "405":
465
+ $ref: "#/components/responses/MethodNotAllowed"
466
+
467
+ /v1/history/stop:
468
+ post:
469
+ tags: [history]
470
+ summary: Stop the latest run for a saved flow
471
+ requestBody:
472
+ required: true
473
+ content:
474
+ application/json:
475
+ schema:
476
+ $ref: "#/components/schemas/FileNameRequest"
477
+ responses:
478
+ "200":
479
+ description: Stopped
480
+ content:
481
+ application/json:
482
+ schema:
483
+ $ref: "#/components/schemas/OkResponse"
484
+ "400":
485
+ $ref: "#/components/responses/Error"
486
+ "401":
487
+ $ref: "#/components/responses/Unauthorized"
488
+ "404":
489
+ $ref: "#/components/responses/Error"
490
+ "409":
491
+ $ref: "#/components/responses/Error"
492
+ "405":
493
+ $ref: "#/components/responses/MethodNotAllowed"
494
+
495
+ components:
496
+ securitySchemes:
497
+ bearerAuth:
498
+ type: http
499
+ scheme: bearer
500
+ description: Value of `apiToken` from the sibling config file.
501
+
502
+ parameters:
503
+ fileName:
504
+ name: fileName
505
+ in: path
506
+ required: true
507
+ schema:
508
+ type: string
509
+ description: Saved flow name. `.json` is added if missing.
510
+
511
+ responses:
512
+ Unauthorized:
513
+ description: Missing or wrong Bearer token
514
+ content:
515
+ application/json:
516
+ schema:
517
+ $ref: "#/components/schemas/ErrorBody"
518
+ Error:
519
+ description: Request failed
520
+ content:
521
+ application/json:
522
+ schema:
523
+ $ref: "#/components/schemas/ErrorBody"
524
+ MethodNotAllowed:
525
+ description: Wrong HTTP method
526
+ headers:
527
+ Allow:
528
+ schema:
529
+ type: string
530
+ content:
531
+ text/plain:
532
+ schema:
533
+ type: string
534
+ example: Method not allowed
535
+
536
+ schemas:
537
+ ErrorBody:
538
+ type: object
539
+ required: [error]
540
+ additionalProperties: false
541
+ properties:
542
+ error:
543
+ type: string
544
+
545
+ OkResponse:
546
+ type: object
547
+ required: [ok]
548
+ additionalProperties: false
549
+ properties:
550
+ ok:
551
+ type: boolean
552
+ const: true
553
+
554
+ FileNameRequest:
555
+ type: object
556
+ required: [fileName]
557
+ additionalProperties: false
558
+ properties:
559
+ fileName:
560
+ type: string
561
+
562
+ FileNameResponse:
563
+ type: object
564
+ required: [fileName]
565
+ additionalProperties: false
566
+ properties:
567
+ fileName:
568
+ type: string
569
+
570
+ HistoryFileRequest:
571
+ type: object
572
+ required: [historyFile]
573
+ additionalProperties: false
574
+ properties:
575
+ historyFile:
576
+ type: string
577
+
578
+ HistoryFileResponse:
579
+ type: object
580
+ required: [historyFile]
581
+ additionalProperties: false
582
+ properties:
583
+ historyFile:
584
+ type: string
585
+
586
+ FileList:
587
+ type: object
588
+ required: [files]
589
+ additionalProperties: false
590
+ properties:
591
+ files:
592
+ type: array
593
+ items:
594
+ type: string
595
+
596
+ ScreenshotName:
597
+ type: object
598
+ required: [imageName]
599
+ additionalProperties: false
600
+ properties:
601
+ imageName:
602
+ type: string
603
+
604
+ SessionStatus:
605
+ type: object
606
+ required: [open, url]
607
+ additionalProperties: false
608
+ properties:
609
+ open:
610
+ type: boolean
611
+ url:
612
+ type: string
613
+
614
+ ModelEntry:
615
+ type: object
616
+ required:
617
+ - provider
618
+ - model
619
+ - input_price_per_million
620
+ - output_price_per_million
621
+ - cache_price_per_million
622
+ - description
623
+ additionalProperties: false
624
+ properties:
625
+ provider:
626
+ type: string
627
+ model:
628
+ type: string
629
+ input_price_per_million:
630
+ type: number
631
+ output_price_per_million:
632
+ type: number
633
+ cache_price_per_million:
634
+ type: number
635
+ description:
636
+ type: string
637
+
638
+ AgentRequest:
639
+ type: object
640
+ required: [task, model]
641
+ additionalProperties: false
642
+ properties:
643
+ task:
644
+ type: string
645
+ model:
646
+ type: string
647
+
648
+ SafetyConfirmRequest:
649
+ type: object
650
+ required: [id, confirmed]
651
+ additionalProperties: false
652
+ properties:
653
+ id:
654
+ type: string
655
+ confirmed:
656
+ type: boolean
657
+
658
+ AgentStreamExtras:
659
+ type: object
660
+ required: [session, screenshot]
661
+ properties:
662
+ session:
663
+ $ref: "#/components/schemas/SessionStatus"
664
+ screenshot:
665
+ $ref: "#/components/schemas/ScreenshotName"
666
+
667
+ AgentEvent:
668
+ oneOf:
669
+ - $ref: "#/components/schemas/AgentIntentEvent"
670
+ - $ref: "#/components/schemas/AgentSafetyEvent"
671
+ - $ref: "#/components/schemas/AgentDoneEvent"
672
+ - $ref: "#/components/schemas/AgentErrorEvent"
673
+
674
+ AgentIntentEvent:
675
+ allOf:
676
+ - $ref: "#/components/schemas/AgentStreamExtras"
677
+ - type: object
678
+ required: [type, label]
679
+ properties:
680
+ type:
681
+ type: string
682
+ const: intent
683
+ label:
684
+ type: string
685
+
686
+ AgentSafetyEvent:
687
+ allOf:
688
+ - $ref: "#/components/schemas/AgentStreamExtras"
689
+ - type: object
690
+ required: [type, id, action, explanation]
691
+ properties:
692
+ type:
693
+ type: string
694
+ const: safety_confirm
695
+ id:
696
+ type: string
697
+ format: uuid
698
+ action:
699
+ type: string
700
+ explanation:
701
+ type: string
702
+
703
+ AgentDoneEvent:
704
+ allOf:
705
+ - $ref: "#/components/schemas/AgentStreamExtras"
706
+ - type: object
707
+ required: [type, text, sessionReset, browserOpen, costUsd]
708
+ properties:
709
+ type:
710
+ type: string
711
+ const: done
712
+ text:
713
+ type: string
714
+ sessionReset:
715
+ type: boolean
716
+ browserOpen:
717
+ type: boolean
718
+ costUsd:
719
+ type: number
720
+
721
+ AgentErrorEvent:
722
+ allOf:
723
+ - $ref: "#/components/schemas/AgentStreamExtras"
724
+ - type: object
725
+ required: [type, error, costUsd]
726
+ properties:
727
+ type:
728
+ type: string
729
+ const: error
730
+ error:
731
+ type: string
732
+ costUsd:
733
+ type: number
734
+
735
+ SavedPromptItem:
736
+ type: object
737
+ required: [sequence, id, prompt, model]
738
+ additionalProperties: false
739
+ properties:
740
+ sequence:
741
+ type: integer
742
+ minimum: 1
743
+ id:
744
+ type: string
745
+ prompt:
746
+ type: string
747
+ model:
748
+ type: string
749
+ costUsd:
750
+ type: number
751
+ resultText:
752
+ type: string
753
+ sessionReset:
754
+ type: boolean
755
+ error:
756
+ type: string
757
+
758
+ SavedItemsBody:
759
+ type: object
760
+ required: [items]
761
+ additionalProperties: false
762
+ properties:
763
+ items:
764
+ type: array
765
+ items:
766
+ $ref: "#/components/schemas/SavedPromptItem"
767
+
768
+ SavedCreateRequest:
769
+ type: object
770
+ required: [fileName, items]
771
+ additionalProperties: false
772
+ properties:
773
+ fileName:
774
+ type: string
775
+ items:
776
+ type: array
777
+ items:
778
+ $ref: "#/components/schemas/SavedPromptItem"
779
+
780
+ SavedFile:
781
+ type: object
782
+ required: [fileName, items]
783
+ additionalProperties: false
784
+ properties:
785
+ fileName:
786
+ type: string
787
+ items:
788
+ type: array
789
+ items:
790
+ $ref: "#/components/schemas/SavedPromptItem"
791
+
792
+ HistoryRunStatus:
793
+ type: string
794
+ enum: [running, done, error, stopped]
795
+
796
+ HistoryItemStatus:
797
+ type: string
798
+ enum: [pending, running, done, error, skipped]
799
+
800
+ HistoryRunSummary:
801
+ type: object
802
+ required: [historyFile, status]
803
+ additionalProperties: false
804
+ properties:
805
+ historyFile:
806
+ type: string
807
+ status:
808
+ $ref: "#/components/schemas/HistoryRunStatus"
809
+
810
+ HistoryList:
811
+ type: object
812
+ required: [runs]
813
+ additionalProperties: false
814
+ properties:
815
+ runs:
816
+ type: array
817
+ items:
818
+ $ref: "#/components/schemas/HistoryRunSummary"
819
+
820
+ HistoryDetailItem:
821
+ type: object
822
+ required: [sequence, prompt, model, screenshots]
823
+ additionalProperties: false
824
+ properties:
825
+ sequence:
826
+ type: integer
827
+ prompt:
828
+ type: string
829
+ model:
830
+ type: string
831
+ resultText:
832
+ type: string
833
+ screenshots:
834
+ type: array
835
+ items:
836
+ type: string
837
+
838
+ HistoryDetail:
839
+ type: object
840
+ required: [historyFile, status, items]
841
+ additionalProperties: false
842
+ properties:
843
+ historyFile:
844
+ type: string
845
+ status:
846
+ $ref: "#/components/schemas/HistoryRunStatus"
847
+ items:
848
+ type: array
849
+ items:
850
+ $ref: "#/components/schemas/HistoryDetailItem"
851
+
852
+ HistoryItem:
853
+ type: object
854
+ required: [sequence, id, prompt, model, status]
855
+ additionalProperties: false
856
+ properties:
857
+ sequence:
858
+ type: integer
859
+ id:
860
+ type: string
861
+ prompt:
862
+ type: string
863
+ model:
864
+ type: string
865
+ status:
866
+ $ref: "#/components/schemas/HistoryItemStatus"
867
+ resultText:
868
+ type: string
869
+ costUsd:
870
+ type: number
871
+ error:
872
+ type: string
873
+
874
+ HistoryStatus:
875
+ type: object
876
+ required:
877
+ - fileName
878
+ - historyFile
879
+ - status
880
+ - current
881
+ - total
882
+ - screenshotPath
883
+ - items
884
+ additionalProperties: false
885
+ properties:
886
+ fileName:
887
+ type: string
888
+ historyFile:
889
+ type: string
890
+ status:
891
+ $ref: "#/components/schemas/HistoryRunStatus"
892
+ current:
893
+ type: integer
894
+ total:
895
+ type: integer
896
+ screenshotPath:
897
+ type: string
898
+ items:
899
+ type: array
900
+ items:
901
+ $ref: "#/components/schemas/HistoryItem"