@abloatai/transaction 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (737) hide show
  1. package/CONVENTIONS.md +51 -41
  2. package/README.md +3 -1
  3. package/dist/ai-sdk/modelTools.d.ts +3 -3
  4. package/dist/ai-sdk/modelTools.d.ts.map +1 -1
  5. package/dist/ai-sdk/modelTools.js +1 -1
  6. package/dist/ai-sdk/modelTools.js.map +1 -1
  7. package/dist/ai-sdk/updateTool.d.ts +5 -7
  8. package/dist/ai-sdk/updateTool.d.ts.map +1 -1
  9. package/dist/ai-sdk/updateTool.js +3 -5
  10. package/dist/ai-sdk/updateTool.js.map +1 -1
  11. package/dist/auth/capability.d.ts +5 -0
  12. package/dist/auth/capability.d.ts.map +1 -1
  13. package/dist/auth/capability.js +5 -0
  14. package/dist/auth/capability.js.map +1 -1
  15. package/dist/auth/capabilityLifecycle.d.ts +1 -1
  16. package/dist/auth/capabilityLifecycle.d.ts.map +1 -1
  17. package/dist/auth/credentialPolicy.d.ts +1 -1
  18. package/dist/auth/credentialPolicy.d.ts.map +1 -1
  19. package/dist/auth/identity.d.ts +3 -3
  20. package/dist/auth/identity.d.ts.map +1 -1
  21. package/dist/auth/identity.js +5 -5
  22. package/dist/auth/identity.js.map +1 -1
  23. package/dist/auth/index.d.ts +4 -208
  24. package/dist/auth/index.d.ts.map +1 -1
  25. package/dist/auth/index.js +4 -330
  26. package/dist/auth/index.js.map +1 -1
  27. package/dist/auth/runtime.d.ts +218 -0
  28. package/dist/auth/runtime.d.ts.map +1 -0
  29. package/dist/auth/runtime.js +336 -0
  30. package/dist/auth/runtime.js.map +1 -0
  31. package/dist/auth/sessionMint.d.ts +1 -1
  32. package/dist/auth/sessionMint.d.ts.map +1 -1
  33. package/dist/auth/sessionMint.js +2 -1
  34. package/dist/auth/sessionMint.js.map +1 -1
  35. package/dist/branches.d.ts +25 -21
  36. package/dist/branches.d.ts.map +1 -1
  37. package/dist/branches.js +3 -0
  38. package/dist/branches.js.map +1 -1
  39. package/dist/{coordination/awaitClaimGrant.d.ts → claims/awaitGrant.d.ts} +1 -1
  40. package/dist/claims/awaitGrant.d.ts.map +1 -0
  41. package/dist/{coordination/awaitClaimGrant.js → claims/awaitGrant.js} +4 -4
  42. package/dist/claims/awaitGrant.js.map +1 -0
  43. package/dist/{wire/claims.d.ts → claims/contract.d.ts} +1 -1
  44. package/dist/claims/contract.d.ts.map +1 -0
  45. package/dist/{wire/claims.js → claims/contract.js} +2 -2
  46. package/dist/claims/contract.js.map +1 -0
  47. package/dist/{wire/claimEvent.d.ts → claims/eventContract.d.ts} +1 -1
  48. package/dist/claims/eventContract.d.ts.map +1 -0
  49. package/dist/{wire/claimEvent.js → claims/eventContract.js} +1 -1
  50. package/dist/claims/eventContract.js.map +1 -0
  51. package/dist/{coordination → claims}/events.d.ts +7 -11
  52. package/dist/claims/events.d.ts.map +1 -0
  53. package/dist/claims/events.js +8 -0
  54. package/dist/claims/events.js.map +1 -0
  55. package/dist/{coordination/claimHeartbeatLoop.d.ts → claims/heartbeat.d.ts} +1 -1
  56. package/dist/claims/heartbeat.d.ts.map +1 -0
  57. package/dist/{coordination/claimHeartbeatLoop.js → claims/heartbeat.js} +1 -1
  58. package/dist/claims/heartbeat.js.map +1 -0
  59. package/dist/claims/index.d.ts +17 -0
  60. package/dist/claims/index.d.ts.map +1 -0
  61. package/dist/claims/index.js +16 -0
  62. package/dist/claims/index.js.map +1 -0
  63. package/dist/claims/lifetime.d.ts +26 -0
  64. package/dist/claims/lifetime.d.ts.map +1 -0
  65. package/dist/claims/lifetime.js +62 -0
  66. package/dist/claims/lifetime.js.map +1 -0
  67. package/dist/{coordination → claims}/locator.d.ts +1 -1
  68. package/dist/claims/locator.d.ts.map +1 -0
  69. package/dist/{coordination → claims}/locator.js +2 -2
  70. package/dist/claims/locator.js.map +1 -0
  71. package/dist/{coordination/claimMeta.d.ts → claims/meta.d.ts} +1 -1
  72. package/dist/claims/meta.d.ts.map +1 -0
  73. package/dist/{coordination/claimMeta.js → claims/meta.js} +1 -1
  74. package/dist/claims/meta.js.map +1 -0
  75. package/dist/claims/routes.d.ts +59 -0
  76. package/dist/claims/routes.d.ts.map +1 -0
  77. package/dist/claims/routes.js +69 -0
  78. package/dist/claims/routes.js.map +1 -0
  79. package/dist/claims/targetConflict.d.ts.map +1 -0
  80. package/dist/claims/targetConflict.js.map +1 -0
  81. package/dist/{coordination → claims}/trace.d.ts +2 -2
  82. package/dist/claims/trace.d.ts.map +1 -0
  83. package/dist/{coordination → claims}/trace.js +5 -5
  84. package/dist/claims/trace.js.map +1 -0
  85. package/dist/{ablo.d.ts → client/ablo.d.ts} +6 -15
  86. package/dist/client/ablo.d.ts.map +1 -0
  87. package/dist/{ablo.js → client/ablo.js} +2 -2
  88. package/dist/client/ablo.js.map +1 -0
  89. package/dist/{transactionLayer.d.ts → client/contract.d.ts} +12 -14
  90. package/dist/client/contract.d.ts.map +1 -0
  91. package/dist/{transactionLayer.js → client/contract.js} +4 -5
  92. package/dist/client/contract.js.map +1 -0
  93. package/dist/{headlessClient.d.ts → client/headless.d.ts} +4 -4
  94. package/dist/client/headless.d.ts.map +1 -0
  95. package/dist/{headlessClient.js → client/headless.js} +8 -10
  96. package/dist/{headlessClient.js.map → client/headless.js.map} +1 -1
  97. package/dist/client/index.d.ts +11 -0
  98. package/dist/client/index.d.ts.map +1 -0
  99. package/dist/client/index.js +11 -0
  100. package/dist/client/index.js.map +1 -0
  101. package/dist/{resources → client/resources}/functionalUpdate.d.ts +4 -4
  102. package/dist/client/resources/functionalUpdate.d.ts.map +1 -0
  103. package/dist/{resources → client/resources}/functionalUpdate.js +3 -3
  104. package/dist/client/resources/functionalUpdate.js.map +1 -0
  105. package/dist/{resources → client/resources}/httpResources.d.ts +51 -57
  106. package/dist/client/resources/httpResources.d.ts.map +1 -0
  107. package/dist/{resources → client/resources}/httpResources.js +1 -1
  108. package/dist/client/resources/httpResources.js.map +1 -0
  109. package/dist/{resources → client/resources}/modelCreate.d.ts +1 -1
  110. package/dist/client/resources/modelCreate.d.ts.map +1 -0
  111. package/dist/{resources → client/resources}/modelCreate.js +1 -1
  112. package/dist/client/resources/modelCreate.js.map +1 -0
  113. package/dist/{resources → client/resources}/modelOperations.d.ts +35 -51
  114. package/dist/client/resources/modelOperations.d.ts.map +1 -0
  115. package/dist/{resources → client/resources}/modelOperations.js +1 -1
  116. package/dist/client/resources/modelOperations.js.map +1 -0
  117. package/dist/{resources → client/resources}/mutationOptions.d.ts +4 -17
  118. package/dist/client/resources/mutationOptions.d.ts.map +1 -0
  119. package/dist/client/resources/mutationOptions.js.map +1 -0
  120. package/dist/client/resources/where.d.ts.map +1 -0
  121. package/dist/{resources → client/resources}/where.js +1 -1
  122. package/dist/client/resources/where.js.map +1 -0
  123. package/dist/{resources → client/resources}/writeOptionsSchema.d.ts +2 -35
  124. package/dist/client/resources/writeOptionsSchema.d.ts.map +1 -0
  125. package/dist/{resources → client/resources}/writeOptionsSchema.js +5 -18
  126. package/dist/client/resources/writeOptionsSchema.js.map +1 -0
  127. package/dist/{transactions → commit}/confirmation/commitEnvelope.d.ts +1 -37
  128. package/dist/commit/confirmation/commitEnvelope.d.ts.map +1 -0
  129. package/dist/{transactions → commit}/confirmation/commitEnvelope.js +2 -7
  130. package/dist/commit/confirmation/commitEnvelope.js.map +1 -0
  131. package/dist/commit/confirmation/httpCommitEnvelope.d.ts.map +1 -0
  132. package/dist/{transactions → commit}/confirmation/httpCommitEnvelope.js +1 -1
  133. package/dist/commit/confirmation/httpCommitEnvelope.js.map +1 -0
  134. package/dist/commit/confirmation/idempotencyKey.d.ts.map +1 -0
  135. package/dist/commit/confirmation/idempotencyKey.js.map +1 -0
  136. package/dist/{transactions → commit}/confirmation/pendingWrite.d.ts +2 -33
  137. package/dist/commit/confirmation/pendingWrite.d.ts.map +1 -0
  138. package/dist/{transactions → commit}/confirmation/pendingWrite.js +1 -1
  139. package/dist/commit/confirmation/pendingWrite.js.map +1 -0
  140. package/dist/commit/contract.d.ts +1404 -0
  141. package/dist/commit/contract.d.ts.map +1 -0
  142. package/dist/{wire/commit.js → commit/contract.js} +13 -20
  143. package/dist/commit/contract.js.map +1 -0
  144. package/dist/{durableWrites.d.ts → commit/durableWrites.d.ts} +6 -6
  145. package/dist/commit/durableWrites.d.ts.map +1 -0
  146. package/dist/{durableWrites.js → commit/durableWrites.js} +5 -5
  147. package/dist/commit/durableWrites.js.map +1 -0
  148. package/dist/{transport/httpCommitRequest.d.ts → commit/httpRequest.d.ts} +6 -6
  149. package/dist/commit/httpRequest.d.ts.map +1 -0
  150. package/dist/{transport/httpCommitRequest.js → commit/httpRequest.js} +2 -3
  151. package/dist/commit/httpRequest.js.map +1 -0
  152. package/dist/commit/index.d.ts +17 -0
  153. package/dist/commit/index.d.ts.map +1 -0
  154. package/dist/commit/index.js +17 -0
  155. package/dist/commit/index.js.map +1 -0
  156. package/dist/{readSetContext.d.ts → commit/readSetContext.d.ts} +7 -15
  157. package/dist/commit/readSetContext.d.ts.map +1 -0
  158. package/dist/{readSetContext.js → commit/readSetContext.js} +10 -25
  159. package/dist/commit/readSetContext.js.map +1 -0
  160. package/dist/{commitRecordRuntime.d.ts → commit/recordRuntime.d.ts} +3 -5
  161. package/dist/commit/recordRuntime.d.ts.map +1 -0
  162. package/dist/{commitRecordRuntime.js → commit/recordRuntime.js} +13 -54
  163. package/dist/commit/recordRuntime.js.map +1 -0
  164. package/dist/coordination/index.d.ts +6 -8
  165. package/dist/coordination/index.d.ts.map +1 -1
  166. package/dist/coordination/index.js +3 -9
  167. package/dist/coordination/index.js.map +1 -1
  168. package/dist/coordination/schema.d.ts +11 -459
  169. package/dist/coordination/schema.d.ts.map +1 -1
  170. package/dist/coordination/schema.js +13 -261
  171. package/dist/coordination/schema.js.map +1 -1
  172. package/dist/errorCodes.d.ts +15 -9
  173. package/dist/errorCodes.d.ts.map +1 -1
  174. package/dist/errorCodes.js +13 -6
  175. package/dist/errorCodes.js.map +1 -1
  176. package/dist/errorObservation.d.ts +2 -2
  177. package/dist/errors.d.ts +3 -2
  178. package/dist/errors.d.ts.map +1 -1
  179. package/dist/errors.js +27 -11
  180. package/dist/errors.js.map +1 -1
  181. package/dist/index.d.ts +7 -7
  182. package/dist/index.d.ts.map +1 -1
  183. package/dist/index.js +3 -3
  184. package/dist/index.js.map +1 -1
  185. package/dist/internal/read-set.d.ts +3 -3
  186. package/dist/internal/read-set.d.ts.map +1 -1
  187. package/dist/internal/read-set.js +2 -2
  188. package/dist/internal/read-set.js.map +1 -1
  189. package/dist/observability.d.ts +4 -4
  190. package/dist/observability.d.ts.map +1 -1
  191. package/dist/observability.js +2 -2
  192. package/dist/{wire/delta.d.ts → observation/contract.d.ts} +8 -8
  193. package/dist/observation/contract.d.ts.map +1 -0
  194. package/dist/{wire/delta.js → observation/contract.js} +3 -3
  195. package/dist/observation/contract.js.map +1 -0
  196. package/dist/{wire/feedCursor.d.ts → observation/cursor.d.ts} +1 -1
  197. package/dist/observation/cursor.d.ts.map +1 -0
  198. package/dist/{wire/feedCursor.js → observation/cursor.js} +1 -1
  199. package/dist/observation/cursor.js.map +1 -0
  200. package/dist/{wire/deltaDelivery.d.ts → observation/deliveryContract.d.ts} +1 -1
  201. package/dist/observation/deliveryContract.d.ts.map +1 -0
  202. package/dist/{wire/deltaDelivery.js → observation/deliveryContract.js} +1 -1
  203. package/dist/observation/deliveryContract.js.map +1 -0
  204. package/dist/{wire/feedEvent.d.ts → observation/feedContract.d.ts} +10 -10
  205. package/dist/observation/feedContract.d.ts.map +1 -0
  206. package/dist/{wire/feedEvent.js → observation/feedContract.js} +4 -4
  207. package/dist/observation/feedContract.js.map +1 -0
  208. package/dist/observation/httpFeed.d.ts +4 -0
  209. package/dist/observation/httpFeed.d.ts.map +1 -0
  210. package/dist/{transport → observation}/httpFeed.js +1 -1
  211. package/dist/{transport → observation}/httpFeed.js.map +1 -1
  212. package/dist/observation/index.d.ts +13 -0
  213. package/dist/observation/index.d.ts.map +1 -0
  214. package/dist/observation/index.js +13 -0
  215. package/dist/observation/index.js.map +1 -0
  216. package/dist/{log → observation/persistence}/syncDeltaRow.d.ts +8 -8
  217. package/dist/observation/persistence/syncDeltaRow.d.ts.map +1 -0
  218. package/dist/{log → observation/persistence}/syncDeltaRow.js +4 -4
  219. package/dist/observation/persistence/syncDeltaRow.js.map +1 -0
  220. package/dist/pricing.d.ts +20 -12
  221. package/dist/pricing.d.ts.map +1 -1
  222. package/dist/pricing.js +46 -26
  223. package/dist/pricing.js.map +1 -1
  224. package/dist/schema/index.d.ts +5 -6
  225. package/dist/schema/index.d.ts.map +1 -1
  226. package/dist/schema/index.js +4 -7
  227. package/dist/schema/index.js.map +1 -1
  228. package/dist/schema/model.d.ts +0 -27
  229. package/dist/schema/model.d.ts.map +1 -1
  230. package/dist/schema/model.js +0 -2
  231. package/dist/schema/model.js.map +1 -1
  232. package/dist/schema/openapi.d.ts.map +1 -1
  233. package/dist/schema/openapi.js +45 -6
  234. package/dist/schema/openapi.js.map +1 -1
  235. package/dist/schema/schema.d.ts +11 -3
  236. package/dist/schema/schema.d.ts.map +1 -1
  237. package/dist/schema/schema.js +9 -2
  238. package/dist/schema/schema.js.map +1 -1
  239. package/dist/schema/serialize.d.ts +1 -4
  240. package/dist/schema/serialize.d.ts.map +1 -1
  241. package/dist/schema/serialize.js +0 -4
  242. package/dist/schema/serialize.js.map +1 -1
  243. package/dist/schema/tenancy.d.ts +1 -1
  244. package/dist/server/adapter.d.ts +1 -1
  245. package/dist/server/adapter.d.ts.map +1 -1
  246. package/dist/server/commit.d.ts +6 -14
  247. package/dist/server/commit.d.ts.map +1 -1
  248. package/dist/server/index.d.ts +1 -1
  249. package/dist/server/index.d.ts.map +1 -1
  250. package/dist/server/index.js +1 -1
  251. package/dist/server/index.js.map +1 -1
  252. package/dist/server/storageMode.d.ts +1 -1
  253. package/dist/source/{adapter.d.ts → adapters/adapter.d.ts} +10 -4
  254. package/dist/source/adapters/adapter.d.ts.map +1 -0
  255. package/dist/source/adapters/adapter.js.map +1 -0
  256. package/dist/source/adapters/adapterFactory.d.ts.map +1 -0
  257. package/dist/source/{adapterFactory.js → adapters/adapterFactory.js} +1 -1
  258. package/dist/source/adapters/adapterFactory.js.map +1 -0
  259. package/dist/source/adapters/adapterProfile.d.ts.map +1 -0
  260. package/dist/source/adapters/adapterProfile.js.map +1 -0
  261. package/dist/source/{conformance.d.ts → adapters/conformance.d.ts} +1 -1
  262. package/dist/source/adapters/conformance.d.ts.map +1 -0
  263. package/dist/source/{conformance.js → adapters/conformance.js} +1 -1
  264. package/dist/source/adapters/conformance.js.map +1 -0
  265. package/dist/source/{contract.d.ts → adapters/contract.d.ts} +8 -77
  266. package/dist/source/adapters/contract.d.ts.map +1 -0
  267. package/dist/source/{contract.js → adapters/contract.js} +12 -57
  268. package/dist/source/adapters/contract.js.map +1 -0
  269. package/dist/source/adapters/drizzle.d.ts +1 -1
  270. package/dist/source/adapters/drizzle.d.ts.map +1 -1
  271. package/dist/source/adapters/drizzle.js +21 -23
  272. package/dist/source/adapters/drizzle.js.map +1 -1
  273. package/dist/source/adapters/idempotency.d.ts.map +1 -0
  274. package/dist/source/{idempotency.js → adapters/idempotency.js} +2 -2
  275. package/dist/source/adapters/idempotency.js.map +1 -0
  276. package/dist/source/adapters/index.d.ts +21 -0
  277. package/dist/source/adapters/index.d.ts.map +1 -0
  278. package/dist/source/adapters/index.js +21 -0
  279. package/dist/source/adapters/index.js.map +1 -0
  280. package/dist/source/adapters/kysely.d.ts +1 -1
  281. package/dist/source/adapters/kysely.d.ts.map +1 -1
  282. package/dist/source/adapters/kysely.js +18 -20
  283. package/dist/source/adapters/kysely.js.map +1 -1
  284. package/dist/source/adapters/kyselyMutationCore.d.ts +2 -2
  285. package/dist/source/adapters/kyselyMutationCore.d.ts.map +1 -1
  286. package/dist/source/adapters/kyselyMutationCore.js +1 -1
  287. package/dist/source/adapters/kyselyMutationCore.js.map +1 -1
  288. package/dist/source/adapters/memory.d.ts +3 -3
  289. package/dist/source/adapters/memory.d.ts.map +1 -1
  290. package/dist/source/adapters/memory.js +19 -7
  291. package/dist/source/adapters/memory.js.map +1 -1
  292. package/dist/source/adapters/migration.d.ts +8 -0
  293. package/dist/source/adapters/migration.d.ts.map +1 -0
  294. package/dist/source/adapters/migration.js +9 -0
  295. package/dist/source/adapters/migration.js.map +1 -0
  296. package/dist/source/{migrations.d.ts → adapters/migrations.d.ts} +3 -4
  297. package/dist/source/adapters/migrations.d.ts.map +1 -0
  298. package/dist/source/{migrations.js → adapters/migrations.js} +4 -52
  299. package/dist/source/adapters/migrations.js.map +1 -0
  300. package/dist/source/adapters/prisma.d.ts +1 -1
  301. package/dist/source/adapters/prisma.d.ts.map +1 -1
  302. package/dist/source/adapters/prisma.js +21 -28
  303. package/dist/source/adapters/prisma.js.map +1 -1
  304. package/dist/source/{subjectAuthorization.d.ts → adapters/subjectAuthorization.d.ts} +1 -1
  305. package/dist/source/adapters/subjectAuthorization.d.ts.map +1 -0
  306. package/dist/source/{subjectAuthorization.js → adapters/subjectAuthorization.js} +2 -2
  307. package/dist/source/adapters/subjectAuthorization.js.map +1 -0
  308. package/dist/source/{connector.d.ts → connector/client.d.ts} +6 -1
  309. package/dist/source/connector/client.d.ts.map +1 -0
  310. package/dist/source/{connector.js → connector/client.js} +28 -11
  311. package/dist/source/connector/client.js.map +1 -0
  312. package/dist/source/connector/index.d.ts +4 -0
  313. package/dist/source/connector/index.d.ts.map +1 -0
  314. package/dist/source/connector/index.js +4 -0
  315. package/dist/source/connector/index.js.map +1 -0
  316. package/dist/source/{connectorProtocol.d.ts → connector/protocol.d.ts} +8 -1
  317. package/dist/source/connector/protocol.d.ts.map +1 -0
  318. package/dist/source/{connectorProtocol.js → connector/protocol.js} +10 -3
  319. package/dist/source/connector/protocol.js.map +1 -0
  320. package/dist/source/delivery/index.d.ts +3 -0
  321. package/dist/source/delivery/index.d.ts.map +1 -0
  322. package/dist/source/delivery/index.js +3 -0
  323. package/dist/source/delivery/index.js.map +1 -0
  324. package/dist/source/{pushQueue.d.ts → delivery/pushQueue.d.ts} +1 -1
  325. package/dist/source/delivery/pushQueue.d.ts.map +1 -0
  326. package/dist/source/{pushQueue.js → delivery/pushQueue.js} +1 -1
  327. package/dist/source/delivery/pushQueue.js.map +1 -0
  328. package/dist/source/{factory.d.ts → endpoint/factory.d.ts} +3 -3
  329. package/dist/source/endpoint/factory.d.ts.map +1 -0
  330. package/dist/source/{factory.js → endpoint/factory.js} +9 -4
  331. package/dist/source/endpoint/factory.js.map +1 -0
  332. package/dist/source/endpoint/index.d.ts +5 -0
  333. package/dist/source/endpoint/index.d.ts.map +1 -0
  334. package/dist/source/endpoint/index.js +5 -0
  335. package/dist/source/endpoint/index.js.map +1 -0
  336. package/dist/source/{next.d.ts → endpoint/next.d.ts} +2 -2
  337. package/dist/source/endpoint/next.d.ts.map +1 -0
  338. package/dist/source/{next.js → endpoint/next.js} +1 -1
  339. package/dist/source/endpoint/next.js.map +1 -0
  340. package/dist/source/{signing.d.ts → endpoint/signing.d.ts} +1 -1
  341. package/dist/source/endpoint/signing.d.ts.map +1 -0
  342. package/dist/source/{signing.js → endpoint/signing.js} +1 -1
  343. package/dist/source/endpoint/signing.js.map +1 -0
  344. package/dist/source/index.d.ts +14 -12
  345. package/dist/source/index.d.ts.map +1 -1
  346. package/dist/source/index.js +13 -11
  347. package/dist/source/index.js.map +1 -1
  348. package/dist/source/outbox/contract.d.ts +50 -0
  349. package/dist/source/outbox/contract.d.ts.map +1 -0
  350. package/dist/source/outbox/contract.js +50 -0
  351. package/dist/source/outbox/contract.js.map +1 -0
  352. package/dist/source/outbox/envelope.d.ts +9 -0
  353. package/dist/source/outbox/envelope.d.ts.map +1 -0
  354. package/dist/source/outbox/envelope.js +36 -0
  355. package/dist/source/outbox/envelope.js.map +1 -0
  356. package/dist/source/outbox/index.d.ts +11 -0
  357. package/dist/source/outbox/index.d.ts.map +1 -0
  358. package/dist/source/outbox/index.js +11 -0
  359. package/dist/source/outbox/index.js.map +1 -0
  360. package/dist/source/outbox/migrations.d.ts +4 -0
  361. package/dist/source/outbox/migrations.d.ts.map +1 -0
  362. package/dist/source/outbox/migrations.js +67 -0
  363. package/dist/source/outbox/migrations.js.map +1 -0
  364. package/dist/source/outbox/retention.d.ts +3 -0
  365. package/dist/source/outbox/retention.d.ts.map +1 -0
  366. package/dist/source/outbox/retention.js +3 -0
  367. package/dist/source/outbox/retention.js.map +1 -0
  368. package/dist/source/types.d.ts +16 -17
  369. package/dist/source/types.d.ts.map +1 -1
  370. package/dist/source/types.js +1 -0
  371. package/dist/source/types.js.map +1 -1
  372. package/dist/syncLog/contract.d.ts +19 -2
  373. package/dist/syncLog/contract.d.ts.map +1 -1
  374. package/dist/syncLog/contract.js +19 -2
  375. package/dist/syncLog/contract.js.map +1 -1
  376. package/dist/transport/{credentialLifecycle.d.ts → connection/credentialLifecycle.d.ts} +3 -3
  377. package/dist/transport/connection/credentialLifecycle.d.ts.map +1 -0
  378. package/dist/transport/{credentialLifecycle.js → connection/credentialLifecycle.js} +2 -2
  379. package/dist/transport/connection/credentialLifecycle.js.map +1 -0
  380. package/dist/transport/connection/index.d.ts +5 -0
  381. package/dist/transport/connection/index.d.ts.map +1 -0
  382. package/dist/transport/connection/index.js +5 -0
  383. package/dist/transport/connection/index.js.map +1 -0
  384. package/dist/transport/{connectionManager.d.ts → connection/manager.d.ts} +13 -5
  385. package/dist/transport/connection/manager.d.ts.map +1 -0
  386. package/dist/transport/{connectionManager.js → connection/manager.js} +6 -4
  387. package/dist/transport/connection/manager.js.map +1 -0
  388. package/dist/transport/{networkProbe.d.ts → connection/networkProbe.d.ts} +2 -2
  389. package/dist/transport/connection/networkProbe.d.ts.map +1 -0
  390. package/dist/transport/{networkProbe.js → connection/networkProbe.js} +4 -4
  391. package/dist/transport/connection/networkProbe.js.map +1 -0
  392. package/dist/transport/{httpClient.d.ts → http/client.d.ts} +26 -45
  393. package/dist/transport/http/client.d.ts.map +1 -0
  394. package/dist/transport/{httpClient.js → http/client.js} +84 -124
  395. package/dist/transport/http/client.js.map +1 -0
  396. package/dist/transport/{httpTransportHelpers.d.ts → http/helpers.d.ts} +5 -5
  397. package/dist/transport/http/helpers.d.ts.map +1 -0
  398. package/dist/transport/{httpTransportHelpers.js → http/helpers.js} +5 -5
  399. package/dist/transport/http/helpers.js.map +1 -0
  400. package/dist/transport/http/index.d.ts +6 -0
  401. package/dist/transport/http/index.d.ts.map +1 -0
  402. package/dist/transport/http/index.js +6 -0
  403. package/dist/transport/http/index.js.map +1 -0
  404. package/dist/transport/{httpOptions.d.ts → http/options.d.ts} +7 -7
  405. package/dist/transport/{httpOptions.d.ts.map → http/options.d.ts.map} +1 -1
  406. package/dist/transport/{httpOptions.js → http/options.js} +1 -1
  407. package/dist/transport/http/options.js.map +1 -0
  408. package/dist/transport/http/subscription.d.ts +16 -0
  409. package/dist/transport/http/subscription.d.ts.map +1 -0
  410. package/dist/transport/http/subscription.js +146 -0
  411. package/dist/transport/http/subscription.js.map +1 -0
  412. package/dist/transport/{httpTransport.d.ts → http/transport.d.ts} +9 -6
  413. package/dist/transport/http/transport.d.ts.map +1 -0
  414. package/dist/transport/{httpTransport.js → http/transport.js} +95 -93
  415. package/dist/transport/http/transport.js.map +1 -0
  416. package/dist/transport/index.d.ts +8 -0
  417. package/dist/transport/index.d.ts.map +1 -0
  418. package/dist/transport/index.js +8 -0
  419. package/dist/transport/index.js.map +1 -0
  420. package/dist/transport/{commitFrames.d.ts → websocket/commitFrames.d.ts} +8 -20
  421. package/dist/transport/websocket/commitFrames.d.ts.map +1 -0
  422. package/dist/transport/{commitFrames.js → websocket/commitFrames.js} +6 -25
  423. package/dist/transport/websocket/commitFrames.js.map +1 -0
  424. package/dist/transport/{wsFrameHandlers.d.ts → websocket/frameHandlers.d.ts} +5 -5
  425. package/dist/transport/websocket/frameHandlers.d.ts.map +1 -0
  426. package/dist/transport/{wsFrameHandlers.js → websocket/frameHandlers.js} +10 -51
  427. package/dist/transport/websocket/frameHandlers.js.map +1 -0
  428. package/dist/transport/{heartbeat.d.ts → websocket/heartbeat.d.ts} +1 -1
  429. package/dist/transport/websocket/heartbeat.d.ts.map +1 -0
  430. package/dist/transport/{heartbeat.js → websocket/heartbeat.js} +2 -2
  431. package/dist/transport/websocket/heartbeat.js.map +1 -0
  432. package/dist/transport/websocket/index.d.ts +6 -0
  433. package/dist/transport/websocket/index.d.ts.map +1 -0
  434. package/dist/transport/websocket/index.js +6 -0
  435. package/dist/transport/websocket/index.js.map +1 -0
  436. package/dist/transport/{wsTransport.d.ts → websocket/transport.d.ts} +13 -25
  437. package/dist/transport/websocket/transport.d.ts.map +1 -0
  438. package/dist/transport/{wsTransport.js → websocket/transport.js} +14 -14
  439. package/dist/transport/websocket/transport.js.map +1 -0
  440. package/dist/types/index.d.ts +1 -1
  441. package/dist/types/index.d.ts.map +1 -1
  442. package/dist/types/streams.d.ts +8 -48
  443. package/dist/types/streams.d.ts.map +1 -1
  444. package/dist/types/streams.js +2 -2
  445. package/dist/wire/accountResponses.d.ts +4 -72
  446. package/dist/wire/accountResponses.d.ts.map +1 -1
  447. package/dist/wire/accountResponses.js +2 -10
  448. package/dist/wire/accountResponses.js.map +1 -1
  449. package/dist/wire/frames.d.ts +6 -83
  450. package/dist/wire/frames.d.ts.map +1 -1
  451. package/dist/wire/frames.js +4 -11
  452. package/dist/wire/frames.js.map +1 -1
  453. package/dist/wire/inboundFrames.d.ts +6 -131
  454. package/dist/wire/inboundFrames.d.ts.map +1 -1
  455. package/dist/wire/inboundFrames.js +3 -3
  456. package/dist/wire/inboundFrames.js.map +1 -1
  457. package/dist/wire/index.d.ts +17 -15
  458. package/dist/wire/index.d.ts.map +1 -1
  459. package/dist/wire/index.js +11 -8
  460. package/dist/wire/index.js.map +1 -1
  461. package/dist/wire/modelMutations.d.ts +1 -32
  462. package/dist/wire/modelMutations.d.ts.map +1 -1
  463. package/dist/wire/modelMutations.js +1 -8
  464. package/dist/wire/modelMutations.js.map +1 -1
  465. package/package.json +130 -10
  466. package/src/ai-sdk/modelTools.ts +5 -5
  467. package/src/ai-sdk/updateTool.ts +5 -7
  468. package/src/auth/capability.ts +5 -0
  469. package/src/auth/capabilityLifecycle.ts +1 -1
  470. package/src/auth/credentialPolicy.ts +1 -1
  471. package/src/auth/identity.ts +7 -7
  472. package/src/auth/index.ts +4 -663
  473. package/src/auth/runtime.ts +669 -0
  474. package/src/auth/sessionMint.ts +3 -2
  475. package/src/branches.ts +3 -0
  476. package/src/{coordination/awaitClaimGrant.ts → claims/awaitGrant.ts} +4 -4
  477. package/src/{wire/claims.ts → claims/contract.ts} +1 -1
  478. package/src/{coordination → claims}/events.ts +7 -11
  479. package/src/claims/index.ts +21 -0
  480. package/src/claims/lifetime.ts +78 -0
  481. package/src/{coordination → claims}/locator.ts +3 -3
  482. package/src/claims/routes.ts +81 -0
  483. package/src/{coordination → claims}/trace.ts +5 -5
  484. package/src/{ablo.ts → client/ablo.ts} +8 -20
  485. package/src/{transactionLayer.ts → client/contract.ts} +11 -13
  486. package/src/{headlessClient.ts → client/headless.ts} +13 -15
  487. package/src/client/index.ts +10 -0
  488. package/src/{resources → client/resources}/functionalUpdate.ts +4 -4
  489. package/src/{resources → client/resources}/httpResources.ts +48 -68
  490. package/src/{resources → client/resources}/modelCreate.ts +2 -2
  491. package/src/{resources → client/resources}/modelOperations.ts +46 -55
  492. package/src/{resources → client/resources}/mutationOptions.ts +4 -17
  493. package/src/{resources → client/resources}/where.ts +1 -1
  494. package/src/{resources → client/resources}/writeOptionsSchema.ts +7 -27
  495. package/src/{transactions → commit}/confirmation/commitEnvelope.ts +2 -12
  496. package/src/{transactions → commit}/confirmation/httpCommitEnvelope.ts +1 -1
  497. package/src/{transactions → commit}/confirmation/pendingWrite.ts +1 -1
  498. package/src/{wire/commit.ts → commit/contract.ts} +11 -25
  499. package/src/{durableWrites.ts → commit/durableWrites.ts} +7 -7
  500. package/src/{transport/httpCommitRequest.ts → commit/httpRequest.ts} +6 -7
  501. package/src/commit/index.ts +16 -0
  502. package/src/{readSetContext.ts → commit/readSetContext.ts} +16 -41
  503. package/src/{commitRecordRuntime.ts → commit/recordRuntime.ts} +12 -67
  504. package/src/coordination/index.ts +4 -52
  505. package/src/coordination/schema.ts +15 -302
  506. package/src/errorCodes.ts +56 -10
  507. package/src/errors.ts +32 -10
  508. package/src/index.ts +8 -8
  509. package/src/internal/read-set.ts +3 -6
  510. package/src/observability.ts +4 -4
  511. package/src/{wire/delta.ts → observation/contract.ts} +2 -2
  512. package/src/{wire/feedEvent.ts → observation/feedContract.ts} +3 -4
  513. package/src/{transport → observation}/httpFeed.ts +3 -3
  514. package/src/observation/index.ts +12 -0
  515. package/src/{log → observation/persistence}/syncDeltaRow.ts +6 -7
  516. package/src/pricing.ts +46 -25
  517. package/src/schema/index.ts +4 -20
  518. package/src/schema/model.ts +0 -33
  519. package/src/schema/openapi.ts +47 -7
  520. package/src/schema/schema.ts +23 -3
  521. package/src/schema/serialize.ts +0 -8
  522. package/src/server/adapter.ts +1 -1
  523. package/src/server/commit.ts +6 -14
  524. package/src/server/index.ts +1 -1
  525. package/src/source/{adapter.ts → adapters/adapter.ts} +9 -5
  526. package/src/source/{adapterFactory.ts → adapters/adapterFactory.ts} +1 -1
  527. package/src/source/{conformance.ts → adapters/conformance.ts} +1 -1
  528. package/src/source/{contract.ts → adapters/contract.ts} +16 -64
  529. package/src/source/adapters/drizzle.ts +29 -27
  530. package/src/source/{idempotency.ts → adapters/idempotency.ts} +2 -2
  531. package/src/source/adapters/index.ts +20 -0
  532. package/src/source/adapters/kysely.ts +32 -25
  533. package/src/source/adapters/kyselyMutationCore.ts +3 -3
  534. package/src/source/adapters/memory.ts +25 -9
  535. package/src/source/adapters/migration.ts +11 -0
  536. package/src/source/{migrations.ts → adapters/migrations.ts} +6 -54
  537. package/src/source/adapters/prisma.ts +33 -32
  538. package/src/source/{subjectAuthorization.ts → adapters/subjectAuthorization.ts} +2 -2
  539. package/src/source/{connector.ts → connector/client.ts} +35 -12
  540. package/src/source/connector/index.ts +3 -0
  541. package/src/source/{connectorProtocol.ts → connector/protocol.ts} +10 -2
  542. package/src/source/delivery/index.ts +2 -0
  543. package/src/source/{pushQueue.ts → delivery/pushQueue.ts} +2 -2
  544. package/src/source/{factory.ts → endpoint/factory.ts} +13 -8
  545. package/src/source/endpoint/index.ts +4 -0
  546. package/src/source/{next.ts → endpoint/next.ts} +2 -2
  547. package/src/source/{signing.ts → endpoint/signing.ts} +1 -1
  548. package/src/source/index.ts +22 -19
  549. package/src/source/outbox/contract.ts +56 -0
  550. package/src/source/outbox/envelope.ts +47 -0
  551. package/src/source/outbox/index.ts +15 -0
  552. package/src/source/outbox/migrations.ts +71 -0
  553. package/src/source/outbox/retention.ts +2 -0
  554. package/src/source/types.ts +17 -17
  555. package/src/syncLog/contract.ts +19 -2
  556. package/src/transport/{credentialLifecycle.ts → connection/credentialLifecycle.ts} +3 -3
  557. package/src/transport/connection/index.ts +4 -0
  558. package/src/transport/{connectionManager.ts → connection/manager.ts} +13 -4
  559. package/src/transport/{networkProbe.ts → connection/networkProbe.ts} +4 -4
  560. package/src/transport/{httpClient.ts → http/client.ts} +128 -209
  561. package/src/transport/{httpTransportHelpers.ts → http/helpers.ts} +7 -7
  562. package/src/transport/http/index.ts +5 -0
  563. package/src/transport/{httpOptions.ts → http/options.ts} +6 -6
  564. package/src/transport/http/subscription.ts +174 -0
  565. package/src/transport/{httpTransport.ts → http/transport.ts} +127 -113
  566. package/src/transport/index.ts +7 -0
  567. package/src/transport/{commitFrames.ts → websocket/commitFrames.ts} +14 -46
  568. package/src/transport/{wsFrameHandlers.ts → websocket/frameHandlers.ts} +11 -54
  569. package/src/transport/{heartbeat.ts → websocket/heartbeat.ts} +2 -2
  570. package/src/transport/websocket/index.ts +5 -0
  571. package/src/transport/{wsTransport.ts → websocket/transport.ts} +16 -30
  572. package/src/types/index.ts +2 -6
  573. package/src/types/streams.ts +7 -61
  574. package/src/webhooks/events.ts +1 -1
  575. package/src/wire/accountResponses.ts +3 -12
  576. package/src/wire/frames.ts +5 -15
  577. package/src/wire/inboundFrames.ts +3 -3
  578. package/src/wire/index.ts +19 -15
  579. package/src/wire/modelMutations.ts +1 -14
  580. package/dist/ablo.d.ts.map +0 -1
  581. package/dist/ablo.js.map +0 -1
  582. package/dist/commitRecordRuntime.d.ts.map +0 -1
  583. package/dist/commitRecordRuntime.js.map +0 -1
  584. package/dist/coordination/awaitClaimGrant.d.ts.map +0 -1
  585. package/dist/coordination/awaitClaimGrant.js.map +0 -1
  586. package/dist/coordination/claimHeartbeatLoop.d.ts.map +0 -1
  587. package/dist/coordination/claimHeartbeatLoop.js.map +0 -1
  588. package/dist/coordination/claimMeta.d.ts.map +0 -1
  589. package/dist/coordination/claimMeta.js.map +0 -1
  590. package/dist/coordination/events.d.ts.map +0 -1
  591. package/dist/coordination/events.js +0 -8
  592. package/dist/coordination/events.js.map +0 -1
  593. package/dist/coordination/locator.d.ts.map +0 -1
  594. package/dist/coordination/locator.js.map +0 -1
  595. package/dist/coordination/targetConflict.d.ts.map +0 -1
  596. package/dist/coordination/targetConflict.js.map +0 -1
  597. package/dist/coordination/trace.d.ts.map +0 -1
  598. package/dist/coordination/trace.js.map +0 -1
  599. package/dist/durableWrites.d.ts.map +0 -1
  600. package/dist/durableWrites.js.map +0 -1
  601. package/dist/headlessClient.d.ts.map +0 -1
  602. package/dist/log/syncDeltaRow.d.ts.map +0 -1
  603. package/dist/log/syncDeltaRow.js.map +0 -1
  604. package/dist/policy/types.d.ts +0 -226
  605. package/dist/policy/types.d.ts.map +0 -1
  606. package/dist/policy/types.js +0 -127
  607. package/dist/policy/types.js.map +0 -1
  608. package/dist/readSetContext.d.ts.map +0 -1
  609. package/dist/readSetContext.js.map +0 -1
  610. package/dist/resources/functionalUpdate.d.ts.map +0 -1
  611. package/dist/resources/functionalUpdate.js.map +0 -1
  612. package/dist/resources/httpResources.d.ts.map +0 -1
  613. package/dist/resources/httpResources.js.map +0 -1
  614. package/dist/resources/modelCreate.d.ts.map +0 -1
  615. package/dist/resources/modelCreate.js.map +0 -1
  616. package/dist/resources/modelOperations.d.ts.map +0 -1
  617. package/dist/resources/modelOperations.js.map +0 -1
  618. package/dist/resources/mutationOptions.d.ts.map +0 -1
  619. package/dist/resources/mutationOptions.js.map +0 -1
  620. package/dist/resources/where.d.ts.map +0 -1
  621. package/dist/resources/where.js.map +0 -1
  622. package/dist/resources/writeOptionsSchema.d.ts.map +0 -1
  623. package/dist/resources/writeOptionsSchema.js.map +0 -1
  624. package/dist/schema/coordination.d.ts +0 -113
  625. package/dist/schema/coordination.d.ts.map +0 -1
  626. package/dist/schema/coordination.js +0 -134
  627. package/dist/schema/coordination.js.map +0 -1
  628. package/dist/source/adapter.d.ts.map +0 -1
  629. package/dist/source/adapter.js.map +0 -1
  630. package/dist/source/adapterFactory.d.ts.map +0 -1
  631. package/dist/source/adapterFactory.js.map +0 -1
  632. package/dist/source/adapterProfile.d.ts.map +0 -1
  633. package/dist/source/adapterProfile.js.map +0 -1
  634. package/dist/source/conformance.d.ts.map +0 -1
  635. package/dist/source/conformance.js.map +0 -1
  636. package/dist/source/connector.d.ts.map +0 -1
  637. package/dist/source/connector.js.map +0 -1
  638. package/dist/source/connectorProtocol.d.ts.map +0 -1
  639. package/dist/source/connectorProtocol.js.map +0 -1
  640. package/dist/source/contract.d.ts.map +0 -1
  641. package/dist/source/contract.js.map +0 -1
  642. package/dist/source/drizzle.d.ts +0 -2
  643. package/dist/source/drizzle.d.ts.map +0 -1
  644. package/dist/source/drizzle.js +0 -2
  645. package/dist/source/drizzle.js.map +0 -1
  646. package/dist/source/factory.d.ts.map +0 -1
  647. package/dist/source/factory.js.map +0 -1
  648. package/dist/source/idempotency.d.ts.map +0 -1
  649. package/dist/source/idempotency.js.map +0 -1
  650. package/dist/source/kysely.d.ts +0 -3
  651. package/dist/source/kysely.d.ts.map +0 -1
  652. package/dist/source/kysely.js +0 -3
  653. package/dist/source/kysely.js.map +0 -1
  654. package/dist/source/migrations.d.ts.map +0 -1
  655. package/dist/source/migrations.js.map +0 -1
  656. package/dist/source/next.d.ts.map +0 -1
  657. package/dist/source/next.js.map +0 -1
  658. package/dist/source/pushQueue.d.ts.map +0 -1
  659. package/dist/source/pushQueue.js.map +0 -1
  660. package/dist/source/signing.d.ts.map +0 -1
  661. package/dist/source/signing.js.map +0 -1
  662. package/dist/source/subjectAuthorization.d.ts.map +0 -1
  663. package/dist/source/subjectAuthorization.js.map +0 -1
  664. package/dist/transactionLayer.d.ts.map +0 -1
  665. package/dist/transactionLayer.js.map +0 -1
  666. package/dist/transactions/confirmation/commitEnvelope.d.ts.map +0 -1
  667. package/dist/transactions/confirmation/commitEnvelope.js.map +0 -1
  668. package/dist/transactions/confirmation/httpCommitEnvelope.d.ts.map +0 -1
  669. package/dist/transactions/confirmation/httpCommitEnvelope.js.map +0 -1
  670. package/dist/transactions/confirmation/idempotencyKey.d.ts.map +0 -1
  671. package/dist/transactions/confirmation/idempotencyKey.js.map +0 -1
  672. package/dist/transactions/confirmation/pendingWrite.d.ts.map +0 -1
  673. package/dist/transactions/confirmation/pendingWrite.js.map +0 -1
  674. package/dist/transport/commitFrames.d.ts.map +0 -1
  675. package/dist/transport/commitFrames.js.map +0 -1
  676. package/dist/transport/connectionManager.d.ts.map +0 -1
  677. package/dist/transport/connectionManager.js.map +0 -1
  678. package/dist/transport/credentialLifecycle.d.ts.map +0 -1
  679. package/dist/transport/credentialLifecycle.js.map +0 -1
  680. package/dist/transport/heartbeat.d.ts.map +0 -1
  681. package/dist/transport/heartbeat.js.map +0 -1
  682. package/dist/transport/httpClient.d.ts.map +0 -1
  683. package/dist/transport/httpClient.js.map +0 -1
  684. package/dist/transport/httpCommitRequest.d.ts.map +0 -1
  685. package/dist/transport/httpCommitRequest.js.map +0 -1
  686. package/dist/transport/httpFeed.d.ts +0 -4
  687. package/dist/transport/httpFeed.d.ts.map +0 -1
  688. package/dist/transport/httpOptions.js.map +0 -1
  689. package/dist/transport/httpTransport.d.ts.map +0 -1
  690. package/dist/transport/httpTransport.js.map +0 -1
  691. package/dist/transport/httpTransportHelpers.d.ts.map +0 -1
  692. package/dist/transport/httpTransportHelpers.js.map +0 -1
  693. package/dist/transport/networkProbe.d.ts.map +0 -1
  694. package/dist/transport/networkProbe.js.map +0 -1
  695. package/dist/transport/wsFrameHandlers.d.ts.map +0 -1
  696. package/dist/transport/wsFrameHandlers.js.map +0 -1
  697. package/dist/transport/wsTransport.d.ts.map +0 -1
  698. package/dist/transport/wsTransport.js.map +0 -1
  699. package/dist/wire/claimEvent.d.ts.map +0 -1
  700. package/dist/wire/claimEvent.js.map +0 -1
  701. package/dist/wire/claims.d.ts.map +0 -1
  702. package/dist/wire/claims.js.map +0 -1
  703. package/dist/wire/commit.d.ts +0 -2866
  704. package/dist/wire/commit.d.ts.map +0 -1
  705. package/dist/wire/commit.js.map +0 -1
  706. package/dist/wire/delta.d.ts.map +0 -1
  707. package/dist/wire/delta.js.map +0 -1
  708. package/dist/wire/deltaDelivery.d.ts.map +0 -1
  709. package/dist/wire/deltaDelivery.js.map +0 -1
  710. package/dist/wire/feedCursor.d.ts.map +0 -1
  711. package/dist/wire/feedCursor.js.map +0 -1
  712. package/dist/wire/feedEvent.d.ts.map +0 -1
  713. package/dist/wire/feedEvent.js.map +0 -1
  714. package/src/policy/types.ts +0 -300
  715. package/src/schema/coordination.ts +0 -161
  716. package/src/source/drizzle.ts +0 -1
  717. package/src/source/kysely.ts +0 -2
  718. /package/dist/{coordination → claims}/targetConflict.d.ts +0 -0
  719. /package/dist/{coordination → claims}/targetConflict.js +0 -0
  720. /package/dist/{resources → client/resources}/mutationOptions.js +0 -0
  721. /package/dist/{resources → client/resources}/where.d.ts +0 -0
  722. /package/dist/{transactions → commit}/confirmation/httpCommitEnvelope.d.ts +0 -0
  723. /package/dist/{transactions → commit}/confirmation/idempotencyKey.d.ts +0 -0
  724. /package/dist/{transactions → commit}/confirmation/idempotencyKey.js +0 -0
  725. /package/dist/source/{adapter.js → adapters/adapter.js} +0 -0
  726. /package/dist/source/{adapterFactory.d.ts → adapters/adapterFactory.d.ts} +0 -0
  727. /package/dist/source/{adapterProfile.d.ts → adapters/adapterProfile.d.ts} +0 -0
  728. /package/dist/source/{adapterProfile.js → adapters/adapterProfile.js} +0 -0
  729. /package/dist/source/{idempotency.d.ts → adapters/idempotency.d.ts} +0 -0
  730. /package/src/{wire/claimEvent.ts → claims/eventContract.ts} +0 -0
  731. /package/src/{coordination/claimHeartbeatLoop.ts → claims/heartbeat.ts} +0 -0
  732. /package/src/{coordination/claimMeta.ts → claims/meta.ts} +0 -0
  733. /package/src/{coordination → claims}/targetConflict.ts +0 -0
  734. /package/src/{transactions → commit}/confirmation/idempotencyKey.ts +0 -0
  735. /package/src/{wire/feedCursor.ts → observation/cursor.ts} +0 -0
  736. /package/src/{wire/deltaDelivery.ts → observation/deliveryContract.ts} +0 -0
  737. /package/src/source/{adapterProfile.ts → adapters/adapterProfile.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * The observability the confirmation core reports on its own behalf.
3
3
  *
4
- * Coordination outcomes — a claim changing state, a stale-write collision that
5
- * notified instead of aborting — happen with no UI and no local store anywhere,
4
+ * Coordination outcomes — a claim changing state or a rejected write collision
5
+ * — happen with no UI and no local store anywhere,
6
6
  * so the core must be able to report them without depending on the consumer's
7
7
  * full provider (ADR 0016).
8
8
  *
@@ -11,13 +11,13 @@
11
11
  * this interface, so a single implementation still satisfies both.
12
12
  */
13
13
 
14
- import type { ClaimEvent, ConflictEvent } from './coordination/events.js';
14
+ import type { ClaimEvent, ConflictEvent } from './claims/events.js';
15
15
 
16
16
  export interface CoordinationObservability {
17
17
  /** Capture a claim state change (acquired / queued / granted / lost / rejected / expired). */
18
18
  captureClaim(event: ClaimEvent): void;
19
19
 
20
- /** Capture a notify-instead-of-abort stale-write collision. */
20
+ /** Capture a rejected stale-write or foreign-claim collision. */
21
21
  captureConflict(event: ConflictEvent): void;
22
22
  }
23
23
 
@@ -6,7 +6,7 @@
6
6
  * layer, alongside the other protocol shapes in `wire/`.
7
7
  *
8
8
  * The wire delta is a projection of the stored `sync_deltas` row (the
9
- * `syncDeltaRowSchema` in `../log/syncDeltaRow.ts`) and differs from it
9
+ * `syncDeltaRowSchema` in `./persistence/syncDeltaRow.ts`) and differs from it
10
10
  * in three ways: it omits `organizationId` (the tenant-isolation predicate is
11
11
  * never broadcast), it uses the full action vocabulary (see
12
12
  * {@link syncDeltaActionSchema}) rather than plain create, update, and delete, and
