@everfur/sdk 0.1.1 → 0.4.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 (219) hide show
  1. package/CHANGELOG.md +703 -4
  2. package/README.md +63 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-BZZ-Py5l.d.ts +128 -0
  5. package/dist/Chat-Dq4fffIO.d.cts +128 -0
  6. package/dist/DepthViews-BG3E25MD.d.ts +16 -0
  7. package/dist/DepthViews-B_hIypI6.d.cts +19 -0
  8. package/dist/DepthViews-CL75jyRA.d.cts +16 -0
  9. package/dist/DepthViews-CkYri51q.d.ts +19 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-BorG422I.d.cts +146 -0
  21. package/dist/attachments-BrUWQYNK.d.ts +257 -0
  22. package/dist/attachments-D_SECjr1.d.cts +257 -0
  23. package/dist/attachments-DpldrvIW.d.ts +146 -0
  24. package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
  25. package/dist/bookingCopy-SREvkG19.d.cts +732 -0
  26. package/dist/branding-CsRdeNwK.d.cts +566 -0
  27. package/dist/branding-CsRdeNwK.d.ts +566 -0
  28. package/dist/callCopy-DoQKG3-L.d.cts +40 -0
  29. package/dist/callCopy-DoQKG3-L.d.ts +40 -0
  30. package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
  31. package/dist/casesRepository-v6QczS9N.d.ts +51 -0
  32. package/dist/chat/index.cjs +1 -1170
  33. package/dist/chat/index.d.cts +32 -53
  34. package/dist/chat/index.d.ts +32 -53
  35. package/dist/chat/index.js +1 -1167
  36. package/dist/client/index.cjs +9 -2315
  37. package/dist/client/index.d.cts +80 -16
  38. package/dist/client/index.d.ts +80 -16
  39. package/dist/client/index.js +9 -2215
  40. package/dist/{config-CiJ0PVBB.d.ts → config--Wu1Umhd.d.cts} +64 -26
  41. package/dist/{config-BSjBdxrZ.d.cts → config-C7eb_IMD.d.ts} +64 -26
  42. package/dist/consent/index.cjs +1 -0
  43. package/dist/consent/index.d.cts +33 -0
  44. package/dist/consent/index.d.ts +33 -0
  45. package/dist/consent/index.js +1 -0
  46. package/dist/context-CL3lyuy1.d.cts +159 -0
  47. package/dist/context-CahAEha8.d.ts +159 -0
  48. package/dist/copy-DdVFDL01.d.ts +198 -0
  49. package/dist/copy-UeUJVk8X.d.cts +198 -0
  50. package/dist/core/index.cjs +13 -3178
  51. package/dist/core/index.d.cts +164 -29
  52. package/dist/core/index.d.ts +164 -29
  53. package/dist/core/index.js +13 -3166
  54. package/dist/depth-D5HwcvKC.d.cts +533 -0
  55. package/dist/depth-DvPwPuT_.d.ts +533 -0
  56. package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
  57. package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
  58. package/dist/{identity-Brl-lDd6.d.cts → identity-C2-08BZW.d.cts} +20 -7
  59. package/dist/{identity-DK9zORrG.d.ts → identity-CEi9GRFZ.d.ts} +20 -7
  60. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  61. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  62. package/dist/index.cjs +12 -4494
  63. package/dist/index.d.cts +30 -121
  64. package/dist/index.d.ts +30 -121
  65. package/dist/index.js +12 -4470
  66. package/dist/models-B-Uh2LTf.d.ts +214 -0
  67. package/dist/models-D2EUxPZY.d.cts +214 -0
  68. package/dist/notifications/index.cjs +2 -0
  69. package/dist/notifications/index.d.cts +17 -0
  70. package/dist/notifications/index.d.ts +17 -0
  71. package/dist/notifications/index.js +2 -0
  72. package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
  73. package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
  74. package/dist/pets-DJv2sj2H.d.ts +92 -0
  75. package/dist/pets-JVCXgRgR.d.cts +92 -0
  76. package/dist/petsRepository-B_gKbAzJ.d.cts +142 -0
  77. package/dist/petsRepository-Bk6GDwLs.d.ts +142 -0
  78. package/dist/photo/index.cjs +1 -2189
  79. package/dist/photo/index.d.cts +6 -6
  80. package/dist/photo/index.d.ts +6 -6
  81. package/dist/photo/index.js +1 -2186
  82. package/dist/ports-BN6RHF9W.d.cts +48 -0
  83. package/dist/ports-BN6RHF9W.d.ts +48 -0
  84. package/dist/ports-BY2ph0_y.d.cts +376 -0
  85. package/dist/ports-D7YW8qz9.d.ts +376 -0
  86. package/dist/profile-CSs1wlXT.d.cts +93 -0
  87. package/dist/profile-CSs1wlXT.d.ts +93 -0
  88. package/dist/records/depth/index.cjs +2 -0
  89. package/dist/records/depth/index.d.cts +13 -0
  90. package/dist/records/depth/index.d.ts +13 -0
  91. package/dist/records/depth/index.js +2 -0
  92. package/dist/records/index.cjs +3 -2839
  93. package/dist/records/index.d.cts +137 -203
  94. package/dist/records/index.d.ts +137 -203
  95. package/dist/records/index.js +3 -2833
  96. package/dist/requestFunnel-BjDpqqvm.d.cts +110 -0
  97. package/dist/requestFunnel-DFMGcluw.d.ts +110 -0
  98. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  99. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  100. package/dist/{runtime-Bvr8yqXm.d.cts → runtimeTypes-gZEJu-da.d.cts} +104 -132
  101. package/dist/{runtime-BIYzf9cK.d.ts → runtimeTypes-w5KqBMcs.d.ts} +104 -132
  102. package/dist/server/events/index.cjs +2 -0
  103. package/dist/server/events/index.d.cts +550 -0
  104. package/dist/server/events/index.d.ts +550 -0
  105. package/dist/server/events/index.js +2 -0
  106. package/dist/server/index.cjs +2 -533
  107. package/dist/server/index.d.cts +73 -18
  108. package/dist/server/index.d.ts +73 -18
  109. package/dist/server/index.js +2 -530
  110. package/dist/species-BXAIMh7I.d.cts +9 -0
  111. package/dist/species-BXAIMh7I.d.ts +9 -0
  112. package/dist/televet/booking/index.cjs +1 -0
  113. package/dist/televet/booking/index.d.cts +294 -0
  114. package/dist/televet/booking/index.d.ts +294 -0
  115. package/dist/televet/booking/index.js +1 -0
  116. package/dist/televet/call/index.cjs +1 -0
  117. package/dist/televet/call/index.d.cts +141 -0
  118. package/dist/televet/call/index.d.ts +141 -0
  119. package/dist/televet/call/index.js +1 -0
  120. package/dist/televet/index.cjs +1 -0
  121. package/dist/televet/index.d.cts +142 -0
  122. package/dist/televet/index.d.ts +142 -0
  123. package/dist/televet/index.js +1 -0
  124. package/dist/testing/index.cjs +5 -823
  125. package/dist/testing/index.d.cts +18 -4
  126. package/dist/testing/index.d.ts +18 -4
  127. package/dist/testing/index.js +5 -820
  128. package/dist/testing/rn/index.cjs +1 -449
  129. package/dist/testing/rn/index.d.cts +18 -29
  130. package/dist/testing/rn/index.d.ts +18 -29
  131. package/dist/testing/rn/index.js +1 -444
  132. package/dist/testing/web/index.cjs +1 -0
  133. package/dist/testing/web/index.d.cts +132 -0
  134. package/dist/testing/web/index.d.ts +132 -0
  135. package/dist/testing/web/index.js +1 -0
  136. package/dist/timelineRows-C15jxFFH.d.ts +19 -0
  137. package/dist/timelineRows-odO8g9r2.d.cts +19 -0
  138. package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
  139. package/dist/typeStyle-DmoyacDG.d.ts +111 -0
  140. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  141. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  142. package/dist/useRecordsDepth-C6rjEaLn.d.cts +237 -0
  143. package/dist/useRecordsDepth-crhBllQK.d.ts +237 -0
  144. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  145. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  146. package/dist/video/index.cjs +1 -1941
  147. package/dist/video/index.d.cts +4 -4
  148. package/dist/video/index.d.ts +4 -4
  149. package/dist/video/index.js +1 -1938
  150. package/dist/view-Bxwxp4xD.d.ts +310 -0
  151. package/dist/view-DyitEO0m.d.cts +310 -0
  152. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  153. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  154. package/dist/web/consent/index.cjs +1 -0
  155. package/dist/web/consent/index.d.cts +34 -0
  156. package/dist/web/consent/index.d.ts +34 -0
  157. package/dist/web/consent/index.js +1 -0
  158. package/dist/web/index.cjs +14 -0
  159. package/dist/web/index.d.cts +218 -0
  160. package/dist/web/index.d.ts +218 -0
  161. package/dist/web/index.js +14 -0
  162. package/dist/web/notifications/index.cjs +2 -0
  163. package/dist/web/notifications/index.d.cts +213 -0
  164. package/dist/web/notifications/index.d.ts +213 -0
  165. package/dist/web/notifications/index.js +2 -0
  166. package/dist/web/records/depth/index.cjs +2 -0
  167. package/dist/web/records/depth/index.d.cts +12 -0
  168. package/dist/web/records/depth/index.d.ts +12 -0
  169. package/dist/web/records/depth/index.js +2 -0
  170. package/dist/web/records/index.cjs +4 -0
  171. package/dist/web/records/index.d.cts +285 -0
  172. package/dist/web/records/index.d.ts +285 -0
  173. package/dist/web/records/index.js +4 -0
  174. package/dist/web/televet/booking/index.cjs +1 -0
  175. package/dist/web/televet/booking/index.d.cts +349 -0
  176. package/dist/web/televet/booking/index.d.ts +349 -0
  177. package/dist/web/televet/booking/index.js +1 -0
  178. package/dist/web/televet/call/index.cjs +1 -0
  179. package/dist/web/televet/call/index.d.cts +142 -0
  180. package/dist/web/televet/call/index.d.ts +142 -0
  181. package/dist/web/televet/call/index.js +1 -0
  182. package/dist/web/televet/index.cjs +1 -0
  183. package/dist/web/televet/index.d.cts +136 -0
  184. package/dist/web/televet/index.d.ts +136 -0
  185. package/dist/web/televet/index.js +1 -0
  186. package/notifications/package.json +8 -0
  187. package/package.json +266 -10
  188. package/records/depth/package.json +8 -0
  189. package/server/events/device-blocked.cjs +15 -0
  190. package/server/events/package.json +9 -0
  191. package/televet/booking/package.json +8 -0
  192. package/televet/call/package.json +8 -0
  193. package/televet/package.json +8 -0
  194. package/testing/web/native-blocked.cjs +12 -0
  195. package/testing/web/package.json +8 -0
  196. package/web/consent/native-blocked.cjs +12 -0
  197. package/web/consent/package.json +8 -0
  198. package/web/native-blocked.cjs +12 -0
  199. package/web/notifications/native-blocked.cjs +12 -0
  200. package/web/notifications/package.json +8 -0
  201. package/web/package.json +8 -0
  202. package/web/records/depth/native-blocked.cjs +12 -0
  203. package/web/records/depth/package.json +8 -0
  204. package/web/records/native-blocked.cjs +12 -0
  205. package/web/records/package.json +8 -0
  206. package/web/televet/booking/native-blocked.cjs +12 -0
  207. package/web/televet/booking/package.json +8 -0
  208. package/web/televet/call/native-blocked.cjs +12 -0
  209. package/web/televet/call/package.json +8 -0
  210. package/web/televet/native-blocked.cjs +12 -0
  211. package/web/televet/package.json +8 -0
  212. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  213. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  214. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  215. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  216. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  217. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  218. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  219. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -1,4 +1,4 @@
