@owlmeans/viable-common 0.0.43 → 0.0.44

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 (322) hide show
  1. package/README.md +3 -3
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
  4. package/agent-meta/skills/viable-common/SKILL.md +22 -11
  5. package/build/agent/consts.d.ts +58 -0
  6. package/build/agent/consts.d.ts.map +1 -0
  7. package/build/agent/consts.js +63 -0
  8. package/build/agent/consts.js.map +1 -0
  9. package/build/agent/consts.local.d.ts +21 -0
  10. package/build/agent/consts.local.d.ts.map +1 -0
  11. package/build/agent/consts.local.js +44 -0
  12. package/build/agent/consts.local.js.map +1 -0
  13. package/build/agent/index.d.ts +1 -0
  14. package/build/agent/index.d.ts.map +1 -1
  15. package/build/agent/index.js +1 -0
  16. package/build/agent/index.js.map +1 -1
  17. package/build/agent/presentation.d.ts +2 -86
  18. package/build/agent/presentation.d.ts.map +1 -1
  19. package/build/agent/presentation.js +2 -104
  20. package/build/agent/presentation.js.map +1 -1
  21. package/build/agent/types.d.ts +30 -0
  22. package/build/agent/types.d.ts.map +1 -1
  23. package/build/agent/types.local.d.ts +2 -0
  24. package/build/agent/types.local.d.ts.map +1 -0
  25. package/build/agent/types.local.js +2 -0
  26. package/build/agent/types.local.js.map +1 -0
  27. package/build/areas/consts.d.ts +5 -0
  28. package/build/areas/consts.d.ts.map +1 -1
  29. package/build/areas/consts.js +4 -0
  30. package/build/areas/consts.js.map +1 -1
  31. package/build/areas/tenancy.d.ts +1 -36
  32. package/build/areas/tenancy.d.ts.map +1 -1
  33. package/build/areas/tenancy.js +1 -5
  34. package/build/areas/tenancy.js.map +1 -1
  35. package/build/areas/types.d.ts +32 -0
  36. package/build/areas/types.d.ts.map +1 -1
  37. package/build/ba/types.d.ts +1 -1
  38. package/build/ba/types.d.ts.map +1 -1
  39. package/build/blueprint/consts.d.ts +41 -0
  40. package/build/blueprint/consts.d.ts.map +1 -1
  41. package/build/blueprint/consts.js +51 -0
  42. package/build/blueprint/consts.js.map +1 -1
  43. package/build/blueprint/consts.local.d.ts +2 -0
  44. package/build/blueprint/consts.local.d.ts.map +1 -0
  45. package/build/blueprint/consts.local.js +3 -0
  46. package/build/blueprint/consts.local.js.map +1 -0
  47. package/build/blueprint/index.d.ts +1 -0
  48. package/build/blueprint/index.d.ts.map +1 -1
  49. package/build/blueprint/index.js +1 -0
  50. package/build/blueprint/index.js.map +1 -1
  51. package/build/blueprint/types.d.ts +2 -50
  52. package/build/blueprint/types.d.ts.map +1 -1
  53. package/build/blueprint/types.js +1 -65
  54. package/build/blueprint/types.js.map +1 -1
  55. package/build/blueprint/utils.d.ts +11 -0
  56. package/build/blueprint/utils.d.ts.map +1 -0
  57. package/build/blueprint/utils.js +16 -0
  58. package/build/blueprint/utils.js.map +1 -0
  59. package/build/branding.d.ts +0 -8
  60. package/build/branding.d.ts.map +1 -1
  61. package/build/branding.js +0 -16
  62. package/build/branding.js.map +1 -1
  63. package/build/connect/consts.d.ts +0 -10
  64. package/build/connect/consts.d.ts.map +1 -1
  65. package/build/connect/consts.js +0 -23
  66. package/build/connect/consts.js.map +1 -1
  67. package/build/connect/entrypoints.d.ts +49 -86
  68. package/build/connect/entrypoints.d.ts.map +1 -1
  69. package/build/connect/entrypoints.js +5 -2
  70. package/build/connect/entrypoints.js.map +1 -1
  71. package/build/connect/errors.d.ts +32 -0
  72. package/build/connect/errors.d.ts.map +1 -1
  73. package/build/connect/errors.js +65 -0
  74. package/build/connect/errors.js.map +1 -1
  75. package/build/connect/index.d.ts +1 -0
  76. package/build/connect/index.d.ts.map +1 -1
  77. package/build/connect/index.js +1 -0
  78. package/build/connect/index.js.map +1 -1
  79. package/build/connect/references.d.ts +1 -153
  80. package/build/connect/references.d.ts.map +1 -1
  81. package/build/connect/references.js.map +1 -1
  82. package/build/connect/schemas.d.ts +2 -1
  83. package/build/connect/schemas.d.ts.map +1 -1
  84. package/build/connect/schemas.js +9 -0
  85. package/build/connect/schemas.js.map +1 -1
  86. package/build/connect/types.d.ts +214 -1
  87. package/build/connect/types.d.ts.map +1 -1
  88. package/build/connect/types.local.d.ts +4 -0
  89. package/build/connect/types.local.d.ts.map +1 -0
  90. package/build/connect/types.local.js +2 -0
  91. package/build/connect/types.local.js.map +1 -0
  92. package/build/connect/utils.d.ts +12 -0
  93. package/build/connect/utils.d.ts.map +1 -0
  94. package/build/connect/utils.js +25 -0
  95. package/build/connect/utils.js.map +1 -0
  96. package/build/consts.d.ts +8 -0
  97. package/build/consts.d.ts.map +1 -1
  98. package/build/consts.js +16 -0
  99. package/build/consts.js.map +1 -1
  100. package/build/convert/consts.d.ts +0 -12
  101. package/build/convert/consts.d.ts.map +1 -1
  102. package/build/convert/consts.js +0 -3
  103. package/build/convert/consts.js.map +1 -1
  104. package/build/convert/consts.local.d.ts +55 -0
  105. package/build/convert/consts.local.d.ts.map +1 -0
  106. package/build/convert/consts.local.js +104 -0
  107. package/build/convert/consts.local.js.map +1 -0
  108. package/build/convert/helpers.d.ts.map +1 -1
  109. package/build/convert/helpers.js +1 -102
  110. package/build/convert/helpers.js.map +1 -1
  111. package/build/convert/index.d.ts +1 -0
  112. package/build/convert/index.d.ts.map +1 -1
  113. package/build/convert/index.js +1 -0
  114. package/build/convert/index.js.map +1 -1
  115. package/build/convert/types.d.ts +10 -1
  116. package/build/convert/types.d.ts.map +1 -1
  117. package/build/convert/utils.d.ts +4 -0
  118. package/build/convert/utils.d.ts.map +1 -0
  119. package/build/convert/utils.js +5 -0
  120. package/build/convert/utils.js.map +1 -0
  121. package/build/design/consts.d.ts +37 -0
  122. package/build/design/consts.d.ts.map +1 -1
  123. package/build/design/consts.js +44 -8
  124. package/build/design/consts.js.map +1 -1
  125. package/build/design/runtime.d.ts +2 -103
  126. package/build/design/runtime.d.ts.map +1 -1
  127. package/build/design/runtime.js +1 -44
  128. package/build/design/runtime.js.map +1 -1
  129. package/build/design/schemas.d.ts +1 -9
  130. package/build/design/schemas.d.ts.map +1 -1
  131. package/build/design/schemas.js +1 -1
  132. package/build/design/schemas.js.map +1 -1
  133. package/build/design/types.d.ts +75 -1
  134. package/build/design/types.d.ts.map +1 -1
  135. package/build/dev/schemas.d.ts.map +1 -1
  136. package/build/dev/schemas.js.map +1 -1
  137. package/build/dev/types.local.d.ts +4 -0
  138. package/build/dev/types.local.d.ts.map +1 -0
  139. package/build/dev/types.local.js +2 -0
  140. package/build/dev/types.local.js.map +1 -0
  141. package/build/integrity/consts.d.ts +0 -117
  142. package/build/integrity/consts.d.ts.map +1 -1
  143. package/build/integrity/consts.js +0 -281
  144. package/build/integrity/consts.js.map +1 -1
  145. package/build/integrity/consts.local.d.ts +5 -0
  146. package/build/integrity/consts.local.d.ts.map +1 -0
  147. package/build/integrity/consts.local.js +5 -0
  148. package/build/integrity/consts.local.js.map +1 -0
  149. package/build/integrity/index.d.ts +1 -0
  150. package/build/integrity/index.d.ts.map +1 -1
  151. package/build/integrity/index.js +1 -0
  152. package/build/integrity/index.js.map +1 -1
  153. package/build/integrity/types.d.ts +33 -1
  154. package/build/integrity/types.d.ts.map +1 -1
  155. package/build/integrity/utils.d.ts +88 -0
  156. package/build/integrity/utils.d.ts.map +1 -0
  157. package/build/integrity/utils.js +280 -0
  158. package/build/integrity/utils.js.map +1 -0
  159. package/build/integrity/verify.d.ts.map +1 -1
  160. package/build/integrity/verify.js +2 -1
  161. package/build/integrity/verify.js.map +1 -1
  162. package/build/intent/consts.local.d.ts +4 -0
  163. package/build/intent/consts.local.d.ts.map +1 -0
  164. package/build/intent/consts.local.js +3 -0
  165. package/build/intent/consts.local.js.map +1 -0
  166. package/build/intent/entrypoints.d.ts +0 -1
  167. package/build/intent/entrypoints.d.ts.map +1 -1
  168. package/build/intent/flow.d.ts.map +1 -1
  169. package/build/intent/flow.js +2 -2
  170. package/build/intent/flow.js.map +1 -1
  171. package/build/intent/types.d.ts +2 -0
  172. package/build/intent/types.d.ts.map +1 -1
  173. package/build/metadata/consts.d.ts +33 -0
  174. package/build/metadata/consts.d.ts.map +1 -1
  175. package/build/metadata/consts.js +37 -0
  176. package/build/metadata/consts.js.map +1 -1
  177. package/build/metadata/types.d.ts +1 -33
  178. package/build/metadata/types.d.ts.map +1 -1
  179. package/build/metadata/types.js +1 -38
  180. package/build/metadata/types.js.map +1 -1
  181. package/build/planning/consts.d.ts +13 -1
  182. package/build/planning/consts.d.ts.map +1 -1
  183. package/build/planning/consts.js +13 -0
  184. package/build/planning/consts.js.map +1 -1
  185. package/build/planning/index.d.ts +0 -1
  186. package/build/planning/index.d.ts.map +1 -1
  187. package/build/planning/index.js +0 -1
  188. package/build/planning/index.js.map +1 -1
  189. package/build/planning/landing.d.ts +0 -12
  190. package/build/planning/landing.d.ts.map +1 -1
  191. package/build/planning/landing.js +1 -13
  192. package/build/planning/landing.js.map +1 -1
  193. package/build/planning/schemas.d.ts +37 -0
  194. package/build/planning/schemas.d.ts.map +1 -1
  195. package/build/planning/schemas.js +173 -4
  196. package/build/planning/schemas.js.map +1 -1
  197. package/build/planning/types.d.ts +2 -2
  198. package/build/planning/types.d.ts.map +1 -1
  199. package/build/preview/consts.d.ts +3 -1
  200. package/build/preview/consts.d.ts.map +1 -1
  201. package/build/preview/consts.js +2 -0
  202. package/build/preview/consts.js.map +1 -1
  203. package/build/preview/types.d.ts +17 -2
  204. package/build/preview/types.d.ts.map +1 -1
  205. package/build/scaffold/helpers.d.ts +1 -14
  206. package/build/scaffold/helpers.d.ts.map +1 -1
  207. package/build/scaffold/helpers.js +11 -0
  208. package/build/scaffold/helpers.js.map +1 -1
  209. package/build/scaffold/types.d.ts +2 -0
  210. package/build/scaffold/types.d.ts.map +1 -1
  211. package/build/slot/consts.d.ts +7 -13
  212. package/build/slot/consts.d.ts.map +1 -1
  213. package/build/slot/consts.js +10 -36
  214. package/build/slot/consts.js.map +1 -1
  215. package/build/slot/helpers.d.ts +1 -6
  216. package/build/slot/helpers.d.ts.map +1 -1
  217. package/build/slot/helpers.js.map +1 -1
  218. package/build/slot/index.d.ts +1 -0
  219. package/build/slot/index.d.ts.map +1 -1
  220. package/build/slot/index.js +1 -0
  221. package/build/slot/index.js.map +1 -1
  222. package/build/slot/layout.d.ts +1 -57
  223. package/build/slot/layout.d.ts.map +1 -1
  224. package/build/slot/layout.js +0 -12
  225. package/build/slot/layout.js.map +1 -1
  226. package/build/slot/types.d.ts +55 -1
  227. package/build/slot/types.d.ts.map +1 -1
  228. package/build/slot/utils.d.ts +18 -0
  229. package/build/slot/utils.d.ts.map +1 -0
  230. package/build/slot/utils.js +41 -0
  231. package/build/slot/utils.js.map +1 -0
  232. package/build/topology/card.d.ts +1 -6
  233. package/build/topology/card.d.ts.map +1 -1
  234. package/build/topology/card.js +1 -3
  235. package/build/topology/card.js.map +1 -1
  236. package/build/topology/consts.local.d.ts +4 -0
  237. package/build/topology/consts.local.d.ts.map +1 -0
  238. package/build/topology/consts.local.js +4 -0
  239. package/build/topology/consts.local.js.map +1 -0
  240. package/build/topology/types.d.ts +5 -0
  241. package/build/topology/types.d.ts.map +1 -1
  242. package/package.json +13 -13
  243. package/src/agent/consts.local.ts +47 -0
  244. package/src/agent/consts.ts +61 -0
  245. package/src/agent/index.ts +1 -0
  246. package/src/agent/presentation.ts +4 -147
  247. package/src/agent/types.local.ts +1 -0
  248. package/src/agent/types.ts +40 -0
  249. package/src/areas/consts.ts +7 -0
  250. package/src/areas/tenancy.ts +2 -38
  251. package/src/areas/types.ts +31 -0
  252. package/src/ba/types.ts +1 -1
  253. package/src/blueprint/consts.local.ts +3 -0
  254. package/src/blueprint/consts.ts +52 -0
  255. package/src/blueprint/index.ts +1 -0
  256. package/src/blueprint/types.ts +2 -72
  257. package/src/blueprint/utils.ts +20 -0
  258. package/src/branding.ts +0 -17
  259. package/src/connect/consts.ts +0 -22
  260. package/src/connect/entrypoints.ts +7 -35
  261. package/src/connect/errors.ts +75 -0
  262. package/src/connect/index.ts +1 -0
  263. package/src/connect/references.ts +4 -75
  264. package/src/connect/schemas.ts +11 -0
  265. package/src/connect/types.local.ts +5 -0
  266. package/src/connect/types.ts +124 -1
  267. package/src/connect/utils.ts +23 -0
  268. package/src/consts.ts +17 -0
  269. package/src/convert/consts.local.ts +120 -0
  270. package/src/convert/consts.ts +0 -14
  271. package/src/convert/helpers.ts +1 -119
  272. package/src/convert/index.ts +1 -0
  273. package/src/convert/types.ts +11 -5
  274. package/src/convert/utils.ts +8 -0
  275. package/src/design/consts.ts +48 -0
  276. package/src/design/runtime.ts +2 -115
  277. package/src/design/schemas.ts +2 -10
  278. package/src/design/types.ts +81 -1
  279. package/src/dev/schemas.ts +1 -3
  280. package/src/dev/types.local.ts +4 -0
  281. package/src/integrity/consts.local.ts +5 -0
  282. package/src/integrity/consts.ts +0 -348
  283. package/src/integrity/index.ts +1 -0
  284. package/src/integrity/types.ts +34 -1
  285. package/src/integrity/utils.ts +320 -0
  286. package/src/integrity/verify.ts +2 -4
  287. package/src/intent/consts.local.ts +3 -0
  288. package/src/intent/entrypoints.ts +0 -1
  289. package/src/intent/flow.ts +2 -3
  290. package/src/intent/types.ts +3 -0
  291. package/src/metadata/consts.ts +37 -0
  292. package/src/metadata/types.ts +1 -37
  293. package/src/planning/consts.ts +15 -2
  294. package/src/planning/index.ts +0 -1
  295. package/src/planning/landing.ts +1 -14
  296. package/src/planning/schemas.ts +191 -4
  297. package/src/planning/types.ts +2 -2
  298. package/src/preview/consts.ts +2 -0
  299. package/src/preview/types.ts +19 -0
  300. package/src/scaffold/helpers.ts +1 -4
  301. package/src/scaffold/types.ts +3 -0
  302. package/src/slot/consts.ts +11 -40
  303. package/src/slot/helpers.ts +1 -6
  304. package/src/slot/index.ts +1 -0
  305. package/src/slot/layout.ts +1 -62
  306. package/src/slot/types.ts +57 -1
  307. package/src/slot/utils.ts +45 -0
  308. package/src/topology/card.ts +2 -9
  309. package/src/topology/consts.local.ts +6 -0
  310. package/src/topology/types.ts +6 -0
  311. package/tests/branding.spec.ts +2 -2
  312. package/tests/connect-convert.spec.ts +21 -1
  313. package/tests/connect-errors.spec.ts +34 -1
  314. package/tests/convert.spec.ts +2 -3
  315. package/tests/error-status.spec.ts +7 -1
  316. package/tests/planning.spec.ts +3 -18
  317. package/tests/presentation.spec.ts +2 -4
  318. package/build/planning/flows.d.ts +0 -34
  319. package/build/planning/flows.d.ts.map +0 -1
  320. package/build/planning/flows.js +0 -174
  321. package/build/planning/flows.js.map +0 -1
  322. package/src/planning/flows.ts +0 -204