@@ -26,7 +26,7 @@
26
26
  */
27
27
 
28
28
  import { z } from 'zod';
29
- import { correlationIdSchema } from './commit.js';
29
+ import { correlationIdSchema } from '../commit/contract.js';
30
30
  import { participantKindSchema } from '../coordination/schema.js';
31
31
  import type { ParticipantKind, ParticipantRef } from '../types/participant.js';
32
32
  import type { AssertExact } from '../types/assertExact.js';
@@ -14,9 +14,9 @@
14
14
  */
15
15
 
16
16
  import { z } from 'zod';
17
- import { logEventSchema, logOpSchema, type LogEvent } from './accountResponses.js';
18
- import { claimEventSchema, type ClaimEvent } from './claimEvent.js';
19
- import { listEnvelopeSchema, type ListEnvelope } from './listEnvelope.js';
17
+ import { logEventSchema, logOpSchema, type LogEvent } from '../wire/accountResponses.js';
18
+ import { claimEventSchema, type ClaimEvent } from '../claims/eventContract.js';
19
+ import { listEnvelopeSchema, type ListEnvelope } from '../wire/listEnvelope.js';
20
20
 
21
21
  /**
22
22
  * One entry, from either source. Discriminated on `object`, so a consumer
@@ -71,4 +71,3 @@ export type LogQuery = z.infer<typeof logQuerySchema>;
71
71
  * What is here is the definition the producer will fill: the union parses
72
72
  * today's pages unchanged, and the cursor already carries the second position.
73
73
  */
