@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/viable-common",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "license": "MIT",
5
5
  "description": "Runtime-free contracts of the OwlMeans Viable platform — the analysis, design and metadata shapes of a generated project, its target-shape manifest, the slot command vocabulary, the connector protocol and the conversion vocabulary, and the intent-first hand-off from the public site to the platform.",
6
6
  "type": "module",
@@ -58,24 +58,24 @@
58
58
  }
59
59
  },
60
60
  "devDependencies": {
61
- "@langchain/core": "^1.2.9",
61
+ "@langchain/core": "^1.2.14",
62
62
  "@owlmeans/dep-config": "workspace:*",
63
- "ajv": "^8.17.1",
63
+ "ajv": "^8.20.0",
64
64
  "ajv-formats": "^3.0.1",
65
65
  "nodemon": "^3.1.14",
66
66
  "typescript": "^7.0.2"
67
67
  },
68
68
  "dependencies": {
69
- "@owlmeans/agent-common": "^0.1.18-rc.45",
70
- "@owlmeans/auth": "^0.1.18-rc.38",
71
- "@owlmeans/context": "^0.1.18-rc.32",
72
- "@owlmeans/entrypoint": "^0.1.18-rc.39",
73
- "@owlmeans/error": "^0.1.18-rc.36",
74
- "@owlmeans/flow": "^0.1.18-rc.42",
75
- "@owlmeans/llm-common": "^0.1.18-rc.37",
76
- "@owlmeans/planning": "^0.1.18-rc.17",
77
- "@owlmeans/resource": "^0.1.18-rc.37",
78
- "@owlmeans/route": "^0.1.18-rc.33"
69
+ "@owlmeans/agent-common": "^0.1.18-rc.47",
70
+ "@owlmeans/auth": "^0.1.18-rc.39",
71
+ "@owlmeans/context": "^0.1.18-rc.33",
72
+ "@owlmeans/entrypoint": "^0.1.18-rc.40",
73
+ "@owlmeans/error": "^0.1.18-rc.37",
74
+ "@owlmeans/flow": "^0.1.18-rc.44",
75
+ "@owlmeans/llm-common": "^0.1.18-rc.38",
76
+ "@owlmeans/planning": "^0.1.18-rc.18",
77
+ "@owlmeans/resource": "^0.1.18-rc.39",
78
+ "@owlmeans/route": "^0.1.18-rc.34"
79
79
  },
