@interf/compiler 0.13.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/LICENSE.md +1 -0
  2. package/README.md +50 -7
  3. package/TRADEMARKS.md +4 -4
  4. package/agent-skills/interf-actions/SKILL.md +51 -5
  5. package/agent-skills/interf-actions/references/cli.md +82 -82
  6. package/builtin-methods/interf-default/README.md +6 -7
  7. package/builtin-methods/interf-default/method.json +7 -68
  8. package/builtin-methods/interf-default/method.schema.json +52 -50
  9. package/dist/cli/commands/agents.d.ts +2 -0
  10. package/dist/cli/commands/agents.js +213 -0
  11. package/dist/cli/commands/compile.js +10 -1
  12. package/dist/cli/commands/doctor.js +1 -1
  13. package/dist/cli/commands/login.js +1 -1
  14. package/dist/cli/commands/logout.js +1 -1
  15. package/dist/cli/commands/mcp.d.ts +42 -0
  16. package/dist/cli/commands/mcp.js +239 -0
  17. package/dist/cli/commands/method.js +1 -1
  18. package/dist/cli/commands/prep.js +81 -7
  19. package/dist/cli/commands/reset.js +1 -1
  20. package/dist/cli/commands/runs.js +1 -1
  21. package/dist/cli/commands/status.js +1 -1
  22. package/dist/cli/commands/verify.d.ts +10 -0
  23. package/dist/cli/commands/{test.js → verify.js} +30 -15
  24. package/dist/cli/commands/web.js +71 -18
  25. package/dist/cli/commands/wizard.js +462 -107
  26. package/dist/cli/index.d.ts +4 -2
  27. package/dist/cli/index.js +7 -3
  28. package/dist/compiler-ui/404.html +1 -1
  29. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  30. package/dist/compiler-ui/__next._full.txt +3 -3
  31. package/dist/compiler-ui/__next._head.txt +1 -1
  32. package/dist/compiler-ui/__next._index.txt +2 -2
  33. package/dist/compiler-ui/__next._tree.txt +2 -2
  34. package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
  35. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
  36. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  37. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  38. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  39. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  40. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  41. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  42. package/dist/compiler-ui/_not-found.html +1 -1
  43. package/dist/compiler-ui/_not-found.txt +2 -2
  44. package/dist/compiler-ui/index.html +1 -1
  45. package/dist/compiler-ui/index.txt +3 -3
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.js +2 -2
  48. package/dist/packages/contracts/index.d.ts +2 -1
  49. package/dist/packages/contracts/index.js +1 -0
  50. package/dist/packages/contracts/lib/schema.d.ts +324 -31
  51. package/dist/packages/contracts/lib/schema.js +281 -21
  52. package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
  53. package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
  54. package/dist/packages/{local-service → engine}/action-planner.js +1 -1
  55. package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
  56. package/dist/packages/{agents → engine/agents}/index.js +3 -0
  57. package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
  58. package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
  59. package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
  60. package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
  61. package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
  62. package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
  63. package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
  64. package/dist/packages/engine/agents/registry.d.ts +91 -0
  65. package/dist/packages/engine/agents/registry.js +321 -0
  66. package/dist/packages/engine/agents/role-executors.d.ts +35 -0
  67. package/dist/packages/engine/agents/role-executors.js +88 -0
  68. package/dist/packages/engine/agents/role-router.d.ts +66 -0
  69. package/dist/packages/engine/agents/role-router.js +73 -0
  70. package/dist/packages/{local-service → engine}/client.d.ts +9 -9
  71. package/dist/packages/{local-service → engine}/client.js +11 -11
  72. package/dist/packages/engine/cloud-seams.d.ts +115 -0
  73. package/dist/packages/engine/cloud-seams.js +84 -0
  74. package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
  75. package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
  76. package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
  77. package/dist/packages/engine/compile/artifact-status.js +166 -0
  78. package/dist/packages/engine/compile/billing-events.d.ts +89 -0
  79. package/dist/packages/engine/compile/billing-events.js +74 -0
  80. package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
  81. package/dist/packages/engine/compile/check-evaluator.js +298 -0
  82. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
  83. package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
  84. package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
  85. package/dist/packages/engine/compile/compiled-schema.js +126 -0
  86. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
  87. package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
  88. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
  89. package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
  90. package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
  91. package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
  92. package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
  93. package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
  94. package/dist/packages/{compiler → engine/compile}/index.js +0 -1
  95. package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
  96. package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
  97. package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
  98. package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
  99. package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
  100. package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
  101. package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
  102. package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
  103. package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
  104. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
  105. package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
  106. package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
  107. package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
  108. package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
  109. package/dist/packages/engine/compile/runtime.d.ts +5 -0
  110. package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
  111. package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
  112. package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
  113. package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
  114. package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
  115. package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
  116. package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
  117. package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
  118. package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
  119. package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
  120. package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
  121. package/dist/packages/engine/index.d.ts +22 -0
  122. package/dist/packages/engine/index.js +15 -0
  123. package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
  124. package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
  125. package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
  126. package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
  127. package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
  128. package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
  129. package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
  130. package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
  131. package/dist/packages/{local-service → engine}/routes.js +38 -1
  132. package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
  133. package/dist/packages/{local-service → engine}/run-observability.js +15 -15
  134. package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
  135. package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
  136. package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
  137. package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
  138. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
  139. package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
  140. package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
  141. package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
  142. package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
  143. package/dist/packages/{local-service → engine}/runtime.js +333 -205
  144. package/dist/packages/{local-service → engine}/server.d.ts +25 -0
  145. package/dist/packages/{local-service → engine}/server.js +338 -17
  146. package/dist/packages/engine/verify/index.d.ts +13 -0
  147. package/dist/packages/engine/verify/index.js +10 -0
  148. package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
  149. package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
  150. package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
  151. package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
  152. package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
  153. package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
  154. package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
  155. package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
  156. package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
  157. package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
  158. package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
  159. package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
  160. package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
  161. package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
  162. package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
  163. package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
  164. package/dist/packages/engine/wire-schemas.d.ts +545 -0
  165. package/dist/packages/engine/wire-schemas.js +59 -0
  166. package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
  167. package/dist/packages/methods/authoring/method-authoring.js +260 -0
  168. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
  169. package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
  170. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
  171. package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
  172. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
  173. package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
  174. package/dist/packages/methods/package/context-interface.d.ts +73 -0
  175. package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
  176. package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
  177. package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
  178. package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
  179. package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
  180. package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
  181. package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
  182. package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
  183. package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
  184. package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
  185. package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
  186. package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
  187. package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
  188. package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
  189. package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
  190. package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
  191. package/dist/packages/{project-model → project}/interf-detect.js +4 -4
  192. package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
  193. package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
  194. package/dist/packages/{project-model → project}/lib/schema.js +1 -1
  195. package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
  196. package/dist/packages/{project-model → project}/source-config.js +9 -8
  197. package/dist/packages/{project-model → project}/source-folders.js +2 -2
  198. package/package.json +7 -16
  199. package/dist/cli/commands/test.d.ts +0 -9
  200. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
  201. package/dist/packages/agents/lib/detection.d.ts +0 -7
  202. package/dist/packages/compiler/artifact-counts.d.ts +0 -1
  203. package/dist/packages/compiler/compiled-schema.d.ts +0 -31
  204. package/dist/packages/compiler/compiled-schema.js +0 -141
  205. package/dist/packages/compiler/method-primitives.d.ts +0 -2
  206. package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
  207. package/dist/packages/compiler/runtime-acceptance.js +0 -262
  208. package/dist/packages/compiler/runtime.d.ts +0 -6
  209. package/dist/packages/local-service/index.d.ts +0 -22
  210. package/dist/packages/local-service/index.js +0 -15
  211. package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
  212. package/dist/packages/method-authoring/method-authoring.js +0 -116
  213. package/dist/packages/method-package/context-interface.d.ts +0 -60
  214. package/dist/packages/testing/index.d.ts +0 -13
  215. package/dist/packages/testing/index.js +0 -10
  216. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
  217. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
  218. /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
  219. /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
  220. /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
  221. /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
  222. /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
  223. /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
  224. /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
  225. /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
  226. /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
  227. /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
  228. /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
  229. /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
  230. /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
  231. /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
  232. /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
  233. /package/dist/packages/{local-service → engine}/action-values.js +0 -0
  234. /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
  235. /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
  236. /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
  237. /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
  238. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
  239. /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
  240. /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
  241. /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
  242. /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
  243. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
  244. /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
  245. /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
  246. /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
  247. /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
  248. /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
  249. /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
  250. /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
  251. /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
  252. /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
  253. /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
  254. /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
  255. /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
  256. /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
  257. /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
  258. /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
  259. /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
  260. /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
  261. /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
  262. /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
  263. /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
  264. /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
  265. /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
  266. /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
  267. /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
  268. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
  269. /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
  270. /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
  271. /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
  272. /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
  273. /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
  274. /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
  275. /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
  276. /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
  277. /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
  278. /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
  279. /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
  280. /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
  281. /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
  282. /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
  283. /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
  284. /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
  285. /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
  286. /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
  287. /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
  288. /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
  289. /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
  290. /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
  291. /package/dist/packages/{execution → engine/execution}/events.js +0 -0
  292. /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
  293. /package/dist/packages/{execution → engine/execution}/index.js +0 -0
  294. /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
  295. /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
  296. /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
  297. /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
  298. /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
  299. /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
  300. /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
  301. /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
  302. /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
  303. /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
  304. /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
  305. /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
  306. /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
  307. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
  308. /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
  309. /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
  310. /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
  311. /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
  312. /package/dist/packages/{project-model → project}/index.d.ts +0 -0
  313. /package/dist/packages/{project-model → project}/index.js +0 -0
  314. /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
  315. /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
  316. /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
  317. /package/dist/packages/{project-model → project}/interf.js +0 -0
  318. /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
  319. /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
  320. /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  import { basename } from "node:path";
