@abloatai/humans 0.57.0 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/Ablo.d.ts +8 -18
  2. package/dist/client.d.ts +6 -19
  3. package/dist/core.d.ts +1 -1
  4. package/dist/core.js +1 -1
  5. package/dist/local/Database.d.ts +1 -1
  6. package/dist/local/SyncClient.js +5 -0
  7. package/dist/local/client/createInternalComponents.d.ts +1 -1
  8. package/dist/local/client/createInternalComponents.js +1 -1
  9. package/dist/local/client/{createModelProxy.d.ts → createModelOperations.d.ts} +11 -10
  10. package/dist/local/client/{createModelProxy.js → createModelOperations.js} +240 -313
  11. package/dist/local/client/options.d.ts +2 -2
  12. package/dist/local/client/reactiveEngine.js +34 -45
  13. package/dist/local/client/resourceTypes.d.ts +3 -3
  14. package/dist/local/client/resourceTypes.js +1 -1
  15. package/dist/local/client/wsMutationExecutor.d.ts +4 -4
  16. package/dist/local/client/wsMutationExecutor.js +3 -5
  17. package/dist/local/coordination/ClaimLog.d.ts +3 -3
  18. package/dist/local/coordination/ClaimLog.js +2 -2
  19. package/dist/local/interfaces/index.d.ts +5 -7
  20. package/dist/local/mutators/mutateActions.d.ts +3 -2
  21. package/dist/local/query/types.d.ts +2 -2
  22. package/dist/local/stores/syncAction.d.ts +1 -1
  23. package/dist/local/stores/syncAction.js +1 -1
  24. package/dist/local/sync/ConnectionManager.d.ts +1 -1
  25. package/dist/local/sync/ConnectionManager.js +1 -1
  26. package/dist/local/sync/OnDemandLoader.d.ts +1 -1
  27. package/dist/local/sync/OnDemandLoader.js +1 -1
  28. package/dist/local/sync/SyncWebSocket.d.ts +3 -3
  29. package/dist/local/sync/SyncWebSocket.js +2 -2
  30. package/dist/local/sync/commitFrames.d.ts +1 -1
  31. package/dist/local/sync/commitFrames.js +1 -1
  32. package/dist/local/sync/contextOnChange.d.ts +8 -0
  33. package/dist/local/sync/contextOnChange.js +65 -0
  34. package/dist/local/sync/createClaimStream.d.ts +1 -1
  35. package/dist/local/sync/createClaimStream.js +47 -28
  36. package/dist/local/sync/credentialLifecycle.d.ts +1 -1
  37. package/dist/local/sync/credentialLifecycle.js +1 -1
  38. package/dist/local/sync/participants.d.ts +1 -1
  39. package/dist/local/sync/schemas.d.ts +2 -2
  40. package/dist/local/sync/schemas.js +1 -1
  41. package/dist/local/sync/wsFrameHandlers.d.ts +1 -1
  42. package/dist/local/sync/wsFrameHandlers.js +1 -1
  43. package/dist/local/transactions/databaseCommitOutbox.d.ts +2 -2
  44. package/dist/local/transactions/mutations/MutationQueue.d.ts +4 -19
  45. package/dist/local/transactions/mutations/MutationQueue.js +5 -70
  46. package/dist/local/transactions/mutations/batchProcessing.d.ts +2 -13
  47. package/dist/local/transactions/mutations/batchProcessing.js +0 -20
  48. package/dist/local/transactions/mutations/commitApi.d.ts +2 -3
  49. package/dist/local/transactions/mutations/commitApi.js +0 -4
  50. package/dist/local/transactions/mutations/commitLane.d.ts +3 -8
  51. package/dist/local/transactions/mutations/commitLane.js +0 -11
  52. package/dist/local/transactions/mutations/commitPayload.d.ts +2 -4
  53. package/dist/local/transactions/mutations/commitPayload.js +2 -6
  54. package/dist/local/transactions/mutations/commitTransport.d.ts +3 -4
  55. package/dist/local/transactions/mutations/commitTransport.js +2 -5
  56. package/dist/local/transactions/mutations/durableCommitRestore.d.ts +1 -1
  57. package/dist/local/transactions/mutations/durableCommitRestore.js +1 -4
  58. package/dist/local/transactions/mutations/durableWriteStore.d.ts +5 -5
  59. package/dist/local/transactions/mutations/durableWriteStore.js +3 -3
  60. package/dist/local/transactions/mutations/failurePolicy.d.ts +2 -2
  61. package/dist/local/transactions/mutations/mutationPersistence.d.ts +1 -1
  62. package/dist/local/transactions/mutations/pendingDrain.d.ts +2 -2
  63. package/dist/local/transactions/mutations/replayValidation.d.ts +0 -20
  64. package/dist/local/transactions/mutations/replayValidation.js +1 -3
  65. package/dist/local/transactions/persistedTransaction.d.ts +0 -2
  66. package/dist/plugin.d.ts +2 -2
  67. package/dist/presenceStream.d.ts +1 -1
  68. package/dist/react/createAbloReact.d.ts +1 -1
  69. package/dist/react/useAblo.d.ts +2 -2
  70. package/dist/react/useAblo.js +1 -1
  71. package/dist/surface.d.ts +1 -1
  72. package/dist/surface.js +1 -2
  73. package/package.json +2 -2
  74. package/src/Ablo.ts +9 -27
  75. package/src/client.ts +6 -22
  76. package/src/core.ts +1 -1
  77. package/src/local/Database.ts +1 -1
  78. package/src/local/SyncClient.ts +5 -0
  79. package/src/local/client/createInternalComponents.ts +2 -2
  80. package/src/local/client/{createModelProxy.ts → createModelOperations.ts} +292 -367
  81. package/src/local/client/options.ts +2 -2
  82. package/src/local/client/reactiveEngine.ts +63 -55
  83. package/src/local/client/resourceTypes.ts +4 -4
  84. package/src/local/client/wsMutationExecutor.ts +3 -9
  85. package/src/local/coordination/ClaimLog.ts +3 -3
  86. package/src/local/interfaces/index.ts +5 -7
  87. package/src/local/mutators/mutateActions.ts +3 -2
  88. package/src/local/query/types.ts +2 -2
  89. package/src/local/stores/syncAction.ts +1 -1
  90. package/src/local/sync/ConnectionManager.ts +1 -1
  91. package/src/local/sync/OnDemandLoader.ts +1 -1
  92. package/src/local/sync/SyncWebSocket.ts +3 -3
  93. package/src/local/sync/commitFrames.ts +1 -2
  94. package/src/local/sync/contextOnChange.ts +92 -0
  95. package/src/local/sync/createClaimStream.ts +77 -39
  96. package/src/local/sync/credentialLifecycle.ts +1 -1
  97. package/src/local/sync/participants.ts +1 -1
  98. package/src/local/sync/schemas.ts +1 -1
  99. package/src/local/sync/wsFrameHandlers.ts +1 -1
  100. package/src/local/transactions/databaseCommitOutbox.ts +2 -2
  101. package/src/local/transactions/mutations/MutationQueue.ts +8 -95
  102. package/src/local/transactions/mutations/batchProcessing.ts +2 -38
  103. package/src/local/transactions/mutations/commitApi.ts +3 -7
  104. package/src/local/transactions/mutations/commitLane.ts +3 -17
  105. package/src/local/transactions/mutations/commitPayload.ts +3 -11
  106. package/src/local/transactions/mutations/commitTransport.ts +3 -7
  107. package/src/local/transactions/mutations/durableCommitRestore.ts +2 -5
  108. package/src/local/transactions/mutations/durableWriteStore.ts +5 -5
  109. package/src/local/transactions/mutations/failurePolicy.ts +2 -2
  110. package/src/local/transactions/mutations/mutationPersistence.ts +1 -1
  111. package/src/local/transactions/mutations/pendingDrain.ts +2 -2
  112. package/src/local/transactions/mutations/replayValidation.ts +1 -3
  113. package/src/local/transactions/persistedTransaction.ts +0 -3
  114. package/src/plugin.ts +2 -2
  115. package/src/presenceStream.ts +2 -2
  116. package/src/react/createAbloReact.ts +1 -1
  117. package/src/react/useAblo.ts +2 -2
  118. package/src/surface.ts +2 -3
  119. package/dist/local/sync/createSnapshot.d.ts +0 -29
  120. package/dist/local/sync/createSnapshot.js +0 -116
  121. package/src/local/sync/createSnapshot.ts +0 -160
