@everfur/sdk 0.9.3 → 0.10.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 (135) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +17 -8
  3. package/dist/{Chat-Dy1L27a8.d.ts → Chat-DwGk5APA.d.ts} +3 -3
  4. package/dist/{Chat-Bkv-MLLu.d.cts → Chat-Ml-HlOiV.d.cts} +3 -3
  5. package/dist/{DepthViews-CBalhef3.d.cts → DepthViews-DAJySZqL.d.cts} +1 -1
  6. package/dist/{DepthViews-De6yb5Tq.d.ts → DepthViews-DwCS5KKh.d.ts} +1 -1
  7. package/dist/{DepthViews-eRdy2ayE.d.cts → DepthViews-PgA2KvTE.d.cts} +1 -1
  8. package/dist/{DepthViews-BwyzpEyX.d.ts → DepthViews-kM-_Mn2x.d.ts} +1 -1
  9. package/dist/animations/index.cjs +1 -1
  10. package/dist/animations/index.d.cts +3 -3
  11. package/dist/animations/index.d.ts +3 -3
  12. package/dist/animations/index.js +1 -1
  13. package/dist/{attachments-Brt7ivEo.d.ts → attachments-BH0vdghi.d.ts} +2 -2
  14. package/dist/{attachments-tPWJ0DJI.d.cts → attachments-BV1Mbqm-.d.cts} +5 -5
  15. package/dist/{attachments-BAcQdIz7.d.ts → attachments-DWv9stp1.d.ts} +5 -5
  16. package/dist/{attachments-DhGAelCA.d.cts → attachments-DaWeeeBW.d.cts} +2 -2
  17. package/dist/{bookingCopy-CJLAgEgK.d.ts → bookingCopy-Cc3Cl-IJ.d.ts} +2 -2
  18. package/dist/{bookingCopy-Ds2JGcPE.d.cts → bookingCopy-DRwrhDUe.d.cts} +2 -2
  19. package/dist/{casesRepository-D0aQSXkb.d.cts → casesRepository-BhfPDWhY.d.cts} +1 -1
  20. package/dist/{casesRepository-DjhMfm_n.d.ts → casesRepository-DMkRRKr8.d.ts} +1 -1
  21. package/dist/chat/index.cjs +7 -7
  22. package/dist/chat/index.d.cts +9 -9
  23. package/dist/chat/index.d.ts +9 -9
  24. package/dist/chat/index.js +7 -7
  25. package/dist/client/index.cjs +2 -2
  26. package/dist/client/index.d.cts +6 -6
  27. package/dist/client/index.d.ts +6 -6
  28. package/dist/client/index.js +2 -2
  29. package/dist/{config-DeUmccwl.d.ts → config-CuOczZUI.d.ts} +1 -1
  30. package/dist/{config-C68HTCf4.d.cts → config-lilR0260.d.cts} +1 -1
  31. package/dist/consent/index.cjs +1 -1
  32. package/dist/consent/index.d.cts +5 -5
  33. package/dist/consent/index.d.ts +5 -5
  34. package/dist/consent/index.js +1 -1
  35. package/dist/{context-DY9pcjdK.d.cts → context-BA6X6ZHd.d.cts} +13 -5
  36. package/dist/{context-D_2sCvoo.d.ts → context-CL3cR0MA.d.ts} +13 -5
  37. package/dist/{copy-wAnv8ldC.d.ts → copy-A2n7xXsL.d.ts} +2 -2
  38. package/dist/{copy-tYW0C83H.d.cts → copy-DkoUo0VR.d.cts} +2 -2
  39. package/dist/core/index.cjs +6 -7
  40. package/dist/core/index.d.cts +12 -12
  41. package/dist/core/index.d.ts +12 -12
  42. package/dist/core/index.js +6 -7
  43. package/dist/{depth-C7RIscDR.d.ts → depth-6_BYIt0s.d.ts} +2 -2
  44. package/dist/{depth-jbSWsweM.d.cts → depth-DOPtk0vF.d.cts} +2 -2
  45. package/dist/{entitlementRepository-D7Fc7OdG.d.ts → entitlementRepository-BE-L6vX1.d.ts} +2 -2
  46. package/dist/{entitlementRepository-Ccc6K6wB.d.cts → entitlementRepository-Blh38A2b.d.cts} +2 -2
  47. package/dist/{identity-BTT6YtH5.d.ts → identity-4lohfP2L.d.ts} +8 -2
  48. package/dist/{identity-ScajqjK5.d.cts → identity-YXqHjBln.d.cts} +8 -2
  49. package/dist/index.cjs +7 -8
  50. package/dist/index.d.cts +15 -14
  51. package/dist/index.d.ts +15 -14
  52. package/dist/index.js +7 -8
  53. package/dist/notifications/index.cjs +1 -1
  54. package/dist/notifications/index.d.cts +2 -2
  55. package/dist/notifications/index.d.ts +2 -2
  56. package/dist/notifications/index.js +1 -1
  57. package/dist/{pets-CqeoV1Jv.d.ts → pets-DzXi_9hY.d.ts} +1 -1
  58. package/dist/{pets-uKMldfz0.d.cts → pets-m61lisZt.d.cts} +1 -1
  59. package/dist/{petsRepository-BdfbY9Oe.d.ts → petsRepository-B1I6Lq_m.d.ts} +1 -1
  60. package/dist/{petsRepository-BYe7_MUo.d.cts → petsRepository-CQeuDdDC.d.cts} +1 -1
  61. package/dist/photo/index.cjs +1 -1
  62. package/dist/photo/index.js +1 -1
  63. package/dist/{ports-D4FQKTBS.d.ts → ports-CrGAcey9.d.ts} +6 -4
  64. package/dist/{ports-okLpXkpu.d.cts → ports-DUqO_XX0.d.cts} +6 -4
  65. package/dist/records/depth/index.cjs +3 -3
  66. package/dist/records/depth/index.d.cts +7 -7
  67. package/dist/records/depth/index.d.ts +7 -7
  68. package/dist/records/depth/index.js +3 -3
  69. package/dist/records/index.cjs +7 -7
  70. package/dist/records/index.d.cts +9 -9
  71. package/dist/records/index.d.ts +9 -9
  72. package/dist/records/index.js +7 -7
  73. package/dist/{requestFunnel-Dhaj0yUq.d.ts → requestFunnel-B86gQFka.d.ts} +2 -2
  74. package/dist/{requestFunnel-u8qnM5Ll.d.cts → requestFunnel-hXkP5T7K.d.cts} +2 -2
  75. package/dist/{runtimeTypes-C67itXfp.d.cts → runtimeTypes-Bt_tIj3h.d.cts} +29 -5
  76. package/dist/{runtimeTypes-BFes64Vp.d.ts → runtimeTypes-DXKxY2yq.d.ts} +29 -5
  77. package/dist/server/events/index.cjs +2 -2
  78. package/dist/server/events/index.d.cts +25 -6
  79. package/dist/server/events/index.d.ts +25 -6
  80. package/dist/server/events/index.js +2 -2
  81. package/dist/server/index.cjs +4 -4
  82. package/dist/server/index.d.cts +5 -4
  83. package/dist/server/index.d.ts +5 -4
  84. package/dist/server/index.js +4 -4
  85. package/dist/televet/booking/index.cjs +18 -15
  86. package/dist/televet/booking/index.d.cts +6 -6
  87. package/dist/televet/booking/index.d.ts +6 -6
  88. package/dist/televet/booking/index.js +19 -16
  89. package/dist/televet/index.cjs +1 -1
  90. package/dist/televet/index.js +1 -1
  91. package/dist/testing/index.d.cts +1 -1
  92. package/dist/testing/index.d.ts +1 -1
  93. package/dist/testing/rn/index.cjs +1 -1
  94. package/dist/testing/rn/index.d.cts +7 -7
  95. package/dist/testing/rn/index.d.ts +7 -7
  96. package/dist/testing/rn/index.js +1 -1
  97. package/dist/testing/web/index.cjs +1 -1
  98. package/dist/testing/web/index.d.cts +7 -7
  99. package/dist/testing/web/index.d.ts +7 -7
  100. package/dist/testing/web/index.js +1 -1
  101. package/dist/{timelineRows-pd4wYVbe.d.ts → timelineRows-C2ObTmfN.d.ts} +1 -1
  102. package/dist/{timelineRows-CDSO3ElK.d.cts → timelineRows-CrA-ePrQ.d.cts} +1 -1
  103. package/dist/{useRecordsDepth-W3UAKQRN.d.cts → useRecordsDepth-Dcr9y6i-.d.cts} +1 -1
  104. package/dist/{useRecordsDepth-CqSMkcyR.d.ts → useRecordsDepth-NQNJaGyk.d.ts} +1 -1
  105. package/dist/video/index.cjs +1 -1
  106. package/dist/video/index.js +1 -1
  107. package/dist/{view-CKfIaJYp.d.ts → view-DWJa2L0U.d.ts} +2 -2
  108. package/dist/{view-h7RPJAEe.d.cts → view-Dk7xpBJ4.d.cts} +2 -2
  109. package/dist/web/consent/index.cjs +1 -1
  110. package/dist/web/consent/index.d.cts +5 -5
  111. package/dist/web/consent/index.d.ts +5 -5
  112. package/dist/web/consent/index.js +1 -1
  113. package/dist/web/index.cjs +7 -8
  114. package/dist/web/index.d.cts +17 -16
  115. package/dist/web/index.d.ts +17 -16
  116. package/dist/web/index.js +7 -8
  117. package/dist/web/notifications/index.cjs +1 -1
  118. package/dist/web/notifications/index.d.cts +3 -3
  119. package/dist/web/notifications/index.d.ts +3 -3
  120. package/dist/web/notifications/index.js +1 -1
  121. package/dist/web/records/depth/index.cjs +3 -3
  122. package/dist/web/records/depth/index.d.cts +7 -7
  123. package/dist/web/records/depth/index.d.ts +7 -7
  124. package/dist/web/records/depth/index.js +3 -3
  125. package/dist/web/records/index.cjs +7 -7
  126. package/dist/web/records/index.d.cts +9 -9
  127. package/dist/web/records/index.d.ts +9 -9
  128. package/dist/web/records/index.js +7 -7
  129. package/dist/web/televet/booking/index.cjs +4 -4
  130. package/dist/web/televet/booking/index.d.cts +6 -6
  131. package/dist/web/televet/booking/index.d.ts +6 -6
  132. package/dist/web/televet/booking/index.js +4 -4
  133. package/dist/web/televet/index.cjs +1 -1
  134. package/dist/web/televet/index.js +1 -1
  135. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