74
-
@@ -1,9 +1,9 @@
1
- import { formatFeedCursor, parseFeedCursor } from '../wire/feedCursor.js';
2
- import type { HttpLogsResource } from '../resources/httpResources.js';
1
+ import { formatFeedCursor, parseFeedCursor } from './cursor.js';
2
+ import type { HttpLogsResource } from '../client/resources/httpResources.js';
3
3
  import type {
4
4
  ObserveOptions,
5
5
  ObservedDelta,
6
- } from '../transactionLayer.js';
6
+ } from '../client/contract.js';
7
7
 
8
8
  const DEFAULT_PAGE_SIZE = 100;
9
9
  const DEFAULT_POLL_INTERVAL_MS = 500;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Observation subsystem.
3
+ *
4
+ * Start here and descend through delta contracts, feed contracts, cursor
5
+ * handling, delivery inspection, HTTP polling, and persisted row projection.
6
+ */
7
+ export * from './contract.js';
8
+ export * from './cursor.js';
9
+ export * from './feedContract.js';
10
+ export * from './deliveryContract.js';
11
+ export * from './httpFeed.js';
12
+ export * from './persistence/syncDeltaRow.js';
@@ -16,25 +16,25 @@
16
16
  * incorrectly as a physical-residency guarantee.
17
17
  *
