@prismatic-io/lux 0.0.2-preview.14 → 0.0.2-preview.16

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 (388) hide show
  1. package/lib/answerers/claude-code/index.d.ts +14 -2
  2. package/lib/answerers/claude-code/index.d.ts.map +1 -1
  3. package/lib/answerers/claude-code/index.js +3 -3
  4. package/lib/answerers/claude-code/index.js.map +1 -1
  5. package/lib/answerers/persona/index.d.ts +28 -2
  6. package/lib/answerers/persona/index.d.ts.map +1 -1
  7. package/lib/answerers/persona/index.js +3 -3
  8. package/lib/answerers/persona/index.js.map +1 -1
  9. package/lib/answerers/terminal/index.d.ts +8 -2
  10. package/lib/answerers/terminal/index.d.ts.map +1 -1
  11. package/lib/answerers/terminal/index.js +3 -2
  12. package/lib/answerers/terminal/index.js.map +1 -1
  13. package/lib/assertions/core/resource-checks.d.ts.map +1 -1
  14. package/lib/assertions/core/resource-checks.js +3 -5
  15. package/lib/assertions/core/resource-checks.js.map +1 -1
  16. package/lib/assertions/rubric/index.d.ts.map +1 -1
  17. package/lib/assertions/rubric/index.js +7 -1
  18. package/lib/assertions/rubric/index.js.map +1 -1
  19. package/lib/assertions/rubric/internal.d.ts +16 -5
  20. package/lib/assertions/rubric/internal.d.ts.map +1 -1
  21. package/lib/assertions/rubric/internal.js +10 -6
  22. package/lib/assertions/rubric/internal.js.map +1 -1
  23. package/lib/authoring.d.ts +32 -2
  24. package/lib/authoring.d.ts.map +1 -1
  25. package/lib/authoring.js +33 -1
  26. package/lib/authoring.js.map +1 -1
  27. package/lib/cli/bin.js +2 -13
  28. package/lib/cli/bin.js.map +1 -1
  29. package/lib/cli/command-runtime.d.ts +3 -3
  30. package/lib/cli/command-runtime.d.ts.map +1 -1
  31. package/lib/cli/command-runtime.js +17 -6
  32. package/lib/cli/command-runtime.js.map +1 -1
  33. package/lib/cli/init-templates.d.ts +11 -0
  34. package/lib/cli/init-templates.d.ts.map +1 -0
  35. package/lib/cli/init-templates.js +207 -0
  36. package/lib/cli/init-templates.js.map +1 -0
  37. package/lib/cli/init.d.ts +7 -0
  38. package/lib/cli/init.d.ts.map +1 -1
  39. package/lib/cli/init.js +23 -173
  40. package/lib/cli/init.js.map +1 -1
  41. package/lib/cli/output-schemas.d.ts +1399 -0
  42. package/lib/cli/output-schemas.d.ts.map +1 -0
  43. package/lib/cli/output-schemas.js +91 -0
  44. package/lib/cli/output-schemas.js.map +1 -0
  45. package/lib/cli/program.d.ts +135 -4
  46. package/lib/cli/program.d.ts.map +1 -1
  47. package/lib/cli/program.js +725 -520
  48. package/lib/cli/program.js.map +1 -1
  49. package/lib/cli/render/reporter.d.ts.map +1 -1
  50. package/lib/cli/render/reporter.js +24 -4
  51. package/lib/cli/render/reporter.js.map +1 -1
  52. package/lib/cli/run-options.d.ts +0 -4
  53. package/lib/cli/run-options.d.ts.map +1 -1
  54. package/lib/cli/run-options.js +8 -19
  55. package/lib/cli/run-options.js.map +1 -1
  56. package/lib/cli/view.d.ts +5 -3
  57. package/lib/cli/view.d.ts.map +1 -1
  58. package/lib/cli/view.js +120 -78
  59. package/lib/cli/view.js.map +1 -1
  60. package/lib/core/annotation.d.ts +6 -2
  61. package/lib/core/annotation.d.ts.map +1 -1
  62. package/lib/core/annotation.js +2 -1
  63. package/lib/core/annotation.js.map +1 -1
  64. package/lib/core/answerer.d.ts +12 -0
  65. package/lib/core/answerer.d.ts.map +1 -1
  66. package/lib/core/answerer.js +2 -0
  67. package/lib/core/answerer.js.map +1 -1
  68. package/lib/core/assertion.d.ts +3 -0
  69. package/lib/core/assertion.d.ts.map +1 -1
  70. package/lib/core/assertion.js +3 -0
  71. package/lib/core/assertion.js.map +1 -1
  72. package/lib/core/case.d.ts +24 -2
  73. package/lib/core/case.d.ts.map +1 -1
  74. package/lib/core/case.js +5 -1
  75. package/lib/core/case.js.map +1 -1
  76. package/lib/core/driver.d.ts +40 -0
  77. package/lib/core/driver.d.ts.map +1 -1
  78. package/lib/core/driver.js +12 -0
  79. package/lib/core/driver.js.map +1 -1
  80. package/lib/core/environment.d.ts +18 -0
  81. package/lib/core/environment.d.ts.map +1 -0
  82. package/lib/core/environment.js +21 -0
  83. package/lib/core/environment.js.map +1 -0
  84. package/lib/core/evaluation-clusters.d.ts +17 -0
  85. package/lib/core/evaluation-clusters.d.ts.map +1 -0
  86. package/lib/core/evaluation-clusters.js +23 -0
  87. package/lib/core/evaluation-clusters.js.map +1 -0
  88. package/lib/core/experiment.d.ts +11 -0
  89. package/lib/core/experiment.d.ts.map +1 -1
  90. package/lib/core/experiment.js +31 -17
  91. package/lib/core/experiment.js.map +1 -1
  92. package/lib/core/file-tree.d.ts +7 -0
  93. package/lib/core/file-tree.d.ts.map +1 -0
  94. package/lib/core/file-tree.js +35 -0
  95. package/lib/core/file-tree.js.map +1 -0
  96. package/lib/core/index.d.ts +1 -0
  97. package/lib/core/index.d.ts.map +1 -1
  98. package/lib/core/index.js +1 -0
  99. package/lib/core/index.js.map +1 -1
  100. package/lib/core/lifecycle-fixtures.d.ts.map +1 -1
  101. package/lib/core/lifecycle-fixtures.js +4 -2
  102. package/lib/core/lifecycle-fixtures.js.map +1 -1
  103. package/lib/core/platform-process.d.ts +5 -1
  104. package/lib/core/platform-process.d.ts.map +1 -1
  105. package/lib/core/platform-process.js +48 -10
  106. package/lib/core/platform-process.js.map +1 -1
  107. package/lib/core/run.d.ts +93 -1
  108. package/lib/core/run.d.ts.map +1 -1
  109. package/lib/core/run.js +16 -0
  110. package/lib/core/run.js.map +1 -1
  111. package/lib/core/usage.d.ts +5 -0
  112. package/lib/core/usage.d.ts.map +1 -1
  113. package/lib/core/usage.js +3 -0
  114. package/lib/core/usage.js.map +1 -1
  115. package/lib/drivers/claude-code/index.d.ts +65 -2
  116. package/lib/drivers/claude-code/index.d.ts.map +1 -1
  117. package/lib/drivers/claude-code/index.js +30 -3
  118. package/lib/drivers/claude-code/index.js.map +1 -1
  119. package/lib/drivers/codex/app-events.d.ts.map +1 -1
  120. package/lib/drivers/codex/app-events.js +41 -30
  121. package/lib/drivers/codex/app-events.js.map +1 -1
  122. package/lib/drivers/codex/exec-events.d.ts +4 -0
  123. package/lib/drivers/codex/exec-events.d.ts.map +1 -0
  124. package/lib/drivers/codex/exec-events.js +230 -0
  125. package/lib/drivers/codex/exec-events.js.map +1 -0
  126. package/lib/drivers/codex/index.d.ts +76 -4
  127. package/lib/drivers/codex/index.d.ts.map +1 -1
  128. package/lib/drivers/codex/index.js +35 -232
  129. package/lib/drivers/codex/index.js.map +1 -1
  130. package/lib/drivers/cursor/acp-transport.d.ts +38 -0
  131. package/lib/drivers/cursor/acp-transport.d.ts.map +1 -0
  132. package/lib/drivers/cursor/acp-transport.js +152 -0
  133. package/lib/drivers/cursor/acp-transport.js.map +1 -0
  134. package/lib/drivers/cursor/config.d.ts +22 -0
  135. package/lib/drivers/cursor/config.d.ts.map +1 -0
  136. package/lib/drivers/cursor/config.js +26 -0
  137. package/lib/drivers/cursor/config.js.map +1 -0
  138. package/lib/drivers/cursor/events.d.ts +13 -0
  139. package/lib/drivers/cursor/events.d.ts.map +1 -0
  140. package/lib/drivers/cursor/events.js +73 -0
  141. package/lib/drivers/cursor/events.js.map +1 -0
  142. package/lib/drivers/cursor/index.d.ts +37 -0
  143. package/lib/drivers/cursor/index.d.ts.map +1 -0
  144. package/lib/drivers/cursor/index.js +276 -0
  145. package/lib/drivers/cursor/index.js.map +1 -0
  146. package/lib/drivers/cursor/interaction.d.ts +7 -0
  147. package/lib/drivers/cursor/interaction.d.ts.map +1 -0
  148. package/lib/drivers/cursor/interaction.js +66 -0
  149. package/lib/drivers/cursor/interaction.js.map +1 -0
  150. package/lib/drivers/mcp/index.d.ts +35 -2
  151. package/lib/drivers/mcp/index.d.ts.map +1 -1
  152. package/lib/drivers/mcp/index.js +16 -3
  153. package/lib/drivers/mcp/index.js.map +1 -1
  154. package/lib/drivers/shared/experiment-behavior.d.ts +13 -0
  155. package/lib/drivers/shared/experiment-behavior.d.ts.map +1 -0
  156. package/lib/drivers/shared/experiment-behavior.js +197 -0
  157. package/lib/drivers/shared/experiment-behavior.js.map +1 -0
  158. package/lib/drivers/shared/experiment-policy.d.ts +4 -0
  159. package/lib/drivers/shared/experiment-policy.d.ts.map +1 -0
  160. package/lib/drivers/shared/experiment-policy.js +143 -0
  161. package/lib/drivers/shared/experiment-policy.js.map +1 -0
  162. package/lib/drivers/subprocess/index.d.ts +37 -2
  163. package/lib/drivers/subprocess/index.d.ts.map +1 -1
  164. package/lib/drivers/subprocess/index.js +46 -6
  165. package/lib/drivers/subprocess/index.js.map +1 -1
  166. package/lib/index.d.ts +6 -5
  167. package/lib/index.d.ts.map +1 -1
  168. package/lib/index.js +4 -3
  169. package/lib/index.js.map +1 -1
  170. package/lib/orchestrator/annotation-loader.d.ts +6 -2
  171. package/lib/orchestrator/annotation-loader.d.ts.map +1 -1
  172. package/lib/orchestrator/annotation-loader.js +8 -0
  173. package/lib/orchestrator/annotation-loader.js.map +1 -1
  174. package/lib/orchestrator/annotation-store.d.ts.map +1 -1
  175. package/lib/orchestrator/annotation-store.js +16 -2
  176. package/lib/orchestrator/annotation-store.js.map +1 -1
  177. package/lib/orchestrator/campaign-lifecycle.d.ts +1 -0
  178. package/lib/orchestrator/campaign-lifecycle.d.ts.map +1 -1
  179. package/lib/orchestrator/campaign-lifecycle.js +4 -1
  180. package/lib/orchestrator/campaign-lifecycle.js.map +1 -1
  181. package/lib/orchestrator/compare.d.ts +4 -0
  182. package/lib/orchestrator/compare.d.ts.map +1 -1
  183. package/lib/orchestrator/compare.js +13 -1
  184. package/lib/orchestrator/compare.js.map +1 -1
  185. package/lib/orchestrator/comparison-identity.d.ts.map +1 -1
  186. package/lib/orchestrator/comparison-identity.js +1 -0
  187. package/lib/orchestrator/comparison-identity.js.map +1 -1
  188. package/lib/orchestrator/config.d.ts +42 -0
  189. package/lib/orchestrator/config.d.ts.map +1 -1
  190. package/lib/orchestrator/config.js +6 -2
  191. package/lib/orchestrator/config.js.map +1 -1
  192. package/lib/orchestrator/discover.d.ts +1 -0
  193. package/lib/orchestrator/discover.d.ts.map +1 -1
  194. package/lib/orchestrator/discover.js +7 -1
  195. package/lib/orchestrator/discover.js.map +1 -1
  196. package/lib/orchestrator/doctor.d.ts.map +1 -1
  197. package/lib/orchestrator/doctor.js +34 -26
  198. package/lib/orchestrator/doctor.js.map +1 -1
  199. package/lib/orchestrator/driver-capabilities.d.ts +3 -0
  200. package/lib/orchestrator/driver-capabilities.d.ts.map +1 -0
  201. package/lib/orchestrator/driver-capabilities.js +10 -0
  202. package/lib/orchestrator/driver-capabilities.js.map +1 -0
  203. package/lib/orchestrator/driver-identity.d.ts +5 -0
  204. package/lib/orchestrator/driver-identity.d.ts.map +1 -0
  205. package/lib/orchestrator/driver-identity.js +41 -0
  206. package/lib/orchestrator/driver-identity.js.map +1 -0
  207. package/lib/orchestrator/experiment-context.d.ts +10 -0
  208. package/lib/orchestrator/experiment-context.d.ts.map +1 -1
  209. package/lib/orchestrator/experiment-contracts.d.ts +10 -0
  210. package/lib/orchestrator/experiment-contracts.d.ts.map +1 -1
  211. package/lib/orchestrator/experiment-corpus.d.ts.map +1 -1
  212. package/lib/orchestrator/experiment-corpus.js +17 -19
  213. package/lib/orchestrator/experiment-corpus.js.map +1 -1
  214. package/lib/orchestrator/experiment-effects.d.ts +33 -0
  215. package/lib/orchestrator/experiment-effects.d.ts.map +1 -0
  216. package/lib/orchestrator/experiment-effects.js +44 -0
  217. package/lib/orchestrator/experiment-effects.js.map +1 -0
  218. package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -1
  219. package/lib/orchestrator/experiment-evaluation.js +36 -3
  220. package/lib/orchestrator/experiment-evaluation.js.map +1 -1
  221. package/lib/orchestrator/experiment-identity.d.ts.map +1 -1
  222. package/lib/orchestrator/experiment-identity.js +18 -29
  223. package/lib/orchestrator/experiment-identity.js.map +1 -1
  224. package/lib/orchestrator/experiment-loader.d.ts +7 -2
  225. package/lib/orchestrator/experiment-loader.d.ts.map +1 -1
  226. package/lib/orchestrator/experiment-report.d.ts +70 -0
  227. package/lib/orchestrator/experiment-report.d.ts.map +1 -1
  228. package/lib/orchestrator/experiment-report.js +9 -1
  229. package/lib/orchestrator/experiment-report.js.map +1 -1
  230. package/lib/orchestrator/experiment-runs.d.ts +22 -1
  231. package/lib/orchestrator/experiment-runs.d.ts.map +1 -1
  232. package/lib/orchestrator/experiment-runs.js +13 -5
  233. package/lib/orchestrator/experiment-runs.js.map +1 -1
  234. package/lib/orchestrator/experiment-runtime-identity.d.ts +0 -16
  235. package/lib/orchestrator/experiment-runtime-identity.d.ts.map +1 -1
  236. package/lib/orchestrator/experiment-runtime-identity.js +5 -220
  237. package/lib/orchestrator/experiment-runtime-identity.js.map +1 -1
  238. package/lib/orchestrator/experiment-selection.d.ts.map +1 -1
  239. package/lib/orchestrator/experiment-selection.js +52 -0
  240. package/lib/orchestrator/experiment-selection.js.map +1 -1
  241. package/lib/orchestrator/experiment.d.ts +0 -2
  242. package/lib/orchestrator/experiment.d.ts.map +1 -1
  243. package/lib/orchestrator/experiment.js +23 -15
  244. package/lib/orchestrator/experiment.js.map +1 -1
  245. package/lib/orchestrator/fs-read.d.ts +1 -6
  246. package/lib/orchestrator/fs-read.d.ts.map +1 -1
  247. package/lib/orchestrator/fs-read.js +2 -32
  248. package/lib/orchestrator/fs-read.js.map +1 -1
  249. package/lib/orchestrator/grader-experiment.d.ts +17 -1
  250. package/lib/orchestrator/grader-experiment.d.ts.map +1 -1
  251. package/lib/orchestrator/grader-experiment.js +52 -7
  252. package/lib/orchestrator/grader-experiment.js.map +1 -1
  253. package/lib/orchestrator/grading.d.ts.map +1 -1
  254. package/lib/orchestrator/grading.js +13 -6
  255. package/lib/orchestrator/grading.js.map +1 -1
  256. package/lib/orchestrator/list-runs.d.ts +1 -0
  257. package/lib/orchestrator/list-runs.d.ts.map +1 -1
  258. package/lib/orchestrator/list-runs.js +27 -6
  259. package/lib/orchestrator/list-runs.js.map +1 -1
  260. package/lib/orchestrator/optimization-lifecycle.d.ts.map +1 -1
  261. package/lib/orchestrator/optimization-lifecycle.js +3 -1
  262. package/lib/orchestrator/optimization-lifecycle.js.map +1 -1
  263. package/lib/orchestrator/orchestrator.d.ts +6 -1
  264. package/lib/orchestrator/orchestrator.d.ts.map +1 -1
  265. package/lib/orchestrator/orchestrator.js +17 -143
  266. package/lib/orchestrator/orchestrator.js.map +1 -1
  267. package/lib/orchestrator/paired-effects.d.ts +34 -0
  268. package/lib/orchestrator/paired-effects.d.ts.map +1 -0
  269. package/lib/orchestrator/paired-effects.js +158 -0
  270. package/lib/orchestrator/paired-effects.js.map +1 -0
  271. package/lib/orchestrator/provenance.d.ts +5 -1
  272. package/lib/orchestrator/provenance.d.ts.map +1 -1
  273. package/lib/orchestrator/provenance.js +16 -3
  274. package/lib/orchestrator/provenance.js.map +1 -1
  275. package/lib/orchestrator/regrade.d.ts +1 -0
  276. package/lib/orchestrator/regrade.d.ts.map +1 -1
  277. package/lib/orchestrator/run-execution.d.ts +2 -0
  278. package/lib/orchestrator/run-execution.d.ts.map +1 -1
  279. package/lib/orchestrator/run-execution.js +18 -3
  280. package/lib/orchestrator/run-execution.js.map +1 -1
  281. package/lib/orchestrator/run-lifecycle.d.ts +1 -0
  282. package/lib/orchestrator/run-lifecycle.d.ts.map +1 -1
  283. package/lib/orchestrator/run-lifecycle.js +3 -2
  284. package/lib/orchestrator/run-lifecycle.js.map +1 -1
  285. package/lib/orchestrator/suite-runs.d.ts +3 -1
  286. package/lib/orchestrator/suite-runs.d.ts.map +1 -1
  287. package/lib/orchestrator/suite-runs.js +12 -2
  288. package/lib/orchestrator/suite-runs.js.map +1 -1
  289. package/lib/orchestrator/suite-summary.d.ts.map +1 -1
  290. package/lib/orchestrator/suite-summary.js +2 -1
  291. package/lib/orchestrator/suite-summary.js.map +1 -1
  292. package/lib/previewer/server.d.ts +6 -0
  293. package/lib/previewer/server.d.ts.map +1 -1
  294. package/lib/previewer/server.js +21 -5
  295. package/lib/previewer/server.js.map +1 -1
  296. package/package.json +2 -2
  297. package/skills/lux/references/cli.md +5 -2
  298. package/skills/lux/references/eval-authoring.md +0 -7
  299. package/skills/lux-answerer/SKILL.md +1 -1
  300. package/src/answerers/claude-code/index.ts +3 -3
  301. package/src/answerers/persona/index.ts +3 -3
  302. package/src/answerers/terminal/index.ts +4 -9
  303. package/src/assertions/core/resource-checks.ts +3 -5
  304. package/src/assertions/rubric/index.ts +7 -1
  305. package/src/assertions/rubric/internal.ts +13 -8
  306. package/src/authoring.ts +331 -2
  307. package/src/cli/bin.ts +2 -12
  308. package/src/cli/command-runtime.ts +20 -9
  309. package/src/cli/init-templates.ts +223 -0
  310. package/src/cli/init.ts +38 -184
  311. package/src/cli/output-schemas.ts +106 -0
  312. package/src/cli/program.ts +621 -548
  313. package/src/cli/render/reporter.ts +25 -4
  314. package/src/cli/run-options.ts +8 -25
  315. package/src/cli/view.ts +45 -84
  316. package/src/core/annotation.ts +2 -1
  317. package/src/core/answerer.ts +9 -0
  318. package/src/core/assertion.ts +3 -0
  319. package/src/core/case.ts +5 -1
  320. package/src/core/driver.ts +38 -0
  321. package/src/core/environment.ts +22 -0
  322. package/src/core/evaluation-clusters.ts +35 -0
  323. package/src/core/experiment.ts +60 -23
  324. package/src/core/file-tree.ts +35 -0
  325. package/src/core/index.ts +1 -0
  326. package/src/core/lifecycle-fixtures.ts +4 -2
  327. package/src/core/platform-process.ts +54 -6
  328. package/src/core/run.ts +20 -0
  329. package/src/core/usage.ts +8 -0
  330. package/src/drivers/claude-code/index.ts +34 -3
  331. package/src/drivers/codex/app-events.ts +43 -33
  332. package/src/drivers/codex/exec-events.ts +258 -0
  333. package/src/drivers/codex/index.ts +37 -262
  334. package/src/drivers/cursor/README.md +57 -0
  335. package/src/drivers/cursor/acp-transport.ts +182 -0
  336. package/src/drivers/cursor/config.ts +29 -0
  337. package/src/drivers/cursor/events.ts +83 -0
  338. package/src/drivers/cursor/index.ts +316 -0
  339. package/src/drivers/cursor/interaction.ts +90 -0
  340. package/src/drivers/mcp/index.ts +16 -3
  341. package/src/drivers/shared/experiment-behavior.ts +214 -0
  342. package/src/drivers/shared/experiment-policy.ts +195 -0
  343. package/src/drivers/subprocess/index.ts +45 -6
  344. package/src/index.ts +16 -5
  345. package/src/orchestrator/annotation-loader.ts +10 -0
  346. package/src/orchestrator/annotation-store.ts +24 -3
  347. package/src/orchestrator/campaign-lifecycle.ts +5 -1
  348. package/src/orchestrator/compare.ts +16 -1
  349. package/src/orchestrator/comparison-identity.ts +1 -0
  350. package/src/orchestrator/config.ts +6 -2
  351. package/src/orchestrator/discover.ts +8 -1
  352. package/src/orchestrator/doctor.ts +40 -22
  353. package/src/orchestrator/driver-capabilities.ts +16 -0
  354. package/src/orchestrator/driver-identity.ts +59 -0
  355. package/src/orchestrator/experiment-corpus.ts +23 -28
  356. package/src/orchestrator/experiment-effects.ts +61 -0
  357. package/src/orchestrator/experiment-evaluation.ts +45 -5
  358. package/src/orchestrator/experiment-identity.ts +27 -36
  359. package/src/orchestrator/experiment-report.ts +21 -1
  360. package/src/orchestrator/experiment-runs.ts +11 -4
  361. package/src/orchestrator/experiment-runtime-identity.ts +5 -243
  362. package/src/orchestrator/experiment-selection.ts +77 -0
  363. package/src/orchestrator/experiment.ts +26 -24
  364. package/src/orchestrator/fs-read.ts +2 -32
  365. package/src/orchestrator/grader-experiment.ts +72 -8
  366. package/src/orchestrator/grading.ts +15 -6
  367. package/src/orchestrator/list-runs.ts +29 -6
  368. package/src/orchestrator/optimization-lifecycle.ts +4 -1
  369. package/src/orchestrator/orchestrator.ts +26 -183
  370. package/src/orchestrator/paired-effects.ts +209 -0
  371. package/src/orchestrator/provenance.ts +23 -3
  372. package/src/orchestrator/run-execution.ts +18 -3
  373. package/src/orchestrator/run-lifecycle.ts +4 -2
  374. package/src/orchestrator/suite-runs.ts +10 -1
  375. package/src/orchestrator/suite-summary.ts +2 -1
  376. package/src/previewer/server.ts +27 -5
  377. package/viewer/app.js +27 -6
  378. package/viewer/detail.js +22 -5
  379. package/lib/answerers/scripted/index.d.ts +0 -18
  380. package/lib/answerers/scripted/index.d.ts.map +0 -1
  381. package/lib/answerers/scripted/index.js +0 -63
  382. package/lib/answerers/scripted/index.js.map +0 -1
  383. package/lib/cli/skills.d.ts +0 -38
  384. package/lib/cli/skills.d.ts.map +0 -1
  385. package/lib/cli/skills.js +0 -84
  386. package/lib/cli/skills.js.map +0 -1
  387. package/src/answerers/scripted/index.ts +0 -78
  388. package/src/cli/skills.ts +0 -129
