@everfur/sdk 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +220 -0
  2. package/README.md +9 -8
  3. package/dist/{Chat-BZZ-Py5l.d.ts → Chat-Rzplrf5M.d.ts} +17 -3
  4. package/dist/{Chat-Dq4fffIO.d.cts → Chat-ypo6miKm.d.cts} +17 -3
  5. package/dist/{DepthViews-BG3E25MD.d.ts → DepthViews-CeTfPUBX.d.ts} +1 -1
  6. package/dist/{DepthViews-B_hIypI6.d.cts → DepthViews-ClykXOJj.d.cts} +1 -1
  7. package/dist/{DepthViews-CL75jyRA.d.cts → DepthViews-Cui3oonj.d.cts} +1 -1
  8. package/dist/{DepthViews-CkYri51q.d.ts → DepthViews-baYLMNQ-.d.ts} +1 -1
  9. package/dist/{ErrorPolicyPort-CwbfmxzJ.d.ts → ErrorPolicyPort-D22LUVrK.d.ts} +1 -1
  10. package/dist/{ErrorPolicyPort-CNf4uQZP.d.cts → ErrorPolicyPort-D6CybiqJ.d.cts} +1 -1
  11. package/dist/{EverfurResult-DN9pL2Ab.d.cts → EverfurError-DmELDpXp.d.cts} +1 -67
  12. package/dist/{EverfurResult-DN9pL2Ab.d.ts → EverfurError-DmELDpXp.d.ts} +1 -67
  13. package/dist/EverfurResult-SGvHKsCB.d.ts +69 -0
  14. package/dist/EverfurResult-ZtH-YV1h.d.cts +69 -0
  15. package/dist/animations/index.cjs +1 -1
  16. package/dist/animations/index.d.cts +6 -5
  17. package/dist/animations/index.d.ts +6 -5
  18. package/dist/animations/index.js +1 -1
  19. package/dist/{attachments-D_SECjr1.d.cts → attachments-CwsR-bPN.d.cts} +7 -6
  20. package/dist/{attachments-BrUWQYNK.d.ts → attachments-CzZ7in24.d.ts} +7 -6
  21. package/dist/{attachments-DpldrvIW.d.ts → attachments-D3HCBmOE.d.ts} +3 -3
  22. package/dist/{attachments-BorG422I.d.cts → attachments-Nk73Lll8.d.cts} +3 -3
  23. package/dist/{bookingCopy-SREvkG19.d.cts → bookingCopy-Dv8rKqyV.d.cts} +417 -14
  24. package/dist/{bookingCopy-CqtDYvCR.d.ts → bookingCopy-SDkXaxDf.d.ts} +417 -14
  25. package/dist/branding-Xb_wL8N1.d.cts +212 -0
  26. package/dist/branding-xpQ056sM.d.ts +212 -0
  27. package/dist/callCopy-rDH9JTFo.d.cts +45 -0
  28. package/dist/callCopy-rDH9JTFo.d.ts +45 -0
  29. package/dist/callRoom-7wrE3RP2.d.ts +62 -0
  30. package/dist/callRoom-B_EqaUzx.d.cts +62 -0
  31. package/dist/{casesRepository-v6QczS9N.d.ts → casesRepository-BTAecTnF.d.ts} +14 -2
  32. package/dist/{casesRepository-DwtZVsbj.d.cts → casesRepository-aryld7fJ.d.cts} +14 -2
  33. package/dist/chat/index.cjs +1 -1
  34. package/dist/chat/index.d.cts +12 -11
  35. package/dist/chat/index.d.ts +12 -11
  36. package/dist/chat/index.js +1 -1
  37. package/dist/client/index.cjs +5 -5
  38. package/dist/client/index.d.cts +14 -12
  39. package/dist/client/index.d.ts +14 -12
  40. package/dist/client/index.js +5 -5
  41. package/dist/{config-C7eb_IMD.d.ts → config-6qS7Sohy.d.cts} +3 -2
  42. package/dist/{config--Wu1Umhd.d.cts → config-X6BtwDwQ.d.ts} +3 -2
  43. package/dist/consent/index.cjs +1 -1
  44. package/dist/consent/index.d.cts +9 -8
  45. package/dist/consent/index.d.ts +9 -8
  46. package/dist/consent/index.js +1 -1
  47. package/dist/{context-CahAEha8.d.ts → context-7f3Nb_xE.d.ts} +9 -8
  48. package/dist/{context-CL3lyuy1.d.cts → context-CkqPM4Ml.d.cts} +9 -8
  49. package/dist/{copy-UeUJVk8X.d.cts → copy-Bd__Pw5s.d.cts} +5 -4
  50. package/dist/{copy-DdVFDL01.d.ts → copy-NgKgOOET.d.ts} +5 -4
  51. package/dist/core/index.cjs +9 -9
  52. package/dist/core/index.d.cts +19 -17
  53. package/dist/core/index.d.ts +19 -17
  54. package/dist/core/index.js +9 -9
  55. package/dist/{depth-DvPwPuT_.d.ts → depth-CYPH92jE.d.ts} +6 -5
  56. package/dist/{depth-D5HwcvKC.d.cts → depth-CyjaJJ6V.d.cts} +6 -5
  57. package/dist/{entitlementRepository-B7egEdW6.d.ts → entitlementRepository-DdeFuEKp.d.ts} +4 -4
  58. package/dist/{entitlementRepository-BpJ7tiwl.d.cts → entitlementRepository-Dl1qRLcJ.d.cts} +4 -4
  59. package/dist/{identity-C2-08BZW.d.cts → identity-DjqhDm5Z.d.cts} +2 -2
  60. package/dist/{identity-CEi9GRFZ.d.ts → identity-Dy_L7Yq4.d.ts} +2 -2
  61. package/dist/index.cjs +6 -6
  62. package/dist/index.d.cts +19 -17
  63. package/dist/index.d.ts +19 -17
  64. package/dist/index.js +6 -6
  65. package/dist/{models-D2EUxPZY.d.cts → models-Bn2z0NNo.d.cts} +1 -1
  66. package/dist/{models-B-Uh2LTf.d.ts → models-DSqA5Ahs.d.ts} +1 -1
  67. package/dist/notifications/index.cjs +2 -2
  68. package/dist/notifications/index.d.cts +5 -4
  69. package/dist/notifications/index.d.ts +5 -4
  70. package/dist/notifications/index.js +2 -2
  71. package/dist/{pets-JVCXgRgR.d.cts → pets-BSG2qbr_.d.cts} +2 -2
  72. package/dist/{pets-DJv2sj2H.d.ts → pets-D7cZutrX.d.ts} +2 -2
  73. package/dist/{petsRepository-B_gKbAzJ.d.cts → petsRepository-D1bnxDZg.d.cts} +2 -2
  74. package/dist/{petsRepository-Bk6GDwLs.d.ts → petsRepository-DhsX3GLw.d.ts} +2 -2
  75. package/dist/photo/index.cjs +1 -1
  76. package/dist/photo/index.d.cts +3 -2
  77. package/dist/photo/index.d.ts +3 -2
  78. package/dist/photo/index.js +1 -1
  79. package/dist/{ports-D7YW8qz9.d.ts → ports-C0m1G1fS.d.ts} +13 -6
  80. package/dist/{ports-BY2ph0_y.d.cts → ports-DNXyyzZF.d.cts} +13 -6
  81. package/dist/records/depth/index.cjs +2 -2
  82. package/dist/records/depth/index.d.cts +11 -10
  83. package/dist/records/depth/index.d.ts +11 -10
  84. package/dist/records/depth/index.js +2 -2
  85. package/dist/records/index.cjs +3 -3
  86. package/dist/records/index.d.cts +25 -14
  87. package/dist/records/index.d.ts +25 -14
  88. package/dist/records/index.js +3 -3
  89. package/dist/{requestFunnel-BjDpqqvm.d.cts → requestFunnel-Bqc1inM9.d.cts} +5 -4
  90. package/dist/{requestFunnel-DFMGcluw.d.ts → requestFunnel-FvE5yLDD.d.ts} +5 -4
  91. package/dist/{runtimeTypes-w5KqBMcs.d.ts → runtimeTypes-C0yPBz89.d.ts} +7 -7
  92. package/dist/{runtimeTypes-gZEJu-da.d.cts → runtimeTypes-RN-VXTFV.d.cts} +7 -7
  93. package/dist/server/events/index.cjs +1 -1
  94. package/dist/server/events/index.d.cts +4 -3
  95. package/dist/server/events/index.d.ts +4 -3
  96. package/dist/server/events/index.js +1 -1
  97. package/dist/server/index.cjs +1 -1
  98. package/dist/server/index.d.cts +5 -4
  99. package/dist/server/index.d.ts +5 -4
  100. package/dist/server/index.js +1 -1
  101. package/dist/televet/booking/index.cjs +1 -1
  102. package/dist/televet/booking/index.d.cts +310 -32
  103. package/dist/televet/booking/index.d.ts +310 -32
  104. package/dist/televet/booking/index.js +1 -1
  105. package/dist/televet/call/index.cjs +1 -1
  106. package/dist/televet/call/index.d.cts +25 -5
  107. package/dist/televet/call/index.d.ts +25 -5
  108. package/dist/televet/call/index.js +1 -1
  109. package/dist/televet/index.cjs +1 -1
  110. package/dist/televet/index.d.cts +41 -71
  111. package/dist/televet/index.d.ts +41 -71
  112. package/dist/televet/index.js +1 -1
  113. package/dist/televetGlobal-CEk0_cW9.d.cts +34 -0
  114. package/dist/televetGlobal-Cs9Wbqsy.d.ts +34 -0
  115. package/dist/testing/index.cjs +3 -3
  116. package/dist/testing/index.d.cts +3 -2
  117. package/dist/testing/index.d.ts +3 -2
  118. package/dist/testing/index.js +3 -3
  119. package/dist/testing/rn/index.cjs +1 -1
  120. package/dist/testing/rn/index.d.cts +13 -11
  121. package/dist/testing/rn/index.d.ts +13 -11
  122. package/dist/testing/rn/index.js +1 -1
  123. package/dist/testing/web/index.cjs +1 -1
  124. package/dist/testing/web/index.d.cts +14 -13
  125. package/dist/testing/web/index.d.ts +14 -13
  126. package/dist/testing/web/index.js +1 -1
  127. package/dist/{timelineRows-C15jxFFH.d.ts → timelineRows-D4U6A8zE.d.ts} +1 -1
  128. package/dist/{timelineRows-odO8g9r2.d.cts → timelineRows-DAB5dpjF.d.cts} +1 -1
  129. package/dist/{branding-CsRdeNwK.d.cts → tokens-CIngRkvt.d.cts} +7 -211
  130. package/dist/{branding-CsRdeNwK.d.ts → tokens-CIngRkvt.d.ts} +7 -211
  131. package/dist/{typeStyle-DmoyacDG.d.ts → typeStyle-DHJzDaUo.d.cts} +2 -1
  132. package/dist/{typeStyle-CKqVYD6L.d.cts → typeStyle-YPS_MXeI.d.ts} +2 -1
  133. package/dist/{useRecordsDepth-crhBllQK.d.ts → useRecordsDepth--ObtMyjH.d.ts} +24 -5
  134. package/dist/{useRecordsDepth-C6rjEaLn.d.cts → useRecordsDepth-B35y8bV-.d.cts} +24 -5
  135. package/dist/{useVetVisit-CjmMa896.d.ts → useVetVisit-BsjoDO-n.d.ts} +21 -6
  136. package/dist/{useVetVisit-Bc84hWUU.d.cts → useVetVisit-Ds8f1peV.d.cts} +21 -6
  137. package/dist/video/index.cjs +1 -1
  138. package/dist/video/index.d.cts +3 -2
  139. package/dist/video/index.d.ts +3 -2
  140. package/dist/video/index.js +1 -1
  141. package/dist/{view-DyitEO0m.d.cts → view-B-Toym_j.d.cts} +5 -4
  142. package/dist/{view-Bxwxp4xD.d.ts → view-D9JqNQai.d.ts} +5 -4
  143. package/dist/web/consent/index.cjs +1 -1
  144. package/dist/web/consent/index.d.cts +9 -8
  145. package/dist/web/consent/index.d.ts +9 -8
  146. package/dist/web/consent/index.js +1 -1
  147. package/dist/web/index.cjs +10 -10
  148. package/dist/web/index.d.cts +42 -19
  149. package/dist/web/index.d.ts +42 -19
  150. package/dist/web/index.js +10 -10
  151. package/dist/web/notifications/index.cjs +2 -2
  152. package/dist/web/notifications/index.d.cts +7 -6
  153. package/dist/web/notifications/index.d.ts +7 -6
  154. package/dist/web/notifications/index.js +2 -2
  155. package/dist/web/records/depth/index.cjs +2 -2
  156. package/dist/web/records/depth/index.d.cts +11 -10
  157. package/dist/web/records/depth/index.d.ts +11 -10
  158. package/dist/web/records/depth/index.js +2 -2
  159. package/dist/web/records/index.cjs +3 -3
  160. package/dist/web/records/index.d.cts +53 -35
  161. package/dist/web/records/index.d.ts +53 -35
  162. package/dist/web/records/index.js +3 -3
  163. package/dist/web/televet/booking/index.cjs +2 -1
  164. package/dist/web/televet/booking/index.d.cts +458 -33
  165. package/dist/web/televet/booking/index.d.ts +458 -33
  166. package/dist/web/televet/booking/index.js +2 -1
  167. package/dist/web/televet/call/index.cjs +1 -1
  168. package/dist/web/televet/call/index.d.cts +3 -1
  169. package/dist/web/televet/call/index.d.ts +3 -1
  170. package/dist/web/televet/call/index.js +1 -1
  171. package/dist/web/televet/index.cjs +1 -1
  172. package/dist/web/televet/index.d.cts +40 -74
  173. package/dist/web/televet/index.d.ts +40 -74
  174. package/dist/web/televet/index.js +1 -1
  175. package/package.json +3 -2
  176. package/dist/callCopy-DoQKG3-L.d.cts +0 -40
  177. package/dist/callCopy-DoQKG3-L.d.ts +0 -40