18
18
  * This is the stored shape. The delta broadcast to clients is a narrower projection
19
- * of it — see {@link import('../wire/delta.js').syncDeltaWireCoreSchema} — and
19
+ * of it — see {@link import('../contract.js').syncDeltaWireCoreSchema} — and
20
20
  * the field names here mirror those on that wire delta.
21
21
  */
22
22
 
23
23
  import { z } from 'zod';
24
- import type { ModelResidency } from '../schema/residency.js';
24
+ import type { ModelResidency } from '../../schema/residency.js';
25
25
  import {
26
26
  participantKindSchema,
27
27
  confirmationStateSchema,
28
28
  syncDeltaActionSchema,
29
- } from '../wire/delta.js';
29
+ } from '../contract.js';
30
30
 
31
31
  // ── Enumerations that mirror the corresponding Postgres enum types ────────────
32
32
 
33
33
  // `participant_kind` and `confirmation_state` are shared with the wire delta and
34
- // live at the wire layer (see `../wire/delta.js`); they are re-exported here so
34
+ // live in the observation contract (see `../contract.js`); they are re-exported here so
35
35
  // code that imports them from `schema` keeps resolving.
36
- export { participantKindSchema, confirmationStateSchema } from '../wire/delta.js';
37
- export type { ParticipantKind, ConfirmationState } from '../wire/delta.js';
36
+ export { participantKindSchema, confirmationStateSchema } from '../contract.js';
37
+ export type { ParticipantKind, ConfirmationState } from '../contract.js';
38
38
 
