human2ai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +120 -0
  3. package/assets/quaternius/License_Standard.txt +22 -0
  4. package/assets/quaternius/README.md +31 -0
  5. package/assets/quaternius/Superhero_Female_FullBody.bin +0 -0
  6. package/assets/quaternius/Superhero_Female_FullBody.gltf +2056 -0
  7. package/assets/quaternius/Superhero_Male_FullBody.bin +0 -0
  8. package/assets/quaternius/Superhero_Male_FullBody.gltf +2018 -0
  9. package/dist/cli/integration.d.ts +39 -0
  10. package/dist/cli/integration.js +466 -0
  11. package/dist/cli/integration.js.map +1 -0
  12. package/dist/cli/main.d.ts +17 -0
  13. package/dist/cli/main.js +1455 -0
  14. package/dist/cli/main.js.map +1 -0
  15. package/dist/database/composition-session-repository.d.ts +37 -0
  16. package/dist/database/composition-session-repository.js +147 -0
  17. package/dist/database/composition-session-repository.js.map +1 -0
  18. package/dist/database/draft-version-errors.d.ts +29 -0
  19. package/dist/database/draft-version-errors.js +47 -0
  20. package/dist/database/draft-version-errors.js.map +1 -0
  21. package/dist/database/draft-version-store.d.ts +30 -0
  22. package/dist/database/draft-version-store.js +168 -0
  23. package/dist/database/draft-version-store.js.map +1 -0
  24. package/dist/database/image-asset-repository.d.ts +37 -0
  25. package/dist/database/image-asset-repository.js +101 -0
  26. package/dist/database/image-asset-repository.js.map +1 -0
  27. package/dist/database/image-input.d.ts +15 -0
  28. package/dist/database/image-input.js +28 -0
  29. package/dist/database/image-input.js.map +1 -0
  30. package/dist/database/migrate.d.ts +4 -0
  31. package/dist/database/migrate.js +45 -0
  32. package/dist/database/migrate.js.map +1 -0
  33. package/dist/database/project-session-repository.d.ts +72 -0
  34. package/dist/database/project-session-repository.js +291 -0
  35. package/dist/database/project-session-repository.js.map +1 -0
  36. package/dist/database/spatial-session-repository.d.ts +26 -0
  37. package/dist/database/spatial-session-repository.js +44 -0
  38. package/dist/database/spatial-session-repository.js.map +1 -0
  39. package/dist/database/style-library-repository.d.ts +70 -0
  40. package/dist/database/style-library-repository.js +290 -0
  41. package/dist/database/style-library-repository.js.map +1 -0
  42. package/dist/database/svg-input.d.ts +1 -0
  43. package/dist/database/svg-input.js +77 -0
  44. package/dist/database/svg-input.js.map +1 -0
  45. package/dist/database/ui-sketch-session-repository.d.ts +19 -0
  46. package/dist/database/ui-sketch-session-repository.js +35 -0
  47. package/dist/database/ui-sketch-session-repository.js.map +1 -0
  48. package/dist/domain/canvas-layer-order.d.ts +6 -0
  49. package/dist/domain/canvas-layer-order.js +40 -0
  50. package/dist/domain/canvas-layer-order.js.map +1 -0
  51. package/dist/domain/canvas-node-metadata.d.ts +20 -0
  52. package/dist/domain/canvas-node-metadata.js +17 -0
  53. package/dist/domain/canvas-node-metadata.js.map +1 -0
  54. package/dist/domain/canvas-states.d.ts +8 -0
  55. package/dist/domain/canvas-states.js +23 -0
  56. package/dist/domain/canvas-states.js.map +1 -0
  57. package/dist/domain/composition/analysis.d.ts +104 -0
  58. package/dist/domain/composition/analysis.js +337 -0
  59. package/dist/domain/composition/analysis.js.map +1 -0
  60. package/dist/domain/composition/camera-reference.d.ts +24 -0
  61. package/dist/domain/composition/camera-reference.js +34 -0
  62. package/dist/domain/composition/camera-reference.js.map +1 -0
  63. package/dist/domain/composition/draft.d.ts +50 -0
  64. package/dist/domain/composition/draft.js +609 -0
  65. package/dist/domain/composition/draft.js.map +1 -0
  66. package/dist/domain/composition/frame.d.ts +23 -0
  67. package/dist/domain/composition/frame.js +154 -0
  68. package/dist/domain/composition/frame.js.map +1 -0
  69. package/dist/domain/composition/geometry.d.ts +15 -0
  70. package/dist/domain/composition/geometry.js +262 -0
  71. package/dist/domain/composition/geometry.js.map +1 -0
  72. package/dist/domain/composition/index.d.ts +13 -0
  73. package/dist/domain/composition/index.js +10 -0
  74. package/dist/domain/composition/index.js.map +1 -0
  75. package/dist/domain/composition/layers.d.ts +4 -0
  76. package/dist/domain/composition/layers.js +12 -0
  77. package/dist/domain/composition/layers.js.map +1 -0
  78. package/dist/domain/composition/records.d.ts +14 -0
  79. package/dist/domain/composition/records.js +2 -0
  80. package/dist/domain/composition/records.js.map +1 -0
  81. package/dist/domain/composition/refinement/engine.d.ts +12 -0
  82. package/dist/domain/composition/refinement/engine.js +521 -0
  83. package/dist/domain/composition/refinement/engine.js.map +1 -0
  84. package/dist/domain/composition/refinement/relations.d.ts +16 -0
  85. package/dist/domain/composition/refinement/relations.js +293 -0
  86. package/dist/domain/composition/refinement/relations.js.map +1 -0
  87. package/dist/domain/composition/refinement/types.d.ts +181 -0
  88. package/dist/domain/composition/refinement/types.js +2 -0
  89. package/dist/domain/composition/refinement/types.js.map +1 -0
  90. package/dist/domain/composition/render.d.ts +5 -0
  91. package/dist/domain/composition/render.js +169 -0
  92. package/dist/domain/composition/render.js.map +1 -0
  93. package/dist/domain/composition/states.d.ts +9 -0
  94. package/dist/domain/composition/states.js +104 -0
  95. package/dist/domain/composition/states.js.map +1 -0
  96. package/dist/domain/composition/types.d.ts +149 -0
  97. package/dist/domain/composition/types.js +2 -0
  98. package/dist/domain/composition/types.js.map +1 -0
  99. package/dist/domain/composition/workflow.d.ts +15 -0
  100. package/dist/domain/composition/workflow.js +77 -0
  101. package/dist/domain/composition/workflow.js.map +1 -0
  102. package/dist/domain/fingerprint.d.ts +2 -0
  103. package/dist/domain/fingerprint.js +25 -0
  104. package/dist/domain/fingerprint.js.map +1 -0
  105. package/dist/domain/session/canvas-edit-history.d.ts +17 -0
  106. package/dist/domain/session/canvas-edit-history.js +53 -0
  107. package/dist/domain/session/canvas-edit-history.js.map +1 -0
  108. package/dist/domain/session/capabilities.d.ts +16 -0
  109. package/dist/domain/session/capabilities.js +84 -0
  110. package/dist/domain/session/capabilities.js.map +1 -0
  111. package/dist/domain/session/draft-version.d.ts +41 -0
  112. package/dist/domain/session/draft-version.js +2 -0
  113. package/dist/domain/session/draft-version.js.map +1 -0
  114. package/dist/domain/session/index.d.ts +5 -0
  115. package/dist/domain/session/index.js +3 -0
  116. package/dist/domain/session/index.js.map +1 -0
  117. package/dist/domain/session/types.d.ts +23 -0
  118. package/dist/domain/session/types.js +2 -0
  119. package/dist/domain/session/types.js.map +1 -0
  120. package/dist/domain/spatial/assets/quaternius-female-rig.json +799 -0
  121. package/dist/domain/spatial/assets/quaternius-rig.json +799 -0
  122. package/dist/domain/spatial/assets/quaternius-superhero-female.json +1 -0
  123. package/dist/domain/spatial/assets/quaternius-superhero.json +1 -0
  124. package/dist/domain/spatial/camera-box.d.ts +13 -0
  125. package/dist/domain/spatial/camera-box.js +52 -0
  126. package/dist/domain/spatial/camera-box.js.map +1 -0
  127. package/dist/domain/spatial/geometric-model.d.ts +4 -0
  128. package/dist/domain/spatial/geometric-model.js +101 -0
  129. package/dist/domain/spatial/geometric-model.js.map +1 -0
  130. package/dist/domain/spatial/hands.d.ts +36 -0
  131. package/dist/domain/spatial/hands.js +128 -0
  132. package/dist/domain/spatial/hands.js.map +1 -0
  133. package/dist/domain/spatial/index.d.ts +30 -0
  134. package/dist/domain/spatial/index.js +381 -0
  135. package/dist/domain/spatial/index.js.map +1 -0
  136. package/dist/domain/spatial/kinematics.d.ts +27 -0
  137. package/dist/domain/spatial/kinematics.js +285 -0
  138. package/dist/domain/spatial/kinematics.js.map +1 -0
  139. package/dist/domain/spatial/lighting.d.ts +35 -0
  140. package/dist/domain/spatial/lighting.js +173 -0
  141. package/dist/domain/spatial/lighting.js.map +1 -0
  142. package/dist/domain/spatial/model.d.ts +5 -0
  143. package/dist/domain/spatial/model.js +193 -0
  144. package/dist/domain/spatial/model.js.map +1 -0
  145. package/dist/domain/spatial/morph.d.ts +3 -0
  146. package/dist/domain/spatial/morph.js +187 -0
  147. package/dist/domain/spatial/morph.js.map +1 -0
  148. package/dist/domain/spatial/proportions.d.ts +46 -0
  149. package/dist/domain/spatial/proportions.js +59 -0
  150. package/dist/domain/spatial/proportions.js.map +1 -0
  151. package/dist/domain/spatial/reference-lines.d.ts +6 -0
  152. package/dist/domain/spatial/reference-lines.js +58 -0
  153. package/dist/domain/spatial/reference-lines.js.map +1 -0
  154. package/dist/domain/spatial/scene-cache.d.ts +15 -0
  155. package/dist/domain/spatial/scene-cache.js +69 -0
  156. package/dist/domain/spatial/scene-cache.js.map +1 -0
  157. package/dist/domain/spatial/scene.d.ts +8 -0
  158. package/dist/domain/spatial/scene.js +69 -0
  159. package/dist/domain/spatial/scene.js.map +1 -0
  160. package/dist/domain/spatial/types.d.ts +187 -0
  161. package/dist/domain/spatial/types.js +5 -0
  162. package/dist/domain/spatial/types.js.map +1 -0
  163. package/dist/domain/style/index.d.ts +1 -0
  164. package/dist/domain/style/index.js +2 -0
  165. package/dist/domain/style/index.js.map +1 -0
  166. package/dist/domain/style/prompt-summary.d.ts +2 -0
  167. package/dist/domain/style/prompt-summary.js +11 -0
  168. package/dist/domain/style/prompt-summary.js.map +1 -0
  169. package/dist/domain/style/types.d.ts +32 -0
  170. package/dist/domain/style/types.js +3 -0
  171. package/dist/domain/style/types.js.map +1 -0
  172. package/dist/domain/ui-sketch/draft.d.ts +12 -0
  173. package/dist/domain/ui-sketch/draft.js +424 -0
  174. package/dist/domain/ui-sketch/draft.js.map +1 -0
  175. package/dist/domain/ui-sketch/geometry.d.ts +7 -0
  176. package/dist/domain/ui-sketch/geometry.js +11 -0
  177. package/dist/domain/ui-sketch/geometry.js.map +1 -0
  178. package/dist/domain/ui-sketch/groups.d.ts +5 -0
  179. package/dist/domain/ui-sketch/groups.js +40 -0
  180. package/dist/domain/ui-sketch/groups.js.map +1 -0
  181. package/dist/domain/ui-sketch/index.d.ts +8 -0
  182. package/dist/domain/ui-sketch/index.js +8 -0
  183. package/dist/domain/ui-sketch/index.js.map +1 -0
  184. package/dist/domain/ui-sketch/layers.d.ts +4 -0
  185. package/dist/domain/ui-sketch/layers.js +11 -0
  186. package/dist/domain/ui-sketch/layers.js.map +1 -0
  187. package/dist/domain/ui-sketch/render.d.ts +2 -0
  188. package/dist/domain/ui-sketch/render.js +58 -0
  189. package/dist/domain/ui-sketch/render.js.map +1 -0
  190. package/dist/domain/ui-sketch/standardize.d.ts +17 -0
  191. package/dist/domain/ui-sketch/standardize.js +139 -0
  192. package/dist/domain/ui-sketch/standardize.js.map +1 -0
  193. package/dist/domain/ui-sketch/states.d.ts +5 -0
  194. package/dist/domain/ui-sketch/states.js +21 -0
  195. package/dist/domain/ui-sketch/states.js.map +1 -0
  196. package/dist/domain/ui-sketch/types.d.ts +73 -0
  197. package/dist/domain/ui-sketch/types.js +2 -0
  198. package/dist/domain/ui-sketch/types.js.map +1 -0
  199. package/dist/server/app.d.ts +18 -0
  200. package/dist/server/app.js +108 -0
  201. package/dist/server/app.js.map +1 -0
  202. package/dist/server/image-content-type-parser.d.ts +2 -0
  203. package/dist/server/image-content-type-parser.js +5 -0
  204. package/dist/server/image-content-type-parser.js.map +1 -0
  205. package/dist/server/routes/composition-sessions.d.ts +3 -0
  206. package/dist/server/routes/composition-sessions.js +190 -0
  207. package/dist/server/routes/composition-sessions.js.map +1 -0
  208. package/dist/server/routes/draft-version-routes.d.ts +10 -0
  209. package/dist/server/routes/draft-version-routes.js +201 -0
  210. package/dist/server/routes/draft-version-routes.js.map +1 -0
  211. package/dist/server/routes/image-assets.d.ts +3 -0
  212. package/dist/server/routes/image-assets.js +114 -0
  213. package/dist/server/routes/image-assets.js.map +1 -0
  214. package/dist/server/routes/project-sessions.d.ts +48 -0
  215. package/dist/server/routes/project-sessions.js +305 -0
  216. package/dist/server/routes/project-sessions.js.map +1 -0
  217. package/dist/server/routes/spatial-sessions.d.ts +3 -0
  218. package/dist/server/routes/spatial-sessions.js +80 -0
  219. package/dist/server/routes/spatial-sessions.js.map +1 -0
  220. package/dist/server/routes/style-library.d.ts +3 -0
  221. package/dist/server/routes/style-library.js +308 -0
  222. package/dist/server/routes/style-library.js.map +1 -0
  223. package/dist/server/routes/ui-sketch-sessions.d.ts +3 -0
  224. package/dist/server/routes/ui-sketch-sessions.js +14 -0
  225. package/dist/server/routes/ui-sketch-sessions.js.map +1 -0
  226. package/dist/server/runtime.d.ts +30 -0
  227. package/dist/server/runtime.js +123 -0
  228. package/dist/server/runtime.js.map +1 -0
  229. package/dist/server/spatial-render.d.ts +5 -0
  230. package/dist/server/spatial-render.js +360 -0
  231. package/dist/server/spatial-render.js.map +1 -0
  232. package/dist/server/start.d.ts +1 -0
  233. package/dist/server/start.js +3 -0
  234. package/dist/server/start.js.map +1 -0
  235. package/licenses/THIRD-PARTY-NOTICES.txt +16664 -0
  236. package/licenses/YisiUI-LICENSE +21 -0
  237. package/locales/en/common.json +671 -0
  238. package/migrations/0001_projects_and_sessions.sql +45 -0
  239. package/migrations/0002_composition_versions_and_refinements.sql +26 -0
  240. package/migrations/0003_ui_sketch_draft_versions.sql +12 -0
  241. package/migrations/0004_image_assets.sql +16 -0
  242. package/migrations/0005_style_library.sql +31 -0
  243. package/migrations/0006_session_styles.sql +6 -0
  244. package/migrations/0007_svg_image_assets.sql +19 -0
  245. package/migrations/0008_spatial_spaces.sql +20 -0
  246. package/package.json +82 -0
  247. package/schemas/composition-draft.schema.json +234 -0
  248. package/schemas/composition-refinement-plan.schema.json +758 -0
  249. package/schemas/spatial-draft.schema.json +517 -0
  250. package/schemas/spatial-operations.schema.json +1082 -0
  251. package/schemas/ui-layout-standardization-plan.schema.json +29 -0
  252. package/schemas/ui-sketch-draft.schema.json +197 -0
  253. package/skills/human2ai/SKILL.md +149 -0
  254. package/skills/human2ai/agents/openai.yaml +3 -0
  255. package/skills/human2ai/references/composition-projection.md +170 -0
  256. package/skills/human2ai/references/composition.md +79 -0
  257. package/skills/human2ai/references/spatial.md +188 -0
  258. package/skills/human2ai/references/svg-images.md +27 -0
  259. package/skills/human2ai/references/ui-layout.md +100 -0
  260. package/web/out/404/index.html +1 -0
  261. package/web/out/404.html +1 -0
  262. package/web/out/__next.__PAGE__.txt +26 -0
  263. package/web/out/__next._full.txt +21 -0
  264. package/web/out/__next._tree.txt +4 -0
  265. package/web/out/_next/static/TV-jgcACg6HANZAMZTE2S/_buildManifest.js +1 -0
  266. package/web/out/_next/static/TV-jgcACg6HANZAMZTE2S/_ssgManifest.js +1 -0
  267. package/web/out/_next/static/chunks/130-9fadd0432daff55d.js +1 -0
  268. package/web/out/_next/static/chunks/158-eb00456e1bab68b3.js +52 -0
  269. package/web/out/_next/static/chunks/20-0801fc297cda2a7a.js +1 -0
  270. package/web/out/_next/static/chunks/248-d4a79649dae2a3f8.js +259 -0
  271. package/web/out/_next/static/chunks/678-1305cadf8254d814.js +1 -0
  272. package/web/out/_next/static/chunks/728-eb8b667f79229443.js +1 -0
  273. package/web/out/_next/static/chunks/83607670-bc1279370476e59f.js +1 -0
  274. package/web/out/_next/static/chunks/app/_global-error/page-5eece43b8152c414.js +1 -0
  275. package/web/out/_next/static/chunks/app/_not-found/page-c0cd75ac39fbf9cf.js +1 -0
  276. package/web/out/_next/static/chunks/app/composition/page-051ee2fabb12110a.js +1 -0
  277. package/web/out/_next/static/chunks/app/layout-745ca27ef8830f4f.js +1 -0
  278. package/web/out/_next/static/chunks/app/page-0027378a269a6168.js +1 -0
  279. package/web/out/_next/static/chunks/app/spatial/page-266dedc81784d4f6.js +1 -0
  280. package/web/out/_next/static/chunks/app/styles/page-d5cb83af828ea9ed.js +1 -0
  281. package/web/out/_next/static/chunks/app/ui-sketch/page-2a8436e05a05c618.js +1 -0
  282. package/web/out/_next/static/chunks/c3f2cda1-9e279dab137b7272.js +342 -0
  283. package/web/out/_next/static/chunks/c7879cf7-7873c8afd9c9c666.js +1 -0
  284. package/web/out/_next/static/chunks/framework-6eacf80ec1e4c887.js +1 -0
  285. package/web/out/_next/static/chunks/main-5ee8fd93319f955c.js +5 -0
  286. package/web/out/_next/static/chunks/main-app-0cf10803ab17c700.js +1 -0
  287. package/web/out/_next/static/chunks/next/dist/client/components/builtin/app-error-5eece43b8152c414.js +1 -0
  288. package/web/out/_next/static/chunks/next/dist/client/components/builtin/forbidden-5eece43b8152c414.js +1 -0
  289. package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-728204b7cccc4ed2.js +1 -0
  290. package/web/out/_next/static/chunks/next/dist/client/components/builtin/not-found-5eece43b8152c414.js +1 -0
  291. package/web/out/_next/static/chunks/next/dist/client/components/builtin/unauthorized-5eece43b8152c414.js +1 -0
  292. package/web/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  293. package/web/out/_next/static/chunks/webpack-97ae63c0e0b2a512.js +1 -0
  294. package/web/out/_next/static/css/3b7982b41ed8eccd.css +4 -0
  295. package/web/out/_next/static/css/81ae71f1d3e9a866.css +1 -0
  296. package/web/out/_next/static/css/8c3843f4951fa9f6.css +5 -0
  297. package/web/out/_next/static/css/c739d0131cdcc891.css +1 -0
  298. package/web/out/_next/static/css/ce1b4bb3ad3c6073.css +1 -0
  299. package/web/out/_next/static/css/db96ae2e88545d96.css +1 -0
  300. package/web/out/_not-found/__next._full.txt +18 -0
  301. package/web/out/_not-found/__next._not-found.__PAGE__.txt +24 -0
  302. package/web/out/_not-found/__next._tree.txt +3 -0
  303. package/web/out/_not-found/index.html +1 -0
  304. package/web/out/_not-found/index.txt +18 -0
  305. package/web/out/composition/__next._full.txt +25 -0
  306. package/web/out/composition/__next._tree.txt +6 -0
  307. package/web/out/composition/__next.composition.__PAGE__.txt +31 -0
  308. package/web/out/composition/index.html +1 -0
  309. package/web/out/composition/index.txt +25 -0
  310. package/web/out/index.html +1 -0
  311. package/web/out/index.txt +21 -0
  312. package/web/out/spatial/__next._full.txt +23 -0
  313. package/web/out/spatial/__next._tree.txt +4 -0
  314. package/web/out/spatial/__next.spatial.__PAGE__.txt +29 -0
  315. package/web/out/spatial/index.html +1 -0
  316. package/web/out/spatial/index.txt +23 -0
  317. package/web/out/styles/__next._full.txt +23 -0
  318. package/web/out/styles/__next._tree.txt +4 -0
  319. package/web/out/styles/__next.styles.__PAGE__.txt +29 -0
  320. package/web/out/styles/index.html +1 -0
  321. package/web/out/styles/index.txt +23 -0
  322. package/web/out/ui-sketch/__next._full.txt +25 -0
  323. package/web/out/ui-sketch/__next._tree.txt +6 -0
  324. package/web/out/ui-sketch/__next.ui-sketch.__PAGE__.txt +31 -0
  325. package/web/out/ui-sketch/index.html +1 -0
  326. package/web/out/ui-sketch/index.txt +25 -0
