@jevitate/cli 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 (375) hide show
  1. package/README.md +23 -0
  2. package/dist/ai-cli.js +40 -30
  3. package/dist/ai-cli.js.map +1 -1
  4. package/dist/author-journey-cli.d.ts +4 -0
  5. package/dist/author-journey-cli.js +109 -0
  6. package/dist/author-journey-cli.js.map +1 -0
  7. package/dist/bin.js +58077 -22454
  8. package/dist/bin.js.map +1 -1
  9. package/dist/browser-run-options.d.ts +58 -0
  10. package/dist/browser-run-options.js +106 -0
  11. package/dist/browser-run-options.js.map +1 -0
  12. package/dist/build-info.generated.d.ts +2 -0
  13. package/dist/build-info.generated.js +10 -0
  14. package/dist/build-info.generated.js.map +1 -0
  15. package/dist/check-api.d.ts +5 -0
  16. package/dist/check-api.js +233 -0
  17. package/dist/check-api.js.map +1 -0
  18. package/dist/check-budget.d.ts +26 -0
  19. package/dist/check-budget.js +89 -0
  20. package/dist/check-budget.js.map +1 -0
  21. package/dist/check-cli.d.ts +31 -0
  22. package/dist/check-cli.js +109 -0
  23. package/dist/check-cli.js.map +1 -0
  24. package/dist/check-execute.d.ts +25 -0
  25. package/dist/check-execute.js +385 -0
  26. package/dist/check-execute.js.map +1 -0
  27. package/dist/check-plan.d.ts +113 -0
  28. package/dist/check-plan.js +448 -0
  29. package/dist/check-plan.js.map +1 -0
  30. package/dist/check-suite.d.ts +171 -0
  31. package/dist/check-suite.js +515 -0
  32. package/dist/check-suite.js.map +1 -0
  33. package/dist/check-types.d.ts +181 -0
  34. package/dist/check-types.js +35 -0
  35. package/dist/check-types.js.map +1 -0
  36. package/dist/cli-args.d.ts +26 -0
  37. package/dist/cli-args.js +50 -0
  38. package/dist/cli-args.js.map +1 -0
  39. package/dist/cli-output.d.ts +102 -0
  40. package/dist/cli-output.js +516 -0
  41. package/dist/cli-output.js.map +1 -0
  42. package/dist/cli-reference.d.ts +3 -0
  43. package/dist/cli-reference.js +81 -0
  44. package/dist/cli-reference.js.map +1 -0
  45. package/dist/cli-refusal.d.ts +12 -0
  46. package/dist/cli-refusal.js +52 -0
  47. package/dist/cli-refusal.js.map +1 -0
  48. package/dist/cli-shared.d.ts +330 -0
  49. package/dist/cli-shared.js +492 -0
  50. package/dist/cli-shared.js.map +1 -0
  51. package/dist/cli-surface.d.ts +33 -0
  52. package/dist/cli-surface.js +48 -0
  53. package/dist/cli-surface.js.map +1 -0
  54. package/dist/conversation-options.d.ts +15 -0
  55. package/dist/conversation-options.js +10 -0
  56. package/dist/conversation-options.js.map +1 -0
  57. package/dist/credentials-file.d.ts +15 -0
  58. package/dist/credentials-file.js +56 -0
  59. package/dist/credentials-file.js.map +1 -0
  60. package/dist/data-dir.d.ts +1 -1
  61. package/dist/data-dir.js +1 -1
  62. package/dist/defect-evidence.d.ts +141 -0
  63. package/dist/defect-evidence.js +502 -0
  64. package/dist/defect-evidence.js.map +1 -0
  65. package/dist/demo-aspect-api.d.ts +209 -0
  66. package/dist/demo-aspect-api.js +397 -0
  67. package/dist/demo-aspect-api.js.map +1 -0
  68. package/dist/demo-aspect-cli.d.ts +3 -0
  69. package/dist/demo-aspect-cli.js +241 -0
  70. package/dist/demo-aspect-cli.js.map +1 -0
  71. package/dist/demo-capture.d.ts +108 -0
  72. package/dist/demo-capture.js +438 -0
  73. package/dist/demo-capture.js.map +1 -0
  74. package/dist/engine.d.ts +35 -0
  75. package/dist/engine.js +25 -0
  76. package/dist/engine.js.map +1 -0
  77. package/dist/environments.d.ts +155 -0
  78. package/dist/environments.js +364 -0
  79. package/dist/environments.js.map +1 -0
  80. package/dist/exit-codes.d.ts +46 -0
  81. package/dist/exit-codes.js +91 -0
  82. package/dist/exit-codes.js.map +1 -0
  83. package/dist/explore-adversarial.d.ts +137 -0
  84. package/dist/explore-adversarial.js +218 -0
  85. package/dist/explore-adversarial.js.map +1 -0
  86. package/dist/explore-api.d.ts +7 -187
  87. package/dist/explore-api.js +7 -301
  88. package/dist/explore-api.js.map +1 -1
  89. package/dist/explore-author.d.ts +79 -0
  90. package/dist/explore-author.js +86 -0
  91. package/dist/explore-author.js.map +1 -0
  92. package/dist/explore-cli.d.ts +7 -0
  93. package/dist/explore-cli.js +963 -0
  94. package/dist/explore-cli.js.map +1 -0
  95. package/dist/explore-coverage.d.ts +158 -0
  96. package/dist/explore-coverage.js +240 -0
  97. package/dist/explore-coverage.js.map +1 -0
  98. package/dist/explore-feature.d.ts +127 -0
  99. package/dist/explore-feature.js +220 -0
  100. package/dist/explore-feature.js.map +1 -0
  101. package/dist/explore-goal.d.ts +253 -0
  102. package/dist/explore-goal.js +374 -0
  103. package/dist/explore-goal.js.map +1 -0
  104. package/dist/explore-shared.d.ts +152 -0
  105. package/dist/explore-shared.js +129 -0
  106. package/dist/explore-shared.js.map +1 -0
  107. package/dist/explore-specs.d.ts +53 -0
  108. package/dist/explore-specs.js +333 -0
  109. package/dist/explore-specs.js.map +1 -0
  110. package/dist/findings-filing.d.ts +64 -0
  111. package/dist/findings-filing.js +108 -0
  112. package/dist/findings-filing.js.map +1 -0
  113. package/dist/fixture-auth.d.ts +52 -0
  114. package/dist/fixture-auth.js +82 -0
  115. package/dist/fixture-auth.js.map +1 -0
  116. package/dist/fixture-cli.d.ts +70 -0
  117. package/dist/fixture-cli.js +178 -0
  118. package/dist/fixture-cli.js.map +1 -0
  119. package/dist/github-issue-filer.d.ts +62 -0
  120. package/dist/github-issue-filer.js +188 -0
  121. package/dist/github-issue-filer.js.map +1 -0
  122. package/dist/host-health-run.d.ts +24 -0
  123. package/dist/host-health-run.js +27 -0
  124. package/dist/host-health-run.js.map +1 -0
  125. package/dist/http-5xx-outcome.d.ts +6 -0
  126. package/dist/http-5xx-outcome.js +39 -0
  127. package/dist/http-5xx-outcome.js.map +1 -0
  128. package/dist/inbox-cli.d.ts +7 -0
  129. package/dist/inbox-cli.js +197 -0
  130. package/dist/inbox-cli.js.map +1 -0
  131. package/dist/index.d.ts +1 -0
  132. package/dist/index.js +1 -0
  133. package/dist/index.js.map +1 -1
  134. package/dist/init-cli.d.ts +4 -0
  135. package/dist/init-cli.js +127 -0
  136. package/dist/init-cli.js.map +1 -0
  137. package/dist/init-keys.d.ts +19 -2
  138. package/dist/init-keys.js +15 -4
  139. package/dist/init-keys.js.map +1 -1
  140. package/dist/init-next-steps.d.ts +35 -0
  141. package/dist/init-next-steps.js +79 -0
  142. package/dist/init-next-steps.js.map +1 -0
  143. package/dist/invariants-file.d.ts +34 -0
  144. package/dist/invariants-file.js +68 -0
  145. package/dist/invariants-file.js.map +1 -0
  146. package/dist/invariants-validate.d.ts +30 -0
  147. package/dist/invariants-validate.js +105 -0
  148. package/dist/invariants-validate.js.map +1 -0
  149. package/dist/journey-annotate-api.d.ts +76 -0
  150. package/dist/journey-annotate-api.js +256 -0
  151. package/dist/journey-annotate-api.js.map +1 -0
  152. package/dist/journey-annotate-cli.d.ts +9 -0
  153. package/dist/journey-annotate-cli.js +179 -0
  154. package/dist/journey-annotate-cli.js.map +1 -0
  155. package/dist/journey-api.d.ts +79 -2
  156. package/dist/journey-api.js +136 -19
  157. package/dist/journey-api.js.map +1 -1
  158. package/dist/journey-cli.d.ts +4 -0
  159. package/dist/journey-cli.js +370 -0
  160. package/dist/journey-cli.js.map +1 -0
  161. package/dist/journey-demo-api.d.ts +112 -0
  162. package/dist/journey-demo-api.js +392 -0
  163. package/dist/journey-demo-api.js.map +1 -0
  164. package/dist/journey-demo-cli.d.ts +10 -0
  165. package/dist/journey-demo-cli.js +155 -0
  166. package/dist/journey-demo-cli.js.map +1 -0
  167. package/dist/kill-signal.d.ts +193 -0
  168. package/dist/kill-signal.js +284 -0
  169. package/dist/kill-signal.js.map +1 -0
  170. package/dist/launch-armed.d.ts +37 -0
  171. package/dist/launch-armed.js +31 -0
  172. package/dist/launch-armed.js.map +1 -0
  173. package/dist/ledger-api.d.ts +106 -0
  174. package/dist/ledger-api.js +237 -0
  175. package/dist/ledger-api.js.map +1 -0
  176. package/dist/ledger-cli.d.ts +18 -0
  177. package/dist/ledger-cli.js +107 -0
  178. package/dist/ledger-cli.js.map +1 -0
  179. package/dist/load-api.d.ts +29 -11
  180. package/dist/load-api.js +23 -15
  181. package/dist/load-api.js.map +1 -1
  182. package/dist/load-cli.d.ts +4 -0
  183. package/dist/load-cli.js +97 -0
  184. package/dist/load-cli.js.map +1 -0
  185. package/dist/log-correlation.d.ts +147 -0
  186. package/dist/log-correlation.js +325 -0
  187. package/dist/log-correlation.js.map +1 -0
  188. package/dist/log-lines.d.ts +131 -0
  189. package/dist/log-lines.js +389 -0
  190. package/dist/log-lines.js.map +1 -0
  191. package/dist/log-sources.d.ts +71 -0
  192. package/dist/log-sources.js +235 -0
  193. package/dist/log-sources.js.map +1 -0
  194. package/dist/logs-cli.d.ts +3 -0
  195. package/dist/logs-cli.js +51 -0
  196. package/dist/logs-cli.js.map +1 -0
  197. package/dist/logs-retention.d.ts +28 -0
  198. package/dist/logs-retention.js +84 -0
  199. package/dist/logs-retention.js.map +1 -0
  200. package/dist/mcp-api.d.ts +89 -1
  201. package/dist/mcp-api.js +472 -18
  202. package/dist/mcp-api.js.map +1 -1
  203. package/dist/mcp-args.d.ts +38 -0
  204. package/dist/mcp-args.js +131 -0
  205. package/dist/mcp-args.js.map +1 -0
  206. package/dist/mcp-cli-bridge.d.ts +34 -0
  207. package/dist/mcp-cli-bridge.js +62 -0
  208. package/dist/mcp-cli-bridge.js.map +1 -0
  209. package/dist/mcp-cli-runner.d.ts +29 -0
  210. package/dist/mcp-cli-runner.js +44 -0
  211. package/dist/mcp-cli-runner.js.map +1 -0
  212. package/dist/mcp-cli-tools.d.ts +125 -0
  213. package/dist/mcp-cli-tools.js +680 -0
  214. package/dist/mcp-cli-tools.js.map +1 -0
  215. package/dist/mcp-paths.d.ts +28 -0
  216. package/dist/mcp-paths.js +76 -0
  217. package/dist/mcp-paths.js.map +1 -0
  218. package/dist/mission-actors.d.ts +40 -0
  219. package/dist/mission-actors.js +72 -0
  220. package/dist/mission-actors.js.map +1 -0
  221. package/dist/mission-api.d.ts +35 -0
  222. package/dist/mission-api.js +58 -2
  223. package/dist/mission-api.js.map +1 -1
  224. package/dist/mission-cli.d.ts +4 -0
  225. package/dist/mission-cli.js +247 -0
  226. package/dist/mission-cli.js.map +1 -0
  227. package/dist/mission-exit.d.ts +22 -0
  228. package/dist/mission-exit.js +26 -0
  229. package/dist/mission-exit.js.map +1 -0
  230. package/dist/mission-fixtures.d.ts +225 -0
  231. package/dist/mission-fixtures.js +828 -0
  232. package/dist/mission-fixtures.js.map +1 -0
  233. package/dist/mission-journal.d.ts +60 -0
  234. package/dist/mission-journal.js +115 -0
  235. package/dist/mission-journal.js.map +1 -0
  236. package/dist/mission-queue-cli.d.ts +10 -0
  237. package/dist/mission-queue-cli.js +198 -0
  238. package/dist/mission-queue-cli.js.map +1 -0
  239. package/dist/mission-queue-runner.d.ts +126 -0
  240. package/dist/mission-queue-runner.js +397 -0
  241. package/dist/mission-queue-runner.js.map +1 -0
  242. package/dist/multi-run-cli.d.ts +37 -0
  243. package/dist/multi-run-cli.js +110 -0
  244. package/dist/multi-run-cli.js.map +1 -0
  245. package/dist/multi-run.d.ts +339 -0
  246. package/dist/multi-run.js +619 -0
  247. package/dist/multi-run.js.map +1 -0
  248. package/dist/openrouter-call.d.ts +22 -0
  249. package/dist/openrouter-call.js +63 -0
  250. package/dist/openrouter-call.js.map +1 -0
  251. package/dist/profile-cli.d.ts +4 -0
  252. package/dist/profile-cli.js +57 -0
  253. package/dist/profile-cli.js.map +1 -0
  254. package/dist/program.d.ts +3 -75
  255. package/dist/program.js +119 -1921
  256. package/dist/program.js.map +1 -1
  257. package/dist/project-dir.d.ts +96 -0
  258. package/dist/project-dir.js +220 -0
  259. package/dist/project-dir.js.map +1 -0
  260. package/dist/record-api.d.ts +10 -6
  261. package/dist/record-api.js +39 -28
  262. package/dist/record-api.js.map +1 -1
  263. package/dist/record-cli.d.ts +4 -0
  264. package/dist/record-cli.js +64 -0
  265. package/dist/record-cli.js.map +1 -0
  266. package/dist/recording-cli.d.ts +4 -0
  267. package/dist/recording-cli.js +248 -0
  268. package/dist/recording-cli.js.map +1 -0
  269. package/dist/regression-api.d.ts +101 -0
  270. package/dist/regression-api.js +384 -5
  271. package/dist/regression-api.js.map +1 -1
  272. package/dist/regression-cli.d.ts +4 -0
  273. package/dist/regression-cli.js +232 -0
  274. package/dist/regression-cli.js.map +1 -0
  275. package/dist/report-api.d.ts +146 -0
  276. package/dist/report-api.js +430 -0
  277. package/dist/report-api.js.map +1 -0
  278. package/dist/report-cli.d.ts +12 -0
  279. package/dist/report-cli.js +147 -0
  280. package/dist/report-cli.js.map +1 -0
  281. package/dist/result-schema.d.ts +22 -0
  282. package/dist/result-schema.js +28 -0
  283. package/dist/result-schema.js.map +1 -0
  284. package/dist/run-index.d.ts +29 -0
  285. package/dist/run-index.js +70 -0
  286. package/dist/run-index.js.map +1 -0
  287. package/dist/run-screenshots.d.ts +123 -0
  288. package/dist/run-screenshots.js +229 -0
  289. package/dist/run-screenshots.js.map +1 -0
  290. package/dist/runtime-env.d.ts +8 -0
  291. package/dist/runtime-env.js +22 -0
  292. package/dist/runtime-env.js.map +1 -0
  293. package/dist/secret-args.d.ts +23 -0
  294. package/dist/secret-args.js +45 -0
  295. package/dist/secret-args.js.map +1 -0
  296. package/dist/serve-cli.d.ts +4 -0
  297. package/dist/serve-cli.js +95 -0
  298. package/dist/serve-cli.js.map +1 -0
  299. package/dist/server-log-verify.d.ts +34 -0
  300. package/dist/server-log-verify.js +115 -0
  301. package/dist/server-log-verify.js.map +1 -0
  302. package/dist/session-check.d.ts +14 -0
  303. package/dist/session-check.js +44 -0
  304. package/dist/session-check.js.map +1 -0
  305. package/dist/site-cli.d.ts +4 -0
  306. package/dist/site-cli.js +127 -0
  307. package/dist/site-cli.js.map +1 -0
  308. package/dist/site-gate-cli.d.ts +28 -0
  309. package/dist/site-gate-cli.js +58 -0
  310. package/dist/site-gate-cli.js.map +1 -0
  311. package/dist/source-api.js +18 -3
  312. package/dist/source-api.js.map +1 -1
  313. package/dist/source-cli.d.ts +4 -0
  314. package/dist/source-cli.js +284 -0
  315. package/dist/source-cli.js.map +1 -0
  316. package/dist/source-run-api.d.ts +27 -1
  317. package/dist/source-run-api.js +22 -11
  318. package/dist/source-run-api.js.map +1 -1
  319. package/dist/storage-state-snapshot.d.ts +50 -0
  320. package/dist/storage-state-snapshot.js +87 -0
  321. package/dist/storage-state-snapshot.js.map +1 -0
  322. package/dist/suite-explore-options.d.ts +289 -0
  323. package/dist/suite-explore-options.js +140 -0
  324. package/dist/suite-explore-options.js.map +1 -0
  325. package/dist/target-config.d.ts +109 -0
  326. package/dist/target-config.js +216 -0
  327. package/dist/target-config.js.map +1 -0
  328. package/dist/transcript-file.d.ts +12 -0
  329. package/dist/transcript-file.js +23 -0
  330. package/dist/transcript-file.js.map +1 -0
  331. package/dist/ui-api.d.ts +3 -0
  332. package/dist/ui-api.js +7 -1
  333. package/dist/ui-api.js.map +1 -1
  334. package/dist/usability-capture.d.ts +43 -0
  335. package/dist/usability-capture.js +326 -0
  336. package/dist/usability-capture.js.map +1 -0
  337. package/dist/usage-config.d.ts +36 -0
  338. package/dist/usage-config.js +114 -0
  339. package/dist/usage-config.js.map +1 -0
  340. package/dist/ux-api.d.ts +3 -75
  341. package/dist/ux-api.js +3 -220
  342. package/dist/ux-api.js.map +1 -1
  343. package/dist/ux-cli.d.ts +4 -0
  344. package/dist/ux-cli.js +102 -0
  345. package/dist/ux-cli.js.map +1 -0
  346. package/dist/ux-config.d.ts +29 -0
  347. package/dist/ux-config.js +103 -0
  348. package/dist/ux-config.js.map +1 -0
  349. package/dist/ux-evidence.d.ts +54 -0
  350. package/dist/ux-evidence.js +197 -0
  351. package/dist/ux-evidence.js.map +1 -0
  352. package/dist/ux-review.d.ts +112 -0
  353. package/dist/ux-review.js +151 -0
  354. package/dist/ux-review.js.map +1 -0
  355. package/dist/ux-usability.d.ts +238 -0
  356. package/dist/ux-usability.js +494 -0
  357. package/dist/ux-usability.js.map +1 -0
  358. package/dist/verify-fix-api.d.ts +173 -0
  359. package/dist/verify-fix-api.js +454 -0
  360. package/dist/verify-fix-api.js.map +1 -0
  361. package/dist/verify-fix-cli.d.ts +4 -0
  362. package/dist/verify-fix-cli.js +110 -0
  363. package/dist/verify-fix-cli.js.map +1 -0
  364. package/package.json +19 -14
  365. package/skills/jevitate-ci-check/SKILL.md +77 -0
  366. package/skills/jevitate-demo/SKILL.md +61 -0
  367. package/skills/jevitate-explore/SKILL.md +88 -87
  368. package/skills/jevitate-getting-started/SKILL.md +88 -0
  369. package/skills/jevitate-load-test/SKILL.md +11 -2
  370. package/skills/jevitate-mission-scope/SKILL.md +19 -11
  371. package/skills/jevitate-record/SKILL.md +23 -5
  372. package/skills/jevitate-run-journey/SKILL.md +61 -17
  373. package/skills/jevitate-sources/SKILL.md +57 -14
  374. package/skills/jevitate-ux-review/SKILL.md +106 -16
  375. package/skills/jevitate-verify-fix/SKILL.md +76 -0