1
  import { b as EverfurErrorCode } from '../EverfurError-DeBqRpQV.cjs';
2
2
  export { A as AUTO_RETRYABLE_CODES, B as BACKOFF_BASE_MS, d as BACKOFF_CAP_MS, e as EVERFUR_ERROR_CATEGORIES, f as EVERFUR_ERROR_CODES, E as EverfurError, a as EverfurErrorCategory, M as MAX_RETRY_ATTEMPTS, g as MakeEverfurErrorOptions, R as RETRYABLE_CONTRACT_CODES, h as backoffDelayMs, j as canRecreateOnNotFound, c as categoryFor, k as fromHttpStatus, l as fromWire, m as isAutoRetryable, i as isRetryableCode, n as makeEverfurError, s as shouldRetry, u as userFacingError } from '../EverfurError-DeBqRpQV.cjs';
3
3
  export { a as EverfurConfigError, E as EverfurResult, b as EverfurThrownError, e as err, i as isErr, c as isOk, o as ok, u as unwrap } from '../EverfurResult-COlXj1wq.cjs';
4
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config-C68HTCf4.cjs';
4
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config-lilR0260.cjs';
5
5
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids-B2GAAifq.cjs';
6
- export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-ScajqjK5.cjs';
6
+ export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-YXqHjBln.cjs';
7
7
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve-D4Ywz5OS.cjs';
8
- export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository-Ccc6K6wB.cjs';
8
+ export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository-Blh38A2b.cjs';
9
9
  import { m as EverfurTheme } from '../tokens-DLj8OnLH.cjs';