@@ -0,0 +1,305 @@
1
+ import { InvalidRecordError, ProjectNameConflictError, ProjectNotFoundError, ProjectNotEmptyError, RevisionConflictError, SessionNotFoundError, } from "../../database/project-session-repository.js";
2
+ import { SESSION_TYPES } from "../../domain/session/index.js";
3
+ const nullableStringSchema = {
4
+ anyOf: [{ type: "null" }, { type: "string" }],
5
+ };
6
+ const nullableDescriptionSchema = {
7
+ anyOf: [{ type: "null" }, { type: "string", maxLength: 2000 }],
8
+ };
9
+ const projectSchema = {
10
+ type: "object",
11
+ additionalProperties: false,
12
+ required: [
13
+ "id",
14
+ "name",
15
+ "description",
16
+ "revision",
17
+ "sessionCount",
18
+ "createdAt",
19
+ "updatedAt",
20
+ ],
21
+ properties: {
22
+ id: { type: "string" },
23
+ name: { type: "string" },
24
+ description: nullableStringSchema,
25
+ revision: { type: "integer", minimum: 1 },
26
+ sessionCount: { type: "integer", minimum: 0 },
27
+ createdAt: { type: "string" },
28
+ updatedAt: { type: "string" },
29
+ },
30
+ };
31
+ export const sessionSchema = {
32
+ type: "object",
33
+ additionalProperties: false,
34
+ required: [
35
+ "id",
36
+ "projectId",
37
+ "styleId",
38
+ "sessionType",
39
+ "title",
40
+ "lifecycleStage",
41
+ "revision",
42
+ "createdAt",
43
+ "updatedAt",
44
+ ],
45
+ properties: {
46
+ id: { type: "string" },
47
+ projectId: nullableStringSchema,
48
+ styleId: nullableStringSchema,
49
+ sessionType: { type: "string", enum: SESSION_TYPES },
50
+ title: { type: "string" },
51
+ lifecycleStage: {
52
+ type: "string",
53
+ enum: ["draft", "interpreted", "approved", "exported"],
54
+ },
55
+ revision: { type: "integer", minimum: 1 },
56
+ createdAt: { type: "string" },
57
+ updatedAt: { type: "string" },
58
+ },
59
+ };
60
+ const errorSchema = {
61
+ type: "object",
62
+ additionalProperties: false,
63
+ required: ["code", "message"],
64
+ properties: {
65
+ code: { type: "string" },
66
+ message: { type: "string" },
67
+ actualRevision: { type: "integer", minimum: 1 },
68
+ sessionCount: { type: "integer", minimum: 1 },
69
+ },
70
+ };
71
+ const idParamsSchema = (key) => ({
72
+ type: "object",
73
+ additionalProperties: false,
74
+ required: [key],
75
+ properties: { [key]: { type: "string", minLength: 1 } },
76
+ });
77
+ export function registerProjectSessionRoutes(server, repository) {
78
+ server.get("/api/v1/projects", {
79
+ schema: {
80
+ response: {
81
+ 200: {
82
+ type: "object",
83
+ additionalProperties: false,
84
+ required: ["projects"],
85
+ properties: { projects: { type: "array", items: projectSchema } },
86
+ },
87
+ },
88
+ },
89
+ }, async () => ({ projects: repository.listProjects() }));
90
+ server.post("/api/v1/projects", {
91
+ schema: {
92
+ body: {
93
+ type: "object",
94
+ additionalProperties: false,
95
+ required: ["name"],
96
+ properties: {
97
+ name: { type: "string", minLength: 1, maxLength: 200 },
98
+ description: nullableDescriptionSchema,
99
+ },
100
+ },
101
+ response: { 201: projectSchema, 400: errorSchema, 409: errorSchema },
102
+ },
103
+ }, async (request, reply) => execute(reply, 201, () => repository.createProject(request.body)));
104
+ server.get("/api/v1/projects/:projectId", {
105
+ schema: {
106
+ params: idParamsSchema("projectId"),
107
+ response: { 200: projectSchema, 404: errorSchema },
108
+ },
109
+ }, async (request, reply) => execute(reply, 200, () => repository.getProject(request.params.projectId)));
110
+ server.patch("/api/v1/projects/:projectId", {
111
+ schema: {
112
+ params: idParamsSchema("projectId"),
113
+ body: {
114
+ type: "object",
115
+ additionalProperties: false,
116
+ required: ["expectedRevision"],
117
+ anyOf: [{ required: ["name"] }, { required: ["description"] }],
118
+ properties: {
119
+ expectedRevision: { type: "integer", minimum: 1 },
120
+ name: { type: "string", minLength: 1, maxLength: 200 },
121
+ description: nullableDescriptionSchema,
122
+ },
123
+ },
124
+ response: {
125
+ 200: projectSchema,
126
+ 400: errorSchema,
127
+ 404: errorSchema,
128
+ 409: errorSchema,
129
+ },
130
+ },
131
+ }, async (request, reply) => execute(reply, 200, () => repository.updateProject(request.params.projectId, request.body)));
132
+ server.delete("/api/v1/projects/:projectId", {
133
+ schema: {
134
+ params: idParamsSchema("projectId"),
135
+ body: {
136
+ type: "object",
137
+ additionalProperties: false,
138
+ required: ["expectedRevision"],
139
+ properties: {
140
+ expectedRevision: { type: "integer", minimum: 1 },
141
+ },
142
+ },
143
+ response: {
144
+ 400: errorSchema,
145
+ 404: errorSchema,
146
+ 409: errorSchema,
147
+ },
148
+ },
149
+ }, async (request, reply) => execute(reply, 204, () => repository.deleteProject(request.params.projectId, request.body)));
150
+ server.get("/api/v1/projects/:projectId/sessions", {
151
+ schema: {
152
+ params: idParamsSchema("projectId"),
153
+ response: {
154
+ 200: {
155
+ type: "object",
156
+ additionalProperties: false,
157
+ required: ["sessions"],
158
+ properties: { sessions: { type: "array", items: sessionSchema } },
159
+ },
160
+ 404: errorSchema,
161
+ },
162
+ },
163
+ }, async (request, reply) => execute(reply, 200, () => ({
164
+ sessions: repository.listProjectSessions(request.params.projectId),
165
+ })));
166
+ server.get("/api/v1/sessions", {
167
+ schema: {
168
+ response: {
169
+ 200: {
170
+ type: "object",
171
+ additionalProperties: false,
172
+ required: ["sessions"],
173
+ properties: { sessions: { type: "array", items: sessionSchema } },
174
+ },
175
+ },
176
+ },
177
+ }, async () => ({ sessions: repository.listSessions() }));
178
+ server.get("/api/v1/sessions/unassigned", {
179
+ schema: {
180
+ response: {
181
+ 200: {
182
+ type: "object",
183
+ additionalProperties: false,
184
+ required: ["sessions"],
185
+ properties: { sessions: { type: "array", items: sessionSchema } },
186
+ },
187
+ },
188
+ },
189
+ }, async () => ({ sessions: repository.listUnassignedSessions() }));
190
+ server.post("/api/v1/sessions", {
191
+ schema: {
192
+ body: {
193
+ type: "object",
194
+ additionalProperties: false,
195
+ required: ["sessionType", "title"],
196
+ properties: {
197
+ sessionType: { type: "string", enum: SESSION_TYPES },
198
+ title: { type: "string", minLength: 1, maxLength: 200 },
199
+ projectId: nullableStringSchema,
200
+ },
201
+ },
202
+ response: {
203
+ 201: sessionSchema,
204
+ 400: errorSchema,
205
+ 404: errorSchema,
206
+ },
207
+ },
208
+ }, async (request, reply) => execute(reply, 201, () => repository.createSession(request.body)));
209
+ server.get("/api/v1/sessions/:sessionId", {
210
+ schema: {
211
+ params: idParamsSchema("sessionId"),
212
+ response: { 200: sessionSchema, 404: errorSchema },
213
+ },
214
+ }, async (request, reply) => execute(reply, 200, () => repository.getSession(request.params.sessionId)));
215
+ server.patch("/api/v1/sessions/:sessionId", {
216
+ schema: {
217
+ params: idParamsSchema("sessionId"),
218
+ body: {
219
+ type: "object",
220
+ additionalProperties: false,
221
+ required: ["title", "expectedRevision"],
222
+ properties: {
223
+ title: { type: "string", minLength: 1, maxLength: 200 },
224
+ expectedRevision: { type: "integer", minimum: 1 },
225
+ },
226
+ },
227
+ response: {
228
+ 200: sessionSchema,
229
+ 400: errorSchema,
230
+ 404: errorSchema,
231
+ 409: errorSchema,
232
+ },
233
+ },
234
+ }, async (request, reply) => execute(reply, 200, () => repository.renameSession(request.params.sessionId, request.body)));
235
+ server.delete("/api/v1/sessions/:sessionId", {
236
+ schema: {
237
+ params: idParamsSchema("sessionId"),
238
+ body: {
239
+ type: "object",
240
+ additionalProperties: false,
241
+ required: ["expectedRevision"],
242
+ properties: {
243
+ expectedRevision: { type: "integer", minimum: 1 },
244
+ },
245
+ },
246
+ response: {
247
+ 400: errorSchema,
248
+ 404: errorSchema,
249
+ 409: errorSchema,
250
+ },
251
+ },
252
+ }, async (request, reply) => execute(reply, 204, () => repository.deleteSession(request.params.sessionId, request.body)));
253
+ server.patch("/api/v1/sessions/:sessionId/project", {
254
+ schema: {
255
+ params: idParamsSchema("sessionId"),
256
+ body: {
257
+ type: "object",
258
+ additionalProperties: false,
259
+ required: ["projectId", "expectedRevision"],
260
+ properties: {
261
+ projectId: nullableStringSchema,
262
+ expectedRevision: { type: "integer", minimum: 1 },
263
+ },
264
+ },
265
+ response: {
266
+ 200: sessionSchema,
267
+ 404: errorSchema,
268
+ 409: errorSchema,
269
+ },
270
+ },
271
+ }, async (request, reply) => execute(reply, 200, () => repository.moveSession(request.params.sessionId, request.body)));
272
+ }
273
+ function execute(reply, successStatus, operation) {
274
+ try {
275
+ return reply.code(successStatus).send(operation());
276
+ }
277
+ catch (error) {
278
+ if (error instanceof ProjectNotFoundError ||
279
+ error instanceof SessionNotFoundError) {
280
+ return reply.code(404).send({ code: error.code, message: error.message });
281
+ }
282
+ if (error instanceof RevisionConflictError) {
283
+ return reply.code(409).send({
284
+ code: error.code,
285
+ message: error.message,
286
+ actualRevision: error.actualRevision,
287
+ });
288
+ }
289
+ if (error instanceof ProjectNameConflictError) {
290
+ return reply.code(409).send({ code: error.code, message: error.message });
291
+ }
292
+ if (error instanceof ProjectNotEmptyError) {
293
+ return reply.code(409).send({
294
+ code: error.code,
295
+ message: error.message,
296
+ sessionCount: error.sessionCount,
297
+ });
298
+ }
299
+ if (error instanceof InvalidRecordError) {
300
+ return reply.code(400).send({ code: error.code, message: error.message });
301
+ }
302
+ throw error;
303
+ }
304
+ }
305
+ //# sourceMappingURL=project-sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-sessions.js","sourceRoot":"","sources":["../../../src/server/routes/project-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EAEpB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,aAAa,EAAoB,MAAM,+BAA+B,CAAC;AAyChF,MAAM,oBAAoB,GAAG;IAC3B,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;CACrC,CAAC;AAEX,MAAM,yB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EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import type { SpatialSessionRepository } from "../../database/spatial-session-repository.ts";
3
+ export declare function registerSpatialSessionRoutes(server: FastifyInstance, repository: SpatialSessionRepository): void;
@@ -0,0 +1,80 @@
1
+ import schema from "../../../schemas/spatial-draft.schema.json" with { type: "json" };
2
+ import { createSpatialDraft, SpatialConstraintError } from "../../domain/spatial/index.js";
3
+ import { renderSpatialPng, renderSpatialCameraBoxPng } from "../spatial-render.js";
4
+ import { SPATIAL_BOX_FACES, SPATIAL_RENDER_PASSES } from "../../domain/spatial/types.js";
5
+ import { registerDraftVersionRoutes, replyToDraftVersionError } from "./draft-version-routes.js";
6
+ export function registerSpatialSessionRoutes(server, repository) {
7
+ const { $schema: _dialect, ...fastifySchema } = schema;
8
+ server.addSchema(fastifySchema);
9
+ registerDraftVersionRoutes(server, { routePrefix: "/api/v1/sessions/:sessionId/spatial", draftSchema: { $ref: schema.$id }, repository });
10
+ const cache = new Map();
11
+ const cached = (key, render) => {
12
+ let pending = cache.get(key);
13
+ if (!pending) {
14
+ pending = render();
15
+ cache.set(key, pending);
16
+ if (cache.size > 24)
17
+ cache.delete(cache.keys().next().value);
18
+ void pending.catch(() => { if (cache.get(key) === pending)
19
+ cache.delete(key); });
20
+ }
21
+ return pending;
22
+ };
23
+ server.post("/api/v1/sessions/:sessionId/spatial/operations", { schema: { body: { type: "object", additionalProperties: false, required: ["expectedLatestRevision", "operations"], properties: { expectedLatestRevision: { type: "integer", minimum: 0 }, operations: { type: "array", maxItems: 100, items: { type: "object", required: ["type"], properties: { type: { type: "string" } } } } } } } }, async (request, reply) => {
24
+ try {
25
+ return reply.code(201).send(repository.apply(request.params.sessionId, request.body.expectedLatestRevision, request.body.operations));
26
+ }
27
+ catch (error) {
28
+ if (error instanceof SpatialConstraintError)
29
+ return reply.code(422).send({ code: error.code, message: error.message });
30
+ if (error instanceof Error && error.message.startsWith("SPATIAL_INVALID"))
31
+ return reply.code(400).send({ code: "SPATIAL_INVALID", message: error.message });
32
+ const handled = replyToDraftVersionError(reply, error);
33
+ if (handled)
34
+ return handled;
35
+ throw error;
36
+ }
37
+ });
38
+ server.get("/api/v1/sessions/:sessionId/spatial/cameras/:cameraId.png", { schema: { querystring: { type: "object", properties: { revision: { type: "integer", minimum: 1 }, pass: { type: "string", enum: [...SPATIAL_RENDER_PASSES] } } } } }, async (request, reply) => {
39
+ try {
40
+ const { sessionId, cameraId } = request.params;
41
+ const version = request.query.revision ? repository.getDraftVersion(sessionId, request.query.revision) : repository.listDraftVersions(sessionId).at(-1);
42
+ const draft = version?.draft ?? createSpatialDraft();
43
+ const camera = draft.cameras.find(c => c.id === cameraId);
44
+ if (!camera)
45
+ return reply.code(404).send({ code: "SPATIAL_CAMERA_NOT_FOUND", message: "Camera not found" });
46
+ const pass = request.query.pass ?? "color";
47
+ const key = JSON.stringify([sessionId, version?.revision ?? 0, cameraId, pass]);
48
+ const pending = cached(key, () => renderSpatialPng(draft, camera, pass));
49
+ return reply.header("cache-control", request.query.revision ? "private, max-age=31536000, immutable" : "no-cache")
50
+ .header("x-spatial-revision", version?.revision ?? 0).header("x-spatial-render-pass", pass).type("image/png").send(await pending);
51
+ }
52
+ catch (error) {
53
+ const handled = replyToDraftVersionError(reply, error);
54
+ if (handled)
55
+ return handled;
56
+ throw error;
57
+ }
58
+ });
59
+ server.get("/api/v1/sessions/:sessionId/spatial/camera-boxes/:boxId.png", { schema: { querystring: { type: "object", properties: { revision: { type: "integer", minimum: 1 }, pass: { type: "string", enum: [...SPATIAL_RENDER_PASSES] }, view: { type: "string", enum: ["sheet", ...SPATIAL_BOX_FACES] } } } } }, async (request, reply) => {
60
+ try {
61
+ const { sessionId, boxId } = request.params;
62
+ const version = request.query.revision ? repository.getDraftVersion(sessionId, request.query.revision) : repository.listDraftVersions(sessionId).at(-1);
63
+ const box = version?.draft.cameraBoxes?.find(box => box.id === boxId);
64
+ if (!box || !version)
65
+ return reply.code(404).send({ code: "SPATIAL_CAMERA_NOT_FOUND", message: "Camera box not found" });
66
+ const pass = request.query.pass ?? "color", view = request.query.view ?? "sheet";
67
+ const key = JSON.stringify([sessionId, version.revision, "camera-box", boxId, view, pass]);
68
+ const png = cached(key, () => renderSpatialCameraBoxPng(version.draft, box, view, pass));
69
+ return reply.header("cache-control", request.query.revision ? "private, max-age=31536000, immutable" : "no-cache")
70
+ .header("x-spatial-revision", version.revision).header("x-spatial-render-pass", pass).header("x-spatial-box-view", view).type("image/png").send(await png);
71
+ }
72
+ catch (error) {
73
+ const handled = replyToDraftVersionError(reply, error);
74
+ if (handled)
75
+ return handled;
76
+ throw error;
77
+ }
78
+ });
79
+ }
80
+ //# sourceMappingURL=spatial-sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-sessions.js","sourceRoot":"","sources":["../../../src/server/routes/spatial-sessions.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,4CAA4C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEtF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAyB,MAAM,+BAA+B,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAA+C,MAAM,+BAA+B,CAAC;AACtI,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAEjG,MAAM,UAAU,4BAA4B,CAAC,MAAuB,EAAE,UAAoC;IACxG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,CAAC;IACvD,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAChC,0BAA0B,CAAC,MAAM,EAAE,EAAE,WA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AO,GAAG,wBAAwB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,OAAO;gBAAE,OAAO,OAAO,CAAC;YAC5B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { FastifyInstance } from "fastify";
2
+ import { StyleLibraryRepository } from "../../database/style-library-repository.ts";
3
+ export declare function registerStyleLibraryRoutes(server: FastifyInstance, repository: StyleLibraryRepository): void;