@interf/compiler 0.9.1 → 0.9.3

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 (250) hide show
  1. package/README.md +9 -9
  2. package/agent-skills/interf-actions/SKILL.md +3 -0
  3. package/agent-skills/interf-actions/references/cli.md +13 -13
  4. package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +2 -2
  5. package/builtin-methods/interf-default/improve/SKILL.md +18 -0
  6. package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +4 -4
  7. package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +2 -2
  8. package/dist/cli/commands/check-draft.d.ts +6 -6
  9. package/dist/cli/commands/check-draft.js +5 -5
  10. package/dist/cli/commands/compile-controller.d.ts +7 -7
  11. package/dist/cli/commands/compile-controller.js +35 -38
  12. package/dist/cli/commands/compile.d.ts +3 -3
  13. package/dist/cli/commands/compile.js +23 -21
  14. package/dist/cli/commands/compiled-flow.d.ts +11 -11
  15. package/dist/cli/commands/compiled-flow.js +33 -30
  16. package/dist/cli/commands/create-method-wizard.d.ts +76 -0
  17. package/dist/cli/commands/{create-workflow-wizard.js → create-method-wizard.js} +153 -163
  18. package/dist/cli/commands/create.d.ts +3 -3
  19. package/dist/cli/commands/create.js +44 -45
  20. package/dist/cli/commands/default.js +1 -1
  21. package/dist/cli/commands/executor-flow.d.ts +6 -6
  22. package/dist/cli/commands/executor-flow.js +1 -1
  23. package/dist/cli/commands/init.d.ts +2 -2
  24. package/dist/cli/commands/init.js +139 -118
  25. package/dist/cli/commands/list.js +11 -10
  26. package/dist/cli/commands/preparation-selection.d.ts +3 -3
  27. package/dist/cli/commands/source-config-wizard.d.ts +9 -9
  28. package/dist/cli/commands/source-config-wizard.js +43 -43
  29. package/dist/cli/commands/status.js +36 -9
  30. package/dist/cli/commands/test-flow.d.ts +15 -15
  31. package/dist/cli/commands/test-flow.js +29 -219
  32. package/dist/cli/commands/test.d.ts +2 -2
  33. package/dist/cli/commands/test.js +50 -51
  34. package/dist/cli/commands/verify.js +7 -7
  35. package/dist/cli/commands/web.js +41 -28
  36. package/dist/compiler-ui/404.html +1 -0
  37. package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
  38. package/dist/compiler-ui/__next._full.txt +20 -0
  39. package/dist/compiler-ui/__next._head.txt +5 -0
  40. package/dist/compiler-ui/__next._index.txt +5 -0
  41. package/dist/compiler-ui/__next._tree.txt +5 -0
  42. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
  43. package/{apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css → dist/compiler-ui/_next/static/chunks/0c9mu7yldxyyg.css} +1 -1
  44. package/{apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js → dist/compiler-ui/_next/static/chunks/15mks7ry_cupt.js} +15 -21
  45. package/{apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js → dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js} +1 -1
  46. package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
  47. package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
  48. package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
  49. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
  50. package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
  51. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
  52. package/dist/compiler-ui/_not-found.html +1 -0
  53. package/dist/compiler-ui/_not-found.txt +15 -0
  54. package/{apps/compiler-ui/.next/server/app → dist/compiler-ui}/index.html +1 -1
  55. package/dist/compiler-ui/index.txt +20 -0
  56. package/dist/index.d.ts +8 -6
  57. package/dist/index.js +5 -3
  58. package/dist/packages/agents/index.d.ts +1 -1
  59. package/dist/packages/agents/lib/args.d.ts +2 -2
  60. package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
  61. package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
  62. package/dist/packages/agents/lib/execution-profile.js +7 -6
  63. package/dist/packages/agents/lib/executors.d.ts +13 -13
  64. package/dist/packages/agents/lib/preflight.d.ts +1 -0
  65. package/dist/packages/agents/lib/preflight.js +32 -9
  66. package/dist/packages/agents/lib/shells.d.ts +25 -24
  67. package/dist/packages/agents/lib/shells.js +161 -154
  68. package/dist/packages/agents/lib/types.d.ts +2 -2
  69. package/dist/packages/compiler/artifact-counts.d.ts +1 -0
  70. package/dist/packages/compiler/artifact-counts.js +30 -0
  71. package/dist/packages/compiler/compiled-paths.d.ts +4 -7
  72. package/dist/packages/compiler/compiled-paths.js +9 -15
  73. package/dist/packages/compiler/compiled-pipeline.d.ts +11 -12
  74. package/dist/packages/compiler/compiled-pipeline.js +22 -22
  75. package/dist/packages/compiler/compiled-schema.d.ts +20 -20
  76. package/dist/packages/compiler/compiled-schema.js +29 -29
  77. package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
  78. package/dist/packages/compiler/compiled-stage-plan.js +8 -8
  79. package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -5
  80. package/dist/packages/compiler/compiled-stage-runner.js +7 -7
  81. package/dist/packages/compiler/compiled-target.d.ts +5 -5
  82. package/dist/packages/compiler/compiled-target.js +5 -5
  83. package/dist/packages/compiler/index.d.ts +3 -3
  84. package/dist/packages/compiler/index.js +2 -2
  85. package/dist/packages/compiler/lib/schema.d.ts +62 -247
  86. package/dist/packages/compiler/lib/schema.js +56 -174
  87. package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
  88. package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
  89. package/dist/packages/compiler/raw-snapshot.d.ts +0 -7
  90. package/dist/packages/compiler/raw-snapshot.js +0 -1
  91. package/dist/packages/compiler/reset.js +3 -3
  92. package/dist/packages/compiler/runtime-acceptance.js +9 -16
  93. package/dist/packages/compiler/runtime-contracts.js +9 -9
  94. package/dist/packages/compiler/runtime-prompt.js +4 -4
  95. package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
  96. package/dist/packages/compiler/runtime-reconcile.js +3 -3
  97. package/dist/packages/compiler/runtime-runs.js +9 -9
  98. package/dist/packages/compiler/runtime-types.d.ts +8 -7
  99. package/dist/packages/compiler/state-health.js +26 -35
  100. package/dist/packages/compiler/state-view.js +6 -6
  101. package/dist/packages/compiler/validate-compiled.d.ts +5 -5
  102. package/dist/packages/compiler/validate-compiled.js +56 -64
  103. package/dist/packages/compiler/validate.d.ts +2 -2
  104. package/dist/packages/compiler/validate.js +22 -14
  105. package/dist/packages/contracts/index.d.ts +2 -0
  106. package/dist/packages/contracts/index.js +1 -0
  107. package/dist/packages/contracts/lib/schema.d.ts +205 -0
  108. package/dist/packages/contracts/lib/schema.js +101 -0
  109. package/dist/packages/execution/index.d.ts +2 -2
  110. package/dist/packages/execution/index.js +1 -1
  111. package/dist/packages/execution/lib/schema.d.ts +80 -83
  112. package/dist/packages/execution/lib/schema.js +25 -48
  113. package/dist/packages/local-service/action-values.d.ts +0 -1
  114. package/dist/packages/local-service/action-values.js +0 -1
  115. package/dist/packages/local-service/client.d.ts +4 -4
  116. package/dist/packages/local-service/client.js +4 -4
  117. package/dist/packages/local-service/index.d.ts +3 -3
  118. package/dist/packages/local-service/index.js +2 -2
  119. package/dist/packages/local-service/lib/schema.d.ts +536 -974
  120. package/dist/packages/local-service/lib/schema.js +43 -160
  121. package/dist/packages/local-service/run-observability.d.ts +6 -0
  122. package/dist/packages/local-service/run-observability.js +592 -0
  123. package/dist/packages/local-service/runtime.d.ts +19 -23
  124. package/dist/packages/local-service/runtime.js +302 -880
  125. package/dist/packages/local-service/server.d.ts +1 -0
  126. package/dist/packages/local-service/server.js +25 -20
  127. package/dist/packages/method-authoring/index.d.ts +4 -0
  128. package/dist/packages/method-authoring/index.js +4 -0
  129. package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
  130. package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
  131. package/dist/packages/method-authoring/method-authoring.js +116 -0
  132. package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
  133. package/dist/packages/method-authoring/method-edit-session.js +125 -0
  134. package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
  135. package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +63 -63
  136. package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
  137. package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
  138. package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
  139. package/dist/packages/{workflow-package → method-package}/context-interface.js +19 -19
  140. package/dist/packages/method-package/index.d.ts +11 -0
  141. package/dist/packages/method-package/index.js +11 -0
  142. package/dist/packages/method-package/interf-method-package.d.ts +31 -0
  143. package/dist/packages/{workflow-package/interf-workflow-package.js → method-package/interf-method-package.js} +145 -145
  144. package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
  145. package/dist/packages/method-package/local-methods.d.ts +64 -0
  146. package/dist/packages/method-package/local-methods.js +466 -0
  147. package/dist/packages/method-package/method-definitions.d.ts +83 -0
  148. package/dist/packages/method-package/method-definitions.js +205 -0
  149. package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
  150. package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +22 -26
  151. package/dist/packages/method-package/method-review-paths.d.ts +10 -0
  152. package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
  153. package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +12 -11
  154. package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +6 -6
  155. package/dist/packages/methods/index.d.ts +2 -0
  156. package/dist/packages/methods/index.js +2 -0
  157. package/dist/packages/methods/method-resolution.d.ts +6 -0
  158. package/dist/packages/methods/method-resolution.js +7 -0
  159. package/dist/packages/project-model/index.d.ts +1 -4
  160. package/dist/packages/project-model/index.js +0 -3
  161. package/dist/packages/project-model/interf-detect.d.ts +1 -5
  162. package/dist/packages/project-model/interf-detect.js +7 -18
  163. package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
  164. package/dist/packages/project-model/interf-scaffold.js +38 -39
  165. package/dist/packages/project-model/interf.d.ts +1 -2
  166. package/dist/packages/project-model/interf.js +1 -2
  167. package/dist/packages/project-model/lib/schema.d.ts +2 -66
  168. package/dist/packages/project-model/lib/schema.js +5 -23
  169. package/dist/packages/project-model/project-paths.d.ts +9 -10
  170. package/dist/packages/project-model/project-paths.js +14 -17
  171. package/dist/packages/project-model/source-config.d.ts +11 -18
  172. package/dist/packages/project-model/source-config.js +42 -60
  173. package/dist/packages/project-model/source-folders.d.ts +4 -4
  174. package/dist/packages/project-model/source-folders.js +10 -10
  175. package/dist/packages/testing/index.d.ts +2 -2
  176. package/dist/packages/testing/index.js +1 -1
  177. package/dist/packages/testing/lib/schema.d.ts +11 -11
  178. package/dist/packages/testing/lib/schema.js +8 -9
  179. package/dist/packages/testing/readiness-check-run.d.ts +67 -0
  180. package/dist/packages/testing/readiness-check-run.js +258 -0
  181. package/dist/packages/testing/test-execution.d.ts +3 -3
  182. package/dist/packages/testing/test-execution.js +5 -5
  183. package/dist/packages/testing/test-paths.js +6 -6
  184. package/dist/packages/testing/test-profile-presets.js +2 -2
  185. package/dist/packages/testing/test-sandbox.js +10 -11
  186. package/dist/packages/testing/test-targets.d.ts +1 -1
  187. package/dist/packages/testing/test-targets.js +8 -7
  188. package/dist/packages/testing/test-types.d.ts +1 -1
  189. package/package.json +16 -33
  190. package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +0 -5
  191. package/builtin-workflows/interf/improve/SKILL.md +0 -18
  192. package/dist/cli/commands/create-workflow-wizard.d.ts +0 -76
  193. package/dist/packages/project-model/compiled-paths.d.ts +0 -1
  194. package/dist/packages/project-model/compiled-paths.js +0 -1
  195. package/dist/packages/project-model/compiled-raw.d.ts +0 -1
  196. package/dist/packages/project-model/compiled-raw.js +0 -1
  197. package/dist/packages/project-model/compiled-reset.d.ts +0 -1
  198. package/dist/packages/project-model/compiled-reset.js +0 -1
  199. package/dist/packages/shared/index.d.ts +0 -7
  200. package/dist/packages/shared/index.js +0 -7
  201. package/dist/packages/shared/util.d.ts +0 -3
  202. package/dist/packages/shared/util.js +0 -3
  203. package/dist/packages/testing/test-matrices.d.ts +0 -90
  204. package/dist/packages/testing/test-matrices.js +0 -96
  205. package/dist/packages/workflow-authoring/index.d.ts +0 -4
  206. package/dist/packages/workflow-authoring/index.js +0 -4
  207. package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -24
  208. package/dist/packages/workflow-authoring/workflow-authoring.js +0 -82
  209. package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -18
  210. package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -91
  211. package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
  212. package/dist/packages/workflow-package/index.d.ts +0 -11
  213. package/dist/packages/workflow-package/index.js +0 -11
  214. package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -31
  215. package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
  216. package/dist/packages/workflow-package/local-workflows.js +0 -457
  217. package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
  218. package/dist/packages/workflow-package/workflow-definitions.js +0 -211
  219. package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
  220. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +0 -0
  221. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +0 -0
  222. /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
  223. /package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +0 -0
  224. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/03~yq9q893hmn.js +0 -0
  225. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/06z~l3kwb891e.js +0 -0
  226. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08g7lvje.te.u.js +0 -0
  227. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/08m7vf5asqlsm.js +0 -0
  228. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0_i-3_5l9t2qe.js +0 -0
  229. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b-ywny_j0g~0.js +0 -0
  230. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0b52v41o1gixx.js +0 -0
  231. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0gpzgsv0w.q~m.js +0 -0
  232. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0ilwfezfvu6~-.js +0 -0
  233. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0n51hrfoufc7g.js +0 -0
  234. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0xxmf45eskdt~.css +0 -0
  235. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
  236. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/14wtz~vq25~qq.js +0 -0
  237. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-10e~t1yzi4svj.js +0 -0
  238. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
  239. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
  240. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
  241. /package/{apps/compiler-ui/.next → dist/compiler-ui/_next}/static/media/worker.102zas1s52_pf.js +0 -0
  242. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_buildManifest.js +0 -0
  243. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_clientMiddlewareManifest.js +0 -0
  244. /package/{apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J → dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK}/_ssgManifest.js +0 -0
  245. /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
  246. /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
  247. /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
  248. /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
  249. /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
  250. /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
