@nodetool-ai/cli 0.7.0-rc.23 → 0.8.2

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 (535) hide show
  1. package/README.md +82 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/ExecutionTree.d.ts +2 -1
  4. package/dist/ExecutionTree.d.ts.map +1 -1
  5. package/dist/ExecutionTree.js +1 -1
  6. package/dist/ExecutionTree.js.map +1 -1
  7. package/dist/affected/affected.d.ts +45 -0
  8. package/dist/affected/affected.d.ts.map +1 -0
  9. package/dist/affected/affected.js +160 -0
  10. package/dist/affected/affected.js.map +1 -0
  11. package/dist/agent-toolbelt.d.ts +15 -0
  12. package/dist/agent-toolbelt.d.ts.map +1 -0
  13. package/dist/agent-toolbelt.js +28 -0
  14. package/dist/agent-toolbelt.js.map +1 -0
  15. package/dist/api-client.d.ts +12 -0
  16. package/dist/api-client.d.ts.map +1 -0
  17. package/dist/api-client.js +21 -0
  18. package/dist/api-client.js.map +1 -0
  19. package/dist/app-build/bundle.d.ts +15 -0
  20. package/dist/app-build/bundle.d.ts.map +1 -0
  21. package/dist/app-build/bundle.js +45 -0
  22. package/dist/app-build/bundle.js.map +1 -0
  23. package/dist/app-build/watch.d.ts +13 -0
  24. package/dist/app-build/watch.d.ts.map +1 -0
  25. package/dist/app-build/watch.js +25 -0
  26. package/dist/app-build/watch.js.map +1 -0
  27. package/dist/app-debug/app-target.d.ts +14 -0
  28. package/dist/app-debug/app-target.d.ts.map +1 -0
  29. package/dist/app-debug/app-target.js +120 -0
  30. package/dist/app-debug/app-target.js.map +1 -0
  31. package/dist/app-debug/harness.d.ts +29 -0
  32. package/dist/app-debug/harness.d.ts.map +1 -0
  33. package/dist/app-debug/harness.js +116 -0
  34. package/dist/app-debug/harness.js.map +1 -0
  35. package/dist/app-debug/index.d.ts +12 -0
  36. package/dist/app-debug/index.d.ts.map +1 -0
  37. package/dist/app-debug/index.js +9 -0
  38. package/dist/app-debug/index.js.map +1 -0
  39. package/dist/app.d.ts +38 -48
  40. package/dist/app.d.ts.map +1 -1
  41. package/dist/app.js +980 -677
  42. package/dist/app.js.map +1 -1
  43. package/dist/bash-tool.d.ts +13 -0
  44. package/dist/bash-tool.d.ts.map +1 -0
  45. package/dist/bash-tool.js +85 -0
  46. package/dist/bash-tool.js.map +1 -0
  47. package/dist/chat-codeact.d.ts +93 -0
  48. package/dist/chat-codeact.d.ts.map +1 -0
  49. package/dist/chat-codeact.js +179 -0
  50. package/dist/chat-codeact.js.map +1 -0
  51. package/dist/chat-context.d.ts +18 -0
  52. package/dist/chat-context.d.ts.map +1 -0
  53. package/dist/chat-context.js +32 -0
  54. package/dist/chat-context.js.map +1 -0
  55. package/dist/chat-media.d.ts +3 -0
  56. package/dist/chat-media.d.ts.map +1 -0
  57. package/dist/chat-media.js +46 -0
  58. package/dist/chat-media.js.map +1 -0
  59. package/dist/chat-prompts.d.ts +20 -0
  60. package/dist/chat-prompts.d.ts.map +1 -0
  61. package/dist/chat-prompts.js +42 -0
  62. package/dist/chat-prompts.js.map +1 -0
  63. package/dist/chat-sessions.d.ts +25 -0
  64. package/dist/chat-sessions.d.ts.map +1 -0
  65. package/dist/chat-sessions.js +153 -0
  66. package/dist/chat-sessions.js.map +1 -0
  67. package/dist/command-errors.d.ts +10 -0
  68. package/dist/command-errors.d.ts.map +1 -0
  69. package/dist/command-errors.js +15 -0
  70. package/dist/command-errors.js.map +1 -0
  71. package/dist/commands/__tests__/jtbd.test.d.ts +2 -0
  72. package/dist/commands/__tests__/jtbd.test.d.ts.map +1 -0
  73. package/dist/commands/__tests__/jtbd.test.js +120 -0
  74. package/dist/commands/__tests__/jtbd.test.js.map +1 -0
  75. package/dist/commands/__tests__/timeline-render-audio.test.d.ts +2 -0
  76. package/dist/commands/__tests__/timeline-render-audio.test.d.ts.map +1 -0
  77. package/dist/commands/__tests__/timeline-render-audio.test.js +53 -0
  78. package/dist/commands/__tests__/timeline-render-audio.test.js.map +1 -0
  79. package/dist/commands/__tests__/timeline-render-completeness.test.d.ts +2 -0
  80. package/dist/commands/__tests__/timeline-render-completeness.test.d.ts.map +1 -0
  81. package/dist/commands/__tests__/timeline-render-completeness.test.js +117 -0
  82. package/dist/commands/__tests__/timeline-render-completeness.test.js.map +1 -0
  83. package/dist/commands/__tests__/timeline-render.test.d.ts +2 -0
  84. package/dist/commands/__tests__/timeline-render.test.d.ts.map +1 -0
  85. package/dist/commands/__tests__/timeline-render.test.js +115 -0
  86. package/dist/commands/__tests__/timeline-render.test.js.map +1 -0
  87. package/dist/commands/__tests__/timeline-score.test.d.ts +2 -0
  88. package/dist/commands/__tests__/timeline-score.test.d.ts.map +1 -0
  89. package/dist/commands/__tests__/timeline-score.test.js +100 -0
  90. package/dist/commands/__tests__/timeline-score.test.js.map +1 -0
  91. package/dist/commands/affected.d.ts +9 -0
  92. package/dist/commands/affected.d.ts.map +1 -0
  93. package/dist/commands/affected.js +122 -0
  94. package/dist/commands/affected.js.map +1 -0
  95. package/dist/commands/agent.d.ts +26 -4
  96. package/dist/commands/agent.d.ts.map +1 -1
  97. package/dist/commands/agent.js +328 -306
  98. package/dist/commands/agent.js.map +1 -1
  99. package/dist/commands/app.d.ts +3 -0
  100. package/dist/commands/app.d.ts.map +1 -0
  101. package/dist/commands/app.js +405 -0
  102. package/dist/commands/app.js.map +1 -0
  103. package/dist/commands/apps.d.ts +15 -0
  104. package/dist/commands/apps.d.ts.map +1 -0
  105. package/dist/commands/apps.js +180 -0
  106. package/dist/commands/apps.js.map +1 -0
  107. package/dist/commands/auth.d.ts +12 -0
  108. package/dist/commands/auth.d.ts.map +1 -0
  109. package/dist/commands/auth.js +154 -0
  110. package/dist/commands/auth.js.map +1 -0
  111. package/dist/commands/collections.d.ts +10 -0
  112. package/dist/commands/collections.d.ts.map +1 -0
  113. package/dist/commands/collections.js +257 -0
  114. package/dist/commands/collections.js.map +1 -0
  115. package/dist/commands/costs.d.ts +15 -0
  116. package/dist/commands/costs.d.ts.map +1 -0
  117. package/dist/commands/costs.js +201 -0
  118. package/dist/commands/costs.js.map +1 -0
  119. package/dist/commands/db.d.ts +3 -0
  120. package/dist/commands/db.d.ts.map +1 -0
  121. package/dist/commands/db.js +176 -0
  122. package/dist/commands/db.js.map +1 -0
  123. package/dist/commands/debug-summary-output.d.ts +22 -0
  124. package/dist/commands/debug-summary-output.d.ts.map +1 -0
  125. package/dist/commands/debug-summary-output.js +28 -0
  126. package/dist/commands/debug-summary-output.js.map +1 -0
  127. package/dist/commands/debug.d.ts +13 -0
  128. package/dist/commands/debug.d.ts.map +1 -0
  129. package/dist/commands/debug.js +138 -0
  130. package/dist/commands/debug.js.map +1 -0
  131. package/dist/commands/deploy-helpers.d.ts +49 -18
  132. package/dist/commands/deploy-helpers.d.ts.map +1 -1
  133. package/dist/commands/deploy-helpers.js +10 -276
  134. package/dist/commands/deploy-helpers.js.map +1 -1
  135. package/dist/commands/deploy.d.ts +0 -1
  136. package/dist/commands/deploy.d.ts.map +1 -1
  137. package/dist/commands/deploy.js +21 -217
  138. package/dist/commands/deploy.js.map +1 -1
  139. package/dist/commands/errors.d.ts +11 -0
  140. package/dist/commands/errors.d.ts.map +1 -0
  141. package/dist/commands/errors.js +177 -0
  142. package/dist/commands/errors.js.map +1 -0
  143. package/dist/commands/eval.d.ts +152 -0
  144. package/dist/commands/eval.d.ts.map +1 -0
  145. package/dist/commands/eval.js +690 -0
  146. package/dist/commands/eval.js.map +1 -0
  147. package/dist/commands/extension.d.ts +12 -0
  148. package/dist/commands/extension.d.ts.map +1 -0
  149. package/dist/commands/extension.js +30 -0
  150. package/dist/commands/extension.js.map +1 -0
  151. package/dist/commands/game-benchmark.d.ts +34 -0
  152. package/dist/commands/game-benchmark.d.ts.map +1 -0
  153. package/dist/commands/game-benchmark.js +95 -0
  154. package/dist/commands/game-benchmark.js.map +1 -0
  155. package/dist/commands/game-smoke.d.ts +3 -0
  156. package/dist/commands/game-smoke.d.ts.map +1 -0
  157. package/dist/commands/game-smoke.js +23 -0
  158. package/dist/commands/game-smoke.js.map +1 -0
  159. package/dist/commands/game.d.ts +4 -0
  160. package/dist/commands/game.d.ts.map +1 -0
  161. package/dist/commands/game.js +624 -0
  162. package/dist/commands/game.js.map +1 -0
  163. package/dist/commands/generate.d.ts +17 -0
  164. package/dist/commands/generate.d.ts.map +1 -0
  165. package/dist/commands/generate.js +324 -0
  166. package/dist/commands/generate.js.map +1 -0
  167. package/dist/commands/generations.d.ts +17 -0
  168. package/dist/commands/generations.d.ts.map +1 -0
  169. package/dist/commands/generations.js +408 -0
  170. package/dist/commands/generations.js.map +1 -0
  171. package/dist/commands/harness.d.ts +69 -0
  172. package/dist/commands/harness.d.ts.map +1 -0
  173. package/dist/commands/harness.js +575 -0
  174. package/dist/commands/harness.js.map +1 -0
  175. package/dist/commands/js-script-validation-output.d.ts +7 -0
  176. package/dist/commands/js-script-validation-output.d.ts.map +1 -0
  177. package/dist/commands/js-script-validation-output.js +5 -0
  178. package/dist/commands/js-script-validation-output.js.map +1 -0
  179. package/dist/commands/js-script-versions.d.ts +53 -0
  180. package/dist/commands/js-script-versions.d.ts.map +1 -0
  181. package/dist/commands/js-script-versions.js +89 -0
  182. package/dist/commands/js-script-versions.js.map +1 -0
  183. package/dist/commands/js-script.d.ts +29 -0
  184. package/dist/commands/js-script.d.ts.map +1 -0
  185. package/dist/commands/js-script.js +211 -0
  186. package/dist/commands/js-script.js.map +1 -0
  187. package/dist/commands/jtbd.d.ts +38 -0
  188. package/dist/commands/jtbd.d.ts.map +1 -0
  189. package/dist/commands/jtbd.js +261 -0
  190. package/dist/commands/jtbd.js.map +1 -0
  191. package/dist/commands/local-db.d.ts +16 -0
  192. package/dist/commands/local-db.d.ts.map +1 -0
  193. package/dist/commands/local-db.js +33 -0
  194. package/dist/commands/local-db.js.map +1 -0
  195. package/dist/commands/mcp.d.ts +21 -0
  196. package/dist/commands/mcp.d.ts.map +1 -0
  197. package/dist/commands/mcp.js +164 -0
  198. package/dist/commands/mcp.js.map +1 -0
  199. package/dist/commands/migrate-code-inputs.d.ts +24 -0
  200. package/dist/commands/migrate-code-inputs.d.ts.map +1 -0
  201. package/dist/commands/migrate-code-inputs.js +120 -0
  202. package/dist/commands/migrate-code-inputs.js.map +1 -0
  203. package/dist/commands/models-hf.js +4 -4
  204. package/dist/commands/models-hf.js.map +1 -1
  205. package/dist/commands/models-recommended.d.ts.map +1 -1
  206. package/dist/commands/models-recommended.js +16 -24
  207. package/dist/commands/models-recommended.js.map +1 -1
  208. package/dist/commands/node.d.ts +10 -0
  209. package/dist/commands/node.d.ts.map +1 -0
  210. package/dist/commands/node.js +72 -0
  211. package/dist/commands/node.js.map +1 -0
  212. package/dist/commands/output.d.ts +24 -0
  213. package/dist/commands/output.d.ts.map +1 -0
  214. package/dist/commands/output.js +132 -0
  215. package/dist/commands/output.js.map +1 -0
  216. package/dist/commands/package-helpers.d.ts +1 -7
  217. package/dist/commands/package-helpers.d.ts.map +1 -1
  218. package/dist/commands/package-helpers.js +3 -26
  219. package/dist/commands/package-helpers.js.map +1 -1
  220. package/dist/commands/package.d.ts.map +1 -1
  221. package/dist/commands/package.js +14 -14
  222. package/dist/commands/package.js.map +1 -1
  223. package/dist/commands/packs.d.ts +13 -0
  224. package/dist/commands/packs.d.ts.map +1 -0
  225. package/dist/commands/packs.js +60 -0
  226. package/dist/commands/packs.js.map +1 -0
  227. package/dist/commands/reliability.d.ts +14 -0
  228. package/dist/commands/reliability.d.ts.map +1 -0
  229. package/dist/commands/reliability.js +80 -0
  230. package/dist/commands/reliability.js.map +1 -0
  231. package/dist/commands/resource-read.d.ts +28 -0
  232. package/dist/commands/resource-read.d.ts.map +1 -0
  233. package/dist/commands/resource-read.js +316 -0
  234. package/dist/commands/resource-read.js.map +1 -0
  235. package/dist/commands/runs.d.ts +7 -0
  236. package/dist/commands/runs.d.ts.map +1 -0
  237. package/dist/commands/runs.js +302 -0
  238. package/dist/commands/runs.js.map +1 -0
  239. package/dist/commands/sketch-validation-output.d.ts +7 -0
  240. package/dist/commands/sketch-validation-output.d.ts.map +1 -0
  241. package/dist/commands/sketch-validation-output.js +5 -0
  242. package/dist/commands/sketch-validation-output.js.map +1 -0
  243. package/dist/commands/sketch-versions.d.ts +66 -0
  244. package/dist/commands/sketch-versions.d.ts.map +1 -0
  245. package/dist/commands/sketch-versions.js +108 -0
  246. package/dist/commands/sketch-versions.js.map +1 -0
  247. package/dist/commands/sketch.d.ts +21 -0
  248. package/dist/commands/sketch.d.ts.map +1 -0
  249. package/dist/commands/sketch.js +101 -0
  250. package/dist/commands/sketch.js.map +1 -0
  251. package/dist/commands/storage.d.ts +24 -0
  252. package/dist/commands/storage.d.ts.map +1 -0
  253. package/dist/commands/storage.js +112 -0
  254. package/dist/commands/storage.js.map +1 -0
  255. package/dist/commands/telegram.d.ts +11 -0
  256. package/dist/commands/telegram.d.ts.map +1 -0
  257. package/dist/commands/telegram.js +66 -0
  258. package/dist/commands/telegram.js.map +1 -0
  259. package/dist/commands/timeline-render.d.ts +85 -0
  260. package/dist/commands/timeline-render.d.ts.map +1 -0
  261. package/dist/commands/timeline-render.js +474 -0
  262. package/dist/commands/timeline-render.js.map +1 -0
  263. package/dist/commands/timeline-score.d.ts +16 -0
  264. package/dist/commands/timeline-score.d.ts.map +1 -0
  265. package/dist/commands/timeline-score.js +89 -0
  266. package/dist/commands/timeline-score.js.map +1 -0
  267. package/dist/commands/timeline-validation-output.d.ts +7 -0
  268. package/dist/commands/timeline-validation-output.d.ts.map +1 -0
  269. package/dist/commands/timeline-validation-output.js +9 -0
  270. package/dist/commands/timeline-validation-output.js.map +1 -0
  271. package/dist/commands/timeline-versions.d.ts +72 -0
  272. package/dist/commands/timeline-versions.d.ts.map +1 -0
  273. package/dist/commands/timeline-versions.js +108 -0
  274. package/dist/commands/timeline-versions.js.map +1 -0
  275. package/dist/commands/timeline.d.ts +22 -0
  276. package/dist/commands/timeline.d.ts.map +1 -0
  277. package/dist/commands/timeline.js +105 -0
  278. package/dist/commands/timeline.js.map +1 -0
  279. package/dist/commands/validate.d.ts +22 -0
  280. package/dist/commands/validate.d.ts.map +1 -0
  281. package/dist/commands/validate.js +127 -0
  282. package/dist/commands/validate.js.map +1 -0
  283. package/dist/commands/validation-output.d.ts +25 -0
  284. package/dist/commands/validation-output.d.ts.map +1 -0
  285. package/dist/commands/validation-output.js +29 -0
  286. package/dist/commands/validation-output.js.map +1 -0
  287. package/dist/commands/version-commands.d.ts +94 -0
  288. package/dist/commands/version-commands.d.ts.map +1 -0
  289. package/dist/commands/version-commands.js +227 -0
  290. package/dist/commands/version-commands.js.map +1 -0
  291. package/dist/commands/worker-models.d.ts +13 -0
  292. package/dist/commands/worker-models.d.ts.map +1 -0
  293. package/dist/commands/worker-models.js +207 -0
  294. package/dist/commands/worker-models.js.map +1 -0
  295. package/dist/commands/worker.d.ts +23 -0
  296. package/dist/commands/worker.d.ts.map +1 -0
  297. package/dist/commands/worker.js +374 -0
  298. package/dist/commands/worker.js.map +1 -0
  299. package/dist/debug/browser-runner.d.ts +21 -0
  300. package/dist/debug/browser-runner.d.ts.map +1 -0
  301. package/dist/debug/browser-runner.js +196 -0
  302. package/dist/debug/browser-runner.js.map +1 -0
  303. package/dist/debug/collector.d.ts +9 -0
  304. package/dist/debug/collector.d.ts.map +1 -0
  305. package/dist/debug/collector.js +9 -0
  306. package/dist/debug/collector.js.map +1 -0
  307. package/dist/debug/diff.d.ts +48 -0
  308. package/dist/debug/diff.d.ts.map +1 -0
  309. package/dist/debug/diff.js +68 -0
  310. package/dist/debug/diff.js.map +1 -0
  311. package/dist/debug/harness.d.ts +11 -0
  312. package/dist/debug/harness.d.ts.map +1 -0
  313. package/dist/debug/harness.js +103 -0
  314. package/dist/debug/harness.js.map +1 -0
  315. package/dist/debug/index.d.ts +17 -0
  316. package/dist/debug/index.d.ts.map +1 -0
  317. package/dist/debug/index.js +16 -0
  318. package/dist/debug/index.js.map +1 -0
  319. package/dist/debug/markdown.d.ts +3 -0
  320. package/dist/debug/markdown.d.ts.map +1 -0
  321. package/dist/debug/markdown.js +127 -0
  322. package/dist/debug/markdown.js.map +1 -0
  323. package/dist/debug/server-runner.d.ts +24 -0
  324. package/dist/debug/server-runner.d.ts.map +1 -0
  325. package/dist/debug/server-runner.js +197 -0
  326. package/dist/debug/server-runner.js.map +1 -0
  327. package/dist/debug/target.d.ts +34 -0
  328. package/dist/debug/target.d.ts.map +1 -0
  329. package/dist/debug/target.js +104 -0
  330. package/dist/debug/target.js.map +1 -0
  331. package/dist/debug/trace.d.ts +30 -0
  332. package/dist/debug/trace.d.ts.map +1 -0
  333. package/dist/debug/trace.js +87 -0
  334. package/dist/debug/trace.js.map +1 -0
  335. package/dist/debug/types.d.ts +82 -0
  336. package/dist/debug/types.d.ts.map +1 -0
  337. package/dist/debug/types.js +13 -0
  338. package/dist/debug/types.js.map +1 -0
  339. package/dist/debug/verdict.d.ts +3 -0
  340. package/dist/debug/verdict.d.ts.map +1 -0
  341. package/dist/debug/verdict.js +78 -0
  342. package/dist/debug/verdict.js.map +1 -0
  343. package/dist/debug/watch.d.ts +23 -0
  344. package/dist/debug/watch.d.ts.map +1 -0
  345. package/dist/debug/watch.js +68 -0
  346. package/dist/debug/watch.js.map +1 -0
  347. package/dist/diagnose.d.ts +139 -0
  348. package/dist/diagnose.d.ts.map +1 -0
  349. package/dist/diagnose.js +418 -0
  350. package/dist/diagnose.js.map +1 -0
  351. package/dist/evals/graph-runner.d.ts +8 -0
  352. package/dist/evals/graph-runner.d.ts.map +1 -0
  353. package/dist/evals/graph-runner.js +136 -0
  354. package/dist/evals/graph-runner.js.map +1 -0
  355. package/dist/harness/capability-coverage.d.ts +161 -0
  356. package/dist/harness/capability-coverage.d.ts.map +1 -0
  357. package/dist/harness/capability-coverage.js +266 -0
  358. package/dist/harness/capability-coverage.js.map +1 -0
  359. package/dist/harness/capability-table.d.ts +17 -0
  360. package/dist/harness/capability-table.d.ts.map +1 -0
  361. package/dist/harness/capability-table.js +3844 -0
  362. package/dist/harness/capability-table.js.map +1 -0
  363. package/dist/harness/changed-files.d.ts +20 -0
  364. package/dist/harness/changed-files.d.ts.map +1 -0
  365. package/dist/harness/changed-files.js +90 -0
  366. package/dist/harness/changed-files.js.map +1 -0
  367. package/dist/harness/declared-capabilities.d.ts +12 -0
  368. package/dist/harness/declared-capabilities.d.ts.map +1 -0
  369. package/dist/harness/declared-capabilities.js +21 -0
  370. package/dist/harness/declared-capabilities.js.map +1 -0
  371. package/dist/harness/registry.d.ts +190 -0
  372. package/dist/harness/registry.d.ts.map +1 -0
  373. package/dist/harness/registry.js +2034 -0
  374. package/dist/harness/registry.js.map +1 -0
  375. package/dist/index.js +122 -131
  376. package/dist/index.js.map +1 -1
  377. package/dist/interaction-script.d.ts +40 -0
  378. package/dist/interaction-script.d.ts.map +1 -0
  379. package/dist/interaction-script.js +96 -0
  380. package/dist/interaction-script.js.map +1 -0
  381. package/dist/js-script-debug/harness.d.ts +124 -0
  382. package/dist/js-script-debug/harness.d.ts.map +1 -0
  383. package/dist/js-script-debug/harness.js +230 -0
  384. package/dist/js-script-debug/harness.js.map +1 -0
  385. package/dist/js-script-debug/index.d.ts +9 -0
  386. package/dist/js-script-debug/index.d.ts.map +1 -0
  387. package/dist/js-script-debug/index.js +9 -0
  388. package/dist/js-script-debug/index.js.map +1 -0
  389. package/dist/js-script-debug/interactions.d.ts +19 -0
  390. package/dist/js-script-debug/interactions.d.ts.map +1 -0
  391. package/dist/js-script-debug/interactions.js +17 -0
  392. package/dist/js-script-debug/interactions.js.map +1 -0
  393. package/dist/js-script-debug/target.d.ts +20 -0
  394. package/dist/js-script-debug/target.d.ts.map +1 -0
  395. package/dist/js-script-debug/target.js +78 -0
  396. package/dist/js-script-debug/target.js.map +1 -0
  397. package/dist/local-model-interfaces.d.ts +20 -0
  398. package/dist/local-model-interfaces.d.ts.map +1 -0
  399. package/dist/local-model-interfaces.js +41 -0
  400. package/dist/local-model-interfaces.js.map +1 -0
  401. package/dist/local-secrets.d.ts +3 -0
  402. package/dist/local-secrets.d.ts.map +1 -0
  403. package/dist/local-secrets.js +16 -0
  404. package/dist/local-secrets.js.map +1 -0
  405. package/dist/markdown.d.ts.map +1 -1
  406. package/dist/markdown.js +7 -2
  407. package/dist/markdown.js.map +1 -1
  408. package/dist/node/run-node.d.ts +28 -0
  409. package/dist/node/run-node.d.ts.map +1 -0
  410. package/dist/node/run-node.js +76 -0
  411. package/dist/node/run-node.js.map +1 -0
  412. package/dist/node-registry.d.ts +27 -0
  413. package/dist/node-registry.d.ts.map +1 -0
  414. package/dist/node-registry.js +33 -0
  415. package/dist/node-registry.js.map +1 -0
  416. package/dist/nodetool-main.d.ts +15 -0
  417. package/dist/nodetool-main.d.ts.map +1 -0
  418. package/dist/nodetool-main.js +1368 -0
  419. package/dist/nodetool-main.js.map +1 -0
  420. package/dist/nodetool.d.ts +0 -13
  421. package/dist/nodetool.d.ts.map +1 -1
  422. package/dist/nodetool.js +17 -1147
  423. package/dist/nodetool.js.map +1 -1
  424. package/dist/numeric-options.d.ts +22 -0
  425. package/dist/numeric-options.d.ts.map +1 -0
  426. package/dist/numeric-options.js +45 -0
  427. package/dist/numeric-options.js.map +1 -0
  428. package/dist/permission-gate.d.ts +55 -0
  429. package/dist/permission-gate.d.ts.map +1 -0
  430. package/dist/permission-gate.js +118 -0
  431. package/dist/permission-gate.js.map +1 -0
  432. package/dist/predicates.d.ts +6 -0
  433. package/dist/predicates.d.ts.map +1 -0
  434. package/dist/predicates.js +6 -0
  435. package/dist/predicates.js.map +1 -0
  436. package/dist/providers.d.ts +73 -10
  437. package/dist/providers.d.ts.map +1 -1
  438. package/dist/providers.js +339 -97
  439. package/dist/providers.js.map +1 -1
  440. package/dist/readline-input.d.ts +13 -19
  441. package/dist/readline-input.d.ts.map +1 -1
  442. package/dist/readline-input.js +201 -190
  443. package/dist/readline-input.js.map +1 -1
  444. package/dist/run-budget.d.ts +40 -0
  445. package/dist/run-budget.d.ts.map +1 -0
  446. package/dist/run-budget.js +119 -0
  447. package/dist/run-budget.js.map +1 -0
  448. package/dist/run-dsl-supervised.d.ts +11 -0
  449. package/dist/run-dsl-supervised.d.ts.map +1 -0
  450. package/dist/run-dsl-supervised.js +82 -0
  451. package/dist/run-dsl-supervised.js.map +1 -0
  452. package/dist/run-dsl.d.ts +29 -0
  453. package/dist/run-dsl.d.ts.map +1 -1
  454. package/dist/run-dsl.js +44 -10
  455. package/dist/run-dsl.js.map +1 -1
  456. package/dist/run-json.d.ts +24 -0
  457. package/dist/run-json.d.ts.map +1 -0
  458. package/dist/run-json.js +132 -0
  459. package/dist/run-json.js.map +1 -0
  460. package/dist/sandbox-catalog.d.ts +24 -0
  461. package/dist/sandbox-catalog.d.ts.map +1 -0
  462. package/dist/sandbox-catalog.js +78 -0
  463. package/dist/sandbox-catalog.js.map +1 -0
  464. package/dist/settings.d.ts +11 -10
  465. package/dist/settings.d.ts.map +1 -1
  466. package/dist/settings.js +71 -13
  467. package/dist/settings.js.map +1 -1
  468. package/dist/sketch-debug/harness.d.ts +87 -0
  469. package/dist/sketch-debug/harness.d.ts.map +1 -0
  470. package/dist/sketch-debug/harness.js +145 -0
  471. package/dist/sketch-debug/harness.js.map +1 -0
  472. package/dist/sketch-debug/index.d.ts +9 -0
  473. package/dist/sketch-debug/index.d.ts.map +1 -0
  474. package/dist/sketch-debug/index.js +9 -0
  475. package/dist/sketch-debug/index.js.map +1 -0
  476. package/dist/sketch-debug/interactions.d.ts +19 -0
  477. package/dist/sketch-debug/interactions.d.ts.map +1 -0
  478. package/dist/sketch-debug/interactions.js +17 -0
  479. package/dist/sketch-debug/interactions.js.map +1 -0
  480. package/dist/sketch-debug/target.d.ts +48 -0
  481. package/dist/sketch-debug/target.d.ts.map +1 -0
  482. package/dist/sketch-debug/target.js +138 -0
  483. package/dist/sketch-debug/target.js.map +1 -0
  484. package/dist/stdin.d.ts +18 -19
  485. package/dist/stdin.d.ts.map +1 -1
  486. package/dist/stdin.js +160 -157
  487. package/dist/stdin.js.map +1 -1
  488. package/dist/supervisor.d.ts +97 -0
  489. package/dist/supervisor.d.ts.map +1 -0
  490. package/dist/supervisor.js +194 -0
  491. package/dist/supervisor.js.map +1 -0
  492. package/dist/terminal-clipboard.d.ts +3 -0
  493. package/dist/terminal-clipboard.d.ts.map +1 -0
  494. package/dist/terminal-clipboard.js +24 -0
  495. package/dist/terminal-clipboard.js.map +1 -0
  496. package/dist/terminal-mouse.d.ts +24 -0
  497. package/dist/terminal-mouse.d.ts.map +1 -0
  498. package/dist/terminal-mouse.js +84 -0
  499. package/dist/terminal-mouse.js.map +1 -0
  500. package/dist/terminal-screen.d.ts +41 -0
  501. package/dist/terminal-screen.d.ts.map +1 -0
  502. package/dist/terminal-screen.js +228 -0
  503. package/dist/terminal-screen.js.map +1 -0
  504. package/dist/timeline-debug/harness.d.ts +79 -0
  505. package/dist/timeline-debug/harness.d.ts.map +1 -0
  506. package/dist/timeline-debug/harness.js +122 -0
  507. package/dist/timeline-debug/harness.js.map +1 -0
  508. package/dist/timeline-debug/index.d.ts +9 -0
  509. package/dist/timeline-debug/index.d.ts.map +1 -0
  510. package/dist/timeline-debug/index.js +9 -0
  511. package/dist/timeline-debug/index.js.map +1 -0
  512. package/dist/timeline-debug/interactions.d.ts +19 -0
  513. package/dist/timeline-debug/interactions.d.ts.map +1 -0
  514. package/dist/timeline-debug/interactions.js +17 -0
  515. package/dist/timeline-debug/interactions.js.map +1 -0
  516. package/dist/timeline-debug/target.d.ts +34 -0
  517. package/dist/timeline-debug/target.d.ts.map +1 -0
  518. package/dist/timeline-debug/target.js +132 -0
  519. package/dist/timeline-debug/target.js.map +1 -0
  520. package/dist/tool-format.d.ts +54 -0
  521. package/dist/tool-format.d.ts.map +1 -0
  522. package/dist/tool-format.js +360 -0
  523. package/dist/tool-format.js.map +1 -0
  524. package/dist/useExecutionState.d.ts.map +1 -1
  525. package/dist/useExecutionState.js +8 -4
  526. package/dist/useExecutionState.js.map +1 -1
  527. package/dist/validate/index.d.ts +28 -0
  528. package/dist/validate/index.d.ts.map +1 -0
  529. package/dist/validate/index.js +51 -0
  530. package/dist/validate/index.js.map +1 -0
  531. package/dist/websocket-client.d.ts +78 -15
  532. package/dist/websocket-client.d.ts.map +1 -1
  533. package/dist/websocket-client.js +497 -171
  534. package/dist/websocket-client.js.map +1 -1
  535. package/package.json +65 -31
