@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +72 -25
  3. package/dist/Model.d.ts +39 -0
  4. package/dist/Model.js +68 -0
  5. package/dist/auth/credentialPolicy.d.ts +145 -0
  6. package/dist/auth/credentialPolicy.js +130 -0
  7. package/dist/cli.cjs +154 -25
  8. package/dist/client/Ablo.d.ts +39 -88
  9. package/dist/client/Ablo.js +54 -99
  10. package/dist/client/ApiClient.d.ts +10 -1
  11. package/dist/client/ApiClient.js +23 -12
  12. package/dist/client/auth.d.ts +21 -9
  13. package/dist/client/auth.js +42 -6
  14. package/dist/client/createModelProxy.d.ts +74 -10
  15. package/dist/client/createModelProxy.js +85 -4
  16. package/dist/client/httpClient.d.ts +17 -3
  17. package/dist/client/httpClient.js +1 -0
  18. package/dist/client/identity.js +134 -122
  19. package/dist/client/index.d.ts +1 -1
  20. package/dist/client/sessionMint.d.ts +15 -0
  21. package/dist/client/sessionMint.js +86 -0
  22. package/dist/errorCodes.d.ts +2 -0
  23. package/dist/errorCodes.js +3 -1
  24. package/dist/errors.d.ts +3 -2
  25. package/dist/errors.js +3 -2
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.js +4 -7
  28. package/dist/mutators/RecordingTransaction.js +14 -42
  29. package/dist/react/AbloProvider.d.ts +1 -6
  30. package/dist/react/AbloProvider.js +1 -5
  31. package/dist/react/context.d.ts +1 -31
  32. package/dist/react/context.js +2 -2
  33. package/dist/react/index.d.ts +0 -6
  34. package/dist/react/index.js +0 -7
  35. package/dist/react/useSyncStatus.d.ts +1 -1
  36. package/dist/realtime/index.d.ts +1 -1
  37. package/dist/schema/generate.js +1 -2
  38. package/dist/schema/schema.d.ts +16 -5
  39. package/dist/schema/schema.js +26 -0
  40. package/dist/surface.d.ts +29 -0
  41. package/dist/surface.js +60 -0
  42. package/dist/sync/ConnectionManager.d.ts +16 -5
  43. package/dist/sync/ConnectionManager.js +42 -7
  44. package/dist/transactions/TransactionQueue.js +22 -10
  45. package/dist/types/global.d.ts +11 -3
  46. package/dist/types/global.js +8 -3
  47. package/dist/types/streams.d.ts +0 -22
  48. package/dist/utils/mobx-setup.js +1 -0
  49. package/docs/api-keys.md +49 -0
  50. package/docs/api.md +6 -5
  51. package/docs/client-behavior.md +7 -3
  52. package/docs/coordination.md +88 -24
  53. package/docs/data-sources.md +29 -9
  54. package/docs/examples/existing-python-backend.md +9 -5
  55. package/docs/examples/scoped-agent.md +1 -1
  56. package/docs/guarantees.md +4 -3
  57. package/docs/identity.md +89 -82
  58. package/docs/integration-guide.md +19 -10
  59. package/docs/migration.md +49 -2
  60. package/docs/quickstart.md +65 -33
  61. package/docs/react.md +49 -3
  62. package/docs/schema-contract.md +23 -5
  63. package/llms-full.txt +43 -24
  64. package/llms.txt +17 -15
  65. package/package.json +1 -1
  66. package/dist/api/index.d.ts +0 -10
  67. package/dist/api/index.js +0 -9
  68. package/dist/principal.d.ts +0 -44
  69. package/dist/principal.js +0 -49
  70. package/dist/react/SyncGroupProvider.d.ts +0 -19
  71. package/dist/react/SyncGroupProvider.js +0 -44
  72. package/dist/react/useClaim.d.ts +0 -29
  73. package/dist/react/useClaim.js +0 -42
  74. package/dist/react/usePresence.d.ts +0 -32
  75. 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
- }