@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
@@ -0,0 +1,260 @@
1
+ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { createMethodAuthoringShell, } from "../../engine/agents/lib/shells.js";
4
+ import { createScratchLocalMethodPackage } from "../package/interf-method-package.js";
5
+ import { CONTEXT_INTERFACE_FILE, listContextInterfaceArtifacts } from "../package/context-interface.js";
6
+ import { loadMethodDefinitionFromDir, validateMethodPackage, methodDefinitionPath, } from "../package/local-methods.js";
7
+ import { runMethodEditSession } from "./method-edit-session.js";
8
+ /**
9
+ * Walk method.json after a successful authoring run and fill in
10
+ * `role: "general"` for any stage missing a role field. Custom role
11
+ * names are kept as-is. Idempotent — does nothing when every stage
12
+ * already declares a role. Returns the list of stage ids that were
13
+ * touched so the runtime can surface that to the user.
14
+ */
15
+ export function ensureStageRoles(methodPath) {
16
+ const methodJsonPath = join(methodPath, "method.json");
17
+ if (!existsSync(methodJsonPath))
18
+ return [];
19
+ let raw;
20
+ try {
21
+ raw = readFileSync(methodJsonPath, "utf8");
22
+ }
23
+ catch {
24
+ return [];
25
+ }
26
+ let parsed;
27
+ try {
28
+ parsed = JSON.parse(raw);
29
+ }
30
+ catch {
31
+ return [];
32
+ }
33
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
34
+ return [];
35
+ const value = parsed;
36
+ if (!Array.isArray(value.stages))
37
+ return [];
38
+ const touched = [];
39
+ let changed = false;
40
+ const nextStages = value.stages.map((stage) => {
41
+ if (!stage || typeof stage !== "object" || Array.isArray(stage))
42
+ return stage;
43
+ const stageRecord = stage;
44
+ const declaredRole = typeof stageRecord.role === "string" && stageRecord.role.trim().length > 0
45
+ ? stageRecord.role.trim()
46
+ : null;
47
+ if (declaredRole)
48
+ return stage;
49
+ const id = typeof stageRecord.id === "string" ? stageRecord.id : "(unknown)";
50
+ touched.push(id);
51
+ changed = true;
52
+ return { ...stageRecord, role: "general" };
53
+ });
54
+ if (!changed)
55
+ return [];
56
+ value.stages = nextStages;
57
+ writeFileSync(methodJsonPath, `${JSON.stringify(value, null, 2)}\n`);
58
+ return touched;
59
+ }
60
+ function buildMethodAuthoringPrompt() {
61
+ return [
62
+ "This is an automated Interf Method-authoring run, not an open-ended chat session.",
63
+ "Execute it now.",
64
+ "Create one standalone Method package for the source data, desired portable-context outputs, and proof requirements in this source folder.",
65
+ "Read `runtime/authoring-context.json` first.",
66
+ "Treat `task_prompt` as the user's preparation-and-evidence brief: source data, output shape, and evidence that should show the data is ready.",
67
+ `Then read \`method/README.md\`, \`method/method.json\`, and \`method/${CONTEXT_INTERFACE_FILE}\`.`,
68
+ "The `method/` directory starts as a neutral Method package scaffold, not as a suggested Method.",
69
+ "Replace the scaffold purpose, inputs, Artifacts, stages, stage docs, checks, and query guidance with the Method this agent work actually needs.",
70
+ "Read `runtime/source-files.json` and inspect the listed source locators before editing the package.",
71
+ "Prefer direct file-reading and search tools over shell commands for routine file inspection.",
72
+ "Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
73
+ "Edit only files under `method/`.",
74
+ "Keep the Method package valid for the current compiler API and `method.schema.json`.",
75
+ "Choose stage ids, stage order, artifact reads, artifact writes, artifact checks, and stage docs from the source data and preparation-and-evidence brief.",
76
+ "Use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids. Never use underscores.",
77
+ "Each stage MAY declare a `role`: one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Pick the role that best matches what the stage's prompt asks the agent to do. Omit `role` (or use `general`) when the stage doesn't fit any specialized role. Custom role names are allowed; the engine treats unknown roles as `general`.",
78
+ "Do not preserve the placeholder `prepare` stage unless the final Method genuinely needs a stage with that exact role.",
79
+ "Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
80
+ "Use only the CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases.",
81
+ "Keep Artifact checks and the producing stage docs aligned: every checked output requirement must be described in the stage doc that writes that Artifact.",
82
+ "For every stage in `method.json`, create `method/compile/stages/<skill_dir>/SKILL.md` and make the folder name exactly match that stage's kebab-case `skill_dir`.",
83
+ "Every Artifact path in `method.schema.json` must be unique and non-overlapping.",
84
+ "Make the package materially specific to this Preparation task, output shape, and proof requirement. A no-op scaffold is not acceptable.",
85
+ "Treat the Method package as four aligned layers: purpose, inputs, context interface, and stages.",
86
+ "If the Method writes an agent entrypoint, declare it as an Artifact and make the final shaping stage own it.",
87
+ "Prefer explicit stage-doc, stage-policy, purpose, input-contract, and context-interface edits over vague rewrites.",
88
+ "Do not introduce wikilinks unless the Method also creates the target note by exact basename or explicit relative path.",
89
+ "Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read Artifacts.",
90
+ "Do not make one stage point at files or notes that are only created later by another stage.",
91
+ "Prefer conservative retrieval routing over speculative note sprawl.",
92
+ "Do not narrate plans or ask follow-up questions.",
93
+ "Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
94
+ "As soon as the Method edits are complete, stop.",
95
+ ].join("\n");
96
+ }
97
+ function stableJson(value) {
98
+ if (value === null || typeof value !== "object") {
99
+ return JSON.stringify(value ?? {});
100
+ }
101
+ if (Array.isArray(value)) {
102
+ return `[${value.map((entry) => stableJson(entry)).join(",")}]`;
103
+ }
104
+ const record = value;
105
+ return `{${Object.keys(record)
106
+ .sort()
107
+ .map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`)
108
+ .join(",")}}`;
109
+ }
110
+ function checkMatchesRequirement(actual, required) {
111
+ return actual.id === required.id &&
112
+ actual.kind === required.kind &&
113
+ (actual.required ?? true) === (required.required ?? true) &&
114
+ stableJson(actual.params) === stableJson(required.params);
115
+ }
116
+ function producingStagesForArtifact(definition, artifactId) {
117
+ return (definition.stages ?? []).filter((stage) => Array.isArray(stage.writes) && stage.writes.includes(artifactId));
118
+ }
119
+ function readProducingStageDocs(methodPath, stages) {
120
+ return stages
121
+ .map((stage) => join(methodPath, "compile", "stages", stage.skill_dir ?? stage.id, "SKILL.md"))
122
+ .filter((filePath) => existsSync(filePath))
123
+ .map((filePath) => readFileSync(filePath, "utf8"))
124
+ .join("\n");
125
+ }
126
+ function validateMustContainStageDocs(methodPath, definition) {
127
+ const artifacts = definition.method_schema.artifacts ?? [];
128
+ const errors = [];
129
+ for (const artifact of artifacts) {
130
+ const producingStages = producingStagesForArtifact(definition, artifact.id);
131
+ if (producingStages.length === 0)
132
+ continue;
133
+ const producingStageDocs = readProducingStageDocs(methodPath, producingStages);
134
+ for (const check of artifact.checks ?? []) {
135
+ if (check.kind !== "must_contain")
136
+ continue;
137
+ const phrases = check.params?.phrases;
138
+ if (!Array.isArray(phrases))
139
+ continue;
140
+ for (const phrase of phrases) {
141
+ if (typeof phrase !== "string")
142
+ continue;
143
+ if (!producingStageDocs.includes(phrase)) {
144
+ errors.push(`Artifact \`${artifact.id}\` check \`${check.id}\` requires phrase not present in producing stage docs.`);
145
+ }
146
+ }
147
+ }
148
+ }
149
+ return errors;
150
+ }
151
+ function validateArtifactRequirements(methodPath, definition, requirements) {
152
+ const artifacts = definition.method_schema.artifacts ?? [];
153
+ const errors = [];
154
+ for (const requirement of requirements) {
155
+ const artifact = artifacts.find((candidate) => candidate.id === requirement.id);
156
+ if (!artifact) {
157
+ errors.push(`Missing required Artifact \`${requirement.id}\`.`);
158
+ continue;
159
+ }
160
+ if (artifact.shape.kind !== requirement.shape.kind ||
161
+ artifact.shape.path !== requirement.shape.path ||
162
+ artifact.shape.artifact_kind !== requirement.shape.artifact_kind) {
163
+ errors.push(`Artifact \`${requirement.id}\` does not match required shape.`);
164
+ }
165
+ for (const check of requirement.checks) {
166
+ if (!artifact.checks.some((candidate) => checkMatchesRequirement(candidate, check))) {
167
+ errors.push(`Artifact \`${requirement.id}\` is missing required check \`${check.id}\`.`);
168
+ }
169
+ }
170
+ const producingStages = producingStagesForArtifact(definition, requirement.id);
171
+ if (producingStages.length === 0) {
172
+ errors.push(`Artifact \`${requirement.id}\` is not written by any stage.`);
173
+ }
174
+ }
175
+ return errors;
176
+ }
177
+ function validateAuthoredMethodPackage(methodPath, artifactRequirements = []) {
178
+ const validation = validateMethodPackage(methodPath);
179
+ if (!validation.ok)
180
+ return validation;
181
+ const definition = loadMethodDefinitionFromDir(methodPath);
182
+ if (!definition)
183
+ return validation;
184
+ const errors = [...validation.errors];
185
+ const placeholderStage = definition.stages?.find((stage) => stage.id === "prepare" &&
186
+ stage.contract_type === "method-draft-stage" &&
187
+ stage.writes.includes("draft-context"));
188
+ const placeholderArtifact = listContextInterfaceArtifacts(definition.method_schema).find((artifact) => artifact.id === "draft-context");
189
+ const placeholderPurpose = definition.purpose?.label === "From-scratch Method draft" ||
190
+ definition.purpose?.task_hint?.includes("Replace this neutral scaffold");
191
+ if (placeholderStage) {
192
+ errors.push("Authored Method still contains the neutral scaffold stage `prepare`.");
193
+ }
194
+ if (placeholderArtifact) {
195
+ errors.push("Authored Method still contains the neutral scaffold artifact `draft-context`.");
196
+ }
197
+ if (placeholderPurpose) {
198
+ errors.push("Authored Method still contains the neutral scaffold purpose.");
199
+ }
200
+ errors.push(...validateArtifactRequirements(methodPath, definition, artifactRequirements));
201
+ errors.push(...validateMustContainStageDocs(methodPath, definition));
202
+ return {
203
+ ok: validation.ok && errors.length === 0,
204
+ summary: errors.length === 0
205
+ ? validation.summary
206
+ : `Method package has ${errors.length} issue(s).`,
207
+ errors,
208
+ counts: validation.counts,
209
+ };
210
+ }
211
+ export async function runMethodAuthoringDraft(options) {
212
+ const methodPath = createScratchLocalMethodPackage({
213
+ prepDataDir: options.prepDataDir,
214
+ methodId: options.methodId,
215
+ label: options.label,
216
+ hint: options.hint,
217
+ });
218
+ const shell = createMethodAuthoringShell({
219
+ methodPath,
220
+ methodId: options.methodId,
221
+ label: options.label,
222
+ referenceMethodId: options.baseMethodId ?? null,
223
+ sourceFolderPath: options.sourceFolderPath,
224
+ taskPrompt: options.taskPrompt,
225
+ checks: options.checks ?? [],
226
+ artifactRequirements: options.artifactRequirements ?? [],
227
+ });
228
+ const session = await runMethodEditSession({
229
+ executor: options.executor,
230
+ methodPath,
231
+ shell,
232
+ prompt: buildMethodAuthoringPrompt(),
233
+ validate: (methodPath) => validateAuthoredMethodPackage(methodPath, options.artifactRequirements ?? []),
234
+ maxValidationRepairAttempts: 1,
235
+ onStatus: options.onStatus,
236
+ });
237
+ if (session.status !== "updated") {
238
+ rmSync(methodPath, { recursive: true, force: true });
239
+ }
240
+ else {
241
+ // 0.15 — auto-fill `role: "general"` for any stage the agent
242
+ // didn't explicitly tag. Idempotent and silent when every stage
243
+ // already declares a role.
244
+ const touched = ensureStageRoles(methodPath);
245
+ if (touched.length > 0 && options.onStatus) {
246
+ options.onStatus(`STATUS: filled role=general on ${touched.length} stage(s) the author didn't tag (${touched.join(", ")}).`);
247
+ }
248
+ }
249
+ return {
250
+ status: session.status,
251
+ changed: session.changed,
252
+ summary: session.summary,
253
+ validation: session.validation,
254
+ methodPath,
255
+ shellPath: shell.rootPath,
256
+ };
257
+ }
258
+ export function resolveMethodDraftPath(sourcePath, methodId) {
259
+ return methodDefinitionPath(sourcePath, methodId);
260
+ }
@@ -1,5 +1,5 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import type { MethodValidationResult } from "../method-package/local-methods.js";
1
+ import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
+ import type { MethodValidationResult } from "../package/local-methods.js";
3
3
  import { type MethodEditShellArtifacts } from "./lib/method-edit-utils.js";