@@ -1,15 +1,15 @@
1
1
  import { appendFileSync, existsSync, mkdirSync, writeFileSync, } from "node:fs";
2
2
  import { join, relative } from "node:path";
3
- import { createWorkflowImprovementShell, freezeWorkflowImprovementShell, } from "../agents/lib/shells.js";
4
- import { validateWorkflowPackage } from "../workflow-package/local-workflows.js";
5
- import { CONTEXT_INTERFACE_FILE } from "../workflow-package/context-interface.js";
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
6
  import { readJsonFileWithSchema } from "../shared/parse.js";
7
- import { resolveWorkflowImprovementReviewPaths } from "../workflow-package/workflow-review-paths.js";
8
- import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, workflowImprovementRunRoot, workflowPackagePathForCompiled, } from "../compiler/compiled-paths.js";
7
+ import { resolveMethodImprovementReviewPaths } from "../method-package/method-review-paths.js";
8
+ import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../compiler/compiled-paths.js";
9
9
  import { readInterfConfig } from "../project-model/interf.js";
10
10
  import { saveCompiledInterfConfig } from "../project-model/source-config.js";
11
- import { WorkflowImprovementRunLedgerSchema, } from "../compiler/lib/schema.js";
12
- import { runWorkflowEditSession } from "./workflow-edit-session.js";
11
+ import { MethodImprovementRunLedgerSchema, } from "../compiler/lib/schema.js";
12
+ import { runMethodEditSession } from "./method-edit-session.js";
13
13
  function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