39
39
  /** `backfill_provenance` */
40
40
  export const backfillProvenanceSchema = z.enum(['exact', 'inferred', 'unknown']);
@@ -116,4 +116,3 @@ export const DELTA_PHYSICAL_STORAGE = {
116
116
  core: 'control',
117
117
  attribution: 'control',
118
118
  } as const satisfies Record<string, ModelResidency>;
119
-
package/src/pricing.ts CHANGED
@@ -28,10 +28,9 @@
28
28
  * invoice, because raising one number does not fail anything that pins the
29
29
  * other.
30
30
  *
31
- * Storage is deliberately absent from {@link billableAxisSchema}. It is a real
32
- * recurring cost and it is quoted per tier as a ceiling, but no per-organization
33
- * bytes sampler emits it yet, and pricing a dimension nothing measures would be
34
- * a claim the invoice cannot support. Add the axis when the sampler ships.
31
+ * Audit-log storage is quoted as an included allowance plus Scale overage. It
32
+ * remains separate from the request meter because GiB-months come from a
33
+ * periodic storage sampler rather than an API event.
35
34
  */
36
35
 
37
36
  import { z } from 'zod';
@@ -47,7 +46,7 @@ export type { MeterEvent, PlanTier, RateBracket };
47
46
  * could observe the difference. It is emitted into the generated pricing