10
10
  export { D as DEFAULT_MAX_FONT_SCALE, w as EASING_CURVES, x as EVERFUR_DARK, y as EVERFUR_LIGHT, E as EverfurColorTokens, z as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, c as EverfurFontSource, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, A as EverfurTextScaleTier, n as EverfurThemeMeta, o as EverfurThemeSlot, p as EverfurThemeSlotKey, q as EverfurThemeSlotName, r as EverfurThemeSlots, s as EverfurTypeSizeTokens, t as EverfurTypeTokens, u as EverfurWeightTokens, S as SLOT_MIN_BORDER_CONTRAST, B as SLOT_MIN_CONTRAST, C as SYSTEM_FONT_FAMILY, F as SYSTEM_MONO_FAMILY, G as SlotGrounds, H as SlotSurrounds, I as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, v as THEME_SLOT_NAMES, J as cssCubicBezier, K as deepFreeze, L as guardSlotContrast, M as mergeThemeSlots, N as parseThemeSlots } from '../tokens-DLj8OnLH.cjs';
11
11
  export { E as EverfurFaceStyle, a as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as themeAdjustments, w as withServerBranding } from '../typeStyle-DJedEu14.cjs';
12
12
  export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, C as ClientBranding, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, h as EverfurThemeFontFaceKey, i as EverfurThemeFontUrlsInput, j as EverfurThemeFontsInput, E as EverfurThemeInput, k as EverfurThemeSlotInput, l as EverfurThemeSlotsInput, L as LOCKABLE_THEME_FIELDS, n as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, o as SLOT_LOCK_PREFIX, p as SlotLockName, S as SurfaceStyle, T as THEME_SCHEMA_VERSIONS, q as ThemeLockName, m as expandAppearance, r as hardenBrandAssetUrl, s as hardenHttpsUrl, t as isEmptyBranding, u as isKnownBrandingSchema, v as lockedFieldsOf, w as parseClientBranding, x as parsePx } from '../branding-BCfwLj0h.cjs';
13
- export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel-u8qnM5Ll.cjs';
14
- export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository-BYe7_MUo.cjs';
15
- export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository-D0aQSXkb.cjs';
13
+ export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel-hXkP5T7K.cjs';
14
+ export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository-CQeuDdDC.cjs';
15
+ export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository-BhfPDWhY.cjs';
16
16
  import '../ErrorPolicyPort-10s3HJCt.cjs';
17
17
  import '../profile-CSs1wlXT.cjs';
18
18
 
@@ -1,18 +1,18 @@
1
1
  import { b as EverfurErrorCode } from '../EverfurError-DeBqRpQV.js';
2
2
  export { A as AUTO_RETRYABLE_CODES, B as BACKOFF_BASE_MS, d as BACKOFF_CAP_MS, e as EVERFUR_ERROR_CATEGORIES, f as EVERFUR_ERROR_CODES, E as EverfurError, a as EverfurErrorCategory, M as MAX_RETRY_ATTEMPTS, g as MakeEverfurErrorOptions, R as RETRYABLE_CONTRACT_CODES, h as backoffDelayMs, j as canRecreateOnNotFound, c as categoryFor, k as fromHttpStatus, l as fromWire, m as isAutoRetryable, i as isRetryableCode, n as makeEverfurError, s as shouldRetry, u as userFacingError } from '../EverfurError-DeBqRpQV.js';
3
3
  export { a as EverfurConfigError, E as EverfurResult, b as EverfurThrownError, e as err, i as isErr, c as isOk, o as ok, u as unwrap } from '../EverfurResult-ClPTS0P2.js';
