@prodara/compiler 0.1.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 (494) hide show
  1. package/README.md +204 -0
  2. package/dist/agent/agent.d.ts +10 -0
  3. package/dist/agent/agent.d.ts.map +1 -0
  4. package/dist/agent/agent.js +122 -0
  5. package/dist/agent/agent.js.map +1 -0
  6. package/dist/agent/api-client.d.ts +29 -0
  7. package/dist/agent/api-client.d.ts.map +1 -0
  8. package/dist/agent/api-client.js +167 -0
  9. package/dist/agent/api-client.js.map +1 -0
  10. package/dist/agent/index.d.ts +5 -0
  11. package/dist/agent/index.d.ts.map +1 -0
  12. package/dist/agent/index.js +3 -0
  13. package/dist/agent/index.js.map +1 -0
  14. package/dist/agent/party.d.ts +48 -0
  15. package/dist/agent/party.d.ts.map +1 -0
  16. package/dist/agent/party.js +79 -0
  17. package/dist/agent/party.js.map +1 -0
  18. package/dist/agent/types.d.ts +35 -0
  19. package/dist/agent/types.d.ts.map +1 -0
  20. package/dist/agent/types.js +5 -0
  21. package/dist/agent/types.js.map +1 -0
  22. package/dist/audit/audit.d.ts +32 -0
  23. package/dist/audit/audit.d.ts.map +1 -0
  24. package/dist/audit/audit.js +120 -0
  25. package/dist/audit/audit.js.map +1 -0
  26. package/dist/audit/index.d.ts +3 -0
  27. package/dist/audit/index.d.ts.map +1 -0
  28. package/dist/audit/index.js +2 -0
  29. package/dist/audit/index.js.map +1 -0
  30. package/dist/audit/types.d.ts +25 -0
  31. package/dist/audit/types.d.ts.map +1 -0
  32. package/dist/audit/types.js +5 -0
  33. package/dist/audit/types.js.map +1 -0
  34. package/dist/binder/binder.d.ts +34 -0
  35. package/dist/binder/binder.d.ts.map +1 -0
  36. package/dist/binder/binder.js +202 -0
  37. package/dist/binder/binder.js.map +1 -0
  38. package/dist/binder/index.d.ts +3 -0
  39. package/dist/binder/index.d.ts.map +1 -0
  40. package/dist/binder/index.js +2 -0
  41. package/dist/binder/index.js.map +1 -0
  42. package/dist/build-state/build-state.d.ts +40 -0
  43. package/dist/build-state/build-state.d.ts.map +1 -0
  44. package/dist/build-state/build-state.js +180 -0
  45. package/dist/build-state/build-state.js.map +1 -0
  46. package/dist/build-state/index.d.ts +3 -0
  47. package/dist/build-state/index.d.ts.map +1 -0
  48. package/dist/build-state/index.js +2 -0
  49. package/dist/build-state/index.js.map +1 -0
  50. package/dist/checker/index.d.ts +5 -0
  51. package/dist/checker/index.d.ts.map +1 -0
  52. package/dist/checker/index.js +3 -0
  53. package/dist/checker/index.js.map +1 -0
  54. package/dist/checker/type-checker.d.ts +8 -0
  55. package/dist/checker/type-checker.d.ts.map +1 -0
  56. package/dist/checker/type-checker.js +136 -0
  57. package/dist/checker/type-checker.js.map +1 -0
  58. package/dist/checker/validator.d.ts +8 -0
  59. package/dist/checker/validator.d.ts.map +1 -0
  60. package/dist/checker/validator.js +251 -0
  61. package/dist/checker/validator.js.map +1 -0
  62. package/dist/cli/agent-setup.d.ts +27 -0
  63. package/dist/cli/agent-setup.d.ts.map +1 -0
  64. package/dist/cli/agent-setup.js +829 -0
  65. package/dist/cli/agent-setup.js.map +1 -0
  66. package/dist/cli/analyze.d.ts +28 -0
  67. package/dist/cli/analyze.d.ts.map +1 -0
  68. package/dist/cli/analyze.js +188 -0
  69. package/dist/cli/analyze.js.map +1 -0
  70. package/dist/cli/checklist.d.ts +27 -0
  71. package/dist/cli/checklist.d.ts.map +1 -0
  72. package/dist/cli/checklist.js +153 -0
  73. package/dist/cli/checklist.js.map +1 -0
  74. package/dist/cli/compile.d.ts +26 -0
  75. package/dist/cli/compile.d.ts.map +1 -0
  76. package/dist/cli/compile.js +112 -0
  77. package/dist/cli/compile.js.map +1 -0
  78. package/dist/cli/dashboard.d.ts +19 -0
  79. package/dist/cli/dashboard.d.ts.map +1 -0
  80. package/dist/cli/dashboard.js +73 -0
  81. package/dist/cli/dashboard.js.map +1 -0
  82. package/dist/cli/explain.d.ts +23 -0
  83. package/dist/cli/explain.d.ts.map +1 -0
  84. package/dist/cli/explain.js +144 -0
  85. package/dist/cli/explain.js.map +1 -0
  86. package/dist/cli/git.d.ts +14 -0
  87. package/dist/cli/git.d.ts.map +1 -0
  88. package/dist/cli/git.js +44 -0
  89. package/dist/cli/git.js.map +1 -0
  90. package/dist/cli/lifecycle.d.ts +28 -0
  91. package/dist/cli/lifecycle.d.ts.map +1 -0
  92. package/dist/cli/lifecycle.js +82 -0
  93. package/dist/cli/lifecycle.js.map +1 -0
  94. package/dist/cli/main.d.ts +10 -0
  95. package/dist/cli/main.d.ts.map +1 -0
  96. package/dist/cli/main.js +1072 -0
  97. package/dist/cli/main.js.map +1 -0
  98. package/dist/cli/notify.d.ts +13 -0
  99. package/dist/cli/notify.d.ts.map +1 -0
  100. package/dist/cli/notify.js +36 -0
  101. package/dist/cli/notify.js.map +1 -0
  102. package/dist/cli/starters.d.ts +12 -0
  103. package/dist/cli/starters.d.ts.map +1 -0
  104. package/dist/cli/starters.js +439 -0
  105. package/dist/cli/starters.js.map +1 -0
  106. package/dist/config/config.d.ts +194 -0
  107. package/dist/config/config.d.ts.map +1 -0
  108. package/dist/config/config.js +434 -0
  109. package/dist/config/config.js.map +1 -0
  110. package/dist/config/index.d.ts +3 -0
  111. package/dist/config/index.d.ts.map +1 -0
  112. package/dist/config/index.js +5 -0
  113. package/dist/config/index.js.map +1 -0
  114. package/dist/diagnostics/diagnostic.d.ts +44 -0
  115. package/dist/diagnostics/diagnostic.d.ts.map +1 -0
  116. package/dist/diagnostics/diagnostic.js +44 -0
  117. package/dist/diagnostics/diagnostic.js.map +1 -0
  118. package/dist/diagnostics/index.d.ts +4 -0
  119. package/dist/diagnostics/index.d.ts.map +1 -0
  120. package/dist/diagnostics/index.js +3 -0
  121. package/dist/diagnostics/index.js.map +1 -0
  122. package/dist/diagnostics/reporter.d.ts +43 -0
  123. package/dist/diagnostics/reporter.d.ts.map +1 -0
  124. package/dist/diagnostics/reporter.js +74 -0
  125. package/dist/diagnostics/reporter.js.map +1 -0
  126. package/dist/discovery/discovery.d.ts +6 -0
  127. package/dist/discovery/discovery.d.ts.map +1 -0
  128. package/dist/discovery/discovery.js +66 -0
  129. package/dist/discovery/discovery.js.map +1 -0
  130. package/dist/discovery/index.d.ts +2 -0
  131. package/dist/discovery/index.d.ts.map +1 -0
  132. package/dist/discovery/index.js +2 -0
  133. package/dist/discovery/index.js.map +1 -0
  134. package/dist/doc-gen/doc-gen-types.d.ts +174 -0
  135. package/dist/doc-gen/doc-gen-types.d.ts.map +1 -0
  136. package/dist/doc-gen/doc-gen-types.js +7 -0
  137. package/dist/doc-gen/doc-gen-types.js.map +1 -0
  138. package/dist/doc-gen/doc-renderer.d.ts +17 -0
  139. package/dist/doc-gen/doc-renderer.d.ts.map +1 -0
  140. package/dist/doc-gen/doc-renderer.js +65 -0
  141. package/dist/doc-gen/doc-renderer.js.map +1 -0
  142. package/dist/doc-gen/format-helpers.d.ts +18 -0
  143. package/dist/doc-gen/format-helpers.d.ts.map +1 -0
  144. package/dist/doc-gen/format-helpers.js +92 -0
  145. package/dist/doc-gen/format-helpers.js.map +1 -0
  146. package/dist/doc-gen/index.d.ts +5 -0
  147. package/dist/doc-gen/index.d.ts.map +1 -0
  148. package/dist/doc-gen/index.js +5 -0
  149. package/dist/doc-gen/index.js.map +1 -0
  150. package/dist/doc-gen/link-resolver.d.ts +10 -0
  151. package/dist/doc-gen/link-resolver.d.ts.map +1 -0
  152. package/dist/doc-gen/link-resolver.js +87 -0
  153. package/dist/doc-gen/link-resolver.js.map +1 -0
  154. package/dist/doc-gen/mermaid-renderers.d.ts +12 -0
  155. package/dist/doc-gen/mermaid-renderers.d.ts.map +1 -0
  156. package/dist/doc-gen/mermaid-renderers.js +197 -0
  157. package/dist/doc-gen/mermaid-renderers.js.map +1 -0
  158. package/dist/doc-gen/module-renderer.d.ts +6 -0
  159. package/dist/doc-gen/module-renderer.d.ts.map +1 -0
  160. package/dist/doc-gen/module-renderer.js +54 -0
  161. package/dist/doc-gen/module-renderer.js.map +1 -0
  162. package/dist/doc-gen/product-renderer.d.ts +6 -0
  163. package/dist/doc-gen/product-renderer.d.ts.map +1 -0
  164. package/dist/doc-gen/product-renderer.js +101 -0
  165. package/dist/doc-gen/product-renderer.js.map +1 -0
  166. package/dist/doc-gen/section-renderers.d.ts +20 -0
  167. package/dist/doc-gen/section-renderers.d.ts.map +1 -0
  168. package/dist/doc-gen/section-renderers.js +357 -0
  169. package/dist/doc-gen/section-renderers.js.map +1 -0
  170. package/dist/doc-gen/string-resolver.d.ts +8 -0
  171. package/dist/doc-gen/string-resolver.d.ts.map +1 -0
  172. package/dist/doc-gen/string-resolver.js +47 -0
  173. package/dist/doc-gen/string-resolver.js.map +1 -0
  174. package/dist/doc-gen/surface-ascii.d.ts +7 -0
  175. package/dist/doc-gen/surface-ascii.d.ts.map +1 -0
  176. package/dist/doc-gen/surface-ascii.js +87 -0
  177. package/dist/doc-gen/surface-ascii.js.map +1 -0
  178. package/dist/drift/drift.d.ts +16 -0
  179. package/dist/drift/drift.d.ts.map +1 -0
  180. package/dist/drift/drift.js +149 -0
  181. package/dist/drift/drift.js.map +1 -0
  182. package/dist/drift/index.d.ts +3 -0
  183. package/dist/drift/index.d.ts.map +1 -0
  184. package/dist/drift/index.js +2 -0
  185. package/dist/drift/index.js.map +1 -0
  186. package/dist/extensions/index.d.ts +6 -0
  187. package/dist/extensions/index.d.ts.map +1 -0
  188. package/dist/extensions/index.js +7 -0
  189. package/dist/extensions/index.js.map +1 -0
  190. package/dist/extensions/loader.d.ts +21 -0
  191. package/dist/extensions/loader.d.ts.map +1 -0
  192. package/dist/extensions/loader.js +101 -0
  193. package/dist/extensions/loader.js.map +1 -0
  194. package/dist/extensions/marketplace.d.ts +22 -0
  195. package/dist/extensions/marketplace.d.ts.map +1 -0
  196. package/dist/extensions/marketplace.js +40 -0
  197. package/dist/extensions/marketplace.js.map +1 -0
  198. package/dist/extensions/registry.d.ts +45 -0
  199. package/dist/extensions/registry.d.ts.map +1 -0
  200. package/dist/extensions/registry.js +82 -0
  201. package/dist/extensions/registry.js.map +1 -0
  202. package/dist/extensions/types.d.ts +41 -0
  203. package/dist/extensions/types.d.ts.map +1 -0
  204. package/dist/extensions/types.js +5 -0
  205. package/dist/extensions/types.js.map +1 -0
  206. package/dist/generator/contracts.d.ts +67 -0
  207. package/dist/generator/contracts.d.ts.map +1 -0
  208. package/dist/generator/contracts.js +94 -0
  209. package/dist/generator/contracts.js.map +1 -0
  210. package/dist/generator/index.d.ts +3 -0
  211. package/dist/generator/index.d.ts.map +1 -0
  212. package/dist/generator/index.js +2 -0
  213. package/dist/generator/index.js.map +1 -0
  214. package/dist/governance/governance.d.ts +24 -0
  215. package/dist/governance/governance.d.ts.map +1 -0
  216. package/dist/governance/governance.js +238 -0
  217. package/dist/governance/governance.js.map +1 -0
  218. package/dist/governance/index.d.ts +3 -0
  219. package/dist/governance/index.d.ts.map +1 -0
  220. package/dist/governance/index.js +2 -0
  221. package/dist/governance/index.js.map +1 -0
  222. package/dist/governance/types.d.ts +14 -0
  223. package/dist/governance/types.d.ts.map +1 -0
  224. package/dist/governance/types.js +5 -0
  225. package/dist/governance/types.js.map +1 -0
  226. package/dist/graph/builder.d.ts +10 -0
  227. package/dist/graph/builder.d.ts.map +1 -0
  228. package/dist/graph/builder.js +573 -0
  229. package/dist/graph/builder.js.map +1 -0
  230. package/dist/graph/graph-types.d.ts +64 -0
  231. package/dist/graph/graph-types.d.ts.map +1 -0
  232. package/dist/graph/graph-types.js +29 -0
  233. package/dist/graph/graph-types.js.map +1 -0
  234. package/dist/graph/index.d.ts +8 -0
  235. package/dist/graph/index.d.ts.map +1 -0
  236. package/dist/graph/index.js +5 -0
  237. package/dist/graph/index.js.map +1 -0
  238. package/dist/graph/serializer.d.ts +9 -0
  239. package/dist/graph/serializer.d.ts.map +1 -0
  240. package/dist/graph/serializer.js +31 -0
  241. package/dist/graph/serializer.js.map +1 -0
  242. package/dist/graph/validator.d.ts +14 -0
  243. package/dist/graph/validator.d.ts.map +1 -0
  244. package/dist/graph/validator.js +96 -0
  245. package/dist/graph/validator.js.map +1 -0
  246. package/dist/implement/implement.d.ts +30 -0
  247. package/dist/implement/implement.d.ts.map +1 -0
  248. package/dist/implement/implement.js +299 -0
  249. package/dist/implement/implement.js.map +1 -0
  250. package/dist/implement/index.d.ts +3 -0
  251. package/dist/implement/index.d.ts.map +1 -0
  252. package/dist/implement/index.js +2 -0
  253. package/dist/implement/index.js.map +1 -0
  254. package/dist/implement/types.d.ts +41 -0
  255. package/dist/implement/types.d.ts.map +1 -0
  256. package/dist/implement/types.js +5 -0
  257. package/dist/implement/types.js.map +1 -0
  258. package/dist/incremental/incremental-spec.d.ts +12 -0
  259. package/dist/incremental/incremental-spec.d.ts.map +1 -0
  260. package/dist/incremental/incremental-spec.js +100 -0
  261. package/dist/incremental/incremental-spec.js.map +1 -0
  262. package/dist/incremental/index.d.ts +3 -0
  263. package/dist/incremental/index.d.ts.map +1 -0
  264. package/dist/incremental/index.js +5 -0
  265. package/dist/incremental/index.js.map +1 -0
  266. package/dist/incremental/types.d.ts +28 -0
  267. package/dist/incremental/types.d.ts.map +1 -0
  268. package/dist/incremental/types.js +7 -0
  269. package/dist/incremental/types.js.map +1 -0
  270. package/dist/index.d.ts +106 -0
  271. package/dist/index.d.ts.map +1 -0
  272. package/dist/index.js +106 -0
  273. package/dist/index.js.map +1 -0
  274. package/dist/lexer/index.d.ts +6 -0
  275. package/dist/lexer/index.d.ts.map +1 -0
  276. package/dist/lexer/index.js +5 -0
  277. package/dist/lexer/index.js.map +1 -0
  278. package/dist/lexer/keywords.d.ts +3 -0
  279. package/dist/lexer/keywords.d.ts.map +1 -0
  280. package/dist/lexer/keywords.js +142 -0
  281. package/dist/lexer/keywords.js.map +1 -0
  282. package/dist/lexer/lexer.d.ts +19 -0
  283. package/dist/lexer/lexer.d.ts.map +1 -0
  284. package/dist/lexer/lexer.js +286 -0
  285. package/dist/lexer/lexer.js.map +1 -0
  286. package/dist/lexer/source.d.ts +13 -0
  287. package/dist/lexer/source.d.ts.map +1 -0
  288. package/dist/lexer/source.js +59 -0
  289. package/dist/lexer/source.js.map +1 -0
  290. package/dist/lexer/tokens.d.ts +157 -0
  291. package/dist/lexer/tokens.d.ts.map +1 -0
  292. package/dist/lexer/tokens.js +173 -0
  293. package/dist/lexer/tokens.js.map +1 -0
  294. package/dist/orchestrator/index.d.ts +5 -0
  295. package/dist/orchestrator/index.d.ts.map +1 -0
  296. package/dist/orchestrator/index.js +3 -0
  297. package/dist/orchestrator/index.js.map +1 -0
  298. package/dist/orchestrator/orchestrator.d.ts +14 -0
  299. package/dist/orchestrator/orchestrator.d.ts.map +1 -0
  300. package/dist/orchestrator/orchestrator.js +129 -0
  301. package/dist/orchestrator/orchestrator.js.map +1 -0
  302. package/dist/orchestrator/pipeline.d.ts +31 -0
  303. package/dist/orchestrator/pipeline.d.ts.map +1 -0
  304. package/dist/orchestrator/pipeline.js +290 -0
  305. package/dist/orchestrator/pipeline.js.map +1 -0
  306. package/dist/orchestrator/types.d.ts +60 -0
  307. package/dist/orchestrator/types.d.ts.map +1 -0
  308. package/dist/orchestrator/types.js +8 -0
  309. package/dist/orchestrator/types.js.map +1 -0
  310. package/dist/parser/ast.d.ts +502 -0
  311. package/dist/parser/ast.d.ts.map +1 -0
  312. package/dist/parser/ast.js +7 -0
  313. package/dist/parser/ast.js.map +1 -0
  314. package/dist/parser/expressions.d.ts +18 -0
  315. package/dist/parser/expressions.d.ts.map +1 -0
  316. package/dist/parser/expressions.js +230 -0
  317. package/dist/parser/expressions.js.map +1 -0
  318. package/dist/parser/index.d.ts +4 -0
  319. package/dist/parser/index.d.ts.map +1 -0
  320. package/dist/parser/index.js +2 -0
  321. package/dist/parser/index.js.map +1 -0
  322. package/dist/parser/parser.d.ts +83 -0
  323. package/dist/parser/parser.d.ts.map +1 -0
  324. package/dist/parser/parser.js +2149 -0
  325. package/dist/parser/parser.js.map +1 -0
  326. package/dist/planner/differ.d.ts +4 -0
  327. package/dist/planner/differ.d.ts.map +1 -0
  328. package/dist/planner/differ.js +96 -0
  329. package/dist/planner/differ.js.map +1 -0
  330. package/dist/planner/index.d.ts +7 -0
  331. package/dist/planner/index.d.ts.map +1 -0
  332. package/dist/planner/index.js +5 -0
  333. package/dist/planner/index.js.map +1 -0
  334. package/dist/planner/plan-types.d.ts +26 -0
  335. package/dist/planner/plan-types.d.ts.map +1 -0
  336. package/dist/planner/plan-types.js +5 -0
  337. package/dist/planner/plan-types.js.map +1 -0
  338. package/dist/planner/planner.d.ts +8 -0
  339. package/dist/planner/planner.d.ts.map +1 -0
  340. package/dist/planner/planner.js +83 -0
  341. package/dist/planner/planner.js.map +1 -0
  342. package/dist/planner/propagator.d.ts +4 -0
  343. package/dist/planner/propagator.d.ts.map +1 -0
  344. package/dist/planner/propagator.js +45 -0
  345. package/dist/planner/propagator.js.map +1 -0
  346. package/dist/planner/semantic-diff.d.ts +27 -0
  347. package/dist/planner/semantic-diff.d.ts.map +1 -0
  348. package/dist/planner/semantic-diff.js +253 -0
  349. package/dist/planner/semantic-diff.js.map +1 -0
  350. package/dist/presets/index.d.ts +3 -0
  351. package/dist/presets/index.d.ts.map +1 -0
  352. package/dist/presets/index.js +5 -0
  353. package/dist/presets/index.js.map +1 -0
  354. package/dist/presets/loader.d.ts +28 -0
  355. package/dist/presets/loader.d.ts.map +1 -0
  356. package/dist/presets/loader.js +99 -0
  357. package/dist/presets/loader.js.map +1 -0
  358. package/dist/presets/types.d.ts +21 -0
  359. package/dist/presets/types.d.ts.map +1 -0
  360. package/dist/presets/types.js +5 -0
  361. package/dist/presets/types.js.map +1 -0
  362. package/dist/proposal/index.d.ts +3 -0
  363. package/dist/proposal/index.d.ts.map +1 -0
  364. package/dist/proposal/index.js +7 -0
  365. package/dist/proposal/index.js.map +1 -0
  366. package/dist/proposal/proposal.d.ts +9 -0
  367. package/dist/proposal/proposal.d.ts.map +1 -0
  368. package/dist/proposal/proposal.js +169 -0
  369. package/dist/proposal/proposal.js.map +1 -0
  370. package/dist/proposal/types.d.ts +15 -0
  371. package/dist/proposal/types.d.ts.map +1 -0
  372. package/dist/proposal/types.js +5 -0
  373. package/dist/proposal/types.js.map +1 -0
  374. package/dist/registry/index.d.ts +3 -0
  375. package/dist/registry/index.d.ts.map +1 -0
  376. package/dist/registry/index.js +2 -0
  377. package/dist/registry/index.js.map +1 -0
  378. package/dist/registry/resolution.d.ts +39 -0
  379. package/dist/registry/resolution.d.ts.map +1 -0
  380. package/dist/registry/resolution.js +70 -0
  381. package/dist/registry/resolution.js.map +1 -0
  382. package/dist/reviewers/adversarial.d.ts +3 -0
  383. package/dist/reviewers/adversarial.d.ts.map +1 -0
  384. package/dist/reviewers/adversarial.js +111 -0
  385. package/dist/reviewers/adversarial.js.map +1 -0
  386. package/dist/reviewers/architecture.d.ts +3 -0
  387. package/dist/reviewers/architecture.d.ts.map +1 -0
  388. package/dist/reviewers/architecture.js +71 -0
  389. package/dist/reviewers/architecture.js.map +1 -0
  390. package/dist/reviewers/code-quality.d.ts +3 -0
  391. package/dist/reviewers/code-quality.d.ts.map +1 -0
  392. package/dist/reviewers/code-quality.js +72 -0
  393. package/dist/reviewers/code-quality.js.map +1 -0
  394. package/dist/reviewers/edge-case.d.ts +3 -0
  395. package/dist/reviewers/edge-case.d.ts.map +1 -0
  396. package/dist/reviewers/edge-case.js +107 -0
  397. package/dist/reviewers/edge-case.js.map +1 -0
  398. package/dist/reviewers/index.d.ts +21 -0
  399. package/dist/reviewers/index.d.ts.map +1 -0
  400. package/dist/reviewers/index.js +39 -0
  401. package/dist/reviewers/index.js.map +1 -0
  402. package/dist/reviewers/prompt-loader.d.ts +24 -0
  403. package/dist/reviewers/prompt-loader.d.ts.map +1 -0
  404. package/dist/reviewers/prompt-loader.js +67 -0
  405. package/dist/reviewers/prompt-loader.js.map +1 -0
  406. package/dist/reviewers/quality.d.ts +3 -0
  407. package/dist/reviewers/quality.d.ts.map +1 -0
  408. package/dist/reviewers/quality.js +76 -0
  409. package/dist/reviewers/quality.js.map +1 -0
  410. package/dist/reviewers/reviewer.d.ts +39 -0
  411. package/dist/reviewers/reviewer.d.ts.map +1 -0
  412. package/dist/reviewers/reviewer.js +149 -0
  413. package/dist/reviewers/reviewer.js.map +1 -0
  414. package/dist/reviewers/security.d.ts +3 -0
  415. package/dist/reviewers/security.d.ts.map +1 -0
  416. package/dist/reviewers/security.js +87 -0
  417. package/dist/reviewers/security.js.map +1 -0
  418. package/dist/reviewers/specification.d.ts +3 -0
  419. package/dist/reviewers/specification.d.ts.map +1 -0
  420. package/dist/reviewers/specification.js +79 -0
  421. package/dist/reviewers/specification.js.map +1 -0
  422. package/dist/reviewers/test-quality.d.ts +3 -0
  423. package/dist/reviewers/test-quality.d.ts.map +1 -0
  424. package/dist/reviewers/test-quality.js +88 -0
  425. package/dist/reviewers/test-quality.js.map +1 -0
  426. package/dist/reviewers/types.d.ts +32 -0
  427. package/dist/reviewers/types.d.ts.map +1 -0
  428. package/dist/reviewers/types.js +5 -0
  429. package/dist/reviewers/types.js.map +1 -0
  430. package/dist/reviewers/ux.d.ts +3 -0
  431. package/dist/reviewers/ux.d.ts.map +1 -0
  432. package/dist/reviewers/ux.js +94 -0
  433. package/dist/reviewers/ux.js.map +1 -0
  434. package/dist/runtime/index.d.ts +3 -0
  435. package/dist/runtime/index.d.ts.map +1 -0
  436. package/dist/runtime/index.js +2 -0
  437. package/dist/runtime/index.js.map +1 -0
  438. package/dist/runtime/resolution.d.ts +30 -0
  439. package/dist/runtime/resolution.d.ts.map +1 -0
  440. package/dist/runtime/resolution.js +59 -0
  441. package/dist/runtime/resolution.js.map +1 -0
  442. package/dist/testing/index.d.ts +3 -0
  443. package/dist/testing/index.d.ts.map +1 -0
  444. package/dist/testing/index.js +2 -0
  445. package/dist/testing/index.js.map +1 -0
  446. package/dist/testing/test-runner.d.ts +18 -0
  447. package/dist/testing/test-runner.d.ts.map +1 -0
  448. package/dist/testing/test-runner.js +131 -0
  449. package/dist/testing/test-runner.js.map +1 -0
  450. package/dist/types.d.ts +36 -0
  451. package/dist/types.d.ts.map +1 -0
  452. package/dist/types.js +127 -0
  453. package/dist/types.js.map +1 -0
  454. package/dist/validation/index.d.ts +3 -0
  455. package/dist/validation/index.d.ts.map +1 -0
  456. package/dist/validation/index.js +2 -0
  457. package/dist/validation/index.js.map +1 -0
  458. package/dist/validation/types.d.ts +16 -0
  459. package/dist/validation/types.d.ts.map +1 -0
  460. package/dist/validation/types.js +5 -0
  461. package/dist/validation/types.js.map +1 -0
  462. package/dist/validation/validation.d.ts +8 -0
  463. package/dist/validation/validation.d.ts.map +1 -0
  464. package/dist/validation/validation.js +101 -0
  465. package/dist/validation/validation.js.map +1 -0
  466. package/dist/verification/index.d.ts +3 -0
  467. package/dist/verification/index.d.ts.map +1 -0
  468. package/dist/verification/index.js +5 -0
  469. package/dist/verification/index.js.map +1 -0
  470. package/dist/verification/types.d.ts +14 -0
  471. package/dist/verification/types.d.ts.map +1 -0
  472. package/dist/verification/types.js +5 -0
  473. package/dist/verification/types.js.map +1 -0
  474. package/dist/verification/verify.d.ts +7 -0
  475. package/dist/verification/verify.d.ts.map +1 -0
  476. package/dist/verification/verify.js +127 -0
  477. package/dist/verification/verify.js.map +1 -0
  478. package/dist/workflow/clarify.d.ts +7 -0
  479. package/dist/workflow/clarify.d.ts.map +1 -0
  480. package/dist/workflow/clarify.js +165 -0
  481. package/dist/workflow/clarify.js.map +1 -0
  482. package/dist/workflow/engine.d.ts +19 -0
  483. package/dist/workflow/engine.d.ts.map +1 -0
  484. package/dist/workflow/engine.js +265 -0
  485. package/dist/workflow/engine.js.map +1 -0
  486. package/dist/workflow/index.d.ts +6 -0
  487. package/dist/workflow/index.d.ts.map +1 -0
  488. package/dist/workflow/index.js +7 -0
  489. package/dist/workflow/index.js.map +1 -0
  490. package/dist/workflow/types.d.ts +95 -0
  491. package/dist/workflow/types.d.ts.map +1 -0
  492. package/dist/workflow/types.js +18 -0
  493. package/dist/workflow/types.js.map +1 -0
  494. package/package.json +63 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Prodara Compiler — Governance Types
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sCAAsC;AACtC,8EAA8E"}
@@ -0,0 +1,10 @@
1
+ import type { AstFile } from '../parser/ast.js';
2
+ import type { BindResult } from '../binder/binder.js';
3
+ import { DiagnosticBag } from '../diagnostics/diagnostic.js';
4
+ import type { ProductGraph } from './graph-types.js';
5
+ export interface BuildGraphResult {
6
+ readonly graph: ProductGraph;
7
+ readonly bag: DiagnosticBag;
8
+ }
9
+ export declare function buildGraph(files: readonly AstFile[], bindResult: BindResult): BuildGraphResult;
10
+ //# sourceMappingURL=builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/graph/builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,kBAAkB,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAwG,MAAM,kBAAkB,CAAC;AAE3J,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAK9F"}
@@ -0,0 +1,573 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Prodara Compiler — Product Graph Builder
3
+ // ---------------------------------------------------------------------------
4
+ // Builds the Product Graph from parsed AST files + bind result.
5
+ import { resolveSymbolRef } from '../binder/binder.js';
6
+ import { DiagnosticBag } from '../diagnostics/diagnostic.js';
7
+ export function buildGraph(files, bindResult) {
8
+ const bag = new DiagnosticBag();
9
+ const builder = new GraphBuilder(files, bindResult, bag);
10
+ const graph = builder.build();
11
+ return { graph, bag };
12
+ }
13
+ // ---------------------------------------------------------------------------
14
+ // Node ID helpers
15
+ // ---------------------------------------------------------------------------
16
+ function nodeId(moduleName, kind, name) {
17
+ return `${moduleName}.${kind}.${name}`;
18
+ }
19
+ function resolveTypeRef(type, moduleName, bindResult) {
20
+ switch (type.kind) {
21
+ case 'primitive':
22
+ return type.name;
23
+ case 'ref': {
24
+ const sym = resolveSymbolRef(type.segments, moduleName, bindResult.modules, bindResult.allSymbols);
25
+ if (sym)
26
+ return { ref: sym.qualifiedName.replace('.', `.${sym.nodeKind}.`) };
27
+ return { ref: type.segments.join('.') };
28
+ }
29
+ case 'generic':
30
+ return { generic: type.wrapper, arg: resolveTypeRef(type.inner, moduleName, bindResult) };
31
+ }
32
+ }
33
+ function serializeExpression(expr) {
34
+ switch (expr.kind) {
35
+ case 'binary':
36
+ if (expr.op === 'and' || expr.op === 'or') {
37
+ const operands = [];
38
+ flattenBoolOp(expr, expr.op, operands);
39
+ return { op: expr.op, operands };
40
+ }
41
+ return { op: expr.op, left: serializeExpression(expr.left), right: serializeExpression(expr.right) };
42
+ case 'unary':
43
+ return { op: 'not', operand: serializeExpression(expr.operand) };
44
+ case 'access':
45
+ return { access: [...expr.segments] };
46
+ case 'literal':
47
+ return { literal: expr.value, type: expr.literalType };
48
+ case 'paren':
49
+ return serializeExpression(expr.inner);
50
+ }
51
+ }
52
+ function flattenBoolOp(expr, op, out) {
53
+ if (expr.kind === 'binary' && expr.op === op) {
54
+ flattenBoolOp(expr.left, op, out);
55
+ flattenBoolOp(expr.right, op, out);
56
+ }
57
+ else {
58
+ out.push(serializeExpression(expr));
59
+ }
60
+ }
61
+ function serializeFields(fields, moduleName, bindResult) {
62
+ return fields.map((f) => ({
63
+ name: f.name,
64
+ type: resolveTypeRef(f.type, moduleName, bindResult),
65
+ }));
66
+ }
67
+ // ---------------------------------------------------------------------------
68
+ // Graph Builder
69
+ // ---------------------------------------------------------------------------
70
+ class GraphBuilder {
71
+ files;
72
+ bind;
73
+ bag;
74
+ edges = [];
75
+ sourceFiles;
76
+ constructor(files, bind, bag) {
77
+ this.files = files;
78
+ this.bind = bind;
79
+ this.bag = bag;
80
+ this.sourceFiles = files.map((f) => f.path).sort();
81
+ }
82
+ build() {
83
+ const product = this.buildProductNode();
84
+ const modules = this.buildModuleNodes();
85
+ // Sort edges deterministically
86
+ this.edges.sort((a, b) => {
87
+ const cf = a.from.localeCompare(b.from);
88
+ if (cf !== 0)
89
+ return cf;
90
+ const ck = a.kind.localeCompare(b.kind);
91
+ if (ck !== 0)
92
+ return ck;
93
+ return a.to.localeCompare(b.to);
94
+ });
95
+ const metadata = {
96
+ compiler: 'prodara-compiler',
97
+ compiled_at: new Date().toISOString(),
98
+ source_files: this.sourceFiles,
99
+ };
100
+ return {
101
+ format: 'prodara-product-graph',
102
+ version: '0.1.0',
103
+ product,
104
+ modules,
105
+ edges: this.edges,
106
+ metadata,
107
+ };
108
+ }
109
+ buildProductNode() {
110
+ let prodNode = {
111
+ id: 'product',
112
+ kind: 'product',
113
+ name: this.bind.productName ?? 'unnamed',
114
+ title: null,
115
+ version: null,
116
+ modules: [],
117
+ publishes: null,
118
+ };
119
+ for (const file of this.files) {
120
+ for (const decl of file.declarations) {
121
+ if (decl.kind === 'product') {
122
+ const moduleNames = [...(this.bind.modules.keys())].sort();
123
+ let publishes = null;
124
+ if (decl.publishes) {
125
+ publishes = {};
126
+ for (const entry of decl.publishes.entries) {
127
+ publishes[entry.category] = entry.symbols.map((s) => {
128
+ const resolved = resolveSymbolRef(s, '', this.bind.modules, this.bind.allSymbols);
129
+ /* v8 ignore next */
130
+ return resolved ? `${resolved.module}.${resolved.nodeKind}.${resolved.name}` : s.join('.');
131
+ });
132
+ }
133
+ }
134
+ /* v8 ignore next */
135
+ prodNode = { ...prodNode, name: decl.name, title: decl.title ?? null, version: decl.version ?? null, modules: moduleNames, publishes };
136
+ // product -> module edges
137
+ for (const mn of moduleNames) {
138
+ this.addEdge('product', mn, 'contains');
139
+ }
140
+ }
141
+ }
142
+ }
143
+ return prodNode;
144
+ }
145
+ buildModuleNodes() {
146
+ const moduleNodes = [];
147
+ for (const [modName, table] of this.bind.modules) {
148
+ const imports = table.imports.map((imp) => ({
149
+ symbol: imp.originalSymbol,
150
+ from: imp.sourceModule,
151
+ /* v8 ignore next */
152
+ alias: imp.localName !== imp.originalSymbol ? imp.localName : null,
153
+ }));
154
+ // Emit module→module import edges
155
+ const importedModules = new Set(table.imports.map((imp) => imp.sourceModule));
156
+ for (const srcMod of importedModules) {
157
+ this.addEdge(modName, srcMod, 'imports');
158
+ }
159
+ // Group items by category
160
+ const categories = {};
161
+ for (const [, sym] of table.symbols) {
162
+ const item = sym.declaration;
163
+ const id = nodeId(modName, sym.nodeKind, sym.name);
164
+ const cat = pluralize(sym.nodeKind);
165
+ if (!categories[cat])
166
+ categories[cat] = [];
167
+ const node = this.serializeItem(item, id, modName);
168
+ if (node) {
169
+ categories[cat].push(node);
170
+ // module -> item edge
171
+ this.addEdge(modName, id, 'contains');
172
+ // emit semantic edges
173
+ this.emitEdgesForItem(item, id, modName);
174
+ }
175
+ }
176
+ // Sort each category by name for determinism
177
+ for (const cat of Object.keys(categories)) {
178
+ categories[cat].sort((a, b) => a.name.localeCompare(b.name));
179
+ }
180
+ // Build module node with sorted category keys
181
+ const modNode = {
182
+ id: modName,
183
+ kind: 'module',
184
+ name: modName,
185
+ imports: imports.sort((a, b) => a.symbol.localeCompare(b.symbol)),
186
+ };
187
+ for (const cat of Object.keys(categories).sort()) {
188
+ modNode[cat] = categories[cat];
189
+ }
190
+ moduleNodes.push(modNode);
191
+ }
192
+ return moduleNodes.sort((a, b) => a.name.localeCompare(b.name));
193
+ }
194
+ /* v8 ignore start — V8 does not track ??/ternary branches in object literals reliably */
195
+ serializeItem(item, id, modName) {
196
+ switch (item.kind) {
197
+ case 'import': return null;
198
+ case 'entity':
199
+ return { id, kind: 'entity', name: item.name, fields: serializeFields(item.fields, modName, this.bind) };
200
+ case 'value':
201
+ return { id, kind: 'value', name: item.name, fields: serializeFields(item.fields, modName, this.bind) };
202
+ case 'enum':
203
+ return { id, kind: 'enum', name: item.name, members: item.members.map((m) => {
204
+ const mem = { name: m.name };
205
+ if (m.metadata && m.metadata.length > 0) {
206
+ const md = {};
207
+ for (const p of m.metadata)
208
+ md[p.key] = serializeValueNode(p.value);
209
+ mem['metadata'] = md;
210
+ }
211
+ return mem;
212
+ }) };
213
+ case 'rule':
214
+ return {
215
+ id, kind: 'rule', name: item.name,
216
+ entity: this.resolveRefToId(item.entity, modName) ?? item.entity.join('.'),
217
+ condition: serializeExpression(item.condition),
218
+ message: item.message.join('.'),
219
+ };
220
+ case 'actor':
221
+ return { id, kind: 'actor', name: item.name, title: item.title ?? null, description: item.description ?? null };
222
+ case 'capability': {
223
+ const actors = item.actors?.map((a) => this.resolveRefToId(a, modName) ?? a.join('.')).sort() ?? [];
224
+ return { id, kind: 'capability', name: item.name, title: item.title ?? null, description: item.description ?? null, actors };
225
+ }
226
+ case 'workflow': {
227
+ const node = { id, kind: 'workflow', name: item.name };
228
+ if (item.capability)
229
+ node['capability'] = this.resolveRefToId(item.capability, modName);
230
+ if (item.authorization)
231
+ node['authorization'] = item.authorization.map((a) => ({
232
+ actor: this.resolveRefToId([a.actor], modName) ?? a.actor,
233
+ permissions: [...a.permissions],
234
+ }));
235
+ if (item.input)
236
+ node['input'] = serializeFields(item.input, modName, this.bind);
237
+ if (item.reads)
238
+ node['reads'] = item.reads.map((r) => this.resolveRefToId(r, modName) ?? r.join('.'));
239
+ if (item.writes)
240
+ node['writes'] = item.writes.map((w) => this.resolveRefToId(w, modName) ?? w.join('.'));
241
+ if (item.rules)
242
+ node['rules'] = item.rules.map((r) => this.resolveRefToId(r, modName) ?? r.join('.'));
243
+ if (item.steps)
244
+ node['steps'] = item.steps.map((s) => {
245
+ if (s.kind === 'call')
246
+ return { call: this.resolveRefToId(s.target, modName) ?? s.target.join('.') };
247
+ if (s.kind === 'fail')
248
+ return { fail: s.code };
249
+ return { decide: s.name, branches: s.branches.map((b) => ({
250
+ when: b.when, action: b.action.kind === 'call' ? { call: this.resolveRefToId(b.action.target, modName) ?? b.action.target.join('.') } : { fail: b.action.code },
251
+ })) };
252
+ });
253
+ if (item.transitions)
254
+ node['transitions'] = item.transitions.map((t) => ({
255
+ entity: this.resolveRefToId(t.entity, modName) ?? t.entity.join('.'),
256
+ field: t.field, from: t.from, to: t.to,
257
+ }));
258
+ if (item.effects)
259
+ node['effects'] = item.effects.map((e) => {
260
+ if (e.kind === 'audit')
261
+ return { audit: e.value };
262
+ if (e.kind === 'emit')
263
+ return { emit: this.resolveRefToId(e.value, modName) ?? e.value.join('.') };
264
+ if (e.kind === 'notify')
265
+ return { notify: this.resolveRefToId(e.value, modName) ?? e.value.join('.') };
266
+ /* v8 ignore next */
267
+ return { ref: e.value.join('.') };
268
+ });
269
+ if (item.returns)
270
+ node['returns'] = item.returns.map((r) => ({
271
+ name: r.name, type: resolveTypeRef(r.type, modName, this.bind),
272
+ }));
273
+ if (item.trigger)
274
+ node['trigger'] = this.resolveRefToId(item.trigger, modName);
275
+ return node;
276
+ }
277
+ case 'action':
278
+ return { id, kind: 'action', name: item.name, title: item.title ?? null, workflow: this.resolveRefToId(item.workflow ?? [], modName) ?? null };
279
+ case 'event':
280
+ return { id, kind: 'event', name: item.name, payload: item.payload ? resolveTypeRef(item.payload, modName, this.bind) : null, description: item.description ?? null };
281
+ case 'schedule':
282
+ return { id, kind: 'schedule', name: item.name, cron: item.cron ?? null, description: item.description ?? null };
283
+ case 'surface':
284
+ return {
285
+ id, kind: 'surface', name: item.name,
286
+ surface_kind: item.surfaceKind ?? null,
287
+ title: typeof item.title === 'string' ? item.title : item.title ? item.title.join('.') : null,
288
+ capability: item.capability ? (this.resolveRefToId(item.capability, modName) ?? null) : null,
289
+ binds: item.binds ? (this.resolveRefToId(item.binds, modName) ?? null) : null,
290
+ };
291
+ case 'rendering':
292
+ return { id, kind: 'rendering', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, platform: item.platform ?? null, layout: item.layout ?? null };
293
+ case 'tokens':
294
+ return { id, kind: 'tokens', name: item.name, categories: item.categories.map((c) => ({
295
+ name: c.name, tokens: c.tokens.map((t) => ({ name: t.name, value: serializeValueNode(t.value) })),
296
+ })) };
297
+ case 'theme':
298
+ return { id, kind: 'theme', name: item.name, extends: item.extends || null, overrides: item.overrides.map((c) => ({
299
+ name: c.name, tokens: c.tokens.map((t) => ({ name: t.name, value: serializeValueNode(t.value) })),
300
+ })) };
301
+ case 'strings':
302
+ return { id, kind: 'strings', name: item.name, entries: Object.fromEntries(item.entries.map((e) => [e.key, e.value])) };
303
+ case 'serialization':
304
+ return { id, kind: 'serialization', name: item.name, properties: Object.fromEntries(item.properties.map((p) => [p.key, serializeValueNode(p.value)])) };
305
+ case 'integration':
306
+ return { id, kind: 'integration', name: item.name, title: item.title ?? null, kind_type: item.integrationKind ?? null, protocol: item.protocol ?? null };
307
+ case 'transport':
308
+ return { id, kind: 'transport', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, protocol: item.protocol ?? null, style: item.style ?? null };
309
+ case 'storage':
310
+ return { id, kind: 'storage', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, model: item.model ?? null, table: item.table ?? null };
311
+ case 'execution':
312
+ return { id, kind: 'execution', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, mode: item.mode ?? null };
313
+ case 'extension':
314
+ return { id, kind: 'extension', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, kind_type: item.extensionKind ?? null, language: item.language ?? null, body: item.body ?? null };
315
+ case 'constitution':
316
+ return { id, kind: 'constitution', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [], policies: item.policies?.map((p) => ({ name: p.name, properties: Object.fromEntries(p.properties.map((pp) => [pp.key, serializeValueNode(pp.value)])) })) ?? [] };
317
+ case 'security':
318
+ return { id, kind: 'security', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [] };
319
+ case 'privacy':
320
+ return { id, kind: 'privacy', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [], classification: item.classification ?? null, retention: item.retention ?? null, exportable: item.exportable ?? null, erasable: item.erasable ?? null };
321
+ case 'validation':
322
+ return { id, kind: 'validation', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [] };
323
+ case 'secret':
324
+ return { id, kind: 'secret', name: item.name, source: item.source ?? null, description: item.description ?? null };
325
+ case 'environment':
326
+ return { id, kind: 'environment', name: item.name, url: item.url ?? null, description: item.description ?? null };
327
+ case 'deployment':
328
+ return { id, kind: 'deployment', name: item.name, environments: item.environments?.map((e) => this.resolveRefToId(e, modName) ?? e.join('.')) ?? [] };
329
+ case 'test':
330
+ return { id, kind: 'test', name: item.name, target: this.resolveRefToId(item.target, modName) ?? item.target.join('.'), description: item.description ?? null };
331
+ case 'product_ref':
332
+ return { id, kind: 'product_ref', name: item.name, product: item.product ?? null, version: item.version ?? null };
333
+ }
334
+ }
335
+ /* v8 ignore stop */
336
+ /* v8 ignore start — same V8 branch-tracking issue for if-guard chains */
337
+ emitEdgesForItem(item, id, modName) {
338
+ switch (item.kind) {
339
+ case 'entity':
340
+ case 'value':
341
+ for (const f of item.fields) {
342
+ this.emitTypeEdges(id, f.type, modName, 'field_type');
343
+ }
344
+ break;
345
+ case 'workflow':
346
+ if (item.capability)
347
+ this.addRefEdge(id, item.capability, modName, 'calls');
348
+ if (item.reads)
349
+ for (const r of item.reads)
350
+ this.addRefEdge(id, r, modName, 'reads');
351
+ if (item.writes)
352
+ for (const w of item.writes)
353
+ this.addRefEdge(id, w, modName, 'writes');
354
+ if (item.rules)
355
+ for (const r of item.rules)
356
+ this.addRefEdge(id, r, modName, 'uses_rule');
357
+ if (item.trigger)
358
+ this.addRefEdge(id, item.trigger, modName, 'triggers_on');
359
+ if (item.authorization) {
360
+ for (const a of item.authorization)
361
+ this.addRefEdge(id, [a.actor], modName, 'authorized_as');
362
+ }
363
+ if (item.effects) {
364
+ for (const e of item.effects) {
365
+ if (e.kind === 'emit' && Array.isArray(e.value))
366
+ this.addRefEdge(id, e.value, modName, 'emits');
367
+ if (e.kind === 'notify' && Array.isArray(e.value))
368
+ this.addRefEdge(id, e.value, modName, 'notifies');
369
+ }
370
+ }
371
+ if (item.transitions) {
372
+ for (const t of item.transitions)
373
+ this.addRefEdge(id, t.entity, modName, 'transitions');
374
+ }
375
+ if (item.input) {
376
+ for (const f of item.input)
377
+ this.emitTypeEdges(id, f.type, modName, 'input_type');
378
+ }
379
+ if (item.returns) {
380
+ for (const r of item.returns)
381
+ this.emitTypeEdges(id, r.type, modName, 'return_type');
382
+ }
383
+ break;
384
+ case 'action':
385
+ if (item.workflow)
386
+ this.addRefEdge(id, item.workflow, modName, 'invokes');
387
+ break;
388
+ case 'event':
389
+ if (item.payload)
390
+ this.emitTypeEdges(id, item.payload, modName, 'payload_type');
391
+ break;
392
+ case 'capability':
393
+ if (item.actors)
394
+ for (const a of item.actors)
395
+ this.addRefEdge(id, a, modName, 'member_of');
396
+ break;
397
+ case 'surface':
398
+ if (item.capability)
399
+ this.addRefEdge(id, item.capability, modName, 'calls');
400
+ if (item.binds)
401
+ this.addRefEdge(id, item.binds, modName, 'binds');
402
+ if (item.actions)
403
+ for (const a of item.actions)
404
+ this.addRefEdge(id, a, modName, 'exposes_action');
405
+ if (item.surfaces)
406
+ for (const s of item.surfaces)
407
+ this.addRefEdge(id, s, modName, 'contains_surface');
408
+ if (item.serialization)
409
+ this.addRefEdge(id, item.serialization, modName, 'uses_serialization');
410
+ if (item.rules)
411
+ for (const r of item.rules)
412
+ this.addRefEdge(id, r, modName, 'uses_rule');
413
+ if (item.hooks) {
414
+ for (const h of item.hooks) {
415
+ this.addRefEdge(id, h.target, modName, 'invokes');
416
+ }
417
+ }
418
+ break;
419
+ case 'rendering':
420
+ if (item.target)
421
+ this.addRefEdge(id, item.target, modName, 'targets_surface');
422
+ break;
423
+ case 'theme':
424
+ if (item.extends)
425
+ this.addRefEdge(id, [item.extends], modName, 'extends_tokens');
426
+ break;
427
+ case 'transport':
428
+ if (item.target)
429
+ this.addRefEdge(id, item.target, modName, 'attaches_to');
430
+ break;
431
+ case 'storage':
432
+ if (item.target)
433
+ this.addRefEdge(id, item.target, modName, 'refines_entity');
434
+ break;
435
+ case 'execution':
436
+ if (item.target)
437
+ this.addRefEdge(id, item.target, modName, 'attaches_to');
438
+ break;
439
+ case 'extension':
440
+ if (item.target)
441
+ this.addRefEdge(id, item.target, modName, 'attaches_to');
442
+ if (item.contract?.input)
443
+ this.emitTypeEdges(id, item.contract.input, modName, 'contract_type');
444
+ if (item.contract?.output)
445
+ this.emitTypeEdges(id, item.contract.output, modName, 'contract_type');
446
+ break;
447
+ case 'constitution':
448
+ if (item.appliesTo)
449
+ for (const r of item.appliesTo)
450
+ this.addRefEdge(id, r, modName, 'governs');
451
+ break;
452
+ case 'security':
453
+ if (item.appliesTo)
454
+ for (const r of item.appliesTo)
455
+ this.addRefEdge(id, r, modName, 'governs');
456
+ break;
457
+ case 'privacy':
458
+ if (item.appliesTo)
459
+ for (const r of item.appliesTo)
460
+ this.addRefEdge(id, r, modName, 'governs');
461
+ break;
462
+ case 'validation':
463
+ if (item.appliesTo)
464
+ for (const r of item.appliesTo)
465
+ this.addRefEdge(id, r, modName, 'governs');
466
+ break;
467
+ case 'environment':
468
+ if (item.secrets) {
469
+ for (const s of item.secrets) {
470
+ this.addRefEdge(id, [s.name], modName, 'binds_secret');
471
+ }
472
+ }
473
+ break;
474
+ case 'deployment':
475
+ if (item.environments)
476
+ for (const e of item.environments)
477
+ this.addRefEdge(id, e, modName, 'includes_env');
478
+ break;
479
+ case 'test':
480
+ if (item.target.length > 0)
481
+ this.addRefEdge(id, item.target, modName, 'tests');
482
+ break;
483
+ default:
484
+ break;
485
+ }
486
+ }
487
+ /* v8 ignore stop */
488
+ emitTypeEdges(fromId, type, modName, kind) {
489
+ if (type.kind === 'ref') {
490
+ this.addRefEdge(fromId, type.segments, modName, kind);
491
+ }
492
+ else if (type.kind === 'generic') {
493
+ this.emitTypeEdges(fromId, type.inner, modName, kind);
494
+ }
495
+ }
496
+ addRefEdge(fromId, segments, modName, kind) {
497
+ /* v8 ignore next */
498
+ if (segments.length === 0)
499
+ return;
500
+ const sym = resolveSymbolRef(segments, modName, this.bind.modules, this.bind.allSymbols);
501
+ if (sym) {
502
+ const toId = nodeId(sym.module, sym.nodeKind, sym.name);
503
+ this.addEdge(fromId, toId, kind);
504
+ }
505
+ }
506
+ resolveRefToId(segments, modName) {
507
+ if (segments.length === 0)
508
+ return null;
509
+ const sym = resolveSymbolRef(segments, modName, this.bind.modules, this.bind.allSymbols);
510
+ if (sym)
511
+ return nodeId(sym.module, sym.nodeKind, sym.name);
512
+ return null;
513
+ }
514
+ addEdge(from, to, kind) {
515
+ this.edges.push({ from, to, kind });
516
+ }
517
+ }
518
+ // ---------------------------------------------------------------------------
519
+ // Value serialization helper
520
+ // ---------------------------------------------------------------------------
521
+ function serializeValueNode(v) {
522
+ switch (v.kind) {
523
+ case 'string': return v['value'];
524
+ case 'integer': return v['value'];
525
+ case 'decimal': return v['value'];
526
+ case 'boolean': return v['value'];
527
+ case 'identifier': return v['value'];
528
+ case 'ref': return v['segments'].join('.');
529
+ case 'list': return v['items'].map(serializeValueNode);
530
+ /* v8 ignore next */
531
+ default: return null;
532
+ }
533
+ }
534
+ // ---------------------------------------------------------------------------
535
+ // Pluralization for category keys
536
+ // ---------------------------------------------------------------------------
537
+ function pluralize(kind) {
538
+ const map = {
539
+ entity: 'entities',
540
+ value: 'values',
541
+ enum: 'enums',
542
+ rule: 'rules',
543
+ actor: 'actors',
544
+ capability: 'capabilities',
545
+ workflow: 'workflows',
546
+ action: 'actions',
547
+ event: 'events',
548
+ schedule: 'schedules',
549
+ surface: 'surfaces',
550
+ rendering: 'renderings',
551
+ tokens: 'tokens',
552
+ theme: 'themes',
553
+ strings: 'strings',
554
+ serialization: 'serializations',
555
+ integration: 'integrations',
556
+ transport: 'transports',
557
+ storage: 'storages',
558
+ execution: 'executions',
559
+ extension: 'extensions',
560
+ constitution: 'constitutions',
561
+ security: 'securities',
562
+ privacy: 'privacies',
563
+ validation: 'validations',
564
+ secret: 'secrets',
565
+ environment: 'environments',
566
+ deployment: 'deployments',
567
+ test: 'tests',
568
+ product_ref: 'product_refs',
569
+ };
570
+ /* v8 ignore next */
571
+ return map[kind] ?? `${kind}s`;
572
+ }
573
+ //# sourceMappingURL=builder.js.map