@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,59 @@
1
+
2
+ /**
3
+ * What the moderation gate refuses, and nothing more.
4
+ *
5
+ * The set is deliberately about the SHAPE of what is being built, never its sector: a product
6
+ * that handles money, credentials or medical data is ordinary, and a platform that refuses
7
+ * those refuses most of its own market. What is not ordinary is a product whose purpose is to
8
+ * collect someone else's credentials, to be mistaken for someone who did not ask to be
9
+ * represented, or to push messages at people who never asked for them.
10
+ *
11
+ * Every generated app has a sign-in screen of its own — that is what an application is — so a
12
+ * login is never evidence of anything here.
13
+ *
14
+ * The set is CLOSED. A new refusal shape belongs inside one of these four, phrased into the
15
+ * policy prompt: each value is a wire contract with user-facing wording in seven languages
16
+ * behind it, and a fifth one silently renders as the generic refusal until every one of those
17
+ * catches up.
18
+ */
19
+ export enum ModerationCategory {
20
+ /** Captures credentials, OTPs, card numbers or recovery phrases for a service the requester does not run. */
21
+ CredentialHarvesting = 'credential-harvesting',
22
+ /** Presents itself as a named third party — an organization OR a real person — rather than as its own product. */
23
+ BrandImpersonation = 'brand-impersonation',
24
+ /** Collects payment details on behalf of a merchant that is not the requester. */
25
+ PaymentCapture = 'payment-capture',
26
+ /** Tooling whose purpose is abuse: credential stuffers, phishing-kit builders, bulk-spam senders. */
27
+ AbuseTooling = 'abuse-tooling',
28
+ }
29
+
30
+ /**
31
+ * What is being classified. Carried into the trace so a refusal can be attributed.
32
+ *
33
+ * Each value has a framing sentence behind it that tells the classifier whose words it is
34
+ * reading — the same text means different things as a customer's request, as our own generated
35
+ * specification, and as a file already sitting inside an approved project.
36
+ */
37
+ export enum ModerationSubject {
38
+ Prompt = 'prompt',
39
+ Specification = 'specification',
40
+ Story = 'story',
41
+ /**
42
+ * A file a human wrote through the project's own editor.
43
+ *
44
+ * Deliberately separate from the three above: this is code inside an already-approved
45
+ * product, so the framing has to stop the classifier from refusing ordinary application
46
+ * source that happens to contain the word "password" or a payment form.
47
+ */
48
+ Source = 'source',
49
+ /**
50
+ * What a project is CALLED — and, through its slug, what it is reachable at.
51
+ *
52
+ * The only subject that judges an identifier rather than a product, and the only one whose
53
+ * answer may disagree with {@link ModerationSubject.Specification} about the same brand. A
54
+ * consumer turns a project's name into a hostname on a domain all of its customers share, so
55
+ * "a dashboard for our Shopify store" is an ordinary thing to build while `shopify-dashboard`
56
+ * is not a name it may be reachable at. Descriptions may name a brand; identifiers may not.
57
+ */
58
+ Name = 'name',
59
+ }
@@ -0,0 +1,4 @@
1
+ export * from './consts.js'
2
+ export * from './schemas.js'
3
+ export * from './utils.js'
4
+ export type * from './types.js'
@@ -0,0 +1,28 @@
1
+ import type { JSONSchemaType } from 'ajv'
2
+ import type { ModerationVerdict } from './types.js'
3
+
4
+ /**
5
+ * What the classifier must answer with.
6
+ *
7
+ * Kept minimal on purpose: a schema the model must satisfy is also a schema it will try to
8
+ * fill, and every extra field is another thing it can hallucinate a reason into. The decision
9
+ * is one boolean; the category exists so the browser can phrase the refusal; the evidence
10
+ * exists so a human reviewing the trace can see what the model actually reacted to.
11
+ *
12
+ * `category` is a free string here even though only `ModerationCategory` values mean anything,
13
+ * and that is deliberate. Constrained to the enum it made **every** call fail: with nothing to
14
+ * categorise, a model that allows still fills the field — `"none"`, `""`, `"n/a"` — the
15
+ * response fails validation, the retry budget runs out, and the gate fails open on every
16
+ * request while looking like it is working. The value is narrowed in code instead
17
+ * (`normalizeCategory`), where an unrecognized one is simply absent.
18
+ */
19
+ export const ModerationVerdictSchema: JSONSchemaType<ModerationVerdict> = {
20
+ type: 'object',
21
+ properties: {
22
+ allowed: { type: 'boolean' },
23
+ category: { type: 'string', maxLength: 64, nullable: true },
24
+ evidence: { type: 'string', maxLength: 500, nullable: true },
25
+ },
26
+ required: ['allowed'],
27
+ additionalProperties: false,
28
+ } as unknown as JSONSchemaType<ModerationVerdict>
@@ -0,0 +1,68 @@
1
+ import type { ModerationCategory, ModerationSubject } from './consts.js'
2
+
3
+ /**
4
+ * What the moderation classifier returns.
5
+ *
6
+ * `evidence` is diagnostic only — it reaches the trace and the logs, never the user. What the
7
+ * user is told derives from `category` in the browser, so a refusal reads the same in all
8
+ * seven languages and the model never gets to write UI copy.
9
+ */
10
+ export interface ModerationVerdict {
11
+ allowed: boolean
12
+ /**
13
+ * Free string on the wire, narrowed to {@link ModerationCategory} by `normalizeCategory`.
14
+ * A model that is allowing has nothing to categorise and will still put something here.
15
+ */
16
+ category?: string
17
+ evidence?: string
18
+ }
19
+
20
+ /**
21
+ * The three outcomes, separated from the IO so the policy can be read and tested on its own.
22
+ *
23
+ * `shadow` means the verdict was negative and is being recorded but not acted on.
24
+ */
25
+ export type ModerationAction = 'allow' | 'refuse' | 'shadow'
26
+
27
+ /**
28
+ * The two operational levers on the gate.
29
+ *
30
+ * Both exist because a blocking classifier will eventually be wrong about a real customer, and
31
+ * at that moment the fix has to be faster than a deploy. `enforce: false` keeps the verdicts
32
+ * flowing into the traces while refusing nothing, which is also how a change to the policy
33
+ * prompt should be evaluated before it is trusted.
34
+ */
35
+ export interface ModerationPolicy {
36
+ /** Defaults to ON. Set false to compute and trace verdicts without acting on them. */
37
+ enforce?: boolean
38
+ /** Entity ids released from the gate entirely. */
39
+ bypassEntities?: string[]
40
+ }
41
+
42
+ /** What a caller needs in order to refuse: never the model's own words. */
43
+ export interface ModerationOutcome {
44
+ action: ModerationAction
45
+ /**
46
+ * Always present when `action` is not `allow`.
47
+ *
48
+ * A refusal has to tell the user something specific, so an unrecognized category from the
49
+ * model is replaced rather than dropped — see `normalizeCategory`.
50
+ */
51
+ category?: ModerationCategory
52
+ /** Diagnostic only. Logged and traced, never rendered. */
53
+ evidence?: string
54
+ }
55
+
56
+ /** One classification request. */
57
+ export interface ModerationInput {
58
+ subject: ModerationSubject
59
+ /** One text, or several judged together — several is one call, not several. */
60
+ text: string | string[]
61
+ /** Whose request this is — the one thing a bypass can be keyed on. */
62
+ entityId?: string
63
+ /**
64
+ * Extra framing appended to the subject's own, for a subject whose meaning depends on where
65
+ * the text came from — a file's path, for instance.
66
+ */
67
+ context?: string
68
+ }
@@ -0,0 +1,35 @@
1
+ import { ModerationCategory } from './consts.js'
2
+ import type { ModerationAction, ModerationPolicy, ModerationVerdict } from './types.js'
3
+
4
+ /**
5
+ * Narrow whatever the model put in `category` to a real one, or to nothing.
6
+ *
7
+ * The wire field is a free string on purpose — see {@link ModerationVerdictSchema}. A model
8
+ * that is allowing has nothing to categorise and still fills the field, so anything
9
+ * unrecognized is treated as absent rather than as a failure.
10
+ */
11
+ export const normalizeCategory = (category?: string): ModerationCategory | undefined => {
12
+ const values = Object.values(ModerationCategory) as string[]
13
+
14
+ return category != null && values.includes(category)
15
+ ? category as ModerationCategory
16
+ : undefined
17
+ }
18
+
19
+ /**
20
+ * What to do about a verdict.
21
+ *
22
+ * Pure, because this is the part with the operational levers on it and the part most likely
23
+ * to be wrong in a hurry: `enforce` turns the whole gate into an observer without a deploy,
24
+ * and `bypassEntities` releases one entity when a real customer is wrongly refused.
25
+ */
26
+ export const decideModeration = (
27
+ verdict: ModerationVerdict, policy: ModerationPolicy & { entityId?: string } = {}
28
+ ): ModerationAction => {
29
+ if (verdict.allowed) return 'allow'
30
+ if (policy.entityId != null && policy.bypassEntities?.includes(policy.entityId) === true) return 'allow'
31
+
32
+ // Defaults to ON: a gate that has to be switched on is a gate that is off in every
33
+ // environment nobody remembered to configure.
34
+ return policy.enforce !== false ? 'refuse' : 'shadow'
35
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Enum for OwlMeans preview integration event types
3
+ */
4
+ export enum PreviewEventType {
5
+ Error = 'OWLMEANS_PREVIEW_ERROR',
6
+ CaughtError = 'OWLMEANS_PREVIEW_CONSOLE_ERROR',
7
+ PromiseRejection = 'OWLMEANS_PREVIEW_PROMISE_REJECTION',
8
+ FetchError = 'OWLMEANS_PREVIEW_FETCH_ERROR',
9
+ }
@@ -0,0 +1,3 @@
1
+
2
+ export type * from './types.js'
3
+ export * from './consts.js'
@@ -0,0 +1,79 @@
1
+ import type { PreviewEventType } from './consts.js'
2
+
3
+ /**
4
+ * Base interface for all OwlMeans preview messages
5
+ */
6
+ export interface OwlMeansPreviewMessage<T extends OwlMenasPreviewPayloads = OwlMenasPreviewPayloads> {
7
+ type: PreviewEventType
8
+ payload: T
9
+ }
10
+
11
+ export interface OwlMeansCaughtErrorPayload {
12
+ message: string
13
+ stack?: string
14
+ }
15
+
16
+ /**
17
+ * Payload for global error events
18
+ */
19
+ export interface OwlMeansErrorPayload {
20
+ message: string
21
+ source: string
22
+ line: number
23
+ col: number
24
+ stack?: string
25
+ }
26
+
27
+ /**
28
+ * Payload for unhandled promise rejection events
29
+ */
30
+ export interface OwlMeansPromiseRejectionPayload {
31
+ reason: unknown
32
+ stack?: string
33
+ }
34
+
35
+ /**
36
+ * Payload for fetch error events
37
+ */
38
+ export interface OwlMeansFetchErrorPayload {
39
+ url: string | URL | Request
40
+ options?: RequestInit
41
+ status: number
42
+ statusText: string
43
+ body: string
44
+ }
45
+
46
+ /**
47
+ * Specific message types for each event kind
48
+ */
49
+ export interface OwlMeansErrorMessage extends OwlMeansPreviewMessage<OwlMeansErrorPayload> {
50
+ type: PreviewEventType.Error
51
+ }
52
+
53
+ export interface OwlMeansPromiseRejectionMessage extends OwlMeansPreviewMessage<OwlMeansPromiseRejectionPayload> {
54
+ type: PreviewEventType.PromiseRejection
55
+ }
56
+
57
+ export interface OwlMeansFetchErrorMessage extends OwlMeansPreviewMessage<OwlMeansFetchErrorPayload> {
58
+ type: PreviewEventType.FetchError
59
+ }
60
+
61
+ export interface OwlMeansCaughtErrorMessage extends OwlMeansPreviewMessage<OwlMeansCaughtErrorPayload> {
62
+ type: PreviewEventType.CaughtError
63
+ }
64
+
65
+ /**
66
+ * Union type for all possible OwlMeans preview messages
67
+ */
68
+ export type OwlMeansPreviewMessages =
69
+ | OwlMeansErrorMessage
70
+ | OwlMeansPromiseRejectionMessage
71
+ | OwlMeansFetchErrorMessage
72
+ | OwlMeansCaughtErrorMessage
73
+
74
+ export type OwlMenasPreviewPayloads =
75
+ | OwlMeansErrorPayload
76
+ | OwlMeansPromiseRejectionPayload
77
+ | OwlMeansFetchErrorPayload
78
+ | OwlMeansCaughtErrorPayload
79
+
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The shapes a drawn widget can take.
3
+ *
4
+ * A CLOSED set, and deliberately small: each value maps to one pre-built sketch primitive in the
5
+ * target's template, so a value nothing can draw is a value that produces a blank card. A story
6
+ * whose shape is none of these is a list — the commonest thing a screen is, and the safest
7
+ * placeholder for anything unrecognised.
8
+ */
9
+ export enum WidgetKind {
10
+ /** A queue, an index, a feed — records one after another. */
11
+ List = 'list',
12
+ /** Records in columns, the shape a back office mostly takes. */
13
+ Table = 'table',
14
+ /** The actor SUBMITS something. */
15
+ Form = 'form',
16
+ /** A trend or a comparison over time. */
17
+ Chart = 'chart',
18
+ /** Headline figures — a summary, a tracker, a status board. */
19
+ Stat = 'stat',
20
+ }
21
+
22
+ /** How many of an area's widgets may be adapted onto its home screen. */
23
+ export const AREA_HOME_WIDGET_CAP = 3
24
+
25
+ /** Sections per area beyond which a top menu stops being navigable. */
26
+ export const AREA_SECTION_CAP = 6
@@ -0,0 +1,84 @@
1
+ import type { ScaffoldPlan, ScaffoldStoryPlan } from './types.js'
2
+
3
+ /**
4
+ * ONE reading of who owns a drawn artifact, so no consumer has to interpret the plan itself.
5
+ *
6
+ * The plan carries `sharesWidgetWith` / `sharesScreenWith` as untrusted hints — a model may drop
7
+ * them, invent a code, point forwards, or build a cycle. These resolve all of that away, and
8
+ * every one is TOTAL: a code the plan does not hold answers itself, which is the unshared
9
+ * behaviour and therefore exactly today's drawn tree.
10
+ *
11
+ * Pure and IO-free. `fillScaffoldPlan` normalises a plan through them before anything is stamped,
12
+ * so the stampers and the scaffold loop can read a plan that is already sane.
13
+ */
14
+
15
+ /** Which field the arrow is being followed along. */
16
+ export type ShareKind = 'widget' | 'screen'
17
+
18
+ const pointerOf = (story: ScaffoldStoryPlan, kind: ShareKind): string | undefined =>
19
+ kind === 'widget' ? story.sharesWidgetWith : story.sharesScreenWith
20
+
21
+ /**
22
+ * The code whose artifact this story renders — itself when it owns one.
23
+ *
24
+ * Backward-only and bounded: an arrow is followed only to a story EARLIER in plan order, which
25
+ * makes a cycle unrepresentable rather than merely unlikely, and makes the owner the earliest
26
+ * member of its group. That is what keeps `widgetDefinition(owner)` stable — the name is a
27
+ * function of one code, never of the group, so adding a member renames nothing.
28
+ */
29
+ export const shareOwner = (
30
+ plan: Pick<ScaffoldPlan, 'stories'>, code: string, kind: ShareKind = 'widget'
31
+ ): string => {
32
+ const order = new Map(plan.stories.map((story, index) => [story.code, index]))
33
+ const byCode = new Map(plan.stories.map(story => [story.code, story]))
34
+
35
+ let current = code
36
+ // Bounded by the list length: every hop strictly decreases the plan index, so it terminates.
37
+ for (let hop = 0; hop <= plan.stories.length; hop++) {
38
+ const story = byCode.get(current)
39
+ const target = story != null ? pointerOf(story, kind) : undefined
40
+ if (story == null || target == null || target === '' || target === current) {
41
+ return current
42
+ }
43
+ const here = order.get(current)
44
+ const there = order.get(target)
45
+ // Unknown, forward or self-referential — none of them is a group, so the story owns its own.
46
+ if (here == null || there == null || there >= here) {
47
+ return current
48
+ }
49
+ current = target
50
+ }
51
+
52
+ return current
53
+ }
54
+
55
+ /**
56
+ * Owner code → every member, owner first, in plan order.
57
+ *
58
+ * The shape the stampers need: one artifact per entry, and the full member list for the notice
59
+ * that names them.
60
+ */
61
+ export const shareGroups = (
62
+ plan: Pick<ScaffoldPlan, 'stories'>, kind: ShareKind = 'widget'
63
+ ): Map<string, string[]> => {
64
+ const groups = new Map<string, string[]>()
65
+ for (const story of plan.stories) {
66
+ const owner = shareOwner(plan, story.code, kind)
67
+ const members = groups.get(owner) ?? []
68
+ if (!members.includes(owner)) members.push(owner)
69
+ if (!members.includes(story.code)) members.push(story.code)
70
+ groups.set(owner, members)
71
+ }
72
+
73
+ return groups
74
+ }
75
+
76
+ /** Every story that renders this owner's artifact, owner first. Total: an owner alone answers `[code]`. */
77
+ export const shareMembers = (
78
+ plan: Pick<ScaffoldPlan, 'stories'>, owner: string, kind: ShareKind = 'widget'
79
+ ): string[] => shareGroups(plan, kind).get(owner) ?? [owner]
80
+
81
+ /** Whether this story draws the artifact, as opposed to rendering somebody else's. */
82
+ export const ownsShare = (
83
+ plan: Pick<ScaffoldPlan, 'stories'>, code: string, kind: ShareKind = 'widget'
84
+ ): boolean => shareOwner(plan, code, kind) === code
@@ -0,0 +1,4 @@
1
+ export * from './consts.js'
2
+ export * from './schemas.js'
3
+ export type * from './types.js'
4
+ export * from './helpers.js'