@abloatai/ablo 0.26.0 → 0.28.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 (418) hide show
  1. package/CHANGELOG.md +42 -2
  2. package/README.md +102 -86
  3. package/dist/BaseSyncedStore.d.ts +85 -88
  4. package/dist/BaseSyncedStore.js +134 -151
  5. package/dist/Database.d.ts +68 -69
  6. package/dist/Database.js +316 -135
  7. package/dist/{ObjectPool.d.ts → InstanceCache.d.ts} +10 -13
  8. package/dist/{ObjectPool.js → InstanceCache.js} +85 -83
  9. package/dist/LazyReferenceCollection.d.ts +11 -15
  10. package/dist/LazyReferenceCollection.js +12 -16
  11. package/dist/Model.d.ts +54 -52
  12. package/dist/Model.js +78 -62
  13. package/dist/ModelRegistry.d.ts +21 -19
  14. package/dist/ModelRegistry.js +23 -27
  15. package/dist/NetworkMonitor.d.ts +5 -6
  16. package/dist/NetworkMonitor.js +5 -6
  17. package/dist/SyncClient.d.ts +122 -118
  18. package/dist/SyncClient.js +541 -245
  19. package/dist/adapters/alwaysOnline.d.ts +6 -8
  20. package/dist/adapters/alwaysOnline.js +6 -8
  21. package/dist/adapters/inMemoryStorage.d.ts +10 -9
  22. package/dist/adapters/inMemoryStorage.js +21 -9
  23. package/dist/agent/Agent.d.ts +27 -32
  24. package/dist/agent/Agent.js +18 -19
  25. package/dist/agent/index.d.ts +4 -4
  26. package/dist/agent/index.js +5 -5
  27. package/dist/agent/session.d.ts +47 -44
  28. package/dist/agent/session.js +37 -48
  29. package/dist/agent/types.d.ts +26 -31
  30. package/dist/agent/types.js +6 -7
  31. package/dist/ai-sdk/coordinatedTool.d.ts +108 -0
  32. package/dist/ai-sdk/{coordinated-tool.js → coordinatedTool.js} +44 -38
  33. package/dist/ai-sdk/coordinationContext.d.ts +46 -0
  34. package/dist/ai-sdk/{coordination-context.js → coordinationContext.js} +26 -33
  35. package/dist/ai-sdk/index.d.ts +25 -22
  36. package/dist/ai-sdk/index.js +25 -22
  37. package/dist/ai-sdk/wrap.d.ts +6 -7
  38. package/dist/ai-sdk/wrap.js +1 -1
  39. package/dist/auth/credentialPolicy.d.ts +69 -74
  40. package/dist/auth/credentialPolicy.js +51 -56
  41. package/dist/auth/credentialSource.d.ts +6 -5
  42. package/dist/auth/credentialSource.js +9 -10
  43. package/dist/auth/index.d.ts +59 -58
  44. package/dist/auth/index.js +31 -37
  45. package/dist/auth/schemas.d.ts +5 -4
  46. package/dist/auth/schemas.js +5 -4
  47. package/dist/batching/index.d.ts +19 -21
  48. package/dist/batching/index.js +14 -17
  49. package/dist/cli.cjs +173 -121
  50. package/dist/client/Ablo.d.ts +97 -74
  51. package/dist/client/Ablo.js +129 -163
  52. package/dist/client/ApiClient.d.ts +30 -19
  53. package/dist/client/ApiClient.js +442 -81
  54. package/dist/client/auth.d.ts +47 -47
  55. package/dist/client/auth.js +108 -117
  56. package/dist/client/claimHeartbeatLoop.d.ts +50 -0
  57. package/dist/client/claimHeartbeatLoop.js +88 -0
  58. package/dist/client/consoleLogger.d.ts +5 -6
  59. package/dist/client/consoleLogger.js +5 -6
  60. package/dist/client/createInternalComponents.d.ts +16 -17
  61. package/dist/client/createInternalComponents.js +26 -31
  62. package/dist/client/createModelProxy.d.ts +130 -120
  63. package/dist/client/createModelProxy.js +152 -122
  64. package/dist/client/credentialEndpoint.d.ts +40 -42
  65. package/dist/client/credentialEndpoint.js +35 -36
  66. package/dist/client/functionalUpdate.d.ts +29 -27
  67. package/dist/client/functionalUpdate.js +21 -21
  68. package/dist/client/hostedEndpoints.d.ts +9 -12
  69. package/dist/client/hostedEndpoints.js +9 -12
  70. package/dist/client/httpClient.d.ts +59 -53
  71. package/dist/client/httpClient.js +29 -31
  72. package/dist/client/identity.d.ts +15 -20
  73. package/dist/client/identity.js +47 -58
  74. package/dist/client/modelRegistration.d.ts +5 -9
  75. package/dist/client/modelRegistration.js +78 -87
  76. package/dist/client/options.d.ts +157 -157
  77. package/dist/client/options.js +3 -7
  78. package/dist/client/registerDataSource.d.ts +9 -9
  79. package/dist/client/registerDataSource.js +15 -16
  80. package/dist/client/resourceTypes.d.ts +64 -75
  81. package/dist/client/resourceTypes.js +4 -10
  82. package/dist/client/schemaConfig.d.ts +31 -43
  83. package/dist/client/schemaConfig.js +38 -50
  84. package/dist/client/sessionMint.d.ts +16 -12
  85. package/dist/client/sessionMint.js +26 -31
  86. package/dist/client/validateAbloOptions.d.ts +12 -14
  87. package/dist/client/validateAbloOptions.js +8 -9
  88. package/dist/client/writeOptionsSchema.d.ts +18 -16
  89. package/dist/client/writeOptionsSchema.js +23 -20
  90. package/dist/client/wsMutationExecutor.d.ts +16 -20
  91. package/dist/client/wsMutationExecutor.js +18 -23
  92. package/dist/commit/contract.d.ts +493 -0
  93. package/dist/commit/contract.js +187 -0
  94. package/dist/commit/index.d.ts +6 -0
  95. package/dist/commit/index.js +5 -0
  96. package/dist/context.d.ts +6 -4
  97. package/dist/context.js +6 -4
  98. package/dist/coordination/index.d.ts +10 -8
  99. package/dist/coordination/index.js +14 -12
  100. package/dist/coordination/schema.d.ts +176 -128
  101. package/dist/coordination/schema.js +197 -133
  102. package/dist/coordination/trace.d.ts +9 -10
  103. package/dist/coordination/trace.js +13 -14
  104. package/dist/core/DatabaseManager.d.ts +5 -7
  105. package/dist/core/DatabaseManager.js +15 -19
  106. package/dist/core/QueryProcessor.d.ts +7 -9
  107. package/dist/core/QueryProcessor.js +22 -28
  108. package/dist/core/QueryView.d.ts +8 -8
  109. package/dist/core/QueryView.js +2 -2
  110. package/dist/core/StoreManager.d.ts +14 -14
  111. package/dist/core/StoreManager.js +33 -24
  112. package/dist/core/ViewRegistry.d.ts +5 -5
  113. package/dist/core/ViewRegistry.js +4 -4
  114. package/dist/core/index.d.ts +17 -12
  115. package/dist/core/index.js +32 -26
  116. package/dist/core/openIDBWithTimeout.d.ts +38 -36
  117. package/dist/core/openIDBWithTimeout.js +42 -43
  118. package/dist/core/queryUtils.d.ts +45 -0
  119. package/dist/core/queryUtils.js +69 -0
  120. package/dist/core/storeContract.d.ts +63 -61
  121. package/dist/core/storeContract.js +8 -12
  122. package/dist/environment.d.ts +28 -0
  123. package/dist/environment.js +21 -0
  124. package/dist/errorCodes.d.ts +107 -99
  125. package/dist/errorCodes.js +137 -134
  126. package/dist/errors.d.ts +160 -166
  127. package/dist/errors.js +155 -158
  128. package/dist/index.d.ts +36 -27
  129. package/dist/index.js +91 -86
  130. package/dist/interfaces/index.d.ts +102 -113
  131. package/dist/interfaces/index.js +5 -4
  132. package/dist/keys/index.d.ts +27 -29
  133. package/dist/keys/index.js +41 -40
  134. package/dist/mutators/RecordingTransaction.d.ts +16 -16
  135. package/dist/mutators/RecordingTransaction.js +31 -37
  136. package/dist/mutators/Transaction.d.ts +18 -26
  137. package/dist/mutators/Transaction.js +14 -20
  138. package/dist/mutators/UndoManager.d.ts +124 -131
  139. package/dist/mutators/UndoManager.js +177 -156
  140. package/dist/mutators/defineMutators.d.ts +23 -34
  141. package/dist/mutators/defineMutators.js +14 -20
  142. package/dist/mutators/inverseOp.d.ts +12 -15
  143. package/dist/mutators/inverseOp.js +12 -15
  144. package/dist/mutators/mutateActions.d.ts +10 -9
  145. package/dist/mutators/mutateActions.js +1 -1
  146. package/dist/mutators/readerActions.d.ts +9 -8
  147. package/dist/mutators/readerActions.js +2 -2
  148. package/dist/mutators/undoApply.d.ts +31 -27
  149. package/dist/mutators/undoApply.js +26 -24
  150. package/dist/policy/index.d.ts +5 -3
  151. package/dist/policy/index.js +5 -3
  152. package/dist/policy/types.d.ts +104 -100
  153. package/dist/policy/types.js +67 -66
  154. package/dist/query/client.d.ts +28 -23
  155. package/dist/query/client.js +45 -43
  156. package/dist/query/types.d.ts +37 -60
  157. package/dist/query/types.js +13 -33
  158. package/dist/react/AbloProvider.d.ts +1 -1
  159. package/dist/react/AbloProvider.js +2 -2
  160. package/dist/react/context.d.ts +25 -28
  161. package/dist/react/context.js +9 -10
  162. package/dist/react/index.d.ts +41 -42
  163. package/dist/react/index.js +37 -38
  164. package/dist/react/internalContext.d.ts +17 -19
  165. package/dist/react/useAblo.d.ts +28 -25
  166. package/dist/react/useAblo.js +41 -17
  167. package/dist/react/useCurrentUserId.d.ts +8 -7
  168. package/dist/react/useCurrentUserId.js +8 -7
  169. package/dist/react/useErrorListener.d.ts +7 -7
  170. package/dist/react/useErrorListener.js +10 -11
  171. package/dist/react/useMutationFailureListener.d.ts +8 -8
  172. package/dist/react/useMutationFailureListener.js +8 -8
  173. package/dist/react/useMutators.d.ts +11 -11
  174. package/dist/react/useMutators.js +3 -3
  175. package/dist/react/useReactive.js +2 -2
  176. package/dist/react/useSyncStatus.d.ts +4 -6
  177. package/dist/react/useUndoScope.d.ts +7 -9
  178. package/dist/react/useUndoScope.js +1 -1
  179. package/dist/schema/coordination.d.ts +21 -25
  180. package/dist/schema/coordination.js +21 -25
  181. package/dist/schema/ddl.d.ts +43 -39
  182. package/dist/schema/ddl.js +75 -68
  183. package/dist/schema/ddlLock.d.ts +20 -24
  184. package/dist/schema/ddlLock.js +18 -23
  185. package/dist/schema/diff.d.ts +99 -61
  186. package/dist/schema/diff.js +43 -34
  187. package/dist/schema/field.d.ts +37 -42
  188. package/dist/schema/field.js +35 -48
  189. package/dist/schema/generate.d.ts +12 -12
  190. package/dist/schema/generate.js +12 -12
  191. package/dist/schema/index.d.ts +3 -3
  192. package/dist/schema/index.js +21 -23
  193. package/dist/schema/model.d.ts +118 -143
  194. package/dist/schema/model.js +22 -33
  195. package/dist/schema/openapi.d.ts +10 -9
  196. package/dist/schema/openapi.js +5 -3
  197. package/dist/schema/queries.d.ts +29 -31
  198. package/dist/schema/queries.js +23 -25
  199. package/dist/schema/relation.d.ts +89 -99
  200. package/dist/schema/relation.js +13 -13
  201. package/dist/schema/residency.d.ts +16 -13
  202. package/dist/schema/residency.js +16 -13
  203. package/dist/schema/roles.d.ts +36 -43
  204. package/dist/schema/roles.js +31 -37
  205. package/dist/schema/schema.d.ts +64 -43
  206. package/dist/schema/schema.js +31 -32
  207. package/dist/schema/select.d.ts +13 -13
  208. package/dist/schema/select.js +13 -13
  209. package/dist/schema/serialize.d.ts +28 -31
  210. package/dist/schema/serialize.js +27 -31
  211. package/dist/schema/sugar.d.ts +17 -32
  212. package/dist/schema/sugar.js +14 -29
  213. package/dist/schema/{sync-delta-row.d.ts → syncDeltaRow.d.ts} +26 -49
  214. package/dist/schema/syncDeltaRow.js +89 -0
  215. package/dist/schema/tenancy.d.ts +44 -46
  216. package/dist/schema/tenancy.js +46 -48
  217. package/dist/server/adapter.d.ts +58 -58
  218. package/dist/server/adapter.js +13 -14
  219. package/dist/server/commit.d.ts +60 -64
  220. package/dist/server/index.d.ts +9 -10
  221. package/dist/server/index.js +1 -1
  222. package/dist/server/readConfig.d.ts +70 -0
  223. package/dist/server/readConfig.js +8 -0
  224. package/dist/server/storageMode.d.ts +23 -0
  225. package/dist/server/storageMode.js +17 -0
  226. package/dist/source/adapter.d.ts +30 -25
  227. package/dist/source/adapter.js +10 -10
  228. package/dist/source/adapters/drizzle.d.ts +28 -23
  229. package/dist/source/adapters/drizzle.js +30 -25
  230. package/dist/source/adapters/kysely.d.ts +27 -25
  231. package/dist/source/adapters/kysely.js +24 -23
  232. package/dist/source/adapters/memory.d.ts +8 -7
  233. package/dist/source/adapters/memory.js +9 -8
  234. package/dist/source/adapters/prisma.d.ts +13 -12
  235. package/dist/source/adapters/prisma.js +22 -25
  236. package/dist/source/conformance.d.ts +18 -11
  237. package/dist/source/conformance.js +17 -11
  238. package/dist/source/connector.d.ts +31 -32
  239. package/dist/source/connector.js +28 -28
  240. package/dist/source/connectorProtocol.d.ts +160 -0
  241. package/dist/source/connectorProtocol.js +162 -0
  242. package/dist/source/contract.d.ts +26 -27
  243. package/dist/source/contract.js +28 -29
  244. package/dist/source/factory.d.ts +46 -58
  245. package/dist/source/factory.js +22 -27
  246. package/dist/source/index.d.ts +7 -9
  247. package/dist/source/index.js +12 -14
  248. package/dist/source/migrations.d.ts +9 -9
  249. package/dist/source/migrations.js +9 -9
  250. package/dist/source/next.d.ts +9 -10
  251. package/dist/source/next.js +6 -7
  252. package/dist/source/pushQueue.d.ts +69 -47
  253. package/dist/source/pushQueue.js +32 -28
  254. package/dist/source/signing.d.ts +46 -17
  255. package/dist/source/signing.js +28 -11
  256. package/dist/source/types.d.ts +121 -104
  257. package/dist/source/types.js +13 -14
  258. package/dist/stores/ObjectStore.d.ts +24 -12
  259. package/dist/stores/ObjectStore.js +38 -16
  260. package/dist/stores/ObjectStoreContract.d.ts +14 -15
  261. package/dist/stores/SyncActionStore.d.ts +7 -11
  262. package/dist/stores/SyncActionStore.js +13 -17
  263. package/dist/surface.d.ts +28 -21
  264. package/dist/surface.js +29 -20
  265. package/dist/sync/{BootstrapHelper.d.ts → BootstrapFetcher.d.ts} +36 -42
  266. package/dist/sync/{BootstrapHelper.js → BootstrapFetcher.js} +76 -76
  267. package/dist/sync/ConnectionManager.d.ts +39 -50
  268. package/dist/sync/ConnectionManager.js +55 -66
  269. package/dist/sync/NetworkProbe.d.ts +24 -29
  270. package/dist/sync/NetworkProbe.js +63 -69
  271. package/dist/sync/{HydrationCoordinator.d.ts → OnDemandLoader.d.ts} +42 -41
  272. package/dist/sync/{HydrationCoordinator.js → OnDemandLoader.js} +59 -54
  273. package/dist/sync/{AreaOfInterestManager.d.ts → SubscriptionManager.d.ts} +43 -57
  274. package/dist/sync/{AreaOfInterestManager.js → SubscriptionManager.js} +43 -51
  275. package/dist/sync/SyncWebSocket.d.ts +141 -166
  276. package/dist/sync/SyncWebSocket.js +191 -223
  277. package/dist/sync/awaitClaimGrant.d.ts +18 -18
  278. package/dist/sync/awaitClaimGrant.js +11 -11
  279. package/dist/sync/bootstrapApply.d.ts +34 -24
  280. package/dist/sync/bootstrapApply.js +27 -19
  281. package/dist/sync/commitFrames.d.ts +21 -20
  282. package/dist/sync/commitFrames.js +18 -18
  283. package/dist/sync/createClaimStream.d.ts +23 -22
  284. package/dist/sync/createClaimStream.js +105 -23
  285. package/dist/sync/createPresenceStream.d.ts +19 -18
  286. package/dist/sync/createPresenceStream.js +25 -26
  287. package/dist/sync/createSnapshot.d.ts +12 -14
  288. package/dist/sync/createSnapshot.js +20 -26
  289. package/dist/sync/credentialLifecycle.d.ts +104 -104
  290. package/dist/sync/credentialLifecycle.js +140 -147
  291. package/dist/sync/deltaPipeline.d.ts +36 -34
  292. package/dist/sync/deltaPipeline.js +64 -65
  293. package/dist/sync/groupChange.d.ts +63 -61
  294. package/dist/sync/groupChange.js +74 -78
  295. package/dist/sync/heartbeat.d.ts +34 -33
  296. package/dist/sync/heartbeat.js +31 -31
  297. package/dist/sync/participants.d.ts +19 -19
  298. package/dist/sync/persistedPrefix.d.ts +12 -0
  299. package/dist/sync/persistedPrefix.js +22 -0
  300. package/dist/sync/schemas.d.ts +3 -2
  301. package/dist/sync/schemas.js +14 -10
  302. package/dist/sync/syncCursor.d.ts +17 -21
  303. package/dist/sync/syncCursor.js +17 -21
  304. package/dist/sync/syncPlan.d.ts +28 -36
  305. package/dist/sync/syncPlan.js +18 -19
  306. package/dist/sync/syncPosition.d.ts +54 -49
  307. package/dist/sync/syncPosition.js +57 -52
  308. package/dist/sync/wsFrameHandlers.d.ts +35 -36
  309. package/dist/sync/wsFrameHandlers.js +63 -67
  310. package/dist/testing/fixtures/bootstrap.d.ts +12 -6
  311. package/dist/testing/fixtures/bootstrap.js +12 -6
  312. package/dist/testing/fixtures/deltas.d.ts +30 -33
  313. package/dist/testing/fixtures/deltas.js +30 -33
  314. package/dist/testing/fixtures/models.d.ts +11 -10
  315. package/dist/testing/fixtures/models.js +11 -10
  316. package/dist/testing/helpers/{react-wrapper.d.ts → reactWrapper.d.ts} +13 -10
  317. package/dist/testing/helpers/{react-wrapper.js → reactWrapper.js} +15 -12
  318. package/dist/testing/helpers/{sync-engine-harness.d.ts → syncEngineHarness.d.ts} +17 -15
  319. package/dist/testing/helpers/{sync-engine-harness.js → syncEngineHarness.js} +12 -10
  320. package/dist/testing/helpers/wait.d.ts +13 -8
  321. package/dist/testing/helpers/wait.js +13 -8
  322. package/dist/testing/index.d.ts +5 -3
  323. package/dist/testing/index.js +3 -2
  324. package/dist/testing/mocks/FakeDatabase.d.ts +18 -0
  325. package/dist/testing/mocks/FakeDatabase.js +10 -0
  326. package/dist/testing/mocks/MockMutationExecutor.d.ts +18 -17
  327. package/dist/testing/mocks/MockMutationExecutor.js +15 -14
  328. package/dist/testing/mocks/MockNetworkMonitor.d.ts +8 -8
  329. package/dist/testing/mocks/MockNetworkMonitor.js +8 -8
  330. package/dist/testing/mocks/MockSyncContext.d.ts +20 -17
  331. package/dist/testing/mocks/MockSyncContext.js +15 -13
  332. package/dist/testing/mocks/MockSyncStore.d.ts +10 -10
  333. package/dist/testing/mocks/MockSyncStore.js +11 -11
  334. package/dist/testing/mocks/MockWebSocket.d.ts +28 -23
  335. package/dist/testing/mocks/MockWebSocket.js +22 -21
  336. package/dist/transactions/TransactionQueue.d.ts +244 -181
  337. package/dist/transactions/TransactionQueue.js +929 -423
  338. package/dist/transactions/TransactionStore.d.ts +6 -4
  339. package/dist/transactions/TransactionStore.js +6 -4
  340. package/dist/transactions/UnconfirmedWrites.d.ts +82 -0
  341. package/dist/transactions/UnconfirmedWrites.js +104 -0
  342. package/dist/transactions/coalesceRules.d.ts +41 -17
  343. package/dist/transactions/coalesceRules.js +40 -17
  344. package/dist/transactions/commitEnvelope.d.ts +132 -0
  345. package/dist/transactions/commitEnvelope.js +139 -0
  346. package/dist/transactions/commitOutboxStore.d.ts +32 -0
  347. package/dist/transactions/commitOutboxStore.js +26 -0
  348. package/dist/transactions/commitPayload.d.ts +63 -52
  349. package/dist/transactions/commitPayload.js +54 -57
  350. package/dist/transactions/deltaConfirmation.d.ts +20 -22
  351. package/dist/transactions/deltaConfirmation.js +37 -45
  352. package/dist/transactions/httpCommitEnvelope.d.ts +43 -0
  353. package/dist/transactions/httpCommitEnvelope.js +179 -0
  354. package/dist/transactions/optimisticApply.d.ts +49 -0
  355. package/dist/transactions/optimisticApply.js +65 -0
  356. package/dist/transactions/replayValidation.d.ts +182 -0
  357. package/dist/transactions/replayValidation.js +156 -0
  358. package/dist/types/global.d.ts +46 -41
  359. package/dist/types/global.js +20 -19
  360. package/dist/types/index.d.ts +71 -77
  361. package/dist/types/index.js +22 -22
  362. package/dist/types/modelData.d.ts +6 -8
  363. package/dist/types/modelData.js +5 -7
  364. package/dist/types/participant.d.ts +10 -11
  365. package/dist/types/participant.js +6 -8
  366. package/dist/types/streams.d.ts +208 -195
  367. package/dist/types/streams.js +7 -7
  368. package/dist/utils/asyncIterator.d.ts +25 -32
  369. package/dist/utils/asyncIterator.js +25 -32
  370. package/dist/utils/duration.d.ts +12 -15
  371. package/dist/utils/duration.js +12 -15
  372. package/dist/utils/mobxSetup.d.ts +53 -0
  373. package/dist/utils/{mobx-setup.js → mobxSetup.js} +42 -98
  374. package/dist/webhooks/events.d.ts +21 -16
  375. package/dist/webhooks/events.js +10 -8
  376. package/dist/webhooks/index.d.ts +5 -7
  377. package/dist/webhooks/index.js +5 -7
  378. package/dist/wire/bootstrapReason.d.ts +9 -0
  379. package/dist/wire/bootstrapReason.js +8 -0
  380. package/dist/{schema/sync-delta-wire.d.ts → wire/delta.d.ts} +58 -41
  381. package/dist/wire/delta.js +114 -0
  382. package/dist/wire/errorEnvelope.d.ts +30 -31
  383. package/dist/wire/errorEnvelope.js +34 -40
  384. package/dist/wire/frames.d.ts +315 -86
  385. package/dist/wire/frames.js +47 -33
  386. package/dist/wire/index.d.ts +18 -14
  387. package/dist/wire/index.js +32 -27
  388. package/dist/wire/listEnvelope.d.ts +16 -23
  389. package/dist/wire/listEnvelope.js +7 -6
  390. package/dist/wire/protocol.d.ts +25 -32
  391. package/dist/wire/protocol.js +25 -32
  392. package/dist/wire/protocolVersion.d.ts +44 -40
  393. package/dist/wire/protocolVersion.js +44 -40
  394. package/docs/api.md +10 -10
  395. package/docs/coordination.md +59 -0
  396. package/docs/mcp.md +1 -1
  397. package/package.json +17 -11
  398. package/dist/ai-sdk/coordinated-tool.d.ts +0 -101
  399. package/dist/ai-sdk/coordination-context.d.ts +0 -52
  400. package/dist/core/query-utils.d.ts +0 -34
  401. package/dist/core/query-utils.js +0 -59
  402. package/dist/schema/sync-delta-row.js +0 -103
  403. package/dist/schema/sync-delta-wire.js +0 -102
  404. package/dist/server/read-config.d.ts +0 -67
  405. package/dist/server/read-config.js +0 -8
  406. package/dist/server/storage-mode.d.ts +0 -8
  407. package/dist/server/storage-mode.js +0 -28
  408. package/dist/source/connector-protocol.d.ts +0 -159
  409. package/dist/source/connector-protocol.js +0 -161
  410. package/dist/transactions/OptimisticEchoTracker.d.ts +0 -82
  411. package/dist/transactions/OptimisticEchoTracker.js +0 -104
  412. package/dist/transactions/mutation-error-handler.d.ts +0 -5
  413. package/dist/transactions/mutation-error-handler.js +0 -39
  414. package/dist/transactions/optimistic.d.ts +0 -24
  415. package/dist/transactions/optimistic.js +0 -45
  416. package/dist/transactions/persistedReplay.d.ts +0 -93
  417. package/dist/transactions/persistedReplay.js +0 -105
  418. package/dist/utils/mobx-setup.d.ts +0 -42