package/dist/Ablo.d.ts CHANGED
@@ -65,7 +65,6 @@ export declare function Ablo<const S extends SchemaRecord, const P extends reado
65
65
  export declare function Ablo<const S extends SchemaRecord>(options: AbloOptions<S>): Ablo<S>;
66
66
  import type * as _Streams from '@abloatai/transaction/types/streams';
67
67
  import type * as _Participants from './local/sync/participants.js';
68
- import type * as _Policy from '@abloatai/transaction/policy/types';
69
68
  import type * as _Mutators from './local/mutators/defineMutators.js';
70
69
  import type * as _Tx from './local/mutators/Transaction.js';
71
70
  import type * as _Undo from './local/mutators/UndoManager.js';
@@ -108,7 +107,6 @@ export declare namespace Ablo {
108
107
  type ClaimLost = _Streams.ClaimLost;
109
108
  type ClaimHeartbeat = _Streams.ClaimHeartbeat;
110
109
  type ClaimHeartbeatOptions = _Streams.ClaimHeartbeatOptions;
111
- type Snapshot<TSchema extends _SchemaTypes.Schema = _SchemaTypes.Schema, K extends keyof TSchema['models'] = keyof TSchema['models']> = _Streams.Snapshot<TSchema, K>;
112
110
  namespace Auth {
113
111
  type Actor = _Streams.ParticipantRef;
114
112
  }
@@ -150,14 +148,6 @@ export declare namespace Ablo {
150
148
  type InferRow<S extends _SchemaTypes.Schema, K extends keyof S['models']> = _SchemaTypes.InferRow<S, K>;
151
149
  type InferModelNames<S extends _SchemaTypes.Schema> = _SchemaTypes.InferModelNames<S>;
152
150
  }
153
- type Conflict = _Policy.Conflict;
154
- namespace Conflict {
155
- type Kind = _Policy.ConflictKind;
156
- type Operation = _Policy.ConflictOperation;
157
- type Decision = _Policy.ConflictDecision;
158
- type Policy = _Policy.ConflictPolicy;
159
- type Axis = _Policy.ConflictAxis;
160
- }
161
151
  namespace Commit {
162
152
  type Wait = import('./local/client/resourceTypes.js').CommitWait;
163
153
  type OperationAction = import('./local/client/resourceTypes.js').ModelOperationAction;
@@ -171,19 +161,19 @@ export declare namespace Ablo {
171
161
  type Held<T = Record<string, unknown>> = import('@abloatai/transaction/types/streams').HeldClaim<T>;
172
162
  type CreateOptions = import('./local/client/resourceTypes.js').ClaimCreateOptions;
173
163
  type WaitOptions = import('./local/client/resourceTypes.js').ClaimWaitOptions;
174
- type ContentionOptions = import('@abloatai/transaction/resources/modelOperations').ClaimContentionOptions;
175
- type AttemptEvent = import('@abloatai/transaction/resources/modelOperations').ClaimAttemptEvent;
176
- type QueueView = import('@abloatai/transaction/resources/modelOperations').ClaimQueueView;
164
+ type ContentionOptions = import('@abloatai/transaction/client/resources/modelOperations').ClaimContentionOptions;
165
+ type AttemptEvent = import('@abloatai/transaction/client/resources/modelOperations').ClaimAttemptEvent;
166
+ type QueueView = import('@abloatai/transaction/client/resources/modelOperations').ClaimQueueView;
177
167
  type Client = import('./local/client/resourceTypes.js').ClaimResource;
178
168
  }
179
169
  namespace Model {
180
170
  type Target = import('./local/client/resourceTypes.js').ModelTarget;
181
171
  type Claim = import('./local/client/resourceTypes.js').ModelClaim;
182
- type Operations<T, CreateInput = T> = import('./local/client/createModelProxy.js').ModelOperations<T, CreateInput>;
183
- type ClaimOptions<T = Record<string, unknown>> = import('./local/client/createModelProxy.js').ClaimOptions<T>;
184
- type ClaimParams<T = Record<string, unknown>> = import('./local/client/createModelProxy.js').ClaimParams<T>;
185
- type ClaimLookupParams<T = Record<string, unknown>> = import('./local/client/createModelProxy.js').ClaimLookupParams<T>;
186
- type ClaimReorderParams<T = Record<string, unknown>> = import('./local/client/createModelProxy.js').ClaimReorderParams<T>;
172
+ type Operations<T, CreateInput = T> = import('./local/client/createModelOperations.js').ModelOperations<T, CreateInput>;
173
+ type ClaimOptions<T = Record<string, unknown>> = import('./local/client/createModelOperations.js').ClaimOptions<T>;
174
+ type ClaimParams<T = Record<string, unknown>> = import('./local/client/createModelOperations.js').ClaimParams<T>;
175
+ type ClaimLookupParams<T = Record<string, unknown>> = import('./local/client/createModelOperations.js').ClaimLookupParams<T>;
176
+ type ClaimReorderParams<T = Record<string, unknown>> = import('./local/client/createModelOperations.js').ClaimReorderParams<T>;
187
177
  type MutationOptions = import('./local/client/resourceTypes.js').ModelMutationOptions;
188
178
  }
189
179
  namespace Source {
package/dist/client.d.ts CHANGED
@@ -11,14 +11,16 @@
11
11
  * the factory back and creating a cycle.
12
12
  */
13
13
  import type { Schema, SchemaRecord, Model, InferCreate, InferRow } from '@abloatai/transaction/schema/schema';
14
- import type { PresenceStream, Snapshot } from '@abloatai/transaction/types/streams';
14
+ import type { PresenceStream } from '@abloatai/transaction/types/streams';
15
15
  import type { InstanceCache } from './local/InstanceCache.js';
16
16
  import type { SyncStoreContract } from './react/context.js';
17
17
  import type { SyncWebSocket, CoreSyncEventMap } from './local/sync/SyncWebSocket.js';
18
18
  import type { SyncStatus } from './local/BaseSyncedStore.js';
19
- import type { ModelOperations } from './local/client/createModelProxy.js';
20
- import type { ClaimResource, CommitResource, CreateAgentClientParams, SessionResource } from '@abloatai/transaction/resources/httpResources';
19
+ import type { ModelOperations } from './local/client/createModelOperations.js';
20
+ import type { ClaimResource, CommitResource, CreateAgentClientParams, SessionResource } from '@abloatai/transaction/client/resources/httpResources';
21
21
  import type { EffectiveAuthority } from '@abloatai/transaction/auth';
22
+ import type { ReadDependency } from '@abloatai/transaction/coordination';
23
+ import type { CapturedRow } from '@abloatai/transaction/transport/http';
22
24
  export type { LocalReadOptions } from './local/client/resourceTypes.js';
23
25
  /** The typed sync engine client — one property per model in the schema */
24
26
  export type AbloClient<S extends SchemaRecord> = {
@@ -268,22 +270,7 @@ export type AbloClient<S extends SchemaRecord> = {
268
270
  * Canonical low-level mutation API. Every untyped model write compiles
269
271
  * down to `commits.create(...)`.
270
272
  */
271
- readonly commits: CommitResource;
272
- /**
273
- * Capture a context-staleness watermark over a set of entities.
274
- * Returns a flat snapshot with `stamp` (thread into writes as
275
- * `readAt`), `signal` (aborts on any captured-entity delta), and
276
- * `onChange` (callback form). Reads from the engine's InstanceCache;
277
- * subscription is on the engine's existing transport.
278
- *
279
- * Use before an LLM call to prevent the model from completing
280
- * against now-stale data:
281
- * ```ts
282
- * const snap = engine.snapshot({ sections: report.sectionIds });
283
- * await streamText({ messages, signal: snap.signal });
284
- * ```
285
- */
286
- snapshot<ModelName extends keyof S & string>(entities: Readonly<Record<ModelName, string | readonly string[]>>): Snapshot<Schema<S>, ModelName>;
273
+ readonly commits: CommitResource<ReadDependency | CapturedRow>;
287
274
  /**
288
275
  * Subscribe to pushed frames — deltas, presence updates, claim grants and
289
276
  * losses, connection changes. Durable: the subscription survives the
package/dist/core.d.ts CHANGED
@@ -30,7 +30,7 @@ export { BootstrapFetcher } from './local/sync/BootstrapFetcher.js';
30
30
  * existing imports working and will be removed in a future major version. */
31
31
  export { BootstrapFetcher as BootstrapHelper } from './local/sync/BootstrapFetcher.js';
32
32
  export { createClaimStream, type AttachableClaimStream, type ClaimStreamConfig, } from './local/sync/createClaimStream.js';
33
- export { awaitClaimGrant, type GrantTransport, } from '@abloatai/transaction/coordination/awaitClaimGrant';
33
+ export { awaitClaimGrant, type GrantTransport, } from '@abloatai/transaction/claims';
34
34
  export { LoadStrategy } from '@abloatai/transaction/types';
35
35
  export type { InternalAbloOptions } from './local/client/options.js';
36
36
  export { drainProfileSnapshot, resetDrainProfile, drainProfilingEnabled, drainAcknowledgeStamps, type AcknowledgeStamp, type DrainProfile, type DrainBatchRow, type DrainStage, type DrainStageTotals, } from './local/sync/drainProfile.js';
package/dist/core.js CHANGED
@@ -42,7 +42,7 @@ export { BootstrapFetcher as BootstrapHelper } from './local/sync/BootstrapFetch
42
42
  // grants. These are for extension code and test harnesses; ordinary
43
43
  // application code should use `ablo.<model>.claim`.
44
44
  export { createClaimStream, } from './local/sync/createClaimStream.js';
45
- export { awaitClaimGrant, } from '@abloatai/transaction/coordination/awaitClaimGrant';
45
+ export { awaitClaimGrant, } from '@abloatai/transaction/claims';
46
46
  // An enum naming the strategies for loading a model's data. Referenced when
47
47
  // registering models in extension code.
48
48
  export { LoadStrategy } from '@abloatai/transaction/types';
@@ -13,7 +13,7 @@ import type { RuntimeContext } from './RuntimeContext.js';
13
13
  import type { AppliedChange } from '../plugin.js';
14
14
  import type { BootstrapFetcher, BootstrapData } from './sync/BootstrapFetcher.js';
15
15
  import { InMemoryObjectStore } from './adapters/inMemoryStorage.js';
16
- import type { SyncDeltaAction } from '@abloatai/transaction/wire/delta';
16
+ import type { SyncDeltaAction } from '@abloatai/transaction/observation';
17
17
  import type { BootstrapType } from '@abloatai/transaction/types';
18
18
  import { type PersistedTransaction } from './transactions/persistedTransaction.js';
19
19
  /** Generic record type for model data */
@@ -1229,6 +1229,11 @@ export class SyncClient extends EventEmitter {
1229
1229
  dispose() {
1230
1230
  this.isDisposed = true;
1231
1231
  this.disconnect();
1232
+ // The queue owns commit retry, replication-lag, offline-grace, and
1233
+ // per-mutation timers. A disposed client must release those resources too;
1234
+ // otherwise an atomic commit can keep a worker process alive after the
1235
+ // public client has been disposed.
1236
+ this.mutationQueue.dispose();
1232
1237
  this.networkMonitor.dispose();
1233
1238
  this.observers.clear();
1234
1239
  this.pendingStages.clear();
@@ -16,7 +16,7 @@ import { BootstrapFetcher } from '../sync/BootstrapFetcher.js';
16
16
  import type { AuthCredentialSource } from '@abloatai/transaction/auth/credentialSource';
17
17
  import type { Schema, SchemaRecord } from '@abloatai/transaction/schema/schema';
18
18
  import { type AbloPersistence } from '../persistence.js';
19
- import type { DurableWriteStore, DurableWritesConfig } from '@abloatai/transaction/durableWrites';
19
+ import type { DurableWriteStore, DurableWritesConfig } from '@abloatai/transaction/commit';
20
20
  import type { RuntimeContext } from '../RuntimeContext.js';
21
21
  export interface InternalComponentsInput<S extends SchemaRecord> {
22
22
  readonly schema: Schema<S>;
@@ -17,7 +17,7 @@ import { loadsAtBootstrap } from '@abloatai/transaction/schema/loadStrategy';
17
17
  import { resolveBootstrapBaseUrl } from '@abloatai/transaction/auth/apiKey';
18
18
  import { shouldUseInMemoryPersistence, } from '../persistence.js';
19
19
  import { globalRuntime } from '../context.js';
20
- import { resolveDurableWrites } from '@abloatai/transaction/durableWrites';
20
+ import { resolveDurableWrites } from '@abloatai/transaction/commit';
21
21
  export function createInternalComponents(input) {
22
22
  const { schema, url, options, auth } = input;
23
23
  const runtime = input.runtime ?? globalRuntime;
@@ -3,25 +3,25 @@
3
3
  * `ablo.<model>`.
4
4
  *
5
5
  * Each schema model gets one {@link ModelOperations}: the async server reads
6
- * `get` and `list`, with the same point lookup restricted to the local graph under
6
+ * `read` and `list`, with the same point lookup restricted to the local graph under
7
7
  * `local`, the writes `create`, `update`, and `delete`, the coordination
8
8
  * namespace `claim` (callable as `claim({ id })`, plus `claim.state`,
9
9
  * `claim.queue`, `claim.release`, and `claim.reorder`), `join`, and `onChange`.
10
10
  * The factory returns a plain object; the client assembles the `ablo.<model>`
11
11
  * lookup table from one of these per model.
12
12
  */
13
- import type { CommitCreateOptions, CommitReceipt } from '@abloatai/transaction/resources/httpResources';
13
+ import type { CommitCreateOptions, CommitReceipt } from '@abloatai/transaction/client/resources/httpResources';
14
14
  import type { ModelTarget } from '@abloatai/transaction/coordination/schema';
15
15
  import type { ModelRegistry } from '../ModelRegistry.js';
16
16
  import type { InstanceCache } from '../InstanceCache.js';
17
17
  import type { SyncClient } from '../SyncClient.js';
18
18
  import type { OnDemandLoader } from '../sync/OnDemandLoader.js';
19
19
  import type { JoinedParticipant } from '../sync/participants.js';
20
- import type { Duration, Claim, ClaimHeartbeat, ClaimHeartbeatOptions, HeldClaim, HeldLease, ClaimWaitOptions, Snapshot } from '@abloatai/transaction/types/streams';
21
- export type { ModelListScope, ModelTrackParams, ModelTrackResult, LocalReadOptions, LocalCountOptions, ServerReadOptions, ListAllOptions, ServerGetOptions, ServerRetrieveOptions, ClaimTargetOptions, ClaimParams, ClaimContentionOptions, ClaimAttemptEvent, ClaimQueueView, ClaimSkipOptions, ClaimSkipParams, ClaimLookupParams, ClaimReorderParams, ClaimOptions, ClaimReadApi, AwaitedClaimMethod, ClaimApi, ModelRetrieveParams, ModelCreateParams, ModelUpdateParams, ModelDeleteParams, JoinOptions, } from '@abloatai/transaction/resources/modelOperations';
20
+ import type { Duration, Claim, ClaimHeartbeat, ClaimHeartbeatOptions, HeldClaim, HeldLease, ClaimWaitOptions } from '@abloatai/transaction/types/streams';
21
+ export type { ModelListScope, LocalReadOptions, LocalCountOptions, ServerReadOptions, ListAllOptions, ServerPointReadOptions, ClaimTargetOptions, ClaimParams, ClaimContentionOptions, ClaimAttemptEvent, ClaimQueueView, ClaimSkipOptions, ClaimSkipParams, ClaimLookupParams, ClaimReorderParams, ClaimOptions, ClaimReadApi, AwaitedClaimMethod, ClaimApi, ModelReadParams, ModelCreateParams, ModelUpdateParams, ModelDeleteParams, JoinOptions, } from '@abloatai/transaction/client/resources/modelOperations';
22
22
  export type { Claim, ClaimHeartbeat, ClaimHeartbeatOptions, HeldClaim, HeldLease };
23
- import type { ClaimApi, ClaimAttemptEvent, JoinOptions, LocalCountOptions, LocalReadOptions } from '@abloatai/transaction/resources/modelOperations';
24
- import type { HttpModelClient } from '@abloatai/transaction/transport/httpClient';
23
+ import type { ClaimApi, ClaimAttemptEvent, JoinOptions, LocalCountOptions, LocalReadOptions } from '@abloatai/transaction/client/resources/modelOperations';
24
+ import type { HttpModelClient } from '@abloatai/transaction/transport/http';
25
25
  import type { ParticipantKind } from '@abloatai/transaction/types/participant';
26
26
  import { type ReadSetContext } from '@abloatai/transaction/internal/read-set';
27
27
  export interface ModelClientMeta {
@@ -77,7 +77,8 @@ export interface ModelCollaboration {
77
77
  /** Request-scoped queued / granted / skipped / failed status events. */
78
78
  onStatus?: (event: ClaimAttemptEvent) => void;
79
79
  }): Promise<Claim>;
80
- createSnapshot(modelKey: string, id: string): Snapshot;
80
+ /** Current applied/acked watermark, captured after a claim's fresh read. */
81
+ currentReadAt(): number;
81
82
  /**
82
83
  * Current coordination state on a target — who (if anyone) holds it.
83
84
  * Synchronous reactive snapshot read off the presence/claim stream;
@@ -145,7 +146,7 @@ export interface ModelCollaboration {
145
146
  * Opens a presence and claim subscription on this model's sync group(s) and
146
147
  * returns the live participant handle. Backs `ablo.<model>.join(ids)`.
147
148
  * WebSocket only, since presence needs a live socket; it is absent on other
148
- * client constructions, where the proxy throws a clear error.
149
+ * client constructions, where the surface throws a clear error.
149
150
  */
150
151
  createJoin?(modelKey: string, ids: string | readonly string[], options?: JoinOptions): Promise<JoinedParticipant>;
151
152
  }
@@ -154,7 +155,7 @@ export interface ModelCollaboration {
154
155
  *
155
156
  * Every verb mirrors its asynchronous sibling on the base surface, and the one
156
157
  * word in front is the whole difference. It is a narrowing, not a claim about
157
- * the other side: `get` consults the local graph and then the network,
158
+ * the other side: `read` consults the local graph and then the network,
158
159
  * while `local.get` is restricted to what is already resident — which is
159
160
  * also why it can return a value instead of a promise. There is nothing to
160
161
  * await.
@@ -253,7 +254,7 @@ interface ReactiveModelSurface<T, Fields = T> {
253
254
  * See {@link ReactiveModelSurface}.
254
255
  */
255
256
  export type ModelOperations<T, CreateInput> = Omit<HttpModelClient<T, CreateInput>, 'claim'> & ReactiveModelSurface<T, CreateInput>;
256
- export declare function createModelProxy<T, C>(schemaKey: string, registeredModelName: string, objectPool: Pick<InstanceCache, 'get' | 'getByType' | 'getOfType'>, syncClient: Pick<SyncClient, 'add' | 'delete' | 'getMutationQueue' | 'getOrganizationId' | 'syncNow' | 'update' | 'waitForConfirmation'>, registry: Pick<ModelRegistry, 'getModelByName'>,
257
+ export declare function createModelOperations<T, C>(schemaKey: string, registeredModelName: string, objectPool: Pick<InstanceCache, 'get' | 'getByType' | 'getOfType'>, syncClient: Pick<SyncClient, 'add' | 'delete' | 'getOrganizationId' | 'syncNow' | 'update' | 'waitForConfirmation'>, registry: Pick<ModelRegistry, 'getModelByName'>,
257
258
  /**
258
259
  * The one thing this factory asks of the loader: fetch rows for a model.
259
260
  *