@aotter/mantle-runtime 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (257) hide show
  1. package/README.md +37 -4
  2. package/dist/MantleRuntime.d.ts +96 -0
  3. package/dist/MantleRuntime.d.ts.map +1 -0
  4. package/dist/MantleRuntime.js +197 -0
  5. package/dist/MantleRuntime.js.map +1 -0
  6. package/dist/domain/model/HandlerContext.d.ts +3 -4
  7. package/dist/domain/model/HandlerContext.d.ts.map +1 -1
  8. package/dist/domain/model/PreparedMantleRevision.d.ts +14 -0
  9. package/dist/domain/model/PreparedMantleRevision.d.ts.map +1 -0
  10. package/dist/domain/model/PreparedMantleRevision.js +8 -0
  11. package/dist/domain/model/PreparedMantleRevision.js.map +1 -0
  12. package/dist/domain/model/index.d.ts +1 -2
  13. package/dist/domain/model/index.d.ts.map +1 -1
  14. package/dist/domain/model/index.js +0 -1
  15. package/dist/domain/model/index.js.map +1 -1
  16. package/dist/domain/port/Clock.d.ts +1 -2
  17. package/dist/domain/port/Clock.d.ts.map +1 -1
  18. package/dist/domain/port/Clock.js.map +1 -1
  19. package/dist/domain/port/DatabaseDriver.d.ts +13 -21
  20. package/dist/domain/port/DatabaseDriver.d.ts.map +1 -1
  21. package/dist/domain/port/HandlerRegistry.d.ts +1 -1
  22. package/dist/domain/port/IdGenerator.d.ts +1 -2
  23. package/dist/domain/port/IdGenerator.d.ts.map +1 -1
  24. package/dist/domain/port/IdGenerator.js.map +1 -1
  25. package/dist/domain/port/MantleStorageAdapter.d.ts +23 -0
  26. package/dist/domain/port/MantleStorageAdapter.d.ts.map +1 -0
  27. package/dist/domain/port/MantleStorageAdapter.js +2 -0
  28. package/dist/domain/port/MantleStorageAdapter.js.map +1 -0
  29. package/dist/domain/port/SiteConfigRepository.d.ts +10 -8
  30. package/dist/domain/port/SiteConfigRepository.d.ts.map +1 -1
  31. package/dist/domain/port/ViewQueryExecutor.d.ts +29 -0
  32. package/dist/domain/port/ViewQueryExecutor.d.ts.map +1 -0
  33. package/dist/domain/port/ViewQueryExecutor.js +2 -0
  34. package/dist/domain/port/ViewQueryExecutor.js.map +1 -0
  35. package/dist/domain/port/index.d.ts +5 -2
  36. package/dist/domain/port/index.d.ts.map +1 -1
  37. package/dist/domain/port/index.js.map +1 -1
  38. package/dist/domain/service/RuntimePlanCompiler.d.ts +89 -0
  39. package/dist/domain/service/RuntimePlanCompiler.d.ts.map +1 -0
  40. package/dist/domain/service/RuntimePlanCompiler.js +230 -0
  41. package/dist/domain/service/RuntimePlanCompiler.js.map +1 -0
  42. package/dist/domain/service/TriggerIndex.d.ts +3 -0
  43. package/dist/domain/service/TriggerIndex.d.ts.map +1 -1
  44. package/dist/domain/service/TriggerIndex.js +14 -1
  45. package/dist/domain/service/TriggerIndex.js.map +1 -1
  46. package/dist/domain/service/index.d.ts +1 -9
  47. package/dist/domain/service/index.d.ts.map +1 -1
  48. package/dist/domain/service/index.js +1 -9
  49. package/dist/domain/service/index.js.map +1 -1
  50. package/dist/domain/service/io/EntryWriteGuard.d.ts +2 -2
  51. package/dist/domain/service/io/EntryWriteGuard.d.ts.map +1 -1
  52. package/dist/domain/service/io/EntryWriteGuard.js +1 -3
  53. package/dist/domain/service/io/EntryWriteGuard.js.map +1 -1
  54. package/dist/index.d.ts +15 -11
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +9 -11
  57. package/dist/index.js.map +1 -1
  58. package/dist/infrastructure/boot/SqliteMigrationRunner.d.ts +10 -0
  59. package/dist/infrastructure/boot/SqliteMigrationRunner.d.ts.map +1 -0
  60. package/dist/infrastructure/boot/SqliteMigrationRunner.js +41 -0
  61. package/dist/infrastructure/boot/SqliteMigrationRunner.js.map +1 -0
  62. package/dist/infrastructure/boot/bootState.d.ts +2 -4
  63. package/dist/infrastructure/boot/bootState.d.ts.map +1 -1
  64. package/dist/infrastructure/boot/bootState.js +1 -1
  65. package/dist/infrastructure/boot/bootState.js.map +1 -1
  66. package/dist/infrastructure/boot/canonicalMigrations.d.ts.map +1 -1
  67. package/dist/infrastructure/boot/canonicalMigrations.js +124 -60
  68. package/dist/infrastructure/boot/canonicalMigrations.js.map +1 -1
  69. package/dist/infrastructure/boot/index.d.ts +1 -0
  70. package/dist/infrastructure/boot/index.d.ts.map +1 -1
  71. package/dist/infrastructure/boot/index.js +1 -0
  72. package/dist/infrastructure/boot/index.js.map +1 -1
  73. package/dist/infrastructure/http/createMantleRequestHandler.d.ts +12 -0
  74. package/dist/infrastructure/http/createMantleRequestHandler.d.ts.map +1 -0
  75. package/dist/infrastructure/http/createMantleRequestHandler.js +127 -0
  76. package/dist/infrastructure/http/createMantleRequestHandler.js.map +1 -0
  77. package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts +2 -2
  78. package/dist/infrastructure/mcp/McpJsonRpcDispatcher.d.ts.map +1 -1
  79. package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js +1 -1
  80. package/dist/infrastructure/mcp/McpJsonRpcDispatcher.js.map +1 -1
  81. package/dist/infrastructure/mcp/McpToolCatalog.d.ts.map +1 -1
  82. package/dist/infrastructure/mcp/McpToolCatalog.js +6 -7
  83. package/dist/infrastructure/mcp/McpToolCatalog.js.map +1 -1
  84. package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts +1 -1
  85. package/dist/infrastructure/persistence/DatabaseEntryRepository.d.ts.map +1 -1
  86. package/dist/infrastructure/persistence/DatabaseEntryRepository.js +1 -1
  87. package/dist/infrastructure/persistence/DatabaseEntryRepository.js.map +1 -1
  88. package/dist/infrastructure/persistence/DatabaseSiteConfigRepository.js +3 -3
  89. package/dist/infrastructure/storage/SqliteMantleStorageAdapter.d.ts +22 -0
  90. package/dist/infrastructure/storage/SqliteMantleStorageAdapter.d.ts.map +1 -0
  91. package/dist/infrastructure/storage/SqliteMantleStorageAdapter.js +86 -0
  92. package/dist/infrastructure/storage/SqliteMantleStorageAdapter.js.map +1 -0
  93. package/dist/{domain/service/ViewSqlCompiler.d.ts → infrastructure/storage/SqliteViewCompiler.d.ts} +9 -20
  94. package/dist/infrastructure/storage/SqliteViewCompiler.d.ts.map +1 -0
  95. package/dist/infrastructure/storage/SqliteViewCompiler.js +307 -0
  96. package/dist/infrastructure/storage/SqliteViewCompiler.js.map +1 -0
  97. package/dist/infrastructure/testing/IndexCoverageHarness.d.ts +2 -2
  98. package/dist/infrastructure/testing/IndexCoverageHarness.d.ts.map +1 -1
  99. package/dist/infrastructure/testing/IndexCoverageHarness.js +4 -4
  100. package/dist/infrastructure/testing/IndexCoverageHarness.js.map +1 -1
  101. package/dist/usecase/boot/ValidateBootUseCase.d.ts +15 -38
  102. package/dist/usecase/boot/ValidateBootUseCase.d.ts.map +1 -1
  103. package/dist/usecase/boot/ValidateBootUseCase.js +79 -274
  104. package/dist/usecase/boot/ValidateBootUseCase.js.map +1 -1
  105. package/dist/usecase/boot/index.d.ts +1 -1
  106. package/dist/usecase/boot/index.d.ts.map +1 -1
  107. package/dist/usecase/boot/index.js +1 -1
  108. package/dist/usecase/boot/index.js.map +1 -1
  109. package/dist/usecase/content/CreateDraftUseCase.d.ts +2 -2
  110. package/dist/usecase/content/CreateDraftUseCase.d.ts.map +1 -1
  111. package/dist/usecase/content/CreateDraftUseCase.js.map +1 -1
  112. package/dist/usecase/content/RequestPublishUseCase.d.ts +2 -2
  113. package/dist/usecase/content/RequestPublishUseCase.d.ts.map +1 -1
  114. package/dist/usecase/content/RequestPublishUseCase.js.map +1 -1
  115. package/dist/usecase/content/UpdateDraftUseCase.d.ts +2 -2
  116. package/dist/usecase/content/UpdateDraftUseCase.d.ts.map +1 -1
  117. package/dist/usecase/content/UpdateDraftUseCase.js.map +1 -1
  118. package/dist/usecase/dto/index.d.ts +0 -1
  119. package/dist/usecase/dto/index.d.ts.map +1 -1
  120. package/dist/usecase/dto/index.js +0 -1
  121. package/dist/usecase/dto/index.js.map +1 -1
  122. package/dist/usecase/dto/view/ExecuteViewRequest.d.ts +2 -2
  123. package/dist/usecase/dto/view/ExecuteViewRequest.d.ts.map +1 -1
  124. package/dist/usecase/index.d.ts +0 -1
  125. package/dist/usecase/index.d.ts.map +1 -1
  126. package/dist/usecase/index.js +0 -1
  127. package/dist/usecase/index.js.map +1 -1
  128. package/dist/usecase/media/diagnostics.js +1 -1
  129. package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts +2 -2
  130. package/dist/usecase/procedure/InvokeBuiltinUseCase.d.ts.map +1 -1
  131. package/dist/usecase/procedure/InvokeBuiltinUseCase.js.map +1 -1
  132. package/dist/usecase/site/UpdateSiteSettingsUseCase.d.ts.map +1 -1
  133. package/dist/usecase/site/UpdateSiteSettingsUseCase.js +8 -1
  134. package/dist/usecase/site/UpdateSiteSettingsUseCase.js.map +1 -1
  135. package/dist/usecase/view/ExecuteViewUseCase.d.ts +8 -16
  136. package/dist/usecase/view/ExecuteViewUseCase.d.ts.map +1 -1
  137. package/dist/usecase/view/ExecuteViewUseCase.js +19 -95
  138. package/dist/usecase/view/ExecuteViewUseCase.js.map +1 -1
  139. package/dist/usecase/view/index.d.ts +2 -1
  140. package/dist/usecase/view/index.d.ts.map +1 -1
  141. package/dist/usecase/view/index.js.map +1 -1
  142. package/package.json +4 -4
  143. package/dist/domain/model/SeoMeta.d.ts +0 -47
  144. package/dist/domain/model/SeoMeta.d.ts.map +0 -1
  145. package/dist/domain/model/SeoMeta.js +0 -2
  146. package/dist/domain/model/SeoMeta.js.map +0 -1
  147. package/dist/domain/model/TemplateRegistry.d.ts +0 -49
  148. package/dist/domain/model/TemplateRegistry.d.ts.map +0 -1
  149. package/dist/domain/model/TemplateRegistry.js +0 -17
  150. package/dist/domain/model/TemplateRegistry.js.map +0 -1
  151. package/dist/domain/port/AssetServer.d.ts +0 -22
  152. package/dist/domain/port/AssetServer.d.ts.map +0 -1
  153. package/dist/domain/port/AssetServer.js +0 -2
  154. package/dist/domain/port/AssetServer.js.map +0 -1
  155. package/dist/domain/service/AbsoluteUrl.d.ts +0 -6
  156. package/dist/domain/service/AbsoluteUrl.d.ts.map +0 -1
  157. package/dist/domain/service/AbsoluteUrl.js +0 -33
  158. package/dist/domain/service/AbsoluteUrl.js.map +0 -1
  159. package/dist/domain/service/HtmlEscaping.d.ts +0 -2
  160. package/dist/domain/service/HtmlEscaping.d.ts.map +0 -1
  161. package/dist/domain/service/HtmlEscaping.js +0 -9
  162. package/dist/domain/service/HtmlEscaping.js.map +0 -1
  163. package/dist/domain/service/HtmlRenderer.d.ts +0 -38
  164. package/dist/domain/service/HtmlRenderer.d.ts.map +0 -1
  165. package/dist/domain/service/HtmlRenderer.js +0 -73
  166. package/dist/domain/service/HtmlRenderer.js.map +0 -1
  167. package/dist/domain/service/MarkdownSerializer.d.ts +0 -45
  168. package/dist/domain/service/MarkdownSerializer.d.ts.map +0 -1
  169. package/dist/domain/service/MarkdownSerializer.js +0 -154
  170. package/dist/domain/service/MarkdownSerializer.js.map +0 -1
  171. package/dist/domain/service/McpToolNaming.d.ts +0 -31
  172. package/dist/domain/service/McpToolNaming.d.ts.map +0 -1
  173. package/dist/domain/service/McpToolNaming.js +0 -48
  174. package/dist/domain/service/McpToolNaming.js.map +0 -1
  175. package/dist/domain/service/PreviewBanner.d.ts +0 -10
  176. package/dist/domain/service/PreviewBanner.d.ts.map +0 -1
  177. package/dist/domain/service/PreviewBanner.js +0 -30
  178. package/dist/domain/service/PreviewBanner.js.map +0 -1
  179. package/dist/domain/service/PublicPathResolver.d.ts +0 -46
  180. package/dist/domain/service/PublicPathResolver.d.ts.map +0 -1
  181. package/dist/domain/service/PublicPathResolver.js +0 -36
  182. package/dist/domain/service/PublicPathResolver.js.map +0 -1
  183. package/dist/domain/service/SeoMetaComposer.d.ts +0 -60
  184. package/dist/domain/service/SeoMetaComposer.d.ts.map +0 -1
  185. package/dist/domain/service/SeoMetaComposer.js +0 -213
  186. package/dist/domain/service/SeoMetaComposer.js.map +0 -1
  187. package/dist/domain/service/SitemapSerializer.d.ts +0 -19
  188. package/dist/domain/service/SitemapSerializer.d.ts.map +0 -1
  189. package/dist/domain/service/SitemapSerializer.js +0 -27
  190. package/dist/domain/service/SitemapSerializer.js.map +0 -1
  191. package/dist/domain/service/ViewSqlCompiler.d.ts.map +0 -1
  192. package/dist/domain/service/ViewSqlCompiler.js +0 -244
  193. package/dist/domain/service/ViewSqlCompiler.js.map +0 -1
  194. package/dist/domain/service/io/MediaAssetReferences.d.ts +0 -13
  195. package/dist/domain/service/io/MediaAssetReferences.d.ts.map +0 -1
  196. package/dist/domain/service/io/MediaAssetReferences.js +0 -48
  197. package/dist/domain/service/io/MediaAssetReferences.js.map +0 -1
  198. package/dist/runtime.d.ts +0 -145
  199. package/dist/runtime.d.ts.map +0 -1
  200. package/dist/runtime.js +0 -224
  201. package/dist/runtime.js.map +0 -1
  202. package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.d.ts +0 -18
  203. package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.d.ts.map +0 -1
  204. package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.js +0 -2
  205. package/dist/usecase/dto/render/ComposeEntrySeoMetaRequest.js.map +0 -1
  206. package/dist/usecase/dto/render/ComposeLlmsTxtRequest.d.ts +0 -13
  207. package/dist/usecase/dto/render/ComposeLlmsTxtRequest.d.ts.map +0 -1
  208. package/dist/usecase/dto/render/ComposeLlmsTxtRequest.js +0 -2
  209. package/dist/usecase/dto/render/ComposeLlmsTxtRequest.js.map +0 -1
  210. package/dist/usecase/dto/render/ComposeSitemapRequest.d.ts +0 -13
  211. package/dist/usecase/dto/render/ComposeSitemapRequest.d.ts.map +0 -1
  212. package/dist/usecase/dto/render/ComposeSitemapRequest.js +0 -2
  213. package/dist/usecase/dto/render/ComposeSitemapRequest.js.map +0 -1
  214. package/dist/usecase/dto/render/PreviewEntryRequest.d.ts +0 -18
  215. package/dist/usecase/dto/render/PreviewEntryRequest.d.ts.map +0 -1
  216. package/dist/usecase/dto/render/PreviewEntryRequest.js +0 -2
  217. package/dist/usecase/dto/render/PreviewEntryRequest.js.map +0 -1
  218. package/dist/usecase/dto/render/RenderEntryLiveRequest.d.ts +0 -19
  219. package/dist/usecase/dto/render/RenderEntryLiveRequest.d.ts.map +0 -1
  220. package/dist/usecase/dto/render/RenderEntryLiveRequest.js +0 -2
  221. package/dist/usecase/dto/render/RenderEntryLiveRequest.js.map +0 -1
  222. package/dist/usecase/dto/render/RenderListLiveRequest.d.ts +0 -15
  223. package/dist/usecase/dto/render/RenderListLiveRequest.d.ts.map +0 -1
  224. package/dist/usecase/dto/render/RenderListLiveRequest.js +0 -2
  225. package/dist/usecase/dto/render/RenderListLiveRequest.js.map +0 -1
  226. package/dist/usecase/dto/render/index.d.ts +0 -7
  227. package/dist/usecase/dto/render/index.d.ts.map +0 -1
  228. package/dist/usecase/dto/render/index.js +0 -7
  229. package/dist/usecase/dto/render/index.js.map +0 -1
  230. package/dist/usecase/render/ComposeEntrySeoMetaUseCase.d.ts +0 -28
  231. package/dist/usecase/render/ComposeEntrySeoMetaUseCase.d.ts.map +0 -1
  232. package/dist/usecase/render/ComposeEntrySeoMetaUseCase.js +0 -66
  233. package/dist/usecase/render/ComposeEntrySeoMetaUseCase.js.map +0 -1
  234. package/dist/usecase/render/ComposeLlmsTxtUseCase.d.ts +0 -18
  235. package/dist/usecase/render/ComposeLlmsTxtUseCase.d.ts.map +0 -1
  236. package/dist/usecase/render/ComposeLlmsTxtUseCase.js +0 -47
  237. package/dist/usecase/render/ComposeLlmsTxtUseCase.js.map +0 -1
  238. package/dist/usecase/render/ComposeSitemapUseCase.d.ts +0 -15
  239. package/dist/usecase/render/ComposeSitemapUseCase.d.ts.map +0 -1
  240. package/dist/usecase/render/ComposeSitemapUseCase.js +0 -38
  241. package/dist/usecase/render/ComposeSitemapUseCase.js.map +0 -1
  242. package/dist/usecase/render/PreviewEntryUseCase.d.ts +0 -28
  243. package/dist/usecase/render/PreviewEntryUseCase.d.ts.map +0 -1
  244. package/dist/usecase/render/PreviewEntryUseCase.js +0 -72
  245. package/dist/usecase/render/PreviewEntryUseCase.js.map +0 -1
  246. package/dist/usecase/render/RenderEntryLiveUseCase.d.ts +0 -36
  247. package/dist/usecase/render/RenderEntryLiveUseCase.d.ts.map +0 -1
  248. package/dist/usecase/render/RenderEntryLiveUseCase.js +0 -62
  249. package/dist/usecase/render/RenderEntryLiveUseCase.js.map +0 -1
  250. package/dist/usecase/render/RenderListLiveUseCase.d.ts +0 -25
  251. package/dist/usecase/render/RenderListLiveUseCase.d.ts.map +0 -1
  252. package/dist/usecase/render/RenderListLiveUseCase.js +0 -46
  253. package/dist/usecase/render/RenderListLiveUseCase.js.map +0 -1
  254. package/dist/usecase/render/index.d.ts +0 -7
  255. package/dist/usecase/render/index.d.ts.map +0 -1
  256. package/dist/usecase/render/index.js +0 -7
  257. package/dist/usecase/render/index.js.map +0 -1
