@abloatai/ablo 0.5.1 → 0.7.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.
- package/CHANGELOG.md +61 -0
- package/README.md +248 -124
- package/dist/BaseSyncedStore.d.ts +3 -3
- package/dist/BaseSyncedStore.js +3 -3
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.js +1 -1
- package/dist/client/Ablo.d.ts +91 -93
- package/dist/client/Ablo.js +122 -60
- package/dist/client/ApiClient.d.ts +14 -14
- package/dist/client/ApiClient.js +81 -55
- package/dist/client/createInternalComponents.d.ts +2 -3
- package/dist/client/createInternalComponents.js +2 -3
- package/dist/client/createModelProxy.d.ts +116 -90
- package/dist/client/createModelProxy.js +128 -128
- package/dist/client/index.d.ts +6 -7
- package/dist/client/index.js +4 -5
- package/dist/client/validateAbloOptions.js +5 -5
- package/dist/coordination/index.d.ts +6 -0
- package/dist/coordination/index.js +6 -0
- package/dist/coordination/schema.d.ts +329 -0
- package/dist/coordination/schema.js +209 -0
- package/dist/core/QueryView.d.ts +4 -1
- package/dist/core/QueryView.js +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +7 -0
- package/dist/core/query-utils.d.ts +7 -10
- package/dist/core/query-utils.js +2 -3
- package/dist/errorCodes.d.ts +264 -0
- package/dist/errorCodes.js +251 -0
- package/dist/errors.d.ts +59 -14
- package/dist/errors.js +73 -12
- package/dist/index.d.ts +11 -9
- package/dist/index.js +8 -12
- package/dist/interfaces/index.d.ts +2 -10
- package/dist/mutators/Transaction.d.ts +2 -2
- package/dist/mutators/Transaction.js +2 -2
- package/dist/mutators/mutateActions.d.ts +44 -0
- package/dist/{react/useMutate.js → mutators/mutateActions.js} +11 -28
- package/dist/mutators/readerActions.d.ts +32 -0
- package/dist/{react/useReader.js → mutators/readerActions.js} +2 -18
- package/dist/policy/index.d.ts +1 -1
- package/dist/policy/index.js +1 -1
- package/dist/policy/types.d.ts +31 -0
- package/dist/policy/types.js +15 -0
- package/dist/query/types.d.ts +1 -1
- package/dist/react/AbloProvider.d.ts +13 -1
- package/dist/react/AbloProvider.js +14 -6
- package/dist/react/context.d.ts +4 -4
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +3 -7
- package/dist/react/useAblo.d.ts +14 -14
- package/dist/react/useAblo.js +26 -26
- package/dist/react/useIntent.d.ts +2 -2
- package/dist/react/useIntent.js +2 -2
- package/dist/react/useMutators.d.ts +1 -1
- package/dist/react/usePresence.d.ts +3 -3
- package/dist/react/usePresence.js +4 -4
- package/dist/react/useUndoScope.d.ts +1 -1
- package/dist/schema/ddl.d.ts +62 -0
- package/dist/schema/ddl.js +317 -0
- package/dist/schema/diff.d.ts +167 -0
- package/dist/schema/diff.js +280 -0
- package/dist/schema/field.d.ts +16 -19
- package/dist/schema/field.js +30 -17
- package/dist/schema/generate.d.ts +19 -0
- package/dist/schema/generate.js +87 -0
- package/dist/schema/index.d.ts +9 -3
- package/dist/schema/index.js +14 -2
- package/dist/schema/model.d.ts +87 -25
- package/dist/schema/model.js +33 -3
- package/dist/schema/relation.d.ts +17 -0
- package/dist/schema/roles.d.ts +148 -0
- package/dist/schema/roles.js +149 -0
- package/dist/schema/schema.d.ts +10 -69
- package/dist/schema/schema.js +58 -24
- package/dist/schema/select.d.ts +25 -0
- package/dist/schema/select.js +55 -0
- package/dist/schema/serialize.d.ts +96 -0
- package/dist/schema/serialize.js +231 -0
- package/dist/schema/sugar.d.ts +20 -3
- package/dist/schema/sugar.js +5 -1
- package/dist/schema/tenancy.d.ts +66 -0
- package/dist/schema/tenancy.js +58 -0
- package/dist/sync/HydrationCoordinator.d.ts +2 -0
- package/dist/sync/HydrationCoordinator.js +23 -17
- package/dist/sync/SyncWebSocket.d.ts +17 -0
- package/dist/sync/SyncWebSocket.js +46 -1
- package/dist/sync/awaitIntentGrant.d.ts +26 -0
- package/dist/sync/awaitIntentGrant.js +60 -0
- package/dist/sync/createIntentStream.d.ts +2 -1
- package/dist/sync/createIntentStream.js +89 -5
- package/dist/sync/createPresenceStream.js +1 -1
- package/dist/sync/participants.d.ts +2 -2
- package/dist/sync/participants.js +9 -18
- package/dist/types/global.d.ts +43 -52
- package/dist/types/global.js +16 -18
- package/dist/types/streams.d.ts +90 -42
- package/docs/api-keys.md +44 -0
- package/docs/api.md +72 -173
- package/docs/audit.md +5 -5
- package/docs/cli.md +212 -0
- package/docs/client-behavior.md +42 -43
- package/docs/coordination.md +343 -0
- package/docs/data-sources.md +16 -16
- package/docs/examples/agent-human.md +30 -32
- package/docs/examples/ai-sdk-tool.md +32 -33
- package/docs/examples/existing-python-backend.md +38 -36
- package/docs/examples/nextjs.md +24 -25
- package/docs/examples/scoped-agent.md +78 -0
- package/docs/examples/server-agent.md +20 -61
- package/docs/guarantees.md +34 -56
- package/docs/identity.md +529 -0
- package/docs/index.md +18 -24
- package/docs/integration-guide.md +130 -144
- package/docs/interaction-model.md +32 -95
- package/docs/mcp/claude-code.md +3 -3
- package/docs/mcp/cursor.md +1 -1
- package/docs/mcp/windsurf.md +1 -1
- package/docs/mcp.md +11 -26
- package/docs/quickstart.md +43 -49
- package/docs/react.md +74 -24
- package/docs/roadmap.md +17 -7
- package/llms.txt +34 -39
- package/package.json +8 -1
- package/dist/react/useMutate.d.ts +0 -83
- package/dist/react/useQuery.d.ts +0 -123
- package/dist/react/useQuery.js +0 -145
- package/dist/react/useReader.d.ts +0 -69
- package/docs/capabilities.md +0 -163
package/dist/client/Ablo.d.ts
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* const sync = Ablo({ schema, apiKey: process.env.ABLO_API_KEY });
|
|
12
12
|
*
|
|
13
|
-
* const
|
|
14
|
-
* await sync.
|
|
15
|
-
* await sync.
|
|
16
|
-
* await sync.
|
|
13
|
+
* const reports = sync.reports.list({ where: { status: 'todo' } });
|
|
14
|
+
* await sync.reports.create({ title: 'Fix bug' });
|
|
15
|
+
* await sync.reports.update(reportId, { status: 'ready' });
|
|
16
|
+
* await sync.reports.delete(reportId);
|
|
17
17
|
*/
|
|
18
18
|
import type { Schema, SchemaRecord, InferModel, InferCreate } from '../schema/schema.js';
|
|
19
19
|
import type { SyncEngineConfig, SyncLogger, MutationExecutor, MutationDispatcher, SyncObservabilityProvider, SyncAnalytics, SessionErrorDetector, OnlineStatusProvider } from '../interfaces/index.js';
|
|
@@ -76,7 +76,7 @@ import { type AbloPersistence } from './persistence.js';
|
|
|
76
76
|
export interface AbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
77
77
|
/**
|
|
78
78
|
* TypeScript schema defined with `defineSchema()`. Required — it's what
|
|
79
|
-
* makes `ablo.
|
|
79
|
+
* makes `ablo.weatherReports.update(...)` typed. This is the one field you must
|
|
80
80
|
* pass; start here.
|
|
81
81
|
*/
|
|
82
82
|
schema: Schema<S>;
|
|
@@ -104,20 +104,6 @@ export interface AbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
104
104
|
* Override the Ablo API base URL. Defaults to hosted production.
|
|
105
105
|
*/
|
|
106
106
|
baseURL?: string | null | undefined;
|
|
107
|
-
/**
|
|
108
|
-
* Maximum time (ms) to wait for a single request before timing out.
|
|
109
|
-
* Timed-out requests are retried, so worst-case wait can exceed this.
|
|
110
|
-
*
|
|
111
|
-
* @default 600_000
|
|
112
|
-
*/
|
|
113
|
-
timeout?: number | undefined;
|
|
114
|
-
/**
|
|
115
|
-
* Maximum retries on transient failure (network error / 5xx / 429).
|
|
116
|
-
* Honors `Retry-After`.
|
|
117
|
-
*
|
|
118
|
-
* @default 2
|
|
119
|
-
*/
|
|
120
|
-
maxRetries?: number | undefined;
|
|
121
107
|
/** Custom fetch implementation for tests, proxies, or non-standard runtimes. */
|
|
122
108
|
fetch?: typeof fetch | undefined;
|
|
123
109
|
/** Default headers sent with every API request. */
|
|
@@ -162,18 +148,6 @@ export interface InternalAbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
162
148
|
* URL for self-hosted or staging (e.g. `wss://mesh-staging.ablo.finance`).
|
|
163
149
|
*/
|
|
164
150
|
baseURL?: string | null | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* Maximum amount of time (ms) the client waits for a response
|
|
167
|
-
* before timing out a single request. Defaults to 10 minutes
|
|
168
|
-
* (600_000ms). Retried requests can wait longer in worst case.
|
|
169
|
-
*/
|
|
170
|
-
timeout?: number | undefined;
|
|
171
|
-
/**
|
|
172
|
-
* Maximum number of times the client will retry a request on
|
|
173
|
-
* transient failure (5xx / 429 / network error). Defaults to 2.
|
|
174
|
-
* Honors `Retry-After` and `retry-after-ms` response headers.
|
|
175
|
-
*/
|
|
176
|
-
maxRetries?: number | undefined;
|
|
177
151
|
/**
|
|
178
152
|
* Custom `fetch` implementation. Defaults to `globalThis.fetch`.
|
|
179
153
|
* Override for testing, custom transports, or runtime shims.
|
|
@@ -201,8 +175,8 @@ export interface InternalAbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
201
175
|
* TypeScript schema defined with `defineSchema()`.
|
|
202
176
|
*
|
|
203
177
|
* The root `Ablo(...)` client is schema-first so consumers get typed
|
|
204
|
-
* model
|
|
205
|
-
* only for the advanced
|
|
178
|
+
* model clients such as `ablo.weatherReports.update(...)`. Omit `schema`
|
|
179
|
+
* only for the advanced Model / Claim / Commit client.
|
|
206
180
|
*/
|
|
207
181
|
schema: Schema<S>;
|
|
208
182
|
/**
|
|
@@ -253,7 +227,7 @@ export interface InternalAbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
253
227
|
inMemory?: boolean;
|
|
254
228
|
/**
|
|
255
229
|
* If true, initialization starts immediately in the background so
|
|
256
|
-
* `sync.
|
|
230
|
+
* `sync.reports.findMany()` works after `await sync.ready()`.
|
|
257
231
|
*
|
|
258
232
|
* If false (default), the consumer MUST call `await sync.ready()` before
|
|
259
233
|
* using the engine — any query before that returns empty results.
|
|
@@ -268,7 +242,7 @@ export interface InternalAbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
268
242
|
* - `'full'`: pull every delta in the configured sync groups before
|
|
269
243
|
* `ready()` resolves. Default for `kind: 'user'`.
|
|
270
244
|
* - `'none'`: open the WS and process live deltas only — no baseline
|
|
271
|
-
* fetch. Reads round-trip via `
|
|
245
|
+
* fetch. Reads round-trip via `model.retrieve()`; subscriptions
|
|
272
246
|
* populate the pool lazily via covering deltas. Default for
|
|
273
247
|
* `kind: 'agent'` because agent-worker / routine runners don't
|
|
274
248
|
* need (or want) a local replica of the org's tenant plane.
|
|
@@ -357,52 +331,76 @@ export interface InternalAbloOptions<S extends SchemaRecord = SchemaRecord> {
|
|
|
357
331
|
* deprecated aliases for one release cycle so consumers can migrate
|
|
358
332
|
* without a flag day.
|
|
359
333
|
*/
|
|
360
|
-
export type { ModelCountOptions, ModelListOptions, ModelListScope, ModelLoadOptions,
|
|
334
|
+
export type { ModelCountOptions, ModelListOptions, ModelListScope, ModelLoadOptions, ClaimOptions, ClaimedRow, ModelOperations, } from './createModelProxy.js';
|
|
361
335
|
import type { ModelOperations } from './createModelProxy.js';
|
|
362
|
-
export type
|
|
336
|
+
export type ModelOperationAction = 'create' | 'update' | 'delete' | 'archive' | 'unarchive';
|
|
363
337
|
export type CommitWait = 'queued' | 'confirmed';
|
|
364
|
-
export interface
|
|
365
|
-
|
|
338
|
+
export interface ModelTarget {
|
|
339
|
+
/** The model name — matches `ablo.<model>` and the schema's `model()`. */
|
|
340
|
+
readonly model: string;
|
|
366
341
|
readonly id: string;
|
|
367
342
|
readonly path?: string;
|
|
368
343
|
readonly range?: TargetRange;
|
|
369
344
|
readonly field?: string;
|
|
370
345
|
readonly meta?: Record<string, unknown>;
|
|
371
346
|
}
|
|
372
|
-
export interface
|
|
347
|
+
export interface ModelClaim {
|
|
373
348
|
readonly id: string;
|
|
374
349
|
readonly actor: string;
|
|
375
350
|
readonly participantKind: ActiveIntent['participantKind'];
|
|
376
351
|
readonly action: string;
|
|
377
352
|
readonly field?: string;
|
|
353
|
+
readonly status?: 'active' | 'queued';
|
|
354
|
+
readonly position?: number;
|
|
378
355
|
readonly expiresAt: string;
|
|
379
|
-
readonly target:
|
|
356
|
+
readonly target: ModelTarget;
|
|
380
357
|
}
|
|
381
|
-
export interface
|
|
358
|
+
export interface ModelRead<T = Record<string, unknown>> {
|
|
382
359
|
readonly data: T;
|
|
383
360
|
readonly stamp: number;
|
|
384
|
-
readonly
|
|
361
|
+
readonly claims: readonly ModelClaim[];
|
|
385
362
|
}
|
|
386
|
-
export type
|
|
387
|
-
export interface
|
|
363
|
+
export type IfClaimedPolicy = 'return' | 'wait' | 'fail';
|
|
364
|
+
export interface ClaimedOptions {
|
|
388
365
|
/**
|
|
389
|
-
* What to do when another participant has
|
|
390
|
-
*
|
|
391
|
-
*
|
|
366
|
+
* What to do when another participant has claimed the target. `return`
|
|
367
|
+
* includes active claim metadata in the response, `wait` resolves after the
|
|
368
|
+
* claim clears, and `fail` throws `AbloClaimedError`.
|
|
392
369
|
*/
|
|
393
|
-
readonly
|
|
394
|
-
/** Max time to wait for peer
|
|
395
|
-
readonly
|
|
370
|
+
readonly ifClaimed?: IfClaimedPolicy;
|
|
371
|
+
/** Max time to wait for peer claims to clear, in milliseconds. */
|
|
372
|
+
readonly claimedTimeout?: number;
|
|
396
373
|
/** HTTP API polling interval while waiting. WebSocket clients ignore it. */
|
|
397
|
-
readonly
|
|
374
|
+
readonly claimedPollInterval?: number;
|
|
375
|
+
/**
|
|
376
|
+
* Backpressure for `ifClaimed: 'wait'`: reject instead of waiting if the
|
|
377
|
+
* row's FIFO line is already `>= maxQueueDepth` deep.
|
|
378
|
+
*/
|
|
379
|
+
readonly maxQueueDepth?: number;
|
|
398
380
|
}
|
|
399
381
|
export type { IntentWaitOptions } from '../types/streams.js';
|
|
400
|
-
export interface
|
|
382
|
+
export interface ModelReadOptions extends ClaimedOptions {
|
|
401
383
|
}
|
|
402
384
|
export interface IntentCreateOptions {
|
|
403
|
-
readonly target:
|
|
385
|
+
readonly target: ModelTarget;
|
|
404
386
|
readonly action: string;
|
|
405
387
|
readonly ttl?: Duration;
|
|
388
|
+
/**
|
|
389
|
+
* Join the server's fair FIFO queue when the target is already claimed,
|
|
390
|
+
* rather than failing immediately. `create` then resolves only once the
|
|
391
|
+
* lease is actually ours (the server pushes `intent_acquired` if the target
|
|
392
|
+
* was free, or `intent_granted` when we reach the head of the line). Without
|
|
393
|
+
* this, a contended claim throws. Used by `ablo.<model>.claim` so writers
|
|
394
|
+
* serialize instead of racing.
|
|
395
|
+
*/
|
|
396
|
+
readonly queue?: boolean;
|
|
397
|
+
/** Cap on how long to wait for a queued grant before rejecting. */
|
|
398
|
+
readonly waitTimeoutMs?: number;
|
|
399
|
+
/**
|
|
400
|
+
* Backpressure: reject with `AbloClaimedError('queue_too_deep')` instead of
|
|
401
|
+
* waiting if the queue is already `>= maxQueueDepth` when we join.
|
|
402
|
+
*/
|
|
403
|
+
readonly maxQueueDepth?: number;
|
|
406
404
|
}
|
|
407
405
|
export interface IntentHandle extends AsyncDisposable {
|
|
408
406
|
readonly id: string;
|
|
@@ -410,9 +408,10 @@ export interface IntentHandle extends AsyncDisposable {
|
|
|
410
408
|
revoke(): void;
|
|
411
409
|
}
|
|
412
410
|
export interface CommitOperationInput {
|
|
413
|
-
readonly action:
|
|
414
|
-
|
|
415
|
-
readonly
|
|
411
|
+
readonly action: ModelOperationAction;
|
|
412
|
+
/** The model name — matches `ablo.<model>` and the schema's `model()`. */
|
|
413
|
+
readonly model?: string;
|
|
414
|
+
readonly target?: ModelTarget;
|
|
416
415
|
readonly id?: string | null;
|
|
417
416
|
readonly data?: Record<string, unknown> | null;
|
|
418
417
|
readonly transactionId?: string | null;
|
|
@@ -429,7 +428,6 @@ export interface CommitCreateOptions {
|
|
|
429
428
|
readonly operation?: CommitOperationInput;
|
|
430
429
|
readonly operations?: readonly CommitOperationInput[];
|
|
431
430
|
readonly wait?: CommitWait;
|
|
432
|
-
readonly timeout?: number;
|
|
433
431
|
}
|
|
434
432
|
export interface CommitReceipt {
|
|
435
433
|
readonly id: string;
|
|
@@ -441,10 +439,10 @@ export interface CommitResource {
|
|
|
441
439
|
}
|
|
442
440
|
export interface IntentResource extends IntentStream {
|
|
443
441
|
create(options: IntentCreateOptions): Promise<IntentHandle>;
|
|
444
|
-
list(target?: Partial<
|
|
445
|
-
waitFor(target: Partial<
|
|
442
|
+
list(target?: Partial<ModelTarget>): readonly ModelClaim[];
|
|
443
|
+
waitFor(target: Partial<ModelTarget>, options?: IntentWaitOptions): Promise<void>;
|
|
446
444
|
}
|
|
447
|
-
export interface
|
|
445
|
+
export interface ModelMutationOptions extends ClaimedOptions {
|
|
448
446
|
readonly intent?: string | {
|
|
449
447
|
readonly id: string;
|
|
450
448
|
} | null;
|
|
@@ -452,15 +450,14 @@ export interface ResourceMutationOptions extends BusyOptions {
|
|
|
452
450
|
readonly readAt?: number | null;
|
|
453
451
|
readonly onStale?: 'reject' | 'force' | 'flag' | 'merge' | null;
|
|
454
452
|
readonly wait?: CommitWait;
|
|
455
|
-
readonly timeout?: number;
|
|
456
453
|
}
|
|
457
|
-
export interface
|
|
458
|
-
retrieve(id: string, options?:
|
|
459
|
-
create(data: Record<string, unknown>, options?:
|
|
454
|
+
export interface ModelClient<T = Record<string, unknown>> {
|
|
455
|
+
retrieve(id: string, options?: ModelReadOptions): Promise<ModelRead<T>>;
|
|
456
|
+
create(data: Record<string, unknown>, options?: ModelMutationOptions & {
|
|
460
457
|
readonly id?: string | null;
|
|
461
458
|
}): Promise<CommitReceipt>;
|
|
462
|
-
update(id: string, data: Record<string, unknown>, options?:
|
|
463
|
-
delete(id: string, options?:
|
|
459
|
+
update(id: string, data: Record<string, unknown>, options?: ModelMutationOptions): Promise<CommitReceipt>;
|
|
460
|
+
delete(id: string, options?: ModelMutationOptions): Promise<CommitReceipt>;
|
|
464
461
|
}
|
|
465
462
|
/** The typed sync engine client — one property per model in the schema */
|
|
466
463
|
export type Ablo<S extends SchemaRecord> = {
|
|
@@ -473,7 +470,7 @@ export type Ablo<S extends SchemaRecord> = {
|
|
|
473
470
|
* ```ts
|
|
474
471
|
* const sync = Ablo({ schema, user });
|
|
475
472
|
* await sync.ready();
|
|
476
|
-
* const
|
|
473
|
+
* const reports = sync.reports.findMany(); // data is available
|
|
477
474
|
* ```
|
|
478
475
|
*
|
|
479
476
|
* If bootstrap fails, this rejects with the underlying error (unreachable
|
|
@@ -494,9 +491,9 @@ export type Ablo<S extends SchemaRecord> = {
|
|
|
494
491
|
* offline, this waits until reconnect + flush completes.
|
|
495
492
|
*
|
|
496
493
|
* ```ts
|
|
497
|
-
* await sync.
|
|
498
|
-
* await sync.
|
|
499
|
-
* await sync.waitForFlush(); // server has both
|
|
494
|
+
* await sync.reports.create({ title: 'A' });
|
|
495
|
+
* await sync.reports.create({ title: 'B' });
|
|
496
|
+
* await sync.waitForFlush(); // server has both reports
|
|
500
497
|
* ```
|
|
501
498
|
*
|
|
502
499
|
* @param timeoutMs - Optional timeout. Default: no timeout (wait forever).
|
|
@@ -596,16 +593,16 @@ export type Ablo<S extends SchemaRecord> = {
|
|
|
596
593
|
*/
|
|
597
594
|
readonly intents: IntentResource;
|
|
598
595
|
/**
|
|
599
|
-
* Canonical low-level mutation API. Every
|
|
600
|
-
*
|
|
596
|
+
* Canonical low-level mutation API. Every untyped model write compiles
|
|
597
|
+
* down to `commits.create(...)`.
|
|
601
598
|
*/
|
|
602
599
|
readonly commits: CommitResource;
|
|
603
600
|
/**
|
|
604
|
-
* Canonical untyped
|
|
601
|
+
* Canonical untyped model API. This is the portable API shape that maps
|
|
605
602
|
* cleanly to HTTP/Python/Ruby/Go clients. Typed `ablo.<model>` properties
|
|
606
|
-
* are schema-powered sugar over the same
|
|
603
|
+
* are schema-powered sugar over the same model write/read path.
|
|
607
604
|
*/
|
|
608
|
-
|
|
605
|
+
model<T = Record<string, unknown>>(name: string): ModelClient<T>;
|
|
609
606
|
/**
|
|
610
607
|
* Canonical multiplayer participant surface. Joins a structured app
|
|
611
608
|
* target, derives the transport scope internally, opens a scoped
|
|
@@ -718,8 +715,8 @@ export declare function computeFKDepthPriority(schema: Schema): ReadonlyMap<stri
|
|
|
718
715
|
* ```ts
|
|
719
716
|
* const sync = Ablo({ schema, apiKey: process.env.ABLO_API_KEY });
|
|
720
717
|
*
|
|
721
|
-
* const
|
|
722
|
-
* await sync.
|
|
718
|
+
* const reports = sync.weatherReports.list({ where: { status: 'pending' } });
|
|
719
|
+
* await sync.weatherReports.create({ location: 'Stockholm', status: 'pending' });
|
|
723
720
|
* ```
|
|
724
721
|
*/
|
|
725
722
|
export declare function Ablo<const S extends SchemaRecord>(options: AbloOptions<S>): Ablo<S>;
|
|
@@ -759,9 +756,9 @@ export declare namespace Ablo {
|
|
|
759
756
|
type AgentRunStatus = import('./ApiClient.js').AgentRunStatus;
|
|
760
757
|
type AgentRunResult<T> = import('./ApiClient.js').AgentRunResult<T>;
|
|
761
758
|
type AgentRunContext = import('./ApiClient.js').AgentRunContext;
|
|
762
|
-
type
|
|
763
|
-
type
|
|
764
|
-
type
|
|
759
|
+
type AgentModelClient<T = Record<string, unknown>> = import('./ApiClient.js').AgentModelClient<T>;
|
|
760
|
+
type AgentModelReadOptions = import('./ApiClient.js').AgentModelReadOptions;
|
|
761
|
+
type AgentModelMutationOptions = import('./ApiClient.js').AgentModelMutationOptions;
|
|
765
762
|
type AgentIntentOptions = import('./ApiClient.js').AgentIntentOptions;
|
|
766
763
|
type AgentIntentInput = import('./ApiClient.js').AgentIntentInput;
|
|
767
764
|
type Capability = import('./ApiClient.js').Capability;
|
|
@@ -774,8 +771,8 @@ export declare namespace Ablo {
|
|
|
774
771
|
type TaskCloseOptions = import('./ApiClient.js').TaskCloseOptions;
|
|
775
772
|
type TaskCloseResult = import('./ApiClient.js').TaskCloseResult;
|
|
776
773
|
type TaskResource = import('./ApiClient.js').TaskResource;
|
|
777
|
-
type
|
|
778
|
-
type
|
|
774
|
+
type IfClaimedPolicy = import('./Ablo.js').IfClaimedPolicy;
|
|
775
|
+
type ClaimedOptions = import('./Ablo.js').ClaimedOptions;
|
|
779
776
|
type EntityRef = _Streams.EntityRef;
|
|
780
777
|
type PresenceTarget = _Streams.PresenceTarget;
|
|
781
778
|
type TargetRange = _Streams.TargetRange;
|
|
@@ -787,6 +784,7 @@ export declare namespace Ablo {
|
|
|
787
784
|
type ActiveIntent = _Streams.ActiveIntent;
|
|
788
785
|
type Claim = _Streams.Claim;
|
|
789
786
|
type IntentRejection = _Streams.IntentRejection;
|
|
787
|
+
type IntentLost = _Streams.IntentLost;
|
|
790
788
|
type Snapshot<TSchema extends _SchemaTypes.Schema = _SchemaTypes.Schema, K extends keyof TSchema['models'] = keyof TSchema['models']> = _Streams.Snapshot<TSchema, K>;
|
|
791
789
|
type Turn = import('./Ablo.js').Turn;
|
|
792
790
|
namespace Auth {
|
|
@@ -817,25 +815,25 @@ export declare namespace Ablo {
|
|
|
817
815
|
}
|
|
818
816
|
namespace Commit {
|
|
819
817
|
type Wait = import('./Ablo.js').CommitWait;
|
|
820
|
-
type OperationAction = import('./Ablo.js').
|
|
818
|
+
type OperationAction = import('./Ablo.js').ModelOperationAction;
|
|
821
819
|
type OperationInput = import('./Ablo.js').CommitOperationInput;
|
|
822
820
|
type CreateOptions = import('./Ablo.js').CommitCreateOptions;
|
|
823
821
|
type Receipt = import('./Ablo.js').CommitReceipt;
|
|
824
|
-
type
|
|
822
|
+
type Client = import('./Ablo.js').CommitResource;
|
|
825
823
|
}
|
|
826
824
|
namespace Intent {
|
|
827
825
|
type Handle = import('./Ablo.js').IntentHandle;
|
|
828
826
|
type CreateOptions = import('./Ablo.js').IntentCreateOptions;
|
|
829
827
|
type WaitOptions = import('./Ablo.js').IntentWaitOptions;
|
|
830
|
-
type
|
|
828
|
+
type Client = import('./Ablo.js').IntentResource;
|
|
831
829
|
}
|
|
832
|
-
namespace
|
|
833
|
-
type Target = import('./Ablo.js').
|
|
834
|
-
type
|
|
835
|
-
type Read<T = Record<string, unknown>> = import('./Ablo.js').
|
|
836
|
-
type Client<T = Record<string, unknown>> = import('./Ablo.js').
|
|
837
|
-
type ReadOptions = import('./Ablo.js').
|
|
838
|
-
type MutationOptions = import('./Ablo.js').
|
|
830
|
+
namespace Model {
|
|
831
|
+
type Target = import('./Ablo.js').ModelTarget;
|
|
832
|
+
type Claim = import('./Ablo.js').ModelClaim;
|
|
833
|
+
type Read<T = Record<string, unknown>> = import('./Ablo.js').ModelRead<T>;
|
|
834
|
+
type Client<T = Record<string, unknown>> = import('./Ablo.js').ModelClient<T>;
|
|
835
|
+
type ReadOptions = import('./Ablo.js').ModelReadOptions;
|
|
836
|
+
type MutationOptions = import('./Ablo.js').ModelMutationOptions;
|
|
839
837
|
}
|
|
840
838
|
namespace Source {
|
|
841
839
|
type Operation = import('../source/index.js').SourceOperation;
|