@@ -0,0 +1,15 @@
1
+ import { type CredentialKey } from "@jevitate/ai-core";
2
+ export declare class CredentialsFileError extends Error {
3
+ }
4
+ export interface CredentialsFileDeps {
5
+ readonly homedir?: () => string;
6
+ readonly readFile?: (path: string) => string;
7
+ }
8
+ export declare function credentialsFilePath(deps?: CredentialsFileDeps): string;
9
+ /**
10
+ * Reads the credential file. A MISSING file means "no local keys" ({}); anything
11
+ * else wrong with it (unreadable, not JSON, not an object) fails closed with an
12
+ * actionable error — never a silent empty store that looks like "keys missing".
13
+ * Only the known key names with string values are returned.
14
+ */
15
+ export declare function loadLocalCredentials(deps?: CredentialsFileDeps): Partial<Record<CredentialKey, string>>;
@@ -0,0 +1,56 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { ALL_CREDENTIAL_KEYS } from "@jevitate/ai-core";
3
+ import { resolveDataDir } from "./data-dir.js";
4
+ /**
5
+ * The machine-local credential file written by `jevitate init` / `jevitate ai setup`
6
+ * (`~/.jevitate/credentials.json`, mode 0600). Every credential READ site loads it
7
+ * through this module so what setup persists is what status/explore/generate see
8
+ * (env vars still win — see `envCredentialStore`).
9
+ */
10
+ const KNOWN_KEYS = ALL_CREDENTIAL_KEYS;
11
+ export class CredentialsFileError extends Error {
12
+ }
13
+ export function credentialsFilePath(deps = {}) {
14
+ return resolveDataDir(["credentials.json"], deps.homedir ? { homedir: deps.homedir } : {});
15
+ }
16
+ function isMissingFile(err) {
17
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
18
+ }
19
+ /**
20
+ * Reads the credential file. A MISSING file means "no local keys" ({}); anything
21
+ * else wrong with it (unreadable, not JSON, not an object) fails closed with an
22
+ * actionable error — never a silent empty store that looks like "keys missing".
23
+ * Only the known key names with string values are returned.
24
+ */
25
+ export function loadLocalCredentials(deps = {}) {
26
+ const path = credentialsFilePath(deps);
27
+ const read = deps.readFile ?? ((p) => readFileSync(p, "utf8"));
28
+ let raw;
29
+ try {
30
+ raw = read(path);
31
+ }
32
+ catch (err) {
33
+ if (isMissingFile(err))
34
+ return {};
35
+ throw new CredentialsFileError(`cannot read ${path}: ${err instanceof Error ? err.message : String(err)}`);
36
+ }
37
+ let parsed;
38
+ try {
39
+ parsed = JSON.parse(raw);
40
+ }
41
+ catch {
42
+ throw new CredentialsFileError(`${path} is not valid JSON — fix or delete it, then run \`jevitate init\``);
43
+ }
44
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
45
+ throw new CredentialsFileError(`${path} must be a JSON object of credential keys — fix or delete it, then run \`jevitate init\``);
46
+ }
47
+ const values = new Map(Object.entries(parsed));
48
+ const out = {};
49
+ for (const key of KNOWN_KEYS) {
50
+ const value = values.get(key);
51
+ if (typeof value === "string")
52
+ out[key] = value;
53
+ }
54
+ return out;
55
+ }
56
+ //# sourceMappingURL=credentials-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials-file.js","sourceRoot":"","sources":["../src/credentials-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAsB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;GAKG;AAEH,MAAM,UAAU,GAA6B,mBAAmB,CAAC;AAEjE,MAAM,OAAO,oBAAqB,SAAQ,KAAK;CAAG;AAOlD,MAAM,UAAU,mBAAmB,CAAC,OAA4B,EAAE;IAChE,OAAO,cAAc,CAAC,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA4B,EAAE;IAE9B,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACvE,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,aAAa,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC;QAClC,MAAM,IAAI,oBAAoB,CAC5B,eAAe,IAAI,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,oBAAoB,CAC5B,GAAG,IAAI,mEAAmE,CAC3E,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,oBAAoB,CAC5B,GAAG,IAAI,0FAA0F,CAClG,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAkB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,MAAM,GAAG,GAA2C,EAAE,CAAC;IACvD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Resolves a default runtime-data path under `~/.jevitate/<segments>`
3
- * (product = Jevitate). Greenfield: there is no legacy `~/.doit` location.
3
+ * (product = Jevitate). Greenfield — no legacy data location to migrate.
4
4
  * `homedir` is injectable so this is unit-testable without touching
