@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,519 @@
1
+ import { addUsage, createToolOutcomeAccumulator, emptyRunUsage, harnessUsage, isUsageEmpty, sumUsage, TURN_GLYPHS, TurnUsageSchema, totalTokens, } from "../../core/index.js";
2
+ import { formatAlignedUsage, formatDuration, formatScore, formatTally, formatTokens, formatUsage, } from "./format.js";
3
+ import { LiveRegion, makeTheme, shouldColor, spinnerFrame, truncate, visibleWidth, } from "./tty.js";
4
+ const PHASE_OF = {
5
+ load: "loading",
6
+ "prepare-answerer": "preparing",
7
+ "run-loop": "starting",
8
+ "start-driver": "agent",
9
+ "collect-start": "collecting",
10
+ "collect-end": "collecting",
11
+ "grade-start": "grading",
12
+ "grade-end": "grading",
13
+ close: "done",
14
+ };
15
+ const NAME_MIN = 14;
16
+ const NAME_MAX = 44;
17
+ const ASSERTION_NAME_MAX = 56;
18
+ const TURN_LABEL_WIDTH = 44;
19
+ const DURATION_COL = 7;
20
+ const TALLY_COL = 6;
21
+ // One wider than "Assertions", the longest label, so the value never abuts it.
22
+ const LABEL_COL = 11;
23
+ const statusMark = (status, theme) => {
24
+ if (status === "passed")
25
+ return theme.green("✓");
26
+ if (status === "failed")
27
+ return theme.red("✗");
28
+ if (status === "errored" || status === "incomplete")
29
+ return theme.red("!");
30
+ if (status === "ungraded")
31
+ return theme.dim("·");
32
+ return theme.cyan("·");
33
+ };
34
+ const assertionTally = (view) => {
35
+ const passed = view.assertions.filter((a) => a.passed).length;
36
+ return view.assertions.length === 0 ? "—" : `${passed}/${view.assertions.length}`;
37
+ };
38
+ /**
39
+ * A crash message on the case's own line, kept short enough to scan. Module
40
+ * resolution errors in particular run to several hundred characters; the
41
+ * untruncated text still lands in the case's tree below.
42
+ */
43
+ const INLINE_ERROR_MAX = 58;
44
+ const inlineError = (message) => {
45
+ const firstLine = message.split("\n")[0] ?? message;
46
+ return firstLine.length > INLINE_ERROR_MAX
47
+ ? `${firstLine.slice(0, INLINE_ERROR_MAX - 1)}…`
48
+ : firstLine;
49
+ };
50
+ /**
51
+ * Pad to exactly `width`, clipping when the name is longer — a `rubric` names
52
+ * itself after its whole criteria string, which would otherwise shove every
53
+ * column to its right off the screen.
54
+ */
55
+ const cell = (text, width) => {
56
+ // Measure visible cells (like truncate does), not code units — an emoji or
57
+ // CJK name would otherwise misalign every column after it. A clip that stops
58
+ // short of a wide glyph lands under `width`, so the result is padded too.
59
+ const clipped = visibleWidth(text) > width ? truncate(text, width) : text;
60
+ return clipped + " ".repeat(Math.max(0, width - visibleWidth(clipped)));
61
+ };
62
+ /**
63
+ * Why a failed assertion failed, in one clause. Two traps here: `threshold` is
64
+ * 0 whenever the case author left it unset — the assertion then applied its own
65
+ * internal bar, so "55% < 0%" would be a lie — and a deterministic assertion
66
+ * scores a flat 0, where "score 0%" only restates the ✗. Both stay silent.
67
+ */
68
+ const scoreNote = (entry) => {
69
+ if (entry.errorMessage)
70
+ return entry.errorMessage;
71
+ if (entry.passed)
72
+ return "";
73
+ const score = formatScore(entry.score);
74
+ if (entry.threshold > 0)
75
+ return `score ${score} < ${formatScore(entry.threshold)}`;
76
+ return entry.score > 0 ? `score ${score}` : "";
77
+ };
78
+ export class ConsoleReporter {
79
+ region;
80
+ theme;
81
+ verbose;
82
+ now;
83
+ cases = [];
84
+ nameWidth = NAME_MIN;
85
+ startedAt = 0;
86
+ total = 0;
87
+ loop = 1;
88
+ runsRoot = "";
89
+ suiteDir = "";
90
+ setSuiteDir(suiteDir) {
91
+ this.suiteDir = suiteDir;
92
+ }
93
+ constructor(options = {}) {
94
+ const stdout = options.stdout ?? process.stdout;
95
+ const env = options.env ?? process.env;
96
+ this.region = new LiveRegion({
97
+ stdout,
98
+ live: options.live,
99
+ frameIntervalMs: options.frameIntervalMs,
100
+ });
101
+ this.theme = makeTheme(shouldColor(stdout, env));
102
+ this.verbose = options.verbose ?? false;
103
+ this.now = options.now ?? Date.now;
104
+ }
105
+ begin(info) {
106
+ this.startedAt = this.now();
107
+ this.total = info.caseIds.length;
108
+ this.loop = info.loop && info.loop > 0 ? info.loop : 1;
109
+ this.runsRoot = info.runsRoot;
110
+ this.nameWidth = Math.min(NAME_MAX, Math.max(NAME_MIN, ...info.caseIds.map((id) => visibleWidth(id))));
111
+ const badge = this.theme.inverse(this.theme.bold(" lux "));
112
+ this.region.staticLine("");
113
+ this.region.staticLine(` ${badge} ${this.theme.bold(info.title)}`);
114
+ this.region.staticLine("");
115
+ this.region.start(this.frame);
116
+ }
117
+ caseStart(info) {
118
+ const view = {
119
+ caseId: info.caseId,
120
+ status: "running",
121
+ startedAt: this.now(),
122
+ endedAt: null,
123
+ phase: "loading",
124
+ toolReportedCalls: 0,
125
+ toolCalls: 0,
126
+ toolSucceeded: 0,
127
+ toolFailed: 0,
128
+ toolUnresolved: 0,
129
+ toolUnmatchedResults: 0,
130
+ toolMalformed: 0,
131
+ toolOutcomes: createToolOutcomeAccumulator(),
132
+ interrupts: 0,
133
+ assertionTotal: 0,
134
+ currentAssertion: null,
135
+ assertions: [],
136
+ usage: emptyRunUsage(),
137
+ agentTurns: [],
138
+ phaseDurationMs: null,
139
+ runDir: null,
140
+ errorMessage: null,
141
+ };
142
+ this.cases.push(view);
143
+ if (!this.region.live) {
144
+ this.region.staticLine(this.theme.dim(` ▶ ${info.caseId}`));
145
+ }
146
+ return {
147
+ event: (event) => this.applyEvent(view, event),
148
+ assertionStart: (assertion) => this.applyAssertionStart(view, assertion),
149
+ assertionEnd: (_info, entry) => this.applyAssertionEnd(view, entry),
150
+ end: (result) => this.finishCase(view, result),
151
+ };
152
+ }
153
+ applyEvent(view, event) {
154
+ if (view.endedAt !== null)
155
+ return;
156
+ if (event.type === "lifecycle")
157
+ view.phase = PHASE_OF[event.stage];
158
+ else if (event.type === "progress" &&
159
+ (event.kind === "tool-call" || event.kind === "tool-result")) {
160
+ view.toolOutcomes.add(event);
161
+ const tools = view.toolOutcomes.summary();
162
+ view.toolReportedCalls = tools.reportedCalls;
163
+ view.toolCalls = tools.total;
164
+ view.toolSucceeded = tools.succeeded;
165
+ view.toolFailed = tools.failed;
166
+ view.toolUnresolved = tools.unresolved;
167
+ view.toolUnmatchedResults = tools.unmatchedResults;
168
+ view.toolMalformed = tools.malformedEvents;
169
+ }
170
+ else if (event.type === "progress" && event.kind === "usage") {
171
+ const turn = TurnUsageSchema.safeParse(event.payload).data;
172
+ if (turn)
173
+ view.agentTurns.push(turn);
174
+ }
175
+ else if (event.type === "interrupt")
176
+ view.interrupts++;
177
+ else if (event.type === "error")
178
+ view.errorMessage = event.reason;
179
+ }
180
+ applyAssertionStart(view, info) {
181
+ if (view.endedAt !== null)
182
+ return;
183
+ view.phase = "grading";
184
+ view.assertionTotal = info.total;
185
+ view.currentAssertion = info.name;
186
+ }
187
+ applyAssertionEnd(view, entry) {
188
+ if (view.endedAt !== null)
189
+ return;
190
+ view.assertions.push(entry);
191
+ view.currentAssertion = null;
192
+ }
193
+ finishCase(view, result) {
194
+ if (view.endedAt !== null)
195
+ return;
196
+ view.endedAt = this.now();
197
+ view.runDir = result.runDir;
198
+ if (!result.result)
199
+ view.status = "errored";
200
+ else if (result.exitReason !== "done")
201
+ view.status = "incomplete";
202
+ else if (result.casePassed === true)
203
+ view.status = "passed";
204
+ else if (result.casePassed === false)
205
+ view.status = "failed";
206
+ else
207
+ view.status = "ungraded";
208
+ if (result.errorMessage)
209
+ view.errorMessage = result.errorMessage;
210
+ if (result.result) {
211
+ view.assertions = result.result.grading.assertions;
212
+ view.usage = result.result.metadata.usage;
213
+ view.phaseDurationMs = result.result.metadata.phaseDurationMs ?? null;
214
+ const tools = result.result.metadata.toolOutcomes;
215
+ if (tools) {
216
+ view.toolReportedCalls = tools.reportedCalls;
217
+ view.toolCalls = tools.total;
218
+ view.toolSucceeded = tools.succeeded;
219
+ view.toolFailed = tools.failed;
220
+ view.toolUnresolved = tools.unresolved;
221
+ view.toolUnmatchedResults = tools.unmatchedResults;
222
+ view.toolMalformed = tools.malformedEvents;
223
+ }
224
+ }
225
+ else {
226
+ // Assertions reported before the run failed to persist are not results
227
+ // and must not inflate the closing tally of a case that errored.
228
+ view.assertions = [];
229
+ }
230
+ this.region.staticLine(this.finishedLine(view));
231
+ for (const line of this.caseTreeLines(view))
232
+ this.region.staticLine(line);
233
+ }
234
+ /** Tear down the live block and print the closing report. */
235
+ finish() {
236
+ this.region.stop();
237
+ this.write("");
238
+ for (const line of this.summaryLines())
239
+ this.write(line);
240
+ this.write("");
241
+ }
242
+ write(text) {
243
+ this.region.staticLine(text);
244
+ }
245
+ frame = () => {
246
+ const running = this.cases.filter((c) => c.status === "running");
247
+ if (running.length === 0 && this.cases.length === 0)
248
+ return [];
249
+ const lines = [""];
250
+ for (const view of running) {
251
+ lines.push(this.runningLine(view));
252
+ lines.push(...this.liveTreeLines(view));
253
+ }
254
+ if (running.length > 0)
255
+ lines.push("");
256
+ lines.push(...this.summaryLines({ live: true }));
257
+ return lines;
258
+ };
259
+ // The running case's agent spend as it stands: the aggregate once the run
260
+ // reports one, else the turns summed so far — so the count ticks up live.
261
+ agentUsageOf(view) {
262
+ return isUsageEmpty(view.usage.agent) ? sumUsage(view.agentTurns) : view.usage.agent;
263
+ }
264
+ runningLine(view) {
265
+ const elapsed = this.now() - view.startedAt;
266
+ const tick = Math.floor((this.now() - this.startedAt) / 80);
267
+ const spinner = this.theme.cyan(spinnerFrame(tick));
268
+ const name = cell(view.caseId, this.nameWidth);
269
+ const duration = formatDuration(elapsed).padStart(DURATION_COL);
270
+ const agent = this.agentUsageOf(view);
271
+ const usage = isUsageEmpty(agent) ? "" : ` ${this.theme.dim(formatAlignedUsage(agent))}`;
272
+ return ` ${spinner} ${name} ${duration} ${this.theme.dim(this.activity(view))}${usage}`;
273
+ }
274
+ activity(view) {
275
+ if (view.phase === "grading") {
276
+ const done = view.assertions.length;
277
+ const current = view.currentAssertion ? ` · ${view.currentAssertion}` : "";
278
+ return `grading ${done}/${view.assertionTotal}${current}`;
279
+ }
280
+ if (view.phase === "agent") {
281
+ const bits = [
282
+ view.toolReportedCalls === view.toolCalls
283
+ ? `${view.toolCalls} tools`
284
+ : `${view.toolReportedCalls} reported tools · ${view.toolCalls} valid`,
285
+ ];
286
+ if (view.toolSucceeded > 0)
287
+ bits.push(`${view.toolSucceeded} ok`);
288
+ if (view.toolFailed > 0)
289
+ bits.push(`${view.toolFailed} failed`);
290
+ if (view.toolUnresolved > 0)
291
+ bits.push(`${view.toolUnresolved} unresolved`);
292
+ if (view.toolUnmatchedResults > 0) {
293
+ bits.push(`${view.toolUnmatchedResults} unmatched results`);
294
+ }
295
+ if (view.interrupts > 0)
296
+ bits.push(`${view.interrupts} asks`);
297
+ return `agent · ${bits.join(" · ")}`;
298
+ }
299
+ return view.phase;
300
+ }
301
+ finishedLine(view) {
302
+ const mark = statusMark(view.status, this.theme);
303
+ const name = cell(view.caseId, this.nameWidth);
304
+ const elapsed = view.endedAt === null ? 0 : view.endedAt - view.startedAt;
305
+ const duration = formatDuration(elapsed).padStart(DURATION_COL);
306
+ if (view.status === "errored") {
307
+ const reason = view.errorMessage ?? "failed before the run started";
308
+ return ` ${mark} ${name} ${duration} ${this.theme.red(inlineError(reason))}`;
309
+ }
310
+ const tally = assertionTally(view).padStart(TALLY_COL);
311
+ if (view.status === "incomplete") {
312
+ const reason = view.errorMessage ?? "did not finish";
313
+ return ` ${mark} ${name} ${duration} ${tally} ${this.theme.red(inlineError(reason))}`;
314
+ }
315
+ const agent = view.usage.agent;
316
+ const usage = isUsageEmpty(agent) ? "" : ` ${this.theme.dim(formatAlignedUsage(agent))}`;
317
+ return ` ${mark} ${name} ${duration} ${tally}${usage}`;
318
+ }
319
+ // A finished case expands into its assertions; a non-passing case also
320
+ // gets a `→ runDir` leaf, and `--verbose` adds timings and the run dir.
321
+ caseTreeLines(view) {
322
+ const nodes = this.contentNodes(view);
323
+ // The headline truncates a long crash message; surface it in full here.
324
+ if (view.errorMessage && view.errorMessage.length > INLINE_ERROR_MAX) {
325
+ nodes.push({ head: this.theme.red(view.errorMessage) });
326
+ }
327
+ if (this.verbose && view.phaseDurationMs) {
328
+ const p = view.phaseDurationMs;
329
+ const parts = [
330
+ `agent ${formatDuration(p.agent)}`,
331
+ `collect ${formatDuration(p.collect)}`,
332
+ `grading ${formatDuration(p.grading)}`,
333
+ ];
334
+ nodes.push({ head: this.theme.dim(parts.join(" · ")) });
335
+ }
336
+ const failed = view.status !== "passed" && view.status !== "ungraded";
337
+ if (view.runDir && (failed || this.verbose)) {
338
+ nodes.push({ head: this.theme.dim(`→ ${view.runDir}`) });
339
+ }
340
+ return this.renderTree(nodes);
341
+ }
342
+ // The assertions and turns as they stand — shared by the finished tree and
343
+ // the live one, so a case looks the same mid-flight as it does when it lands.
344
+ contentNodes(view) {
345
+ const nodes = [];
346
+ const width = Math.min(ASSERTION_NAME_MAX, Math.max(NAME_MIN, ...view.assertions.map((a) => a.name.length)));
347
+ for (const entry of view.assertions) {
348
+ const mark = entry.passed ? this.theme.green("✓") : this.theme.red("✗");
349
+ const duration = formatDuration(entry.durationMs).padStart(DURATION_COL);
350
+ const note = scoreNote(entry);
351
+ const suffix = note ? ` ${this.theme.red(note)}` : "";
352
+ nodes.push({
353
+ head: `${mark} ${cell(entry.name, width)} ${this.theme.dim(duration)}${suffix}`,
354
+ body: !entry.passed && entry.comment ? [this.theme.dim(entry.comment)] : [],
355
+ });
356
+ }
357
+ if (view.toolCalls > 0 || view.toolUnmatchedResults > 0 || view.toolMalformed > 0) {
358
+ const parts = [
359
+ ...(view.toolReportedCalls === view.toolCalls
360
+ ? [`${view.toolCalls} total`]
361
+ : [`${view.toolReportedCalls} reported`, `${view.toolCalls} valid`]),
362
+ this.theme.green(`${view.toolSucceeded} succeeded`),
363
+ ...(view.toolFailed > 0
364
+ ? [this.theme.red(`${view.toolFailed} failed`)]
365
+ : [`${view.toolFailed} failed`]),
366
+ `${view.toolUnresolved} unresolved`,
367
+ ];
368
+ if (view.toolUnmatchedResults > 0) {
369
+ parts.push(this.theme.red(`${view.toolUnmatchedResults} unmatched results`));
370
+ }
371
+ if (view.toolMalformed > 0) {
372
+ parts.push(this.theme.red(`${view.toolMalformed} malformed events`));
373
+ }
374
+ nodes.push({
375
+ head: `${this.theme.dim("tools")} ${parts.join(" · ")}`,
376
+ });
377
+ }
378
+ // The per-call split behind the headline's aggregate. One turn is just the
379
+ // aggregate restated, so the group only earns its space at two or more.
380
+ if (view.agentTurns.length >= 2) {
381
+ nodes.push({
382
+ head: this.theme.dim(`turns (${view.agentTurns.length})`),
383
+ children: view.agentTurns.map((turn, i) => {
384
+ const number = String(i + 1).padStart(String(view.agentTurns.length).length);
385
+ return {
386
+ head: `${this.theme.dim(number)} ${cell(turn.label ?? "", TURN_LABEL_WIDTH)} ${this.theme.dim(formatAlignedUsage(turn))}`,
387
+ };
388
+ }),
389
+ });
390
+ }
391
+ return nodes;
392
+ }
393
+ // The tree under a still-running case. Elide old assertions before they can
394
+ // crowd recent activity and the summary out of the live region.
395
+ liveTreeLines(view) {
396
+ const nodes = this.contentNodes(view);
397
+ const hasTurns = view.agentTurns.length >= 2;
398
+ const assertionNodes = hasTurns ? nodes.slice(0, -1) : nodes;
399
+ const trailing = hasTurns ? nodes.slice(-1) : [];
400
+ const MAX_ASSERTIONS = 8;
401
+ const shown = assertionNodes.length > MAX_ASSERTIONS
402
+ ? [
403
+ { head: this.theme.dim(`… ${assertionNodes.length - MAX_ASSERTIONS} earlier`) },
404
+ ...assertionNodes.slice(-MAX_ASSERTIONS),
405
+ ]
406
+ : assertionNodes;
407
+ return this.renderTree([...shown, ...trailing]);
408
+ }
409
+ renderTree(nodes, prefix = " ") {
410
+ const lines = [];
411
+ nodes.forEach((node, i) => {
412
+ const last = i === nodes.length - 1;
413
+ lines.push(`${prefix}${this.theme.dim(last ? "└─ " : "├─ ")}${node.head}`);
414
+ const childPrefix = `${prefix}${this.theme.dim(last ? " " : "│ ")}`;
415
+ for (const line of node.body ?? [])
416
+ lines.push(`${childPrefix}${line}`);
417
+ if (node.children?.length)
418
+ lines.push(...this.renderTree(node.children, childPrefix));
419
+ });
420
+ return lines;
421
+ }
422
+ summaryLines(opts = {}) {
423
+ const label = (text) => this.theme.dim(text.padEnd(LABEL_COL));
424
+ const lines = [];
425
+ const count = (status) => this.cases.filter((c) => c.status === status).length;
426
+ const queued = Math.max(0, this.total - this.cases.length);
427
+ if (this.total > 1 || opts.live) {
428
+ const tally = formatTally([
429
+ [count("passed"), this.theme.green("passed")],
430
+ [count("failed"), this.theme.red("failed")],
431
+ [count("incomplete"), this.theme.red("incomplete")],
432
+ [count("errored"), this.theme.red("errored")],
433
+ [count("ungraded"), "ungraded"],
434
+ [count("running"), this.theme.cyan("running")],
435
+ [queued, this.theme.dim("queued")],
436
+ ], this.total);
437
+ lines.push(` ${label("Cases")}${tally}`);
438
+ }
439
+ if (this.loop > 1) {
440
+ lines.push(` ${label("Loop")}${this.theme.dim(`${this.loop} runs per eval`)}`);
441
+ }
442
+ const assertions = this.cases.flatMap((c) => c.assertions);
443
+ if (assertions.length > 0) {
444
+ const ok = assertions.filter((a) => a.passed).length;
445
+ const bad = assertions.length - ok;
446
+ const tally = formatTally([
447
+ [ok, this.theme.green("passed")],
448
+ [bad, this.theme.red("failed")],
449
+ ], assertions.length);
450
+ lines.push(` ${label("Assertions")}${tally}`);
451
+ }
452
+ const done = this.cases.filter((c) => c.endedAt !== null);
453
+ const elapsed = this.now() - this.startedAt;
454
+ // An average over one case is just that case's duration, restated.
455
+ const average = done.length > 0
456
+ ? done.reduce((sum, c) => sum + ((c.endedAt ?? 0) - c.startedAt), 0) / done.length
457
+ : 0;
458
+ const avgText = this.total > 1 && done.length > 0
459
+ ? ` ${this.theme.dim(`avg ${formatDuration(average)}/case`)}`
460
+ : "";
461
+ lines.push(` ${label("Duration")}${formatDuration(elapsed)}${avgText}`);
462
+ lines.push(...this.usageLines(label, Boolean(opts.live)));
463
+ if (!opts.live && this.runsRoot) {
464
+ lines.push(` ${label("Runs")}${this.theme.dim(this.runsRoot)}`);
465
+ }
466
+ if (!opts.live && this.suiteDir) {
467
+ lines.push(` ${label("Suite")}${this.theme.dim(this.suiteDir)}`);
468
+ }
469
+ if (!opts.live)
470
+ lines.push(` ${label("Legend")}${this.legend()}`);
471
+ return lines;
472
+ }
473
+ legend() {
474
+ const dim = this.theme.dim;
475
+ const g = TURN_GLYPHS;
476
+ const entries = [
477
+ `${this.theme.green("✓")} ${dim("pass")}`,
478
+ `${this.theme.red("✗")} ${dim("fail")}`,
479
+ dim(`${g.thinking} thought`),
480
+ dim(`${g.tool} tool`),
481
+ dim(`${g.reply} reply`),
482
+ dim(`${g.ask} ask`),
483
+ dim("↑ input"),
484
+ dim("↓ output"),
485
+ dim("⚡ cache hit · ◇ cache write"),
486
+ ];
487
+ return entries.join(dim(" · "));
488
+ }
489
+ usageLines(label, live) {
490
+ const total = this.cases.reduce((acc, c) => ({
491
+ agent: addUsage(acc.agent, this.agentUsageOf(c)),
492
+ answerer: addUsage(acc.answerer, c.usage.answerer),
493
+ grading: addUsage(acc.grading, c.usage.grading),
494
+ }), emptyRunUsage());
495
+ const harness = harnessUsage(total);
496
+ if (isUsageEmpty(total.agent) && isUsageEmpty(harness)) {
497
+ return live ? [] : [` ${label("Tokens")}${this.theme.dim("none reported")}`];
498
+ }
499
+ const agentText = isUsageEmpty(total.agent) ? this.theme.dim("none") : formatUsage(total.agent);
500
+ if (live) {
501
+ const harnessText = isUsageEmpty(harness)
502
+ ? ""
503
+ : ` harness ${formatTokens(totalTokens(harness))}`;
504
+ return [` ${label("Tokens")}agent ${agentText}${this.theme.dim(harnessText)}`];
505
+ }
506
+ const lines = [` ${label("Tokens")}agent ${agentText}`];
507
+ if (!isUsageEmpty(harness)) {
508
+ const split = [
509
+ `answerer ${formatTokens(totalTokens(total.answerer))}`,
510
+ `judge ${formatTokens(totalTokens(total.grading))}`,
511
+ ].join(", ");
512
+ lines.push(` ${label("")}${this.theme.dim(`harness ${formatUsage(harness)} (${split})`)}`);
513
+ }
514
+ return lines;
515
+ }
516
+ }
517
+ // Internal exports for testing
518
+ export { cell, scoreNote };
519
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/cli/render/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,4BAA4B,EAC5B,aAAa,EAEb,YAAY,EACZ,YA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AAI,EAAE,CAAC;YACT,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC;gBACvC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,cAAc,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YACvD,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,SAAS,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG;gBACZ,YAAY,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE;gBACvD,SAAS,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE;aACpD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACb,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,WAAW,CAAC,OAAO,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,+BAA+B;AAC/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,77 @@
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
+ export declare const stripAnsi: (text: string) => string;
7
+ export declare const visibleWidth: (text: string) => number;
8
+ /**
9
+ * Cut `text` to `maxWidth` visible cells, counting styling as zero-width.
10
+ * A line wider than the terminal would wrap, and a wrapped line breaks the
11
+ * cursor arithmetic the live region depends on — so every painted row goes
12
+ * through here.
13
+ */
14
+ export declare const truncate: (text: string, maxWidth: number) => string;
15
+ export type Theme = {
16
+ bold: (s: string) => string;
17
+ dim: (s: string) => string;
18
+ green: (s: string) => string;
19
+ red: (s: string) => string;
20
+ yellow: (s: string) => string;
21
+ cyan: (s: string) => string;
22
+ inverse: (s: string) => string;
23
+ };
24
+ export declare const makeTheme: (color: boolean) => Theme;
25
+ /**
26
+ * Honour the two conventions users actually rely on: `NO_COLOR` to force
27
+ * plain output anywhere, `FORCE_COLOR` to keep colour through a pipe (CI
28
+ * log viewers that render ANSI).
29
+ */
30
+ export declare const shouldColor: (stream: NodeJS.WriteStream, env: NodeJS.ProcessEnv) => boolean;
31
+ export declare const spinnerFrame: (tick: number) => string;
32
+ export type LiveRegionOptions = {
33
+ stdout?: NodeJS.WriteStream | undefined;
34
+ /** Force live painting on/off. Defaults to `stdout.isTTY`. */
35
+ live?: boolean | undefined;
36
+ frameIntervalMs?: number | undefined;
37
+ };
38
+ /**
39
+ * A block of lines pinned to the bottom of the terminal, repainted on a
40
+ * timer so elapsed clocks tick. Anything else that writes to the terminal
41
+ * while it is active is intercepted, printed *above* the block, and the
42
+ * block repainted underneath — otherwise a stray write lands mid-frame and
43
+ * every subsequent cursor-up is off by one. Off a TTY the whole mechanism
44
+ * collapses to plain `staticLine` writes.
45
+ */
46
+ export declare class LiveRegion {
47
+ private readonly stdout;
48
+ private readonly writeRaw;
49
+ private readonly frameIntervalMs;
50
+ readonly live: boolean;
51
+ private renderFrame;
52
+ private paintedRows;
53
+ private timer;
54
+ private patched;
55
+ private held;
56
+ private started;
57
+ constructor(options?: LiveRegionOptions);
58
+ start(renderFrame: () => string[]): void;
59
+ /**
60
+ * Print a permanent line above the live block. Before `start()` and after
61
+ * `stop()` there is no block to move, so the line goes straight out — which
62
+ * is also exactly the non-TTY behaviour.
63
+ */
64
+ staticLine(text: string): void;
65
+ repaint(): void;
66
+ stop(): void;
67
+ private readonly onExit;
68
+ private clear;
69
+ private paint;
70
+ /**
71
+ * Buffer a foreign stream to whole lines before letting it through: a
72
+ * half-written line cannot be painted over cleanly, and the subprocess
73
+ * driver relays agent stderr in arbitrary chunks.
74
+ */
75
+ private intercept;
76
+ }
77
+ //# sourceMappingURL=tty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../../src/cli/render/tty.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MAAwC,CAAC;AAmClF,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,MAI3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,SAAU,MAAM,YAAY,MAAM,KAAG,MAgCzD,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5B,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5B,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAChC,CAAC;AASF,eAAO,MAAM,SAAS,UAAW,OAAO,KAAG,KAmBpC,CAAC;AAER;;;;GAIG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,CAAC,WAAW,OAAO,MAAM,CAAC,UAAU,KAAG,OAIhF,CAAC;AAIF,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,MACS,CAAC;AAQtD,MAAM,MAAM,iBAAiB,GA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