4
- export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config-DeUmccwl.js';
4
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, B as ByteSource, C as ClientConfigFailure, k as ClientConfigFailureReason, l as ClientConfigOutcome, m as DEFAULT_CONTRACT_VERSION, D as DeltaFrame, c as DoneFrame, n as EMPTY_FRAME_ARRAYS, o as ENV_API_BASE_URL, E as ErrorFrame, p as EventSourceFactory, q as EventSourceInit, r as EventSourceLike, s as EventSourceMessage, t as EverfurConfig, d as EverfurRequest, e as EverfurRequestBase, u as FetchInit, j as FetchLike, v as FetchResponseLike, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, R as RawResponse, w as ReadableStreamLike, x as ResolveClientConfigOptions, y as ResolvedClientConfig, S as SDK_PLATFORM, z as SDK_VERSION, G as SdkPlatform, I as ServerRequestIdSource, J as TransportDeps, T as TransportPort, U as UnknownFrame, i as UrgencyLevel, K as acceptedFrame, L as analysisCompleteFrame, N as analysisStartedFrame, O as assertNever, P as bufferedTextByteSource, Q as buildBaseHeaders, V as checkPublishableKey, W as createHttpTransport, X as deltaFrame, Y as doneFrame, Z as errorFrame, _ as errorFromResponse, $ as eventSourceByteSource, a0 as eventSourceRequestId, a1 as fetchByteSource, a2 as getGlobalFetch, a3 as heartbeatFrame, a4 as networkError, a5 as parseSse, a6 as requestIdOf, a7 as requestJson, a8 as requestRaw, a9 as resolveApiBaseUrl, aa as resolveClientConfig, ab as tryResolveApiBaseUrl, ac as tryResolveClientConfig, ad as unknownFrame } from '../config-CuOczZUI.js';
5
5
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids-B2GAAifq.js';
6
- export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-BTT6YtH5.js';
6
+ export { A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, a as authHeaders, b as authedSend, c as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity-4lohfP2L.js';
7
7
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve-D4Ywz5OS.js';
8
- export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository-D7Fc7OdG.js';
8
+ export { E as ENTITLEMENTS_PATH, a as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository-BE-L6vX1.js';
9
9
  import { m as EverfurTheme } from '../tokens-DLj8OnLH.js';
10
10
  export { D as DEFAULT_MAX_FONT_SCALE, w as EASING_CURVES, x as EVERFUR_DARK, y as EVERFUR_LIGHT, E as EverfurColorTokens, z as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, c as EverfurFontSource, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, A as EverfurTextScaleTier, n as EverfurThemeMeta, o as EverfurThemeSlot, p as EverfurThemeSlotKey, q as EverfurThemeSlotName, r as EverfurThemeSlots, s as EverfurTypeSizeTokens, t as EverfurTypeTokens, u as EverfurWeightTokens, S as SLOT_MIN_BORDER_CONTRAST, B as SLOT_MIN_CONTRAST, C as SYSTEM_FONT_FAMILY, F as SYSTEM_MONO_FAMILY, G as SlotGrounds, H as SlotSurrounds, I as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, v as THEME_SLOT_NAMES, J as cssCubicBezier, K as deepFreeze, L as guardSlotContrast, M as mergeThemeSlots, N as parseThemeSlots } from '../tokens-DLj8OnLH.js';
11
11
  export { E as EverfurFaceStyle, a as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as themeAdjustments, w as withServerBranding } from '../typeStyle-BxVyF71R.js';
12
12
  export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, C as ClientBranding, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, h as EverfurThemeFontFaceKey, i as EverfurThemeFontUrlsInput, j as EverfurThemeFontsInput, E as EverfurThemeInput, k as EverfurThemeSlotInput, l as EverfurThemeSlotsInput, L as LOCKABLE_THEME_FIELDS, n as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, o as SLOT_LOCK_PREFIX, p as SlotLockName, S as SurfaceStyle, T as THEME_SCHEMA_VERSIONS, q as ThemeLockName, m as expandAppearance, r as hardenBrandAssetUrl, s as hardenHttpsUrl, t as isEmptyBranding, u as isKnownBrandingSchema, v as lockedFieldsOf, w as parseClientBranding, x as parsePx } from '../branding-DJf4h12Q.js';
13
- export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel-Dhaj0yUq.js';
14
- export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository-BdfbY9Oe.js';
15
- export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository-DjhMfm_n.js';
13
+ export { F as FunnelSendOptions, R as RequestFunnel, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel-B86gQFka.js';
14
+ export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository-B1I6Lq_m.js';
15
+ export { b as CHECKIN_ANSWERS, c as CasesRepository, C as CheckinAnswer, a as CheckinOutcome, W as WatchCase, d as createCasesRepository } from '../casesRepository-DMkRRKr8.js';
16
16
  import '../ErrorPolicyPort-C3nNSS_j.js';
17
17
  import '../profile-CSs1wlXT.js';
18
18
 
@@ -87,11 +87,11 @@ import{z}from"zod";var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
87
87
  /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
88
88
  /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}function contractDocUrl(entry){return entry.envelope==="sse_frame"?`/errors#sse-${entry.wireCode}`:entry.envelope==="oauth_error"?`/errors#oauth-${entry.wireCode}`:`/errors#${entry.wireCode}`}var DOC_SITE_ORIGIN=null;function publishedDocUrl(entry){return null}var EVERFUR_ERROR_CODES=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),EVERFUR_ERROR_CATEGORIES=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}function fromHttpStatus(status){return status===401?"authExpired":status===403?"accessDenied":status===404?"conversationNotFound":status===409?"idempotencyConflict":status===421?"unknown":status===429?"rateLimited":status===400||status===422?"unknown":status>=500?"internalError":"unknown"}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}function shouldRetry(code,frameRetryable=false){return frameRetryable||isAutoRetryable(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}function canRecreateOnNotFound(code){return code==="conversationNotFound"}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
89
89
  return Object.freeze(warning===void 0?{ok:true,value:value}:{ok:true,value:value,warning:warning})}function err(error){/* @__PURE__ */
90
- return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var SDK_VERSION="0.9.3",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
90
+ return Object.freeze({ok:false,error:error})}function isOk(r){return r.ok}function isErr(r){return!r.ok}var EverfurThrownError=class _EverfurThrownError extends Error{constructor(error){super(`${error.code}: ${error.displayMessage}`),this.name="EverfurThrownError",this.error=error,this.code=error.code,this.category=error.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(r){if(r.ok)return r.value;throw new EverfurThrownError(r.error)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var SDK_VERSION="0.10.0",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
91
91
  return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function checkPublishableKey(raw){let publishableKey=typeof raw=="string"?raw.trim():"";return publishableKey.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(publishableKey)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(config,options){let keyFailure=checkPublishableKey(config?.publishableKey);if(keyFailure!==null)/* @__PURE__ */
92
92
  return Object.freeze({ok:false,failure:keyFailure});let publishableKey=config.publishableKey.trim(),baseUrl=tryResolveApiBaseUrl(config.apiBaseUrl);if(!baseUrl.ok)return baseUrl;let contractVersion=config.contractVersion?.trim()||DEFAULT_CONTRACT_VERSION;/* @__PURE__ */
93
93
  return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:publishableKey,apiBaseUrl:baseUrl.value,contractVersion:contractVersion,sdkVersion:SDK_VERSION,platform:options?.platform??SDK_PLATFORM,debug:config.debug===true})})}function resolveClientConfig(config,options){let outcome=tryResolveClientConfig(config,options);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.config}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(apiBaseUrl){let outcome=tryResolveApiBaseUrl(apiBaseUrl);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.value}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host){return host.length===0||host.includes("@")?false:host.startsWith("[")&&host.endsWith("]")?true:!host.includes(":")}function canEchoOrigin(rawTrimmed,host){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host)}function safeOrigin(scheme,host){return`${scheme}://${host}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host=hostOf(match[2]);if(host.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host)?`: ${safeOrigin(scheme,host)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
94
- return Object.freeze({ok:true,value:value})}function isLoopbackHost(hostname){let host=hostname.toLowerCase();return host==="localhost"||host==="127.0.0.1"||host==="[::1]"||host==="::1"}function readEnv(name){let value=globalThis.process?.env?.[name];return typeof value=="string"&&value.trim().length>0?value.trim():void 0}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var MAX_USER_REF_LEN=128,MAX_PET_REF_LEN=128,CONTROL_CHAR=/[\u0000-\u001F\u007F]/,UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function petRef(raw){let v=raw,length=serverLength(v);if(length===0||length>MAX_PET_REF_LEN)throw new EverfurConfigError("invalid-argument",`petRef must be 1..${MAX_PET_REF_LEN} characters`);if(CONTROL_CHAR.test(v))throw new EverfurConfigError("invalid-argument","petRef must be printable (no control characters)");return v}function userRef(raw){let v=raw,length=serverLength(v);if(length===0||length>MAX_USER_REF_LEN)throw new EverfurConfigError("invalid-argument",`userRef must be 1..${MAX_USER_REF_LEN} characters`);if(v.includes("@"))throw new EverfurConfigError("invalid-argument","userRef must not contain '@'");if(CONTROL_CHAR.test(v))throw new EverfurConfigError("invalid-argument","userRef must be printable (no control characters)");return v}function conversationId(raw){if(!UUID_RE.test(raw))throw new EverfurConfigError("invalid-argument","conversationId must be a UUID");return raw}function unsafePetRef(raw){return raw}function unsafeUserRef(raw){return raw}function unsafeConversationId(raw){return raw}function unsafeResponseId(raw){return raw}function unsafeClientId(raw){return raw}function unsafeDocumentId(raw){return raw}function unsafeJobId(raw){return raw}function unsafeRecordsRequestId(raw){return raw}function createIdentityProvider(userRef2,getToken,onMinted){let cached=null,inFlight=null,revoked=false,load=()=>inFlight||(inFlight=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight=null}})(),inFlight);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}var EMPTY_STRINGS=/* @__PURE__ */Object.freeze([]),EMPTY_MAPS=/* @__PURE__ */Object.freeze([]);function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
94
+ return Object.freeze({ok:true,value:value})}function isLoopbackHost(hostname){let host=hostname.toLowerCase();return host==="localhost"||host==="127.0.0.1"||host==="[::1]"||host==="::1"}function readEnv(name){let value=globalThis.process?.env?.[name];return typeof value=="string"&&value.trim().length>0?value.trim():void 0}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var MAX_USER_REF_LEN=128,MAX_PET_REF_LEN=128,CONTROL_CHAR=/[\u0000-\u001F\u007F]/,UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function petRef(raw){let v=raw,length=serverLength(v);if(length===0||length>MAX_PET_REF_LEN)throw new EverfurConfigError("invalid-argument",`petRef must be 1..${MAX_PET_REF_LEN} characters`);if(CONTROL_CHAR.test(v))throw new EverfurConfigError("invalid-argument","petRef must be printable (no control characters)");return v}function userRef(raw){let v=raw,length=serverLength(v);if(length===0||length>MAX_USER_REF_LEN)throw new EverfurConfigError("invalid-argument",`userRef must be 1..${MAX_USER_REF_LEN} characters`);if(v.includes("@"))throw new EverfurConfigError("invalid-argument","userRef must not contain '@'");if(CONTROL_CHAR.test(v))throw new EverfurConfigError("invalid-argument","userRef must be printable (no control characters)");return v}function conversationId(raw){if(!UUID_RE.test(raw))throw new EverfurConfigError("invalid-argument","conversationId must be a UUID");return raw}function unsafePetRef(raw){return raw}function unsafeUserRef(raw){return raw}function unsafeConversationId(raw){return raw}function unsafeResponseId(raw){return raw}function unsafeClientId(raw){return raw}function unsafeDocumentId(raw){return raw}function unsafeJobId(raw){return raw}function unsafeRecordsRequestId(raw){return raw}function createIdentityProvider(userRef2,getToken,onMinted,onRejected){let cached=null,rejectionReported=false,inFlight=null,revoked=false,load=()=>inFlight||(inFlight=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,rejectionReported=!1,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight=null}})(),inFlight);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null},reportRejected(){revoked||rejectionReported||(rejectionReported=true,onRejected?.())}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(authRejectedError(retry.error.httpStatus))):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}var EMPTY_STRINGS=/* @__PURE__ */Object.freeze([]),EMPTY_MAPS=/* @__PURE__ */Object.freeze([]);function acceptedFrame(streamId,lastEventId,serverRequestId=null){/* @__PURE__ */
95
95
  return Object.freeze({kind:"accepted",streamId:streamId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function heartbeatFrame(lastEventId,serverRequestId=null){/* @__PURE__ */
96
96
  return Object.freeze({kind:"heartbeat",lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function deltaFrame(delta,lastEventId,serverRequestId=null){/* @__PURE__ */
97
97
  return Object.freeze({kind:"delta",delta:delta,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function doneFrame(fields,serverRequestId=null){/* @__PURE__ */
@@ -409,7 +409,7 @@ declare function getGlobalFetch(): FetchLike;
409
409
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
410
410
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
411
411
  */
412
- declare const SDK_VERSION = "0.9.3";
412
+ declare const SDK_VERSION = "0.10.0";
413
413
  /**
414
414
  * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
415
415
  *
@@ -409,7 +409,7 @@ declare function getGlobalFetch(): FetchLike;
409
409
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
410
410
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
411
411
  */
412
- declare const SDK_VERSION = "0.9.3";
412
+ declare const SDK_VERSION = "0.10.0";
413
413
  /**
414
414
  * The platforms this package ships an entry point for, as the wire names them (X-Everfur-SDK-Platform).
415
415
  *
@@ -88,7 +88,7 @@
88
88
  /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
89
89
  return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
90
90
  return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
91
- return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
91
+ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(authRejectedError(retry.error.httpStatus))):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
92
92
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
93
93
  return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' 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 ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
94
94
  return Object.freeze({scope:scope,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:error})}function settled(verdict){/* @__PURE__ */
@@ -1,15 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
- import { E as EverfurConsentScope } from '../copy-tYW0C83H.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-tYW0C83H.cjs';
3
+ import { E as EverfurConsentScope } from '../copy-DkoUo0VR.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-DkoUo0VR.cjs';
5
5
  import { E as EverfurError } from '../EverfurError-DeBqRpQV.cjs';
6
6
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError-DeBqRpQV.cjs';
7
- export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-ScajqjK5.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-C68HTCf4.cjs';
7
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-YXqHjBln.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-lilR0260.cjs';
9
9
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids-B2GAAifq.cjs';
10
10
  export { E as EverfurResult } from '../EverfurResult-COlXj1wq.cjs';
11
11
  export { E as ErrorPolicyPort } from '../ErrorPolicyPort-10s3HJCt.cjs';
12
- import '../requestFunnel-u8qnM5Ll.cjs';
12
+ import '../requestFunnel-hXkP5T7K.cjs';
13
13
 
14
14
  interface EverfurConsentToggleProps {
15
15
  /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
@@ -1,15 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
- import { E as EverfurConsentScope } from '../copy-wAnv8ldC.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-wAnv8ldC.js';
3
+ import { E as EverfurConsentScope } from '../copy-A2n7xXsL.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-A2n7xXsL.js';
5
5
  import { E as EverfurError } from '../EverfurError-DeBqRpQV.js';
6
6
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError-DeBqRpQV.js';
7
- export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-BTT6YtH5.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-DeUmccwl.js';
7
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity-4lohfP2L.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-CuOczZUI.js';
9
9
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids-B2GAAifq.js';
10
10
  export { E as EverfurResult } from '../EverfurResult-ClPTS0P2.js';
11
11
  export { E as ErrorPolicyPort } from '../ErrorPolicyPort-C3nNSS_j.js';
12
- import '../requestFunnel-Dhaj0yUq.js';
12
+ import '../requestFunnel-B86gQFka.js';
13
13
 
14
14
  interface EverfurConsentToggleProps {
15
15
  /** Which act this row is. One row is one act; two acts are two rows, never one switch. */
@@ -88,7 +88,7 @@ import{createContext,forwardRef,createElement,useMemo,useState,useRef,useCallbac
88
88
  /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
89
89
  return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
90
90
  return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
91
- return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
91
+ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return ctx.identity.reportRejected?.(),err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(authRejectedError(retry.error.httpStatus))):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled2;try{settled2=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled2=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled2.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled2;let error=settled2.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
92
92
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
93
93
  return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var CONSENT_PATH="/widget/v1/consent",EVERFUR_CONSENT_SCOPES=/* @__PURE__ */Object.freeze(["transcript_exposure","partner_context"]),RECORDS_CONTENT_SCOPE="records_content",CONSENT_VERSION_MAX=64,SCOPES=new Set(EVERFUR_CONSENT_SCOPES);function isEverfurConsentScope(value){return typeof value=="string"&&SCOPES.has(value)}function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function validateScope(scope){return isEverfurConsentScope(scope)?null:invalid(scope===RECORDS_CONTENT_SCOPE?`'${RECORDS_CONTENT_SCOPE}' 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 ${EVERFUR_CONSENT_SCOPES.join(", ")}`)}function validateDecision(decision){if(typeof decision!="object"||decision===null)return invalid("write needs a decision object");let{scope:scope,granted:granted,consentVersion:consentVersion}=decision,badScope=validateScope(scope);return badScope!==null?badScope:typeof granted!="boolean"?invalid("granted must be true to grant or false to withdraw"):consentVersion!==void 0&&(typeof consentVersion!="string"||consentVersion.length===0||consentVersion.length>CONSENT_VERSION_MAX)?invalid(`consentVersion must be 1..${CONSENT_VERSION_MAX} characters`):null}var str=value=>typeof value=="string"&&value.length>0?value:null;function verdictFromWire(raw,scope){if(typeof raw!="object"||raw===null)return null;let o=raw;return typeof o.granted!="boolean"||typeof o.has_decision!="boolean"?null:/* @__PURE__ */Object.freeze({scope:scope,granted:o.granted,hasDecision:o.has_decision,consentVersion:str(o.consent_version),actor:str(o.actor),recordedAt:str(o.recorded_at)})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no granted/has_decision pair`})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createConsentRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createConsentRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(scope,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(scope,opts),write:(decision,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("write"))):over().write(decision,opts)}}function createConsentRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async read(scope,opts){let bad=validateScope(scope);if(bad!==null)return err(bad);let res=await funnel.send("consent.read",withSignal({method:"GET",path:CONSENT_PATH,query:{scope:scope}},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,scope);return verdict===null?err(malformed("consent.read")):ok(verdict)},async write(decision,opts){let bad=validateDecision(decision);if(bad!==null)return err(bad);let body={scope:decision.scope,granted:decision.granted};decision.consentVersion!==void 0&&(body.consent_version=decision.consentVersion);let res=await funnel.send("consent.write",withSignal({method:"PUT",path:CONSENT_PATH,body:body},opts?.signal));if(!res.ok)return err(res.error);let verdict=verdictFromWire(res.value,decision.scope);return verdict===null?err(malformed("consent.write")):ok(verdict)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function blank(scope,error){/* @__PURE__ */
94
94
  return Object.freeze({scope:scope,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:error})}function settled(verdict){/* @__PURE__ */
@@ -1,18 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { U as UserRef, P as PetRef } from './ids-B2GAAifq.cjs';
3
3
  import { C as CapabilityName, a as CapabilityDecision } from './resolve-D4Ywz5OS.cjs';
4
- import { T as TokenProvider } from './identity-ScajqjK5.cjs';
5
- import { T as TransportPort } from './config-C68HTCf4.cjs';
4
+ import { S as SecureStorePort, c as LogSink, a as EverfurEventHandler, g as EverfurRuntime } from './runtimeTypes-Bt_tIj3h.cjs';
5
+ import { T as TokenProvider } from './identity-YXqHjBln.cjs';
6
+ import { T as TransportPort } from './config-lilR0260.cjs';
6
7
  import { K as KvPort, I as ImageCachePort } from './cacheEpoch-DknKn3S0.cjs';
7
- import { S as SecureStorePort, b as LogSink, e as EverfurRuntime } from './runtimeTypes-C67itXfp.cjs';
8
8
  import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.cjs';
9
9
  import { E as ErrorPolicyPort } from './ErrorPolicyPort-10s3HJCt.cjs';
10
10
  import { C as CameraPort } from './CameraPort-Cv31Pz7g.cjs';
11
11
  import { U as UploadTransport } from './ports-BN6RHF9W.cjs';
12
- import { U as UploadPort } from './ports-okLpXkpu.cjs';
12
+ import { U as UploadPort } from './ports-DUqO_XX0.cjs';
13
13
  import { E as EverfurThemeInput } from './branding-BCfwLj0h.cjs';
14
14
  import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
15
- import { b as WidgetPetProfile } from './petsRepository-BYe7_MUo.cjs';
15
+ import { b as WidgetPetProfile } from './petsRepository-CQeuDdDC.cjs';
16
16
  import { m as EverfurTheme } from './tokens-DLj8OnLH.cjs';
17
17
 
18
18
  interface EverfurConfig {
@@ -47,6 +47,14 @@ interface EverfurConfig {
47
47
  readonly imageCache?: ImageCachePort;
48
48
  /** Structured, redacted LogPort events when true. */
49
49
  readonly debug?: boolean;
50
+ /**
51
+ * Lifecycle events: `ready`, `error`, `session_expired`, `conversation_started` (see `EverfurClientEvent`).
52
+ * Delivered asynchronously, never during a render. The latest function you pass is the one called, so an
53
+ * inline arrow is fine. A throw from it is reported on `console.error` and ignored. Best effort at teardown:
54
+ * an event still queued when the provider unmounts (or rebuilds for a new key or base URL) is dropped, and a
55
+ * session refusal that lands during `logout()` is not reported.
56
+ */
57
+ readonly onEvent?: EverfurEventHandler;
50
58
  }
51
59
  /**
52
60
  * Identity handed to the provider: the partner's opaque user id + a lazy token minter (SPEC-00 §4.3). The
@@ -1,18 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { U as UserRef, P as PetRef } from './ids-B2GAAifq.js';
3
3
  import { C as CapabilityName, a as CapabilityDecision } from './resolve-D4Ywz5OS.js';
4
- import { T as TokenProvider } from './identity-BTT6YtH5.js';
5
- import { T as TransportPort } from './config-DeUmccwl.js';
4
+ import { S as SecureStorePort, c as LogSink, a as EverfurEventHandler, g as EverfurRuntime } from './runtimeTypes-DXKxY2yq.js';
5
+ import { T as TokenProvider } from './identity-4lohfP2L.js';
6
+ import { T as TransportPort } from './config-CuOczZUI.js';
6
7
  import { K as KvPort, I as ImageCachePort } from './cacheEpoch-DknKn3S0.js';
7
- import { S as SecureStorePort, b as LogSink, e as EverfurRuntime } from './runtimeTypes-BFes64Vp.js';
8
8
  import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.js';
9
9
  import { E as ErrorPolicyPort } from './ErrorPolicyPort-C3nNSS_j.js';
10
10
  import { C as CameraPort } from './CameraPort-Cv31Pz7g.js';
11
11
  import { U as UploadTransport } from './ports-BN6RHF9W.js';
12
- import { U as UploadPort } from './ports-D4FQKTBS.js';
12
+ import { U as UploadPort } from './ports-CrGAcey9.js';
13
13
  import { E as EverfurThemeInput } from './branding-DJf4h12Q.js';
14
14
  import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
15
- import { b as WidgetPetProfile } from './petsRepository-BdfbY9Oe.js';
15
+ import { b as WidgetPetProfile } from './petsRepository-B1I6Lq_m.js';
16
16
  import { m as EverfurTheme } from './tokens-DLj8OnLH.js';
17
17
 
18
18
  interface EverfurConfig {
@@ -47,6 +47,14 @@ interface EverfurConfig {
47
47
  readonly imageCache?: ImageCachePort;
48
48
  /** Structured, redacted LogPort events when true. */
49
49
  readonly debug?: boolean;
50
+ /**
51
+ * Lifecycle events: `ready`, `error`, `session_expired`, `conversation_started` (see `EverfurClientEvent`).
52
+ * Delivered asynchronously, never during a render. The latest function you pass is the one called, so an
53
+ * inline arrow is fine. A throw from it is reported on `console.error` and ignored. Best effort at teardown:
54
+ * an event still queued when the provider unmounts (or rebuilds for a new key or base URL) is dropped, and a
55
+ * session refusal that lands during `logout()` is not reported.
56
+ */
57
+ readonly onEvent?: EverfurEventHandler;
50
58
  }
51
59
  /**
52
60
  * Identity handed to the provider: the partner's opaque user id + a lazy token minter (SPEC-00 §4.3). The
@@ -1,7 +1,7 @@
1
1
  import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
2
2
  import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
3
- import { R as RequestFunnel } from './requestFunnel-Dhaj0yUq.js';
4
- import { A as AuthContext } from './identity-BTT6YtH5.js';
3
+ import { R as RequestFunnel } from './requestFunnel-B86gQFka.js';
4
+ import { A as AuthContext } from './identity-4lohfP2L.js';
5
5
  import { U as UserRef } from './ids-B2GAAifq.js';
6
6
  import { E as ErrorPolicyPort } from './ErrorPolicyPort-C3nNSS_j.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
2
2
  import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
3
- import { R as RequestFunnel } from './requestFunnel-u8qnM5Ll.cjs';
4
- import { A as AuthContext } from './identity-ScajqjK5.cjs';
3
+ import { R as RequestFunnel } from './requestFunnel-hXkP5T7K.cjs';
4
+ import { A as AuthContext } from './identity-YXqHjBln.cjs';
5
5
  import { U as UserRef } from './ids-B2GAAifq.cjs';
6
6
  import { E as ErrorPolicyPort } from './ErrorPolicyPort-10s3HJCt.cjs';
7
7