@prismatic-io/lux 0.0.1

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 (636) hide show
  1. package/LICENSE +21 -0
  2. package/lib/answerers/claude-code/index.d.ts +17 -0
  3. package/lib/answerers/claude-code/index.d.ts.map +1 -0
  4. package/lib/answerers/claude-code/index.js +280 -0
  5. package/lib/answerers/claude-code/index.js.map +1 -0
  6. package/lib/answerers/persona/index.d.ts +40 -0
  7. package/lib/answerers/persona/index.d.ts.map +1 -0
  8. package/lib/answerers/persona/index.js +265 -0
  9. package/lib/answerers/persona/index.js.map +1 -0
  10. package/lib/answerers/scripted/index.d.ts +8 -0
  11. package/lib/answerers/scripted/index.d.ts.map +1 -0
  12. package/lib/answerers/scripted/index.js +163 -0
  13. package/lib/answerers/scripted/index.js.map +1 -0
  14. package/lib/answerers/shared.d.ts +13 -0
  15. package/lib/answerers/shared.d.ts.map +1 -0
  16. package/lib/answerers/shared.js +17 -0
  17. package/lib/answerers/shared.js.map +1 -0
  18. package/lib/answerers/terminal/index.d.ts +9 -0
  19. package/lib/answerers/terminal/index.d.ts.map +1 -0
  20. package/lib/answerers/terminal/index.js +97 -0
  21. package/lib/answerers/terminal/index.js.map +1 -0
  22. package/lib/assertions/core/command-exits-zero.d.ts +21 -0
  23. package/lib/assertions/core/command-exits-zero.d.ts.map +1 -0
  24. package/lib/assertions/core/command-exits-zero.js +87 -0
  25. package/lib/assertions/core/command-exits-zero.js.map +1 -0
  26. package/lib/assertions/core/event-checks.d.ts +57 -0
  27. package/lib/assertions/core/event-checks.d.ts.map +1 -0
  28. package/lib/assertions/core/event-checks.js +123 -0
  29. package/lib/assertions/core/event-checks.js.map +1 -0
  30. package/lib/assertions/core/file-checks.d.ts +103 -0
  31. package/lib/assertions/core/file-checks.d.ts.map +1 -0
  32. package/lib/assertions/core/file-checks.js +288 -0
  33. package/lib/assertions/core/file-checks.js.map +1 -0
  34. package/lib/assertions/core/helpers.d.ts +66 -0
  35. package/lib/assertions/core/helpers.d.ts.map +1 -0
  36. package/lib/assertions/core/helpers.js +170 -0
  37. package/lib/assertions/core/helpers.js.map +1 -0
  38. package/lib/assertions/core/index.d.ts +15 -0
  39. package/lib/assertions/core/index.d.ts.map +1 -0
  40. package/lib/assertions/core/index.js +56 -0
  41. package/lib/assertions/core/index.js.map +1 -0
  42. package/lib/assertions/core/json-pointer-equals.d.ts +19 -0
  43. package/lib/assertions/core/json-pointer-equals.d.ts.map +1 -0
  44. package/lib/assertions/core/json-pointer-equals.js +71 -0
  45. package/lib/assertions/core/json-pointer-equals.js.map +1 -0
  46. package/lib/assertions/core/output-checks.d.ts +46 -0
  47. package/lib/assertions/core/output-checks.d.ts.map +1 -0
  48. package/lib/assertions/core/output-checks.js +121 -0
  49. package/lib/assertions/core/output-checks.js.map +1 -0
  50. package/lib/assertions/core/predicate.d.ts +14 -0
  51. package/lib/assertions/core/predicate.d.ts.map +1 -0
  52. package/lib/assertions/core/predicate.js +55 -0
  53. package/lib/assertions/core/predicate.js.map +1 -0
  54. package/lib/assertions/core/resource-checks.d.ts +71 -0
  55. package/lib/assertions/core/resource-checks.d.ts.map +1 -0
  56. package/lib/assertions/core/resource-checks.js +159 -0
  57. package/lib/assertions/core/resource-checks.js.map +1 -0
  58. package/lib/assertions/core/safe-regex.d.ts +23 -0
  59. package/lib/assertions/core/safe-regex.d.ts.map +1 -0
  60. package/lib/assertions/core/safe-regex.js +102 -0
  61. package/lib/assertions/core/safe-regex.js.map +1 -0
  62. package/lib/assertions/core/tool-called-with.d.ts +21 -0
  63. package/lib/assertions/core/tool-called-with.d.ts.map +1 -0
  64. package/lib/assertions/core/tool-called-with.js +69 -0
  65. package/lib/assertions/core/tool-called-with.js.map +1 -0
  66. package/lib/assertions/core/tool-calls.d.ts +22 -0
  67. package/lib/assertions/core/tool-calls.d.ts.map +1 -0
  68. package/lib/assertions/core/tool-calls.js +17 -0
  69. package/lib/assertions/core/tool-calls.js.map +1 -0
  70. package/lib/assertions/core/tool-invocation.d.ts +36 -0
  71. package/lib/assertions/core/tool-invocation.d.ts.map +1 -0
  72. package/lib/assertions/core/tool-invocation.js +170 -0
  73. package/lib/assertions/core/tool-invocation.js.map +1 -0
  74. package/lib/assertions/core/tool-result-checks.d.ts +59 -0
  75. package/lib/assertions/core/tool-result-checks.d.ts.map +1 -0
  76. package/lib/assertions/core/tool-result-checks.js +193 -0
  77. package/lib/assertions/core/tool-result-checks.js.map +1 -0
  78. package/lib/assertions/mcp/discovery-checks.d.ts +36 -0
  79. package/lib/assertions/mcp/discovery-checks.d.ts.map +1 -0
  80. package/lib/assertions/mcp/discovery-checks.js +122 -0
  81. package/lib/assertions/mcp/discovery-checks.js.map +1 -0
  82. package/lib/assertions/mcp/index.d.ts +10 -0
  83. package/lib/assertions/mcp/index.d.ts.map +1 -0
  84. package/lib/assertions/mcp/index.js +25 -0
  85. package/lib/assertions/mcp/index.js.map +1 -0
  86. package/lib/assertions/rubric/index.d.ts +104 -0
  87. package/lib/assertions/rubric/index.d.ts.map +1 -0
  88. package/lib/assertions/rubric/index.js +191 -0
  89. package/lib/assertions/rubric/index.js.map +1 -0
  90. package/lib/assertions/rubric/internal.d.ts +14 -0
  91. package/lib/assertions/rubric/internal.d.ts.map +1 -0
  92. package/lib/assertions/rubric/internal.js +335 -0
  93. package/lib/assertions/rubric/internal.js.map +1 -0
  94. package/lib/authoring.d.ts +3 -0
  95. package/lib/authoring.d.ts.map +1 -0
  96. package/lib/authoring.js +3 -0
  97. package/lib/authoring.js.map +1 -0
  98. package/lib/cli/bin.d.ts +3 -0
  99. package/lib/cli/bin.d.ts.map +1 -0
  100. package/lib/cli/bin.js +15 -0
  101. package/lib/cli/bin.js.map +1 -0
  102. package/lib/cli/command-runtime.d.ts +5 -0
  103. package/lib/cli/command-runtime.d.ts.map +1 -0
  104. package/lib/cli/command-runtime.js +30 -0
  105. package/lib/cli/command-runtime.js.map +1 -0
  106. package/lib/cli/init.d.ts +21 -0
  107. package/lib/cli/init.d.ts.map +1 -0
  108. package/lib/cli/init.js +340 -0
  109. package/lib/cli/init.js.map +1 -0
  110. package/lib/cli/program.d.ts +22 -0
  111. package/lib/cli/program.d.ts.map +1 -0
  112. package/lib/cli/program.js +757 -0
  113. package/lib/cli/program.js.map +1 -0
  114. package/lib/cli/render/format.d.ts +14 -0
  115. package/lib/cli/render/format.d.ts.map +1 -0
  116. package/lib/cli/render/format.js +71 -0
  117. package/lib/cli/render/format.js.map +1 -0
  118. package/lib/cli/render/reporter.d.ts +73 -0
  119. package/lib/cli/render/reporter.d.ts.map +1 -0
  120. package/lib/cli/render/reporter.js +519 -0
  121. package/lib/cli/render/reporter.js.map +1 -0
  122. package/lib/cli/render/tty.d.ts +77 -0
  123. package/lib/cli/render/tty.d.ts.map +1 -0
  124. package/lib/cli/render/tty.js +283 -0
  125. package/lib/cli/render/tty.js.map +1 -0
  126. package/lib/cli/run-options.d.ts +27 -0
  127. package/lib/cli/run-options.d.ts.map +1 -0
  128. package/lib/cli/run-options.js +58 -0
  129. package/lib/cli/run-options.js.map +1 -0
  130. package/lib/cli/skills.d.ts +38 -0
  131. package/lib/cli/skills.d.ts.map +1 -0
  132. package/lib/cli/skills.js +84 -0
  133. package/lib/cli/skills.js.map +1 -0
  134. package/lib/core/annotation.d.ts +56 -0
  135. package/lib/core/annotation.d.ts.map +1 -0
  136. package/lib/core/annotation.js +92 -0
  137. package/lib/core/annotation.js.map +1 -0
  138. package/lib/core/answerer.d.ts +68 -0
  139. package/lib/core/answerer.d.ts.map +1 -0
  140. package/lib/core/answerer.js +17 -0
  141. package/lib/core/answerer.js.map +1 -0
  142. package/lib/core/artifact-evidence.d.ts +50 -0
  143. package/lib/core/artifact-evidence.d.ts.map +1 -0
  144. package/lib/core/artifact-evidence.js +185 -0
  145. package/lib/core/artifact-evidence.js.map +1 -0
  146. package/lib/core/artifact-snapshot.d.ts +37 -0
  147. package/lib/core/artifact-snapshot.d.ts.map +1 -0
  148. package/lib/core/artifact-snapshot.js +339 -0
  149. package/lib/core/artifact-snapshot.js.map +1 -0
  150. package/lib/core/assertion.d.ts +129 -0
  151. package/lib/core/assertion.d.ts.map +1 -0
  152. package/lib/core/assertion.js +75 -0
  153. package/lib/core/assertion.js.map +1 -0
  154. package/lib/core/case.d.ts +79 -0
  155. package/lib/core/case.d.ts.map +1 -0
  156. package/lib/core/case.js +90 -0
  157. package/lib/core/case.js.map +1 -0
  158. package/lib/core/conversation-turn.d.ts +23 -0
  159. package/lib/core/conversation-turn.d.ts.map +1 -0
  160. package/lib/core/conversation-turn.js +31 -0
  161. package/lib/core/conversation-turn.js.map +1 -0
  162. package/lib/core/driver.d.ts +64 -0
  163. package/lib/core/driver.d.ts.map +1 -0
  164. package/lib/core/driver.js +18 -0
  165. package/lib/core/driver.js.map +1 -0
  166. package/lib/core/emitter.d.ts +20 -0
  167. package/lib/core/emitter.d.ts.map +1 -0
  168. package/lib/core/emitter.js +34 -0
  169. package/lib/core/emitter.js.map +1 -0
  170. package/lib/core/events.d.ts +202 -0
  171. package/lib/core/events.d.ts.map +1 -0
  172. package/lib/core/events.js +107 -0
  173. package/lib/core/events.js.map +1 -0
  174. package/lib/core/exec.d.ts +82 -0
  175. package/lib/core/exec.d.ts.map +1 -0
  176. package/lib/core/exec.js +168 -0
  177. package/lib/core/exec.js.map +1 -0
  178. package/lib/core/experiment.d.ts +285 -0
  179. package/lib/core/experiment.d.ts.map +1 -0
  180. package/lib/core/experiment.js +389 -0
  181. package/lib/core/experiment.js.map +1 -0
  182. package/lib/core/glob.d.ts +3 -0
  183. package/lib/core/glob.d.ts.map +1 -0
  184. package/lib/core/glob.js +32 -0
  185. package/lib/core/glob.js.map +1 -0
  186. package/lib/core/hash.d.ts +8 -0
  187. package/lib/core/hash.d.ts.map +1 -0
  188. package/lib/core/hash.js +214 -0
  189. package/lib/core/hash.js.map +1 -0
  190. package/lib/core/index.d.ts +29 -0
  191. package/lib/core/index.d.ts.map +1 -0
  192. package/lib/core/index.js +29 -0
  193. package/lib/core/index.js.map +1 -0
  194. package/lib/core/lifecycle-fixtures.d.ts +20 -0
  195. package/lib/core/lifecycle-fixtures.d.ts.map +1 -0
  196. package/lib/core/lifecycle-fixtures.js +109 -0
  197. package/lib/core/lifecycle-fixtures.js.map +1 -0
  198. package/lib/core/lifecycle-hooks.d.ts +52 -0
  199. package/lib/core/lifecycle-hooks.d.ts.map +1 -0
  200. package/lib/core/lifecycle-hooks.js +42 -0
  201. package/lib/core/lifecycle-hooks.js.map +1 -0
  202. package/lib/core/mcp-events.d.ts +44 -0
  203. package/lib/core/mcp-events.d.ts.map +1 -0
  204. package/lib/core/mcp-events.js +23 -0
  205. package/lib/core/mcp-events.js.map +1 -0
  206. package/lib/core/model-cli.d.ts +57 -0
  207. package/lib/core/model-cli.d.ts.map +1 -0
  208. package/lib/core/model-cli.js +237 -0
  209. package/lib/core/model-cli.js.map +1 -0
  210. package/lib/core/observer.d.ts +31 -0
  211. package/lib/core/observer.d.ts.map +1 -0
  212. package/lib/core/observer.js +25 -0
  213. package/lib/core/observer.js.map +1 -0
  214. package/lib/core/platform-process.d.ts +33 -0
  215. package/lib/core/platform-process.d.ts.map +1 -0
  216. package/lib/core/platform-process.js +214 -0
  217. package/lib/core/platform-process.js.map +1 -0
  218. package/lib/core/registry.d.ts +22 -0
  219. package/lib/core/registry.d.ts.map +1 -0
  220. package/lib/core/registry.js +45 -0
  221. package/lib/core/registry.js.map +1 -0
  222. package/lib/core/rubric.d.ts +18 -0
  223. package/lib/core/rubric.d.ts.map +1 -0
  224. package/lib/core/rubric.js +49 -0
  225. package/lib/core/rubric.js.map +1 -0
  226. package/lib/core/run.d.ts +419 -0
  227. package/lib/core/run.d.ts.map +1 -0
  228. package/lib/core/run.js +126 -0
  229. package/lib/core/run.js.map +1 -0
  230. package/lib/core/statistics.d.ts +39 -0
  231. package/lib/core/statistics.d.ts.map +1 -0
  232. package/lib/core/statistics.js +163 -0
  233. package/lib/core/statistics.js.map +1 -0
  234. package/lib/core/subject.d.ts +4 -0
  235. package/lib/core/subject.d.ts.map +1 -0
  236. package/lib/core/subject.js +46 -0
  237. package/lib/core/subject.js.map +1 -0
  238. package/lib/core/tool-events.d.ts +69 -0
  239. package/lib/core/tool-events.d.ts.map +1 -0
  240. package/lib/core/tool-events.js +242 -0
  241. package/lib/core/tool-events.js.map +1 -0
  242. package/lib/core/usage.d.ts +78 -0
  243. package/lib/core/usage.d.ts.map +1 -0
  244. package/lib/core/usage.js +104 -0
  245. package/lib/core/usage.js.map +1 -0
  246. package/lib/core/wire.d.ts +83 -0
  247. package/lib/core/wire.d.ts.map +1 -0
  248. package/lib/core/wire.js +101 -0
  249. package/lib/core/wire.js.map +1 -0
  250. package/lib/core/zod.d.ts +10 -0
  251. package/lib/core/zod.d.ts.map +1 -0
  252. package/lib/core/zod.js +18 -0
  253. package/lib/core/zod.js.map +1 -0
  254. package/lib/drivers/claude-code/index.d.ts +55 -0
  255. package/lib/drivers/claude-code/index.d.ts.map +1 -0
  256. package/lib/drivers/claude-code/index.js +779 -0
  257. package/lib/drivers/claude-code/index.js.map +1 -0
  258. package/lib/drivers/claude-code/parse-events.d.ts +46 -0
  259. package/lib/drivers/claude-code/parse-events.d.ts.map +1 -0
  260. package/lib/drivers/claude-code/parse-events.js +387 -0
  261. package/lib/drivers/claude-code/parse-events.js.map +1 -0
  262. package/lib/drivers/codex/app-events.d.ts +16 -0
  263. package/lib/drivers/codex/app-events.d.ts.map +1 -0
  264. package/lib/drivers/codex/app-events.js +184 -0
  265. package/lib/drivers/codex/app-events.js.map +1 -0
  266. package/lib/drivers/codex/config.d.ts +55 -0
  267. package/lib/drivers/codex/config.d.ts.map +1 -0
  268. package/lib/drivers/codex/config.js +125 -0
  269. package/lib/drivers/codex/config.js.map +1 -0
  270. package/lib/drivers/codex/index.d.ts +8 -0
  271. package/lib/drivers/codex/index.d.ts.map +1 -0
  272. package/lib/drivers/codex/index.js +904 -0
  273. package/lib/drivers/codex/index.js.map +1 -0
  274. package/lib/drivers/mcp/index.d.ts +52 -0
  275. package/lib/drivers/mcp/index.d.ts.map +1 -0
  276. package/lib/drivers/mcp/index.js +282 -0
  277. package/lib/drivers/mcp/index.js.map +1 -0
  278. package/lib/drivers/mcp/transport.d.ts +50 -0
  279. package/lib/drivers/mcp/transport.d.ts.map +1 -0
  280. package/lib/drivers/mcp/transport.js +190 -0
  281. package/lib/drivers/mcp/transport.js.map +1 -0
  282. package/lib/drivers/shared/artifacts.d.ts +4 -0
  283. package/lib/drivers/shared/artifacts.d.ts.map +1 -0
  284. package/lib/drivers/shared/artifacts.js +81 -0
  285. package/lib/drivers/shared/artifacts.js.map +1 -0
  286. package/lib/drivers/shared/secure-copy.d.ts +2 -0
  287. package/lib/drivers/shared/secure-copy.d.ts.map +1 -0
  288. package/lib/drivers/shared/secure-copy.js +35 -0
  289. package/lib/drivers/shared/secure-copy.js.map +1 -0
  290. package/lib/drivers/subprocess/index.d.ts +24 -0
  291. package/lib/drivers/subprocess/index.d.ts.map +1 -0
  292. package/lib/drivers/subprocess/index.js +451 -0
  293. package/lib/drivers/subprocess/index.js.map +1 -0
  294. package/lib/index.d.ts +40 -0
  295. package/lib/index.d.ts.map +1 -0
  296. package/lib/index.js +48 -0
  297. package/lib/index.js.map +1 -0
  298. package/lib/optimization/reflective.d.ts +27 -0
  299. package/lib/optimization/reflective.d.ts.map +1 -0
  300. package/lib/optimization/reflective.js +257 -0
  301. package/lib/optimization/reflective.js.map +1 -0
  302. package/lib/orchestrator/annotation-loader.d.ts +65 -0
  303. package/lib/orchestrator/annotation-loader.d.ts.map +1 -0
  304. package/lib/orchestrator/annotation-loader.js +73 -0
  305. package/lib/orchestrator/annotation-loader.js.map +1 -0
  306. package/lib/orchestrator/annotation-store.d.ts +3 -0
  307. package/lib/orchestrator/annotation-store.d.ts.map +1 -0
  308. package/lib/orchestrator/annotation-store.js +100 -0
  309. package/lib/orchestrator/annotation-store.js.map +1 -0
  310. package/lib/orchestrator/authored-dependencies.d.ts +3 -0
  311. package/lib/orchestrator/authored-dependencies.d.ts.map +1 -0
  312. package/lib/orchestrator/authored-dependencies.js +146 -0
  313. package/lib/orchestrator/authored-dependencies.js.map +1 -0
  314. package/lib/orchestrator/campaign-lifecycle.d.ts +105 -0
  315. package/lib/orchestrator/campaign-lifecycle.d.ts.map +1 -0
  316. package/lib/orchestrator/campaign-lifecycle.js +141 -0
  317. package/lib/orchestrator/campaign-lifecycle.js.map +1 -0
  318. package/lib/orchestrator/candidate-integrity.d.ts +4 -0
  319. package/lib/orchestrator/candidate-integrity.d.ts.map +1 -0
  320. package/lib/orchestrator/candidate-integrity.js +14 -0
  321. package/lib/orchestrator/candidate-integrity.js.map +1 -0
  322. package/lib/orchestrator/candidates.d.ts +13 -0
  323. package/lib/orchestrator/candidates.d.ts.map +1 -0
  324. package/lib/orchestrator/candidates.js +577 -0
  325. package/lib/orchestrator/candidates.js.map +1 -0
  326. package/lib/orchestrator/compare.d.ts +80 -0
  327. package/lib/orchestrator/compare.d.ts.map +1 -0
  328. package/lib/orchestrator/compare.js +270 -0
  329. package/lib/orchestrator/compare.js.map +1 -0
  330. package/lib/orchestrator/comparison-identity.d.ts +10 -0
  331. package/lib/orchestrator/comparison-identity.d.ts.map +1 -0
  332. package/lib/orchestrator/comparison-identity.js +39 -0
  333. package/lib/orchestrator/comparison-identity.js.map +1 -0
  334. package/lib/orchestrator/config.d.ts +121 -0
  335. package/lib/orchestrator/config.d.ts.map +1 -0
  336. package/lib/orchestrator/config.js +176 -0
  337. package/lib/orchestrator/config.js.map +1 -0
  338. package/lib/orchestrator/content-bound-json.d.ts +5 -0
  339. package/lib/orchestrator/content-bound-json.d.ts.map +1 -0
  340. package/lib/orchestrator/content-bound-json.js +59 -0
  341. package/lib/orchestrator/content-bound-json.js.map +1 -0
  342. package/lib/orchestrator/discover.d.ts +45 -0
  343. package/lib/orchestrator/discover.d.ts.map +1 -0
  344. package/lib/orchestrator/discover.js +98 -0
  345. package/lib/orchestrator/discover.js.map +1 -0
  346. package/lib/orchestrator/doctor.d.ts +141 -0
  347. package/lib/orchestrator/doctor.d.ts.map +1 -0
  348. package/lib/orchestrator/doctor.js +525 -0
  349. package/lib/orchestrator/doctor.js.map +1 -0
  350. package/lib/orchestrator/driver-session.d.ts +177 -0
  351. package/lib/orchestrator/driver-session.d.ts.map +1 -0
  352. package/lib/orchestrator/driver-session.js +396 -0
  353. package/lib/orchestrator/driver-session.js.map +1 -0
  354. package/lib/orchestrator/evaluator-identity.d.ts +7 -0
  355. package/lib/orchestrator/evaluator-identity.d.ts.map +1 -0
  356. package/lib/orchestrator/evaluator-identity.js +42 -0
  357. package/lib/orchestrator/evaluator-identity.js.map +1 -0
  358. package/lib/orchestrator/experiment-budget.d.ts +11 -0
  359. package/lib/orchestrator/experiment-budget.d.ts.map +1 -0
  360. package/lib/orchestrator/experiment-budget.js +51 -0
  361. package/lib/orchestrator/experiment-budget.js.map +1 -0
  362. package/lib/orchestrator/experiment-context.d.ts +43 -0
  363. package/lib/orchestrator/experiment-context.d.ts.map +1 -0
  364. package/lib/orchestrator/experiment-context.js +9 -0
  365. package/lib/orchestrator/experiment-context.js.map +1 -0
  366. package/lib/orchestrator/experiment-contracts.d.ts +290 -0
  367. package/lib/orchestrator/experiment-contracts.d.ts.map +1 -0
  368. package/lib/orchestrator/experiment-contracts.js +38 -0
  369. package/lib/orchestrator/experiment-contracts.js.map +1 -0
  370. package/lib/orchestrator/experiment-corpus.d.ts +21 -0
  371. package/lib/orchestrator/experiment-corpus.d.ts.map +1 -0
  372. package/lib/orchestrator/experiment-corpus.js +276 -0
  373. package/lib/orchestrator/experiment-corpus.js.map +1 -0
  374. package/lib/orchestrator/experiment-evaluation.d.ts +44 -0
  375. package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -0
  376. package/lib/orchestrator/experiment-evaluation.js +542 -0
  377. package/lib/orchestrator/experiment-evaluation.js.map +1 -0
  378. package/lib/orchestrator/experiment-finish.d.ts +6 -0
  379. package/lib/orchestrator/experiment-finish.d.ts.map +1 -0
  380. package/lib/orchestrator/experiment-finish.js +19 -0
  381. package/lib/orchestrator/experiment-finish.js.map +1 -0
  382. package/lib/orchestrator/experiment-identity.d.ts +6 -0
  383. package/lib/orchestrator/experiment-identity.d.ts.map +1 -0
  384. package/lib/orchestrator/experiment-identity.js +257 -0
  385. package/lib/orchestrator/experiment-identity.js.map +1 -0
  386. package/lib/orchestrator/experiment-loader.d.ts +175 -0
  387. package/lib/orchestrator/experiment-loader.d.ts.map +1 -0
  388. package/lib/orchestrator/experiment-loader.js +77 -0
  389. package/lib/orchestrator/experiment-loader.js.map +1 -0
  390. package/lib/orchestrator/experiment-report.d.ts +450 -0
  391. package/lib/orchestrator/experiment-report.d.ts.map +1 -0
  392. package/lib/orchestrator/experiment-report.js +570 -0
  393. package/lib/orchestrator/experiment-report.js.map +1 -0
  394. package/lib/orchestrator/experiment-runs.d.ts +379 -0
  395. package/lib/orchestrator/experiment-runs.d.ts.map +1 -0
  396. package/lib/orchestrator/experiment-runs.js +796 -0
  397. package/lib/orchestrator/experiment-runs.js.map +1 -0
  398. package/lib/orchestrator/experiment-runtime-identity.d.ts +41 -0
  399. package/lib/orchestrator/experiment-runtime-identity.d.ts.map +1 -0
  400. package/lib/orchestrator/experiment-runtime-identity.js +411 -0
  401. package/lib/orchestrator/experiment-runtime-identity.js.map +1 -0
  402. package/lib/orchestrator/experiment-selection.d.ts +25 -0
  403. package/lib/orchestrator/experiment-selection.d.ts.map +1 -0
  404. package/lib/orchestrator/experiment-selection.js +286 -0
  405. package/lib/orchestrator/experiment-selection.js.map +1 -0
  406. package/lib/orchestrator/experiment.d.ts +11 -0
  407. package/lib/orchestrator/experiment.d.ts.map +1 -0
  408. package/lib/orchestrator/experiment.js +639 -0
  409. package/lib/orchestrator/experiment.js.map +1 -0
  410. package/lib/orchestrator/fixture-identity.d.ts +7 -0
  411. package/lib/orchestrator/fixture-identity.d.ts.map +1 -0
  412. package/lib/orchestrator/fixture-identity.js +55 -0
  413. package/lib/orchestrator/fixture-identity.js.map +1 -0
  414. package/lib/orchestrator/fs-read.d.ts +19 -0
  415. package/lib/orchestrator/fs-read.d.ts.map +1 -0
  416. package/lib/orchestrator/fs-read.js +113 -0
  417. package/lib/orchestrator/fs-read.js.map +1 -0
  418. package/lib/orchestrator/grader-experiment.d.ts +190 -0
  419. package/lib/orchestrator/grader-experiment.d.ts.map +1 -0
  420. package/lib/orchestrator/grader-experiment.js +579 -0
  421. package/lib/orchestrator/grader-experiment.js.map +1 -0
  422. package/lib/orchestrator/grading.d.ts +31 -0
  423. package/lib/orchestrator/grading.d.ts.map +1 -0
  424. package/lib/orchestrator/grading.js +186 -0
  425. package/lib/orchestrator/grading.js.map +1 -0
  426. package/lib/orchestrator/index.d.ts +22 -0
  427. package/lib/orchestrator/index.d.ts.map +1 -0
  428. package/lib/orchestrator/index.js +30 -0
  429. package/lib/orchestrator/index.js.map +1 -0
  430. package/lib/orchestrator/lifecycle-hook-execution.d.ts +4 -0
  431. package/lib/orchestrator/lifecycle-hook-execution.d.ts.map +1 -0
  432. package/lib/orchestrator/lifecycle-hook-execution.js +67 -0
  433. package/lib/orchestrator/lifecycle-hook-execution.js.map +1 -0
  434. package/lib/orchestrator/list-runs.d.ts +33 -0
  435. package/lib/orchestrator/list-runs.d.ts.map +1 -0
  436. package/lib/orchestrator/list-runs.js +308 -0
  437. package/lib/orchestrator/list-runs.js.map +1 -0
  438. package/lib/orchestrator/loader.d.ts +3 -0
  439. package/lib/orchestrator/loader.d.ts.map +1 -0
  440. package/lib/orchestrator/loader.js +17 -0
  441. package/lib/orchestrator/loader.js.map +1 -0
  442. package/lib/orchestrator/optimization-lifecycle.d.ts +12 -0
  443. package/lib/orchestrator/optimization-lifecycle.d.ts.map +1 -0
  444. package/lib/orchestrator/optimization-lifecycle.js +92 -0
  445. package/lib/orchestrator/optimization-lifecycle.js.map +1 -0
  446. package/lib/orchestrator/orchestrator.d.ts +144 -0
  447. package/lib/orchestrator/orchestrator.d.ts.map +1 -0
  448. package/lib/orchestrator/orchestrator.js +632 -0
  449. package/lib/orchestrator/orchestrator.js.map +1 -0
  450. package/lib/orchestrator/owned-lock.d.ts +17 -0
  451. package/lib/orchestrator/owned-lock.d.ts.map +1 -0
  452. package/lib/orchestrator/owned-lock.js +149 -0
  453. package/lib/orchestrator/owned-lock.js.map +1 -0
  454. package/lib/orchestrator/package-version.d.ts +2 -0
  455. package/lib/orchestrator/package-version.d.ts.map +1 -0
  456. package/lib/orchestrator/package-version.js +4 -0
  457. package/lib/orchestrator/package-version.js.map +1 -0
  458. package/lib/orchestrator/provenance.d.ts +5 -0
  459. package/lib/orchestrator/provenance.d.ts.map +1 -0
  460. package/lib/orchestrator/provenance.js +137 -0
  461. package/lib/orchestrator/provenance.js.map +1 -0
  462. package/lib/orchestrator/regrade.d.ts +80 -0
  463. package/lib/orchestrator/regrade.d.ts.map +1 -0
  464. package/lib/orchestrator/regrade.js +433 -0
  465. package/lib/orchestrator/regrade.js.map +1 -0
  466. package/lib/orchestrator/rubric-loader.d.ts +7 -0
  467. package/lib/orchestrator/rubric-loader.d.ts.map +1 -0
  468. package/lib/orchestrator/rubric-loader.js +65 -0
  469. package/lib/orchestrator/rubric-loader.js.map +1 -0
  470. package/lib/orchestrator/run-dir.d.ts +40 -0
  471. package/lib/orchestrator/run-dir.d.ts.map +1 -0
  472. package/lib/orchestrator/run-dir.js +161 -0
  473. package/lib/orchestrator/run-dir.js.map +1 -0
  474. package/lib/orchestrator/run-execution.d.ts +30 -0
  475. package/lib/orchestrator/run-execution.d.ts.map +1 -0
  476. package/lib/orchestrator/run-execution.js +531 -0
  477. package/lib/orchestrator/run-execution.js.map +1 -0
  478. package/lib/orchestrator/run-lifecycle.d.ts +115 -0
  479. package/lib/orchestrator/run-lifecycle.d.ts.map +1 -0
  480. package/lib/orchestrator/run-lifecycle.js +136 -0
  481. package/lib/orchestrator/run-lifecycle.js.map +1 -0
  482. package/lib/orchestrator/suite-compare.d.ts +76 -0
  483. package/lib/orchestrator/suite-compare.d.ts.map +1 -0
  484. package/lib/orchestrator/suite-compare.js +159 -0
  485. package/lib/orchestrator/suite-compare.js.map +1 -0
  486. package/lib/orchestrator/suite-lifecycle.d.ts +157 -0
  487. package/lib/orchestrator/suite-lifecycle.d.ts.map +1 -0
  488. package/lib/orchestrator/suite-lifecycle.js +253 -0
  489. package/lib/orchestrator/suite-lifecycle.js.map +1 -0
  490. package/lib/orchestrator/suite-runs.d.ts +91 -0
  491. package/lib/orchestrator/suite-runs.d.ts.map +1 -0
  492. package/lib/orchestrator/suite-runs.js +157 -0
  493. package/lib/orchestrator/suite-runs.js.map +1 -0
  494. package/lib/orchestrator/suite-summary.d.ts +109 -0
  495. package/lib/orchestrator/suite-summary.d.ts.map +1 -0
  496. package/lib/orchestrator/suite-summary.js +213 -0
  497. package/lib/orchestrator/suite-summary.js.map +1 -0
  498. package/lib/orchestrator/trace-limits.d.ts +20 -0
  499. package/lib/orchestrator/trace-limits.d.ts.map +1 -0
  500. package/lib/orchestrator/trace-limits.js +28 -0
  501. package/lib/orchestrator/trace-limits.js.map +1 -0
  502. package/lib/orchestrator/validate-plugin-config.d.ts +10 -0
  503. package/lib/orchestrator/validate-plugin-config.d.ts.map +1 -0
  504. package/lib/orchestrator/validate-plugin-config.js +26 -0
  505. package/lib/orchestrator/validate-plugin-config.js.map +1 -0
  506. package/package.json +84 -0
  507. package/skills/lux/SKILL.md +85 -0
  508. package/skills/lux/references/cli.md +102 -0
  509. package/skills/lux/references/eval-authoring.md +105 -0
  510. package/skills/lux-answerer/SKILL.md +169 -0
  511. package/src/answerers/claude-code/index.ts +342 -0
  512. package/src/answerers/persona/index.ts +327 -0
  513. package/src/answerers/scripted/index.ts +186 -0
  514. package/src/answerers/shared.ts +23 -0
  515. package/src/answerers/terminal/index.ts +117 -0
  516. package/src/assertions/core/command-exits-zero.ts +94 -0
  517. package/src/assertions/core/event-checks.ts +138 -0
  518. package/src/assertions/core/file-checks.ts +336 -0
  519. package/src/assertions/core/helpers.ts +203 -0
  520. package/src/assertions/core/index.ts +80 -0
  521. package/src/assertions/core/json-pointer-equals.ts +84 -0
  522. package/src/assertions/core/output-checks.ts +134 -0
  523. package/src/assertions/core/predicate.ts +67 -0
  524. package/src/assertions/core/resource-checks.ts +180 -0
  525. package/src/assertions/core/safe-regex.ts +196 -0
  526. package/src/assertions/core/tool-called-with.ts +68 -0
  527. package/src/assertions/core/tool-calls.ts +28 -0
  528. package/src/assertions/core/tool-invocation.ts +198 -0
  529. package/src/assertions/core/tool-result-checks.ts +211 -0
  530. package/src/assertions/mcp/discovery-checks.ts +139 -0
  531. package/src/assertions/mcp/index.ts +37 -0
  532. package/src/assertions/rubric/index.ts +258 -0
  533. package/src/assertions/rubric/internal.ts +367 -0
  534. package/src/authoring.ts +2 -0
  535. package/src/cli/bin.ts +14 -0
  536. package/src/cli/command-runtime.ts +34 -0
  537. package/src/cli/init.ts +410 -0
  538. package/src/cli/program.ts +992 -0
  539. package/src/cli/render/format.ts +69 -0
  540. package/src/cli/render/reporter.ts +643 -0
  541. package/src/cli/render/tty.ts +314 -0
  542. package/src/cli/run-options.ts +82 -0
  543. package/src/cli/skills.ts +129 -0
  544. package/src/core/annotation.ts +104 -0
  545. package/src/core/answerer.ts +75 -0
  546. package/src/core/artifact-evidence.ts +249 -0
  547. package/src/core/artifact-snapshot.ts +429 -0
  548. package/src/core/assertion.ts +156 -0
  549. package/src/core/case.ts +103 -0
  550. package/src/core/conversation-turn.ts +47 -0
  551. package/src/core/driver.ts +75 -0
  552. package/src/core/emitter.ts +38 -0
  553. package/src/core/events.ts +135 -0
  554. package/src/core/exec.ts +263 -0
  555. package/src/core/experiment.ts +467 -0
  556. package/src/core/glob.ts +31 -0
  557. package/src/core/hash.ts +237 -0
  558. package/src/core/index.ts +28 -0
  559. package/src/core/lifecycle-fixtures.ts +145 -0
  560. package/src/core/lifecycle-hooks.ts +101 -0
  561. package/src/core/mcp-events.ts +57 -0
  562. package/src/core/model-cli.ts +271 -0
  563. package/src/core/observer.ts +50 -0
  564. package/src/core/platform-process.ts +284 -0
  565. package/src/core/registry.ts +57 -0
  566. package/src/core/rubric.ts +52 -0
  567. package/src/core/run.ts +144 -0
  568. package/src/core/statistics.ts +194 -0
  569. package/src/core/subject.ts +50 -0
  570. package/src/core/tool-events.ts +292 -0
  571. package/src/core/usage.ts +123 -0
  572. package/src/core/wire.ts +135 -0
  573. package/src/core/zod.ts +20 -0
  574. package/src/drivers/claude-code/index.ts +866 -0
  575. package/src/drivers/claude-code/parse-events.ts +464 -0
  576. package/src/drivers/codex/app-events.ts +218 -0
  577. package/src/drivers/codex/config.ts +128 -0
  578. package/src/drivers/codex/index.ts +995 -0
  579. package/src/drivers/mcp/index.ts +351 -0
  580. package/src/drivers/mcp/transport.ts +222 -0
  581. package/src/drivers/shared/artifacts.ts +86 -0
  582. package/src/drivers/shared/secure-copy.ts +40 -0
  583. package/src/drivers/subprocess/index.ts +490 -0
  584. package/src/index.ts +594 -0
  585. package/src/optimization/reflective.ts +319 -0
  586. package/src/orchestrator/annotation-loader.ts +97 -0
  587. package/src/orchestrator/annotation-store.ts +112 -0
  588. package/src/orchestrator/authored-dependencies.ts +193 -0
  589. package/src/orchestrator/campaign-lifecycle.ts +181 -0
  590. package/src/orchestrator/candidate-integrity.ts +18 -0
  591. package/src/orchestrator/candidates.ts +683 -0
  592. package/src/orchestrator/compare.ts +358 -0
  593. package/src/orchestrator/comparison-identity.ts +45 -0
  594. package/src/orchestrator/config.ts +205 -0
  595. package/src/orchestrator/content-bound-json.ts +71 -0
  596. package/src/orchestrator/discover.ts +132 -0
  597. package/src/orchestrator/doctor.ts +781 -0
  598. package/src/orchestrator/driver-session.ts +507 -0
  599. package/src/orchestrator/evaluator-identity.ts +45 -0
  600. package/src/orchestrator/experiment-budget.ts +61 -0
  601. package/src/orchestrator/experiment-context.ts +41 -0
  602. package/src/orchestrator/experiment-contracts.ts +43 -0
  603. package/src/orchestrator/experiment-corpus.ts +416 -0
  604. package/src/orchestrator/experiment-evaluation.ts +749 -0
  605. package/src/orchestrator/experiment-finish.ts +33 -0
  606. package/src/orchestrator/experiment-identity.ts +356 -0
  607. package/src/orchestrator/experiment-loader.ts +105 -0
  608. package/src/orchestrator/experiment-report.ts +788 -0
  609. package/src/orchestrator/experiment-runs.ts +960 -0
  610. package/src/orchestrator/experiment-runtime-identity.ts +465 -0
  611. package/src/orchestrator/experiment-selection.ts +467 -0
  612. package/src/orchestrator/experiment.ts +991 -0
  613. package/src/orchestrator/fixture-identity.ts +67 -0
  614. package/src/orchestrator/fs-read.ts +126 -0
  615. package/src/orchestrator/grader-experiment.ts +856 -0
  616. package/src/orchestrator/grading.ts +260 -0
  617. package/src/orchestrator/index.ts +186 -0
  618. package/src/orchestrator/lifecycle-hook-execution.ts +90 -0
  619. package/src/orchestrator/list-runs.ts +384 -0
  620. package/src/orchestrator/loader.ts +19 -0
  621. package/src/orchestrator/optimization-lifecycle.ts +126 -0
  622. package/src/orchestrator/orchestrator.ts +919 -0
  623. package/src/orchestrator/owned-lock.ts +147 -0
  624. package/src/orchestrator/package-version.ts +5 -0
  625. package/src/orchestrator/provenance.ts +140 -0
  626. package/src/orchestrator/regrade.ts +580 -0
  627. package/src/orchestrator/rubric-loader.ts +74 -0
  628. package/src/orchestrator/run-dir.ts +209 -0
  629. package/src/orchestrator/run-execution.ts +694 -0
  630. package/src/orchestrator/run-lifecycle.ts +174 -0
  631. package/src/orchestrator/suite-compare.ts +195 -0
  632. package/src/orchestrator/suite-lifecycle.ts +335 -0
  633. package/src/orchestrator/suite-runs.ts +202 -0
  634. package/src/orchestrator/suite-summary.ts +276 -0
  635. package/src/orchestrator/trace-limits.ts +65 -0
  636. package/src/orchestrator/validate-plugin-config.ts +34 -0