2
- import { readInterfConfig, resolveSourceFolderPath, } from "../project-model/interf-detect.js";
2
+ import { readInterfConfig, resolveSourceFolderPath, } from "../../project/interf-detect.js";
3
3
  import { discoverSourceFiles } from "./discovery.js";
4
4
  import { loadRuntimeRun } from "./runtime.js";
5
5
  import { loadState } from "./state-io.js";
6
6
  import { validateCompiled, validateCompiledStage, validateCompiledMethod, } from "./validate.js";
7
- import { readCompiledSchemaFile } from "./compiled-schema.js";
7
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
8
8
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
9
- import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
10
- import { countCompiledZoneArtifacts } from "./artifact-counts.js";
9
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
10
+ import { countCompiledArtifactsAtPath } from "./artifact-counts.js";
11
11
  export function computeCompiledHealth(dirPath) {
12
12
  const now = new Date().toISOString();
13
13
  const config = readInterfConfig(dirPath);
@@ -37,9 +37,9 @@ export function computeCompiledHealth(dirPath) {
37
37
  const firstFailed = stageResults.find((entry) => !entry.validation.ok) ?? null;
38
38
  const methodValidation = validateCompiledMethod(dirPath);
39
39
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
40
- const zoneMetrics = Object.fromEntries((schema?.zones ?? []).map((zone) => [
41
- `zone_${zone.id}`,
42
- countCompiledZoneArtifacts(dirPath, zone.path, zone.kind),
40
+ const artifactMetrics = Object.fromEntries((schema ? listCompiledSchemaArtifacts(schema) : []).map((artifact) => [
41
+ `artifact_${artifact.id}`,
42
+ countCompiledArtifactsAtPath(dirPath, artifact.path, artifact.kind),
43
43
  ]));
44
44
  let status = "idle";
45
45
  let stage = "idle";
@@ -98,7 +98,7 @@ export function computeCompiledHealth(dirPath) {
98
98
  completed_stages: completedStages,
99
99
  warnings: state?.warning_count ?? 0,
100
100
  errors: (state?.error_count ?? 0) + errors,
101
- ...zoneMetrics,
101
+ ...artifactMetrics,
102
102
  },
103
103
  checks,
104
104
  };
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
2
- import { warnInterf } from "../shared/logger.js";
3
- import { readJsonFileUnchecked, readJsonFileWithSchema } from "../shared/parse.js";
2
+ import { warnInterf } from "../../contracts/utils/logger.js";
3
+ import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
4
4
  import { CompiledHealthSchema, CompiledStateSchema, CompiledViewSpecSchema, SourceFilesSchema, SourceSnapshotSchema, } from "./lib/schema.js";
5
5
  import { emptyCompiledInventory, } from "./runtime-inventory.js";
6
6
  import { healthPath, sourceFilesPath, sourceSnapshotPath, statePath, viewSpecPath, } from "./state-paths.js";
@@ -1,9 +1,9 @@
1
1
  import { basename } from "node:path";
2
- import { readInterfConfig, resolveSourceFolderPath } from "../project-model/interf-detect.js";
2
+ import { readInterfConfig, resolveSourceFolderPath } from "../../project/interf-detect.js";
3
3
  import { loadCompiledSourceSnapshot, loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
4
4
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
5
- import { readCompiledSchemaFile } from "./compiled-schema.js";
6
- import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../method-package/method-definitions.js";
5
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
6
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
7
7
  import { writeCompiledSourceFiles, writeCompiledSourceSnapshot, } from "./source-files.js";
8
8
  export function ensureCompiledViewSpec(dirPath) {
9
9
  const existing = loadCompiledViewSpec(dirPath);
@@ -63,10 +63,11 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
63
63
  resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${dirPath}`);
64
64
  const method = getActiveCompiledMethod(dirPath);
65
65
  const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
66
- const outputDocumentPaths = (schema?.zones ?? [])
67
- .filter((zone) => zone.role === "output" && zone.kind !== "runtime")
68
- .map((zone) => zone.path);
69
- const defaultNote = (schema?.zones ?? []).find((zone) => zone.role === "output" && zone.kind === "file")?.path ?? null;
66
+ const schemaArtifacts = schema ? listCompiledSchemaArtifacts(schema) : [];
67
+ const outputDocumentPaths = schemaArtifacts
68
+ .filter((artifact) => artifact.role === "output" && artifact.kind !== "runtime")
69
+ .map((artifact) => artifact.path);
70
+ const defaultNote = schemaArtifacts.find((artifact) => artifact.role === "output" && artifact.kind === "file")?.path ?? null;
70
71
  return {
71
72
  kind: "compiled-view-spec",
72
73
  version: 2,
@@ -85,7 +86,7 @@ function buildDefaultCompiledViewSpec(dirPath, compiledName, generatedAt) {
85
86
  { id: "status", type: "status", title: "Compile Status", path: ".interf/runtime/health.json" },
86
87
  { id: "cards", type: "cards", title: "Key Metrics", path: ".interf/runtime/health.json" },
87
88
  ...(outputDocumentPaths.length > 0
88
- ? [{ id: "outputs", type: "documents", title: "Output Zones", paths: outputDocumentPaths }]
89
+ ? [{ id: "outputs", type: "documents", title: "Output Artifacts", paths: outputDocumentPaths }]
89
90
  : []),
90
91
  { id: "method", type: "documents", title: "Method Docs", paths: ["method/README.md", ...method.stages.map((stage) => `method/compile/stages/${stage.skillDir}`)] },
91
92
  ],
@@ -1,13 +1,13 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { discoverSourceFiles } from "./discovery.js";
3
- import { METHOD_SCHEMA_FILE, findCompiledSchemaZone, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
4
- import { resolveSourceFolderPath } from "../project-model/interf-detect.js";
3
+ import { METHOD_SCHEMA_FILE, findCompiledSchemaArtifact, readCompiledSchemaFile, methodSchemaExists, } from "./compiled-schema.js";
4
+ import { resolveSourceFolderPath } from "../../project/interf-detect.js";
5
5
  import { compiledInterfConfigPath, methodPackagePathForCompiled } from "./compiled-paths.js";
6
6
  import { readCompiledConfig } from "./validate.js";
7
7
  import { loadState } from "./state.js";
8
- import { validateResolvedStageAcceptance, stageRecordFromState } from "./runtime-acceptance.js";
9
- import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../method-package/method-definitions.js";
10
- import { countCompiledZoneArtifacts } from "./artifact-counts.js";
8
+ import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../../methods/package/method-definitions.js";
9
+ import { countCompiledArtifactsAtPath } from "./artifact-counts.js";
10
+ import { evaluateChecks } from "./check-evaluator.js";
11
11
  function methodSchemaPresent(dirPath) {
12
12
  return methodSchemaExists(methodPackagePathForCompiled(dirPath));
13
13
  }
@@ -45,23 +45,57 @@ function readMethodContext(dirPath) {
45
45
  function stageRequired(sourceTotal, writeCounts, stageRecordPresent) {
46
46
  return sourceTotal > 0 || writeCounts > 0 || stageRecordPresent;
47
47
  }
48
- function zoneWriteCount(compiledPath, schema, stage) {
49
- const zoneCounts = {};
48
+ function artifactWriteCount(compiledPath, schema, stage) {
49
+ const artifactCounts = {};
50
50
  let total = 0;
51
- for (const zoneId of stage.writes) {
52
- const zone = findCompiledSchemaZone(schema, zoneId);
53
- if (!zone)
51
+ for (const artifactId of stage.writes) {
52
+ const artifact = findCompiledSchemaArtifact(schema, artifactId);
53
+ if (!artifact)
54
54
  continue;
55
- const count = countCompiledZoneArtifacts(compiledPath, zone.path, zone.kind);
56
- zoneCounts[zoneId] = count;
55
+ const count = countCompiledArtifactsAtPath(compiledPath, artifact.path, artifact.kind);
56
+ artifactCounts[artifactId] = count;
57
57
  total += count;
58
58
  }
59
- return { total, zoneCounts };
59
+ return { total, artifactCounts };
60
60
  }
61
- function mergeValidationCounts(sourceTotal, stageRecord, zoneCounts) {
61
+ function stageRecordFromState(state, stageId) {
62
+ const stages = state?.stages;
63
+ if (!stages || typeof stages !== "object")
64
+ return null;
65
+ const stage = stages[stageId];
66
+ if (!stage || typeof stage !== "object" || Array.isArray(stage))
67
+ return null;
68
+ return stage;
69
+ }
70
+ function artifactsBuiltByStage(schema, stage) {
71
+ return (schema.artifacts ?? []).filter((artifact) => {
72
+ if (artifact.built_by_stages.includes(stage.id))
73
+ return true;
74
+ if (stage.writes.includes(artifact.id))
75
+ return true;
76
+ return artifact.shape.kind === "path" && (stage.writes.includes(artifact.id) || stage.writes.includes(artifact.shape.path));
77
+ });
78
+ }
79
+ function artifactCheckFailures(compiledPath, artifacts, counts) {
80
+ const failures = [];
81
+ for (const artifact of artifacts) {
82
+ const checks = artifact.checks ?? [];
83
+ if (checks.length === 0)
84
+ continue;
85
+ const targetPath = artifact.shape.kind === "path" ? artifact.shape.path : undefined;
86
+ const result = evaluateChecks(checks, {
87
+ rootPath: compiledPath,
88
+ targetPath,
89
+ counts,
90
+ });
91
+ failures.push(...result.failures);
92
+ }
93
+ return failures;
94
+ }
95
+ function mergeValidationCounts(sourceTotal, stageRecord, artifactCounts) {
62
96
  const merged = {
63
97
  source_total: sourceTotal,
64
- ...zoneCounts,
98
+ ...artifactCounts,
65
99
  };
66
100
  const stageCounts = stageRecord?.counts;
67
101
  if (stageCounts && typeof stageCounts === "object" && !Array.isArray(stageCounts)) {
@@ -121,22 +155,19 @@ export function validateCompiledStage(dirPath, stageId) {
121
155
  checks.stage_finished = Boolean(stageRecord?.finished_at);
122
156
  checks.stage_succeeded = stageRecord?.status === "succeeded";
123
157
  const writeCounts = methodStage && context.schema
124
- ? zoneWriteCount(dirPath, context.schema, methodStage)
125
- : { total: 0, zoneCounts: {} };
126
- const acceptanceCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.zoneCounts);
158
+ ? artifactWriteCount(dirPath, context.schema, methodStage)
159
+ : { total: 0, artifactCounts: {} };
160
+ const artifactCounts = mergeValidationCounts(context.sourceTotal, stageRecord, writeCounts.artifactCounts);
127
161
  const required = stageRequired(context.sourceTotal, writeCounts.total, checks.stage_record_present);
128
- let acceptanceErrors = [];
162
+ let artifactErrors = [];
129
163
  if (methodStage && context.schema) {
130
- const acceptanceValidation = validateResolvedStageAcceptance(dirPath, {
131
- stageId,
132
- acceptance: methodStage.acceptance,
133
- counts: acceptanceCounts,
134
- });
135
- checks.acceptance_ok = acceptanceValidation.ok;
136
- acceptanceErrors = acceptanceValidation.failures;
164
+ const artifacts = artifactsBuiltByStage(context.schema, methodStage);
165
+ const failures = artifactCheckFailures(dirPath, artifacts, artifactCounts);
166
+ checks.artifact_checks_ok = failures.length === 0;
167
+ artifactErrors = failures.map((proof) => `Artifact check "${proof.check_id}" failed for ${proof.kind}: ${proof.summary}`);
137
168
  }
138
169
  else {
139
- checks.acceptance_ok = false;
170
+ checks.artifact_checks_ok = false;
140
171
  }
141
172
  if (required && checks.stage_record_present && !checks.stage_finished) {
142
173
  errors.push(`Stage "${stageId}" has no finished_at proof in runtime state.`);
@@ -145,23 +176,23 @@ export function validateCompiledStage(dirPath, stageId) {
145
176
  errors.push(`Stage "${stageId}" is not marked succeeded in runtime state.`);
146
177
  }
147
178
  if (required) {
148
- errors.push(...acceptanceErrors);
179
+ errors.push(...artifactErrors);
149
180
  }
150
181
  const ok = required ? errors.length === 0 : errors.length === 0;
151
182
  const summary = !required
152
183
  ? `Stage "${stageId}" is not required yet.`
153
184
  : ok
154
185
  ? `Stage "${stageId}" verified.`
155
- : `Stage "${stageId}" failed — ${errors[0] ?? "acceptance not satisfied."}`;
186
+ : `Stage "${stageId}" failed — ${errors[0] ?? "artifact checks not satisfied."}`;
156
187
  return {
157
188
  ok,
158
189
  required,
159
190
  stage: stageId,
160
191
  summary,
161
192
  counts: {
162
- ...acceptanceCounts,
193
+ ...artifactCounts,
163
194
  write_artifacts: writeCounts.total,
164
- declared_write_zones: methodStage?.writes.length ?? 0,
195
+ declared_write_artifacts: methodStage?.writes.length ?? 0,
165
196
  },
166
197
  checks,
167
198
  errors,
@@ -213,7 +244,7 @@ export function validateCompiledMethod(dirPath) {
213
244
  stage: failedStage,
214
245
  summary: ok
215
246
  ? `Compiled Method verified — ${completedStages}/${context.method.stages.length} stages satisfied.`
216
- : `Compiled Method failed — ${errors[0] ?? "stage acceptance not satisfied."}`,
247
+ : `Compiled Method failed — ${errors[0] ?? "stage artifact checks not satisfied."}`,
217
248
  counts: {
218
249
  source_total: context.sourceTotal,
219
250
  stage_total: context.method.stages.length,
@@ -1,4 +1,4 @@
1
- import { readInterfConfig } from "../project-model/interf-detect.js";
1
+ import { readInterfConfig } from "../../project/interf-detect.js";
2
2
  export declare function readCompiledConfig(dirPath: string): {
3
3
  present: boolean;
4
4
  valid: boolean;
@@ -1,11 +1,10 @@
1
1
  import { existsSync, readFileSync, statSync, } from "node:fs";
2
2
  import { basename, dirname, extname, join, resolve } from "node:path";
3
- import { readCompiledSchemaFile } from "./compiled-schema.js";
4
- import { compiledKnowledgeRootPath } from "./compiled-schema.js";
3
+ import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
5
4
  import { methodPackagePathForCompiled } from "./compiled-paths.js";
6
- import { listFilesRecursive } from "../shared/filesystem.js";
7
- import { readInterfConfig } from "../project-model/interf-detect.js";
8
- import { parseJsonFrontmatter } from "../shared/parse.js";
5
+ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
6
+ import { readInterfConfig } from "../../project/interf-detect.js";
7
+ import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
9
8
  import { compiledInterfConfigPath } from "./compiled-paths.js";
10
9
  const MIN_ABSTRACT_WORDS = 5;
11
10
  const WIKILINK_PATTERN = /!?\[\[([^[\]]+)\]\]/g;
@@ -53,8 +52,8 @@ export function validateSynthFiles(files, options) {
53
52
  };
54
53
  }
55
54
  export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots) {
56
- const zonePathById = compiledZoneDirectoryPaths(compiledRoot);
57
- const knowledgeRelativePrefixes = compiledKnowledgeRelativePrefixes(zonePathById);
55
+ const artifactPathById = compiledArtifactDirectoryPaths(compiledRoot);
56
+ const directoryLeafParents = compiledDirectoryLeafParents(artifactPathById);
58
57
  const noteIndex = new Set();
59
58
  for (const filePath of dedupeFiles(noteIndexRoots)) {
60
59
  for (const target of collectWikilinkTargets(filePath)) {
@@ -75,15 +74,15 @@ export function countBrokenWikilinks(compiledRoot, noteIndexRoots, linkScanRoots
75
74
  if (!target)
76
75
  continue;
77
76
  if (target.includes("/")) {
78
- if (!wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath)) {
77
+ if (!wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, filePath)) {
79
78
  brokenLinks += 1;
80
79
  }
81
80
  continue;
82
81
  }
83
82
  if (!noteIndex.has(target.toLowerCase()) &&
84
83
  !noteIndex.has(noteName(target).toLowerCase()) &&
85
- !wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, filePath) &&
86
- !wikilinkPathExists(compiledRoot, noteName(target), zonePathById, knowledgeRelativePrefixes, filePath)) {
84
+ !wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, filePath) &&
85
+ !wikilinkPathExists(compiledRoot, noteName(target), artifactPathById, directoryLeafParents, filePath)) {
87
86
  brokenLinks += 1;
88
87
  }
89
88
  }
@@ -172,22 +171,25 @@ function countWords(text) {
172
171
  function noteName(filePath) {
173
172
  return basename(filePath, extname(filePath));
174
173
  }
175
- function wikilinkPathExists(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
176
- return linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath)
174
+ function wikilinkPathExists(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath) {
175
+ return linkPathCandidates(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath)
177
176
  .some((candidate) => existsSync(candidate));
178
177
  }
179
- function linkPathCandidates(compiledRoot, target, zonePathById, knowledgeRelativePrefixes, sourceFilePath) {
178
+ function linkPathCandidates(compiledRoot, target, artifactPathById, directoryLeafParents, sourceFilePath) {
180
179
  const candidates = new Set();
181
180
  addPathCandidate(candidates, join(compiledRoot, target));
182
181
  if (sourceFilePath && (target.startsWith("./") || target.startsWith("../"))) {
183
182
  addPathCandidateIfInside(candidates, compiledRoot, resolve(dirname(sourceFilePath), target));
184
183
  }
185
184
  const [firstSegment] = target.split("/");
186
- if (firstSegment && knowledgeRelativePrefixes.has(firstSegment)) {
187
- addPathCandidate(candidates, join(compiledKnowledgeRootPath(compiledRoot), target));
185
+ if (firstSegment) {
186
+ const parentPath = directoryLeafParents.get(firstSegment);
187
+ if (parentPath) {
188
+ addPathCandidate(candidates, join(compiledRoot, parentPath, target));
189
+ }
188
190
  }
189
191
  if (firstSegment) {
190
- const normalizedPrefix = zonePathById.get(firstSegment);
192
+ const normalizedPrefix = artifactPathById.get(firstSegment);
191
193
  if (normalizedPrefix) {
192
194
  const remainder = target.slice(firstSegment.length).replace(/^\/+/, "");
193
195
  addPathCandidate(candidates, join(compiledRoot, normalizedPrefix, remainder));
@@ -206,24 +208,24 @@ function addPathCandidateIfInside(candidates, compiledRoot, absolutePath) {
206
208
  return;
207
209
  addPathCandidate(candidates, candidate);
208
210
  }
209
- function compiledZoneDirectoryPaths(compiledRoot) {
211
+ function compiledArtifactDirectoryPaths(compiledRoot) {
210
212
  const methodRoot = methodPackagePathForCompiled(compiledRoot);
211
213
  const schema = readCompiledSchemaFile(methodRoot);
212
214
  if (!schema)
213
215
  return new Map();
214
- return new Map(schema.zones
215
- .filter((zone) => zone.kind === "directory")
216
- .map((zone) => [zone.id, zone.path]));
216
+ return new Map(listCompiledSchemaArtifacts(schema)
217
+ .filter((artifact) => artifact.kind === "directory")
218
+ .map((artifact) => [artifact.id, artifact.path]));
217
219
  }
218
- function compiledKnowledgeRelativePrefixes(zonePathById) {
219
- const prefixes = new Set();
220
- for (const zonePath of zonePathById.values()) {
221
- const [root, leaf, ...rest] = zonePath.split("/");
222
- if (root !== "knowledge" || !leaf || rest.length > 0)
220
+ function compiledDirectoryLeafParents(artifactPathById) {
221
+ const parents = new Map();
222
+ for (const artifactPath of artifactPathById.values()) {
223
+ const [root, leaf, ...rest] = artifactPath.split("/");
224
+ if (!root || !leaf || rest.length > 0)
223
225
  continue;
224
- prefixes.add(leaf);
226
+ parents.set(leaf, root);
225
227
  }
226
- return prefixes;
228
+ return parents;
227
229
  }
228
230
  function collectWikilinkTargets(filePath) {
229
231
  const targets = new Set();