@owlmeans/viable-common 0.0.4

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 (453) hide show
  1. package/README.md +68 -0
  2. package/agent-meta/manifest.json +16 -0
  3. package/agent-meta/skills/viable-common/SKILL.md +179 -0
  4. package/build/agent/index.d.ts +4 -0
  5. package/build/agent/index.d.ts.map +1 -0
  6. package/build/agent/index.js +3 -0
  7. package/build/agent/index.js.map +1 -0
  8. package/build/agent/memory.d.ts +12 -0
  9. package/build/agent/memory.d.ts.map +1 -0
  10. package/build/agent/memory.js +11 -0
  11. package/build/agent/memory.js.map +1 -0
  12. package/build/agent/spectator/consts.d.ts +9 -0
  13. package/build/agent/spectator/consts.d.ts.map +1 -0
  14. package/build/agent/spectator/consts.js +10 -0
  15. package/build/agent/spectator/consts.js.map +1 -0
  16. package/build/agent/spectator/index.d.ts +3 -0
  17. package/build/agent/spectator/index.d.ts.map +1 -0
  18. package/build/agent/spectator/index.js +2 -0
  19. package/build/agent/spectator/index.js.map +1 -0
  20. package/build/agent/spectator/types.d.ts +13 -0
  21. package/build/agent/spectator/types.d.ts.map +1 -0
  22. package/build/agent/spectator/types.js +2 -0
  23. package/build/agent/spectator/types.js.map +1 -0
  24. package/build/agent/types.d.ts +10 -0
  25. package/build/agent/types.d.ts.map +1 -0
  26. package/build/agent/types.js +2 -0
  27. package/build/agent/types.js.map +1 -0
  28. package/build/areas/consts.d.ts +88 -0
  29. package/build/areas/consts.d.ts.map +1 -0
  30. package/build/areas/consts.js +106 -0
  31. package/build/areas/consts.js.map +1 -0
  32. package/build/areas/index.d.ts +3 -0
  33. package/build/areas/index.d.ts.map +1 -0
  34. package/build/areas/index.js +2 -0
  35. package/build/areas/index.js.map +1 -0
  36. package/build/areas/types.d.ts +28 -0
  37. package/build/areas/types.d.ts.map +1 -0
  38. package/build/areas/types.js +2 -0
  39. package/build/areas/types.js.map +1 -0
  40. package/build/ba/consts.d.ts +38 -0
  41. package/build/ba/consts.d.ts.map +1 -0
  42. package/build/ba/consts.js +41 -0
  43. package/build/ba/consts.js.map +1 -0
  44. package/build/ba/helpers.d.ts +41 -0
  45. package/build/ba/helpers.d.ts.map +1 -0
  46. package/build/ba/helpers.js +79 -0
  47. package/build/ba/helpers.js.map +1 -0
  48. package/build/ba/index.d.ts +5 -0
  49. package/build/ba/index.d.ts.map +1 -0
  50. package/build/ba/index.js +4 -0
  51. package/build/ba/index.js.map +1 -0
  52. package/build/ba/schemas.d.ts +13 -0
  53. package/build/ba/schemas.d.ts.map +1 -0
  54. package/build/ba/schemas.js +181 -0
  55. package/build/ba/schemas.js.map +1 -0
  56. package/build/ba/types.d.ts +113 -0
  57. package/build/ba/types.d.ts.map +1 -0
  58. package/build/ba/types.js +2 -0
  59. package/build/ba/types.js.map +1 -0
  60. package/build/blueprint/case.d.ts +73 -0
  61. package/build/blueprint/case.d.ts.map +1 -0
  62. package/build/blueprint/case.js +244 -0
  63. package/build/blueprint/case.js.map +1 -0
  64. package/build/blueprint/consts.d.ts +11 -0
  65. package/build/blueprint/consts.d.ts.map +1 -0
  66. package/build/blueprint/consts.js +11 -0
  67. package/build/blueprint/consts.js.map +1 -0
  68. package/build/blueprint/index.d.ts +6 -0
  69. package/build/blueprint/index.d.ts.map +1 -0
  70. package/build/blueprint/index.js +6 -0
  71. package/build/blueprint/index.js.map +1 -0
  72. package/build/blueprint/resolve.d.ts +51 -0
  73. package/build/blueprint/resolve.d.ts.map +1 -0
  74. package/build/blueprint/resolve.js +108 -0
  75. package/build/blueprint/resolve.js.map +1 -0
  76. package/build/blueprint/schemas.d.ts +41 -0
  77. package/build/blueprint/schemas.d.ts.map +1 -0
  78. package/build/blueprint/schemas.js +27 -0
  79. package/build/blueprint/schemas.js.map +1 -0
  80. package/build/blueprint/types.d.ts +186 -0
  81. package/build/blueprint/types.d.ts.map +1 -0
  82. package/build/blueprint/types.js +32 -0
  83. package/build/blueprint/types.js.map +1 -0
  84. package/build/branding.d.ts +19 -0
  85. package/build/branding.d.ts.map +1 -0
  86. package/build/branding.js +32 -0
  87. package/build/branding.js.map +1 -0
  88. package/build/connect/consts.d.ts +378 -0
  89. package/build/connect/consts.d.ts.map +1 -0
  90. package/build/connect/consts.js +425 -0
  91. package/build/connect/consts.js.map +1 -0
  92. package/build/connect/entrypoints.d.ts +41 -0
  93. package/build/connect/entrypoints.d.ts.map +1 -0
  94. package/build/connect/entrypoints.js +141 -0
  95. package/build/connect/entrypoints.js.map +1 -0
  96. package/build/connect/errors.d.ts +50 -0
  97. package/build/connect/errors.d.ts.map +1 -0
  98. package/build/connect/errors.js +77 -0
  99. package/build/connect/errors.js.map +1 -0
  100. package/build/connect/index.d.ts +8 -0
  101. package/build/connect/index.d.ts.map +1 -0
  102. package/build/connect/index.js +6 -0
  103. package/build/connect/index.js.map +1 -0
  104. package/build/connect/ops.d.ts +192 -0
  105. package/build/connect/ops.d.ts.map +1 -0
  106. package/build/connect/ops.js +2 -0
  107. package/build/connect/ops.js.map +1 -0
  108. package/build/connect/references.d.ts +194 -0
  109. package/build/connect/references.d.ts.map +1 -0
  110. package/build/connect/references.js +62 -0
  111. package/build/connect/references.js.map +1 -0
  112. package/build/connect/schemas.d.ts +59 -0
  113. package/build/connect/schemas.d.ts.map +1 -0
  114. package/build/connect/schemas.js +346 -0
  115. package/build/connect/schemas.js.map +1 -0
  116. package/build/connect/types.d.ts +428 -0
  117. package/build/connect/types.d.ts.map +1 -0
  118. package/build/connect/types.js +2 -0
  119. package/build/connect/types.js.map +1 -0
  120. package/build/consts.d.ts +9 -0
  121. package/build/consts.d.ts.map +1 -0
  122. package/build/consts.js +31 -0
  123. package/build/consts.js.map +1 -0
  124. package/build/convert/consts.d.ts +539 -0
  125. package/build/convert/consts.d.ts.map +1 -0
  126. package/build/convert/consts.js +630 -0
  127. package/build/convert/consts.js.map +1 -0
  128. package/build/convert/helpers.d.ts +91 -0
  129. package/build/convert/helpers.d.ts.map +1 -0
  130. package/build/convert/helpers.js +301 -0
  131. package/build/convert/helpers.js.map +1 -0
  132. package/build/convert/index.d.ts +11 -0
  133. package/build/convert/index.d.ts.map +1 -0
  134. package/build/convert/index.js +4 -0
  135. package/build/convert/index.js.map +1 -0
  136. package/build/convert/schemas.d.ts +62 -0
  137. package/build/convert/schemas.d.ts.map +1 -0
  138. package/build/convert/schemas.js +626 -0
  139. package/build/convert/schemas.js.map +1 -0
  140. package/build/convert/types.d.ts +683 -0
  141. package/build/convert/types.d.ts.map +1 -0
  142. package/build/convert/types.js +2 -0
  143. package/build/convert/types.js.map +1 -0
  144. package/build/design/consts.d.ts +25 -0
  145. package/build/design/consts.d.ts.map +1 -0
  146. package/build/design/consts.js +26 -0
  147. package/build/design/consts.js.map +1 -0
  148. package/build/design/helpers.d.ts +60 -0
  149. package/build/design/helpers.d.ts.map +1 -0
  150. package/build/design/helpers.js +221 -0
  151. package/build/design/helpers.js.map +1 -0
  152. package/build/design/index.d.ts +6 -0
  153. package/build/design/index.d.ts.map +1 -0
  154. package/build/design/index.js +5 -0
  155. package/build/design/index.js.map +1 -0
  156. package/build/design/runtime.d.ts +126 -0
  157. package/build/design/runtime.d.ts.map +1 -0
  158. package/build/design/runtime.js +65 -0
  159. package/build/design/runtime.js.map +1 -0
  160. package/build/design/schemas.d.ts +21 -0
  161. package/build/design/schemas.d.ts.map +1 -0
  162. package/build/design/schemas.js +369 -0
  163. package/build/design/schemas.js.map +1 -0
  164. package/build/design/types.d.ts +199 -0
  165. package/build/design/types.d.ts.map +1 -0
  166. package/build/design/types.js +2 -0
  167. package/build/design/types.js.map +1 -0
  168. package/build/dev/consts.d.ts +32 -0
  169. package/build/dev/consts.d.ts.map +1 -0
  170. package/build/dev/consts.js +33 -0
  171. package/build/dev/consts.js.map +1 -0
  172. package/build/dev/index.d.ts +4 -0
  173. package/build/dev/index.d.ts.map +1 -0
  174. package/build/dev/index.js +3 -0
  175. package/build/dev/index.js.map +1 -0
  176. package/build/dev/schemas.d.ts +15 -0
  177. package/build/dev/schemas.d.ts.map +1 -0
  178. package/build/dev/schemas.js +116 -0
  179. package/build/dev/schemas.js.map +1 -0
  180. package/build/dev/types.d.ts +42 -0
  181. package/build/dev/types.d.ts.map +1 -0
  182. package/build/dev/types.js +2 -0
  183. package/build/dev/types.js.map +1 -0
  184. package/build/execution/consts.d.ts +36 -0
  185. package/build/execution/consts.d.ts.map +1 -0
  186. package/build/execution/consts.js +37 -0
  187. package/build/execution/consts.js.map +1 -0
  188. package/build/execution/index.d.ts +3 -0
  189. package/build/execution/index.d.ts.map +1 -0
  190. package/build/execution/index.js +2 -0
  191. package/build/execution/index.js.map +1 -0
  192. package/build/execution/types.d.ts +50 -0
  193. package/build/execution/types.d.ts.map +1 -0
  194. package/build/execution/types.js +2 -0
  195. package/build/execution/types.js.map +1 -0
  196. package/build/index.d.ts +22 -0
  197. package/build/index.d.ts.map +1 -0
  198. package/build/index.js +21 -0
  199. package/build/index.js.map +1 -0
  200. package/build/integrity/consts.d.ts +226 -0
  201. package/build/integrity/consts.d.ts.map +1 -0
  202. package/build/integrity/consts.js +401 -0
  203. package/build/integrity/consts.js.map +1 -0
  204. package/build/integrity/index.d.ts +4 -0
  205. package/build/integrity/index.d.ts.map +1 -0
  206. package/build/integrity/index.js +3 -0
  207. package/build/integrity/index.js.map +1 -0
  208. package/build/integrity/types.d.ts +35 -0
  209. package/build/integrity/types.d.ts.map +1 -0
  210. package/build/integrity/types.js +2 -0
  211. package/build/integrity/types.js.map +1 -0
  212. package/build/integrity/verify.d.ts +23 -0
  213. package/build/integrity/verify.d.ts.map +1 -0
  214. package/build/integrity/verify.js +198 -0
  215. package/build/integrity/verify.js.map +1 -0
  216. package/build/metadata/consts.d.ts +101 -0
  217. package/build/metadata/consts.d.ts.map +1 -0
  218. package/build/metadata/consts.js +104 -0
  219. package/build/metadata/consts.js.map +1 -0
  220. package/build/metadata/index.d.ts +3 -0
  221. package/build/metadata/index.d.ts.map +1 -0
  222. package/build/metadata/index.js +3 -0
  223. package/build/metadata/index.js.map +1 -0
  224. package/build/metadata/types.d.ts +286 -0
  225. package/build/metadata/types.d.ts.map +1 -0
  226. package/build/metadata/types.js +39 -0
  227. package/build/metadata/types.js.map +1 -0
  228. package/build/moderation/consts.d.ts +58 -0
  229. package/build/moderation/consts.d.ts.map +1 -0
  230. package/build/moderation/consts.js +60 -0
  231. package/build/moderation/consts.js.map +1 -0
  232. package/build/moderation/index.d.ts +5 -0
  233. package/build/moderation/index.d.ts.map +1 -0
  234. package/build/moderation/index.js +4 -0
  235. package/build/moderation/index.js.map +1 -0
  236. package/build/moderation/schemas.d.ts +19 -0
  237. package/build/moderation/schemas.d.ts.map +1 -0
  238. package/build/moderation/schemas.js +26 -0
  239. package/build/moderation/schemas.js.map +1 -0
  240. package/build/moderation/types.d.ts +64 -0
  241. package/build/moderation/types.d.ts.map +1 -0
  242. package/build/moderation/types.js +2 -0
  243. package/build/moderation/types.js.map +1 -0
  244. package/build/moderation/utils.d.ts +21 -0
  245. package/build/moderation/utils.d.ts.map +1 -0
  246. package/build/moderation/utils.js +31 -0
  247. package/build/moderation/utils.js.map +1 -0
  248. package/build/preview/consts.d.ts +10 -0
  249. package/build/preview/consts.d.ts.map +1 -0
  250. package/build/preview/consts.js +11 -0
  251. package/build/preview/consts.js.map +1 -0
  252. package/build/preview/index.d.ts +3 -0
  253. package/build/preview/index.d.ts.map +1 -0
  254. package/build/preview/index.js +2 -0
  255. package/build/preview/index.js.map +1 -0
  256. package/build/preview/types.d.ts +60 -0
  257. package/build/preview/types.d.ts.map +1 -0
  258. package/build/preview/types.js +2 -0
  259. package/build/preview/types.js.map +1 -0
  260. package/build/scaffold/consts.d.ts +25 -0
  261. package/build/scaffold/consts.d.ts.map +1 -0
  262. package/build/scaffold/consts.js +26 -0
  263. package/build/scaffold/consts.js.map +1 -0
  264. package/build/scaffold/helpers.d.ts +35 -0
  265. package/build/scaffold/helpers.d.ts.map +1 -0
  266. package/build/scaffold/helpers.js +54 -0
  267. package/build/scaffold/helpers.js.map +1 -0
  268. package/build/scaffold/index.d.ts +5 -0
  269. package/build/scaffold/index.d.ts.map +1 -0
  270. package/build/scaffold/index.js +4 -0
  271. package/build/scaffold/index.js.map +1 -0
  272. package/build/scaffold/schemas.d.ts +5 -0
  273. package/build/scaffold/schemas.d.ts.map +1 -0
  274. package/build/scaffold/schemas.js +273 -0
  275. package/build/scaffold/schemas.js.map +1 -0
  276. package/build/scaffold/types.d.ts +144 -0
  277. package/build/scaffold/types.d.ts.map +1 -0
  278. package/build/scaffold/types.js +2 -0
  279. package/build/scaffold/types.js.map +1 -0
  280. package/build/skills/catalogue.d.ts +47 -0
  281. package/build/skills/catalogue.d.ts.map +1 -0
  282. package/build/skills/catalogue.js +1566 -0
  283. package/build/skills/catalogue.js.map +1 -0
  284. package/build/skills/consts.d.ts +104 -0
  285. package/build/skills/consts.d.ts.map +1 -0
  286. package/build/skills/consts.js +170 -0
  287. package/build/skills/consts.js.map +1 -0
  288. package/build/skills/index.d.ts +4 -0
  289. package/build/skills/index.d.ts.map +1 -0
  290. package/build/skills/index.js +4 -0
  291. package/build/skills/index.js.map +1 -0
  292. package/build/skills/roles.d.ts +52 -0
  293. package/build/skills/roles.d.ts.map +1 -0
  294. package/build/skills/roles.js +256 -0
  295. package/build/skills/roles.js.map +1 -0
  296. package/build/slot/consts.d.ts +305 -0
  297. package/build/slot/consts.d.ts.map +1 -0
  298. package/build/slot/consts.js +376 -0
  299. package/build/slot/consts.js.map +1 -0
  300. package/build/slot/helpers.d.ts +25 -0
  301. package/build/slot/helpers.d.ts.map +1 -0
  302. package/build/slot/helpers.js +27 -0
  303. package/build/slot/helpers.js.map +1 -0
  304. package/build/slot/index.d.ts +6 -0
  305. package/build/slot/index.d.ts.map +1 -0
  306. package/build/slot/index.js +5 -0
  307. package/build/slot/index.js.map +1 -0
  308. package/build/slot/layout.d.ts +72 -0
  309. package/build/slot/layout.d.ts.map +1 -0
  310. package/build/slot/layout.js +82 -0
  311. package/build/slot/layout.js.map +1 -0
  312. package/build/slot/schemas.d.ts +12 -0
  313. package/build/slot/schemas.d.ts.map +1 -0
  314. package/build/slot/schemas.js +43 -0
  315. package/build/slot/schemas.js.map +1 -0
  316. package/build/slot/types.d.ts +147 -0
  317. package/build/slot/types.d.ts.map +1 -0
  318. package/build/slot/types.js +2 -0
  319. package/build/slot/types.js.map +1 -0
  320. package/build/topology/card.d.ts +23 -0
  321. package/build/topology/card.d.ts.map +1 -0
  322. package/build/topology/card.js +95 -0
  323. package/build/topology/card.js.map +1 -0
  324. package/build/topology/consts.d.ts +32 -0
  325. package/build/topology/consts.d.ts.map +1 -0
  326. package/build/topology/consts.js +55 -0
  327. package/build/topology/consts.js.map +1 -0
  328. package/build/topology/helpers.d.ts +44 -0
  329. package/build/topology/helpers.d.ts.map +1 -0
  330. package/build/topology/helpers.js +112 -0
  331. package/build/topology/helpers.js.map +1 -0
  332. package/build/topology/index.d.ts +5 -0
  333. package/build/topology/index.d.ts.map +1 -0
  334. package/build/topology/index.js +4 -0
  335. package/build/topology/index.js.map +1 -0
  336. package/build/topology/types.d.ts +83 -0
  337. package/build/topology/types.d.ts.map +1 -0
  338. package/build/topology/types.js +2 -0
  339. package/build/topology/types.js.map +1 -0
  340. package/build/types.d.ts +88 -0
  341. package/build/types.d.ts.map +1 -0
  342. package/build/types.js +2 -0
  343. package/build/types.js.map +1 -0
  344. package/build/ux/consts.d.ts +5 -0
  345. package/build/ux/consts.d.ts.map +1 -0
  346. package/build/ux/consts.js +6 -0
  347. package/build/ux/consts.js.map +1 -0
  348. package/build/ux/index.d.ts +4 -0
  349. package/build/ux/index.d.ts.map +1 -0
  350. package/build/ux/index.js +3 -0
  351. package/build/ux/index.js.map +1 -0
  352. package/build/ux/schemas.d.ts +8 -0
  353. package/build/ux/schemas.d.ts.map +1 -0
  354. package/build/ux/schemas.js +91 -0
  355. package/build/ux/schemas.js.map +1 -0
  356. package/build/ux/types.d.ts +21 -0
  357. package/build/ux/types.d.ts.map +1 -0
  358. package/build/ux/types.js +2 -0
  359. package/build/ux/types.js.map +1 -0
  360. package/package.json +71 -0
  361. package/src/agent/index.ts +4 -0
  362. package/src/agent/memory.ts +16 -0
  363. package/src/agent/spectator/consts.ts +10 -0
  364. package/src/agent/spectator/index.ts +3 -0
  365. package/src/agent/spectator/types.ts +14 -0
  366. package/src/agent/types.ts +10 -0
  367. package/src/areas/consts.ts +112 -0
  368. package/src/areas/index.ts +3 -0
  369. package/src/areas/types.ts +29 -0
  370. package/src/ba/consts.ts +40 -0
  371. package/src/ba/helpers.ts +93 -0
  372. package/src/ba/index.ts +5 -0
  373. package/src/ba/schemas.ts +196 -0
  374. package/src/ba/types.ts +125 -0
  375. package/src/blueprint/case.ts +272 -0
  376. package/src/blueprint/consts.ts +11 -0
  377. package/src/blueprint/index.ts +6 -0
  378. package/src/blueprint/resolve.ts +133 -0
  379. package/src/blueprint/schemas.ts +44 -0
  380. package/src/blueprint/types.ts +204 -0
  381. package/src/branding.ts +34 -0
  382. package/src/connect/consts.ts +441 -0
  383. package/src/connect/entrypoints.ts +291 -0
  384. package/src/connect/errors.ts +91 -0
  385. package/src/connect/index.ts +7 -0
  386. package/src/connect/ops.ts +208 -0
  387. package/src/connect/references.ts +89 -0
  388. package/src/connect/schemas.ts +384 -0
  389. package/src/connect/types.ts +456 -0
  390. package/src/consts.ts +34 -0
  391. package/src/convert/consts.ts +672 -0
  392. package/src/convert/helpers.ts +340 -0
  393. package/src/convert/index.ts +10 -0
  394. package/src/convert/schemas.ts +663 -0
  395. package/src/convert/types.ts +741 -0
  396. package/src/design/consts.ts +26 -0
  397. package/src/design/helpers.ts +255 -0
  398. package/src/design/index.ts +5 -0
  399. package/src/design/runtime.ts +142 -0
  400. package/src/design/schemas.ts +384 -0
  401. package/src/design/types.ts +191 -0
  402. package/src/dev/consts.ts +35 -0
  403. package/src/dev/index.ts +4 -0
  404. package/src/dev/schemas.ts +124 -0
  405. package/src/dev/types.ts +47 -0
  406. package/src/execution/consts.ts +37 -0
  407. package/src/execution/index.ts +3 -0
  408. package/src/execution/types.ts +55 -0
  409. package/src/index.ts +22 -0
  410. package/src/integrity/consts.ts +477 -0
  411. package/src/integrity/index.ts +3 -0
  412. package/src/integrity/types.ts +37 -0
  413. package/src/integrity/verify.ts +221 -0
  414. package/src/metadata/consts.ts +118 -0
  415. package/src/metadata/index.ts +3 -0
  416. package/src/metadata/types.ts +310 -0
  417. package/src/moderation/consts.ts +59 -0
  418. package/src/moderation/index.ts +4 -0
  419. package/src/moderation/schemas.ts +28 -0
  420. package/src/moderation/types.ts +68 -0
  421. package/src/moderation/utils.ts +35 -0
  422. package/src/preview/consts.ts +9 -0
  423. package/src/preview/index.ts +3 -0
  424. package/src/preview/types.ts +79 -0
  425. package/src/scaffold/consts.ts +26 -0
  426. package/src/scaffold/helpers.ts +84 -0
  427. package/src/scaffold/index.ts +4 -0
  428. package/src/scaffold/schemas.ts +283 -0
  429. package/src/scaffold/types.ts +118 -0
  430. package/src/skills/catalogue.ts +1617 -0
  431. package/src/skills/consts.ts +183 -0
  432. package/src/skills/index.ts +4 -0
  433. package/src/skills/roles.ts +299 -0
  434. package/src/slot/consts.ts +393 -0
  435. package/src/slot/helpers.ts +34 -0
  436. package/src/slot/index.ts +5 -0
  437. package/src/slot/layout.ts +141 -0
  438. package/src/slot/schemas.ts +46 -0
  439. package/src/slot/types.ts +164 -0
  440. package/src/topology/card.ts +106 -0
  441. package/src/topology/consts.ts +59 -0
  442. package/src/topology/helpers.ts +138 -0
  443. package/src/topology/index.ts +5 -0
  444. package/src/topology/types.ts +86 -0
  445. package/src/types.ts +104 -0
  446. package/src/ux/consts.ts +5 -0
  447. package/src/ux/index.ts +4 -0
  448. package/src/ux/schemas.ts +97 -0
  449. package/src/ux/types.ts +25 -0
  450. package/tests/connect-convert.spec.ts +161 -0
  451. package/tests/convert.spec.ts +318 -0
  452. package/tests/design.spec.ts +136 -0
  453. package/tsconfig.json +16 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/slot/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEtE,eAAO,MAAM,wBAAwB,EAsBhC,cAAc,CAAC,kBAAkB,CAAC,CAAA;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAUnB,cAAc,CAAC,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,43 @@
