clivly 0.4.1 → 0.7.1

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