@@ -0,0 +1,283 @@
1
+ /**
2
+ * Terminal primitives for the live runner. Hand-rolled: the CLI needs
3
+ * perhaps 40 lines of this, and a dependency here would have to ship as a
4
+ * runtime dep of the published package for the sake of its `bin`.
5
+ */
6
+ // Assembled from a variable so the escape byte never appears as a literal
7
+ // control character inside a regex or string constant.
8
+ const ESC = String.fromCharCode(27);
9
+ const ANSI_PATTERN = new RegExp(`${ESC}\\[[0-9;?]*[A-Za-z]`, "g");
10
+ const ANSI_PREFIX = new RegExp(`^${ESC}\\[[0-9;?]*[A-Za-z]`);
11
+ const RESET = `${ESC}[0m`;
12
+ const CURSOR_HIDE = `${ESC}[?25l`;
13
+ const CURSOR_SHOW = `${ESC}[?25h`;
14
+ const ERASE_BELOW = `${ESC}[0J`;
15
+ const cursorUp = (rows) => (rows > 0 ? `${ESC}[${rows}A` : "");
16
+ export const stripAnsi = (text) => text.replace(ANSI_PATTERN, "");
17
+ /**
18
+ * Code points we render that occupy two terminal cells. The CJK/emoji block
19
+ * ranges cover most of it; the explicit set is the handful of pre-emoji
20
+ * symbols (⚡ especially) that default to emoji presentation and therefore
21
+ * render wide despite living below U+1F300.
22
+ */
23
+ const WIDE_SINGLETONS = new Set([0x231a, 0x231b, 0x23f0, 0x23f3, 0x26a1, 0x2705, 0x274c, 0x2b50]);
24
+ const charWidth = (codePoint) => {
25
+ if (WIDE_SINGLETONS.has(codePoint))
26
+ return 2;
27
+ if (codePoint >= 0x1100 && codePoint <= 0x115f)
28
+ return 2;
29
+ if (codePoint >= 0x2e80 && codePoint <= 0xa4cf)
30
+ return 2;
31
+ if (codePoint >= 0xac00 && codePoint <= 0xd7a3)
32
+ return 2;
33
+ if (codePoint >= 0xf900 && codePoint <= 0xfaff)
34
+ return 2;
35
+ if (codePoint >= 0xfe30 && codePoint <= 0xfe6f)
36
+ return 2;
37
+ if (codePoint >= 0xff00 && codePoint <= 0xff60)
38
+ return 2;
39
+ if (codePoint >= 0xffe0 && codePoint <= 0xffe6)
40
+ return 2;
41
+ if (codePoint >= 0x1f300 && codePoint <= 0x1faff)
42
+ return 2;
43
+ return 1;
44
+ };
45
+ const graphemes = new Intl.Segmenter(undefined, { granularity: "grapheme" });
46
+ // Per-code-point counting over-counts ZWJ emoji sequences (a family emoji is
47
+ // seven code points but one two-cell glyph), so width is measured per
48
+ // grapheme cluster: any wide code point inside makes the whole cluster wide.
49
+ const clusterWidth = (cluster) => {
50
+ for (const char of cluster) {
51
+ if (charWidth(char.codePointAt(0) ?? 0) === 2)
52
+ return 2;
53
+ }
54
+ return 1;
55
+ };
56
+ export const visibleWidth = (text) => {
57
+ let width = 0;
58
+ for (const { segment } of graphemes.segment(stripAnsi(text)))
59
+ width += clusterWidth(segment);
60
+ return width;
61
+ };
62
+ /**
63
+ * Cut `text` to `maxWidth` visible cells, counting styling as zero-width.
64
+ * A line wider than the terminal would wrap, and a wrapped line breaks the
65
+ * cursor arithmetic the live region depends on — so every painted row goes
66
+ * through here.
67
+ */
68
+ export const truncate = (text, maxWidth) => {
69
+ if (maxWidth <= 0)
70
+ return "";
71
+ if (visibleWidth(text) <= maxWidth)
72
+ return text;
73
+ let out = "";
74
+ let width = 0;
75
+ let index = 0;
76
+ let styled = false;
77
+ scan: while (index < text.length) {
78
+ if (text.startsWith(ESC, index)) {
79
+ const sequence = text.slice(index).match(ANSI_PREFIX)?.[0];
80
+ if (!sequence)
81
+ break;
82
+ out += sequence;
83
+ styled = true;
84
+ index += sequence.length;
85
+ continue;
86
+ }
87
+ // Segment the plain-text run up to the next escape so a grapheme cluster
88
+ // is never split mid-sequence.
89
+ const nextEsc = text.indexOf(ESC, index);
90
+ const run = text.slice(index, nextEsc === -1 ? text.length : nextEsc);
91
+ for (const { segment } of graphemes.segment(run)) {
92
+ const next = width + clusterWidth(segment);
93
+ // Reserve one cell for the ellipsis.
94
+ if (next > maxWidth - 1)
95
+ break scan;
96
+ out += segment;
97
+ width = next;
98
+ }
99
+ index += run.length;
100
+ }
101
+ return `${out}…${styled ? RESET : ""}`;
102
+ };
103
+ const wrap = (open, close) => (s) => `${ESC}[${open}m${s}${ESC}[${close}m`;
104
+ const plain = (s) => s;
105
+ export const makeTheme = (color) => color
106
+ ? {
107
+ bold: wrap("1", "22"),
108
+ dim: wrap("2", "22"),
109
+ green: wrap("32", "39"),
110
+ red: wrap("31", "39"),
111
+ yellow: wrap("33", "39"),
112
+ cyan: wrap("36", "39"),
113
+ inverse: wrap("7", "27"),
114
+ }
115
+ : {
116
+ bold: plain,
117
+ dim: plain,
118
+ green: plain,
119
+ red: plain,
120
+ yellow: plain,
121
+ cyan: plain,
122
+ inverse: plain,
123
+ };
124
+ /**
125
+ * Honour the two conventions users actually rely on: `NO_COLOR` to force
126
+ * plain output anywhere, `FORCE_COLOR` to keep colour through a pipe (CI
127
+ * log viewers that render ANSI).
128
+ */
129
+ export const shouldColor = (stream, env) => {
130
+ if (env.NO_COLOR)
131
+ return false;
132
+ if (env.FORCE_COLOR)
133
+ return env.FORCE_COLOR !== "0";
134
+ return Boolean(stream.isTTY);
135
+ };
136
+ const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
137
+ export const spinnerFrame = (tick) => SPINNER_FRAMES[tick % SPINNER_FRAMES.length] ?? "-";
138
+ /**
139
+ * A block of lines pinned to the bottom of the terminal, repainted on a
140
+ * timer so elapsed clocks tick. Anything else that writes to the terminal
141
+ * while it is active is intercepted, printed *above* the block, and the
142
+ * block repainted underneath — otherwise a stray write lands mid-frame and
143
+ * every subsequent cursor-up is off by one. Off a TTY the whole mechanism
144
+ * collapses to plain `staticLine` writes.
145
+ */
146
+ export class LiveRegion {
147
+ stdout;
148
+ writeRaw;
149
+ frameIntervalMs;
150
+ live;
151
+ renderFrame = () => [];
152
+ paintedRows = 0;
153
+ timer = null;
154
+ patched = [];
155
+ held = new Map();
156
+ started = false;
157
+ constructor(options = {}) {
158
+ this.stdout = options.stdout ?? process.stdout;
159
+ // Captured before any interception, so the region's own paints never
160
+ // recurse back through the patched writer.
161
+ const original = this.stdout.write.bind(this.stdout);
162
+ this.writeRaw = (chunk) => {
163
+ original(chunk);
164
+ };
165
+ this.live = options.live ?? Boolean(this.stdout.isTTY);
166
+ this.frameIntervalMs = options.frameIntervalMs ?? 80;
167
+ }
168
+ start(renderFrame) {
169
+ this.renderFrame = renderFrame;
170
+ if (!this.live || this.started)
171
+ return;
172
+ this.started = true;
173
+ this.writeRaw(CURSOR_HIDE);
174
+ this.intercept(process.stderr);
175
+ this.timer = setInterval(() => this.repaint(), this.frameIntervalMs);
176
+ // Never let the repaint timer be the reason the process stays alive.
177
+ this.timer.unref();
178
+ // Interrupt handling belongs to the CLI, which has a run to unwind; the
179
+ // region only guarantees the cursor comes back however the process ends.
180
+ process.once("exit", this.onExit);
181
+ this.paint();
182
+ }
183
+ /**
184
+ * Print a permanent line above the live block. Before `start()` and after
185
+ * `stop()` there is no block to move, so the line goes straight out — which
186
+ * is also exactly the non-TTY behaviour.
187
+ */
188
+ staticLine(text) {
189
+ if (!this.live || !this.started) {
190
+ this.writeRaw(`${text}\n`);
191
+ return;
192
+ }
193
+ this.clear();
194
+ this.writeRaw(`${text}\n`);
195
+ this.paint();
196
+ }
197
+ repaint() {
198
+ if (!this.live || !this.started)
199
+ return;
200
+ this.clear();
201
+ this.paint();
202
+ }
203
+ stop() {
204
+ if (!this.live || !this.started)
205
+ return;
206
+ this.started = false;
207
+ if (this.timer)
208
+ clearInterval(this.timer);
209
+ this.timer = null;
210
+ this.clear();
211
+ for (const { stream, original, restore } of this.patched) {
212
+ const rest = this.held.get(stream);
213
+ if (rest)
214
+ original(`${rest}\n`);
215
+ restore();
216
+ }
217
+ this.patched = [];
218
+ this.held.clear();
219
+ this.writeRaw(CURSOR_SHOW);
220
+ process.off("exit", this.onExit);
221
+ }
222
+ onExit = () => {
223
+ if (this.started)
224
+ this.writeRaw(CURSOR_SHOW);
225
+ };
226
+ clear() {
227
+ if (this.paintedRows === 0)
228
+ return;
229
+ this.writeRaw(cursorUp(this.paintedRows) + ERASE_BELOW);
230
+ this.paintedRows = 0;
231
+ }
232
+ paint() {
233
+ const columns = this.stdout.columns ?? 80;
234
+ const maxRows = Math.max(1, (this.stdout.rows ?? 24) - 1);
235
+ const lines = this.renderFrame()
236
+ .slice(-maxRows)
237
+ .map((line) => truncate(line, columns - 1));
238
+ if (lines.length === 0)
239
+ return;
240
+ this.writeRaw(lines.map((line) => `${line}\n`).join(""));
241
+ this.paintedRows = lines.length;
242
+ }
243
+ /**
244
+ * Buffer a foreign stream to whole lines before letting it through: a
245
+ * half-written line cannot be painted over cleanly, and the subprocess
246
+ * driver relays agent stderr in arbitrary chunks.
247
+ */
248
+ intercept(stream) {
249
+ if (!stream.isTTY)
250
+ return;
251
+ const original = stream.write.bind(stream);
252
+ const emit = (chunk) => {
253
+ original(chunk);
254
+ };
255
+ const patched = (chunk, encoding, callback) => {
256
+ const done = typeof encoding === "function" ? encoding : callback;
257
+ const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf-8");
258
+ const buffered = (this.held.get(stream) ?? "") + text;
259
+ const lastBreak = buffered.lastIndexOf("\n");
260
+ if (lastBreak === -1) {
261
+ this.held.set(stream, buffered);
262
+ }
263
+ else {
264
+ this.held.set(stream, buffered.slice(lastBreak + 1));
265
+ this.clear();
266
+ emit(buffered.slice(0, lastBreak + 1));
267
+ this.paint();
268
+ }
269
+ if (typeof done === "function")
270
+ done();
271
+ return true;
272
+ };
273
+ stream.write = patched;
274
+ this.patched.push({
275
+ stream,
276
+ original: emit,
277
+ restore: () => {
278
+ stream.write = original;
279
+ },
280
+ });
281
+ }
282
+ }
283
+ //# sourceMappingURL=tty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tty.js","sourceRoot":"","sources":["../../../src/cli/render/tty.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0EAA0E;AAC1E,uDAAuD;AACvD,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,qBAAqB,EAAE,GAAG,CAAC,CAAC;AAClE,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,qBAAqB,CAAC,CAAC;AA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,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrD,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;YACD,IAAI,OAAO,IAAI,KAAK,UAAU;gBAAG,IAAmB,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QACF,MAAM,CAAC,KAAK,GAAG,OAAyC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YAChB,MAAM;YACN,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,GAAG,EAAE;gBACZ,MAAM,CAAC,KAAK,GAAG,QAA+B,CAAC;YACjD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ export type RunOptions = {
2
+ tag?: string[];
3
+ loop?: number;
4
+ concurrency?: number;
5
+ list?: boolean;
6
+ listTags?: boolean;
7
+ interactive?: boolean;
8
+ claudeAnswerer?: boolean;
9
+ runsRoot?: string;
10
+ profile?: string;
11
+ subjectRoot?: string;
12
+ verbose?: boolean;
13
+ };
14
+ export declare const collectTags: (value: string, previous: string[]) => string[];
15
+ export declare const collectValues: (value: string, previous: string[]) => string[];
16
+ export declare const parseAnnotationAssertion: (value: string) => [string, {
17
+ passed: boolean;
18
+ score?: number;
19
+ }];
20
+ export declare const parsePositiveInt: (value: string) => number;
21
+ export declare const parseUnitInterval: (value: string) => number;
22
+ export declare const resolveConcurrency: (options: Pick<RunOptions, "concurrency" | "interactive" | "claudeAnswerer">, configured: number) => {
23
+ concurrency: number;
24
+ note?: string;
25
+ };
26
+ export declare const resolveAnswererOverride: (options: RunOptions) => string | undefined;
27
+ //# sourceMappingURL=run-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-options.d.ts","sourceRoot":"","sources":["../../src/cli/run-options.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,YAAY,MAAM,EAAE,KAAG,MAAM,EAMnE,CAAC;AAEJ,eAAO,MAAM,aAAa,UAAW,MAAM,YAAY,MAAM,EAAE,KAAG,MAAM,EAA0B,CAAC;AAEnG,eAAO,MAAM,wBAAwB,UAC5B,MAAM,KACZ,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAa9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MAOhD,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,MAAM,KAAG,MAMjD,CAAC;AAEF,eAAO,MAAM,kBAAkB,YACpB,IAAI,CAAC,UAAU,EAAE,aAAa,GAAG,aAAa,GAAG,gBAAgB,CAAC,cAC/D,MAAM,KACjB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAYtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,YAAa,UAAU,KAAG,MAAM,GAAG,SAItE,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { InvalidArgumentError } from "commander";
2
+ export const collectTags = (value, previous) => previous.concat(value
3
+ .split(",")
4
+ .map((tag) => tag.trim())
5
+ .filter(Boolean));
6
+ export const collectValues = (value, previous) => [...previous, value];
7
+ export const parseAnnotationAssertion = (value) => {
8
+ const match = /^(.+)=(pass|fail)(?::(.+))?$/.exec(value);
9
+ if (!match?.[1] || !match[2]) {
10
+ throw new InvalidArgumentError("--assertion must use id=pass, id=fail, or id=pass:0.8 syntax");
11
+ }
12
+ const score = match[3] === undefined ? undefined : parseUnitInterval(match[3]);
13
+ return [
14
+ match[1],
15
+ {
16
+ passed: match[2] === "pass",
17
+ ...(score !== undefined ? { score } : {}),
18
+ },
19
+ ];
20
+ };
21
+ export const parsePositiveInt = (value) => {
22
+ // Number() rejects partial numbers such as "3abc" and "2.9".
23
+ const parsed = Number(value);
24
+ if (!Number.isInteger(parsed) || parsed < 1) {
25
+ throw new InvalidArgumentError("must be a positive integer");
26
+ }
27
+ return parsed;
28
+ };
29
+ export const parseUnitInterval = (value) => {
30
+ const parsed = Number(value);
31
+ if (!Number.isFinite(parsed) || parsed < 0 || parsed > 1) {
32
+ throw new InvalidArgumentError("must be a number between 0 and 1");
33
+ }
34
+ return parsed;
35
+ };
36
+ export const resolveConcurrency = (options, configured) => {
37
+ const requested = options.concurrency ?? configured;
38
+ let liveFlag = null;
39
+ if (options.interactive)
40
+ liveFlag = "--interactive";
41
+ else if (options.claudeAnswerer)
42
+ liveFlag = "--claude-answerer";
43
+ if (liveFlag && requested > 1) {
44
+ return {
45
+ concurrency: 1,
46
+ note: `lux: ${liveFlag} is a live session; running one case at a time (ignoring concurrency ${requested})\n`,
47
+ };
48
+ }
49
+ return { concurrency: requested };
50
+ };
51
+ export const resolveAnswererOverride = (options) => {
52
+ if (options.interactive)
53
+ return "terminal";
54
+ if (options.claudeAnswerer)
55
+ return "claude-code";
56
+ return undefined;
57
+ };
58
+ //# sourceMappingURL=run-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-options.js","sourceRoot":"","sources":["../../src/cli/run-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAgBjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,QAAkB,EAAY,EAAE,CACzE,QAAQ,CAAC,MAAM,CACb,KAAK;KACF,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KACxB,MAAM,CAAC,OAAO,CAAC,CACnB,CAAC;AAEJ,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,QAAkB,EAAY,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,KAAa,EACkC,EAAE;IACjD,MAAM,KAAK,GAAG,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,oBAAoB,CAAC,8DAA8D,CAAC,CAAC;IACjG,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,OAAO;QACL,KAAK,CAAC,CAAC,CAAC;QACR;YACE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM;YAC3B,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAA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AW,EAAE,SAAS,EAAE,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAmB,EAAsB,EAAE;IACjF,IAAI,OAAO,CAAC,WAAW;QAAE,OAAO,UAAU,CAAC;IAC3C,IAAI,OAAO,CAAC,cAAc;QAAE,OAAO,aAAa,CAAC;IACjD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ declare const PlatformSchema: z.ZodEnum<{
3
+ all: "all";
4
+ claude: "claude";
5
+ "claude-code": "claude-code";
6
+ codex: "codex";
7
+ }>;
8
+ export type SkillsPlatform = z.infer<typeof PlatformSchema>;
9
+ declare const SkillNameSchema: z.ZodEnum<{
10
+ lux: "lux";
11
+ "lux-answerer": "lux-answerer";
12
+ }>;
13
+ export type BundledSkillName = z.infer<typeof SkillNameSchema>;
14
+ declare const InstallSkillsOptionsSchema: z.ZodObject<{
15
+ cwd: z.ZodString;
16
+ platform: z.ZodEnum<{
17
+ all: "all";
18
+ claude: "claude";
19
+ "claude-code": "claude-code";
20
+ codex: "codex";
21
+ }>;
22
+ project: z.ZodDefault<z.ZodBoolean>;
23
+ dir: z.ZodOptional<z.ZodString>;
24
+ name: z.ZodOptional<z.ZodEnum<{
25
+ lux: "lux";
26
+ "lux-answerer": "lux-answerer";
27
+ }>>;
28
+ }, z.core.$strict>;
29
+ export interface InstalledSkill {
30
+ name: BundledSkillName;
31
+ platform: "claude-code" | "codex";
32
+ path: string;
33
+ }
34
+ export declare const formatSkillsList: () => string;
35
+ export declare const installSkills: (options: z.input<typeof InstallSkillsOptionsSchema>) => Promise<InstalledSkill[]>;
36
+ export declare const formatSkillsInstall: (installed: InstalledSkill[], cwd: string) => string;
37
+ export {};
38
+ //# sourceMappingURL=skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,cAAc;;;;;EAAoD,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,QAAA,MAAM,eAAe;;;EAAkC,CAAC;AACxD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE/D,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;kBAQrB,CAAC;AAEZ,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAmBD,eAAO,MAAM,gBAAgB,QAAO,MAGtB,CAAC;AA2Df,eAAO,MAAM,aAAa,YACf,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,KAClD,OAAO,CAAC,cAAc,EAAE,CAU1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,cAAe,cAAc,EAAE,OAAO,MAAM,KAAG,MAQhE,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { lstat, mkdir, readdir, readFile, writeFile } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { dirname, join, relative, resolve, sep } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { z } from "zod";
6
+ const PlatformSchema = z.enum(["claude", "claude-code", "codex", "all"]);
7
+ const SkillNameSchema = z.enum(["lux", "lux-answerer"]);
8
+ const InstallSkillsOptionsSchema = z
9
+ .object({
10
+ cwd: z.string().min(1),
11
+ platform: PlatformSchema,
12
+ project: z.boolean().default(false),
13
+ dir: z.string().min(1).optional(),
14
+ name: SkillNameSchema.optional(),
15
+ })
16
+ .strict();
17
+ const BUNDLED_SKILLS = [
18
+ {
19
+ name: "lux",
20
+ description: "Author and drive coding-agent evals with Lux",
21
+ platforms: ["claude-code", "codex"],
22
+ },
23
+ {
24
+ name: "lux-answerer",
25
+ description: "Play a simulated user for a running Lux eval",
26
+ platforms: ["claude-code"],
27
+ },
28
+ ];
29
+ export const formatSkillsList = () => BUNDLED_SKILLS.map(({ name, description, platforms }) => `${name}\t${description}\t${platforms.join(",")}`).join("\n");
30
+ const targetsFor = (platform, cwd, project, dir, name) => {
31
+ const platforms = platform === "all"
32
+ ? ["claude-code", "codex"]
33
+ : [platform === "claude" ? "claude-code" : platform];
34
+ const scopeRoot = project ? resolve(cwd) : homedir();
35
+ const skills = name ? BUNDLED_SKILLS.filter((skill) => skill.name === name) : BUNDLED_SKILLS;
36
+ return platforms.flatMap((platformName) => skills
37
+ .filter((skill) => skill.platforms.includes(platformName))
38
+ .map((skill) => ({
39
+ name: skill.name,
40
+ platform: platformName,
41
+ source: fileURLToPath(new URL(`../../skills/${skill.name}`, import.meta.url)),
42
+ path: dir
43
+ ? join(resolve(dir), skill.name)
44
+ : join(scopeRoot, platformName === "claude-code" ? ".claude" : ".codex", "skills", skill.name),
45
+ })));
46
+ };
47
+ const copySkillDirectory = async (source, target) => {
48
+ const sourceInfo = await lstat(source);
49
+ if (!sourceInfo.isDirectory() || sourceInfo.isSymbolicLink()) {
50
+ throw new Error(`lux skills: bundled skill source is not a real directory: ${source}`);
51
+ }
52
+ await mkdir(target, { recursive: true });
53
+ for (const entry of await readdir(source, { withFileTypes: true })) {
54
+ const sourcePath = join(source, entry.name);
55
+ const targetPath = join(target, entry.name);
56
+ if (entry.isSymbolicLink()) {
57
+ throw new Error(`lux skills: bundled skill contains a symbolic link: ${sourcePath}`);
58
+ }
59
+ if (entry.isDirectory()) {
60
+ await copySkillDirectory(sourcePath, targetPath);
61
+ }
62
+ else if (entry.isFile()) {
63
+ await mkdir(dirname(targetPath), { recursive: true });
64
+ await writeFile(targetPath, await readFile(sourcePath));
65
+ }
66
+ else {
67
+ throw new Error(`lux skills: bundled skill contains an unsupported entry: ${sourcePath}`);
68
+ }
69
+ }
70
+ };
71
+ export const installSkills = async (options) => {
72
+ const parsed = InstallSkillsOptionsSchema.parse(options);
73
+ const targets = targetsFor(parsed.platform, parsed.cwd, parsed.project, parsed.dir, parsed.name);
74
+ if (targets.length === 0) {
75
+ throw new Error(`lux skills: '${parsed.name}' is not available for platform '${parsed.platform}'`);
76
+ }
77
+ for (const target of targets)
78
+ await copySkillDirectory(target.source, target.path);
79
+ return targets.map(({ source: _, ...installed }) => installed);
80
+ };
81
+ export const formatSkillsInstall = (installed, cwd) => installed
82
+ .map(({ name, platform, path }) => `installed ${name} skill for ${platform} at ${relative(cwd, path).split(sep).join("/") || "."}`)
83
+ .join("\n");
84
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/cli/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAEzE,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;AAGxD,MAAM,0BAA0B,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,CAAC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IACJ,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,MAAM,kBAAkB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACnF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;AACjE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAA2B,EAAE,GAAW,EAAU,EAAE,CACtF,SAAS;KACN,GAAG,CACF,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAC3B,aAAa,IAAI,cAAc,QAAQ,OACrC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAC9C,EAAE,CACL;KACA,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ export declare const GraderAnnotationSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ runDir: z.ZodString;
5
+ rubricPath: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
7
+ expected: z.ZodObject<{
8
+ casePassed: z.ZodOptional<z.ZodBoolean>;
9
+ caseScore: z.ZodOptional<z.ZodNumber>;
10
+ assertions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
11
+ passed: z.ZodBoolean;
12
+ score: z.ZodOptional<z.ZodNumber>;
13
+ }, z.core.$strict>>>;
14
+ }, z.core.$strict>;
15
+ source: z.ZodEnum<{
16
+ human: "human";
17
+ synthetic: "synthetic";
18
+ }>;
19
+ annotator: z.ZodOptional<z.ZodString>;
20
+ labeledAt: z.ZodOptional<z.ZodString>;
21
+ reviewer: z.ZodOptional<z.ZodString>;
22
+ feedback: z.ZodOptional<z.ZodString>;
23
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
+ }, z.core.$strict>;
25
+ export type GraderAnnotation = z.output<typeof GraderAnnotationSchema>;
26
+ export declare const GraderAnnotationDatasetSchema: z.ZodObject<{
27
+ schemaVersion: z.ZodLiteral<1>;
28
+ annotations: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ runDir: z.ZodString;
31
+ rubricPath: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
32
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
+ expected: z.ZodObject<{
34
+ casePassed: z.ZodOptional<z.ZodBoolean>;
35
+ caseScore: z.ZodOptional<z.ZodNumber>;
36
+ assertions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
37
+ passed: z.ZodBoolean;
38
+ score: z.ZodOptional<z.ZodNumber>;
39
+ }, z.core.$strict>>>;
40
+ }, z.core.$strict>;
41
+ source: z.ZodEnum<{
42
+ human: "human";
43
+ synthetic: "synthetic";
44
+ }>;
45
+ annotator: z.ZodOptional<z.ZodString>;
46
+ labeledAt: z.ZodOptional<z.ZodString>;
47
+ reviewer: z.ZodOptional<z.ZodString>;
48
+ feedback: z.ZodOptional<z.ZodString>;
49
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ }, z.core.$strict>>;
51
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ }, z.core.$strict>;
53
+ export type GraderAnnotationDatasetInput = z.input<typeof GraderAnnotationDatasetSchema>;
54
+ export type GraderAnnotationDataset = z.output<typeof GraderAnnotationDatasetSchema>;
55
+ export declare const defineGraderAnnotations: (input: GraderAnnotationDatasetInput) => GraderAnnotationDataset;
56
+ //# sourceMappingURL=annotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/core/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;kBA2D/B,CAAC;AACL,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmBtC,CAAC;AACL,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAErF,eAAO,MAAM,uBAAuB,UAC3B,4BAA4B,KAClC,uBAMF,CAAC"}