@@ -0,0 +1,690 @@
1
+ import { parseNumericOption } from "../numeric-options.js";
2
+ /**
3
+ * Threshold gates for one suite run: the reasons it should exit non-zero.
4
+ * Extracted from the command action so both gates — including the failing
5
+ * paths, which otherwise only a paid model run reaches — are unit-testable.
6
+ */
7
+ export function evalGateFailures(result, suiteId, opts) {
8
+ const failures = [];
9
+ // Checked first, and reported in its own words: every suite reports a rate of
10
+ // 0 over an empty set, so a run whose cases were all skipped otherwise fails
11
+ // as if the cases had run and lost. It is also the one failure a rate cannot
12
+ // express — a suite that ran half its cases and passed them reports 1.0.
13
+ if (opts.minCases !== undefined) {
14
+ const floor = parseNumericOption(opts.minCases, "--min-cases", {
15
+ integer: true,
16
+ min: 0
17
+ });
18
+ if (result.casesRan < floor) {
19
+ failures.push(`Suite "${suiteId}" ran ${result.casesRan} case(s), below --min-cases ` +
20
+ `${floor} — a rate over that many cases says nothing`);
21
+ }
22
+ }
23
+ if (opts.minScore !== undefined) {
24
+ const threshold = parseNumericOption(opts.minScore, "--min-score", {
25
+ min: 0,
26
+ max: 1
27
+ });
28
+ if (result.meanScore === undefined) {
29
+ failures.push(`--min-score: suite "${suiteId}" reports no score`);
30
+ }
31
+ else if (result.meanScore < threshold) {
32
+ failures.push(`Mean score ${result.meanScore.toFixed(2)} below threshold ${threshold}`);
33
+ }
34
+ }
35
+ if (opts.minSuccess !== undefined) {
36
+ const threshold = parseNumericOption(opts.minSuccess, "--min-success", {
37
+ min: 0,
38
+ max: 1
39
+ });
40
+ if (result.successRate < threshold) {
41
+ failures.push(`Success rate ${result.successRate.toFixed(2)} below threshold ${threshold}`);
42
+ }
43
+ }
44
+ // Spend is summed over every case, skipped ones included (they cost 0), so
45
+ // the number gated is what the run billed.
46
+ if (opts.maxCostUsd !== undefined) {
47
+ const cap = parseNumericOption(opts.maxCostUsd, "--max-cost-usd", {
48
+ min: 0
49
+ });
50
+ if (result.costUsd > cap) {
51
+ failures.push(`Total cost $${result.costUsd.toFixed(4)} above --max-cost-usd ${cap}`);
52
+ }
53
+ }
54
+ // p95 over the cases that ran: a skipped case records 0 ms and would pull
55
+ // the percentile down. Nearest-rank, so the number is a duration one case
56
+ // actually took. A run with no timings fails the gate outright — the same
57
+ // rule --min-score applies when a suite reports no score.
58
+ if (opts.maxP95DurationMs !== undefined) {
59
+ const cap = parseNumericOption(opts.maxP95DurationMs, "--max-p95-duration-ms", { integer: true, min: 0 });
60
+ const p95 = percentile95(result.durationsMs);
61
+ if (p95 === undefined) {
62
+ failures.push(`--max-p95-duration-ms: suite "${suiteId}" ran no case, nothing to time`);
63
+ }
64
+ else if (p95 > cap) {
65
+ failures.push(`p95 case duration ${p95}ms above --max-p95-duration-ms ${cap}`);
66
+ }
67
+ }
68
+ return failures;
69
+ }
70
+ /** Nearest-rank p95; undefined over an empty sample. */
71
+ function percentile95(samples) {
72
+ if (samples.length === 0)
73
+ return undefined;
74
+ const sorted = [...samples].sort((a, b) => a - b);
75
+ return sorted[Math.ceil(0.95 * sorted.length) - 1];
76
+ }
77
+ /**
78
+ * What every suite records per case and the cost/duration gates read. A
79
+ * skipped case (`skipped` set, or a non-empty reason string) cost nothing and
80
+ * took no time, so it stays in the sum and leaves the timings.
81
+ */
82
+ function runMetrics(cases) {
83
+ return {
84
+ costUsd: cases.reduce((sum, c) => sum + c.costUsd, 0),
85
+ durationsMs: cases.filter((c) => !c.skipped).map((c) => c.durationMs)
86
+ };
87
+ }
88
+ /**
89
+ * Filter a suite's cases down to `--cases`, rejecting ids the suite doesn't
90
+ * have. Undefined ids run the whole suite.
91
+ */
92
+ function selectCases(all, caseIds) {
93
+ if (!caseIds)
94
+ return all;
95
+ const wanted = new Set(caseIds);
96
+ const picked = all.filter((c) => wanted.has(c.id));
97
+ const pickedIds = new Set(picked.map((c) => c.id));
98
+ const missing = [...wanted].filter((id) => !pickedIds.has(id));
99
+ if (missing.length > 0) {
100
+ throw new Error(`Unknown case ids: ${missing.join(", ")} (see --list)`);
101
+ }
102
+ return picked;
103
+ }
104
+ /** Graph authoring suite — `authorGraph` over the typed DSL pack. */
105
+ const graphPlannerSuite = {
106
+ id: "graph-planner",
107
+ description: "Run the graph authoring eval suite (authorGraph, typed DSL pack) against a provider/model and report metrics",
108
+ async listCases() {
109
+ const { GRAPH_PLANNER_EVAL_CASES } = await import("@nodetool-ai/agents");
110
+ return GRAPH_PLANNER_EVAL_CASES.map((c) => ({
111
+ id: c.id,
112
+ description: c.description,
113
+ needsModelProviders: c.needsModelProviders
114
+ }));
115
+ },
116
+ async run(deps) {
117
+ const { GRAPH_PLANNER_EVAL_CASES, runGraphPlannerEval, formatEvalReport } = await import("@nodetool-ai/agents");
118
+ const cases = selectCases(GRAPH_PLANNER_EVAL_CASES, deps.caseIds);
119
+ deps.log(`Running ${cases.length} case(s) with ${deps.providerId}/${deps.model}` +
120
+ (deps.providers && Object.keys(deps.providers).length > 0
121
+ ? ` (find_model: ${Object.keys(deps.providers).join(", ")})`
122
+ : " (no model providers — model-dependent cases skipped)"));
123
+ const evalOptions = {
124
+ provider: deps.provider,
125
+ model: deps.model,
126
+ registry: deps.registry,
127
+ providers: deps.providers,
128
+ cases,
129
+ onEvent: deps.onEvent
130
+ };
131
+ if (deps.maxIterations) {
132
+ evalOptions.maxIterations = deps.maxIterations;
133
+ }
134
+ const report = await runGraphPlannerEval(evalOptions);
135
+ return {
136
+ report,
137
+ ...runMetrics(report.cases),
138
+ formatted: formatEvalReport(report),
139
+ successRate: report.summary.successRate,
140
+ meanScore: report.summary.meanScore,
141
+ casesRan: report.summary.total - report.summary.skipped
142
+ };
143
+ }
144
+ };
145
+ /**
146
+ * End-to-end graph suite: plan a workflow, run it on the kernel, judge the
147
+ * outputs against the case's goal.
148
+ *
149
+ * This is the one suite that executes what the planner produced, so it needs a
150
+ * `GraphRunner` — built here over `ExecutionSession` — and it costs real
151
+ * inference twice per case (the run, then the judge). Its success rate is the
152
+ * end-to-end claim: planned AND ran AND achieved the goal.
153
+ */
154
+ const graphE2eSuite = {
155
+ id: "graph-e2e",
156
+ description: "Plan a workflow with the agent, execute it, and judge whether the outputs achieve the goal",
157
+ async listCases() {
158
+ const { GRAPH_E2E_EVAL_CASES } = await import("@nodetool-ai/agents");
159
+ return GRAPH_E2E_EVAL_CASES.map((c) => ({
160
+ id: c.id,
161
+ description: c.description,
162
+ needsModelProviders: c.needsModelProviders
163
+ }));
164
+ },
165
+ async run(deps) {
166
+ const { GRAPH_E2E_EVAL_CASES, runGraphE2eEval, formatGraphE2eReport } = await import("@nodetool-ai/agents");
167
+ const { createEvalGraphRunner } = await import("../evals/graph-runner.js");
168
+ const cases = selectCases(GRAPH_E2E_EVAL_CASES, deps.caseIds);
169
+ deps.log(`Running ${cases.length} graph-e2e case(s) with ${deps.providerId}/${deps.model}` +
170
+ (deps.providers && Object.keys(deps.providers).length > 0
171
+ ? ` (find_model: ${Object.keys(deps.providers).join(", ")})`
172
+ : " (no model providers — model-dependent cases skipped)"));
173
+ const evalOptions = {
174
+ provider: deps.provider,
175
+ model: deps.model,
176
+ registry: deps.registry,
177
+ providers: deps.providers,
178
+ runGraph: createEvalGraphRunner(),
179
+ cases,
180
+ timeoutMs: deps.timeoutMs,
181
+ onEvent: deps.onEvent
182
+ };
183
+ // Without this the judge is the run's own provider/model grading itself.
184
+ if (deps.judge) {
185
+ evalOptions.judgeProvider = deps.judge.provider;
186
+ evalOptions.judgeModel = deps.judge.model;
187
+ }
188
+ if (deps.maxIterations) {
189
+ evalOptions.maxIterations = deps.maxIterations;
190
+ }
191
+ const report = await runGraphE2eEval(evalOptions);
192
+ return {
193
+ report,
194
+ ...runMetrics(report.cases),
195
+ formatted: formatGraphE2eReport(report),
196
+ successRate: report.summary.successRate,
197
+ casesRan: report.summary.total - report.summary.skipped
198
+ };
199
+ }
200
+ };
201
+ /**
202
+ * Code node authoring suite (`CodePlanner` + `submit_code`).
203
+ *
204
+ * Its gate reads post-repair acceptance — a submission accepted at all within
205
+ * the round cap — while the report also carries first-pass acceptance, which is
206
+ * what the model managed without the tool's feedback.
207
+ */
208
+ const codeGenSuite = {
209
+ id: "code-gen",
210
+ description: "Run the Code node authoring eval suite (CodePlanner writes one typed Code node) against a provider/model, reporting first-pass and post-repair acceptance",
211
+ async listCases() {
212
+ const { CODE_GEN_EVAL_CASES } = await import("@nodetool-ai/agents");
213
+ return CODE_GEN_EVAL_CASES.map((c) => ({
214
+ id: c.id,
215
+ description: c.description
216
+ }));
217
+ },
218
+ async run(deps) {
219
+ const { CODE_GEN_EVAL_CASES, runCodeGenEval, formatCodeGenReport } = await import("@nodetool-ai/agents");
220
+ const cases = selectCases(CODE_GEN_EVAL_CASES, deps.caseIds);
221
+ deps.log(`Running ${cases.length} code-gen case(s) with ${deps.providerId}/${deps.model}`);
222
+ const report = await runCodeGenEval({
223
+ provider: deps.provider,
224
+ model: deps.model,
225
+ cases,
226
+ onEvent: deps.onEvent
227
+ });
228
+ return {
229
+ report,
230
+ ...runMetrics(report.cases),
231
+ formatted: formatCodeGenReport(report),
232
+ successRate: report.summary.postRepairRate,
233
+ // The suite skips nothing: every case is a Code body the planner writes.
234
+ casesRan: report.summary.total
235
+ };
236
+ }
237
+ };
238
+ /** Sub-agent execution suite (RunSubtaskTool + inherited toolset). */
239
+ const subtaskSuite = {
240
+ id: "subtask",
241
+ description: "Run the sub-agent execution eval suite (run_subtask delegates to a child agent that runs the inherited tools) against a provider/model",
242
+ async listCases() {
243
+ const { SUBTASK_EVAL_CASES } = await import("@nodetool-ai/agents");
244
+ return SUBTASK_EVAL_CASES.map((c) => ({
245
+ id: c.id,
246
+ description: c.description,
247
+ needsModelProviders: c.needsModelProviders
248
+ }));
249
+ },
250
+ async run(deps) {
251
+ const { SUBTASK_EVAL_CASES, runSubtaskEval, formatSubtaskReport } = await import("@nodetool-ai/agents");
252
+ const cases = selectCases(SUBTASK_EVAL_CASES, deps.caseIds);
253
+ deps.log(`Running ${cases.length} subtask case(s) with ${deps.providerId}/${deps.model}` +
254
+ (deps.providers && Object.keys(deps.providers).length > 0
255
+ ? ""
256
+ : " (no model providers — model-dependent cases skipped)"));
257
+ const report = await runSubtaskEval({
258
+ provider: deps.provider,
259
+ model: deps.model,
260
+ providers: deps.providers,
261
+ cases,
262
+ maxIterations: deps.maxIterations,
263
+ onEvent: deps.onEvent
264
+ });
265
+ return {
266
+ report,
267
+ ...runMetrics(report.cases),
268
+ formatted: formatSubtaskReport(report),
269
+ successRate: report.summary.successRate,
270
+ casesRan: report.summary.total - report.summary.skipped
271
+ };
272
+ }
273
+ };
274
+ /** CodeAct execution suite. */
275
+ const codeActSuite = {
276
+ id: "codeact",
277
+ description: "Run the CodeAct execution eval suite (steps act by writing sandboxed JavaScript over the toolbelt — docs/codeact-design.md) against a provider/model",
278
+ async listCases() {
279
+ const { CODEACT_EVAL_CASES, CODEACT_API_EVAL_CASES, CODEACT_SANDBOX_PACK_EVAL_CASES } = await import("@nodetool-ai/agents");
280
+ return [
281
+ ...CODEACT_EVAL_CASES,
282
+ ...CODEACT_API_EVAL_CASES,
283
+ ...CODEACT_SANDBOX_PACK_EVAL_CASES
284
+ ].map((c) => ({
285
+ id: c.id,
286
+ description: c.description
287
+ }));
288
+ },
289
+ async run(deps) {
290
+ const { CODEACT_EVAL_CASES, CODEACT_API_EVAL_CASES, CODEACT_SANDBOX_PACK_EVAL_CASES, runCodeActEval, formatCodeActReport } = await import("@nodetool-ai/agents");
291
+ const cases = selectCases([
292
+ ...CODEACT_EVAL_CASES,
293
+ ...CODEACT_API_EVAL_CASES,
294
+ ...CODEACT_SANDBOX_PACK_EVAL_CASES
295
+ ], deps.caseIds);
296
+ deps.log(`Running ${cases.length} codeact case(s) with ${deps.providerId}/${deps.model}`);
297
+ const report = await runCodeActEval({
298
+ provider: deps.provider,
299
+ model: deps.model,
300
+ cases,
301
+ maxIterations: deps.maxIterations,
302
+ onEvent: deps.onEvent
303
+ });
304
+ return {
305
+ report,
306
+ ...runMetrics(report.cases),
307
+ formatted: formatCodeActReport(report),
308
+ successRate: report.summary.successRate,
309
+ meanScore: report.summary.meanScore,
310
+ // The suite skips nothing: its toolbelt is instrumented, not configured.
311
+ casesRan: report.summary.total
312
+ };
313
+ }
314
+ };
315
+ /** TaskPlanner multi-task (plan mode) DAG-quality suite. */
316
+ const taskPlannerSuite = {
317
+ id: "task-planner",
318
+ description: "Run the TaskPlanner (plan mode) eval suite — multi-task DAG quality: parallelism, decomposition size, tool routing — against a provider/model",
319
+ async listCases() {
320
+ const { TASK_PLANNER_EVAL_CASES } = await import("@nodetool-ai/agents");
321
+ return TASK_PLANNER_EVAL_CASES.map((c) => ({
322
+ id: c.id,
323
+ description: c.description,
324
+ needsModelProviders: c.needsModelProviders
325
+ }));
326
+ },
327
+ async run(deps) {
328
+ const { TASK_PLANNER_EVAL_CASES, runTaskPlannerEval, formatTaskPlanReport } = await import("@nodetool-ai/agents");
329
+ const cases = selectCases(TASK_PLANNER_EVAL_CASES, deps.caseIds);
330
+ deps.log(`Running ${cases.length} task-planner case(s) with ${deps.providerId}/${deps.model}`);
331
+ const report = await runTaskPlannerEval({
332
+ provider: deps.provider,
333
+ model: deps.model,
334
+ providers: deps.providers,
335
+ cases,
336
+ systemPrompt: deps.systemPrompt,
337
+ onEvent: deps.onEvent
338
+ });
339
+ return {
340
+ report,
341
+ ...runMetrics(report.cases),
342
+ formatted: formatTaskPlanReport(report),
343
+ successRate: report.summary.successRate,
344
+ meanScore: report.summary.meanScore,
345
+ casesRan: report.summary.total - report.summary.skipped
346
+ };
347
+ }
348
+ };
349
+ /**
350
+ * Mini-app build suite: prompt in, verified `ApplicationBundle` out.
351
+ *
352
+ * The only suite that both plans workflows and runs them, so it needs the
353
+ * kernel runner (`runOnServer`, the same one `nodetool app debug` uses) and a
354
+ * real `ProcessingContext`. Its deterministic cases author from a script and
355
+ * never touch the provider, which is why it is the one suite that declares a
356
+ * keyless set: `--keyless` runs exactly those, with no API key at all. The gate
357
+ * reads green-within-budget; the report also carries the one-shot rate the PRD
358
+ * calls the north star.
359
+ */
360
+ const appBuildSuite = {
361
+ id: "app-build",
362
+ description: "Run the mini-app build eval suite (nodetool app build end to end) against a provider/model, reporting one-shot and green-within-budget rates",
363
+ async listCases() {
364
+ const { APP_BUILD_EVAL_CASES } = await import("@nodetool-ai/agents");
365
+ return APP_BUILD_EVAL_CASES.map((c) => ({
366
+ id: c.id,
367
+ description: c.description,
368
+ needsModelProviders: c.needsModelProviders
369
+ }));
370
+ },
371
+ async keylessCaseIds() {
372
+ // The suite's own marker, not a list a caller copies: a case that gains or
373
+ // loses `deterministic` moves `--keyless` with it.
374
+ const { APP_BUILD_DETERMINISTIC_CASE_IDS } = await import("@nodetool-ai/agents");
375
+ return APP_BUILD_DETERMINISTIC_CASE_IDS;
376
+ },
377
+ async run(deps) {
378
+ const [{ APP_BUILD_EVAL_CASES, runAppBuildEval, formatAppBuildReport }, { runOnServer }, { getDefaultAssetsPath }, { resolveLocalSecret }, { ProcessingContext }, { FileStorageAdapter }] = await Promise.all([
379
+ import("@nodetool-ai/agents"),
380
+ import("../debug/server-runner.js"),
381
+ import("@nodetool-ai/config"),
382
+ import("../local-secrets.js"),
383
+ import("@nodetool-ai/runtime"),
384
+ import("@nodetool-ai/storage")
385
+ ]);
386
+ const { setupLocalDb } = await import("./local-db.js");
387
+ await setupLocalDb();
388
+ const cases = selectCases(APP_BUILD_EVAL_CASES, deps.caseIds);
389
+ deps.log(`Running ${cases.length} app-build case(s) with ${deps.providerId}/${deps.model}` +
390
+ (deps.providers && Object.keys(deps.providers).length > 0
391
+ ? ` (find_model: ${Object.keys(deps.providers).join(", ")})`
392
+ : " (no model providers — prompt cases skipped)"));
393
+ const evalOptions = {
394
+ provider: deps.provider,
395
+ model: deps.model,
396
+ registry: deps.registry,
397
+ context: new ProcessingContext({
398
+ jobId: `eval-app-build-${Date.now()}`,
399
+ workflowId: null,
400
+ userId: "1",
401
+ secretResolver: resolveLocalSecret,
402
+ storage: new FileStorageAdapter(getDefaultAssetsPath())
403
+ }),
404
+ runOnServer,
405
+ cases,
406
+ onEvent: deps.onEvent
407
+ };
408
+ if (deps.providers) {
409
+ evalOptions.providers = deps.providers;
410
+ }
411
+ // `--judge-model` overrides `buildApp`'s own judge default.
412
+ if (deps.judge) {
413
+ evalOptions.judge = {
414
+ enabled: true,
415
+ provider: deps.judge.provider,
416
+ model: deps.judge.model
417
+ };
418
+ }
419
+ if (deps.timeoutMs !== undefined) {
420
+ evalOptions.timeoutMs = deps.timeoutMs;
421
+ }
422
+ const report = await runAppBuildEval(evalOptions);
423
+ return {
424
+ report,
425
+ ...runMetrics(report.cases),
426
+ formatted: formatAppBuildReport(report),
427
+ successRate: report.summary.greenWithinBudgetRate,
428
+ meanScore: report.summary.meanScore,
429
+ casesRan: report.summary.ran
430
+ };
431
+ }
432
+ };
433
+ /**
434
+ * Build a tool-loop suite (multi-turn `ui_*` tool calling) from a named export
435
+ * in `@nodetool-ai/agents`. The graph-editor suite and the five editor-surface
436
+ * suites (script/sketch/timeline/storyboard/3D) all share the generic runner
437
+ * and report shape — only the case array differs — so each is data, not code.
438
+ */
439
+ function makeToolLoopSuite(id, description, casesOf) {
440
+ const pickCases = (mod) => {
441
+ // The declaration says this is an array; a stale packages/*/dist can still
442
+ // hand back nothing, so say which suite lost its cases rather than failing
443
+ // later on `.map` of undefined.
444
+ const picked = casesOf(mod);
445
+ if (!Array.isArray(picked)) {
446
+ throw new Error(`Eval suite "${id}" found no case array in @nodetool-ai/agents. ` +
447
+ `A stale packages/*/dist is the usual cause — rebuild with ` +
448
+ `npm run build:packages.`);
449
+ }
450
+ return picked;
451
+ };
452
+ return {
453
+ id,
454
+ description,
455
+ async listCases() {
456
+ const mod = await import("@nodetool-ai/agents");
457
+ return pickCases(mod).map((c) => ({
458
+ id: c.id,
459
+ description: c.description,
460
+ needsModelProviders: c.needsModelProviders
461
+ }));
462
+ },
463
+ async run(deps) {
464
+ const mod = await import("@nodetool-ai/agents");
465
+ const { runToolLoopEval, formatToolLoopReport } = mod;
466
+ const cases = selectCases(pickCases(mod), deps.caseIds);
467
+ deps.log(`Running ${cases.length} ${id} case(s) with ${deps.providerId}/${deps.model}`);
468
+ const report = await runToolLoopEval({
469
+ provider: deps.provider,
470
+ model: deps.model,
471
+ cases,
472
+ maxIterations: deps.maxIterations,
473
+ onEvent: deps.onEvent
474
+ });
475
+ return {
476
+ report,
477
+ ...runMetrics(report.cases),
478
+ formatted: formatToolLoopReport(report),
479
+ successRate: report.summary.successRate,
480
+ meanScore: report.summary.meanScore,
481
+ casesRan: report.summary.total - report.summary.skipped
482
+ };
483
+ }
484
+ };
485
+ }
486
+ /** All evaluation suites exposed under `nodetool eval <suite>`. */
487
+ export const EVAL_SUITES = [
488
+ graphPlannerSuite,
489
+ graphE2eSuite,
490
+ codeGenSuite,
491
+ taskPlannerSuite,
492
+ subtaskSuite,
493
+ codeActSuite,
494
+ appBuildSuite,
495
+ makeToolLoopSuite("tool-loop", "Run the frontend graph-editor tool-loop eval suite (ui_* graph tools) against a provider/model and report metrics", (mod) => mod.TOOL_LOOP_EVAL_CASES),
496
+ makeToolLoopSuite("workflow-escalation", "Run the workflow-tool escalation eval suite (ui_* graph tools plus an ask_user channel to a scripted user) against a provider/model", (mod) => mod.WORKFLOW_ESCALATION_TOOL_LOOP_CASES),
497
+ makeToolLoopSuite("script-tools", "Run the Script surface tool-loop eval suite (ui_script_* tools) against a provider/model", (mod) => mod.SCRIPT_TOOL_LOOP_CASES),
498
+ makeToolLoopSuite("jsscript-tools", "Run the JS-script surface tool-loop eval suite (ui_jsscript_* tools, real sandbox execution) against a provider/model", (mod) => mod.JS_SCRIPT_TOOL_LOOP_CASES),
499
+ makeToolLoopSuite("sketch-tools", "Run the Sketch/image-editor surface tool-loop eval suite (ui_sketch_* tools) against a provider/model", (mod) => mod.SKETCH_TOOL_LOOP_CASES),
500
+ makeToolLoopSuite("timeline-tools", "Run the Timeline/video-editor surface tool-loop eval suite (ui_timeline_* tools) against a provider/model", (mod) => mod.TIMELINE_TOOL_LOOP_CASES),
501
+ makeToolLoopSuite("storyboard-tools", "Run the Storyboard surface tool-loop eval suite (ui_storyboard_* tools) against a provider/model", (mod) => mod.STORYBOARD_TOOL_LOOP_CASES),
502
+ makeToolLoopSuite("model3d-tools", "Run the 3D model-editor surface tool-loop eval suite (ui_3d_* tools) against a provider/model", (mod) => mod.MODEL3D_TOOL_LOOP_CASES),
503
+ makeToolLoopSuite("app-tools", "Run the App Builder surface tool-loop eval suite (ui_app_* tools) against a provider/model", (mod) => mod.APP_TOOL_LOOP_CASES),
504
+ makeToolLoopSuite("memory-tools", "Run the memory tool-loop eval suite (memory_*/asset tools, real DB) against a provider/model", (mod) => mod.MEMORY_TOOL_LOOP_CASES),
505
+ makeToolLoopSuite("creative-pipeline", "Run the long-horizon creative eval: one commission carried through brief, ideation, sketch, storyboard, cut and review across the composed ui_sketch_*/ui_storyboard_*/ui_timeline_* surfaces", (mod) => mod.CREATIVE_PIPELINE_TOOL_LOOP_CASES)
506
+ ];
507
+ /**
508
+ * The case ids one invocation should run: `--cases` verbatim, `--keyless` from
509
+ * the suite's own declaration, or undefined for the whole suite.
510
+ */
511
+ async function resolveCaseIds(suite, opts) {
512
+ if (opts.keyless) {
513
+ if (opts.cases) {
514
+ throw new Error("--keyless and --cases select cases two ways; pass one");
515
+ }
516
+ const ids = suite.keylessCaseIds ? await suite.keylessCaseIds() : [];
517
+ if (ids.length === 0) {
518
+ const offered = EVAL_SUITES.filter((s) => s.id !== suite.id && s.keylessCaseIds).map((s) => s.id);
519
+ throw new Error(`Suite "${suite.id}" has no keyless cases: every case it runs needs a ` +
520
+ `live provider.` +
521
+ (offered.length > 0 ? ` Suites that do: ${offered.join(", ")}.` : ""));
522
+ }
523
+ return [...ids];
524
+ }
525
+ if (!opts.cases)
526
+ return undefined;
527
+ return opts.cases
528
+ .split(",")
529
+ .map((s) => s.trim())
530
+ .filter(Boolean);
531
+ }
532
+ /**
533
+ * Shared runner for every suite: handles `--list`, builds the provider/
534
+ * registry/find-model deps, runs the suite, and applies the common
535
+ * `--out`/`--json`/`--min-success` handling.
536
+ */
537
+ async function runSuite(suite, opts) {
538
+ if (opts.list) {
539
+ const keyless = new Set(suite.keylessCaseIds ? await suite.keylessCaseIds() : []);
540
+ // Marked here rather than described in a doc: which cases run without a key
541
+ // is a property of the suite, and this is the command that reports it.
542
+ const cases = (await suite.listCases()).map((c) => ({
543
+ ...c,
544
+ keyless: keyless.has(c.id)
545
+ }));
546
+ if (opts.json) {
547
+ console.log(JSON.stringify(cases, null, 2));
548
+ return;
549
+ }
550
+ for (const c of cases) {
551
+ console.log(`${c.id.padEnd(24)} ${c.description}` +
552
+ (c.keyless ? " (keyless)" : "") +
553
+ (c.needsModelProviders ? " (needs model providers)" : ""));
554
+ }
555
+ return;
556
+ }
557
+ if (!opts.provider || !opts.model) {
558
+ const message = "--provider and --model are required (or use --list)";
559
+ console.error(message);
560
+ if (opts.json)
561
+ console.log(JSON.stringify({ error: message }, null, 2));
562
+ process.exitCode = 1;
563
+ return;
564
+ }
565
+ try {
566
+ const [{ createProviderStrict, buildConfiguredProviders }, registryMod] = await Promise.all([
567
+ import("../providers.js"),
568
+ import("../node-registry.js")
569
+ ]);
570
+ const provider = await createProviderStrict(opts.provider);
571
+ const registry = registryMod.buildFullRegistry();
572
+ const providers = opts.findModel === false ? undefined : await buildConfiguredProviders();
573
+ const caseIds = await resolveCaseIds(suite, opts);
574
+ const judge = opts.judgeModel
575
+ ? await resolveJudge(opts.judgeModel, createProviderStrict)
576
+ : undefined;
577
+ const runOptions = {
578
+ provider,
579
+ providerId: opts.provider,
580
+ model: opts.model,
581
+ registry,
582
+ providers,
583
+ caseIds,
584
+ maxIterations: opts.maxIterations !== undefined
585
+ ? parseNumericOption(opts.maxIterations, "--max-iterations", {
586
+ integer: true,
587
+ min: 1
588
+ })
589
+ : undefined,
590
+ timeoutMs: opts.timeout !== undefined
591
+ ? parseNumericOption(opts.timeout, "--timeout", {
592
+ integer: true,
593
+ min: 0
594
+ })
595
+ : undefined,
596
+ log: (line) => {
597
+ if (!opts.json)
598
+ console.log(line);
599
+ },
600
+ onEvent: (line) => {
601
+ if (!opts.json)
602
+ console.log(line);
603
+ }
604
+ };
605
+ // `--no-agent-prompt` scores the bare contract; `--system-prompt` swaps in
606
+ // another caller's. Neither given, the suite plans behind the prompt the
607
+ // product actually sends.
608
+ if (opts.agentPrompt === false) {
609
+ runOptions.systemPrompt = "";
610
+ }
611
+ else if (opts.systemPrompt !== undefined) {
612
+ runOptions.systemPrompt = opts.systemPrompt;
613
+ }
614
+ if (judge) {
615
+ runOptions.judge = judge;
616
+ }
617
+ const result = await suite.run(runOptions);
618
+ if (opts.out) {
619
+ const { writeFile } = await import("node:fs/promises");
620
+ await writeFile(opts.out, JSON.stringify(result.report, null, 2), "utf-8");
621
+ if (!opts.json)
622
+ console.log(`Report written to ${opts.out}`);
623
+ }
624
+ if (opts.json) {
625
+ console.log(JSON.stringify(result.report, null, 2));
626
+ }
627
+ else {
628
+ console.log("\n" + result.formatted);
629
+ }
630
+ const gateFailures = evalGateFailures(result, suite.id, opts);
631
+ for (const line of gateFailures)
632
+ console.error(line);
633
+ if (gateFailures.length > 0)
634
+ process.exitCode = 1;
635
+ }
636
+ catch (err) {
637
+ const message = err instanceof Error ? err.message : String(err);
638
+ console.error(message);
639
+ // An agent reading `--json` gets parseable output on the failure path too.
640
+ if (opts.json)
641
+ console.log(JSON.stringify({ error: message }, null, 2));
642
+ process.exitCode = 1;
643
+ }
644
+ }
645
+ /**
646
+ * Resolve `--judge-model` (`provider/model`) into a live provider. Model ids
647
+ * carry slashes themselves, so the split is decided by the provider registry,
648
+ * exactly as `--supervisor-model` does.
649
+ */
650
+ async function resolveJudge(spec, createProvider) {
651
+ const { listRegisteredProviderIds } = await import("@nodetool-ai/runtime");
652
+ const registered = listRegisteredProviderIds();
653
+ const cut = spec.indexOf("/");
654
+ const head = cut === -1 ? spec : spec.slice(0, cut).toLowerCase();
655
+ if (cut === -1 || !registered.includes(head)) {
656
+ throw new Error(`--judge-model must be "<provider>/<model>" with a registered provider ` +
657
+ `(got "${spec}"). Example: openai/gpt-5.4-mini.`);
658
+ }
659
+ return { provider: await createProvider(head), model: spec.slice(cut + 1) };
660
+ }
661
+ export function registerEvalCommand(program) {
662
+ const evalCmd = program
663
+ .command("eval")
664
+ .description("Evaluation suites for the agent system");
665
+ for (const suite of EVAL_SUITES) {
666
+ evalCmd
667
+ .command(suite.id)
668
+ .description(suite.description)
669
+ .option("-p, --provider <id>", "Provider id (anthropic, openai, claude_agent_sdk, ollama, ...)")
670
+ .option("-m, --model <id>", "Model id for the provider")
671
+ .option("--cases <ids>", "Comma-separated case ids to run (default: all; see --list)")
672
+ .option("--list", "List available cases and exit")
673
+ .option("--json", "Print the full report as JSON")
674
+ .option("--out <path>", "Write the JSON report to a file")
675
+ .option("--max-iterations <n>", "Turn cap per case for loop-style suites (tool-loop; default 12)")
676
+ .option("--timeout <ms>", "Per-case execution timeout for suites that run what they plan (graph-e2e; default 300000)")
677
+ .option("--judge-model <provider/model>", "Model that judges outputs for the self-judging suites (graph-e2e, app-build). Default: the run's own provider/model, which grades its own work")
678
+ .option("--min-success <rate>", "Exit non-zero when the success rate is below this threshold (0..1)")
679
+ .option("--min-cases <n>", "Exit non-zero when fewer than n cases actually ran (skipped cases do not count)")
680
+ .option("--keyless", "Run only the cases that need no API key and no network (see --list)")
681
+ .option("--no-find-model", "Run without configured model providers (skips model-dependent cases)")
682
+ .option("--min-score <rate>", "Exit non-zero when the mean expectation score is below this threshold (0..1)")
683
+ .option("--system-prompt <text>", "Caller preamble the planner suites plan behind (default: the AgentNode's own prompt)")
684
+ .option("--no-agent-prompt", "Plan with no caller preamble — scores the bare planner contract")
685
+ .option("--max-cost-usd <usd>", "Exit non-zero when the run's total provider spend exceeds this")
686
+ .option("--max-p95-duration-ms <ms>", "Exit non-zero when the p95 case duration (skipped cases excluded) exceeds this")
687
+ .action((opts) => runSuite(suite, opts));
688
+ }
689
+ }
690
+ //# sourceMappingURL=eval.js.map