1
+ import { SlotCommandType, SlotFileCommand, SlotGitCommand, SlotShellCommand } from './consts.js';
2
+ export const SlotCommandPayloadSchema = {
3
+ type: 'object',
4
+ properties: {
5
+ type: {
6
+ type: 'string',
7
+ enum: Object.values(SlotCommandType)
8
+ },
9
+ command: {
10
+ oneOf: [
11
+ { type: 'string', enum: Object.values(SlotFileCommand) },
12
+ { type: 'string', enum: Object.values(SlotShellCommand) },
13
+ { type: 'string', enum: Object.values(SlotGitCommand) },
14
+ ]
15
+ },
16
+ args: {
17
+ type: 'object',
18
+ nullable: true,
19
+ additionalProperties: true
20
+ }
21
+ },
22
+ required: ['type', 'command'],
23
+ additionalProperties: false
24
+ };
25
+ /**
26
+ * The clone command's arguments, as a signed body carries them.
27
+ *
28
+ * `token` is declared because it is SENT — a body field the schema does not declare is stripped
29
+ * by validation and then verified against a signature the sender made over the whole thing, which
30
+ * the guard reports as a 401 rather than as the validation gap it is.
31
+ */
32
+ export const SlotGitCloneArgsSchema = {
33
+ type: 'object',
34
+ properties: {
35
+ remoteUrl: { type: 'string', minLength: 1, maxLength: 2048 },
36
+ branch: { type: 'string', maxLength: 256, nullable: true },
37
+ depth: { type: 'number', minimum: 0, nullable: true },
38
+ token: { type: 'string', maxLength: 4096, nullable: true },
39
+ },
40
+ required: ['remoteUrl'],
41
+ additionalProperties: false,
42
+ };
43
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","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AK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC3D;IACD,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,oBAAoB,EAAE,KAAK;CACmB,CAAA"}
@@ -0,0 +1,147 @@
1
+ import type { SlotCommandType, SlotFileCommand, SlotGitCommand, SlotShellCommand, SubProject } from './consts.js';
2
+ export type SlotCommand = SlotFileCommand | SlotShellCommand | SlotGitCommand;
3
+ export interface SlotCommandPayload {
4
+ type: SlotCommandType;
5
+ command: SlotCommand;
6
+ args?: Record<string, any>;
7
+ }
8
+ /**
9
+ * What a shell command answers with.
10
+ *
11
+ * `result` is the contract every caller reads: **error text, or `null` for success**. It is not a
12
+ * transcript — a command that fails returns the diagnostics a fixer or a person can act on, and a
13
+ * command that succeeds returns nothing at all. The remaining fields belong to the two commands
14
+ * that report a JOB rather than a verdict ({@link SlotShellCommand.BootCheck} and its status read)
15
+ * and to the integrity check, which reports a refusal rather than a failure.
16
+ */
17
+ export interface SlotShellResult {
18
+ result: string | null;
19
+ /** BootCheck: the job was started; the verdict comes from a BootCheckStatus read. */
20
+ started?: boolean;
21
+ /** BootCheckStatus: whether a check is still in flight, and when it began. */
22
+ running?: boolean;
23
+ startedAt?: string;
24
+ /** BootCheckStatus: a verdict is available in `result`. */
25
+ done?: boolean;
26
+ /** The target's own boot phase, when it got far enough to report one. */
27
+ phase?: string;
28
+ /** Integrity: whether the tree still holds the generated application. */
29
+ ok?: boolean;
30
+ violations?: string[];
31
+ }
32
+ /**
33
+ * The shapes the git commands answer with.
34
+ *
35
+ * Redeclared here rather than imported: the implementation lives in a package that carries
36
+ * `simple-git` and a GitHub client, and the connector — which executes these commands through the
37
+ * `git` CLI on a developer's machine — must not depend on either. The platform keeps answering
38
+ * with its own richer types; these are the subset both ends agree on.
39
+ */
40
+ export interface SlotGitFileChange {
41
+ path: string;
42
+ status: string;
43
+ }
44
+ export interface SlotGitCommitInfo {
45
+ hash: string;
46
+ shortHash: string;
47
+ subject: string;
48
+ authorName: string;
49
+ authorEmail: string;
50
+ committedAt: string;
51
+ }
52
+ export interface SlotGitStatus {
53
+ initialized: boolean;
54
+ head: SlotGitCommitInfo | null;
55
+ branch: string;
56
+ dirty: boolean;
57
+ changedFiles: number;
58
+ files: SlotGitFileChange[];
59
+ remoteUrl: string | null;
60
+ ahead: number | null;
61
+ behind: number | null;
62
+ }
63
+ export interface SlotGitCommitResult {
64
+ commit: SlotGitCommitInfo | null;
65
+ }
66
+ export interface SlotGitLogResult {
67
+ commits: SlotGitCommitInfo[];
68
+ }
69
+ /**
70
+ * Bring a remote repository onto the volume.
71
+ *
72
+ * `token` is a per-invocation credential and never reaches the tree: the executor passes it
73
+ * through the process environment for the one fetch, exactly as push and pull already do, so it
74
+ * appears in no `.git/config`, no remote URL and no argv anything can observe.
75
+ */
76
+ export interface SlotGitCloneArgs {
77
+ remoteUrl: string;
78
+ /** The branch to check out. Absent means whatever the remote calls its default. */
79
+ branch?: string;
80
+ /** Fetch depth; 0 means the whole history. Defaults to a shallow fetch. */
81
+ depth?: number;
82
+ token?: string;
83
+ }
84
+ export interface SlotGitCloneResult {
85
+ cloned: boolean;
86
+ /** The branch actually checked out — the resolved default, when none was asked for. */
87
+ branch: string;
88
+ head: SlotGitCommitInfo | null;
89
+ /** Executor diagnostics, when it has any worth reporting. */
90
+ result?: string;
91
+ }
92
+ /**
93
+ * One entry of a {@link SlotFileCommand.StatTree} listing.
94
+ *
95
+ * The shape both a publisher and a connector answer with, so a census walks a pod's volume and a
96
+ * developer's own directory through one contract. `binary` is the executor's own verdict — the
97
+ * caller has not read the file and cannot form one.
98
+ */
99
+ export interface FileStat {
100
+ path: string;
101
+ bytes: number;
102
+ binary: boolean;
103
+ modifiedAt?: string;
104
+ }
105
+ export interface StatTreeArgs {
106
+ /** Project-relative directory to walk. Absent means the whole project. */
107
+ dir?: string;
108
+ /** Entries to return before the answer reports itself truncated. */
109
+ limit?: number;
110
+ }
111
+ /**
112
+ * `total` is what the walk SAW, `entries` what it returned.
113
+ *
114
+ * The two differ on a truncated walk, and the difference is what tells a caller its picture of the
115
+ * tree is partial — a bounded listing that reported only what it returned would be indistinguish-
116
+ * able from a small repository.
117
+ */
118
+ export interface StatTreeResult {
119
+ entries: FileStat[];
120
+ truncated: boolean;
121
+ total: number;
122
+ }
123
+ export interface ReadHeadArgs {
124
+ path: string;
125
+ bytes: number;
126
+ }
127
+ /** Move everything in the project root under `dir`, leaving the named entries where they are. */
128
+ export interface RelocateArgs {
129
+ dir: string;
130
+ /** Root-relative names that stay put — the slot's own metadata and markers. */
131
+ keep?: string[];
132
+ }
133
+ export interface RelocateResult {
134
+ moved: number;
135
+ kept: string[];
136
+ }
137
+ export interface RemoveTreeArgs {
138
+ dir: string;
139
+ }
140
+ /** Arguments a shell command may carry. */
141
+ export interface SlotShellArgs {
142
+ subproject?: SubProject;
143
+ /** Free-form arguments for {@link SlotShellCommand.Bun}; absent means a plain install. */
144
+ args?: string;
145
+ skipBuild?: boolean;
146
+ }
147
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/slot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEjH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,gBAAgB,GAAG,cAAc,CAAA;AAE7E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,OAAO,EAAE,WAAW,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC3B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,qFAAqF;IACrF,OAAO,CAAC,EAAE,O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AC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/slot/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import type { TopologyDescriptor } from './types.js';
2
+ /** What `.agents/memory/topology.md` carries in its frontmatter. */
3
+ export interface TopologyMeta extends TopologyDescriptor {
4
+ version: number;
5
+ updatedAt: string;
6
+ }
7
+ /**
8
+ * Narrow a parsed frontmatter block into a topology, or answer `null`.
9
+ *
10
+ * `null` means "use the layout default", and every caller treats it that way. A topology file
11
+ * written by a platform version this one cannot read must not stop a project from building — the
12
+ * arrangement it describes is almost certainly still the default one.
13
+ */
14
+ export declare const parseTopologyMeta: (data: unknown) => TopologyDescriptor | null;
15
+ export declare const topologyMeta: (topology: TopologyDescriptor) => TopologyMeta;
16
+ /**
17
+ * The body of `.agents/memory/topology.md` — what a model reads, and what a person reads.
18
+ *
19
+ * Rendered from the descriptor rather than maintained beside it, for the same reason the layout
20
+ * tables are: a card that disagrees with the frontmatter teaches the wrong tree.
21
+ */
22
+ export declare const renderTopologyCard: (topology: TopologyDescriptor) => string;
23
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/topology/card.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA8C,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEhG,oEAAoE;AACpE,MAAM,WAAW,YAAa,SAAQ,kBAAkB;IACtD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AAqCD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SAAU,OAAO,KAAG,kBAAkB,GAAG,IActE,CAAA;AAED,eAAO,MAAM,YAAY,aAAc,kBAAkB,KAAG,YAK1D,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,aAAc,kBAAkB,KAAG,MAuBjE,CAAA"}
@@ -0,0 +1,95 @@
1
+ import { SubProject } from '../slot/consts.js';
2
+ import { TOPOLOGY_VERSION } from './consts.js';
3
+ import { orderPackages } from './helpers.js';
4
+ const ROLES = new Set(Object.values(SubProject));
5
+ const KINDS = new Set(['library', 'bundle']);
6
+ const asStrings = (value) => Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
7
+ /**
8
+ * Read a package descriptor out of whatever the file held.
9
+ *
10
+ * Everything is narrowed rather than trusted: the file is on the target's volume, where a person,
11
+ * a GitHub pull or a previous platform version may have written it. A descriptor that cannot be
12
+ * narrowed is DROPPED, never repaired — a package with no name or no recognisable role would
13
+ * otherwise resolve a path somewhere real and wrong.
14
+ */
15
+ const parsePackage = (value) => {
16
+ if (value == null || typeof value !== 'object')
17
+ return null;
18
+ const raw = value;
19
+ const name = typeof raw.name === 'string' ? raw.name.trim() : '';
20
+ if (name === '' || name.includes('/') || name.startsWith('.'))
21
+ return null;
22
+ const roles = asStrings(raw.roles).filter((role) => ROLES.has(role));
23
+ if (roles.length === 0)
24
+ return null;
25
+ const kind = KINDS.has(raw.kind) ? raw.kind : 'bundle';
26
+ const areas = asStrings(raw.areas);
27
+ const queues = asStrings(raw.queues);
28
+ return {
29
+ name,
30
+ roles,
31
+ kind,
32
+ dependsOn: asStrings(raw.dependsOn),
33
+ ...(areas.length > 0 ? { areas: areas } : {}),
34
+ ...(queues.length > 0 ? { queues } : {}),
35
+ };
36
+ };
37
+ /**
38
+ * Narrow a parsed frontmatter block into a topology, or answer `null`.
39
+ *
40
+ * `null` means "use the layout default", and every caller treats it that way. A topology file
41
+ * written by a platform version this one cannot read must not stop a project from building — the
42
+ * arrangement it describes is almost certainly still the default one.
43
+ */
44
+ export const parseTopologyMeta = (data) => {
45
+ if (data == null || typeof data !== 'object')
46
+ return null;
47
+ const raw = data;
48
+ if (typeof raw.dir !== 'string' || raw.dir.trim() === '')
49
+ return null;
50
+ const packages = Array.isArray(raw.packages)
51
+ ? raw.packages.map(parsePackage).filter((pkg) => pkg != null)
52
+ : [];
53
+ if (packages.length === 0)
54
+ return null;
55
+ return {
56
+ id: typeof raw.id === 'string' && raw.id !== '' ? raw.id : 'recorded',
57
+ dir: raw.dir.trim(),
58
+ packages,
59
+ };
60
+ };
61
+ export const topologyMeta = (topology) => ({
62
+ ...topology,
63
+ packages: orderPackages(topology.packages),
64
+ version: TOPOLOGY_VERSION,
65
+ updatedAt: new Date().toISOString(),
66
+ });
67
+ /**
68
+ * The body of `.agents/memory/topology.md` — what a model reads, and what a person reads.
69
+ *
70
+ * Rendered from the descriptor rather than maintained beside it, for the same reason the layout
71
+ * tables are: a card that disagrees with the frontmatter teaches the wrong tree.
72
+ */
73
+ export const renderTopologyCard = (topology) => {
74
+ const ordered = orderPackages(topology.packages);
75
+ const rows = ordered.map(pkg => {
76
+ const deps = pkg.dependsOn.length > 0 ? pkg.dependsOn.join(', ') : '—';
77
+ const extra = [
78
+ ...(pkg.areas != null ? [`areas: ${pkg.areas.join(', ')}`] : []),
79
+ ...(pkg.queues != null ? [`queues: ${pkg.queues.join(', ')}`] : []),
80
+ ].join('; ');
81
+ return `| \`${topology.dir}/${pkg.name}\` | ${pkg.roles.join(', ')} | ${pkg.kind} | ${deps} | ${extra === '' ? '—' : extra} |`;
82
+ });
83
+ return [
84
+ '# Topology',
85
+ '',
86
+ 'Which packages this project has, what each one is, and which compile against which.',
87
+ 'Built in the order of the table — a `library` must be built before anything importing it.',
88
+ '',
89
+ '| Package | Roles | Kind | Depends on | Notes |',
90
+ '|---|---|---|---|---|',
91
+ ...rows,
92
+ '',
93
+ ].join('\n');
94
+ };
95
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/topology/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACpE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEZ,OAAO,OAAO,QAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;IAChI,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,YAAY;QACZ,EAAE;QACF,qFAAqF;QACrF,2FAA2F;QAC3F,EAAE;QACF,iDAAiD;QACjD,uBAAuB;QACvB,GAAG,IAAI;QACP,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { TargetLayout } from '../integrity/consts.js';
2
+ import type { TopologyDescriptor } from './types.js';
3
+ /**
4
+ * The two arrangements the platform itself writes.
5
+ *
6
+ * They are the DEFAULTS a project falls back to, not the set of arrangements that can exist: a
7
+ * project records its own topology and may hold packages neither of these names. What makes them
8
+ * special is only that `detectTargetLayout` can recognise them from the disk, which is what a
9
+ * consumer needs when a project predates the topology file entirely.
10
+ *
11
+ * v1 is frozen. A target's tree is the one it was initialized with, so nothing is ever added here.
12
+ */
13
+ export declare const DEFAULT_TOPOLOGY: TopologyDescriptor;
14
+ /**
15
+ * The pre-restructure arrangement, frozen.
16
+ *
17
+ * `backend` here is the HTTP SERVER and `frontend` the browser app — the same two words the
18
+ * current topology uses for other things, which is why roles are mapped per topology and never
19
+ * joined onto a path.
20
+ */
21
+ export declare const LEGACY_TOPOLOGY: TopologyDescriptor;
22
+ /** The default topology for each layout the platform can detect on disk. */
23
+ export declare const LAYOUT_TOPOLOGIES: Readonly<Record<TargetLayout, TopologyDescriptor>>;
24
+ /**
25
+ * The frontmatter version of `.agents/memory/topology.md`.
26
+ *
27
+ * A file written by an older platform is READ, never refused: an unknown or missing version falls
28
+ * back to the layout default, because a topology nobody can parse must not stop a project from
29
+ * building.
30
+ */
31
+ export declare const TOPOLOGY_VERSION = 1;
32
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/topology/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBAY9B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,kBAQ7B,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAGhF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAA"}
@@ -0,0 +1,55 @@
1
+ import { TargetLayout } from '../integrity/consts.js';
2
+ import { SubProject } from '../slot/consts.js';
3
+ /**
4
+ * The two arrangements the platform itself writes.
5
+ *
6
+ * They are the DEFAULTS a project falls back to, not the set of arrangements that can exist: a
7
+ * project records its own topology and may hold packages neither of these names. What makes them
8
+ * special is only that `detectTargetLayout` can recognise them from the disk, which is what a
9
+ * consumer needs when a project predates the topology file entirely.
10
+ *
11
+ * v1 is frozen. A target's tree is the one it was initialized with, so nothing is ever added here.
12
+ */
13
+ export const DEFAULT_TOPOLOGY = {
14
+ id: 'owlmeans-fullstack',
15
+ dir: 'sources',
16
+ packages: [
17
+ { name: 'common', roles: [SubProject.Common], kind: 'library', dependsOn: [] },
18
+ // The shared LIBRARY, not the server — that is `api`. It owns the context factory, the config,
19
+ // the resources, the services, the domain models and the job processors.
20
+ { name: 'backend', roles: [SubProject.Backend], kind: 'library', dependsOn: ['common'] },
21
+ { name: 'api', roles: [SubProject.Api], kind: 'bundle', dependsOn: ['common', 'backend'] },
22
+ { name: 'web', roles: [SubProject.Web, SubProject.Frontend], kind: 'bundle', dependsOn: ['common'] },
23
+ { name: 'worker', roles: [SubProject.Worker], kind: 'bundle', dependsOn: ['common', 'backend'] },
24
+ ],
25
+ };
26
+ /**
27
+ * The pre-restructure arrangement, frozen.
28
+ *
29
+ * `backend` here is the HTTP SERVER and `frontend` the browser app — the same two words the
30
+ * current topology uses for other things, which is why roles are mapped per topology and never
31
+ * joined onto a path.
32
+ */
33
+ export const LEGACY_TOPOLOGY = {
34
+ id: 'owlmeans-fullstack-v1',
35
+ dir: 'packages',
36
+ packages: [
37
+ { name: 'common', roles: [SubProject.Common], kind: 'library', dependsOn: [] },
38
+ { name: 'backend', roles: [SubProject.Backend, SubProject.Api], kind: 'bundle', dependsOn: ['common'] },
39
+ { name: 'frontend', roles: [SubProject.Frontend, SubProject.Web], kind: 'bundle', dependsOn: ['common'] },
40
+ ],
41
+ };
42
+ /** The default topology for each layout the platform can detect on disk. */
43
+ export const LAYOUT_TOPOLOGIES = {
44
+ [TargetLayout.V2]: DEFAULT_TOPOLOGY,
45
+ [TargetLayout.V1]: LEGACY_TOPOLOGY,
46
+ };
47
+ /**
48
+ * The frontmatter version of `.agents/memory/topology.md`.
49
+ *
50
+ * A file written by an older platform is READ, never refused: an unknown or missing version falls
51
+ * back to the layout default, because a topology nobody can parse must not stop a project from
52
+ * building.
53
+ */
54
+ export const TOPOLOGY_VERSION = 1;
55
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/topology/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9C;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,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U,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;QACvG,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE;KAC1G;CACF,CAAA;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAuD;IACnF,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,gBAAgB;IACnC,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,eAAe;CACnC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA"}
@@ -0,0 +1,44 @@
1
+ import { TargetLayout } from '../integrity/consts.js';
2
+ import type { ProjectArea } from '../areas/consts.js';
3
+ import type { SubProject } from '../slot/consts.js';
4
+ import type { ResolvedTopology, TargetPackageDescriptor, TopologyDescriptor } from './types.js';
5
+ /**
6
+ * Order the packages so that nothing is built before what it compiles against.
7
+ *
8
+ * Kahn's algorithm, with two deliberate tolerances. An edge to a package the topology does not
9
+ * hold is DROPPED rather than fatal — a project may declare a dependency on something a pull has
10
+ * not brought in yet, and refusing to order the tree would take the whole build down over one
11
+ * name. A cycle leaves its members unvisited, and they are appended in declaration order: a cycle
12
+ * cannot be built correctly in any order, so the useful behaviour is to build it in the order
13
+ * somebody wrote rather than to throw.
14
+ */
15
+ export declare const orderPackages: (packages: TargetPackageDescriptor[]) => TargetPackageDescriptor[];
16
+ /** Resolve the derived halves — build order, library order and the role index. */
17
+ export declare const resolveTopology: (topology: TopologyDescriptor) => ResolvedTopology;
18
+ /** The default topology for a layout already decided. */
19
+ export declare const topologyOf: (layout: TargetLayout) => TopologyDescriptor;
20
+ /**
21
+ * The directory a role names, or `null` when this topology has no package for it.
22
+ *
23
+ * `null` rather than the role's own name: a command aimed at a package the tree does not have must
24
+ * fail where it is issued. Answering with a plausible directory runs it somewhere real and wrong,
25
+ * which is how a type check once ran against the shared package instead of the one under repair.
26
+ */
27
+ export declare const packageForRole: (topology: ResolvedTopology, role: SubProject) => TargetPackageDescriptor | null;
28
+ /** Every package holding a role — more than one only where a topology splits that role. */
29
+ export declare const packagesForRole: (topology: ResolvedTopology, role: SubProject) => TargetPackageDescriptor[];
30
+ /** The package serving an area, for a topology that splits the browser app across several. */
31
+ export declare const packageForArea: (topology: ResolvedTopology, role: SubProject, area: ProjectArea) => TargetPackageDescriptor | null;
32
+ /** `<dir>/<package>` — the only place a topology directory is composed. */
33
+ export declare const packageDir: (topology: TopologyDescriptor, pkg: TargetPackageDescriptor) => string;
34
+ /**
35
+ * Merge a package into a topology, by name.
36
+ *
37
+ * This is the ADOPTION path: a package that arrived with a GitHub pull is classified once and
38
+ * recorded here, so the next run addresses the tree that exists rather than re-deriving one that
39
+ * does not. Replacing by name rather than appending keeps a re-classification idempotent.
40
+ */
41
+ export declare const withPackage: (topology: TopologyDescriptor, pkg: TargetPackageDescriptor) => TopologyDescriptor;
42
+ /** Whether two topologies describe the same arrangement — used to skip a needless rewrite. */
43
+ export declare const sameTopology: (a: TopologyDescriptor, b: TopologyDescriptor) => boolean;
44
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/topology/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,KAAK,EACV,gBAAgB,EAAE,uBAAuB,EAAE,kBAAkB,EAC9D,MAAM,YAAY,CAAA;AAEnB;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,aAAc,uBAAuB,EAAE,KAAG,uBAAuB,EA4C1F,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,eAAe,aAAc,kBAAkB,KAAG,gBAgB9D,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,UAAU,WAAY,YAAY,KAAG,kBACH,CAAA;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,aACf,gBAAgB,QAAQ,UAAU,KAC3C,uBAAuB,GAAG,IAA0C,CAAA;AAEvE,2FAA2F;AAC3F,eAAO,MAAM,eAAe,aAChB,gBAAgB,QAAQ,UAAU,KAC3C,uBAAuB,EAAiC,CAAA;AAE3D,8FAA8F;AAC9F,eAAO,MAAM,cAAc,aACf,gBAAgB,QAAQ,UAAU,QAAQ,WAAW,KAC9D,uBAAuB,GAAG,IAM5B,CAAA;AAED,2EAA2E;AAC3E,eAAO,MAAM,UAAU,aAAc,kBAAkB,OAAO,uBAAuB,KAAG,MACzD,CAAA;AAE/B;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,aACZ,kBAAkB,OAAO,uBAAuB,KACzD,kBAKD,CAAA;AAEF,8FAA8F;AAC9F,eAAO,MAAM,YAAY,MAAO,kBAAkB,KAAK,kBAAkB,KAAG,OAEtD,CAAA"}
@@ -0,0 +1,112 @@
1
+ import { LAYOUT_TOPOLOGIES, DEFAULT_TOPOLOGY } from './consts.js';
2
+ /**
3
+ * Order the packages so that nothing is built before what it compiles against.
4
+ *
5
+ * Kahn's algorithm, with two deliberate tolerances. An edge to a package the topology does not
6
+ * hold is DROPPED rather than fatal — a project may declare a dependency on something a pull has
7
+ * not brought in yet, and refusing to order the tree would take the whole build down over one
8
+ * name. A cycle leaves its members unvisited, and they are appended in declaration order: a cycle
9
+ * cannot be built correctly in any order, so the useful behaviour is to build it in the order
10
+ * somebody wrote rather than to throw.
11
+ */
12
+ export const orderPackages = (packages) => {
13
+ const known = new Set(packages.map(pkg => pkg.name));
14
+ const index = new Map(packages.map((pkg, at) => [pkg.name, at]));
15
+ const pending = new Map(packages.map(pkg => [
16
+ pkg.name, pkg.dependsOn.filter(dep => known.has(dep) && dep !== pkg.name).length,
17
+ ]));
18
+ const dependents = new Map();
19
+ for (const pkg of packages) {
20
+ for (const dep of pkg.dependsOn) {
21
+ if (!known.has(dep) || dep === pkg.name)
22
+ continue;
23
+ dependents.set(dep, [...dependents.get(dep) ?? [], pkg.name]);
24
+ }
25
+ }
26
+ const byName = new Map(packages.map(pkg => [pkg.name, pkg]));
27
+ const out = [];
28
+ // Ready packages are taken in DECLARATION order, not in the order they became ready. Both are
29
+ // correct builds; only one is the same list every time and the same list a person wrote, and
30
+ // this order is compared against the shipped layout tables by a test.
31
+ const ready = packages.filter(pkg => pending.get(pkg.name) === 0).map(pkg => pkg.name);
32
+ const take = () => {
33
+ if (ready.length === 0)
34
+ return undefined;
35
+ let at = 0;
36
+ for (let i = 1; i < ready.length; i++) {
37
+ if ((index.get(ready[i]) ?? 0) < (index.get(ready[at]) ?? 0))
38
+ at = i;
39
+ }
40
+ return ready.splice(at, 1)[0];
41
+ };
42
+ for (let name = take(); name != null; name = take()) {
43
+ const pkg = byName.get(name);
44
+ if (pkg == null)
45
+ continue;
46
+ out.push(pkg);
47
+ for (const next of dependents.get(name) ?? []) {
48
+ const left = (pending.get(next) ?? 0) - 1;
49
+ pending.set(next, left);
50
+ if (left === 0)
51
+ ready.push(next);
52
+ }
53
+ }
54
+ const seen = new Set(out.map(pkg => pkg.name));
55
+ return [...out, ...packages.filter(pkg => !seen.has(pkg.name))];
56
+ };
57
+ /** Resolve the derived halves — build order, library order and the role index. */
58
+ export const resolveTopology = (topology) => {
59
+ const ordered = orderPackages(topology.packages);
60
+ const byRole = {};
61
+ for (const pkg of ordered) {
62
+ for (const role of pkg.roles) {
63
+ byRole[role] = [...byRole[role] ?? [], pkg];
64
+ }
65
+ }
66
+ return {
67
+ ...topology,
68
+ packages: ordered,
69
+ build: ordered.map(pkg => pkg.name),
70
+ libraries: ordered.filter(pkg => pkg.kind === 'library').map(pkg => pkg.name),
71
+ byRole,
72
+ };
73
+ };
74
+ /** The default topology for a layout already decided. */
75
+ export const topologyOf = (layout) => LAYOUT_TOPOLOGIES[layout] ?? DEFAULT_TOPOLOGY;
76
+ /**
77
+ * The directory a role names, or `null` when this topology has no package for it.
78
+ *
79
+ * `null` rather than the role's own name: a command aimed at a package the tree does not have must
80
+ * fail where it is issued. Answering with a plausible directory runs it somewhere real and wrong,
81
+ * which is how a type check once ran against the shared package instead of the one under repair.
82
+ */
83
+ export const packageForRole = (topology, role) => topology.byRole[role]?.[0] ?? null;
84
+ /** Every package holding a role — more than one only where a topology splits that role. */
85
+ export const packagesForRole = (topology, role) => topology.byRole[role] ?? [];
86
+ /** The package serving an area, for a topology that splits the browser app across several. */
87
+ export const packageForArea = (topology, role, area) => {
88
+ const candidates = packagesForRole(topology, role);
89
+ return candidates.find(pkg => pkg.areas?.includes(area) === true)
90
+ ?? candidates.find(pkg => pkg.areas == null)
91
+ ?? candidates[0]
92
+ ?? null;
93
+ };
94
+ /** `<dir>/<package>` — the only place a topology directory is composed. */
95
+ export const packageDir = (topology, pkg) => `${topology.dir}/${pkg.name}`;
96
+ /**
97
+ * Merge a package into a topology, by name.
98
+ *
99
+ * This is the ADOPTION path: a package that arrived with a GitHub pull is classified once and
100
+ * recorded here, so the next run addresses the tree that exists rather than re-deriving one that
101
+ * does not. Replacing by name rather than appending keeps a re-classification idempotent.
102
+ */
103
+ export const withPackage = (topology, pkg) => ({
104
+ ...topology,
105
+ packages: topology.packages.some(known => known.name === pkg.name)
106
+ ? topology.packages.map(known => known.name === pkg.name ? pkg : known)
107
+ : [...topology.packages, pkg],
108
+ });
109
+ /** Whether two topologies describe the same arrangement — used to skip a needless rewrite. */
110
+ export const sameTopology = (a, b) => JSON.stringify(orderPackages(a.packages)) === JSON.stringify(orderPackages(b.packages))
111
+ && a.dir === b.dir;
112
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources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AE,CAC/F,GAAG,QAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAA;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAA4B,EAAE,GAA4B,EACtC,EAAE,CAAC,CAAC;IACxB,GAAG,QAAQ;IACX,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC;QAChE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QACvE,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC;CAChC,CAAC,CAAA;AAEF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAqB,EAAE,CAAqB,EAAW,EAAE,CACpF,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;OAClF,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAA"}
@@ -0,0 +1,5 @@
1
+ export type * from './types.js';
2
+ export * from './consts.js';
3
+ export * from './helpers.js';
4
+ export * from './card.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/topology/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './consts.js';
2
+ export * from './helpers.js';
3
+ export * from './card.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/topology/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA"}