@aotter/mantle 0.1.5-alpha.1 → 0.2.0-alpha.1

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 (870) hide show
  1. package/README.md +39 -306
  2. package/dist/admin/consent.d.ts +17 -0
  3. package/dist/admin/consent.d.ts.map +1 -0
  4. package/dist/admin/consent.js +17 -0
  5. package/dist/admin/consent.js.map +1 -0
  6. package/dist/admin/createAdminSurface.d.ts +22 -0
  7. package/dist/admin/createAdminSurface.d.ts.map +1 -0
  8. package/dist/admin/createAdminSurface.js +589 -0
  9. package/dist/admin/createAdminSurface.js.map +1 -0
  10. package/dist/admin/developerConsole.d.ts +264 -0
  11. package/dist/admin/developerConsole.d.ts.map +1 -0
  12. package/dist/admin/developerConsole.js +136 -0
  13. package/dist/admin/developerConsole.js.map +1 -0
  14. package/dist/admin/identity.d.ts +62 -0
  15. package/dist/admin/identity.d.ts.map +1 -0
  16. package/dist/admin/identity.js +7 -0
  17. package/dist/admin/identity.js.map +1 -0
  18. package/dist/admin/index.d.ts +4 -0
  19. package/dist/admin/index.d.ts.map +1 -0
  20. package/dist/admin/index.js +4 -0
  21. package/dist/admin/index.js.map +1 -0
  22. package/dist/admin/procedureFlow.d.ts +25 -0
  23. package/dist/admin/procedureFlow.d.ts.map +1 -0
  24. package/dist/admin/procedureFlow.js +154 -0
  25. package/dist/admin/procedureFlow.js.map +1 -0
  26. package/dist/auth/ConsoleEmailSender.d.ts +15 -0
  27. package/dist/auth/ConsoleEmailSender.d.ts.map +1 -0
  28. package/dist/auth/ConsoleEmailSender.js +19 -0
  29. package/dist/auth/ConsoleEmailSender.js.map +1 -0
  30. package/dist/auth/appleClientSecret.d.ts +75 -0
  31. package/dist/auth/appleClientSecret.d.ts.map +1 -0
  32. package/dist/auth/appleClientSecret.js +116 -0
  33. package/dist/auth/appleClientSecret.js.map +1 -0
  34. package/dist/auth/buildAuth.d.ts +4565 -0
  35. package/dist/auth/buildAuth.d.ts.map +1 -0
  36. package/dist/auth/buildAuth.js +307 -0
  37. package/dist/auth/buildAuth.js.map +1 -0
  38. package/dist/auth/callerResolver.d.ts +48 -0
  39. package/dist/auth/callerResolver.d.ts.map +1 -0
  40. package/dist/auth/callerResolver.js +49 -0
  41. package/dist/auth/callerResolver.js.map +1 -0
  42. package/dist/auth/createAuthRoutes.d.ts +22 -0
  43. package/dist/auth/createAuthRoutes.d.ts.map +1 -0
  44. package/dist/auth/createAuthRoutes.js +128 -0
  45. package/dist/auth/createAuthRoutes.js.map +1 -0
  46. package/dist/auth/createMantleAuth.d.ts +3 -0
  47. package/dist/auth/createMantleAuth.d.ts.map +1 -0
  48. package/dist/auth/createMantleAuth.js +483 -0
  49. package/dist/auth/createMantleAuth.js.map +1 -0
  50. package/dist/auth/db.d.ts +17 -0
  51. package/dist/auth/db.d.ts.map +1 -0
  52. package/dist/auth/db.js +24 -0
  53. package/dist/auth/db.js.map +1 -0
  54. package/dist/auth/emailTemplates.d.ts +7 -0
  55. package/dist/auth/emailTemplates.d.ts.map +1 -0
  56. package/dist/auth/emailTemplates.js +27 -0
  57. package/dist/auth/emailTemplates.js.map +1 -0
  58. package/dist/auth/index.d.ts +9 -0
  59. package/dist/auth/index.d.ts.map +1 -0
  60. package/dist/auth/index.js +7 -0
  61. package/dist/auth/index.js.map +1 -0
  62. package/dist/auth/methods.d.ts +717 -0
  63. package/dist/auth/methods.d.ts.map +1 -0
  64. package/dist/auth/methods.js +321 -0
  65. package/dist/auth/methods.js.map +1 -0
  66. package/dist/auth/oauthTokens.d.ts +24 -0
  67. package/dist/auth/oauthTokens.d.ts.map +1 -0
  68. package/dist/auth/oauthTokens.js +146 -0
  69. package/dist/auth/oauthTokens.js.map +1 -0
  70. package/dist/auth/setupIncomplete.d.ts +16 -0
  71. package/dist/auth/setupIncomplete.d.ts.map +1 -0
  72. package/dist/auth/setupIncomplete.js +50 -0
  73. package/dist/auth/setupIncomplete.js.map +1 -0
  74. package/dist/auth/types.d.ts +440 -0
  75. package/dist/auth/types.d.ts.map +1 -0
  76. package/dist/auth/types.js +10 -0
  77. package/dist/auth/types.js.map +1 -0
  78. package/dist/bun/index.d.ts +65 -0
  79. package/dist/bun/index.d.ts.map +1 -0
  80. package/dist/bun/index.js +130 -0
  81. package/dist/bun/index.js.map +1 -0
  82. package/dist/cli/emitModule.d.ts +7 -0
  83. package/dist/cli/emitModule.d.ts.map +1 -0
  84. package/dist/cli/emitModule.js +127 -0
  85. package/dist/cli/emitModule.js.map +1 -0
  86. package/dist/cli/generate.d.ts +4 -16
  87. package/dist/cli/generate.d.ts.map +1 -1
  88. package/dist/cli/generate.js +318 -262
  89. package/dist/cli/generate.js.map +1 -1
  90. package/dist/cli/main.d.ts +1 -1
  91. package/dist/cli/main.d.ts.map +1 -1
  92. package/dist/cli/main.js +15 -71
  93. package/dist/cli/main.js.map +1 -1
  94. package/dist/cli/preset.d.ts +18 -0
  95. package/dist/cli/preset.d.ts.map +1 -0
  96. package/dist/cli/preset.js +352 -0
  97. package/dist/cli/preset.js.map +1 -0
  98. package/dist/cloudflare/index.d.ts +21 -0
  99. package/dist/cloudflare/index.d.ts.map +1 -0
  100. package/dist/cloudflare/index.js +14 -0
  101. package/dist/cloudflare/index.js.map +1 -0
  102. package/dist/cloudflare/r2Media.d.ts +43 -0
  103. package/dist/cloudflare/r2Media.d.ts.map +1 -0
  104. package/dist/cloudflare/r2Media.js +69 -0
  105. package/dist/cloudflare/r2Media.js.map +1 -0
  106. package/dist/core/caller.d.ts +35 -0
  107. package/dist/core/caller.d.ts.map +1 -0
  108. package/dist/core/caller.js +3 -0
  109. package/dist/core/caller.js.map +1 -0
  110. package/dist/core/createMantle.d.ts +22 -0
  111. package/dist/core/createMantle.d.ts.map +1 -0
  112. package/dist/core/createMantle.js +117 -0
  113. package/dist/core/createMantle.js.map +1 -0
  114. package/dist/core/dialect.d.ts +41 -0
  115. package/dist/core/dialect.d.ts.map +1 -0
  116. package/dist/core/dialect.js +7 -0
  117. package/dist/core/dialect.js.map +1 -0
  118. package/dist/core/driver.d.ts +17 -0
  119. package/dist/core/driver.d.ts.map +1 -0
  120. package/dist/core/driver.js +2 -0
  121. package/dist/core/driver.js.map +1 -0
  122. package/dist/core/email.d.ts +17 -0
  123. package/dist/core/email.d.ts.map +1 -0
  124. package/dist/core/email.js +2 -0
  125. package/dist/core/email.js.map +1 -0
  126. package/dist/core/index.d.ts +16 -0
  127. package/dist/core/index.d.ts.map +1 -0
  128. package/dist/core/index.js +16 -0
  129. package/dist/core/index.js.map +1 -0
  130. package/dist/core/invocation.d.ts +66 -0
  131. package/dist/core/invocation.d.ts.map +1 -0
  132. package/dist/core/invocation.js +3 -0
  133. package/dist/core/invocation.js.map +1 -0
  134. package/dist/core/runtime/auth.d.ts +9 -0
  135. package/dist/core/runtime/auth.d.ts.map +1 -0
  136. package/dist/core/runtime/auth.js +39 -0
  137. package/dist/core/runtime/auth.js.map +1 -0
  138. package/dist/core/runtime/createRuntime.d.ts +23 -0
  139. package/dist/core/runtime/createRuntime.d.ts.map +1 -0
  140. package/dist/core/runtime/createRuntime.js +214 -0
  141. package/dist/core/runtime/createRuntime.js.map +1 -0
  142. package/dist/core/runtime/verifyPlan.d.ts +34 -0
  143. package/dist/core/runtime/verifyPlan.d.ts.map +1 -0
  144. package/dist/core/runtime/verifyPlan.js +301 -0
  145. package/dist/core/runtime/verifyPlan.js.map +1 -0
  146. package/dist/core/service.d.ts +45 -0
  147. package/dist/core/service.d.ts.map +1 -0
  148. package/dist/core/service.js +2 -0
  149. package/dist/core/service.js.map +1 -0
  150. package/dist/core/site.d.ts +117 -0
  151. package/dist/core/site.d.ts.map +1 -0
  152. package/dist/core/site.js +2 -0
  153. package/dist/core/site.js.map +1 -0
  154. package/dist/core/siteConfig.d.ts +5 -0
  155. package/dist/core/siteConfig.d.ts.map +1 -0
  156. package/dist/core/siteConfig.js +24 -0
  157. package/dist/core/siteConfig.js.map +1 -0
  158. package/dist/core/sql/allowlist.d.ts +65 -0
  159. package/dist/core/sql/allowlist.d.ts.map +1 -0
  160. package/dist/core/sql/allowlist.js +705 -0
  161. package/dist/core/sql/allowlist.js.map +1 -0
  162. package/dist/core/sql/ast.d.ts +24 -0
  163. package/dist/core/sql/ast.d.ts.map +1 -0
  164. package/dist/core/sql/ast.js +32 -0
  165. package/dist/core/sql/ast.js.map +1 -0
  166. package/dist/core/sql/compile.d.ts +50 -0
  167. package/dist/core/sql/compile.d.ts.map +1 -0
  168. package/dist/core/sql/compile.js +48 -0
  169. package/dist/core/sql/compile.js.map +1 -0
  170. package/dist/core/sql/policy.d.ts +121 -0
  171. package/dist/core/sql/policy.d.ts.map +1 -0
  172. package/dist/core/sql/policy.js +379 -0
  173. package/dist/core/sql/policy.js.map +1 -0
  174. package/dist/core/sql/positions.d.ts +30 -0
  175. package/dist/core/sql/positions.d.ts.map +1 -0
  176. package/dist/core/sql/positions.js +22 -0
  177. package/dist/core/sql/positions.js.map +1 -0
  178. package/dist/core/sql/run.d.ts +76 -0
  179. package/dist/core/sql/run.d.ts.map +1 -0
  180. package/dist/core/sql/run.js +267 -0
  181. package/dist/core/sql/run.js.map +1 -0
  182. package/dist/core/store/createStore.d.ts +49 -0
  183. package/dist/core/store/createStore.d.ts.map +1 -0
  184. package/dist/core/store/createStore.js +227 -0
  185. package/dist/core/store/createStore.js.map +1 -0
  186. package/dist/core/store/cursor.d.ts +4 -0
  187. package/dist/core/store/cursor.d.ts.map +1 -0
  188. package/dist/core/store/cursor.js +22 -0
  189. package/dist/core/store/cursor.js.map +1 -0
  190. package/dist/core/store/json.d.ts +80 -0
  191. package/dist/core/store/json.d.ts.map +1 -0
  192. package/dist/core/store/json.js +342 -0
  193. package/dist/core/store/json.js.map +1 -0
  194. package/dist/core/store.d.ts +160 -0
  195. package/dist/core/store.d.ts.map +1 -0
  196. package/dist/core/store.js +2 -0
  197. package/dist/core/store.js.map +1 -0
  198. package/dist/core/wire.d.ts +20 -0
  199. package/dist/core/wire.d.ts.map +1 -0
  200. package/dist/core/wire.js +84 -0
  201. package/dist/core/wire.js.map +1 -0
  202. package/dist/core/withCaller.d.ts +16 -0
  203. package/dist/core/withCaller.d.ts.map +1 -0
  204. package/dist/core/withCaller.js +29 -0
  205. package/dist/core/withCaller.js.map +1 -0
  206. package/dist/d1/adapter.d.ts +12 -0
  207. package/dist/d1/adapter.d.ts.map +1 -0
  208. package/dist/d1/adapter.js +23 -0
  209. package/dist/d1/adapter.js.map +1 -0
  210. package/dist/d1/codec.d.ts +14 -0
  211. package/dist/d1/codec.d.ts.map +1 -0
  212. package/dist/d1/codec.js +136 -0
  213. package/dist/d1/codec.js.map +1 -0
  214. package/dist/d1/compile/index.d.ts +9 -0
  215. package/dist/d1/compile/index.d.ts.map +1 -0
  216. package/dist/d1/compile/index.js +9 -0
  217. package/dist/d1/compile/index.js.map +1 -0
  218. package/dist/d1/dialect.d.ts +4 -0
  219. package/dist/d1/dialect.d.ts.map +1 -0
  220. package/dist/d1/dialect.js +13 -0
  221. package/dist/d1/dialect.js.map +1 -0
  222. package/dist/d1/executor.d.ts +13 -0
  223. package/dist/d1/executor.d.ts.map +1 -0
  224. package/dist/d1/executor.js +91 -0
  225. package/dist/d1/executor.js.map +1 -0
  226. package/dist/d1/index.d.ts +6 -0
  227. package/dist/d1/index.d.ts.map +1 -0
  228. package/dist/d1/index.js +6 -0
  229. package/dist/d1/index.js.map +1 -0
  230. package/dist/d1/lower.d.ts +8 -0
  231. package/dist/d1/lower.d.ts.map +1 -0
  232. package/dist/d1/lower.js +167 -0
  233. package/dist/d1/lower.js.map +1 -0
  234. package/dist/d1/media.d.ts +5 -0
  235. package/dist/d1/media.d.ts.map +1 -0
  236. package/dist/d1/media.js +157 -0
  237. package/dist/d1/media.js.map +1 -0
  238. package/dist/d1/migrations.d.ts +12 -0
  239. package/dist/d1/migrations.d.ts.map +1 -0
  240. package/dist/d1/migrations.js +111 -0
  241. package/dist/d1/migrations.js.map +1 -0
  242. package/dist/d1/print.d.ts +28 -0
  243. package/dist/d1/print.d.ts.map +1 -0
  244. package/dist/d1/print.js +54 -0
  245. package/dist/d1/print.js.map +1 -0
  246. package/dist/d1/site.d.ts +17 -0
  247. package/dist/d1/site.d.ts.map +1 -0
  248. package/dist/d1/site.js +63 -0
  249. package/dist/d1/site.js.map +1 -0
  250. package/dist/d1/storage.d.ts +34 -0
  251. package/dist/d1/storage.d.ts.map +1 -0
  252. package/dist/d1/storage.js +288 -0
  253. package/dist/d1/storage.js.map +1 -0
  254. package/dist/d1/tz.d.ts +21 -0
  255. package/dist/d1/tz.d.ts.map +1 -0
  256. package/dist/d1/tz.js +54 -0
  257. package/dist/d1/tz.js.map +1 -0
  258. package/dist/d1/validator.d.ts +10 -0
  259. package/dist/d1/validator.d.ts.map +1 -0
  260. package/dist/d1/validator.js +33 -0
  261. package/dist/d1/validator.js.map +1 -0
  262. package/dist/mcp/apps.d.ts +43 -0
  263. package/dist/mcp/apps.d.ts.map +1 -0
  264. package/dist/mcp/apps.js +57 -0
  265. package/dist/mcp/apps.js.map +1 -0
  266. package/dist/mcp/catalog.d.ts +55 -0
  267. package/dist/mcp/catalog.d.ts.map +1 -0
  268. package/dist/mcp/catalog.js +81 -0
  269. package/dist/mcp/catalog.js.map +1 -0
  270. package/dist/mcp/createMcpSurface.d.ts +34 -0
  271. package/dist/mcp/createMcpSurface.d.ts.map +1 -0
  272. package/dist/mcp/createMcpSurface.js +150 -0
  273. package/dist/mcp/createMcpSurface.js.map +1 -0
  274. package/dist/mcp/index.d.ts +4 -0
  275. package/dist/mcp/index.d.ts.map +1 -0
  276. package/dist/mcp/index.js +4 -0
  277. package/dist/mcp/index.js.map +1 -0
  278. package/dist/postgres/adapter.d.ts +20 -0
  279. package/dist/postgres/adapter.d.ts.map +1 -0
  280. package/dist/postgres/adapter.js +44 -0
  281. package/dist/postgres/adapter.js.map +1 -0
  282. package/dist/postgres/codec.d.ts +13 -0
  283. package/dist/postgres/codec.d.ts.map +1 -0
  284. package/dist/postgres/codec.js +110 -0
  285. package/dist/postgres/codec.js.map +1 -0
  286. package/dist/postgres/compile/index.d.ts +9 -0
  287. package/dist/postgres/compile/index.d.ts.map +1 -0
  288. package/dist/postgres/compile/index.js +9 -0
  289. package/dist/postgres/compile/index.js.map +1 -0
  290. package/dist/postgres/driver.d.ts +92 -0
  291. package/dist/postgres/driver.d.ts.map +1 -0
  292. package/dist/postgres/driver.js +110 -0
  293. package/dist/postgres/driver.js.map +1 -0
  294. package/dist/postgres/executor.d.ts +20 -0
  295. package/dist/postgres/executor.d.ts.map +1 -0
  296. package/dist/postgres/executor.js +69 -0
  297. package/dist/postgres/executor.js.map +1 -0
  298. package/dist/postgres/index.d.ts +7 -0
  299. package/dist/postgres/index.d.ts.map +1 -0
  300. package/dist/postgres/index.js +7 -0
  301. package/dist/postgres/index.js.map +1 -0
  302. package/dist/postgres/lower.d.ts +6 -0
  303. package/dist/postgres/lower.d.ts.map +1 -0
  304. package/dist/postgres/lower.js +157 -0
  305. package/dist/postgres/lower.js.map +1 -0
  306. package/dist/postgres/print.d.ts +11 -0
  307. package/dist/postgres/print.d.ts.map +1 -0
  308. package/dist/postgres/print.js +121 -0
  309. package/dist/postgres/print.js.map +1 -0
  310. package/dist/postgres/storage.d.ts +19 -0
  311. package/dist/postgres/storage.d.ts.map +1 -0
  312. package/dist/postgres/storage.js +201 -0
  313. package/dist/postgres/storage.js.map +1 -0
  314. package/dist/postgres/textRows.d.ts +10 -0
  315. package/dist/postgres/textRows.d.ts.map +1 -0
  316. package/dist/postgres/textRows.js +44 -0
  317. package/dist/postgres/textRows.js.map +1 -0
  318. package/dist/postgres/validator.d.ts +12 -0
  319. package/dist/postgres/validator.d.ts.map +1 -0
  320. package/dist/postgres/validator.js +46 -0
  321. package/dist/postgres/validator.js.map +1 -0
  322. package/dist/spec/domain/index.d.ts +3 -0
  323. package/dist/spec/domain/index.d.ts.map +1 -0
  324. package/dist/spec/domain/index.js +3 -0
  325. package/dist/spec/domain/index.js.map +1 -0
  326. package/dist/spec/domain/model/ContentState.d.ts +8 -0
  327. package/dist/spec/domain/model/ContentState.d.ts.map +1 -0
  328. package/dist/spec/domain/model/ContentState.js +7 -0
  329. package/dist/spec/domain/model/ContentState.js.map +1 -0
  330. package/dist/spec/domain/model/Entry.d.ts +29 -0
  331. package/dist/spec/domain/model/Entry.d.ts.map +1 -0
  332. package/dist/spec/domain/model/Entry.js +16 -0
  333. package/dist/spec/domain/model/Entry.js.map +1 -0
  334. package/dist/spec/domain/model/Locale.d.ts +30 -0
  335. package/dist/spec/domain/model/Locale.d.ts.map +1 -0
  336. package/dist/spec/domain/model/Locale.js +33 -0
  337. package/dist/spec/domain/model/Locale.js.map +1 -0
  338. package/dist/spec/domain/model/ManifestGrammar.d.ts +452 -0
  339. package/dist/spec/domain/model/ManifestGrammar.d.ts.map +1 -0
  340. package/dist/spec/domain/model/ManifestGrammar.js +149 -0
  341. package/dist/spec/domain/model/ManifestGrammar.js.map +1 -0
  342. package/dist/spec/domain/model/MediaMimeAccept.d.ts +55 -0
  343. package/dist/spec/domain/model/MediaMimeAccept.d.ts.map +1 -0
  344. package/dist/spec/domain/model/MediaMimeAccept.js +90 -0
  345. package/dist/spec/domain/model/MediaMimeAccept.js.map +1 -0
  346. package/dist/spec/domain/model/RuntimePlan.d.ts +94 -0
  347. package/dist/spec/domain/model/RuntimePlan.d.ts.map +1 -0
  348. package/dist/spec/domain/model/RuntimePlan.js +4 -0
  349. package/dist/spec/domain/model/RuntimePlan.js.map +1 -0
  350. package/dist/spec/domain/model/SiteConfig.d.ts +173 -0
  351. package/dist/spec/domain/model/SiteConfig.d.ts.map +1 -0
  352. package/dist/spec/domain/model/SiteConfig.js +13 -0
  353. package/dist/spec/domain/model/SiteConfig.js.map +1 -0
  354. package/dist/spec/domain/model/SqlIr.d.ts +96 -0
  355. package/dist/spec/domain/model/SqlIr.d.ts.map +1 -0
  356. package/dist/spec/domain/model/SqlIr.js +95 -0
  357. package/dist/spec/domain/model/SqlIr.js.map +1 -0
  358. package/dist/spec/domain/model/index.d.ts +14 -0
  359. package/dist/spec/domain/model/index.d.ts.map +1 -0
  360. package/dist/spec/domain/model/index.js +14 -0
  361. package/dist/spec/domain/model/index.js.map +1 -0
  362. package/dist/spec/domain/service/CloudflareCron.d.ts +2 -0
  363. package/dist/spec/domain/service/CloudflareCron.d.ts.map +1 -0
  364. package/dist/spec/domain/service/CloudflareCron.js +63 -0
  365. package/dist/spec/domain/service/CloudflareCron.js.map +1 -0
  366. package/dist/spec/domain/service/CrossSchemaChecker.d.ts +34 -0
  367. package/dist/spec/domain/service/CrossSchemaChecker.d.ts.map +1 -0
  368. package/dist/spec/domain/service/CrossSchemaChecker.js +114 -0
  369. package/dist/spec/domain/service/CrossSchemaChecker.js.map +1 -0
  370. package/dist/spec/domain/service/EntryDataValidator.d.ts +56 -0
  371. package/dist/spec/domain/service/EntryDataValidator.d.ts.map +1 -0
  372. package/dist/spec/domain/service/EntryDataValidator.js +88 -0
  373. package/dist/spec/domain/service/EntryDataValidator.js.map +1 -0
  374. package/dist/spec/domain/service/JsonSchemaToZod.d.ts +29 -0
  375. package/dist/spec/domain/service/JsonSchemaToZod.d.ts.map +1 -0
  376. package/dist/spec/domain/service/JsonSchemaToZod.js +156 -0
  377. package/dist/spec/domain/service/JsonSchemaToZod.js.map +1 -0
  378. package/dist/spec/domain/service/LifecycleStateMachine.d.ts +75 -0
  379. package/dist/spec/domain/service/LifecycleStateMachine.d.ts.map +1 -0
  380. package/dist/spec/domain/service/LifecycleStateMachine.js +76 -0
  381. package/dist/spec/domain/service/LifecycleStateMachine.js.map +1 -0
  382. package/dist/spec/domain/service/LocaleCanonicalizer.d.ts +29 -0
  383. package/dist/spec/domain/service/LocaleCanonicalizer.d.ts.map +1 -0
  384. package/dist/spec/domain/service/LocaleCanonicalizer.js +96 -0
  385. package/dist/spec/domain/service/LocaleCanonicalizer.js.map +1 -0
  386. package/dist/spec/domain/service/ManifestFieldChecks.d.ts +60 -0
  387. package/dist/spec/domain/service/ManifestFieldChecks.d.ts.map +1 -0
  388. package/dist/spec/domain/service/ManifestFieldChecks.js +116 -0
  389. package/dist/spec/domain/service/ManifestFieldChecks.js.map +1 -0
  390. package/dist/spec/domain/service/ManifestGraphValidator.d.ts +15 -0
  391. package/dist/spec/domain/service/ManifestGraphValidator.d.ts.map +1 -0
  392. package/dist/spec/domain/service/ManifestGraphValidator.js +225 -0
  393. package/dist/spec/domain/service/ManifestGraphValidator.js.map +1 -0
  394. package/dist/spec/domain/service/ManifestLinker.d.ts +45 -0
  395. package/dist/spec/domain/service/ManifestLinker.d.ts.map +1 -0
  396. package/dist/spec/domain/service/ManifestLinker.js +92 -0
  397. package/dist/spec/domain/service/ManifestLinker.js.map +1 -0
  398. package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts +16 -0
  399. package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts.map +1 -0
  400. package/dist/spec/domain/service/ManifestLocaleTrimmer.js +76 -0
  401. package/dist/spec/domain/service/ManifestLocaleTrimmer.js.map +1 -0
  402. package/dist/spec/domain/service/ManifestParser.d.ts +49 -0
  403. package/dist/spec/domain/service/ManifestParser.d.ts.map +1 -0
  404. package/dist/spec/domain/service/ManifestParser.js +203 -0
  405. package/dist/spec/domain/service/ManifestParser.js.map +1 -0
  406. package/dist/spec/domain/service/ManifestPartition.d.ts +9 -0
  407. package/dist/spec/domain/service/ManifestPartition.d.ts.map +1 -0
  408. package/dist/spec/domain/service/ManifestPartition.js +19 -0
  409. package/dist/spec/domain/service/ManifestPartition.js.map +1 -0
  410. package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts +33 -0
  411. package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts.map +1 -0
  412. package/dist/spec/domain/service/ManifestPathDiagnoser.js +43 -0
  413. package/dist/spec/domain/service/ManifestPathDiagnoser.js.map +1 -0
  414. package/dist/spec/domain/service/ManifestSourceSpans.d.ts +10 -0
  415. package/dist/spec/domain/service/ManifestSourceSpans.d.ts.map +1 -0
  416. package/dist/spec/domain/service/ManifestSourceSpans.js +76 -0
  417. package/dist/spec/domain/service/ManifestSourceSpans.js.map +1 -0
  418. package/dist/spec/domain/service/McpToolNaming.d.ts +25 -0
  419. package/dist/spec/domain/service/McpToolNaming.d.ts.map +1 -0
  420. package/dist/spec/domain/service/McpToolNaming.js +50 -0
  421. package/dist/spec/domain/service/McpToolNaming.js.map +1 -0
  422. package/dist/spec/domain/service/PlanFingerprint.d.ts +4 -0
  423. package/dist/spec/domain/service/PlanFingerprint.d.ts.map +1 -0
  424. package/dist/spec/domain/service/PlanFingerprint.js +14 -0
  425. package/dist/spec/domain/service/PlanFingerprint.js.map +1 -0
  426. package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts +4 -0
  427. package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts.map +1 -0
  428. package/dist/spec/domain/service/ProcedureViewSpecChecks.js +211 -0
  429. package/dist/spec/domain/service/ProcedureViewSpecChecks.js.map +1 -0
  430. package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts +42 -0
  431. package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts.map +1 -0
  432. package/dist/spec/domain/service/SchemaAdminUiChecker.js +289 -0
  433. package/dist/spec/domain/service/SchemaAdminUiChecker.js.map +1 -0
  434. package/dist/spec/domain/service/SchemaIndexChecker.d.ts +33 -0
  435. package/dist/spec/domain/service/SchemaIndexChecker.d.ts.map +1 -0
  436. package/dist/spec/domain/service/SchemaIndexChecker.js +256 -0
  437. package/dist/spec/domain/service/SchemaIndexChecker.js.map +1 -0
  438. package/dist/spec/domain/service/SchemaSearchChecker.d.ts +11 -0
  439. package/dist/spec/domain/service/SchemaSearchChecker.d.ts.map +1 -0
  440. package/dist/spec/domain/service/SchemaSearchChecker.js +78 -0
  441. package/dist/spec/domain/service/SchemaSearchChecker.js.map +1 -0
  442. package/dist/spec/domain/service/SchemaSpecChecks.d.ts +31 -0
  443. package/dist/spec/domain/service/SchemaSpecChecks.d.ts.map +1 -0
  444. package/dist/spec/domain/service/SchemaSpecChecks.js +445 -0
  445. package/dist/spec/domain/service/SchemaSpecChecks.js.map +1 -0
  446. package/dist/spec/domain/service/SiteDefaultsValidator.d.ts +39 -0
  447. package/dist/spec/domain/service/SiteDefaultsValidator.d.ts.map +1 -0
  448. package/dist/spec/domain/service/SiteDefaultsValidator.js +194 -0
  449. package/dist/spec/domain/service/SiteDefaultsValidator.js.map +1 -0
  450. package/dist/spec/domain/service/SqlClassify.d.ts +19 -0
  451. package/dist/spec/domain/service/SqlClassify.d.ts.map +1 -0
  452. package/dist/spec/domain/service/SqlClassify.js +42 -0
  453. package/dist/spec/domain/service/SqlClassify.js.map +1 -0
  454. package/dist/spec/domain/service/SqlRefusal.d.ts +16 -0
  455. package/dist/spec/domain/service/SqlRefusal.d.ts.map +1 -0
  456. package/dist/spec/domain/service/SqlRefusal.js +20 -0
  457. package/dist/spec/domain/service/SqlRefusal.js.map +1 -0
  458. package/dist/spec/domain/service/SqlTypes.d.ts +40 -0
  459. package/dist/spec/domain/service/SqlTypes.d.ts.map +1 -0
  460. package/dist/spec/domain/service/SqlTypes.js +110 -0
  461. package/dist/spec/domain/service/SqlTypes.js.map +1 -0
  462. package/dist/spec/domain/service/StaffRoleHierarchy.d.ts +3 -0
  463. package/dist/spec/domain/service/StaffRoleHierarchy.d.ts.map +1 -0
  464. package/dist/spec/domain/service/StaffRoleHierarchy.js +19 -0
  465. package/dist/spec/domain/service/StaffRoleHierarchy.js.map +1 -0
  466. package/dist/spec/domain/service/TriggerGraphChecks.d.ts +16 -0
  467. package/dist/spec/domain/service/TriggerGraphChecks.d.ts.map +1 -0
  468. package/dist/spec/domain/service/TriggerGraphChecks.js +337 -0
  469. package/dist/spec/domain/service/TriggerGraphChecks.js.map +1 -0
  470. package/dist/spec/domain/service/TriggerSpecChecks.d.ts +4 -0
  471. package/dist/spec/domain/service/TriggerSpecChecks.d.ts.map +1 -0
  472. package/dist/spec/domain/service/TriggerSpecChecks.js +89 -0
  473. package/dist/spec/domain/service/TriggerSpecChecks.js.map +1 -0
  474. package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts +11 -0
  475. package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts.map +1 -0
  476. package/dist/spec/domain/service/ValidatedAdminUiProjection.js +26 -0
  477. package/dist/spec/domain/service/ValidatedAdminUiProjection.js.map +1 -0
  478. package/dist/spec/domain/service/ViewAdminUiChecker.d.ts +14 -0
  479. package/dist/spec/domain/service/ViewAdminUiChecker.d.ts.map +1 -0
  480. package/dist/spec/domain/service/ViewAdminUiChecker.js +53 -0
  481. package/dist/spec/domain/service/ViewAdminUiChecker.js.map +1 -0
  482. package/dist/spec/domain/service/index.d.ts +24 -0
  483. package/dist/spec/domain/service/index.d.ts.map +1 -0
  484. package/dist/spec/domain/service/index.js +24 -0
  485. package/dist/spec/domain/service/index.js.map +1 -0
  486. package/dist/spec/index.d.ts +10 -0
  487. package/dist/spec/index.d.ts.map +1 -0
  488. package/dist/spec/index.js +12 -0
  489. package/dist/spec/index.js.map +1 -0
  490. package/dist/spec/infrastructure/cli/parseArgsError.d.ts +16 -0
  491. package/dist/spec/infrastructure/cli/parseArgsError.d.ts.map +1 -0
  492. package/dist/spec/infrastructure/cli/parseArgsError.js +34 -0
  493. package/dist/spec/infrastructure/cli/parseArgsError.js.map +1 -0
  494. package/dist/spec/infrastructure/index.d.ts +2 -0
  495. package/dist/spec/infrastructure/index.d.ts.map +1 -0
  496. package/dist/spec/infrastructure/index.js +2 -0
  497. package/dist/spec/infrastructure/index.js.map +1 -0
  498. package/dist/spec/infrastructure/sql/PgQueryParser.d.ts +18 -0
  499. package/dist/spec/infrastructure/sql/PgQueryParser.d.ts.map +1 -0
  500. package/dist/spec/infrastructure/sql/PgQueryParser.js +17 -0
  501. package/dist/spec/infrastructure/sql/PgQueryParser.js.map +1 -0
  502. package/dist/spec/infrastructure/sql/compilePlan.d.ts +37 -0
  503. package/dist/spec/infrastructure/sql/compilePlan.d.ts.map +1 -0
  504. package/dist/spec/infrastructure/sql/compilePlan.js +282 -0
  505. package/dist/spec/infrastructure/sql/compilePlan.js.map +1 -0
  506. package/dist/spec/infrastructure/sql/compileSql.d.ts +35 -0
  507. package/dist/spec/infrastructure/sql/compileSql.d.ts.map +1 -0
  508. package/dist/spec/infrastructure/sql/compileSql.js +92 -0
  509. package/dist/spec/infrastructure/sql/compileSql.js.map +1 -0
  510. package/dist/spec/infrastructure/sql/frontEnd.d.ts +8 -0
  511. package/dist/spec/infrastructure/sql/frontEnd.d.ts.map +1 -0
  512. package/dist/spec/infrastructure/sql/frontEnd.js +100 -0
  513. package/dist/spec/infrastructure/sql/frontEnd.js.map +1 -0
  514. package/dist/spec/infrastructure/sql/index.d.ts +4 -0
  515. package/dist/spec/infrastructure/sql/index.d.ts.map +1 -0
  516. package/dist/spec/infrastructure/sql/index.js +4 -0
  517. package/dist/spec/infrastructure/sql/index.js.map +1 -0
  518. package/dist/spec/kernel/diagnostic.d.ts +137 -0
  519. package/dist/spec/kernel/diagnostic.d.ts.map +1 -0
  520. package/dist/spec/kernel/diagnostic.js +296 -0
  521. package/dist/spec/kernel/diagnostic.js.map +1 -0
  522. package/dist/spec/kernel/index.d.ts +8 -0
  523. package/dist/spec/kernel/index.d.ts.map +1 -0
  524. package/dist/spec/kernel/index.js +8 -0
  525. package/dist/spec/kernel/index.js.map +1 -0
  526. package/dist/spec/usecase/EmitTypes.d.ts +22 -0
  527. package/dist/spec/usecase/EmitTypes.d.ts.map +1 -0
  528. package/dist/spec/usecase/EmitTypes.js +182 -0
  529. package/dist/spec/usecase/EmitTypes.js.map +1 -0
  530. package/dist/spec/usecase/ValidateManifestsUseCase.d.ts +8 -0
  531. package/dist/spec/usecase/ValidateManifestsUseCase.d.ts.map +1 -0
  532. package/dist/spec/usecase/ValidateManifestsUseCase.js +101 -0
  533. package/dist/spec/usecase/ValidateManifestsUseCase.js.map +1 -0
  534. package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts +27 -0
  535. package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts.map +1 -0
  536. package/dist/spec/usecase/dto/ValidateManifestsRequest.js +2 -0
  537. package/dist/spec/usecase/dto/ValidateManifestsRequest.js.map +1 -0
  538. package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts +14 -0
  539. package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts.map +1 -0
  540. package/dist/spec/usecase/dto/ValidateManifestsResponse.js +2 -0
  541. package/dist/spec/usecase/dto/ValidateManifestsResponse.js.map +1 -0
  542. package/dist/spec/usecase/dto/index.d.ts +3 -0
  543. package/dist/spec/usecase/dto/index.d.ts.map +1 -0
  544. package/dist/spec/usecase/dto/index.js +3 -0
  545. package/dist/spec/usecase/dto/index.js.map +1 -0
  546. package/dist/spec/usecase/index.d.ts +10 -0
  547. package/dist/spec/usecase/index.d.ts.map +1 -0
  548. package/dist/spec/usecase/index.js +10 -0
  549. package/dist/spec/usecase/index.js.map +1 -0
  550. package/dist/testing/cases/before-hook.d.ts +4 -0
  551. package/dist/testing/cases/before-hook.d.ts.map +1 -0
  552. package/dist/testing/cases/before-hook.js +71 -0
  553. package/dist/testing/cases/before-hook.js.map +1 -0
  554. package/dist/testing/cases/corpus.d.ts +12 -0
  555. package/dist/testing/cases/corpus.d.ts.map +1 -0
  556. package/dist/testing/cases/corpus.js +91 -0
  557. package/dist/testing/cases/corpus.js.map +1 -0
  558. package/dist/testing/cases/policy.d.ts +74 -0
  559. package/dist/testing/cases/policy.d.ts.map +1 -0
  560. package/dist/testing/cases/policy.js +142 -0
  561. package/dist/testing/cases/policy.js.map +1 -0
  562. package/dist/testing/cases/printer.d.ts +4 -0
  563. package/dist/testing/cases/printer.d.ts.map +1 -0
  564. package/dist/testing/cases/printer.js +32 -0
  565. package/dist/testing/cases/printer.js.map +1 -0
  566. package/dist/testing/cases/report-view.d.ts +5 -0
  567. package/dist/testing/cases/report-view.d.ts.map +1 -0
  568. package/dist/testing/cases/report-view.js +33 -0
  569. package/dist/testing/cases/report-view.js.map +1 -0
  570. package/dist/testing/cases/requisition.d.ts +4 -0
  571. package/dist/testing/cases/requisition.d.ts.map +1 -0
  572. package/dist/testing/cases/requisition.js +38 -0
  573. package/dist/testing/cases/requisition.js.map +1 -0
  574. package/dist/testing/cases/search-places.d.ts +4 -0
  575. package/dist/testing/cases/search-places.d.ts.map +1 -0
  576. package/dist/testing/cases/search-places.js +60 -0
  577. package/dist/testing/cases/search-places.js.map +1 -0
  578. package/dist/testing/cases/stock.d.ts +4 -0
  579. package/dist/testing/cases/stock.d.ts.map +1 -0
  580. package/dist/testing/cases/stock.js +35 -0
  581. package/dist/testing/cases/stock.js.map +1 -0
  582. package/dist/testing/cases/store.d.ts +4 -0
  583. package/dist/testing/cases/store.d.ts.map +1 -0
  584. package/dist/testing/cases/store.js +100 -0
  585. package/dist/testing/cases/store.js.map +1 -0
  586. package/dist/testing/harness.d.ts +94 -0
  587. package/dist/testing/harness.d.ts.map +1 -0
  588. package/dist/testing/harness.js +168 -0
  589. package/dist/testing/harness.js.map +1 -0
  590. package/dist/testing/index.d.ts +37 -0
  591. package/dist/testing/index.d.ts.map +1 -0
  592. package/dist/testing/index.js +43 -0
  593. package/dist/testing/index.js.map +1 -0
  594. package/dist/testing/report.d.ts +15 -0
  595. package/dist/testing/report.d.ts.map +1 -0
  596. package/dist/testing/report.js +22 -0
  597. package/dist/testing/report.js.map +1 -0
  598. package/dist/web/createRestSurface.d.ts +7 -0
  599. package/dist/web/createRestSurface.d.ts.map +1 -0
  600. package/dist/web/createRestSurface.js +39 -0
  601. package/dist/web/createRestSurface.js.map +1 -0
  602. package/dist/web/index.d.ts +2 -0
  603. package/dist/web/index.d.ts.map +1 -0
  604. package/dist/web/index.js +2 -0
  605. package/dist/web/index.js.map +1 -0
  606. package/docs/adr/0008-structured-diagnostic-shape.md +2 -2
  607. package/docs/adr/0011-adapter-port-spec.md +2 -2
  608. package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +21 -2
  609. package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +5 -1
  610. package/docs/adr/0022-caller-observed-version-occ.md +1 -1
  611. package/docs/adr/0024-manifest-native-schema-tables.md +2 -2
  612. package/docs/adr/0027-scheduled-procedure-triggers.md +1 -1
  613. package/docs/adr/0028-schema-ttl-expiry.md +3 -3
  614. package/docs/adr/0029-mcp-apps-interaction-contracts.md +324 -0
  615. package/docs/adr/0030-store.md +40 -0
  616. package/docs/adr/0031-host-cloud-core-contract.md +25 -0
  617. package/docs/adr/0032-store-centric-core-and-service-contract.md +361 -0
  618. package/docs/adr/0033-storage-converges-to-the-plan.md +92 -0
  619. package/docs/adr/0034-store-is-authored-as-sql.md +192 -0
  620. package/docs/adr/0035-sql-dialects.md +154 -0
  621. package/docs/adr/0036-host-and-dialect.md +65 -0
  622. package/docs/adr/0037-postgresql-is-the-reference-dialect.md +124 -0
  623. package/docs/adr/0038-bun-native-host.md +63 -0
  624. package/docs/adr/README.md +23 -8
  625. package/docs/adr/adr-lite-861-admin-webmcp.md +6 -0
  626. package/docs/adr/adr-lite-909-admin-ui-kit.md +1 -1
  627. package/docs/examples/README.md +16 -18
  628. package/docs/examples/commerce-inventory.md +481 -0
  629. package/docs/examples/commerce.md +254 -0
  630. package/docs/examples/guarded-api.md +238 -0
  631. package/docs/examples/intake-hooks.md +237 -0
  632. package/docs/examples/intake.md +127 -0
  633. package/docs/examples/legal-documents.md +218 -0
  634. package/docs/examples/procurement.md +215 -0
  635. package/docs/examples/publication.md +211 -0
  636. package/docs/examples/reference-service/.dev.vars.example +4 -0
  637. package/docs/examples/reference-service/.mantle/generated/mantle.ts +174 -0
  638. package/docs/examples/reference-service/.mantle/generated/plan.json +1936 -0
  639. package/docs/examples/reference-service/README.md +33 -0
  640. package/docs/examples/reference-service/manifests/catalog.yaml +103 -0
  641. package/docs/examples/reference-service/manifests/orders.yaml +120 -0
  642. package/docs/examples/reference-service/mantle.config.json +1 -0
  643. package/docs/examples/reference-service/package.json +27 -0
  644. package/docs/examples/reference-service/smoke.mjs +156 -0
  645. package/docs/examples/reference-service/src/handlers.ts +36 -0
  646. package/docs/examples/reference-service/src/index.ts +33 -0
  647. package/docs/examples/reference-service/src/service.ts +78 -0
  648. package/docs/examples/{host-minimal-worker → reference-service}/tsconfig.json +7 -2
  649. package/docs/examples/reference-service/wrangler.jsonc +26 -0
  650. package/docs/examples/reservation.md +142 -0
  651. package/docs/handbook/cloudflare/authentication.md +96 -316
  652. package/docs/handbook/cloudflare/chatgpt-sites.md +104 -15
  653. package/docs/handbook/cloudflare/deploy-and-operate.md +77 -71
  654. package/docs/handbook/cloudflare/media-r2.md +64 -187
  655. package/docs/handbook/cloudflare/service-entry.md +138 -0
  656. package/docs/handbook/concepts/authorization.md +104 -94
  657. package/docs/handbook/concepts/four-atoms.md +68 -144
  658. package/docs/handbook/concepts/lifecycle-and-locales.md +62 -114
  659. package/docs/handbook/concepts/mcp-and-agents.md +112 -117
  660. package/docs/handbook/concepts/procedures-and-triggers.md +126 -181
  661. package/docs/handbook/concepts/runtime-and-adapters.md +177 -163
  662. package/docs/handbook/concepts/views.md +97 -173
  663. package/docs/handbook/examples/hub.md +17 -6
  664. package/docs/handbook/guides/admin-ui.md +101 -96
  665. package/docs/handbook/guides/agent-setup.md +56 -71
  666. package/docs/handbook/guides/typed-queries.md +105 -111
  667. package/docs/handbook/navigation.json +8 -33
  668. package/docs/handbook/reference/authorization.md +52 -271
  669. package/docs/handbook/reference/diagnostics.md +69 -178
  670. package/docs/handbook/reference/features.md +48 -50
  671. package/docs/handbook/reference/manifest.md +56 -116
  672. package/docs/handbook/reference/procedure.md +91 -279
  673. package/docs/handbook/reference/schema.md +154 -239
  674. package/docs/handbook/reference/site-config.md +58 -211
  675. package/docs/handbook/reference/surface.md +69 -181
  676. package/docs/handbook/reference/trigger.md +72 -181
  677. package/docs/handbook/reference/view.md +140 -241
  678. package/docs/handbook/releases/index.md +58 -77
  679. package/docs/handbook/start/overview.md +59 -51
  680. package/docs/handbook/start/project-and-cli.md +132 -105
  681. package/docs/handbook/start/quickstart-worker.md +102 -160
  682. package/docs/skills/develop/SKILL.md +114 -240
  683. package/docs/skills/develop/mcp-app.md +79 -0
  684. package/docs/skills/integrate/SKILL.md +83 -47
  685. package/docs/skills/media-gc/SKILL.md +21 -10
  686. package/docs/skills/provision/SKILL.md +68 -162
  687. package/docs/skills/update/SKILL.md +33 -34
  688. package/docs/upgrade-0.1-to-0.2.md +211 -0
  689. package/package.json +87 -106
  690. package/dist/admin-ui.d.ts +0 -2
  691. package/dist/admin-ui.d.ts.map +0 -1
  692. package/dist/admin-ui.js +0 -2
  693. package/dist/admin-ui.js.map +0 -1
  694. package/dist/admin.d.ts +0 -2
  695. package/dist/admin.d.ts.map +0 -1
  696. package/dist/admin.js +0 -2
  697. package/dist/admin.js.map +0 -1
  698. package/dist/auth.d.ts +0 -2
  699. package/dist/auth.d.ts.map +0 -1
  700. package/dist/auth.js +0 -2
  701. package/dist/auth.js.map +0 -1
  702. package/dist/bun.d.ts +0 -2
  703. package/dist/bun.d.ts.map +0 -1
  704. package/dist/bun.js +0 -2
  705. package/dist/bun.js.map +0 -1
  706. package/dist/cli/generate-cloudflare.d.ts +0 -7
  707. package/dist/cli/generate-cloudflare.d.ts.map +0 -1
  708. package/dist/cli/generate-cloudflare.js +0 -123
  709. package/dist/cli/generate-cloudflare.js.map +0 -1
  710. package/dist/cli/generate-project.d.ts +0 -25
  711. package/dist/cli/generate-project.d.ts.map +0 -1
  712. package/dist/cli/generate-project.js +0 -282
  713. package/dist/cli/generate-project.js.map +0 -1
  714. package/dist/cli/generate-sites.d.ts +0 -8
  715. package/dist/cli/generate-sites.d.ts.map +0 -1
  716. package/dist/cli/generate-sites.js +0 -273
  717. package/dist/cli/generate-sites.js.map +0 -1
  718. package/dist/cli/harness.d.ts +0 -3
  719. package/dist/cli/harness.d.ts.map +0 -1
  720. package/dist/cli/harness.js +0 -214
  721. package/dist/cli/harness.js.map +0 -1
  722. package/dist/cli/skills.d.ts +0 -3
  723. package/dist/cli/skills.d.ts.map +0 -1
  724. package/dist/cli/skills.js +0 -128
  725. package/dist/cli/skills.js.map +0 -1
  726. package/dist/cloudflare.d.ts +0 -2
  727. package/dist/cloudflare.d.ts.map +0 -1
  728. package/dist/cloudflare.js +0 -2
  729. package/dist/cloudflare.js.map +0 -1
  730. package/dist/codegen/emitMantleModule.d.ts +0 -22
  731. package/dist/codegen/emitMantleModule.d.ts.map +0 -1
  732. package/dist/codegen/emitMantleModule.js +0 -291
  733. package/dist/codegen/emitMantleModule.js.map +0 -1
  734. package/dist/codegen.d.ts +0 -2
  735. package/dist/codegen.d.ts.map +0 -1
  736. package/dist/codegen.js +0 -2
  737. package/dist/codegen.js.map +0 -1
  738. package/dist/runtime-testing.d.ts +0 -2
  739. package/dist/runtime-testing.d.ts.map +0 -1
  740. package/dist/runtime-testing.js +0 -2
  741. package/dist/runtime-testing.js.map +0 -1
  742. package/dist/runtime.d.ts +0 -2
  743. package/dist/runtime.d.ts.map +0 -1
  744. package/dist/runtime.js +0 -2
  745. package/dist/runtime.js.map +0 -1
  746. package/dist/spec.d.ts +0 -2
  747. package/dist/spec.d.ts.map +0 -1
  748. package/dist/spec.js +0 -2
  749. package/dist/spec.js.map +0 -1
  750. package/dist/vercel-libsql.d.ts +0 -2
  751. package/dist/vercel-libsql.d.ts.map +0 -1
  752. package/dist/vercel-libsql.js +0 -2
  753. package/dist/vercel-libsql.js.map +0 -1
  754. package/dist/vercel.d.ts +0 -2
  755. package/dist/vercel.d.ts.map +0 -1
  756. package/dist/vercel.js +0 -2
  757. package/dist/vercel.js.map +0 -1
  758. package/dist/web.d.ts +0 -2
  759. package/dist/web.d.ts.map +0 -1
  760. package/dist/web.js +0 -2
  761. package/dist/web.js.map +0 -1
  762. package/docs/adapter-guide.md +0 -222
  763. package/docs/agent-prompts.md +0 -64
  764. package/docs/api-mcp-authorization.md +0 -5
  765. package/docs/assets/mantle-admin-developer.png +0 -0
  766. package/docs/assets/mantle-admin-operations.png +0 -0
  767. package/docs/assets/mantle-hero.jpg +0 -0
  768. package/docs/auth-hosting-model.md +0 -166
  769. package/docs/cloudflare-low-level-composition.md +0 -5
  770. package/docs/consumer-onboarding-audit.md +0 -65
  771. package/docs/deferred-lifecycle-queues.md +0 -5
  772. package/docs/design-atoms.md +0 -16
  773. package/docs/design-references/editorial-blog-2026-05-05.md +0 -218
  774. package/docs/direct-authoring.md +0 -5
  775. package/docs/examples/builtin-commerce.md +0 -269
  776. package/docs/examples/builtin-intake.md +0 -143
  777. package/docs/examples/builtin-legal-documents.md +0 -189
  778. package/docs/examples/builtin-procurement.md +0 -241
  779. package/docs/examples/builtin-publication.md +0 -241
  780. package/docs/examples/builtin-reservation.md +0 -149
  781. package/docs/examples/cf-primitives-commerce-inventory.md +0 -809
  782. package/docs/examples/cf-primitives-guarded-api.md +0 -429
  783. package/docs/examples/cf-primitives-intake-hooks.md +0 -319
  784. package/docs/examples/host-chatgpt-sites/.openai/hosting.json +0 -1
  785. package/docs/examples/host-chatgpt-sites/README.md +0 -70
  786. package/docs/examples/host-chatgpt-sites/drizzle/0000_sites_users.sql +0 -8
  787. package/docs/examples/host-chatgpt-sites/drizzle/0001_mantle.sql +0 -294
  788. package/docs/examples/host-chatgpt-sites/drizzle/0002_article_cover.sql +0 -5
  789. package/docs/examples/host-chatgpt-sites/drizzle/0003_store_instance_id.sql +0 -1
  790. package/docs/examples/host-chatgpt-sites/drizzle/0004_mantle.sql +0 -10
  791. package/docs/examples/host-chatgpt-sites/drizzle/0005_mantle.sql +0 -24
  792. package/docs/examples/host-chatgpt-sites/drizzle/meta/_journal.json +0 -1
  793. package/docs/examples/host-chatgpt-sites/drizzle/meta/mantle-state.json +0 -60
  794. package/docs/examples/host-chatgpt-sites/manifests/site.yaml +0 -27
  795. package/docs/examples/host-chatgpt-sites/package.json +0 -1
  796. package/docs/examples/host-chatgpt-sites/public/site.css +0 -1
  797. package/docs/examples/host-chatgpt-sites/scripts/build.mjs +0 -13
  798. package/docs/examples/host-chatgpt-sites/scripts/check.mjs +0 -101
  799. package/docs/examples/host-chatgpt-sites/scripts/migration.mjs +0 -43
  800. package/docs/examples/host-chatgpt-sites/src/chatgpt-auth.ts +0 -66
  801. package/docs/examples/host-chatgpt-sites/src/index.ts +0 -46
  802. package/docs/examples/host-chatgpt-sites/src/mcp.ts +0 -49
  803. package/docs/examples/host-chatgpt-sites/src/media.ts +0 -109
  804. package/docs/examples/host-chatgpt-sites/src/r2-lab.ts +0 -38
  805. package/docs/examples/host-chatgpt-sites/src/storage-fingerprint.json +0 -1
  806. package/docs/examples/host-chatgpt-sites/src/web.ts +0 -35
  807. package/docs/examples/host-chatgpt-sites/tsconfig.json +0 -1
  808. package/docs/examples/host-chatgpt-sites/wrangler.jsonc +0 -10
  809. package/docs/examples/host-local-admin-otp/.dev.vars.example +0 -3
  810. package/docs/examples/host-local-admin-otp/README.md +0 -80
  811. package/docs/examples/host-local-admin-otp/ensure-dev-vars.mjs +0 -5
  812. package/docs/examples/host-local-admin-otp/manifests/site.yaml +0 -25
  813. package/docs/examples/host-local-admin-otp/package.json +0 -29
  814. package/docs/examples/host-local-admin-otp/public/.gitkeep +0 -1
  815. package/docs/examples/host-local-admin-otp/smoke.mjs +0 -141
  816. package/docs/examples/host-local-admin-otp/src/index.ts +0 -54
  817. package/docs/examples/host-local-admin-otp/tsconfig.json +0 -17
  818. package/docs/examples/host-local-admin-otp/wrangler.jsonc +0 -23
  819. package/docs/examples/host-minimal-worker/README.md +0 -41
  820. package/docs/examples/host-minimal-worker/manifests/site.yaml +0 -25
  821. package/docs/examples/host-minimal-worker/package.json +0 -26
  822. package/docs/examples/host-minimal-worker/smoke.mjs +0 -23
  823. package/docs/examples/host-minimal-worker/src/index.ts +0 -4
  824. package/docs/examples/host-minimal-worker/wrangler.jsonc +0 -22
  825. package/docs/handbook/chatgpt-sites/equipment-checkout.md +0 -231
  826. package/docs/handbook/chatgpt-sites/generated-app.md +0 -84
  827. package/docs/handbook/chatgpt-sites/host-reference.md +0 -113
  828. package/docs/handbook/chatgpt-sites/index.md +0 -133
  829. package/docs/handbook/cloudflare/bindings.md +0 -291
  830. package/docs/handbook/cloudflare/conventional-worker.md +0 -166
  831. package/docs/handbook/cloudflare/deferred-hooks-queues.md +0 -170
  832. package/docs/handbook/cloudflare/low-level-composition.md +0 -169
  833. package/docs/handbook/cloudflare/public-web.md +0 -144
  834. package/docs/handbook/cloudflare/site-chrome.md +0 -75
  835. package/docs/handbook/examples/commerce-transaction.md +0 -11
  836. package/docs/handbook/examples/commerce.md +0 -11
  837. package/docs/handbook/examples/guarded-api.md +0 -10
  838. package/docs/handbook/examples/intake-form.md +0 -12
  839. package/docs/handbook/examples/intake-hooks.md +0 -11
  840. package/docs/handbook/examples/legal-documents.md +0 -10
  841. package/docs/handbook/examples/procurement-approvals.md +0 -10
  842. package/docs/handbook/examples/publication.md +0 -10
  843. package/docs/handbook/examples/reservation.md +0 -10
  844. package/docs/handbook/start/quickstart-admin.md +0 -52
  845. package/docs/labels.md +0 -71
  846. package/docs/media-uploads.md +0 -5
  847. package/docs/migration-0.1.2.md +0 -13
  848. package/docs/performance-harness.md +0 -228
  849. package/docs/release-process.md +0 -244
  850. package/docs/schema-indexes.md +0 -5
  851. package/docs/sealed-pipeline-ownership.md +0 -101
  852. package/docs/skills/plugin/SKILL.md +0 -132
  853. package/docs/skills/theme/SKILL.md +0 -77
  854. package/docs/spec-only-host-adoption.md +0 -157
  855. package/docs/transaction-patterns.md +0 -5
  856. package/skills/README.md +0 -127
  857. package/skills/develop/SKILL.md +0 -258
  858. package/skills/install/SKILL.md +0 -112
  859. package/skills/integrate/SKILL.md +0 -60
  860. package/skills/media-gc/SKILL.md +0 -85
  861. package/skills/plugin/SKILL.md +0 -132
  862. package/skills/provision/SKILL.md +0 -194
  863. package/skills/theme/SKILL.md +0 -77
  864. package/skills/update/SKILL.md +0 -51
  865. package/templates/chatgpt-sites/auth.ts +0 -66
  866. package/templates/chatgpt-sites/build.mjs +0 -14
  867. package/templates/chatgpt-sites/env.ts +0 -1
  868. package/templates/chatgpt-sites/mcp.ts +0 -48
  869. package/templates/chatgpt-sites/public-mcp.ts +0 -29
  870. package/templates/chatgpt-sites/smoke-local.mjs +0 -20