48
47
  * documentation so a stale copy is identifiable on sight.
49
48
  */
50
- export const PRICING_VERSION = '2026-07-31';
49
+ export const PRICING_VERSION = '2026-08-24';
51
50
 
52
51
  /**
53
52
  * Resolve a stored plan string (`stripe_subscription.plan`) to a tier.
@@ -66,8 +65,8 @@ export function toPlanTier(plan: string | null | undefined): PlanTier {
66
65
  }
67
66
 
68
67
  /**
69
- * The axes a bill is actually computed from: `ops` is metered, `connections` is
70
- * capped. Storage is quoted but not billed, so it is not here.
68
+ * The request-time axes: `ops` is metered and `connections` is capped. Audit
69
+ * storage is sampled periodically, so it does not map from a request event.
71
70
  */
72
71
  export const billableAxisSchema = z.enum(['ops', 'connections']);
73
72
  export type BillableAxis = z.infer<typeof billableAxisSchema>;
@@ -184,11 +183,12 @@ const rateCardSchema = z
184
183
  * knob; the bracket structure is the contract.
185
184
  */
186
185
  export const OPS_RATE_CARD: readonly RateBracket[] = rateCardSchema.parse([
187
- { throughOps: 50_000_000, usdPerMillionOps: 2.0 },
188
- { throughOps: 500_000_000, usdPerMillionOps: 1.2 },
189
- { throughOps: null, usdPerMillionOps: 0.6 },
186
+ { throughOps: null, usdPerMillionOps: 5 },
190
187
  ]);
191
188
 
189
+ /** Scale audit-log storage above the included allowance, per GiB-month. */
190
+ export const AUDIT_LOG_STORAGE_USD_PER_GIB_MONTH = 1;
191
+
192
192
  /**
193
193
  * A tier. `null` on a floor, a cap, or a quota means negotiated rather than
194
194
  * unlimited, and the runtime treats it as "no typed default, use the operator's
@@ -206,9 +206,9 @@ export const planDefinitionSchema = z.object({
206
206
  */
207
207
  monthlyMinimumUsd: z.number().nonnegative().nullable(),
208
208
  /**
209
- * A hard monthly stop on operations. Set only where the tier is not billed at
210
- * all: Free is capped rather than metered, so exceeding it is refused instead
211
- * of invoiced. `null` on every metered tier.
209
+ * The no-billing monthly stop. On Free this is also the included allowance:
210
+ * organizations without billing enabled stop here, while organizations that
211
+ * enable billing pay only for operations above it. `null` on paid tiers.
212
212
  */
213
213
  hardCapOps: z.number().int().positive().nullable(),
214
214
  /**
@@ -220,7 +220,7 @@ export const planDefinitionSchema = z.object({
220
220
  * are billed rather than stopped.
221
221
  */
222
222
  hardCapOpsPerDay: z.number().int().positive().nullable(),
223
- /** Quoted ceiling on stored data, in GiB. Not billed. `null` is negotiated. */
223
+ /** Included audit-log storage, in GiB. `null` means contract-priced capacity. */
224
224
  storageGib: z.number().positive().nullable(),
225
225
  /** Hard concurrent-connection cap, the real Free to Scale boundary. */
226
226
  maxConcurrentConnections: z.number().int().positive().nullable(),