@@ -0,0 +1,320 @@
1
+ import { HARNESS_PROTECTED, ROOT_PROTECTED } from './consts.local.js'
2
+ import { TARGET_BUNDLED_PACKAGES, TARGET_CURRENT_LAYOUT, TARGET_LEGACY_BUNDLED_PACKAGES, TARGET_LEGACY_PACKAGES, TARGET_LEGACY_PACKAGES_DIR, TARGET_PACKAGES_DIR, TargetLayout, TargetLegacyPackage, TargetPackage } from './consts.js'
3
+ import type { TargetLayoutManifest } from './types.js'
4
+
5
+ const fileIn = (dir: string, pkg: string, path: string): string => `${dir}/${pkg}/${path}`
6
+
7
+ const protectedOf = (
8
+ dir: string, packages: readonly string[], bundled: readonly string[]
9
+ ): readonly string[] => [
10
+ ...ROOT_PROTECTED,
11
+ ...HARNESS_PROTECTED,
12
+ ...packages.flatMap(pkg => [fileIn(dir, pkg, 'package.json'), fileIn(dir, pkg, 'tsconfig.json')]),
13
+ ...bundled.flatMap(pkg =>
14
+ [fileIn(dir, pkg, 'rollup.config.js'), fileIn(dir, pkg, 'rollup.build.mjs')]),
15
+ ]
16
+
17
+ const v2 = (pkg: TargetPackage, path: string): string =>
18
+ fileIn(TARGET_PACKAGES_DIR, pkg, path)
19
+
20
+ const v1 = (pkg: TargetLegacyPackage, path: string): string =>
21
+ fileIn(TARGET_LEGACY_PACKAGES_DIR, pkg, path)
22
+
23
+ /**
24
+ * The current layout: five workspace packages under `sources/`.
25
+ *
26
+ * `common` and `backend` are libraries the other three import, so they emit declarations with
27
+ * `tsc -b` rather than a bundle; `api`, `web` and `worker` each bundle themselves.
28
+ */
29
+ const V2_MANIFEST: TargetLayoutManifest = {
30
+ layout: TargetLayout.V2,
31
+ dir: TARGET_PACKAGES_DIR,
32
+ packages: Object.values(TargetPackage),
33
+ // The same file the publisher's own filesystem detection probes for (`sources/api`), so the
34
+ // two answers about one volume cannot disagree.
35
+ probe: v2(TargetPackage.Api, 'package.json'),
36
+ files: [
37
+ 'package.json',
38
+ 'bunfig.toml',
39
+ v2(TargetPackage.Common, 'package.json'),
40
+ v2(TargetPackage.Common, 'tsconfig.json'),
41
+ v2(TargetPackage.Common, 'src/index.ts'),
42
+ v2(TargetPackage.Common, 'src/entrypoints.ts'),
43
+ v2(TargetPackage.Backend, 'package.json'),
44
+ v2(TargetPackage.Backend, 'tsconfig.json'),
45
+ v2(TargetPackage.Backend, 'src/index.ts'),
46
+ v2(TargetPackage.Backend, 'src/context.ts'),
47
+ v2(TargetPackage.Backend, 'src/config.ts'),
48
+ v2(TargetPackage.Api, 'package.json'),
49
+ v2(TargetPackage.Api, 'tsconfig.json'),
50
+ v2(TargetPackage.Api, 'rollup.config.js'),
51
+ v2(TargetPackage.Api, 'rollup.build.mjs'),
52
+ v2(TargetPackage.Api, 'src/index.ts'),
53
+ v2(TargetPackage.Api, 'src/owlmeans.ts'),
54
+ v2(TargetPackage.Api, 'src/config.ts'),
55
+ v2(TargetPackage.Api, 'src/entrypoints.ts'),
56
+ v2(TargetPackage.Web, 'package.json'),
57
+ v2(TargetPackage.Web, 'tsconfig.json'),
58
+ v2(TargetPackage.Web, 'rollup.config.js'),
59
+ v2(TargetPackage.Web, 'rollup.build.mjs'),
60
+ v2(TargetPackage.Web, 'src/index.tsx'),
61
+ v2(TargetPackage.Web, 'src/owlmeans.ts'),
62
+ v2(TargetPackage.Web, 'src/config.ts'),
63
+ v2(TargetPackage.Web, 'src/entrypoints.ts'),
64
+ v2(TargetPackage.Worker, 'package.json'),
65
+ v2(TargetPackage.Worker, 'tsconfig.json'),
66
+ v2(TargetPackage.Worker, 'rollup.config.js'),
67
+ v2(TargetPackage.Worker, 'rollup.build.mjs'),
68
+ v2(TargetPackage.Worker, 'src/index.ts'),
69
+ v2(TargetPackage.Worker, 'src/owlmeans.ts'),
70
+ v2(TargetPackage.Worker, 'src/config.ts'),
71
+ v2(TargetPackage.Worker, 'src/entrypoints.ts'),
72
+ ],
73
+ protectedFiles: protectedOf(
74
+ TARGET_PACKAGES_DIR, Object.values(TargetPackage), TARGET_BUNDLED_PACKAGES),
75
+ buildScripts: {
76
+ [TargetPackage.Common]: 'tsc -b',
77
+ [TargetPackage.Backend]: 'tsc -b',
78
+ [TargetPackage.Api]: 'bun ./rollup.build.mjs',
79
+ [TargetPackage.Web]: 'bun ./rollup.build.mjs',
80
+ [TargetPackage.Worker]: 'bun ./rollup.build.mjs',
81
+ },
82
+ requiredDeps: {
83
+ [TargetPackage.Common]: ['@owlmeans/context', '@owlmeans/entrypoint'],
84
+ [TargetPackage.Backend]: ['@owlmeans/context', '@owlmeans/postgres-resource'],
85
+ [TargetPackage.Api]: ['@owlmeans/server-app'],
86
+ [TargetPackage.Web]: ['@owlmeans/web-client'],
87
+ [TargetPackage.Worker]: ['@owlmeans/queue', '@owlmeans/redis-queue'],
88
+ },
89
+ // `api` and `worker` both reach the database through `backend`, which is the whole reason
90
+ // `backend` is a library: two runtimes, one context factory, one set of resources. A `worker`
91
+ // that stopped depending on `backend` is processing jobs against something else.
92
+ workspaceDeps: {
93
+ [TargetPackage.Common]: [],
94
+ [TargetPackage.Backend]: [TargetPackage.Common],
95
+ [TargetPackage.Api]: [TargetPackage.Common, TargetPackage.Backend],
96
+ [TargetPackage.Web]: [TargetPackage.Common],
97
+ [TargetPackage.Worker]: [TargetPackage.Backend],
98
+ },
99
+ workspaceGlob: `${TARGET_PACKAGES_DIR}/*`,
100
+ workspaceEntries: Object.values(TargetPackage).map(pkg => `${TARGET_PACKAGES_DIR}/${pkg}`),
101
+ markers: {
102
+ [v2(TargetPackage.Common, 'src/index.ts')]: ['./entrypoints.js'],
103
+ [v2(TargetPackage.Backend, 'src/index.ts')]: ['./context.js'],
104
+ [v2(TargetPackage.Backend, 'src/context.ts')]: ['@owlmeans/context', 'makeContext'],
105
+ [v2(TargetPackage.Api, 'src/index.ts')]: ['./owlmeans.js', 'initOwlMeans'],
106
+ [v2(TargetPackage.Api, 'src/owlmeans.ts')]: ['@owlmeans/server-app', 'makeContext'],
107
+ [v2(TargetPackage.Web, 'src/index.tsx')]: ['@owlmeans/web-client', 'renderApp', './owlmeans'],
108
+ [v2(TargetPackage.Web, 'src/owlmeans.ts')]: ['makeContext', 'owlCtx'],
109
+ // The worker binds nothing but its health port; what makes it a worker is that it listens.
110
+ [v2(TargetPackage.Worker, 'src/index.ts')]: ['./owlmeans.js', 'initOwlMeans'],
111
+ [v2(TargetPackage.Worker, 'src/owlmeans.ts')]: ['@owlmeans/queue', 'makeContext'],
112
+ // The build configuration itself: what it reads and what it emits. These are the paths the
113
+ // publisher spawns and serves, so a config that redirects either one is a different program.
114
+ // Matched loosely enough to survive the `path.resolve(srcDir, …)` the template writes them
115
+ // with, and strictly enough that an input or an output somewhere else fails.
116
+ [v2(TargetPackage.Api, 'rollup.config.js')]: ['input:', 'index.ts', 'dist', 'index.js'],
117
+ [v2(TargetPackage.Web, 'rollup.config.js')]: ['input:', 'index.tsx', 'dist', 'bundle.js'],
118
+ [v2(TargetPackage.Worker, 'rollup.config.js')]: ['input:', 'index.ts', 'dist', 'index.js'],
119
+ },
120
+ }
121
+
122
+ /**
123
+ * The legacy layout: three workspace packages under `packages/`.
124
+ *
125
+ * Frozen — nothing generates one any more, and every rule here is stated against the trees that
126
+ * exist rather than against a template this repository still ships (it does not). `backend` is
127
+ * the HTTP server AND the data layer, which is why it carries both `@owlmeans/server-app` and
128
+ * `@owlmeans/postgres-resource`; `common` is the only library.
129
+ */
130
+ const V1_MANIFEST: TargetLayoutManifest = {
131
+ layout: TargetLayout.V1,
132
+ dir: TARGET_LEGACY_PACKAGES_DIR,
133
+ packages: TARGET_LEGACY_PACKAGES,
134
+ // `packages/backend` again — the publisher's own marker for this layout.
135
+ probe: v1(TargetLegacyPackage.Backend, 'package.json'),
136
+ files: [
137
+ 'package.json',
138
+ 'bunfig.toml',
139
+ v1(TargetLegacyPackage.Common, 'package.json'),
140
+ v1(TargetLegacyPackage.Common, 'tsconfig.json'),
141
+ v1(TargetLegacyPackage.Common, 'src/index.ts'),
142
+ v1(TargetLegacyPackage.Common, 'src/entrypoints.ts'),
143
+ v1(TargetLegacyPackage.Backend, 'package.json'),
144
+ v1(TargetLegacyPackage.Backend, 'tsconfig.json'),
145
+ v1(TargetLegacyPackage.Backend, 'rollup.config.js'),
146
+ v1(TargetLegacyPackage.Backend, 'rollup.build.mjs'),
147
+ v1(TargetLegacyPackage.Backend, 'src/index.ts'),
148
+ v1(TargetLegacyPackage.Backend, 'src/owlmeans.ts'),
149
+ v1(TargetLegacyPackage.Backend, 'src/config.ts'),
150
+ v1(TargetLegacyPackage.Backend, 'src/entrypoints.ts'),
151
+ v1(TargetLegacyPackage.Frontend, 'package.json'),
152
+ v1(TargetLegacyPackage.Frontend, 'tsconfig.json'),
153
+ v1(TargetLegacyPackage.Frontend, 'rollup.config.js'),
154
+ v1(TargetLegacyPackage.Frontend, 'rollup.build.mjs'),
155
+ v1(TargetLegacyPackage.Frontend, 'src/index.tsx'),
156
+ v1(TargetLegacyPackage.Frontend, 'src/owlmeans.ts'),
157
+ v1(TargetLegacyPackage.Frontend, 'src/config.ts'),
158
+ v1(TargetLegacyPackage.Frontend, 'src/entrypoints.ts'),
159
+ ],
160
+ protectedFiles: protectedOf(
161
+ TARGET_LEGACY_PACKAGES_DIR, TARGET_LEGACY_PACKAGES, TARGET_LEGACY_BUNDLED_PACKAGES),
162
+ buildScripts: {
163
+ [TargetLegacyPackage.Common]: 'tsc -b',
164
+ [TargetLegacyPackage.Backend]: 'bun ./rollup.build.mjs',
165
+ [TargetLegacyPackage.Frontend]: 'bun ./rollup.build.mjs',
166
+ },
167
+ requiredDeps: {
168
+ [TargetLegacyPackage.Common]: ['@owlmeans/context', '@owlmeans/entrypoint'],
169
+ [TargetLegacyPackage.Backend]: ['@owlmeans/server-app', '@owlmeans/postgres-resource'],
170
+ [TargetLegacyPackage.Frontend]: ['@owlmeans/web-client'],
171
+ },
172
+ workspaceDeps: {
173
+ [TargetLegacyPackage.Common]: [],
174
+ [TargetLegacyPackage.Backend]: [TargetLegacyPackage.Common],
175
+ [TargetLegacyPackage.Frontend]: [TargetLegacyPackage.Common],
176
+ },
177
+ workspaceGlob: `${TARGET_LEGACY_PACKAGES_DIR}/*`,
178
+ workspaceEntries: TARGET_LEGACY_PACKAGES.map(pkg => `${TARGET_LEGACY_PACKAGES_DIR}/${pkg}`),
179
+ markers: {
180
+ [v1(TargetLegacyPackage.Common, 'src/index.ts')]: ['./entrypoints.js'],
181
+ [v1(TargetLegacyPackage.Backend, 'src/index.ts')]: ['./owlmeans.js', 'initOwlMeans'],
182
+ [v1(TargetLegacyPackage.Backend, 'src/owlmeans.ts')]: ['@owlmeans/server-app', 'makeContext'],
183
+ [v1(TargetLegacyPackage.Frontend, 'src/index.tsx')]:
184
+ ['@owlmeans/web-client', 'renderApp', './owlmeans'],
185
+ [v1(TargetLegacyPackage.Frontend, 'src/owlmeans.ts')]: ['makeContext', 'owlCtx'],
186
+ [v1(TargetLegacyPackage.Backend, 'rollup.config.js')]:
187
+ ['input:', 'index.ts', 'dist', 'index.js'],
188
+ [v1(TargetLegacyPackage.Frontend, 'rollup.config.js')]:
189
+ ['input:', 'index.tsx', 'dist', 'bundle.js'],
190
+ },
191
+ }
192
+
193
+ /**
194
+ * Every layout the platform is willing to run, keyed by its own name.
195
+ *
196
+ * Declared current-first, and the order is load-bearing: detection walks it and takes the first
197
+ * probe it finds, so a half-migrated tree carrying both is verified against the layout the
198
+ * platform generates today rather than against the frozen one.
199
+ */
200
+ export const TARGET_LAYOUTS: Readonly<Record<TargetLayout, TargetLayoutManifest>> = {
201
+ [TargetLayout.V2]: V2_MANIFEST,
202
+ [TargetLayout.V1]: V1_MANIFEST,
203
+ }
204
+
205
+ /** What one layout asserts. */
206
+ export const targetManifest = (layout: TargetLayout): TargetLayoutManifest =>
207
+ TARGET_LAYOUTS[layout]
208
+
209
+ /**
210
+ * Whether a tree of this layout can still be GENERATED INTO.
211
+ *
212
+ * A legacy target is served, built and run exactly like any other — that is the whole point of
213
+ * verifying it against its own manifest. What no longer works on it is code generation: every
214
+ * path builder, every stamped import specifier and the whole `docs/` metadata tree name the
215
+ * current layout's packages, so a story implemented into a legacy tree writes files into
216
+ * directories its workspace does not contain. That fails silently — the build succeeds, the
217
+ * story completes and the application does not change — which is why the platform refuses
218
+ * instead, and names re-initialization as the one cure.
219
+ *
220
+ * `undefined` reads as current: a publisher that predates layout reporting omits it, and reading
221
+ * that silence as legacy would refuse development for every slot already in the cluster.
222
+ */
223
+ export const isLegacyLayout = (layout: TargetLayout | string | undefined | null): boolean =>
224
+ layout != null && layout !== TARGET_CURRENT_LAYOUT
225
+
226
+ /**
227
+ * The files whose presence tells the layouts apart.
228
+ *
229
+ * Each layout's probe is a path the other cannot have. They are members of their own layout's
230
+ * file list too, so a caller that reads {@link TARGET_INTEGRITY_FILES} always has both in hand —
231
+ * which is the whole reason detection works at all. It did not before: the probe for the legacy
232
+ * layout was declared but never read, so `detectTargetLayout` could only ever answer `V2`.
233
+ */
234
+ export const TARGET_LAYOUT_PROBE_FILES: readonly string[] =
235
+ Object.values(TARGET_LAYOUTS).map(manifest => manifest.probe)
236
+
237
+ /**
238
+ * Which layout a tree is in, from its files alone — IO-free, like everything else here.
239
+ *
240
+ * A tree that shows neither probe is reported as the current layout: it is not a target at all,
241
+ * and the integrity report is what has to say so, in the vocabulary of the layout the platform
242
+ * generates today.
243
+ */
244
+ export const detectTargetLayout = (files: Record<string, string | null>): TargetLayout => {
245
+ for (const manifest of Object.values(TARGET_LAYOUTS)) {
246
+ if (files[manifest.probe] != null) {
247
+ return manifest.layout
248
+ }
249
+ }
250
+
251
+ return TARGET_CURRENT_LAYOUT
252
+ }
253
+
254
+ /**
255
+ * Files a caller must read and hand to `verifyTargetShape`.
256
+ *
257
+ * The UNION over every layout, because a caller reads before it knows which layout it is holding
258
+ * and the probes are what settle that. The verifier reports only the files its selected layout
259
+ * actually requires, so the extra reads cost a `stat` each and never a violation.
260
+ *
261
+ * The verifier is pure and does no IO of its own — the publisher reads these from the PVC, and
262
+ * a test reads them from the template tree. A path that does not exist is passed as `null`,
263
+ * which the verifier reports rather than skipping: absence is a violation for everything here.
264
+ */
265
+ export const TARGET_INTEGRITY_FILES: readonly string[] = [
266
+ ...new Set(Object.values(TARGET_LAYOUTS).flatMap(manifest => manifest.files)),
267
+ ]
268
+
269
+ /**
270
+ * Files no user-facing write may touch, through any path — the union over every layout.
271
+ *
272
+ * These are the ones that decide what gets EXECUTED — the build scripts, the package manifests
273
+ * that name them, the compiler configuration that resolves them, and the install configuration.
274
+ * The agent harness is here for the same reason: `.claude/settings.json` declares a
275
+ * `SessionStart` hook and `.agents/scripts/link-skills.sh` is the command it spawns, so a write
276
+ * to either runs code in the slot the next time an agent session opens, with no build and no
277
+ * request involved. The agent's own generator already refuses the wiring sources
278
+ * (`WIRING_SOURCES`), but that guard is LLM-scoped: it never saw a manual editor save and never
279
+ * saw a git merge.
280
+ *
281
+ * The union rather than the current layout's list, because this is a path-shaped refusal with
282
+ * nothing to gain from being narrow: a v2 path cannot exist in a v1 tree, so covering both costs
283
+ * nothing and covers the legacy slots that were left writable.
284
+ */
285
+ export const TARGET_PROTECTED_FILES: readonly string[] = [
286
+ ...new Set(Object.values(TARGET_LAYOUTS).flatMap(manifest => manifest.protectedFiles)),
287
+ ]
288
+
289
+ /** `<slug>-<package>` — the only way a workspace package is ever named, in either layout. */
290
+ export const targetPackageName = (slug: string, pkg: string): string => `${slug}-${pkg}`
291
+
292
+ /** Everything one package must declare, once the root manifest has named the slug. */
293
+ export const targetRequiredDeps = (
294
+ slug: string, pkg: string, layout: TargetLayout = TARGET_CURRENT_LAYOUT
295
+ ): string[] => {
296
+ const manifest = targetManifest(layout)
297
+
298
+ return [
299
+ ...(manifest.requiredDeps[pkg] ?? []),
300
+ ...(manifest.workspaceDeps[pkg] ?? []).map(dep => targetPackageName(slug, dep)),
301
+ ]
302
+ }
303
+
304
+ /**
305
+ * The current layout's own rules, kept as named constants because consumers outside the verifier
306
+ * ask about the tree the platform generates today — never about a frozen one.
307
+ */
308
+ export const TARGET_BUILD_SCRIPTS: Readonly<Record<string, string>> = V2_MANIFEST.buildScripts
309
+
310
+ export const TARGET_REQUIRED_DEPS: Readonly<Record<string, readonly string[]>> =
311
+ V2_MANIFEST.requiredDeps
312
+
313
+ export const TARGET_WORKSPACE_DEPS: Readonly<Record<string, readonly string[]>> =
314
+ V2_MANIFEST.workspaceDeps
315
+
316
+ export const TARGET_ENTRY_MARKERS: Readonly<Record<string, readonly string[]>> = V2_MANIFEST.markers
317
+
318
+ export const TARGET_WORKSPACE_GLOB = V2_MANIFEST.workspaceGlob
319
+
320
+ export const TARGET_WORKSPACE_ENTRIES: readonly string[] = V2_MANIFEST.workspaceEntries
@@ -1,7 +1,5 @@
1
- import {
2
- detectTargetLayout, IntegrityRule, TARGET_FORBIDDEN_SCRIPTS, TARGET_SLUG_PATTERN,
3
- targetManifest, targetPackageName, targetRequiredDeps
4
- } from './consts.js'
1
+ import { IntegrityRule, TARGET_FORBIDDEN_SCRIPTS, TARGET_SLUG_PATTERN } from './consts.js'
2
+ import { detectTargetLayout, targetManifest, targetPackageName, targetRequiredDeps } from './utils.js'
5
3
  import type { IntegrityViolation, TargetFileMap, TargetIntegrityReport } from './types.js'