5
5
  * `os.homedir()`.
6
6
  */
package/dist/data-dir.js CHANGED
@@ -2,7 +2,7 @@ import { homedir as osHomedir } from "node:os";
2
2
  import { join } from "node:path";
3
3
  /**
4
4
  * Resolves a default runtime-data path under `~/.jevitate/<segments>`
5
- * (product = Jevitate). Greenfield: there is no legacy `~/.doit` location.
5
+ * (product = Jevitate). Greenfield — no legacy data location to migrate.
6
6
  * `homedir` is injectable so this is unit-testable without touching
7
7
  * `os.homedir()`.
8
8
  */
@@ -0,0 +1,141 @@
1
+ import { type FilingConfig, type IssueFilerPort } from "@jevitate/domain";
2
+ import { type BrowserPort, type EmulationSpec } from "@jevitate/playwright";
3
+ import type { Recording, RecordedStep } from "@jevitate/recording";
4
+ import { type BrowserRunOptions } from "./browser-run-options.js";
5
+ import type { RunScreenshots } from "./run-screenshots.js";
6
+ /**
7
+ * #250 — defect evidence: per defect, its minimal repro Recording (the one `verify-fix` replays:
8
+ * the finding's own, else the run's, up to `repro.recordingStepIndex`) is replayed in a FRESH
9
+ * session with the demo overlay and a video. Each step is captioned with what it does (its
10
+ * objective, else its label, else a value-free description); the failing step is marked with the
11
+ * defect's actual signal ("Save → server returned 500 (PUT /api/profile)", "invariant `x`
12
+ * violated", …) and whether this replay saw it fire again. Two key screenshots — just before the
13
+ * failing step and at it, the failing element highlighted — have the overlay hidden.
14
+ *
15
+ * Secrets are masked in pixels by the display-only mask layer (`demo-capture.ts`) from the video's
16
+ * first paint; the mask is re-proven at every step. FAIL CLOSED: a clip whose mask could not be
17
+ * proven at some step is deleted and the reason recorded; a screenshot that cannot be proven is not
18
+ * written. Nothing here reaches a model; every string written is redacted.
19
+ *
20
+ * The media are attached as `defects[].evidence.{videoPath, screenshots[]}` (additive, schemaVersion
21
+ * 1), appended to the defect's issue draft, and read by `report` / `check` (JUnit, SARIF). GitHub's
22
+ * API cannot upload media: drafts and filed issues LINK to the files (commit them under `.jevitate/`
23
+ * or publish them as CI artifacts).
24
+ */
25
+ /** Caption time per step in an evidence clip (ms). */
26
+ export declare const EVIDENCE_PACE_MS = 700;
27
+ /** At most this many defects get a clip per run (hard defects first). */
28
+ export declare const EVIDENCE_MAX_DEFECTS = 5;
29
+ export interface DefectEvidence {
30
+ /** The captioned repro clip (WebM). Absent: no video was asked for, or it was refused (see `skipped`). */
31
+ readonly videoPath?: string;
32
+ /** Key screenshots: just before the failing step, and at it (failing element highlighted). */
33
+ readonly screenshots: string[];
34
+ /** 1-based failing step within the repro. */
35
+ readonly failingStep?: number;
36
+ /** What the failing step is marked with (redacted). */
37
+ readonly signal?: string;
38
+ /** Whether the defect's signal fired again on this replay (absent when the replay cannot tell). */
39
+ readonly reproduced?: boolean;
40
+ /** How the replay went: `completed`, or where it stopped. */
41
+ readonly replay?: {
42
+ readonly outcome: "completed" | "stopped";
43
+ readonly atStep?: number;
44
+ readonly reason?: string;
45
+ };
46
+ /** Why there is no media at all (no repro Recording, the session could not be masked, …). */
47
+ readonly skipped?: string;
48
+ /** Captures refused (fail closed) with their reason. */
49
+ readonly captureSkips?: string[];
50
+ }
51
+ export interface EvidenceReplayInput {
52
+ readonly recording: Recording;
53
+ /** Flat index of the failing step (the defect's `repro.recordingStepIndex`). */
54
+ readonly stepIndex: number;
55
+ /** The defect's fingerprint(s): a page signal with one of them means it fired again. */
56
+ readonly fingerprints: readonly string[];
57
+ /** Whether a page signal can show this defect at all (else `reproduced` stays absent). */
58
+ readonly signalCheckable: boolean;
59
+ /** The failing step's mark (redacted by the caller). */
60
+ readonly signal: string;
61
+ readonly seedUrl: string;
62
+ readonly allowlist: readonly string[];
63
+ readonly storageState?: string;
64
+ readonly emulation?: EmulationSpec;
65
+ /** Where the clip and screenshots go (created). */
66
+ readonly outDir: string;
67
+ /** Record the clip (else screenshots only). */
68
+ readonly video: boolean;
69
+ /** #251: the run's `--screenshots` capture, fed after every step. */
70
+ readonly screenshots?: RunScreenshots;
71
+ readonly secrets: readonly string[];
72
+ readonly browser?: BrowserRunOptions;
73
+ readonly browserPortFactory?: () => BrowserPort;
74
+ readonly paceMs?: number;
75
+ readonly settleCeilingMs?: number;
76
+ /** The final card (e.g. verify-fix's verdict); default: reproduced / not reproduced. */
77
+ readonly finalCard?: (reproduced: boolean | undefined) => {
78
+ readonly text: string;
79
+ readonly ok: boolean;
80
+ };
81
+ }
82
+ /** A recorded step's caption: its objective, else its label, else a value-free description. */
83
+ export declare function stepCaption(recorded: RecordedStep): string;
84
+ /** Whether a replay's page signals can show a defect of this kind fire again. */
85
+ export declare function signalCheckable(kind: string): boolean;
86
+ /** The persisted defect (or hang) record with this fingerprint in a raw `<stem>.result.json`. */
87
+ export declare function persistedDefect(raw: unknown, fingerprint: string): Record<string, unknown> | undefined;
88
+ /** What a defect's failing step is marked with: its actual signal, in one line (redacted). */
89
+ export declare function defectSignalText(d: Record<string, unknown>, secrets: readonly string[]): string;
90
+ /**
91
+ * Replays `recording` up to `stepIndex` with captions, the failing step marked, key screenshots and
92
+ * (when `video`) a clip — see the module comment. Never throws: a failure is `skipped` / `captureSkips`.
93
+ */
94
+ export declare function replayWithEvidence(input: EvidenceReplayInput): Promise<DefectEvidence>;
95
+ export interface AttachEvidenceOptions {
96
+ /** The run's persisted `<stem>.result.json`. */
97
+ readonly resultPath: string;
98
+ /** Record a clip per defect (`--evidence-video`); screenshots are always taken. Default true. */
99
+ readonly video?: boolean;
100
+ /** Where evidence goes (default `<stem>.evidence/` beside the result); one folder per defect. */
101
+ readonly dir?: string;
102
+ /** Every registered secret of the run: masked in pixels, redacted in text. */
103
+ readonly secrets?: readonly string[];
104
+ /** Overrides the storage state recorded with the run. */
105
+ readonly storageState?: string;
106
+ readonly browser?: BrowserRunOptions;
107
+ readonly browserPortFactory?: () => BrowserPort;
108
+ readonly paceMs?: number;
109
+ readonly maxDefects?: number;
110
+ readonly settleCeilingMs?: number;
111
+ }
112
+ /** `<dir>/<stem>.result.json` → `<dir>/<stem>.evidence`. */
113
+ export declare function evidenceDirFor(resultPath: string): string;
114
+ /**
115
+ * Captures evidence for a finished run's defects (hard ones first, at most `maxDefects`), writes it
116
+ * into the persisted result (`defects[].evidence`) and the defects' issue drafts, and returns the
117
+ * updated result. A run with no defects is returned unchanged (nothing replayed).
118
+ */
119
+ export declare function attachDefectEvidence<R extends object>(result: R, opts: AttachEvidenceOptions): Promise<R>;
120
+ /** The heading of a draft's media section (#250). */
121
+ export declare const EVIDENCE_MEDIA_HEADING = "## Repro clip and screenshots";
122
+ /** The Markdown media section of an issue draft (paths only; redacted, proven secret-free). */
123
+ export declare function evidenceSection(e: DefectEvidence, secrets: readonly string[]): string;
124
+ /**
125
+ * Files the run's drafts AFTER their evidence was attached (the run itself wrote drafts only), so
126
+ * a filed issue links to the media. Returns the result with `issues.filing` replaced.
127
+ */
128
+ export declare function fileDraftsWithEvidence<R extends object>(result: R, config: FilingConfig, makeFiler: () => IssueFilerPort, nowIso: string): Promise<R>;
129
+ /** The runner options `withRunEvidence` reads (every explore runner has them). */
130
+ export interface RunEvidenceOptions {
131
+ readonly evidenceVideo?: boolean;
132
+ readonly browser?: BrowserRunOptions;
133
+ readonly browserPortFactory?: () => BrowserPort;
134
+ readonly storageState?: string;
135
+ }
136
+ /** A runner's evidence settings: on only with `evidenceVideo`, over the run's own secrets. */
137
+ export declare function evidenceOf(opts: RunEvidenceOptions, secrets: readonly string[]): AttachEvidenceOptions | undefined;
138
+ /** A written result with its defects' evidence attached (unchanged without `evidenceVideo`). */
139
+ export declare function withRunEvidence<R extends {
140
+ readonly resultPath: string;
141
+ }>(result: R, evidence: AttachEvidenceOptions | undefined): Promise<R>;