clivly 0.8.0 → 0.9.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 (114) hide show
  1. package/README.md +330 -134
  2. package/core-drizzle.cjs +3 -1
  3. package/core-drizzle.d.cts +3 -2
  4. package/core-drizzle.d.mts +3 -2
  5. package/core-drizzle.mjs +2 -2
  6. package/core-entity-config.cjs +1 -1
  7. package/core-entity-config.d.cts +2 -2
  8. package/core-entity-config.d.mts +2 -2
  9. package/core-entity-config.mjs +1 -1
  10. package/core-entity-heuristics.d.cts +3 -2
  11. package/core-entity-heuristics.d.mts +3 -2
  12. package/core-mapping-form.d.cts +1 -1
  13. package/core-mapping-form.d.mts +1 -1
  14. package/core-mappings-config.cjs +1 -1
  15. package/core-mappings-config.d.cts +1 -1
  16. package/core-mappings-config.d.mts +1 -1
  17. package/core-mappings-config.mjs +1 -1
  18. package/core-sync-engine.cjs +1 -1
  19. package/core-sync-engine.d.cts +1 -1
  20. package/core-sync-engine.d.mts +1 -1
  21. package/core-sync-engine.mjs +1 -1
  22. package/core-view-compiler.cjs +1 -1
  23. package/core-view-compiler.d.cts +1 -1
  24. package/core-view-compiler.d.mts +1 -1
  25. package/core-view-compiler.mjs +1 -1
  26. package/core.cjs +21 -5
  27. package/core.d.cts +7 -6
  28. package/core.d.mts +7 -6
  29. package/core.mjs +7 -6
  30. package/drizzle-3kvhkwO7.mjs +110 -0
  31. package/drizzle-BhN5M9zt.d.cts +41 -0
  32. package/drizzle-bfjVzYR6.cjs +127 -0
  33. package/drizzle-kBULBAOa.d.mts +41 -0
  34. package/drizzle.cjs +12 -40
  35. package/drizzle.d.cts +3 -11
  36. package/drizzle.d.mts +3 -11
  37. package/drizzle.mjs +12 -41
  38. package/{entity-config-DoUCXtq5.d.cts → entity-config-C4Yf_fPj.d.cts} +120 -1
  39. package/{entity-config-DoUCXtq5.d.mts → entity-config-C4Yf_fPj.d.mts} +120 -1
  40. package/entity-config-CsLl-ftC.cjs +727 -0
  41. package/entity-config-D3LmzgLb.mjs +612 -0
  42. package/index.cjs +764 -120
  43. package/index.d.cts +12 -0
  44. package/index.d.mts +12 -0
  45. package/index.mjs +765 -121
  46. package/internal-B8ydhsKd.d.cts +73 -0
  47. package/internal-BARjyN4n.cjs +97 -0
  48. package/internal-DMySVbM0.mjs +68 -0
  49. package/internal-MBkNo3bw.d.mts +73 -0
  50. package/internal-drizzle.cjs +3 -1
  51. package/internal-drizzle.d.cts +2 -2
  52. package/internal-drizzle.d.mts +2 -2
  53. package/internal-drizzle.mjs +2 -2
  54. package/internal-entity-config.cjs +1 -1
  55. package/internal-entity-config.d.cts +2 -2
  56. package/internal-entity-config.d.mts +2 -2
  57. package/internal-entity-config.mjs +1 -1
  58. package/internal-entity-heuristics.cjs +28 -8
  59. package/internal-entity-heuristics.d.cts +2 -12
  60. package/internal-entity-heuristics.d.mts +2 -12
  61. package/internal-entity-heuristics.mjs +28 -8
  62. package/internal-mapping-form.d.cts +1 -1
  63. package/internal-mapping-form.d.mts +1 -1
  64. package/internal-mappings-config.cjs +1 -1
  65. package/internal-mappings-config.d.cts +1 -1
  66. package/internal-mappings-config.d.mts +1 -1
  67. package/internal-mappings-config.mjs +1 -1
  68. package/internal-sync-engine.cjs +1 -1
  69. package/internal-sync-engine.d.cts +1 -1
  70. package/internal-sync-engine.d.mts +1 -1
  71. package/internal-sync-engine.mjs +1 -1
  72. package/internal-view-compiler.cjs +1 -1
  73. package/internal-view-compiler.d.cts +1 -1
  74. package/internal-view-compiler.d.mts +1 -1
  75. package/internal-view-compiler.mjs +1 -1
  76. package/internal.cjs +21 -4
  77. package/internal.d.cts +7 -6
  78. package/internal.d.mts +7 -6
  79. package/internal.mjs +7 -5
  80. package/{mapping-form-D93lhHEc.d.mts → mapping-form-43bwOTat.d.cts} +1 -1
  81. package/{mapping-form-lfyEE7EJ.d.cts → mapping-form-DUvWUYCo.d.mts} +1 -1
  82. package/{mappings-config-BsRADNRv.cjs → mappings-config-BSSwdHiq.cjs} +32 -6
  83. package/mappings-config-BpcR8bBo.d.mts +167 -0
  84. package/{mappings-config-Dbgxx3Nv.mjs → mappings-config-bJQT_gSa.mjs} +32 -6
  85. package/mappings-config-xsLMn3I-.d.cts +167 -0
  86. package/namespace-probe-BSH_p9TK.d.cts +381 -0
  87. package/namespace-probe-Dsp5uNkS.d.mts +381 -0
  88. package/package.json +1 -1
  89. package/{entity-config-va2bkH5o.mjs → projection-C5244vGa.cjs} +130 -309
  90. package/{entity-config-D87rV-tE.cjs → projection-D7xmQP4S.mjs} +60 -381
  91. package/{sdk-iqOXeWIp.cjs → sdk-Bj-ZDf4u.cjs} +126 -28
  92. package/{sdk-C6WANW8M.mjs → sdk-BvRD2jAp.mjs} +126 -28
  93. package/sdk.cjs +2 -2
  94. package/sdk.d.cts +36 -1
  95. package/sdk.d.mts +36 -1
  96. package/sdk.mjs +2 -2
  97. package/{sync-engine-Do5ru3WF.mjs → sync-engine-Bg6-SznL.mjs} +9 -2
  98. package/{sync-engine-CzEbpQGv.cjs → sync-engine-DEJvKw6E.cjs} +9 -2
  99. package/{sync-engine-DGk_AeHJ.d.mts → sync-engine-GNqRB8eS.d.cts} +2 -2
  100. package/{sync-engine-B7QIbXro.d.cts → sync-engine-ZsusW-q_.d.mts} +2 -2
  101. package/{view-compiler-BWz0sGdm.d.cts → view-compiler-Cin0neDO.d.mts} +1 -1
  102. package/{view-compiler-ChWr_Lml.mjs → view-compiler-DlTpOfZi.mjs} +81 -12
  103. package/{view-compiler-BIwvm-o2.cjs → view-compiler-DplczSjF.cjs} +81 -12
  104. package/{view-compiler-Bn_EJJMO.d.mts → view-compiler-Ll9cbIJz.d.cts} +1 -1
  105. package/vite.d.cts +1 -1
  106. package/vite.d.mts +1 -1
  107. package/drizzle-B89tLo4T.mjs +0 -31
  108. package/drizzle-CFOr9dU9.d.mts +0 -20
  109. package/drizzle-DiReZf6d.cjs +0 -36
  110. package/drizzle-DmeKSqeF.d.cts +0 -20
  111. package/mappings-config-DsUa7-1w.d.mts +0 -41
  112. package/mappings-config-XmzB4dag.d.cts +0 -41
  113. package/types-CsL0rFYh.d.cts +0 -155
  114. package/types-CsL0rFYh.d.mts +0 -155