6
4
 
7
5
  /**
@@ -0,0 +1,3 @@
1
+ import { INTENT_PAYLOAD_REF } from './consts.js'
2
+
3
+ export const payloadMap = { [INTENT_PAYLOAD_REF]: 0 }
@@ -40,4 +40,3 @@ export const makeIntentProtocols = (opts: IntentProtocolOptions = {}) => {
40
40
  }
41
41
  }
42
42
 
43
- export type IntentProtocols = ReturnType<typeof makeIntentProtocols>
@@ -1,9 +1,8 @@
1
1
  import { DISPATCHER } from '@owlmeans/auth'
2
2
  import { HOME } from '@owlmeans/context'
3
3
  import type { ShallowFlow } from '@owlmeans/flow'
4
- import { INTENT_FLOW, INTENT_PAYLOAD_REF, intent, IntentFlowStep } from './consts.js'
5
-
6
- const payloadMap = { [INTENT_PAYLOAD_REF]: 0 }
4
+ import { INTENT_FLOW, intent, IntentFlowStep } from './consts.js'
5
+ import { payloadMap } from './consts.local.js'
7
6
 
8
7
  /**
9
8
  * The hand-off flow both sides walk.
@@ -1,4 +1,5 @@
1
1
  import type { ResourceRecord } from '@owlmeans/resource'
2
+ import { makeIntentProtocols } from './entrypoints.js'
2
3
 
3
4
  /** What the public site sends: the prompt and the person's confirmation of its processing. */