80
80
  "publishConfig": {
81
81
  "access": "public"
@@ -0,0 +1,47 @@
1
+ import { AgentMarkdownKind, AgentStructuredKind } from './consts.js'
2
+
3
+ export const documentActions: Record<string, AgentMarkdownKind> = {
4
+ 'write-specification': AgentMarkdownKind.Specification,
5
+ 'summarize-specification': AgentMarkdownKind.Specification,
6
+ 'write-design-concept': AgentMarkdownKind.DesignDocument,
7
+ 'describe-ui-component': AgentMarkdownKind.DesignDocument,
8
+ 'describe-ui-screen': AgentMarkdownKind.DesignDocument,
9
+ 'describe-ui-layout': AgentMarkdownKind.DesignDocument,
10
+ }
11
+
12
+ export const codeActions = new Set(['code', 'update-code', 'update-code-full'])
13
+
14
+ /**
15
+ * The model's schema makes the final output self-describing; while it streams, the helper action
16
+ * gives the client the same semantic cue before a complete JSON value exists.
17
+ */
18
+ export const structuredActions: Record<string, AgentStructuredKind> = {
19
+ 'choose-files-for-fix': AgentStructuredKind.ArtifactSelection,
20
+ 'list-files-to-fix': AgentStructuredKind.ArtifactSelection,
21
+ 'extract-user-stories-from-spec': AgentStructuredKind.StoryPlan,
22
+ 'derive-connecting-stories': AgentStructuredKind.StoryPlan,
23
+ 'derive-area-scaffold-stories': AgentStructuredKind.StoryPlan,
24
+ 'describe-ux-story-transitions': AgentStructuredKind.TransitionPlan,
25
+ 'find-entrypoint-for-screen': AgentStructuredKind.EntrypointSelection,
26
+ 'describe-api-access': AgentStructuredKind.AccessPolicy,
27
+ 'describe-screen-access': AgentStructuredKind.AccessPolicy,
28
+ 'plan-scaffold': AgentStructuredKind.ScaffoldPlan,
29
+ 'runtime-gate': AgentStructuredKind.RuntimeDecision,
30
+ 'detect-story-with-home-screen': AgentStructuredKind.CandidateRanking,
31
+ }
32
+
33
+ /**
34
+ * Classifies known model output by source AND shape. The `value` comes from a caller's JSON
35
+ * parser; this runtime-free package intentionally never repairs or parses streamed JSON itself.
36
+ */
37
+ /**
38
+ * Actions run by an unconstrained tool-calling loop (the coding agent, the repair/architect/
39
+ * lookup sub-agents, source extraction) rather than a single pinned-schema call. Their tool calls
40
+ * are file/shell operations, not model-schema output, so they always render as ToolCalls even
41
+ * when a call's arguments happen to shape-match a schema kind — `read_sources({ files })` looks
42
+ * exactly like an ArtifactSelection.
43
+ */
44
+ export const agentLoopActions = new Set([
45
+ 'coding-agent-ask', 'arbitrary-modification', 'fix-agent', 'architect', 'declaration-lookup',
46
+ 'source-extract',
47
+ ])
@@ -0,0 +1,61 @@
1
+ /**
2
+ * A compact, runtime-free description of how an agent message should be presented.
3
+ *
4
+ * The server emits this with thinking events and the browser refines it as streaming output
5
+ * becomes parseable. Keeping the vocabulary here prevents the two runtimes from drifting into
6
+ * their own guesses about the same model response.
7
+ */
8
+ export enum AgentMessageCategory {
9
+ Code = 'code',
10
+ Diff = 'diff',
11
+ Structured = 'structured',
12
+ Markdown = 'markdown',
13
+ Plain = 'plain',
14
+ }
15
+
16
+ export enum AgentCodeLanguage {
17
+ ReactTsx = 'react-tsx',
18
+ Css = 'css',
19
+ TypeScript = 'typescript',
20
+ Json = 'json',
21
+ Other = 'other',
22
+ }
23
+
24
+ /** A semantic shape that the manager can render as a purpose-built card. */
25
+ export enum AgentStructuredKind {
26
+ ToolCalls = 'tool-calls',
27
+ ArtifactSelection = 'artifact-selection',
28
+ EntitySelection = 'entity-selection',
29
+ StoryPlan = 'story-plan',
30
+ ScreenPlan = 'screen-plan',
31
+ ComponentPlan = 'component-plan',
32
+ TransitionPlan = 'transition-plan',
33
+ EntrypointSelection = 'entrypoint-selection',
34
+ AccessPolicy = 'access-policy',
35
+ ScaffoldPlan = 'scaffold-plan',
36
+ RuntimeDecision = 'runtime-decision',
37
+ CandidateRanking = 'candidate-ranking',
38
+ Decision = 'decision',
39
+ GenericRecord = 'generic-record',
40
+ GenericList = 'generic-list',
41
+ GenericValue = 'generic-value',
42
+ }
43
+
44
+ export enum AgentMarkdownKind {
45
+ Specification = 'specification',
46
+ DesignDocument = 'design-document',
47
+ Documentation = 'documentation',
48
+ }
49
+
50
+ /** The family of specialist that produced an output, not an authorization role. */
51
+ export enum AgentMessageRole {
52
+ Technical = 'technical',
53
+ Analytical = 'analytical',
54
+ Product = 'product',
55
+ Ux = 'ux',
56
+ VisualDesign = 'visual-design',
57
+ Architect = 'architect',
58
+ Developer = 'developer',
59
+ Repair = 'repair',
60
+ Orchestrator = 'orchestrator',
61
+ }
@@ -3,3 +3,4 @@ export type * from './types.js'
3
3
  export * from './spectator/index.js'
4
4
  export * from './memory.js'
5
5
  export * from './presentation.js'
6
+ export * from './consts.js'
@@ -1,135 +1,8 @@
1
- /**
2
- * A compact, runtime-free description of how an agent message should be presented.
3
- *
4
- * The server emits this with thinking events and the browser refines it as streaming output
5
- * becomes parseable. Keeping the vocabulary here prevents the two runtimes from drifting into
6
- * their own guesses about the same model response.
7
- */
8
- export enum AgentMessageCategory {
9
- Code = 'code',
10
- Diff = 'diff',
11
- Structured = 'structured',
12
- Markdown = 'markdown',
13
- Plain = 'plain',
14
- }
15
-
16
- export enum AgentCodeLanguage {
17
- ReactTsx = 'react-tsx',
18
- Css = 'css',
19
- TypeScript = 'typescript',
20
- Json = 'json',
21
- Other = 'other',
22
- }
23
-
24
- /** A semantic shape that the manager can render as a purpose-built card. */
25
- export enum AgentStructuredKind {
26
- ToolCalls = 'tool-calls',
27
- ArtifactSelection = 'artifact-selection',
28
- EntitySelection = 'entity-selection',
29
- StoryPlan = 'story-plan',
30
- ScreenPlan = 'screen-plan',
31
- ComponentPlan = 'component-plan',
32
- TransitionPlan = 'transition-plan',
33
- EntrypointSelection = 'entrypoint-selection',
34
- AccessPolicy = 'access-policy',
35
- ScaffoldPlan = 'scaffold-plan',
36
- RuntimeDecision = 'runtime-decision',
37
- CandidateRanking = 'candidate-ranking',
38
- Decision = 'decision',
39
- GenericRecord = 'generic-record',
40
- GenericList = 'generic-list',
41
- GenericValue = 'generic-value',
42
- }
43
-
44
- export enum AgentMarkdownKind {
45
- Specification = 'specification',
46
- DesignDocument = 'design-document',
47
- Documentation = 'documentation',
48
- }
49
-
50
- /** The family of specialist that produced an output, not an authorization role. */
51
- export enum AgentMessageRole {
52
- Technical = 'technical',
53
- Analytical = 'analytical',
54
- Product = 'product',
55
- Ux = 'ux',
56
- VisualDesign = 'visual-design',
57
- Architect = 'architect',
58
- Developer = 'developer',
59
- Repair = 'repair',
60
- Orchestrator = 'orchestrator',
61
- }
62
-
63
- export interface AgentCodePresentation {
64
- category: AgentMessageCategory.Code | AgentMessageCategory.Diff
65
- language: AgentCodeLanguage
66
- role: AgentMessageRole
67
- }
68
-
69
- export interface AgentStructuredPresentation {
70
- category: AgentMessageCategory.Structured
71
- structure: AgentStructuredKind
72
- role: AgentMessageRole
73
- }
74
-
75
- export interface AgentMarkdownPresentation {
76
- category: AgentMessageCategory.Markdown
77
- document: AgentMarkdownKind
78
- role: AgentMessageRole
79
- }
80
1
 
81
- export interface AgentPlainPresentation {
82
- category: AgentMessageCategory.Plain
83
- role: AgentMessageRole
84
- }
85
-
86
- export type AgentMessagePresentation =
87
- | AgentCodePresentation
88
- | AgentStructuredPresentation
89
- | AgentMarkdownPresentation
90
- | AgentPlainPresentation
91
-
92
- /** The attribution and content available to either side of a thinking event. */
93
- export interface AgentMessageClassificationInput {
94
- agent?: string
95
- helper?: string
96
- action?: string
97
- outputType?: string
98
- text?: string
99
- value?: unknown
100
- }
101
-
102
- type RecordValue = Record<string, unknown>
103
-
104
- const documentActions: Record<string, AgentMarkdownKind> = {
105
- 'write-specification': AgentMarkdownKind.Specification,
106
- 'summarize-specification': AgentMarkdownKind.Specification,
107
- 'write-design-concept': AgentMarkdownKind.DesignDocument,
108
- 'describe-ui-component': AgentMarkdownKind.DesignDocument,
109
- 'describe-ui-screen': AgentMarkdownKind.DesignDocument,
110
- 'describe-ui-layout': AgentMarkdownKind.DesignDocument,
111
- }
112
-
113
- const codeActions = new Set(['code', 'update-code', 'update-code-full'])
114
-
115
- /**
116
- * The model's schema makes the final output self-describing; while it streams, the helper action
117
- * gives the client the same semantic cue before a complete JSON value exists.
118
- */
119
- const structuredActions: Record<string, AgentStructuredKind> = {
120
- 'choose-files-for-fix': AgentStructuredKind.ArtifactSelection,
121
- 'list-files-to-fix': AgentStructuredKind.ArtifactSelection,
122
- 'extract-user-stories-from-spec': AgentStructuredKind.StoryPlan,
123
- 'derive-connecting-stories': AgentStructuredKind.StoryPlan,
124
- 'derive-area-scaffold-stories': AgentStructuredKind.StoryPlan,
125
- 'describe-ux-story-transitions': AgentStructuredKind.TransitionPlan,
126
- 'find-entrypoint-for-screen': AgentStructuredKind.EntrypointSelection,
127
- 'describe-api-access': AgentStructuredKind.AccessPolicy,
128
- 'describe-screen-access': AgentStructuredKind.AccessPolicy,
129
- 'plan-scaffold': AgentStructuredKind.ScaffoldPlan,
130
- 'runtime-gate': AgentStructuredKind.RuntimeDecision,
131
- 'detect-story-with-home-screen': AgentStructuredKind.CandidateRanking,
132
- }
2
+ import { agentLoopActions, codeActions, documentActions, structuredActions } from './consts.local.js'
3
+ import { AgentCodeLanguage, AgentMarkdownKind, AgentMessageCategory, AgentMessageRole, AgentStructuredKind } from './consts.js'
4
+ import type { RecordValue } from './types.local.js'
5
+ import type { AgentMessageClassificationInput, AgentMessagePresentation } from './types.js'
133
6
 
134
7
  const asRecord = (value: unknown): RecordValue | undefined =>
135
8
  value != null && typeof value === 'object' && !Array.isArray(value)
@@ -274,22 +147,6 @@ const markdownKindOf = (text: string): AgentMarkdownKind | undefined => {
274
147
  return listItems >= 2 ? AgentMarkdownKind.Documentation : undefined
275
148
  }
276
149
 
277
- /**
278
- * Classifies known model output by source AND shape. The `value` comes from a caller's JSON
279
- * parser; this runtime-free package intentionally never repairs or parses streamed JSON itself.
280
- */
281
- /**
282
- * Actions run by an unconstrained tool-calling loop (the coding agent, the repair/architect/
283
- * lookup sub-agents, source extraction) rather than a single pinned-schema call. Their tool calls
284
- * are file/shell operations, not model-schema output, so they always render as ToolCalls even
285
- * when a call's arguments happen to shape-match a schema kind — `read_sources({ files })` looks
286
- * exactly like an ArtifactSelection.
287
- */
288
- const agentLoopActions = new Set([
289
- 'coding-agent-ask', 'arbitrary-modification', 'fix-agent', 'architect', 'declaration-lookup',
290
- 'source-extract',
291
- ])
292
-
293
150
  const isGenericStructure = (kind: AgentStructuredKind | undefined): boolean =>
294
151
  kind == null || kind === AgentStructuredKind.GenericRecord || kind === AgentStructuredKind.GenericList ||
295
152
  kind === AgentStructuredKind.GenericValue
@@ -0,0 +1 @@
1
+ export type RecordValue = Record<string, unknown>
@@ -1,4 +1,5 @@
1
1
  import type { LlmPurpose } from '@owlmeans/llm-common'
2
+ import { AgentCodeLanguage, AgentMarkdownKind, AgentMessageCategory, AgentMessageRole, AgentStructuredKind } from './consts.js'
2
3
 
3
4
  /**
4
5
  * Observability metadata attached to every model call. Extends the generic
@@ -8,3 +9,42 @@ export interface PurposeMetadata extends LlmPurpose {
8
9
  viableAgent?: string
9
10
  viableHelper?: string
10
11
  }
12
+
13
+ export interface AgentCodePresentation {
14
+ category: AgentMessageCategory.Code | AgentMessageCategory.Diff
15
+ language: AgentCodeLanguage
16
+ role: AgentMessageRole
17
+ }
18
+
19
+ export interface AgentStructuredPresentation {
20
+ category: AgentMessageCategory.Structured
21
+ structure: AgentStructuredKind
22
+ role: AgentMessageRole
23
+ }
24
+
25
+ export interface AgentMarkdownPresentation {
26
+ category: AgentMessageCategory.Markdown
27
+ document: AgentMarkdownKind
28
+ role: AgentMessageRole
29
+ }
30
+
31
+ export interface AgentPlainPresentation {
32
+ category: AgentMessageCategory.Plain
33
+ role: AgentMessageRole
34
+ }
35
+
36
+ export type AgentMessagePresentation =
37
+ | AgentCodePresentation
38
+ | AgentStructuredPresentation
39
+ | AgentMarkdownPresentation
40
+ | AgentPlainPresentation
41
+
42
+ /** The attribution and content available to either side of a thinking event. */
43
+ export interface AgentMessageClassificationInput {
44
+ agent?: string
45
+ helper?: string
46
+ action?: string
47
+ outputType?: string
48
+ text?: string
49
+ value?: unknown
50
+ }
@@ -1,4 +1,5 @@
1
1
  import { AccessLevel } from '../dev/consts.js'
2
+ import type { ProjectTenancy } from './types.js'
2
3
 
3
4
  /**
4
5
  * The audiences a generated application serves.
@@ -110,3 +111,9 @@ export const AREA_TIER: Record<ProjectArea, string | null> = {
110
111
  [ProjectArea.Admin]: null,
111
112
  [ProjectArea.Operator]: ProjectArea.Operator,
112
113
  }
114
+
115
+ /** The longest requester sentence a tenancy decision quotes — a card refuses a longer one. */
116
+ export const TENANCY_QUOTE_MAX = 1024
117
+
118
+ /** A single-organization application — what every project is until a decision says otherwise. */
119
+ export const NO_TENANCY: ProjectTenancy = Object.freeze({ operators: false, users: false })
@@ -1,42 +1,6 @@
1
1
  import type { Blueprint } from '../blueprint/types.js'
2
- import { ProjectArea } from './consts.js'
3
-
4
- /**
5
- * Whether a generated application splits its audiences into tenant ORGANIZATIONS.
6
- *
7
- * Two flags rather than one, because the two audiences split independently: one back office can
8
- * serve end users who each belong to their own company (`users` only), every reseller can run its
9
- * own staff over one shared public (`operators` only), and a B2B tool usually does both. An
10
- * organization is an IAM-managed tenant — never a table the target keeps for itself.
11
- *
12
- * Both false is today's application: one organization, the project owner's, that every person acts in.
13
- */
14
- export interface ProjectTenancy {
15
- /** The staff of the back office are split into tenant organizations. */
16
- operators: boolean
17
- /** The end users of the front office are distributed across tenant organizations. */
18
- users: boolean
19
- }
20
-
21
- /**
22
- * A tenancy decision as the project card records it (`fields.tenancy`).
23
- *
24
- * The flags plus where they came from. `quotes` are the requester's OWN sentences, verbatim — the
25
- * evidence a later reader (a person reviewing the board, a run asked to reconsider) checks the
26
- * decision against, which a paraphrase would quietly replace with the model's reading of it.
27
- * `by` says whether a model inferred it or the owner set it; `at` is when, an ISO timestamp.
28
- */
29
- export interface ViableTenancyDecision extends ProjectTenancy {
30
- quotes?: { operators?: string; users?: string }
31
- by: 'model' | 'owner'
32
- at: string
33
- }
34
-
35
- /** The longest requester sentence a tenancy decision quotes — a card refuses a longer one. */
36
- export const TENANCY_QUOTE_MAX = 1024
37
-
38
- /** A single-organization application — what every project is until a decision says otherwise. */
39
- export const NO_TENANCY: ProjectTenancy = Object.freeze({ operators: false, users: false })
2
+ import { ProjectArea, NO_TENANCY } from './consts.js'
3
+ import type { ProjectTenancy } from './types.js'
40
4
 
41
5
  /**
42
6
  * The tenancy of a resolved blueprint.
@@ -27,3 +27,34 @@ export interface NavEntry {
27
27
  alias: string
28
28
  label: string
29
29
  }
30
+
31
+ /**
32
+ * Whether a generated application splits its audiences into tenant ORGANIZATIONS.
33
+ *
34
+ * Two flags rather than one, because the two audiences split independently: one back office can
35
+ * serve end users who each belong to their own company (`users` only), every reseller can run its
36
+ * own staff over one shared public (`operators` only), and a B2B tool usually does both. An
37
+ * organization is an IAM-managed tenant — never a table the target keeps for itself.
38
+ *
39
+ * Both false is today's application: one organization, the project owner's, that every person acts in.
40
+ */
41
+ export interface ProjectTenancy {
42
+ /** The staff of the back office are split into tenant organizations. */
43
+ operators: boolean
44
+ /** The end users of the front office are distributed across tenant organizations. */
45
+ users: boolean
46
+ }
47
+
48
+ /**
49
+ * A tenancy decision as the project card records it (`fields.tenancy`).
50
+ *
51
+ * The flags plus where they came from. `quotes` are the requester's OWN sentences, verbatim — the
52
+ * evidence a later reader (a person reviewing the board, a run asked to reconsider) checks the
53
+ * decision against, which a paraphrase would quietly replace with the model's reading of it.
54
+ * `by` says whether a model inferred it or the owner set it; `at` is when, an ISO timestamp.
55
+ */
56
+ export interface ViableTenancyDecision extends ProjectTenancy {
57
+ quotes?: { operators?: string; users?: string }
58
+ by: 'model' | 'owner'
59
+ at: string
60
+ }
package/src/ba/types.ts CHANGED
@@ -2,7 +2,7 @@ import { SpecCategory } from "./consts"
2
2
  import type { ConnectingStoryKind, StoryKind } from "./consts.js"
3
3
  import type { ProjectArea } from "../areas/consts.js"
4
4
  import type { StoryDraft } from "../areas/types.js"
5
- import type { StoryActor } from "../design/runtime.js"
5
+ import type { StoryActor } from "../design/consts.js"
6
6
 
7
7
  export interface EntityList {
8
8
  entities: string[]
@@ -0,0 +1,3 @@
1
+ import { LandingGatePreference } from './consts.js'
2
+
3
+ export const LANDING_GATE_PREFERENCES = new Set<string>(Object.values(LandingGatePreference))
@@ -85,3 +85,55 @@ export enum WorkKind {
85
85
 
86
86
  /** The longest case quote a project card keeps (`fields.caseQuote`) — one sentence, generously. */
87
87
  export const CASE_QUOTE_MAX = 1024
88
+
89
+ /**
90
+ * The layers, lowest first. A higher layer's value replaces the same key from a lower one.
91
+ *
92
+ * The ordering is the point: `technology` overrides everything, because a change of language
93
+ * invalidates every template, prompt and package below it. Nothing today has more than one
94
+ * technology — the ladder exists so that adding one is a data change. `experience` is last and
95
+ * optional: it shares no key with the five build layers, so its place decides nothing today.
96
+ */
97
+ export enum BlueprintLayer {
98
+ Technology = 'technology',
99
+ Stack = 'stack',
100
+ Template = 'template',
101
+ CreateApp = 'create-app',
102
+ Packages = 'packages',
103
+ Experience = 'experience',
104
+ }
105
+
106
+ export const BLUEPRINT_LAYER_ORDER: BlueprintLayer[] = [
107
+ BlueprintLayer.Technology,
108
+ BlueprintLayer.Stack,
109
+ BlueprintLayer.Template,
110
+ BlueprintLayer.CreateApp,
111
+ BlueprintLayer.Packages,
112
+ BlueprintLayer.Experience,
113
+ ]
114
+
115
+ /**
116
+ * How strongly a product of this kind wants a LANDING GATE — the working entry into the key
117
+ * end-user workflow drawn on the guest home, where a guest starts before signing in.
118
+ *
119
+ * A PRIOR handed to the model that decides, never the decision itself: `Encourage` still lets it
120
+ * answer "no gate" for a product with no end-user step a guest could begin, and `Discourage` still
121
+ * lets it choose one when the specification plainly describes such a step.
122
+ */
123
+ export enum LandingGatePreference {
124
+ /** Most products of this kind have a first-value step a guest can begin — look for it. */
125
+ Encourage = 'encourage',
126
+ /** Neutral: decide from the specification alone. */
127
+ Allow = 'allow',
128
+ /** Products of this kind rarely have one — choose a gate only when the specification asks. */
129
+ Discourage = 'discourage',
130
+ }
131
+
132
+ export enum BlueprintPatchKind {
133
+ /** Deep-merge a JSON document — the manifests, the tsconfigs. */
134
+ JsonMerge = 'json-merge',
135
+ /** Rewrite the `<head>` of an HTML document from the project's identity. */
136
+ HtmlHead = 'html-head',
137
+ /** Write a document composed from the project's identity. */
138
+ Compose = 'compose',
139
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './types.js'
2
+ export * from './utils.js'
2
3
 
3
4
  export * from './consts.js'
@@ -1,8 +1,9 @@
1
- import type { ProjectTenancy } from '../areas/tenancy.js'
1
+ import type { ProjectTenancy } from '../areas/types.js'
2
2
  import type { SubProject } from '../slot/consts.js'
3
3
  import type { ViableSkill } from '../skills/consts.js'
4
4
  import type { ViablePersona } from '../skills/roles.js'
5
5
  import type { TopologyDescriptor } from '../topology/types.js'
6
+ import { BlueprintPatchKind, LandingGatePreference } from './consts.js'
6
7
 
7
8
  /**
8
9
  * A BLUEPRINT is everything that decides what kind of project the pipeline is building — the
@@ -35,49 +36,6 @@ export interface Blueprint {
35
36
  experience?: ExperienceLayer
36
37
  }
37
38
 
38
- /**
39
- * The layers, lowest first. A higher layer's value replaces the same key from a lower one.
40
- *
41
- * The ordering is the point: `technology` overrides everything, because a change of language
42
- * invalidates every template, prompt and package below it. Nothing today has more than one
43
- * technology — the ladder exists so that adding one is a data change. `experience` is last and
44
- * optional: it shares no key with the five build layers, so its place decides nothing today.
45
- */
46
- export enum BlueprintLayer {
47
- Technology = 'technology',
48
- Stack = 'stack',
49
- Template = 'template',
50
- CreateApp = 'create-app',
51
- Packages = 'packages',
52
- Experience = 'experience',
53
- }
54
-
55
- export const BLUEPRINT_LAYER_ORDER: BlueprintLayer[] = [
56
- BlueprintLayer.Technology,
57
- BlueprintLayer.Stack,
58
- BlueprintLayer.Template,
59
- BlueprintLayer.CreateApp,
60
- BlueprintLayer.Packages,
61
- BlueprintLayer.Experience,
62
- ]
63
-
64
- /**
65
- * How strongly a product of this kind wants a LANDING GATE — the working entry into the key
66
- * end-user workflow drawn on the guest home, where a guest starts before signing in.
67
- *
68
- * A PRIOR handed to the model that decides, never the decision itself: `Encourage` still lets it
69
- * answer "no gate" for a product with no end-user step a guest could begin, and `Discourage` still
70
- * lets it choose one when the specification plainly describes such a step.
71
- */
72
- export enum LandingGatePreference {
73
- /** Most products of this kind have a first-value step a guest can begin — look for it. */
74
- Encourage = 'encourage',
75
- /** Neutral: decide from the specification alone. */
76
- Allow = 'allow',
77
- /** Products of this kind rarely have one — choose a gate only when the specification asks. */
78
- Discourage = 'discourage',
79
- }
80
-
81
39
  /**
82
40
  * What the product should do for the people using it, independent of the stack it is built on.
83
41
  *
@@ -96,25 +54,6 @@ export interface ExperienceLayer {
96
54
  tenancy?: ProjectTenancy
97
55
  }
98
56
 
99
- const LANDING_GATE_PREFERENCES = new Set<string>(Object.values(LandingGatePreference))
100
-
101
- /**
102
- * The landing-gate preference of a resolved blueprint.
103
- *
104
- * Total: an absent layer, an absent key and a value this deploy does not know (a patch serialized
105
- * by a newer one) all answer `Allow` — the neutral prior, which leaves the decision to the
106
- * specification rather than tilting it either way on a value nobody set.
107
- */
108
- export const landingGatePreferenceOf = (
109
- blueprint?: Pick<Blueprint, 'experience'> | null
110
- ): LandingGatePreference => {
111
- const value = blueprint?.experience?.landingGate
112
-
113
- return value != null && LANDING_GATE_PREFERENCES.has(value)
114
- ? value
115
- : LandingGatePreference.Allow
116
- }
117
-
118
57
  /** Language and toolchain. Overrides everything below it. */
119
58
  export interface TechnologyLayer {
120
59
  id: string
@@ -181,15 +120,6 @@ export interface BlueprintPatchSpec {
181
120
  kind: BlueprintPatchKind
182
121
  }
183
122
 
184
- export enum BlueprintPatchKind {
185
- /** Deep-merge a JSON document — the manifests, the tsconfigs. */
186
- JsonMerge = 'json-merge',
187
- /** Rewrite the `<head>` of an HTML document from the project's identity. */
188
- HtmlHead = 'html-head',
189
- /** Write a document composed from the project's identity. */
190
- Compose = 'compose',
191
- }
192
-
193
123
  /** Which scaffolder runs first, and how. */
194
124
  export interface CreateAppLayer {
195
125
  id: string
@@ -0,0 +1,20 @@
1
+ import { LANDING_GATE_PREFERENCES } from './consts.local.js'
2
+ import { LandingGatePreference } from './consts.js'
3
+ import type { Blueprint } from './types.js'
4
+
5
+ /**
6
+ * The landing-gate preference of a resolved blueprint.
7
+ *
8
+ * Total: an absent layer, an absent key and a value this deploy does not know (a patch serialized
9
+ * by a newer one) all answer `Allow` — the neutral prior, which leaves the decision to the
10
+ * specification rather than tilting it either way on a value nobody set.
11
+ */
12
+ export const landingGatePreferenceOf = (
13
+ blueprint?: Pick<Blueprint, 'experience'> | null
14
+ ): LandingGatePreference => {
15
+ const value = blueprint?.experience?.landingGate
16
+
17
+ return value != null && LANDING_GATE_PREFERENCES.has(value)
18
+ ? value
19
+ : LandingGatePreference.Allow
20
+ }