@@ -0,0 +1,381 @@
1
+ import { a as ClivlyEntitiesConfig } from "./entity-config-C4Yf_fPj.mjs";
2
+ //#region ../sdk/src/drizzle-meta.d.ts
3
+ declare const DRIZZLE_META: "__clivly_drizzle_source_meta__";
4
+ interface DrizzleSourceMeta {
5
+ /** Drizzle property keys of every column on the source table. */
6
+ columnKeys: string[];
7
+ /** Schema-v2 typed column metadata derived from the Drizzle table. */
8
+ columnsMeta?: DiscoveredColumn[];
9
+ cursorField: string;
10
+ idField: string;
11
+ /** The backing table's real name, so discovery can key metadata by table. */
12
+ tableName?: string;
13
+ /** Every unique key on the table, each as its DB column names. */
14
+ uniqueConstraints?: string[][];
15
+ }
16
+ //#endregion
17
+ //#region ../sdk/src/types.d.ts
18
+ interface DiscoveredColumn {
19
+ isForeignKey?: boolean;
20
+ isPrimaryKey?: boolean;
21
+ name: string;
22
+ nullable?: boolean;
23
+ /** The column this FK points at, when it is a foreign key. */
24
+ references?: {
25
+ table: string;
26
+ column: string;
27
+ };
28
+ /** SQL/driver type, e.g. "text", "integer", "timestamp". */
29
+ type?: string;
30
+ }
31
+ interface DiscoveredTable {
32
+ columns: string[];
33
+ /** Schema-v2 typed column metadata (types, PK/FK, nullability). */
34
+ columnsMeta?: DiscoveredColumn[];
35
+ name: string;
36
+ /** Approximate source row count, when cheaply derivable. */
37
+ rowCount?: number;
38
+ /**
39
+ * Every unique key on the table, each as its DB column names. Primary keys
40
+ * are included (a PK is a unique key). Absent on v1 hosts and for
41
+ * hand-declared tables — consumers must treat absence as "unknown", never
42
+ * as "no unique keys".
43
+ */
44
+ uniqueConstraints?: string[][];
45
+ }
46
+ interface ClivlySDKConfig {
47
+ /** Org-scoped API token (sk_live_…) from Settings → API keys. */
48
+ apiKey: string;
49
+ /** Clivly API base URL. Defaults to https://api.clivly.com. */
50
+ apiUrl?: string;
51
+ /**
52
+ * The host table Clivly treats as the contact entity.
53
+ * @deprecated Prefer `entities` — the same mapping-derived shape
54
+ * `crm_entity_mappings` (and `@clivly/core`'s `mappingsToEntitiesConfig`)
55
+ * produce, so the SDK, the mappings table, and the sync engine share one
56
+ * model. A bare `contactEntity` is treated as a single contact entity.
57
+ */
58
+ contactEntity?: string;
59
+ /** Which columns of the contact entity Clivly may read. */
60
+ contactFields?: string[];
61
+ /**
62
+ * Where per-entity delta cursors are persisted between syncs. Defaults to an
63
+ * in-memory store (fine for a long-lived process). On serverless/edge, pass a
64
+ * store backed by your own KV/DB so a cold start resumes delta sync instead of
65
+ * re-paging the whole entity. See `CursorStore`.
66
+ */
67
+ cursorStore?: CursorStore;
68
+ /**
69
+ * Declarative entity config — the single source of truth shared with
70
+ * `crm_entity_mappings`. When set, discovery and heartbeat are derived from
71
+ * it (each entity's `source` table + mapped columns), superseding the flat
72
+ * `contactEntity`.
73
+ */
74
+ entities?: ClivlyEntitiesConfig;
75
+ /**
76
+ * Environment to read platform variables from when discovering the public
77
+ * trigger URL. Defaults to `process.env`. Injectable so tests and non-Node
78
+ * runtimes can supply their own.
79
+ */
80
+ env?: Record<string, string | undefined>;
81
+ /**
82
+ * 🚧 Not implemented in 0.1.x. Reserved options for tunnel mode and CRM
83
+ * write-back — they have NO effect yet and land with the Cloudflare
84
+ * infrastructure. Grouped under `experimental` so the stable config surface
85
+ * above is unambiguous; nothing here is part of the supported API.
86
+ */
87
+ experimental?: {
88
+ /** Cloudflare Tunnel token — reserved for tunnel mode. Not wired up yet. */
89
+ tunnelToken?: string;
90
+ /** CRM write-back target — reserved. Not wired up yet. */
91
+ writeBack?: {
92
+ enabled?: boolean;
93
+ /** Only crm_* tables are ever accepted; this narrows further. */
94
+ tables?: string[];
95
+ };
96
+ };
97
+ /** Reported to the portal so it can show the detected stack. */
98
+ framework?: string;
99
+ /** Heartbeat cadence in ms. Defaults to 60s. */
100
+ heartbeatIntervalMs?: number;
101
+ /**
102
+ * Optional live namespace probe, used on-demand by `doctor()`'s "Namespace
103
+ * reachable" check to verify every required source table + column is
104
+ * genuinely reachable. Not consulted by the heartbeat. Build one with
105
+ * `drizzleIntrospector(db)` from `@clivly/sdk/drizzle`.
106
+ */
107
+ introspector?: NamespaceIntrospector;
108
+ /**
109
+ * Self-reported readiness sent on every heartbeat as-is (no live check).
110
+ * For a real reachability check, configure `introspector` and run
111
+ * `doctor()`.
112
+ */
113
+ namespaceReady?: boolean;
114
+ orm?: string;
115
+ /**
116
+ * Network retry policy for outbound calls (heartbeat + sync push). Transient
117
+ * failures (network errors, HTTP 429, HTTP 5xx) are retried with exponential
118
+ * backoff + jitter; a `Retry-After` header on a 429 is honoured. Non-transient
119
+ * responses (e.g. 4xx other than 429) are returned immediately, not retried.
120
+ */
121
+ retry?: {
122
+ /** Total attempts including the first. Defaults to 3. Min 1. */
123
+ maxAttempts?: number;
124
+ /** Base backoff in ms (doubled each attempt). Defaults to 500. */
125
+ baseDelayMs?: number;
126
+ };
127
+ /** Tables/columns to report for entity discovery + mapping. */
128
+ schema?: DiscoveredTable[];
129
+ sdkVersion?: string;
130
+ /** Host entities to mirror into Clivly Cloud. */
131
+ source?: {
132
+ contacts: SyncSource;
133
+ companies?: SyncSource;
134
+ deals?: SyncSource;
135
+ /** Org-defined custom objects to mirror. Each carries its object-type slug. */
136
+ custom?: Array<SyncSource & {
137
+ objectType: string;
138
+ }>;
139
+ };
140
+ sync?: {
141
+ onBoot?: boolean;
142
+ /**
143
+ * Sync cadence in ms for the background keep-alive loop. Defaults to
144
+ * `heartbeatIntervalMs` (60s) so sync and heartbeat share a tick unless you
145
+ * decouple them — e.g. a slow full-mirror alongside frequent heartbeats.
146
+ */
147
+ intervalMs?: number;
148
+ batchSize?: number;
149
+ };
150
+ /**
151
+ * The remote sync trigger: how Clivly Cloud asks this app to run a sync.
152
+ *
153
+ * Without it, cloud mode is push-only — Clivly can watch the app but can't
154
+ * start anything, so the dashboard's "Run sync" has nothing to call. With it,
155
+ * the SDK reports `url` on each heartbeat and requires every trigger request to
156
+ * be signed with `secret`.
157
+ */
158
+ syncTrigger?: {
159
+ /**
160
+ * Public URL of the route where `createClivlyHandler()` is mounted, e.g.
161
+ * `https://app.example.com/api/clivly/tick`. Reported to Clivly on each
162
+ * heartbeat; a URL set in the dashboard overrides it.
163
+ *
164
+ * Optional — leave it unset and the SDK discovers the URL itself, from the
165
+ * hosting platform's environment or from the first request the route
166
+ * serves. Set it only to pin an address the SDK can't infer.
167
+ */
168
+ url?: string;
169
+ /**
170
+ * Path where `createClivlyHandler()` is mounted, e.g. `/api/clivly/tick`.
171
+ * Written by `clivly init`. Combined with the origin detected from the
172
+ * hosting platform so the SDK can report a trigger URL on its very first
173
+ * heartbeat, before any request has arrived to observe.
174
+ */
175
+ path?: string;
176
+ /**
177
+ * Signing secret (`whsec_…`) issued by Clivly under Integrations → Remote
178
+ * sync. When set, `createClivlyHandler()` rejects any request that isn't
179
+ * validly signed. Leave unset only if the route is already unreachable from
180
+ * the public internet.
181
+ */
182
+ secret?: string;
183
+ };
184
+ /**
185
+ * Shared secret Clivly Cloud presents (as `Authorization: Bearer <token>`) when
186
+ * calling the `/clivly/auth/verify` endpoint. Required for the verify handler to
187
+ * authenticate the caller; without it the handler fails closed (HTTP 503). No
188
+ * cloud consumer calls this endpoint yet — it is an inert primitive reserved for
189
+ * a future CRM/dashboard auth-passthrough.
190
+ */
191
+ verifyToken?: string;
192
+ }
193
+ interface ClivlyUser {
194
+ email: string;
195
+ id: string;
196
+ name?: string;
197
+ }
198
+ interface ChatWidgetVisitor {
199
+ email: string;
200
+ name: string;
201
+ }
202
+ interface ChatSessionRequestBody {
203
+ visitor: ChatWidgetVisitor;
204
+ visitorToken?: string | null;
205
+ widgetId: string;
206
+ }
207
+ interface CreateChatSessionHandlerOptions {
208
+ allowedOrigins?: string[];
209
+ apiKey: string;
210
+ apiUrl?: string;
211
+ fetchImpl?: typeof fetch;
212
+ /**
213
+ * Optional host-auth hook. When provided, it runs on the incoming browser
214
+ * request (session cookies intact) and, on a non-null `ClivlyUser`, the host
215
+ * vouches for that verified identity to Clivly Cloud. Absent/null/throwing =
216
+ * the visitor stays self-reported. Never fails the session.
217
+ */
218
+ resolveUser?: (req: Request) => Promise<ClivlyUser | null> | ClivlyUser | null;
219
+ }
220
+ interface DoctorCheck {
221
+ /** Human-readable outcome — what passed, or why it failed. */
222
+ detail: string;
223
+ /** Short label, e.g. "API key present". */
224
+ name: string;
225
+ /** True when the check passed. Ignored when `skipped` is true. */
226
+ ok: boolean;
227
+ /** True when the check could not run (e.g. a hand-written source). */
228
+ skipped?: boolean;
229
+ /**
230
+ * True when the setup works but carries a risk worth stating.
231
+ *
232
+ * Distinct from `ok: false`, which means "this is broken, fix it before you
233
+ * rely on it". A warning is for a configuration that will run and sync, yet
234
+ * behaves in a way the developer probably did not intend — the cursor check
235
+ * below is the motivating case: syncing from an `id` column succeeds, mirrors
236
+ * every insert, and silently never re-syncs an edited row.
237
+ *
238
+ * Warnings do not fail `doctor`. Reporting them as failures would train
239
+ * people to ignore a red ladder on a working setup, which is worse than not
240
+ * reporting them at all.
241
+ */
242
+ warn?: boolean;
243
+ }
244
+ interface DoctorReport {
245
+ checks: DoctorCheck[];
246
+ /** AND of every non-skipped check's `ok`. */
247
+ ok: boolean;
248
+ }
249
+ type ClivlyConnectReason = "ok" | "invalid_api_key" | "forbidden" | "rate_limited" | "server_error" | "client_error" | "server_too_old" | "network_error";
250
+ interface ClivlyConnectResult {
251
+ /**
252
+ * When the org's app last heartbeated, or null if it never has. Set only by
253
+ * `ping()` — `connect()` IS a heartbeat, so the question is meaningless there.
254
+ */
255
+ appLastSeenAt?: string | null;
256
+ ok: boolean;
257
+ /** Org resolved from a successful heartbeat, when the server returns it. */
258
+ org?: {
259
+ id?: string;
260
+ name?: string;
261
+ };
262
+ reason: ClivlyConnectReason;
263
+ /** Whether a retry could plausibly succeed (network, 429, 5xx). */
264
+ retryable: boolean;
265
+ /** HTTP status, or null when the request never completed (network error). */
266
+ status: number | null;
267
+ }
268
+ interface SyncCursor {
269
+ /** The row's id, breaking ties when timestamps collide. */
270
+ id: string;
271
+ /** The row's cursor-field value (typically `updated_at`). */
272
+ time: Date;
273
+ }
274
+ interface SyncSource {
275
+ cursorField: string;
276
+ entity: string;
277
+ fetchPage(args: {
278
+ since: SyncCursor | null;
279
+ limit: number;
280
+ }): Promise<Record<string, unknown>[]>;
281
+ /** Stable, unique tie-breaker column for keyset paging. Defaults to "id". */
282
+ idField?: string;
283
+ /** Set by `fromDrizzle`; lets `doctor` introspect the backing table. */
284
+ [DRIZZLE_META]?: DrizzleSourceMeta;
285
+ }
286
+ type SyncMode = "delta" | "full";
287
+ interface CursorStore {
288
+ get(entity: string): Promise<SyncCursor | null> | SyncCursor | null;
289
+ set(entity: string, cursor: SyncCursor | null): Promise<void> | void;
290
+ }
291
+ interface ClivlySDK {
292
+ /**
293
+ * Send a single heartbeat and report the outcome richly: `ok`, the HTTP
294
+ * `status` (null on network failure), a coarse `reason`, whether it's
295
+ * `retryable`, and the resolved `org` when the server returns it. Never throws
296
+ * — inspect the result, or turn a failure into an exception with
297
+ * `ClivlyError.from(result)`. Prefer this over `heartbeat()` for onboarding,
298
+ * health checks, and one-shot serverless calls.
299
+ */
300
+ connect(): Promise<ClivlyConnectResult>;
301
+ /**
302
+ * Build the `/clivly/auth/verify` handler the developer mounts in their app.
303
+ * Clivly's cloud calls it to validate a CRM user's identity against the host
304
+ * app's session. Pass a resolver that reads the host session from the request.
305
+ *
306
+ * The handler authenticates the caller against `config.verifyToken` (presented
307
+ * as `Authorization: Bearer <token>`) before invoking the resolver, so the
308
+ * endpoint can't be used by third parties to probe host sessions. It fails
309
+ * closed with HTTP 503 if `verifyToken` is unset (a missing config value, not a
310
+ * server fault — so it won't trip the host's 5xx error alerting).
311
+ */
312
+ createAuthVerifyHandler(resolveUser: (req: Request) => Promise<ClivlyUser | null> | ClivlyUser | null): (req: Request) => Promise<Response>;
313
+ /**
314
+ * A fetch handler to mount at a route. Each request runs one `runScheduled()`
315
+ * and returns JSON: 200 when the sync succeeded, 500 otherwise.
316
+ *
317
+ * Two callers use it: Clivly Cloud (when someone clicks "Run sync" — those
318
+ * requests are HMAC-signed and carry a run id), and the host's own scheduler
319
+ * (Workers cron, an uptime ping — no body).
320
+ *
321
+ * When `syncTrigger.secret` is set the handler rejects unsigned or
322
+ * badly-signed requests with 401. When it isn't, the route stays open to
323
+ * anyone who can reach it — set a secret if it's publicly routable.
324
+ */
325
+ createClivlyHandler(): (req: Request) => Promise<Response>;
326
+ /** Validate this setup end-to-end (read-only) before the first sync. */
327
+ doctor(): Promise<DoctorReport>;
328
+ /**
329
+ * Send a single heartbeat now. Returns true on success. Kept for the keep-alive
330
+ * loop and back-compat; use `connect()` when you need the failure reason.
331
+ */
332
+ heartbeat(): Promise<boolean>;
333
+ /**
334
+ * Read-only diagnostic probe. Proves the API key is valid and Clivly is
335
+ * reachable, and resolves the org — without reporting anything about the
336
+ * host app. Use this for `clivly status` and other diagnostics; use
337
+ * `connect()` only from the running app, which is entitled to report its
338
+ * own state.
339
+ */
340
+ ping(): Promise<ClivlyConnectResult>;
341
+ /**
342
+ * One-shot heartbeat + a single sync, with no keep-alive timers. The correct
343
+ * entry point on serverless/edge (Workers, Vercel, Lambda), where `start()`'s
344
+ * `setInterval` loop can't persist between invocations — call this from a
345
+ * scheduled/cron trigger. Throws if a sync push fails (so the run is marked
346
+ * failed); heartbeat is best-effort.
347
+ */
348
+ runScheduled(options?: {
349
+ mode?: SyncMode;
350
+ runId?: string;
351
+ }): Promise<void>;
352
+ /**
353
+ * Send the initial heartbeat and start the keep-alive loop. For long-lived
354
+ * hosts only — on serverless/edge the interval can't persist, so prefer
355
+ * `runScheduled()` / `createClivlyHandler()`. Emits a warning if a serverless
356
+ * runtime is detected.
357
+ */
358
+ start(): Promise<void>;
359
+ /** Stop the keep-alive loop. */
360
+ stop(): void;
361
+ /**
362
+ * Sync all configured sources now. `delta` (default) pages changed rows since
363
+ * the last cursor; `full` pushes each complete entity so the server can
364
+ * reconcile leavers (archive-on-leave). Throws if a push fails, so callers see
365
+ * the failure — the background keep-alive loop swallows and retries instead.
366
+ */
367
+ sync(options?: {
368
+ mode?: SyncMode;
369
+ runId?: string;
370
+ }): Promise<void>;
371
+ }
372
+ //#endregion
373
+ //#region ../sdk/src/namespace-probe.d.ts
374
+ interface NamespaceIntrospector {
375
+ /** All base table names in the reachable schema. */
376
+ listTables(): Promise<string[]>;
377
+ /** Prove a table is genuinely selectable (SELECT ... LIMIT 1). Throws if unreachable/denied. */
378
+ sampleSelect(table: string): Promise<void>;
379
+ }
380
+ //#endregion
381
+ export { ClivlyConnectResult as a, ClivlyUser as c, DiscoveredTable as d, DoctorCheck as f, ClivlyConnectReason as i, CreateChatSessionHandlerOptions as l, SyncSource as m, ChatSessionRequestBody as n, ClivlySDK as o, DoctorReport as p, ChatWidgetVisitor as r, ClivlySDKConfig as s, NamespaceIntrospector as t, CursorStore as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clivly",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Clivly CLI — scaffold a CRM into your app (clivly init).",