package/README.md CHANGED
@@ -2,9 +2,42 @@
2
2
 
3
3
  Runtime engine for mantle.
4
4
 
5
- This package owns the adapter-agnostic CMS core: dispatcher, content operations,
6
- render pipeline, auth/session abstractions, MCP JSON-RPC dispatch, and the
7
- runtime ports implemented by platform adapters.
5
+ This package owns the adapter-neutral Core pipeline after semantic compilation.
6
+ Storage adapters prepare `RuntimePlan` into existing content repositories/readers
7
+ and a `ViewQueryExecutor`; SQL-shaped drivers remain SQLite/D1 implementation
8
+ details rather than a universal database contract.
9
+
10
+ ```ts
11
+ const runtime = await bootMantleRuntime({
12
+ plan,
13
+ storage,
14
+ handlers,
15
+ ports,
16
+ deployment: deploymentOptions,
17
+ });
18
+
19
+ await runtime.invokeProcedure({ procedure: "recompute", input, ctx });
20
+ await runtime.executeView({ view: "open-orders", options: { params }, ctx });
21
+ ```
22
+
23
+ `bootMantleRuntime` makes one preparation attempt and derives handler readiness
24
+ from `handlers`; hosts still own lazy initialization, caching, retries, and
25
+ resource shutdown.
26
+
27
+ Advanced hosts may keep the stages explicit. `prepareDeployment()` returns the
28
+ exact plan together with its prepared semantic storage, so binding cannot
29
+ accidentally pair storage from one revision with another plan:
30
+
31
+ ```ts
32
+ const prepared = await prepareDeployment(plan, storage, deploymentOptions);
33
+ const runtime = createMantleRuntime({ prepared, handlers, ports });
34
+ ```
35
+
36
+ Pass `handlerNames` during explicit preparation when the embedding dispatches
37
+ Procedures. A projection-only embedding may omit it.
38
+
39
+ Binding is synchronous and performs no migrations, parsing, linking, or hidden
40
+ preparation. Request identity is supplied to each invocation.
8
41
 