@@ -1,222 +0,0 @@
1
- # Adapter implementation guide
2
-
3
- This guide is the fresh-developer entry point for implementing a new mantle platform adapter.
4
-
5
- Read this with [ADR-0019](adr/0019-sealed-manifest-runtime-pipeline.md). The source of truth for TypeScript shapes is `packages/mantle-runtime/src/domain/port/`.
6
-
7
- Adapter packages live under `packages/adapters/<platform>/` using a plural `adapters` bucket. The npm package names stay unchanged, for example `@aotter/mantle-cloudflare`. Keep adapters in this monorepo until the runtime/spec API is stable enough that coordinated releases across separate repositories would not create version skew for consumers.
8
-
9
- ## Required storage boundary
10
-
11
- A storage adapter prepares one `RuntimePlan` into semantic ports:
12
-
13
- | Contract | Source | Cloudflare example |
14
- |---|---|---|
15
- | `MantleStorageAdapter` / `PreparedMantleStorage` | `packages/mantle-runtime/src/domain/port/MantleStorageAdapter.ts` | `SqliteMantleStorageAdapter` over `D1DatabaseDriver` |
16
- | `EntryRepository & EntryReader` | Existing semantic content ports | `DatabaseEntryRepository` supplied by the SQLite adapter |
17
- | `ViewQueryExecutor` | `packages/mantle-runtime/src/domain/port/ViewQueryExecutor.ts` | `SqliteViewQueryExecutor` |
18
-
19
- `DatabaseDriver` is only the reusable SQLite/D1 implementation seam. A
20
- PostgreSQL, MongoDB, or application-owned-table adapter implements the semantic
21
- ports directly; it does not emulate D1 and needs no mapping DSL. Platform types
22
- such as `D1Database`, Postgres pools, and Mongo clients remain in adapter code.
23
-
24
- ## Optional capabilities
25
-
26
- Optional ports are enabled only when a feature needs them:
27
-
28
- | Contract | Source | Required when |
29
- |---|---|---|
30
- | `MediaStorage` | `packages/mantle-runtime/src/domain/port/MediaStorage.ts` | The adapter exposes admin/MCP media upload flows. |
31
- | `DeferredHookDispatcher` | `packages/mantle-runtime/src/domain/port/DeferredHookDispatcher.ts` | The adapter wants at-least-once queue delivery for `after_*` lifecycle hooks. |
32
-
33
- Test seams such as `Clock` and `IdGenerator` are injectable through `createMantleRuntime`, but normal adapters do not need custom implementations.
34
-
35
- Deferred delivery is an optional, versioned wire contract. Queue acceptance is
36
- not atomic with the entry write; adapters must preserve the supplied event id,
37
- validate untrusted messages before dereferencing them, surface handler failures
38
- to their retry mechanism, and document poison-message/DLQ behavior. See
39
- [Deferred lifecycle hooks on Cloudflare Queues](deferred-lifecycle-queues.md)
40
- for the reference implementation and exact guarantees.
41
-
42
- ## Storage preparation
43
-
44
- Compile before deployment preparation, then pass only the sealed plan:
45
-
46
- ```ts
47
- import {
48
- bootMantleRuntime,
49
- SqliteMantleStorageAdapter,
50
- } from "@aotter/mantle-runtime";
51
-
52
- const storage = new SqliteMantleStorageAdapter(db, siteDefaults);
53
- const runtime = await bootMantleRuntime({
54
- plan,
55
- storage,
56
- handlers,
57
- ports,
58
- deployment: {
59
- reservedHttpPathPrefixes: selectedCapabilities.flatMap(
60
- (capability) => capability.reservedHttpPathPrefixes,
61
- ),
62
- },
63
- });
64
- ```
65
-
66
- `bootMantleRuntime` performs one attempt and derives Procedure readiness from
67
- the supplied handlers. The platform adapter remains responsible for lazy boot,
68
- promise caching, retry policy, and teardown.
69
-
70
- Hosts that need work between preparation and binding may keep the same stages
71
- public and explicit:
72
-
73
- ```ts
74
- const prepared = await prepareDeployment(plan, storage, {
75
- handlerNames: Object.keys(handlers ?? {}),
76
- });
77
- const runtime = createMantleRuntime({ prepared, handlers, ports });
78
- ```
79
-
80
- The prepared revision carries its exact plan, but exposes both `plan` and
81
- `storage`; it seals the pairing invariant rather than hiding low-level host
82
- capabilities. Omit `handlerNames` only for a read-only embedding that never
83
- dispatches Procedures.
84
-
85
- The official SQLite adapter runs canonical migrations, materializes one native
86
- table per Schema, prepares indexes and Views, and skips mutation for an
87
- unchanged storage revision. A
88
- custom adapter owns its own preparation and returns application-owned semantic
89
- ports. Unsupported native View dialects fail before the adapter mutates state.
90
-
91
- ### Bun embedding
92
-
93
- > **Experimental.** The Bun and Vercel adapters may change in a minor
94
- > release. They cover public Views and HTTP Triggers; the host owns
95
- > authentication and CSRF, and Auth, Admin and MCP are Cloudflare-only today.
96
- > Cloudflare is the supported host.
97
-
98
- `@aotter/mantle-bun` is the minimal SQLite reference: pass an application-owned
99
- `bun:sqlite` `Database` and a compiled `RuntimePlan` to `createBunMantle()`.
100
- Its `handle()` returns `null` for sibling routes and a Web-standard `Response`
101
- for manifest-declared public Views and HTTP Triggers. The host owns
102
- `Bun.serve`, database shutdown, authentication, and CSRF policy; the adapter
103
- prepares the semantic revision once and retries only after failed preparation.
104
-
105
- ### Vercel Functions embedding
106
-
107
- `@aotter/mantle-vercel` accepts a compiled plan plus any application-owned
108
- `MantleStorageAdapter` and reuses the same public View/HTTP Trigger transport as
109
- Bun. It maps deferred work to Vercel Functions `waitUntil` and otherwise leaves
110
- the Web Handler, auth/CSRF, and route composition to the application. The
111
- optional `/libsql` subpath adapts a caller-owned remote Turso/libSQL client to
112
- the canonical SQLite chain; the default entry has no database-vendor policy.
113
- Vercel's read-only filesystem and writable `/tmp` are never durable state.
114
-
115
- ### Browser IndexedDB embedding
116
-
117
- `@aotter/mantle-indexeddb` implements the same required semantic storage ports
118
- over one application-owned IndexedDB database. It keeps browser globals out of
119
- Runtime Core, supports declarative Views with a documented O(n) collection
120
- scan, and exposes `deleteDatabase()` only on the concrete adapter. The host owns
121
- database naming, `navigator.storage` persistence requests, active-runtime
122
- selection, UI invalidation, and any remote synchronization.
123
-
124
- ## HTTP and MCP surfaces
125
-
126
- The runtime is a library, not an HTTP server. A new adapter must mount equivalent framework routes:
127
-
128
- | Surface | Adapter responsibility | Cloudflare reference |
129
- |---|---|---|
130
- | Runtime HTTP endpoints | Route HTTP Triggers and public View REST endpoints into runtime use cases. | `packages/adapters/cloudflare/src/mount/mountRuntimeEndpoints.ts` |
131
- | Optional Admin | Supply session/request context and assets to `mantle-admin`; mount only when selected. | `packages/adapters/cloudflare/src/mount/mountAdmin.ts` |
132
- | Auth endpoints | Own sign-in/session/OAuth metadata through the adapter's Better Auth implementation selected by Admin/OAuth surfaces. | `packages/adapters/cloudflare/src/auth/createAuth.ts` |
133
- | MCP endpoints | Mount `/mcp/staff` and `/mcp` behind one canonical protected resource. The adapter verifies Better Auth JWTs, normalizes the caller, re-reads the staff D1 role, then dispatches JSON-RPC. | `packages/adapters/cloudflare/src/mount/mountMcp.ts`, `auth/createAuth.ts` |
134
-
135
- Auth is not a runtime port. Per [ADR-0014](adr/0014-auth-better-auth-and-multi-tenant-mcp.md), the adapter owns Better Auth wiring and passes authenticated user/staff context into runtime dispatchers. Procedure handlers receive that data through `HandlerContext` in `packages/mantle-runtime/src/domain/model/HandlerContext.ts`.
136
-
137
- The adapter must also normalize verified credential metadata into
138
- `HandlerContext.auth` (`credential`, opaque `credentialId`, optional
139
- `clientId`, scopes). Platform-native session/OAuth verification stays in the
140
- adapter. A narrow adapter extension seam may let consumer code verify its own
141
- API-key or personal-token formats, but credential storage/issuance must not
142
- become a runtime port. The Cloudflare reference is
143
- `mount/resolveCaller.ts`; consumer usage is documented in
144
- [API and MCP authorization](examples/cf-primitives-guarded-api.md).
145
-
146
- Minimum HTTP behavior for a full adapter:
147
-
148
- - Route manifest HTTP Triggers to `runtime.invokeProcedure`.
149
- - Route `GET /api/views/<name>` to `runtime.executeView`.
150
- - Mount admin content APIs with session/role checks before calling runtime content use cases.
151
- - Serve selected Admin SPA assets through `AdminAssetServer`, with an SPA catchall for client-side routes.
152
- - Mount public render routes and markdown mirrors when the application exposes public pages.
153
- - Translate runtime diagnostics and validation failures into stable HTTP JSON responses instead of throwing raw errors.
154
- - Evaluate target auth and dynamic guards through the runtime use cases; do
155
- not duplicate guard logic in HTTP handlers.
156
-
157
- For the Cloudflare adapter, public rendering requires three matching consumer
158
- inputs: `mountPublicRoutes(...)` route declarations, a `TemplateRegistry`
159
- passed through `MantleCloudflareConfig.templates`, and a `publicPathResolver`
160
- passed through `MantleCloudflareConfig.publicPathResolver`. Omitting public routes is valid for a headless
161
- consumer; mounting every Schema automatically is not, because some collections
162
- are private even when they contain a slug.
163
-
164
- `TemplateRegistry` and `createPublicPathResolver` come from
165
- `@aotter/mantle-web`. Other adapters can call `createMantleWeb(runtime)` and map
166
- its document operations into their own routing and cache conventions.
167
-
168
- ### HTTP cache contract
169
-
170
- Keep responses private by default. For Cloudflare, apply the final policy after
171
- all routes and preserve only explicit anonymous public opt-in. Follow the
172
- [public cache contract](handbook/cloudflare/public-web.md#cache-contract) and the
173
- [performance harness](performance-harness.md#cache-contract) for verification.
174
-
175
- Minimum auth/MCP behavior:
176
-
177
- - Provide Better Auth-compatible sign-in/session routes for the platform.
178
- - Validate `/mcp/staff` requests with the staff D1 admin role (`owner`/`editor`/`contributor`).
179
- - Validate `/mcp` requests with any authenticated session (D1 role check is surface-driven, not OAuth-scope-driven — claude.ai rejects colon-shaped scopes).
180
- - Advertise a single non-colon scope (default `["mcp"]`) in `scopes_supported`. Per-surface enforcement happens server-side in the apiHandler.
181
- - Build `McpAuthContext` from the validated session and pass it to `McpJsonRpcDispatcher`.
182
- - Build Procedure/View `HandlerContext` with `user`, live `staff`, normalized
183
- `auth`, adapter `env`, and optional `waitUntil`.
184
- - Re-read mutable staff role for each protected REST/MCP invocation. Token or
185
- consent-time role snapshots are not an authorization boundary.
186
- - Keep `tools/list` filtering as UX only; route every `tools/call` through the
187
- same auth evaluator and guard runner used by REST.
188
-
189
- ## Static assets
190
-
191
- `AdminAssetServer` belongs to optional `@aotter/mantle-admin`. Headless Core
192
- storage preparation and binding do not accept or require a static asset port.
193
-
194
- ## Implementation checklist
195
-
196
- - [ ] Run `runStorageConformance` from `@aotter/mantle-runtime/testing/storage`
197
- against a disposable prepared-storage factory. See the
198
- [Runtime conformance guide](../packages/mantle-runtime/README.md#storage-adapter-conformance)
199
- for coverage, cleanup, locale setup, and remaining adapter-specific tests.
200
- - [ ] Implement `MantleStorageAdapter` returning existing semantic ports, or reuse `SqliteMantleStorageAdapter` with an already-owned handle.
201
- - [ ] Call `bootMantleRuntime()` once per semantic revision, or explicitly prepare before binding.
202
- - [ ] Mount HTTP Trigger and View REST surfaces.
203
- - [ ] Mount admin/public render routes and admin SPA assets.
204
- - [ ] Provide adapter-owned Better Auth wiring and session helpers.
205
- - [ ] Normalize session/OAuth and any consumer credential seam into
206
- `HandlerContext.auth`; never put raw credentials in runtime context.
207
- - [ ] Mount `/mcp/staff` and `/mcp` behind one resource-bound token verifier. Enforce the live staff role inside the apiHandler.
208
- - [ ] Preserve the HTTP cache contract: private by default; explicit anonymous 200 `GET`/`HEAD` public opt-in only.
209
- - [ ] Prove one guarded target has identical REST/MCP outcomes, including
210
- mutable revocation on the next call.
211
- - [ ] Add optional `MediaStorage` or `DeferredHookDispatcher` only when the adapter supports those features.
212
- - [ ] For deferred hooks, document at-least-once delivery, idempotency,
213
- message limits, retries/DLQ, and the non-transactional write-to-enqueue gap.
214
- - [ ] Verify the runtime package still has no platform-specific imports.
215
-
216
- ## Current non-goals
217
-
218
- - Do not add `SessionRepository`, `OAuthVerifier`, `UserRepository`, or `StaffRepository` runtime ports. Those were pre-ADR-0014 concepts and are not part of the current adapter contract.
219
- - Do not add API-key, personal-token, transaction, billing, or entitlement
220
- repositories to Core. They are consumer state behind the adapter resolver
221
- and guard Procedure.
222
- - Do not generalize `DatabaseDriver` for PostgreSQL/MongoDB or add a mapping DSL. Implement semantic ports; SQLite/D1 alone reuse the canonical SQL chain.
@@ -1,64 +0,0 @@
1
- # Task-specific agent prompts
2
-
3
- First install the small bootstrap skill:
4
-
5
- ```sh
6
- npx skills add aotter/mantle
7
- ```
8
-
9
- The installed skill locates the target project, resolves its actual SDK
10
- version, and sends the agent to that package's CLI and docs. A GitHub skill
11
- may be newer than npm: published 0.1.4 uses the direct-authoring path;
12
- 0.1.5-alpha.1 adds full generated projects. Never assume a new flag exists without
13
- checking the installed CLI.
14
-
15
- ## New full Cloudflare app
16
-
17
- ```text
18
- Build a Mantle app on Cloudflare. Follow the installed mantle skill, pin one
19
- exact stable SDK version, and use its project-generation path if supported.
20
- Select the full default Spec, Runtime, API, MCP, Admin and blank home. Install
21
- the CLI-declared dependencies and rerun generation. Ask for my actual data and
22
- workflow before adding Manifests. For local Admin, copy .dev.vars.example,
23
- set the real owner email and a random secret, and verify OTP, Admin assets,
24
- unauthorized access, public API and MCP. Do not claim production Auth is set
25
- up from a local OTP test.
26
- ```
27
-
28
- ## Small API or Spec-only app
29
-
30
- ```text
31
- Use the installed Mantle CLI and version-matched docs. For a Cloudflare API,
32
- select --host cf --features spec,api if that CLI supports project generation.
33
- For manifest parsing only, use --features spec without a host. Keep unselected
34
- Admin, Web and MCP packages out. Author the Schema and View I request, then
35
- run generate, validate, typecheck and a real route probe when a host exists.
36
- Preserve an existing direct-authored application instead of regenerating it.
37
- ```
38
-
39
- ## ChatGPT Sites
40
-
41
- ```text
42
- Build with ChatGPT Sites and Mantle. Start from the installed SDK's generated
43
- blank app when supported; otherwise follow that version's Sites reference.
44
- Pin all selected Mantle packages exactly, install declared dependencies,
45
- review and apply the initial local D1 migration, then add my Manifests and
46
- review each appended migration. Configure OWNER_EMAIL and PUBLIC_ORIGIN. The
47
- local owner smoke simulates Sites identity; deployed ChatGPT sign-in needs a
48
- separate check. Show how I will maintain content through Admin, browser
49
- WebMCP, public MCP and Sites-session staff MCP. Add R2 only if my workflow
50
- requires uploads. Never deploy the Worker directly or claim remote staff OAuth
51
- MCP from a Sites browser session.
52
- ```
53
-
54
- ## Existing project with typed queries
55
-
56
- ```text
57
- Read this project's package.json, lockfile, installed Mantle package and
58
- projected develop skill. Keep its host and selected surfaces. Use the installed
59
- CLI's help and handbook to add the requested Schema/View/Procedure, then run
60
- its generate/check, validation, TypeScript and host smoke. Do not use another
61
- checkout's SDK docs or overwrite user-owned files.
62
- ```
63
-
64
- [Back to the Core README](../README.md).
@@ -1,5 +0,0 @@
1
- # API and MCP authorization
2
-
3
- See [Authorization](handbook/reference/authorization.md),
4
- [Guarded API access](examples/cf-primitives-guarded-api.md), and
5
- [OAuth resource primitives](handbook/cloudflare/authentication.md#oauth-resource-primitives).
Binary file
@@ -1,166 +0,0 @@
1
- # Auth Hosting Model
2
-
3
- Mantle treats authentication as a runtime capability, not a paywall on
4
- basic login. The split is:
5
-
6
- - **Mantle SDK** gives every generated site the primitives needed to
7
- run its own auth.
8
- - **Mantle's conventional Cloudflare adapter** runs the generated site's
9
- selected self-hosted or Mantle Platform hosted client configuration.
10
- - **The application owner/host** declares the explicit auth mode and provider
11
- configuration.
12
- - **Mantle Platform** can sell hosted identity, provider setup, email,
13
- and billing convenience for site owners who do not want to operate
14
- those pieces.
15
-
16
- This document is the source of truth for the product and SDK boundary.
17
- Do not duplicate this model in starter handoff copy or landing prose;
18
- link here and keep downstream docs short.
19
-
20
- ## Free Self-Hosted Auth
21
-
22
- A free Mantle site can run every login method the SDK exposes through
23
- `createAuth()`:
24
-
25
- - social OAuth providers supported by Better Auth;
26
- - provider-specific options through Better Auth's native `socialProviders` types;
27
- - email OTP;
28
- - magic link;
29
- - passkey or another Better Auth method through the raw `plugins` path when the
30
- application owns its callback and UI;
31
- - first-party same-domain or same-parent-domain SSO when the site owner
32
- controls every participating subdomain.
33
-
34
- The site owner supplies their own provider client ids/secrets,
35
- transactional email sender, DNS, cookie policy, and operational
36
- maintenance. Mantle must not block self-hosted login behind a paid
37
- feature flag.
38
-
39
- ## Hosted Platform Auth
40
-
41
- Paid hosted auth is a convenience and operations product. The value is
42
- that Mantle Platform can:
43
-
44
- - hold OAuth provider configuration;
45
- - hold email provider credentials;
46
- - send OTP and magic-link email;
47
- - manage deliverability and provider rotation;
48
- - register generated sites as clients;
49
- - check billing/license entitlements before hosted capabilities are
50
- enabled;
51
- - expose a stable hosted identity broker for generated sites.
52
-
53
- The generated site still owns local grants, member records, content,
54
- orders, forms, and legal copy. Platform returns identity. The site maps
55
- that identity into `ctx.user`, `ctx.staff`, and its own grant model.
56
-
57
- ## Same Parent Domain SSO
58
-
59
- When the apps share a parent domain that the same party controls, SSO
60
- can use browser cookies:
61
-
62
- ```ts
63
- createAuth({
64
- // ...
65
- trustedOrigins: ["https://mantle.tools", "https://www.mantle.tools"],
66
- cookiePrefix: "mantle-platform",
67
- crossSubDomainCookies: {
68
- enabled: true,
69
- domain: "mantle.tools",
70
- },
71
- });
72
- ```
73
-
74
- Use this only for a trusted first-party app family, for example
75
- `platform.mantle.tools` and `mantle.tools`.
76
-
77
- `cookiePrefix` is required whenever more than one Better Auth app can
78
- write cookies under the same parent domain. Without it, Platform and
79
- Landing can overwrite each other's default Better Auth cookie names.
80
-
81
- `trustedOrigins` is a Better Auth auth-flow trust list. It is not a
82
- general API CORS policy and must not be documented as one.
83
-
84
- ## Customer Domain SSO
85
-
86
- Shared cookies do not work across different registrable domains:
87
-
88
- ```text
89
- platform.mantle.tools -> customer.com
90
- ```
91
-
92
- Browsers will not send a `mantle.tools` cookie to `customer.com`. For a
93
- customer-owned domain, hosted auth must use OAuth/OIDC:
94
-
95
- ```text
96
- customer.com/login
97
- -> platform.mantle.tools/api/auth/oauth2/authorize
98
- -> user signs in with Platform-supported methods
99
- -> customer.com/api/auth/callback/mantle
100
- -> customer.com verifies the authorization response
101
- -> customer.com creates its own local session
102
- ```
103
-
104
- That local session is the customer's site session. Platform remains the
105
- identity broker and entitlement authority; it does not become the
106
- customer site's member database or authorization system.
107
-
108
- ## Landing Provisioning Split
109
-
110
- Landing should branch before GitHub or Cloudflare side effects:
111
-
112
- - **Continue free**: commit a self-hosted auth-ready site with docs,
113
- env placeholders, and the user's own provider setup path.
114
- - **Use hosted auth**: check Platform entitlement, register the site as
115
- a Platform auth client, and commit the generated site's Platform auth
116
- client config.
117
-
118
- Landing can probe Platform staff/session state, but provisioning's
119
- GitHub OAuth token is still Landing-owned unless a separate token
120
- handoff design is introduced.
121
-
122
- The conventional hosted-auth client wiring belongs in Core's Cloudflare
123
- adapter. Applications declare its environment bindings; a provisioning host supplies an
124
- allocated client. A site can still replace Auth construction through
125
- `createMantleWorker({ auth })` when it needs a different curated identity
126
- design. Core continues to own the normalized manifest/runtime credential
127
- vocabulary (`ctx.user`, `ctx.staff`, `ctx.auth`) and guard orchestration.
128
-
129
- ## API and MCP Authorization
130
-
131
- Login hosting and business API authorization are related but separate. Core
132
- provides a normalized verified-credential context (`ctx.auth`), closed scope
133
- predicates, one Cloudflare consumer credential resolver seam, and a
134
- Procedure-backed guard that REST and MCP both execute. A generated site owns
135
- API keys, personal tokens, grants, transactions, subscriptions, and the guard
136
- handler that checks current business state.
137
-
138
- Mantle Platform may be the identity or OAuth token authority for a hosted
139
- flow. That does not make token claims the generated site's live membership or
140
- entitlement authority. The target site's guard reads its authoritative state
141
- on every call. See [API and MCP authorization](examples/cf-primitives-guarded-api.md) for
142
- the exact public API and four consumer examples.
143
-
144
- ## SDK Surface Rule
145
-
146
- Mantle owns only integration fields with a real Mantle use case. Method
147
- configuration uses Better Auth's official provider/plugin option types; do not
148
- copy those unions or add a generic `Partial<BetterAuthOptions>` deep merge.
149
-
150
- The current first-party SSO use case justifies these optional fields on
151
- `CreateAuthConfig`:
152
-
153
- - `trustedOrigins`
154
- - `crossSubDomainCookies`
155
- - `cookiePrefix`
156
-
157
- The cross-site API use case additionally justifies these fields and facades:
158
-
159
- - native generic OAuth `authorizationUrlParams`, `tokenUrlParams`, and
160
- `refreshTokenParams` for RFC 8707 `resource`
161
- - OAuth provider `resources` and the curated `mcpResource`
162
- - `Auth.getProviderAccessToken(request, providerId)`
163
- - `Auth.verifyOAuthAccessToken(tokenOrRequest, { audience, scopes })`
164
-
165
- Generic OAuth providers use Better Auth 1.7's official `GenericOAuthConfig`,
166
- standard social sign-in and `/api/auth/callback/:id` path.
@@ -1,5 +0,0 @@
1
- # Cloudflare low-level composition
2
-
3
- This guide moved into the handbook: [`docs/handbook/cloudflare/low-level-composition.md`](handbook/cloudflare/low-level-composition.md).
4
-
5
- The handbook ships inside the `@aotter/mantle` package under `node_modules/@aotter/mantle/docs/handbook/` and describes the installed release.
@@ -1,65 +0,0 @@
1
- # Consumer onboarding audit for 0.1.3
2
-
3
- Scope: source skill install → pinned npm package → CLI → generated skills and
4
- handbook → application manifest and Admin customization. This is maintainer
5
- evidence, not a release announcement. Baseline: develop `b90cebbd`, package
6
- version `0.1.3-alpha.5`; the package version alone does not identify unreleased
7
- commits on develop. Tracking: [#1042](https://github.com/aotter/mantle/issues/1042).
8
-
9
- ## Clean source install
10
-
11
- Executed in an empty temporary directory:
12
-
13
- ```sh
14
- npx --yes skills add aotter/mantle --skill install --agent codex --yes
15
- ```
16
-
17
- Observed output: repository cloned, **7 skills found**, **1 selected**, copied
18
- to `./.agents/skills/install`. `skills-lock.json` records source `aotter/mantle`,
19
- source type `github`, and source path `skills/install/SKILL.md`. The installed
20
- file's hash in that lock was
21
- `8a6fd26aea97ae8bdf3e05fef22196c247b3f95aa049204a6ac51259d87e4e29`.
22
- No SDK, handbook or application is installed by that command. The explicit
23
- Codex and noninteractive flags make the audited destination reproducible;
24
- other selected agents/global scope can use another destination.
25
-
26
- This source install follows the repository's default ref. It does not test the
27
- unreleased edits in this PR or establish an npm version. The packed-consumer
28
- check below tests this branch's shipped instructions separately.
29
-
30
- ## White-box path and fixes
31
-
32
- | Stage / owner | Finding before this change | Correction |
33
- |---|---|---|
34
- | README → external skills installer | Prompt told the agent to read `skills/install/SKILL.md` and `docs/agent-prompts.md`, neither installed there. | Read the installer-reported destination, then the installed SDK's embedded docs. |
35
- | `skills/install/SKILL.md` | Bootstrap Git instructions did not explicitly hand off to the installed package's own install skill; `docs/...` root was implicit. Host interview was repeated. | Explicit package-root resolution and version authority; ask only for missing requirements. |
36
- | Install → CLI | It was possible to try the local CLI before installing Core; `generate` in an empty directory fails rather than creating a project. | Spell out package installation before CLI and manifest authoring before generation. |
37
- | Quickstart versions | Floating `latest` dependency examples contradicted exact-pin advice. | Resolve the requested channel once and save exact Mantle versions before the first build. |
38
- | `mantle skills` | Correctly projected four project skills, but success output did not tell the agent what to read next. | Print the projected develop skill and installed handbook entry. Document overwrite, drift and opt-in behavior. |
39
- | `sync-package-docs.mjs` → npm `files` | Docs and all seven skills already shipped; presence checks did not protect the new entry paths or exercise projection from the tarball. | Assert handbook/skill files and byte-identical `.agents`/`.claude` projection in the existing packed-consumer check. |
40
- | View concepts → grammar/runtime | Concepts denied internal Views and recommended SQL for every new View; reference `surface` table omitted `internal`. SQL admission text was stale. | Match implemented surfaces, typed declarative reads, SQLite admission sandbox and native-dialect limits. |
41
- | Manifest reference | View's allowed spec keys omitted `cache`; Schema list-column prose omitted native columns. | Reconcile with parser and Admin UI checker. |
42
- | Plugin/update skills | Assumed conventional source paths, missed regeneration after plugin manifest edits, and treated every View as publicly callable. | Use actual project paths, regenerate the plan, verify the declared surface and distinguish stable index from target prerelease docs. |
43
- | Feature discovery | No task-to-manifest capability map or usable human entry; reference was buried after host-specific sections. | Add overview, capability table and task guides; move reference before host guides without breaking existing URLs. |
44
- | Typed query discovery | APIs existed but lacked a complete internal-View calling example or clear reader authorization distinction. | Explain generated params/results, runtime `result` versus REST `data`, SQL `unknown`, indexed reader limits and plan-based emission. |
45
- | Admin requests → theme/develop skills | Theme skill targeted visitor source; no routing from an Admin request to manifest-controlled presentation. | Route to Admin guide, with Schema/View/Procedure rendering table and supported customization ceiling. |
46
- | Auth operations | Store-bound session cache behavior existed in code/ADR but was missing from the handbook. | Explain store identity, preparation order and KV propagation limits. |
47
-
48
- ## Verification and regression coverage
49
-
50
- - `packages/mantle-spec/test/handbook-contract.test.ts`: complete handbook YAML
51
- examples parse and validate; navigation covers pages; relative links resolve.
52
- - `packages/mantle/test/cli/generate.test.ts`: extracts the new internal-View
53
- YAML and TypeScript directly from the handbook, generates bindings and runs
54
- strict TypeScript checking on the real example.
55
- - CLI surface/projection tests assert the concrete next-read destinations;
56
- existing drift checks verify `--check` is read-only.
57
- - `scripts/check-optional-packages.mjs`: packs and installs the actual Core
58
- tarball, checks embedded entry pages/skills, runs `skills` and `skills --check`,
59
- and compares each project projection byte-for-byte with the installed package.
60
- - Repository gate: `pnpm check`. Exact execution results and any environment
61
- limitations are recorded in the PR, rather than frozen as a future guarantee.
62
-
63
- No npm publish, tag, deployment or grammar change is part of this audit. Source
64
- skill consumers receive the corrections only once they reach the installed Git
65
- ref; npm consumers receive them only in a package built from the corrected tree.
@@ -1,5 +0,0 @@
1
- # Deferred lifecycle hooks on Cloudflare Queues
2
-
3
- This guide moved into the handbook: [`docs/handbook/cloudflare/deferred-hooks-queues.md`](handbook/cloudflare/deferred-hooks-queues.md).
4
-
5
- The handbook ships inside the `@aotter/mantle` package under `node_modules/@aotter/mantle/docs/handbook/` and describes the installed release.
@@ -1,16 +0,0 @@
1
- # Manifest reference has moved
2
-
3
- The version-matched [handbook](handbook/reference/manifest.md) is the single
4
- grammar reference. This compatibility URL contains no duplicate grammar.
5
-
6
- - [Four atoms](handbook/concepts/four-atoms.md)
7
- - [Schema](handbook/reference/schema.md)
8
- - [View](handbook/reference/view.md)
9
- - [Procedure and builtin handlers](handbook/reference/procedure.md)
10
- - [Trigger](handbook/reference/trigger.md)
11
- - [Authorization](handbook/reference/authorization.md)
12
- - [Diagnostics](handbook/reference/diagnostics.md)
13
-
14
- Builder consumers must load these pages from the same installed SDK as their
15
- runtime. The old Markdown section headings are retired; see
16
- [#837](https://github.com/aotter/mantle/issues/837).