@cristianormazabal/triton-core 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 (283) hide show
  1. package/dist/contracts/anchors.d.ts +150 -0
  2. package/dist/contracts/anchors.d.ts.map +1 -0
  3. package/dist/contracts/crosslink.d.ts +171 -0
  4. package/dist/contracts/crosslink.d.ts.map +1 -0
  5. package/dist/contracts/diagram.d.ts +107 -0
  6. package/dist/contracts/diagram.d.ts.map +1 -0
  7. package/dist/contracts/index.d.ts +29 -0
  8. package/dist/contracts/index.d.ts.map +1 -0
  9. package/dist/contracts/overlay.d.ts +98 -0
  10. package/dist/contracts/overlay.d.ts.map +1 -0
  11. package/dist/contracts/primitives.d.ts +42 -0
  12. package/dist/contracts/primitives.d.ts.map +1 -0
  13. package/dist/contracts/renderer.d.ts +21 -0
  14. package/dist/contracts/renderer.d.ts.map +1 -0
  15. package/dist/contracts/result.d.ts +32 -0
  16. package/dist/contracts/result.d.ts.map +1 -0
  17. package/dist/contracts/routing.d.ts +60 -0
  18. package/dist/contracts/routing.d.ts.map +1 -0
  19. package/dist/contracts/scene.d.ts +114 -0
  20. package/dist/contracts/scene.d.ts.map +1 -0
  21. package/dist/contracts/theme.d.ts +113 -0
  22. package/dist/contracts/theme.d.ts.map +1 -0
  23. package/dist/crosslink/engine2.d.ts +40 -0
  24. package/dist/crosslink/engine2.d.ts.map +1 -0
  25. package/dist/crosslink/engine3.d.ts +36 -0
  26. package/dist/crosslink/engine3.d.ts.map +1 -0
  27. package/dist/crosslink/index.d.ts +5 -0
  28. package/dist/crosslink/index.d.ts.map +1 -0
  29. package/dist/crosslink/render.d.ts +22 -0
  30. package/dist/crosslink/render.d.ts.map +1 -0
  31. package/dist/crosslink/resolve.d.ts +26 -0
  32. package/dist/crosslink/resolve.d.ts.map +1 -0
  33. package/dist/diagrams/architecture/index.d.ts +5 -0
  34. package/dist/diagrams/architecture/index.d.ts.map +1 -0
  35. package/dist/diagrams/architecture/ir.d.ts +29 -0
  36. package/dist/diagrams/architecture/ir.d.ts.map +1 -0
  37. package/dist/diagrams/architecture/layout.d.ts +11 -0
  38. package/dist/diagrams/architecture/layout.d.ts.map +1 -0
  39. package/dist/diagrams/block/index.d.ts +5 -0
  40. package/dist/diagrams/block/index.d.ts.map +1 -0
  41. package/dist/diagrams/block/ir.d.ts +22 -0
  42. package/dist/diagrams/block/ir.d.ts.map +1 -0
  43. package/dist/diagrams/block/layout.d.ts +12 -0
  44. package/dist/diagrams/block/layout.d.ts.map +1 -0
  45. package/dist/diagrams/c4/index.d.ts +5 -0
  46. package/dist/diagrams/c4/index.d.ts.map +1 -0
  47. package/dist/diagrams/c4/ir.d.ts +33 -0
  48. package/dist/diagrams/c4/ir.d.ts.map +1 -0
  49. package/dist/diagrams/c4/layout.d.ts +12 -0
  50. package/dist/diagrams/c4/layout.d.ts.map +1 -0
  51. package/dist/diagrams/class/index.d.ts +5 -0
  52. package/dist/diagrams/class/index.d.ts.map +1 -0
  53. package/dist/diagrams/class/ir.d.ts +32 -0
  54. package/dist/diagrams/class/ir.d.ts.map +1 -0
  55. package/dist/diagrams/class/layout.d.ts +13 -0
  56. package/dist/diagrams/class/layout.d.ts.map +1 -0
  57. package/dist/diagrams/ds/graph/graph.d.ts +39 -0
  58. package/dist/diagrams/ds/graph/graph.d.ts.map +1 -0
  59. package/dist/diagrams/ds/hashmap/hashmap.d.ts +39 -0
  60. package/dist/diagrams/ds/hashmap/hashmap.d.ts.map +1 -0
  61. package/dist/diagrams/ds/matrix/matrix.d.ts +33 -0
  62. package/dist/diagrams/ds/matrix/matrix.d.ts.map +1 -0
  63. package/dist/diagrams/ds/queue/cqueue.d.ts +31 -0
  64. package/dist/diagrams/ds/queue/cqueue.d.ts.map +1 -0
  65. package/dist/diagrams/ds/queue/deque.d.ts +24 -0
  66. package/dist/diagrams/ds/queue/deque.d.ts.map +1 -0
  67. package/dist/diagrams/ds/queue/pqueue.d.ts +29 -0
  68. package/dist/diagrams/ds/queue/pqueue.d.ts.map +1 -0
  69. package/dist/diagrams/ds/queue/queue.d.ts +27 -0
  70. package/dist/diagrams/ds/queue/queue.d.ts.map +1 -0
  71. package/dist/diagrams/ds/queue/shared.d.ts +35 -0
  72. package/dist/diagrams/ds/queue/shared.d.ts.map +1 -0
  73. package/dist/diagrams/ds/stack/stack.d.ts +28 -0
  74. package/dist/diagrams/ds/stack/stack.d.ts.map +1 -0
  75. package/dist/diagrams/ds/struct/array.d.ts +28 -0
  76. package/dist/diagrams/ds/struct/array.d.ts.map +1 -0
  77. package/dist/diagrams/ds/struct/linkedlist.d.ts +21 -0
  78. package/dist/diagrams/ds/struct/linkedlist.d.ts.map +1 -0
  79. package/dist/diagrams/ds/struct/memory.d.ts +44 -0
  80. package/dist/diagrams/ds/struct/memory.d.ts.map +1 -0
  81. package/dist/diagrams/ds/struct/page.d.ts +25 -0
  82. package/dist/diagrams/ds/struct/page.d.ts.map +1 -0
  83. package/dist/diagrams/ds/struct/shared.d.ts +9 -0
  84. package/dist/diagrams/ds/struct/shared.d.ts.map +1 -0
  85. package/dist/diagrams/ds/tree/avl.d.ts +14 -0
  86. package/dist/diagrams/ds/tree/avl.d.ts.map +1 -0
  87. package/dist/diagrams/ds/tree/btree.d.ts +12 -0
  88. package/dist/diagrams/ds/tree/btree.d.ts.map +1 -0
  89. package/dist/diagrams/ds/tree/build.d.ts +34 -0
  90. package/dist/diagrams/ds/tree/build.d.ts.map +1 -0
  91. package/dist/diagrams/ds/tree/heap.d.ts +12 -0
  92. package/dist/diagrams/ds/tree/heap.d.ts.map +1 -0
  93. package/dist/diagrams/ds/tree/index.d.ts +5 -0
  94. package/dist/diagrams/ds/tree/index.d.ts.map +1 -0
  95. package/dist/diagrams/ds/tree/ir.d.ts +29 -0
  96. package/dist/diagrams/ds/tree/ir.d.ts.map +1 -0
  97. package/dist/diagrams/ds/tree/layout.d.ts +13 -0
  98. package/dist/diagrams/ds/tree/layout.d.ts.map +1 -0
  99. package/dist/diagrams/ds/tree/plan.d.ts +11 -0
  100. package/dist/diagrams/ds/tree/plan.d.ts.map +1 -0
  101. package/dist/diagrams/ds/tree/radix.d.ts +12 -0
  102. package/dist/diagrams/ds/tree/radix.d.ts.map +1 -0
  103. package/dist/diagrams/ds/tree/rbtree.d.ts +12 -0
  104. package/dist/diagrams/ds/tree/rbtree.d.ts.map +1 -0
  105. package/dist/diagrams/ds/tree/segtree.d.ts +12 -0
  106. package/dist/diagrams/ds/tree/segtree.d.ts.map +1 -0
  107. package/dist/diagrams/ds/trie/trie.d.ts +17 -0
  108. package/dist/diagrams/ds/trie/trie.d.ts.map +1 -0
  109. package/dist/diagrams/ds/unionfind/unionfind.d.ts +34 -0
  110. package/dist/diagrams/ds/unionfind/unionfind.d.ts.map +1 -0
  111. package/dist/diagrams/er/index.d.ts +5 -0
  112. package/dist/diagrams/er/index.d.ts.map +1 -0
  113. package/dist/diagrams/er/ir.d.ts +28 -0
  114. package/dist/diagrams/er/ir.d.ts.map +1 -0
  115. package/dist/diagrams/er/layout.d.ts +12 -0
  116. package/dist/diagrams/er/layout.d.ts.map +1 -0
  117. package/dist/diagrams/flowchart/index.d.ts +5 -0
  118. package/dist/diagrams/flowchart/index.d.ts.map +1 -0
  119. package/dist/diagrams/flowchart/ir.d.ts +38 -0
  120. package/dist/diagrams/flowchart/ir.d.ts.map +1 -0
  121. package/dist/diagrams/flowchart/layout.d.ts +5 -0
  122. package/dist/diagrams/flowchart/layout.d.ts.map +1 -0
  123. package/dist/diagrams/gantt/index.d.ts +5 -0
  124. package/dist/diagrams/gantt/index.d.ts.map +1 -0
  125. package/dist/diagrams/gantt/ir.d.ts +25 -0
  126. package/dist/diagrams/gantt/ir.d.ts.map +1 -0
  127. package/dist/diagrams/gantt/layout.d.ts +12 -0
  128. package/dist/diagrams/gantt/layout.d.ts.map +1 -0
  129. package/dist/diagrams/gitgraph/index.d.ts +5 -0
  130. package/dist/diagrams/gitgraph/index.d.ts.map +1 -0
  131. package/dist/diagrams/gitgraph/ir.d.ts +31 -0
  132. package/dist/diagrams/gitgraph/ir.d.ts.map +1 -0
  133. package/dist/diagrams/gitgraph/layout.d.ts +12 -0
  134. package/dist/diagrams/gitgraph/layout.d.ts.map +1 -0
  135. package/dist/diagrams/journey/index.d.ts +5 -0
  136. package/dist/diagrams/journey/index.d.ts.map +1 -0
  137. package/dist/diagrams/journey/ir.d.ts +20 -0
  138. package/dist/diagrams/journey/ir.d.ts.map +1 -0
  139. package/dist/diagrams/journey/layout.d.ts +13 -0
  140. package/dist/diagrams/journey/layout.d.ts.map +1 -0
  141. package/dist/diagrams/kanban/index.d.ts +5 -0
  142. package/dist/diagrams/kanban/index.d.ts.map +1 -0
  143. package/dist/diagrams/kanban/ir.d.ts +18 -0
  144. package/dist/diagrams/kanban/ir.d.ts.map +1 -0
  145. package/dist/diagrams/kanban/layout.d.ts +12 -0
  146. package/dist/diagrams/kanban/layout.d.ts.map +1 -0
  147. package/dist/diagrams/mindmap/index.d.ts +5 -0
  148. package/dist/diagrams/mindmap/index.d.ts.map +1 -0
  149. package/dist/diagrams/mindmap/ir.d.ts +15 -0
  150. package/dist/diagrams/mindmap/ir.d.ts.map +1 -0
  151. package/dist/diagrams/mindmap/layout.d.ts +12 -0
  152. package/dist/diagrams/mindmap/layout.d.ts.map +1 -0
  153. package/dist/diagrams/packet/index.d.ts +5 -0
  154. package/dist/diagrams/packet/index.d.ts.map +1 -0
  155. package/dist/diagrams/packet/ir.d.ts +15 -0
  156. package/dist/diagrams/packet/ir.d.ts.map +1 -0
  157. package/dist/diagrams/packet/layout.d.ts +12 -0
  158. package/dist/diagrams/packet/layout.d.ts.map +1 -0
  159. package/dist/diagrams/pie/index.d.ts +5 -0
  160. package/dist/diagrams/pie/index.d.ts.map +1 -0
  161. package/dist/diagrams/pie/ir.d.ts +16 -0
  162. package/dist/diagrams/pie/ir.d.ts.map +1 -0
  163. package/dist/diagrams/pie/layout.d.ts +12 -0
  164. package/dist/diagrams/pie/layout.d.ts.map +1 -0
  165. package/dist/diagrams/poster/index.d.ts +5 -0
  166. package/dist/diagrams/poster/index.d.ts.map +1 -0
  167. package/dist/diagrams/poster/ir.d.ts +46 -0
  168. package/dist/diagrams/poster/ir.d.ts.map +1 -0
  169. package/dist/diagrams/poster/layout.d.ts +8 -0
  170. package/dist/diagrams/poster/layout.d.ts.map +1 -0
  171. package/dist/diagrams/quadrant/index.d.ts +5 -0
  172. package/dist/diagrams/quadrant/index.d.ts.map +1 -0
  173. package/dist/diagrams/quadrant/ir.d.ts +23 -0
  174. package/dist/diagrams/quadrant/ir.d.ts.map +1 -0
  175. package/dist/diagrams/quadrant/layout.d.ts +12 -0
  176. package/dist/diagrams/quadrant/layout.d.ts.map +1 -0
  177. package/dist/diagrams/radar/index.d.ts +5 -0
  178. package/dist/diagrams/radar/index.d.ts.map +1 -0
  179. package/dist/diagrams/radar/ir.d.ts +22 -0
  180. package/dist/diagrams/radar/ir.d.ts.map +1 -0
  181. package/dist/diagrams/radar/layout.d.ts +12 -0
  182. package/dist/diagrams/radar/layout.d.ts.map +1 -0
  183. package/dist/diagrams/requirement/index.d.ts +5 -0
  184. package/dist/diagrams/requirement/index.d.ts.map +1 -0
  185. package/dist/diagrams/requirement/ir.d.ts +25 -0
  186. package/dist/diagrams/requirement/ir.d.ts.map +1 -0
  187. package/dist/diagrams/requirement/layout.d.ts +12 -0
  188. package/dist/diagrams/requirement/layout.d.ts.map +1 -0
  189. package/dist/diagrams/sankey/index.d.ts +5 -0
  190. package/dist/diagrams/sankey/index.d.ts.map +1 -0
  191. package/dist/diagrams/sankey/ir.d.ts +15 -0
  192. package/dist/diagrams/sankey/ir.d.ts.map +1 -0
  193. package/dist/diagrams/sankey/layout.d.ts +12 -0
  194. package/dist/diagrams/sankey/layout.d.ts.map +1 -0
  195. package/dist/diagrams/sequence/index.d.ts +5 -0
  196. package/dist/diagrams/sequence/index.d.ts.map +1 -0
  197. package/dist/diagrams/sequence/ir.d.ts +47 -0
  198. package/dist/diagrams/sequence/ir.d.ts.map +1 -0
  199. package/dist/diagrams/sequence/layout.d.ts +13 -0
  200. package/dist/diagrams/sequence/layout.d.ts.map +1 -0
  201. package/dist/diagrams/state/index.d.ts +5 -0
  202. package/dist/diagrams/state/index.d.ts.map +1 -0
  203. package/dist/diagrams/state/ir.d.ts +28 -0
  204. package/dist/diagrams/state/ir.d.ts.map +1 -0
  205. package/dist/diagrams/state/layout.d.ts +12 -0
  206. package/dist/diagrams/state/layout.d.ts.map +1 -0
  207. package/dist/diagrams/timeline/index.d.ts +7 -0
  208. package/dist/diagrams/timeline/index.d.ts.map +1 -0
  209. package/dist/diagrams/timeline/ir.d.ts +47 -0
  210. package/dist/diagrams/timeline/ir.d.ts.map +1 -0
  211. package/dist/diagrams/timeline/layout.d.ts +5 -0
  212. package/dist/diagrams/timeline/layout.d.ts.map +1 -0
  213. package/dist/diagrams/timeline/numbered.d.ts +16 -0
  214. package/dist/diagrams/timeline/numbered.d.ts.map +1 -0
  215. package/dist/diagrams/timeline/roadmap.d.ts +18 -0
  216. package/dist/diagrams/timeline/roadmap.d.ts.map +1 -0
  217. package/dist/diagrams/timeline/serpentine.d.ts +20 -0
  218. package/dist/diagrams/timeline/serpentine.d.ts.map +1 -0
  219. package/dist/diagrams/timeline/shared.d.ts +37 -0
  220. package/dist/diagrams/timeline/shared.d.ts.map +1 -0
  221. package/dist/diagrams/timeline/timeline-columns.d.ts +19 -0
  222. package/dist/diagrams/timeline/timeline-columns.d.ts.map +1 -0
  223. package/dist/diagrams/timeline/vertical-spine.d.ts +21 -0
  224. package/dist/diagrams/timeline/vertical-spine.d.ts.map +1 -0
  225. package/dist/diagrams/topology/topology.d.ts +47 -0
  226. package/dist/diagrams/topology/topology.d.ts.map +1 -0
  227. package/dist/diagrams/xychart/index.d.ts +5 -0
  228. package/dist/diagrams/xychart/index.d.ts.map +1 -0
  229. package/dist/diagrams/xychart/ir.d.ts +21 -0
  230. package/dist/diagrams/xychart/ir.d.ts.map +1 -0
  231. package/dist/diagrams/xychart/layout.d.ts +12 -0
  232. package/dist/diagrams/xychart/layout.d.ts.map +1 -0
  233. package/dist/frontend/detect.d.ts +7 -0
  234. package/dist/frontend/detect.d.ts.map +1 -0
  235. package/dist/frontend/index.d.ts +44 -0
  236. package/dist/frontend/index.d.ts.map +1 -0
  237. package/dist/frontend/registry.d.ts +21 -0
  238. package/dist/frontend/registry.d.ts.map +1 -0
  239. package/dist/graph/connect.d.ts +39 -0
  240. package/dist/graph/connect.d.ts.map +1 -0
  241. package/dist/graph/layered.d.ts +43 -0
  242. package/dist/graph/layered.d.ts.map +1 -0
  243. package/dist/graph/tree.d.ts +41 -0
  244. package/dist/graph/tree.d.ts.map +1 -0
  245. package/dist/index.d.ts +9 -0
  246. package/dist/index.d.ts.map +1 -0
  247. package/dist/index.js +41345 -0
  248. package/dist/index.js.map +7 -0
  249. package/dist/overlay/apply.d.ts +15 -0
  250. package/dist/overlay/apply.d.ts.map +1 -0
  251. package/dist/overlay/compiler.d.ts +10 -0
  252. package/dist/overlay/compiler.d.ts.map +1 -0
  253. package/dist/overlay/layout.d.ts +16 -0
  254. package/dist/overlay/layout.d.ts.map +1 -0
  255. package/dist/palette/categorical.d.ts +15 -0
  256. package/dist/palette/categorical.d.ts.map +1 -0
  257. package/dist/render/registry.d.ts +15 -0
  258. package/dist/render/registry.d.ts.map +1 -0
  259. package/dist/render/svg.d.ts +11 -0
  260. package/dist/render/svg.d.ts.map +1 -0
  261. package/dist/routing/registry.d.ts +16 -0
  262. package/dist/routing/registry.d.ts.map +1 -0
  263. package/dist/routing/router.d.ts +10 -0
  264. package/dist/routing/router.d.ts.map +1 -0
  265. package/dist/scene/build.d.ts +45 -0
  266. package/dist/scene/build.d.ts.map +1 -0
  267. package/dist/scene/strip.d.ts +39 -0
  268. package/dist/scene/strip.d.ts.map +1 -0
  269. package/dist/style/cost.d.ts +35 -0
  270. package/dist/style/cost.d.ts.map +1 -0
  271. package/dist/text/metrics.d.ts +19 -0
  272. package/dist/text/metrics.d.ts.map +1 -0
  273. package/dist/text/wrap.d.ts +21 -0
  274. package/dist/text/wrap.d.ts.map +1 -0
  275. package/dist/theme/preset.d.ts +29 -0
  276. package/dist/theme/preset.d.ts.map +1 -0
  277. package/dist/theme/resolver.d.ts +7 -0
  278. package/dist/theme/resolver.d.ts.map +1 -0
  279. package/dist/time/dates.d.ts +72 -0
  280. package/dist/time/dates.d.ts.map +1 -0
  281. package/dist/util/round.d.ts +12 -0
  282. package/dist/util/round.d.ts.map +1 -0
  283. package/package.json +42 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Result
