@abloatai/ablo 0.36.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (597) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +55 -2014
  3. package/NOTICE +2 -2
  4. package/README.md +45 -63
  5. package/assets/banner.png +0 -0
  6. package/dist/auth.d.ts +2 -0
  7. package/dist/auth.d.ts.map +1 -0
  8. package/dist/auth.js +2 -0
  9. package/dist/auth.js.map +1 -0
  10. package/dist/client.d.ts +3 -0
  11. package/dist/client.d.ts.map +1 -0
  12. package/dist/client.js +3 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/coordination.d.ts +2 -0
  15. package/dist/coordination.d.ts.map +1 -0
  16. package/dist/coordination.js +2 -0
  17. package/dist/coordination.js.map +1 -0
  18. package/dist/index.d.ts +3 -114
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +3 -163
  21. package/dist/index.js.map +1 -0
  22. package/dist/react.d.ts +4 -0
  23. package/dist/react.d.ts.map +1 -0
  24. package/dist/react.js +3 -0
  25. package/dist/react.js.map +1 -0
  26. package/dist/schema.d.ts +2 -0
  27. package/dist/schema.d.ts.map +1 -0
  28. package/dist/schema.js +2 -0
  29. package/dist/schema.js.map +1 -0
  30. package/dist/server.d.ts +2 -0
  31. package/dist/server.d.ts.map +1 -0
  32. package/dist/server.js +2 -0
  33. package/dist/server.js.map +1 -0
  34. package/dist/source-conformance.d.ts +2 -0
  35. package/dist/source-conformance.d.ts.map +1 -0
  36. package/dist/source-conformance.js +2 -0
  37. package/dist/source-conformance.js.map +1 -0
  38. package/dist/source-drizzle.d.ts +2 -0
  39. package/dist/source-drizzle.d.ts.map +1 -0
  40. package/dist/source-drizzle.js +2 -0
  41. package/dist/source-drizzle.js.map +1 -0
  42. package/dist/source-kysely.d.ts +2 -0
  43. package/dist/source-kysely.d.ts.map +1 -0
  44. package/dist/source-kysely.js +2 -0
  45. package/dist/source-kysely.js.map +1 -0
  46. package/dist/source-next.d.ts +2 -0
  47. package/dist/source-next.d.ts.map +1 -0
  48. package/dist/source-next.js +2 -0
  49. package/dist/source-next.js.map +1 -0
  50. package/dist/source.d.ts +2 -0
  51. package/dist/source.d.ts.map +1 -0
  52. package/dist/source.js +2 -0
  53. package/dist/source.js.map +1 -0
  54. package/dist/wire.d.ts +2 -0
  55. package/dist/wire.d.ts.map +1 -0
  56. package/dist/wire.js +2 -0
  57. package/dist/wire.js.map +1 -0
  58. package/docs/agents.md +1 -1
  59. package/docs/api-keys.md +7 -6
  60. package/docs/api.md +10 -10
  61. package/docs/client-behavior.md +5 -5
  62. package/docs/coordination.md +52 -62
  63. package/docs/data-sources.md +1 -1
  64. package/docs/examples/agent-human.md +4 -4
  65. package/docs/examples/ai-sdk-tool.md +1 -1
  66. package/docs/examples/existing-python-backend.md +15 -4
  67. package/docs/examples/nextjs.md +27 -6
  68. package/docs/examples/server-agent.md +2 -2
  69. package/docs/how-it-works.md +4 -4
  70. package/docs/identity.md +2 -1
  71. package/docs/integration-guide.md +24 -13
  72. package/docs/internal/README.md +18 -0
  73. package/docs/internal/agent-fleet-coordination-design.md +171 -0
  74. package/docs/internal/agent-orchestration.md +58 -0
  75. package/docs/internal/commit-identifiers.md +91 -0
  76. package/docs/internal/concurrency-open-decisions.md +37 -0
  77. package/docs/internal/data-source-reverse-channel.md +150 -0
  78. package/docs/internal/per-field-conflict-detection.md +165 -0
  79. package/docs/internal/postgres-replication.md +64 -0
  80. package/docs/internal/serializable-schema.md +119 -0
  81. package/docs/internal/structure.md +32 -0
  82. package/docs/mcp.md +2 -2
  83. package/docs/migration.md +3 -3
  84. package/docs/quickstart.md +2 -2
  85. package/docs/react.md +5 -5
  86. package/docs/schema-contract.md +3 -3
  87. package/docs/sessions.md +91 -37
  88. package/examples/README.md +2 -2
  89. package/examples/data-source/README.md +1 -1
  90. package/examples/data-source/ablo-driver.ts +1 -1
  91. package/examples/data-source/customer-server.ts +1 -1
  92. package/examples/data-source/run.ts +1 -1
  93. package/examples/data-source/schema.ts +1 -1
  94. package/examples/quickstart.ts +2 -2
  95. package/llms.txt +8 -8
  96. package/package.json +63 -166
  97. package/bin/ablo.cjs +0 -39
  98. package/dist/BaseSyncedStore.d.ts +0 -843
  99. package/dist/BaseSyncedStore.js +0 -1971
  100. package/dist/Database.d.ts +0 -323
  101. package/dist/Database.js +0 -1502
  102. package/dist/InstanceCache.d.ts +0 -237
  103. package/dist/InstanceCache.js +0 -1166
  104. package/dist/LazyReferenceCollection.d.ts +0 -177
  105. package/dist/LazyReferenceCollection.js +0 -461
  106. package/dist/Model.d.ts +0 -454
  107. package/dist/Model.js +0 -919
  108. package/dist/ModelRegistry.d.ts +0 -225
  109. package/dist/ModelRegistry.js +0 -539
  110. package/dist/NetworkMonitor.d.ts +0 -28
  111. package/dist/NetworkMonitor.js +0 -79
  112. package/dist/RuntimeContext.d.ts +0 -52
  113. package/dist/RuntimeContext.js +0 -80
  114. package/dist/SyncClient.d.ts +0 -541
  115. package/dist/SyncClient.js +0 -2202
  116. package/dist/adapters/alwaysOnline.d.ts +0 -14
  117. package/dist/adapters/alwaysOnline.js +0 -17
  118. package/dist/adapters/inMemoryStorage.d.ts +0 -31
  119. package/dist/adapters/inMemoryStorage.js +0 -110
  120. package/dist/ai-sdk/coordinatedTool.d.ts +0 -120
  121. package/dist/ai-sdk/coordinatedTool.js +0 -134
  122. package/dist/ai-sdk/coordinationContext.d.ts +0 -46
  123. package/dist/ai-sdk/coordinationContext.js +0 -106
  124. package/dist/ai-sdk/index.d.ts +0 -121
  125. package/dist/ai-sdk/index.js +0 -121
  126. package/dist/ai-sdk/wrap.d.ts +0 -65
  127. package/dist/ai-sdk/wrap.js +0 -39
  128. package/dist/auth/index.d.ts +0 -1
  129. package/dist/auth/index.js +0 -8
  130. package/dist/batching/index.d.ts +0 -55
  131. package/dist/batching/index.js +0 -147
  132. package/dist/client/Ablo.d.ts +0 -231
  133. package/dist/client/Ablo.js +0 -160
  134. package/dist/client/abloClient.d.ts +0 -309
  135. package/dist/client/abloClient.js +0 -13
  136. package/dist/client/clientPrelude.d.ts +0 -52
  137. package/dist/client/clientPrelude.js +0 -60
  138. package/dist/client/consoleLogger.d.ts +0 -35
  139. package/dist/client/consoleLogger.js +0 -44
  140. package/dist/client/coreClient.d.ts +0 -60
  141. package/dist/client/coreClient.js +0 -118
  142. package/dist/client/createInternalComponents.d.ts +0 -50
  143. package/dist/client/createInternalComponents.js +0 -98
  144. package/dist/client/createModelProxy.d.ts +0 -248
  145. package/dist/client/createModelProxy.js +0 -884
  146. package/dist/client/humans.d.ts +0 -69
  147. package/dist/client/humans.js +0 -78
  148. package/dist/client/modelRegistration.d.ts +0 -10
  149. package/dist/client/modelRegistration.js +0 -312
  150. package/dist/client/options.d.ts +0 -461
  151. package/dist/client/options.js +0 -7
  152. package/dist/client/reactiveEngine.d.ts +0 -53
  153. package/dist/client/reactiveEngine.js +0 -688
  154. package/dist/client/resourceTypes.d.ts +0 -12
  155. package/dist/client/resourceTypes.js +0 -10
  156. package/dist/client/schemaConfig.d.ts +0 -44
  157. package/dist/client/schemaConfig.js +0 -185
  158. package/dist/client/storeCluster.d.ts +0 -47
  159. package/dist/client/storeCluster.js +0 -118
  160. package/dist/client/storeLifecycle.d.ts +0 -61
  161. package/dist/client/storeLifecycle.js +0 -231
  162. package/dist/client/validateAbloOptions.d.ts +0 -42
  163. package/dist/client/validateAbloOptions.js +0 -43
  164. package/dist/client/wsMutationExecutor.d.ts +0 -27
  165. package/dist/client/wsMutationExecutor.js +0 -72
  166. package/dist/context.d.ts +0 -42
  167. package/dist/context.js +0 -81
  168. package/dist/coordination/ClaimLog.d.ts +0 -26
  169. package/dist/coordination/ClaimLog.js +0 -32
  170. package/dist/coordination/index.d.ts +0 -1
  171. package/dist/coordination/index.js +0 -8
  172. package/dist/core/index.d.ts +0 -33
  173. package/dist/core/index.js +0 -48
  174. package/dist/docs/catalog.d.ts +0 -72
  175. package/dist/docs/catalog.js +0 -230
  176. package/dist/docs/index.d.ts +0 -10
  177. package/dist/docs/index.js +0 -10
  178. package/dist/environment.d.ts +0 -1
  179. package/dist/environment.js +0 -8
  180. package/dist/interfaces/index.d.ts +0 -311
  181. package/dist/interfaces/index.js +0 -9
  182. package/dist/keys/index.d.ts +0 -1
  183. package/dist/keys/index.js +0 -8
  184. package/dist/mutators/RecordingMutation.d.ts +0 -36
  185. package/dist/mutators/RecordingMutation.js +0 -182
  186. package/dist/mutators/Transaction.d.ts +0 -40
  187. package/dist/mutators/Transaction.js +0 -58
  188. package/dist/mutators/UndoManager.d.ts +0 -258
  189. package/dist/mutators/UndoManager.js +0 -658
  190. package/dist/mutators/defineMutators.d.ts +0 -60
  191. package/dist/mutators/defineMutators.js +0 -18
  192. package/dist/mutators/inverseOp.d.ts +0 -126
  193. package/dist/mutators/inverseOp.js +0 -71
  194. package/dist/mutators/mutateActions.d.ts +0 -45
  195. package/dist/mutators/mutateActions.js +0 -105
  196. package/dist/mutators/readerActions.d.ts +0 -33
  197. package/dist/mutators/readerActions.js +0 -57
  198. package/dist/mutators/undoApply.d.ts +0 -51
  199. package/dist/mutators/undoApply.js +0 -117
  200. package/dist/policy/index.d.ts +0 -21
  201. package/dist/policy/index.js +0 -20
  202. package/dist/query/QueryProcessor.d.ts +0 -75
  203. package/dist/query/QueryProcessor.js +0 -255
  204. package/dist/query/client.d.ts +0 -64
  205. package/dist/query/client.js +0 -138
  206. package/dist/query/types.d.ts +0 -85
  207. package/dist/query/types.js +0 -16
  208. package/dist/react/AbloProvider.d.ts +0 -242
  209. package/dist/react/AbloProvider.js +0 -458
  210. package/dist/react/ClientSideSuspense.d.ts +0 -36
  211. package/dist/react/ClientSideSuspense.js +0 -17
  212. package/dist/react/DefaultFallback.d.ts +0 -24
  213. package/dist/react/DefaultFallback.js +0 -43
  214. package/dist/react/context.d.ts +0 -55
  215. package/dist/react/context.js +0 -29
  216. package/dist/react/createAbloReact.d.ts +0 -56
  217. package/dist/react/createAbloReact.js +0 -51
  218. package/dist/react/index.d.ts +0 -62
  219. package/dist/react/index.js +0 -69
  220. package/dist/react/internalContext.d.ts +0 -33
  221. package/dist/react/internalContext.js +0 -3
  222. package/dist/react/useAblo.d.ts +0 -82
  223. package/dist/react/useAblo.js +0 -120
  224. package/dist/react/useCurrentUserId.d.ts +0 -22
  225. package/dist/react/useCurrentUserId.js +0 -34
  226. package/dist/react/useErrorListener.d.ts +0 -20
  227. package/dist/react/useErrorListener.js +0 -38
  228. package/dist/react/useMutationFailureListener.d.ts +0 -26
  229. package/dist/react/useMutationFailureListener.js +0 -38
  230. package/dist/react/useMutators.d.ts +0 -56
  231. package/dist/react/useMutators.js +0 -84
  232. package/dist/react/useReactive.d.ts +0 -35
  233. package/dist/react/useReactive.js +0 -123
  234. package/dist/react/useSyncStatus.d.ts +0 -59
  235. package/dist/react/useSyncStatus.js +0 -76
  236. package/dist/react/useUndoScope.d.ts +0 -34
  237. package/dist/react/useUndoScope.js +0 -81
  238. package/dist/schema/coordination.d.ts +0 -112
  239. package/dist/schema/coordination.js +0 -133
  240. package/dist/schema/ddl.d.ts +0 -97
  241. package/dist/schema/ddl.js +0 -491
  242. package/dist/schema/ddlLock.d.ts +0 -35
  243. package/dist/schema/ddlLock.js +0 -46
  244. package/dist/schema/diff.d.ts +0 -225
  245. package/dist/schema/diff.js +0 -289
  246. package/dist/schema/generate.d.ts +0 -19
  247. package/dist/schema/generate.js +0 -86
  248. package/dist/schema/index.d.ts +0 -42
  249. package/dist/schema/index.js +0 -80
  250. package/dist/schema/queries.d.ts +0 -201
  251. package/dist/schema/queries.js +0 -144
  252. package/dist/schema/select.d.ts +0 -40
  253. package/dist/schema/select.js +0 -90
  254. package/dist/schema/serialize.d.ts +0 -115
  255. package/dist/schema/serialize.js +0 -265
  256. package/dist/schema/sugar.d.ts +0 -109
  257. package/dist/schema/sugar.js +0 -83
  258. package/dist/schema/syncDeltaRow.d.ts +0 -6
  259. package/dist/schema/syncDeltaRow.js +0 -6
  260. package/dist/server/adapter.d.ts +0 -173
  261. package/dist/server/adapter.js +0 -18
  262. package/dist/server/commit.d.ts +0 -107
  263. package/dist/server/commit.js +0 -1
  264. package/dist/server/index.d.ts +0 -14
  265. package/dist/server/index.js +0 -2
  266. package/dist/server/readConfig.d.ts +0 -80
  267. package/dist/server/readConfig.js +0 -8
  268. package/dist/server/storageMode.d.ts +0 -23
  269. package/dist/server/storageMode.js +0 -17
  270. package/dist/source/adapter.d.ts +0 -83
  271. package/dist/source/adapter.js +0 -24
  272. package/dist/source/adapters/drizzle.d.ts +0 -48
  273. package/dist/source/adapters/drizzle.js +0 -219
  274. package/dist/source/adapters/kysely.d.ts +0 -42
  275. package/dist/source/adapters/kysely.js +0 -205
  276. package/dist/source/adapters/kyselyMutationCore.d.ts +0 -76
  277. package/dist/source/adapters/kyselyMutationCore.js +0 -125
  278. package/dist/source/adapters/memory.d.ts +0 -13
  279. package/dist/source/adapters/memory.js +0 -130
  280. package/dist/source/adapters/prisma.d.ts +0 -63
  281. package/dist/source/adapters/prisma.js +0 -202
  282. package/dist/source/conformance.d.ts +0 -37
  283. package/dist/source/conformance.js +0 -215
  284. package/dist/source/connector.d.ts +0 -95
  285. package/dist/source/connector.js +0 -266
  286. package/dist/source/connectorProtocol.d.ts +0 -154
  287. package/dist/source/connectorProtocol.js +0 -163
  288. package/dist/source/contract.d.ts +0 -195
  289. package/dist/source/contract.js +0 -164
  290. package/dist/source/factory.d.ts +0 -92
  291. package/dist/source/factory.js +0 -286
  292. package/dist/source/idempotency.d.ts +0 -61
  293. package/dist/source/idempotency.js +0 -144
  294. package/dist/source/index.d.ts +0 -23
  295. package/dist/source/index.js +0 -30
  296. package/dist/source/migrations.d.ts +0 -21
  297. package/dist/source/migrations.js +0 -103
  298. package/dist/source/next.d.ts +0 -32
  299. package/dist/source/next.js +0 -25
  300. package/dist/source/pushQueue.d.ts +0 -134
  301. package/dist/source/pushQueue.js +0 -256
  302. package/dist/source/signing.d.ts +0 -92
  303. package/dist/source/signing.js +0 -162
  304. package/dist/source/types.d.ts +0 -401
  305. package/dist/source/types.js +0 -59
  306. package/dist/storeContract.d.ts +0 -145
  307. package/dist/storeContract.js +0 -12
  308. package/dist/stores/DatabaseManager.d.ts +0 -107
  309. package/dist/stores/DatabaseManager.js +0 -388
  310. package/dist/stores/ObjectStore.d.ts +0 -115
  311. package/dist/stores/ObjectStore.js +0 -393
  312. package/dist/stores/ObjectStoreContract.d.ts +0 -38
  313. package/dist/stores/ObjectStoreContract.js +0 -1
  314. package/dist/stores/StoreManager.d.ts +0 -114
  315. package/dist/stores/StoreManager.js +0 -304
  316. package/dist/stores/SyncActionStore.d.ts +0 -99
  317. package/dist/stores/SyncActionStore.js +0 -506
  318. package/dist/stores/openIDBWithTimeout.d.ts +0 -65
  319. package/dist/stores/openIDBWithTimeout.js +0 -153
  320. package/dist/stores/syncAction.d.ts +0 -26
  321. package/dist/stores/syncAction.js +0 -16
  322. package/dist/surface.d.ts +0 -36
  323. package/dist/surface.js +0 -75
  324. package/dist/sync/BootstrapFetcher.d.ts +0 -284
  325. package/dist/sync/BootstrapFetcher.js +0 -964
  326. package/dist/sync/ConnectionManager.d.ts +0 -8
  327. package/dist/sync/ConnectionManager.js +0 -8
  328. package/dist/sync/OnDemandLoader.d.ts +0 -231
  329. package/dist/sync/OnDemandLoader.js +0 -743
  330. package/dist/sync/SubscriptionManager.d.ts +0 -159
  331. package/dist/sync/SubscriptionManager.js +0 -243
  332. package/dist/sync/SyncWebSocket.d.ts +0 -173
  333. package/dist/sync/SyncWebSocket.js +0 -438
  334. package/dist/sync/awaitClaimGrant.d.ts +0 -6
  335. package/dist/sync/awaitClaimGrant.js +0 -6
  336. package/dist/sync/bootstrapApply.d.ts +0 -73
  337. package/dist/sync/bootstrapApply.js +0 -73
  338. package/dist/sync/commitFrames.d.ts +0 -8
  339. package/dist/sync/commitFrames.js +0 -8
  340. package/dist/sync/contextPorts.d.ts +0 -18
  341. package/dist/sync/contextPorts.js +0 -31
  342. package/dist/sync/createClaimStream.d.ts +0 -7
  343. package/dist/sync/createClaimStream.js +0 -7
  344. package/dist/sync/createPresenceStream.d.ts +0 -69
  345. package/dist/sync/createPresenceStream.js +0 -200
  346. package/dist/sync/createSnapshot.d.ts +0 -29
  347. package/dist/sync/createSnapshot.js +0 -118
  348. package/dist/sync/credentialLifecycle.d.ts +0 -7
  349. package/dist/sync/credentialLifecycle.js +0 -7
  350. package/dist/sync/deltaPipeline.d.ts +0 -114
  351. package/dist/sync/deltaPipeline.js +0 -278
  352. package/dist/sync/groupChange.d.ts +0 -116
  353. package/dist/sync/groupChange.js +0 -244
  354. package/dist/sync/participants.d.ts +0 -132
  355. package/dist/sync/participants.js +0 -346
  356. package/dist/sync/persistedPrefix.d.ts +0 -12
  357. package/dist/sync/persistedPrefix.js +0 -22
  358. package/dist/sync/schemaDrift.d.ts +0 -55
  359. package/dist/sync/schemaDrift.js +0 -53
  360. package/dist/sync/schemas.d.ts +0 -71
  361. package/dist/sync/schemas.js +0 -94
  362. package/dist/sync/syncCursor.d.ts +0 -40
  363. package/dist/sync/syncCursor.js +0 -55
  364. package/dist/sync/syncPlan.d.ts +0 -54
  365. package/dist/sync/syncPlan.js +0 -50
  366. package/dist/sync/wsFrameHandlers.d.ts +0 -8
  367. package/dist/sync/wsFrameHandlers.js +0 -8
  368. package/dist/syncLog/contract.d.ts +0 -20
  369. package/dist/syncLog/contract.js +0 -19
  370. package/dist/syncLog/index.d.ts +0 -1
  371. package/dist/syncLog/index.js +0 -1
  372. package/dist/transaction/ablo.d.ts +0 -88
  373. package/dist/transaction/ablo.js +0 -33
  374. package/dist/transaction/auth/apiKey.d.ts +0 -152
  375. package/dist/transaction/auth/apiKey.js +0 -419
  376. package/dist/transaction/auth/bootstrapScope.d.ts +0 -15
  377. package/dist/transaction/auth/bootstrapScope.js +0 -1
  378. package/dist/transaction/auth/capability.d.ts +0 -212
  379. package/dist/transaction/auth/capability.js +0 -224
  380. package/dist/transaction/auth/credentialEndpoint.d.ts +0 -61
  381. package/dist/transaction/auth/credentialEndpoint.js +0 -86
  382. package/dist/transaction/auth/credentialPolicy.d.ts +0 -148
  383. package/dist/transaction/auth/credentialPolicy.js +0 -125
  384. package/dist/transaction/auth/credentialSource.d.ts +0 -30
  385. package/dist/transaction/auth/credentialSource.js +0 -55
  386. package/dist/transaction/auth/hostedEndpoints.d.ts +0 -21
  387. package/dist/transaction/auth/hostedEndpoints.js +0 -21
  388. package/dist/transaction/auth/identity.d.ts +0 -55
  389. package/dist/transaction/auth/identity.js +0 -210
  390. package/dist/transaction/auth/index.d.ts +0 -162
  391. package/dist/transaction/auth/index.js +0 -304
  392. package/dist/transaction/auth/schemas.d.ts +0 -59
  393. package/dist/transaction/auth/schemas.js +0 -85
  394. package/dist/transaction/auth/sessionMint.d.ts +0 -28
  395. package/dist/transaction/auth/sessionMint.js +0 -85
  396. package/dist/transaction/coordination/awaitClaimGrant.d.ts +0 -56
  397. package/dist/transaction/coordination/awaitClaimGrant.js +0 -124
  398. package/dist/transaction/coordination/claimHeartbeatLoop.d.ts +0 -84
  399. package/dist/transaction/coordination/claimHeartbeatLoop.js +0 -108
  400. package/dist/transaction/coordination/claimMeta.d.ts +0 -49
  401. package/dist/transaction/coordination/claimMeta.js +0 -52
  402. package/dist/transaction/coordination/createClaimStream.d.ts +0 -64
  403. package/dist/transaction/coordination/createClaimStream.js +0 -475
  404. package/dist/transaction/coordination/events.d.ts +0 -74
  405. package/dist/transaction/coordination/events.js +0 -7
  406. package/dist/transaction/coordination/index.d.ts +0 -19
  407. package/dist/transaction/coordination/index.js +0 -45
  408. package/dist/transaction/coordination/locator.d.ts +0 -104
  409. package/dist/transaction/coordination/locator.js +0 -102
  410. package/dist/transaction/coordination/schema.d.ts +0 -1536
  411. package/dist/transaction/coordination/schema.js +0 -1177
  412. package/dist/transaction/coordination/targetConflict.d.ts +0 -2
  413. package/dist/transaction/coordination/targetConflict.js +0 -107
  414. package/dist/transaction/coordination/trace.d.ts +0 -78
  415. package/dist/transaction/coordination/trace.js +0 -138
  416. package/dist/transaction/durableWrites.d.ts +0 -62
  417. package/dist/transaction/durableWrites.js +0 -71
  418. package/dist/transaction/environment.d.ts +0 -105
  419. package/dist/transaction/environment.js +0 -108
  420. package/dist/transaction/errorCodes.d.ts +0 -403
  421. package/dist/transaction/errorCodes.js +0 -484
  422. package/dist/transaction/errors.d.ts +0 -428
  423. package/dist/transaction/errors.js +0 -686
  424. package/dist/transaction/footprint.d.ts +0 -111
  425. package/dist/transaction/footprint.js +0 -0
  426. package/dist/transaction/index.d.ts +0 -20
  427. package/dist/transaction/index.js +0 -20
  428. package/dist/transaction/keys/index.d.ts +0 -87
  429. package/dist/transaction/keys/index.js +0 -207
  430. package/dist/transaction/log/syncDeltaRow.d.ts +0 -158
  431. package/dist/transaction/log/syncDeltaRow.js +0 -95
  432. package/dist/transaction/logPosition.d.ts +0 -97
  433. package/dist/transaction/logPosition.js +0 -125
  434. package/dist/transaction/logger.d.ts +0 -16
  435. package/dist/transaction/logger.js +0 -7
  436. package/dist/transaction/observability.d.ts +0 -53
  437. package/dist/transaction/observability.js +0 -19
  438. package/dist/transaction/persistence.d.ts +0 -12
  439. package/dist/transaction/persistence.js +0 -11
  440. package/dist/transaction/plugin.d.ts +0 -285
  441. package/dist/transaction/plugin.js +0 -106
  442. package/dist/transaction/policy/types.d.ts +0 -217
  443. package/dist/transaction/policy/types.js +0 -126
  444. package/dist/transaction/resources/functionalUpdate.d.ts +0 -79
  445. package/dist/transaction/resources/functionalUpdate.js +0 -87
  446. package/dist/transaction/resources/httpResources.d.ts +0 -321
  447. package/dist/transaction/resources/httpResources.js +0 -7
  448. package/dist/transaction/resources/modelOperations.d.ts +0 -427
  449. package/dist/transaction/resources/modelOperations.js +0 -12
  450. package/dist/transaction/resources/mutationOptions.d.ts +0 -66
  451. package/dist/transaction/resources/mutationOptions.js +0 -9
  452. package/dist/transaction/resources/where.d.ts +0 -101
  453. package/dist/transaction/resources/where.js +0 -115
  454. package/dist/transaction/resources/writeOptionsSchema.d.ts +0 -47
  455. package/dist/transaction/resources/writeOptionsSchema.js +0 -73
  456. package/dist/transaction/schema/field.d.ts +0 -120
  457. package/dist/transaction/schema/field.js +0 -265
  458. package/dist/transaction/schema/fieldRef.d.ts +0 -38
  459. package/dist/transaction/schema/fieldRef.js +0 -11
  460. package/dist/transaction/schema/loadStrategy.d.ts +0 -45
  461. package/dist/transaction/schema/loadStrategy.js +0 -46
  462. package/dist/transaction/schema/model.d.ts +0 -379
  463. package/dist/transaction/schema/model.js +0 -123
  464. package/dist/transaction/schema/openapi.d.ts +0 -58
  465. package/dist/transaction/schema/openapi.js +0 -501
  466. package/dist/transaction/schema/relation.d.ts +0 -204
  467. package/dist/transaction/schema/relation.js +0 -104
  468. package/dist/transaction/schema/residency.d.ts +0 -29
  469. package/dist/transaction/schema/residency.js +0 -25
  470. package/dist/transaction/schema/roles.d.ts +0 -249
  471. package/dist/transaction/schema/roles.js +0 -230
  472. package/dist/transaction/schema/schema.d.ts +0 -351
  473. package/dist/transaction/schema/schema.js +0 -325
  474. package/dist/transaction/schema/tenancy.d.ts +0 -139
  475. package/dist/transaction/schema/tenancy.js +0 -190
  476. package/dist/transaction/transactionLayer.d.ts +0 -82
  477. package/dist/transaction/transactionLayer.js +0 -24
  478. package/dist/transaction/transactions/settlement/commitEnvelope.d.ts +0 -143
  479. package/dist/transaction/transactions/settlement/commitEnvelope.js +0 -161
  480. package/dist/transaction/transactions/settlement/httpCommitEnvelope.d.ts +0 -53
  481. package/dist/transaction/transactions/settlement/httpCommitEnvelope.js +0 -207
  482. package/dist/transaction/transactions/settlement/idempotencyKey.d.ts +0 -10
  483. package/dist/transaction/transactions/settlement/idempotencyKey.js +0 -9
  484. package/dist/transaction/transactions/settlement/pendingWrite.d.ts +0 -112
  485. package/dist/transaction/transactions/settlement/pendingWrite.js +0 -20
  486. package/dist/transaction/transport/commitFrames.d.ts +0 -90
  487. package/dist/transaction/transport/commitFrames.js +0 -134
  488. package/dist/transaction/transport/connectionManager.d.ts +0 -215
  489. package/dist/transaction/transport/connectionManager.js +0 -673
  490. package/dist/transaction/transport/credentialLifecycle.d.ts +0 -177
  491. package/dist/transaction/transport/credentialLifecycle.js +0 -324
  492. package/dist/transaction/transport/heartbeat.d.ts +0 -65
  493. package/dist/transaction/transport/heartbeat.js +0 -93
  494. package/dist/transaction/transport/httpClient.d.ts +0 -131
  495. package/dist/transaction/transport/httpClient.js +0 -146
  496. package/dist/transaction/transport/httpOptions.d.ts +0 -33
  497. package/dist/transaction/transport/httpOptions.js +0 -12
  498. package/dist/transaction/transport/httpTransport.d.ts +0 -8
  499. package/dist/transaction/transport/httpTransport.js +0 -1388
  500. package/dist/transaction/transport/networkProbe.d.ts +0 -84
  501. package/dist/transaction/transport/networkProbe.js +0 -207
  502. package/dist/transaction/transport/wsFrameHandlers.d.ts +0 -128
  503. package/dist/transaction/transport/wsFrameHandlers.js +0 -429
  504. package/dist/transaction/transport/wsTransport.d.ts +0 -574
  505. package/dist/transaction/transport/wsTransport.js +0 -1023
  506. package/dist/transaction/types/assertExact.d.ts +0 -17
  507. package/dist/transaction/types/assertExact.js +0 -1
  508. package/dist/transaction/types/global.d.ts +0 -107
  509. package/dist/transaction/types/global.js +0 -40
  510. package/dist/transaction/types/index.d.ts +0 -205
  511. package/dist/transaction/types/index.js +0 -56
  512. package/dist/transaction/types/modelData.d.ts +0 -10
  513. package/dist/transaction/types/modelData.js +0 -9
  514. package/dist/transaction/types/participant.d.ts +0 -20
  515. package/dist/transaction/types/participant.js +0 -10
  516. package/dist/transaction/types/streams.d.ts +0 -550
  517. package/dist/transaction/types/streams.js +0 -11
  518. package/dist/transaction/utils/asyncIterator.d.ts +0 -34
  519. package/dist/transaction/utils/asyncIterator.js +0 -135
  520. package/dist/transaction/utils/duration.d.ts +0 -50
  521. package/dist/transaction/utils/duration.js +0 -77
  522. package/dist/transaction/utils/json.d.ts +0 -57
  523. package/dist/transaction/utils/json.js +0 -276
  524. package/dist/transaction/wire/accountResponses.d.ts +0 -420
  525. package/dist/transaction/wire/accountResponses.js +0 -290
  526. package/dist/transaction/wire/auth.d.ts +0 -56
  527. package/dist/transaction/wire/auth.js +0 -63
  528. package/dist/transaction/wire/bootstrapReason.d.ts +0 -9
  529. package/dist/transaction/wire/bootstrapReason.js +0 -8
  530. package/dist/transaction/wire/claimEvent.d.ts +0 -76
  531. package/dist/transaction/wire/claimEvent.js +0 -73
  532. package/dist/transaction/wire/claims.d.ts +0 -530
  533. package/dist/transaction/wire/claims.js +0 -327
  534. package/dist/transaction/wire/commit.d.ts +0 -603
  535. package/dist/transaction/wire/commit.js +0 -321
  536. package/dist/transaction/wire/delta.d.ts +0 -250
  537. package/dist/transaction/wire/delta.js +0 -147
  538. package/dist/transaction/wire/errorEnvelope.d.ts +0 -72
  539. package/dist/transaction/wire/errorEnvelope.js +0 -123
  540. package/dist/transaction/wire/feedCursor.d.ts +0 -60
  541. package/dist/transaction/wire/feedCursor.js +0 -82
  542. package/dist/transaction/wire/feedEvent.d.ts +0 -204
  543. package/dist/transaction/wire/feedEvent.js +0 -65
  544. package/dist/transaction/wire/frames.d.ts +0 -194
  545. package/dist/transaction/wire/frames.js +0 -50
  546. package/dist/transaction/wire/inboundFrames.d.ts +0 -562
  547. package/dist/transaction/wire/inboundFrames.js +0 -116
  548. package/dist/transaction/wire/index.d.ts +0 -54
  549. package/dist/transaction/wire/index.js +0 -83
  550. package/dist/transaction/wire/listEnvelope.d.ts +0 -37
  551. package/dist/transaction/wire/listEnvelope.js +0 -42
  552. package/dist/transaction/wire/modelMutations.d.ts +0 -31
  553. package/dist/transaction/wire/modelMutations.js +0 -52
  554. package/dist/transaction/wire/modelResponses.d.ts +0 -85
  555. package/dist/transaction/wire/modelResponses.js +0 -43
  556. package/dist/transaction/wire/modelShape.d.ts +0 -78
  557. package/dist/transaction/wire/modelShape.js +0 -74
  558. package/dist/transaction/wire/protocol.d.ts +0 -38
  559. package/dist/transaction/wire/protocol.js +0 -38
  560. package/dist/transaction/wire/protocolVersion.d.ts +0 -73
  561. package/dist/transaction/wire/protocolVersion.js +0 -83
  562. package/dist/transactions/mutations/MutationQueue.d.ts +0 -661
  563. package/dist/transactions/mutations/MutationQueue.js +0 -2807
  564. package/dist/transactions/mutations/MutationStore.d.ts +0 -20
  565. package/dist/transactions/mutations/MutationStore.js +0 -53
  566. package/dist/transactions/mutations/UnconfirmedWrites.d.ts +0 -82
  567. package/dist/transactions/mutations/UnconfirmedWrites.js +0 -104
  568. package/dist/transactions/mutations/coalesceRules.d.ts +0 -58
  569. package/dist/transactions/mutations/coalesceRules.js +0 -140
  570. package/dist/transactions/mutations/commitLatency.d.ts +0 -52
  571. package/dist/transactions/mutations/commitLatency.js +0 -130
  572. package/dist/transactions/mutations/commitOutboxStore.d.ts +0 -28
  573. package/dist/transactions/mutations/commitOutboxStore.js +0 -26
  574. package/dist/transactions/mutations/commitPayload.d.ts +0 -165
  575. package/dist/transactions/mutations/commitPayload.js +0 -152
  576. package/dist/transactions/mutations/deltaConfirmation.d.ts +0 -63
  577. package/dist/transactions/mutations/deltaConfirmation.js +0 -235
  578. package/dist/transactions/mutations/durableWriteStore.d.ts +0 -14
  579. package/dist/transactions/mutations/durableWriteStore.js +0 -12
  580. package/dist/transactions/mutations/optimisticApply.d.ts +0 -49
  581. package/dist/transactions/mutations/optimisticApply.js +0 -65
  582. package/dist/transactions/mutations/replayValidation.d.ts +0 -187
  583. package/dist/transactions/mutations/replayValidation.js +0 -164
  584. package/dist/utils/mobxSetup.d.ts +0 -53
  585. package/dist/utils/mobxSetup.js +0 -330
  586. package/dist/views/QueryView.d.ts +0 -79
  587. package/dist/views/QueryView.js +0 -218
  588. package/dist/views/ViewRegistry.d.ts +0 -20
  589. package/dist/views/ViewRegistry.js +0 -55
  590. package/dist/views/incrementalView.d.ts +0 -45
  591. package/dist/views/incrementalView.js +0 -69
  592. package/dist/webhooks/events.d.ts +0 -43
  593. package/dist/webhooks/events.js +0 -42
  594. package/dist/webhooks/index.d.ts +0 -8
  595. package/dist/webhooks/index.js +0 -8
  596. package/dist/wire/index.d.ts +0 -1
  597. package/dist/wire/index.js +0 -8
