@abloatai/ablo 0.11.0 → 0.11.2
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 +58 -0
- package/README.md +72 -25
- package/dist/Model.d.ts +39 -0
- package/dist/Model.js +68 -0
- package/dist/auth/credentialPolicy.d.ts +145 -0
- package/dist/auth/credentialPolicy.js +130 -0
- package/dist/cli.cjs +154 -25
- package/dist/client/Ablo.d.ts +39 -88
- package/dist/client/Ablo.js +54 -99
- package/dist/client/ApiClient.d.ts +10 -1
- package/dist/client/ApiClient.js +23 -12
- package/dist/client/auth.d.ts +21 -9
- package/dist/client/auth.js +42 -6
- package/dist/client/createModelProxy.d.ts +74 -10
- package/dist/client/createModelProxy.js +85 -4
- package/dist/client/httpClient.d.ts +17 -3
- package/dist/client/httpClient.js +1 -0
- package/dist/client/identity.js +134 -122
- package/dist/client/index.d.ts +1 -1
- package/dist/client/sessionMint.d.ts +15 -0
- package/dist/client/sessionMint.js +86 -0
- package/dist/errorCodes.d.ts +2 -0
- package/dist/errorCodes.js +3 -1
- package/dist/errors.d.ts +3 -2
- package/dist/errors.js +3 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -7
- package/dist/mutators/RecordingTransaction.js +14 -42
- package/dist/react/AbloProvider.d.ts +1 -6
- package/dist/react/AbloProvider.js +1 -5
- package/dist/react/context.d.ts +1 -31
- package/dist/react/context.js +2 -2
- package/dist/react/index.d.ts +0 -6
- package/dist/react/index.js +0 -7
- package/dist/react/useSyncStatus.d.ts +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/schema/generate.js +1 -2
- package/dist/schema/schema.d.ts +16 -5
- package/dist/schema/schema.js +26 -0
- package/dist/surface.d.ts +29 -0
- package/dist/surface.js +60 -0
- package/dist/sync/ConnectionManager.d.ts +16 -5
- package/dist/sync/ConnectionManager.js +42 -7
- package/dist/transactions/TransactionQueue.js +22 -10
- package/dist/types/global.d.ts +11 -3
- package/dist/types/global.js +8 -3
- package/dist/types/streams.d.ts +0 -22
- package/dist/utils/mobx-setup.js +1 -0
- package/docs/api-keys.md +49 -0
- package/docs/api.md +6 -5
- package/docs/client-behavior.md +7 -3
- package/docs/coordination.md +88 -24
- package/docs/data-sources.md +29 -9
- package/docs/examples/existing-python-backend.md +9 -5
- package/docs/examples/scoped-agent.md +1 -1
- package/docs/guarantees.md +4 -3
- package/docs/identity.md +89 -82
- package/docs/integration-guide.md +19 -10
- package/docs/migration.md +49 -2
- package/docs/quickstart.md +65 -33
- package/docs/react.md +49 -3
- package/docs/schema-contract.md +23 -5
- package/llms-full.txt +43 -24
- package/llms.txt +17 -15
- package/package.json +1 -1
- package/dist/api/index.d.ts +0 -10
- package/dist/api/index.js +0 -9
- package/dist/principal.d.ts +0 -44
- package/dist/principal.js +0 -49
- package/dist/react/SyncGroupProvider.d.ts +0 -19
- package/dist/react/SyncGroupProvider.js +0 -44
- package/dist/react/useClaim.d.ts +0 -29
- package/dist/react/useClaim.js +0 -42
- package/dist/react/usePresence.d.ts +0 -32
- package/dist/react/usePresence.js +0 -41
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { ResolvePresence } from '../types/global.js';
|
|
2
|
-
/**
|
|
3
|
-
* Read the consumer-supplied presence state with `ResolvePresence`d
|
|
4
|
-
* typing — the shape the consumer declared in
|
|
5
|
-
* `declare module '@abloatai/ablo' { interface Register { Presence: ... } }`.
|
|
6
|
-
*
|
|
7
|
-
* The SDK doesn't own a presence wire format. Consumers plug whatever
|
|
8
|
-
* backs their cursors, status, or activity (a MobX store, a custom
|
|
9
|
-
* WebSocket channel, `SyncAgent` in Node, a Zustand slice) via the
|
|
10
|
-
* `presence` prop on `SyncProvider`. This hook returns it typed.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* // apps/your-app/src/ablo-sync.d.ts
|
|
14
|
-
* declare module '@abloatai/ablo' {
|
|
15
|
-
* interface Register {
|
|
16
|
-
* Presence: { cursor: { x: number; y: number } | null; status: 'away' | 'online' };
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* // consumer's <SyncProvider> wiring
|
|
21
|
-
* <SyncProvider store={store} organizationId={orgId} presence={presenceStore}>
|
|
22
|
-
*
|
|
23
|
-
* // any component
|
|
24
|
-
* const presence = usePresence();
|
|
25
|
-
* presence?.cursor?.x; // fully typed
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* Returns `undefined` when no provider-level presence source is wired —
|
|
29
|
-
* consumers can narrow with a guard or configure a default in their
|
|
30
|
-
* provider.
|
|
31
|
-
*/
|
|
32
|
-
export declare function usePresence(): ResolvePresence | undefined;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useSyncContext } from './context.js';
|
|
3
|
-
/**
|
|
4
|
-
* Read the consumer-supplied presence state with `ResolvePresence`d
|
|
5
|
-
* typing — the shape the consumer declared in
|
|
6
|
-
* `declare module '@abloatai/ablo' { interface Register { Presence: ... } }`.
|
|
7
|
-
*
|
|
8
|
-
* The SDK doesn't own a presence wire format. Consumers plug whatever
|
|
9
|
-
* backs their cursors, status, or activity (a MobX store, a custom
|
|
10
|
-
* WebSocket channel, `SyncAgent` in Node, a Zustand slice) via the
|
|
11
|
-
* `presence` prop on `SyncProvider`. This hook returns it typed.
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* // apps/your-app/src/ablo-sync.d.ts
|
|
15
|
-
* declare module '@abloatai/ablo' {
|
|
16
|
-
* interface Register {
|
|
17
|
-
* Presence: { cursor: { x: number; y: number } | null; status: 'away' | 'online' };
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* // consumer's <SyncProvider> wiring
|
|
22
|
-
* <SyncProvider store={store} organizationId={orgId} presence={presenceStore}>
|
|
23
|
-
*
|
|
24
|
-
* // any component
|
|
25
|
-
* const presence = usePresence();
|
|
26
|
-
* presence?.cursor?.x; // fully typed
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* Returns `undefined` when no provider-level presence source is wired —
|
|
30
|
-
* consumers can narrow with a guard or configure a default in their
|
|
31
|
-
* provider.
|
|
32
|
-
*/
|
|
33
|
-
export function usePresence() {
|
|
34
|
-
const ctx = useSyncContext();
|
|
35
|
-
// The runtime value is whatever the consumer passed to `SyncProvider`.
|
|
36
|
-
// The type assertion reflects the consumer's declared global, which
|
|
37
|
-
// the hook can't verify at runtime — but the consumer controls both
|
|
38
|
-
// ends (the registration and the provider prop) so this is a
|
|
39
|
-
// single-source-of-truth contract, not blind trust.
|
|
40
|
-
return ctx.presence;
|
|
41
|
-
}
|