3
+ *
4
+ * A discriminated union for all public API return values.
5
+ *
6
+ * All public-facing functions (render, compile) return Result<T> instead
7
+ * of throwing. Internal functions may still throw — errors are caught at
8
+ * the pipeline boundary and wrapped into Err values.
9
+ *
10
+ * Usage:
11
+ * const result = await render(input);
12
+ * if (!result.ok) { console.error(result.error.message); return; }
13
+ * console.log(result.value); // string
14
+ */
15
+ export type DiagramErrorCode = 'PARSE_ERROR' | 'LAYOUT_ERROR' | 'UNKNOWN_DIAGRAM' | 'UNSUPPORTED_FORMAT' | 'UNKNOWN_RENDERER';
16
+ export interface DiagramError {
17
+ readonly code: DiagramErrorCode;
18
+ readonly message: string;
19
+ readonly cause?: unknown;
20
+ }
21
+ export type Result<T> = {
22
+ readonly ok: true;
23
+ readonly value: T;
24
+ } | {
25
+ readonly ok: false;
26
+ readonly error: DiagramError;
27
+ };
28
+ /** Construct a successful result. */
29
+ export declare function ok<T>(value: T): Result<T>;
30
+ /** Construct a failed result. */
31
+ export declare function err(code: DiagramErrorCode, message: string, cause?: unknown): Result<never>;
32
+ //# sourceMappingURL=result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/contracts/result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,IAChB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACzC;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAAC;AAEzD,qCAAqC;AACrC,wBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAEzC;AAED,iCAAiC;AACjC,wBAAgB,GAAG,CACjB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,OAAO,GACd,MAAM,CAAC,KAAK,CAAC,CAKf"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Routing
3
+ *
4
+ * Contracts for edge-path routing algorithms.
5
+ *
6
+ * Defines what routing algorithms accept and return.
7
+ * All graph-based diagrams (flow, state, ER, class, …) use a common
8
+ * routing contract so layout engines can swap algorithms without
9
+ * changing their own interface.
10
+ *
11
+ * No routing logic lives here — only the shapes that implementations must satisfy.
12
+ */
13
+ import type { Point, Rect } from './primitives.js';
14
+ /**
15
+ * Cardinal direction the port faces — the direction traffic should
16
+ * flow when leaving (fromDir) or arriving at (toDir) the anchor.
17
+ */
18
+ export type PortDirection = 'N' | 'S' | 'E' | 'W';
19
+ /**
20
+ * The geometric style of a computed route.
21
+ *
22
+ * straight — direct line from source to target.
23
+ * orthogonal — axis-aligned segments (L/Z shape), routes around obstacles.
24
+ * bezier — smooth cubic bezier curve.
25
+ * polyline — straight segments between explicit waypoints.
26
+ */
27
+ export type RouteStyle = 'straight' | 'orthogonal' | 'bezier' | 'polyline';
28
+ export interface RouteRequest {
29
+ /** Source anchor point (center of source node edge). */
30
+ readonly from: Point;
31
+ /** Target anchor point (center of target node edge). */
32
+ readonly to: Point;
33
+ readonly style: RouteStyle;
34
+ /** Bounding boxes of other nodes to route around. */
35
+ readonly obstacles: ReadonlyArray<Rect>;
36
+ /** Minimum clearance from obstacle edges in px. */
37
+ readonly padding: number;
38
+ /** Bezier only — curve tension in [0, 1]. Default 0.4. */
39
+ readonly tension?: number;
40
+ /** Direction the exit port faces. Hint for orthogonal/bezier routing. */
41
+ readonly fromDir?: PortDirection;
42
+ /** Direction the entry port faces. Hint for orthogonal/bezier routing. */
43
+ readonly toDir?: PortDirection;
44
+ }
45
+ export interface Route {
46
+ /** Ordered waypoints from source to target, including endpoints. */
47
+ readonly points: ReadonlyArray<Point>;
48
+ /** Fully resolved SVG path data string, ready for a <path d="...">. */
49
+ readonly path: string;
50
+ /** Suggested position for an edge label — typically the route midpoint. */
51
+ readonly labelPosition: Point;
52
+ }
53
+ /**
54
+ * A routing algorithm must satisfy this interface.
55
+ * Layout engines depend on this, not on a concrete implementation.
56
+ */
57
+ export interface Router {
58
+ route(request: RouteRequest): Route;
59
+ }
60
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../../src/contracts/routing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAInD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAIlD;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;AAI3E,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IACxC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC;AAID,MAAM,WAAW,KAAK;IACpB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC;CAC/B;AAID;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,KAAK,CAAC;CACrC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Scene
3
+ *
4
+ * The universal render-ready intermediate representation.
5
+ *
6
+ * Every DiagramLayoutEngine produces a Scene. Every renderer (SVG, PNG,
7
+ * canvas, PDF) consumes a Scene. Neither side knows anything about the other.
8
+ *
9
+ * Design rules:
10
+ * - Every property must be fully resolved — no "inherit", no "auto",
11
+ * no unresolved references. The Scene is ready to paint as-is.
12
+ * - Scene elements are immutable value objects (all readonly).
13
+ * - Scene carries no semantic information (no diagram type, no grammar
14
+ * concepts, no overlay specs). It is pure geometry and style.
15
+ * - Elements are ordered back-to-front (painter's algorithm).
16
+ */
17
+ import type { Color, FontFamily, FontWeight, Point, Rect, TextAnchor } from './primitives.js';
18
+ export interface SceneRect {
19
+ readonly type: 'rect';
20
+ readonly bounds: Rect;
21
+ readonly fill: Color;
22
+ readonly stroke: Color;
23
+ readonly strokeWidth: number;
24
+ readonly rx?: number;
25
+ readonly opacity?: number;
26
+ }
27
+ export interface SceneCircle {
28
+ readonly type: 'circle';
29
+ readonly center: Point;
30
+ readonly radius: number;
31
+ readonly fill: Color;
32
+ readonly stroke: Color;
33
+ readonly strokeWidth: number;
34
+ readonly opacity?: number;
35
+ }
36
+ export interface ScenePath {
37
+ readonly type: 'path';
38
+ /** Fully resolved SVG path data string. */
39
+ readonly d: string;
40
+ readonly fill?: Color;
41
+ readonly stroke: Color;
42
+ readonly strokeWidth: number;
43
+ readonly strokeDasharray?: string;
44
+ /**
45
+ * Marker def ID (without the `url(#...)` wrapper) — the renderer adds that.
46
+ * The def itself must appear in Scene.defs.
47
+ */
48
+ readonly markerEnd?: string;
49
+ readonly markerStart?: string;
50
+ readonly opacity?: number;
51
+ /**
52
+ * When set, the SVG renderer emits a SMIL animation on this path.
53
+ *
54
+ * 'march' — animates stroke-dashoffset by one full dash+gap period,
55
+ * producing "marching ants" flow. Requires strokeDasharray;
56
+ * silently ignored on solid paths.
57
+ * 'particle' — emits a sibling <circle> with <animateMotion> that travels
58
+ * along the path. Works on any edge style.
59
+ *
60
+ * Both degrade cleanly in rsvg-convert (SMIL ignored → static line/dot).
61
+ */
62
+ readonly animated?: 'march' | 'particle';
63
+ }
64
+ export interface SceneText {
65
+ readonly type: 'text';
66
+ readonly content: string;
67
+ readonly position: Point;
68
+ readonly fontSize: number;
69
+ readonly fontFamily: FontFamily;
70
+ readonly fontWeight?: FontWeight;
71
+ readonly fill: Color;
72
+ readonly anchor?: TextAnchor;
73
+ readonly opacity?: number;
74
+ }
75
+ /**
76
+ * SceneGroup — a logical grouping of elements.
77
+ *
78
+ * Groups exist for two purposes:
79
+ * 1. Applying a shared transform (e.g. translate a composed sub-diagram).
80
+ * 2. Providing a stable anchor ID for overlay connectors.
81
+ *
82
+ * Groups must not be used for visual styling — use explicit element properties.
83
+ */
84
+ export interface SceneGroup {
85
+ readonly type: 'group';
86
+ /** Stable identifier. Required when this group is an overlay anchor target. */
87
+ readonly id?: string;
88
+ readonly children: readonly SceneElement[];
89
+ readonly transform?: string;
90
+ readonly opacity?: number;
91
+ }
92
+ /** Discriminated union of everything a renderer knows how to paint. */
93
+ export type SceneElement = SceneRect | SceneCircle | ScenePath | SceneText | SceneGroup;
94
+ /**
95
+ * The complete, self-contained output of a layout pass.
96
+ *
97
+ * Immutable after construction. Renderers must not mutate it.
98
+ * All overlay geometry (annotations, legends) has already been resolved
99
+ * into elements[] before this object is produced.
100
+ */
101
+ export interface Scene {
102
+ /** The coordinate viewport. Origin is top-left; y grows downward. */
103
+ readonly viewBox: Rect;
104
+ /** Background fill. Absent means transparent. */
105
+ readonly background?: Color;
106
+ /** Ordered elements, painted back-to-front. */
107
+ readonly elements: readonly SceneElement[];
108
+ /**
109
+ * Raw SVG <defs> content — marker definitions, gradients, clip paths.
110
+ * Renderers emit these verbatim inside a <defs> block.
111
+ */
112
+ readonly defs?: readonly string[];
113
+ }
114
+ //# sourceMappingURL=scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../../../src/contracts/scene.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Theme
3
+ *
4
+ * The unified visual configuration contract.
5
+ *
6
+ * One ResolvedTheme applies uniformly to every diagram type.
7
+ * No diagram gets private theme keys — all visual tokens are defined here.
8
+ * This guarantees that switching themes affects all diagrams identically.
9
+ *
10
+ * Two shapes exist:
11
+ * ThemeInput — what users/callers provide (all fields optional).
12
+ * ResolvedTheme — what layout engines consume (all fields required).
13
+ *
14
+ * A theme resolver (not defined here — that is implementation) merges a
15
+ * ThemeInput over a base preset to produce a ResolvedTheme.
16
+ */
17
+ import type { Color, FontFamily } from './primitives.js';
18
+ export interface ThemePalette {
19
+ /** Primary accent — edges, active indicators, highlights. */
20
+ readonly primary: Color;
21
+ /** Secondary accent — secondary highlights, badges. */
22
+ readonly secondary: Color;
23
+ /** Canvas / page background. */
24
+ readonly background: Color;
25
+ /** Node / card fill. */
26
+ readonly surface: Color;
27
+ /** Default border and stroke. */
28
+ readonly border: Color;
29
+ /** Primary readable text. */
30
+ readonly text: Color;
31
+ /** De-emphasised / secondary text. */
32
+ readonly textMuted: Color;
33
+ /** Semantic: success state. */
34
+ readonly success: Color;
35
+ /** Semantic: warning state. */
36
+ readonly warning: Color;
37
+ /** Semantic: error / blocked state. */
38
+ readonly error: Color;
39
+ }
40
+ export interface ThemeTypography {
41
+ readonly fontFamily: FontFamily;
42
+ readonly monoFamily: FontFamily;
43
+ /** Base body text size in px. */
44
+ readonly baseFontSize: number;
45
+ /** Diagram title / section heading size in px. */
46
+ readonly titleFontSize: number;
47
+ /** Labels, captions, timestamps in px. */
48
+ readonly smallFontSize: number;
49
+ /** Line height multiplier (unitless, e.g. 1.4). */
50
+ readonly lineHeight: number;
51
+ }
52
+ export interface ThemeSpacing {
53
+ /** Base grid unit in px. All spacing should be multiples of this. */
54
+ readonly unit: number;
55
+ /** Padding inside node/card shapes. */
56
+ readonly nodePadding: number;
57
+ /** Gap between adjacent nodes. */
58
+ readonly nodeGap: number;
59
+ /** Margin between the diagram content and the viewBox edge. */
60
+ readonly diagramMargin: number;
61
+ }
62
+ export interface ThemeEdges {
63
+ /** Default edge stroke width in px. */
64
+ readonly strokeWidth: number;
65
+ /** Arrowhead size in px. */
66
+ readonly arrowSize: number;
67
+ /** Font size for edge labels in px. */
68
+ readonly labelFontSize: number;
69
+ /** Bezier curve tension, 0 (straight) to 1 (full arc). */
70
+ readonly curveTension: number;
71
+ }
72
+ /**
73
+ * Titled-container chrome — how the title of a framed panel is placed and
74
+ * decorated. Applies to any diagram that draws a titled box: poster cells
75
+ * today, flowchart subgraphs / timeline sections tomorrow.
76
+ */
77
+ export interface ThemePanel {
78
+ /** Horizontal alignment of the panel title within the panel width. */
79
+ readonly titleAlign: 'left' | 'center' | 'right';
80
+ /**
81
+ * Vertical placement of the title relative to the panel's top edge:
82
+ * 'inside' — sits below the top edge, inside the panel (default).
83
+ * 'on-border' — straddles the top edge line (tab / caption look).
84
+ * 'above' — floats just above the top edge, outside the panel.
85
+ */
86
+ readonly titlePosition: 'inside' | 'on-border' | 'above';
87
+ /**
88
+ * Decorative container drawn behind the title:
89
+ * 'none' — bare text.
90
+ * 'box' — rounded rectangle.
91
+ * 'pill' — fully-rounded capsule.
92
+ */
93
+ readonly titleChrome: 'none' | 'box' | 'pill';
94
+ }
95
+ /** Fully resolved — every field is present and required. Layout engines receive this. */
96
+ export interface ResolvedTheme {
97
+ readonly name: string;
98
+ readonly palette: ThemePalette;
99
+ readonly typography: ThemeTypography;
100
+ readonly spacing: ThemeSpacing;
101
+ readonly edges: ThemeEdges;
102
+ readonly panel: ThemePanel;
103
+ }
104
+ /** Partial override — merged with a base preset by the theme resolver. */
105
+ export type ThemeInput = {
106
+ readonly name?: string;
107
+ readonly palette?: Partial<ThemePalette>;
108
+ readonly typography?: Partial<ThemeTypography>;
109
+ readonly spacing?: Partial<ThemeSpacing>;
110
+ readonly edges?: Partial<ThemeEdges>;
111
+ readonly panel?: Partial<ThemePanel>;
112
+ };
113
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/contracts/theme.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Cross-Link Engine v2 — Global Cost-Function Routing
3
+ *
4
+ * Replaces the two-step resolve.ts + render.ts pipeline with a single unified
5
+ * pass that uses a global cost function for port selection.
6
+ *
7
+ * Architecture:
8
+ * 1. For each link, generate all 16 (srcWall × dstWall) port-pair candidates
9
+ * 2. Score each candidate against already-committed routes using a unified
10
+ * cost function: side preference, crossing count, port conflict, bend
11
+ * count, path length, and alignment penalty
12
+ * 3. Commit the best candidate greedily (longest links first, so the most
13
+ * spatially constrained routes claim cleaner corridors first)
14
+ * 4. Post-route: border nudge → channel separation → label stagger → label de-collision
15
+ *
16
+ * Cost function:
17
+ * cost = W_CROSS × crossings(candidate, committed_routes)
18
+ * + W_SIDE × wrong_side_penalty(srcWall, dstWall, Δx, Δy)
19
+ * + W_PORT × port_conflict_penalty(ports, committed_ports)
20
+ * + W_BENDS × bend_count
21
+ * + W_LEN × path_length
22
+ * + W_ALIGN × alignment_penalty (short jog segments < SNAP_THRESHOLD)
23
+ */
24
+ import type { SceneElement } from '../contracts/scene.js';
25
+ import type { CrossLink, TraceRecord } from '../contracts/crosslink.js';
26
+ import type { NodeAnchorRegistry } from '../contracts/anchors.js';
27
+ import type { Rect } from '../contracts/primitives.js';
28
+ import type { ResolvedTheme } from '../contracts/theme.js';
29
+ export interface CrossLinkRenderResult {
30
+ readonly defs: string[];
31
+ readonly elements: SceneElement[];
32
+ }
33
+ /**
34
+ * Unified routing + rendering pass for all cross-links in a poster.
35
+ *
36
+ * Drop-in replacement for `resolveCrossLinks` + `renderCrossLinks` but takes
37
+ * the raw CrossLink array instead of pre-resolved port positions.
38
+ */
39
+ export declare function routeAndRenderCrossLinks2(links: readonly CrossLink[], traces: readonly TraceRecord[], theme: ResolvedTheme, anchors: NodeAnchorRegistry, occupiedRects?: readonly Rect[], routingObstacles?: readonly Rect[], cellRects?: ReadonlyMap<string, Rect>): CrossLinkRenderResult;
40
+ //# sourceMappingURL=engine2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine2.d.ts","sourceRoot":"","sources":["../../../../src/crosslink/engine2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAsB,MAAM,2BAA2B,CAAC;AAC5F,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;CACnC;AA6DD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,kBAAkB,EAC3B,aAAa,CAAC,EAAE,SAAS,IAAI,EAAE,EAC/B,gBAAgB,CAAC,EAAE,SAAS,IAAI,EAAE,EAClC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GACpC,qBAAqB,CAqVvB"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Cross-Link Engine v3 — Global Cost-Function Routing
3
+ *
4
+ * Passes:
5
+ * 0. Port assign Global: shared-endpoint t values sorted by angular order
6
+ * 1. Sort Axis-aligned first; longest within group
7
+ * 2. Route Greedy: search collapsed by phase-0 hints for shared ports
8
+ * 3. Repair Find crossing pairs, re-route lower-priority links
9
+ * 4. Channel sep Spread parallel overlapping segments
10
+ * 5. Labels Stagger + de-collision
11
+ * 6. Emit SVG path strings (L for orthogonal, C for bezier)
12
+ *
13
+ * Cost function:
14
+ * W_CROSS × crossings — H/V decomposition for orthogonal pairs
15
+ * W_INTER × cross-link port conflict
16
+ * W_SIDE × wrong-side wall
17
+ * W_INTRA × intra-diagram port conflict (softer — can be overridden)
18
+ * W_BEND × excess bends
19
+ * W_LEN × path length
20
+ * W_ALIGN × short jog segments (orthogonal only)
21
+ *
22
+ * Crossing detection:
23
+ * Orthogonal ↔ orthogonal: H/V decomposition, O(1) per segment pair
24
+ * Mixed/bezier: sampled polyline + AABB prefilter + segment intersection
25
+ */
26
+ import type { SceneElement } from '../contracts/scene.js';
27
+ import type { CrossLink, TraceRecord } from '../contracts/crosslink.js';
28
+ import type { NodeAnchorRegistry, OccupiedPort } from '../contracts/anchors.js';
29
+ import type { Rect } from '../contracts/primitives.js';
30
+ import type { ResolvedTheme } from '../contracts/theme.js';
31
+ export interface CrossLinkRenderResult {
32
+ readonly defs: string[];
33
+ readonly elements: SceneElement[];
34
+ }
35
+ export declare function routeAndRenderCrossLinks3(links: readonly CrossLink[], traces: readonly TraceRecord[], theme: ResolvedTheme, anchors: NodeAnchorRegistry, intraPorts?: readonly OccupiedPort[], occupiedRects?: readonly Rect[], routingObstacles?: readonly Rect[], cellRects?: ReadonlyMap<string, Rect>): CrossLinkRenderResult;
36
+ //# sourceMappingURL=engine3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine3.d.ts","sourceRoot":"","sources":["../../../../src/crosslink/engine3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAgB,kBAAkB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,KAAK,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAM,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;CACnC;AA6ED,wBAAgB,yBAAyB,CACvC,KAAK,EAAc,SAAS,SAAS,EAAE,EACvC,MAAM,EAAa,SAAS,WAAW,EAAE,EACzC,KAAK,EAAc,aAAa,EAChC,OAAO,EAAY,kBAAkB,EACrC,UAAU,CAAC,EAAQ,SAAS,YAAY,EAAE,EAC1C,aAAa,CAAC,EAAK,SAAS,IAAI,EAAE,EAClC,gBAAgB,CAAC,EAAE,SAAS,IAAI,EAAE,EAClC,SAAS,CAAC,EAAS,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GAC3C,qBAAqB,CAuOvB"}
@@ -0,0 +1,5 @@
1
+ export { resolveCrossLinks } from './resolve.js';
2
+ export type { ResolutionResult, ResolutionDiagnostic } from './resolve.js';
3
+ export { renderCrossLinks } from './render.js';
4
+ export type { CrossLinkRenderResult } from './render.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/crosslink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Cross-Link Rendering
3
+ *
4
+ * Converts resolved cross-links into SceneElements (paths + labels)
5
+ * that are layered on top of the poster's cell elements.
6
+ *
7
+ * Routes use the orthogonal router with port-direction hints from the
8
+ * resolved link's fromSide/toSide.
9
+ */
10
+ import type { SceneElement } from '../contracts/scene.js';
11
+ import type { ResolvedCrossLink, TraceRecord } from '../contracts/crosslink.js';
12
+ import type { NodeAnchorRegistry } from '../contracts/anchors.js';
13
+ import type { Rect } from '../contracts/primitives.js';
14
+ import type { ResolvedTheme } from '../contracts/theme.js';
15
+ export interface CrossLinkRenderResult {
16
+ /** SVG defs needed (e.g. arrowhead markers for cross-links). */
17
+ readonly defs: string[];
18
+ /** Scene elements: paths, labels, grouped per link. */
19
+ readonly elements: SceneElement[];
20
+ }
21
+ export declare function renderCrossLinks(resolved: readonly ResolvedCrossLink[], traces: readonly TraceRecord[], theme: ResolvedTheme, anchors?: NodeAnchorRegistry, occupiedRects?: readonly Rect[], routingObstacles?: readonly Rect[], cellRects?: ReadonlyMap<string, Rect>): CrossLinkRenderResult;
22
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/crosslink/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAsB,MAAM,2BAA2B,CAAC;AACpG,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;CACnC;AAsBD,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EACtC,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,KAAK,EAAE,aAAa,EACpB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,aAAa,CAAC,EAAE,SAAS,IAAI,EAAE,EAC/B,gBAAgB,CAAC,EAAE,SAAS,IAAI,EAAE,EAClC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GACpC,qBAAqB,CA6PvB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Cross-Link Resolution
3
+ *
4
+ * Resolves declared CrossLinks against a poster's merged NodeAnchorRegistry.
5
+ * For each link, finds both endpoint anchors and selects the optimal port pair
6
+ * (minimising euclidean distance between available ports).
7
+ *
8
+ * Inputs: CrossLink[] + NodeAnchorRegistry (in poster coordinates)
9
+ * Outputs: ResolvedCrossLink[] (ready for routing)
10
+ *
11
+ * Links with unresolvable addresses (missing cells/nodes) are skipped
12
+ * with a diagnostic message — they never crash the layout.
13
+ */
14
+ import type { Rect } from '../contracts/primitives.js';
15
+ import type { NodeAnchorRegistry } from '../contracts/anchors.js';
16
+ import type { CrossLink, ResolvedCrossLink } from '../contracts/crosslink.js';
17
+ export interface ResolutionResult {
18
+ readonly resolved: ResolvedCrossLink[];
19
+ readonly diagnostics: ResolutionDiagnostic[];
20
+ }
21
+ export interface ResolutionDiagnostic {
22
+ readonly linkIndex: number;
23
+ readonly message: string;
24
+ }
25
+ export declare function resolveCrossLinks(links: readonly CrossLink[], anchors: NodeAnchorRegistry, cellRects?: ReadonlyMap<string, Rect>): ResolutionResult;
26
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/crosslink/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAA4B,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAe,MAAM,2BAA2B,CAAC;AAI3F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAgBD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,EAAE,kBAAkB,EAC3B,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,GACpC,gBAAgB,CAmElB"}
@@ -0,0 +1,5 @@
1
+ import type { DiagramModule } from '../../contracts/index.js';
2
+ import type { ArchitectureDocument } from './ir.js';
3
+ export type { ArchitectureDocument, ArchService, ArchGroup, ArchEdge } from './ir.js';
4
+ export declare const architecture: DiagramModule<ArchitectureDocument>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/architecture/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAKpD,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEtF,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,oBAAoB,CAY5D,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { BaseIR } from '../../contracts/index.js';
2
+ export interface ArchService {
3
+ readonly id: string;
4
+ readonly label: string;
5
+ readonly icon: string;
6
+ readonly group?: string;
7
+ }
8
+ export interface ArchGroup {
9
+ readonly id: string;
10
+ readonly label: string;
11
+ readonly icon: string;
12
+ }
13
+ export interface ArchEdge {
14
+ readonly from: string;
15
+ readonly fromSide: string;
16
+ readonly to: string;
17
+ readonly toSide: string;
18
+ }
19
+ export interface ArchitectureDocument extends BaseIR {
20
+ readonly metadata: {
21
+ readonly title?: string;
22
+ readonly theme?: string;
23
+ readonly [key: string]: string | undefined;
24
+ };
25
+ readonly groups: readonly ArchGroup[];
26
+ readonly services: readonly ArchService[];
27
+ readonly edges: readonly ArchEdge[];
28
+ }
29
+ //# sourceMappingURL=ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/architecture/ir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,MAAM;IAClD,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACpH,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file diagrams/architecture/layout.ts — Cloud architecture diagram.
3
+ *
4
+ * Services place via the shared layered kernel; group boxes wrap their members;
5
+ * edges connect side-anchored ports (L/R/T/B) with an orthogonal connector.
6
+ */
7
+ import type { ArchitectureDocument } from './ir.js';
8
+ import type { LayoutResult } from '../../contracts/index.js';
9
+ import type { ResolvedTheme } from '../../contracts/index.js';
10
+ export declare function layoutArchitecture(ir: ArchitectureDocument, theme: ResolvedTheme): LayoutResult;
11
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/architecture/layout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAuB,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAmB9D,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,aAAa,GAAG,YAAY,CAiE/F"}
@@ -0,0 +1,5 @@
1
+ import type { DiagramModule } from '../../contracts/index.js';
2
+ import type { BlockDocument } from './ir.js';
3
+ export type { BlockDocument, BlockNode, BlockEdge } from './ir.js';
4
+ export declare const block: DiagramModule<BlockDocument>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEnE,eAAO,MAAM,KAAK,EAAE,aAAa,CAAC,aAAa,CAY9C,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { BaseIR } from '../../contracts/index.js';
2
+ export interface BlockNode {
3
+ readonly id: string;
4
+ readonly label: string;
5
+ readonly span: number;
6
+ }
7
+ export interface BlockEdge {
8
+ readonly from: string;
9
+ readonly to: string;
10
+ readonly label?: string;
11
+ }
12
+ export interface BlockDocument extends BaseIR {
13
+ readonly metadata: {
14
+ readonly title?: string;
15
+ readonly theme?: string;
16
+ readonly [key: string]: string | undefined;
17
+ };
18
+ readonly columns: number;
19
+ readonly blocks: readonly BlockNode[];
20
+ readonly edges: readonly BlockEdge[];
21
+ }
22
+ //# sourceMappingURL=ir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ir.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/block/ir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACpH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;CACtC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file diagrams/block/layout.ts — Block diagram (column grid).
3
+ *
4
+ * Blocks pack left→right into a fixed column grid, honouring per-block column
5
+ * spans and wrapping when a span would overflow the row. Edges connect block
6
+ * centres, clipped to borders, with an arrowhead.
7
+ */
8
+ import type { BlockDocument } from './ir.js';
9
+ import type { LayoutResult } from '../../contracts/index.js';
10
+ import type { ResolvedTheme } from '../../contracts/index.js';
11
+ export declare function layoutBlock(ir: BlockDocument, theme: ResolvedTheme): LayoutResult;
12
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/block/layout.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAuB,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAS9D,wBAAgB,WAAW,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,YAAY,CA4DjF"}
@@ -0,0 +1,5 @@
1
+ import type { DiagramModule } from '../../contracts/index.js';
2
+ import type { C4Document } from './ir.js';
3
+ export type { C4Document, C4Node, C4Boundary, C4Rel } from './ir.js';
4
+ export declare const c4: DiagramModule<C4Document>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/diagrams/c4/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErE,eAAO,MAAM,EAAE,EAAE,aAAa,CAAC,UAAU,CAYxC,CAAC"}