@executioncontrolprotocol/core 0.14.0 → 0.51.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 (754) hide show
  1. package/README.md +25 -36
  2. package/dist/bindings/extension.d.ts +15 -1
  3. package/dist/bindings/extension.d.ts.map +1 -1
  4. package/dist/bindings/extension.js +23 -0
  5. package/dist/bindings/extension.js.map +1 -1
  6. package/dist/bindings/policy.d.ts +15 -1
  7. package/dist/bindings/policy.d.ts.map +1 -1
  8. package/dist/bindings/policy.js +23 -0
  9. package/dist/bindings/policy.js.map +1 -1
  10. package/dist/bindings/step.d.ts +3 -3
  11. package/dist/bindings/step.d.ts.map +1 -1
  12. package/dist/compile/extract-workflow-module.d.ts +18 -2
  13. package/dist/compile/extract-workflow-module.d.ts.map +1 -1
  14. package/dist/compile/extract-workflow-module.js +39 -10
  15. package/dist/compile/extract-workflow-module.js.map +1 -1
  16. package/dist/compile/index.d.ts +4 -13
  17. package/dist/compile/index.d.ts.map +1 -1
  18. package/dist/compile/index.js +1 -48
  19. package/dist/compile/index.js.map +1 -1
  20. package/dist/compile/types.d.ts +1 -1
  21. package/dist/compile/types.d.ts.map +1 -1
  22. package/dist/config/builder.d.ts +39 -0
  23. package/dist/config/builder.d.ts.map +1 -0
  24. package/dist/config/builder.js +50 -0
  25. package/dist/config/builder.js.map +1 -0
  26. package/dist/config/index.d.ts +2 -0
  27. package/dist/config/index.d.ts.map +1 -0
  28. package/dist/config/index.js +2 -0
  29. package/dist/config/index.js.map +1 -0
  30. package/dist/definitions/capability.d.ts +3 -2
  31. package/dist/definitions/capability.d.ts.map +1 -1
  32. package/dist/definitions/capability.js +4 -3
  33. package/dist/definitions/capability.js.map +1 -1
  34. package/dist/definitions/environment.d.ts +38 -0
  35. package/dist/definitions/environment.d.ts.map +1 -0
  36. package/dist/definitions/environment.js +77 -0
  37. package/dist/definitions/environment.js.map +1 -0
  38. package/dist/definitions/extension.d.ts +16 -4
  39. package/dist/definitions/extension.d.ts.map +1 -1
  40. package/dist/definitions/extension.js +27 -6
  41. package/dist/definitions/extension.js.map +1 -1
  42. package/dist/definitions/hook.d.ts +1 -1
  43. package/dist/definitions/hook.d.ts.map +1 -1
  44. package/dist/definitions/index.d.ts +2 -2
  45. package/dist/definitions/index.d.ts.map +1 -1
  46. package/dist/definitions/index.js +1 -1
  47. package/dist/definitions/index.js.map +1 -1
  48. package/dist/definitions/policy.d.ts +8 -0
  49. package/dist/definitions/policy.d.ts.map +1 -1
  50. package/dist/definitions/policy.js +16 -0
  51. package/dist/definitions/policy.js.map +1 -1
  52. package/dist/definitions/types.d.ts +23 -5
  53. package/dist/definitions/types.d.ts.map +1 -1
  54. package/dist/encoding/contracts.js +1 -1
  55. package/dist/encoding/contracts.js.map +1 -1
  56. package/dist/encoding/decode-builder.d.ts +1 -1
  57. package/dist/encoding/decode-builder.d.ts.map +1 -1
  58. package/dist/encoding/decode-builder.js +1 -9
  59. package/dist/encoding/decode-builder.js.map +1 -1
  60. package/dist/encoding/encode-builder.d.ts +1 -1
  61. package/dist/encoding/encode-builder.d.ts.map +1 -1
  62. package/dist/encoding/encode-builder.js +1 -1
  63. package/dist/encoding/encode-builder.js.map +1 -1
  64. package/dist/encoding/errors.d.ts +2 -2
  65. package/dist/encoding/errors.d.ts.map +1 -1
  66. package/dist/encoding/invoke-utility.d.ts +1 -1
  67. package/dist/encoding/invoke-utility.d.ts.map +1 -1
  68. package/dist/encoding/invoke-utility.js +1 -1
  69. package/dist/encoding/invoke-utility.js.map +1 -1
  70. package/dist/encoding/json-codec.d.ts +1 -1
  71. package/dist/encoding/json-codec.d.ts.map +1 -1
  72. package/dist/encoding/json-codec.js +1 -1
  73. package/dist/encoding/json-codec.js.map +1 -1
  74. package/dist/encoding/normalize-workflow.d.ts +1 -1
  75. package/dist/encoding/normalize-workflow.d.ts.map +1 -1
  76. package/dist/encoding/resolve.js +1 -1
  77. package/dist/encoding/resolve.js.map +1 -1
  78. package/dist/encoding/schemas.d.ts +20 -20
  79. package/dist/encoding/schemas.js +1 -1
  80. package/dist/encoding/schemas.js.map +1 -1
  81. package/dist/environment/bindings.d.ts +4 -14
  82. package/dist/environment/bindings.d.ts.map +1 -1
  83. package/dist/environment/bindings.js +2 -7
  84. package/dist/environment/bindings.js.map +1 -1
  85. package/dist/environment/config-resolver.d.ts +1 -3
  86. package/dist/environment/config-resolver.d.ts.map +1 -1
  87. package/dist/environment/config-resolver.js +13 -19
  88. package/dist/environment/config-resolver.js.map +1 -1
  89. package/dist/environment/describe.d.ts +1 -1
  90. package/dist/environment/describe.d.ts.map +1 -1
  91. package/dist/environment/describe.js +32 -24
  92. package/dist/environment/describe.js.map +1 -1
  93. package/dist/environment/ecp.d.ts +10 -13
  94. package/dist/environment/ecp.d.ts.map +1 -1
  95. package/dist/environment/ecp.js +4 -14
  96. package/dist/environment/ecp.js.map +1 -1
  97. package/dist/environment/environment.d.ts +99 -49
  98. package/dist/environment/environment.d.ts.map +1 -1
  99. package/dist/environment/environment.js +203 -155
  100. package/dist/environment/environment.js.map +1 -1
  101. package/dist/environment/search.d.ts +1 -1
  102. package/dist/environment/search.d.ts.map +1 -1
  103. package/dist/environment/search.js +10 -7
  104. package/dist/environment/search.js.map +1 -1
  105. package/dist/environment/validate-binding-config.d.ts +12 -0
  106. package/dist/environment/validate-binding-config.d.ts.map +1 -0
  107. package/dist/environment/validate-binding-config.js +43 -0
  108. package/dist/environment/validate-binding-config.js.map +1 -0
  109. package/dist/file/file-ref.d.ts +1 -1
  110. package/dist/file/file-ref.d.ts.map +1 -1
  111. package/dist/file/file-ref.js +1 -1
  112. package/dist/file/file-ref.js.map +1 -1
  113. package/dist/fluent/encode-fluent.d.ts +1 -1
  114. package/dist/fluent/encode-fluent.d.ts.map +1 -1
  115. package/dist/fluent/encode-fluent.js +1 -1
  116. package/dist/fluent/encode-fluent.js.map +1 -1
  117. package/dist/fluent/render-expr.d.ts +1 -1
  118. package/dist/fluent/render-expr.d.ts.map +1 -1
  119. package/dist/fluent/render-node.d.ts +1 -1
  120. package/dist/fluent/render-node.d.ts.map +1 -1
  121. package/dist/fluent/render-value.d.ts +1 -2
  122. package/dist/fluent/render-value.d.ts.map +1 -1
  123. package/dist/fluent/render-value.js +0 -5
  124. package/dist/fluent/render-value.js.map +1 -1
  125. package/dist/fluent/render-workflow.d.ts +1 -1
  126. package/dist/fluent/render-workflow.d.ts.map +1 -1
  127. package/dist/fluent/render-workflow.js +0 -2
  128. package/dist/fluent/render-workflow.js.map +1 -1
  129. package/dist/formats/format-fluent.d.ts.map +1 -1
  130. package/dist/formats/format-fluent.js +10 -8
  131. package/dist/formats/format-fluent.js.map +1 -1
  132. package/dist/formats/format-json.d.ts.map +1 -1
  133. package/dist/formats/format-json.js +22 -27
  134. package/dist/formats/format-json.js.map +1 -1
  135. package/dist/formats/register-core-formats.d.ts +2 -1
  136. package/dist/formats/register-core-formats.d.ts.map +1 -1
  137. package/dist/formats/register-core-formats.js +2 -4
  138. package/dist/formats/register-core-formats.js.map +1 -1
  139. package/dist/helpers/env.d.ts +1 -1
  140. package/dist/helpers/env.d.ts.map +1 -1
  141. package/dist/helpers/expr.d.ts +1 -1
  142. package/dist/helpers/expr.d.ts.map +1 -1
  143. package/dist/helpers/merge-parameter-body.d.ts +11 -0
  144. package/dist/helpers/merge-parameter-body.d.ts.map +1 -0
  145. package/dist/helpers/merge-parameter-body.js +36 -0
  146. package/dist/helpers/merge-parameter-body.js.map +1 -0
  147. package/dist/{harness/authoring/to-provider-chat-turns.d.ts → helpers/provider-chat-turns.d.ts} +7 -7
  148. package/dist/helpers/provider-chat-turns.d.ts.map +1 -0
  149. package/dist/{harness/authoring/to-provider-chat-turns.js → helpers/provider-chat-turns.js} +4 -4
  150. package/dist/helpers/provider-chat-turns.js.map +1 -0
  151. package/dist/helpers/ref.d.ts +1 -1
  152. package/dist/helpers/ref.d.ts.map +1 -1
  153. package/dist/helpers/secrets.d.ts +1 -1
  154. package/dist/helpers/secrets.d.ts.map +1 -1
  155. package/dist/helpers/state.d.ts +1 -1
  156. package/dist/helpers/state.d.ts.map +1 -1
  157. package/dist/index.d.ts +28 -22
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +25 -21
  160. package/dist/index.js.map +1 -1
  161. package/dist/invoke/execute-invoke.d.ts +2 -2
  162. package/dist/invoke/execute-invoke.d.ts.map +1 -1
  163. package/dist/invoke/execute-invoke.js +8 -20
  164. package/dist/invoke/execute-invoke.js.map +1 -1
  165. package/dist/invoke/invoke-builder.d.ts +1 -3
  166. package/dist/invoke/invoke-builder.d.ts.map +1 -1
  167. package/dist/invoke/invoke-builder.js +1 -6
  168. package/dist/invoke/invoke-builder.js.map +1 -1
  169. package/dist/media/base64.d.ts +11 -0
  170. package/dist/media/base64.d.ts.map +1 -0
  171. package/dist/media/base64.js +30 -0
  172. package/dist/media/base64.js.map +1 -0
  173. package/dist/media/browser-locator.d.ts +8 -0
  174. package/dist/media/browser-locator.d.ts.map +1 -0
  175. package/dist/media/browser-locator.js +22 -0
  176. package/dist/media/browser-locator.js.map +1 -0
  177. package/dist/media/index.d.ts +4 -2
  178. package/dist/media/index.d.ts.map +1 -1
  179. package/dist/media/index.js +4 -2
  180. package/dist/media/index.js.map +1 -1
  181. package/dist/media/resolve-file.d.ts +17 -15
  182. package/dist/media/resolve-file.d.ts.map +1 -1
  183. package/dist/media/resolve-file.js +28 -85
  184. package/dist/media/resolve-file.js.map +1 -1
  185. package/dist/media/resolved-file.d.ts +15 -0
  186. package/dist/media/resolved-file.d.ts.map +1 -0
  187. package/dist/media/resolved-file.js +2 -0
  188. package/dist/media/resolved-file.js.map +1 -0
  189. package/dist/media/write-media.d.ts +3 -14
  190. package/dist/media/write-media.d.ts.map +1 -1
  191. package/dist/media/write-media.js +17 -99
  192. package/dist/media/write-media.js.map +1 -1
  193. package/dist/patch/apply-patch.d.ts +2 -2
  194. package/dist/patch/apply-patch.d.ts.map +1 -1
  195. package/dist/patch/apply-patch.js +1 -1
  196. package/dist/patch/apply-patch.js.map +1 -1
  197. package/dist/patch/normalize-input.d.ts +1 -1
  198. package/dist/patch/normalize-input.d.ts.map +1 -1
  199. package/dist/patch/normalize-input.js +1 -1
  200. package/dist/patch/normalize-input.js.map +1 -1
  201. package/dist/patch/patch-builder.d.ts +1 -1
  202. package/dist/patch/patch-builder.d.ts.map +1 -1
  203. package/dist/patch/patch-builder.js.map +1 -1
  204. package/dist/patch/patch-document.d.ts +2 -2
  205. package/dist/patch/resolve-path.d.ts +2 -2
  206. package/dist/patch/resolve-path.d.ts.map +1 -1
  207. package/dist/patch/resolve-path.js +1 -1
  208. package/dist/patch/resolve-path.js.map +1 -1
  209. package/dist/patch/step-index.d.ts +1 -1
  210. package/dist/patch/step-index.d.ts.map +1 -1
  211. package/dist/policies/registry-control.d.ts +20 -0
  212. package/dist/policies/registry-control.d.ts.map +1 -0
  213. package/dist/policies/registry-control.js +72 -0
  214. package/dist/policies/registry-control.js.map +1 -0
  215. package/dist/registry/ensure-bound-extensions.d.ts +1 -1
  216. package/dist/registry/ensure-bound-extensions.js +2 -2
  217. package/dist/registry/ensure-bound-extensions.js.map +1 -1
  218. package/dist/registry/errors.d.ts +1 -1
  219. package/dist/registry/errors.d.ts.map +1 -1
  220. package/dist/registry/errors.js +2 -1
  221. package/dist/registry/errors.js.map +1 -1
  222. package/dist/registry/extension-catalog.d.ts +3 -18
  223. package/dist/registry/extension-catalog.d.ts.map +1 -1
  224. package/dist/registry/extension-catalog.js +3 -25
  225. package/dist/registry/extension-catalog.js.map +1 -1
  226. package/dist/registry/registry.d.ts +8 -9
  227. package/dist/registry/registry.d.ts.map +1 -1
  228. package/dist/registry/registry.js +9 -10
  229. package/dist/registry/registry.js.map +1 -1
  230. package/dist/runtime/capability-execution.d.ts +9 -8
  231. package/dist/runtime/capability-execution.d.ts.map +1 -1
  232. package/dist/runtime/capability-execution.js +11 -11
  233. package/dist/runtime/capability-execution.js.map +1 -1
  234. package/dist/runtime/commit.d.ts +2 -2
  235. package/dist/runtime/commit.d.ts.map +1 -1
  236. package/dist/runtime/context.d.ts +24 -4
  237. package/dist/runtime/context.d.ts.map +1 -1
  238. package/dist/runtime/context.js.map +1 -1
  239. package/dist/runtime/dispatch-capability.d.ts +1 -1
  240. package/dist/runtime/dispatch-capability.d.ts.map +1 -1
  241. package/dist/runtime/dispatch-capability.js +10 -5
  242. package/dist/runtime/dispatch-capability.js.map +1 -1
  243. package/dist/runtime/error-details.d.ts +13 -0
  244. package/dist/runtime/error-details.d.ts.map +1 -0
  245. package/dist/runtime/error-details.js +56 -0
  246. package/dist/runtime/error-details.js.map +1 -0
  247. package/dist/runtime/executor.d.ts +14 -5
  248. package/dist/runtime/executor.d.ts.map +1 -1
  249. package/dist/runtime/in-memory-executor.d.ts +1 -1
  250. package/dist/runtime/in-memory-executor.d.ts.map +1 -1
  251. package/dist/runtime/in-memory-executor.js +195 -27
  252. package/dist/runtime/in-memory-executor.js.map +1 -1
  253. package/dist/runtime/lifecycle.d.ts +1 -1
  254. package/dist/runtime/lifecycle.d.ts.map +1 -1
  255. package/dist/runtime/mutation-records.d.ts +1 -1
  256. package/dist/runtime/mutation-records.d.ts.map +1 -1
  257. package/dist/runtime/policy-engine.d.ts +3 -2
  258. package/dist/runtime/policy-engine.d.ts.map +1 -1
  259. package/dist/runtime/policy-engine.js +12 -3
  260. package/dist/runtime/policy-engine.js.map +1 -1
  261. package/dist/runtime/remote-invoke.d.ts +22 -2
  262. package/dist/runtime/remote-invoke.d.ts.map +1 -1
  263. package/dist/runtime/remote-invoke.js +43 -6
  264. package/dist/runtime/remote-invoke.js.map +1 -1
  265. package/dist/runtime/resolve-input.d.ts +1 -1
  266. package/dist/runtime/resolve-input.d.ts.map +1 -1
  267. package/dist/runtime/resolve-input.js +6 -0
  268. package/dist/runtime/resolve-input.js.map +1 -1
  269. package/dist/runtime/runtime-ids.d.ts +4 -4
  270. package/dist/runtime/runtime-ids.d.ts.map +1 -1
  271. package/dist/runtime/runtime-ids.js +4 -4
  272. package/dist/runtime/runtime-ids.js.map +1 -1
  273. package/dist/runtime/step-order.d.ts +32 -0
  274. package/dist/runtime/step-order.d.ts.map +1 -0
  275. package/dist/runtime/step-order.js +85 -0
  276. package/dist/runtime/step-order.js.map +1 -0
  277. package/dist/runtime/store.d.ts +1 -1
  278. package/dist/runtime/store.d.ts.map +1 -1
  279. package/dist/schema/json-schema.d.ts +20 -4
  280. package/dist/schema/json-schema.d.ts.map +1 -1
  281. package/dist/schema/json-schema.js +66 -10
  282. package/dist/schema/json-schema.js.map +1 -1
  283. package/dist/schema/workflow-io.d.ts +1 -1
  284. package/dist/schema/workflow-io.d.ts.map +1 -1
  285. package/dist/schemas/decode.result.json +165 -0
  286. package/dist/schemas/encode.result.json +172 -0
  287. package/dist/schemas/environment.describe.json +362 -0
  288. package/dist/schemas/environment.manifest.json +159 -0
  289. package/dist/schemas/environment.search.json +72 -0
  290. package/dist/schemas/patch.json +104 -0
  291. package/dist/schemas/patch.result.json +270 -0
  292. package/dist/schemas/requirements.json +102 -0
  293. package/dist/schemas/run.journal.json +158 -0
  294. package/dist/schemas/run.request.json +491 -0
  295. package/dist/schemas/run.result.json +240 -0
  296. package/dist/schemas/validation.result.json +99 -0
  297. package/dist/schemas/workflow.manifest.json +457 -0
  298. package/dist/services/index.d.ts +4 -0
  299. package/dist/services/index.d.ts.map +1 -0
  300. package/dist/services/index.js +4 -0
  301. package/dist/services/index.js.map +1 -0
  302. package/dist/services/map.d.ts +24 -0
  303. package/dist/services/map.d.ts.map +1 -0
  304. package/dist/services/map.js +37 -0
  305. package/dist/services/map.js.map +1 -0
  306. package/dist/services/media-store.d.ts +78 -0
  307. package/dist/services/media-store.d.ts.map +1 -0
  308. package/dist/services/media-store.js +16 -0
  309. package/dist/services/media-store.js.map +1 -0
  310. package/dist/services/provider.d.ts +35 -0
  311. package/dist/services/provider.d.ts.map +1 -0
  312. package/dist/services/provider.js +25 -0
  313. package/dist/services/provider.js.map +1 -0
  314. package/dist/testing/index.d.ts +4 -2
  315. package/dist/testing/index.d.ts.map +1 -1
  316. package/dist/testing/index.js +4 -2
  317. package/dist/testing/index.js.map +1 -1
  318. package/dist/testing/memory-media-store.d.ts +24 -0
  319. package/dist/testing/memory-media-store.d.ts.map +1 -0
  320. package/dist/testing/memory-media-store.js +71 -0
  321. package/dist/testing/memory-media-store.js.map +1 -0
  322. package/dist/testing/test-extension.d.ts +19 -3
  323. package/dist/testing/test-extension.d.ts.map +1 -1
  324. package/dist/testing/test-extension.js +83 -51
  325. package/dist/testing/test-extension.js.map +1 -1
  326. package/dist/testing/test-lifecycle-extension.d.ts +5 -4
  327. package/dist/testing/test-lifecycle-extension.d.ts.map +1 -1
  328. package/dist/testing/test-lifecycle-extension.js +28 -25
  329. package/dist/testing/test-lifecycle-extension.js.map +1 -1
  330. package/dist/types/capabilities.d.ts +39 -0
  331. package/dist/types/capabilities.d.ts.map +1 -0
  332. package/dist/types/capabilities.js +2 -0
  333. package/dist/types/capabilities.js.map +1 -0
  334. package/dist/types/capability-execution.d.ts +5 -0
  335. package/dist/types/capability-execution.d.ts.map +1 -0
  336. package/dist/types/capability-execution.js +3 -0
  337. package/dist/types/capability-execution.js.map +1 -0
  338. package/dist/types/capability-metadata.d.ts +216 -0
  339. package/dist/types/capability-metadata.d.ts.map +1 -0
  340. package/dist/types/capability-metadata.js +138 -0
  341. package/dist/types/capability-metadata.js.map +1 -0
  342. package/dist/types/encoding.d.ts +103 -0
  343. package/dist/types/encoding.d.ts.map +1 -0
  344. package/dist/types/encoding.js +29 -0
  345. package/dist/types/encoding.js.map +1 -0
  346. package/dist/types/environment.d.ts +155 -0
  347. package/dist/types/environment.d.ts.map +1 -0
  348. package/dist/types/environment.js +2 -0
  349. package/dist/types/environment.js.map +1 -0
  350. package/dist/types/errors.d.ts +93 -0
  351. package/dist/types/errors.d.ts.map +1 -0
  352. package/dist/types/errors.js +89 -0
  353. package/dist/types/errors.js.map +1 -0
  354. package/dist/types/file-ref.d.ts +84 -0
  355. package/dist/types/file-ref.d.ts.map +1 -0
  356. package/dist/types/file-ref.js +117 -0
  357. package/dist/types/file-ref.js.map +1 -0
  358. package/dist/types/image-output.d.ts +32 -0
  359. package/dist/types/image-output.d.ts.map +1 -0
  360. package/dist/types/image-output.js +11 -0
  361. package/dist/types/image-output.js.map +1 -0
  362. package/dist/types/index.d.ts +36 -0
  363. package/dist/types/index.d.ts.map +1 -0
  364. package/dist/types/index.js +13 -0
  365. package/dist/types/index.js.map +1 -0
  366. package/dist/types/invoke.d.ts +51 -0
  367. package/dist/types/invoke.d.ts.map +1 -0
  368. package/dist/types/invoke.js +32 -0
  369. package/dist/types/invoke.js.map +1 -0
  370. package/dist/types/journal.d.ts +121 -0
  371. package/dist/types/journal.d.ts.map +1 -0
  372. package/dist/types/journal.js +3 -0
  373. package/dist/types/journal.js.map +1 -0
  374. package/dist/types/lifecycle.d.ts +27 -0
  375. package/dist/types/lifecycle.d.ts.map +1 -0
  376. package/dist/types/lifecycle.js +2 -0
  377. package/dist/types/lifecycle.js.map +1 -0
  378. package/dist/types/model.d.ts +102 -0
  379. package/dist/types/model.d.ts.map +1 -0
  380. package/dist/types/model.js +51 -0
  381. package/dist/types/model.js.map +1 -0
  382. package/dist/types/patch-errors.d.ts +11 -0
  383. package/dist/types/patch-errors.d.ts.map +1 -0
  384. package/dist/types/patch-errors.js +9 -0
  385. package/dist/types/patch-errors.js.map +1 -0
  386. package/dist/types/patch.d.ts +51 -0
  387. package/dist/types/patch.d.ts.map +1 -0
  388. package/dist/types/patch.js +2 -0
  389. package/dist/types/patch.js.map +1 -0
  390. package/dist/types/registry.d.ts +24 -0
  391. package/dist/types/registry.d.ts.map +1 -0
  392. package/dist/types/registry.js +2 -0
  393. package/dist/types/registry.js.map +1 -0
  394. package/dist/types/requirements.d.ts +42 -0
  395. package/dist/types/requirements.d.ts.map +1 -0
  396. package/dist/types/requirements.js +2 -0
  397. package/dist/types/requirements.js.map +1 -0
  398. package/dist/types/run-events.d.ts +32 -0
  399. package/dist/types/run-events.d.ts.map +1 -0
  400. package/dist/types/run-events.js +8 -0
  401. package/dist/types/run-events.js.map +1 -0
  402. package/dist/types/run.d.ts +48 -0
  403. package/dist/types/run.d.ts.map +1 -0
  404. package/dist/types/run.js +2 -0
  405. package/dist/types/run.js.map +1 -0
  406. package/dist/types/schema.d.ts +58 -0
  407. package/dist/types/schema.d.ts.map +1 -0
  408. package/dist/types/schema.js +2 -0
  409. package/dist/types/schema.js.map +1 -0
  410. package/dist/types/store.d.ts +30 -0
  411. package/dist/types/store.d.ts.map +1 -0
  412. package/dist/types/store.js +2 -0
  413. package/dist/types/store.js.map +1 -0
  414. package/dist/types/validation.d.ts +30 -0
  415. package/dist/types/validation.d.ts.map +1 -0
  416. package/dist/types/validation.js +2 -0
  417. package/dist/types/validation.js.map +1 -0
  418. package/dist/types/version.d.ts +5 -0
  419. package/dist/types/version.d.ts.map +1 -0
  420. package/dist/types/version.js +3 -0
  421. package/dist/types/version.js.map +1 -0
  422. package/dist/types/workflow.d.ts +80 -0
  423. package/dist/types/workflow.d.ts.map +1 -0
  424. package/dist/types/workflow.js +2 -0
  425. package/dist/types/workflow.js.map +1 -0
  426. package/dist/util/semver-range.d.ts +6 -0
  427. package/dist/util/semver-range.d.ts.map +1 -0
  428. package/dist/util/semver-range.js +9 -0
  429. package/dist/util/semver-range.js.map +1 -0
  430. package/dist/validate/environment.d.ts +5 -2
  431. package/dist/validate/environment.d.ts.map +1 -1
  432. package/dist/validate/environment.js +38 -19
  433. package/dist/validate/environment.js.map +1 -1
  434. package/dist/validate/workflow-schema.d.ts +17 -31
  435. package/dist/validate/workflow-schema.d.ts.map +1 -1
  436. package/dist/validate/workflow-schema.js +1 -10
  437. package/dist/validate/workflow-schema.js.map +1 -1
  438. package/dist/validate/workflow.d.ts +1 -1
  439. package/dist/validate/workflow.d.ts.map +1 -1
  440. package/dist/validate/workflow.js +2 -11
  441. package/dist/validate/workflow.js.map +1 -1
  442. package/dist/validate/zod-mapper.d.ts +1 -1
  443. package/dist/validate/zod-mapper.d.ts.map +1 -1
  444. package/dist/workflow/assign-unique-step-ids.d.ts +1 -1
  445. package/dist/workflow/assign-unique-step-ids.d.ts.map +1 -1
  446. package/dist/workflow/builder.d.ts +17 -1
  447. package/dist/workflow/builder.d.ts.map +1 -1
  448. package/dist/workflow/builder.js +27 -1
  449. package/dist/workflow/builder.js.map +1 -1
  450. package/dist/workflow/flow.d.ts +2 -2
  451. package/dist/workflow/flow.d.ts.map +1 -1
  452. package/dist/workflow/requirements.d.ts +34 -0
  453. package/dist/workflow/requirements.d.ts.map +1 -0
  454. package/dist/workflow/requirements.js +134 -0
  455. package/dist/workflow/requirements.js.map +1 -0
  456. package/package.json +13 -86
  457. package/dist/bindings/harness.d.ts +0 -24
  458. package/dist/bindings/harness.d.ts.map +0 -1
  459. package/dist/bindings/harness.js +0 -44
  460. package/dist/bindings/harness.js.map +0 -1
  461. package/dist/bindings/runtime.d.ts +0 -19
  462. package/dist/bindings/runtime.d.ts.map +0 -1
  463. package/dist/bindings/runtime.js +0 -32
  464. package/dist/bindings/runtime.js.map +0 -1
  465. package/dist/browser-runtime-entry.d.ts +0 -61
  466. package/dist/browser-runtime-entry.d.ts.map +0 -1
  467. package/dist/browser-runtime-entry.js +0 -54
  468. package/dist/browser-runtime-entry.js.map +0 -1
  469. package/dist/browser.d.ts +0 -20
  470. package/dist/browser.d.ts.map +0 -1
  471. package/dist/browser.js +0 -20
  472. package/dist/browser.js.map +0 -1
  473. package/dist/compile/compile-harness-artifact.d.ts +0 -30
  474. package/dist/compile/compile-harness-artifact.d.ts.map +0 -1
  475. package/dist/compile/compile-harness-artifact.js +0 -43
  476. package/dist/compile/compile-harness-artifact.js.map +0 -1
  477. package/dist/compile/entry.d.ts +0 -3
  478. package/dist/compile/entry.d.ts.map +0 -1
  479. package/dist/compile/entry.js +0 -3
  480. package/dist/compile/entry.js.map +0 -1
  481. package/dist/compile/evaluate-browser.d.ts +0 -7
  482. package/dist/compile/evaluate-browser.d.ts.map +0 -1
  483. package/dist/compile/evaluate-browser.js +0 -26
  484. package/dist/compile/evaluate-browser.js.map +0 -1
  485. package/dist/compile/evaluate-harness-artifact.d.ts +0 -3
  486. package/dist/compile/evaluate-harness-artifact.d.ts.map +0 -1
  487. package/dist/compile/evaluate-harness-artifact.js +0 -17
  488. package/dist/compile/evaluate-harness-artifact.js.map +0 -1
  489. package/dist/compile/evaluate.d.ts +0 -5
  490. package/dist/compile/evaluate.d.ts.map +0 -1
  491. package/dist/compile/evaluate.js +0 -20
  492. package/dist/compile/evaluate.js.map +0 -1
  493. package/dist/compile/extract-harness-artifact.d.ts +0 -9
  494. package/dist/compile/extract-harness-artifact.d.ts.map +0 -1
  495. package/dist/compile/extract-harness-artifact.js +0 -33
  496. package/dist/compile/extract-harness-artifact.js.map +0 -1
  497. package/dist/compile/index.browser.d.ts +0 -49
  498. package/dist/compile/index.browser.d.ts.map +0 -1
  499. package/dist/compile/index.browser.js +0 -93
  500. package/dist/compile/index.browser.js.map +0 -1
  501. package/dist/compile/prepare-browser-source.d.ts +0 -3
  502. package/dist/compile/prepare-browser-source.d.ts.map +0 -1
  503. package/dist/compile/prepare-browser-source.js +0 -25
  504. package/dist/compile/prepare-browser-source.js.map +0 -1
  505. package/dist/compile/transpile-browser.d.ts +0 -44
  506. package/dist/compile/transpile-browser.d.ts.map +0 -1
  507. package/dist/compile/transpile-browser.js +0 -120
  508. package/dist/compile/transpile-browser.js.map +0 -1
  509. package/dist/compile/transpile.d.ts +0 -27
  510. package/dist/compile/transpile.d.ts.map +0 -1
  511. package/dist/compile/transpile.js +0 -150
  512. package/dist/compile/transpile.js.map +0 -1
  513. package/dist/definitions/runtime.d.ts +0 -22
  514. package/dist/definitions/runtime.d.ts.map +0 -1
  515. package/dist/definitions/runtime.js +0 -48
  516. package/dist/definitions/runtime.js.map +0 -1
  517. package/dist/encoding/strip-harness-typescript-output.d.ts +0 -7
  518. package/dist/encoding/strip-harness-typescript-output.d.ts.map +0 -1
  519. package/dist/encoding/strip-harness-typescript-output.js +0 -40
  520. package/dist/encoding/strip-harness-typescript-output.js.map +0 -1
  521. package/dist/encoding/strip-markdown-fences.d.ts +0 -6
  522. package/dist/encoding/strip-markdown-fences.d.ts.map +0 -1
  523. package/dist/encoding/strip-markdown-fences.js +0 -23
  524. package/dist/encoding/strip-markdown-fences.js.map +0 -1
  525. package/dist/feedback/collect.d.ts +0 -32
  526. package/dist/feedback/collect.d.ts.map +0 -1
  527. package/dist/feedback/collect.js +0 -97
  528. package/dist/feedback/collect.js.map +0 -1
  529. package/dist/feedback/index.d.ts +0 -2
  530. package/dist/feedback/index.d.ts.map +0 -1
  531. package/dist/feedback/index.js +0 -2
  532. package/dist/feedback/index.js.map +0 -1
  533. package/dist/harness/authoring/chat-result.d.ts +0 -19
  534. package/dist/harness/authoring/chat-result.d.ts.map +0 -1
  535. package/dist/harness/authoring/chat-result.js +0 -56
  536. package/dist/harness/authoring/chat-result.js.map +0 -1
  537. package/dist/harness/authoring/classified-intent.d.ts +0 -46
  538. package/dist/harness/authoring/classified-intent.d.ts.map +0 -1
  539. package/dist/harness/authoring/classified-intent.js +0 -261
  540. package/dist/harness/authoring/classified-intent.js.map +0 -1
  541. package/dist/harness/authoring/context-policy.d.ts +0 -47
  542. package/dist/harness/authoring/context-policy.d.ts.map +0 -1
  543. package/dist/harness/authoring/context-policy.js +0 -160
  544. package/dist/harness/authoring/context-policy.js.map +0 -1
  545. package/dist/harness/authoring/describe-for-prompt.d.ts +0 -19
  546. package/dist/harness/authoring/describe-for-prompt.d.ts.map +0 -1
  547. package/dist/harness/authoring/describe-for-prompt.js +0 -105
  548. package/dist/harness/authoring/describe-for-prompt.js.map +0 -1
  549. package/dist/harness/authoring/encode-prompt-text.d.ts +0 -7
  550. package/dist/harness/authoring/encode-prompt-text.d.ts.map +0 -1
  551. package/dist/harness/authoring/encode-prompt-text.js +0 -13
  552. package/dist/harness/authoring/encode-prompt-text.js.map +0 -1
  553. package/dist/harness/authoring/environment-question.d.ts +0 -6
  554. package/dist/harness/authoring/environment-question.d.ts.map +0 -1
  555. package/dist/harness/authoring/environment-question.js +0 -11
  556. package/dist/harness/authoring/environment-question.js.map +0 -1
  557. package/dist/harness/authoring/index.d.ts +0 -23
  558. package/dist/harness/authoring/index.d.ts.map +0 -1
  559. package/dist/harness/authoring/index.js +0 -22
  560. package/dist/harness/authoring/index.js.map +0 -1
  561. package/dist/harness/authoring/normalize-create-eql-output.d.ts +0 -27
  562. package/dist/harness/authoring/normalize-create-eql-output.d.ts.map +0 -1
  563. package/dist/harness/authoring/normalize-create-eql-output.js +0 -284
  564. package/dist/harness/authoring/normalize-create-eql-output.js.map +0 -1
  565. package/dist/harness/authoring/normalize-intent-eql-output.d.ts +0 -7
  566. package/dist/harness/authoring/normalize-intent-eql-output.d.ts.map +0 -1
  567. package/dist/harness/authoring/normalize-intent-eql-output.js +0 -59
  568. package/dist/harness/authoring/normalize-intent-eql-output.js.map +0 -1
  569. package/dist/harness/authoring/normalize-patch-eql-output.d.ts +0 -28
  570. package/dist/harness/authoring/normalize-patch-eql-output.d.ts.map +0 -1
  571. package/dist/harness/authoring/normalize-patch-eql-output.js +0 -202
  572. package/dist/harness/authoring/normalize-patch-eql-output.js.map +0 -1
  573. package/dist/harness/authoring/normalize-workflow-output.d.ts +0 -6
  574. package/dist/harness/authoring/normalize-workflow-output.d.ts.map +0 -1
  575. package/dist/harness/authoring/normalize-workflow-output.js +0 -51
  576. package/dist/harness/authoring/normalize-workflow-output.js.map +0 -1
  577. package/dist/harness/authoring/patch-clear-intent.d.ts +0 -17
  578. package/dist/harness/authoring/patch-clear-intent.d.ts.map +0 -1
  579. package/dist/harness/authoring/patch-clear-intent.js +0 -46
  580. package/dist/harness/authoring/patch-clear-intent.js.map +0 -1
  581. package/dist/harness/authoring/presentation.d.ts +0 -57
  582. package/dist/harness/authoring/presentation.d.ts.map +0 -1
  583. package/dist/harness/authoring/presentation.js +0 -137
  584. package/dist/harness/authoring/presentation.js.map +0 -1
  585. package/dist/harness/authoring/recover-structured-patch.d.ts +0 -21
  586. package/dist/harness/authoring/recover-structured-patch.d.ts.map +0 -1
  587. package/dist/harness/authoring/recover-structured-patch.js +0 -230
  588. package/dist/harness/authoring/recover-structured-patch.js.map +0 -1
  589. package/dist/harness/authoring/repair-workflow-json.d.ts +0 -16
  590. package/dist/harness/authoring/repair-workflow-json.d.ts.map +0 -1
  591. package/dist/harness/authoring/repair-workflow-json.js +0 -183
  592. package/dist/harness/authoring/repair-workflow-json.js.map +0 -1
  593. package/dist/harness/authoring/safe-reply.d.ts +0 -71
  594. package/dist/harness/authoring/safe-reply.d.ts.map +0 -1
  595. package/dist/harness/authoring/safe-reply.js +0 -291
  596. package/dist/harness/authoring/safe-reply.js.map +0 -1
  597. package/dist/harness/authoring/summarize-capability-schema.d.ts +0 -20
  598. package/dist/harness/authoring/summarize-capability-schema.d.ts.map +0 -1
  599. package/dist/harness/authoring/summarize-capability-schema.js +0 -141
  600. package/dist/harness/authoring/summarize-capability-schema.js.map +0 -1
  601. package/dist/harness/authoring/summarize-environment.d.ts +0 -77
  602. package/dist/harness/authoring/summarize-environment.d.ts.map +0 -1
  603. package/dist/harness/authoring/summarize-environment.js +0 -298
  604. package/dist/harness/authoring/summarize-environment.js.map +0 -1
  605. package/dist/harness/authoring/summarize-probe-context.d.ts +0 -31
  606. package/dist/harness/authoring/summarize-probe-context.d.ts.map +0 -1
  607. package/dist/harness/authoring/summarize-probe-context.js +0 -134
  608. package/dist/harness/authoring/summarize-probe-context.js.map +0 -1
  609. package/dist/harness/authoring/summarize-run-context.d.ts +0 -28
  610. package/dist/harness/authoring/summarize-run-context.d.ts.map +0 -1
  611. package/dist/harness/authoring/summarize-run-context.js +0 -40
  612. package/dist/harness/authoring/summarize-run-context.js.map +0 -1
  613. package/dist/harness/authoring/summarize-workflow.d.ts +0 -37
  614. package/dist/harness/authoring/summarize-workflow.d.ts.map +0 -1
  615. package/dist/harness/authoring/summarize-workflow.js +0 -148
  616. package/dist/harness/authoring/summarize-workflow.js.map +0 -1
  617. package/dist/harness/authoring/to-provider-chat-turns.d.ts.map +0 -1
  618. package/dist/harness/authoring/to-provider-chat-turns.js.map +0 -1
  619. package/dist/harness/call-model.d.ts +0 -15
  620. package/dist/harness/call-model.d.ts.map +0 -1
  621. package/dist/harness/call-model.js +0 -59
  622. package/dist/harness/call-model.js.map +0 -1
  623. package/dist/harness/context.d.ts +0 -28
  624. package/dist/harness/context.d.ts.map +0 -1
  625. package/dist/harness/context.js +0 -19
  626. package/dist/harness/context.js.map +0 -1
  627. package/dist/harness/define-harness.d.ts +0 -37
  628. package/dist/harness/define-harness.d.ts.map +0 -1
  629. package/dist/harness/define-harness.js +0 -88
  630. package/dist/harness/define-harness.js.map +0 -1
  631. package/dist/harness/definitions/test-minimal-harness.d.ts +0 -13
  632. package/dist/harness/definitions/test-minimal-harness.d.ts.map +0 -1
  633. package/dist/harness/definitions/test-minimal-harness.js +0 -45
  634. package/dist/harness/definitions/test-minimal-harness.js.map +0 -1
  635. package/dist/harness/execute-harness.d.ts +0 -9
  636. package/dist/harness/execute-harness.d.ts.map +0 -1
  637. package/dist/harness/execute-harness.js +0 -142
  638. package/dist/harness/execute-harness.js.map +0 -1
  639. package/dist/harness/format-resolve.d.ts +0 -26
  640. package/dist/harness/format-resolve.d.ts.map +0 -1
  641. package/dist/harness/format-resolve.js +0 -50
  642. package/dist/harness/format-resolve.js.map +0 -1
  643. package/dist/harness/harness-catalog.d.ts +0 -41
  644. package/dist/harness/harness-catalog.d.ts.map +0 -1
  645. package/dist/harness/harness-catalog.js +0 -66
  646. package/dist/harness/harness-catalog.js.map +0 -1
  647. package/dist/harness/index.d.ts +0 -11
  648. package/dist/harness/index.d.ts.map +0 -1
  649. package/dist/harness/index.js +0 -9
  650. package/dist/harness/index.js.map +0 -1
  651. package/dist/harness/prompts/build-repair-hint.d.ts +0 -8
  652. package/dist/harness/prompts/build-repair-hint.d.ts.map +0 -1
  653. package/dist/harness/prompts/build-repair-hint.js +0 -28
  654. package/dist/harness/prompts/build-repair-hint.js.map +0 -1
  655. package/dist/harness/prompts/build-system-prompt.d.ts +0 -7
  656. package/dist/harness/prompts/build-system-prompt.d.ts.map +0 -1
  657. package/dist/harness/prompts/build-system-prompt.js +0 -97
  658. package/dist/harness/prompts/build-system-prompt.js.map +0 -1
  659. package/dist/harness/prompts/eql-primer.d.ts +0 -14
  660. package/dist/harness/prompts/eql-primer.d.ts.map +0 -1
  661. package/dist/harness/prompts/eql-primer.js +0 -221
  662. package/dist/harness/prompts/eql-primer.js.map +0 -1
  663. package/dist/harness/prompts/fixtures-root.d.ts +0 -5
  664. package/dist/harness/prompts/fixtures-root.d.ts.map +0 -1
  665. package/dist/harness/prompts/fixtures-root.js +0 -7
  666. package/dist/harness/prompts/fixtures-root.js.map +0 -1
  667. package/dist/harness/prompts/harness-prompt-fixture-schema.d.ts +0 -95
  668. package/dist/harness/prompts/harness-prompt-fixture-schema.d.ts.map +0 -1
  669. package/dist/harness/prompts/harness-prompt-fixture-schema.js +0 -28
  670. package/dist/harness/prompts/harness-prompt-fixture-schema.js.map +0 -1
  671. package/dist/harness/prompts/identity-primer.d.ts +0 -6
  672. package/dist/harness/prompts/identity-primer.d.ts.map +0 -1
  673. package/dist/harness/prompts/identity-primer.js +0 -9
  674. package/dist/harness/prompts/identity-primer.js.map +0 -1
  675. package/dist/harness/prompts/index.d.ts +0 -7
  676. package/dist/harness/prompts/index.d.ts.map +0 -1
  677. package/dist/harness/prompts/index.js +0 -7
  678. package/dist/harness/prompts/index.js.map +0 -1
  679. package/dist/harness/prompts/load-schema-example.browser.d.ts +0 -11
  680. package/dist/harness/prompts/load-schema-example.browser.d.ts.map +0 -1
  681. package/dist/harness/prompts/load-schema-example.browser.js +0 -70
  682. package/dist/harness/prompts/load-schema-example.browser.js.map +0 -1
  683. package/dist/harness/prompts/load-schema-example.d.ts +0 -11
  684. package/dist/harness/prompts/load-schema-example.d.ts.map +0 -1
  685. package/dist/harness/prompts/load-schema-example.js +0 -22
  686. package/dist/harness/prompts/load-schema-example.js.map +0 -1
  687. package/dist/harness/prompts/load-schema-example.node.d.ts +0 -7
  688. package/dist/harness/prompts/load-schema-example.node.d.ts.map +0 -1
  689. package/dist/harness/prompts/load-schema-example.node.js +0 -38
  690. package/dist/harness/prompts/load-schema-example.node.js.map +0 -1
  691. package/dist/harness/prompts/schema-example-files.d.ts +0 -7
  692. package/dist/harness/prompts/schema-example-files.d.ts.map +0 -1
  693. package/dist/harness/prompts/schema-example-files.js +0 -12
  694. package/dist/harness/prompts/schema-example-files.js.map +0 -1
  695. package/dist/harness/prompts/typescript-primer.d.ts +0 -11
  696. package/dist/harness/prompts/typescript-primer.d.ts.map +0 -1
  697. package/dist/harness/prompts/typescript-primer.js +0 -80
  698. package/dist/harness/prompts/typescript-primer.js.map +0 -1
  699. package/dist/harness/repair-loop-timing.d.ts +0 -17
  700. package/dist/harness/repair-loop-timing.d.ts.map +0 -1
  701. package/dist/harness/repair-loop-timing.js +0 -89
  702. package/dist/harness/repair-loop-timing.js.map +0 -1
  703. package/dist/harness/resolve-harness-binding.d.ts +0 -10
  704. package/dist/harness/resolve-harness-binding.d.ts.map +0 -1
  705. package/dist/harness/resolve-harness-binding.js +0 -14
  706. package/dist/harness/resolve-harness-binding.js.map +0 -1
  707. package/dist/harness/run-model-repair-loop.d.ts +0 -45
  708. package/dist/harness/run-model-repair-loop.d.ts.map +0 -1
  709. package/dist/harness/run-model-repair-loop.js +0 -57
  710. package/dist/harness/run-model-repair-loop.js.map +0 -1
  711. package/dist/harness/types.d.ts +0 -34
  712. package/dist/harness/types.d.ts.map +0 -1
  713. package/dist/harness/types.js +0 -2
  714. package/dist/harness/types.js.map +0 -1
  715. package/dist/helpers/browser.d.ts +0 -12
  716. package/dist/helpers/browser.d.ts.map +0 -1
  717. package/dist/helpers/browser.js +0 -12
  718. package/dist/helpers/browser.js.map +0 -1
  719. package/dist/loaders/files.d.ts +0 -13
  720. package/dist/loaders/files.d.ts.map +0 -1
  721. package/dist/loaders/files.js +0 -66
  722. package/dist/loaders/files.js.map +0 -1
  723. package/dist/loaders/index.d.ts +0 -2
  724. package/dist/loaders/index.d.ts.map +0 -1
  725. package/dist/loaders/index.js +0 -2
  726. package/dist/loaders/index.js.map +0 -1
  727. package/dist/loaders/read-media-file.d.ts +0 -6
  728. package/dist/loaders/read-media-file.d.ts.map +0 -1
  729. package/dist/loaders/read-media-file.js +0 -10
  730. package/dist/loaders/read-media-file.js.map +0 -1
  731. package/dist/node.d.ts +0 -8
  732. package/dist/node.d.ts.map +0 -1
  733. package/dist/node.js +0 -8
  734. package/dist/node.js.map +0 -1
  735. package/dist/runtime/test-session-state.d.ts +0 -23
  736. package/dist/runtime/test-session-state.d.ts.map +0 -1
  737. package/dist/runtime/test-session-state.js +0 -62
  738. package/dist/runtime/test-session-state.js.map +0 -1
  739. package/dist/test-session/index.d.ts +0 -2
  740. package/dist/test-session/index.d.ts.map +0 -1
  741. package/dist/test-session/index.js +0 -2
  742. package/dist/test-session/index.js.map +0 -1
  743. package/dist/test-session/test-session.d.ts +0 -36
  744. package/dist/test-session/test-session.d.ts.map +0 -1
  745. package/dist/test-session/test-session.js +0 -115
  746. package/dist/test-session/test-session.js.map +0 -1
  747. package/dist/testing/test-model-generate.d.ts +0 -15
  748. package/dist/testing/test-model-generate.d.ts.map +0 -1
  749. package/dist/testing/test-model-generate.js +0 -71
  750. package/dist/testing/test-model-generate.js.map +0 -1
  751. package/dist/validate/harness.d.ts +0 -11
  752. package/dist/validate/harness.d.ts.map +0 -1
  753. package/dist/validate/harness.js +0 -72
  754. package/dist/validate/harness.js.map +0 -1