@@ -240,7 +240,7 @@ export const PLANS = z
240
240
  free: {
241
241
  tier: 'free',
242
242
  label: 'Free',
243
- summary: 'Build against the real engine without a card.',
243
+ summary: 'Free for early-stage teams building against the real engine.',
244
244
  monthlyMinimumUsd: 0,
245
245
  hardCapOps: 100_000,
246
246
  hardCapOpsPerDay: 10_000,
@@ -252,8 +252,8 @@ export const PLANS = z
252
252
  scale: {
253
253
  tier: 'scale',
254
254
  label: 'Scale',
255
- summary: 'Production traffic, metered above a monthly floor.',
256
- monthlyMinimumUsd: 20,
255
+ summary: 'Built for scaling teams with production traffic.',
256
+ monthlyMinimumUsd: 250,
257
257
  hardCapOps: null,
258
258
  hardCapOpsPerDay: null,
259
259
  storageGib: 50,
@@ -264,8 +264,8 @@ export const PLANS = z
264
264
  enterprise: {
265
265
  tier: 'enterprise',
266
266
  label: 'Enterprise',
267
- summary: 'Committed volume, private networking, and an uptime guarantee.',
268
- monthlyMinimumUsd: 2_000,
267
+ summary: 'Custom infrastructure, security, and support for critical workloads.',
268
+ monthlyMinimumUsd: 4_000,
269
269
  hardCapOps: null,
270
270
  hardCapOpsPerDay: null,
271
271
  storageGib: null,
@@ -336,8 +336,8 @@ export function opsForUsd(usd: number): number {
336
336
  }
337
337
 
338
338
  /**
339
- * The operations a tier includes, as shown on the pricing page. A capped tier
340
- * shows its cap; a metered tier shows what its floor covers, computed from the
339
+ * The operations a tier includes, as shown on the pricing page. Free shows its
340
+ * pay-as-you-go allowance; a tier with a floor shows what that floor covers, computed from the
341
341
  * floor rather than stored beside it. `null` where the terms are contractual.
342
342
  */
343
343
  export function monthlyOpsAllowance(tier: PlanTier): number | null {
@@ -348,17 +348,38 @@ export function monthlyOpsAllowance(tier: PlanTier): number | null {
348
348
  }
349
349
 
350
350
  /**
351
- * The invoice for a month: the floor, or the metered usage, whichever is
352
- * greater. A capped tier is never billed above its floor because the cap is
353
- * enforced before the usage exists. `null` where the terms are contractual.
351
+ * The invoice for a month. Free subtracts its included operations before
352
+ * applying the rate. Scale charges the floor or metered usage, whichever is
353
+ * greater. `null` where the terms are contractual.
354
354
  */
355
355
  export function monthlyBillUsd(tier: PlanTier, ops: number): number | null {
356
356
  const plan = PLANS[tier];
357
357
  if (plan.contractPriced || plan.monthlyMinimumUsd === null) return null;
358
- if (plan.hardCapOps !== null) return plan.monthlyMinimumUsd;
358
+ if (plan.hardCapOps !== null) {
359
+ return roundUsd(usdForOps(Math.max(0, ops - plan.hardCapOps)));
360
+ }
359
361
  return roundUsd(Math.max(plan.monthlyMinimumUsd, usdForOps(ops)));
360
362
  }
361
363
 
364
+ /**
365
+ * Audit-log storage overage for a month. Free and Scale meter only the GiB
366
+ * above their included amount, and Enterprise is priced in the contract.
367
+ */
368
+ export function auditLogStorageBillUsd(tier: PlanTier, storageGib: number): number | null {
369
+ const plan = PLANS[tier];
370
+ if (plan.contractPriced || plan.storageGib === null) return null;
371
+ if (!Number.isFinite(storageGib)) return 0;
372
+ return roundUsd(Math.max(0, storageGib - plan.storageGib) * AUDIT_LOG_STORAGE_USD_PER_GIB_MONTH);
373
+ }
374
+
375
+ /** The complete published estimate across operation and audit-storage usage. */
376
+ export function monthlyEstimateUsd(tier: PlanTier, ops: number, auditStorageGib: number): number | null {
377
+ const operationsBill = monthlyBillUsd(tier, ops);
378
+ const storageBill = auditLogStorageBillUsd(tier, auditStorageGib);
379
+ if (operationsBill === null || storageBill === null) return null;
380
+ return roundUsd(operationsBill + storageBill);
381
+ }
382
+
362
383
  /**
363
384
  * The daily operations cap for a tier: the typed default the quota gate falls
364
385
  * back to when no `plan_limit` row sets one. `null` means the tier is metered
@@ -13,7 +13,7 @@
13
13
  * status: z.enum(['todo', 'doing', 'done']).default('todo'),
14
14
  * projectId: z.string().optional(),
15
15
  * }, {
16
- * project: relation.belongsTo('projects', 'projectId'),
16
+ * relations: { project: relation.belongsTo('projects', 'projectId') },
17
17
  * }),
18
18
  * });
19
19
  *
@@ -80,7 +80,7 @@ export {
80
80
  type ParticipantKind,
81
81
  type ConfirmationState,
82
82
  type BackfillProvenance,
83
- } from '../log/syncDeltaRow.js';
83
+ } from '../observation/persistence/syncDeltaRow.js';
84
84
 
85
85
  // The wire delta contract — the server-to-client projection of the stored row.
86
86
  // Both the client SDK and the server derive their `SyncDelta` type from these with
@@ -98,7 +98,7 @@ export {
98
98
  type SyncDeltaWireCore,
99
99
  type ClientSyncDelta,
100
100
  type ServerSyncDelta,
101
- } from '../wire/delta.js';
101
+ } from '../observation/contract.js';
102
102
 
103
103
  // Model builder
104
104
  export {
@@ -115,25 +115,8 @@ export {
115
115
  type PersistOptions,
116
116
  type RelationRecord,
117
117
  type GrantsRef,
118
- type ConflictAxis,
119
118
  } from './model.js';
120
119
 
121
- // Coordination authoring helpers for the `conflict` axis — composable disposition
122
- // functions plus a combinator that merges them.
123
- export {
124
- coordination,
125
- humansOverwrite,
126
- humansReject,
127
- humansNotify,
128
- agentsOverwrite,
129
- agentsReject,
130
- agentsNotify,
131
- systemOverwrite,
132
- systemReject,
133
- systemNotify,
134
- type ConflictRule,
135
- } from './coordination.js';
136
-
137
120
  // Claim-first shorthand for common model options: `mutable.lazy({...})` and friends
138
121
  // encode a model's write-safety and load strategy in the verb, and fall back to
139
122
  // sensible defaults for everything else.
@@ -145,6 +128,7 @@ export {
145
128
  composeIdentitySyncGroups,
146
129
  type Schema,
147
130
  type SchemaRecord,
131
+ BASE_FIELDS,
148
132
  type Model,
149
133
  type Row,
150
134
  type InferCreate,
@@ -29,11 +29,6 @@ import { getFieldMeta, inferFieldMetaFromZod, type FieldMeta } from './field.js'
29
29
  import { resolvePolicy, type Tenancy, type ScopedViaRef, type PolicyInput } from './tenancy.js';
30
30
  export type { ScopedViaRef, Tenancy, PolicyInput } from './tenancy.js';
31
31
  import { DEFAULT_RESIDENCY, type ModelResidency } from './residency.js';
32
- // The write-conflict disposition. It is plain data (the `onStale` vocabulary) so it
33
- // round-trips through schema serialization, and the engine interprets it when a
34
- // commit is applied.
35
- import type { ConflictAxis } from '../policy/types.js';
36
- export type { ConflictAxis } from '../policy/types.js';
37
32
 
38
33
  /** Normalize the `entityRoles` option (single | array | undefined) to an array. */
39
34
  function normalizeEntityRoles(
@@ -197,29 +192,6 @@ export interface ModelOptions {
197
192
  */
198
193
  groups?: GroupsInput;
199
194
 
200
- /**
201
- * Write-conflict disposition, set per committer kind — decides what happens when a
202
- * commit collides with another participant's claim or with a stale snapshot of this
203
- * model. This is independent of {@link policy} (read access) and {@link groups}
204
- * (delta routing). It is a map keyed by the committer's kind (`user`, `agent`, or
205
- * `system`), with these outcomes as values:
206
- *
207
- * - `'overwrite'` — the write wins; that committer is never blocked.
208
- * - `'reject'` — the write is refused; that committer yields.
209
- * - `'notify'` — hold the write and hand the current value back so the committer
210
- * re-reads and re-applies (for stale writes only).
211
- *
212
- * A kind you omit falls back to the engine default: reject, while honoring
213
- * `onStale: 'notify'`. The value is plain data that travels with the schema to the
214
- * server, where the engine interprets it. For example:
215
- *
216
- * ```ts
217
- * // "a human's edit always wins (never blocked); an agent yields"
218
- * conflict: { user: 'overwrite', agent: 'reject' }
219
- * ```
220
- */
221
- conflict?: ConflictAxis;
222
-
223
195
  /**
224
196
  * Whether clients may create, update, and delete this model's rows through the
225
197
  * commit protocol. Defaults to true: declaring a model in your schema is the
@@ -377,9 +349,6 @@ export interface ModelDef<
377
349
  readonly entityRoles?: readonly EntityRole[];
378
350
  /** Explicit acknowledgement that sync groups are routing, not row access. */
379
351
  readonly routingOnly?: true;
380
- /** The write-conflict disposition per committer kind, carried as plain data. See
381
- * {@link ModelOptions.conflict}. */
382
- readonly conflict?: ConflictAxis;
383
352
  /** Whether wire-level CREATE/UPDATE/DELETE is allowed. See {@link ModelOptions.mutable}. */
384
353
  readonly mutable?: boolean;
385
354
  /** Defer MobX setup until first observer access. See {@link ModelOptions.lazyObservable}. */
@@ -467,8 +436,6 @@ export function model<
467
436
  grants: options?.groups?.grants,
468
437
  entityRoles: normalizeEntityRoles(options?.groups?.roles),
469
438
  routingOnly: options?.groups?.routingOnly,
470
- // The conflict disposition is already plain data, so it passes through unchanged.
471
- conflict: options?.conflict,
472
439
  mutable: options?.mutable ?? true,
473
440
  lazyObservable: options?.lazyObservable,
474
441
  computed: options?.computed,
@@ -25,6 +25,7 @@ import type { FieldMeta } from './field.js';
25
25
  // Pulled from the endpoints module to keep this schema file free of the client's
26
26
  // error-handling and credential dependencies.
27
27
  import { ABLO_HOSTED_HTTP_BASE_URL } from '../auth/hostedEndpoints.js';
28
+ import { docUrlForCode } from '../errors.js';
28
29
  // The commit body is DERIVED from the schema the server validates against —
29
30
  // one definition site, so the documented surface cannot drift from the
30
31
  // enforced one.
@@ -35,7 +36,7 @@ import {
35
36
  commitRecordSchema,
36
37
  commitRecordListSchema,
37
38
  commitRecordWhereSchema,
38
- } from '../wire/commit.js';
39
+ } from '../commit/contract.js';
39
40
  import { CURSOR_PARAM, CURSOR_PARAM_ALIAS } from '../wire/listEnvelope.js';
40
41
  import {
41
42
  claimRequestSchema,
@@ -51,7 +52,7 @@ import {
51
52
  claimReorderRequestSchema,
52
53
  claimReorderReplySchema,
53
54
  claimReleaseReplySchema,
54
- } from '../wire/claims.js';
55
+ } from '../claims/contract.js';
55
56
  import { errorEnvelopeSchema } from '../wire/errorEnvelope.js';
56
57
  // The lifecycle promise and the rate-limit fields are contract, not prose about
57
58
  // contract: the document renders the same constants the server emits, so the
@@ -69,8 +70,8 @@ import {
69
70
  } from '../wire/rateLimit.js';
70
71
  import { modelReadResponseSchema, modelListResponseSchema } from '../wire/modelResponses.js';
71
72
  import { modelMutationRequestSchema } from '../wire/modelMutations.js';
72
- import { logListResponseSchema, logQuerySchema } from '../wire/feedEvent.js';
73
- import { logDeliveryResponseSchema } from '../wire/deltaDelivery.js';
73
+ import { logListResponseSchema, logQuerySchema } from '../observation/feedContract.js';
74
+ import { logDeliveryResponseSchema } from '../observation/deliveryContract.js';
74
75
  import { schemaReadResponseSchema } from '../wire/accountResponses.js';
75
76
  import {
76
77
  ephemeralKeyRequestSchema,
@@ -530,6 +531,11 @@ function envelope(options: SchemaToOpenApiOptions, description: string, paths: J
530
531
  name: 'Apache License 2.0',
531
532
  identifier: 'Apache-2.0',
532
533
  },
534
+ contact: {
535
+ name: 'Ablo Support',
536
+ url: 'https://github.com/Abloatai/ablo/issues',
537
+ email: 'support@abloatai.com',
538
+ },
533
539
  },
534
540
  servers: [{ url: options.serverUrl ?? `${ABLO_HOSTED_HTTP_BASE_URL}/api` }],
535
541
  security: [{ bearerAuth: [] }],
@@ -555,6 +561,41 @@ const ERROR_RESPONSES: Readonly<Record<string, string>> = {
555
561
  '503': 'A required service is temporarily unavailable.',
556
562
  };
557
563
 
564
+ /**
565
+ * One real instance of the error shape every operation shares.
566
+ *
567
+ * This lives beside the canonical error responses rather than on the schema:
568
+ * OpenAPI consumers select examples from an operation's media type, and an
569
+ * example buried on a component does not tell them which response carries it.
570
+ * Stamping the same representative validation failure on every operation also
571
+ * means a newly added route cannot regress the published example coverage.
572
+ */
573
+ const ERROR_RESPONSE_EXAMPLE: Readonly<Json> = {
574
+ type: 'AbloValidationError',
575
+ code: 'invalid_request',
576
+ param: 'body',
577
+ message: 'The request did not satisfy the published contract.',
578
+ doc_url: docUrlForCode('invalid_request'),
579
+ request_id: 'req_52bb7f46-17bc-4f2d-9988-89d1398d2990',
580
+ };
581
+
582
+ function canonicalErrorResp(description: string): Json {
583
+ return {
584
+ description,
585
+ content: {
586
+ 'application/json': {
587
+ schema: schemaRef('ErrorEnvelope'),
588
+ examples: {
589
+ validation: {
590
+ summary: 'Typed validation failure',
591
+ value: ERROR_RESPONSE_EXAMPLE,
592
+ },
593
+ },
594
+ },
595
+ },
596
+ };
597
+ }
598
+
558
599
  /**
559
600
  * Every route passes failures through the same server error funnel. Publish
560
601
  * that fact on every operation so generated transports decode all HTTP errors
@@ -569,11 +610,10 @@ function attachCanonicalErrors(paths: Json): void {
569
610
  const operation = rawOperation as Json;
570
611
  const responses = { ...(operation.responses as Json | undefined) };
571
612
  for (const [status, description] of Object.entries(ERROR_RESPONSES)) {
572
- responses[status] = namedResp(description, 'ErrorEnvelope');
613
+ responses[status] = canonicalErrorResp(description);
573
614
  }
574
- responses.default = namedResp(
615
+ responses.default = canonicalErrorResp(
575
616
  'An HTTP error not otherwise listed; decoded through the canonical envelope.',
576
- 'ErrorEnvelope',
577
617
  );
578
618
  operation.responses = responses;
579
619
  }
@@ -13,11 +13,11 @@
13
13
  * status: z.enum(['todo', 'doing', 'done']).default('todo'),
14
14
  * workspaceId: z.string().optional(),
15
15
  * }, {
16
- * workspace: relation.belongsTo('workspaces', 'workspaceId'),
16
+ * relations: { workspace: relation.belongsTo('workspaces', 'workspaceId') },
17
17
  * }),
18
18
  * });
19
19
  *
20
- * type Item = InferModel<typeof schema, 'items'>;
20
+ * type Item = Model<typeof schema, 'items'>;
21
21
  */
22
22
 
23
23
  import { z } from 'zod';
@@ -231,6 +231,13 @@ export const baseFieldsSchema = z.object({
231
231
  /**
232
232
  * The universal model field names. Audit and application metadata is declared
233
233
  * by the application or carried by the commit record, never injected here.
234
+ *
235
+ * This is the runtime spelling of {@link baseFieldsSchema}, and the one every
236
+ * consumer outside this package derives from: the CLI's adopt rule, the MCP
237
+ * schema linter, and the docs that tell an author which names not to declare.
238
+ * It is exported from `@abloatai/transaction/schema` for exactly that reason —
239
+ * when this list last moved (0.52.0, five names down to one) three hand-written
240
+ * copies stayed behind and went on rejecting correct schemas for five releases.
234
241
  */
235
242
  export const BASE_FIELDS = [
236
243
  'id',
@@ -239,6 +246,18 @@ export const BASE_FIELDS = [
239
246
  /** The base fields type — pure data columns. */
240
247
  export type BaseModelFields = z.infer<typeof baseFieldsSchema>;
241
248
 
249
+ // Invariant equality (no runtime, no casts): true only when both are mutually
250
+ // assignable. `ExpectTrue`'s constraint is what turns a mismatch into an error
251
+ // at THIS declaration, so the tuple and the schema cannot move apart — in
252
+ // either direction, a name in one and not the other fails to compile.
253
+ type BaseFieldsEqual<A, B> =
254
+ (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2 ? true : false;
255
+ type ExpectTrue<T extends true> = T;
256
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
257
+ type _BaseFieldsExact = ExpectTrue<
258
+ BaseFieldsEqual<(typeof BASE_FIELDS)[number], keyof BaseModelFields & string>
259
+ >;
260
+
242
261
  /**
243
262
  * Methods every model instance carries. These are intersected into
244
263
  * {@link InferModel}, the read-side type, but not into the create or update
@@ -332,7 +351,8 @@ export interface Schema<S extends SchemaRecord = SchemaRecord> {
332
351
 
333
352
  /**
334
353
  * Infer the full model type from a schema.
335
- * Includes base fields (id, createdAt, updatedAt, etc.)
354
+ * Includes the base fields, which today means `id` alone: audit timestamps are
355
+ * ordinary declared fields and appear here only when the model declares them.
336
356
  *
337
357
  * ```ts
338
358
  * type Item = InferModel<typeof schema, 'items'>;
@@ -41,7 +41,6 @@ import type {
41
41
  LoadStrategy,
42
42
  PersistOptions,
43
43
  AutoFillRule,
44
- ConflictAxis,
45
44
  } from './model.js';
46
45
  import {
47
46
  relation,
@@ -90,9 +89,6 @@ export interface ModelJSON {
90
89
  readonly grants?: GrantsRef;
91
90
  readonly entityRoles?: readonly EntityRole[];
92
91
  readonly routingOnly?: true;
93
- /** The declared write-conflict disposition per committer kind. When absent,
94
- * the engine falls back to its default. */
95
- readonly conflict?: ConflictAxis;
96
92
  readonly bootstrapLimit?: number;
97
93
  readonly bootstrapOrderBy?: string;
98
94
  readonly mutable?: boolean;
@@ -145,7 +141,6 @@ function modelToJSON(def: ModelDef): ModelJSON {
145
141
  grants: def.grants,
146
142
  entityRoles: def.entityRoles,
147
143
  routingOnly: def.routingOnly,
148
- conflict: def.conflict,
149
144
  bootstrapLimit: def.bootstrapLimit,
150
145
  bootstrapOrderBy: def.bootstrapOrderBy,
151
146
  mutable: def.mutable,
@@ -285,9 +280,6 @@ function modelFromJSON(json: ModelJSON): ModelDef {
285
280
  grants: json.grants,
286
281
  entityRoles: json.entityRoles,
287
282
  routingOnly: json.routingOnly,
288
- // Absent in older artifacts → undefined, so the commit path falls through to
289
- // the function registry or the engine default.
290
- conflict: json.conflict,
291
283
  mutable: json.mutable,
292
284
  lazyObservable: json.lazyObservable,
293
285
  // computed getters are closures and intentionally not serialized; a
@@ -21,7 +21,7 @@ import type {
21
21
  SourceOperation,
22
22
  SourceRequestContext,
23
23
  } from '../source/index.js';
24
- import type { ServerSyncDelta } from '../wire/delta.js';
24
+ import type { ServerSyncDelta } from '../observation/contract.js';
25
25
  import type { BootstrapModel } from './readConfig.js';
26
26
  import type { CommitContext, CommitExecutionResult } from './commit.js';
27
27
  import type { StorageMode } from './storageMode.js';
@@ -13,11 +13,11 @@
13
13
  * commit time and the shape of a stored or broadcast delta share one definition
14
14
  * rather than being kept in step by hand.
15
15
  */
16
- import type { ParticipantKind, ConfirmationState } from '../log/syncDeltaRow.js';
17
- import type { ParticipantRef } from '../wire/delta.js';
18
- import type { CommitExecutionResultInput } from '../wire/commit.js';
19
- import type { CommitOperationResult } from '../wire/commit.js';
20
- import type { ReadDependency, TrackDependency } from '../coordination/schema.js';
16
+ import type { ParticipantKind, ConfirmationState } from '../observation/persistence/syncDeltaRow.js';
17
+ import type { ParticipantRef } from '../observation/contract.js';
18
+ import type { CommitExecutionResultInput } from '../commit/contract.js';
19
+ import type { CommitOperationResult } from '../commit/contract.js';
20
+ import type { ReadDependency } from '../coordination/schema.js';
21
21
  import type { EffectiveAuthority } from '../auth/capability.js';
22
22
 
23
23
  export interface CommitContext {
@@ -81,18 +81,10 @@ export interface CommitContext {
81
81
  /**
82
82
  * The premise for the whole batch. The committer declares the rows or groups
83
83
  * it read to form this batch; the engine checks that none of them changed since
84
- * each entry's `readAt` timestamp and applies that entry's `onStale` disposition
85
- * across the batch. This differs from the per-operation `readAt` guard, which
84
+ * each entry's `readAt` timestamp and rejects the batch if one moved. This differs from the per-operation `readAt` guard, which
86
85
  * validates only the rows being written. Omit it to check the write targets alone.
87
86
  */
88
87
  reads?: ReadDependency[] | null;
89
- /**
90
- * Durable premises to persist for this commit's participant. Each entry is
91
- * kept in `track_dependencies` and re-checked against every future delta; a
92
- * later match opens a `StaleNotification` delivered out of band. Distinct
93
- * from `reads`, which is checked once here and discarded.
94
- */
95
- track?: TrackDependency[] | null;
96
88
  }
97
89
 
98
90
  /**
@@ -26,7 +26,7 @@ export {
26
26
  commitExecutionResultSchema,
27
27
  commitRecordSchema,
28
28
  type CommitRecord,
29
- } from '../wire/commit.js';
29
+ } from '../commit/contract.js';
30
30
  export { storageModeSchema, type StorageMode } from './storageMode.js';
31
31
  export type {
32
32
  ColumnOverride,