@@ -1,7 +1,7 @@
1
- 'use strict';var zod=require('zod');var oe=Object.defineProperty;var n=(e,t)=>oe(e,"name",{value:t,configurable:true});function O(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(O,"ok");function C(e){return Object.freeze({ok:false,error:e})}n(C,"err");var v=class v extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,v.prototype);}};n(v,"EverfurConfigError");var p=v;var ae=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent"],h=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule"];function ie(e,t){let r=e.split("/"),[o=""]=t.split("?"),a=o.split("/");return r.length!==a.length?false:r.every((i,l)=>{let s=a[l];return s===void 0?false:i.startsWith("{")&&i.endsWith("}")?s.length>0:i===s})}n(ie,"pathMatches");function k(e,t){let r=n(o=>o.some(a=>{let[i,l]=a.split(" ");return i===void 0||l===void 0?false:i===e.toUpperCase()&&ie(l,t)}),"matches");return r(ae)?"known":r(h)?"absent":"unknown"}n(k,"classifyRoute");var b=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(b.map(e=>e.wireCode));var se=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"}),x=Object.freeze(b.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:se[e.wireCode]}))),le=new Map(x.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),de=Object.freeze(["http_envelope",...[...new Set(x.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function _(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...de]){let a=le.get(o+r);if(a)return a}}n(_,"contractErrorFor");function ue(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(ue,"contractDocUrl");function I(e){return null}n(I,"publishedDocUrl");var ce=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function A(e){return ce[e]}n(A,"categoryFor");function m(e){let t=_(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(m,"fromWire");function N(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}n(N,"fromHttpStatus");var pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function E(e){return pe.has(e)}n(E,"isAutoRetryable");var fe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function z(e){return E(e)||fe.has(e)}n(z,"isRetryableCode");function L(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(L,"assertNever");function P(e,t,r=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(P,"acceptedFrame");function D(e,t=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:t,terminal:false})}n(D,"heartbeatFrame");function j(e,t,r=null){return Object.freeze({kind:"delta",delta:e,lastEventId:t,serverRequestId:r,terminal:false})}n(j,"deltaFrame");function q(e,t=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:t})}n(q,"doneFrame");function c(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(c,"errorFrame");function U(e,t,r=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(U,"analysisStartedFrame");function M(e,t=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:t})}n(M,"analysisCompleteFrame");function B(e,t,r=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:t,serverRequestId:r,terminal:false})}n(B,"unknownFrame");var G=`
1
+ 'use strict';var zod=require('zod');var oe=Object.defineProperty;var n=(e,t)=>oe(e,"name",{value:t,configurable:true});function O(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(O,"ok");function C(e){return Object.freeze({ok:false,error:e})}n(C,"err");var v=class v extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,v.prototype);}};n(v,"EverfurConfigError");var p=v;var ae=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent"],h=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","GET /widget/v1/pets/{pet_ref}/state","POST /widget/v1/televet/consults/triage","POST /widget/v1/televet/state-interest"];function ie(e,t){let r=e.split("/"),[o=""]=t.split("?"),a=o.split("/");return r.length!==a.length?false:r.every((i,l)=>{let s=a[l];return s===void 0?false:i.startsWith("{")&&i.endsWith("}")?s.length>0:i===s})}n(ie,"pathMatches");function k(e,t){let r=n(o=>o.some(a=>{let[i,l]=a.split(" ");return i===void 0||l===void 0?false:i===e.toUpperCase()&&ie(l,t)}),"matches");return r(ae)?"known":r(h)?"absent":"unknown"}n(k,"classifyRoute");var b=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(b.map(e=>e.wireCode));var se=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"}),x=Object.freeze(b.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:se[e.wireCode]}))),le=new Map(x.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),de=Object.freeze(["http_envelope",...[...new Set(x.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function _(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...de]){let a=le.get(o+r);if(a)return a}}n(_,"contractErrorFor");function ue(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(ue,"contractDocUrl");function I(e){return null}n(I,"publishedDocUrl");var ce=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function A(e){return ce[e]}n(A,"categoryFor");function m(e){let t=_(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){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 "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(m,"fromWire");function N(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}n(N,"fromHttpStatus");var pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function E(e){return pe.has(e)}n(E,"isAutoRetryable");var fe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function z(e){return E(e)||fe.has(e)}n(z,"isRetryableCode");function P(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(P,"assertNever");function L(e,t,r=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(L,"acceptedFrame");function D(e,t=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:t,terminal:false})}n(D,"heartbeatFrame");function j(e,t,r=null){return Object.freeze({kind:"delta",delta:e,lastEventId:t,serverRequestId:r,terminal:false})}n(j,"deltaFrame");function q(e,t=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:t})}n(q,"doneFrame");function c(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(c,"errorFrame");function U(e,t,r=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(U,"analysisStartedFrame");function M(e,t=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:t})}n(M,"analysisCompleteFrame");function B(e,t,r=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:t,serverRequestId:r,terminal:false})}n(B,"unknownFrame");var G=`
2
2
 
3
3
  `,_e=1048576,me=zod.z.record(zod.z.string(),zod.z.unknown()),Ee=["emergency","schedule_soon","home_care"];async function*f(e,t=null){let r=null,o=n(()=>(r!==null||(r=typeof t=="function"?t():t),r),"requestIdNow"),a=new TextDecoder("utf-8"),i="",l=0,s=false;for await(let u of e){for(i+=a.decode(u,{stream:true});;){let g=i.indexOf(G,l);if(g===-1)break;let ne=i.slice(0,g);i=i.slice(g+G.length),l=0;let y=W(ne,o());if(y!==null&&(y.kind==="delta"&&(s=true),yield y,y.terminal))return}if(l=i.length>0?i.length-1:0,i.length>_e){yield c({code:s?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});return}}if(i+=a.decode(),i.trim().length>0){let u=W(i,o());if(u!==null&&(u.kind==="delta"&&(s=true),yield u,u.terminal))return}yield c({code:s?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});}n(f,"parseSse");function W(e,t){let r=null,o=[];for(let l of e.split(`
4
4
  `)){let s=l.replace(/\s+$/,"");s.length===0||s.startsWith(":")||(s.startsWith("id:")?r=s.slice(3).trim():s.startsWith("data:")&&o.push(s.slice(5).replace(/^ /,"")));}if(o.length===0)return null;let a;try{a=JSON.parse(o.join(`
5
- `));}catch{return null}if(typeof a!="object"||a===null||Array.isArray(a))return null;let i=me.safeParse(a);return i.success?ge(i.data,r,t):null}n(W,"parseBlock");function ge(e,t,r){let o=e.type,a=e.event;if(o==="error"||"error"in e)return c({code:d(e.code)??"unknown",retryable:e.retryable===true,wireMessage:d(e.error),synthesized:false,lastEventId:t,serverRequestId:r});if(o==="done"||e.done===true)return q({conversationId:d(e.conversation_id)??"",messageId:d(e.message_id),title:d(e.title),followUpQuestions:we(e.follow_up_questions),citations:Y(e.citations),citationStatus:d(e.citation_status),urgencyLevel:H(e.urgency_level),urgencyReason:d(e.urgency_reason),urgencyProvided:be(e),resultId:d(e.result_id),lastEventId:t},r);if(o==="accepted"||e.status==="reasoning")return P(d(e.stream_id),t,r);if(o==="heartbeat"||e.heartbeat===true)return D(t,r);if(o==="text.delta"||"delta"in e||"token"in e){let i=d(e.delta)??d(e.token)??"";return j(i,t,r)}return a==="analysis_started"?U(d(e.request_id),t,r):a==="analysis_complete"?M({resultId:d(e.result_id),analysisType:d(e.analysis_type),modelVersion:d(e.model_version),confidence:he(e.confidence),detections:Y(e.detections),interpretation:d(e.interpretation),lastEventId:t},r):B(e,t,r)}n(ge,"frameFromWire");function d(e){return typeof e=="string"?e:null}n(d,"asString");function he(e){return typeof e=="number"&&Number.isFinite(e)?e:null}n(he,"asNumber");function H(e){return typeof e=="string"&&Ee.includes(e)?e:null}n(H,"asUrgency");function be(e){if(!Object.prototype.hasOwnProperty.call(e,"urgency_level"))return false;let t=e.urgency_level;return t===null||H(t)!==null}n(be,"urgencySlotProvided");function we(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:String(t)):[]}n(we,"asStringList");function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(Re,"isPlainObject");function Y(e){return Array.isArray(e)?e.filter(Re):[]}n(Y,"asMapList");var Se=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Te(e){return Se[e]}n(Te,"userFacingError");function Q(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(Q,"defineHidden");var Oe=/^[a-z][a-z0-9_]{0,63}$/;function $(e,t){let r=_(t?.wireCode,t?.wireEnvelope),o={code:e,category:A(e),retryable:t?.retryable??z(e),displayMessage:Te(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Oe.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&Q(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Q(o,"raw",t.raw),Object.freeze(o)}n($,"makeEverfurError");async function*V(e,t=[]){let r=new TextEncoder().encode(e),o=[...new Set(t)].filter(i=>i>0&&i<r.length).sort((i,l)=>i-l),a=0;for(let i of o)yield r.subarray(a,i),a=i;yield r.subarray(a);}n(V,"bufferedTextByteSource");function J(e,t,r){let o=Ce(t),a=o?m(o):N(e),i=ke(t);return $(a,{httpStatus:e,...Fe(t)?{retryable:true}:{},...r?{requestId:r}:{},...o?{wireCode:o}:{},...K(t)?{reasonCode:K(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}n(J,"errorFromResponse");function K(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}n(K,"extractReasonCode");function Ce(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ce,"extractWireCode");function ke(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(ke,"extractWireMessage");function Fe(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(Fe,"extractRetryable");var ee=Object.freeze({accepted:n(e=>JSON.stringify(e?{type:"accepted",stream_id:e}:{type:"accepted"}),"accepted"),heartbeat:n(()=>JSON.stringify({type:"heartbeat"}),"heartbeat"),delta:n(e=>JSON.stringify({type:"text.delta",delta:e}),"delta"),done:n(e=>JSON.stringify({type:"done",...e??{}}),"done"),error:n((e,t=false)=>JSON.stringify({type:"error",code:e,retryable:t}),"error")}),xe=Object.freeze({pets:n(e=>({pets:e.map(t=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...t}))}),"pets"),uploadInitiate:n(e=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...e??{}}),"uploadInitiate"),feedback:n(e=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...e??{}}),"feedback")});function X(e,t){let r=k(e,t);if(r!=="known")throw r==="absent"?new p("invalid-argument",`MockTransport: ${e} ${t} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${h.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new p("invalid-argument",`MockTransport: ${e} ${t} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}n(X,"assertRouteIsServed");var T=class T{constructor(t={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=t.strictPaths??true;}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...t){return this.streamQueue.push(...t),this}enqueueRequest(...t){return this.requestQueue.push(...t),this}async request(t){this.strictPaths&&X(t.method,t.path);let r={method:t.method,path:t.path,headers:{...t.headers??{}},...t.query===void 0?{}:{query:{...t.query}}},o=t.body===void 0?r:{...r,body:t.body};this.requests.push(o);let a=`${t.method} ${t.path}`,i=this.requestQueue.shift();i!==void 0&&this.lastRequestScript.set(a,i);let l=i??this.lastRequestScript.get(a)??{status:200,body:{}},s=l.status??200;return s===304||s>=400?C(J(s,l.body??null)):O(l.body??{})}stream(t,r){this.strictPaths&&X(t.method,t.path),this.streamRequests.push({path:t.path,authorization:R(t,"authorization"),partnerKey:R(t,"x-everfur-partner-key"),idempotencyKey:R(t,"idempotency-key"),...t.body===void 0?{}:{body:t.body},headers:{...t.headers??{}}});let o=this.streamQueue.shift()??{kind:"sse",blocks:[ee.done()]};return this.openStream(o,r)}async*openStream(t,r){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(t,r);}finally{this.openCount-=1;}}async*runScript(t,r){switch(t.kind){case "httpError":{let o=Ae(t.body)??Le(t.status);yield c({code:o,retryable:ze(t.body)||E(m(o)),wireMessage:Ne(t.body),synthesized:true,lastEventId:null});return}case "network":yield c({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case "partialByte":yield*f(V(t.body,t.splitAt));return;case "sse":yield*f(Z(t.blocks,t.gapMs??0,r));return;case "drop":yield*f(Z(t.blocks,0,r));return;case "stall":yield*f(Ie(t.preface??[],r));return;default:return L(t)}}};n(T,"MockTransport");var S=T;async function*Z(e,t,r){let o=new TextEncoder,a=true;for(let i of e){if(r.aborted||!a&&t>0&&await re(t,r)==="abort")return;a=false,yield o.encode(te(i));}}n(Z,"sseByteSource");async function*Ie(e,t){let r=new TextEncoder;for(let o of e){if(t.aborted)return;yield r.encode(te(o));}await re(1/0,t);}n(Ie,"stallByteSource");function te(e){return `data: ${e}
5
+ `));}catch{return null}if(typeof a!="object"||a===null||Array.isArray(a))return null;let i=me.safeParse(a);return i.success?ge(i.data,r,t):null}n(W,"parseBlock");function ge(e,t,r){let o=e.type,a=e.event;if(o==="error"||"error"in e)return c({code:d(e.code)??"unknown",retryable:e.retryable===true,wireMessage:d(e.error),synthesized:false,lastEventId:t,serverRequestId:r});if(o==="done"||e.done===true)return q({conversationId:d(e.conversation_id)??"",messageId:d(e.message_id),title:d(e.title),followUpQuestions:we(e.follow_up_questions),citations:Y(e.citations),citationStatus:d(e.citation_status),urgencyLevel:H(e.urgency_level),urgencyReason:d(e.urgency_reason),urgencyProvided:be(e),resultId:d(e.result_id),lastEventId:t},r);if(o==="accepted"||e.status==="reasoning")return L(d(e.stream_id),t,r);if(o==="heartbeat"||e.heartbeat===true)return D(t,r);if(o==="text.delta"||"delta"in e||"token"in e){let i=d(e.delta)??d(e.token)??"";return j(i,t,r)}return a==="analysis_started"?U(d(e.request_id),t,r):a==="analysis_complete"?M({resultId:d(e.result_id),analysisType:d(e.analysis_type),modelVersion:d(e.model_version),confidence:he(e.confidence),detections:Y(e.detections),interpretation:d(e.interpretation),lastEventId:t},r):B(e,t,r)}n(ge,"frameFromWire");function d(e){return typeof e=="string"?e:null}n(d,"asString");function he(e){return typeof e=="number"&&Number.isFinite(e)?e:null}n(he,"asNumber");function H(e){return typeof e=="string"&&Ee.includes(e)?e:null}n(H,"asUrgency");function be(e){if(!Object.prototype.hasOwnProperty.call(e,"urgency_level"))return false;let t=e.urgency_level;return t===null||H(t)!==null}n(be,"urgencySlotProvided");function we(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:String(t)):[]}n(we,"asStringList");function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(Re,"isPlainObject");function Y(e){return Array.isArray(e)?e.filter(Re):[]}n(Y,"asMapList");var Se=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Te(e){return Se[e]}n(Te,"userFacingError");function Q(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(Q,"defineHidden");var Oe=/^[a-z][a-z0-9_]{0,63}$/;function $(e,t){let r=_(t?.wireCode,t?.wireEnvelope),o={code:e,category:A(e),retryable:t?.retryable??z(e),displayMessage:Te(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Oe.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&Q(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Q(o,"raw",t.raw),Object.freeze(o)}n($,"makeEverfurError");async function*V(e,t=[]){let r=new TextEncoder().encode(e),o=[...new Set(t)].filter(i=>i>0&&i<r.length).sort((i,l)=>i-l),a=0;for(let i of o)yield r.subarray(a,i),a=i;yield r.subarray(a);}n(V,"bufferedTextByteSource");function J(e,t,r){let o=Ce(t),a=o?m(o):N(e),i=ke(t);return $(a,{httpStatus:e,...Fe(t)?{retryable:true}:{},...r?{requestId:r}:{},...o?{wireCode:o}:{},...K(t)?{reasonCode:K(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}n(J,"errorFromResponse");function K(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}n(K,"extractReasonCode");function Ce(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ce,"extractWireCode");function ke(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(ke,"extractWireMessage");function Fe(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(Fe,"extractRetryable");var ee=Object.freeze({accepted:n(e=>JSON.stringify(e?{type:"accepted",stream_id:e}:{type:"accepted"}),"accepted"),heartbeat:n(()=>JSON.stringify({type:"heartbeat"}),"heartbeat"),delta:n(e=>JSON.stringify({type:"text.delta",delta:e}),"delta"),done:n(e=>JSON.stringify({type:"done",...e??{}}),"done"),error:n((e,t=false)=>JSON.stringify({type:"error",code:e,retryable:t}),"error")}),xe=Object.freeze({pets:n(e=>({pets:e.map(t=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...t}))}),"pets"),uploadInitiate:n(e=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...e??{}}),"uploadInitiate"),feedback:n(e=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...e??{}}),"feedback")});function X(e,t){let r=k(e,t);if(r!=="known")throw r==="absent"?new p("invalid-argument",`MockTransport: ${e} ${t} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${h.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new p("invalid-argument",`MockTransport: ${e} ${t} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}n(X,"assertRouteIsServed");var T=class T{constructor(t={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=t.strictPaths??true;}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...t){return this.streamQueue.push(...t),this}enqueueRequest(...t){return this.requestQueue.push(...t),this}async request(t){this.strictPaths&&X(t.method,t.path);let r={method:t.method,path:t.path,headers:{...t.headers??{}},...t.query===void 0?{}:{query:{...t.query}}},o=t.body===void 0?r:{...r,body:t.body};this.requests.push(o);let a=`${t.method} ${t.path}`,i=this.requestQueue.shift();i!==void 0&&this.lastRequestScript.set(a,i);let l=i??this.lastRequestScript.get(a)??{status:200,body:{}},s=l.status??200;return s===304||s>=400?C(J(s,l.body??null)):O(l.body??{})}stream(t,r){this.strictPaths&&X(t.method,t.path),this.streamRequests.push({path:t.path,authorization:R(t,"authorization"),partnerKey:R(t,"x-everfur-partner-key"),idempotencyKey:R(t,"idempotency-key"),...t.body===void 0?{}:{body:t.body},headers:{...t.headers??{}}});let o=this.streamQueue.shift()??{kind:"sse",blocks:[ee.done()]};return this.openStream(o,r)}async*openStream(t,r){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(t,r);}finally{this.openCount-=1;}}async*runScript(t,r){switch(t.kind){case "httpError":{let o=Ae(t.body)??Pe(t.status);yield c({code:o,retryable:ze(t.body)||E(m(o)),wireMessage:Ne(t.body),synthesized:true,lastEventId:null});return}case "network":yield c({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case "partialByte":yield*f(V(t.body,t.splitAt));return;case "sse":yield*f(Z(t.blocks,t.gapMs??0,r));return;case "drop":yield*f(Z(t.blocks,0,r));return;case "stall":yield*f(Ie(t.preface??[],r));return;default:return P(t)}}};n(T,"MockTransport");var S=T;async function*Z(e,t,r){let o=new TextEncoder,a=true;for(let i of e){if(r.aborted||!a&&t>0&&await re(t,r)==="abort")return;a=false,yield o.encode(te(i));}}n(Z,"sseByteSource");async function*Ie(e,t){let r=new TextEncoder;for(let o of e){if(t.aborted)return;yield r.encode(te(o));}await re(1/0,t);}n(Ie,"stallByteSource");function te(e){return `data: ${e}
6
6
 
7
- `}n(te,"toSseBlock");function re(e,t){return new Promise(r=>{if(t.aborted){r("abort");return}let o=null,a=n(()=>{o!==null&&clearTimeout(o),t.removeEventListener("abort",a),r("abort");},"onAbort");Number.isFinite(e)&&(o=setTimeout(()=>{t.removeEventListener("abort",a),r("timeout");},e)),t.addEventListener("abort",a,{once:true});})}n(re,"abortableSleep");function R(e,t){let r=e.headers;if(!r)return null;for(let[o,a]of Object.entries(r))if(o.toLowerCase()===t)return a;return null}n(R,"header");function Ae(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ae,"extractWireCode");function Ne(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(Ne,"extractWireMessage");function ze(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(ze,"extractRetryable");function Le(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e>=500?"INTERNAL_ERROR":""}n(Le,"statusToWireCode");exports.MockTransport=S;exports.bodies=xe;exports.wire=ee;
7
+ `}n(te,"toSseBlock");function re(e,t){return new Promise(r=>{if(t.aborted){r("abort");return}let o=null,a=n(()=>{o!==null&&clearTimeout(o),t.removeEventListener("abort",a),r("abort");},"onAbort");Number.isFinite(e)&&(o=setTimeout(()=>{t.removeEventListener("abort",a),r("timeout");},e)),t.addEventListener("abort",a,{once:true});})}n(re,"abortableSleep");function R(e,t){let r=e.headers;if(!r)return null;for(let[o,a]of Object.entries(r))if(o.toLowerCase()===t)return a;return null}n(R,"header");function Ae(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ae,"extractWireCode");function Ne(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(Ne,"extractWireMessage");function ze(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(ze,"extractRetryable");function Pe(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e>=500?"INTERNAL_ERROR":""}n(Pe,"statusToWireCode");exports.MockTransport=S;exports.bodies=xe;exports.wire=ee;
@@ -1,5 +1,6 @@
1
- import { c as EverfurResult } from '../EverfurResult-DN9pL2Ab.cjs';
2
- import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config--Wu1Umhd.cjs';
1
+ import { E as EverfurResult } from '../EverfurResult-ZtH-YV1h.cjs';
2
+ import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-6qS7Sohy.cjs';
3
+ import '../EverfurError-DmELDpXp.cjs';
3
4
 
4
5
  /** One scripted stream outcome. Each block is a JSON `data:` payload string; MockTransport wraps it in SSE. */
5
6
  type StreamScript = {
@@ -1,5 +1,6 @@
1
- import { c as EverfurResult } from '../EverfurResult-DN9pL2Ab.js';
2
- import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-C7eb_IMD.js';
1
+ import { E as EverfurResult } from '../EverfurResult-SGvHKsCB.js';
2
+ import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-X6BtwDwQ.js';
3
+ import '../EverfurError-DmELDpXp.js';
3
4
 
4
5
  /** One scripted stream outcome. Each block is a JSON `data:` payload string; MockTransport wraps it in SSE. */
5
6
  type StreamScript = {
@@ -1,7 +1,7 @@
1
- import {z as z$1}from'zod';var oe=Object.defineProperty;var n=(e,t)=>oe(e,"name",{value:t,configurable:true});function O(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(O,"ok");function C(e){return Object.freeze({ok:false,error:e})}n(C,"err");var v=class v extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,v.prototype);}};n(v,"EverfurConfigError");var p=v;var ae=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent"],h=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","GET /widget/v1/pets/{pet_ref}/state","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule"];function ie(e,t){let r=e.split("/"),[o=""]=t.split("?"),a=o.split("/");return r.length!==a.length?false:r.every((i,l)=>{let s=a[l];return s===void 0?false:i.startsWith("{")&&i.endsWith("}")?s.length>0:i===s})}n(ie,"pathMatches");function k(e,t){let r=n(o=>o.some(a=>{let[i,l]=a.split(" ");return i===void 0||l===void 0?false:i===e.toUpperCase()&&ie(l,t)}),"matches");return r(ae)?"known":r(h)?"absent":"unknown"}n(k,"classifyRoute");var b=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(b.map(e=>e.wireCode));var se=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"}),x=Object.freeze(b.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:se[e.wireCode]}))),le=new Map(x.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),de=Object.freeze(["http_envelope",...[...new Set(x.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function _(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...de]){let a=le.get(o+r);if(a)return a}}n(_,"contractErrorFor");function ue(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(ue,"contractDocUrl");function I(e){return null}n(I,"publishedDocUrl");var ce=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function A(e){return ce[e]}n(A,"categoryFor");function m(e){let t=_(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(m,"fromWire");function N(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}n(N,"fromHttpStatus");var pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function E(e){return pe.has(e)}n(E,"isAutoRetryable");var fe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function z(e){return E(e)||fe.has(e)}n(z,"isRetryableCode");function L(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(L,"assertNever");function P(e,t,r=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(P,"acceptedFrame");function D(e,t=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:t,terminal:false})}n(D,"heartbeatFrame");function j(e,t,r=null){return Object.freeze({kind:"delta",delta:e,lastEventId:t,serverRequestId:r,terminal:false})}n(j,"deltaFrame");function q(e,t=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:t})}n(q,"doneFrame");function c(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(c,"errorFrame");function U(e,t,r=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(U,"analysisStartedFrame");function M(e,t=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:t})}n(M,"analysisCompleteFrame");function B(e,t,r=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:t,serverRequestId:r,terminal:false})}n(B,"unknownFrame");var G=`
1
+ import {z as z$1}from'zod';var oe=Object.defineProperty;var n=(e,t)=>oe(e,"name",{value:t,configurable:true});function O(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(O,"ok");function C(e){return Object.freeze({ok:false,error:e})}n(C,"err");var v=class v extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,v.prototype);}};n(v,"EverfurConfigError");var p=v;var ae=["DELETE /widget/v1/me","DELETE /widget/v1/me/devices/{device_id}","POST /widget/v1/me/devices","PUT /widget/v1/me/notification-preferences","DELETE /widget/v1/pets/{pet_ref}","DELETE /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/consent","GET /widget/v1/conversations","GET /widget/v1/conversations/{conversation_id}/messages","GET /widget/v1/entitlements","GET /widget/v1/pets","GET /widget/v1/pets/{pet_ref}/cases","POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin","POST /widget/v1/conversations/{conversation_id}/read","GET /widget/v1/records/authorization-copy","GET /widget/v1/records/clinics/search","GET /widget/v1/records/clinics/recent","GET /widget/v1/records/pets/{pet_ref}/consent","GET /widget/v1/records/pets/{pet_ref}/documents/{doc_id}/contributions","GET /widget/v1/records/pets/{pet_ref}/record","GET /widget/v1/records/pets/{pet_ref}/timeline","GET /widget/v1/records/pets/{pet_ref}/markers","POST /widget/v1/records/pets/{pet_ref}/everfur_record/share","GET /widget/v1/records/pets/{pet_ref}/everfur_record/shares","DELETE /widget/v1/records/pets/{pet_ref}/everfur_record/shares/{share_id}","GET /widget/v1/records/pets/{pet_ref}/everfur_record/pdf-link","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/edit","POST /widget/v1/records/pets/{pet_ref}/everfur_record/facts/remove","GET /widget/v1/records/authorization-signatures","GET /widget/v1/records/request-groups/{request_group_id}","GET /widget/v1/records/requests","GET /widget/v1/records/requests/{request_id}","GET /widget/v1/records/requests/{request_id}/documents","GET /widget/v1/suggested-prompts","PATCH /widget/v1/pets/{pet_ref}","POST /widget/v1/conversations","POST /widget/v1/conversations/{conversation_id}/analyze","POST /widget/v1/conversations/{conversation_id}/classify","POST /widget/v1/conversations/{conversation_id}/messages","POST /widget/v1/messages/{message_id}/feedback","POST /widget/v1/uploads/initiate","POST /widget/v1/pets/{pet_ref}","POST /widget/v1/records/clinic-requests","POST /widget/v1/records/clinic-requests/batch","POST /widget/v1/records/requests","POST /widget/v1/records/requests/{request_id}/clinic-email","POST /widget/v1/records/requests/{request_id}/convert-to-upload","POST /widget/v1/records/requests/{request_id}/retry","POST /widget/v1/records/requests/{request_id}/revoke","POST /widget/v1/records/requests/{request_id}/uploads/complete","POST /widget/v1/records/requests/{request_id}/uploads/initiate","POST /widget/v1/records/sandbox/requests/{request_id}/clinic-reply","POST /widget/v1/records/sandbox/requests/{request_id}/publish-sample","POST /widget/v1/records/signatures/complete","POST /widget/v1/records/signatures/initiate","POST /widget/v1/sessions","POST /widget/v1/televet/handoffs","POST /widget/v1/televet/availability","GET /widget/v1/televet/chat-entry","POST /widget/v1/televet/sandbox/visits","POST /widget/v1/televet/sandbox/visits/{visit_ref}/advance","POST /widget/v1/televet/sandbox/visits/{visit_ref}/simulate","GET /widget/v1/televet/state-policy/{state}","GET /widget/v1/televet/vets","GET /widget/v1/televet/slots","GET /widget/v1/televet/slots/next","POST /widget/v1/televet/slots/{slot_id}/hold","GET /widget/v1/televet/entitlement","GET /widget/v1/televet/cancellation-policy","POST /widget/v1/televet/consults","GET /widget/v1/televet/consults","GET /widget/v1/televet/consults/{consult_id}","POST /widget/v1/televet/consults/{consult_id}/join","POST /widget/v1/televet/consults/{consult_id}/cancel","POST /widget/v1/televet/consults/{consult_id}/reschedule","GET /widget/v1/pets/{pet_ref}/profile","GET /widget/v1/embed-config","PUT /widget/v1/consent","PUT /widget/v1/records/pets/{pet_ref}/consent"],h=["POST /widget/v1/photo/precheck","POST /widget/v1/photo/analyze","POST /widget/v1/video/analyze","GET /widget/v1/analysis/jobs/{job_id}","GET /widget/v1/pets/{pet_ref}/state","POST /widget/v1/televet/consults/triage","POST /widget/v1/televet/state-interest"];function ie(e,t){let r=e.split("/"),[o=""]=t.split("?"),a=o.split("/");return r.length!==a.length?false:r.every((i,l)=>{let s=a[l];return s===void 0?false:i.startsWith("{")&&i.endsWith("}")?s.length>0:i===s})}n(ie,"pathMatches");function k(e,t){let r=n(o=>o.some(a=>{let[i,l]=a.split(" ");return i===void 0||l===void 0?false:i===e.toUpperCase()&&ie(l,t)}),"matches");return r(ae)?"known":r(h)?"absent":"unknown"}n(k,"classifyRoute");var b=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(b.map(e=>e.wireCode));var se=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"}),x=Object.freeze(b.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:se[e.wireCode]}))),le=new Map(x.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),de=Object.freeze(["http_envelope",...[...new Set(x.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function _(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...de]){let a=le.get(o+r);if(a)return a}}n(_,"contractErrorFor");function ue(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(ue,"contractDocUrl");function I(e){return null}n(I,"publishedDocUrl");var ce=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function A(e){return ce[e]}n(A,"categoryFor");function m(e){let t=_(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){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 "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(m,"fromWire");function N(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}n(N,"fromHttpStatus");var pe=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function E(e){return pe.has(e)}n(E,"isAutoRetryable");var fe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function z(e){return E(e)||fe.has(e)}n(z,"isRetryableCode");function P(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}n(P,"assertNever");function L(e,t,r=null){return Object.freeze({kind:"accepted",streamId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(L,"acceptedFrame");function D(e,t=null){return Object.freeze({kind:"heartbeat",lastEventId:e,serverRequestId:t,terminal:false})}n(D,"heartbeatFrame");function j(e,t,r=null){return Object.freeze({kind:"delta",delta:e,lastEventId:t,serverRequestId:r,terminal:false})}n(j,"deltaFrame");function q(e,t=null){return Object.freeze({kind:"done",terminal:true,conversationId:e.conversationId,messageId:e.messageId,title:e.title,followUpQuestions:Object.freeze([...e.followUpQuestions]),citations:Object.freeze([...e.citations]),citationStatus:e.citationStatus,urgencyLevel:e.urgencyLevel,urgencyReason:e.urgencyReason,urgencyProvided:e.urgencyProvided??e.urgencyLevel!==null,resultId:e.resultId,lastEventId:e.lastEventId,serverRequestId:t})}n(q,"doneFrame");function c(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(c,"errorFrame");function U(e,t,r=null){return Object.freeze({kind:"analysisStarted",requestId:e,lastEventId:t,serverRequestId:r,terminal:false})}n(U,"analysisStartedFrame");function M(e,t=null){return Object.freeze({kind:"analysisComplete",terminal:false,resultId:e.resultId,analysisType:e.analysisType,modelVersion:e.modelVersion,confidence:e.confidence,detections:Object.freeze([...e.detections]),interpretation:e.interpretation,lastEventId:e.lastEventId,serverRequestId:t})}n(M,"analysisCompleteFrame");function B(e,t,r=null){return Object.freeze({kind:"unknown",raw:{...e},lastEventId:t,serverRequestId:r,terminal:false})}n(B,"unknownFrame");var G=`
2
2
 
3
3
  `,_e=1048576,me=z$1.record(z$1.string(),z$1.unknown()),Ee=["emergency","schedule_soon","home_care"];async function*f(e,t=null){let r=null,o=n(()=>(r!==null||(r=typeof t=="function"?t():t),r),"requestIdNow"),a=new TextDecoder("utf-8"),i="",l=0,s=false;for await(let u of e){for(i+=a.decode(u,{stream:true});;){let g=i.indexOf(G,l);if(g===-1)break;let ne=i.slice(0,g);i=i.slice(g+G.length),l=0;let y=W(ne,o());if(y!==null&&(y.kind==="delta"&&(s=true),yield y,y.terminal))return}if(l=i.length>0?i.length-1:0,i.length>_e){yield c({code:s?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});return}}if(i+=a.decode(),i.trim().length>0){let u=W(i,o());if(u!==null&&(u.kind==="delta"&&(s=true),yield u,u.terminal))return}yield c({code:s?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:o()});}n(f,"parseSse");function W(e,t){let r=null,o=[];for(let l of e.split(`
4
4
  `)){let s=l.replace(/\s+$/,"");s.length===0||s.startsWith(":")||(s.startsWith("id:")?r=s.slice(3).trim():s.startsWith("data:")&&o.push(s.slice(5).replace(/^ /,"")));}if(o.length===0)return null;let a;try{a=JSON.parse(o.join(`
5
- `));}catch{return null}if(typeof a!="object"||a===null||Array.isArray(a))return null;let i=me.safeParse(a);return i.success?ge(i.data,r,t):null}n(W,"parseBlock");function ge(e,t,r){let o=e.type,a=e.event;if(o==="error"||"error"in e)return c({code:d(e.code)??"unknown",retryable:e.retryable===true,wireMessage:d(e.error),synthesized:false,lastEventId:t,serverRequestId:r});if(o==="done"||e.done===true)return q({conversationId:d(e.conversation_id)??"",messageId:d(e.message_id),title:d(e.title),followUpQuestions:we(e.follow_up_questions),citations:Y(e.citations),citationStatus:d(e.citation_status),urgencyLevel:H(e.urgency_level),urgencyReason:d(e.urgency_reason),urgencyProvided:be(e),resultId:d(e.result_id),lastEventId:t},r);if(o==="accepted"||e.status==="reasoning")return P(d(e.stream_id),t,r);if(o==="heartbeat"||e.heartbeat===true)return D(t,r);if(o==="text.delta"||"delta"in e||"token"in e){let i=d(e.delta)??d(e.token)??"";return j(i,t,r)}return a==="analysis_started"?U(d(e.request_id),t,r):a==="analysis_complete"?M({resultId:d(e.result_id),analysisType:d(e.analysis_type),modelVersion:d(e.model_version),confidence:he(e.confidence),detections:Y(e.detections),interpretation:d(e.interpretation),lastEventId:t},r):B(e,t,r)}n(ge,"frameFromWire");function d(e){return typeof e=="string"?e:null}n(d,"asString");function he(e){return typeof e=="number"&&Number.isFinite(e)?e:null}n(he,"asNumber");function H(e){return typeof e=="string"&&Ee.includes(e)?e:null}n(H,"asUrgency");function be(e){if(!Object.prototype.hasOwnProperty.call(e,"urgency_level"))return false;let t=e.urgency_level;return t===null||H(t)!==null}n(be,"urgencySlotProvided");function we(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:String(t)):[]}n(we,"asStringList");function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(Re,"isPlainObject");function Y(e){return Array.isArray(e)?e.filter(Re):[]}n(Y,"asMapList");var Se=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Te(e){return Se[e]}n(Te,"userFacingError");function Q(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(Q,"defineHidden");var Oe=/^[a-z][a-z0-9_]{0,63}$/;function $(e,t){let r=_(t?.wireCode,t?.wireEnvelope),o={code:e,category:A(e),retryable:t?.retryable??z(e),displayMessage:Te(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Oe.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&Q(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Q(o,"raw",t.raw),Object.freeze(o)}n($,"makeEverfurError");async function*V(e,t=[]){let r=new TextEncoder().encode(e),o=[...new Set(t)].filter(i=>i>0&&i<r.length).sort((i,l)=>i-l),a=0;for(let i of o)yield r.subarray(a,i),a=i;yield r.subarray(a);}n(V,"bufferedTextByteSource");function J(e,t,r){let o=Ce(t),a=o?m(o):N(e),i=ke(t);return $(a,{httpStatus:e,...Fe(t)?{retryable:true}:{},...r?{requestId:r}:{},...o?{wireCode:o}:{},...K(t)?{reasonCode:K(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}n(J,"errorFromResponse");function K(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}n(K,"extractReasonCode");function Ce(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ce,"extractWireCode");function ke(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(ke,"extractWireMessage");function Fe(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(Fe,"extractRetryable");var ee=Object.freeze({accepted:n(e=>JSON.stringify(e?{type:"accepted",stream_id:e}:{type:"accepted"}),"accepted"),heartbeat:n(()=>JSON.stringify({type:"heartbeat"}),"heartbeat"),delta:n(e=>JSON.stringify({type:"text.delta",delta:e}),"delta"),done:n(e=>JSON.stringify({type:"done",...e??{}}),"done"),error:n((e,t=false)=>JSON.stringify({type:"error",code:e,retryable:t}),"error")}),xe=Object.freeze({pets:n(e=>({pets:e.map(t=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...t}))}),"pets"),uploadInitiate:n(e=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...e??{}}),"uploadInitiate"),feedback:n(e=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...e??{}}),"feedback")});function X(e,t){let r=k(e,t);if(r!=="known")throw r==="absent"?new p("invalid-argument",`MockTransport: ${e} ${t} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${h.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new p("invalid-argument",`MockTransport: ${e} ${t} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}n(X,"assertRouteIsServed");var T=class T{constructor(t={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=t.strictPaths??true;}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...t){return this.streamQueue.push(...t),this}enqueueRequest(...t){return this.requestQueue.push(...t),this}async request(t){this.strictPaths&&X(t.method,t.path);let r={method:t.method,path:t.path,headers:{...t.headers??{}},...t.query===void 0?{}:{query:{...t.query}}},o=t.body===void 0?r:{...r,body:t.body};this.requests.push(o);let a=`${t.method} ${t.path}`,i=this.requestQueue.shift();i!==void 0&&this.lastRequestScript.set(a,i);let l=i??this.lastRequestScript.get(a)??{status:200,body:{}},s=l.status??200;return s===304||s>=400?C(J(s,l.body??null)):O(l.body??{})}stream(t,r){this.strictPaths&&X(t.method,t.path),this.streamRequests.push({path:t.path,authorization:R(t,"authorization"),partnerKey:R(t,"x-everfur-partner-key"),idempotencyKey:R(t,"idempotency-key"),...t.body===void 0?{}:{body:t.body},headers:{...t.headers??{}}});let o=this.streamQueue.shift()??{kind:"sse",blocks:[ee.done()]};return this.openStream(o,r)}async*openStream(t,r){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(t,r);}finally{this.openCount-=1;}}async*runScript(t,r){switch(t.kind){case "httpError":{let o=Ae(t.body)??Le(t.status);yield c({code:o,retryable:ze(t.body)||E(m(o)),wireMessage:Ne(t.body),synthesized:true,lastEventId:null});return}case "network":yield c({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case "partialByte":yield*f(V(t.body,t.splitAt));return;case "sse":yield*f(Z(t.blocks,t.gapMs??0,r));return;case "drop":yield*f(Z(t.blocks,0,r));return;case "stall":yield*f(Ie(t.preface??[],r));return;default:return L(t)}}};n(T,"MockTransport");var S=T;async function*Z(e,t,r){let o=new TextEncoder,a=true;for(let i of e){if(r.aborted||!a&&t>0&&await re(t,r)==="abort")return;a=false,yield o.encode(te(i));}}n(Z,"sseByteSource");async function*Ie(e,t){let r=new TextEncoder;for(let o of e){if(t.aborted)return;yield r.encode(te(o));}await re(1/0,t);}n(Ie,"stallByteSource");function te(e){return `data: ${e}
5
+ `));}catch{return null}if(typeof a!="object"||a===null||Array.isArray(a))return null;let i=me.safeParse(a);return i.success?ge(i.data,r,t):null}n(W,"parseBlock");function ge(e,t,r){let o=e.type,a=e.event;if(o==="error"||"error"in e)return c({code:d(e.code)??"unknown",retryable:e.retryable===true,wireMessage:d(e.error),synthesized:false,lastEventId:t,serverRequestId:r});if(o==="done"||e.done===true)return q({conversationId:d(e.conversation_id)??"",messageId:d(e.message_id),title:d(e.title),followUpQuestions:we(e.follow_up_questions),citations:Y(e.citations),citationStatus:d(e.citation_status),urgencyLevel:H(e.urgency_level),urgencyReason:d(e.urgency_reason),urgencyProvided:be(e),resultId:d(e.result_id),lastEventId:t},r);if(o==="accepted"||e.status==="reasoning")return L(d(e.stream_id),t,r);if(o==="heartbeat"||e.heartbeat===true)return D(t,r);if(o==="text.delta"||"delta"in e||"token"in e){let i=d(e.delta)??d(e.token)??"";return j(i,t,r)}return a==="analysis_started"?U(d(e.request_id),t,r):a==="analysis_complete"?M({resultId:d(e.result_id),analysisType:d(e.analysis_type),modelVersion:d(e.model_version),confidence:he(e.confidence),detections:Y(e.detections),interpretation:d(e.interpretation),lastEventId:t},r):B(e,t,r)}n(ge,"frameFromWire");function d(e){return typeof e=="string"?e:null}n(d,"asString");function he(e){return typeof e=="number"&&Number.isFinite(e)?e:null}n(he,"asNumber");function H(e){return typeof e=="string"&&Ee.includes(e)?e:null}n(H,"asUrgency");function be(e){if(!Object.prototype.hasOwnProperty.call(e,"urgency_level"))return false;let t=e.urgency_level;return t===null||H(t)!==null}n(be,"urgencySlotProvided");function we(e){return Array.isArray(e)?e.map(t=>typeof t=="string"?t:String(t)):[]}n(we,"asStringList");function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(Re,"isPlainObject");function Y(e){return Array.isArray(e)?e.filter(Re):[]}n(Y,"asMapList");var Se=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Te(e){return Se[e]}n(Te,"userFacingError");function Q(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(Q,"defineHidden");var Oe=/^[a-z][a-z0-9_]{0,63}$/;function $(e,t){let r=_(t?.wireCode,t?.wireEnvelope),o={code:e,category:A(e),retryable:t?.retryable??z(e),displayMessage:Te(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Oe.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&Q(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Q(o,"raw",t.raw),Object.freeze(o)}n($,"makeEverfurError");async function*V(e,t=[]){let r=new TextEncoder().encode(e),o=[...new Set(t)].filter(i=>i>0&&i<r.length).sort((i,l)=>i-l),a=0;for(let i of o)yield r.subarray(a,i),a=i;yield r.subarray(a);}n(V,"bufferedTextByteSource");function J(e,t,r){let o=Ce(t),a=o?m(o):N(e),i=ke(t);return $(a,{httpStatus:e,...Fe(t)?{retryable:true}:{},...r?{requestId:r}:{},...o?{wireCode:o}:{},...K(t)?{reasonCode:K(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}n(J,"errorFromResponse");function K(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}n(K,"extractReasonCode");function Ce(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ce,"extractWireCode");function ke(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(ke,"extractWireMessage");function Fe(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(Fe,"extractRetryable");var ee=Object.freeze({accepted:n(e=>JSON.stringify(e?{type:"accepted",stream_id:e}:{type:"accepted"}),"accepted"),heartbeat:n(()=>JSON.stringify({type:"heartbeat"}),"heartbeat"),delta:n(e=>JSON.stringify({type:"text.delta",delta:e}),"delta"),done:n(e=>JSON.stringify({type:"done",...e??{}}),"done"),error:n((e,t=false)=>JSON.stringify({type:"error",code:e,retryable:t}),"error")}),xe=Object.freeze({pets:n(e=>({pets:e.map(t=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...t}))}),"pets"),uploadInitiate:n(e=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...e??{}}),"uploadInitiate"),feedback:n(e=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...e??{}}),"feedback")});function X(e,t){let r=k(e,t);if(r!=="known")throw r==="absent"?new p("invalid-argument",`MockTransport: ${e} ${t} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${h.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new p("invalid-argument",`MockTransport: ${e} ${t} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}n(X,"assertRouteIsServed");var T=class T{constructor(t={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=t.strictPaths??true;}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...t){return this.streamQueue.push(...t),this}enqueueRequest(...t){return this.requestQueue.push(...t),this}async request(t){this.strictPaths&&X(t.method,t.path);let r={method:t.method,path:t.path,headers:{...t.headers??{}},...t.query===void 0?{}:{query:{...t.query}}},o=t.body===void 0?r:{...r,body:t.body};this.requests.push(o);let a=`${t.method} ${t.path}`,i=this.requestQueue.shift();i!==void 0&&this.lastRequestScript.set(a,i);let l=i??this.lastRequestScript.get(a)??{status:200,body:{}},s=l.status??200;return s===304||s>=400?C(J(s,l.body??null)):O(l.body??{})}stream(t,r){this.strictPaths&&X(t.method,t.path),this.streamRequests.push({path:t.path,authorization:R(t,"authorization"),partnerKey:R(t,"x-everfur-partner-key"),idempotencyKey:R(t,"idempotency-key"),...t.body===void 0?{}:{body:t.body},headers:{...t.headers??{}}});let o=this.streamQueue.shift()??{kind:"sse",blocks:[ee.done()]};return this.openStream(o,r)}async*openStream(t,r){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(t,r);}finally{this.openCount-=1;}}async*runScript(t,r){switch(t.kind){case "httpError":{let o=Ae(t.body)??Pe(t.status);yield c({code:o,retryable:ze(t.body)||E(m(o)),wireMessage:Ne(t.body),synthesized:true,lastEventId:null});return}case "network":yield c({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case "partialByte":yield*f(V(t.body,t.splitAt));return;case "sse":yield*f(Z(t.blocks,t.gapMs??0,r));return;case "drop":yield*f(Z(t.blocks,0,r));return;case "stall":yield*f(Ie(t.preface??[],r));return;default:return P(t)}}};n(T,"MockTransport");var S=T;async function*Z(e,t,r){let o=new TextEncoder,a=true;for(let i of e){if(r.aborted||!a&&t>0&&await re(t,r)==="abort")return;a=false,yield o.encode(te(i));}}n(Z,"sseByteSource");async function*Ie(e,t){let r=new TextEncoder;for(let o of e){if(t.aborted)return;yield r.encode(te(o));}await re(1/0,t);}n(Ie,"stallByteSource");function te(e){return `data: ${e}
6
6
 
7
- `}n(te,"toSseBlock");function re(e,t){return new Promise(r=>{if(t.aborted){r("abort");return}let o=null,a=n(()=>{o!==null&&clearTimeout(o),t.removeEventListener("abort",a),r("abort");},"onAbort");Number.isFinite(e)&&(o=setTimeout(()=>{t.removeEventListener("abort",a),r("timeout");},e)),t.addEventListener("abort",a,{once:true});})}n(re,"abortableSleep");function R(e,t){let r=e.headers;if(!r)return null;for(let[o,a]of Object.entries(r))if(o.toLowerCase()===t)return a;return null}n(R,"header");function Ae(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ae,"extractWireCode");function Ne(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(Ne,"extractWireMessage");function ze(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(ze,"extractRetryable");function Le(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e>=500?"INTERNAL_ERROR":""}n(Le,"statusToWireCode");export{S as MockTransport,xe as bodies,ee as wire};
7
+ `}n(te,"toSseBlock");function re(e,t){return new Promise(r=>{if(t.aborted){r("abort");return}let o=null,a=n(()=>{o!==null&&clearTimeout(o),t.removeEventListener("abort",a),r("abort");},"onAbort");Number.isFinite(e)&&(o=setTimeout(()=>{t.removeEventListener("abort",a),r("timeout");},e)),t.addEventListener("abort",a,{once:true});})}n(re,"abortableSleep");function R(e,t){let r=e.headers;if(!r)return null;for(let[o,a]of Object.entries(r))if(o.toLowerCase()===t)return a;return null}n(R,"header");function Ae(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?r:null}n(Ae,"extractWireCode");function Ne(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}n(Ne,"extractWireMessage");function ze(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}n(ze,"extractRetryable");function Pe(e){return e===401?"AUTH_EXPIRED":e===403?"ACCESS_DENIED":e===404?"NOT_FOUND":e===409?"IDEMPOTENCY_CONFLICT":e===421?"MISDIRECTED_REQUEST":e===429?"RATE_LIMITED":e===400||e===422?"INVALID_REQUEST":e>=500?"INTERNAL_ERROR":""}n(Pe,"statusToWireCode");export{S as MockTransport,xe as bodies,ee as wire};