@@ -1,142 +0,0 @@
1
- import { ECP_HARNESS_ERROR_CODES, ECP_INVOKE_ERROR_CODES, LATEST_ECP_VERSION, } from "@executioncontrolprotocol/types";
2
- import { createUtilityCapabilityContext } from "../encoding/utility-context.js";
3
- import { evaluatePolicies } from "../runtime/policy-engine.js";
4
- import { createUsageLedger } from "../runtime/context.js";
5
- import { emptyValidationResult } from "../validate/workflow-schema.js";
6
- import { zodIssuesToValidationIssues } from "../validate/zod-mapper.js";
7
- import { getCatalogedHarness, harnessIdFromCapabilityId } from "./harness-catalog.js";
8
- import { createHarnessCapabilityContext } from "./context.js";
9
- import { findHarnessBinding } from "./resolve-harness-binding.js";
10
- import { EcpImpl } from "../environment/ecp.js";
11
- import { CapabilityDispatchError, createDispatchingCall, } from "../runtime/dispatch-capability.js";
12
- const INVOKE_STUB_WORKFLOW = {
13
- schema: "@executioncontrolprotocol.workflow",
14
- version: LATEST_ECP_VERSION,
15
- workflow: { id: "invoke-stub" },
16
- steps: [],
17
- };
18
- function invokeFailure(capabilityId, code, message, validation) {
19
- return {
20
- schema: "@executioncontrolprotocol.invoke.result",
21
- version: LATEST_ECP_VERSION,
22
- success: false,
23
- capabilityId,
24
- validation,
25
- diagnostics: [{ severity: "error", code, message }],
26
- };
27
- }
28
- /**
29
- * Execute a harness evaluate capability.
30
- * @category Harness
31
- * @internal
32
- */
33
- export async function executeHarnessInvoke(env, capabilityId, input, providerOverride) {
34
- const harnessId = harnessIdFromCapabilityId(capabilityId);
35
- if (!harnessId) {
36
- return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.CAPABILITY_NOT_FOUND, `Not a harness capability: ${capabilityId}`);
37
- }
38
- const def = getCatalogedHarness(harnessId);
39
- if (!def) {
40
- return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.UNKNOWN_HARNESS, `Harness ${harnessId} is not registered.`);
41
- }
42
- const binding = findHarnessBinding(env, harnessId);
43
- if (!binding) {
44
- return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.HARNESS_NOT_BOUND, `Harness ${harnessId} is not bound in this environment.`);
45
- }
46
- const uses = providerOverride ?? binding.uses;
47
- if (!uses) {
48
- return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.UNKNOWN_HARNESS_PROVIDER, `Harness ${harnessId} has no provider (.uses(...)).`);
49
- }
50
- let parsedInput = input;
51
- if (def.inputSchema) {
52
- const parsed = def.inputSchema.safeParse(input);
53
- if (!parsed.success) {
54
- const validation = emptyValidationResult(false);
55
- validation.errors.push(...zodIssuesToValidationIssues(parsed.error.issues));
56
- return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_INPUT_INVALID, "Harness input validation failed", validation);
57
- }
58
- parsedInput = parsed.data;
59
- }
60
- const bindings = env.ecpResolveBindings();
61
- const policyCtx = {
62
- workflow: INVOKE_STUB_WORKFLOW,
63
- run: { id: env.getEnvId(), input: {} },
64
- step: { id: "invoke", capabilityId },
65
- state: {},
66
- input: (parsedInput ?? {}),
67
- usage: createUsageLedger(),
68
- scope: "invoke",
69
- operation: "invoke",
70
- capabilityId,
71
- };
72
- const preDecision = await evaluatePolicies("policy:pre", bindings.policyHooks, policyCtx);
73
- if (preDecision.type === "deny" || preDecision.type === "pause") {
74
- return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_DENIED, preDecision.reason ?? "Harness invocation denied by policy");
75
- }
76
- const registry = env.getRegistry();
77
- const utilityCtx = createUtilityCapabilityContext(env.getEnvId(), env.getEnvLabel(), registry);
78
- const extPrefix = uses.replace(/\.[^.]+$/, "");
79
- const extBinding = bindings.extensions.find((e) => e.id === extPrefix);
80
- const capCtx = {
81
- store: utilityCtx.store,
82
- state: {},
83
- run: { id: env.getEnvId(), input: {} },
84
- step: { id: "invoke", capabilityId },
85
- logger: utilityCtx.logger,
86
- usage: policyCtx.usage,
87
- extensionConfig: extBinding?.config,
88
- blobs: env.getBlobStore(),
89
- artifacts: env.ensureArtifactStore(),
90
- capabilities: {
91
- call: async (id) => {
92
- throw new Error(`nested call not bound: ${id}`);
93
- },
94
- },
95
- };
96
- capCtx.capabilities.call = createDispatchingCall({
97
- ctx: capCtx,
98
- registry,
99
- runtimeId: env.getRuntimeId(),
100
- remoteInvoke: env.getRemoteInvoke(),
101
- });
102
- const ecp = new EcpImpl(env);
103
- const harnessCtx = createHarnessCapabilityContext(harnessId, uses, binding.config, env, ecp, capCtx, def.configSchema);
104
- let output;
105
- try {
106
- output = await def.handler(parsedInput, harnessCtx);
107
- }
108
- catch (err) {
109
- if (err instanceof CapabilityDispatchError) {
110
- return invokeFailure(capabilityId, err.result.diagnostics[0]?.code ?? ECP_HARNESS_ERROR_CODES.HARNESS_EVALUATE_FAILED, err.result.diagnostics[0]?.message ?? "Harness evaluation failed");
111
- }
112
- const message = err instanceof Error ? err.message : String(err);
113
- return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.HARNESS_EVALUATE_FAILED, message);
114
- }
115
- if (def.outputSchema) {
116
- const parsed = def.outputSchema.safeParse(output);
117
- if (!parsed.success) {
118
- const validation = emptyValidationResult(false);
119
- validation.errors.push(...zodIssuesToValidationIssues(parsed.error.issues));
120
- return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_OUTPUT_INVALID, "Harness output validation failed", validation);
121
- }
122
- output = parsed.data;
123
- }
124
- return {
125
- schema: "@executioncontrolprotocol.invoke.result",
126
- version: LATEST_ECP_VERSION,
127
- success: true,
128
- capabilityId,
129
- result: output,
130
- validation: emptyValidationResult(true),
131
- diagnostics: [],
132
- usage: policyCtx.usage.modelCalls > 0
133
- ? {
134
- modelCalls: policyCtx.usage.modelCalls,
135
- costUsd: policyCtx.usage.costUsd,
136
- tokens: policyCtx.usage.tokens,
137
- retries: policyCtx.usage.retries,
138
- }
139
- : undefined,
140
- };
141
- }
142
- //# sourceMappingURL=execute-harness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-harness.js","sourceRoot":"","sources":["../../src/harness/execute-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,GAInB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAA0B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acedId } from "@executioncontrolprotocol/types";
2
- /** Core formatter ids that do not require environment binding. @category Harness */
3
- export declare const CORE_FORMATTER_IDS: Set<string>;
4
- /**
5
- * Whether a formatter id is core-cataloged (always available).
6
- * @category Harness
7
- */
8
- export declare function isCoreFormatterId(formatId: string): boolean;
9
- /**
10
- * Normalize harness config format field to extension id.
11
- * @category Harness
12
- */
13
- export declare function normalizeFormatId(format: string): NamespacedId;
14
- /**
15
- * Whether formatter is registered in catalog or core set.
16
- * @category Harness
17
- */
18
- export declare function isFormatterRegistered(formatId: string): boolean;
19
- /**
20
- * Infer model response format hint from formatter id.
21
- * @category Harness
22
- */
23
- /** Logical harness output format for TypeScript source (not an extension id). @category Harness */
24
- export declare const HARNESS_OUTPUT_FORMAT_TYPESCRIPT: "typescript";
25
- export declare function inferResponseFormatFromFormatter(formatId: string): "text" | "json" | "toon" | "eql" | undefined;
26
- //# sourceMappingURL=format-resolve.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-resolve.d.ts","sourceRoot":"","sources":["../../src/harness/format-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAG3F,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,aAG7B,CAAA;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAE9D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,EAAG,YAAqB,CAAA;AAErE,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAO9C"}
@@ -1,50 +0,0 @@
1
- import { ECP_CORE_FORMATTER_IDS } from "@executioncontrolprotocol/types";
2
- import { getCatalogedExtension, normalizeExtensionId } from "../registry/extension-catalog.js";
3
- /** Core formatter ids that do not require environment binding. @category Harness */
4
- export const CORE_FORMATTER_IDS = new Set([
5
- ECP_CORE_FORMATTER_IDS.JSON,
6
- ECP_CORE_FORMATTER_IDS.FLUENT,
7
- ]);
8
- /**
9
- * Whether a formatter id is core-cataloged (always available).
10
- * @category Harness
11
- */
12
- export function isCoreFormatterId(formatId) {
13
- return CORE_FORMATTER_IDS.has(normalizeExtensionId(formatId));
14
- }
15
- /**
16
- * Normalize harness config format field to extension id.
17
- * @category Harness
18
- */
19
- export function normalizeFormatId(format) {
20
- return normalizeExtensionId(format);
21
- }
22
- /**
23
- * Whether formatter is registered in catalog or core set.
24
- * @category Harness
25
- */
26
- export function isFormatterRegistered(formatId) {
27
- const normalized = normalizeFormatId(formatId);
28
- if (isCoreFormatterId(normalized))
29
- return true;
30
- return getCatalogedExtension(normalized) !== undefined;
31
- }
32
- /**
33
- * Infer model response format hint from formatter id.
34
- * @category Harness
35
- */
36
- /** Logical harness output format for TypeScript source (not an extension id). @category Harness */
37
- export const HARNESS_OUTPUT_FORMAT_TYPESCRIPT = "typescript";
38
- export function inferResponseFormatFromFormatter(formatId) {
39
- if (formatId === HARNESS_OUTPUT_FORMAT_TYPESCRIPT)
40
- return "text";
41
- const id = normalizeFormatId(formatId);
42
- if (id === ECP_CORE_FORMATTER_IDS.JSON)
43
- return "json";
44
- if (id === "@executioncontrolprotocol/format-toon")
45
- return "toon";
46
- if (id === "@executioncontrolprotocol/format-eql")
47
- return "eql";
48
- return "text";
49
- }
50
- //# sourceMappingURL=format-resolve.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-resolve.js","sourceRoot":"","sources":["../../src/harness/format-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAqB,MAAM,iCAAiC,CAAA;AAC3F,OAAO,EAAE,qBA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essDefinition } from "./types.js";
3
- /**
4
- * Normalize harness id to `@namespace/name` form.
5
- * @category Harness
6
- */
7
- export declare function normalizeHarnessId(ref: string): HarnessId;
8
- /**
9
- * Register a harness definition for catalog lookup and invocation.
10
- * @category Harness
11
- */
12
- export declare function catalogHarness(def: HarnessDefinition): void;
13
- /**
14
- * Look up a cataloged harness by id.
15
- * @category Harness
16
- */
17
- export declare function getCatalogedHarness(id: HarnessId | string): HarnessDefinition | undefined;
18
- /**
19
- * List cataloged harness ids.
20
- * @category Harness
21
- */
22
- export declare function listCatalogedHarnessIds(): HarnessId[];
23
- /**
24
- * Parse harness id from evaluate capability id.
25
- * @category Harness
26
- */
27
- export declare function harnessIdFromCapabilityId(capabilityId: string): HarnessId | undefined;
28
- /**
29
- * Build harness evaluate capability id.
30
- * @category Harness
31
- */
32
- export declare function harnessEvaluateCapabilityId(harnessId: NamespacedId | string): HarnessCapabilityId;
33
- /**
34
- * Whether a capability id is a harness evaluate endpoint.
35
- * Extension capabilities such as `@executioncontrolprotocol/ollama.evaluate` also end with `.evaluate` but are not harnesses.
36
- * @category Harness
37
- */
38
- export declare function isHarnessCapabilityId(capabilityId: string): boolean;
39
- /** Clear harness catalog (unit tests). @internal */
40
- export declare function resetHarnessCatalogForTests(): void;
41
- //# sourceMappingURL=harness-catalog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"harness-catalog.d.ts","sourceRoot":"","sources":["../../src/harness/harness-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAInD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAGzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEzF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAErD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAIrF;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,GAAG,mBAAmB,CAGjG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAInE;AAED,oDAAoD;AACpD,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -1,66 +0,0 @@
1
- import { ECP_HARNESS_CAPABILITY_NAME, } from "@executioncontrolprotocol/types";
2
- const catalog = new Map();
3
- /**
4
- * Normalize harness id to `@namespace/name` form.
5
- * @category Harness
6
- */
7
- export function normalizeHarnessId(ref) {
8
- if (ref.startsWith("@"))
9
- return ref;
10
- return `@executioncontrolprotocol/${ref}`;
11
- }
12
- /**
13
- * Register a harness definition for catalog lookup and invocation.
14
- * @category Harness
15
- */
16
- export function catalogHarness(def) {
17
- catalog.set(def.id, def);
18
- }
19
- /**
20
- * Look up a cataloged harness by id.
21
- * @category Harness
22
- */
23
- export function getCatalogedHarness(id) {
24
- return catalog.get(normalizeHarnessId(id));
25
- }
26
- /**
27
- * List cataloged harness ids.
28
- * @category Harness
29
- */
30
- export function listCatalogedHarnessIds() {
31
- return [...catalog.keys()];
32
- }
33
- /**
34
- * Parse harness id from evaluate capability id.
35
- * @category Harness
36
- */
37
- export function harnessIdFromCapabilityId(capabilityId) {
38
- const suffix = `.${ECP_HARNESS_CAPABILITY_NAME}`;
39
- if (!capabilityId.endsWith(suffix))
40
- return undefined;
41
- return capabilityId.slice(0, -suffix.length);
42
- }
43
- /**
44
- * Build harness evaluate capability id.
45
- * @category Harness
46
- */
47
- export function harnessEvaluateCapabilityId(harnessId) {
48
- const id = normalizeHarnessId(String(harnessId));
49
- return `${id}.${ECP_HARNESS_CAPABILITY_NAME}`;
50
- }
51
- /**
52
- * Whether a capability id is a harness evaluate endpoint.
53
- * Extension capabilities such as `@executioncontrolprotocol/ollama.evaluate` also end with `.evaluate` but are not harnesses.
54
- * @category Harness
55
- */
56
- export function isHarnessCapabilityId(capabilityId) {
57
- const harnessId = harnessIdFromCapabilityId(capabilityId);
58
- if (!harnessId)
59
- return false;
60
- return getCatalogedHarness(harnessId) !== undefined;
61
- }
62
- /** Clear harness catalog (unit tests). @internal */
63
- export function resetHarnessCatalogForTests() {
64
- catalog.clear();
65
- }
66
- //# sourceMappingURL=harness-catalog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"harness-catalog.js","sourceRoot":"","sources":["../../src/harness/harness-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAI5B,MAAM,iCAAiC,CAAA;AAGxC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAgC,CAAA;AAEvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAgB,CAAA;IAChD,OAAO,6BAA6B,GAAG,EAAe,CAAA;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAsB;IACnD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAsB;IACxD,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAA;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,YAAoB;IAC5D,MAAM,MAAM,GAAG,IAAI,2BAA2B,EAAE,CAAA;IAChD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IACpD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAc,CAAA;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,SAAgC;IAC1E,MAAM,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IAChD,OAAO,GAAG,EAAE,IAAI,2BAA2B,EAAyB,CAAA;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACxD,MAAM,SAAS,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAA;IACzD,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAA;IAC5B,OAAO,mBAAmB,CAAC,SAAS,CAAC,KAAK,SAAS,CAAA;AACrD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,2BAA2B;IACzC,OAAO,CAAC,KAAK,EAAE,CAAA;AACjB,CAAC"}
@@ -1,11 +0,0 @@
1
- export { defineHarness, HarnessDefinitionBuilder, isHarnessDefinition } from "./define-harness.js";
2
- export { catalogHarness, getCatalogedHarness, listCatalogedHarnessIds, harnessEvaluateCapabilityId, harnessIdFromCapabilityId, isHarnessCapabilityId, } from "./harness-catalog.js";
3
- export type { ErasedHarnessHandler, HarnessConfigOf, HarnessDefinition, HarnessHandler, HarnessInputOf, HarnessOutputOf, } from "./types.js";
4
- export type { HarnessCapabilityContext } from "./context.js";
5
- export { callModelGenerate, HARNESS_MODEL_GENERATE_OPTIONS } from "./call-model.js";
6
- export { isCoreFormatterId, CORE_FORMATTER_IDS, inferResponseFormatFromFormatter, HARNESS_OUTPUT_FORMAT_TYPESCRIPT, } from "./format-resolve.js";
7
- export { runModelRepairLoop, type ModelRepairGenerateContext, type ModelRepairEvaluateResult, type RunModelRepairLoopOptions, type ModelRepairLoopResult, } from "./run-model-repair-loop.js";
8
- export { isHarnessTimingDebugEnabled, summarizeRepairAttemptTiming, formatRepairLoopTimingReport, logRepairLoopTiming, } from "./repair-loop-timing.js";
9
- export { harnessPromptFixtureSchema, loadSchemaExample, loadSchemaExampleEql, formatSchemaExampleJson, formatSchemaExampleEql, buildSystemPromptFromFixture, buildRepairHintFromFixture, type HarnessPromptFixture, } from "./prompts/index.js";
10
- export * from "./authoring/index.js";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,sBAAsB,CAAA"}
@@ -1,9 +0,0 @@
1
- export { defineHarness, HarnessDefinitionBuilder, isHarnessDefinition } from "./define-harness.js";
2
- export { catalogHarness, getCatalogedHarness, listCatalogedHarnessIds, harnessEvaluateCapabilityId, harnessIdFromCapabilityId, isHarnessCapabilityId, } from "./harness-catalog.js";
3
- export { callModelGenerate, HARNESS_MODEL_GENERATE_OPTIONS } from "./call-model.js";
4
- export { isCoreFormatterId, CORE_FORMATTER_IDS, inferResponseFormatFromFormatter, HARNESS_OUTPUT_FORMAT_TYPESCRIPT, } from "./format-resolve.js";
5
- export { runModelRepairLoop, } from "./run-model-repair-loop.js";
6
- export { isHarnessTimingDebugEnabled, summarizeRepairAttemptTiming, formatRepairLoopTimingReport, logRepairLoopTiming, } from "./repair-loop-timing.js";
7
- export { harnessPromptFixtureSchema, loadSchemaExample, loadSchemaExampleEql, formatSchemaExampleJson, formatSchemaExampleEql, buildSystemPromptFromFixture, buildRepairHintFromFixture, } from "./prompts/index.js";
8
- export * from "./authoring/index.js";
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAU7B,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,kBAAkB,GAKnB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,GAE3B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,sBAAsB,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { HarnessPromptFixture } from "./harness-prompt-fixture-schema.js";
2
- /**
3
- * Build repair-line text from an in-memory harness prompt fixture.
4
- * TypeScript / JSON return prose only (no EQL example shapes). EQL appends an example shape.
5
- * @category Harness
6
- */
7
- export declare function buildRepairHintFromFixture(fixture: HarnessPromptFixture): string;
8
- //# sourceMappingURL=build-repair-hint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-repair-hint.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/build-repair-hint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAS9E;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAchF"}
@@ -1,28 +0,0 @@
1
- import { formatSchemaExampleEql, formatSchemaExampleJson } from "./load-schema-example.js";
2
- function formatRepairExample(outputSchema, eql) {
3
- if (eql && outputSchema === "@executioncontrolprotocol.patch") {
4
- return "PATCH WORKFLOW <workflow-id> then only required UPDATE/ADD/DELETE/MOVE lines with real step ids.";
5
- }
6
- return eql ? formatSchemaExampleEql(outputSchema) : formatSchemaExampleJson(outputSchema);
7
- }
8
- /**
9
- * Build repair-line text from an in-memory harness prompt fixture.
10
- * TypeScript / JSON return prose only (no EQL example shapes). EQL appends an example shape.
11
- * @category Harness
12
- */
13
- export function buildRepairHintFromFixture(fixture) {
14
- const format = fixture.promptFormat ?? "eql";
15
- if (format === "typescript") {
16
- return fixture.repairHint ?? "Return corrected TypeScript only.";
17
- }
18
- if (format === "json") {
19
- return fixture.repairHint ?? "Return corrected JSON only.";
20
- }
21
- const parts = [fixture.repairHint ?? "Return corrected EQL only."];
22
- if (fixture.outputSchema !== "@executioncontrolprotocol.patch") {
23
- const example = formatRepairExample(fixture.outputSchema, true);
24
- parts.push(`Example shape:\n${example}`);
25
- }
26
- return parts.join(" ");
27
- }
28
- //# sourceMappingURL=build-repair-hint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-repair-hint.js","sourceRoot":"","sources":["../../../src/harness/prompts/build-repair-hint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAG1F,SAAS,mBAAmB,CAAC,YAAoB,EAAE,GAAY;IAC7D,IAAI,GAAG,IAAI,YAAY,KAAK,iCAAiC,EAAE,CAAC;QAC9D,OAAO,kGAAkG,CAAA;IAC3G,CAAC;IACD,OAAO,GAAG,CAAC,CAAC,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAA;AAC3F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA6B;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,IAAI,KAAK,CAAA;IAC5C,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,UAAU,IAAI,mCAAmC,CAAA;IAClE,CAAC;IACD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,UAAU,IAAI,6BAA6B,CAAA;IAC5D,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,4BAA4B,CAAC,CAAA;IAClE,IAAI,OAAO,CAAC,YAAY,KAAK,iCAAiC,EAAE,CAAC;QAC/D,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QAC/D,KAAK,CAAC,IAAI,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { HarnessPromptFixture } from "./harness-prompt-fixture-schema.js";
2
- /**
3
- * Build the system prompt string from an in-memory harness prompt fixture.
4
- * @category Harness
5
- */
6
- export declare function buildSystemPromptFromFixture(fixture: HarnessPromptFixture): string;
7
- //# sourceMappingURL=build-system-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/build-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAmD9E;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA+ClF"}
@@ -1,97 +0,0 @@
1
- import { formatSchemaExampleEql, formatSchemaExampleJson } from "./load-schema-example.js";
2
- import { eqlPrimerForOutputSchema } from "./eql-primer.js";
3
- import { ECP_ASSISTANT_IDENTITY_PRIMER } from "./identity-primer.js";
4
- import { typescriptPrimerForOutputSchema } from "./typescript-primer.js";
5
- function usesEql(fixture) {
6
- return fixture.promptFormat === "eql";
7
- }
8
- function usesTypeScript(fixture) {
9
- return fixture.promptFormat === "typescript";
10
- }
11
- function formatAllowedValues(fixture) {
12
- if (!fixture.allowedValues)
13
- return [];
14
- const lines = ["Allowed values:"];
15
- for (const [field, values] of Object.entries(fixture.allowedValues)) {
16
- lines.push(`- ${field}: ${values.join(", ")}`);
17
- }
18
- return lines;
19
- }
20
- function formatDefinitions(fixture) {
21
- if (!fixture.definitions?.length)
22
- return [];
23
- const lines = ["Intent definitions:"];
24
- for (const def of fixture.definitions) {
25
- lines.push(`- ${def.intent}: ${def.when}`);
26
- }
27
- return lines;
28
- }
29
- function formatFewShots(fixture) {
30
- if (!fixture.fewShots?.length)
31
- return [];
32
- const header = usesTypeScript(fixture)
33
- ? "Examples (message -> TypeScript output):"
34
- : usesEql(fixture)
35
- ? "Additional examples (message -> EQL output):"
36
- : "Examples (message -> JSON output):";
37
- const lines = [header];
38
- for (const shot of fixture.fewShots) {
39
- lines.push(`User: ${shot.message}`);
40
- if (typeof shot.output === "string") {
41
- lines.push(`Output:\n${shot.output.trimEnd()}`);
42
- }
43
- else {
44
- lines.push(`Output: ${JSON.stringify(shot.output)}`);
45
- }
46
- }
47
- return lines;
48
- }
49
- /**
50
- * Build the system prompt string from an in-memory harness prompt fixture.
51
- * @category Harness
52
- */
53
- export function buildSystemPromptFromFixture(fixture) {
54
- const identityBlock = fixture.identity ? [ECP_ASSISTANT_IDENTITY_PRIMER] : [];
55
- if (usesTypeScript(fixture)) {
56
- const sections = [
57
- ...identityBlock,
58
- typescriptPrimerForOutputSchema(fixture.outputSchema),
59
- ...formatFewShots(fixture),
60
- [fixture.role, fixture.task].filter(Boolean).join("\n"),
61
- ...formatAllowedValues(fixture),
62
- ...formatDefinitions(fixture),
63
- "Reply with TypeScript only. No markdown fences. No prose outside code.",
64
- ].filter((s) => s.length > 0);
65
- return sections.join("\n\n");
66
- }
67
- const eql = usesEql(fixture);
68
- const example = eql
69
- ? formatSchemaExampleEql(fixture.outputSchema)
70
- : formatSchemaExampleJson(fixture.outputSchema);
71
- const sections = eql
72
- ? [
73
- ...identityBlock,
74
- eqlPrimerForOutputSchema(fixture.outputSchema),
75
- fixture.outputSchema === "@executioncontrolprotocol.patch"
76
- ? undefined
77
- : `Operation syntax sample (${fixture.outputSchema}):\n${example}`,
78
- ...formatFewShots(fixture),
79
- [fixture.role, fixture.task].filter(Boolean).join("\n"),
80
- ...formatAllowedValues(fixture),
81
- ...formatDefinitions(fixture),
82
- "Reply with SQL-like EQL only. No markdown fences. No header line.",
83
- ].filter((s) => s !== undefined && s.length > 0)
84
- : [
85
- ...identityBlock,
86
- fixture.role,
87
- fixture.task,
88
- `Output schema: ${fixture.outputSchema}`,
89
- `Example output (copy this shape exactly): ${example}`,
90
- ...formatAllowedValues(fixture),
91
- ...formatDefinitions(fixture),
92
- ...formatFewShots(fixture),
93
- "Reply with JSON only. No markdown fences.",
94
- ];
95
- return sections.filter((s) => s.length > 0).join("\n\n");
96
- }
97
- //# sourceMappingURL=build-system-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-system-prompt.js","sourceRoot":"","sources":["../../../src/harness/prompts/build-system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AAExE,SAAS,OAAO,CAAC,OAA6B;IAC5C,OAAO,OAAO,CAAC,YAAY,KAAK,KAAK,CAAA;AACvC,CAAC;AAED,SAAS,cAAc,CAAC,OAA6B;IACnD,OAAO,OAAO,CAAC,YAAY,KAAK,YAAY,CAAA;AAC9C,CAAC;AAED,SAAS,mBAAmB,CAAC,OAA6B;IACxD,IAAI,CAAC,OAAO,CAAC,aAAa;QAAE,OAAO,EAAE,CAAA;IACrC,MAAM,KAAK,GAAa,CAAC,iBAAiB,CAAC,CAAA;IAC3C,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACpE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,IA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E,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACvD,GAAG,mBAAmB,CAAC,OAAO,CAAC;YAC/B,GAAG,iBAAiB,CAAC,OAAO,CAAC;YAC7B,mEAAmE;SACpE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/D,CAAC,CAAC;YACE,GAAG,aAAa;YAChB,OAAO,CAAC,IAAI;YACZ,OAAO,CAAC,IAAI;YACZ,kBAAkB,OAAO,CAAC,YAAY,EAAE;YACxC,6CAA6C,OAAO,EAAE;YACtD,GAAG,mBAAmB,CAAC,OAAO,CAAC;YAC/B,GAAG,iBAAiB,CAAC,OAAO,CAAC;YAC7B,GAAG,cAAc,CAAC,OAAO,CAAC;YAC1B,2CAA2C;SAC5C,CAAA;IAEL,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC1D,CAAC"}
@@ -1,14 +0,0 @@
1
- /** Shared EQL language primer blocks for harness system prompts. @internal */
2
- export declare const EQL_ZERO_KNOWLEDGE_INTRO: string;
3
- export declare const EQL_VALUE_EXPRESSIONS: string;
4
- export declare const EQL_WORKFLOW_IO: string;
5
- export declare const EQL_WORKFLOW_OPERATIONS: string;
6
- export declare const EQL_PATCH_OPERATIONS: string;
7
- export declare const EQL_PATCH_CANONICAL_EXAMPLES: string;
8
- export declare const EQL_WORKFLOW_PRIMER: string;
9
- export declare const EQL_PATCH_PRIMER: string;
10
- export declare const EQL_INTENT_PRIMER: string;
11
- export declare const EQL_REPLY_PRIMER: string;
12
- /** Pick the EQL primer for a harness output schema id. */
13
- export declare function eqlPrimerForOutputSchema(outputSchema: string): string;
14
- //# sourceMappingURL=eql-primer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eql-primer.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/eql-primer.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,eAAO,MAAM,wBAAwB,QAezB,CAAA;AAEZ,eAAO,MAAM,qBAAqB,QAQtB,CAAA;AAEZ,eAAO,MAAM,eAAe,QAYhB,CAAA;AAEZ,eAAO,MAAM,uBAAuB,QAUxB,CAAA;AAEZ,eAAO,MAAM,oBAAoB,QAwCrB,CAAA;AAEZ,eAAO,MAAM,4BAA4B,QA0E7B,CAAA;AAEZ,eAAO,MAAM,mBAAmB,QAQpB,CAAA;AAEZ,eAAO,MAAM,gBAAgB,QAUjB,CAAA;AAEZ,eAAO,MAAM,iBAAiB,QAQlB,CAAA;AAEZ,eAAO,MAAM,gBAAgB,QASjB,CAAA;AAEZ,0DAA0D;AAC1D,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAarE"}