9
42
  Node-based tooling may import `@aotter/mantle-runtime/testing` for the real
10
43
  SQLite access-path and HTTP sampling helpers. That subpath is intentionally
@@ -12,7 +45,7 @@ separate from the Worker-safe package entry.
12
45
 
13
46
  For a fresh adapter implementation, start with
14
47
  [`docs/adapter-guide.md`](../../docs/adapter-guide.md) and
15
- [`docs/adr/0011-adapter-port-spec.md`](../../docs/adr/0011-adapter-port-spec.md).
48
+ [`docs/adr/0019-sealed-manifest-runtime-pipeline.md`](../../docs/adr/0019-sealed-manifest-runtime-pipeline.md).
16
49
 
17
50
  Queue-backed `after_*` lifecycle delivery is optional and at-least-once. See
18
51
  [`docs/deferred-lifecycle-queues.md`](../../docs/deferred-lifecycle-queues.md)
@@ -0,0 +1,96 @@
1
+ import { type SchemaManifest } from "@aotter/mantle-spec";
2
+ import type { AnyHandler, HandlerContext } from "./domain/model/HandlerContext.js";
3
+ import type { PreparedMantleRevision } from "./domain/model/PreparedMantleRevision.js";
4
+ import { type Clock } from "./domain/port/Clock.js";
5
+ import type { DeferredHookDispatcher } from "./domain/port/DeferredHookDispatcher.js";
6
+ import type { EntryReader } from "./domain/port/EntryReader.js";
7
+ import type { MediaAsset, MediaStorage } from "./domain/port/MediaStorage.js";
8
+ import { type IdGenerator } from "./domain/port/IdGenerator.js";
9
+ import type { MantleStorageAdapter } from "./domain/port/MantleStorageAdapter.js";
10
+ import type { LocalePolicyReader, SiteConfigRepository } from "./domain/port/SiteConfigRepository.js";
11
+ import type { ViewQueryOptions } from "./domain/port/ViewQueryExecutor.js";
12
+ import type { RuntimePlan } from "./domain/service/RuntimePlanCompiler.js";
13
+ import { ArchiveUseCase, CreateDraftUseCase, DeleteEntryUseCase, GetEntryUseCase, ListEntriesUseCase, RequestPublishUseCase, UnpublishUseCase, UpdateDraftUseCase } from "./usecase/content/index.js";
14
+ import type { RunDeferredHookRequest } from "./usecase/dto/lifecycle/index.js";
15
+ import type { InvokeProcedureResponse } from "./usecase/dto/procedure/index.js";
16
+ import { CommitMediaUploadUseCase, CreateMediaUploadUseCase, DeleteMediaAssetUseCase, GetMediaAssetUseCase, ListMediaAssetsUseCase, UpdateMediaAssetUseCase } from "./usecase/media/index.js";
17
+ import { type ExecuteViewResponse } from "./usecase/view/index.js";
18
+ import { UpdateSiteSettingsUseCase } from "./usecase/site/index.js";
19
+ import { type DeploymentPreparationOptions } from "./usecase/boot/ValidateBootUseCase.js";
20
+ export interface MantleRuntimePorts {
21
+ readonly localePolicy?: LocalePolicyReader;
22
+ readonly deferredHookDispatcher?: DeferredHookDispatcher;
23
+ readonly clock?: Clock;
24
+ readonly idgen?: IdGenerator;
25
+ /** Host callback after a successful publishing-content mutation. */
26
+ readonly onPublishingContentChange?: () => Promise<void>;
27
+ readonly mediaStorage?: MediaStorage;
28
+ readonly mediaAllowSvg?: boolean;
29
+ }
30
+ export interface CreateMantleRuntimeArgs {
31
+ readonly prepared: PreparedMantleRevision;
32
+ readonly ports?: MantleRuntimePorts;
33
+ readonly handlers?: Readonly<Record<string, AnyHandler>>;
34
+ }
35
+ export interface BootMantleRuntimeArgs {
36
+ readonly plan: RuntimePlan;
37
+ readonly storage: MantleStorageAdapter;
38
+ readonly ports?: MantleRuntimePorts;
39
+ readonly handlers?: Readonly<Record<string, AnyHandler>>;
40
+ readonly deployment?: Omit<DeploymentPreparationOptions, "handlerNames">;
41
+ }
42
+ export interface InvokeMantleProcedureRequest {
43
+ readonly procedure: string;
44
+ readonly input: unknown;
45
+ readonly ctx: HandlerContext;
46
+ readonly pathPrefix?: string;
47
+ }
48
+ export interface ExecuteMantleViewRequest {
49
+ readonly view: string;
50
+ readonly options?: ViewQueryOptions;
51
+ readonly ctx?: HandlerContext;
52
+ readonly pathPrefix?: string;
53
+ }
54
+ export interface InvokeMantleTriggerRequest {
55
+ readonly trigger: string;
56
+ readonly input: unknown;
57
+ readonly ctx: HandlerContext;
58
+ readonly pathPrefix?: string;
59
+ }
60
+ /** Programmatic Core bound to one prepared semantic revision. */
61
+ export interface MantleRuntime {
62
+ readonly revision: string;
63
+ /** Linked schemas needed by optional projections such as Mantle Web. */
64
+ readonly schemas: ReadonlyMap<string, SchemaManifest>;
65
+ readonly entries: EntryReader;
66
+ readonly siteConfig: SiteConfigRepository | null;
67
+ readonly updateSiteSettings: UpdateSiteSettingsUseCase | null;
68
+ readonly media: MantleMedia | null;
69
+ readonly createDraft: CreateDraftUseCase;
70
+ readonly updateDraft: UpdateDraftUseCase;
71
+ readonly getEntry: GetEntryUseCase;
72
+ readonly listEntries: ListEntriesUseCase;
73
+ readonly requestPublish: RequestPublishUseCase;
74
+ readonly unpublish: UnpublishUseCase;
75
+ readonly archive: ArchiveUseCase;
76
+ readonly deleteEntry: DeleteEntryUseCase;
77
+ invokeProcedure<O = unknown>(request: InvokeMantleProcedureRequest): Promise<InvokeProcedureResponse<O>>;
78
+ executeView<R = Record<string, unknown>>(request: ExecuteMantleViewRequest): Promise<ExecuteViewResponse<R>>;
79
+ invokeTrigger<O = unknown>(request: InvokeMantleTriggerRequest): Promise<InvokeProcedureResponse<O>>;
80
+ runDeferredHook(request: RunDeferredHookRequest): Promise<void>;
81
+ }
82
+ export interface MantleMedia {
83
+ readonly storage: MediaStorage;
84
+ readonly createUpload: CreateMediaUploadUseCase;
85
+ readonly commitUpload: CommitMediaUploadUseCase;
86
+ readonly listAssets: ListMediaAssetsUseCase;
87
+ readonly getAsset: GetMediaAssetUseCase;
88
+ readonly updateAsset: UpdateMediaAssetUseCase;
89
+ readonly deleteAsset: DeleteMediaAssetUseCase;
90
+ resolve(id: string): Promise<MediaAsset | null>;
91
+ resolveMany(ids: readonly string[]): Promise<ReadonlyMap<string, MediaAsset>>;
92
+ }
93
+ /** Prepare and bind once. Hosts remain responsible for caching and retry policy. */
94
+ export declare function bootMantleRuntime(args: BootMantleRuntimeArgs): Promise<MantleRuntime>;
95
+ export declare function createMantleRuntime(args: CreateMantleRuntimeArgs): MantleRuntime;
96
+ //# sourceMappingURL=MantleRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MantleRuntime.d.ts","sourceRoot":"","sources":["../src/MantleRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK9E,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AACpC,OA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AO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAChD,WAAW,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;CAC/E;AAED,oFAAoF;AACpF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC,CAO3F;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa,CA6JhF"}
@@ -0,0 +1,197 @@
1
+ import { EntryDataValidator, runtimeDiagnostic, } from "@aotter/mantle-spec";
2
+ import { SystemClock } from "./domain/port/Clock.js";
3
+ import { buildHandlerRegistry, } from "./domain/port/HandlerRegistry.js";
4
+ import { RandomUuidGenerator, } from "./domain/port/IdGenerator.js";
5
+ import { TriggerIndex } from "./domain/service/TriggerIndex.js";
6
+ import { LifecycleHookingEntryRepository } from "./infrastructure/persistence/LifecycleHookingEntryRepository.js";
7
+ import { ArchiveUseCase, CreateDraftUseCase, DeleteEntryUseCase, GetEntryUseCase, ListEntriesUseCase, RequestPublishUseCase, UnpublishUseCase, UpdateDraftUseCase, } from "./usecase/content/index.js";
8
+ import { RunDeferredHookUseCase, RunLifecycleHooksUseCase, } from "./usecase/lifecycle/index.js";
9
+ import { CommitMediaUploadUseCase, CreateMediaUploadUseCase, DeleteMediaAssetUseCase, GetMediaAssetUseCase, ListMediaAssetsUseCase, UpdateMediaAssetUseCase, } from "./usecase/media/index.js";
10
+ import { InvokeBuiltinUseCase, InvokeProcedureUseCase, } from "./usecase/procedure/index.js";
11
+ import { ExecuteViewUseCase, } from "./usecase/view/index.js";
12
+ import { UpdateSiteSettingsUseCase } from "./usecase/site/index.js";
13
+ import { assertDeploymentPlan, prepareDeployment, } from "./usecase/boot/ValidateBootUseCase.js";
14
+ /** Prepare and bind once. Hosts remain responsible for caching and retry policy. */
15
+ export async function bootMantleRuntime(args) {
16
+ const handlers = { ...(args.handlers ?? {}) };
17
+ const prepared = await prepareDeployment(args.plan, args.storage, {
18
+ ...args.deployment,
19
+ handlerNames: Object.keys(handlers),
20
+ });
21
+ return createMantleRuntime({ prepared, handlers, ports: args.ports });
22
+ }
23
+ export function createMantleRuntime(args) {
24
+ const { plan, storage: prepared } = args.prepared;
25
+ const ports = args.ports ?? {};
26
+ if (args.prepared.handlerNames) {
27
+ assertDeploymentPlan(plan, { handlerNames: Object.keys(args.handlers ?? {}) });
28
+ }
29
+ const schemasByName = manifestMap(plan.schemas);
30
+ const proceduresByName = manifestMap(plan.procedures);
31
+ const viewsByName = manifestMap(plan.views);
32
+ const triggersByName = manifestMap(plan.triggers);
33
+ const registry = buildHandlerRegistry(args.handlers ?? {});
34
+ const clock = ports.clock ?? SystemClock;
35
+ const idgen = ports.idgen ?? RandomUuidGenerator;
36
+ const localePolicy = ports.localePolicy ?? prepared.localePolicy;
37
+ const validator = new EntryDataValidator();
38
+ const triggerIndex = TriggerIndex.fromPlan(plan.lifecycleHooks, plan.triggers);
39
+ let entries;
40
+ const entriesProxy = {
41
+ create: (request) => entries.create(request),
42
+ get: (id) => entries.get(id),
43
+ update: (request) => entries.update(request),
44
+ delete: (request) => entries.delete(request),
45
+ transitionStatus: (request) => entries.transitionStatus(request),
46
+ list: (request) => entries.list(request),
47
+ findByDataField: (request) => entries.findByDataField(request),
48
+ findByDataFields: (request) => entries.findByDataFields(request),
49
+ };
50
+ const invokeBuiltin = new InvokeBuiltinUseCase(entriesProxy, schemasByName, clock, idgen, localePolicy, validator);
51
+ const invokeProcedure = new InvokeProcedureUseCase(registry, invokeBuiltin, proceduresByName);
52
+ const lifecycleHooks = new RunLifecycleHooksUseCase(triggerIndex, proceduresByName, (request) => invokeProcedure.execute(request));
53
+ entries = invalidateAfterWrites(new LifecycleHookingEntryRepository(prepared.entries, triggerIndex, lifecycleHooks, idgen, ports.deferredHookDispatcher), ports.onPublishingContentChange, (collection) => (schemasByName.get(collection)?.spec.lifecycle ?? "publishing") === "publishing");
54
+ const createDraft = new CreateDraftUseCase(entries, schemasByName, clock, idgen, localePolicy, validator);
55
+ const updateDraft = new UpdateDraftUseCase(entries, schemasByName, clock, localePolicy, validator);
56
+ const getEntry = new GetEntryUseCase(entries);
57
+ const listEntries = new ListEntriesUseCase(entries, schemasByName);
58
+ const requestPublish = new RequestPublishUseCase(entries, schemasByName, clock, localePolicy, validator);
59
+ const unpublish = new UnpublishUseCase(entries, schemasByName, clock);
60
+ const archive = new ArchiveUseCase(entries, schemasByName, clock);
61
+ const deleteEntry = new DeleteEntryUseCase(entries, schemasByName);
62
+ const executeView = new ExecuteViewUseCase(prepared.views, async (request) => {
63
+ const procedure = proceduresByName.get(request.procedure);
64
+ if (!procedure)
65
+ return unknown("Procedure", request.procedure, request.pathPrefix);
66
+ return invokeProcedure.execute({
67
+ procedure,
68
+ input: request.input,
69
+ ctx: request.ctx,
70
+ pathPrefix: request.pathPrefix,
71
+ });
72
+ }, plan.views);
73
+ const runDeferredHook = new RunDeferredHookUseCase(lifecycleHooks);
74
+ const siteConfig = prepared.siteConfig ?? null;
75
+ const updateSiteSettings = siteConfig
76
+ ? new UpdateSiteSettingsUseCase(siteConfig, ports.onPublishingContentChange)
77
+ : null;
78
+ const media = ports.mediaStorage
79
+ ? createMedia(ports.mediaStorage, prepared.mediaAssets, prepared.pendingUploads, {
80
+ clock,
81
+ idgen,
82
+ siteConfig,
83
+ allowSvg: ports.mediaAllowSvg ?? false,
84
+ })
85
+ : null;
86
+ return {
87
+ revision: plan.semanticFingerprint,
88
+ schemas: schemasByName,
89
+ entries: prepared.entries,
90
+ siteConfig,
91
+ updateSiteSettings,
92
+ media,
93
+ createDraft,
94
+ updateDraft,
95
+ getEntry,
96
+ listEntries,
97
+ requestPublish,
98
+ unpublish,
99
+ archive,
100
+ deleteEntry,
101
+ invokeProcedure: (request) => {
102
+ const procedure = proceduresByName.get(request.procedure);
103
+ if (!procedure) {
104
+ return Promise.resolve(unknown("Procedure", request.procedure, request.pathPrefix));
105
+ }
106
+ return invokeProcedure.execute({ ...request, procedure });
107
+ },
108
+ executeView: (request) => {
109
+ const view = viewsByName.get(request.view);
110
+ if (!view)
111
+ return Promise.resolve(unknown("View", request.view, request.pathPrefix));
112
+ return executeView.execute({ ...request, view });
113
+ },
114
+ invokeTrigger: (request) => {
115
+ const trigger = plan.triggers[request.trigger];
116
+ if (!trigger)
117
+ return Promise.resolve(unknown("Trigger", request.trigger, request.pathPrefix));
118
+ const procedure = proceduresByName.get(trigger.target);
119
+ if (!procedure) {
120
+ return Promise.resolve(unknown("Procedure", trigger.target, request.pathPrefix));
121
+ }
122
+ return invokeProcedure.execute({
123
+ procedure,
124
+ input: request.input,
125
+ ctx: request.ctx,
126
+ pathPrefix: request.pathPrefix ?? `manifest:Trigger/${request.trigger}`,
127
+ });
128
+ },
129
+ runDeferredHook: (request) => runDeferredHook.execute(request),
130
+ };
131
+ }
132
+ function createMedia(storage, assets, pending, options) {
133
+ if (!assets || !pending || !options.siteConfig) {
134
+ throw new Error("mediaStorage requires prepared media and site-config repositories");
135
+ }
136
+ return {
137
+ storage,
138
+ createUpload: new CreateMediaUploadUseCase(storage, pending, options.clock, options.idgen, options.siteConfig, { allowSvg: options.allowSvg }),
139
+ commitUpload: new CommitMediaUploadUseCase(storage, pending, options.clock, assets),
140
+ listAssets: new ListMediaAssetsUseCase(assets),
141
+ getAsset: new GetMediaAssetUseCase(assets),
142
+ updateAsset: new UpdateMediaAssetUseCase(assets),
143
+ deleteAsset: new DeleteMediaAssetUseCase(storage, assets),
144
+ resolve: (id) => assets.findById(id),
145
+ resolveMany: (ids) => assets.findManyByIds(ids),
146
+ };
147
+ }
148
+ function manifestMap(record) {
149
+ return new Map(Object.values(record).map((item) => [item.name, item.manifest]));
150
+ }
151
+ function unknown(kind, name, pathPrefix) {
152
+ return {
153
+ ok: false,
154
+ diagnostic: runtimeDiagnostic({
155
+ code: kind === "Procedure" ? "PROCEDURE_NOT_FOUND" : "NOT_FOUND",
156
+ severity: "error",
157
+ path: pathPrefix ?? `runtime:${kind}/${name}`,
158
+ value: name,
159
+ expected: `name of a ${kind} in the bound RuntimePlan`,
160
+ }),
161
+ };
162
+ }
163
+ function invalidateAfterWrites(inner, invalidate, affectsPublishingContent) {
164
+ if (!invalidate)
165
+ return inner;
166
+ return {
167
+ async create(args) {
168
+ const row = await inner.create(args);
169
+ if (affectsPublishingContent(args.collection))
170
+ await invalidate();
171
+ return row;
172
+ },
173
+ get: (id) => inner.get(id),
174
+ async update(args) {
175
+ const row = await inner.update(args);
176
+ if (affectsPublishingContent(args.collection))
177
+ await invalidate();
178
+ return row;
179
+ },
180
+ async delete(args) {
181
+ const result = await inner.delete(args);
182
+ if (result.removed && affectsPublishingContent(args.collection))
183
+ await invalidate();
184
+ return result;
185
+ },
186
+ async transitionStatus(args) {
187
+ const row = await inner.transitionStatus(args);
188
+ if (affectsPublishingContent(args.collection))
189
+ await invalidate();
190
+ return row;
191
+ },
192
+ list: (args) => inner.list(args),
193
+ findByDataField: (args) => inner.findByDataField(args),
194
+ findByDataFields: (args) => inner.findByDataFields(args),
195
+ };
196
+ }
197
+ //# sourceMappingURL=MantleRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MantleRuntime.js","sourceRoot":"","sources":["../src/MantleRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,WAAW,EAAc,MAAM,wBAAwB,CAAC;AAOjE,OAAO,EACL,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mBAAmB,GAEpB,MAAM,8BAA8B,CAAC;AAQtC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iEAAiE,CAAC;AAClH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,qB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,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC;QACtD,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC;KACzD,CAAC;AACJ,CAAC"}
@@ -31,10 +31,9 @@ export interface HandlerContext<Env = unknown> {
31
31
  /** Adapter-specific bindings. The default stays portable; consumers may
32
32
  * supply their Worker Env type through `HandlerFn`/generated handlers. */
33
33
  readonly env: Env;
34
- /** Cloudflare `ExecutionContext.waitUntil`-style fire-and-forget
35
- * bridge. Adapter populates when running in a Worker; runtime uses
36
- * it for deferred lifecycle-hook fallback. Optional so non-Worker
37
- * adapters can leave it out. */
34
+ /** Platform `waitUntil`-style fire-and-forget bridge. An adapter may
35
+ * populate it from Cloudflare `ExecutionContext` or Vercel Functions;
36
+ * runtime uses it for deferred lifecycle-hook fallback. */
38
37
  readonly waitUntil?: (p: Promise<unknown>) => void;
39
38
  /** Lifecycle event metadata. Populated by `RunLifecycleHooksUseCase`
40
39
  * when this ctx is passed to a Procedure invoked AS a lifecycle hook
@@ -1 +1 @@
1
- {"version":3,"file":"HandlerContext.d.ts","sourceRoot":"","sources":["../../../src/domain/model/HandlerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,cAAc,CAAC,GAAG,GAAG,OAAO;IAC3C,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;KAAE,GAAG,IAAI,CA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MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;iEAC6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;yEACqE;IACrE,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,CAC/D,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,KACrB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEpB;;;;;GAKG;AAEH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { PreparedMantleStorage } from "../port/MantleStorageAdapter.js";
2
+ import type { RuntimePlan } from "../service/RuntimePlanCompiler.js";
3
+ declare const preparedMantleRevision: unique symbol;
4
+ /** Exact plan plus semantic storage proven ready for that revision. */
5
+ export interface PreparedMantleRevision {
6
+ readonly [preparedMantleRevision]: true;
7
+ readonly plan: RuntimePlan;
8
+ readonly storage: PreparedMantleStorage;
9
+ /** Present when preparation validated Procedure handler availability. */
10
+ readonly handlerNames?: readonly string[];
11
+ }
12
+ export declare function sealPreparedMantleRevision(plan: RuntimePlan, storage: PreparedMantleStorage, handlerNames?: readonly string[]): PreparedMantleRevision;
13
+ export {};
14
+ //# sourceMappingURL=PreparedMantleRevision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreparedMantleRevision.d.ts","sourceRoot":"","sources":["../../../src/domain/model/PreparedMantleRevision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,MAAM,CAAC;AAEpD,uEAAuE;AACvE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,qBAAqB,EAC9B,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAC/B,sBAAsB,CAMxB"}
@@ -0,0 +1,8 @@
1
+ export function sealPreparedMantleRevision(plan, storage, handlerNames) {
2
+ return Object.freeze({
3
+ plan,
4
+ storage,
5
+ ...(handlerNames ? { handlerNames: Object.freeze([...new Set(handlerNames)].sort()) } : {}),
6
+ });
7
+ }
8
+ //# sourceMappingURL=PreparedMantleRevision.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PreparedMantleRevision.js","sourceRoot":"","sources":["../../../src/domain/model/PreparedMantleRevision.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,0BAA0B,CACxC,IAAiB,EACjB,OAA8B,EAC9B,YAAgC;IAEhC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI;QACJ,OAAO;QACP,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5F,CAA2B,CAAC;AAC/B,CAAC"}
@@ -2,7 +2,6 @@
2
2
  * `@aotter/mantle-spec`. */
3
3
  export * from "./EntryRow.js";
4
4
  export * from "./HandlerContext.js";
5
+ export type { PreparedMantleRevision } from "./PreparedMantleRevision.js";
5
6
  export type { PendingUploadRecord, PendingUploadVariant, } from "./PendingUploadRecord.js";
6
- export type { SeoMeta } from "./SeoMeta.js";
7
- export { TemplateRegistry, type EntryContext, type ListContext, type EntryTemplate, type ListTemplate, } from "./TemplateRegistry.js";
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/model/index.ts"],"names":[],"mappings":"AAAA;6BAC6B;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/model/index.ts"],"names":[],"mappings":"AAAA;6BAC6B;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC"}
@@ -2,5 +2,4 @@
2
2
  * `@aotter/mantle-spec`. */
3
3
  export * from "./EntryRow.js";
4
4
  export * from "./HandlerContext.js";
5
- export { TemplateRegistry, } from "./TemplateRegistry.js";
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/model/index.ts"],"names":[],"mappings":"AAAA;6BAC6B;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAMpC,OAAO,EACL,gBAAgB,GAKjB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/model/index.ts"],"names":[],"mappings":"AAAA;6BAC6B;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
@@ -3,8 +3,7 @@
3
3
  * calling `Date.now()` directly so tests can run with a fixed clock
4
4
  * and production stays on real time without ceremony.
5
5
  *
6
- * Defaults: `Date.now`. The runtime's assembly root (`createCmsRuntime`)
7
- * binds the default; tests override.
6
+ * Defaults: `Date.now`. `createMantleRuntime` binds the default; tests override.
8
7
  */
9
8
  export interface Clock {
10
9
  now(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/domain/port/Clock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,KAAK;IACpB,GAAG,IAAI,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,EAAE,KAAiC,CAAC"}
1
+ {"version":3,"file":"Clock.d.ts","sourceRoot":"","sources":["../../../src/domain/port/Clock.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB,GAAG,IAAI,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,EAAE,KAAiC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Clock.js","sourceRoot":"","sources":["../../../src/domain/port/Clock.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,WAAW,GAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"Clock.js","sourceRoot":"","sources":["../../../src/domain/port/Clock.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,WAAW,GAAU,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC"}
@@ -1,24 +1,17 @@
1
1
  /**
2
- * `DatabaseDriver` runtime's adapter-agnostic interface to
3
- * persistent relational state. Entries, site config,
4
- * auth support, and media tables declared by the canonical migrations live
5
- * behind this surface; the runtime never sees `D1Database`, `Pool` (postgres),
6
- * or any concrete driver.
2
+ * SQLite-shaped implementation detail used by the official SQLite/D1
3
+ * storage preparation path. Portable runtime use cases depend on semantic
4
+ * repositories and `ViewQueryExecutor`, never this SQL surface.
7
5
  *
8
- * The shape is intentionally close to D1's API (which is itself close
9
- * to the SQLite C API) that's the smallest common denominator
10
- * across the adapters we expect to ship. Adapters wrap their native
11
- * driver to this shape:
6
+ * The shape stays intentionally close to D1's API. Adapters that reuse the
7
+ * shipped SQLite implementation wrap their native driver to this shape:
12
8
  *
13
9
  * - `mantle-cloudflare` wraps `env.DB` (D1) directly (1:1 surface).
14
- * - A future Postgres adapter wraps `pg` to the same shape.
15
10
  * - Core tests supply in-memory implementations under `test/fakes/`.
16
11
  *
17
- * See ADR-0011 § DatabaseDriver for the rationale (and the alternatives
18
- * mega-port, function-injection, plugin packages that were
19
- * rejected). Renamed from `DatabasePort` per the clean-architecture
20
- * naming convention (no `Port` suffix; ports are discoverable by
21
- * package alone).
12
+ * PostgreSQL, MongoDB, and application-owned tables implement
13
+ * `MantleStorageAdapter` with semantic ports instead of emulating SQLite.
14
+ * See ADR-0019.
22
15
  */
23
16
  export interface DatabaseDriver {
24
17
  /** Build a parameterised statement. Bind values then execute. */
@@ -27,9 +20,7 @@ export interface DatabaseDriver {
27
20
  * all-or-nothing semantics — a child-row delete + parent delete
28
21
  * can't half-land. */
29
22
  batch(stmts: ReadonlyArray<PreparedStatement>): Promise<readonly BatchResult[]>;
30
- /** Migration runner the runtime's `bootInit` invokes
31
- * `migrations.runAll()` once per isolate. Adapters supply the
32
- * storage; the runtime supplies the canonical migration list. */
23
+ /** Migration runner used by SQLite storage preparation. */
33
24
  readonly migrations: MigrationRunner;
34
25
  }
35
26
  /**
@@ -64,9 +55,10 @@ export interface BatchResult {
64
55
  readonly results?: readonly Record<string, unknown>[];
65
56
  }
66
57
  /**
67
- * Migration runner contract. The adapter implements this against its
68
- * driver; the runtime calls `runAll(migrations)` once per isolate at
69
- * boot. Migration order is the array index — runtime supplies the
58
+ * Migration runner contract. The adapter supplies this against its driver;
59
+ * SQLite adapters can reuse `SqliteMigrationRunner`. Selected SQLite
60
+ * preparation calls `runAll(migrations)`.
61
+ * Migration order is the array index — Core supplies the
70
62
  * canonical list (see `infrastructure/boot/canonicalMigrations.ts`);
71
63
  * adapter just executes.
72
64
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseDriver.d.ts","sourceRoot":"","sources":["../../../src/domain/port/DatabaseDriver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACxC;;2BAEuB;IACvB,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;IAChF;;sEAEkE;IAClE,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;8BAE0B;IAC1B,IAAI,CAAC,GAAG,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC;IAC3D,qEAAqE;IACrE,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACxD,+BAA+B;IAC/B,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,SAA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AAE,MAAM,CAAC;CACtB"}
@@ -2,7 +2,7 @@ import type { AnyHandler, HandlerFn } from "../model/HandlerContext.js";
2
2
  /**
3
3
  * Handler registry keyed by `Procedure.handler.ref`. Consumers call
4
4
  * `register` at boot — typically via the `handlers` option of
5
- * `createCmsRuntime` — and the dispatcher resolves per request via
5
+ * `createMantleRuntime` — and the dispatcher resolves per request via
6
6
  * `get`.
7
7
  *
8
8
  * The registry is a usecase-level port: use cases (specifically
@@ -16,8 +16,7 @@
16
16
  *
17
17
  * The default `RandomUuidGenerator` (UUID v4 via Web Crypto) satisfies
18
18
  * this. Counter-based / sortable / "debuggable" alternatives MUST be
19
- * confined to test code — never wired into a `createCmsRuntime` /
20
- * adapter ctor at runtime.
19
+ * confined to test code — never wired into a production runtime or adapter.
21
20
  */
22
21
  export interface IdGenerator {
23
22
  next(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/domain/port/IdGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,IAAI,MAAM,CAAC;CAChB;AAED;;wCAEwC;AACxC,eAAO,MAAM,mBAAmB,EAAE,WAAiD,CAAC"}
1
+ {"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/domain/port/IdGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,IAAI,MAAM,CAAC;CAChB;AAED;;wCAEwC;AACxC,eAAO,MAAM,mBAAmB,EAAE,WAAiD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IdGenerator.js","sourceRoot":"","sources":["../../../src/domain/port/IdGenerator.ts"],"names":[],"mappings":"AAyBA;;wCAEwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"IdGenerator.js","sourceRoot":"","sources":["../../../src/domain/port/IdGenerator.ts"],"names":[],"mappings":"AAwBA;;wCAEwC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { RuntimePlan } from "../service/RuntimePlanCompiler.js";
2
+ import type { EntryReader } from "./EntryReader.js";
3
+ import type { EntryRepository } from "./EntryRepository.js";
4
+ import type { MediaAssetRepository } from "./MediaAssetRepository.js";
5
+ import type { PendingUploadRepository } from "./PendingUploadRepository.js";
6
+ import type { LocalePolicyReader } from "./SiteConfigRepository.js";
7
+ import type { SiteConfigRepository } from "./SiteConfigRepository.js";
8
+ import type { ViewQueryExecutor } from "./ViewQueryExecutor.js";
9
+ export interface PreparedMantleStorage {
10
+ readonly entries: EntryRepository & EntryReader;
11
+ readonly views: ViewQueryExecutor;
12
+ readonly localePolicy?: LocalePolicyReader;
13
+ readonly siteConfig?: SiteConfigRepository;
14
+ readonly mediaAssets?: MediaAssetRepository;
15
+ readonly pendingUploads?: PendingUploadRepository;
16
+ }
17
+ /** Prepare one immutable plan against storage already owned by the host. */
18
+ export interface MantleStorageAdapter {
19
+ /** Native View dialects accepted by this adapter. Declarative Views are required. */
20
+ readonly nativeViewDialects?: readonly string[];
21
+ prepare(plan: RuntimePlan): Promise<PreparedMantleStorage>;
22
+ }
23
+ //# sourceMappingURL=MantleStorageAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MantleStorageAdapter.d.ts","sourceRoot":"","sources":["../../../src/domain/port/MantleStorageAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,cAAc,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,qFAAqF;IACrF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MantleStorageAdapter.js.map