@bjoernrochel/sevro 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/CONTRIBUTING.md +34 -4
  2. package/README.md +7 -6
  3. package/dist/examples/basic/graded.json +13 -0
  4. package/dist/examples/basic/host.js +9 -0
  5. package/dist/examples/basic/host.js.map +1 -0
  6. package/dist/examples/basic/prompt-only.json +7 -0
  7. package/dist/examples/recipes/candidate.js +23 -0
  8. package/dist/examples/recipes/candidate.js.map +1 -0
  9. package/dist/examples/recipes/cases/coding-change.json +21 -0
  10. package/dist/examples/recipes/cases/host-tools.json +21 -0
  11. package/dist/examples/recipes/cases/mise.json +21 -0
  12. package/dist/examples/recipes/cases/node.json +21 -0
  13. package/dist/examples/recipes/cases/python-uv.json +21 -0
  14. package/dist/examples/recipes/cases/semantic.json +17 -0
  15. package/dist/examples/recipes/coding-change/check.js +16 -0
  16. package/dist/examples/recipes/coding-change/check.js.map +1 -0
  17. package/dist/examples/recipes/executable.js +20 -0
  18. package/dist/examples/recipes/executable.js.map +1 -0
  19. package/dist/examples/recipes/extension-artifacts.js +56 -0
  20. package/dist/examples/recipes/extension-artifacts.js.map +1 -0
  21. package/dist/examples/recipes/extension-methods.js +167 -0
  22. package/dist/examples/recipes/extension-methods.js.map +1 -0
  23. package/dist/examples/recipes/extension.js +28 -0
  24. package/dist/examples/recipes/extension.js.map +1 -0
  25. package/dist/examples/recipes/modules.js +9 -0
  26. package/dist/examples/recipes/modules.js.map +1 -0
  27. package/dist/examples/recipes/repository-skill/.agents/skills/startup-guide/SKILL.md +7 -0
  28. package/dist/examples/recipes/repository-skill/.claude/skills/startup-guide/SKILL.md +7 -0
  29. package/dist/examples/recipes/repository-skill/README.md +3 -0
  30. package/dist/examples/recipes/run-inputs.js +144 -0
  31. package/dist/examples/recipes/run-inputs.js.map +1 -0
  32. package/dist/examples/recipes/run-options.js +103 -0
  33. package/dist/examples/recipes/run-options.js.map +1 -0
  34. package/dist/examples/recipes/run.js +62 -0
  35. package/dist/examples/recipes/run.js.map +1 -0
  36. package/dist/examples/recipes/runtime/empty.json +1 -0
  37. package/dist/examples/recipes/runtime/goals.json +1 -0
  38. package/dist/examples/recipes/runtime/mise.json +6 -0
  39. package/dist/examples/recipes/runtime/path.json +1 -0
  40. package/dist/examples/recipes/runtime/plugins.json +4 -0
  41. package/dist/examples/recipes/runtime/python-uv.json +10 -0
  42. package/dist/examples/recipes/semantic-judge.js +27 -0
  43. package/dist/examples/recipes/semantic-judge.js.map +1 -0
  44. package/dist/examples/templates/coding/adapter.js +14 -0
  45. package/dist/examples/templates/coding/adapter.js.map +1 -0
  46. package/dist/examples/templates/coding/case.json +15 -0
  47. package/dist/examples/templates/repository-skill/.agents/skills/startup-guide/SKILL.md +6 -0
  48. package/dist/examples/templates/repository-skill/extension-data.js +61 -0
  49. package/dist/examples/templates/repository-skill/extension-data.js.map +1 -0
  50. package/dist/examples/templates/repository-skill/extension.js +29 -0
  51. package/dist/examples/templates/repository-skill/extension.js.map +1 -0
  52. package/dist/examples/templates/response/adapter.js +13 -0
  53. package/dist/examples/templates/response/adapter.js.map +1 -0
  54. package/dist/examples/templates/response/case.json +13 -0
  55. package/dist/src/advisory.js +86 -0
  56. package/dist/src/advisory.js.map +1 -0
  57. package/dist/src/candidate-artifacts.js +139 -0
  58. package/dist/src/candidate-artifacts.js.map +1 -0
  59. package/dist/src/candidate-codex-state.js +110 -0
  60. package/dist/src/candidate-codex-state.js.map +1 -0
  61. package/dist/src/case-validation.js +92 -0
  62. package/dist/src/case-validation.js.map +1 -0
  63. package/dist/src/cli/cancellation.js +21 -0
  64. package/dist/src/cli/cancellation.js.map +1 -0
  65. package/dist/src/cli/command.js +60 -0
  66. package/dist/src/cli/command.js.map +1 -0
  67. package/dist/src/cli/completion.js +14 -0
  68. package/dist/src/cli/completion.js.map +1 -0
  69. package/dist/src/cli/demo.js +45 -0
  70. package/dist/src/cli/demo.js.map +1 -0
  71. package/dist/src/cli/evaluation.js +40 -0
  72. package/dist/src/cli/evaluation.js.map +1 -0
  73. package/dist/src/cli/extension.js +54 -0
  74. package/dist/src/cli/extension.js.map +1 -0
  75. package/dist/src/cli/help.js +190 -0
  76. package/dist/src/cli/help.js.map +1 -0
  77. package/dist/src/cli/hosts.js +33 -0
  78. package/dist/src/cli/hosts.js.map +1 -0
  79. package/dist/src/cli/init-settings.js +29 -0
  80. package/dist/src/cli/init-settings.js.map +1 -0
  81. package/dist/src/cli/init.js +82 -0
  82. package/dist/src/cli/init.js.map +1 -0
  83. package/dist/src/cli/invocation.js +431 -0
  84. package/dist/src/cli/invocation.js.map +1 -0
  85. package/dist/src/cli/loading.js +110 -0
  86. package/dist/src/cli/loading.js.map +1 -0
  87. package/dist/src/cli/preparation.js +88 -0
  88. package/dist/src/cli/preparation.js.map +1 -0
  89. package/dist/src/cli/presentation.js +61 -0
  90. package/dist/src/cli/presentation.js.map +1 -0
  91. package/dist/src/cli/progress.js +5 -0
  92. package/dist/src/cli/progress.js.map +1 -0
  93. package/dist/src/cli/run-manifest.js +108 -0
  94. package/dist/src/cli/run-manifest.js.map +1 -0
  95. package/dist/src/cli/run-options.js +367 -0
  96. package/dist/src/cli/run-options.js.map +1 -0
  97. package/dist/src/cli/run-overrides.js +51 -0
  98. package/dist/src/cli/run-overrides.js.map +1 -0
  99. package/dist/src/cli/settings.js +127 -0
  100. package/dist/src/cli/settings.js.map +1 -0
  101. package/dist/src/cli/summary.js +28 -0
  102. package/dist/src/cli/summary.js.map +1 -0
  103. package/dist/src/cli.js +20 -0
  104. package/dist/src/cli.js.map +1 -0
  105. package/dist/src/contract-types.js +2 -0
  106. package/dist/src/contract-types.js.map +1 -0
  107. package/dist/src/engine.js +4 -0
  108. package/dist/src/engine.js.map +1 -0
  109. package/dist/src/evaluation/advisory.js +85 -0
  110. package/dist/src/evaluation/advisory.js.map +1 -0
  111. package/dist/src/evaluation/check-plan.js +292 -0
  112. package/dist/src/evaluation/check-plan.js.map +1 -0
  113. package/dist/src/evaluation/collection.js +61 -0
  114. package/dist/src/evaluation/collection.js.map +1 -0
  115. package/dist/src/evaluation/context.js +2 -0
  116. package/dist/src/evaluation/context.js.map +1 -0
  117. package/dist/src/evaluation/grading-host.js +28 -0
  118. package/dist/src/evaluation/grading-host.js.map +1 -0
  119. package/dist/src/evaluation/grading.js +154 -0
  120. package/dist/src/evaluation/grading.js.map +1 -0
  121. package/dist/src/evaluation/invocation-plan.js +312 -0
  122. package/dist/src/evaluation/invocation-plan.js.map +1 -0
  123. package/dist/src/evaluation/plan.js +376 -0
  124. package/dist/src/evaluation/plan.js.map +1 -0
  125. package/dist/src/evaluation/progress.js +14 -0
  126. package/dist/src/evaluation/progress.js.map +1 -0
  127. package/dist/src/evaluation/resources.js +159 -0
  128. package/dist/src/evaluation/resources.js.map +1 -0
  129. package/dist/src/evaluation/run.js +148 -0
  130. package/dist/src/evaluation/run.js.map +1 -0
  131. package/dist/src/evaluation/scheduler.js +27 -0
  132. package/dist/src/evaluation/scheduler.js.map +1 -0
  133. package/dist/src/evaluation/semantic.js +183 -0
  134. package/dist/src/evaluation/semantic.js.map +1 -0
  135. package/dist/src/evaluation/trial.js +593 -0
  136. package/dist/src/evaluation/trial.js.map +1 -0
  137. package/dist/src/evaluation/types.js +20 -0
  138. package/dist/src/evaluation/types.js.map +1 -0
  139. package/dist/src/evidence/host-results.js +67 -0
  140. package/dist/src/evidence/host-results.js.map +1 -0
  141. package/dist/src/evidence/retained-artifacts.js +17 -0
  142. package/dist/src/evidence/retained-artifacts.js.map +1 -0
  143. package/dist/src/evidence/trial-writer.js +131 -0
  144. package/dist/src/evidence/trial-writer.js.map +1 -0
  145. package/dist/src/evidence/usage.js +14 -0
  146. package/dist/src/evidence/usage.js.map +1 -0
  147. package/dist/src/executable.js +20 -0
  148. package/dist/src/executable.js.map +1 -0
  149. package/dist/src/extension-client.js +212 -0
  150. package/dist/src/extension-client.js.map +1 -0
  151. package/dist/src/extension-session.js +236 -0
  152. package/dist/src/extension-session.js.map +1 -0
  153. package/dist/src/fixtures/advisory.js +206 -0
  154. package/dist/src/fixtures/advisory.js.map +1 -0
  155. package/dist/src/fixtures/bin.js +41 -0
  156. package/dist/src/fixtures/bin.js.map +1 -0
  157. package/dist/src/fixtures/cleanup.js +43 -0
  158. package/dist/src/fixtures/cleanup.js.map +1 -0
  159. package/dist/src/fixtures/create.js +94 -0
  160. package/dist/src/fixtures/create.js.map +1 -0
  161. package/dist/src/fixtures/generated.js +181 -0
  162. package/dist/src/fixtures/generated.js.map +1 -0
  163. package/dist/src/fixtures/git-hooks.js +16 -0
  164. package/dist/src/fixtures/git-hooks.js.map +1 -0
  165. package/dist/src/fixtures/preparation.js +201 -0
  166. package/dist/src/fixtures/preparation.js.map +1 -0
  167. package/dist/src/fixtures/repository.js +255 -0
  168. package/dist/src/fixtures/repository.js.map +1 -0
  169. package/dist/src/fixtures/setup.js +175 -0
  170. package/dist/src/fixtures/setup.js.map +1 -0
  171. package/dist/src/fixtures/tools.js +57 -0
  172. package/dist/src/fixtures/tools.js.map +1 -0
  173. package/dist/src/fixtures/workspace-state.js +155 -0
  174. package/dist/src/fixtures/workspace-state.js.map +1 -0
  175. package/dist/src/generated/cli-result.cjs +2 -0
  176. package/dist/src/generated/extension.cjs +2 -0
  177. package/dist/src/generated/report.cjs +2 -0
  178. package/dist/src/generated/run-evidence.cjs +2 -0
  179. package/dist/src/generated/runtime.cjs +2 -0
  180. package/dist/src/git.js +72 -0
  181. package/dist/src/git.js.map +1 -0
  182. package/dist/src/graders/artifact.js +68 -0
  183. package/dist/src/graders/artifact.js.map +1 -0
  184. package/dist/src/graders/git-head.js +112 -0
  185. package/dist/src/graders/git-head.js.map +1 -0
  186. package/dist/src/graders/output.js +345 -0
  187. package/dist/src/graders/output.js.map +1 -0
  188. package/dist/src/graders/semantic.js +132 -0
  189. package/dist/src/graders/semantic.js.map +1 -0
  190. package/dist/src/graders/shell.js +321 -0
  191. package/dist/src/graders/shell.js.map +1 -0
  192. package/dist/src/host-diagnostic-redaction.js +52 -0
  193. package/dist/src/host-diagnostic-redaction.js.map +1 -0
  194. package/dist/src/host-diagnostics.js +248 -0
  195. package/dist/src/host-diagnostics.js.map +1 -0
  196. package/dist/src/hosts/claude-continuation.js +89 -0
  197. package/dist/src/hosts/claude-continuation.js.map +1 -0
  198. package/dist/src/hosts/claude-credential.js +121 -0
  199. package/dist/src/hosts/claude-credential.js.map +1 -0
  200. package/dist/src/hosts/claude-events.js +136 -0
  201. package/dist/src/hosts/claude-events.js.map +1 -0
  202. package/dist/src/hosts/claude-keychain.js +100 -0
  203. package/dist/src/hosts/claude-keychain.js.map +1 -0
  204. package/dist/src/hosts/claude-login-recovery.js +67 -0
  205. package/dist/src/hosts/claude-login-recovery.js.map +1 -0
  206. package/dist/src/hosts/claude-login-refresh.js +146 -0
  207. package/dist/src/hosts/claude-login-refresh.js.map +1 -0
  208. package/dist/src/hosts/claude-login-store.js +124 -0
  209. package/dist/src/hosts/claude-login-store.js.map +1 -0
  210. package/dist/src/hosts/claude-login.js +74 -0
  211. package/dist/src/hosts/claude-login.js.map +1 -0
  212. package/dist/src/hosts/claude-native-goal.js +138 -0
  213. package/dist/src/hosts/claude-native-goal.js.map +1 -0
  214. package/dist/src/hosts/claude-process.js +10 -0
  215. package/dist/src/hosts/claude-process.js.map +1 -0
  216. package/dist/src/hosts/claude-refresh-lock.js +76 -0
  217. package/dist/src/hosts/claude-refresh-lock.js.map +1 -0
  218. package/dist/src/hosts/claude-repository-invocation.js +229 -0
  219. package/dist/src/hosts/claude-repository-invocation.js.map +1 -0
  220. package/dist/src/hosts/claude-settings.js +156 -0
  221. package/dist/src/hosts/claude-settings.js.map +1 -0
  222. package/dist/src/hosts/claude-skill-activations.js +131 -0
  223. package/dist/src/hosts/claude-skill-activations.js.map +1 -0
  224. package/dist/src/hosts/claude-state.js +237 -0
  225. package/dist/src/hosts/claude-state.js.map +1 -0
  226. package/dist/src/hosts/claude-tool-calls.js +150 -0
  227. package/dist/src/hosts/claude-tool-calls.js.map +1 -0
  228. package/dist/src/hosts/claude.js +373 -0
  229. package/dist/src/hosts/claude.js.map +1 -0
  230. package/dist/src/hosts/codex-app-server.js +764 -0
  231. package/dist/src/hosts/codex-app-server.js.map +1 -0
  232. package/dist/src/hosts/codex-configuration.js +91 -0
  233. package/dist/src/hosts/codex-configuration.js.map +1 -0
  234. package/dist/src/hosts/codex-events.js +104 -0
  235. package/dist/src/hosts/codex-events.js.map +1 -0
  236. package/dist/src/hosts/codex-exec-controls.js +434 -0
  237. package/dist/src/hosts/codex-exec-controls.js.map +1 -0
  238. package/dist/src/hosts/codex-invocation.js +54 -0
  239. package/dist/src/hosts/codex-invocation.js.map +1 -0
  240. package/dist/src/hosts/codex-marketplace.js +185 -0
  241. package/dist/src/hosts/codex-marketplace.js.map +1 -0
  242. package/dist/src/hosts/codex-native-calls.js +516 -0
  243. package/dist/src/hosts/codex-native-calls.js.map +1 -0
  244. package/dist/src/hosts/codex-process.js +10 -0
  245. package/dist/src/hosts/codex-process.js.map +1 -0
  246. package/dist/src/hosts/codex-profile.js +206 -0
  247. package/dist/src/hosts/codex-profile.js.map +1 -0
  248. package/dist/src/hosts/codex-session-files.js +89 -0
  249. package/dist/src/hosts/codex-session-files.js.map +1 -0
  250. package/dist/src/hosts/codex-state.js +310 -0
  251. package/dist/src/hosts/codex-state.js.map +1 -0
  252. package/dist/src/hosts/codex.js +527 -0
  253. package/dist/src/hosts/codex.js.map +1 -0
  254. package/dist/src/hosts/isolation-common.js +43 -0
  255. package/dist/src/hosts/isolation-common.js.map +1 -0
  256. package/dist/src/hosts/isolation-roots.js +64 -0
  257. package/dist/src/hosts/isolation-roots.js.map +1 -0
  258. package/dist/src/hosts/isolation.js +12 -0
  259. package/dist/src/hosts/isolation.js.map +1 -0
  260. package/dist/src/hosts/linux-sandbox.js +127 -0
  261. package/dist/src/hosts/linux-sandbox.js.map +1 -0
  262. package/dist/src/hosts/mac-sandbox.js +137 -0
  263. package/dist/src/hosts/mac-sandbox.js.map +1 -0
  264. package/dist/src/hosts/native-controls.js +151 -0
  265. package/dist/src/hosts/native-controls.js.map +1 -0
  266. package/dist/src/hosts/native-request.js +33 -0
  267. package/dist/src/hosts/native-request.js.map +1 -0
  268. package/dist/src/hosts/process-lifecycle.js +167 -0
  269. package/dist/src/hosts/process-lifecycle.js.map +1 -0
  270. package/dist/src/hosts/protected-worktrees.js +81 -0
  271. package/dist/src/hosts/protected-worktrees.js.map +1 -0
  272. package/dist/src/hosts/skill-hook-catalog.js +100 -0
  273. package/dist/src/hosts/skill-hook-catalog.js.map +1 -0
  274. package/dist/src/hosts/skill-hook-handler.js +228 -0
  275. package/dist/src/hosts/skill-hook-handler.js.map +1 -0
  276. package/dist/src/hosts/skill-hooks.js +423 -0
  277. package/dist/src/hosts/skill-hooks.js.map +1 -0
  278. package/dist/src/hosts/workspace-fingerprint.js +72 -0
  279. package/dist/src/hosts/workspace-fingerprint.js.map +1 -0
  280. package/dist/src/identity.js +167 -0
  281. package/dist/src/identity.js.map +1 -0
  282. package/dist/src/instrumentation.js +83 -0
  283. package/dist/src/instrumentation.js.map +1 -0
  284. package/dist/src/native-transcript-state.js +85 -0
  285. package/dist/src/native-transcript-state.js.map +1 -0
  286. package/dist/src/native-transcript-view.js +65 -0
  287. package/dist/src/native-transcript-view.js.map +1 -0
  288. package/dist/src/native-transcripts.js +208 -0
  289. package/dist/src/native-transcripts.js.map +1 -0
  290. package/dist/src/paths.js +13 -0
  291. package/dist/src/paths.js.map +1 -0
  292. package/dist/src/process-lifecycle.js +101 -0
  293. package/dist/src/process-lifecycle.js.map +1 -0
  294. package/dist/src/provenance.js +263 -0
  295. package/dist/src/provenance.js.map +1 -0
  296. package/dist/src/prune.js +228 -0
  297. package/dist/src/prune.js.map +1 -0
  298. package/dist/src/report.js +276 -0
  299. package/dist/src/report.js.map +1 -0
  300. package/dist/src/resolved-case.js +29 -0
  301. package/dist/src/resolved-case.js.map +1 -0
  302. package/dist/src/results-lock.js +40 -0
  303. package/dist/src/results-lock.js.map +1 -0
  304. package/dist/src/results.js +127 -0
  305. package/dist/src/results.js.map +1 -0
  306. package/dist/src/run-owner.js +283 -0
  307. package/dist/src/run-owner.js.map +1 -0
  308. package/dist/src/runner-paths.js +11 -0
  309. package/dist/src/runner-paths.js.map +1 -0
  310. package/dist/src/runtime/config.js +323 -0
  311. package/dist/src/runtime/config.js.map +1 -0
  312. package/dist/src/runtime/discovery-apple.js +65 -0
  313. package/dist/src/runtime/discovery-apple.js.map +1 -0
  314. package/dist/src/runtime/discovery-providers.js +37 -0
  315. package/dist/src/runtime/discovery-providers.js.map +1 -0
  316. package/dist/src/runtime/discovery.js +40 -0
  317. package/dist/src/runtime/discovery.js.map +1 -0
  318. package/dist/src/runtime/hook-processes.js +81 -0
  319. package/dist/src/runtime/hook-processes.js.map +1 -0
  320. package/dist/src/runtime/hooks.js +304 -0
  321. package/dist/src/runtime/hooks.js.map +1 -0
  322. package/dist/src/runtime/paths.js +244 -0
  323. package/dist/src/runtime/paths.js.map +1 -0
  324. package/dist/src/runtime/query.js +76 -0
  325. package/dist/src/runtime/query.js.map +1 -0
  326. package/dist/src/runtime/seeds.js +98 -0
  327. package/dist/src/runtime/seeds.js.map +1 -0
  328. package/dist/src/runtime/shared-cache.js +81 -0
  329. package/dist/src/runtime/shared-cache.js.map +1 -0
  330. package/dist/src/runtime/state.js +106 -0
  331. package/dist/src/runtime/state.js.map +1 -0
  332. package/dist/src/runtime-process.js +148 -0
  333. package/dist/src/runtime-process.js.map +1 -0
  334. package/dist/src/schema-types.js +2 -0
  335. package/dist/src/schema-types.js.map +1 -0
  336. package/dist/src/schema.js +16 -0
  337. package/dist/src/schema.js.map +1 -0
  338. package/dist/src/shell.js +5 -0
  339. package/dist/src/shell.js.map +1 -0
  340. package/dist/src/sqlite-lock.js +18 -0
  341. package/dist/src/sqlite-lock.js.map +1 -0
  342. package/dist/src/storage.js +21 -0
  343. package/dist/src/storage.js.map +1 -0
  344. package/dist/src/transcript-retention.js +109 -0
  345. package/dist/src/transcript-retention.js.map +1 -0
  346. package/dist/src/value-guards.js +26 -0
  347. package/dist/src/value-guards.js.map +1 -0
  348. package/docs/architecture.md +5 -2
  349. package/docs/creating-cases.md +2 -3
  350. package/docs/development-cli.md +12 -7
  351. package/docs/documentation-quality.md +4 -3
  352. package/docs/evaluation-workflow.md +8 -8
  353. package/docs/getting-started.md +7 -6
  354. package/docs/guide-evaluation.md +1 -1
  355. package/docs/identity-v1.md +4 -1
  356. package/docs/installing.md +31 -13
  357. package/docs/licensing.md +2 -2
  358. package/docs/native-hosts.md +1 -1
  359. package/docs/recipes.md +41 -40
  360. package/docs/releases.md +20 -4
  361. package/docs/run-settings-v1.md +3 -3
  362. package/docs/specs/repository-guide.md +1 -1
  363. package/docs/troubleshooting.md +1 -1
  364. package/docs/typescript-quality.md +18 -1
  365. package/examples/recipes/executable.ts +19 -0
  366. package/examples/recipes/extension-artifacts.ts +1 -1
  367. package/examples/recipes/extension.ts +2 -1
  368. package/examples/recipes/modules.ts +9 -0
  369. package/examples/recipes/run-inputs.ts +14 -19
  370. package/examples/recipes/run-options.ts +9 -8
  371. package/examples/recipes/run.ts +21 -7
  372. package/examples/templates/repository-skill/extension-data.ts +1 -1
  373. package/examples/templates/repository-skill/extension.ts +2 -1
  374. package/package.json +14 -6
  375. package/src/cli/demo.ts +3 -2
  376. package/src/cli/help.ts +4 -3
  377. package/src/cli/init-settings.ts +5 -4
  378. package/src/cli/init.ts +9 -8
  379. package/src/cli/invocation.ts +2 -1
  380. package/src/cli/preparation.ts +2 -2
  381. package/src/cli.ts +1 -1
  382. package/src/executable.ts +19 -0
  383. package/src/extension-client.ts +6 -12
  384. package/src/fixtures/setup.ts +3 -2
  385. package/src/git.ts +2 -1
  386. package/src/graders/git-head.ts +3 -2
  387. package/src/graders/shell.ts +4 -3
  388. package/src/hosts/claude-keychain.ts +3 -2
  389. package/src/hosts/claude-login-refresh.ts +3 -2
  390. package/src/hosts/claude-refresh-lock.ts +2 -1
  391. package/src/hosts/isolation-roots.ts +3 -2
  392. package/src/hosts/process-lifecycle.ts +4 -6
  393. package/src/hosts/protected-worktrees.ts +2 -1
  394. package/src/hosts/skill-hook-handler.ts +1 -1
  395. package/src/hosts/skill-hooks.ts +10 -2
  396. package/src/provenance.ts +7 -6
  397. package/src/results-lock.ts +4 -4
  398. package/src/run-owner.ts +15 -9
  399. package/src/runner-paths.ts +21 -0
  400. package/src/runtime/hook-processes.ts +2 -1
  401. package/src/runtime/hooks.ts +9 -7
  402. package/src/runtime-process.ts +194 -0
  403. package/src/sqlite-lock.ts +25 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.js","sourceRoot":"","sources":["modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB;AAEjC,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,GAAG,KAAe;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QACzC,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { join } from \"node:path\";\n\n/** Locate source modules for Bun development or compiled modules for consumers. */\nexport function recipeFile(...parts: string[]): string {\n const path = join(import.meta.dirname, ...parts);\n return import.meta.filename.endsWith(\".ts\")\n ? path\n : path.replace(/\\.ts$/, \".js\");\n}\n"]}
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: startup-guide
3
+ description: Explain how to start this sample application and identify its port.
4
+ ---
5
+
6
+ Read README.md. Explain the exact start command and port from that file.
7
+ Do not change files. Do not invent a different command or port.
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: startup-guide
3
+ description: Explain how to start this sample application and identify its port.
4
+ ---
5
+
6
+ Read README.md. Explain the exact start command and port from that file.
7
+ Do not change files. Do not invent a different command or port.
@@ -0,0 +1,3 @@
1
+ # Sample application
2
+
3
+ Run `bun run dev` to start the application on port `3000`.
@@ -0,0 +1,144 @@
1
+ import { recipeFile } from "./modules.js";
2
+ import { readFile, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { record } from "./extension-methods.js";
5
+ import { requireTool } from "./run-options.js";
6
+ function shellQuote(text) {
7
+ return `'${text.replaceAll("'", "'\\''")}'`;
8
+ }
9
+ function evaluatorCode(test) {
10
+ if (import.meta.filename.endsWith(".js"))
11
+ return test;
12
+ return new Bun.Transpiler({ loader: "ts" }).transformSync(test);
13
+ }
14
+ async function caseFile(options, state) {
15
+ const value = record(JSON.parse(await readFile(join(import.meta.dirname, "cases", `${options.recipe}.json`), "utf8")));
16
+ if (options.recipe === "coding-change") {
17
+ const test = await readFile(recipeFile("coding-change/check.ts"), "utf8");
18
+ const checks = Array.isArray(value.checks) ? value.checks : [];
19
+ const check = record(checks[0]);
20
+ const javascript = evaluatorCode(test);
21
+ const protectedTest = shellQuote(recipeFile("coding-change/check.ts"));
22
+ record(check.configuration).run =
23
+ `test ! -r ${protectedTest}\nnode --input-type=module -e ${shellQuote(javascript)}`;
24
+ }
25
+ if (options.fail)
26
+ negativeFixture(value, options.recipe);
27
+ const path = join(state, "case.json");
28
+ await writeFile(path, JSON.stringify(value));
29
+ return ["--case-file", path];
30
+ }
31
+ function negativeFixture(value, recipe) {
32
+ if (["coding-change", "semantic"].includes(recipe)) {
33
+ value.prompt =
34
+ "Deliberate negative control: leave math.cjs unchanged if present and respond only: npm start on port 9000.";
35
+ return;
36
+ }
37
+ const files = record(record(value.fixture).files);
38
+ for (const [path, content] of Object.entries(files)) {
39
+ if (typeof content !== "string")
40
+ throw new Error("Expected inline fixture text");
41
+ files[path] = content.replaceAll("3000", "9000");
42
+ }
43
+ }
44
+ async function extensionFiles(options, state) {
45
+ const command = join(state, "extension-command.json");
46
+ await writeFile(command, JSON.stringify([
47
+ process.execPath,
48
+ recipeFile("extension.ts"),
49
+ options.recipe,
50
+ options.route,
51
+ options.fail ? "fail" : "pass",
52
+ ]));
53
+ const sources = [
54
+ "extension.ts",
55
+ "extension-methods.ts",
56
+ "extension-artifacts.ts",
57
+ "repository-skill/.agents/skills/startup-guide/SKILL.md",
58
+ "repository-skill/.claude/skills/startup-guide/SKILL.md",
59
+ ];
60
+ return [
61
+ "--extension-command-file",
62
+ command,
63
+ "--case-id",
64
+ "recipe-extension",
65
+ ...sources.flatMap((path) => ["--extension-source-file", recipeFile(path)]),
66
+ ];
67
+ }
68
+ export async function recipeInputs(options, state) {
69
+ if (["lifecycle", "repository-skill", "plugins"].includes(options.recipe))
70
+ return extensionFiles(options, state);
71
+ return caseFile(options, state);
72
+ }
73
+ async function codexAuthentication(options, state) {
74
+ if (!options.dry) {
75
+ const path = process.env.SEVRO_RECIPE_CODEX_AUTH;
76
+ if (!path)
77
+ throw new Error("Set SEVRO_RECIPE_CODEX_AUTH to your private Codex auth.json path");
78
+ return path;
79
+ }
80
+ const path = join(state, "dry-auth.json");
81
+ await writeFile(path, "{}\n");
82
+ return path;
83
+ }
84
+ export async function hostArguments(options, state) {
85
+ if (options.route === "deterministic")
86
+ return ["--adapter-module", recipeFile("candidate.ts")];
87
+ const model = selectedModel(options.dry, "SEVRO_RECIPE_MODEL");
88
+ if (!model)
89
+ throw new Error("Set SEVRO_RECIPE_MODEL to an available model for the selected native host");
90
+ const args = [
91
+ "--host",
92
+ options.route,
93
+ "--model",
94
+ model,
95
+ "--effort",
96
+ "medium",
97
+ ];
98
+ if (options.route === "codex")
99
+ return [
100
+ ...args,
101
+ "--codex-bin",
102
+ requireTool("codex"),
103
+ "--codex-auth-file",
104
+ await codexAuthentication(options, state),
105
+ ];
106
+ return [
107
+ ...args,
108
+ "--claude-bin",
109
+ requireTool("claude"),
110
+ ...(options.recipe === "repository-skill"
111
+ ? ["--claude-project-settings"]
112
+ : []),
113
+ ];
114
+ }
115
+ export async function semanticArguments(options, state) {
116
+ if (options.recipe !== "semantic")
117
+ return [];
118
+ if (options.route === "deterministic")
119
+ return ["--semantic-adapter-module", recipeFile("semantic-judge.ts")];
120
+ const model = selectedModel(options.dry, "SEVRO_RECIPE_JUDGE_MODEL");
121
+ if (!model)
122
+ throw new Error("Set SEVRO_RECIPE_JUDGE_MODEL for the separate Codex judge route");
123
+ const args = [
124
+ "--semantic-host",
125
+ "codex",
126
+ "--semantic-model",
127
+ model,
128
+ "--semantic-effort",
129
+ "medium",
130
+ ];
131
+ if (options.route === "codex")
132
+ return args;
133
+ return [
134
+ ...args,
135
+ "--codex-bin",
136
+ requireTool("codex"),
137
+ "--codex-auth-file",
138
+ await codexAuthentication(options, state),
139
+ ];
140
+ }
141
+ function selectedModel(dry, variable) {
142
+ return dry ? "dry-model" : process.env[variable];
143
+ }
144
+ //# sourceMappingURL=run-inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-inputs.js","sourceRoot":"","sources":["run-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,qBAAkB;AACvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAyB;AACvD,OAAO,EAAE,IAAI,EAAE,kBAAkB;AACjC,OAAO,EAAE,MAAM,EAAE,+BAA4B;AAC7C,OAAO,EAAE,WAAW,EAAsB,yBAAsB;AAEhE,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,C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["import { recipeFile } from \"./modules\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { record } from \"./extension-methods\";\nimport { requireTool, type RecipeOptions } from \"./run-options\";\n\nfunction shellQuote(text: string): string {\n return `'${text.replaceAll(\"'\", \"'\\\\''\")}'`;\n}\n\nfunction evaluatorCode(test: string): string {\n if (import.meta.filename.endsWith(\".js\")) return test;\n return new Bun.Transpiler({ loader: \"ts\" }).transformSync(test);\n}\n\nasync function caseFile(\n options: RecipeOptions,\n state: string,\n): Promise<string[]> {\n const value = record(\n JSON.parse(\n await readFile(\n join(import.meta.dirname, \"cases\", `${options.recipe}.json`),\n \"utf8\",\n ),\n ) as unknown,\n );\n if (options.recipe === \"coding-change\") {\n const test = await readFile(recipeFile(\"coding-change/check.ts\"), \"utf8\");\n const checks: unknown[] = Array.isArray(value.checks) ? value.checks : [];\n const check = record(checks[0]);\n const javascript = evaluatorCode(test);\n const protectedTest = shellQuote(recipeFile(\"coding-change/check.ts\"));\n record(check.configuration).run =\n `test ! -r ${protectedTest}\\nnode --input-type=module -e ${shellQuote(javascript)}`;\n }\n if (options.fail) negativeFixture(value, options.recipe);\n const path = join(state, \"case.json\");\n await writeFile(path, JSON.stringify(value));\n return [\"--case-file\", path];\n}\n\nfunction negativeFixture(value: Record<string, unknown>, recipe: string): void {\n if ([\"coding-change\", \"semantic\"].includes(recipe)) {\n value.prompt =\n \"Deliberate negative control: leave math.cjs unchanged if present and respond only: npm start on port 9000.\";\n return;\n }\n const files = record(record(value.fixture).files);\n for (const [path, content] of Object.entries(files)) {\n if (typeof content !== \"string\")\n throw new Error(\"Expected inline fixture text\");\n files[path] = content.replaceAll(\"3000\", \"9000\");\n }\n}\n\nasync function extensionFiles(\n options: RecipeOptions,\n state: string,\n): Promise<string[]> {\n const command = join(state, \"extension-command.json\");\n await writeFile(\n command,\n JSON.stringify([\n process.execPath,\n recipeFile(\"extension.ts\"),\n options.recipe,\n options.route,\n options.fail ? \"fail\" : \"pass\",\n ]),\n );\n const sources = [\n \"extension.ts\",\n \"extension-methods.ts\",\n \"extension-artifacts.ts\",\n \"repository-skill/.agents/skills/startup-guide/SKILL.md\",\n \"repository-skill/.claude/skills/startup-guide/SKILL.md\",\n ];\n return [\n \"--extension-command-file\",\n command,\n \"--case-id\",\n \"recipe-extension\",\n ...sources.flatMap((path) => [\"--extension-source-file\", recipeFile(path)]),\n ];\n}\n\nexport async function recipeInputs(\n options: RecipeOptions,\n state: string,\n): Promise<string[]> {\n if ([\"lifecycle\", \"repository-skill\", \"plugins\"].includes(options.recipe))\n return extensionFiles(options, state);\n return caseFile(options, state);\n}\n\nasync function codexAuthentication(\n options: RecipeOptions,\n state: string,\n): Promise<string> {\n if (!options.dry) {\n const path = process.env.SEVRO_RECIPE_CODEX_AUTH;\n if (!path)\n throw new Error(\n \"Set SEVRO_RECIPE_CODEX_AUTH to your private Codex auth.json path\",\n );\n return path;\n }\n const path = join(state, \"dry-auth.json\");\n await writeFile(path, \"{}\\n\");\n return path;\n}\n\nexport async function hostArguments(\n options: RecipeOptions,\n state: string,\n): Promise<string[]> {\n if (options.route === \"deterministic\")\n return [\"--adapter-module\", recipeFile(\"candidate.ts\")];\n const model = selectedModel(options.dry, \"SEVRO_RECIPE_MODEL\");\n if (!model)\n throw new Error(\n \"Set SEVRO_RECIPE_MODEL to an available model for the selected native host\",\n );\n const args = [\n \"--host\",\n options.route,\n \"--model\",\n model,\n \"--effort\",\n \"medium\",\n ];\n if (options.route === \"codex\")\n return [\n ...args,\n \"--codex-bin\",\n requireTool(\"codex\"),\n \"--codex-auth-file\",\n await codexAuthentication(options, state),\n ];\n return [\n ...args,\n \"--claude-bin\",\n requireTool(\"claude\"),\n ...(options.recipe === \"repository-skill\"\n ? [\"--claude-project-settings\"]\n : []),\n ];\n}\n\nexport async function semanticArguments(\n options: RecipeOptions,\n state: string,\n): Promise<string[]> {\n if (options.recipe !== \"semantic\") return [];\n if (options.route === \"deterministic\")\n return [\"--semantic-adapter-module\", recipeFile(\"semantic-judge.ts\")];\n const model = selectedModel(options.dry, \"SEVRO_RECIPE_JUDGE_MODEL\");\n if (!model)\n throw new Error(\n \"Set SEVRO_RECIPE_JUDGE_MODEL for the separate Codex judge route\",\n );\n const args = [\n \"--semantic-host\",\n \"codex\",\n \"--semantic-model\",\n model,\n \"--semantic-effort\",\n \"medium\",\n ];\n if (options.route === \"codex\") return args;\n return [\n ...args,\n \"--codex-bin\",\n requireTool(\"codex\"),\n \"--codex-auth-file\",\n await codexAuthentication(options, state),\n ];\n}\n\nfunction selectedModel(dry: boolean, variable: string): string | undefined {\n return dry ? \"dry-model\" : process.env[variable];\n}\n"]}
@@ -0,0 +1,103 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { which } from "./executable.js";
3
+ import { delimiter, isAbsolute, join } from "node:path";
4
+ import { homedir } from "node:os";
5
+ export const recipeNames = [
6
+ "coding-change",
7
+ "host-tools",
8
+ "node",
9
+ "python-uv",
10
+ "mise",
11
+ "semantic",
12
+ "lifecycle",
13
+ "repository-skill",
14
+ "plugins",
15
+ ];
16
+ function validateSelection(recipe, route, flags) {
17
+ if (!recipeNames.includes(recipe))
18
+ throw new Error(`Choose a recipe: ${recipeNames.join(", ")}`);
19
+ if (!["deterministic", "codex", "claude"].includes(route))
20
+ throw new Error("Choose deterministic, codex, or claude");
21
+ if (flags.some((flag) => !["--dry", "--fail", "--goals-only"].includes(flag)))
22
+ throw new Error("Supported flags: --dry --fail --goals-only");
23
+ }
24
+ function validateNativeRecipe(recipe, route) {
25
+ if (["repository-skill", "plugins"].includes(recipe) &&
26
+ route === "deterministic")
27
+ throw new Error("Skill and plugin recipes require codex or claude (add --dry to prepare without model calls)");
28
+ }
29
+ export function selectedOptions() {
30
+ const [recipe = "", route = "deterministic", ...flags] = process.argv.slice(2);
31
+ validateSelection(recipe, route, flags);
32
+ validateNativeRecipe(recipe, route);
33
+ validateGoalsStep(flags);
34
+ return {
35
+ recipe,
36
+ route,
37
+ dry: flags.includes("--dry"),
38
+ fail: flags.includes("--fail"),
39
+ goalsOnly: flags.includes("--goals-only"),
40
+ };
41
+ }
42
+ function validateGoalsStep(flags) {
43
+ if (flags.includes("--goals-only") && !flags.includes("--dry"))
44
+ throw new Error("--goals-only is a dry preparation step; omit it for the complete hook recipe");
45
+ }
46
+ export function requireTool(name) {
47
+ const path = which(name);
48
+ if (!path)
49
+ throw new Error(`Recipe prerequisite missing: install ${name} and put it on PATH`);
50
+ return path;
51
+ }
52
+ export function runtimeFile(options) {
53
+ const files = {
54
+ "coding-change": "path",
55
+ "host-tools": "path",
56
+ node: "path",
57
+ "python-uv": "python-uv",
58
+ mise: "mise",
59
+ plugins: options.goalsOnly ? "goals" : "plugins",
60
+ };
61
+ return join(import.meta.dirname, "runtime", `${files[options.recipe] ?? "empty"}.json`);
62
+ }
63
+ function languagePrerequisites(recipe) {
64
+ if (recipe === "python-uv")
65
+ process.env.RECIPE_PYTHON ??= requireTool("python3");
66
+ if (recipe === "mise")
67
+ selectMiseNode();
68
+ if (recipe === "host-tools")
69
+ requireStandaloneRipgrep();
70
+ }
71
+ function requireStandaloneRipgrep() {
72
+ const roots = [
73
+ process.env.CODEX_HOME ?? join(homedir(), ".codex"),
74
+ process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), ".claude"),
75
+ ];
76
+ const paths = (process.env.PATH ?? "")
77
+ .split(delimiter)
78
+ .filter((entry) => !roots.some((root) => entry.startsWith(root)));
79
+ if (!which("rg", paths.join(delimiter)))
80
+ throw new Error("Install standalone ripgrep outside Codex/Claude credential directories, then put it on PATH (for example brew install ripgrep or apt-get install ripgrep)");
81
+ }
82
+ function selectMiseNode() {
83
+ const result = spawnSync(requireTool("mise"), ["where", "node@24.13.0"], {
84
+ encoding: "utf8",
85
+ });
86
+ const installation = result.stdout.trim();
87
+ if (result.status !== 0 || !isAbsolute(installation))
88
+ throw new Error("Install the recipe's Node with mise install node@24.13.0 before running it");
89
+ process.env.PATH = `${join(installation, "bin")}${delimiter}${process.env.PATH ?? "/usr/bin:/bin"}`;
90
+ }
91
+ export function runtimePrerequisites(recipe) {
92
+ const tools = {
93
+ "coding-change": ["node"],
94
+ "host-tools": ["rg"],
95
+ node: ["node"],
96
+ "python-uv": ["uv", "python3"],
97
+ mise: ["mise"],
98
+ };
99
+ for (const tool of tools[recipe] ?? [])
100
+ requireTool(tool);
101
+ languagePrerequisites(recipe);
102
+ }
103
+ //# sourceMappingURL=run-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-options.js","sourceRoot":"","sources":["run-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,2BAA2B;AAC/C,OAAO,EAAE,KAAK,EAAE,wBAAqB;AACrC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB;AACxD,OAAO,EAAE,OAAO,EAAE,gBAAgB;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,eAAe;IACf,YAAY;IACZ,MAAM;IACN,WAAW;IACX,MAAM;IACN,UAAU;IACV,WAAW;IACX,kBAAkB;IAClB,SAAS;CACV,CAAC;AAEF,SAAS,iBAAiB,CACxB,MAAc,EACd,KAAa,EACb,KAAe;IAEf,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,oBAAoB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,IAAI,CAAC,CAAC,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CA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KAAK,CACb,2JAA2J,CAC5J,CAAC;AACN,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,EAAE;QACvE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,eAAe,EAAE,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,KAAK,GAA6B;QACtC,eAAe,EAAE,CAAC,MAAM,CAAC;QACzB,YAAY,EAAE,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,WAAW,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC;QAC9B,IAAI,EAAE,CAAC,MAAM,CAAC;KACf,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE;QAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1D,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC","sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport { which } from \"./executable\";\nimport { delimiter, isAbsolute, join } from \"node:path\";\nimport { homedir } from \"node:os\";\n\nexport const recipeNames = [\n \"coding-change\",\n \"host-tools\",\n \"node\",\n \"python-uv\",\n \"mise\",\n \"semantic\",\n \"lifecycle\",\n \"repository-skill\",\n \"plugins\",\n];\n\nfunction validateSelection(\n recipe: string,\n route: string,\n flags: string[],\n): void {\n if (!recipeNames.includes(recipe))\n throw new Error(`Choose a recipe: ${recipeNames.join(\", \")}`);\n if (![\"deterministic\", \"codex\", \"claude\"].includes(route))\n throw new Error(\"Choose deterministic, codex, or claude\");\n if (flags.some((flag) => ![\"--dry\", \"--fail\", \"--goals-only\"].includes(flag)))\n throw new Error(\"Supported flags: --dry --fail --goals-only\");\n}\n\nfunction validateNativeRecipe(recipe: string, route: string): void {\n if (\n [\"repository-skill\", \"plugins\"].includes(recipe) &&\n route === \"deterministic\"\n )\n throw new Error(\n \"Skill and plugin recipes require codex or claude (add --dry to prepare without model calls)\",\n );\n}\n\nexport function selectedOptions() {\n const [recipe = \"\", route = \"deterministic\", ...flags] =\n process.argv.slice(2);\n validateSelection(recipe, route, flags);\n validateNativeRecipe(recipe, route);\n validateGoalsStep(flags);\n return {\n recipe,\n route,\n dry: flags.includes(\"--dry\"),\n fail: flags.includes(\"--fail\"),\n goalsOnly: flags.includes(\"--goals-only\"),\n };\n}\nexport type RecipeOptions = ReturnType<typeof selectedOptions>;\n\nfunction validateGoalsStep(flags: string[]): void {\n if (flags.includes(\"--goals-only\") && !flags.includes(\"--dry\"))\n throw new Error(\n \"--goals-only is a dry preparation step; omit it for the complete hook recipe\",\n );\n}\n\nexport function requireTool(name: string): string {\n const path = which(name);\n if (!path)\n throw new Error(\n `Recipe prerequisite missing: install ${name} and put it on PATH`,\n );\n return path;\n}\n\nexport function runtimeFile(options: RecipeOptions): string {\n const files: Record<string, string> = {\n \"coding-change\": \"path\",\n \"host-tools\": \"path\",\n node: \"path\",\n \"python-uv\": \"python-uv\",\n mise: \"mise\",\n plugins: options.goalsOnly ? \"goals\" : \"plugins\",\n };\n return join(\n import.meta.dirname,\n \"runtime\",\n `${files[options.recipe] ?? \"empty\"}.json`,\n );\n}\n\nfunction languagePrerequisites(recipe: string): void {\n if (recipe === \"python-uv\")\n process.env.RECIPE_PYTHON ??= requireTool(\"python3\");\n if (recipe === \"mise\") selectMiseNode();\n if (recipe === \"host-tools\") requireStandaloneRipgrep();\n}\n\nfunction requireStandaloneRipgrep(): void {\n const roots = [\n process.env.CODEX_HOME ?? join(homedir(), \".codex\"),\n process.env.CLAUDE_CONFIG_DIR ?? join(homedir(), \".claude\"),\n ];\n const paths = (process.env.PATH ?? \"\")\n .split(delimiter)\n .filter((entry) => !roots.some((root) => entry.startsWith(root)));\n if (!which(\"rg\", paths.join(delimiter)))\n throw new Error(\n \"Install standalone ripgrep outside Codex/Claude credential directories, then put it on PATH (for example brew install ripgrep or apt-get install ripgrep)\",\n );\n}\n\nfunction selectMiseNode(): void {\n const result = spawnSync(requireTool(\"mise\"), [\"where\", \"node@24.13.0\"], {\n encoding: \"utf8\",\n });\n const installation = result.stdout.trim();\n if (result.status !== 0 || !isAbsolute(installation))\n throw new Error(\n \"Install the recipe's Node with mise install node@24.13.0 before running it\",\n );\n process.env.PATH = `${join(installation, \"bin\")}${delimiter}${process.env.PATH ?? \"/usr/bin:/bin\"}`;\n}\n\nexport function runtimePrerequisites(recipe: string): void {\n const tools: Record<string, string[]> = {\n \"coding-change\": [\"node\"],\n \"host-tools\": [\"rg\"],\n node: [\"node\"],\n \"python-uv\": [\"uv\", \"python3\"],\n mise: [\"mise\"],\n };\n for (const tool of tools[recipe] ?? []) requireTool(tool);\n languagePrerequisites(recipe);\n}\n"]}
@@ -0,0 +1,62 @@
1
+ import { spawn } from "node:child_process";
2
+ import { Readable } from "node:stream";
3
+ import { mkdir, realpath, writeFile } from "node:fs/promises";
4
+ import { join, resolve } from "node:path";
5
+ import { hostArguments, recipeInputs, semanticArguments } from "./run-inputs.js";
6
+ import { runtimeFile, runtimePrerequisites, selectedOptions, } from "./run-options.js";
7
+ const options = selectedOptions();
8
+ runtimePrerequisites(options.recipe);
9
+ const mode = options.dry ? "dry" : options.fail ? "fail" : "pass";
10
+ const state = resolve(".sevro-recipes", options.recipe, options.route, options.goalsOnly ? "goals" : mode);
11
+ await mkdir(join(state, "project"), { recursive: true });
12
+ await mkdir(join(state, "config"), { recursive: true });
13
+ const root = await realpath(state);
14
+ const cli = process.env.SEVRO_RECIPE_CLI ??
15
+ resolve(import.meta.dirname, import.meta.filename.endsWith(".ts")
16
+ ? "../../src/cli.ts"
17
+ : "../../src/cli.js");
18
+ const args = [
19
+ process.execPath,
20
+ cli,
21
+ "run",
22
+ "--json",
23
+ "--project-root",
24
+ join(root, "project"),
25
+ "--config-root",
26
+ join(root, "config"),
27
+ "--results-root",
28
+ join(root, "results"),
29
+ "--runtime-config-file",
30
+ runtimeFile(options),
31
+ "--condition",
32
+ "passive",
33
+ "--trials",
34
+ "1",
35
+ "--threshold",
36
+ "1",
37
+ "--shell-isolation",
38
+ "--protected-root",
39
+ import.meta.dirname,
40
+ ...(await recipeInputs(options, root)),
41
+ ...(await hostArguments(options, root)),
42
+ ...(await semanticArguments(options, root)),
43
+ ...(options.dry ? ["--dry"] : []),
44
+ ];
45
+ const child = spawn(process.execPath, args.slice(1), {
46
+ env: { ...process.env, SEVRO_RECIPE_FAIL: options.fail ? "1" : "0" },
47
+ stdio: ["ignore", "pipe", "inherit"],
48
+ });
49
+ const [output, code] = await Promise.all([
50
+ new Response(Readable.toWeb(child.stdout)).text(),
51
+ new Promise((resolve, reject) => {
52
+ child.once("error", reject);
53
+ child.once("close", (code) => {
54
+ resolve(code ?? 1);
55
+ });
56
+ }),
57
+ ]);
58
+ await writeFile(join(root, "result.json"), output);
59
+ process.stderr.write(`Recipe result: ${join(root, "result.json")}\n`);
60
+ process.stdout.write(output);
61
+ process.exit(code);
62
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,2BAA2B;AAC3C,OAAO,EAAE,QAAQ,EAAE,oBAAoB;AACvC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,yBAAyB;AAC9D,OAAO,EAAE,IAA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AAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAC3B,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC,CAAC;AACH,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;AACnD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;AACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { spawn } from \"node:child_process\";\nimport { Readable } from \"node:stream\";\nimport { mkdir, realpath, writeFile } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { hostArguments, recipeInputs, semanticArguments } from \"./run-inputs\";\nimport {\n runtimeFile,\n runtimePrerequisites,\n selectedOptions,\n} from \"./run-options\";\n\nconst options = selectedOptions();\nruntimePrerequisites(options.recipe);\nconst mode = options.dry ? \"dry\" : options.fail ? \"fail\" : \"pass\";\nconst state = resolve(\n \".sevro-recipes\",\n options.recipe,\n options.route,\n options.goalsOnly ? \"goals\" : mode,\n);\nawait mkdir(join(state, \"project\"), { recursive: true });\nawait mkdir(join(state, \"config\"), { recursive: true });\nconst root = await realpath(state);\nconst cli =\n process.env.SEVRO_RECIPE_CLI ??\n resolve(\n import.meta.dirname,\n import.meta.filename.endsWith(\".ts\")\n ? \"../../src/cli.ts\"\n : \"../../src/cli.js\",\n );\nconst args = [\n process.execPath,\n cli,\n \"run\",\n \"--json\",\n \"--project-root\",\n join(root, \"project\"),\n \"--config-root\",\n join(root, \"config\"),\n \"--results-root\",\n join(root, \"results\"),\n \"--runtime-config-file\",\n runtimeFile(options),\n \"--condition\",\n \"passive\",\n \"--trials\",\n \"1\",\n \"--threshold\",\n \"1\",\n \"--shell-isolation\",\n \"--protected-root\",\n import.meta.dirname,\n ...(await recipeInputs(options, root)),\n ...(await hostArguments(options, root)),\n ...(await semanticArguments(options, root)),\n ...(options.dry ? [\"--dry\"] : []),\n];\nconst child = spawn(process.execPath, args.slice(1), {\n env: { ...process.env, SEVRO_RECIPE_FAIL: options.fail ? \"1\" : \"0\" },\n stdio: [\"ignore\", \"pipe\", \"inherit\"],\n});\nconst [output, code] = await Promise.all([\n new Response(\n Readable.toWeb(child.stdout) as unknown as ReadableStream<Uint8Array>,\n ).text(),\n new Promise<number>((resolve, reject) => {\n child.once(\"error\", reject);\n child.once(\"close\", (code) => {\n resolve(code ?? 1);\n });\n }),\n]);\nawait writeFile(join(root, \"result.json\"), output);\nprocess.stderr.write(`Recipe result: ${join(root, \"result.json\")}\\n`);\nprocess.stdout.write(output);\nprocess.exit(code);\n"]}
@@ -0,0 +1 @@
1
+ { "format": "sevro.runtime.v1" }
@@ -0,0 +1 @@
1
+ { "format": "sevro.runtime.v1", "hooks": { "nativeGoal": true } }
@@ -0,0 +1,6 @@
1
+ {
2
+ "format": "sevro.runtime.v1",
3
+ "environment": {
4
+ "inherit": ["PATH"]
5
+ }
6
+ }
@@ -0,0 +1 @@
1
+ { "format": "sevro.runtime.v1", "environment": { "inherit": ["PATH"] } }
@@ -0,0 +1,4 @@
1
+ {
2
+ "format": "sevro.runtime.v1",
3
+ "hooks": { "nativeGoal": true, "plugins": ["startup"] }
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "format": "sevro.runtime.v1",
3
+ "environment": {
4
+ "inherit": ["PATH", "RECIPE_PYTHON"],
5
+ "set": {
6
+ "UV_CACHE_DIR": "{{sevro.runtime}}/uv-cache",
7
+ "UV_PYTHON_DOWNLOADS": "never"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,27 @@
1
+ /** Protocol control only: use a real judge for qualitative model assessment. */
2
+ const judge = {
3
+ id: "recipes.protocol-judge",
4
+ model: "exact-fixture-oracle",
5
+ effort: "none",
6
+ run({ prompt }) {
7
+ const match = /<candidate-response-json>\s*([\s\S]*?)\s*<\/candidate-response-json>/.exec(prompt);
8
+ if (!match?.[1])
9
+ throw new Error("Missing semantic candidate response");
10
+ const candidate = JSON.parse(match[1]);
11
+ const passed = candidate === "Run bun run dev on port 3000.";
12
+ return Promise.resolve({
13
+ complete: true,
14
+ finalMessage: JSON.stringify({
15
+ checks: [
16
+ {
17
+ id: "startup-meaning",
18
+ verdict: passed ? "pass" : "fail",
19
+ reason: "Exact deterministic fixture oracle; no model judgment was made.",
20
+ },
21
+ ],
22
+ }),
23
+ });
24
+ },
25
+ };
26
+ export default judge;
27
+ //# sourceMappingURL=semantic-judge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic-judge.js","sourceRoot":"","sources":["semantic-judge.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE,wBAAwB;IAC5B,KAAK,EAAE,sBAAsB;IAC7B,MAAM,EAAE,MAAM;IACd,GAAG,CAAC,EAAE,MAAM,EAAsB;QAChC,MAAM,KAAK,GACT,sEAAsE,CAAC,IAAI,CACzE,MAAM,CACP,CAAC;QACJ,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACxE,MAAM,SAAS,GAAY,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,KAAK,+BAA+B,CAAC;QAC7D,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC;gBAC3B,MAAM,EAAE;oBACN;wBACE,EAAE,EAAE,iBAAiB;wBACrB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;wBACjC,MAAM,EACJ,iEAAiE;qBACpE;iBACF;aACF,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AACF,eAAe,KAAK,CAAC","sourcesContent":["/** Protocol control only: use a real judge for qualitative model assessment. */\nconst judge = {\n id: \"recipes.protocol-judge\",\n model: \"exact-fixture-oracle\",\n effort: \"none\",\n run({ prompt }: { prompt: string }) {\n const match =\n /<candidate-response-json>\\s*([\\s\\S]*?)\\s*<\\/candidate-response-json>/.exec(\n prompt,\n );\n if (!match?.[1]) throw new Error(\"Missing semantic candidate response\");\n const candidate: unknown = JSON.parse(match[1]);\n const passed = candidate === \"Run bun run dev on port 3000.\";\n return Promise.resolve({\n complete: true,\n finalMessage: JSON.stringify({\n checks: [\n {\n id: \"startup-meaning\",\n verdict: passed ? \"pass\" : \"fail\",\n reason:\n \"Exact deterministic fixture oracle; no model judgment was made.\",\n },\n ],\n }),\n });\n },\n};\nexport default judge;\n"]}
@@ -0,0 +1,14 @@
1
+ import { writeFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ /** Deterministic file editor; it exercises the evaluator, not model coding ability. */
4
+ export default {
5
+ id: "template.coding",
6
+ model: "deterministic-editor",
7
+ effort: "none",
8
+ async run({ workspace }) {
9
+ if (process.env.SEVRO_TEMPLATE_FAIL !== "1")
10
+ await writeFile(join(workspace, "add.sh"), 'add() { echo "$(( $1 + $2 ))"; }\n');
11
+ return { finalMessage: "Completed the coding task.", complete: true };
12
+ },
13
+ };
14
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,yBAAyB;AAC7C,OAAO,EAAE,IAAI,EAAE,kBAAkB;AAEjC,uFAAuF;AACvF,eAAe;IACb,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,sBAAsB;IAC7B,MAAM,EAAE,MAAM;IACd,KAAK,CAAC,GAAG,CAAC,EAAE,SAAS,EAAyB;QAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG;YACzC,MAAM,SAAS,CACb,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,EACzB,oCAAoC,CACrC,CAAC;QACJ,OAAO,EAAE,YAAY,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxE,CAAC;CACF,CAAC","sourcesContent":["import { writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\n/** Deterministic file editor; it exercises the evaluator, not model coding ability. */\nexport default {\n id: \"template.coding\",\n model: \"deterministic-editor\",\n effort: \"none\",\n async run({ workspace }: { workspace: string }) {\n if (process.env.SEVRO_TEMPLATE_FAIL !== \"1\")\n await writeFile(\n join(workspace, \"add.sh\"),\n 'add() { echo \"$(( $1 + $2 ))\"; }\\n',\n );\n return { finalMessage: \"Completed the coding task.\", complete: true };\n },\n};\n"]}
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "coding-addition",
3
+ "prompt": "Fix add.sh so add computes integer addition. Preserve the add shell function interface.",
4
+ "fixture": { "files": { "add.sh": "add() { echo \"$(( $1 - $2 ))\"; }\n" } },
5
+ "checks": [
6
+ {
7
+ "id": "addition",
8
+ "grader": "sevro.shell",
9
+ "configuration": {
10
+ "run": ". ./add.sh; test \"$(add 2 3)\" = 5 && test \"$(add -2 -3)\" = -5 && test \"$(add 0 0)\" = 0"
11
+ }
12
+ }
13
+ ],
14
+ "requiredEvidence": []
15
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: startup-guide
3
+ description: Explain the sample application's start command and port.
4
+ ---
5
+
6
+ Read README.md. State the exact start command and port. Do not change files.
@@ -0,0 +1,61 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ export const description = {
5
+ extension: { id: "template.startup", version: "1.0.0" },
6
+ protocols: ["sevro.extension.v1"],
7
+ requiredCapabilities: ["sevro.codex.repository-invocation"],
8
+ optionalCapabilities: [],
9
+ graders: [],
10
+ taskVerdictPolicies: [],
11
+ };
12
+ export const resolved = {
13
+ cases: [
14
+ {
15
+ id: "repository-skill",
16
+ prompt: "{{sevro.skill_invocation}} Explain the application's start command and port. Do not change files.",
17
+ fixture: {
18
+ kind: "generated",
19
+ commits: [
20
+ {
21
+ message: "Initialize application",
22
+ files: { "README.md": "Run bun run dev on port 3000.\n" },
23
+ },
24
+ ],
25
+ },
26
+ checks: [
27
+ {
28
+ id: "start-command",
29
+ grader: "sevro.regex",
30
+ configuration: { pattern: "bun run dev" },
31
+ },
32
+ {
33
+ id: "port",
34
+ grader: "sevro.regex",
35
+ configuration: { pattern: "\\b3000\\b" },
36
+ },
37
+ ],
38
+ requiredEvidence: ["sevro.codex.explicit-invocation"],
39
+ extensionData: {},
40
+ },
41
+ ],
42
+ };
43
+ export async function prepare() {
44
+ const relativePath = ".agents/skills/startup-guide/SKILL.md";
45
+ const body = await readFile(join(import.meta.dirname, relativePath));
46
+ return {
47
+ artifacts: [
48
+ {
49
+ id: "template.startup-skill",
50
+ relativePath,
51
+ sha256: createHash("sha256").update(body).digest("hex"),
52
+ contentBase64: body.toString("base64"),
53
+ gitExclude: true,
54
+ },
55
+ ],
56
+ requestedInstrumentation: [],
57
+ extensionData: {},
58
+ codexRepositorySkillInvocation: { skillName: "startup-guide" },
59
+ };
60
+ }
61
+ //# sourceMappingURL=extension-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-data.js","sourceRoot":"","sources":["extension-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB;AACzC,OAAO,EAAE,QAAQ,EAAE,yBAAyB;AAC5C,OAAO,EAAE,IAAI,EAAE,kBAAkB;AAEjC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE;IACvD,SAAS,EAAE,CAAC,oBAAoB,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E;QAC5B,aAAa,EAAE,EAAE;QACjB,8BAA8B,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE;KAC/D,CAAC;AACJ,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nexport const description = {\n extension: { id: \"template.startup\", version: \"1.0.0\" },\n protocols: [\"sevro.extension.v1\"],\n requiredCapabilities: [\"sevro.codex.repository-invocation\"],\n optionalCapabilities: [],\n graders: [],\n taskVerdictPolicies: [],\n};\n\nexport const resolved = {\n cases: [\n {\n id: \"repository-skill\",\n prompt:\n \"{{sevro.skill_invocation}} Explain the application's start command and port. Do not change files.\",\n fixture: {\n kind: \"generated\",\n commits: [\n {\n message: \"Initialize application\",\n files: { \"README.md\": \"Run bun run dev on port 3000.\\n\" },\n },\n ],\n },\n checks: [\n {\n id: \"start-command\",\n grader: \"sevro.regex\",\n configuration: { pattern: \"bun run dev\" },\n },\n {\n id: \"port\",\n grader: \"sevro.regex\",\n configuration: { pattern: \"\\\\b3000\\\\b\" },\n },\n ],\n requiredEvidence: [\"sevro.codex.explicit-invocation\"],\n extensionData: {},\n },\n ],\n};\n\nexport async function prepare() {\n const relativePath = \".agents/skills/startup-guide/SKILL.md\";\n const body = await readFile(join(import.meta.dirname, relativePath));\n return {\n artifacts: [\n {\n id: \"template.startup-skill\",\n relativePath,\n sha256: createHash(\"sha256\").update(body).digest(\"hex\"),\n contentBase64: body.toString(\"base64\"),\n gitExclude: true,\n },\n ],\n requestedInstrumentation: [],\n extensionData: {},\n codexRepositorySkillInvocation: { skillName: \"startup-guide\" },\n };\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { description, prepare, resolved } from "./extension-data.js";
2
+ import { readFileSync } from "node:fs";
3
+ function record(value) {
4
+ if (!value || typeof value !== "object" || Array.isArray(value))
5
+ throw new Error("Expected a protocol request object");
6
+ return value;
7
+ }
8
+ const request = record(JSON.parse(readFileSync(0, "utf8")));
9
+ async function result() {
10
+ switch (request.method) {
11
+ case "describe":
12
+ return description;
13
+ case "resolve":
14
+ return resolved;
15
+ case "prepare":
16
+ return await prepare();
17
+ case "evaluate":
18
+ return { checks: [], metrics: [] };
19
+ default:
20
+ throw new Error("Unsupported extension method");
21
+ }
22
+ }
23
+ process.stdout.write(JSON.stringify({
24
+ protocol: request.protocol,
25
+ id: request.id,
26
+ method: request.method,
27
+ result: await result(),
28
+ }));
29
+ //# sourceMappingURL=extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,4BAAyB;AAClE,OAAO,EAAE,YAAY,EAAE,gBAAgB;AAEvC,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAY,CAAC,CAAC;AACvE,KAAK,UAAU,MAAM;IACnB,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,MAAM,OAAO,EAAE,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACrC;YACE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,CAAC,SAAS,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;IAC1B,EAAE,EAAE,OAAO,CAAC,EAAE;IACd,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,MAAM,EAAE,MAAM,MAAM,EAAE;CACvB,CAAC,CACH,CAAC","sourcesContent":["import { description, prepare, resolved } from \"./extension-data\";\nimport { readFileSync } from \"node:fs\";\n\nfunction record(value: unknown): Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value))\n throw new Error(\"Expected a protocol request object\");\n return value as Record<string, unknown>;\n}\n\nconst request = record(JSON.parse(readFileSync(0, \"utf8\")) as unknown);\nasync function result() {\n switch (request.method) {\n case \"describe\":\n return description;\n case \"resolve\":\n return resolved;\n case \"prepare\":\n return await prepare();\n case \"evaluate\":\n return { checks: [], metrics: [] };\n default:\n throw new Error(\"Unsupported extension method\");\n }\n}\nprocess.stdout.write(\n JSON.stringify({\n protocol: request.protocol,\n id: request.id,\n method: request.method,\n result: await result(),\n }),\n);\n"]}
@@ -0,0 +1,13 @@
1
+ /** Deterministic starter; replace with an explicit native route to evaluate a model. */
2
+ export default {
3
+ id: "template.response",
4
+ model: "deterministic-example",
5
+ effort: "none",
6
+ run() {
7
+ return Promise.resolve({
8
+ finalMessage: process.env.SEVRO_TEMPLATE_FAIL === "1" ? "wrong" : "ready",
9
+ complete: true,
10
+ });
11
+ },
12
+ };
13
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["adapter.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,eAAe;IACb,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,uBAAuB;IAC9B,MAAM,EAAE,MAAM;IACd,GAAG;QACD,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;IACL,CAAC;CACF,CAAC","sourcesContent":["/** Deterministic starter; replace with an explicit native route to evaluate a model. */\nexport default {\n id: \"template.response\",\n model: \"deterministic-example\",\n effort: \"none\",\n run() {\n return Promise.resolve({\n finalMessage: process.env.SEVRO_TEMPLATE_FAIL === \"1\" ? \"wrong\" : \"ready\",\n complete: true,\n });\n },\n};\n"]}