14
14
  if (!absolutePath)
15
15
  return null;
@@ -33,15 +33,15 @@ function buildLoopContext(options) {
33
33
  const previousVariations = options.previousVariations.map((summary) => mapLoopSummaryForShell(summary, options.compiledPath));
34
34
  const latestFailure = previousVariations.at(-1) ?? null;
35
35
  return {
36
- kind: "interf-workflow-improvement-loop",
36
+ kind: "interf-method-improvement-loop",
37
37
  version: 1,
38
38
  generated_at: new Date().toISOString(),
39
39
  target_name: readInterfConfig(options.compiledPath)?.name ?? "compiled",
40
- workflow_id: options.workflowId,
40
+ method_id: options.methodId,
41
41
  loop_index: options.loopIndex,
42
42
  max_loops: options.maxLoops,
43
43
  max_attempts: options.maxAttempts,
44
- review_paths: resolveWorkflowImprovementReviewPaths(options.compiledPath),
44
+ review_paths: resolveMethodImprovementReviewPaths(options.compiledPath),
45
45
  readiness_checks: {
46
46
  count: options.compiledConfig.checks.length,
47
47
  questions: options.compiledConfig.checks.map((check, index) => ({
@@ -53,86 +53,86 @@ function buildLoopContext(options) {
53
53
  latest_failure: latestFailure,
54
54
  };
55
55
  }
56
- function buildWorkflowImprovementPrompt() {
56
+ function buildMethodImprovementPrompt() {
57
57
  return [
58
- "This is an automated Interf workflow-improvement run, not an open-ended chat session.",
58
+ "This is an automated Interf Method-improvement run, not an open-ended chat session.",
59
59
  "The user already invoked this through `interf compile` with self-improving loops enabled. Execute it now.",
60
60
  "Read `runtime/loop-context.json` first.",
61
- `Then read \`workflow/README.md\`, \`workflow/workflow.json\`, \`workflow/${CONTEXT_INTERFACE_FILE}\`, and \`workflow/improve/SKILL.md\` if it exists.`,
62
- "Review preserved evidence from earlier failures under `artifacts/` before you edit the workflow.",
63
- "Treat `workflow/improve/SKILL.md` as guidance for how to improve the workflow, not as the default file to edit.",
64
- "Treat the workflow package as four aligned layers: purpose, inputs, context interface, and stages.",
65
- "Prefer editing the stage docs, workflow contract, input contract, or schema ownership that actually change compiled outputs.",
66
- "Edit only files under `workflow/`.",
67
- "Do not edit checks, test specs, raw dataset files, or generated compiled outputs.",
68
- "Keep the workflow valid for the current compiler API and workflow schema.",
61
+ `Then read \`method/README.md\`, \`method/method.json\`, \`method/${CONTEXT_INTERFACE_FILE}\`, and \`method/improve/SKILL.md\` if it exists.`,
62
+ "Review preserved evidence from earlier failures under `artifacts/` before you edit the Method.",
63
+ "Treat `method/improve/SKILL.md` as guidance for how to improve the Method, not as the default file to edit.",
64
+ "Treat the Method package as four aligned layers: purpose, inputs, context interface, and stages.",
65
+ "Prefer editing the stage docs, Method contract, input contract, or schema ownership that actually change portable-context outputs.",
66
+ "Edit only files under `method/`.",
67
+ "Do not edit checks, test specs, raw source files, or generated portable-context outputs.",
68
+ "Keep the Method package valid for the current compiler API and `method.schema.json`.",
69
69
  "Respect stage boundaries: a stage may only introduce links that resolve within that stage's declared writes or already-existing read zones.",
70
70
  "Do not make one stage point at files or notes that are only created later by another stage.",
71
- "Prefer small, defensible changes to workflow docs, stage docs, stage policies, or schema ownership over random churn.",
71
+ "Prefer small, defensible changes to Method docs, stage docs, stage policies, or schema ownership over random churn.",
72
72
  "Do not narrate plans or ask follow-up questions.",
73
73
  "Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
74
- "As soon as the workflow edits are complete, stop.",
74
+ "As soon as the Method edits are complete, stop.",
75
75
  ].join("\n");
76
76
  }
77
- function updateCompiledWorkflowOrigin(options) {
77
+ function updateCompiledMethodOrigin(options) {
78
78
  const current = readInterfConfig(options.compiledPath);
79
79
  if (!current)
80
80
  return;
81
81
  const nextConfig = {
82
82
  ...current,
83
- workflow: current.workflow ?? options.selectedWorkflowId,
84
- workflow_origin: {
85
- selected: options.selectedWorkflowId,
83
+ method: current.method ?? options.selectedMethodId,
84
+ method_origin: {
85
+ selected: options.selectedMethodId,
86
86
  ...(options.localDraft ? { local_draft: true } : {}),
87
87
  },
88
88
  };
89
89
  saveCompiledInterfConfig(options.compiledPath, nextConfig);
90
90
  }
91
- function workflowImprovementRunLedgerPath(compiledPath, runId) {
92
- return join(workflowImprovementRunRoot(compiledPath, runId), "run.json");
91
+ function methodImprovementRunLedgerPath(compiledPath, runId) {
92
+ return join(methodImprovementRunRoot(compiledPath, runId), "run.json");
93
93
  }
94
- function workflowImprovementLoopHistoryPath(compiledPath, runId) {
95
- return join(workflowImprovementRunRoot(compiledPath, runId), "loop-history.jsonl");
94
+ function methodImprovementLoopHistoryPath(compiledPath, runId) {
95
+ return join(methodImprovementRunRoot(compiledPath, runId), "loop-history.jsonl");
96
96
  }
97
- function workflowImprovementLoopRecordPath(loopRootPath) {
97
+ function methodImprovementLoopRecordPath(loopRootPath) {
98
98
  return join(loopRootPath, "loop.json");
99
99
  }
100
- function readWorkflowImprovementRunLedger(compiledPath, runId) {
101
- const ledgerPath = workflowImprovementRunLedgerPath(compiledPath, runId);
100
+ function readMethodImprovementRunLedger(compiledPath, runId) {
101
+ const ledgerPath = methodImprovementRunLedgerPath(compiledPath, runId);
102
102
  if (!existsSync(ledgerPath))
103
103
  return null;
104
- return readJsonFileWithSchema(ledgerPath, "workflow improvement run ledger", WorkflowImprovementRunLedgerSchema);
104
+ return readJsonFileWithSchema(ledgerPath, "Method improvement run ledger", MethodImprovementRunLedgerSchema);
105
105
  }
106
- function writeWorkflowImprovementRunLedger(compiledPath, runId, record, options) {
107
- const runRoot = workflowImprovementRunRoot(compiledPath, runId);
106
+ function writeMethodImprovementRunLedger(compiledPath, runId, record, options) {
107
+ const runRoot = methodImprovementRunRoot(compiledPath, runId);
108
108
  mkdirSync(runRoot, { recursive: true });
109
- const existing = readWorkflowImprovementRunLedger(compiledPath, runId);
109
+ const existing = readMethodImprovementRunLedger(compiledPath, runId);
110
110
  const generatedAt = existing?.generated_at ?? new Date().toISOString();
111
111
  const ledger = {
112
- kind: "interf-workflow-improvement-run",
112
+ kind: "interf-method-improvement-run",
113
113
  version: 1,
114
114
  generated_at: generatedAt,
115
115
  updated_at: new Date().toISOString(),
116
116
  run_id: runId,
117
117
  target_name: options.targetName,
118
- workflow_id: options.workflowId,
118
+ method_id: options.methodId,
119
119
  max_loops: options.maxLoops,
120
120
  max_attempts: options.maxAttempts,
121
121
  loops: [...(existing?.loops ?? []), record],
122
122
  };
123
- writeFileSync(workflowImprovementRunLedgerPath(compiledPath, runId), `${JSON.stringify(ledger, null, 2)}\n`);
124
- writeFileSync(workflowImprovementLoopRecordPath(record.loop_root_path), `${JSON.stringify(record, null, 2)}\n`);
125
- appendFileSync(workflowImprovementLoopHistoryPath(compiledPath, runId), `${JSON.stringify(record)}\n`);
123
+ writeFileSync(methodImprovementRunLedgerPath(compiledPath, runId), `${JSON.stringify(ledger, null, 2)}\n`);
124
+ writeFileSync(methodImprovementLoopRecordPath(record.loop_root_path), `${JSON.stringify(record, null, 2)}\n`);
125
+ appendFileSync(methodImprovementLoopHistoryPath(compiledPath, runId), `${JSON.stringify(record)}\n`);
126
126
  }
127
- function buildWorkflowImprovementLoopRecord(options) {
127
+ function buildMethodImprovementLoopRecord(options) {
128
128
  return {
129
- kind: "interf-workflow-improvement-loop-record",
129
+ kind: "interf-method-improvement-loop-record",
130
130
  version: 1,
131
131
  recorded_at: new Date().toISOString(),
132
132
  run_id: options.runId,
133
133
  loop_index: options.loopIndex,
134
134
  target_name: options.targetName,
135
- workflow_id: options.workflowId,
135
+ method_id: options.methodId,
136
136
  result: options.result,
137
137
  changed: options.changed,
138
138
  applied: options.result === "updated",
@@ -140,8 +140,8 @@ function buildWorkflowImprovementLoopRecord(options) {
140
140
  shell_path: options.shellPath,
141
141
  loop_root_path: options.loopRootPath,
142
142
  context_path: join(options.shellPath, "runtime", "loop-context.json"),
143
- workflow_before_path: options.workflowBeforePath,
144
- workflow_after_path: options.workflowAfterPath,
143
+ method_before_path: options.methodBeforePath,
144
+ method_after_path: options.methodAfterPath,
145
145
  prompt_log_path: options.promptLogPath,
146
146
  event_log_path: options.eventLogPath,
147
147
  status_log_path: options.statusLogPath,
@@ -149,36 +149,36 @@ function buildWorkflowImprovementLoopRecord(options) {
149
149
  validation: options.validation,
150
150
  };
151
151
  }
152
- export async function runWorkflowImprovementLoop(options) {
152
+ export async function runMethodImprovementLoop(options) {
153
153
  const compiledName = readInterfConfig(options.compiledPath)?.name ?? "compiled";
154
154
  const context = buildLoopContext(options);
155
- const shell = createWorkflowImprovementShell({
155
+ const shell = createMethodImprovementShell({
156
156
  compiledPath: options.compiledPath,
157
157
  compiledName,
158
- workflowId: options.workflowId,
158
+ methodId: options.methodId,
159
159
  runId: options.runId,
160
160
  loopIndex: options.loopIndex,
161
161
  context,
162
162
  });
163
- const workflowRoot = workflowPackagePathForCompiled(options.compiledPath);
164
- const session = await runWorkflowEditSession({
163
+ const methodRoot = methodPackagePathForCompiled(options.compiledPath);
164
+ const session = await runMethodEditSession({
165
165
  executor: options.executor,
166
- workflowPath: workflowRoot,
166
+ methodPath: methodRoot,
167
167
  shell,
168
- prompt: buildWorkflowImprovementPrompt(),
169
- validate: validateWorkflowPackage,
168
+ prompt: buildMethodImprovementPrompt(),
169
+ validate: validateMethodPackage,
170
170
  maxValidationRepairAttempts: 1,
171
171
  });
172
- const preservedShellManifestPath = freezeWorkflowImprovementShell(shell.rootPath);
173
- writeWorkflowImprovementRunLedger(options.compiledPath, options.runId, buildWorkflowImprovementLoopRecord({
172
+ const preservedShellManifestPath = freezeMethodImprovementShell(shell.rootPath);
173
+ writeMethodImprovementRunLedger(options.compiledPath, options.runId, buildMethodImprovementLoopRecord({
174
174
  targetName: compiledName,
175
- workflowId: options.workflowId,
175
+ methodId: options.methodId,
176
176
  runId: options.runId,
177
177
  loopIndex: options.loopIndex,
178
178
  shellPath: shell.rootPath,
179
179
  loopRootPath: shell.loopRootPath,
180
- workflowBeforePath: shell.workflowBeforePath,
181
- workflowAfterPath: shell.workflowAfterPath,
180
+ methodBeforePath: shell.methodBeforePath,
181
+ methodAfterPath: shell.methodAfterPath,
182
182
  promptLogPath: shell.promptLogPath,
183
183
  eventLogPath: shell.eventLogPath,
184
184
  statusLogPath: shell.statusLogPath,
@@ -189,14 +189,14 @@ export async function runWorkflowImprovementLoop(options) {
189
189
  summary: session.summary,
190
190
  }), {
191
191
  targetName: compiledName,
192
- workflowId: options.workflowId,
192
+ methodId: options.methodId,
193
193
  maxLoops: options.maxLoops,
194
194
  maxAttempts: options.maxAttempts,
195
195
  });
196
196
  if (session.status === "updated") {
197
- updateCompiledWorkflowOrigin({
197
+ updateCompiledMethodOrigin({
198
198
  compiledPath: options.compiledPath,
199
- selectedWorkflowId: options.workflowId,
199
+ selectedMethodId: options.methodId,
200
200
  localDraft: true,
201
201
  });
202
202
  }
@@ -1,4 +1,4 @@
1
- import { COMPILED_ZONE_KINDS, type CompiledZoneKind } from "../compiler/workflow-primitives.js";
1
+ import { COMPILED_ZONE_KINDS, type CompiledZoneKind } from "../compiler/method-primitives.js";
2
2
  export declare const BUILTIN_COMPILED_STAGE_IDS: {
3
3
  readonly SUMMARIZE: "summarize";
4
4
  readonly STRUCTURE: "structure";
@@ -1,8 +1,8 @@
1
1
  import { join } from "node:path";
2
2
  import { z } from "zod";
3
3
  import { readJsonFileWithSchema } from "../shared/parse.js";
4
- import { COMPILED_ZONE_KINDS } from "../compiler/workflow-primitives.js";
5
- import { WorkflowCompiledSchemaSchema } from "../compiler/lib/schema.js";
4
+ import { COMPILED_ZONE_KINDS } from "../compiler/method-primitives.js";
5
+ import { MethodCompiledSchemaSchema } from "../compiler/lib/schema.js";
6
6
  import { PACKAGE_ROOT } from "./lib/package-root.js";
7
7
  export const BUILTIN_COMPILED_STAGE_IDS = {
8
8
  SUMMARIZE: "summarize",
@@ -20,44 +20,44 @@ export const BUILTIN_COMPILED_ZONE_IDS = {
20
20
  };
21
21
  const BUILTIN_ZONE_ID_SET = new Set(Object.values(BUILTIN_COMPILED_ZONE_IDS));
22
22
  const BUILTIN_STAGE_ID_SET = new Set(Object.values(BUILTIN_COMPILED_STAGE_IDS));
23
- const BuiltinWorkflowStageSchema = z.object({
23
+ const BuiltinMethodStageSchema = z.object({
24
24
  id: z.string(),
25
25
  contract_type: z.string(),
26
26
  reads: z.array(z.string()).min(1),
27
27
  writes: z.array(z.string()).min(1),
28
28
  });
29
- const BuiltinWorkflowPackageSchema = z.object({
30
- stages: z.array(BuiltinWorkflowStageSchema).min(1),
29
+ const BuiltinMethodPackageSchema = z.object({
30
+ stages: z.array(BuiltinMethodStageSchema).min(1),
31
31
  });
32
32
  let builtinCompiledContractCache = null;
33
- function builtinWorkflowRootPath() {
34
- return join(PACKAGE_ROOT, "builtin-workflows", "interf");
33
+ function builtinMethodRootPath() {
34
+ return join(PACKAGE_ROOT, "builtin-methods", "interf-default");
35
35
  }
36
- function builtinWorkflowPath(relativePath) {
37
- return join(builtinWorkflowRootPath(), relativePath);
36
+ function builtinMethodPath(relativePath) {
37
+ return join(builtinMethodRootPath(), relativePath);
38
38
  }
39
39
  function assertBuiltinZoneId(value) {
40
40
  if (!BUILTIN_ZONE_ID_SET.has(value)) {
41
- throw new Error(`Built-in Interf workflow schema declares unsupported zone id "${value}".`);
41
+ throw new Error(`Built-in Interf Method schema declares unsupported zone id "${value}".`);
42
42
  }
43
43
  return value;
44
44
  }
45
45
  function assertBuiltinStageId(value) {
46
46
  if (!BUILTIN_STAGE_ID_SET.has(value)) {
47
- throw new Error(`Built-in Interf workflow package declares unsupported stage id "${value}".`);
47
+ throw new Error(`Built-in Interf Method package declares unsupported stage id "${value}".`);
48
48
  }
49
49
  return value;
50
50
  }
51
51
  function loadBuiltinCompiledContract() {
52
52
  if (builtinCompiledContractCache)
53
53
  return builtinCompiledContractCache;
54
- const schema = readJsonFileWithSchema(builtinWorkflowPath("workflow.schema.json"), "built-in Interf workflow schema", WorkflowCompiledSchemaSchema);
54
+ const schema = readJsonFileWithSchema(builtinMethodPath("method.schema.json"), "built-in Interf Method schema", MethodCompiledSchemaSchema);
55
55
  if (!schema) {
56
- throw new Error(`Missing or invalid built-in workflow schema at ${builtinWorkflowPath("workflow.schema.json")}.`);
56
+ throw new Error(`Missing or invalid built-in Method schema at ${builtinMethodPath("method.schema.json")}.`);
57
57
  }
58
- const workflow = readJsonFileWithSchema(builtinWorkflowPath("workflow.json"), "built-in Interf workflow package", BuiltinWorkflowPackageSchema);
59
- if (!workflow) {
60
- throw new Error(`Missing or invalid built-in workflow package at ${builtinWorkflowPath("workflow.json")}.`);
58
+ const method = readJsonFileWithSchema(builtinMethodPath("method.json"), "built-in Interf Method package", BuiltinMethodPackageSchema);
59
+ if (!method) {
60
+ throw new Error(`Missing or invalid built-in Method package at ${builtinMethodPath("method.json")}.`);
61
61
  }
62
62
  const zones = schema.zones.map((zone) => ({
63
63
  id: assertBuiltinZoneId(zone.id),
@@ -67,7 +67,7 @@ function loadBuiltinCompiledContract() {
67
67
  required: zone.required,
68
68
  description: zone.description,
69
69
  }));
70
- const stages = workflow.stages.map((stage) => ({
70
+ const stages = method.stages.map((stage) => ({
71
71
  id: assertBuiltinStageId(stage.id),
72
72
  contract_type: stage.contract_type,
73
73
  reads: stage.reads.map(assertBuiltinZoneId),
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
- import { type WorkflowCompiledSchema, type WorkflowCompiledZone, type WorkflowZoneId } from "../compiler/lib/schema.js";
3
- export declare const CONTEXT_INTERFACE_FILE = "workflow.schema.json";
2
+ import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "../compiler/lib/schema.js";
3
+ export declare const CONTEXT_INTERFACE_FILE = "method.schema.json";
4
4
  export declare const ContextInterfaceSchema: z.ZodObject<{
5
- kind: z.ZodLiteral<"workflow-schema">;
5
+ kind: z.ZodLiteral<"method-schema">;
6
6
  version: z.ZodLiteral<1>;
7
7
  target_type: z.ZodLiteral<"compiled">;
8
8
  label: z.ZodString;
@@ -17,8 +17,8 @@ export declare const ContextInterfaceSchema: z.ZodObject<{
17
17
  path: z.ZodString;
18
18
  kind: z.ZodEnum<{
19
19
  runtime: "runtime";
20
- directory: "directory";
21
20
  file: "file";
21
+ directory: "directory";
22
22
  }>;
23
23
  required: z.ZodBoolean;
24
24
  owned_by: z.ZodArray<z.ZodString>;
@@ -36,8 +36,8 @@ export declare const ContextInterfaceZoneSchema: z.ZodObject<{
36
36
  path: z.ZodString;
37
37
  kind: z.ZodEnum<{
38
38
  runtime: "runtime";
39
- directory: "directory";
40
39
  file: "file";
40
+ directory: "directory";
41
41
  }>;
42
42
  required: z.ZodBoolean;
43
43
  owned_by: z.ZodArray<z.ZodString>;
@@ -50,25 +50,25 @@ export declare const ContextInterfaceZoneRoleSchema: z.ZodEnum<{
50
50
  input: "input";
51
51
  working: "working";
52
52
  }>;
53
- export declare const WorkflowInputSpecSchema: z.ZodObject<{
53
+ export declare const MethodInputSpecSchema: z.ZodObject<{
54
54
  id: z.ZodString;
55
55
  label: z.ZodString;
56
56
  description: z.ZodString;
57
57
  required: z.ZodDefault<z.ZodBoolean>;
58
58
  examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
59
  }, z.core.$strict>;
60
- export declare const WorkflowInputContractSchema: z.ZodArray<z.ZodObject<{
60
+ export declare const MethodInputContractSchema: z.ZodArray<z.ZodObject<{
61
61
  id: z.ZodString;
62
62
  label: z.ZodString;
63
63
  description: z.ZodString;
64
64
  required: z.ZodDefault<z.ZodBoolean>;
65
65
  examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
66
  }, z.core.$strict>>;
67
- export type ContextInterface = WorkflowCompiledSchema;
68
- export type ContextInterfaceZone = WorkflowCompiledZone;
69
- export type ContextInterfaceZoneId = WorkflowZoneId;
67
+ export type ContextInterface = MethodCompiledSchema;
68
+ export type ContextInterfaceZone = MethodCompiledZone;
69
+ export type ContextInterfaceZoneId = MethodZoneId;
70
70
  export type ContextInterfaceZoneRole = z.infer<typeof ContextInterfaceZoneRoleSchema>;
71
- export type WorkflowInputSpec = z.infer<typeof WorkflowInputSpecSchema>;
71
+ export type MethodInputSpec = z.infer<typeof MethodInputSpecSchema>;
72
72
  export interface ContextInterfaceStageLike {
73
73
  id: string;
74
74
  writes: readonly string[];
@@ -89,7 +89,7 @@ export declare function contextInterfaceZoneAbsolutePath(compiledPath: string, z
89
89
  export declare function contextInterfaceArtifactPath(zone: Pick<ContextInterfaceZone, "path" | "kind">): string;
90
90
  export declare function contextInterfaceArtifactPathsForZoneIds(contextInterface: ContextInterface, zoneIds: readonly ContextInterfaceZoneId[]): string[];
91
91
  export declare function summarizeContextInterface(contextInterface: ContextInterface): ContextInterfaceSummary;
92
- export declare function deriveWorkflowInputsFromContextInterface(contextInterface: ContextInterface | null | undefined): WorkflowInputSpec[];
92
+ export declare function deriveMethodInputsFromContextInterface(contextInterface: ContextInterface | null | undefined): MethodInputSpec[];
93
93
  export declare function buildContextInterface(stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
94
94
  export declare function writeContextInterfaceFile(rootPath: string, stages: ContextInterfaceStageLike[], label?: string): ContextInterface;
95
95
  export declare function writeContextInterface(rootPath: string, contextInterface: ContextInterface): ContextInterface;
@@ -3,32 +3,32 @@ import { join } from "node:path";
3
3
  import { z } from "zod";
4
4
  import { warnInterf } from "../shared/logger.js";
5
5
  import { readJsonFileUnchecked } from "../shared/parse.js";
6
- import { WorkflowCompiledSchemaSchema, WorkflowCompiledZoneSchema, WorkflowZoneIdSchema, WorkflowZoneRoleSchema, } from "../compiler/lib/schema.js";
7
- import { listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "./builtin-compiled-workflow.js";
8
- // Workflow packages define the context interface. The compiler persists the
6
+ import { MethodCompiledSchemaSchema, MethodCompiledZoneSchema, MethodZoneIdSchema, MethodZoneRoleSchema, } from "../compiler/lib/schema.js";
7
+ import { listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "./builtin-compiled-method.js";
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
- // mean "the workflow-declared shape a compiled context must implement."
11
- export const CONTEXT_INTERFACE_FILE = "workflow.schema.json";
12
- export const ContextInterfaceSchema = WorkflowCompiledSchemaSchema;
13
- export const ContextInterfaceZoneSchema = WorkflowCompiledZoneSchema;
14
- export const ContextInterfaceZoneIdSchema = WorkflowZoneIdSchema;
15
- export const ContextInterfaceZoneRoleSchema = WorkflowZoneRoleSchema;
10
+ // mean "the Method-declared shape a portable context must implement."
11
+ export const CONTEXT_INTERFACE_FILE = "method.schema.json";
12
+ export const ContextInterfaceSchema = MethodCompiledSchemaSchema;
13
+ export const ContextInterfaceZoneSchema = MethodCompiledZoneSchema;
14
+ export const ContextInterfaceZoneIdSchema = MethodZoneIdSchema;
15
+ export const ContextInterfaceZoneRoleSchema = MethodZoneRoleSchema;
16
16
  // Package-owned input contract for authoring, review, and future authoring flows.
17
17
  // This does not change compiler execution semantics; it describes what data a
18
- // workflow expects to organize before the compiler materializes the context
18
+ // Method expects to organize before the compiler materializes the context
19
19
  // interface on disk.
20
- export const WorkflowInputSpecSchema = z.object({
21
- id: WorkflowZoneIdSchema,
20
+ export const MethodInputSpecSchema = z.object({
21
+ id: MethodZoneIdSchema,
22
22
  label: z.string().min(1),
23
23
  description: z.string().min(1),
24
24
  required: z.boolean().default(false),
25
25
  examples: z.array(z.string().min(1)).optional(),
26
26
  }).strict();
27
- export const WorkflowInputContractSchema = z.array(WorkflowInputSpecSchema);
27
+ export const MethodInputContractSchema = z.array(MethodInputSpecSchema);
28
28
  function normalizeContextInterface(contextInterface) {
29
29
  return {
30
30
  ...contextInterface,
31
- kind: "workflow-schema",
31
+ kind: "method-schema",
32
32
  };
33
33
  }
34
34
  function pushContextInterfaceZone(zones, zone) {
@@ -87,7 +87,7 @@ export function summarizeContextInterface(contextInterface) {
87
87
  runtimeZones: contextInterface.zones.filter((zone) => zone.role === "runtime"),
88
88
  };
89
89
  }
90
- export function deriveWorkflowInputsFromContextInterface(contextInterface) {
90
+ export function deriveMethodInputsFromContextInterface(contextInterface) {
91
91
  if (!contextInterface)
92
92
  return [];
93
93
  return contextInterface.zones
@@ -99,7 +99,7 @@ export function deriveWorkflowInputsFromContextInterface(contextInterface) {
99
99
  required: zone.required,
100
100
  }));
101
101
  }
102
- export function buildContextInterface(stages, label = "Workflow context interface") {
102
+ export function buildContextInterface(stages, label = "Method context interface") {
103
103
  const zones = [];
104
104
  for (const zone of listBuiltinCompiledZoneSpecs()) {
105
105
  pushContextInterfaceZone(zones, {
@@ -113,7 +113,7 @@ export function buildContextInterface(stages, label = "Workflow context interfac
113
113
  });
114
114
  }
115
115
  return {
116
- kind: "workflow-schema",
116
+ kind: "method-schema",
117
117
  version: 1,
118
118
  target_type: "compiled",
119
119
  label,
@@ -134,12 +134,12 @@ export function readContextInterface(rootPath) {
134
134
  const path = contextInterfaceFilePath(rootPath);
135
135
  if (!existsSync(path))
136
136
  return null;
137
- const raw = readJsonFileUnchecked(path, "workflow context interface");
137
+ const raw = readJsonFileUnchecked(path, "Method context interface");
138
138
  if (raw === null)
139
139
  return null;
140
140
  const parsed = ContextInterfaceSchema.safeParse(raw);
141
141
  if (!parsed.success) {
142
- warnInterf(`Warning: failed to validate workflow context interface at ${path}: ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
142
+ warnInterf(`Warning: failed to validate Method context interface at ${path}: ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
143
143
  return null;
144
144
  }
145
145
  return normalizeContextInterface(parsed.data);
@@ -0,0 +1,11 @@
1
+ export * as builtinMethod from "./builtin-compiled-method.js";
2
+ export * as contextInterface from "./context-interface.js";
3
+ export * as localMethods from "./local-methods.js";
4
+ export * as packageWriters from "./interf-method-package.js";
5
+ export * as methodDefinitions from "./method-definitions.js";
6
+ export * as methodHelpers from "./method-helpers.js";
7
+ export * as methodStagePolicy from "./method-stage-policy.js";
8
+ export * as methodStageRunner from "./method-stage-runner.js";
9
+ export * as methodReviewPaths from "./method-review-paths.js";
10
+ export * as packageRoot from "./lib/package-root.js";
11
+ export { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, ContextInterfaceZoneSchema, ContextInterfaceZoneIdSchema, ContextInterfaceZoneRoleSchema, MethodInputSpecSchema, MethodInputContractSchema, contextInterfaceFilePath, resolveContextInterfacePath, contextInterfaceExists, contextInterfaceRelativePath, listContextInterfaceZones, findContextInterfaceZone, contextInterfaceZoneAbsolutePath, contextInterfaceArtifactPath, contextInterfaceArtifactPathsForZoneIds, buildContextInterface, writeContextInterfaceFile, writeContextInterface, readContextInterface, type ContextInterface, type ContextInterfaceZone, type ContextInterfaceZoneId, type ContextInterfaceZoneRole, type ContextInterfaceStageLike, type MethodInputSpec, type ContextInterfaceSummary, summarizeContextInterface, deriveMethodInputsFromContextInterface, } from "./context-interface.js";
@@ -0,0 +1,11 @@
1
+ export * as builtinMethod from "./builtin-compiled-method.js";
2
+ export * as contextInterface from "./context-interface.js";
3
+ export * as localMethods from "./local-methods.js";
4
+ export * as packageWriters from "./interf-method-package.js";
5
+ export * as methodDefinitions from "./method-definitions.js";
6
+ export * as methodHelpers from "./method-helpers.js";
7
+ export * as methodStagePolicy from "./method-stage-policy.js";
8
+ export * as methodStageRunner from "./method-stage-runner.js";
9
+ export * as methodReviewPaths from "./method-review-paths.js";
10
+ export * as packageRoot from "./lib/package-root.js";
11
+ export { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, ContextInterfaceZoneSchema, ContextInterfaceZoneIdSchema, ContextInterfaceZoneRoleSchema, MethodInputSpecSchema, MethodInputContractSchema, contextInterfaceFilePath, resolveContextInterfacePath, contextInterfaceExists, contextInterfaceRelativePath, listContextInterfaceZones, findContextInterfaceZone, contextInterfaceZoneAbsolutePath, contextInterfaceArtifactPath, contextInterfaceArtifactPathsForZoneIds, buildContextInterface, writeContextInterfaceFile, writeContextInterface, readContextInterface, summarizeContextInterface, deriveMethodInputsFromContextInterface, } from "./context-interface.js";
@@ -0,0 +1,31 @@
1
+ import { type MethodDefinition } from "./method-definitions.js";
2
+ export declare function writeCompiledMethodPackage(compiledPath: string, method: MethodDefinition<string>): void;
3
+ export declare function writeMethodPackageToDir(methodDir: string, method: MethodDefinition<string>, options?: {
4
+ overwrite?: boolean;
5
+ }): void;
6
+ export declare function seedCompiledMethodPackage(options: {
7
+ compiledPath: string;
8
+ sourcePath: string;
9
+ methodId: string;
10
+ }): void;
11
+ export declare function createLocalMethodPackageFromTemplate(options: {
12
+ sourcePath: string;
13
+ baseMethodId: string;
14
+ methodId: string;
15
+ label: string;
16
+ hint: string;
17
+ stagePolicyNotes: Record<string, string[]>;
18
+ }): string;
19
+ export declare function seedLocalMethodPackageFromBase(options: {
20
+ sourcePath: string;
21
+ baseMethodId: string;
22
+ methodId: string;
23
+ label: string;
24
+ hint: string;
25
+ }): string;
26
+ export declare function createScratchLocalMethodPackage(options: {
27
+ sourcePath: string;
28
+ methodId: string;
29
+ label: string;
30
+ hint: string;
31
+ }): string;