@@ -0,0 +1,83 @@
1
+ import { type Progress, toolResultProgress } from "../../core/index.js";
2
+ import { asRecord, type RpcRecord } from "./acp-transport.js";
3
+ import { records } from "./interaction.js";
4
+
5
+ type ToolState = { value: RpcRecord; bytes: number; name: string };
6
+
7
+ export class CursorEvents {
8
+ private seq = 0;
9
+ private retainedBytes = 0;
10
+ private readonly tools = new Map<string, ToolState>();
11
+ private readonly completed = new Set<string>();
12
+
13
+ private readonly maxToolCalls: number;
14
+ private readonly maxBytes: number;
15
+
16
+ constructor(maxToolCalls: number, maxBytes: number) {
17
+ this.maxToolCalls = maxToolCalls;
18
+ this.maxBytes = maxBytes;
19
+ }
20
+
21
+ update(update: RpcRecord): Progress[] {
22
+ const ts = Date.now();
23
+ if (
24
+ update.sessionUpdate === "agent_message_chunk" ||
25
+ update.sessionUpdate === "agent_thought_chunk"
26
+ ) {
27
+ const content = asRecord(update.content);
28
+ if (content?.type !== "text" || typeof content.text !== "string") return [];
29
+ return [
30
+ {
31
+ id: `cursor-message-${++this.seq}`,
32
+ kind: update.sessionUpdate === "agent_message_chunk" ? "agent-message" : "reasoning",
33
+ payload: { text: content.text },
34
+ ts,
35
+ },
36
+ ];
37
+ }
38
+ if (update.sessionUpdate !== "tool_call" && update.sessionUpdate !== "tool_call_update") {
39
+ return [{ id: `cursor-update-${++this.seq}`, kind: "cursor-update", payload: update, ts }];
40
+ }
41
+ const id = update.toolCallId;
42
+ if (typeof id !== "string") throw new Error("Cursor ACP tool update omitted toolCallId");
43
+ if (this.completed.has(id)) return [];
44
+ const old = this.tools.get(id);
45
+ if (!old && this.tools.size + this.completed.size >= this.maxToolCalls)
46
+ throw new Error("Cursor ACP exceeded maxToolCalls");
47
+ const value = { ...old?.value, ...update };
48
+ const bytes = Buffer.byteLength(JSON.stringify(value));
49
+ this.retainedBytes += bytes - (old?.bytes ?? 0);
50
+ if (this.retainedBytes > this.maxBytes)
51
+ throw new Error("Cursor ACP tool state exceeded maxQueuedBytes");
52
+ const name = old?.name ?? String(value.title ?? value.kind ?? "cursor-tool");
53
+ this.tools.set(id, { value, bytes, name });
54
+ const events: Progress[] = old
55
+ ? []
56
+ : [
57
+ {
58
+ id: `tc-${id}`,
59
+ kind: "tool-call",
60
+ payload: { name, input: value.rawInput ?? {}, toolUseId: id },
61
+ ts,
62
+ },
63
+ ];
64
+ if (value.status === "completed" || value.status === "failed") {
65
+ const content = value.rawOutput ?? value.content ?? [];
66
+ const text = records(value.content)
67
+ .map((block) => asRecord(block.content)?.text)
68
+ .filter((entry) => typeof entry === "string")
69
+ .join("\n");
70
+ events.push(
71
+ toolResultProgress(
72
+ ++this.seq,
73
+ { name, toolUseId: id, content, isError: value.status === "failed", text },
74
+ ts,
75
+ ),
76
+ );
77
+ this.retainedBytes -= bytes;
78
+ this.tools.delete(id);
79
+ this.completed.add(id);
80
+ }
81
+ return events;
82
+ }
83
+ }
@@ -0,0 +1,316 @@
1
+ import { realpath } from "node:fs/promises";
2
+ import {
3
+ type AgentDriver,
4
+ type Answer,
5
+ type Artifact,
6
+ type DriverEventMap,
7
+ defineDriver,
8
+ discoverCliVersion,
9
+ type ReadyState,
10
+ type StartContext,
11
+ TypedEmitter,
12
+ } from "../../core/index.js";
13
+ import { walkArtifacts } from "../shared/artifacts.js";
14
+ import { AcpTransport, asRecord, type RpcId, type RpcRecord } from "./acp-transport.js";
15
+ import { buildCursorArgs, type CursorDriverConfig, CursorDriverConfigSchema } from "./config.js";
16
+ import { CursorEvents } from "./events.js";
17
+ import { cursorAnswer, cursorQuestionText, effortSelector, records } from "./interaction.js";
18
+
19
+ class CursorDriver implements AgentDriver {
20
+ private readonly emitter = new TypedEmitter<DriverEventMap>();
21
+ private readonly events: CursorEvents;
22
+ private transport: AcpTransport | undefined;
23
+ private sessionId: string | undefined;
24
+ private cwd: string | undefined;
25
+ private artifactsDir: string | undefined;
26
+ private ready = false;
27
+ private runPromise: Promise<void> | undefined;
28
+ private terminal = false;
29
+ private idleTimer: NodeJS.Timeout | undefined;
30
+ private interruptCount = 0;
31
+ private readonly interrupts = new Map<string, { id: RpcId; method: string; params: RpcRecord }>();
32
+
33
+ private readonly config: CursorDriverConfig;
34
+
35
+ constructor(config: CursorDriverConfig) {
36
+ this.config = config;
37
+ this.events = new CursorEvents(config.maxToolCalls, config.maxQueuedBytes);
38
+ }
39
+
40
+ on<K extends keyof DriverEventMap>(
41
+ event: K,
42
+ handler: (e: DriverEventMap[K]) => void | Promise<void>,
43
+ ): void {
44
+ this.emitter.on(event, handler);
45
+ }
46
+ off<K extends keyof DriverEventMap>(
47
+ event: K,
48
+ handler: (e: DriverEventMap[K]) => void | Promise<void>,
49
+ ): void {
50
+ this.emitter.off(event, handler);
51
+ }
52
+
53
+ async start(ctx: StartContext): Promise<ReadyState> {
54
+ if (this.transport || this.terminal)
55
+ throw new Error("Cursor driver cannot be started twice or after close");
56
+ this.cwd = await realpath(this.config.cwd ?? ctx.artifactsDir);
57
+ this.artifactsDir = await realpath(ctx.artifactsDir);
58
+ const cliVersion = await discoverCliVersion(this.config.command);
59
+ const transport = new AcpTransport({
60
+ command: this.config.command,
61
+ args: buildCursorArgs(this.config),
62
+ cwd: this.cwd,
63
+ env: { ...process.env, ...this.config.env },
64
+ signal: ctx.abortSignal,
65
+ maxLineBytes: this.config.maxLineBytes,
66
+ maxQueuedBytes: this.config.maxQueuedBytes,
67
+ onMessage: (message) => this.message(message),
68
+ onFailure: (error) => this.fail(error),
69
+ onActivity: () => this.bumpIdleTimer(),
70
+ });
71
+ this.transport = transport;
72
+ try {
73
+ await transport.spawned();
74
+ const initialized = await this.request("initialize", {
75
+ protocolVersion: 1,
76
+ clientInfo: { name: "lux", version: "1" },
77
+ clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false },
78
+ });
79
+ if (initialized.protocolVersion !== 1)
80
+ throw new Error("Cursor ACP returned an unsupported protocol version");
81
+ if (!records(initialized.authMethods).some((method) => method.id === "cursor_login")) {
82
+ throw new Error(
83
+ "Expected Cursor ACP with cursor_login authentication; check the configured command points to Cursor CLI",
84
+ );
85
+ }
86
+ await this.request("authenticate", { methodId: "cursor_login" });
87
+ let session = await this.request("session/new", { cwd: this.cwd, mcpServers: [] });
88
+ if (typeof session.sessionId !== "string") throw new Error("Cursor ACP omitted sessionId");
89
+ this.sessionId = session.sessionId;
90
+ if (this.config.reasoningEffort) {
91
+ const selection = effortSelector(session, this.config.reasoningEffort);
92
+ const updated = await this.request("session/set_config_option", {
93
+ sessionId: this.sessionId,
94
+ ...selection,
95
+ });
96
+ const applied = records(updated.configOptions).find(
97
+ (option) => option.id === selection.configId,
98
+ );
99
+ if (applied?.currentValue !== this.config.reasoningEffort)
100
+ throw new Error("Cursor ACP did not apply the requested reasoning effort");
101
+ session = { ...session, ...updated };
102
+ }
103
+ const model =
104
+ records(session.configOptions).find(
105
+ (option) => option.category === "model" || option.id === "model",
106
+ )?.currentValue ?? asRecord(session.models)?.currentModelId;
107
+ if (typeof model === "string" && model !== this.config.model)
108
+ throw new Error(
109
+ `Cursor ACP selected '${model}' instead of requested '${this.config.model}'`,
110
+ );
111
+ this.ready = true;
112
+ this.bumpIdleTimer();
113
+ this.runPromise = this.run(ctx.prompt).catch((error: unknown) => this.fail(error));
114
+ return {
115
+ agentId: "cursor",
116
+ model: this.config.model,
117
+ detail: {
118
+ sessionId: this.sessionId,
119
+ transport: "acp",
120
+ protocolVersion: 1,
121
+ ...(cliVersion ? { cliVersion } : {}),
122
+ modelResolution: typeof model === "string" ? "reported" : "requested",
123
+ nativeConfig: session.configOptions ?? [],
124
+ usageAvailability: "unknown",
125
+ isolation: "none",
126
+ },
127
+ };
128
+ } catch (error) {
129
+ await this.close();
130
+ throw error;
131
+ }
132
+ }
133
+
134
+ private request(method: string, params: RpcRecord): Promise<RpcRecord> {
135
+ if (!this.transport) throw new Error("Cursor ACP has not started");
136
+ return this.transport.request(method, params, this.config.startupTimeoutMs);
137
+ }
138
+
139
+ private async run(prompt: string): Promise<void> {
140
+ const result = await this.transport?.request("session/prompt", {
141
+ sessionId: this.sessionId,
142
+ prompt: [{ type: "text", text: prompt }],
143
+ });
144
+ await this.transport?.drained();
145
+ if (this.terminal) return;
146
+ if (result?.stopReason !== "end_turn")
147
+ throw new Error(`Cursor stopped with ${String(result?.stopReason ?? "unknown reason")}`);
148
+ this.terminal = true;
149
+ clearTimeout(this.idleTimer);
150
+ await this.emitter.emit("done", {
151
+ exitReason: "done",
152
+ summary: {
153
+ sessionId: this.sessionId,
154
+ stopReason: result.stopReason,
155
+ usageAvailability: "unknown",
156
+ },
157
+ });
158
+ }
159
+
160
+ private async message(message: RpcRecord): Promise<void> {
161
+ if (this.terminal) return;
162
+ const method = String(message.method);
163
+ const params = asRecord(message.params) ?? {};
164
+ const id = message.id;
165
+ if (typeof id === "number" || typeof id === "string") {
166
+ if (typeof params.sessionId === "string" && params.sessionId !== this.sessionId) {
167
+ this.transport?.write({ id, error: { code: -32602, message: "Unknown session" } });
168
+ return;
169
+ }
170
+ if (
171
+ !["session/request_permission", "cursor/ask_question", "cursor/create_plan"].includes(
172
+ method,
173
+ )
174
+ ) {
175
+ this.transport?.write({
176
+ id,
177
+ error: { code: -32601, message: `Unsupported method: ${method}` },
178
+ });
179
+ return;
180
+ }
181
+ if (++this.interruptCount > this.config.maxInterrupts)
182
+ throw new Error("Cursor exceeded maxInterrupts");
183
+ const interruptId = `cursor-${id}`;
184
+ if (this.interrupts.has(interruptId)) throw new Error("Cursor reused a pending request ID");
185
+ this.interrupts.set(interruptId, { id, method, params });
186
+ clearTimeout(this.idleTimer);
187
+ if (method === "cursor/ask_question") {
188
+ await this.emitter.emit("interrupt", {
189
+ kind: "ask",
190
+ id: interruptId,
191
+ question: cursorQuestionText(params),
192
+ context: params,
193
+ });
194
+ } else {
195
+ await this.emitter.emit("interrupt", {
196
+ kind: "approve",
197
+ id: interruptId,
198
+ request:
199
+ method === "cursor/create_plan"
200
+ ? String(params.plan ?? params.overview ?? "Approve this plan?")
201
+ : String(asRecord(params.toolCall)?.title ?? "Approve this tool call?"),
202
+ context: params,
203
+ });
204
+ }
205
+ return;
206
+ }
207
+ if (method === "session/update") {
208
+ if (params.sessionId !== this.sessionId) return;
209
+ const update = asRecord(params.update);
210
+ if (update)
211
+ for (const event of this.events.update(update)) await this.emitter.emit("progress", event);
212
+ } else if (method.startsWith("cursor/")) {
213
+ await this.emitter.emit("progress", {
214
+ id: `cursor-native-${Date.now()}-${method}`,
215
+ kind: "cursor-event",
216
+ payload: { method, params },
217
+ ts: Date.now(),
218
+ });
219
+ }
220
+ }
221
+
222
+ async respond(answer: Answer): Promise<void> {
223
+ const pending = this.interrupts.get(answer.id);
224
+ if (!pending) throw new Error(`Cursor has no pending interrupt '${answer.id}'`);
225
+ const result = cursorAnswer(pending.method, pending.params, answer);
226
+ this.transport?.write({ id: pending.id, result });
227
+ this.interrupts.delete(answer.id);
228
+ this.bumpIdleTimer();
229
+ }
230
+
231
+ private bumpIdleTimer(): void {
232
+ clearTimeout(this.idleTimer);
233
+ if (!this.ready || this.terminal || this.interrupts.size > 0) return;
234
+ this.idleTimer = setTimeout(
235
+ () =>
236
+ this.fail(
237
+ new Error(`Cursor emitted no event for ${this.config.idleTimeoutMs}ms`),
238
+ "idle-timeout",
239
+ ),
240
+ this.config.idleTimeoutMs,
241
+ );
242
+ }
243
+
244
+ private fail(error: unknown, exitReason: "error" | "idle-timeout" = "error"): void {
245
+ if (this.terminal) return;
246
+ this.terminal = true;
247
+ clearTimeout(this.idleTimer);
248
+ if (this.ready)
249
+ void this.transport?.drained().then(() =>
250
+ this.emitter.emit("error", {
251
+ exitReason,
252
+ reason: error instanceof Error ? error.message : String(error),
253
+ }),
254
+ );
255
+ void this.transport?.close();
256
+ }
257
+
258
+ async quiesce(): Promise<void> {
259
+ clearTimeout(this.idleTimer);
260
+ const cancelling = !this.terminal && this.sessionId !== undefined;
261
+ this.terminal = true;
262
+ if (cancelling) {
263
+ for (const pending of this.interrupts.values())
264
+ this.transport?.write({ id: pending.id, result: { outcome: { outcome: "cancelled" } } });
265
+ this.transport?.write({ method: "session/cancel", params: { sessionId: this.sessionId } });
266
+ let timer: NodeJS.Timeout | undefined;
267
+ try {
268
+ await Promise.race([
269
+ this.runPromise,
270
+ new Promise<void>((resolve) => {
271
+ timer = setTimeout(resolve, 200);
272
+ }),
273
+ ]);
274
+ } finally {
275
+ clearTimeout(timer);
276
+ }
277
+ }
278
+ this.interrupts.clear();
279
+ await this.transport?.close();
280
+ }
281
+
282
+ async collect(): Promise<Artifact[]> {
283
+ await this.quiesce();
284
+ if (!this.cwd) return [];
285
+ const artifacts = await walkArtifacts(this.cwd);
286
+ return this.cwd === this.artifactsDir
287
+ ? artifacts
288
+ : artifacts.map((artifact) => ({ ...artifact, root: this.cwd as string }));
289
+ }
290
+
291
+ async close(): Promise<void> {
292
+ await this.quiesce();
293
+ this.emitter.removeAllListeners();
294
+ }
295
+ }
296
+
297
+ export const cursorDriver = defineDriver({
298
+ name: "cursor",
299
+ configSchema: CursorDriverConfigSchema,
300
+ runtime: (config) => ({
301
+ commands: [config.command],
302
+ capabilities: {
303
+ interactive: true,
304
+ "tool-calls": true,
305
+ "tool-results": true,
306
+ artifacts: true,
307
+ usage: false,
308
+ cost: false,
309
+ isolation: false,
310
+ },
311
+ }),
312
+ create: (config) => new CursorDriver(config),
313
+ });
314
+
315
+ export type { CursorDriverConfig };
316
+ export { buildCursorArgs, CursorDriverConfigSchema };
@@ -0,0 +1,90 @@
1
+ import type { Answer } from "../../core/index.js";
2
+ import { asRecord, type RpcRecord } from "./acp-transport.js";
3
+
4
+ export const records = (value: unknown): RpcRecord[] =>
5
+ Array.isArray(value)
6
+ ? value.flatMap((entry): RpcRecord[] => {
7
+ const record = asRecord(entry);
8
+ return record ? [record] : [];
9
+ })
10
+ : [];
11
+
12
+ export const cursorQuestionText = (params: RpcRecord): string =>
13
+ `Return a JSON object mapping each question ID to its selected option ID. For questions allowing multiple selections, use an array of option IDs.\n\n${records(
14
+ params.questions,
15
+ )
16
+ .map(
17
+ (question) =>
18
+ `Question ID: ${String(question.id)}${question.allowMultiple === true ? " (multiple selections allowed)" : " (select one)"}\n${String(question.prompt ?? question.id)}\n${records(
19
+ question.options,
20
+ )
21
+ .map((option) => `${String(option.id)}: ${String(option.label)}`)
22
+ .join("\n")}`,
23
+ )
24
+ .join("\n\n")}`;
25
+
26
+ export const cursorAnswer = (method: string, params: RpcRecord, answer: Answer): RpcRecord => {
27
+ if (method === "cursor/ask_question") {
28
+ if (answer.kind !== "ask") throw new Error("Cursor questions require a text answer");
29
+ let supplied: RpcRecord = {};
30
+ try {
31
+ supplied = asRecord(JSON.parse(answer.text)) ?? {};
32
+ } catch {
33
+ /* Plain option IDs and labels are accepted too. */
34
+ }
35
+ const answers = records(params.questions).map((question) => {
36
+ const selection = supplied[String(question.id)] ?? answer.text;
37
+ const selections = Array.isArray(selection) ? selection : [selection];
38
+ if (question.allowMultiple !== true && selections.length !== 1)
39
+ throw new Error("Cursor question requires exactly one selection");
40
+ const selectedOptionIds = selections.map((value) => {
41
+ const option = records(question.options).find(
42
+ (entry) => entry.id === value || entry.label === value,
43
+ );
44
+ if (!option || typeof option.id !== "string")
45
+ throw new Error(`Cursor answer does not match an option for '${String(question.id)}'`);
46
+ return option.id;
47
+ });
48
+ return { questionId: question.id, selectedOptionIds };
49
+ });
50
+ return { outcome: { outcome: "answered", answers } };
51
+ }
52
+ if (answer.kind !== "approve") throw new Error("Cursor approval requires an approval answer");
53
+ if (method === "cursor/create_plan") {
54
+ return {
55
+ outcome: answer.approved
56
+ ? { outcome: "accepted" }
57
+ : { outcome: "rejected", ...(answer.reason ? { reason: answer.reason } : {}) },
58
+ };
59
+ }
60
+ const option = records(params.options).find(
61
+ (entry) => entry.kind === (answer.approved ? "allow_once" : "reject_once"),
62
+ );
63
+ // A Lux approval applies to this operation, never a remembered permission.
64
+ return {
65
+ outcome:
66
+ option && typeof option.optionId === "string"
67
+ ? { outcome: "selected", optionId: option.optionId }
68
+ : { outcome: "cancelled" },
69
+ };
70
+ };
71
+
72
+ const optionValues = (options: unknown): string[] =>
73
+ records(options).flatMap((option) =>
74
+ typeof option.value === "string" ? [option.value] : optionValues(option.options),
75
+ );
76
+
77
+ export const effortSelector = (session: RpcRecord, effort: string): RpcRecord => {
78
+ const option = records(session.configOptions).find(
79
+ (entry) =>
80
+ entry.category === "thought_level" ||
81
+ entry.id === "reasoning_effort" ||
82
+ entry.id === "effort",
83
+ );
84
+ if (!option || typeof option.id !== "string" || !optionValues(option.options).includes(effort)) {
85
+ throw new Error(
86
+ `Cursor ACP does not advertise reasoning effort '${effort}'; select an explicit supported model/effort ID or omit reasoningEffort`,
87
+ );
88
+ }
89
+ return { configId: option.id, value: effort };
90
+ };
@@ -6,7 +6,7 @@ import {
6
6
  type Answer,
7
7
  type Artifact,
8
8
  type DriverEventMap,
9
- type DriverPlugin,
9
+ defineDriver,
10
10
  type ListedTool,
11
11
  MCP_INIT_KIND,
12
12
  MCP_TOOLS_LIST_KIND,
@@ -344,8 +344,21 @@ class McpProbeDriverImpl implements AgentDriver {
344
344
  }
345
345
  }
346
346
 
347
- export const mcpProbeDriver: DriverPlugin<McpProbeDriverConfig> = {
347
+ export const mcpProbeDriver = defineDriver({
348
348
  name: "mcp-probe",
349
349
  configSchema: McpProbeDriverConfigSchema,
350
+ runtime: (config) => ({
351
+ commands: [config.command],
352
+ capabilities: {
353
+ interactive: false,
354
+ "tool-calls": true,
355
+ "tool-results": true,
356
+ artifacts: true,
357
+ subagents: false,
358
+ usage: false,
359
+ cost: false,
360
+ isolation: false,
361
+ },
362
+ }),
350
363
  create: (config) => new McpProbeDriverImpl(config),
351
- };
364
+ });