4
4
  export interface MethodEditSessionResult {
5
5
  status: "updated" | "no-change" | "invalid" | "executor-failed";
@@ -94,12 +94,12 @@ export async function runMethodEditSession(options) {
94
94
  "",
95
95
  "Rules:",
96
96
  "- Edit only files under `method/`.",
97
- "- Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
97
+ "- Use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids. Never use underscores.",
98
98
  "- Keep every stage `skill_dir` matched by `method/compile/stages/<skill_dir>/SKILL.md`.",
99
- "- Keep `method.schema.json` zone paths unique and non-overlapping.",
100
- "- Keep zone-count acceptance keys declared in `method.schema.json`.",
101
- "- Keep `artifacts_must_not_contain` keys as portable-context relative artifact paths such as `home.md`, not zone ids.",
102
- "- Preserve root `home.md` as the main portable-context entrypoint when the Method writes an entrypoint.",
99
+ "- Keep `method.schema.json` Artifact paths unique and non-overlapping.",
100
+ "- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
101
+ "- Use only CheckKind values listed in `runtime/authoring-context.json`; replace invented aliases with valid kinds.",
102
+ "- If the Method writes an agent entrypoint, keep it declared as an Artifact owned by the producing stage.",
103
103
  "- Stop as soon as the package should validate.",
104
104
  ].join("\n");
105
105
  appendFileSync(options.shell.promptLogPath, `\n\n---\n\n${prompt}\n`);
@@ -1,7 +1,7 @@
1
- import type { MethodExecutor } from "../agents/lib/executors.js";
2
- import { type MethodValidationResult } from "../method-package/local-methods.js";
3
- import type { SourcePreparationConfig } from "../project-model/lib/schema.js";
4
- import type { MethodImprovementLoopSummary } from "../compiler/lib/schema.js";
1
+ import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
2
+ import { type MethodValidationResult } from "../package/local-methods.js";
3
+ import type { SourcePreparationConfig } from "../../project/lib/schema.js";
4
+ import type { MethodImprovementLoopSummary } from "../../engine/compile/lib/schema.js";
5
5
  export interface MethodImprovementRunResult {
6
6
  status: "updated" | "no-change" | "invalid" | "executor-failed";
7
7
  changed: boolean;
@@ -1,15 +1,16 @@
1
1
  import { appendFileSync, existsSync, mkdirSync, writeFileSync, } from "node:fs";
2
2
  import { join, relative } from "node:path";
3
- import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../agents/lib/shells.js";
4
- import { validateMethodPackage } from "../method-package/local-methods.js";
5
- import { CONTEXT_INTERFACE_FILE } from "../method-package/context-interface.js";
6
- import { readJsonFileWithSchema } from "../shared/parse.js";
7
- import { resolveMethodImprovementReviewPaths } from "../method-package/method-review-paths.js";
8
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../compiler/compiled-paths.js";
9
- import { readInterfConfig } from "../project-model/interf.js";
10
- import { saveCompiledInterfConfig } from "../project-model/source-config.js";
11
- import { MethodImprovementRunLedgerSchema, } from "../compiler/lib/schema.js";
3
+ import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../../engine/agents/lib/shells.js";
4
+ import { validateMethodPackage } from "../package/local-methods.js";
5
+ import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
6
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
7
+ import { resolveMethodImprovementReviewPaths } from "../package/method-review-paths.js";
8
+ import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../../engine/compile/compiled-paths.js";
9
+ import { readInterfConfig } from "../../project/interf.js";
10
+ import { saveCompiledInterfConfig } from "../../project/source-config.js";
11
+ import { MethodImprovementRunLedgerSchema, } from "../../engine/compile/lib/schema.js";
12
12
  import { runMethodEditSession } from "./method-edit-session.js";
13
+ import { ensureStageRoles } from "./method-authoring.js";
13
14
  function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
14
15
  if (!absolutePath)
15
16
  return null;
@@ -66,7 +67,7 @@ function buildMethodImprovementPrompt() {
66
67
  "Edit only files under `method/`.",
67
68
  "Do not edit checks, test specs, source files, or generated portable-context outputs.",
68
69
  "Keep the Method package valid for the current compiler API and `method.schema.json`.",
69
- "Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read zones.",
70
+ "Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read Artifacts.",
70
71
  "Do not make one stage point at files or notes that are only created later by another stage.",
71
72
  "Prefer small, defensible changes to Method docs, stage docs, stage policies, or schema ownership over random churn.",
72
73
  "Do not narrate plans or ask follow-up questions.",
@@ -169,6 +170,11 @@ export async function runMethodImprovementLoop(options) {
169
170
  validate: validateMethodPackage,
170
171
  maxValidationRepairAttempts: 1,
171
172
  });
173
+ if (session.status === "updated") {
174
+ // 0.15 — fill role=general on any stage the improvement run
175
+ // dropped a role from. Idempotent and silent when complete.
176
+ ensureStageRoles(methodRoot);
177
+ }
172
178
  const preservedShellManifestPath = freezeMethodImprovementShell(shell.rootPath);
173
179
  writeMethodImprovementRunLedger(options.compiledPath, options.runId, buildMethodImprovementLoopRecord({
174
180
  targetName: compiledName,
@@ -1,37 +1,37 @@
1
- import { type CompiledZoneKind } from "../compiler/method-primitives.js";
1
+ import { type CompiledArtifactKind } from "../../engine/compile/method-primitives.js";
2
2
  declare const BUILTIN_COMPILED_STAGE_IDS: {
3
3
  readonly SUMMARIZE: "summarize";
4
4
  readonly STRUCTURE: "structure";
5
5
  readonly SHAPE: "shape";
6
6
  };
7
7
  type BuiltinCompiledStageId = typeof BUILTIN_COMPILED_STAGE_IDS[keyof typeof BUILTIN_COMPILED_STAGE_IDS];
8
- export declare const BUILTIN_COMPILED_ZONE_IDS: {
8
+ export declare const BUILTIN_COMPILED_ARTIFACT_IDS: {
9
9
  readonly SUMMARIES: "summaries";
10
10
  readonly KNOWLEDGE_ENTITIES: "knowledge-entities";
11
11
  readonly KNOWLEDGE_CLAIMS: "knowledge-claims";
12
12
  readonly KNOWLEDGE_INDEXES: "knowledge-indexes";
13
- readonly HOME: "home";
13
+ readonly HOME: "atlas";
14
14
  readonly RUNTIME: "runtime";
15
15
  };
16
- export type BuiltinCompiledZoneId = typeof BUILTIN_COMPILED_ZONE_IDS[keyof typeof BUILTIN_COMPILED_ZONE_IDS];
17
- export interface BuiltinCompiledZoneSpec {
18
- id: BuiltinCompiledZoneId;
16
+ export type BuiltinCompiledArtifactId = typeof BUILTIN_COMPILED_ARTIFACT_IDS[keyof typeof BUILTIN_COMPILED_ARTIFACT_IDS];
17
+ export interface BuiltinCompiledArtifactSpec {
18
+ id: BuiltinCompiledArtifactId;
19
19
  role: "input" | "working" | "output" | "runtime";
20
20
  path: string;
21
- kind: CompiledZoneKind;
21
+ kind: CompiledArtifactKind;
22
22
  required: boolean;
23
23
  description: string;
24
24
  }
25
25
  export interface BuiltinCompiledStageAccessPattern {
26
26
  id: BuiltinCompiledStageId;
27
27
  contract_type: string;
28
- reads: BuiltinCompiledZoneId[];
29
- writes: BuiltinCompiledZoneId[];
28
+ reads: BuiltinCompiledArtifactId[];
29
+ writes: BuiltinCompiledArtifactId[];
30
30
  }
31
- export declare function listBuiltinCompiledZoneSpecs(): BuiltinCompiledZoneSpec[];
31
+ export declare function listBuiltinCompiledArtifactSpecs(): BuiltinCompiledArtifactSpec[];
32
32
  export declare function listBuiltinCompiledFallbackStages(): BuiltinCompiledStageAccessPattern[];
33
- export declare function requiredCompiledZoneOwners<TStage extends {
33
+ export declare function requiredCompiledArtifactOwners<TStage extends {
34
34
  id: string;
35
35
  writes: readonly string[];
36
- }>(stages: readonly TStage[], zoneId: BuiltinCompiledZoneId): string[];
36
+ }>(stages: readonly TStage[], artifactId: BuiltinCompiledArtifactId): string[];
37
37
  export {};
@@ -1,27 +1,27 @@
1
1
  import { join } from "node:path";
2
2
  import { z } from "zod";
3
- import { readJsonFileWithSchema } from "../shared/parse.js";
4
- import { MethodCompiledSchemaSchema } from "../compiler/lib/schema.js";
3
+ import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
4
+ import { MethodCompiledSchemaSchema } from "../../engine/compile/lib/schema.js";
5
5
  import { PACKAGE_ROOT } from "./lib/package-root.js";
6
6
  const BUILTIN_COMPILED_STAGE_IDS = {
7
7
  SUMMARIZE: "summarize",
8
8
  STRUCTURE: "structure",
9
9
  SHAPE: "shape",
10
10
  };
11
- export const BUILTIN_COMPILED_ZONE_IDS = {
11
+ export const BUILTIN_COMPILED_ARTIFACT_IDS = {
12
12
  SUMMARIES: "summaries",
13
13
  KNOWLEDGE_ENTITIES: "knowledge-entities",
14
14
  KNOWLEDGE_CLAIMS: "knowledge-claims",
15
15
  KNOWLEDGE_INDEXES: "knowledge-indexes",
16
- HOME: "home",
16
+ HOME: "atlas",
17
17
  RUNTIME: "runtime",
18
18
  };
19
- const BUILTIN_ZONE_ID_SET = new Set(Object.values(BUILTIN_COMPILED_ZONE_IDS));
19
+ const BUILTIN_ARTIFACT_ID_SET = new Set(Object.values(BUILTIN_COMPILED_ARTIFACT_IDS));
20
20
  const BUILTIN_STAGE_ID_SET = new Set(Object.values(BUILTIN_COMPILED_STAGE_IDS));
21
21
  const BuiltinMethodStageSchema = z.object({
22
22
  id: z.string(),
23
23
  contract_type: z.string(),
24
- reads: z.array(z.string()).min(1),
24
+ reads: z.array(z.string()),
25
25
  writes: z.array(z.string()).min(1),
26
26
  });
27
27
  const BuiltinMethodPackageSchema = z.object({
@@ -29,9 +29,9 @@ const BuiltinMethodPackageSchema = z.object({
29
29
  });
30
30
  let builtinCompiledContractCache = null;
31
31
  const BUILTIN_DEFAULT_METHOD_ROOT = join(PACKAGE_ROOT, "builtin-methods", "interf-default");
32
- function assertBuiltinZoneId(value) {
33
- if (!BUILTIN_ZONE_ID_SET.has(value)) {
34
- throw new Error(`Built-in Interf Method schema declares unsupported zone id "${value}".`);
32
+ function assertBuiltinArtifactId(value) {
33
+ if (!BUILTIN_ARTIFACT_ID_SET.has(value)) {
34
+ throw new Error(`Built-in Interf Method schema declares unsupported Artifact id "${value}".`);
35
35
  }
36
36
  return value;
37
37
  }
@@ -54,25 +54,28 @@ function loadBuiltinCompiledContract() {
54
54
  if (!method) {
55
55
  throw new Error(`Missing or invalid built-in Method package at ${methodPath}.`);
56
56
  }
57
- const zones = schema.zones.map((zone) => ({
58
- id: assertBuiltinZoneId(zone.id),
59
- role: zone.role,
60
- path: zone.path,
61
- kind: zone.kind,
62
- required: zone.required,
63
- description: zone.description,
64
- }));
57
+ const artifacts = schema.artifacts.map((artifact) => {
58
+ const path = artifact.shape.path;
59
+ return {
60
+ id: assertBuiltinArtifactId(artifact.id),
61
+ role: "output",
62
+ path,
63
+ kind: artifact.shape.artifact_kind,
64
+ required: true,
65
+ description: artifact.description,
66
+ };
67
+ });
65
68
  const stages = method.stages.map((stage) => ({
66
69
  id: assertBuiltinStageId(stage.id),
67
70
  contract_type: stage.contract_type,
68
- reads: stage.reads.map(assertBuiltinZoneId),
69
- writes: stage.writes.map(assertBuiltinZoneId),
71
+ reads: stage.reads.map(assertBuiltinArtifactId),
72
+ writes: stage.writes.map(assertBuiltinArtifactId),
70
73
  }));
71
- builtinCompiledContractCache = { zones, stages };
74
+ builtinCompiledContractCache = { artifacts, stages };
72
75
  return builtinCompiledContractCache;
73
76
  }
74
- export function listBuiltinCompiledZoneSpecs() {
75
- return loadBuiltinCompiledContract().zones.map((zone) => ({ ...zone }));
77
+ export function listBuiltinCompiledArtifactSpecs() {
78
+ return loadBuiltinCompiledContract().artifacts.map((artifact) => ({ ...artifact }));
76
79
  }
77
80
  export function listBuiltinCompiledFallbackStages() {
78
81
  return loadBuiltinCompiledContract().stages.map((stage) => ({
@@ -81,8 +84,8 @@ export function listBuiltinCompiledFallbackStages() {
81
84
  writes: [...stage.writes],
82
85
  }));
83
86
  }
84
- export function requiredCompiledZoneOwners(stages, zoneId) {
87
+ export function requiredCompiledArtifactOwners(stages, artifactId) {
85
88
  return Array.from(new Set(stages
86
- .filter((stage) => stage.writes.includes(zoneId))
89
+ .filter((stage) => stage.writes.includes(artifactId))
87
90
  .map((stage) => stage.id)));
88
91
  }
@@ -0,0 +1,73 @@
1
+ import { z } from "zod";
2
+ import { type MethodCompiledSchema, type MethodCompiledArtifact, type MethodArtifactId } from "../../engine/compile/lib/schema.js";
3
+ export declare const CONTEXT_INTERFACE_FILE = "method.schema.json";
4
+ export declare const ContextInterfaceSchema: z.ZodObject<{
5
+ kind: z.ZodLiteral<"method-schema">;
6
+ version: z.ZodLiteral<1>;
7
+ target_type: z.ZodLiteral<"compiled">;
8
+ label: z.ZodString;
9
+ artifacts: z.ZodArray<z.ZodObject<{
10
+ id: z.ZodString;
11
+ description: z.ZodString;
12
+ shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"path">;
14
+ path: z.ZodString;
15
+ artifact_kind: z.ZodEnum<{
16
+ file: "file";
17
+ directory: "directory";
18
+ }>;
19
+ }, z.core.$strict>], "kind">;
20
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
21
+ id: z.ZodString;
22
+ kind: z.ZodEnum<{
23
+ file_exists: "file_exists";
24
+ min_file_count: "min_file_count";
25
+ min_file_count_matches_source: "min_file_count_matches_source";
26
+ frontmatter_valid: "frontmatter_valid";
27
+ frontmatter_required_keys: "frontmatter_required_keys";
28
+ wikilinks_valid: "wikilinks_valid";
29
+ must_not_contain: "must_not_contain";
30
+ must_contain: "must_contain";
31
+ qa_match: "qa_match";
32
+ }>;
33
+ description: z.ZodOptional<z.ZodString>;
34
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
+ required: z.ZodDefault<z.ZodBoolean>;
36
+ }, z.core.$strict>>>;
37
+ built_by_stages: z.ZodDefault<z.ZodArray<z.ZodString>>;
38
+ }, z.core.$strict>>;
39
+ }, z.core.$strict>;
40
+ export declare const MethodInputSpecSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ label: z.ZodString;
43
+ description: z.ZodString;
44
+ required: z.ZodDefault<z.ZodBoolean>;
45
+ examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ }, z.core.$strict>;
47
+ export type ContextInterface = MethodCompiledSchema;
48
+ export type ContextInterfaceArtifact = MethodCompiledArtifact;
49
+ export type ContextInterfaceArtifactId = MethodArtifactId;
50
+ export type MethodInputSpec = z.infer<typeof MethodInputSpecSchema>;
51
+ interface ContextInterfaceStageLike {
52
+ id: string;
53
+ writes: readonly string[];
54
+ }
55
+ interface ContextInterfaceSummary {
56
+ inputArtifacts: ContextInterfaceArtifact[];
57
+ workingArtifacts: ContextInterfaceArtifact[];
58
+ outputArtifacts: ContextInterfaceArtifact[];
59
+ runtimeArtifacts: ContextInterfaceArtifact[];
60
+ }
61
+ export declare function listContextInterfaceArtifacts(contextInterface: ContextInterface): ContextInterfaceArtifact[];
62
+ export declare function contextInterfaceFilePath(rootPath: string): string;
63
+ export declare function resolveContextInterfacePath(rootPath: string): string | null;
64
+ export declare function contextInterfaceExists(rootPath: string): boolean;
65
+ export declare function contextInterfaceArtifactAbsolutePath(compiledPath: string, artifact: Pick<ContextInterfaceArtifact, "path">): string;
66
+ export declare function contextInterfaceArtifactPath(artifact: Pick<ContextInterfaceArtifact, "path" | "kind">): string;
67
+ export declare function summarizeContextInterface(contextInterface: ContextInterface): ContextInterfaceSummary;
68
+ export declare function deriveMethodInputsFromContextInterface(contextInterface: ContextInterface | null | undefined): MethodInputSpec[];
69
+ export declare function buildContextInterface(stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
70
+ export declare function writeContextInterfaceFile(rootPath: string, stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
71
+ export declare function writeContextInterface(rootPath: string, contextInterface: ContextInterface): ContextInterface;
72
+ export declare function readContextInterface(rootPath: string): ContextInterface | null;
73
+ export {};