@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 { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { renderCompiledQuerySkill } from "../agents/lib/shells.js";
4
- import { copyWorkflowPackageDirectory, isPortableWorkflowPackage, patchWorkflowPackageMetadata, resolveWorkflowPackageSourcePath, workflowDefinitionPath, } from "./local-workflows.js";
5
- import { getCompiledWorkflow, } from "./workflow-definitions.js";
6
- import { CONTEXT_INTERFACE_FILE, deriveWorkflowInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
7
- import { workflowPackagePathForCompiled } from "../compiler/compiled-paths.js";
8
- import { mergeStagePolicyNotesForStages } from "./workflow-stage-policy.js";
9
- function workflowPackagePath(dirPath) {
10
- return workflowPackagePathForCompiled(dirPath);
4
+ import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, } from "./local-methods.js";
5
+ import { getCompiledMethod, } from "./method-definitions.js";
6
+ import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
7
+ import { methodPackagePathForCompiled } from "../compiler/compiled-paths.js";
8
+ import { mergeStagePolicyNotesForStages } from "./method-stage-policy.js";
9
+ function methodPackagePath(dirPath) {
10
+ return methodPackagePathForCompiled(dirPath);
11
11
  }
12
- function writeWorkflowStarterDocs(dirPath, docs, options) {
12
+ function writeMethodStarterDocs(dirPath, docs, options) {
13
13
  for (const doc of docs ?? []) {
14
14
  const targetPath = join(dirPath, doc.relativePath);
15
15
  if (!options.overwrite && existsSync(targetPath))
@@ -18,32 +18,32 @@ function writeWorkflowStarterDocs(dirPath, docs, options) {
18
18
  writeFileSync(targetPath, doc.content);
19
19
  }
20
20
  }
21
- function writeWorkflowPackageJson(rootPath, workflow, options) {
22
- const targetPath = join(rootPath, "workflow.json");
21
+ function writeMethodPackageJson(rootPath, method, options) {
22
+ const targetPath = join(rootPath, "method.json");
23
23
  if (!options.overwrite && existsSync(targetPath))
24
24
  return;
25
- const inputs = workflow.inputs?.length
26
- ? workflow.inputs
27
- : deriveWorkflowInputsFromContextInterface(workflow.contextInterface ?? workflow.schema);
25
+ const inputs = method.inputs?.length
26
+ ? method.inputs
27
+ : deriveMethodInputsFromContextInterface(method.contextInterface ?? method.schema);
28
28
  writeFileSync(targetPath, `${JSON.stringify({
29
- id: workflow.id,
29
+ id: method.id,
30
30
  type: "compiled",
31
- compiler_api: workflow.compilerApi ?? {
31
+ compiler_api: method.compilerApi ?? {
32
32
  kind: "compiled",
33
33
  version: 1,
34
34
  },
35
- ...(workflow.purpose
35
+ ...(method.purpose
36
36
  ? {
37
37
  purpose: {
38
- label: workflow.purpose.label,
39
- task_hint: workflow.purpose.taskHint,
38
+ label: method.purpose.label,
39
+ task_hint: method.purpose.taskHint,
40
40
  },
41
41
  }
42
42
  : {}),
43
43
  ...(inputs.length > 0 ? { inputs } : {}),
44
- label: workflow.label,
45
- hint: workflow.hint,
46
- stages: workflow.stages.map((stage) => ({
44
+ label: method.label,
45
+ hint: method.hint,
46
+ stages: method.stages.map((stage) => ({
47
47
  id: stage.id,
48
48
  label: stage.label,
49
49
  description: stage.description,
@@ -53,12 +53,12 @@ function writeWorkflowPackageJson(rootPath, workflow, options) {
53
53
  writes: stage.writes,
54
54
  ...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
55
55
  })),
56
- ...(workflow.stagePolicyNotes ? { stage_policy_notes: workflow.stagePolicyNotes } : {}),
56
+ ...(method.stagePolicyNotes ? { stage_policy_notes: method.stagePolicyNotes } : {}),
57
57
  }, null, 2)}\n`);
58
58
  }
59
- function renderWorkflowReadme(workflow) {
60
- const contextInterface = workflow.contextInterface ?? workflow.schema ?? null;
61
- const stageLines = workflow.stages
59
+ function renderMethodReadme(method) {
60
+ const contextInterface = method.contextInterface ?? method.schema ?? null;
61
+ const stageLines = method.stages
62
62
  .map((stage) => `- \`${stage.id}\` — ${stage.description} (${stage.contractType}; reads: ${stage.reads.join(", ")}; writes: ${stage.writes.join(", ")})`)
63
63
  .join("\n");
64
64
  const interfaceSummary = contextInterface
@@ -69,9 +69,9 @@ function renderWorkflowReadme(workflow) {
69
69
  .map((zone) => `- \`${zone.id}\` — ${zone.role} ${zone.kind} at \`${zone.path}\`: ${zone.description}`)
70
70
  .join("\n")
71
71
  : null;
72
- const inputs = workflow.inputs?.length
73
- ? workflow.inputs
74
- : deriveWorkflowInputsFromContextInterface(contextInterface);
72
+ const inputs = method.inputs?.length
73
+ ? method.inputs
74
+ : deriveMethodInputsFromContextInterface(contextInterface);
75
75
  const inputLines = inputs.length > 0
76
76
  ? inputs
77
77
  .map((input) => `- \`${input.id}\` — ${input.label}: ${input.description}${input.required ? " (required)" : ""}${input.examples?.length ? ` Example inputs: ${input.examples.join("; ")}` : ""}`)
@@ -86,16 +86,16 @@ function renderWorkflowReadme(workflow) {
86
86
  ].join("\n")
87
87
  : null;
88
88
  return [
89
- `# ${workflow.label}`,
89
+ `# ${method.label}`,
90
90
  "",
91
- workflow.hint,
92
- ...(workflow.purpose
91
+ method.hint,
92
+ ...(method.purpose
93
93
  ? [
94
94
  "",
95
95
  "## Purpose",
96
96
  "",
97
- `- ${workflow.purpose.label}`,
98
- `- ${workflow.purpose.taskHint}`,
97
+ `- ${method.purpose.label}`,
98
+ `- ${method.purpose.taskHint}`,
99
99
  ]
100
100
  : []),
101
101
  ...(inputLines
@@ -125,11 +125,11 @@ function renderWorkflowReadme(workflow) {
125
125
  "",
126
126
  "## Package",
127
127
  "",
128
- "- `workflow.json` = stage graph, compiler API target, and compile contract mapping",
129
- "- `workflow.schema.json` = deterministic context interface for the workflow package",
128
+ "- `method.json` = stage graph, compiler API target, and compile contract mapping",
129
+ "- `method.schema.json` = deterministic context interface for the Method package",
130
130
  "- `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs",
131
- "- Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder",
132
- "- Interf projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
131
+ "- Portable Method packages are standalone: explicit stages, schema, and docs live together in this folder",
132
+ "- Interf projects native agent shells from these docs for query use, stage execution, and Method-improvement loops",
133
133
  "",
134
134
  "## Stages",
135
135
  "",
@@ -139,14 +139,14 @@ function renderWorkflowReadme(workflow) {
139
139
  "",
140
140
  ].join("\n");
141
141
  }
142
- function renderDerivedWorkflowReadme(options) {
142
+ function renderDerivedMethodReadme(options) {
143
143
  return [
144
144
  `# ${options.label}`,
145
145
  "",
146
146
  options.hint,
147
147
  "",
148
- `This workflow package was forked from \`${options.baseWorkflowId}\` and materialized as a standalone package for this kind of work.`,
149
- "It starts with that workflow's topology; edit the package when the work needs different stages, zones, or proof.",
148
+ `This Method package was forked from \`${options.baseMethodId}\` and materialized as a standalone package for this kind of agent work.`,
149
+ "It starts with that Method's topology; edit the package when the agent work needs different stages, zones, or proof.",
150
150
  "",
151
151
  "Interf runs the local copy of this package directly. Keep purpose, inputs, context interface, and stage docs self-contained in this folder instead of relying on runtime inheritance.",
152
152
  "",
@@ -158,58 +158,58 @@ function renderDerivedWorkflowReadme(options) {
158
158
  "",
159
159
  ].join("\n");
160
160
  }
161
- function renderSeedWorkflowReadme(options) {
161
+ function renderSeedMethodReadme(options) {
162
162
  return [
163
163
  `# ${options.label}`,
164
164
  "",
165
165
  options.hint,
166
166
  "",
167
- `This workflow package was forked from \`${options.baseWorkflowId}\` as a standalone local package.`,
168
- "It starts with that workflow's topology; edit the package when the work needs different stages, zones, or proof.",
167
+ `This Method package was forked from \`${options.baseMethodId}\` as a standalone local package.`,
168
+ "It starts with that Method's topology; edit the package when the agent work needs different stages, zones, or proof.",
169
169
  "",
170
170
  "Interf runs the local copy of this package directly. Refine purpose, inputs, context interface, and stage instructions in this folder instead of relying on inheritance.",
171
171
  "",
172
172
  ].join("\n");
173
173
  }
174
- function renderScratchWorkflowReadme(options) {
174
+ function renderScratchMethodReadme(options) {
175
175
  return [
176
176
  `# ${options.label}`,
177
177
  "",
178
178
  options.hint,
179
179
  "",
180
- "This workflow package is a neutral from-scratch authoring scaffold.",
180
+ "This Method package is a neutral from-scratch authoring scaffold.",
181
181
  "",
182
182
  "It is not copied from `interf-default`, and its placeholder stage is not a recommended topology.",
183
- "Replace purpose, inputs, context interface, stages, stage docs, proof rules, and query guidance with the workflow this source data and task actually need.",
183
+ "Replace purpose, inputs, context interface, stages, stage docs, proof rules, and query guidance with the Method this source data and task actually need.",
184
184
  "",
185
185
  ].join("\n");
186
186
  }
187
- function renderImproveSkill(workflow) {
187
+ function renderImproveSkill(method) {
188
188
  return [
189
- "# Workflow Improvement",
189
+ "# Method Improvement",
190
190
  "",
191
- `Workflow: ${workflow.id}`,
191
+ `Method: ${method.id}`,
192
192
  "",
193
- "This file is the editable authoring source for Interf's generated native workflow-improver shell.",
193
+ "This file is the editable authoring source for Interf's generated native Method-improver shell.",
194
194
  "The improver edits this local package directly.",
195
195
  "",
196
196
  "Default loop:",
197
197
  "1. Read the loop context first.",
198
198
  "2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.",
199
- "3. Edit only the local Method package for this portable context to create a better Method variation for this kind of work.",
200
- `4. Keep purpose, inputs, \`workflow.json\`, \`${CONTEXT_INTERFACE_FILE}\`, and any changed stage docs aligned.`,
199
+ "3. Edit only the local Method package for this portable context to create a better Method variation for this kind of agent work.",
200
+ `4. Keep purpose, inputs, \`method.json\`, \`${CONTEXT_INTERFACE_FILE}\`, and any changed stage docs aligned.`,
201
201
  "",
202
202
  "Guardrails:",
203
203
  "- do not edit checks, test specs, or raw files",
204
- "- do not hardcode expected answers into workflow docs",
205
- "- keep this package standalone; do not add or rely on runtime `extends`",
206
- "- keep the workflow stack coherent: purpose, inputs, context interface, and stages should describe the same job",
207
- "- prefer small, defensible workflow changes over random churn",
204
+ "- do not hardcode expected answers into Method docs",
205
+ "- keep this package standalone; do not rely on runtime inheritance",
206
+ "- keep the Method stack coherent: purpose, inputs, context interface, and stages should describe the same job",
207
+ "- prefer small, defensible Method changes over random churn",
208
208
  "",
209
209
  ].join("\n");
210
210
  }
211
- function renderStageSkill(workflow, stage) {
212
- const notes = workflow.stagePolicyNotes?.[stage.id] ?? [];
211
+ function renderStageSkill(method, stage) {
212
+ const notes = method.stagePolicyNotes?.[stage.id] ?? [];
213
213
  const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
214
214
  const abstractRules = stage.contractType === "compiled-file-evidence"
215
215
  ? [
@@ -232,11 +232,11 @@ function renderStageSkill(workflow, stage) {
232
232
  "",
233
233
  "## Requirements",
234
234
  "",
235
- "- Treat `workflow.json` and `workflow.schema.json` as the authoritative package contract for this stage.",
235
+ "- Treat `method.json` and `method.schema.json` as the authoritative package contract for this stage.",
236
236
  "- Read only from the declared input zones unless this package explicitly documents a broader method.",
237
237
  "- Write only inside the declared output zones for this stage. Do not invent undeclared zones or implicit outputs.",
238
- "- Keep stage instructions, zone ownership, and workflow-level acceptance aligned when you change this stage.",
239
- "- Treat runtime files as proof and execution state, not as the source of truth for workflow behavior.",
238
+ "- Keep stage instructions, zone ownership, and Method-level acceptance aligned when you change this stage.",
239
+ "- Treat runtime files as proof and execution state, not as the source of truth for Method behavior.",
240
240
  "- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
241
241
  ...abstractRules,
242
242
  "",
@@ -258,95 +258,95 @@ function renderStageSkill(workflow, stage) {
258
258
  : []),
259
259
  ].join("\n");
260
260
  }
261
- export function writeCompiledWorkflowPackage(compiledPath, workflow) {
262
- writeWorkflowPackageToDir(workflowPackagePath(compiledPath), workflow);
261
+ export function writeCompiledMethodPackage(compiledPath, method) {
262
+ writeMethodPackageToDir(methodPackagePath(compiledPath), method);
263
263
  }
264
- export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
264
+ export function writeMethodPackageToDir(methodDir, method, options = {}) {
265
265
  const overwrite = options.overwrite ?? true;
266
- mkdirSync(join(workflowDir, "improve"), { recursive: true });
267
- mkdirSync(join(workflowDir, "use", "query"), { recursive: true });
268
- mkdirSync(join(workflowDir, "compile", "stages"), { recursive: true });
269
- for (const stage of workflow.stages) {
270
- mkdirSync(join(workflowDir, "compile", "stages", stage.skillDir), { recursive: true });
266
+ mkdirSync(join(methodDir, "improve"), { recursive: true });
267
+ mkdirSync(join(methodDir, "use", "query"), { recursive: true });
268
+ mkdirSync(join(methodDir, "compile", "stages"), { recursive: true });
269
+ for (const stage of method.stages) {
270
+ mkdirSync(join(methodDir, "compile", "stages", stage.skillDir), { recursive: true });
271
271
  }
272
- writeWorkflowPackageJson(workflowDir, workflow, { overwrite });
273
- if (overwrite || !existsSync(join(workflowDir, CONTEXT_INTERFACE_FILE))) {
274
- const contextInterface = workflow.contextInterface ?? workflow.schema;
272
+ writeMethodPackageJson(methodDir, method, { overwrite });
273
+ if (overwrite || !existsSync(join(methodDir, CONTEXT_INTERFACE_FILE))) {
274
+ const contextInterface = method.contextInterface ?? method.schema;
275
275
  if (contextInterface) {
276
- writeContextInterface(workflowDir, {
276
+ writeContextInterface(methodDir, {
277
277
  ...contextInterface,
278
- label: contextInterface.label || `${workflow.label} workflow schema`,
278
+ label: contextInterface.label || `${method.label} Method schema`,
279
279
  });
280
280
  }
281
281
  else {
282
- writeContextInterfaceFile(workflowDir, workflow.stages, `${workflow.label} workflow schema`);
282
+ writeContextInterfaceFile(methodDir, method.stages, `${method.label} Method schema`);
283
283
  }
284
284
  }
285
- if (overwrite || !existsSync(join(workflowDir, "README.md"))) {
286
- writeFileSync(join(workflowDir, "README.md"), renderWorkflowReadme(workflow));
285
+ if (overwrite || !existsSync(join(methodDir, "README.md"))) {
286
+ writeFileSync(join(methodDir, "README.md"), renderMethodReadme(method));
287
287
  }
288
- if (overwrite || !existsSync(join(workflowDir, "improve", "SKILL.md"))) {
289
- writeFileSync(join(workflowDir, "improve", "SKILL.md"), renderImproveSkill(workflow));
288
+ if (overwrite || !existsSync(join(methodDir, "improve", "SKILL.md"))) {
289
+ writeFileSync(join(methodDir, "improve", "SKILL.md"), renderImproveSkill(method));
290
290
  }
291
- if (overwrite || !existsSync(join(workflowDir, "use", "query", "SKILL.md"))) {
292
- writeFileSync(join(workflowDir, "use", "query", "SKILL.md"), renderCompiledQuerySkill());
291
+ if (overwrite || !existsSync(join(methodDir, "use", "query", "SKILL.md"))) {
292
+ writeFileSync(join(methodDir, "use", "query", "SKILL.md"), renderCompiledQuerySkill());
293
293
  }
294
- for (const stage of workflow.stages) {
295
- const targetPath = join(workflowDir, "compile", "stages", stage.skillDir, "SKILL.md");
294
+ for (const stage of method.stages) {
295
+ const targetPath = join(methodDir, "compile", "stages", stage.skillDir, "SKILL.md");
296
296
  if (overwrite || !existsSync(targetPath)) {
297
- writeFileSync(targetPath, renderStageSkill(workflow, stage));
297
+ writeFileSync(targetPath, renderStageSkill(method, stage));
298
298
  }
299
299
  }
300
- writeWorkflowStarterDocs(workflowDir, workflow.starterDocs, { overwrite });
300
+ writeMethodStarterDocs(methodDir, method.starterDocs, { overwrite });
301
301
  }
302
- export function seedCompiledWorkflowPackage(options) {
303
- const resolvedWorkflow = getCompiledWorkflow(options.workflowId, {
302
+ export function seedCompiledMethodPackage(options) {
303
+ const resolvedMethod = getCompiledMethod(options.methodId, {
304
304
  sourcePath: options.sourcePath,
305
305
  });
306
- const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, resolvedWorkflow.id);
307
- if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
306
+ const sourceMethodPath = resolveMethodPackageSourcePath(options.sourcePath, resolvedMethod.id);
307
+ if (sourceMethodPath && isPortableMethodPackage(sourceMethodPath)) {
308
308
  // Portable seed packages can be copied directly because compile runs the
309
- // local package folder without reading source-root workflow packages.
310
- copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.compiledPath));
311
- patchWorkflowPackageMetadata(workflowPackagePath(options.compiledPath), {
312
- id: resolvedWorkflow.id,
313
- inputs: resolvedWorkflow.inputs,
314
- label: resolvedWorkflow.label,
315
- hint: resolvedWorkflow.hint,
316
- stagePolicyNotes: resolvedWorkflow.stagePolicyNotes,
309
+ // local package folder without reading source-root Method packages.
310
+ copyMethodPackageDirectory(sourceMethodPath, methodPackagePath(options.compiledPath));
311
+ patchMethodPackageMetadata(methodPackagePath(options.compiledPath), {
312
+ id: resolvedMethod.id,
313
+ inputs: resolvedMethod.inputs,
314
+ label: resolvedMethod.label,
315
+ hint: resolvedMethod.hint,
316
+ stagePolicyNotes: resolvedMethod.stagePolicyNotes,
317
317
  });
318
- if (resolvedWorkflow.scope === "builtin") {
319
- writeFileSync(join(workflowPackagePath(options.compiledPath), "README.md"), renderWorkflowReadme(resolvedWorkflow));
318
+ if (resolvedMethod.scope === "builtin") {
319
+ writeFileSync(join(methodPackagePath(options.compiledPath), "README.md"), renderMethodReadme(resolvedMethod));
320
320
  }
321
321
  return;
322
322
  }
323
323
  // Legacy or partially-defined seed packages are resolved once and
324
324
  // materialized into a standalone local package.
325
- writeCompiledWorkflowPackage(options.compiledPath, resolvedWorkflow);
325
+ writeCompiledMethodPackage(options.compiledPath, resolvedMethod);
326
326
  }
327
- export function createLocalWorkflowPackageFromTemplate(options) {
328
- const targetPath = seedLocalWorkflowPackageFromBase({
327
+ export function createLocalMethodPackageFromTemplate(options) {
328
+ const targetPath = seedLocalMethodPackageFromBase({
329
329
  sourcePath: options.sourcePath,
330
- baseWorkflowId: options.baseWorkflowId,
331
- workflowId: options.workflowId,
330
+ baseMethodId: options.baseMethodId,
331
+ methodId: options.methodId,
332
332
  label: options.label,
333
333
  hint: options.hint,
334
334
  });
335
- const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
335
+ const baseMethod = getCompiledMethod(options.baseMethodId, {
336
336
  sourcePath: options.sourcePath,
337
337
  });
338
- const stagePolicyNotes = mergeStagePolicyNotesForStages(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, options.stagePolicyNotes);
339
- patchWorkflowPackageMetadata(targetPath, {
340
- id: options.workflowId,
338
+ const stagePolicyNotes = mergeStagePolicyNotesForStages(baseMethod.stages, baseMethod.stagePolicyNotes, options.stagePolicyNotes);
339
+ patchMethodPackageMetadata(targetPath, {
340
+ id: options.methodId,
341
341
  label: options.label,
342
342
  hint: options.hint,
343
343
  stagePolicyNotes,
344
344
  });
345
- writeFileSync(join(targetPath, "README.md"), renderDerivedWorkflowReadme({
345
+ writeFileSync(join(targetPath, "README.md"), renderDerivedMethodReadme({
346
346
  label: options.label,
347
347
  hint: options.hint,
348
- baseWorkflowId: options.baseWorkflowId,
349
- emphasis: baseWorkflow.stages
348
+ baseMethodId: options.baseMethodId,
349
+ emphasis: baseMethod.stages
350
350
  .map((stage) => ({
351
351
  stageId: stage.id,
352
352
  label: stage.label,
@@ -356,33 +356,33 @@ export function createLocalWorkflowPackageFromTemplate(options) {
356
356
  }));
357
357
  return targetPath;
358
358
  }
359
- export function seedLocalWorkflowPackageFromBase(options) {
360
- const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
359
+ export function seedLocalMethodPackageFromBase(options) {
360
+ const baseMethod = getCompiledMethod(options.baseMethodId, {
361
361
  sourcePath: options.sourcePath,
362
362
  });
363
- const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, options.baseWorkflowId);
364
- const targetPath = workflowDefinitionPath(options.sourcePath, options.workflowId);
365
- if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
363
+ const sourceMethodPath = resolveMethodPackageSourcePath(options.sourcePath, options.baseMethodId);
364
+ const targetPath = methodDefinitionPath(options.sourcePath, options.methodId);
365
+ if (sourceMethodPath && isPortableMethodPackage(sourceMethodPath)) {
366
366
  // Copy directly when the base package is already portable and standalone.
367
- copyWorkflowPackageDirectory(sourceWorkflowPath, targetPath);
368
- patchWorkflowPackageMetadata(targetPath, {
369
- id: options.workflowId,
370
- inputs: baseWorkflow.inputs,
367
+ copyMethodPackageDirectory(sourceMethodPath, targetPath);
368
+ patchMethodPackageMetadata(targetPath, {
369
+ id: options.methodId,
370
+ inputs: baseMethod.inputs,
371
371
  label: options.label,
372
372
  hint: options.hint,
373
373
  });
374
- writeFileSync(join(targetPath, "README.md"), renderSeedWorkflowReadme({
374
+ writeFileSync(join(targetPath, "README.md"), renderSeedMethodReadme({
375
375
  label: options.label,
376
376
  hint: options.hint,
377
- baseWorkflowId: options.baseWorkflowId,
377
+ baseMethodId: options.baseMethodId,
378
378
  }));
379
379
  return targetPath;
380
380
  }
381
- // Legacy or inherited base packages are materialized immediately so the new
382
- // local workflow package is standalone from its first write.
383
- const localWorkflow = {
384
- ...baseWorkflow,
385
- id: options.workflowId,
381
+ // Base packages are materialized immediately so the new local Method package
382
+ // is standalone from its first write.
383
+ const localMethod = {
384
+ ...baseMethod,
385
+ id: options.methodId,
386
386
  label: options.label,
387
387
  hint: options.hint,
388
388
  recommended: false,
@@ -390,29 +390,29 @@ export function seedLocalWorkflowPackageFromBase(options) {
390
390
  starterDocs: [
391
391
  {
392
392
  relativePath: "README.md",
393
- content: renderSeedWorkflowReadme({
393
+ content: renderSeedMethodReadme({
394
394
  label: options.label,
395
395
  hint: options.hint,
396
- baseWorkflowId: options.baseWorkflowId,
396
+ baseMethodId: options.baseMethodId,
397
397
  }),
398
398
  },
399
- ...(baseWorkflow.starterDocs ?? []).filter((doc) => doc.relativePath !== "README.md"),
399
+ ...(baseMethod.starterDocs ?? []).filter((doc) => doc.relativePath !== "README.md"),
400
400
  ],
401
401
  };
402
- writeWorkflowPackageToDir(targetPath, localWorkflow);
402
+ writeMethodPackageToDir(targetPath, localMethod);
403
403
  return targetPath;
404
404
  }
405
- export function createScratchLocalWorkflowPackage(options) {
406
- const targetPath = workflowDefinitionPath(options.sourcePath, options.workflowId);
407
- const workflow = {
408
- id: options.workflowId,
405
+ export function createScratchLocalMethodPackage(options) {
406
+ const targetPath = methodDefinitionPath(options.sourcePath, options.methodId);
407
+ const method = {
408
+ id: options.methodId,
409
409
  compilerApi: {
410
410
  kind: "compiled",
411
411
  version: 1,
412
412
  },
413
413
  purpose: {
414
- label: "From-scratch workflow draft",
415
- taskHint: "Replace this neutral scaffold with the workflow stages, outputs, and proof rules this work requires.",
414
+ label: "From-scratch Method draft",
415
+ taskHint: "Replace this neutral scaffold with the Method stages, outputs, and proof rules this agent work requires.",
416
416
  },
417
417
  inputs: [
418
418
  {
@@ -427,10 +427,10 @@ export function createScratchLocalWorkflowPackage(options) {
427
427
  recommended: false,
428
428
  scope: "local",
429
429
  contextInterface: {
430
- kind: "workflow-schema",
430
+ kind: "method-schema",
431
431
  version: 1,
432
432
  target_type: "compiled",
433
- label: `${options.label} workflow schema`,
433
+ label: `${options.label} Method schema`,
434
434
  zones: [
435
435
  {
436
436
  id: "raw",
@@ -465,8 +465,8 @@ export function createScratchLocalWorkflowPackage(options) {
465
465
  {
466
466
  id: "prepare",
467
467
  label: "Prepare",
468
- description: "Neutral placeholder stage for workflow authoring. Replace this stage with the topology this work needs.",
469
- contractType: "workflow-draft-stage",
468
+ description: "Neutral placeholder stage for Method authoring. Replace this stage with the topology this agent work needs.",
469
+ contractType: "method-draft-stage",
470
470
  skillDir: "prepare",
471
471
  reads: ["raw", "runtime"],
472
472
  writes: ["draft-context"],
@@ -477,20 +477,20 @@ export function createScratchLocalWorkflowPackage(options) {
477
477
  ],
478
478
  stagePolicyNotes: {
479
479
  prepare: [
480
- "This is a neutral authoring scaffold, not a recommended workflow topology.",
481
- "Replace this stage, output zone, and proof rule when drafting the final workflow.",
480
+ "This is a neutral authoring scaffold, not a recommended method topology.",
481
+ "Replace this stage, output zone, and proof rule when drafting the final method.",
482
482
  ],
483
483
  },
484
484
  starterDocs: [
485
485
  {
486
486
  relativePath: "README.md",
487
- content: renderScratchWorkflowReadme({
487
+ content: renderScratchMethodReadme({
488
488
  label: options.label,
489
489
  hint: options.hint,
490
490
  }),
491
491
  },
492
492
  ],
493
493
  };
494
- writeWorkflowPackageToDir(targetPath, workflow);
494
+ writeMethodPackageToDir(targetPath, method);
495
495
  return targetPath;
496
496
  }
@@ -2,5 +2,5 @@ import { dirname, join } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  const __filename = fileURLToPath(import.meta.url);
4
4
  const __dirname = dirname(__filename);
5
- // Package root (dist/packages/workflow-package/lib/ -> package root)
5
+ // Package root (dist/packages/method-package/lib/ -> package root)
6
6
  export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..");
@@ -0,0 +1,64 @@
1
+ import { z } from "zod";
2
+ import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } from "../compiler/lib/schema.js";
3
+ import { RuntimeContractTypeSchema } from "../contracts/lib/schema.js";
4
+ import { MethodInputSpecSchema, type ContextInterface, type MethodInputSpec } from "./context-interface.js";
5
+ export interface LocalMethodStarterDoc {
6
+ relativePath: string;
7
+ content: string;
8
+ }
9
+ export interface LocalMethodStageDefinition {
10
+ id: string;
11
+ label: string;
12
+ contract_type: z.infer<typeof RuntimeContractTypeSchema>;
13
+ skill_dir?: string;
14
+ description?: string;
15
+ reads: z.infer<typeof MethodStageZoneAccessSchema>;
16
+ writes: z.infer<typeof MethodStageZoneAccessSchema>;
17
+ acceptance?: z.infer<typeof RuntimeStageAcceptanceSchema>;
18
+ }
19
+ export interface LocalMethodDefinition {
20
+ id: string;
21
+ type: "compiled";
22
+ compiler_api?: z.infer<typeof MethodCompilerApiSchema>;
23
+ purpose?: z.infer<typeof MethodPurposeSchema>;
24
+ inputs?: Array<z.infer<typeof MethodInputSpecSchema>>;
25
+ label: string;
26
+ hint: string;
27
+ stages?: LocalMethodStageDefinition[];
28
+ stage_policy_notes?: Record<string, string[]>;
29
+ method_schema: ContextInterface;
30
+ starter_docs: LocalMethodStarterDoc[];
31
+ directoryPath: string;
32
+ methodPath: string;
33
+ methodSchemaPath: string;
34
+ }
35
+ export declare function methodDefinitionPath(sourcePath: string, id: string): string;
36
+ export declare function loadMethodDefinitionFromDir(dirPath: string): LocalMethodDefinition | null;
37
+ export declare function listLocalMethodDefinitions(sourcePath: string): LocalMethodDefinition[];
38
+ export declare function loadLocalMethodDefinition(sourcePath: string, id: string): LocalMethodDefinition | null;
39
+ export declare function resolveMethodPackageSourcePath(sourcePath: string, methodId: string): string | null;
40
+ export declare function seedLocalDefaultMethod(options: {
41
+ sourcePath: string;
42
+ }): {
43
+ methodId: string;
44
+ targetPath: string;
45
+ alreadyExisted: boolean;
46
+ };
47
+ export declare function isMethodId(value: string): boolean;
48
+ export declare function patchMethodPackageMetadata(dirPath: string, options?: {
49
+ id?: string;
50
+ inputs?: MethodInputSpec[];
51
+ label?: string;
52
+ hint?: string;
53
+ stagePolicyNotes?: Record<string, string[]>;
54
+ }): void;
55
+ export declare function describeMethodPackagePortability(dirPath: string): string[];
56
+ export declare function isPortableMethodPackage(dirPath: string): boolean;
57
+ export declare function copyMethodPackageDirectory(sourceMethodPath: string, targetMethodPath: string): void;
58
+ export interface MethodValidationResult {
59
+ ok: boolean;
60
+ summary: string;
61
+ errors: string[];
62
+ counts: Record<string, number>;
63
+ }
64
+ export declare function validateMethodPackage(dirPath: string): MethodValidationResult;