@@ -1,1536 +0,0 @@
1
- import { z } from 'zod';
2
- import { type FieldRef } from '../schema/fieldRef.js';
3
- import type { ParticipantKind } from '../types/participant.js';
4
- /**
5
- * The wire schemas for coordination — the shapes that keep agents and people
6
- * from overwriting each other on a shared row. Coordination works in three
7
- * layers, from outermost to innermost:
8
- *
9
- * 1. Presence (observation): who is working where. It reports, never blocks.
10
- * 2. Claims (pessimistic leases): `claim_begin` / `claim_abandon` grant one
11
- * participant exclusive intent on a target while others wait.
12
- * 3. Stale-context (optimistic): a `readAt` watermark plus an `onStale` write
13
- * guard that catches a lost update when the row moved after you read it.
14
- *
15
- * These Zod schemas are the single definition of each shape. Both the client
16
- * SDK and the server derive their TypeScript types from them with `z.infer`
17
- * rather than re-declaring the shapes, and the server validates inbound frames
18
- * against them at runtime.
19
- */
20
- /**
21
- * A span within a text-bearing part of a row (section body, doc, cell).
22
- *
23
- * Overlap is judged on the line axis alone: two ranges conflict when their
24
- * `[startLine, endLine]` intervals intersect, and columns ride along for
25
- * display. An editor that addresses by integer position rather than by line
26
- * maps that position axis straight onto `startLine`/`endLine` — the test is
27
- * plain interval intersection and never assumes the units are lines of a file.
28
- */
29
- export declare const targetRangeSchema: z.ZodObject<{
30
- startLine: z.ZodNumber;
31
- endLine: z.ZodNumber;
32
- startColumn: z.ZodOptional<z.ZodNumber>;
33
- endColumn: z.ZodOptional<z.ZodNumber>;
34
- }, z.core.$strip>;
35
- export type TargetRange = z.infer<typeof targetRangeSchema>;
36
- /**
37
- * An app-defined claimable part name — a cell (`'B2'`), a section id, a
38
- * block — made explicit with {@link part}. The schema's own field names need
39
- * no marker; a name that is NOT a field does, so looseness is a visible
40
- * decision at the call site rather than a silent absorber of typos.
41
- *
42
- * A small object rather than a branded string on purpose: a brand makes a
43
- * concrete schema's claim params mutually unassignable with the erased
44
- * `SchemaRecord` view, and the react context boundary erases and restores
45
- * exactly that way. The object member stays pairwise comparable, so no
46
- * boundary needs a cast through `unknown`.
47
- */
48
- export interface ClaimPart {
49
- readonly part: string;
50
- }
51
- /**
52
- * Name an app-defined part of a row for a claim target: `part('B2')` for a
53
- * cell, `part('sec_intro')` for a section. The conflict rule compares part
54
- * names as opaque case-insensitive strings, so any name is legal on the
55
- * wire — this marker exists purely so the type surface stays definite about
56
- * the model's own fields.
57
- */
58
- export declare function part(name: string): ClaimPart;
59
- /**
60
- * The wire spelling of a part name, from whichever spelling the caller used.
61
- *
62
- * Three, because they are three different promises. A {@link FieldRef} —
63
- * `schema.fields.tasks.status` — is a field the schema declares, so a name that
64
- * does not exist never compiles. `part('B2')` is a name the schema does not
65
- * know and says so. A bare string is neither, and survives only because the
66
- * erased `SchemaRecord` view and untyped callers still need it.
67
- *
68
- * All three become the same string here: the wire has always carried names, and
69
- * what differs is how much was known before the crossing.
70
- */
71
- export declare function partName(value: string | ClaimPart | FieldRef): string;
72
- export declare const participantKindSchema: z.ZodEnum<{
73
- user: "user";
74
- agent: "agent";
75
- system: "system";
76
- }>;
77
- export type { ParticipantKind } from '../types/participant.js';
78
- /**
79
- * Parses a participant kind from an inbound frame, tolerating an older wire
80
- * dialect. Some presence and claim frames label a non-agent participant
81
- * `'human'`, while the rest of the surface uses `'user'` for the same
82
- * participant. This normalizes `'human'` to `'user'` on read so every consumer
83
- * switches on one vocabulary. Producers emit the canonical
84
- * {@link participantKindSchema} values, and the output union is never widened.
85
- */
86
- export declare const wireParticipantKindSchema: z.ZodPreprocess<z.ZodEnum<{
87
- user: "user";
88
- agent: "agent";
89
- system: "system";
90
- }>>;
91
- /**
92
- * Resolves a peer's kind from an inbound presence or claim frame. It prefers
93
- * the server-stamped `participantKind` (normalized through
94
- * {@link wireParticipantKindSchema}). A frame from an older server that omits
95
- * that field falls back to the `isAgent` boolean, which can tell 'agent' from
96
- * 'user' but can never report 'system'.
97
- */
98
- export declare function participantKindFromWire(wireKind: unknown, isAgent: boolean | undefined): ParticipantKind;
99
- /**
100
- * Reads the peer-visible description a claim or presence frame carries in its
101
- * opaque `meta.description`. This is the single place that unpacks that field.
102
- * A caller that has an explicit `description` should prefer it
103
- * (`explicit ?? fromMeta`).
104
- *
105
- * The parameter is `unknown` because that is the honest requirement: this reads
106
- * one optional string off a value it does not own. Demanding the wire's open
107
- * record instead forced every caller holding a claim's *declared* `meta` — the
108
- * shape registered on `Register`'s `ClaimMeta` slot — through a conversion to
109
- * ask a question that never needed one.
110
- */
111
- export declare function descriptionFromMeta(meta: unknown): string | undefined;
112
- /** The default a claim carries when its holder describes no work. */
113
- export declare const DEFAULT_CLAIM_DESCRIPTION = "editing";
114
- /**
115
- * Resolves the peer-visible description of a claim from the places a caller may
116
- * have put it, falling back to a plain default.
117
- *
118
- * `reason` was this field's name before it was renamed, and the rename shipped
119
- * without leaving anything behind — so the wire kept accepting both spellings
120
- * while the SDK type quietly offered only one, and two branches "fixed" the
121
- * gap in opposite directions without either being contradicted by a compiler.
122
- * The precedence is declared once, here, and both the client and the server
123
- * read it from this function rather than each spelling out the same `??` chain.
124
- *
125
- * A caller whose default differs — a claim taken around a `create` describes
126
- * itself as `'creating'` — passes that word as `fallback`; the precedence above
127
- * it stays this function's.
128
- */
129
- export declare function claimDescription(source: {
130
- description?: string | null;
131
- reason?: string | null;
132
- /** Wire-shaped or declared — see {@link descriptionFromMeta}. */
133
- meta?: unknown;
134
- }, fallback?: string): string;
135
- /**
136
- * What a coordination event points at — the locator shared by all three
137
- * layers. It names an entity, optionally narrowed to a path, range, or field,
138
- * and carries opaque application metadata.
139
- */
140
- export declare const targetRefSchema: z.ZodObject<{
141
- entityType: z.ZodString;
142
- entityId: z.ZodString;
143
- path: z.ZodOptional<z.ZodString>;
144
- range: z.ZodOptional<z.ZodObject<{
145
- startLine: z.ZodNumber;
146
- endLine: z.ZodNumber;
147
- startColumn: z.ZodOptional<z.ZodNumber>;
148
- endColumn: z.ZodOptional<z.ZodNumber>;
149
- }, z.core.$strip>>;
150
- field: z.ZodOptional<z.ZodString>;
151
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
152
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
153
- }, z.core.$strip>;
154
- export type TargetRef = z.infer<typeof targetRefSchema>;
155
- /**
156
- * How the server treats a write whose snapshot watermark (`readAt`) is older
157
- * than the target row's latest change. There are three dispositions:
158
- * • `notify` — hold the write and return a {@link StaleNotification}
159
- * carrying the current value, so the actor (agent or human)
160
- * can resolve it.
161
- * • `reject` — throw `AbloStaleContextError`, the default when `readAt`
162
- * is present.
163
- * • `overwrite` — apply the write blindly, last write wins, with no signal.
164
- */
165
- export declare const onStaleModeSchema: z.ZodEnum<{
166
- reject: "reject";
167
- overwrite: "overwrite";
168
- notify: "notify";
169
- }>;
170
- export type OnStaleMode = z.infer<typeof onStaleModeSchema>;
171
- /**
172
- * The optimistic guard carried on a commit operation. `readAt` is the
173
- * snapshot watermark from `context.capture` (null/absent ⇒ unguarded write).
174
- * `bypass` is the explicit, recorded override of a *foreign* pessimistic
175
- * claim — see the claim layer below.
176
- */
177
- export declare const writeGuardSchema: z.ZodObject<{
178
- readAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
179
- onStale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
180
- reject: "reject";
181
- overwrite: "overwrite";
182
- notify: "notify";
183
- }>>>;
184
- bypass: z.ZodOptional<z.ZodBoolean>;
185
- }, z.core.$strip>;
186
- export type WriteGuard = z.infer<typeof writeGuardSchema>;
187
- /**
188
- * The advisory returned to a committer whose write hit a stale-context
189
- * conflict under `onStale: 'notify'` — it reports that the value the committer
190
- * reasoned against changed while they were away. Rather than throwing, the
191
- * server hands back the conflicting field's current value as data so the
192
- * actor — an agent or a human — can reconcile and re-commit. A claim is the
193
- * prospective form of the same idea (coordinate before acting); this
194
- * notification is the in-flight form (here is what changed, you resolve). It
195
- * rides on the commit acknowledgement alongside `lastSyncId`; an empty or
196
- * absent array means nothing the committer depended on moved.
197
- *
198
- * Only `onStale: 'notify'` produces this. The conflicting operation was held,
199
- * not written, and the actor reconciles against `currentValues` and
200
- * re-commits. `reject` throws instead, and `overwrite` proceeds silently —
201
- * neither notifies.
202
- */
203
- export declare const staleNotificationSchema: z.ZodObject<{
204
- object: z.ZodOptional<z.ZodLiteral<"stale_notification">>;
205
- model: z.ZodString;
206
- id: z.ZodString;
207
- readAt: z.ZodNumber;
208
- observedSyncId: z.ZodNumber;
209
- conflictingFields: z.ZodArray<z.ZodString>;
210
- currentValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
211
- writtenBy: z.ZodObject<{
212
- kind: z.ZodEnum<{
213
- user: "user";
214
- agent: "agent";
215
- system: "system";
216
- }>;
217
- id: z.ZodString;
218
- }, z.core.$strip>;
219
- group: z.ZodOptional<z.ZodString>;
220
- }, z.core.$strip>;
221
- export type StaleNotification = z.infer<typeof staleNotificationSchema>;
222
- export declare const readDependencySchema: z.ZodUnion<readonly [z.ZodObject<{
223
- model: z.ZodString;
224
- id: z.ZodString;
225
- readAt: z.ZodNumber;
226
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
227
- onStale: z.ZodOptional<z.ZodEnum<{
228
- reject: "reject";
229
- overwrite: "overwrite";
230
- notify: "notify";
231
- }>>;
232
- }, z.core.$strip>, z.ZodObject<{
233
- group: z.ZodString;
234
- readAt: z.ZodNumber;
235
- onStale: z.ZodOptional<z.ZodEnum<{
236
- reject: "reject";
237
- overwrite: "overwrite";
238
- notify: "notify";
239
- }>>;
240
- }, z.core.$strip>]>;
241
- export type ReadDependency = z.infer<typeof readDependencySchema>;
242
- export declare const trackDependencySchema: z.ZodUnion<readonly [z.ZodObject<{
243
- id: z.ZodString;
244
- model: z.ZodString;
245
- readAt: z.ZodOptional<z.ZodNumber>;
246
- }, z.core.$strip>, z.ZodObject<{
247
- group: z.ZodString;
248
- readAt: z.ZodOptional<z.ZodNumber>;
249
- }, z.core.$strip>]>;
250
- export type TrackDependency = z.infer<typeof trackDependencySchema>;
251
- /**
252
- * The lifecycle of a claim. When absent on the wire it means `'active'` (an
253
- * additive back-compat default). The server stamps `'active'` on `claim_begin`
254
- * and emits one terminal frame — `committed`, `canceled`, or `expired` — as the
255
- * claim ends, so contenders learn how it resolved, not merely that it vanished.
256
- */
257
- export declare const wireClaimStatusSchema: z.ZodEnum<{
258
- active: "active";
259
- committed: "committed";
260
- expired: "expired";
261
- canceled: "canceled";
262
- }>;
263
- export type WireClaimStatus = z.infer<typeof wireClaimStatusSchema>;
264
- /**
265
- * Every lifecycle state of a claim, as a caller sees it.
266
- *
267
- * `active` is the current holder — the lock itself. `queued` is waiting in line
268
- * behind the holder and carries an advisory `position`. The rest are terminal
269
- * and drop the claim from the synced set.
270
- *
271
- * Distinct from {@link wireClaimStatusSchema}, which never carries `queued`
272
- * because the wire frame for a waiter is a different message. This is the one a
273
- * published contract describes, so it is a schema rather than a bare TS union —
274
- * a union cannot be derived into the API reference.
275
- */
276
- export declare const publicClaimStatusSchema: z.ZodEnum<{
277
- active: "active";
278
- committed: "committed";
279
- expired: "expired";
280
- canceled: "canceled";
281
- queued: "queued";
282
- }>;
283
- export type PublicClaimStatus = z.infer<typeof publicClaimStatusSchema>;
284
- /**
285
- * @deprecated Renamed to {@link wireClaimStatusSchema} — this is the wire enum,
286
- * which never carries `'queued'`; the five-state public status lives in
287
- * types/streams. Removed in 0.36.0.
288
- */
289
- export declare const claimStatusSchema: z.ZodEnum<{
290
- active: "active";
291
- committed: "committed";
292
- expired: "expired";
293
- canceled: "canceled";
294
- }>;
295
- /** @deprecated Renamed to {@link WireClaimStatus}. Removed in 0.36.0. */
296
- export type ClaimStatus = WireClaimStatus;
297
- /**
298
- * A holder as the participant blocked behind them sees it: who has the row,
299
- * what they said they are doing, and until when.
300
- *
301
- * This is the smaller half of a claim, so it is declared first and the full
302
- * claim extends it — the waiter's view cannot omit a member the holder's view
303
- * has, because there is nowhere for it to be omitted. Listing what to keep was
304
- * the bug: this named `field` and not `path`, `range`, or `fields`, so a waiter
305
- * could see that a row was held but never which part of it, and every locator
306
- * member added later would have been missing here too.
307
- */
308
- export declare const wireClaimSummarySchema: z.ZodObject<{
309
- entityType: z.ZodString;
310
- entityId: z.ZodString;
311
- path: z.ZodOptional<z.ZodString>;
312
- range: z.ZodOptional<z.ZodObject<{
313
- startLine: z.ZodNumber;
314
- endLine: z.ZodNumber;
315
- startColumn: z.ZodOptional<z.ZodNumber>;
316
- endColumn: z.ZodOptional<z.ZodNumber>;
317
- }, z.core.$strip>>;
318
- field: z.ZodOptional<z.ZodString>;
319
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
320
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
321
- claimId: z.ZodString;
322
- description: z.ZodOptional<z.ZodString>;
323
- declaredAt: z.ZodNumber;
324
- expiresAt: z.ZodNumber;
325
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
327
- user: "user";
328
- agent: "agent";
329
- system: "system";
330
- }>>>>;
331
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
- }, z.core.$strip>;
333
- export type WireClaimSummary = z.infer<typeof wireClaimSummarySchema>;
334
- /** Why a claim ended in a non-success terminal state. */
335
- export declare const claimErrorSchema: z.ZodObject<{
336
- code: z.ZodString;
337
- message: z.ZodOptional<z.ZodString>;
338
- heldBy: z.ZodOptional<z.ZodString>;
339
- heldByClaimId: z.ZodOptional<z.ZodString>;
340
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
341
- heldByClaim: z.ZodOptional<z.ZodObject<{
342
- entityType: z.ZodString;
343
- entityId: z.ZodString;
344
- path: z.ZodOptional<z.ZodString>;
345
- range: z.ZodOptional<z.ZodObject<{
346
- startLine: z.ZodNumber;
347
- endLine: z.ZodNumber;
348
- startColumn: z.ZodOptional<z.ZodNumber>;
349
- endColumn: z.ZodOptional<z.ZodNumber>;
350
- }, z.core.$strip>>;
351
- field: z.ZodOptional<z.ZodString>;
352
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
353
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
354
- claimId: z.ZodString;
355
- description: z.ZodOptional<z.ZodString>;
356
- declaredAt: z.ZodNumber;
357
- expiresAt: z.ZodNumber;
358
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
360
- user: "user";
361
- agent: "agent";
362
- system: "system";
363
- }>>>>;
364
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
365
- }, z.core.$strip>>;
366
- policyReason: z.ZodOptional<z.ZodString>;
367
- }, z.core.$strip>;
368
- export type ClaimError = z.infer<typeof claimErrorSchema>;
369
- /**
370
- * Why a claim ended without its holder releasing it, or was refused.
371
- *
372
- * A closed set, because the two refusals are different guarantees and a reader
373
- * has to be able to tell them apart: `conflict` means someone holds the row
374
- * right now and you may queue behind them, while `coordination_unavailable`
375
- * means the coordinator could not answer, so nothing is known about the row.
376
- * `expired` and `preempted` are the two ways a lease you held ends.
377
- *
378
- * The rejection frame's `reason` stays a plain string on the wire — it is
379
- * frozen, and an older server may send a word not listed here. This is the
380
- * reader's side of it: a value that parses becomes the typed reason, and one
381
- * that does not is simply absent rather than smuggled through as prose.
382
- * {@link claimExpiredSchema} and {@link claimLostSchema} already spelled their
383
- * reasons as enums; this brings the refusals into line.
384
- */
385
- export declare const claimEventReasonSchema: z.ZodEnum<{
386
- conflict: "conflict";
387
- expired: "expired";
388
- coordination_unavailable: "coordination_unavailable";
389
- preempted: "preempted";
390
- }>;
391
- export type ClaimEventReason = z.infer<typeof claimEventReasonSchema>;
392
- /**
393
- * A declared, pending-mutation claim — the unit broadcast inside a presence
394
- * frame's `activeClaims`. The client supplies the descriptive `targetRef`
395
- * fields, a `description` of the work, and a chosen `claimId`; the server stamps
396
- * `declaredAt` and `expiresAt` and may set `status` and `error`. Those last
397
- * two are optional, so one shape serves both the server, which sets them, and
398
- * the leaner SDK view, which reads a claim without them.
399
- */
400
- export declare const wireClaimSchema: z.ZodObject<{
401
- entityType: z.ZodString;
402
- entityId: z.ZodString;
403
- path: z.ZodOptional<z.ZodString>;
404
- range: z.ZodOptional<z.ZodObject<{
405
- startLine: z.ZodNumber;
406
- endLine: z.ZodNumber;
407
- startColumn: z.ZodOptional<z.ZodNumber>;
408
- endColumn: z.ZodOptional<z.ZodNumber>;
409
- }, z.core.$strip>>;
410
- field: z.ZodOptional<z.ZodString>;
411
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
412
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
413
- claimId: z.ZodString;
414
- description: z.ZodOptional<z.ZodString>;
415
- declaredAt: z.ZodNumber;
416
- expiresAt: z.ZodNumber;
417
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
418
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
419
- user: "user";
420
- agent: "agent";
421
- system: "system";
422
- }>>>>;
423
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
424
- fenceToken: z.ZodOptional<z.ZodNumber>;
425
- acquiredAt: z.ZodOptional<z.ZodNumber>;
426
- status: z.ZodOptional<z.ZodEnum<{
427
- active: "active";
428
- committed: "committed";
429
- expired: "expired";
430
- canceled: "canceled";
431
- }>>;
432
- error: z.ZodOptional<z.ZodObject<{
433
- code: z.ZodString;
434
- message: z.ZodOptional<z.ZodString>;
435
- heldBy: z.ZodOptional<z.ZodString>;
436
- heldByClaimId: z.ZodOptional<z.ZodString>;
437
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
438
- heldByClaim: z.ZodOptional<z.ZodObject<{
439
- entityType: z.ZodString;
440
- entityId: z.ZodString;
441
- path: z.ZodOptional<z.ZodString>;
442
- range: z.ZodOptional<z.ZodObject<{
443
- startLine: z.ZodNumber;
444
- endLine: z.ZodNumber;
445
- startColumn: z.ZodOptional<z.ZodNumber>;
446
- endColumn: z.ZodOptional<z.ZodNumber>;
447
- }, z.core.$strip>>;
448
- field: z.ZodOptional<z.ZodString>;
449
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
450
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
451
- claimId: z.ZodString;
452
- description: z.ZodOptional<z.ZodString>;
453
- declaredAt: z.ZodNumber;
454
- expiresAt: z.ZodNumber;
455
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
457
- user: "user";
458
- agent: "agent";
459
- system: "system";
460
- }>>>>;
461
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
462
- }, z.core.$strip>>;
463
- policyReason: z.ZodOptional<z.ZodString>;
464
- }, z.core.$strip>>;
465
- }, z.core.$strip>;
466
- export type WireClaim = z.infer<typeof wireClaimSchema>;
467
- export declare const claimRejectionSchema: z.ZodObject<{
468
- claimId: z.ZodString;
469
- reason: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
470
- conflict: "conflict";
471
- expired: "expired";
472
- coordination_unavailable: "coordination_unavailable";
473
- preempted: "preempted";
474
- }>>>;
475
- target: z.ZodOptional<z.ZodObject<{
476
- entityType: z.ZodString;
477
- entityId: z.ZodString;
478
- path: z.ZodOptional<z.ZodString>;
479
- range: z.ZodOptional<z.ZodObject<{
480
- startLine: z.ZodNumber;
481
- endLine: z.ZodNumber;
482
- startColumn: z.ZodOptional<z.ZodNumber>;
483
- endColumn: z.ZodOptional<z.ZodNumber>;
484
- }, z.core.$strip>>;
485
- field: z.ZodOptional<z.ZodString>;
486
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
487
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
488
- }, z.core.$strip>>;
489
- heldBy: z.ZodOptional<z.ZodString>;
490
- heldByKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
491
- user: "user";
492
- agent: "agent";
493
- system: "system";
494
- }>>>;
495
- heldByClaimId: z.ZodOptional<z.ZodString>;
496
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
497
- heldByClaim: z.ZodOptional<z.ZodObject<{
498
- entityType: z.ZodString;
499
- entityId: z.ZodString;
500
- path: z.ZodOptional<z.ZodString>;
501
- range: z.ZodOptional<z.ZodObject<{
502
- startLine: z.ZodNumber;
503
- endLine: z.ZodNumber;
504
- startColumn: z.ZodOptional<z.ZodNumber>;
505
- endColumn: z.ZodOptional<z.ZodNumber>;
506
- }, z.core.$strip>>;
507
- field: z.ZodOptional<z.ZodString>;
508
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
509
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
510
- claimId: z.ZodString;
511
- description: z.ZodOptional<z.ZodString>;
512
- declaredAt: z.ZodNumber;
513
- expiresAt: z.ZodNumber;
514
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
515
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
516
- user: "user";
517
- agent: "agent";
518
- system: "system";
519
- }>>>>;
520
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
521
- }, z.core.$strip>>;
522
- policyReason: z.ZodOptional<z.ZodString>;
523
- }, z.core.$strip>;
524
- export type ClaimRejection = z.infer<typeof claimRejectionSchema>;
525
- /**
526
- * The point-to-point notification sent to a holder whose lease ended without
527
- * a successful commit. This remains a wire-shaped target because it arrives
528
- * directly from the WebSocket; the schema is the single validation boundary
529
- * before the event reaches public `claims.onLost` listeners.
530
- */
531
- export declare const claimLostSchema: z.ZodObject<{
532
- claimId: z.ZodString;
533
- reason: z.ZodEnum<{
534
- expired: "expired";
535
- preempted: "preempted";
536
- }>;
537
- target: z.ZodObject<{
538
- entityType: z.ZodString;
539
- entityId: z.ZodString;
540
- path: z.ZodOptional<z.ZodString>;
541
- range: z.ZodOptional<z.ZodObject<{
542
- startLine: z.ZodNumber;
543
- endLine: z.ZodNumber;
544
- startColumn: z.ZodOptional<z.ZodNumber>;
545
- endColumn: z.ZodOptional<z.ZodNumber>;
546
- }, z.core.$strip>>;
547
- field: z.ZodOptional<z.ZodString>;
548
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
549
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
550
- }, z.core.$strip>;
551
- }, z.core.$strip>;
552
- export type ClaimLost = z.infer<typeof claimLostSchema>;
553
- /**
554
- * The lease is ours without waiting — the target was free when the claim
555
- * arrived. `fenceToken` is present whenever the coordinator minted one, and a
556
- * write carries it back so a lapsed lease cannot apply late.
557
- */
558
- export declare const claimAcquiredSchema: z.ZodObject<{
559
- claimId: z.ZodString;
560
- fenceToken: z.ZodOptional<z.ZodNumber>;
561
- target: z.ZodObject<{
562
- entityType: z.ZodString;
563
- entityId: z.ZodString;
564
- path: z.ZodOptional<z.ZodString>;
565
- range: z.ZodOptional<z.ZodObject<{
566
- startLine: z.ZodNumber;
567
- endLine: z.ZodNumber;
568
- startColumn: z.ZodOptional<z.ZodNumber>;
569
- endColumn: z.ZodOptional<z.ZodNumber>;
570
- }, z.core.$strip>>;
571
- field: z.ZodOptional<z.ZodString>;
572
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
573
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
574
- }, z.core.$strip>;
575
- }, z.core.$strip>;
576
- export type ClaimAcquired = z.infer<typeof claimAcquiredSchema>;
577
- /**
578
- * A queued claim reached the head of the line and the lease is now ours. The
579
- * shape matches {@link claimAcquiredSchema} exactly — the two frames differ
580
- * only in whether the caller waited — but they stay separate declarations
581
- * because they are separate wire contracts, and collapsing them would let a
582
- * change to one silently redefine the other.
583
- */
584
- export declare const claimGrantedSchema: z.ZodObject<{
585
- claimId: z.ZodString;
586
- fenceToken: z.ZodOptional<z.ZodNumber>;
587
- target: z.ZodObject<{
588
- entityType: z.ZodString;
589
- entityId: z.ZodString;
590
- path: z.ZodOptional<z.ZodString>;
591
- range: z.ZodOptional<z.ZodObject<{
592
- startLine: z.ZodNumber;
593
- endLine: z.ZodNumber;
594
- startColumn: z.ZodOptional<z.ZodNumber>;
595
- endColumn: z.ZodOptional<z.ZodNumber>;
596
- }, z.core.$strip>>;
597
- field: z.ZodOptional<z.ZodString>;
598
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
599
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
600
- }, z.core.$strip>;
601
- }, z.core.$strip>;
602
- export type ClaimGranted = z.infer<typeof claimGrantedSchema>;
603
- /**
604
- * Our claim is waiting in line behind a live holder — the same conflict
605
- * {@link claimRejectionSchema} reports, delivered as a wait rather than a
606
- * refusal, plus the caller's `position`.
607
- *
608
- * `reason` is the one member that does not carry over as required. A refusal
609
- * states why it refused; a wait has only ever named the conflict through
610
- * `heldBy`/`heldByClaim`, and no server has ever stamped `reason` on this
611
- * frame. Requiring it here — inherited silently by extending the rejection
612
- * schema — made the parse boundary reject every genuine `claim_queued` as
613
- * malformed the moment frame validation went in. Optional is what the wire
614
- * actually is, and it stays derived from the rejection field so the two cannot
615
- * describe the value differently.
616
- *
617
- * `position` is advisory: a privileged reorder can move it up, so a caller
618
- * that asserts monotonic position will fail in production. Only the arrival of
619
- * a grant is authoritative.
620
- */
621
- export declare const claimQueuedSchema: z.ZodObject<{
622
- claimId: z.ZodString;
623
- target: z.ZodOptional<z.ZodObject<{
624
- entityType: z.ZodString;
625
- entityId: z.ZodString;
626
- path: z.ZodOptional<z.ZodString>;
627
- range: z.ZodOptional<z.ZodObject<{
628
- startLine: z.ZodNumber;
629
- endLine: z.ZodNumber;
630
- startColumn: z.ZodOptional<z.ZodNumber>;
631
- endColumn: z.ZodOptional<z.ZodNumber>;
632
- }, z.core.$strip>>;
633
- field: z.ZodOptional<z.ZodString>;
634
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
635
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
636
- }, z.core.$strip>>;
637
- heldBy: z.ZodOptional<z.ZodString>;
638
- heldByKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
639
- user: "user";
640
- agent: "agent";
641
- system: "system";
642
- }>>>;
643
- heldByClaimId: z.ZodOptional<z.ZodString>;
644
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
645
- heldByClaim: z.ZodOptional<z.ZodObject<{
646
- entityType: z.ZodString;
647
- entityId: z.ZodString;
648
- path: z.ZodOptional<z.ZodString>;
649
- range: z.ZodOptional<z.ZodObject<{
650
- startLine: z.ZodNumber;
651
- endLine: z.ZodNumber;
652
- startColumn: z.ZodOptional<z.ZodNumber>;
653
- endColumn: z.ZodOptional<z.ZodNumber>;
654
- }, z.core.$strip>>;
655
- field: z.ZodOptional<z.ZodString>;
656
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
657
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
658
- claimId: z.ZodString;
659
- description: z.ZodOptional<z.ZodString>;
660
- declaredAt: z.ZodNumber;
661
- expiresAt: z.ZodNumber;
662
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
663
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
664
- user: "user";
665
- agent: "agent";
666
- system: "system";
667
- }>>>>;
668
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
669
- }, z.core.$strip>>;
670
- policyReason: z.ZodOptional<z.ZodString>;
671
- position: z.ZodNumber;
672
- reason: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
673
- conflict: "conflict";
674
- expired: "expired";
675
- coordination_unavailable: "coordination_unavailable";
676
- preempted: "preempted";
677
- }>>>>;
678
- }, z.core.$strip>;
679
- export type ClaimQueued = z.infer<typeof claimQueuedSchema>;
680
- /**
681
- * One entry in a wait-line snapshot.
682
- *
683
- * NOTE — this is the third spelling of a target locator on the wire: here it is
684
- * `{ type, id }`, the HTTP claim DTO uses `{ model, id }`
685
- * ({@link modelTargetSchema}), and the claim frames use
686
- * `{ entityType, entityId }` ({@link targetRefSchema}). The schema describes
687
- * what the server sends today rather than what it should send; unifying the
688
- * three is a coordinated protocol change scheduled behind the protocol version.
689
- * Until it happens, the translation between the spellings lives in one place —
690
- * `wireTarget`, `modelTarget` and `streamTarget` in ./locator.ts — so no hop
691
- * gets to invent a fourth.
692
- */
693
- export declare const claimQueueEntrySchema: z.ZodObject<{
694
- object: z.ZodLiteral<"claim">;
695
- id: z.ZodString;
696
- status: z.ZodLiteral<"queued">;
697
- target: z.ZodObject<{
698
- field: z.ZodOptional<z.ZodString>;
699
- path: z.ZodOptional<z.ZodString>;
700
- range: z.ZodOptional<z.ZodObject<{
701
- startLine: z.ZodNumber;
702
- endLine: z.ZodNumber;
703
- startColumn: z.ZodOptional<z.ZodNumber>;
704
- endColumn: z.ZodOptional<z.ZodNumber>;
705
- }, z.core.$strip>>;
706
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
707
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
708
- type: z.ZodString;
709
- id: z.ZodString;
710
- }, z.core.$strip>;
711
- description: z.ZodDefault<z.ZodString>;
712
- heldBy: z.ZodOptional<z.ZodString>;
713
- participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
714
- user: "user";
715
- agent: "agent";
716
- system: "system";
717
- }>>>;
718
- position: z.ZodNumber;
719
- expiresAt: z.ZodNumber;
720
- }, z.core.$strip>;
721
- export type ClaimQueueEntry = z.infer<typeof claimQueueEntrySchema>;
722
- /**
723
- * The whole wait line for one row, rebroadcast to that row's peers on every
724
- * queue mutation. This is what backs the reactive
725
- * `ablo.<model>.claim.queue({ id })` read, which is why it carries the full
726
- * line rather than a delta against it.
727
- */
728
- export declare const claimQueueSchema: z.ZodObject<{
729
- target: z.ZodObject<{
730
- type: z.ZodString;
731
- id: z.ZodString;
732
- }, z.core.$strip>;
733
- queue: z.ZodArray<z.ZodObject<{
734
- object: z.ZodLiteral<"claim">;
735
- id: z.ZodString;
736
- status: z.ZodLiteral<"queued">;
737
- target: z.ZodObject<{
738
- field: z.ZodOptional<z.ZodString>;
739
- path: z.ZodOptional<z.ZodString>;
740
- range: z.ZodOptional<z.ZodObject<{
741
- startLine: z.ZodNumber;
742
- endLine: z.ZodNumber;
743
- startColumn: z.ZodOptional<z.ZodNumber>;
744
- endColumn: z.ZodOptional<z.ZodNumber>;
745
- }, z.core.$strip>>;
746
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
747
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
748
- type: z.ZodString;
749
- id: z.ZodString;
750
- }, z.core.$strip>;
751
- description: z.ZodDefault<z.ZodString>;
752
- heldBy: z.ZodOptional<z.ZodString>;
753
- participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
754
- user: "user";
755
- agent: "agent";
756
- system: "system";
757
- }>>>;
758
- position: z.ZodNumber;
759
- expiresAt: z.ZodNumber;
760
- }, z.core.$strip>>;
761
- }, z.core.$strip>;
762
- export type ClaimQueue = z.infer<typeof claimQueueSchema>;
763
- /**
764
- * A held claim's TTL lapsed server-side. The claim is already inactive by the
765
- * time this arrives, so a consumer either re-claims with a fresh credential or
766
- * accepts the drop; there is nothing to release.
767
- */
768
- export declare const claimExpiredSchema: z.ZodObject<{
769
- claimId: z.ZodString;
770
- }, z.core.$strip>;
771
- export type ClaimExpired = z.infer<typeof claimExpiredSchema>;
772
- /**
773
- * What a {@link ModelClaim} points at — the target locator as SDK callers see
774
- * it, keyed by `model` and `id` rather than the wire schema's `entityType` and
775
- * `entityId`. This is the public `ModelTarget` shape.
776
- */
777
- export declare const modelTargetSchema: z.ZodReadonly<z.ZodObject<{
778
- model: z.ZodString;
779
- id: z.ZodString;
780
- path: z.ZodOptional<z.ZodString>;
781
- range: z.ZodOptional<z.ZodObject<{
782
- startLine: z.ZodNumber;
783
- endLine: z.ZodNumber;
784
- startColumn: z.ZodOptional<z.ZodNumber>;
785
- endColumn: z.ZodOptional<z.ZodNumber>;
786
- }, z.core.$strip>>;
787
- field: z.ZodOptional<z.ZodString>;
788
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
789
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
790
- }, z.core.$strip>>;
791
- export type ModelTarget = z.infer<typeof modelTargetSchema>;
792
- /**
793
- * The two states a claim can be observed in while it still exists.
794
- *
795
- * Derived from {@link publicClaimStatusSchema} rather than spelled again: the
796
- * other three are terminal and drop the claim from the observable set, so a
797
- * listing or a peer's view can only ever see these. Extracting them by name
798
- * means a state added to the public vocabulary is a deliberate decision about
799
- * whether it is observable, not a silent omission.
800
- */
801
- export declare const heldClaimStatusSchema: z.ZodEnum<{
802
- active: "active";
803
- queued: "queued";
804
- }>;
805
- export type HeldClaimStatus = z.infer<typeof heldClaimStatusSchema>;
806
- /**
807
- * ONE CLAIM — everything true about a lease at a moment: what it points at, who
808
- * holds it, what they said they are doing, where it stands, and until when.
809
- *
810
- * Every caller-facing surface that answers a question about a claim is a
811
- * PROJECTION of this record, never a second object: {@link modelClaimSchema} is
812
- * what a peer may see, and `claimStateSchema` (`wire/claims.ts`) is what a
813
- * caller polls about a claim of its own. Each is pinned to this record, so a
814
- * field added here either reaches the people it was declared for or fails to
815
- * compile.
816
- *
817
- * Before this, the peer-visible shape was a standalone `z.object` deriving from
818
- * nothing, and the polling shape was a third. That is why it took reading four
819
- * files to answer whether a heartbeat's progress reaches an asker — the
820
- * declaring surface and the observing surface were kept in step by hand, and
821
- * three of their shared fields had already drifted on how strictly they parse.
822
- *
823
- * What this record deliberately does NOT unify is the socket family
824
- * ({@link wireClaimSchema} and its base). Those carry the same claim under the
825
- * `entityType`/`entityId` locator rather than `model`/`id`, and they already
826
- * derive from one another; collapsing the two locator spellings is a wire
827
- * rename, not a projection.
828
- */
829
- export declare const claimRecordSchema: z.ZodObject<{
830
- id: z.ZodString;
831
- actor: z.ZodString;
832
- participantKind: z.ZodPreprocess<z.ZodEnum<{
833
- user: "user";
834
- agent: "agent";
835
- system: "system";
836
- }>>;
837
- onBehalfOfId: z.ZodNullable<z.ZodString>;
838
- onBehalfOfKind: z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
839
- user: "user";
840
- agent: "agent";
841
- system: "system";
842
- }>>>;
843
- capabilityId: z.ZodNullable<z.ZodString>;
844
- description: z.ZodString;
845
- status: z.ZodEnum<{
846
- active: "active";
847
- queued: "queued";
848
- }>;
849
- position: z.ZodNumber;
850
- expiresAt: z.ZodNumber;
851
- fenceToken: z.ZodNumber;
852
- target: z.ZodReadonly<z.ZodObject<{
853
- model: z.ZodString;
854
- id: z.ZodString;
855
- path: z.ZodOptional<z.ZodString>;
856
- range: z.ZodOptional<z.ZodObject<{
857
- startLine: z.ZodNumber;
858
- endLine: z.ZodNumber;
859
- startColumn: z.ZodOptional<z.ZodNumber>;
860
- endColumn: z.ZodOptional<z.ZodNumber>;
861
- }, z.core.$strip>>;
862
- field: z.ZodOptional<z.ZodString>;
863
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
864
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
865
- }, z.core.$strip>>;
866
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
867
- }, z.core.$strip>;
868
- export type ClaimRecord = z.infer<typeof claimRecordSchema>;
869
- /**
870
- * A claim as SDK callers and the HTTP claim routes see it
871
- * (`ablo.<model>.claim.state`, `GET /v1/claims`) — the resolved, peer-readable
872
- * view of one active or queued claim. The client's `ModelClaim` type derives
873
- * from this shape.
874
- *
875
- * Everything but the deprecated `field` is projected from
876
- * {@link claimRecordSchema}. Four members are optional here and required on the
877
- * record, and the split is the same in each case: the record says what a claim
878
- * IS, while a peer's view of one may legitimately have been built without them
879
- * — a queued claim has no `fenceToken`, a held one has no `position`, an older
880
- * producer sends no `status`, and a claim may be declared with no description.
881
- */
882
- export declare const modelClaimSchema: z.ZodReadonly<z.ZodObject<{
883
- id: z.ZodString;
884
- actor: z.ZodString;
885
- participantKind: z.ZodPreprocess<z.ZodEnum<{
886
- user: "user";
887
- agent: "agent";
888
- system: "system";
889
- }>>;
890
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
891
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
892
- user: "user";
893
- agent: "agent";
894
- system: "system";
895
- }>>>>;
896
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
897
- description: z.ZodOptional<z.ZodString>;
898
- status: z.ZodOptional<z.ZodEnum<{
899
- active: "active";
900
- queued: "queued";
901
- }>>;
902
- position: z.ZodOptional<z.ZodNumber>;
903
- expiresAt: z.ZodNumber;
904
- fenceToken: z.ZodOptional<z.ZodNumber>;
905
- target: z.ZodReadonly<z.ZodObject<{
906
- model: z.ZodString;
907
- id: z.ZodString;
908
- path: z.ZodOptional<z.ZodString>;
909
- range: z.ZodOptional<z.ZodObject<{
910
- startLine: z.ZodNumber;
911
- endLine: z.ZodNumber;
912
- startColumn: z.ZodOptional<z.ZodNumber>;
913
- endColumn: z.ZodOptional<z.ZodNumber>;
914
- }, z.core.$strip>>;
915
- field: z.ZodOptional<z.ZodString>;
916
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
917
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
918
- }, z.core.$strip>>;
919
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
920
- field: z.ZodOptional<z.ZodString>;
921
- }, z.core.$strip>>;
922
- export type ModelClaim = z.infer<typeof modelClaimSchema>;
923
- /**
924
- * The `claim_begin` payload a client sends. It carries the descriptive target
925
- * and a `description` of the work, an optional duration hint, and the opt-in
926
- * fair-queue flag. The server stamps the lifecycle and timestamp fields, so they
927
- * are not part of this inbound shape — this is exactly what the server validates
928
- * on ingest.
929
- */
930
- export declare const claimBeginPayloadSchema: z.ZodObject<{
931
- entityType: z.ZodString;
932
- entityId: z.ZodString;
933
- path: z.ZodOptional<z.ZodString>;
934
- range: z.ZodOptional<z.ZodObject<{
935
- startLine: z.ZodNumber;
936
- endLine: z.ZodNumber;
937
- startColumn: z.ZodOptional<z.ZodNumber>;
938
- endColumn: z.ZodOptional<z.ZodNumber>;
939
- }, z.core.$strip>>;
940
- field: z.ZodOptional<z.ZodString>;
941
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
942
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
943
- claimId: z.ZodString;
944
- description: z.ZodOptional<z.ZodString>;
945
- estimatedMs: z.ZodOptional<z.ZodNumber>;
946
- queue: z.ZodOptional<z.ZodBoolean>;
947
- }, z.core.$strip>;
948
- export type ClaimBeginPayload = z.infer<typeof claimBeginPayloadSchema>;
949
- /**
950
- * The `claim_abandon` payload a client sends. `entityType` and `entityId` let
951
- * the server dequeue a claim that is still waiting (not yet held) from the FIFO
952
- * line; abandoning a claim that is already held needs only `claimId`.
953
- */
954
- export declare const claimAbandonPayloadSchema: z.ZodObject<{
955
- claimId: z.ZodString;
956
- entityType: z.ZodOptional<z.ZodString>;
957
- entityId: z.ZodOptional<z.ZodString>;
958
- }, z.core.$strip>;
959
- export type ClaimAbandonPayload = z.infer<typeof claimAbandonPayloadSchema>;
960
- /**
961
- * The `claim_reorder` payload a client sends. A privileged participant, such as
962
- * a supervisor over its sub-agents, re-ranks the FIFO wait queue for an entity:
963
- * `order` lists waiters by `heldBy` and `claimId` in the desired priority, and
964
- * any waiter not listed keeps its relative order behind those that are. The
965
- * server gates who may call this and drops an unauthorized sender. Where
966
- * `claim_abandon` acts on the caller's own entry, a reorder acts on other
967
- * participants' queue positions — which is why it is gated.
968
- */
969
- export declare const claimReorderPayloadSchema: z.ZodObject<{
970
- entityType: z.ZodString;
971
- entityId: z.ZodString;
972
- order: z.ZodArray<z.ZodObject<{
973
- heldBy: z.ZodString;
974
- claimId: z.ZodString;
975
- }, z.core.$strip>>;
976
- }, z.core.$strip>;
977
- export type ClaimReorderPayload = z.infer<typeof claimReorderPayloadSchema>;
978
- /**
979
- * The `claim_heartbeat` payload a client sends to extend a lease it holds (or
980
- * refresh its slot in the wait queue) past the liveness window — the
981
- * work-duration signal for long-running holders, distinct from the connection
982
- * keepalive.
983
- *
984
- * The claim is identified either way: by `claimId`, or — since a claim is
985
- * singular per (actor, entity) — by the full `entityType`/`entityId` target
986
- * ("my claim on this row"). At least one of the two must be present. The
987
- * target also lets the server resolve without a scan and is required to
988
- * refresh a *queued* claim (a waiter is not in the holder set the server
989
- * would otherwise search).
990
- */
991
- export declare const claimHeartbeatPayloadSchema: z.ZodObject<{
992
- claimId: z.ZodOptional<z.ZodString>;
993
- entityType: z.ZodOptional<z.ZodString>;
994
- entityId: z.ZodOptional<z.ZodString>;
995
- ttlMs: z.ZodOptional<z.ZodNumber>;
996
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
997
- }, z.core.$strip>;
998
- export type ClaimHeartbeatPayload = z.infer<typeof claimHeartbeatPayloadSchema>;
999
- /**
1000
- * The server's reply to a `claim_heartbeat`. For a socketless worker the
1001
- * heartbeat reply is the only inbound signal path, so it carries the lease's
1002
- * fate rather than a bare ok: `held` (extended to `expiresAt`), `queued`
1003
- * (slot refreshed; `position` is the current place in line), or `lost` (the
1004
- * lease expired and the queue moved on — the worker should abandon or
1005
- * re-queue, and any write it still attempts is caught by its `readAt` guard).
1006
- */
1007
- export declare const claimHeartbeatAckPayloadSchema: z.ZodObject<{
1008
- claimId: z.ZodString;
1009
- status: z.ZodEnum<{
1010
- queued: "queued";
1011
- held: "held";
1012
- lost: "lost";
1013
- }>;
1014
- expiresAt: z.ZodOptional<z.ZodNumber>;
1015
- position: z.ZodOptional<z.ZodNumber>;
1016
- queueDepth: z.ZodOptional<z.ZodNumber>;
1017
- }, z.core.$strip>;
1018
- export type ClaimHeartbeatAckPayload = z.infer<typeof claimHeartbeatAckPayloadSchema>;
1019
- /**
1020
- * The batched heartbeat — one request extends every lease the caller holds
1021
- * on its plane (the socketless twin of the WebSocket keepalive, which renews
1022
- * all held leases on every ping). For a worker holding many rows this is one
1023
- * round trip per cadence instead of one per claim. Queued slots are not
1024
- * batch-refreshed: a waiter knows its target and beats it directly.
1025
- */
1026
- export declare const claimHeartbeatBatchPayloadSchema: z.ZodObject<{
1027
- ttlMs: z.ZodOptional<z.ZodNumber>;
1028
- }, z.core.$strip>;
1029
- export type ClaimHeartbeatBatchPayload = z.infer<typeof claimHeartbeatBatchPayloadSchema>;
1030
- /** Reply to a batched heartbeat: one ack entry per lease that was extended. */
1031
- export declare const claimHeartbeatBatchAckPayloadSchema: z.ZodObject<{
1032
- results: z.ZodArray<z.ZodObject<{
1033
- claimId: z.ZodString;
1034
- status: z.ZodEnum<{
1035
- queued: "queued";
1036
- held: "held";
1037
- lost: "lost";
1038
- }>;
1039
- expiresAt: z.ZodOptional<z.ZodNumber>;
1040
- position: z.ZodOptional<z.ZodNumber>;
1041
- queueDepth: z.ZodOptional<z.ZodNumber>;
1042
- }, z.core.$strip>>;
1043
- }, z.core.$strip>;
1044
- export type ClaimHeartbeatBatchAckPayload = z.infer<typeof claimHeartbeatBatchAckPayloadSchema>;
1045
- /**
1046
- * How many scopes one frame may name. A coarse abuse ceiling, not a business
1047
- * limit: a connection legitimately watches a handful of entities, and a list
1048
- * this long is an amplification attempt rather than a workload. Declared here,
1049
- * beside the two frames it bounds, so neither can be given a different answer.
1050
- */
1051
- export declare const MAX_FRAME_SYNC_GROUPS = 200;
1052
- /**
1053
- * The `claim` payload a client sends — the frame behind `join`.
1054
- *
1055
- * It opens one participant claim: the connection is added to each named
1056
- * scope's fan-out under `claimId`, announced into its presence roster, and
1057
- * holds that interest until `release`, the TTL lapses, or the socket closes.
1058
- * The handle is client-chosen because the client must be able to `release`
1059
- * the exact claim it opened while others stay open.
1060
- *
1061
- * This shape was, for a long time, written three times — built as a literal in
1062
- * the transport, restated as an interface on the server, and read back through
1063
- * a cast in the frame handler — which is how the frame came to be the only
1064
- * coordination message with no runtime check on the way in.
1065
- */
1066
- export declare const participantClaimPayloadSchema: z.ZodObject<{
1067
- claimId: z.ZodString;
1068
- syncGroups: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"default">, z.core.$ZodBranded<z.ZodTemplateLiteral<`${string}:${string}`>, "SyncGroup", "out">]>>;
1069
- capabilityToken: z.ZodOptional<z.ZodString>;
1070
- ttlSeconds: z.ZodOptional<z.ZodNumber>;
1071
- }, z.core.$strip>;
1072
- export type ParticipantClaimPayload = z.infer<typeof participantClaimPayloadSchema>;
1073
- /**
1074
- * The `release` payload — drop one participant claim by its handle.
1075
- *
1076
- * A projection of the claim it releases rather than a second object, so the
1077
- * handle cannot be spelled one way when opened and another when dropped.
1078
- * Idempotent by contract: the server accepts an unknown handle silently, so a
1079
- * client releasing everything at shutdown never has to check what is still open.
1080
- */
1081
- export declare const participantReleasePayloadSchema: z.ZodObject<{
1082
- claimId: z.ZodString;
1083
- }, z.core.$strip>;
1084
- export type ParticipantReleasePayload = z.infer<typeof participantReleasePayloadSchema>;
1085
- /**
1086
- * The `update_subscription` payload a client sends. It replaces the
1087
- * connection's read interest with the complete set of sync groups — the
1088
- * unleased counterpart to {@link participantClaimPayloadSchema}, with no
1089
- * handle, no TTL, and no roster entry.
1090
- */
1091
- export declare const updateSubscriptionPayloadSchema: z.ZodObject<{
1092
- syncGroups: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"default">, z.core.$ZodBranded<z.ZodTemplateLiteral<`${string}:${string}`>, "SyncGroup", "out">]>>;
1093
- }, z.core.$strip>;
1094
- export type UpdateSubscriptionPayload = z.infer<typeof updateSubscriptionPayloadSchema>;
1095
- /**
1096
- * `subscription_ack` payload (server → client). Echoes the connection's
1097
- * effective read set after the update (unchanged on rejection — the update is
1098
- * atomic). `error` is present iff `success` is false (e.g. a scoped key
1099
- * requesting a group outside its grant). `syncGroups` is lenient
1100
- * (`z.string()`) here, not branded: it is the server's own echo for display,
1101
- * not untrusted input, and includes base anchors like `org:<id>`.
1102
- */
1103
- export declare const subscriptionAckPayloadSchema: z.ZodObject<{
1104
- success: z.ZodBoolean;
1105
- syncGroups: z.ZodArray<z.ZodString>;
1106
- error: z.ZodOptional<z.ZodObject<{
1107
- code: z.ZodString;
1108
- message: z.ZodString;
1109
- }, z.core.$strip>>;
1110
- }, z.core.$strip>;
1111
- export type SubscriptionAckPayload = z.infer<typeof subscriptionAckPayloadSchema>;
1112
- export declare const commitOperationTypeSchema: z.ZodEnum<{
1113
- CREATE: "CREATE";
1114
- UPDATE: "UPDATE";
1115
- DELETE: "DELETE";
1116
- ARCHIVE: "ARCHIVE";
1117
- UNARCHIVE: "UNARCHIVE";
1118
- }>;
1119
- export type CommitOperationType = z.infer<typeof commitOperationTypeSchema>;
1120
- /**
1121
- * A single mutation in a commit batch, as it arrives on the wire. Extends the
1122
- * optimistic `writeGuard` (`readAt`/`onStale`/`bypass`) — the structural link
1123
- * that makes "every write is stale-guarded" legible in the type, not just in
1124
- * prose.
1125
- */
1126
- export declare const commitOperationSchema: z.ZodObject<{
1127
- readAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1128
- onStale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1129
- reject: "reject";
1130
- overwrite: "overwrite";
1131
- notify: "notify";
1132
- }>>>;
1133
- bypass: z.ZodOptional<z.ZodBoolean>;
1134
- type: z.ZodEnum<{
1135
- CREATE: "CREATE";
1136
- UPDATE: "UPDATE";
1137
- DELETE: "DELETE";
1138
- ARCHIVE: "ARCHIVE";
1139
- UNARCHIVE: "UNARCHIVE";
1140
- }>;
1141
- model: z.ZodString;
1142
- id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1143
- input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1144
- transactionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1145
- fenceToken: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1146
- }, z.core.$strip>;
1147
- export type CommitOperation = z.infer<typeof commitOperationSchema>;
1148
- /**
1149
- * Any commit operation on the wire — the runtime-validated ingest contract.
1150
- * Commit operations carry replace (last-write-wins) semantics, guarded by the
1151
- * optimistic write guard. It is a distinct alias from {@link CommitOperation}
1152
- * so the server's ingest boundary reads as "any op on the wire", even though
1153
- * the two shapes are identical.
1154
- */
1155
- export type AnyCommitOperation = CommitOperation;
1156
- export declare const presenceKindSchema: z.ZodEnum<{
1157
- enter: "enter";
1158
- update: "update";
1159
- leave: "leave";
1160
- }>;
1161
- export type PresenceKind = z.infer<typeof presenceKindSchema>;
1162
- /**
1163
- * What a participant is actively working on (agents fill this in).
1164
- *
1165
- * The two backpressure fields are part of the frame, not an extension of it:
1166
- * an agent worker announces them on every step, and an orchestrator reading
1167
- * peer activity routes work by them. They are declared here because a reader
1168
- * that validates this frame would otherwise drop them on the floor — the
1169
- * server passes both through without interpreting either.
1170
- */
1171
- export declare const presenceActivitySchema: z.ZodObject<{
1172
- entityType: z.ZodString;
1173
- entityId: z.ZodString;
1174
- path: z.ZodOptional<z.ZodString>;
1175
- range: z.ZodOptional<z.ZodObject<{
1176
- startLine: z.ZodNumber;
1177
- endLine: z.ZodNumber;
1178
- startColumn: z.ZodOptional<z.ZodNumber>;
1179
- endColumn: z.ZodOptional<z.ZodNumber>;
1180
- }, z.core.$strip>>;
1181
- field: z.ZodOptional<z.ZodString>;
1182
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1183
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1184
- action: z.ZodString;
1185
- detail: z.ZodOptional<z.ZodString>;
1186
- loadFactor: z.ZodOptional<z.ZodNumber>;
1187
- acceptingNewWork: z.ZodOptional<z.ZodBoolean>;
1188
- }, z.core.$strip>;
1189
- export type PresenceActivity = z.infer<typeof presenceActivitySchema>;
1190
- /**
1191
- * Full `presence_update` frame as the server broadcasts it. The activity +
1192
- * `activeClaims` are the observation surface for the other two layers —
1193
- * rendered, never acted on as enforcement.
1194
- *
1195
- * Open for the same reason {@link presenceUpdatePayloadSchema} is, and it has to
1196
- * be the same in both directions: whatever vocabulary an application announces
1197
- * through presence, it reads back off its peers' frames. A reader that parsed
1198
- * this strictly would validate the frame and quietly discard the part the
1199
- * application actually came for.
1200
- */
1201
- export declare const presenceUpdateSchema: z.ZodObject<{
1202
- kind: z.ZodEnum<{
1203
- enter: "enter";
1204
- update: "update";
1205
- leave: "leave";
1206
- }>;
1207
- userId: z.ZodString;
1208
- syncGroups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1209
- timestamp: z.ZodOptional<z.ZodNumber>;
1210
- status: z.ZodString;
1211
- timezone: z.ZodOptional<z.ZodString>;
1212
- customStatus: z.ZodOptional<z.ZodString>;
1213
- activity: z.ZodOptional<z.ZodObject<{
1214
- entityType: z.ZodString;
1215
- entityId: z.ZodString;
1216
- path: z.ZodOptional<z.ZodString>;
1217
- range: z.ZodOptional<z.ZodObject<{
1218
- startLine: z.ZodNumber;
1219
- endLine: z.ZodNumber;
1220
- startColumn: z.ZodOptional<z.ZodNumber>;
1221
- endColumn: z.ZodOptional<z.ZodNumber>;
1222
- }, z.core.$strip>>;
1223
- field: z.ZodOptional<z.ZodString>;
1224
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1225
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1226
- action: z.ZodString;
1227
- detail: z.ZodOptional<z.ZodString>;
1228
- loadFactor: z.ZodOptional<z.ZodNumber>;
1229
- acceptingNewWork: z.ZodOptional<z.ZodBoolean>;
1230
- }, z.core.$strip>>;
1231
- isAgent: z.ZodOptional<z.ZodBoolean>;
1232
- participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
1233
- user: "user";
1234
- agent: "agent";
1235
- system: "system";
1236
- }>>>;
1237
- activeClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
1238
- entityType: z.ZodString;
1239
- entityId: z.ZodString;
1240
- path: z.ZodOptional<z.ZodString>;
1241
- range: z.ZodOptional<z.ZodObject<{
1242
- startLine: z.ZodNumber;
1243
- endLine: z.ZodNumber;
1244
- startColumn: z.ZodOptional<z.ZodNumber>;
1245
- endColumn: z.ZodOptional<z.ZodNumber>;
1246
- }, z.core.$strip>>;
1247
- field: z.ZodOptional<z.ZodString>;
1248
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1249
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1250
- claimId: z.ZodString;
1251
- description: z.ZodOptional<z.ZodString>;
1252
- declaredAt: z.ZodNumber;
1253
- expiresAt: z.ZodNumber;
1254
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1255
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1256
- user: "user";
1257
- agent: "agent";
1258
- system: "system";
1259
- }>>>>;
1260
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1261
- fenceToken: z.ZodOptional<z.ZodNumber>;
1262
- acquiredAt: z.ZodOptional<z.ZodNumber>;
1263
- status: z.ZodOptional<z.ZodEnum<{
1264
- active: "active";
1265
- committed: "committed";
1266
- expired: "expired";
1267
- canceled: "canceled";
1268
- }>>;
1269
- error: z.ZodOptional<z.ZodObject<{
1270
- code: z.ZodString;
1271
- message: z.ZodOptional<z.ZodString>;
1272
- heldBy: z.ZodOptional<z.ZodString>;
1273
- heldByClaimId: z.ZodOptional<z.ZodString>;
1274
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
1275
- heldByClaim: z.ZodOptional<z.ZodObject<{
1276
- entityType: z.ZodString;
1277
- entityId: z.ZodString;
1278
- path: z.ZodOptional<z.ZodString>;
1279
- range: z.ZodOptional<z.ZodObject<{
1280
- startLine: z.ZodNumber;
1281
- endLine: z.ZodNumber;
1282
- startColumn: z.ZodOptional<z.ZodNumber>;
1283
- endColumn: z.ZodOptional<z.ZodNumber>;
1284
- }, z.core.$strip>>;
1285
- field: z.ZodOptional<z.ZodString>;
1286
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1287
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1288
- claimId: z.ZodString;
1289
- description: z.ZodOptional<z.ZodString>;
1290
- declaredAt: z.ZodNumber;
1291
- expiresAt: z.ZodNumber;
1292
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1293
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1294
- user: "user";
1295
- agent: "agent";
1296
- system: "system";
1297
- }>>>>;
1298
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1299
- }, z.core.$strip>>;
1300
- policyReason: z.ZodOptional<z.ZodString>;
1301
- }, z.core.$strip>>;
1302
- }, z.core.$strip>>>;
1303
- delegatedFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1304
- }, z.core.$catchall<z.ZodUnknown>>;
1305
- export type PresenceUpdate = z.infer<typeof presenceUpdateSchema>;
1306
- /**
1307
- * @deprecated Renamed to {@link presenceUpdateSchema}. Removed in 0.36.0.
1308
- *
1309
- * `Frame` was the only such suffix in this vocabulary: every other frame the
1310
- * server sends is named plainly — {@link claimLostSchema},
1311
- * {@link claimAcquiredSchema}, {@link claimRejectionSchema} — and the client's
1312
- * half carries `Payload`. One name did not follow the rule the other fifteen do.
1313
- */
1314
- export declare const presenceUpdateFrameSchema: z.ZodObject<{
1315
- kind: z.ZodEnum<{
1316
- enter: "enter";
1317
- update: "update";
1318
- leave: "leave";
1319
- }>;
1320
- userId: z.ZodString;
1321
- syncGroups: z.ZodOptional<z.ZodArray<z.ZodString>>;
1322
- timestamp: z.ZodOptional<z.ZodNumber>;
1323
- status: z.ZodString;
1324
- timezone: z.ZodOptional<z.ZodString>;
1325
- customStatus: z.ZodOptional<z.ZodString>;
1326
- activity: z.ZodOptional<z.ZodObject<{
1327
- entityType: z.ZodString;
1328
- entityId: z.ZodString;
1329
- path: z.ZodOptional<z.ZodString>;
1330
- range: z.ZodOptional<z.ZodObject<{
1331
- startLine: z.ZodNumber;
1332
- endLine: z.ZodNumber;
1333
- startColumn: z.ZodOptional<z.ZodNumber>;
1334
- endColumn: z.ZodOptional<z.ZodNumber>;
1335
- }, z.core.$strip>>;
1336
- field: z.ZodOptional<z.ZodString>;
1337
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1338
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1339
- action: z.ZodString;
1340
- detail: z.ZodOptional<z.ZodString>;
1341
- loadFactor: z.ZodOptional<z.ZodNumber>;
1342
- acceptingNewWork: z.ZodOptional<z.ZodBoolean>;
1343
- }, z.core.$strip>>;
1344
- isAgent: z.ZodOptional<z.ZodBoolean>;
1345
- participantKind: z.ZodOptional<z.ZodPreprocess<z.ZodEnum<{
1346
- user: "user";
1347
- agent: "agent";
1348
- system: "system";
1349
- }>>>;
1350
- activeClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
1351
- entityType: z.ZodString;
1352
- entityId: z.ZodString;
1353
- path: z.ZodOptional<z.ZodString>;
1354
- range: z.ZodOptional<z.ZodObject<{
1355
- startLine: z.ZodNumber;
1356
- endLine: z.ZodNumber;
1357
- startColumn: z.ZodOptional<z.ZodNumber>;
1358
- endColumn: z.ZodOptional<z.ZodNumber>;
1359
- }, z.core.$strip>>;
1360
- field: z.ZodOptional<z.ZodString>;
1361
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1362
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1363
- claimId: z.ZodString;
1364
- description: z.ZodOptional<z.ZodString>;
1365
- declaredAt: z.ZodNumber;
1366
- expiresAt: z.ZodNumber;
1367
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1368
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1369
- user: "user";
1370
- agent: "agent";
1371
- system: "system";
1372
- }>>>>;
1373
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1374
- fenceToken: z.ZodOptional<z.ZodNumber>;
1375
- acquiredAt: z.ZodOptional<z.ZodNumber>;
1376
- status: z.ZodOptional<z.ZodEnum<{
1377
- active: "active";
1378
- committed: "committed";
1379
- expired: "expired";
1380
- canceled: "canceled";
1381
- }>>;
1382
- error: z.ZodOptional<z.ZodObject<{
1383
- code: z.ZodString;
1384
- message: z.ZodOptional<z.ZodString>;
1385
- heldBy: z.ZodOptional<z.ZodString>;
1386
- heldByClaimId: z.ZodOptional<z.ZodString>;
1387
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
1388
- heldByClaim: z.ZodOptional<z.ZodObject<{
1389
- entityType: z.ZodString;
1390
- entityId: z.ZodString;
1391
- path: z.ZodOptional<z.ZodString>;
1392
- range: z.ZodOptional<z.ZodObject<{
1393
- startLine: z.ZodNumber;
1394
- endLine: z.ZodNumber;
1395
- startColumn: z.ZodOptional<z.ZodNumber>;
1396
- endColumn: z.ZodOptional<z.ZodNumber>;
1397
- }, z.core.$strip>>;
1398
- field: z.ZodOptional<z.ZodString>;
1399
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1400
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1401
- claimId: z.ZodString;
1402
- description: z.ZodOptional<z.ZodString>;
1403
- declaredAt: z.ZodNumber;
1404
- expiresAt: z.ZodNumber;
1405
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1406
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1407
- user: "user";
1408
- agent: "agent";
1409
- system: "system";
1410
- }>>>>;
1411
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1412
- }, z.core.$strip>>;
1413
- policyReason: z.ZodOptional<z.ZodString>;
1414
- }, z.core.$strip>>;
1415
- }, z.core.$strip>>>;
1416
- delegatedFrom: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1417
- }, z.core.$catchall<z.ZodUnknown>>;
1418
- /** @deprecated Renamed to {@link PresenceUpdate}. Removed in 0.36.0. */
1419
- export type PresenceUpdateFrame = PresenceUpdate;
1420
- /**
1421
- * The `presence_update` payload a client SENDS — deliberately much smaller
1422
- * than the frame the server broadcasts back.
1423
- *
1424
- * Everything that identifies or situates the participant is stamped by the
1425
- * server and cannot be declared here: `userId`, `participantKind`, `isAgent`,
1426
- * `syncGroups`, `timestamp`, `kind`, and `delegatedFrom` all come from the
1427
- * connection's own identity. A client that sends them is not believed — an
1428
- * older SDK once hardcoded `isAgent: true` on every announce, and because the
1429
- * payload was spread into the broadcast unfiltered, every human session
1430
- * rendered to its peers as an agent. Parsing an inbound payload through this
1431
- * schema and broadcasting the *result* is what makes that structurally
1432
- * impossible rather than a rule the broadcast has to remember.
1433
- *
1434
- * `status` is a plain string, matching the outbound frame: the three canonical
1435
- * values are conventions the presence UI understands, not a closed set the
1436
- * protocol enforces.
1437
- *
1438
- * The payload is deliberately OPEN — `catchall` keeps keys this schema does not
1439
- * name. Presence is the one frame an application extends: an agent mesh
1440
- * announces its own coordination vocabulary through it and reads it back off
1441
- * peer frames, without the protocol having to learn each app's words. So the
1442
- * fields named here are validated and typed, and anything else rides along
1443
- * untouched. Openness is not the same as trust: the server-stamped identity
1444
- * fields are applied AFTER this payload is spread into the broadcast, so a
1445
- * client that sends its own `userId` or `isAgent` is overwritten either way.
1446
- */
1447
- export declare const presenceUpdatePayloadSchema: z.ZodObject<{
1448
- status: z.ZodOptional<z.ZodString>;
1449
- activity: z.ZodOptional<z.ZodObject<{
1450
- entityType: z.ZodString;
1451
- entityId: z.ZodString;
1452
- path: z.ZodOptional<z.ZodString>;
1453
- range: z.ZodOptional<z.ZodObject<{
1454
- startLine: z.ZodNumber;
1455
- endLine: z.ZodNumber;
1456
- startColumn: z.ZodOptional<z.ZodNumber>;
1457
- endColumn: z.ZodOptional<z.ZodNumber>;
1458
- }, z.core.$strip>>;
1459
- field: z.ZodOptional<z.ZodString>;
1460
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1461
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1462
- action: z.ZodString;
1463
- detail: z.ZodOptional<z.ZodString>;
1464
- loadFactor: z.ZodOptional<z.ZodNumber>;
1465
- acceptingNewWork: z.ZodOptional<z.ZodBoolean>;
1466
- }, z.core.$strip>>;
1467
- activeClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
1468
- entityType: z.ZodString;
1469
- entityId: z.ZodString;
1470
- path: z.ZodOptional<z.ZodString>;
1471
- range: z.ZodOptional<z.ZodObject<{
1472
- startLine: z.ZodNumber;
1473
- endLine: z.ZodNumber;
1474
- startColumn: z.ZodOptional<z.ZodNumber>;
1475
- endColumn: z.ZodOptional<z.ZodNumber>;
1476
- }, z.core.$strip>>;
1477
- field: z.ZodOptional<z.ZodString>;
1478
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1479
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1480
- claimId: z.ZodString;
1481
- description: z.ZodOptional<z.ZodString>;
1482
- declaredAt: z.ZodNumber;
1483
- expiresAt: z.ZodNumber;
1484
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1485
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1486
- user: "user";
1487
- agent: "agent";
1488
- system: "system";
1489
- }>>>>;
1490
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1491
- fenceToken: z.ZodOptional<z.ZodNumber>;
1492
- acquiredAt: z.ZodOptional<z.ZodNumber>;
1493
- status: z.ZodOptional<z.ZodEnum<{
1494
- active: "active";
1495
- committed: "committed";
1496
- expired: "expired";
1497
- canceled: "canceled";
1498
- }>>;
1499
- error: z.ZodOptional<z.ZodObject<{
1500
- code: z.ZodString;
1501
- message: z.ZodOptional<z.ZodString>;
1502
- heldBy: z.ZodOptional<z.ZodString>;
1503
- heldByClaimId: z.ZodOptional<z.ZodString>;
1504
- heldByExpiresAt: z.ZodOptional<z.ZodNumber>;
1505
- heldByClaim: z.ZodOptional<z.ZodObject<{
1506
- entityType: z.ZodString;
1507
- entityId: z.ZodString;
1508
- path: z.ZodOptional<z.ZodString>;
1509
- range: z.ZodOptional<z.ZodObject<{
1510
- startLine: z.ZodNumber;
1511
- endLine: z.ZodNumber;
1512
- startColumn: z.ZodOptional<z.ZodNumber>;
1513
- endColumn: z.ZodOptional<z.ZodNumber>;
1514
- }, z.core.$strip>>;
1515
- field: z.ZodOptional<z.ZodString>;
1516
- fields: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1517
- meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1518
- claimId: z.ZodString;
1519
- description: z.ZodOptional<z.ZodString>;
1520
- declaredAt: z.ZodNumber;
1521
- expiresAt: z.ZodNumber;
1522
- onBehalfOfId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1523
- onBehalfOfKind: z.ZodOptional<z.ZodNullable<z.ZodPreprocess<z.ZodEnum<{
1524
- user: "user";
1525
- agent: "agent";
1526
- system: "system";
1527
- }>>>>;
1528
- capabilityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1529
- }, z.core.$strip>>;
1530
- policyReason: z.ZodOptional<z.ZodString>;
1531
- }, z.core.$strip>>;
1532
- }, z.core.$strip>>>;
1533
- timezone: z.ZodOptional<z.ZodString>;
1534
- customStatus: z.ZodOptional<z.ZodString>;
1535
- }, z.core.$catchall<z.ZodUnknown>>;
1536
- export type PresenceUpdatePayload = z.infer<typeof presenceUpdatePayloadSchema>;