1
- import { E as EverfurResult, f as EverfurError } from './EverfurResult-D92-uL82.js';
1
+ import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.cjs';
2
2
 
3
3
  /** The closed set of frame discriminators. `unknown` is the forward-compat catch-all. */
4
4
  type FrameKind = 'accepted' | 'heartbeat' | 'delta' | 'done' | 'error' | 'analysisStarted' | 'analysisComplete' | 'unknown';
@@ -49,24 +49,22 @@ interface DoneFrame extends FrameBase {
49
49
  readonly conversationId: string;
50
50
  readonly messageId: string | null;
51
51
  /**
52
- * PLANE-SPECIFIC, measured 2026-08-22. Populated on the CONSUMER chat plane, whose `_sse_done` writes it
53
- * onto the done payload. **Always null on the `/widget/v1` partner plane this SDK targets**: that router
54
- * builds a done payload of only `{done, conversation_id, follow_up_questions}` (+ optional message_id,
55
- * citations, clinical_sections) and defers `title` / urgency to a LATER `{"metadata": true}` frame — which
56
- * `done`'s terminal semantics stop this parser from reading.
52
+ * Populated on the CONSUMER chat plane, whose `_sse_done` writes it onto the done payload. On the
53
+ * `/widget/v1` partner plane, servers built on the shared turn pipeline (`widget_chat_turn_sse.py`) emit the
54
+ * legacy `{"metadata": true}` frame first and then ONE done carrying the available `title`,
55
+ * `follow_up_questions` and urgency. Older widget deployments sent a done without them and deferred
56
+ * `title` / urgency to a metadata frame AFTER done, so this field is null against those servers.
57
57
  *
58
- * The parse is deliberately kept: it is correct on the consumer plane, the cross-language SSE conformance
59
- * vectors pin it, and these are public fields a partner may already read via `handlers.onFrame`.
58
+ * The parse is deliberately kept: the cross-language SSE conformance vectors pin it, and these are public
59
+ * fields a partner may already read via `handlers.onFrame`.
60
60
  *
61
- * Do NOT "fix" this by making `done` non-terminal. The server guards the metadata yield behind
62
- * `if metadata:`, so a turn with no title/urgency ends right after `done`, and this parser's EOF path
63
- * would then synthesize a terminal `streamIncomplete` ERROR on every such turn — converting a working
64
- * turn into a user-visible failure. If the widget plane needs urgency, the field belongs on the server's
65
- * done payload, at the cost of re-serializing the 1-5s metadata generation ahead of it.
61
+ * Do NOT make `done` non-terminal to catch a trailing metadata frame from an older server. A turn with no
62
+ * title/urgency ends right after `done`, and this parser's EOF path would then synthesize a terminal
63
+ * `streamIncomplete` ERROR on every such turn, converting a working turn into a user-visible failure.
66
64
  */
67
65
  readonly title: string | null;
68
66
  /**
69
- * Present on the widget plane's done payload, but it carries `[]` there — the GENERATED follow-ups ride
67
+ * Present on the widget plane's done payload, but it carries `[]` there: the GENERATED follow-ups ride
70
68
  * the later metadata frame (see `title`). Populated for real on the consumer plane.
71
69
  */
72
70
  readonly followUpQuestions: readonly string[];
@@ -74,11 +72,19 @@ interface DoneFrame extends FrameBase {
74
72
  readonly citationStatus: string | null;
75
73
  /**
76
74
  * null = slot present but empty; absent on non-urgency turns (folded to null here).
77
- * Consumer plane only in practice — see `title` for why this is always null on `/widget/v1`.
75
+ * Null against older `/widget/v1` servers, see `title`.
78
76
  */
79
77
  readonly urgencyLevel: UrgencyLevel | null;
80
- /** Consumer plane only in practice — see `title`. */
78
+ /** Null against older `/widget/v1` servers, see `title`. */
81
79
  readonly urgencyReason: string | null;
80
+ /**
81
+ * True when the wire CARRIED the `urgency_level` slot: a tier, or an explicit null. The server folds two
82
+ * different things to the same null here (`widget_chat_turn_sse.py` `_metadata`): a turn the classifier
83
+ * judged informational sends `urgency_level: null`, a turn it never classified omits the key. The consumer
84
+ * app reads the first as its calm "Good to know" state (`stream.ts` `extractUrgencyMetadata`), and only
85
+ * the second as "no urgency". A slot holding an unrecognised string counts as absent, as the app does.
86
+ */
87
+ readonly urgencyProvided: boolean;
82
88
  /** present on the terminal frame of an analyze stream. */
83
89
  readonly resultId: string | null;
84
90
  }
@@ -139,7 +145,10 @@ declare function assertNever(x: never): never;
139
145
  declare function acceptedFrame(streamId: string | null, lastEventId: string | null, serverRequestId?: string | null): AcceptedFrame;
140
146
  declare function heartbeatFrame(lastEventId: string | null, serverRequestId?: string | null): HeartbeatFrame;
141
147
  declare function deltaFrame(delta: string, lastEventId: string | null, serverRequestId?: string | null): DeltaFrame;
142
- declare function doneFrame(fields: Omit<DoneFrame, 'kind' | 'terminal' | 'serverRequestId'>, serverRequestId?: string | null): DoneFrame;
148
+ declare function doneFrame(fields: Omit<DoneFrame, 'kind' | 'terminal' | 'serverRequestId' | 'urgencyProvided'> & {
149
+ /** Defaults to "a tier is present": a caller that builds a frame from a level never has to say so twice. */
150
+ readonly urgencyProvided?: boolean;
151
+ }, serverRequestId?: string | null): DoneFrame;
143
152
  declare function errorFrame(fields: {
144
153
  code: string;
145
154
  retryable: boolean;
@@ -399,11 +408,33 @@ declare function getGlobalFetch(): FetchLike;
399
408
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
400
409
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
401
410
  */
402
- declare const SDK_VERSION = "0.1.0";
403
- /** Sent as X-Everfur-SDK-Platform. */
404
- declare const SDK_PLATFORM = "react-native";
405
- /** Dated wire contract axis (SPEC-00 §4.2). Server is additive-only. Override via config.contractVersion. */
406
- declare const DEFAULT_CONTRACT_VERSION = "2026-08-01";
411
+ declare const SDK_VERSION = "0.4.0";
412
+ /**
413
+ * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
414
+ *
415
+ * The server allow-lists the header and its logs and diagnostics read it, so a web build that reported
416
+ * `react-native` would read as a native app in every log line (and be mis-sorted the day the min-version
417
+ * gate keys on it). The value is decided by the FACADE that builds the runtime (rn or web), never by partner
418
+ * config: a partner cannot make a web page claim to be a phone.
419
+ */
420
+ type SdkPlatform = 'react-native' | 'web';
421
+ /** Sent as X-Everfur-SDK-Platform when no facade names another. The RN facade is the historical default. */
422
+ declare const SDK_PLATFORM: SdkPlatform;
423
+ /**
424
+ * Dated wire contract axis (SPEC-00 §4.2). Override via config.contractVersion.
425
+ *
426
+ * 2026-09-19 is EFBackend's `PET_PROFILE_STRICT_CONTRACT` (widget_schemas.py, PF-05): from it, an unknown field in
427
+ * the partner pet body is a 400 rather than silently dropped. The SDK only ever sends named pet fields, so the strict
428
+ * answer can never meet an SDK call; a caller pinned to an older date keeps the one-release leniency and an
429
+ * `X-Everfur-Warning` header naming what was ignored. Where the min-version gate is armed, the platform's
430
+ * `PARTNER_SUPPORTED_CONTRACTS` must list this date.
431
+ *
432
+ * THE GRACE IS NOT A REJECTION, measured on the wire 2026-09-19: the warning names the ignored KEY and never its
433
+ * value, and the graced write still lands every field Everfur does know. So a caller on an older date must not
434
+ * treat the header as "my write did not apply" and re-send, or drop the rest of the body; the rest already
435
+ * landed. The SDK neither reads nor surfaces the header, because on this contract date it can never be sent.
436
+ */
437
+ declare const DEFAULT_CONTRACT_VERSION = "2026-09-19";
407
438
  /** The environment variable the base URL is derived from when config.apiBaseUrl is absent. */
408
439
  declare const ENV_API_BASE_URL = "EVERFUR_API_BASE_URL";
409
440
  interface EverfurConfig {
@@ -427,9 +458,16 @@ interface ResolvedClientConfig {
427
458
  readonly apiBaseUrl: string;
428
459
  readonly contractVersion: string;
429
460
  readonly sdkVersion: string;
430
- readonly platform: string;
461
+ readonly platform: SdkPlatform;
431
462
  readonly debug: boolean;
432
463
  }
464
+ /**
465
+ * What the FACADE knows and partner config must not decide. Threaded from the runtime factory into
466
+ * config resolution so `X-Everfur-SDK-Platform` names the entry point that actually built the runtime.
467
+ */
468
+ interface ResolveClientConfigOptions {
469
+ readonly platform?: SdkPlatform;
470
+ }
433
471
  /**
434
472
  * CONFIG FAILURE IS A VALUE, NOT A THROW.
435
473
  *
@@ -481,13 +519,13 @@ type BaseUrlOutcome = {
481
519
  */
482
520
  declare function checkPublishableKey(raw: unknown): ClientConfigFailure | null;
483
521
  /** Validate the partner-supplied config into the frozen client subset. Settles; never throws. */
484
- declare function tryResolveClientConfig(config: EverfurConfig): ClientConfigOutcome;
522
+ declare function tryResolveClientConfig(config: EverfurConfig, options?: ResolveClientConfigOptions): ClientConfigOutcome;
485
523
  /**
486
524
  * Validate the partner-supplied config into the frozen client subset. Throws EverfurConfigError
487
525
  * synchronously for programmer error (missing publishableKey, unresolvable/invalid base URL) -- never for
488
526
  * network/domain failure. Prefer `tryResolveClientConfig` wherever a blank screen is the alternative.
489
527
  */
490
- declare function resolveClientConfig(config: EverfurConfig): ResolvedClientConfig;
528
+ declare function resolveClientConfig(config: EverfurConfig, options?: ResolveClientConfigOptions): ResolvedClientConfig;
491
529
  /**
492
530
  * Resolve the base URL from (in order) an explicit value then EVERFUR_API_BASE_URL, then normalize.
493
531
  * Settles; never throws. There is deliberately no hardcoded host default (INV-ORG-AGNOSTIC).
@@ -498,4 +536,4 @@ declare function resolveApiBaseUrl(apiBaseUrl?: string): string;
498
536
  /** The always-on SDK protocol headers (version / platform / contract). Set inside the transport only. */
499
537
  declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion'>): Record<string, string>;
500
538
 
501
- export { fetchByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, DEFAULT_CONTRACT_VERSION as D, type EverfurRequest as E, type Frame as F, type UrgencyLevel as G, type HeartbeatFrame as H, acceptedFrame as I, analysisCompleteFrame as J, analysisStartedFrame as K, assertNever as L, type MultipartBody as M, bufferedTextByteSource as N, buildBaseHeaders as O, checkPublishableKey as P, createHttpTransport as Q, type RawResponse as R, SDK_PLATFORM as S, type TransportPort as T, type UnknownFrame as U, deltaFrame as V, doneFrame as W, errorFrame as X, errorFromResponse as Y, eventSourceByteSource as Z, eventSourceRequestId as _, type FetchLike as a, getGlobalFetch as a0, heartbeatFrame as a1, networkError as a2, parseSse as a3, requestIdOf as a4, requestJson as a5, requestRaw as a6, resolveApiBaseUrl as a7, resolveClientConfig as a8, tryResolveApiBaseUrl as a9, tryResolveClientConfig as aa, unknownFrame as ab, type AnalysisCompleteFrame as b, type AnalysisStartedFrame as c, type ClientConfigFailureReason as d, type ClientConfigOutcome as e, type DeltaFrame as f, type DoneFrame as g, EMPTY_FRAME_ARRAYS as h, ENV_API_BASE_URL as i, type ErrorFrame as j, type EventSourceFactory as k, type EventSourceInit as l, type EventSourceLike as m, type EventSourceMessage as n, type EverfurConfig as o, type EverfurRequestBase as p, type FetchInit as q, type FetchResponseLike as r, type FrameBase as s, type FrameKind as t, type HttpMethod as u, type ReadableStreamLike as v, type ResolvedClientConfig as w, SDK_VERSION as x, type ServerRequestIdSource as y, type TransportDeps as z };
539
+ export { eventSourceByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, type DeltaFrame as D, type ErrorFrame as E, type Frame as F, type SdkPlatform as G, type HeartbeatFrame as H, type ServerRequestIdSource as I, type TransportDeps as J, acceptedFrame as K, analysisCompleteFrame as L, type MultipartBody as M, analysisStartedFrame as N, assertNever as O, bufferedTextByteSource as P, buildBaseHeaders as Q, type RawResponse as R, SDK_PLATFORM as S, type TransportPort as T, type UnknownFrame as U, checkPublishableKey as V, createHttpTransport as W, deltaFrame as X, doneFrame as Y, errorFrame as Z, errorFromResponse as _, type AnalysisCompleteFrame as a, eventSourceRequestId as a0, fetchByteSource as a1, getGlobalFetch as a2, heartbeatFrame as a3, networkError as a4, parseSse as a5, requestIdOf as a6, requestJson as a7, requestRaw as a8, resolveApiBaseUrl as a9, resolveClientConfig as aa, tryResolveApiBaseUrl as ab, tryResolveClientConfig as ac, unknownFrame as ad, type AnalysisStartedFrame as b, type DoneFrame as c, type EverfurRequest as d, type EverfurRequestBase as e, type FrameBase as f, type FrameKind as g, type HttpMethod as h, type UrgencyLevel as i, type FetchLike as j, type ClientConfigFailureReason as k, type ClientConfigOutcome as l, DEFAULT_CONTRACT_VERSION as m, EMPTY_FRAME_ARRAYS as n, ENV_API_BASE_URL as o, type EventSourceFactory as p, type EventSourceInit as q, type EventSourceLike as r, type EventSourceMessage as s, type EverfurConfig as t, type FetchInit as u, type FetchResponseLike as v, type ReadableStreamLike as w, type ResolveClientConfigOptions as x, type ResolvedClientConfig as y, SDK_VERSION as z };
@@ -1,4 +1,4 @@
1
- import { E as EverfurResult, f as EverfurError } from './EverfurResult-D92-uL82.cjs';
1
+ import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.js';
2
2
 
3
3
  /** The closed set of frame discriminators. `unknown` is the forward-compat catch-all. */
4
4
  type FrameKind = 'accepted' | 'heartbeat' | 'delta' | 'done' | 'error' | 'analysisStarted' | 'analysisComplete' | 'unknown';
@@ -49,24 +49,22 @@ interface DoneFrame extends FrameBase {
49
49
  readonly conversationId: string;
50
50
  readonly messageId: string | null;
51
51
  /**
52
- * PLANE-SPECIFIC, measured 2026-08-22. Populated on the CONSUMER chat plane, whose `_sse_done` writes it
53
- * onto the done payload. **Always null on the `/widget/v1` partner plane this SDK targets**: that router
54
- * builds a done payload of only `{done, conversation_id, follow_up_questions}` (+ optional message_id,
55
- * citations, clinical_sections) and defers `title` / urgency to a LATER `{"metadata": true}` frame — which
56
- * `done`'s terminal semantics stop this parser from reading.
52
+ * Populated on the CONSUMER chat plane, whose `_sse_done` writes it onto the done payload. On the
53
+ * `/widget/v1` partner plane, servers built on the shared turn pipeline (`widget_chat_turn_sse.py`) emit the
54
+ * legacy `{"metadata": true}` frame first and then ONE done carrying the available `title`,
55
+ * `follow_up_questions` and urgency. Older widget deployments sent a done without them and deferred
56
+ * `title` / urgency to a metadata frame AFTER done, so this field is null against those servers.
57
57
  *
58
- * The parse is deliberately kept: it is correct on the consumer plane, the cross-language SSE conformance
59
- * vectors pin it, and these are public fields a partner may already read via `handlers.onFrame`.
58
+ * The parse is deliberately kept: the cross-language SSE conformance vectors pin it, and these are public
59
+ * fields a partner may already read via `handlers.onFrame`.
60
60
  *
61
- * Do NOT "fix" this by making `done` non-terminal. The server guards the metadata yield behind
62
- * `if metadata:`, so a turn with no title/urgency ends right after `done`, and this parser's EOF path
63
- * would then synthesize a terminal `streamIncomplete` ERROR on every such turn — converting a working
64
- * turn into a user-visible failure. If the widget plane needs urgency, the field belongs on the server's
65
- * done payload, at the cost of re-serializing the 1-5s metadata generation ahead of it.
61
+ * Do NOT make `done` non-terminal to catch a trailing metadata frame from an older server. A turn with no
62
+ * title/urgency ends right after `done`, and this parser's EOF path would then synthesize a terminal
63
+ * `streamIncomplete` ERROR on every such turn, converting a working turn into a user-visible failure.
66
64
  */
67
65
  readonly title: string | null;
68
66
  /**
69
- * Present on the widget plane's done payload, but it carries `[]` there — the GENERATED follow-ups ride
67
+ * Present on the widget plane's done payload, but it carries `[]` there: the GENERATED follow-ups ride
70
68
  * the later metadata frame (see `title`). Populated for real on the consumer plane.
71
69
  */
72
70
  readonly followUpQuestions: readonly string[];
@@ -74,11 +72,19 @@ interface DoneFrame extends FrameBase {
74
72
  readonly citationStatus: string | null;
75
73
  /**
76
74
  * null = slot present but empty; absent on non-urgency turns (folded to null here).
77
- * Consumer plane only in practice — see `title` for why this is always null on `/widget/v1`.
75
+ * Null against older `/widget/v1` servers, see `title`.
78
76
  */
79
77
  readonly urgencyLevel: UrgencyLevel | null;
80
- /** Consumer plane only in practice — see `title`. */
78
+ /** Null against older `/widget/v1` servers, see `title`. */
81
79
  readonly urgencyReason: string | null;
80
+ /**
81
+ * True when the wire CARRIED the `urgency_level` slot: a tier, or an explicit null. The server folds two
82
+ * different things to the same null here (`widget_chat_turn_sse.py` `_metadata`): a turn the classifier
83
+ * judged informational sends `urgency_level: null`, a turn it never classified omits the key. The consumer
84
+ * app reads the first as its calm "Good to know" state (`stream.ts` `extractUrgencyMetadata`), and only
85
+ * the second as "no urgency". A slot holding an unrecognised string counts as absent, as the app does.
86
+ */
87
+ readonly urgencyProvided: boolean;
82
88
  /** present on the terminal frame of an analyze stream. */
83
89
  readonly resultId: string | null;
84
90
  }
@@ -139,7 +145,10 @@ declare function assertNever(x: never): never;
139
145
  declare function acceptedFrame(streamId: string | null, lastEventId: string | null, serverRequestId?: string | null): AcceptedFrame;
140
146
  declare function heartbeatFrame(lastEventId: string | null, serverRequestId?: string | null): HeartbeatFrame;
141
147
  declare function deltaFrame(delta: string, lastEventId: string | null, serverRequestId?: string | null): DeltaFrame;
142
- declare function doneFrame(fields: Omit<DoneFrame, 'kind' | 'terminal' | 'serverRequestId'>, serverRequestId?: string | null): DoneFrame;
148
+ declare function doneFrame(fields: Omit<DoneFrame, 'kind' | 'terminal' | 'serverRequestId' | 'urgencyProvided'> & {
149
+ /** Defaults to "a tier is present": a caller that builds a frame from a level never has to say so twice. */
150
+ readonly urgencyProvided?: boolean;
151
+ }, serverRequestId?: string | null): DoneFrame;
143
152
  declare function errorFrame(fields: {
144
153
  code: string;
145
154
  retryable: boolean;
@@ -399,11 +408,33 @@ declare function getGlobalFetch(): FetchLike;
399
408
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
400
409
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
401
410
  */
402
- declare const SDK_VERSION = "0.1.0";
403
- /** Sent as X-Everfur-SDK-Platform. */
404
- declare const SDK_PLATFORM = "react-native";
405
- /** Dated wire contract axis (SPEC-00 §4.2). Server is additive-only. Override via config.contractVersion. */
406
- declare const DEFAULT_CONTRACT_VERSION = "2026-08-01";
411
+ declare const SDK_VERSION = "0.4.0";
412
+ /**
413
+ * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
414
+ *
415
+ * The server allow-lists the header and its logs and diagnostics read it, so a web build that reported
416
+ * `react-native` would read as a native app in every log line (and be mis-sorted the day the min-version
417
+ * gate keys on it). The value is decided by the FACADE that builds the runtime (rn or web), never by partner
418
+ * config: a partner cannot make a web page claim to be a phone.
419
+ */
420
+ type SdkPlatform = 'react-native' | 'web';
421
+ /** Sent as X-Everfur-SDK-Platform when no facade names another. The RN facade is the historical default. */
422
+ declare const SDK_PLATFORM: SdkPlatform;
423
+ /**
424
+ * Dated wire contract axis (SPEC-00 §4.2). Override via config.contractVersion.
425
+ *
426
+ * 2026-09-19 is EFBackend's `PET_PROFILE_STRICT_CONTRACT` (widget_schemas.py, PF-05): from it, an unknown field in
427
+ * the partner pet body is a 400 rather than silently dropped. The SDK only ever sends named pet fields, so the strict
428
+ * answer can never meet an SDK call; a caller pinned to an older date keeps the one-release leniency and an
429
+ * `X-Everfur-Warning` header naming what was ignored. Where the min-version gate is armed, the platform's
430
+ * `PARTNER_SUPPORTED_CONTRACTS` must list this date.
431
+ *
432
+ * THE GRACE IS NOT A REJECTION, measured on the wire 2026-09-19: the warning names the ignored KEY and never its
433
+ * value, and the graced write still lands every field Everfur does know. So a caller on an older date must not
434
+ * treat the header as "my write did not apply" and re-send, or drop the rest of the body; the rest already
435
+ * landed. The SDK neither reads nor surfaces the header, because on this contract date it can never be sent.
436
+ */
437
+ declare const DEFAULT_CONTRACT_VERSION = "2026-09-19";
407
438
  /** The environment variable the base URL is derived from when config.apiBaseUrl is absent. */
408
439
  declare const ENV_API_BASE_URL = "EVERFUR_API_BASE_URL";
409
440
  interface EverfurConfig {
@@ -427,9 +458,16 @@ interface ResolvedClientConfig {
427
458
  readonly apiBaseUrl: string;
428
459
  readonly contractVersion: string;
429
460
  readonly sdkVersion: string;
430
- readonly platform: string;
461
+ readonly platform: SdkPlatform;
431
462
  readonly debug: boolean;
432
463
  }
464
+ /**
465
+ * What the FACADE knows and partner config must not decide. Threaded from the runtime factory into
466
+ * config resolution so `X-Everfur-SDK-Platform` names the entry point that actually built the runtime.
467
+ */
468
+ interface ResolveClientConfigOptions {
469
+ readonly platform?: SdkPlatform;
470
+ }
433
471
  /**
434
472
  * CONFIG FAILURE IS A VALUE, NOT A THROW.
435
473
  *
@@ -481,13 +519,13 @@ type BaseUrlOutcome = {
481
519
  */
482
520
  declare function checkPublishableKey(raw: unknown): ClientConfigFailure | null;
483
521
  /** Validate the partner-supplied config into the frozen client subset. Settles; never throws. */
484
- declare function tryResolveClientConfig(config: EverfurConfig): ClientConfigOutcome;
522
+ declare function tryResolveClientConfig(config: EverfurConfig, options?: ResolveClientConfigOptions): ClientConfigOutcome;
485
523
  /**
486
524
  * Validate the partner-supplied config into the frozen client subset. Throws EverfurConfigError
487
525
  * synchronously for programmer error (missing publishableKey, unresolvable/invalid base URL) -- never for
488
526
  * network/domain failure. Prefer `tryResolveClientConfig` wherever a blank screen is the alternative.
489
527
  */
490
- declare function resolveClientConfig(config: EverfurConfig): ResolvedClientConfig;
528
+ declare function resolveClientConfig(config: EverfurConfig, options?: ResolveClientConfigOptions): ResolvedClientConfig;
491
529
  /**
492
530
  * Resolve the base URL from (in order) an explicit value then EVERFUR_API_BASE_URL, then normalize.
493
531
  * Settles; never throws. There is deliberately no hardcoded host default (INV-ORG-AGNOSTIC).
@@ -498,4 +536,4 @@ declare function resolveApiBaseUrl(apiBaseUrl?: string): string;
498
536
  /** The always-on SDK protocol headers (version / platform / contract). Set inside the transport only. */
499
537
  declare function buildBaseHeaders(cfg: Pick<ResolvedClientConfig, 'sdkVersion' | 'platform' | 'contractVersion'>): Record<string, string>;
500
538
 
501
- export { fetchByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, DEFAULT_CONTRACT_VERSION as D, type EverfurRequest as E, type Frame as F, type UrgencyLevel as G, type HeartbeatFrame as H, acceptedFrame as I, analysisCompleteFrame as J, analysisStartedFrame as K, assertNever as L, type MultipartBody as M, bufferedTextByteSource as N, buildBaseHeaders as O, checkPublishableKey as P, createHttpTransport as Q, type RawResponse as R, SDK_PLATFORM as S, type TransportPort as T, type UnknownFrame as U, deltaFrame as V, doneFrame as W, errorFrame as X, errorFromResponse as Y, eventSourceByteSource as Z, eventSourceRequestId as _, type FetchLike as a, getGlobalFetch as a0, heartbeatFrame as a1, networkError as a2, parseSse as a3, requestIdOf as a4, requestJson as a5, requestRaw as a6, resolveApiBaseUrl as a7, resolveClientConfig as a8, tryResolveApiBaseUrl as a9, tryResolveClientConfig as aa, unknownFrame as ab, type AnalysisCompleteFrame as b, type AnalysisStartedFrame as c, type ClientConfigFailureReason as d, type ClientConfigOutcome as e, type DeltaFrame as f, type DoneFrame as g, EMPTY_FRAME_ARRAYS as h, ENV_API_BASE_URL as i, type ErrorFrame as j, type EventSourceFactory as k, type EventSourceInit as l, type EventSourceLike as m, type EventSourceMessage as n, type EverfurConfig as o, type EverfurRequestBase as p, type FetchInit as q, type FetchResponseLike as r, type FrameBase as s, type FrameKind as t, type HttpMethod as u, type ReadableStreamLike as v, type ResolvedClientConfig as w, SDK_VERSION as x, type ServerRequestIdSource as y, type TransportDeps as z };
539
+ export { eventSourceByteSource as $, type AcceptedFrame as A, type ByteSource as B, type ClientConfigFailure as C, type DeltaFrame as D, type ErrorFrame as E, type Frame as F, type SdkPlatform as G, type HeartbeatFrame as H, type ServerRequestIdSource as I, type TransportDeps as J, acceptedFrame as K, analysisCompleteFrame as L, type MultipartBody as M, analysisStartedFrame as N, assertNever as O, bufferedTextByteSource as P, buildBaseHeaders as Q, type RawResponse as R, SDK_PLATFORM as S, type TransportPort as T, type UnknownFrame as U, checkPublishableKey as V, createHttpTransport as W, deltaFrame as X, doneFrame as Y, errorFrame as Z, errorFromResponse as _, type AnalysisCompleteFrame as a, eventSourceRequestId as a0, fetchByteSource as a1, getGlobalFetch as a2, heartbeatFrame as a3, networkError as a4, parseSse as a5, requestIdOf as a6, requestJson as a7, requestRaw as a8, resolveApiBaseUrl as a9, resolveClientConfig as aa, tryResolveApiBaseUrl as ab, tryResolveClientConfig as ac, unknownFrame as ad, type AnalysisStartedFrame as b, type DoneFrame as c, type EverfurRequest as d, type EverfurRequestBase as e, type FrameBase as f, type FrameKind as g, type HttpMethod as h, type UrgencyLevel as i, type FetchLike as j, type ClientConfigFailureReason as k, type ClientConfigOutcome as l, DEFAULT_CONTRACT_VERSION as m, EMPTY_FRAME_ARRAYS as n, ENV_API_BASE_URL as o, type EventSourceFactory as p, type EventSourceInit as q, type EventSourceLike as r, type EventSourceMessage as s, type EverfurConfig as t, type FetchInit as u, type FetchResponseLike as v, type ReadableStreamLike as w, type ResolveClientConfigOptions as x, type ResolvedClientConfig as y, SDK_VERSION as z };
@@ -0,0 +1 @@
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime');var ir=Object.defineProperty;var n=(e,r)=>ir(e,"name",{value:r,configurable:true});var sr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function O(e,r){let t=e.type,o=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:o}:{fontFamily:o,fontWeight:t.weight[sr[r]]}}n(O,"face");var S=Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),$=Object.freeze({transcript_exposure:Object.freeze({title:"Conversation sharing",body:n(e=>`Let ${e} read the conversations you have with Everfur.`,"body")}),partner_context:Object.freeze({title:"Pet details",body:n(e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`,"body")})});function Q(e,r){if(e.status==="signed_out")return {kind:"signedOut"};let t=e.scopes.find(o=>o.scope===r);return t===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:t.loaded?{kind:"row",scope:t.scope,granted:t.granted,hasDecision:t.hasDecision,saving:t.saving,error:t.error}:t.error!==null?{kind:"failed",error:t.error}:{kind:"loading"}}n(Q,"consentRowView");var X=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(X.map(e=>e.wireCode));var lr=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),Ee=Object.freeze(X.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:lr[e.wireCode]}))),ur=new Map(Ee.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),dr=Object.freeze(["http_envelope",...[...new Set(Ee.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function q(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let o of [r??"http_envelope",...dr]){let a=ur.get(o+t);if(a)return a}}n(q,"contractErrorFor");function cr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(cr,"contractDocUrl");function be(e){return null}n(be,"publishedDocUrl");var pr=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function ge(e){return pr[e]}n(ge,"categoryFor");function he(e){let r=q(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),o=t.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(he,"fromWire");var fr=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function J(e){return fr.has(e)}n(J,"isAutoRetryable");var yr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function _e(e){return J(e)||yr.has(e)}n(_e,"isRetryableCode");var mr=500,Z=8e3,Ce=4;function Re(e,r=Math.random){let t=Math.max(0,e),o=Math.min(mr*2**t,Z);return Math.floor(r()*o)}n(Re,"backoffDelayMs");var vr=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Er(e){return vr[e]}n(Er,"userFacingError");function Te(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}n(Te,"defineHidden");var br=/^[a-z][a-z0-9_]{0,63}$/;function w(e,r){let t=q(r?.wireCode,r?.wireEnvelope),o={code:e,category:ge(e),retryable:r?.retryable??_e(e),displayMessage:Er(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&br.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),t);return r?.wireMessage&&Te(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Te(o,"raw",r.raw),Object.freeze(o)}n(w,"makeEverfurError");function ee(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}n(ee,"ok");function p(e){return Object.freeze({ok:false,error:e})}n(p,"err");var V=class V extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,V.prototype);}};n(V,"EverfurConfigError");var D=V;function Se(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(Se,"errorFrame");function _r(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}n(_r,"authHeaders");function N(e,r){return {...e,headers:{...Cr(e.headers),..._r(r)}}}n(N,"withAuthHeaders");function Cr(e){if(!e)return {};let r={};for(let[t,o]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=o);}return r}n(Cr,"stripAuthHeaders");async function we(e,r){if(r.mode==="anonymous")return r.transport.request(N(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return p(re())}let o=await r.transport.request(N(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return p(re())}let l=await r.transport.request(N(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?p(re(l.error.httpStatus)):l}n(we,"authedSend");function re(e){return w("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(re,"authRejectedError");function xe(e){return w("internalError",{retryable:true,wireMessage:Rr(e)})}n(xe,"networkError");function Rr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Rr,"describeCause");var Tr=3e4,Sr=Z*2,wr="idempotency-key",xr=new Set(["POST","PUT","PATCH","DELETE"]),Fr=Object.freeze({onEvent(){}}),kr=Object.freeze({setTimeout:n((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Or(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}n(Or,"seededIdempotencyKey");function ke(e){let r=e.observer??Fr,t=e.timers??kr,o=e.rng??Math.random,a=e.sleep??((v,d)=>Vr(v,t,d)),l=e.maxAttempts??Ce,i=e.unaryTimeoutMs??Tr,f=e.newIdempotencyKey??Ir(),s=n(v=>{try{r.onEvent(v);}catch{}},"emit");async function m(v,d,c){let y=c?.maxAttempts,C=Math.max(1,y??l),x=c?.idempotent??xr.has(d.method),R=c?.idempotencyKey===void 0?null:Or(c.idempotencyKey),u=x?R??f():null,g=Ar(d,u),h=0;for(;;){let T=n(G=>Object.freeze({call:v,method:d.method,path:d.path,attempt:h,...u?{idempotencyKey:u}:{},...G}),"stamp");s(T({phase:"attempt"}));let z=Br(i,t),U=qr(z.signal,d.signal),j;try{j=await we({...g,signal:U.signal},e.auth);}catch(G){j=p(xe(G));}finally{U.dispose(),z.cancel();}if(j.ok)return s(T({phase:"settled",ok:true,reason:"ok"})),j;let F=j.error,B=zr(F,h,{maxAttempts:C,rng:o,now:t.now(),aborted:d.signal?.aborted===true,...y!==void 0?{perCallMaxAttempts:y}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),W={ok:false,code:F.code,reason:B.reason,...F.httpStatus!==void 0?{httpStatus:F.httpStatus}:{},...F.requestId!==void 0?{requestId:F.requestId}:{}};if(!B.retry)return s(T({phase:"settled",...W})),p(F);if(s(T({phase:"retry",...W,delayMs:B.delayMs})),await a(B.delayMs,d.signal),d.signal?.aborted===true)return s(T({phase:"settled",...W,reason:"aborted"})),p(F);h+=1;}}n(m,"send");async function k(v){return N(v,await Ur(e.auth))}n(k,"authorize");async function*_(v,d,c){s(Object.freeze({call:v,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,c);}catch{yield Se({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(_,"stream"),Object.freeze({send:m,authorize:k,stream:_})}n(ke,"createRequestFunnel");function Ar(e,r){let t={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==wr&&(t[o]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}n(Ar,"assembleHeaders");function Ir(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Ir,"defaultIdempotencyKeyFactory");var Pr=10;function zr(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let o=jr(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!J(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let i=n(()=>{if(t.policy===void 0)return null;let m;try{m=t.policy.maxAttempts(e.code);}catch{return null}return typeof m!="number"||!Number.isFinite(m)?null:Math.max(1,Math.min(Pr,Math.floor(m)))},"policyCeiling"),f=t.perCallMaxAttempts??i()??t.maxAttempts;if(r+1>=f)return {retry:false,reason:"attempts-exhausted"};let s=Dr(e,t.now);return s!==null?s>Sr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:s}:{retry:true,reason:a,delayMs:Re(r,t.rng)}}n(zr,"decideRetry");function jr(e){let r=e.code==="unknown"?he(Lr(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}n(jr,"throttleKind");function Dr(e,r){let t=Nr(e.raw);if(t===null)return null;let o=t-r;return o>0?o:0}n(Dr,"retryOverrideMs");function Nr(e){for(let r of Oe(e)){let t=r.resets_at,o=Mr(t);if(o!==null)return o}return null}n(Nr,"findResetsAt");function Oe(e){if(!Fe(e))return [];let r=[e];for(let t of ["error","detail"]){let o=e[t];Fe(o)&&r.push(o);}return r}n(Oe,"candidateScopes");function Mr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}n(Mr,"parseInstantMs");function Lr(e){for(let r of Oe(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}n(Lr,"rawWireCode");function Fe(e){return typeof e=="object"&&e!==null}n(Fe,"isRecord");async function Ur(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}n(Ur,"resolveDeviceAuth");function Br(e,r){let t=new AbortController,o=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:n(()=>r.clearTimeout(o),"cancel")}}n(Br,"boundedSignal");function qr(e,r){let t=n(()=>{},"noop");if(!r)return {signal:e,dispose:t};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:t};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}n(qr,"mergeSignals");function Vr(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(o=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",l),o();},e),l=n(()=>{r.clearTimeout(a),o();},"onAbort");t?.addEventListener("abort",l,{once:true});})}n(Vr,"delayAbortable");var Ae="/widget/v1/consent",M=Object.freeze(["transcript_exposure","partner_context"]),Ie="records_content",ne=64,Hr=new Set(M);function H(e){return typeof e=="string"&&Hr.has(e)}n(H,"isEverfurConsentScope");function P(e){return w("validationFailed",{retryable:false,wireMessage:e})}n(P,"invalid");function De(e){return H(e)?null:P(e===Ie?`'${Ie}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/pets/{pet_ref}/consent, which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${M.join(", ")}`)}n(De,"validateScope");function Yr(e){if(typeof e!="object"||e===null)return P("write needs a decision object");let{scope:r,granted:t,consentVersion:o}=e,a=De(r);return a!==null?a:typeof t!="boolean"?P("granted must be true to grant or false to withdraw"):o!==void 0&&(typeof o!="string"||o.length===0||o.length>ne)?P(`consentVersion must be 1..${ne} characters`):null}n(Yr,"validateDecision");var te=n(e=>typeof e=="string"&&e.length>0?e:null,"str");function Pe(e,r){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.granted!="boolean"||typeof t.has_decision!="boolean"?null:Object.freeze({scope:r,granted:t.granted,hasDecision:t.has_decision,consentVersion:te(t.consent_version),actor:te(t.actor),recordedAt:te(t.recorded_at)})}n(Pe,"verdictFromWire");function ze(e){return w("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no granted/has_decision pair`})}n(ze,"malformed");function je(e){return P(`the Everfur runtime is disposed; ${e} was called after unmount`)}n(je,"disposed");function oe(e){let r=n(()=>{let{services:t}=e.registry;return Ne({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})},"over");return {read:n((t,o)=>e.isDisposed?Promise.resolve(p(je("read"))):r().read(t,o),"read"),write:n((t,o)=>e.isDisposed?Promise.resolve(p(je("write"))):r().write(t,o),"write")}}n(oe,"createConsentRepository");function Ne(e){let r=e.funnel??ke({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=n((o,a)=>a?{...o,signal:a}:o,"withSignal");return {async read(o,a){let l=De(o);if(l!==null)return p(l);let i=await r.send("consent.read",t({method:"GET",path:Ae,query:{scope:o}},a?.signal));if(!i.ok)return p(i.error);let f=Pe(i.value,o);return f===null?p(ze("consent.read")):ee(f)},async write(o,a){let l=Yr(o);if(l!==null)return p(l);let i={scope:o.scope,granted:o.granted};o.consentVersion!==void 0&&(i.consent_version=o.consentVersion);let f=await r.send("consent.write",t({method:"PUT",path:Ae,body:i},a?.signal));if(!f.ok)return p(f.error);let s=Pe(f.value,o.scope);return s===null?p(ze("consent.write")):ee(s)}}}n(Ne,"createConsentRepositoryOver");var Me=Symbol.for("@everfur/sdk#EverfurContext@v1"),Le=globalThis,Ue=Le[Me]??(Le[Me]=react.createContext(null));Ue.displayName??="EverfurContext";function ae(){let e=react.useContext(Ue);if(e===null)throw new D("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(ae,"useEverfurContext");function se(e,r){return Object.freeze({scope:e,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:r})}n(se,"blank");function qe(e){return Object.freeze({scope:e.scope,granted:e.granted,hasDecision:e.hasDecision,consentVersion:e.consentVersion,recordedAt:e.recordedAt,loaded:true,saving:false,error:null})}n(qe,"settled");function Qr(){return w("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}n(Qr,"noMember");function Ve(){let{runtime:e}=ae();return react.useMemo(()=>oe(e),[e])}n(Ve,"useEverfurConsentRepository");function ue(e){let{userRef:r}=ae(),t=Ve(),o=(e?.scopes??[]).filter(H).join(","),a=react.useMemo(()=>{let c=o.length===0?[]:o.split(",");return c.length===0?M:Object.freeze(c)},[o]),[l,i]=react.useState(r===null?"signed_out":"loading"),[f,s]=react.useState([]),[m,k]=react.useState(null),_=react.useRef(0),v=react.useCallback(async()=>{if(r===null){_.current+=1,i("signed_out"),s([]),k(null);return}let c=_.current+=1;i("loading"),k(null);let y=await Promise.all(a.map(u=>t.read(u)));if(c!==_.current)return;let C=y.map((u,g)=>{let h=a[g];return u.ok?qe(u.value):se(h,u.error)}),x=y.find(u=>!u.ok),R=y.every(u=>!u.ok);s(Object.freeze(C)),i(R?"failed":"ready"),k(R&&x!==void 0&&!x.ok?x.error:null);},[t,a,r]);react.useEffect(()=>{v();},[v]);let d=react.useCallback(async(c,y)=>{if(r===null)return p(Qr());let C=_.current,x=null;s(u=>{let g=u.findIndex(U=>U.scope===c),h=g===-1?se(c,null):u[g];x=h;let T=Object.freeze({...h,granted:y,hasDecision:true,saving:true,error:null});if(g===-1)return Object.freeze([...u,T]);let z=[...u];return z[g]=T,Object.freeze(z)});let R=await t.write({scope:c,granted:y});return C!==_.current||s(u=>{let g=u.findIndex(T=>T.scope===c);if(g===-1)return u;let h=[...u];return h[g]=R.ok?qe(R.value):Object.freeze({...x??se(c,null),saving:false,error:R.error}),Object.freeze(h)}),R},[t,r]);return react.useMemo(()=>({status:l,scopes:f,error:m,setConsent:d,refresh:v}),[l,f,m,d,v])}n(ue,"useEverfurConsent");function He(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(He,"reportHostFailure");function Xr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(Xr,"isThenable");function Jr(e,...r){if(typeof e=="function")try{let t=e(...r);return Xr(t)&&Promise.resolve(t).then(void 0,He),t}catch(t){He(t);return}}n(Jr,"callHost");var Ye=new WeakMap;function Zr(e){if(typeof e!="function")return;let r=Ye.get(e);if(r!==void 0)return r;let t=n((...o)=>{Jr(e,...o);},"guarded");return Ye.set(e,t),t}n(Zr,"guardHost");function Ke(e,r){let t=null;for(let o of r){let a=e[o];typeof a=="function"&&(t??={...e},t[o]=Zr(a));}return t??e}n(Ke,"guardHostProps");var ce=class ce extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,o){return Object.is(t.resetKey,o.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};n(ce,"HostRenderBoundary");var de=ce;function rt({render:e}){return e()}n(rt,"RenderHost");function Ge({render:e,fallback:r,resetKey:t}){return react.createElement(de,{fallback:r,resetKey:t,children:react.createElement(rt,{render:e})})}n(Ge,"HostRender");function ye(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ye(e[r]);}return e}n(ye,"deepFreeze");var tt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Qe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Xe={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},$e={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},nt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},ot={regular:"400",medium:"500",bold:"700"},at={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},it=0,Y="System",K="monospace",st=["content","heading","control","compact","badge"];function lt(e){let r={};for(let t of st)r[t]=e;return r}n(lt,"authoredTierSizes");function Je(){return {family:Y,mono:K,fontUrl:null,families:{regular:Y,medium:Y,bold:Y,mono:K,monoMedium:K,monoBold:K},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:$e,tierSizes:lt($e),lineHeight:nt,weight:ot,letterSpacing:at,scale:1,maxScale:it,scaleCaps:tt}}n(Je,"baseType");var Ze={},pe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function fe(e){return `cubic-bezier(${e.join(", ")})`}n(fe,"cssCubicBezier");var er={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:fe(pe.standard),emphasized:fe(pe.emphasized),exit:fe(pe.exit)},reducedMotion:false},ut={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},rr=ye({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:ut,space:Qe,radius:Xe,type:Je(),motion:er,slots:Ze}),dt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ye({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:dt,space:Qe,radius:Xe,type:Je(),motion:er,slots:Ze});var tr=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),nr=globalThis,me=nr[tr]??(nr[tr]=react.createContext(rr));me.displayName??="EverfurThemeContext";function L(){return react.useContext(me)}n(L,"useEverfurTheme");function vt(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}n(vt,"tierMultiplier");function b({tier:e="content",...r}){let{type:t}=L(),o=vt(t,e);return react.createElement(reactNative.Text,o===void 0?r:{maxFontSizeMultiplier:o,...r})}n(b,"Text");react.forwardRef(n(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function Ct(e){let{scope:r,onChange:t,renderNotice:o,style:a}=Ke(e,["onChange"]),l=L(),i=react.useMemo(()=>Rt(l),[l]),f=ue({scopes:[r]}),s=Q(f,r),m=$[r],[k,_]=react.useState(null),v=react.useCallback(async y=>{_(y);let C=await f.setConsent(r,y);C.ok&&(_(null),t?.(C.value.granted));},[f,t,r]),d=n((y,C)=>jsxRuntime.jsxs(reactNative.View,{style:i.notice,children:[jsxRuntime.jsx(Ge,{resetKey:y,render:()=>o?o(y):jsxRuntime.jsx(b,{style:i.noticeText,children:y.displayMessage}),fallback:jsxRuntime.jsx(b,{style:i.noticeText,children:y.displayMessage})}),jsxRuntime.jsx(reactNative.Pressable,{onPress:C,accessibilityRole:"button",accessibilityLabel:S.retry,style:i.retry,children:jsxRuntime.jsx(b,{tier:"control",style:i.retryLabel,children:S.retry})})]}),"notice");if(s.kind==="signedOut")return jsxRuntime.jsxs(reactNative.View,{style:[i.container,a],accessible:true,accessibilityRole:"text",accessibilityLabel:S.signedOut,children:[jsxRuntime.jsx(b,{style:i.title,children:m.title}),jsxRuntime.jsx(b,{style:i.body,children:S.signedOut})]});if(s.kind==="loading")return jsxRuntime.jsxs(reactNative.View,{style:[i.container,a],accessible:true,accessibilityRole:"progressbar",accessibilityLabel:S.loading,children:[jsxRuntime.jsx(b,{style:i.title,children:m.title}),jsxRuntime.jsx(reactNative.ActivityIndicator,{color:l.color.brandInk})]});if(s.kind==="failed")return jsxRuntime.jsxs(reactNative.View,{style:[i.container,a],children:[jsxRuntime.jsx(b,{style:i.title,children:m.title}),d(s.error,()=>{f.refresh();})]});let c=`${m.title}. ${m.body(l.meta.displayName)}`;return jsxRuntime.jsxs(reactNative.View,{style:[i.container,a],children:[jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>{s.saving||v(!s.granted);},disabled:s.saving,accessibilityRole:"checkbox",accessibilityState:{checked:s.granted,disabled:s.saving},accessibilityLabel:c,accessibilityHint:s.saving?S.saving:void 0,hitSlop:{top:6,bottom:6,left:6,right:6},style:[i.row,s.granted?i.rowChecked:null],children:[jsxRuntime.jsx(reactNative.View,{style:[i.box,s.granted?i.boxChecked:null],accessibilityElementsHidden:true,importantForAccessibility:"no",children:s.granted?jsxRuntime.jsx(b,{style:i.tick,children:"\u2713"}):null}),jsxRuntime.jsxs(reactNative.View,{style:i.copy,children:[jsxRuntime.jsx(b,{style:i.title,children:m.title}),jsxRuntime.jsx(b,{style:i.body,children:m.body(l.meta.displayName)}),jsxRuntime.jsx(b,{style:i.footnote,children:S.changeable})]})]}),s.error===null?null:d(s.error,()=>{v(k??!s.granted);})]})}n(Ct,"EverfurConsentToggle");function Rt(e){let{color:r,radius:t,space:o,type:a}=e;return reactNative.StyleSheet.create({container:{gap:o.sm,paddingHorizontal:o.lg,paddingVertical:o.md},row:{flexDirection:"row",alignItems:"flex-start",gap:o.md,borderRadius:t.md,borderWidth:1,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:o.lg,paddingVertical:o.lg},rowChecked:{borderColor:r.brand,backgroundColor:r.brandSoft},box:{width:24,height:24,borderRadius:t.xs,borderWidth:1,borderColor:r.brandBorder,backgroundColor:r.surface,alignItems:"center",justifyContent:"center"},boxChecked:{borderColor:r.brand,backgroundColor:r.brand},tick:{...O(e,"bold"),fontSize:a.size.caption,color:r.text.onBrand},copy:{flex:1,gap:o.xs},title:{...O(e,"bold"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.snug),color:r.text.primary},body:{...O(e,"regular"),fontSize:a.size.caption,lineHeight:Math.round(a.size.caption*a.lineHeight.snug),color:r.text.secondary},footnote:{...O(e,"regular"),fontSize:a.size.caption,lineHeight:Math.round(a.size.caption*a.lineHeight.snug),color:r.text.muted},notice:{gap:o.xs,paddingTop:o.xs},noticeText:{...O(e,"regular"),fontSize:a.size.caption,lineHeight:Math.round(a.size.caption*a.lineHeight.snug),color:r.errorRed},retry:{alignSelf:"flex-start",minHeight:44,justifyContent:"center"},retryLabel:{...O(e,"bold"),fontSize:a.size.caption,color:r.linkInk}})}n(Rt,"makeStyles");exports.CONSENT_COPY=S;exports.CONSENT_SCOPE_COPY=$;exports.CONSENT_VERSION_MAX=ne;exports.EVERFUR_CONSENT_SCOPES=M;exports.EverfurConsentToggle=Ct;exports.consentRowView=Q;exports.createConsentRepository=oe;exports.createConsentRepositoryOver=Ne;exports.isEverfurConsentScope=H;exports.useEverfurConsent=ue;exports.useEverfurConsentRepository=Ve;
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { E as EverfurConsentScope } from '../copy-UeUJVk8X.cjs';
4
+ export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy-UeUJVk8X.cjs';
5
+ import { E as EverfurError } from '../EverfurResult-DN9pL2Ab.cjs';
6
+ export { a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../EverfurResult-DN9pL2Ab.cjs';
7
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-C2-08BZW.cjs';
8
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config--Wu1Umhd.cjs';
9
+ export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids-B2GAAifq.cjs';
10
+ export { E as ErrorPolicyPort } from '../ErrorPolicyPort-CNf4uQZP.cjs';
11
+ import '../requestFunnel-BjDpqqvm.cjs';
12
+
13
+ interface EverfurConsentToggleProps {
14
+ /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
15
+ readonly scope: EverfurConsentScope;
16
+ /**
17
+ * Called with the settled answer after a decision lands, so a host can react (close a sheet, log its own
18
+ * analytics). A throw from it is swallowed by the SDK's host-callback guard and never reaches your tree.
19
+ */
20
+ readonly onChange?: (granted: boolean) => void;
21
+ /**
22
+ * Your own wording for a refusal, in place of the SDK's line. It runs inside the SDK's error boundary; a
23
+ * throw falls back to the SDK's own text. The RETRY control is always the SDK's, so replacing the wording
24
+ * can never remove the way out.
25
+ */
26
+ readonly renderNotice?: (error: EverfurError) => ReactNode;
27
+ /** Layout tokens only (spacing / surface). */
28
+ readonly style?: StyleProp<ViewStyle>;
29
+ }
30
+ /** One consent act the member can read and change, on the React Native band. */
31
+ declare function EverfurConsentToggle(props: EverfurConsentToggleProps): ReactNode;
32
+
33
+ export { EverfurConsentScope, EverfurConsentToggle, type EverfurConsentToggleProps, EverfurError };
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { E as EverfurConsentScope } from '../copy-DdVFDL01.js';
4
+ export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../copy-DdVFDL01.js';
5
+ import { E as EverfurError } from '../EverfurResult-DN9pL2Ab.js';
6
+ export { a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../EverfurResult-DN9pL2Ab.js';
7
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-CEi9GRFZ.js';
8
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config-C7eb_IMD.js';
9
+ export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids-B2GAAifq.js';
10
+ export { E as ErrorPolicyPort } from '../ErrorPolicyPort-CwbfmxzJ.js';
11
+ import '../requestFunnel-DFMGcluw.js';
12
+
13
+ interface EverfurConsentToggleProps {
14
+ /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
15
+ readonly scope: EverfurConsentScope;
16
+ /**
17
+ * Called with the settled answer after a decision lands, so a host can react (close a sheet, log its own
18
+ * analytics). A throw from it is swallowed by the SDK's host-callback guard and never reaches your tree.
19
+ */
20
+ readonly onChange?: (granted: boolean) => void;
21
+ /**
22
+ * Your own wording for a refusal, in place of the SDK's line. It runs inside the SDK's error boundary; a
23
+ * throw falls back to the SDK's own text. The RETRY control is always the SDK's, so replacing the wording
24
+ * can never remove the way out.
25
+ */
26
+ readonly renderNotice?: (error: EverfurError) => ReactNode;
27
+ /** Layout tokens only (spacing / surface). */
28
+ readonly style?: StyleProp<ViewStyle>;
29
+ }
30
+ /** One consent act the member can read and change, on the React Native band. */
31
+ declare function EverfurConsentToggle(props: EverfurConsentToggleProps): ReactNode;
32
+
33
+ export { EverfurConsentScope, EverfurConsentToggle, type EverfurConsentToggleProps, EverfurError };