@interf/compiler 0.13.0 → 0.18.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 (320) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +50 -7
  3. package/TRADEMARKS.md +4 -4
  4. package/agent-skills/interf-actions/SKILL.md +51 -5
  5. package/agent-skills/interf-actions/references/cli.md +82 -82
  6. package/builtin-methods/interf-default/README.md +6 -7
  7. package/builtin-methods/interf-default/method.json +7 -68
  8. package/builtin-methods/interf-default/method.schema.json +52 -50
  9. package/dist/cli/commands/agents.d.ts +2 -0
  10. package/dist/cli/commands/agents.js +213 -0
  11. package/dist/cli/commands/compile.js +10 -1
  12. package/dist/cli/commands/doctor.js +1 -1
  13. package/dist/cli/commands/login.js +1 -1
  14. package/dist/cli/commands/logout.js +1 -1
  15. package/dist/cli/commands/mcp.d.ts +42 -0
  16. package/dist/cli/commands/mcp.js +239 -0
  17. package/dist/cli/commands/method.js +1 -1
  18. package/dist/cli/commands/prep.js +81 -7
  19. package/dist/cli/commands/reset.js +1 -1
  20. package/dist/cli/commands/runs.js +1 -1
  21. package/dist/cli/commands/status.js +1 -1
  22. package/dist/cli/commands/verify.d.ts +10 -0
  23. package/dist/cli/commands/{test.js → verify.js} +30 -15
  24. package/dist/cli/commands/web.js +71 -18
  25. package/dist/cli/commands/wizard.js +462 -107
  26. package/dist/cli/index.d.ts +4 -2
  27. package/dist/cli/index.js +7 -3
  28. package/dist/compiler-ui/404.html +1 -1
  29. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  30. package/dist/compiler-ui/__next._full.txt +3 -3
  31. package/dist/compiler-ui/__next._head.txt +1 -1
  32. package/dist/compiler-ui/__next._index.txt +2 -2
  33. package/dist/compiler-ui/__next._tree.txt +2 -2
  34. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
  35. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
  36. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  37. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  38. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  39. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  40. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  41. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  42. package/dist/compiler-ui/_not-found.html +1 -1
  43. package/dist/compiler-ui/_not-found.txt +2 -2
  44. package/dist/compiler-ui/index.html +1 -1
  45. package/dist/compiler-ui/index.txt +3 -3
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.js +2 -2
  48. package/dist/packages/contracts/index.d.ts +2 -1
  49. package/dist/packages/contracts/index.js +1 -0
  50. package/dist/packages/contracts/lib/schema.d.ts +324 -31
  51. package/dist/packages/contracts/lib/schema.js +281 -21
  52. package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
  53. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  54. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  55. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  56. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  57. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  58. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  59. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  60. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  61. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
  62. package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
  63. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  64. package/dist/packages/engine/agents/registry.d.ts +91 -0
  65. package/dist/packages/engine/agents/registry.js +321 -0
  66. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  67. package/dist/packages/engine/agents/role-executors.js +88 -0
  68. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  69. package/dist/packages/engine/agents/role-router.js +73 -0
  70. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  71. package/dist/packages/{local-service → engine}/client.js +11 -11
  72. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  73. package/dist/packages/engine/cloud-seams.js +84 -0
  74. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
  75. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
  76. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  77. package/dist/packages/engine/compile/artifact-status.js +166 -0
  78. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  79. package/dist/packages/engine/compile/billing-events.js +74 -0
  80. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  81. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  82. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  83. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  84. package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
  85. package/dist/packages/engine/compile/compiled-schema.js +126 -0
  86. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
  87. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
  88. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  89. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
  90. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  91. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  92. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  93. package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
  94. package/dist/packages/{compiler → engine/compile}/index.js +0 -1
  95. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
  96. package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
  97. package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
  98. package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
  99. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  100. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  101. package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
  102. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
  103. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
  104. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  105. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
  106. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  107. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
  108. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
  109. package/dist/packages/engine/compile/runtime.d.ts +5 -0
  110. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
  111. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  112. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  113. package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
  114. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  115. package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
  116. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
  117. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  118. package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
  119. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
  120. package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
  121. package/dist/packages/engine/index.d.ts +22 -0
  122. package/dist/packages/engine/index.js +15 -0
  123. package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
  124. package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
  125. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  126. package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
  127. package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
  128. package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
  129. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  130. package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
  131. package/dist/packages/{local-service → engine}/routes.js +38 -1
  132. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  133. package/dist/packages/{local-service → engine}/run-observability.js +15 -15
  134. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  135. package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
  136. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  137. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  138. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  139. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  140. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
  141. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
  142. package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
  143. package/dist/packages/{local-service → engine}/runtime.js +333 -205
  144. package/dist/packages/{local-service → engine}/server.d.ts +25 -0
  145. package/dist/packages/{local-service → engine}/server.js +338 -17
  146. package/dist/packages/engine/verify/index.d.ts +13 -0
  147. package/dist/packages/engine/verify/index.js +10 -0
  148. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  149. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  150. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
  151. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
  152. package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
  153. package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
  154. package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
  155. package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
  156. package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
  157. package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
  158. package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
  159. package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
  160. package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
  161. package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
  162. package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
  163. package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
  164. package/dist/packages/engine/wire-schemas.d.ts +545 -0
  165. package/dist/packages/engine/wire-schemas.js +59 -0
  166. package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
  167. package/dist/packages/methods/authoring/method-authoring.js +260 -0
  168. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  169. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
  170. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  171. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  172. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
  173. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
  174. package/dist/packages/methods/package/context-interface.d.ts +73 -0
  175. package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
  176. package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
  177. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  178. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
  179. package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
  180. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
  181. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
  182. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
  183. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
  184. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  185. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  186. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  187. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  188. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  189. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  190. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  191. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  192. package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
  193. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  194. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  195. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  196. package/dist/packages/{project-model → project}/source-config.js +9 -8
  197. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  198. package/package.json +7 -16
  199. package/dist/cli/commands/test.d.ts +0 -9
  200. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
  201. package/dist/packages/agents/lib/detection.d.ts +0 -7
  202. package/dist/packages/compiler/artifact-counts.d.ts +0 -1
  203. package/dist/packages/compiler/compiled-schema.d.ts +0 -31
  204. package/dist/packages/compiler/compiled-schema.js +0 -141
  205. package/dist/packages/compiler/method-primitives.d.ts +0 -2
  206. package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
  207. package/dist/packages/compiler/runtime-acceptance.js +0 -262
  208. package/dist/packages/compiler/runtime.d.ts +0 -6
  209. package/dist/packages/local-service/index.d.ts +0 -22
  210. package/dist/packages/local-service/index.js +0 -15
  211. package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
  212. package/dist/packages/method-authoring/method-authoring.js +0 -116
  213. package/dist/packages/method-package/context-interface.d.ts +0 -60
  214. package/dist/packages/testing/index.d.ts +0 -13
  215. package/dist/packages/testing/index.js +0 -10
  216. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
  217. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
  218. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
  219. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  220. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  221. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  222. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  223. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  224. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  225. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  226. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  227. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  228. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  229. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  230. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  231. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  232. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  233. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  234. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  235. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  236. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  237. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  238. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  239. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  240. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  241. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  242. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  243. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  244. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  245. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  246. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  247. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  248. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  249. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  250. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  251. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  252. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  253. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  254. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  255. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  256. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  257. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  258. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  259. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  260. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  261. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  262. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  263. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  264. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  265. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  266. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  267. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  268. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  269. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  270. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  271. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  272. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  273. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  274. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  275. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  276. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  277. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  278. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  279. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  280. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  281. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  282. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  283. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  284. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  285. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  286. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  287. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  288. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  289. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  290. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  291. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  292. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  293. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  294. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  295. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  296. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  297. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  298. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  299. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  300. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  301. /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
  302. /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
  303. /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
  304. /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
  305. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  306. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  307. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  308. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  309. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  310. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  311. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  312. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  313. /package/dist/packages/{project-model → project}/index.js +0 -0
  314. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  315. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  316. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  317. /package/dist/packages/{project-model → project}/interf.js +0 -0
  318. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  319. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  320. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  import { existsSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { z } from "zod";
4
- import { warnInterf } from "../shared/logger.js";
5
- import { readJsonFileUnchecked } from "../shared/parse.js";
6
- import { MethodCompiledSchemaSchema, MethodZoneIdSchema, } from "../compiler/lib/schema.js";
7
- import { listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "./builtin-compiled-method.js";
4
+ import { warnInterf } from "../../contracts/utils/logger.js";
5
+ import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
6
+ import { MethodCompiledSchemaSchema, MethodArtifactIdSchema, } from "../../engine/compile/lib/schema.js";
7
+ import { listBuiltinCompiledArtifactSpecs, requiredCompiledArtifactOwners, } from "./builtin-compiled-method.js";
8
8
  // Method packages define the context interface. The compiler persists the
9
9
  // same schema on disk, but higher layers should prefer this boundary when they
10
10
  // mean "the Method-declared shape a portable context must implement."
@@ -15,7 +15,7 @@ export const ContextInterfaceSchema = MethodCompiledSchemaSchema;
15
15
  // Method expects to organize before the compiler materializes the context
16
16
  // interface on disk.
17
17
  export const MethodInputSpecSchema = z.object({
18
- id: MethodZoneIdSchema,
18
+ id: MethodArtifactIdSchema,
19
19
  label: z.string().min(1),
20
20
  description: z.string().min(1),
21
21
  required: z.boolean().default(false),
@@ -27,13 +27,23 @@ function normalizeContextInterface(contextInterface) {
27
27
  kind: "method-schema",
28
28
  };
29
29
  }
30
- function pushContextInterfaceZone(zones, zone) {
31
- if (zones.some((existing) => existing.path === zone.path))
32
- return;
33
- zones.push(zone);
30
+ function artifactToMethodArtifact(artifact) {
31
+ const path = artifact.shape.kind === "path" ? artifact.shape.path : artifact.id;
32
+ return {
33
+ id: artifact.id,
34
+ role: "output",
35
+ path,
36
+ kind: artifact.shape.kind === "path" ? artifact.shape.artifact_kind : "directory",
37
+ required: true,
38
+ owned_by: [...artifact.built_by_stages],
39
+ description: artifact.description,
40
+ };
34
41
  }
35
- function titleCaseZoneId(zoneId) {
36
- return zoneId
42
+ export function listContextInterfaceArtifacts(contextInterface) {
43
+ return contextInterface.artifacts.map(artifactToMethodArtifact);
44
+ }
45
+ function titleCaseArtifactId(artifactId) {
46
+ return artifactId
37
47
  .split("-")
38
48
  .filter(Boolean)
39
49
  .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
@@ -49,53 +59,52 @@ export function resolveContextInterfacePath(rootPath) {
49
59
  export function contextInterfaceExists(rootPath) {
50
60
  return existsSync(contextInterfaceFilePath(rootPath));
51
61
  }
52
- export function contextInterfaceZoneAbsolutePath(compiledPath, zone) {
53
- return join(compiledPath, zone.path);
62
+ export function contextInterfaceArtifactAbsolutePath(compiledPath, artifact) {
63
+ return join(compiledPath, artifact.path);
54
64
  }
55
- export function contextInterfaceArtifactPath(zone) {
56
- if (zone.kind === "file")
57
- return zone.path;
58
- return zone.path.endsWith("/") ? zone.path : `${zone.path}/`;
65
+ export function contextInterfaceArtifactPath(artifact) {
66
+ if (artifact.kind === "file")
67
+ return artifact.path;
68
+ return artifact.path.endsWith("/") ? artifact.path : `${artifact.path}/`;
59
69
  }
60
70
  export function summarizeContextInterface(contextInterface) {
71
+ const artifacts = listContextInterfaceArtifacts(contextInterface);
61
72
  return {
62
- inputZones: contextInterface.zones.filter((zone) => zone.role === "input"),
63
- workingZones: contextInterface.zones.filter((zone) => zone.role === "working"),
64
- outputZones: contextInterface.zones.filter((zone) => zone.role === "output"),
65
- runtimeZones: contextInterface.zones.filter((zone) => zone.role === "runtime"),
73
+ inputArtifacts: artifacts.filter((artifact) => artifact.role === "input"),
74
+ workingArtifacts: artifacts.filter((artifact) => artifact.role === "working"),
75
+ outputArtifacts: artifacts.filter((artifact) => artifact.role === "output"),
76
+ runtimeArtifacts: artifacts.filter((artifact) => artifact.role === "runtime"),
66
77
  };
67
78
  }
68
79
  export function deriveMethodInputsFromContextInterface(contextInterface) {
69
80
  if (!contextInterface)
70
81
  return [];
71
- return contextInterface.zones
72
- .filter((zone) => zone.role === "input")
73
- .map((zone) => ({
74
- id: zone.id,
75
- label: titleCaseZoneId(zone.id),
76
- description: zone.description,
77
- required: zone.required,
82
+ return listContextInterfaceArtifacts(contextInterface)
83
+ .filter((artifact) => artifact.role === "input")
84
+ .map((artifact) => ({
85
+ id: artifact.id,
86
+ label: titleCaseArtifactId(artifact.id),
87
+ description: artifact.description,
88
+ required: artifact.required,
78
89
  }));
79
90
  }
80
91
  export function buildContextInterface(stages, label = "Method context interface") {
81
- const zones = [];
82
- for (const zone of listBuiltinCompiledZoneSpecs()) {
83
- pushContextInterfaceZone(zones, {
84
- id: zone.id,
85
- role: zone.role,
86
- path: zone.path,
87
- kind: zone.kind,
88
- required: zone.required,
89
- owned_by: requiredCompiledZoneOwners(stages, zone.id),
90
- description: zone.description,
91
- });
92
- }
93
92
  return {
94
93
  kind: "method-schema",
95
94
  version: 1,
96
95
  target_type: "compiled",
97
96
  label,
98
- zones,
97
+ artifacts: listBuiltinCompiledArtifactSpecs().map((artifact) => ({
98
+ id: artifact.id,
99
+ description: artifact.description,
100
+ shape: {
101
+ kind: "path",
102
+ path: artifact.path,
103
+ artifact_kind: artifact.kind === "file" ? "file" : "directory",
104
+ },
105
+ checks: [],
106
+ built_by_stages: requiredCompiledArtifactOwners(stages, artifact.id),
107
+ })),
99
108
  };
100
109
  }
101
110
  export function writeContextInterfaceFile(rootPath, stages, label) {
@@ -1,10 +1,10 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
- import { renderCompiledQuerySkill } from "../agents/lib/shells.js";
3
+ import { renderCompiledQuerySkill } from "../../engine/agents/lib/shells.js";
4
4
  import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, mergeStagePolicyNotesForStages, } from "./local-methods.js";
5
5
  import { getCompiledMethod, } from "./method-definitions.js";
6
- import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
7
- import { methodPackagePathForCompiled } from "../compiler/compiled-paths.js";
6
+ import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, listContextInterfaceArtifacts, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
7
+ import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
8
8
  function writeMethodStarterDocs(dirPath, docs, options) {
9
9
  for (const doc of docs ?? []) {
10
10
  const targetPath = join(dirPath, doc.relativePath);
@@ -47,7 +47,6 @@ function writeMethodPackageJson(rootPath, method, options) {
47
47
  skill_dir: stage.skillDir,
48
48
  reads: stage.reads,
49
49
  writes: stage.writes,
50
- ...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
51
50
  })),
52
51
  ...(method.stagePolicyNotes ? { stage_policy_notes: method.stagePolicyNotes } : {}),
53
52
  }, null, 2)}\n`);
@@ -60,9 +59,12 @@ function renderMethodReadme(method) {
60
59
  const interfaceSummary = contextInterface
61
60
  ? summarizeContextInterface(contextInterface)
62
61
  : null;
63
- const contextInterfaceLines = contextInterface?.zones
64
- ? contextInterface.zones
65
- .map((zone) => `- \`${zone.id}\` — ${zone.role} ${zone.kind} at \`${zone.path}\`: ${zone.description}`)
62
+ const contextInterfaceArtifacts = contextInterface
63
+ ? listContextInterfaceArtifacts(contextInterface)
64
+ : [];
65
+ const contextInterfaceLines = contextInterfaceArtifacts.length > 0
66
+ ? contextInterfaceArtifacts
67
+ .map((artifact) => `- \`${artifact.id}\` — ${artifact.role} ${artifact.kind} Artifact at \`${artifact.path}\`: ${artifact.description}`)
66
68
  .join("\n")
67
69
  : null;
68
70
  const inputs = method.inputs?.length
@@ -75,10 +77,10 @@ function renderMethodReadme(method) {
75
77
  : null;
76
78
  const contextInterfaceSummaryLines = interfaceSummary
77
79
  ? [
78
- `- Input zones: ${interfaceSummary.inputZones.length > 0 ? interfaceSummary.inputZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
79
- `- Working zones: ${interfaceSummary.workingZones.length > 0 ? interfaceSummary.workingZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
80
- `- Output zones: ${interfaceSummary.outputZones.length > 0 ? interfaceSummary.outputZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
81
- `- Runtime zones: ${interfaceSummary.runtimeZones.length > 0 ? interfaceSummary.runtimeZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
80
+ `- Input Artifacts: ${interfaceSummary.inputArtifacts.length > 0 ? interfaceSummary.inputArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
81
+ `- Working Artifacts: ${interfaceSummary.workingArtifacts.length > 0 ? interfaceSummary.workingArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
82
+ `- Output Artifacts: ${interfaceSummary.outputArtifacts.length > 0 ? interfaceSummary.outputArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
83
+ `- Runtime Artifacts: ${interfaceSummary.runtimeArtifacts.length > 0 ? interfaceSummary.runtimeArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
82
84
  ].join("\n")
83
85
  : null;
84
86
  return [
@@ -113,7 +115,7 @@ function renderMethodReadme(method) {
113
115
  "",
114
116
  ]
115
117
  : []),
116
- "Zone map:",
118
+ "Artifact map:",
117
119
  "",
118
120
  contextInterfaceLines,
119
121
  ]
@@ -142,7 +144,7 @@ function renderDerivedMethodReadme(options) {
142
144
  options.hint,
143
145
  "",
144
146
  `This Method package was forked from \`${options.baseMethodId}\` and materialized as a standalone package for this kind of agent work.`,
145
- "It starts with that Method's topology; edit the package when the agent work needs different stages, zones, or proof.",
147
+ "It starts with that Method's topology; edit the package when the agent work needs different stages, Artifacts, or checks.",
146
148
  "",
147
149
  "Interf runs the local copy of this package directly. Keep purpose, inputs, context interface, and stage docs self-contained in this folder instead of relying on runtime inheritance.",
148
150
  "",
@@ -161,7 +163,7 @@ function renderSeedMethodReadme(options) {
161
163
  options.hint,
162
164
  "",
163
165
  `This Method package was forked from \`${options.baseMethodId}\` as a standalone local package.`,
164
- "It starts with that Method's topology; edit the package when the agent work needs different stages, zones, or proof.",
166
+ "It starts with that Method's topology; edit the package when the agent work needs different stages, Artifacts, or checks.",
165
167
  "",
166
168
  "Interf runs the local copy of this package directly. Refine purpose, inputs, context interface, and stage instructions in this folder instead of relying on inheritance.",
167
169
  "",
@@ -206,7 +208,6 @@ function renderImproveSkill(method) {
206
208
  }
207
209
  function renderStageSkill(method, stage) {
208
210
  const notes = method.stagePolicyNotes?.[stage.id] ?? [];
209
- const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
210
211
  const abstractRules = stage.contractType === "compiled-file-evidence"
211
212
  ? [
212
213
  "- Valid abstract forms for deterministic validation are:",
@@ -223,27 +224,19 @@ function renderStageSkill(method, stage) {
223
224
  "## Stage Contract",
224
225
  "",
225
226
  `- Contract type: \`${stage.contractType}\``,
226
- `- Reads zones: ${stage.reads.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
227
- `- Writes zones: ${stage.writes.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
227
+ `- Reads Artifacts: ${stage.reads.map((artifactId) => `\`${artifactId}\``).join(", ")}`,
228
+ `- Writes Artifacts: ${stage.writes.map((artifactId) => `\`${artifactId}\``).join(", ")}`,
228
229
  "",
229
230
  "## Requirements",
230
231
  "",
231
232
  "- Treat `method.json` and `method.schema.json` as the authoritative package contract for this stage.",
232
- "- Read only from the declared input zones unless this package explicitly documents a broader method.",
233
- "- Write only inside the declared output zones for this stage. Do not invent undeclared zones or implicit outputs.",
234
- "- Keep stage instructions, zone ownership, and Method-level acceptance aligned when you change this stage.",
233
+ "- Read only from the declared input Artifacts unless this package explicitly documents a broader method.",
234
+ "- Write only inside the declared output Artifacts for this stage. Do not invent undeclared Artifacts or implicit outputs.",
235
+ "- Keep stage instructions, artifact ownership, and Method-level checks aligned when you change this stage.",
235
236
  "- Treat runtime files as proof and execution state, not as the source of truth for Method behavior.",
236
237
  "- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
237
238
  ...abstractRules,
238
239
  "",
239
- ...(acceptanceKeys.length > 0
240
- ? [
241
- "## Declarative Acceptance",
242
- "",
243
- ...acceptanceKeys.map((key) => `- \`${key}\``),
244
- "",
245
- ]
246
- : []),
247
240
  ...(notes.length > 0
248
241
  ? [
249
242
  "## Notes",
@@ -428,24 +421,15 @@ export function createScratchLocalMethodPackage(options) {
428
421
  version: 1,
429
422
  target_type: "compiled",
430
423
  label: `${options.label} Method schema`,
431
- zones: [
424
+ artifacts: [
432
425
  {
433
426
  id: "draft-context",
434
- role: "output",
435
- path: "draft",
436
- kind: "directory",
437
- required: true,
438
- owned_by: ["prepare"],
439
- description: "Temporary placeholder output zone for the neutral authoring scaffold. Replace it with task-specific output zones.",
440
- },
441
- {
442
- id: "runtime",
443
- role: "runtime",
444
- path: ".interf/runtime",
445
- kind: "runtime",
446
- required: true,
447
- owned_by: [],
448
- description: "CLI-owned runtime state, health, stage contracts, and proof artifacts.",
427
+ description: "Temporary placeholder Artifact for the neutral authoring scaffold. Replace it with task-specific Artifacts.",
428
+ shape: { kind: "path", path: "draft", artifact_kind: "directory" },
429
+ checks: [
430
+ { id: "exists", kind: "min_file_count", required: true, params: { min: 1 } },
431
+ ],
432
+ built_by_stages: ["prepare"],
449
433
  },
450
434
  ],
451
435
  },
@@ -456,17 +440,15 @@ export function createScratchLocalMethodPackage(options) {
456
440
  description: "Neutral placeholder stage for Method authoring. Replace this stage with the topology this agent work needs.",
457
441
  contractType: "method-draft-stage",
458
442
  skillDir: "prepare",
459
- reads: ["runtime"],
443
+ role: "general",
444
+ reads: [],
460
445
  writes: ["draft-context"],
461
- acceptance: {
462
- stage_truthy: ["finished_at"],
463
- },
464
446
  },
465
447
  ],
466
448
  stagePolicyNotes: {
467
449
  prepare: [
468
450
  "This is a neutral authoring scaffold, not a recommended method topology.",
469
- "Replace this stage, output zone, and proof rule when drafting the final method.",
451
+ "Replace this stage, Artifact, and check when drafting the final method.",
470
452
  ],
471
453
  },
472
454
  starterDocs: [
@@ -2,5 +2,5 @@ import { dirname, join } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  const __filename = fileURLToPath(import.meta.url);
4
4
  const __dirname = dirname(__filename);
5
- // Package root (dist/packages/method-package/lib/ -> package root)
6
- export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..");
5
+ // Package root (dist/packages/methods/package/lib/ -> package root)
6
+ export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..", "..");
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } from "../compiler/lib/schema.js";
3
- import { RuntimeContractTypeSchema } from "../contracts/lib/schema.js";
2
+ import { MethodCompilerApiSchema, MethodPurposeSchema, type MethodStageArtifactReadAccess, type MethodStageArtifactWriteAccess } from "../../engine/compile/lib/schema.js";
3
+ import { RuntimeContractTypeSchema } from "../../contracts/lib/schema.js";
4
4
  import { MethodInputSpecSchema, type ContextInterface, type MethodInputSpec } from "./context-interface.js";
5
5
  export interface LocalMethodStarterDoc {
6
6
  relativePath: string;
@@ -12,9 +12,14 @@ export interface LocalMethodStageDefinition {
12
12
  contract_type: z.infer<typeof RuntimeContractTypeSchema>;
13
13
  skill_dir?: string;
14
14
  description?: string;
15
- reads: z.infer<typeof MethodStageZoneAccessSchema>;
16
- writes: z.infer<typeof MethodStageZoneAccessSchema>;
17
- acceptance?: z.infer<typeof RuntimeStageAcceptanceSchema>;
15
+ /**
16
+ * Optional role hint. Open-ended string; defaults to `general` at the
17
+ * runtime layer when missing. Maps to a connected agent via the user's
18
+ * role-map (`~/.interf/agents.json`).
19
+ */
20
+ role?: string;
21
+ reads: MethodStageArtifactReadAccess;
22
+ writes: MethodStageArtifactWriteAccess;
18
23
  }
19
24
  export interface LocalMethodDefinition {
20
25
  id: string;
@@ -1,15 +1,14 @@
1
1
  import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
2
2
  import { basename, dirname, join, relative } from "node:path";
3
3
  import { z } from "zod";
4
- import { listFilesRecursive } from "../shared/filesystem.js";
5
- import { warnInterf } from "../shared/logger.js";
6
- import { readJsonFileUnchecked, readJsonFileWithSchema } from "../shared/parse.js";
7
- import { isMarkdownFile } from "../shared/file-types.js";
8
- import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema, } from "../compiler/lib/schema.js";
9
- import { RuntimeContractTypeSchema, InterfIdPattern, } from "../contracts/lib/schema.js";
10
- import { asPreparationDataDir, preparationMethodsRoot, } from "../contracts/lib/preparation-paths.js";
11
- import { listBuiltinCompiledZoneSpecs, } from "./builtin-compiled-method.js";
12
- import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
4
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
5
+ import { warnInterf } from "../../contracts/utils/logger.js";
6
+ import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
7
+ import { isMarkdownFile } from "../../contracts/utils/file-types.js";
8
+ import { MethodCompilerApiSchema, MethodPurposeSchema, MethodStageArtifactReadAccessSchema, MethodStageArtifactWriteAccessSchema, } from "../../engine/compile/lib/schema.js";
9
+ import { RuntimeContractTypeSchema, InterfIdPattern, } from "../../contracts/lib/schema.js";
10
+ import { asPreparationDataDir, preparationMethodsRoot, } from "../../contracts/lib/preparation-paths.js";
11
+ import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, listContextInterfaceArtifacts, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
13
12
  import { PACKAGE_ROOT } from "./lib/package-root.js";
14
13
  const LocalMethodStageDefinitionSchema = z.object({
15
14
  id: z.string().regex(InterfIdPattern),
@@ -17,9 +16,9 @@ const LocalMethodStageDefinitionSchema = z.object({
17
16
  contract_type: RuntimeContractTypeSchema,
18
17
  skill_dir: z.string().regex(InterfIdPattern).optional(),
19
18
  description: z.string().min(1).optional(),
20
- reads: MethodStageZoneAccessSchema,
21
- writes: MethodStageZoneAccessSchema,
22
- acceptance: RuntimeStageAcceptanceSchema.optional(),
19
+ role: z.string().min(1).optional(),
20
+ reads: MethodStageArtifactReadAccessSchema,
21
+ writes: MethodStageArtifactWriteAccessSchema,
23
22
  });
24
23
  const LocalMethodDefinitionSchema = z.object({
25
24
  id: z.string().regex(InterfIdPattern),
@@ -364,8 +363,9 @@ export function validateMethodPackage(dirPath) {
364
363
  const stages = def.stages ?? [];
365
364
  const stageIds = new Set(stages.map((stage) => stage.id));
366
365
  const seenPaths = new Map();
367
- const seenZoneIds = new Set();
368
- const zoneById = new Map(methodSchema.zones.map((zone) => [zone.id, zone]));
366
+ const seenArtifactIds = new Set();
367
+ const schemaArtifacts = listContextInterfaceArtifacts(methodSchema);
368
+ const artifactById = new Map(schemaArtifacts.map((artifact) => [artifact.id, artifact]));
369
369
  const normalizedParts = (value) => value.replaceAll("\\", "/").split("/").filter(Boolean);
370
370
  const hasOverlappingPath = (value, other) => {
371
371
  const a = normalizedParts(value);
@@ -374,78 +374,51 @@ export function validateMethodPackage(dirPath) {
374
374
  const longer = a.length <= b.length ? b : a;
375
375
  return shorter.every((part, index) => longer[index] === part);
376
376
  };
377
- for (const zone of methodSchema.zones) {
378
- if (seenZoneIds.has(zone.id)) {
379
- errors.push(`method.schema.json repeats zone id "${zone.id}".`);
377
+ for (const artifact of schemaArtifacts) {
378
+ if (seenArtifactIds.has(artifact.id)) {
379
+ errors.push(`method.schema.json repeats Artifact id "${artifact.id}".`);
380
380
  }
381
- seenZoneIds.add(zone.id);
382
- const existingPathOwner = seenPaths.get(zone.path);
381
+ seenArtifactIds.add(artifact.id);
382
+ const existingPathOwner = seenPaths.get(artifact.path);
383
383
  if (existingPathOwner) {
384
- errors.push(`method.schema.json repeats zone path "${zone.path}".`);
384
+ errors.push(`method.schema.json repeats Artifact path "${artifact.path}".`);
385
385
  }
386
386
  for (const [existingPath, existingZoneId] of seenPaths.entries()) {
387
- if (existingPath === zone.path)
387
+ if (existingPath === artifact.path)
388
388
  continue;
389
- if (hasOverlappingPath(zone.path, existingPath)) {
390
- errors.push(`method.schema.json zones "${zone.id}" and "${existingZoneId}" overlap on path "${zone.path}" / "${existingPath}".`);
389
+ if (hasOverlappingPath(artifact.path, existingPath)) {
390
+ errors.push(`method.schema.json Artifacts "${artifact.id}" and "${existingZoneId}" overlap on path "${artifact.path}" / "${existingPath}".`);
391
391
  }
392
392
  }
393
- seenPaths.set(zone.path, zone.id);
394
- if ((zone.role === "input" || zone.role === "runtime") && zone.owned_by.length > 0) {
395
- errors.push(`method.schema.json zone "${zone.id}" cannot declare owners because its role is "${zone.role}".`);
393
+ seenPaths.set(artifact.path, artifact.id);
394
+ if ((artifact.role === "input" || artifact.role === "runtime") && artifact.owned_by.length > 0) {
395
+ errors.push(`method.schema.json Artifact "${artifact.id}" cannot declare owners because its role is "${artifact.role}".`);
396
396
  }
397
- for (const owner of zone.owned_by) {
397
+ for (const owner of artifact.owned_by) {
398
398
  if (!stageIds.has(owner)) {
399
- errors.push(`method.schema.json references unknown stage "${owner}" for zone "${zone.path}".`);
399
+ errors.push(`method.schema.json references unknown stage "${owner}" for Artifact path "${artifact.path}".`);
400
400
  }
401
401
  }
402
402
  }
403
403
  for (const stage of stages) {
404
- for (const zoneId of stage.reads) {
405
- if (!zoneById.has(zoneId)) {
406
- errors.push(`Stage "${stage.id}" reads unknown zone "${zoneId}".`);
404
+ for (const artifactId of stage.reads) {
405
+ if (!artifactById.has(artifactId)) {
406
+ errors.push(`Stage "${stage.id}" reads unknown Artifact "${artifactId}".`);
407
407
  }
408
408
  }
409
- for (const zoneId of stage.writes) {
410
- const zone = zoneById.get(zoneId);
411
- if (!zone) {
412
- errors.push(`Stage "${stage.id}" writes unknown zone "${zoneId}".`);
409
+ for (const artifactId of stage.writes) {
410
+ const artifact = artifactById.get(artifactId);
411
+ if (!artifact) {
412
+ errors.push(`Stage "${stage.id}" writes unknown Artifact "${artifactId}".`);
413
413
  continue;
414
414
  }
415
- if (zone.role === "input" || zone.role === "runtime") {
416
- errors.push(`Stage "${stage.id}" writes zone "${zoneId}" but zones with role "${zone.role}" are engine-owned inputs, not writable stage outputs.`);
415
+ if (artifact.role === "input" || artifact.role === "runtime") {
416
+ errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but Artifacts with role "${artifact.role}" are engine-owned inputs, not writable stage outputs.`);
417
417
  }
418
- if (!zone.owned_by.includes(stage.id)) {
419
- errors.push(`Stage "${stage.id}" writes zone "${zoneId}" but that zone is not owned by the stage in method.schema.json.`);
418
+ if (!artifact.owned_by.includes(stage.id)) {
419
+ errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but that Artifact is not owned by the stage in method.schema.json.`);
420
420
  }
421
421
  }
422
- for (const artifactPath of Object.keys(stage.acceptance?.artifacts_must_not_contain ?? {})) {
423
- const normalizedArtifactPath = artifactPath.replaceAll("\\", "/");
424
- const artifactParts = normalizedArtifactPath.split("/").filter(Boolean);
425
- if (artifactPath.startsWith("/") ||
426
- artifactPath.startsWith("\\") ||
427
- artifactParts.some((part) => part === "..")) {
428
- errors.push(`Stage "${stage.id}" artifacts_must_not_contain key "${artifactPath}" must be a portable-context relative artifact path.`);
429
- continue;
430
- }
431
- const matchingZone = zoneById.get(artifactPath);
432
- if (matchingZone) {
433
- errors.push(`Stage "${stage.id}" artifacts_must_not_contain key "${artifactPath}" is a zone id. Use the zone path "${matchingZone.path}" instead.`);
434
- }
435
- }
436
- }
437
- for (const requiredZone of listBuiltinCompiledZoneSpecs().filter((zone) => zone.id === "runtime")) {
438
- const match = zoneById.get(requiredZone.id);
439
- if (!match) {
440
- errors.push(`method.schema.json is missing required zone "${requiredZone.id}".`);
441
- continue;
442
- }
443
- if (match.kind !== requiredZone.kind) {
444
- errors.push(`method.schema.json zone "${requiredZone.id}" should be kind "${requiredZone.kind}".`);
445
- }
446
- if (match.role !== requiredZone.role) {
447
- errors.push(`method.schema.json zone "${requiredZone.id}" should have role "${requiredZone.role}".`);
448
- }
449
422
  }
450
423
  }
451
424
  const stageDirs = existsSync(join(dirPath, "compile", "stages"))
@@ -454,8 +427,8 @@ export function validateMethodPackage(dirPath) {
454
427
  const counts = {
455
428
  starter_docs: collectStarterDocs(dirPath).length,
456
429
  compile_stage_docs: stageDirs.length,
457
- compiled_zones: methodSchema?.zones.length ?? 0,
458
- method_zones: methodSchema?.zones.length ?? 0,
430
+ compiled_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
431
+ method_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
459
432
  };
460
433
  return {
461
434
  ok: errors.length === 0,
@@ -1,7 +1,7 @@
1
1
  import { type LocalMethodDefinition } from "./local-methods.js";
2
- import type { RuntimeStageAcceptance, MethodCompilerApi } from "../compiler/lib/schema.js";
3
- import type { MethodId, RuntimeContractType } from "../contracts/lib/schema.js";
4
- import { type ContextInterface, type ContextInterfaceZoneId, type MethodInputSpec } from "./context-interface.js";
2
+ import type { MethodCompilerApi } from "../../engine/compile/lib/schema.js";
3
+ import type { MethodId, RuntimeContractType } from "../../contracts/lib/schema.js";
4
+ import { type ContextInterface, type ContextInterfaceArtifactId, type MethodInputSpec } from "./context-interface.js";
5
5
  export interface MethodStarterDoc {
6
6
  relativePath: string;
7
7
  content: string;
@@ -12,9 +12,14 @@ export interface MethodStageDefinition {
12
12
  description: string;
13
13
  contractType: RuntimeContractType;
14
14
  skillDir: string;
15
- reads: ContextInterfaceZoneId[];
16
- writes: ContextInterfaceZoneId[];
17
- acceptance?: RuntimeStageAcceptance;
15
+ /**
16
+ * Role hint declared by the Method package. Defaults to `general` when
17
+ * absent; mapped to a connected agent via the user's role-map at run
18
+ * time.
19
+ */
20
+ role: string;
21
+ reads: ContextInterfaceArtifactId[];
22
+ writes: ContextInterfaceArtifactId[];
18
23
  }
19
24
  export interface MethodDefinition<TId extends string> {
20
25
  id: TId;
@@ -53,5 +58,4 @@ export declare function getMethodStagePosition(methodId: MethodId, stage: string
53
58
  export declare function getMethodStages(methodId: MethodId, prepDataDir?: string): string[];
54
59
  export declare function getActiveCompiledStages(compiledPath: string): string[];
55
60
  export declare function getActiveCompiledStagePolicyNotes(compiledPath: string, stage: string): string[];
56
- export declare function resolveActiveCompiledStageAcceptance(compiledPath: string, stage: string): MethodStageDefinition["acceptance"] | undefined;
57
61
  export declare function formatActiveCompiledMethodStageStep(compiledPath: string, stage: string): string;
@@ -2,10 +2,10 @@ import { existsSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { builtinMethodPackagePath, isMethodId, listLocalMethodDefinitions, loadLocalMethodDefinition, loadMethodDefinitionFromDir, mergeStagePolicyNotesForStages, } from "./local-methods.js";
4
4
  import { listUserMethodDefinitions, loadUserMethodDefinition, } from "./user-methods.js";
5
- import { warnInterf } from "../shared/logger.js";
6
- import { methodPackagePathForCompiled } from "../compiler/compiled-paths.js";
7
- import { asPreparationDataDir, preparationMethodPackagePath } from "../contracts/lib/preparation-paths.js";
8
- import { resolveSourceControlPath } from "../project-model/interf.js";
5
+ import { warnInterf } from "../../contracts/utils/logger.js";
6
+ import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
7
+ import { asPreparationDataDir, preparationMethodPackagePath } from "../../contracts/lib/preparation-paths.js";
8
+ import { resolveSourceControlPath } from "../../project/interf.js";
9
9
  import { deriveMethodInputsFromContextInterface, } from "./context-interface.js";
10
10
  const DEFAULT_METHOD_ID = "interf-default";
11
11
  let builtinDefaultMethodCache = null;
@@ -16,9 +16,9 @@ function toMethodStages(stages) {
16
16
  description: stage.description ?? stage.label,
17
17
  contractType: stage.contract_type,
18
18
  skillDir: stage.skill_dir ?? stage.id,
19
+ role: stage.role && stage.role.trim().length > 0 ? stage.role : "general",
19
20
  reads: [...stage.reads],
20
21
  writes: [...stage.writes],
21
- ...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
22
22
  }));
23
23
  }
24
24
  export function standaloneMethodDefinitionFromLocalPackage(local) {
@@ -209,9 +209,6 @@ export function getActiveCompiledStagePolicyNotes(compiledPath, stage) {
209
209
  const method = getActiveCompiledMethod(compiledPath);
210
210
  return [...(method.stagePolicyNotes?.[stage] ?? [])];
211
211
  }
212
- export function resolveActiveCompiledStageAcceptance(compiledPath, stage) {
213
- return getActiveCompiledMethod(compiledPath).stages.find((candidate) => candidate.id === stage)?.acceptance;
214
- }
215
212
  export function formatActiveCompiledMethodStageStep(compiledPath, stage) {
216
213
  return formatMethodStageStep(getActiveCompiledMethod(compiledPath), stage);
217
214
  }
@@ -1,5 +1,4 @@
1
- import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "../compiler/lib/schema.js";
2
- import { type MethodStageDefinition } from "./method-definitions.js";
1
+ import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "../../engine/compile/lib/schema.js";
3
2
  export interface MethodReporter {
4
3
  line?: (message: string) => void;
5
4
  blankLine?: () => void;
@@ -23,4 +22,3 @@ export declare function buildStageInstructions(stageSkillDir: string, localSkill
23
22
  export declare function reportLine(reporter: MethodReporter | undefined, message: string): void;
24
23
  export declare function reportBlankLine(reporter: MethodReporter | undefined): void;
25
24
  export declare function reportValidationFailure(reporter: MethodReporter | undefined, summary: string, errors?: string[]): void;
26
- export declare function resolveStageAcceptance(methodId: string, stageId: string, prepDataDir?: string): MethodStageDefinition["acceptance"] | undefined;
@@ -1,10 +1,9 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { join, relative, sep } from "node:path";
3
- import { listFilesRecursive } from "../shared/filesystem.js";
4
- import { parseJsonFrontmatter } from "../shared/parse.js";
5
- import { isMarkdownFile } from "../shared/file-types.js";
6
- import { getCompiledMethod, } from "./method-definitions.js";
7
- import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "../compiler/compiled-paths.js";
3
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
4
+ import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
5
+ import { isMarkdownFile } from "../../contracts/utils/file-types.js";
6
+ import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
8
7
  const LOCAL_SKILL_READ_LIMIT = 50;
9
8
  export function methodCompileStageDirectory(stageDir) {
10
9
  return `${COMPILED_METHOD_DIR}/compile/stages/${stageDir}`;
@@ -128,6 +127,3 @@ export function reportValidationFailure(reporter, summary, errors = []) {
128
127
  reportLine(reporter, `- ${error}`);
129
128
  }
130
129
  }
131
- export function resolveStageAcceptance(methodId, stageId, prepDataDir) {
132
- return getCompiledMethod(methodId, { prepDataDir }).stages.find((stage) => stage.id === stageId)?.acceptance;
133
- }
@@ -1,4 +1,4 @@
1
- import type { MethodImprovementContext } from "../compiler/lib/schema.js";
1
+ import type { MethodImprovementContext } from "../../engine/compile/lib/schema.js";
2
2
  export interface MethodImprovementReviewSourcePaths {
3
3
  compiledRuntime: string | null;
4
4
  readinessRuns: string | null;