4
5
  export interface IntentStashBody {
@@ -43,3 +44,5 @@ export interface IntentProtocolOptions {
43
44
  /** Path of the landing screen; defaults to `/start`. */
44
45
  landing?: string
45
46
  }
47
+
48
+ export type IntentProtocols = ReturnType<typeof makeIntentProtocols>
@@ -116,3 +116,40 @@ export const METADATA_SUFFIXES = [SPEC_SUFFIX, UX_SUFFIX, UI_SUFFIX]
116
116
 
117
117
  /** The trees the pipeline writes into — excluded wholesale when source files are enumerated. */
118
118
  export const METADATA_DIRS = [HARNESS_DIR, DOCS_DIR]
119
+
120
+ export enum MetadataKind {
121
+ Project = 'project',
122
+ Story = 'story',
123
+ Source = 'source',
124
+ History = 'history',
125
+ }
126
+
127
+ export enum MetadataListKind {
128
+ Stories = 'stories',
129
+ Meta = 'meta',
130
+ // All metadata: the docs/ and .agents/ trees + co-located *.spec/.ux/.ui.md beside sources
131
+ All = 'all',
132
+ }
133
+
134
+ /**
135
+ * What a registry entry names.
136
+ *
137
+ * One entry per artifact the pipeline can generate, so that "where does this live" and "what is
138
+ * it called" have exactly one answer for the whole life of the project.
139
+ */
140
+ export enum RegistryKind {
141
+ /** The single directory segment an entity owns across models/, resources/ and backend models/ */
142
+ EntityDir = 'entity-dir',
143
+ ModelType = 'model-type',
144
+ Resource = 'resource',
145
+ BackendModel = 'backend-model',
146
+ ApiHandlers = 'api-handlers',
147
+ Service = 'service',
148
+ Layout = 'layout',
149
+ Screen = 'screen',
150
+ Component = 'component',
151
+ ViewModel = 'view-model',
152
+ State = 'state',
153
+ /** Alias-only entry for one endpoint — carries no source path of its own */
154
+ ApiEntrypoint = 'api-entrypoint',
155
+ }
@@ -1,5 +1,6 @@
1
1
 
2
2
  import type { SpecCategory } from '../ba/consts.js'
3
+ import { MetadataKind, MetadataListKind, RegistryKind } from './consts.js'
3
4
 
4
5
  export interface MetadataFile<T extends Record<string, unknown> = Record<string, unknown>> {
5
6
  path: string
@@ -12,20 +13,6 @@ export interface MetadataWriteInput<T extends Record<string, unknown> = Record<s
12
13
  body: string
13
14
  }
14
15
 
15
- export enum MetadataKind {
16
- Project = 'project',
17
- Story = 'story',
18
- Source = 'source',
19
- History = 'history',
20
- }
21
-
22
- export enum MetadataListKind {
23
- Stories = 'stories',
24
- Meta = 'meta',
25
- // All metadata: the docs/ and .agents/ trees + co-located *.spec/.ux/.ui.md beside sources
26
- All = 'all',
27
- }
28
-
29
16
  /**
30
17
  * Identifies a single metadata document to read:
31
18
  * - Project: kind=Project, no ref/category needed
@@ -181,29 +168,6 @@ export interface StoryWriteInput {
181
168
 
182
169
  // ─── Name registry (.agents/memory/registry.md) ───────────────────────────────────────
183
170
 
184
- /**
185
- * What a registry entry names.
186
- *
187
- * One entry per artifact the pipeline can generate, so that "where does this live" and "what is
188
- * it called" have exactly one answer for the whole life of the project.
189
- */
190
- export enum RegistryKind {
191
- /** The single directory segment an entity owns across models/, resources/ and backend models/ */
192
- EntityDir = 'entity-dir',
193
- ModelType = 'model-type',
194
- Resource = 'resource',
195
- BackendModel = 'backend-model',
196
- ApiHandlers = 'api-handlers',
197
- Service = 'service',
198
- Layout = 'layout',
199
- Screen = 'screen',
200
- Component = 'component',
201
- ViewModel = 'view-model',
202
- State = 'state',
203
- /** Alias-only entry for one endpoint — carries no source path of its own */
204
- ApiEntrypoint = 'api-entrypoint',
205
- }
206
-
207
171
  /**
208
172
  * One allocated name.
209
173
  *
@@ -1,5 +1,4 @@
1
- import { CodeScope, CodeStyle } from '@owlmeans/planning'
2
- import type { CodePolicy } from '@owlmeans/planning'
1
+ import { CodeScope, CodeStyle, type CodePolicy } from '@owlmeans/planning'
3
2
 
4
3
  /**
5
4
  * The OwlMeans Viable vocabulary over `@owlmeans/planning`.
@@ -180,3 +179,17 @@ export const VIABLE_IMPROVEMENT_CODE: CodePolicy = Object.freeze({
180
179
  export const VIABLE_REQUIREMENT_CODE: CodePolicy = Object.freeze({
181
180
  ...VIABLE_STORY_CODE, prefix: VIABLE_REQUIREMENT_CODE_PREFIX,
182
181
  })
182
+
183
+ /**
184
+ * The sentence a landing story's narrative carries — what a person reading the board sees.
185
+ *
186
+ * The AUTHORITY is the card's `fields.landing` flag, never this text: the design and development
187
+ * stages key on the flag, and a person may reword the narrative at any time. The sentence exists so
188
+ * the board says in plain words why this story is different, and so the analyst and the designer,
189
+ * who read the narrative, write a screen that continues what the guest started.
190
+ *
191
+ * A constant, byte for byte, because {@link hasLandingSentence} is how a resumed decision step
192
+ * knows it already appended it.
193
+ */
194
+ export const LANDING_STORY_SENTENCE = 'A visitor can start this on the landing page without an account;'
195
+ + ' after signing in they continue here with their choices carried over.'
@@ -1,7 +1,6 @@
1
1
  export * from './consts.js'
2
2
  export * from './errors.js'
3
3
  export * from './schemas.js'
4
- export * from './flows.js'
5
4
  export * from './helpers.js'
6
5
  export * from './landing.js'
7
6
  export type * from './types.js'
@@ -1,18 +1,5 @@
1
1
  import { TITLE_MAX } from '@owlmeans/planning'
2
-
3
- /**
4
- * The sentence a landing story's narrative carries — what a person reading the board sees.
5
- *
6
- * The AUTHORITY is the card's `fields.landing` flag, never this text: the design and development
7
- * stages key on the flag, and a person may reword the narrative at any time. The sentence exists so
8
- * the board says in plain words why this story is different, and so the analyst and the designer,
9
- * who read the narrative, write a screen that continues what the guest started.
10
- *
11
- * A constant, byte for byte, because {@link hasLandingSentence} is how a resumed decision step
12
- * knows it already appended it.
13
- */
14
- export const LANDING_STORY_SENTENCE = 'A visitor can start this on the landing page without an account;'
15
- + ' after signing in they continue here with their choices carried over.'
2
+ import { LANDING_STORY_SENTENCE } from './consts.js'
16
3
 
17
4
  const normalized = (text: string): string => text.replace(/\s+/g, ' ')
18
5