package/dist/cli.cjs CHANGED
@@ -215687,9 +215687,9 @@ var require_braces = __commonJS({
215687
215687
  }
215688
215688
  });
215689
215689
 
215690
- // node_modules/picomatch/lib/constants.js
215690
+ // node_modules/micromatch/node_modules/picomatch/lib/constants.js
215691
215691
  var require_constants2 = __commonJS({
215692
- "node_modules/picomatch/lib/constants.js"(exports2, module2) {
215692
+ "node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
215693
215693
  "use strict";
215694
215694
  init_cjs_shims();
215695
215695
  var path = require("path");
@@ -215889,9 +215889,9 @@ var require_constants2 = __commonJS({
215889
215889
  }
215890
215890
  });
215891
215891
 
215892
- // node_modules/picomatch/lib/utils.js
215892
+ // node_modules/micromatch/node_modules/picomatch/lib/utils.js
215893
215893
  var require_utils2 = __commonJS({
215894
- "node_modules/picomatch/lib/utils.js"(exports2) {
215894
+ "node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports2) {
215895
215895
  "use strict";
215896
215896
  init_cjs_shims();
215897
215897
  var path = require("path");
@@ -215951,9 +215951,9 @@ var require_utils2 = __commonJS({
215951
215951
  }
215952
215952
  });
215953
215953
 
215954
- // node_modules/picomatch/lib/scan.js
215954
+ // node_modules/micromatch/node_modules/picomatch/lib/scan.js
215955
215955
  var require_scan = __commonJS({
215956
- "node_modules/picomatch/lib/scan.js"(exports2, module2) {
215956
+ "node_modules/micromatch/node_modules/picomatch/lib/scan.js"(exports2, module2) {
215957
215957
  "use strict";
215958
215958
  init_cjs_shims();
215959
215959
  var utils = require_utils2();
@@ -216282,9 +216282,9 @@ var require_scan = __commonJS({
216282
216282
  }
216283
216283
  });
216284
216284
 
216285
- // node_modules/picomatch/lib/parse.js
216285
+ // node_modules/micromatch/node_modules/picomatch/lib/parse.js
216286
216286
  var require_parse2 = __commonJS({
216287
- "node_modules/picomatch/lib/parse.js"(exports2, module2) {
216287
+ "node_modules/micromatch/node_modules/picomatch/lib/parse.js"(exports2, module2) {
216288
216288
  "use strict";
216289
216289
  init_cjs_shims();
216290
216290
  var constants = require_constants2();
@@ -217285,9 +217285,9 @@ var require_parse2 = __commonJS({
217285
217285
  }
217286
217286
  });
217287
217287
 
217288
- // node_modules/picomatch/lib/picomatch.js
217288
+ // node_modules/micromatch/node_modules/picomatch/lib/picomatch.js
217289
217289
  var require_picomatch = __commonJS({
217290
- "node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
217290
+ "node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
217291
217291
  "use strict";
217292
217292
  init_cjs_shims();
217293
217293
  var path = require("path");
@@ -217427,9 +217427,9 @@ var require_picomatch = __commonJS({
217427
217427
  }
217428
217428
  });
217429
217429
 
217430
- // node_modules/picomatch/index.js
217430
+ // node_modules/micromatch/node_modules/picomatch/index.js
217431
217431
  var require_picomatch2 = __commonJS({
217432
- "node_modules/picomatch/index.js"(exports2, module2) {
217432
+ "node_modules/micromatch/node_modules/picomatch/index.js"(exports2, module2) {
217433
217433
  "use strict";
217434
217434
  init_cjs_shims();
217435
217435
  module2.exports = require_picomatch();
@@ -276772,12 +276772,12 @@ var ERROR_CODES = {
276772
276772
  // ── auth (401) ─────────────────────────────────────────────────────
276773
276773
  apikey_invalid: wire("auth", 401, false, "This API key isn't one Ablo recognizes \u2014 it may be mistyped, truncated, or belong to a different environment. Check the key and try again."),
276774
276774
  apikey_revoked: wire("auth", 401, false, "This API key has been revoked and can no longer be used. Mint a new key from the dashboard."),
276775
- // THE sync-engine access credential — the Stripe-style ephemeral key
276776
- // (`ek_` for users, `rk_` for agents) minted server-side from the login and
276777
- // presented as a Bearer. Its expiry is routine and re-mintable: get a fresh
276778
- // key from the still-valid session and retry NEVER a sign-out. (An agent's
276779
- // expired `rk_` must not log a human out either.) This is the ONLY code on
276780
- // the silent re-mint path; see RecoveryClass `access_credential_expiry`.
276775
+ // The short-lived access credential — the ephemeral key (`ek_` for users,
276776
+ // `rk_` for agents) minted from the login and presented as a bearer token.
276777
+ // Its expiry is routine and re-mintable: get a fresh key from the still-valid
276778
+ // session and retry, rather than signing out. An agent's expired `rk_` must
276779
+ // not sign a human out either. This is the one code on the silent re-mint
276780
+ // path; see the `access_credential_expiry` recovery class.
276781
276781
  apikey_expired: wire("auth", 401, false, "This ephemeral API key has expired. Mint a fresh key from your still-valid session and retry the request.", "access_credential_expiry"),
276782
276782
  apikey_missing: wire("auth", 401, false, "The request arrived without an API key. Send one as `Authorization: Bearer <key>`."),
276783
276783
  api_key_required: wire("auth", 401, false, "This operation requires an API key, and none was presented. Send one as `Authorization: Bearer <key>`."),
@@ -276786,25 +276786,25 @@ var ERROR_CODES = {
276786
276786
  identity_resolve_failed: wire("auth", 401, false, "The server could not resolve an identity for this credential \u2014 the identity lookup was rejected. Check that the credential is still valid."),
276787
276787
  auth_no_credentials: wire("auth", 401, false, "No recognized authentication credential was presented \u2014 no API key and no bearer JWT. Send `Authorization: Bearer <token>`."),
276788
276788
  identity_missing_organization: wire("auth", 401, false, "Authentication succeeded, but the credential resolves to no organization, so requests cannot be scoped. Check that the key or token carries an organization."),
276789
- // The long-lived login is gone terminal, drives sign-out + re-auth.
276789
+ // The long-lived login is gone; this is terminal and drives sign-out and
276790
+ // re-authentication.
276790
276791
  session_expired: wire("auth", 401, false, "Your session has expired or is no longer valid. Sign in again to continue.", "session_expiry"),
276791
- // `jwt_invalid` is the residual fallback; the codes below split out the
276792
- // specific failure modes so an integrating customer can tell "I registered
276793
- // the wrong JWKS" from "my token has no org claim" from "wrong audience"
276794
- // rather than getting one opaque code for all of them.
276792
+ // `jwt_invalid` is the general fallback; the codes below it split out specific
276793
+ // failure modes, so an integrator can tell a wrong JWKS registration from a
276794
+ // token with no organization claim from a wrong audience, instead of getting
276795
+ // one opaque code for all of them.
276795
276796
  jwt_invalid: wire("auth", 401, false, "The bearer JWT failed validation for a reason the server could not classify further. Check the token's issuer, signature, audience, and expiry."),
276796
276797
  jwt_malformed: wire("auth", 401, false, "The bearer token is not a well-formed JWT and could not be decoded. Check that the full, unmodified token was sent."),
276797
276798
  jwt_missing_issuer: wire("auth", 401, false, "The bearer JWT has no `iss` (issuer) claim, so it cannot be routed to a trusted issuer."),
276798
- jwt_issuer_untrusted: wire("auth", 401, false, "The bearer JWT's `iss` is not a registered trusted issuer. Register it via POST /v1/trusted-issuers, or check the token's issuer claim."),
276799
+ jwt_issuer_untrusted: wire("auth", 401, false, "The bearer JWT's `iss` is not a registered trusted issuer. Check the token's issuer claim, or register the issuer with your deployment before retrying."),
276799
276800
  jwt_signature_invalid: wire("auth", 401, false, "The bearer JWT's signature could not be verified against the issuer's JWKS (wrong key, rotated key, or forged token)."),
276800
276801
  jwt_audience_mismatch: wire("auth", 401, false, "The bearer JWT's `aud` (audience) claim does not match the audience this issuer is registered with."),
276801
276802
  jwt_missing_subject: wire("auth", 401, false, "The bearer JWT has no `sub` (subject) claim to identify the user."),
276802
276803
  jwt_missing_organization: wire("auth", 401, false, "The bearer JWT carries no organization context \u2014 neither a fixed org for the issuer nor the configured organization claim."),
276803
- // Trusted-issuer / BYO-IdP path only Ablo's own sync-engine no longer
276804
- // authenticates with JWTs (it uses the Stripe-style ephemeral key, below).
276805
- // When a customer DOES present an external-IdP JWT, its expiry means
276806
- // re-authenticate against that IdP, so it classifies as a session expiry
276807
- // (which also keeps `isSessionErrorResponse` behaviour unchanged).
276804
+ // Applies only to the trusted-issuer path, where a customer authenticates with
276805
+ // a JWT from their own identity provider. When such a token expires, the
276806
+ // remedy is to re-authenticate against that provider, so it classifies as a
276807
+ // session expiry.
276808
276808
  jwt_expired: wire("auth", 401, false, "The bearer JWT has expired. Obtain a fresh token from your identity provider and retry.", "session_expiry"),
276809
276809
  jwt_org_membership_denied: wire("auth", 403, false, "The bearer JWT's subject is not an active member of the organization in its `org_id` claim (removed, suspended, or the claim does not match a membership)."),
276810
276810
  file_upload_auth_required: wire("auth", 401, false, "File uploads require an authenticated session. Sign in and retry."),
@@ -276823,22 +276823,18 @@ var ERROR_CODES = {
276823
276823
  database_role_unreadable: wire("permission", 403, false, "Ablo could not introspect the database role it connects with, so it cannot verify that row-level security is enforced."),
276824
276824
  database_tables_unforced_rls: wire("permission", 403, false, "Some synced tables do not have `FORCE ROW LEVEL SECURITY` applied, so the table owner can bypass row isolation. Run `ALTER TABLE ... FORCE ROW LEVEL SECURITY` on each synced table."),
276825
276825
  database_host_not_allowed: wire("permission", 403, false, "The database host resolves to a private, loopback, or link-local address, which Ablo's servers will not connect to. Use a publicly resolvable host."),
276826
- // Deprecated spellings of the `database_*` codes above still emitted by
276827
- // older servers; kept so they classify identically. Do not use in new code.
276826
+ // Older spellings of the `database_*` codes above, still sent by some servers
276827
+ // and kept so they classify identically. Prefer the `database_*` codes.
276828
276828
  byo_role_cannot_enforce_rls: wire("permission", 403, false, "The direct Postgres connector role cannot enforce row-level security."),
276829
276829
  byo_role_unreadable: wire("permission", 403, false, "The direct Postgres connector role could not be introspected."),
276830
276830
  byo_tenant_tables_unforced_rls: wire("permission", 403, false, "Tenant tables do not have RLS forced under the direct Postgres connector role."),
276831
276831
  byo_host_not_allowed: wire("permission", 403, false, "The direct Postgres connector host resolves to a private, loopback, or link-local address and cannot be used."),
276832
276832
  // ── claim / claim conflict (409) ──────────────────────────────────
276833
- // Held-claim rejections are NOT queue-retryable (gRPC FAILED_PRECONDITION /
276834
- // ABORTED semantics; Replicache/Zero SETTLE a rejected mutation reject the
276835
- // caller, roll back the optimistic effect instead of resending it).
276836
- // Blindly re-sending the same payload cannot succeed while the lease is
276837
- // held, and a lease can outlive any sane retry budget. The correct recovery
276838
- // lives at the CALLER: take a claim (`ablo.<model>.claim` queues fairly
276839
- // behind the holder) or re-read and rebase. `retryable: true` here turned
276840
- // every cross-client claim conflict into an infinite client resend loop
276841
- // (~150ms storm — found by the claims journey, 2026-06-10).
276833
+ // A rejection because another participant holds a claim is not retryable.
276834
+ // Re-sending the same write cannot succeed while the claim is held, and a
276835
+ // claim can outlive any reasonable retry budget, so an automatic retry would
276836
+ // only loop. Recovery belongs to the caller: take a claim, which queues fairly
276837
+ // behind the holder (`ablo.<model>.claim`), or re-read and rebase.
276842
276838
  claim_conflict: wire("claim", 409, false, "Another participant holds a claim on this row, so the write was rejected. Take a claim with `ablo.<model>.claim` to queue fairly behind the holder, or re-read and rebase."),
276843
276839
  claim_lost: wire("claim", 409, false, "The claim held on this row was lost before the write could apply. Re-acquire the claim and retry."),
276844
276840
  entity_claimed: wire("claim", 409, false, "This row is currently claimed by another participant, so the write was blocked. Queue behind the holder with `ablo.<model>.claim`, or wait for the claim to clear."),
@@ -276849,11 +276845,15 @@ var ERROR_CODES = {
276849
276845
  model_claim_not_configured: client("claim", "Claiming requires the collaboration runtime, which the standard Ablo({ schema, apiKey }) client wires up for every model automatically \u2014 there is no per-model claim configuration to add. This appears only when a model proxy is constructed directly without that runtime (an internal/advanced path)."),
276850
276846
  model_watch_not_configured: client("claim", "watch() opens a presence/claim subscription and needs a live WebSocket, so it is unavailable on the HTTP transport and on model proxies built without a socket. Use the standard Ablo({ schema, apiKey }) client (default WebSocket transport)."),
276851
276847
  // ── stale context / idempotency (409) ──────────────────────────────
276852
- stale_context: wire("conflict", 409, true, "The row changed after you read it \u2014 the write's `readAt` watermark is older than the current row version. Re-read the row and retry."),
276848
+ // Not retryable at the transport: the rejected request carries its frozen
276849
+ // `readAt`, so resending the identical payload can never succeed. Recovery
276850
+ // is a caller-level re-read that produces a NEW request with a fresh
276851
+ // watermark — the same shape as `claim_conflict`.
276852
+ stale_context: wire("conflict", 409, false, "The row changed after you read it \u2014 the write's `readAt` watermark is older than the current row version. Re-read the row and retry."),
276853
276853
  // Raised by the functional `update(id, current => next)` form once its
276854
- // internal reconcile budget is exhausted the row stayed continuously
276855
- // contended. Client-side: the SDK already retried; the caller decides whether
276856
- // to back off, raise `retries`, or move the row to the WebSocket transport.
276854
+ // internal reconcile budget is exhausted, because the row stayed continuously
276855
+ // contended. The SDK has already retried; the caller decides whether to back
276856
+ // off, raise `retries`, or move the row to the WebSocket transport.
276857
276857
  contention_exhausted: client("conflict", "A functional update kept losing to concurrent writes and exhausted its reconcile budget. Back off and retry, raise `retries`, or move the row to the WebSocket transport."),
276858
276858
  update_aborted: client("conflict", "The functional update was aborted via its `AbortSignal` before the write landed; nothing was written."),
276859
276859
  idempotency_conflict: wire("conflict", 409, false, "This `Idempotency-Key` was already used with a different request body. Reuse a key only to retry an identical request; otherwise generate a new one."),
@@ -276862,21 +276862,20 @@ var ERROR_CODES = {
276862
276862
  write_options_invalid: client("validation", "The write options (`idempotencyKey` / `label` / `wait` / `readAt` / `onStale` / `claim`) failed validation against the write-options schema."),
276863
276863
  source_operation_id_required: client("validation", "A data-source operation arrived without the entity `id` it targets."),
276864
276864
  source_adapter_misconfigured: client("validation", "The data-source ORM adapter could not map a schema model onto the backing client \u2014 the client exposes no matching delegate or model. Check that the adapter and schema agree on model names."),
276865
- // Wire since 2026-07-01: the sync-server validates every pushed/polled
276866
- // source event before appending to the log and rejects the whole batch
276867
- // with this code (`param` names the offending index + field path, e.g.
276868
- // `events[3].entityId`). Also raised client-side by
276869
- // `sourceEventForOperation` when an outbox event cannot be built.
276865
+ // The server validates every incoming data-source event before appending it
276866
+ // to the log and rejects the whole batch with this code; `param` names the
276867
+ // offending index and field path, such as `events[3].entityId`. It is also
276868
+ // raised on the client when an outbound source event cannot be built.
276870
276869
  source_event_invalid: wire("validation", 400, false, "A data-source event was malformed \u2014 missing or invalid id, model, entityId, type, or field value. The whole event batch was rejected and nothing was ingested; fix the offending outbox row and re-send."),
276871
276870
  duration_invalid: client("validation", 'A duration value was not a number of seconds or a "500ms" | "30s" | "3m" | "24h" string.'),
276872
276871
  schema_definition_invalid: client("validation", "A schema definition value was invalid (bad column identifier, non-finite backfill, or unsupported schema-JSON version)."),
276873
276872
  cli_invalid_arguments: client("validation", "The CLI was invoked with an unknown flag or a malformed flag value."),
276874
276873
  turn_validation_failed: wire("validation", 422, false, "The agent turn payload failed server-side validation and was not applied."),
276875
276874
  commit_operation_required: wire("validation", 400, false, "A commit must carry `operation` or `operations`."),
276876
- // Wire since 2026-07-01: both commit transports (WS `commit` frame and HTTP
276877
- // `/v1/commits`) validate every operation against `commitOperationSchema`
276878
- // (`wire/frames.ts`) and reject the whole batch with this code. `param`
276879
- // names the offending index + field path (e.g. `operations[3].readAt`).
276875
+ // Both commit transports the WebSocket `commit` frame and the HTTP
276876
+ // `/v1/commits` endpoint — validate every operation and reject the whole batch
276877
+ // with this code. `param` names the offending index and field path, such as
276878
+ // `operations[3].readAt`.
276880
276879
  commit_operation_invalid: wire("validation", 400, false, "A commit operation failed validation against the wire commit-operation schema \u2014 wrong field type (e.g. a string `readAt`), unknown `type`, or missing `model`. The whole batch was rejected; the error names the offending operation index and field path."),
276881
276880
  commit_operation_model_required: wire("validation", 400, false, "A commit operation is missing its `model`."),
276882
276881
  commit_operations_ambiguous: wire("validation", 400, false, "A commit supplied both `operation` and `operations`. Send one or the other, not both."),
@@ -276893,13 +276892,12 @@ var ERROR_CODES = {
276893
276892
  model_not_found: wire("not_found", 404, false, "No row of this model exists with the requested id. It may have been deleted, or the id may belong to a different environment."),
276894
276893
  mutate_update_entity_not_found: wire("not_found", 404, false, "The row targeted by this update does not exist \u2014 it may have been deleted since you read it. Re-read before retrying."),
276895
276894
  task_id_missing: wire("server", 502, true, "The task-create response arrived without a task id, so the result cannot be used. Retry the request."),
276896
- // ── data integrity / DB constraints ────────────────────────────────
276897
- // Emitted when a write is rejected by a database integrity constraint
276898
- // (Postgres class-23). All NON-retryable: the same payload re-sent
276899
- // unchanged will fail identically, so the client must roll back, not
276900
- // retry. The server normalizer maps SQLSTATE → these codes and tucks the
276901
- // raw constraint/column/table detail into `details` rather than leaking
276902
- // the driver's message text onto the wire.
276895
+ // ── data integrity / database constraints ──────────────────────────
276896
+ // Emitted when a database integrity constraint rejects a write. None are
276897
+ // retryable: the same payload re-sent unchanged fails identically, so the
276898
+ // client must roll back rather than retry. The server maps the underlying SQL
276899
+ // constraint to one of these codes and places the raw constraint, column, and
276900
+ // table detail in `details` instead of exposing the driver's message text.
276903
276901
  not_null_violation: wire("validation", 400, false, "The database rejected the write because a required column was left empty \u2014 a not-null constraint. The error details name the column; supply a value and retry."),
276904
276902
  foreign_key_violation: wire("conflict", 409, false, "The database rejected the write on a foreign-key constraint: a referenced row does not exist, or the row being deleted is still referenced by others. The error details name the constraint."),
276905
276903
  unique_violation: wire("conflict", 409, false, "The write duplicates a value that must be unique \u2014 another row already holds it. Choose a different value, or update the existing row."),
@@ -276963,17 +276961,18 @@ var ERROR_CODES = {
276963
276961
  // ── quota / rate limit (429) ──────────────────────────────────────
276964
276962
  quota_exceeded: wire("rate_limit", 429, true, "Your organization has used up its configured usage quota. Requests will succeed again once the quota resets or the limit is raised."),
276965
276963
  connection_limit_exceeded: wire("rate_limit", 429, true, "Too many concurrent WebSocket connections for this principal or organization. Close idle connections, or retry once others drain."),
276966
- // Per-CREDENTIAL request-rate limit — the fast (RPS/burst) axis, distinct from
276967
- // the slow-axis `quota_exceeded` (org daily/monthly usage). Keyed per API key,
276968
- // so one noisy key backs off without affecting the rest of the org. The
276969
- // `Retry-After` header carries the bucket-refill delay.
276964
+ // A per-key request-rate limit — the fast, requests-per-second axis, as
276965
+ // opposed to `quota_exceeded`, which is the slower organization-wide usage
276966
+ // limit. It is keyed per API key, so one noisy key backs off without affecting
276967
+ // the rest of the organization. The `Retry-After` header carries the delay
276968
+ // before the next request is allowed.
276970
276969
  rate_limit_exceeded: wire("rate_limit", 429, true, "This API key is sending requests faster than its rate limit allows. Slow down and retry after the delay in the `Retry-After` header."),
276971
276970
  // ── server (5xx) ───────────────────────────────────────────────────
276972
276971
  internal_error: wire("server", 500, true, "Something went wrong on Ablo's side \u2014 an unexpected server error. It is safe to retry."),
276973
276972
  quota_lookup_failed: wire("server", 503, true, "The server could not load this organization's quota state, so the request was rejected rather than admitted unchecked. Retry shortly."),
276974
- // The per-key rate-limiter backend (Redis) was unreachable and the API is
276975
- // configured to FAIL CLOSED on that path, so the request was rejected rather
276976
- // than admitted unchecked. Retryable: the next attempt re-probes the backend.
276973
+ // The rate-limiter backend was unreachable and this endpoint is configured to
276974
+ // fail closed, so the request was rejected rather than admitted unchecked. It
276975
+ // is retryable: the next attempt re-probes the backend.
276977
276976
  rate_limiter_unavailable: wire("server", 503, true, "The rate-limiter backend is unavailable and this endpoint is configured to fail closed; retry shortly."),
276978
276977
  turn_open_failed: wire("server", 500, true, "The agent turn could not be opened on the server. It is safe to retry."),
276979
276978
  turn_close_failed: wire("server", 500, true, "The agent turn could not be closed cleanly on the server. It is safe to retry the close."),
@@ -277016,7 +277015,7 @@ var ERROR_CODES = {
277016
277015
  undo_entry_invalid: client("client", "An undo entry failed inverse-op schema validation."),
277017
277016
  mock_mutation_failed: client("client", "A mock mutation adapter was configured to fail."),
277018
277017
  mock_unsupported_operation: client("client", "A mock adapter received an unsupported operation."),
277019
- // ── HTTP route edge codes (egress through app.onError) ─────────────
277018
+ // ── HTTP route edge codes ──────────────────────────────────────────
277020
277019
  invalid_body: wire("validation", 400, false, "The request body was missing, unparseable, or the wrong shape."),
277021
277020
  invalid_json: wire("validation", 400, false, "The request body was not valid JSON."),
277022
277021
  capability_id_required: wire("validation", 400, false, "A capability id is required for this request."),
@@ -277051,6 +277050,7 @@ var ERROR_CODES = {
277051
277050
  protocol_version_unsupported: wire("transport", 426, false, "The client sync-protocol version is outside the range this server supports \u2014 upgrade the SDK (or the server was rolled back mid-fleet)."),
277052
277051
  database_unreachable: wire("validation", 400, false, "Ablo could not reach this database to check that it can stream replication. The connection string may be wrong, the host may not be reachable from Ablo's servers, or the credentials may not be accepted."),
277053
277052
  database_not_replication_ready: wire("validation", 400, false, "This database is not set up for logical replication yet. Every failing item \u2014 wal_level, the publication, the replication grant, a replica identity \u2014 is listed in the error details with its exact fix. `ablo connect` prints the one-time setup; `ablo connect --check` verifies it."),
277053
+ replication_publication_drift: wire("validation", 400, false, "Your schema maps to tables that are not members of the replication publication, so their changes silently never stream and the source looks frozen. The missing tables and the exact `ALTER PUBLICATION \u2026 ADD TABLE \u2026` to add them are in the error details \u2014 Ablo never alters your database for you."),
277054
277054
  query_unknown_relation: wire("validation", 400, false, "The query references a relation the model does not define. Check the relation name against the schema."),
277055
277055
  query_relation_target_unknown: wire("schema", 500, false, "A relation in the query targets a model the schema does not define."),
277056
277056
  query_invalid_identifier: wire("validation", 400, false, "The query contained an invalid identifier."),
@@ -277159,7 +277159,7 @@ var writeGuardSchema = import_zod3.z.object({
277159
277159
  bypass: import_zod3.z.boolean().optional()
277160
277160
  });
277161
277161
  var staleNotificationSchema = import_zod3.z.object({
277162
- /** Stripe-style object tag every returned object names its type. */
277162
+ /** Names this object's type; every returned object carries such a tag. */
277163
277163
  object: import_zod3.z.literal("stale_notification").optional(),
277164
277164
  /** Model name of the conflicting row. */
277165
277165
  model: import_zod3.z.string(),
@@ -277179,8 +277179,8 @@ var staleNotificationSchema = import_zod3.z.object({
277179
277179
  */
277180
277180
  conflictingFields: import_zod3.z.array(import_zod3.z.string()),
277181
277181
  /**
277182
- * Post-conflict live values of `conflictingFields` — the part a plain stale
277183
- * error never carried. Lets the LLM self-heal without a round-trip read.
277182
+ * The live values of `conflictingFields` after the conflict — the piece a
277183
+ * plain stale error omits. It lets the actor reconcile without a follow-up read.
277184
277184
  */
277185
277185
  currentValues: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()),
277186
277186
  /** Who wrote the conflicting delta. */
@@ -277289,10 +277289,10 @@ var claimBeginPayloadSchema = targetRefSchema.extend({
277289
277289
  /** Hint for `expiresAt`; the server caps it. */
277290
277290
  estimatedMs: import_zod3.z.number().optional(),
277291
277291
  /**
277292
- * Opt into the fair wait queue: when the target is already held, the server
277293
- * enqueues this claim (FIFO) and replies `claim_queued` → later
277294
- * `claim_granted`, instead of `claim_rejected`. Clients that set this MUST
277295
- * handle the grant.
277292
+ * Opt into the fair wait queue. When the target is already held, the server
277293
+ * enqueues this claim in FIFO order and replies `claim_queued`, then
277294
+ * `claim_granted` later, instead of `claim_rejected`. A client that sets this
277295
+ * must be ready to handle the grant.
277296
277296
  */
277297
277297
  queue: import_zod3.z.boolean().optional()
277298
277298
  });
@@ -277306,6 +277306,48 @@ var claimReorderPayloadSchema = import_zod3.z.object({
277306
277306
  entityId: import_zod3.z.string(),
277307
277307
  order: import_zod3.z.array(import_zod3.z.object({ heldBy: import_zod3.z.string(), claimId: import_zod3.z.string() }))
277308
277308
  });
277309
+ var claimHeartbeatFieldsSchema = import_zod3.z.object({
277310
+ claimId: import_zod3.z.string().optional(),
277311
+ entityType: import_zod3.z.string().optional(),
277312
+ entityId: import_zod3.z.string().optional(),
277313
+ /** Requested extension from now; the server clamps it, and an extension
277314
+ * never shortens a lease. */
277315
+ ttlMs: import_zod3.z.number().positive().optional(),
277316
+ /**
277317
+ * Lightweight progress the beat carries along ("42/100 pages") — stored
277318
+ * as the claim's `meta.progress` (last beat wins) and peer-visible via
277319
+ * `claim.state` while the lease is held. This is presence, not a
277320
+ * checkpoint: it dies with the lease. Crash-recoverable progress belongs
277321
+ * in the data itself — write a row, and every subscriber already sees it.
277322
+ */
277323
+ details: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional()
277324
+ });
277325
+ var claimHeartbeatPayloadSchema = claimHeartbeatFieldsSchema.refine(
277326
+ (payload) => payload.claimId !== void 0 || payload.entityType !== void 0 && payload.entityId !== void 0,
277327
+ {
277328
+ message: "a heartbeat must identify its claim \u2014 pass claimId, or entityType and entityId together"
277329
+ }
277330
+ );
277331
+ var claimHeartbeatAckPayloadSchema = import_zod3.z.object({
277332
+ claimId: import_zod3.z.string(),
277333
+ status: import_zod3.z.enum(["held", "queued", "lost"]),
277334
+ expiresAt: import_zod3.z.number().optional(),
277335
+ position: import_zod3.z.number().optional(),
277336
+ /**
277337
+ * How many participants are waiting in line behind a held lease — the
277338
+ * cooperative-yield pressure signal (present on `held`). A worker that can
277339
+ * checkpoint may choose to release early when others wait. Hard
277340
+ * cancellation needs no extra field: a preempted, expired, or revoked
277341
+ * lease answers the next beat with `lost`.
277342
+ */
277343
+ queueDepth: import_zod3.z.number().optional()
277344
+ });
277345
+ var claimHeartbeatBatchPayloadSchema = claimHeartbeatFieldsSchema.pick(
277346
+ { ttlMs: true }
277347
+ );
277348
+ var claimHeartbeatBatchAckPayloadSchema = import_zod3.z.object({
277349
+ results: import_zod3.z.array(claimHeartbeatAckPayloadSchema)
277350
+ });
277309
277351
  var updateSubscriptionPayloadSchema = import_zod3.z.object({
277310
277352
  syncGroups: import_zod3.z.array(syncGroupInputSchema)
277311
277353
  });
@@ -277355,35 +277397,34 @@ var presenceUpdateFrameSchema = import_zod3.z.object({
277355
277397
 
277356
277398
  // src/errors.ts
277357
277399
  var AbloError = class extends Error {
277358
- /** Discriminator string matches the class name. Lets consumers
277359
- * switch on `e.type` without `instanceof` checks across package
277360
- * boundaries (matches Stripe's `err.type` pattern). */
277400
+ /** A discriminator string equal to the class name. Switch on `error.type` to
277401
+ * distinguish error kinds when `instanceof` is unreliable, such as after an
277402
+ * error has crossed a serialization boundary. */
277361
277403
  type = "AbloError";
277362
- /** Stable short identifier for logs + metrics, drawn from the closed
277363
- * {@link ErrorCode} registry — e.g. `'apikey_invalid'`,
277364
- * `'capability_scope_denied'`. Stored as a plain `string` (not
277365
- * `ErrorCode`) so an older SDK still surfaces a newer server's code it
277366
- * doesn't recognise yet; producers are constrained at the constructor
277367
- * param instead. */
277404
+ /** A stable, machine-readable identifier for the error, drawn from the
277405
+ * {@link ErrorCode} registry — for example `'apikey_invalid'` or
277406
+ * `'capability_scope_denied'` suitable for logs, metrics, and `switch`
277407
+ * handling. It is typed as a plain `string` rather than {@link ErrorCode} so
277408
+ * this client can still surface a code from a newer server that it does not
277409
+ * yet recognize; code producers are constrained at the constructor instead. */
277368
277410
  code;
277369
- /** HTTP status code when the error originated from an HTTP response. */
277411
+ /** HTTP status code, when the error originated from an HTTP response. */
277370
277412
  httpStatus;
277371
- /** Correlation id for ops present when the server sent one on
277372
- * `x-request-id`. Include in support tickets. */
277413
+ /** A correlation id for tracing a request through the server, present when the
277414
+ * server returned one on the `x-request-id` header. Include it in support
277415
+ * requests. */
277373
277416
  requestId;
277374
- /** Which input caused the error a model/field path like
277375
- * `'dataroomMember.grants.subject'`. Mirrors Stripe's `error.param`;
277376
- * lets tooling point at the exact offending declaration. */
277417
+ /** The specific input that caused the error, as a model or field path such as
277418
+ * `'dataroomMember.grants.subject'`, so tooling can point at the exact
277419
+ * offending value. */
277377
277420
  param;
277378
- /** Link to the docs for this `code`. Mirrors Stripe's `error.doc_url`.
277379
- * Defaults from `code` via {@link docUrlForCode} when omitted. */
277421
+ /** A link to the documentation for this error's {@link code}. When not set
277422
+ * explicitly, it is derived from the code by {@link docUrlForCode}. */
277380
277423
  docUrl;
277381
- /** Domain-specific structured payload merged into the wire envelope —
277382
- * e.g. a schema push's `{ warnings, unexecutable }`, a stale write's
277383
- * conflicting rows. Mirrors how Stripe attaches type-specific fields
277384
- * (`decline_code`, `payment_intent`) alongside the standard ones, so a
277385
- * structured error keeps its detail through `toJSON` instead of being
277386
- * flattened to a bare message. */
277424
+ /** Extra structured data specific to this error, merged into the serialized
277425
+ * envelope — for example a schema push's `{ warnings, unexecutable }`, or the
277426
+ * conflicting rows of a stale write. This detail is preserved through
277427
+ * {@link toJSON} rather than flattened into the message. */
277387
277428
  details;
277388
277429
  constructor(message, options) {
277389
277430
  super(message);
@@ -277400,9 +277441,10 @@ var AbloError = class extends Error {
277400
277441
  }
277401
277442
  }
277402
277443
  /**
277403
- * Serialize to Stripe's error-object shape: `{ type, code, param, message,
277404
- * doc_url, request_id }`. One JSON shape across HTTP bodies, WS frames, and
277405
- * logs so consumers parse Ablo errors the way they already parse Stripe's.
277444
+ * Serializes the error to its wire shape: `{ type, code, param, message,
277445
+ * doc_url, request_id }`, with any {@link details} merged in. This is the same
277446
+ * JSON shape the SDK uses across HTTP bodies, WebSocket frames, and logs, so a
277447
+ * consumer parses every Ablo error the same way.
277406
277448
  */
277407
277449
  toJSON() {
277408
277450
  return {
@@ -277416,12 +277458,13 @@ var AbloError = class extends Error {
277416
277458
  };
277417
277459
  }
277418
277460
  /**
277419
- * A single, leak-proof line for logs and `String(err)` / template
277420
- * interpolation: `AbloValidationError [code]: message (see docs) [request_id: …]`.
277461
+ * Formats the error as a single line for logs and string interpolation:
277462
+ * `AbloValidationError [code]: message (see docs) [request_id: …]`.
277421
277463
  *
277422
- * Deliberately does NOT dump `details`, `cause`, or the stack the thing that
277423
- * makes `console.error(richError)` an unreadable wall of text. The structured
277424
- * payload stays available via {@link toJSON}; this is the human one-liner.
277464
+ * It intentionally omits {@link details}, the cause, and the stack, which are
277465
+ * what turn a logged rich error into an unreadable wall of text. The full
277466
+ * structured payload remains available through {@link toJSON}; this is the
277467
+ * concise human-readable form.
277425
277468
  */
277426
277469
  toString() {
277427
277470
  const code = this.code ? ` [${this.code}]` : "";
@@ -277462,8 +277505,8 @@ var ErrorFieldSchema = import_zod4.z.preprocess(
277462
277505
  import_zod4.z.union([import_zod4.z.string(), NestedErrorShapeSchema]).optional()
277463
277506
  ).catch(void 0);
277464
277507
  var ErrorBodyShapeSchema = import_zod4.z.object({
277465
- /** Legacy: `error` was a flat code string on older endpoints. Newer
277466
- * endpoints (CommitReceipt) carry `error` as a nested object. */
277508
+ /** The `error` field may be a flat code string, as some endpoints return,
277509
+ * or a nested error object, as a {@link CommitReceipt} carries. */
277467
277510
  error: ErrorFieldSchema,
277468
277511
  code: OptionalWireStringSchema,
277469
277512
  reason: OptionalWireStringSchema,
@@ -280310,6 +280353,12 @@ async function push(argv) {
280310
280353
  ` This is a ${import_picocolors3.default.bold("database privilege")} error (Postgres 42501 / row-level security), not a key scope \u2014 a different API key won't help. The role behind this org's database can't write the target. Provision a writable, RLS-scoped role with ${import_picocolors3.default.bold("npx ablo migrate")}, or check the org's database registration. See docs/plans/read-path-logical-replication-vs-hosting.md.`
280311
280354
  )
280312
280355
  );
280356
+ } else if (code === "schema_provisioning_forbidden") {
280357
+ console.error(
280358
+ import_picocolors3.default.dim(
280359
+ ` This is not a key problem \u2014 the push was authorized, but the target database refused to let the engine create tables (Postgres 42501). On the replication read path Ablo never runs DDL: register your database as a data source with ${import_picocolors3.default.bold("npx ablo connect --register")}, and pushes to that environment record the schema as metadata only \u2014 no tables are created anywhere.`
280360
+ )
280361
+ );
280313
280362
  } else if (args.apiKey != null && classifyCredentialKind(args.apiKey) === "restricted") {
280314
280363
  console.error(
280315
280364
  import_picocolors3.default.dim(
@@ -280768,6 +280817,9 @@ async function runCheck() {
280768
280817
  );
280769
280818
  process.exit(1);
280770
280819
  }
280820
+ function registerEndpoint(baseUrl2) {
280821
+ return `${baseUrl2.replace(/\/+$/, "")}/api/v1/datasources`;
280822
+ }
280771
280823
  async function runRegister() {
280772
280824
  const dbUrl = requireDatabaseUrl("--register");
280773
280825
  const apiKey = resolveApiKey();
@@ -280792,7 +280844,7 @@ async function runRegister() {
280792
280844
  const apiUrl2 = (process.env.ABLO_API_URL ?? DEFAULT_URL).replace(/\/+$/, "");
280793
280845
  let res;
280794
280846
  try {
280795
- res = await fetch(`${apiUrl2}/v1/datasources`, {
280847
+ res = await fetch(registerEndpoint(apiUrl2), {
280796
280848
  method: "POST",
280797
280849
  headers: { "content-type": "application/json", authorization: `Bearer ${apiKey}` },
280798
280850
  body: JSON.stringify({ connectionString: dbUrl })
@@ -281724,9 +281776,9 @@ async function status(args = []) {
281724
281776
  mode: mode2,
281725
281777
  // The locally-active project (`ablo projects use`); null = org-default.
281726
281778
  project: activeProject2 ?? null,
281727
- // The credential the CLI resolves for requests, with its provenance
281728
- // 'env' | '.env.local' | '.env' | 'stored' (users debug key confusion
281729
- // constantly; the SOURCE is usually the answer).
281779
+ // The credential the CLI resolves for requests, with its source
281780
+ // 'env' | '.env.local' | '.env' | 'stored'. Key confusion is a common
281781
+ // source of trouble, and the source is usually the answer.
281730
281782
  effectiveKey: {
281731
281783
  prefix: effective2.key ? effective2.key.slice(0, 12) : null,
281732
281784
  source: effective2.source
@@ -281739,16 +281791,16 @@ async function status(args = []) {
281739
281791
  keyMatchesStoredActiveKey: key2.keyMatchesStoredActiveKey,
281740
281792
  keyMismatch: key2.keyMismatch,
281741
281793
  organizationId: entry?.organizationId ?? null,
281742
- // What `ablo push` would do right now — the one-command answer to
281743
- // "why did push demand a different key" (2026-06-11 live-key incident).
281794
+ // What `ablo push` would do right now — the answer to "why did push
281795
+ // demand a different key".
281744
281796
  push: {
281745
281797
  flow: plan2.flow,
281746
281798
  keyPrefix: plan2.apiKey?.slice(0, 12) ?? null,
281747
281799
  keySource: plan2.source
281748
281800
  },
281749
- // The schema ACTIVE on this key's plane — the typename/conflict the
281750
- // engine enforces, which may differ from local `schema.ts`. null = the
281751
- // server didn't answer (unreachable / old server / no key).
281801
+ // The schema active for this key's environment — the typename and conflict
281802
+ // rules the engine enforces, which may differ from your local `schema.ts`.
281803
+ // null means the server did not answer (unreachable, too old, or no key).
281752
281804
  schema: pushed ? {
281753
281805
  active: pushed.active,
281754
281806
  version: pushed.version ?? null,
@@ -282633,12 +282685,12 @@ async function pull(argv) {
282633
282685
  );
282634
282686
  }
282635
282687
 
282636
- // src/cli/prisma-pull.ts
282688
+ // src/cli/prismaPull.ts
282637
282689
  init_cjs_shims();
282638
282690
  var import_picocolors17 = __toESM(require_picocolors(), 1);
282639
282691
  var import_fs10 = require("fs");
282640
282692
 
282641
- // src/cli/schema-ir.ts
282693
+ // src/cli/schemaIr.ts
282642
282694
  init_cjs_shims();
282643
282695
  function camelToSnake3(s) {
282644
282696
  return s.replace(/[A-Z]/g, (ch) => `_${ch.toLowerCase()}`);
@@ -282708,7 +282760,7 @@ function emitSchemaSource(schema, importPath) {
282708
282760
  return lines.join("\n");
282709
282761
  }
282710
282762
 
282711
- // src/cli/prisma-pull.ts
282763
+ // src/cli/prismaPull.ts
282712
282764
  var DEFAULT_SCHEMA = "prisma/schema.prisma";
282713
282765
  var DEFAULT_OUT3 = "ablo/schema.ts";
282714
282766
  var DEFAULT_IMPORT2 = "@abloatai/ablo/schema";
@@ -282965,7 +283017,7 @@ async function prismaPull(argv) {
282965
283017
  );
282966
283018
  }
282967
283019
 
282968
- // src/cli/drizzle-pull.ts
283020
+ // src/cli/drizzlePull.ts
282969
283021
  init_cjs_shims();
282970
283022
  var import_picocolors18 = __toESM(require_picocolors(), 1);
282971
283023
  var import_fs11 = require("fs");