@everfur/sdk 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +648 -1
  2. package/README.md +58 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-DPUD6dnc.d.cts +128 -0
  5. package/dist/Chat-DwAC2vhB.d.ts +128 -0
  6. package/dist/DepthViews-DNEM96Se.d.ts +16 -0
  7. package/dist/DepthViews-DP0R-DhB.d.cts +19 -0
  8. package/dist/DepthViews-D_3hl4xk.d.ts +19 -0
  9. package/dist/DepthViews-DbFhR4Du.d.cts +16 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-5NeobOCd.d.ts +256 -0
  21. package/dist/attachments-Bw3iMQgu.d.ts +146 -0
  22. package/dist/attachments-CQgFrEQ7.d.cts +146 -0
  23. package/dist/attachments-D8T5re7e.d.cts +256 -0
  24. package/dist/casesRepository-ClLv6qMl.d.ts +188 -0
  25. package/dist/casesRepository-DHwtGRYY.d.cts +188 -0
  26. package/dist/chat/index.cjs +1 -1170
  27. package/dist/chat/index.d.cts +31 -53
  28. package/dist/chat/index.d.ts +31 -53
  29. package/dist/chat/index.js +1 -1167
  30. package/dist/client/index.cjs +9 -2315
  31. package/dist/client/index.d.cts +77 -15
  32. package/dist/client/index.d.ts +77 -15
  33. package/dist/client/index.js +9 -2215
  34. package/dist/{config-CiJ0PVBB.d.ts → config-CzTZGlfF.d.cts} +63 -25
  35. package/dist/{config-BSjBdxrZ.d.cts → config-DW60uRb9.d.ts} +63 -25
  36. package/dist/consent/index.cjs +1 -0
  37. package/dist/consent/index.d.cts +33 -0
  38. package/dist/consent/index.d.ts +33 -0
  39. package/dist/consent/index.js +1 -0
  40. package/dist/context-DXhqHlPU.d.ts +159 -0
  41. package/dist/context-XvTzq1tE.d.cts +159 -0
  42. package/dist/copy-Mjoo91aS.d.ts +198 -0
  43. package/dist/copy-bKDNigLb.d.cts +198 -0
  44. package/dist/core/index.cjs +13 -3175
  45. package/dist/core/index.d.cts +58 -12
  46. package/dist/core/index.d.ts +58 -12
  47. package/dist/core/index.js +13 -3163
  48. package/dist/depth-CErXCU8J.d.cts +502 -0
  49. package/dist/depth-DjDcJ6kH.d.ts +502 -0
  50. package/dist/entitlementRepository-DKdXFgTo.d.cts +698 -0
  51. package/dist/entitlementRepository-DSbzuyAW.d.ts +698 -0
  52. package/dist/{identity-DK9zORrG.d.ts → identity-BMx2SUOM.d.ts} +19 -6
  53. package/dist/{identity-Brl-lDd6.d.cts → identity-DI4eVx9S.d.cts} +19 -6
  54. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  55. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  56. package/dist/index.cjs +12 -4488
  57. package/dist/index.d.cts +29 -121
  58. package/dist/index.d.ts +29 -121
  59. package/dist/index.js +12 -4464
  60. package/dist/models-B-Uh2LTf.d.ts +214 -0
  61. package/dist/models-D2EUxPZY.d.cts +214 -0
  62. package/dist/notifications/index.cjs +2 -0
  63. package/dist/notifications/index.d.cts +17 -0
  64. package/dist/notifications/index.d.ts +17 -0
  65. package/dist/notifications/index.js +2 -0
  66. package/dist/pets-CtQdRpWo.d.ts +92 -0
  67. package/dist/pets-aB8q0JyX.d.cts +92 -0
  68. package/dist/photo/index.cjs +1 -2189
  69. package/dist/photo/index.d.cts +6 -6
  70. package/dist/photo/index.d.ts +6 -6
  71. package/dist/photo/index.js +1 -2186
  72. package/dist/ports-BN6RHF9W.d.cts +48 -0
  73. package/dist/ports-BN6RHF9W.d.ts +48 -0
  74. package/dist/ports-DEBzEhbp.d.cts +386 -0
  75. package/dist/ports-DMolTRzU.d.ts +386 -0
  76. package/dist/profile-CSs1wlXT.d.cts +93 -0
  77. package/dist/profile-CSs1wlXT.d.ts +93 -0
  78. package/dist/records/depth/index.cjs +2 -0
  79. package/dist/records/depth/index.d.cts +13 -0
  80. package/dist/records/depth/index.d.ts +13 -0
  81. package/dist/records/depth/index.js +2 -0
  82. package/dist/records/index.cjs +3 -2839
  83. package/dist/records/index.d.cts +137 -203
  84. package/dist/records/index.d.ts +137 -203
  85. package/dist/records/index.js +3 -2833
  86. package/dist/requestFunnel-CjW7uDuA.d.ts +87 -0
  87. package/dist/requestFunnel-L-BQfi0z.d.cts +87 -0
  88. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  89. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  90. package/dist/{runtime-BgQnA594.d.cts → runtime-B8s-_hv8.d.cts} +134 -59
  91. package/dist/{runtime-CBA-LvdM.d.ts → runtime-BR9ysG0J.d.ts} +134 -59
  92. package/dist/server/events/index.cjs +2 -0
  93. package/dist/server/events/index.d.cts +550 -0
  94. package/dist/server/events/index.d.ts +550 -0
  95. package/dist/server/events/index.js +2 -0
  96. package/dist/server/index.cjs +2 -533
  97. package/dist/server/index.d.cts +73 -18
  98. package/dist/server/index.d.ts +73 -18
  99. package/dist/server/index.js +2 -530
  100. package/dist/species-BXAIMh7I.d.cts +9 -0
  101. package/dist/species-BXAIMh7I.d.ts +9 -0
  102. package/dist/televet/index.cjs +1 -0
  103. package/dist/televet/index.d.cts +60 -0
  104. package/dist/televet/index.d.ts +60 -0
  105. package/dist/televet/index.js +1 -0
  106. package/dist/testing/index.cjs +5 -823
  107. package/dist/testing/index.d.cts +17 -3
  108. package/dist/testing/index.d.ts +17 -3
  109. package/dist/testing/index.js +5 -820
  110. package/dist/testing/rn/index.cjs +1 -449
  111. package/dist/testing/rn/index.d.cts +17 -29
  112. package/dist/testing/rn/index.d.ts +17 -29
  113. package/dist/testing/rn/index.js +1 -444
  114. package/dist/testing/web/index.cjs +1 -0
  115. package/dist/testing/web/index.d.cts +131 -0
  116. package/dist/testing/web/index.d.ts +131 -0
  117. package/dist/testing/web/index.js +1 -0
  118. package/dist/timelineRows-CaohZzXS.d.cts +19 -0
  119. package/dist/timelineRows-DZed6dAM.d.ts +19 -0
  120. package/dist/typeStyle-0TydiZ1w.d.cts +19 -0
  121. package/dist/typeStyle-CWMsoe6b.d.ts +19 -0
  122. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  123. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  124. package/dist/useRecordsDepth-BHBzJ76R.d.cts +237 -0
  125. package/dist/useRecordsDepth-BU-OhzH6.d.ts +237 -0
  126. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  127. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  128. package/dist/video/index.cjs +1 -1941
  129. package/dist/video/index.d.cts +4 -4
  130. package/dist/video/index.d.ts +4 -4
  131. package/dist/video/index.js +1 -1938
  132. package/dist/view-C3qPIXGX.d.cts +310 -0
  133. package/dist/view-DtSPYpKa.d.ts +310 -0
  134. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  135. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  136. package/dist/web/consent/index.cjs +1 -0
  137. package/dist/web/consent/index.d.cts +34 -0
  138. package/dist/web/consent/index.d.ts +34 -0
  139. package/dist/web/consent/index.js +1 -0
  140. package/dist/web/index.cjs +14 -0
  141. package/dist/web/index.d.cts +217 -0
  142. package/dist/web/index.d.ts +217 -0
  143. package/dist/web/index.js +14 -0
  144. package/dist/web/notifications/index.cjs +2 -0
  145. package/dist/web/notifications/index.d.cts +213 -0
  146. package/dist/web/notifications/index.d.ts +213 -0
  147. package/dist/web/notifications/index.js +2 -0
  148. package/dist/web/records/depth/index.cjs +2 -0
  149. package/dist/web/records/depth/index.d.cts +12 -0
  150. package/dist/web/records/depth/index.d.ts +12 -0
  151. package/dist/web/records/depth/index.js +2 -0
  152. package/dist/web/records/index.cjs +4 -0
  153. package/dist/web/records/index.d.cts +194 -0
  154. package/dist/web/records/index.d.ts +194 -0
  155. package/dist/web/records/index.js +4 -0
  156. package/dist/web/televet/index.cjs +1 -0
  157. package/dist/web/televet/index.d.cts +50 -0
  158. package/dist/web/televet/index.d.ts +50 -0
  159. package/dist/web/televet/index.js +1 -0
  160. package/notifications/package.json +8 -0
  161. package/package.json +197 -9
  162. package/records/depth/package.json +8 -0
  163. package/server/events/device-blocked.cjs +15 -0
  164. package/server/events/package.json +9 -0
  165. package/televet/package.json +8 -0
  166. package/testing/web/native-blocked.cjs +12 -0
  167. package/testing/web/package.json +8 -0
  168. package/web/consent/native-blocked.cjs +12 -0
  169. package/web/consent/package.json +8 -0
  170. package/web/native-blocked.cjs +12 -0
  171. package/web/notifications/native-blocked.cjs +12 -0
  172. package/web/notifications/package.json +8 -0
  173. package/web/package.json +8 -0
  174. package/web/records/depth/native-blocked.cjs +12 -0
  175. package/web/records/depth/package.json +8 -0
  176. package/web/records/native-blocked.cjs +12 -0
  177. package/web/records/package.json +8 -0
  178. package/web/televet/native-blocked.cjs +12 -0
  179. package/web/televet/package.json +8 -0
  180. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  181. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  182. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  183. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  184. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  185. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  186. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  187. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1,256 @@
1
+ import { E as EverfurError, c as EverfurResult } from './EverfurResult-DN9pL2Ab.cjs';
2
+ import { C as ConversationId, P as PetRef, b as ResponseId } from './ids-B2GAAifq.cjs';
3
+ import { f as ChatFeedbackType, j as ChatStatus, i as ChatMessage, c as ChatConversationListOptions, d as ChatConversationPage, g as ChatHistoryOptions, h as ChatMessagePage, a as ChatCheckinTarget, e as ChatFeedbackReceipt } from './ports-DEBzEhbp.cjs';
4
+ import { C as CheckinAnswer, a as CheckinOutcome, b as WidgetPet } from './casesRepository-DHwtGRYY.cjs';
5
+ import { i as UrgencyLevel } from './config-CzTZGlfF.cjs';
6
+ import { U as UploadTransport, F as FileHandle } from './ports-BN6RHF9W.cjs';
7
+ import { c as AttachmentQueue, d as AttachmentState, A as AttachmentError, b as AttachmentOutcome } from './attachments-CQgFrEQ7.cjs';
8
+
9
+ /** The three thumbs. `'neutral'` is the app's rotated thumbs-down glyph. */
10
+ type ChatSentiment = 'up' | 'neutral' | 'down';
11
+ /** The reason keys of the not-helpful sheet, in the app's order. */
12
+ type ChatFeedbackReason = 'inaccurate' | 'outdated' | 'unsafe' | 'unclear' | 'other';
13
+ interface ChatFeedbackReasonOption {
14
+ readonly key: ChatFeedbackReason;
15
+ /** The chip label, verbatim from the app. */
16
+ readonly label: string;
17
+ /** The `feedback_type` the chip records. */
18
+ readonly feedbackType: ChatFeedbackType;
19
+ }
20
+
21
+ /**
22
+ * Headless chat state. `isBootstrapping` is a deliberate superset of the SPEC-10 §7.4 minimum: the
23
+ * controller snapshot carries it (§7.1) and the prebuilt component maps it to the Loading state.
24
+ */
25
+ interface UseEverfurChatState {
26
+ readonly status: ChatStatus;
27
+ readonly messages: ReadonlyArray<ChatMessage>;
28
+ readonly conversationId: ConversationId | null;
29
+ /** The pet this surface is scoped to (the option, else the provider's active pet); null when unscoped. */
30
+ readonly petRef: PetRef | null;
31
+ readonly error: EverfurError | null;
32
+ readonly isStreaming: boolean;
33
+ readonly isBootstrapping: boolean;
34
+ readonly historyCursor: string | null;
35
+ readonly isLoadingHistory: boolean;
36
+ /**
37
+ * The last turn was stopped before its first token: the question is on screen with no answer under it. The
38
+ * prebuilt surface renders the app's `Response stopped` notice with a retry; a fresh send, a retry or a
39
+ * thread change clears it.
40
+ *
41
+ * OPTIONAL on the type, always present from the hook. It was added to a shipped interface that partners and
42
+ * suites already build doubles of, and a required field would have made every one of those a type error for
43
+ * a flag they have no opinion about; absent reads the same as `false` everywhere it is consumed.
44
+ */
45
+ readonly stopped?: boolean;
46
+ listConversations(opts?: ChatConversationListOptions): Promise<EverfurResult<ChatConversationPage>>;
47
+ getMessages(id: ConversationId, opts?: ChatHistoryOptions): Promise<EverfurResult<ChatMessagePage>>;
48
+ resumeConversation(id: ConversationId): Promise<EverfurResult<void>>;
49
+ loadOlderMessages(): Promise<EverfurResult<void>>;
50
+ /**
51
+ * Backend-owned suggested-prompt strings (flattened + de-duplicated) from the chat bootstrap. Empty until the
52
+ * bootstrap resolves and empty when the backend returns none; the prebuilt component renders them as the
53
+ * tappable "Follow up questions" list, each string a ready-to-send message.
54
+ */
55
+ readonly suggestedPrompts: ReadonlyArray<string>;
56
+ /** Unread assistant messages in the active thread (see `ChatSnapshot.unreadCount`); null while unknown. */
57
+ readonly unreadCount: number | null;
58
+ /**
59
+ * Does any thread the SDK has listed still carry unread assistant content? The header dot, answerable from
60
+ * the chat bootstrap's own head read, so it never waits on the history drawer being opened.
61
+ *
62
+ * OPTIONAL on the type, always present from the hook, for the same reason `stopped` is: it was added to a
63
+ * shipped interface that partners and suites already build doubles of, and absent reads as `false`.
64
+ */
65
+ readonly hasUnreadThreads?: boolean;
66
+ /**
67
+ * Open the thread a follow-up check-in landed in: the conversation an Everfur push named, or, with only a
68
+ * pet, the head of that pet's list (the read that also materializes a check-in the member is owed).
69
+ * Settles to the conversation opened, `ok(null)` when there is no thread yet; never throws.
70
+ *
71
+ * OPTIONAL on the type, always present from the hook, for the same reason `stopped` is: it was added to a
72
+ * shipped interface that partners and suites already build doubles of, and a required member would have
73
+ * made every one of those a type error. A double that omits it simply opens nothing.
74
+ */
75
+ openCheckin?(target?: ChatCheckinTarget): Promise<EverfurResult<ConversationId | null>>;
76
+ /** Mark the active thread read and zero `unreadCount`. Settles; a no-op without an active thread. */
77
+ markRead(): Promise<EverfurResult<void>>;
78
+ /**
79
+ * CRN-16. The turn in flight is being re-attempted by the SDK with nothing asked of the reader. The
80
+ * prebuilt surfaces render the app's `Reconnecting` caption for it.
81
+ *
82
+ * OPTIONAL on the type, always present from the hook, for the same reason `stopped` is.
83
+ */
84
+ readonly reconnecting?: boolean;
85
+ /**
86
+ * CRN-16. Re-read the active thread's newest window and the limit-1 list, merging in anything the platform
87
+ * wrote while the host was away. Settles; a no-op without a thread and while a turn is in flight.
88
+ *
89
+ * OPTIONAL on the type, always present from the hook, for the same reason `stopped` is.
90
+ */
91
+ refreshActiveThread?(): Promise<EverfurResult<void>>;
92
+ /**
93
+ * Record the owner's answer to a follow-up check-in against the scoped pet and reflect it on the message
94
+ * (`message.checkin`). Settles; without a pet in scope it is `validationFailed` before any I/O.
95
+ */
96
+ answerCheckin(caseId: string, answer: CheckinAnswer): Promise<EverfurResult<CheckinOutcome>>;
97
+ /**
98
+ * Leave the active thread for a fresh, empty one (the history drawer's "New conversation"): the transcript
99
+ * clears and the next `send` creates the conversation. Nothing is fetched or deleted.
100
+ */
101
+ newConversation(): void;
102
+ /**
103
+ * The reader's rating per assistant message (keyed by the message id), for the thumbs: what was last recorded
104
+ * this session. A message with no entry is unrated. Local state; the server keeps its own copy.
105
+ */
106
+ readonly sentimentByMessage: Readonly<Record<string, ChatSentiment>>;
107
+ /**
108
+ * Rate an assistant reply (`POST /widget/v1/messages/{message_id}/feedback`). Only a message with a server
109
+ * `responseId` is eligible (a local or pending id settles to `validationFailed` before any I/O). A tap on the
110
+ * sentiment already recorded CLEARS it locally and sends nothing (the consumer app's behaviour); a different
111
+ * one replaces it. `reason` upgrades a thumbs-down to the specific `feedback_type` the not-helpful sheet
112
+ * picks, `notes` (<= 4000 characters) rides with it. Settles `ok({ feedbackId })` (an empty id on a local
113
+ * clear); never throws.
114
+ */
115
+ feedback(responseId: ResponseId, sentiment: ChatSentiment, reason?: ChatFeedbackReason | null, notes?: string | null): Promise<EverfurResult<ChatFeedbackReceipt>>;
116
+ /**
117
+ * Optimistic; the blank user bubble is removed on a pre-first-delta failure (controller-owned). Drives the
118
+ * controller stream to completion and settles: `ok(responseId)` on a completed turn (the id is null when
119
+ * the terminal `done` frame carried no message id), or `err` with the terminal EverfurError. `imageS3Keys`
120
+ * are the keys of images staged through the attachments queue (at most 5).
121
+ */
122
+ send(text: string, opts?: {
123
+ readonly imageS3Keys?: readonly string[];
124
+ }): Promise<EverfurResult<ResponseId | null>>;
125
+ /**
126
+ * CRN-06. Ask a grounded question in a FRESH conversation: the thread on screen is left and `prompt` is
127
+ * the first turn of a new one (the consumer's "Ask Everfur" handoff from a records card). Settles like
128
+ * `send`.
129
+ *
130
+ * OPTIONAL on the type, always present from the hook, for the same reason `stopped` is.
131
+ */
132
+ askEverfur?(prompt: string): Promise<EverfurResult<ResponseId | null>>;
133
+ /** Re-sends the last turn with the SAME idempotency key; no duplicate user bubble (§7.4). */
134
+ retryLast(): Promise<EverfurResult<ResponseId | null>>;
135
+ /** Aborts the in-flight stream; not an error. */
136
+ stop(): void;
137
+ }
138
+ /**
139
+ * @throws {EverfurConfigError} kind 'not-initialized' if called outside an EverfurProvider.
140
+ * Auto-disposes its controller reference on unmount.
141
+ */
142
+ declare function useEverfurChat(opts?: {
143
+ readonly petRef?: PetRef;
144
+ readonly conversationId?: ConversationId;
145
+ }): UseEverfurChatState;
146
+
147
+ /**
148
+ * The host's lifecycle and connectivity signals. Each subscribe returns its own unsubscribe, which the SDK
149
+ * calls on unmount; a listener that throws is contained by the caller, never by the host.
150
+ */
151
+ interface LifecyclePort {
152
+ /**
153
+ * The host came back to the foreground. Only the real blur-to-focus edge, please: a platform that flips
154
+ * through an inactive state constantly (iOS control centre, a call banner) would otherwise turn a
155
+ * notification-shade pull into a request.
156
+ */
157
+ onForeground(listener: () => void): () => void;
158
+ /** Connectivity returned. Omit it and a deferred refresh waits for the next foreground instead. */
159
+ onOnline?(listener: () => void): () => void;
160
+ /**
161
+ * Something told the host THIS member's thread changed: the push that carried the message. Announced
162
+ * triggers are never coalesced, because that is the one case where the reader is waiting on new content.
163
+ */
164
+ onAnnounced?(listener: () => void): () => void;
165
+ /** Is the host unambiguously offline? Absent reads as online, which is exactly today's behaviour. */
166
+ isOffline?(): boolean;
167
+ }
168
+
169
+ /**
170
+ * CRN-16. The host's own storage for an unsent draft. The SDK ships NO persistence of its own: a draft is
171
+ * memory-only unless a host passes this, because a question half-typed on a health surface is the reader's
172
+ * own text and where it may be written down is the host's decision, not the SDK's. `conversationId` is null
173
+ * for the not-yet-created thread, so a host that keys on it can scope per thread.
174
+ */
175
+ interface EverfurChatDraftStore {
176
+ /** The draft you last stored for this thread, or null. May be async. */
177
+ read(conversationId: string | null): string | null | Promise<string | null>;
178
+ /** Store the unsent draft for this thread; an empty string means the reader cleared it. May be async. */
179
+ write(conversationId: string | null, text: string): void | Promise<void>;
180
+ }
181
+
182
+ /** The three server tiers plus the app's calm `general` tier for an informational turn. */
183
+ type UrgencyDisplayLevel = UrgencyLevel | 'general';
184
+
185
+ /** The pet list state a header or switcher renders from. */
186
+ interface UseEverfurPetsState {
187
+ /** The registered pets, newest first as the server lists them; empty until the first fetch settles. */
188
+ readonly pets: readonly WidgetPet[];
189
+ /** The provider's active pet (`activePet` prop or `handle.setActivePet`), resolved against the list; null when unscoped or not listed. */
190
+ readonly activePet: WidgetPet | null;
191
+ /** True while a fetch is in flight (the first one too, so a header can hold its disc until the name is known). */
192
+ readonly loading: boolean;
193
+ /** The last fetch's settled error (`error.displayMessage` is safe to show), or null. */
194
+ readonly error: EverfurError | null;
195
+ /** Fetch the list again (after `registerPet`, or a retry). Settles; never throws. */
196
+ refresh(): Promise<void>;
197
+ }
198
+ /**
199
+ * @throws {EverfurConfigError} kind 'not-initialized' if called outside an EverfurProvider.
200
+ */
201
+ declare function useEverfurPets(): UseEverfurPetsState;
202
+
203
+ /** What a composer renders and calls. */
204
+ interface UseChatAttachmentsState {
205
+ /** True when the host wired an upload transport; the attach control is hidden otherwise. */
206
+ readonly available: boolean;
207
+ /** The rows, in the order they were added. */
208
+ readonly attachments: readonly AttachmentState[];
209
+ /** The composer's slots. */
210
+ readonly maxPerMessage: number;
211
+ /** True while any row is still uploading: the send is blocked meanwhile. */
212
+ readonly uploading: boolean;
213
+ /**
214
+ * True while any row FAILED to upload. The send is blocked on this too, because the alternative is the
215
+ * silent drop: `s3Keys` names only the rows that landed and the strip is cleared on dispatch, so a send here
216
+ * would post the message without the photo the owner picked and leave nothing behind to say so. The consumer
217
+ * app blocks the same way (everfur-mobile `useAuthenticatedReportChat.ts`, the `blockingAttachment` guard).
218
+ */
219
+ readonly failed: boolean;
220
+ /**
221
+ * True while the composer must refuse the send: a row is uploading or a row failed. `failed` says which of
222
+ * the two needs a sentence (the spinner already speaks for the other).
223
+ */
224
+ readonly blocked: boolean;
225
+ /** The S3 keys of every uploaded row, for `send(text, { imageS3Keys })`. */
226
+ readonly s3Keys: readonly string[];
227
+ /** The last failure that kept a pick out of the queue (`too_large`, `unsupported_type`, `too_many`), or null. */
228
+ readonly rejected: AttachmentError | null;
229
+ /** Validate and enqueue one or more picked files; returns each outcome. Never throws. */
230
+ add(files: FileHandle | readonly FileHandle[]): readonly AttachmentOutcome<AttachmentState>[];
231
+ retry(id: string): void;
232
+ remove(id: string): void;
233
+ /** Drop every row (after a successful send). */
234
+ clear(): void;
235
+ /** Forget the last rejection (the composer showed it). */
236
+ dismissRejected(): void;
237
+ }
238
+ interface UseChatAttachmentsOptions {
239
+ /** The composer's slots; default `MAX_ATTACHMENTS_PER_MESSAGE` (5). */
240
+ readonly maxPerMessage?: number;
241
+ /** Test seam: a queue to bind instead of building one from the provider. */
242
+ readonly queue?: AttachmentQueue;
243
+ /**
244
+ * The upload transport to bind instead of the provider's `uploadTransport`: the web surface passes its own
245
+ * fetch-based one, since a browser needs no host adapter to post a multipart form. Absent, the host's.
246
+ */
247
+ readonly transport?: UploadTransport;
248
+ }
249
+ /**
250
+ * The attachment rows of the composer. The queue lives for the scope (user, session epoch) and is disposed on
251
+ * unmount or re-scope, so a previous user's thumbnails never survive a switch.
252
+ * @throws {EverfurConfigError} kind 'not-initialized' if called outside an EverfurProvider.
253
+ */
254
+ declare function useChatAttachments(options?: UseChatAttachmentsOptions): UseChatAttachmentsState;
255
+
256
+ export { type ChatFeedbackReason as C, type EverfurChatDraftStore as E, type LifecyclePort as L, type UrgencyDisplayLevel as U, type ChatFeedbackReasonOption as a, type ChatSentiment as b, type UseChatAttachmentsOptions as c, type UseChatAttachmentsState as d, type UseEverfurChatState as e, type UseEverfurPetsState as f, useEverfurChat as g, useEverfurPets as h, useChatAttachments as u };
@@ -0,0 +1,188 @@
1
+ import { c as EverfurResult } from './EverfurResult-DN9pL2Ab.js';
2
+ import { A as AuthContext } from './identity-BMx2SUOM.js';
3
+ import { P as PetRef } from './ids-B2GAAifq.js';
4
+ import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile-CSs1wlXT.js';
5
+
6
+ /**
7
+ * Server-declared bounds on `WidgetPetInput`, mirrored so a violation is refused before the wire rather
8
+ * than returning a refusal after the caller has already driven a registration flow. Every field is optional
9
+ * server-side: `POST` with an empty body registers a bare pet, which is all consent needs.
10
+ *
11
+ * WHICH STATUS THE SERVER WOULD HAVE ANSWERED, because the two are not interchangeable: a body that does not
12
+ * PARSE is a 400 `ValidationException` (an unknown key, the birth date pair split, a `ref` repeated in a
13
+ * list), rendered by the app-wide validation handler. The 422s are raised AFTER the body parses: an
14
+ * unsupported species and an empty PATCH body. Every rule mirrored here is refused locally, so a partner
15
+ * using this SDK meets neither.
16
+ */
17
+ declare const PET_NAME_MAX = 100;
18
+ declare const PET_SPECIES_MAX = 50;
19
+ declare const PET_BREED_MAX = 100;
20
+ declare const PET_AGE_YEARS_MAX = 50;
21
+ declare const PET_WEIGHT_KG_MAX = 500;
22
+ /**
23
+ * The optional profile fields. Omit all of them to register the pet without describing it.
24
+ *
25
+ * The five identity fields merge: an absent one leaves the stored value unchanged. The health fields
26
+ * (`PetHealthProfileInput`) follow the partner pet body's own rules: an explicit null clears a scalar, and a list you
27
+ * send REPLACES the rows your integration wrote for that list (`[]` clears them). A registration is an upsert, so
28
+ * sending a list on a later `registerPet` replaces the earlier one rather than adding to it. Health fields need a
29
+ * SIGNED session (403 `identitySignatureRequired` otherwise) and a pet that is a dog or a cat.
30
+ */
31
+ interface PetProfileInput extends PetHealthProfileInput {
32
+ readonly name?: string;
33
+ readonly species?: string;
34
+ readonly breed?: string;
35
+ readonly ageYears?: number;
36
+ readonly weightKg?: number;
37
+ }
38
+ /** The registered profile, as the server echoes it back. */
39
+ interface RegisteredPet {
40
+ readonly petRef: string;
41
+ readonly name: string | null;
42
+ readonly species: string | null;
43
+ readonly breed: string | null;
44
+ readonly ageYears: number | null;
45
+ readonly weightKg: number | null;
46
+ }
47
+ /**
48
+ * A partial profile change for `updatePet`. An omitted field is left unchanged; `null` clears it. At least one
49
+ * field is required. The server refuses clearing or changing `species` to an unsupported value once the pet
50
+ * uses Records (Records needs a dog or a cat). A health list you send replaces your rows for that list; `[]`
51
+ * clears them.
52
+ */
53
+ interface PetProfilePatch extends PetHealthProfileInput {
54
+ readonly name?: string | null;
55
+ readonly species?: string | null;
56
+ readonly breed?: string | null;
57
+ readonly ageYears?: number | null;
58
+ readonly weightKg?: number | null;
59
+ }
60
+ /**
61
+ * One row of `GET /widget/v1/pets` (`WidgetPetResponse`, widget_schemas.py): the profile the partner registered,
62
+ * keyed by its `petRef`. The roster carries the identity fields only, never health data: the health profile is its
63
+ * own signed read (`getPetProfile`). `ageYears` is the registered whole-or-fractional age. Unknown wire fields are
64
+ * dropped at the boundary.
65
+ */
66
+ interface WidgetPet {
67
+ /** The server's own id for the row; opaque, never a scope key (`petRef` is). */
68
+ readonly petId: string | null;
69
+ readonly petRef: PetRef;
70
+ readonly name: string | null;
71
+ readonly species: string | null;
72
+ readonly breed: string | null;
73
+ readonly ageYears: number | null;
74
+ readonly weightKg: number | null;
75
+ readonly updatedAt: string | null;
76
+ }
77
+ /**
78
+ * One pet read back WITH its health profile (`GET /widget/v1/pets/{pet_ref}/profile`, `WidgetPetProfileResponse`):
79
+ * the list row's fields plus `profileVersion`, the health scalars and your integration's four lists.
80
+ */
81
+ interface WidgetPetProfile extends WidgetPet, PetHealthProfile {
82
+ }
83
+ interface PetsRepository {
84
+ /**
85
+ * `GET /widget/v1/pets` - every pet registered for the current user, as the server lists them. Settles
86
+ * `ok(readonly WidgetPet[])` on 200 (an empty list when none); `err(EverfurError)` otherwise. A row without a
87
+ * `pet_ref` is dropped rather than failing the page. Never throws.
88
+ */
89
+ list(opts?: {
90
+ signal?: AbortSignal;
91
+ }): Promise<EverfurResult<readonly WidgetPet[]>>;
92
+ /**
93
+ * `POST /widget/v1/pets/{pet_ref}` - create or update the widget pet profile. Idempotent by construction:
94
+ * the route is an upsert, so calling it for an already-registered pet updates rather than duplicates.
95
+ *
96
+ * Settles: `ok(RegisteredPet)` on 201, `err(EverfurError)` otherwise. Never throws.
97
+ */
98
+ registerPet(petRef: PetRef, profile?: PetProfileInput, opts?: {
99
+ signal?: AbortSignal;
100
+ }): Promise<EverfurResult<RegisteredPet>>;
101
+ /**
102
+ * `PATCH /widget/v1/pets/{pet_ref}` - change part of a registered pet's profile. Settles `ok(RegisteredPet)`
103
+ * on 200; an unknown pet is the not-found error; an empty change is refused before the wire.
104
+ */
105
+ updatePet(petRef: PetRef, patch: PetProfilePatch, opts?: {
106
+ signal?: AbortSignal;
107
+ }): Promise<EverfurResult<RegisteredPet>>;
108
+ /**
109
+ * `GET /widget/v1/pets/{pet_ref}/profile` - one pet with its health profile, so a partner app can show what
110
+ * Everfur holds. A SIGNED session only: any other session settles to the route's 403 `identitySignatureRequired`.
111
+ * An unknown pet is the not-found error. Never throws.
112
+ */
113
+ getPetProfile(petRef: PetRef, opts?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<EverfurResult<WidgetPetProfile>>;
116
+ /**
117
+ * `DELETE /widget/v1/pets/{pet_ref}` - delete the pet profile. The server also retires the pet's Records
118
+ * data. Settles `ok(undefined)` on 204; an unknown pet is the not-found error.
119
+ */
120
+ deletePet(petRef: PetRef, opts?: {
121
+ signal?: AbortSignal;
122
+ }): Promise<EverfurResult<void>>;
123
+ /**
124
+ * `DELETE /widget/v1/me` - permanently erase everything Everfur holds for the current user (right to
125
+ * erasure). Settles `ok(undefined)` on 204. A 503 means the erasure did not finish: it is retryable and a
126
+ * repeat call resumes it. Sent once per call (never auto-retried, so two erasures never overlap), with a
127
+ * per-attempt deadline of `ERASE_USER_DATA_TIMEOUT_MS`. The next request for the same user starts a fresh,
128
+ * empty user.
129
+ */
130
+ eraseUserData(opts?: {
131
+ signal?: AbortSignal;
132
+ }): Promise<EverfurResult<void>>;
133
+ }
134
+ /**
135
+ * The allowlist mapper for one `GET /widget/v1/pets` row: the named fields, each type-checked; anything else on
136
+ * the wire is dropped. null for a row that is not an object or carries no `pet_ref` (nothing to scope by).
137
+ */
138
+ declare function widgetPetFromWire(raw: unknown): WidgetPet | null;
139
+ /** Build the repository over a device AuthContext (personalized bearer XOR anonymous pk). */
140
+ declare function createPetsRepository(auth: AuthContext): PetsRepository;
141
+
142
+ /** The owner's answer to a check-in, the wire values of the consumer `CheckinResponse` enum. */
143
+ type CheckinAnswer = 'better' | 'same' | 'worse';
144
+ /** The closed answer set, in the order the consumer surfaces offer it. */
145
+ declare const CHECKIN_ANSWERS: readonly CheckinAnswer[];
146
+ /**
147
+ * The member-safe view of one watch case (consumer `WatchCaseView`). Case STATE only: the concern itself
148
+ * never rides on this row. `status` is the server's vocabulary (`watching` while open, then `resolved`,
149
+ * `escalated` or `lapsed`), carried as a string so a status added later never breaks a frozen client.
150
+ */
151
+ interface WatchCase {
152
+ readonly caseId: string;
153
+ readonly status: string;
154
+ /** The body-region copy hint (`ears`, `eyes`, ..., `general`), never a diagnosis. */
155
+ readonly bodyLocation: string | null;
156
+ readonly lastResponse: CheckinAnswer | null;
157
+ readonly checkInDueAt: string | null;
158
+ readonly openedAt: string | null;
159
+ readonly resolvedAt: string | null;
160
+ /** The server's own non-diagnostic post-answer line, stamped only on a BETTER resolve. */
161
+ readonly resolutionText: string | null;
162
+ }
163
+ /** The result of recording a check-in. `ctaDeepLink` is set only on a WORSE escalation (an `everfur://` pointer). */
164
+ interface CheckinOutcome {
165
+ readonly case: WatchCase;
166
+ readonly ctaDeepLink: string | null;
167
+ }
168
+ interface CasesRepository {
169
+ /**
170
+ * `GET /widget/v1/pets/{pet_ref}/cases` - the pet's open (`watching`) cases. Settles `ok([])` when the pet
171
+ * has none, which the server makes indistinguishable from a non-member or the feature being off.
172
+ */
173
+ list(petRef: PetRef, opts?: {
174
+ signal?: AbortSignal;
175
+ }): Promise<EverfurResult<readonly WatchCase[]>>;
176
+ /**
177
+ * `POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin` - record the owner's answer. Settles
178
+ * `ok(CheckinOutcome)` on 200; a case that is stale, closed, another member's or gated off is the ordinary
179
+ * not-found error. A malformed case id or an answer outside the closed set is refused before the wire.
180
+ */
181
+ checkin(petRef: PetRef, caseId: string, answer: CheckinAnswer, opts?: {
182
+ signal?: AbortSignal;
183
+ }): Promise<EverfurResult<CheckinOutcome>>;
184
+ }
185
+ /** Build the repository over a device AuthContext (personalized bearer XOR anonymous pk). */
186
+ declare function createCasesRepository(auth: AuthContext): CasesRepository;
187
+
188
+ export { type CheckinAnswer as C, type PetProfileInput as P, type RegisteredPet as R, type WatchCase as W, type CheckinOutcome as a, type WidgetPet as b, type PetProfilePatch as c, type WidgetPetProfile as d, CHECKIN_ANSWERS as e, type CasesRepository as f, PET_AGE_YEARS_MAX as g, PET_BREED_MAX as h, PET_NAME_MAX as i, PET_SPECIES_MAX as j, PET_WEIGHT_KG_MAX as k, type PetsRepository as l, createCasesRepository as m, createPetsRepository as n, widgetPetFromWire as w };
@@ -0,0 +1,188 @@
1
+ import { c as EverfurResult } from './EverfurResult-DN9pL2Ab.cjs';
2
+ import { A as AuthContext } from './identity-DI4eVx9S.cjs';
3
+ import { P as PetRef } from './ids-B2GAAifq.cjs';
4
+ import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile-CSs1wlXT.cjs';
5
+
6
+ /**
7
+ * Server-declared bounds on `WidgetPetInput`, mirrored so a violation is refused before the wire rather
8
+ * than returning a refusal after the caller has already driven a registration flow. Every field is optional
9
+ * server-side: `POST` with an empty body registers a bare pet, which is all consent needs.
10
+ *
11
+ * WHICH STATUS THE SERVER WOULD HAVE ANSWERED, because the two are not interchangeable: a body that does not
12
+ * PARSE is a 400 `ValidationException` (an unknown key, the birth date pair split, a `ref` repeated in a
13
+ * list), rendered by the app-wide validation handler. The 422s are raised AFTER the body parses: an
14
+ * unsupported species and an empty PATCH body. Every rule mirrored here is refused locally, so a partner
15
+ * using this SDK meets neither.
16
+ */
17
+ declare const PET_NAME_MAX = 100;
18
+ declare const PET_SPECIES_MAX = 50;
19
+ declare const PET_BREED_MAX = 100;
20
+ declare const PET_AGE_YEARS_MAX = 50;
21
+ declare const PET_WEIGHT_KG_MAX = 500;
22
+ /**
23
+ * The optional profile fields. Omit all of them to register the pet without describing it.
24
+ *
25
+ * The five identity fields merge: an absent one leaves the stored value unchanged. The health fields
26
+ * (`PetHealthProfileInput`) follow the partner pet body's own rules: an explicit null clears a scalar, and a list you
27
+ * send REPLACES the rows your integration wrote for that list (`[]` clears them). A registration is an upsert, so
28
+ * sending a list on a later `registerPet` replaces the earlier one rather than adding to it. Health fields need a
29
+ * SIGNED session (403 `identitySignatureRequired` otherwise) and a pet that is a dog or a cat.
30
+ */
31
+ interface PetProfileInput extends PetHealthProfileInput {
32
+ readonly name?: string;
33
+ readonly species?: string;
34
+ readonly breed?: string;
35
+ readonly ageYears?: number;
36
+ readonly weightKg?: number;
37
+ }
38
+ /** The registered profile, as the server echoes it back. */
39
+ interface RegisteredPet {
40
+ readonly petRef: string;
41
+ readonly name: string | null;
42
+ readonly species: string | null;
43
+ readonly breed: string | null;
44
+ readonly ageYears: number | null;
45
+ readonly weightKg: number | null;
46
+ }
47
+ /**
48
+ * A partial profile change for `updatePet`. An omitted field is left unchanged; `null` clears it. At least one
49
+ * field is required. The server refuses clearing or changing `species` to an unsupported value once the pet
50
+ * uses Records (Records needs a dog or a cat). A health list you send replaces your rows for that list; `[]`
51
+ * clears them.
52
+ */
53
+ interface PetProfilePatch extends PetHealthProfileInput {
54
+ readonly name?: string | null;
55
+ readonly species?: string | null;
56
+ readonly breed?: string | null;
57
+ readonly ageYears?: number | null;
58
+ readonly weightKg?: number | null;
59
+ }
60
+ /**
61
+ * One row of `GET /widget/v1/pets` (`WidgetPetResponse`, widget_schemas.py): the profile the partner registered,
62
+ * keyed by its `petRef`. The roster carries the identity fields only, never health data: the health profile is its
63
+ * own signed read (`getPetProfile`). `ageYears` is the registered whole-or-fractional age. Unknown wire fields are
64
+ * dropped at the boundary.
65
+ */
66
+ interface WidgetPet {
67
+ /** The server's own id for the row; opaque, never a scope key (`petRef` is). */
68
+ readonly petId: string | null;
69
+ readonly petRef: PetRef;
70
+ readonly name: string | null;
71
+ readonly species: string | null;
72
+ readonly breed: string | null;
73
+ readonly ageYears: number | null;
74
+ readonly weightKg: number | null;
75
+ readonly updatedAt: string | null;
76
+ }
77
+ /**
78
+ * One pet read back WITH its health profile (`GET /widget/v1/pets/{pet_ref}/profile`, `WidgetPetProfileResponse`):
79
+ * the list row's fields plus `profileVersion`, the health scalars and your integration's four lists.
80
+ */
81
+ interface WidgetPetProfile extends WidgetPet, PetHealthProfile {
82
+ }
83
+ interface PetsRepository {
84
+ /**
85
+ * `GET /widget/v1/pets` - every pet registered for the current user, as the server lists them. Settles
86
+ * `ok(readonly WidgetPet[])` on 200 (an empty list when none); `err(EverfurError)` otherwise. A row without a
87
+ * `pet_ref` is dropped rather than failing the page. Never throws.
88
+ */
89
+ list(opts?: {
90
+ signal?: AbortSignal;
91
+ }): Promise<EverfurResult<readonly WidgetPet[]>>;
92
+ /**
93
+ * `POST /widget/v1/pets/{pet_ref}` - create or update the widget pet profile. Idempotent by construction:
94
+ * the route is an upsert, so calling it for an already-registered pet updates rather than duplicates.
95
+ *
96
+ * Settles: `ok(RegisteredPet)` on 201, `err(EverfurError)` otherwise. Never throws.
97
+ */
98
+ registerPet(petRef: PetRef, profile?: PetProfileInput, opts?: {
99
+ signal?: AbortSignal;
100
+ }): Promise<EverfurResult<RegisteredPet>>;
101
+ /**
102
+ * `PATCH /widget/v1/pets/{pet_ref}` - change part of a registered pet's profile. Settles `ok(RegisteredPet)`
103
+ * on 200; an unknown pet is the not-found error; an empty change is refused before the wire.
104
+ */
105
+ updatePet(petRef: PetRef, patch: PetProfilePatch, opts?: {
106
+ signal?: AbortSignal;
107
+ }): Promise<EverfurResult<RegisteredPet>>;
108
+ /**
109
+ * `GET /widget/v1/pets/{pet_ref}/profile` - one pet with its health profile, so a partner app can show what
110
+ * Everfur holds. A SIGNED session only: any other session settles to the route's 403 `identitySignatureRequired`.
111
+ * An unknown pet is the not-found error. Never throws.
112
+ */
113
+ getPetProfile(petRef: PetRef, opts?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<EverfurResult<WidgetPetProfile>>;
116
+ /**
117
+ * `DELETE /widget/v1/pets/{pet_ref}` - delete the pet profile. The server also retires the pet's Records
118
+ * data. Settles `ok(undefined)` on 204; an unknown pet is the not-found error.
119
+ */
120
+ deletePet(petRef: PetRef, opts?: {
121
+ signal?: AbortSignal;
122
+ }): Promise<EverfurResult<void>>;
123
+ /**
124
+ * `DELETE /widget/v1/me` - permanently erase everything Everfur holds for the current user (right to
125
+ * erasure). Settles `ok(undefined)` on 204. A 503 means the erasure did not finish: it is retryable and a
126
+ * repeat call resumes it. Sent once per call (never auto-retried, so two erasures never overlap), with a
127
+ * per-attempt deadline of `ERASE_USER_DATA_TIMEOUT_MS`. The next request for the same user starts a fresh,
128
+ * empty user.
129
+ */
130
+ eraseUserData(opts?: {
131
+ signal?: AbortSignal;
132
+ }): Promise<EverfurResult<void>>;
133
+ }
134
+ /**
135
+ * The allowlist mapper for one `GET /widget/v1/pets` row: the named fields, each type-checked; anything else on
136
+ * the wire is dropped. null for a row that is not an object or carries no `pet_ref` (nothing to scope by).
137
+ */
138
+ declare function widgetPetFromWire(raw: unknown): WidgetPet | null;
139
+ /** Build the repository over a device AuthContext (personalized bearer XOR anonymous pk). */
140
+ declare function createPetsRepository(auth: AuthContext): PetsRepository;
141
+
142
+ /** The owner's answer to a check-in, the wire values of the consumer `CheckinResponse` enum. */
143
+ type CheckinAnswer = 'better' | 'same' | 'worse';
144
+ /** The closed answer set, in the order the consumer surfaces offer it. */
145
+ declare const CHECKIN_ANSWERS: readonly CheckinAnswer[];
146
+ /**
147
+ * The member-safe view of one watch case (consumer `WatchCaseView`). Case STATE only: the concern itself
148
+ * never rides on this row. `status` is the server's vocabulary (`watching` while open, then `resolved`,
149
+ * `escalated` or `lapsed`), carried as a string so a status added later never breaks a frozen client.
150
+ */
151
+ interface WatchCase {
152
+ readonly caseId: string;
153
+ readonly status: string;
154
+ /** The body-region copy hint (`ears`, `eyes`, ..., `general`), never a diagnosis. */
155
+ readonly bodyLocation: string | null;
156
+ readonly lastResponse: CheckinAnswer | null;
157
+ readonly checkInDueAt: string | null;
158
+ readonly openedAt: string | null;
159
+ readonly resolvedAt: string | null;
160
+ /** The server's own non-diagnostic post-answer line, stamped only on a BETTER resolve. */
161
+ readonly resolutionText: string | null;
162
+ }
163
+ /** The result of recording a check-in. `ctaDeepLink` is set only on a WORSE escalation (an `everfur://` pointer). */
164
+ interface CheckinOutcome {
165
+ readonly case: WatchCase;
166
+ readonly ctaDeepLink: string | null;
167
+ }
168
+ interface CasesRepository {
169
+ /**
170
+ * `GET /widget/v1/pets/{pet_ref}/cases` - the pet's open (`watching`) cases. Settles `ok([])` when the pet
171
+ * has none, which the server makes indistinguishable from a non-member or the feature being off.
172
+ */
173
+ list(petRef: PetRef, opts?: {
174
+ signal?: AbortSignal;
175
+ }): Promise<EverfurResult<readonly WatchCase[]>>;
176
+ /**
177
+ * `POST /widget/v1/pets/{pet_ref}/cases/{case_id}/checkin` - record the owner's answer. Settles
178
+ * `ok(CheckinOutcome)` on 200; a case that is stale, closed, another member's or gated off is the ordinary
179
+ * not-found error. A malformed case id or an answer outside the closed set is refused before the wire.
180
+ */
181
+ checkin(petRef: PetRef, caseId: string, answer: CheckinAnswer, opts?: {
182
+ signal?: AbortSignal;
183
+ }): Promise<EverfurResult<CheckinOutcome>>;
184
+ }
185
+ /** Build the repository over a device AuthContext (personalized bearer XOR anonymous pk). */
186
+ declare function createCasesRepository(auth: AuthContext): CasesRepository;
187
+
188
+ export { type CheckinAnswer as C, type PetProfileInput as P, type RegisteredPet as R, type WatchCase as W, type CheckinOutcome as a, type WidgetPet as b, type PetProfilePatch as c, type WidgetPetProfile as d, CHECKIN_ANSWERS as e, type CasesRepository as f, PET_AGE_YEARS_MAX as g, PET_BREED_MAX as h, PET_NAME_MAX as i, PET_SPECIES_MAX as j, PET_WEIGHT_KG_MAX as k, type PetsRepository as l, createCasesRepository as m, createPetsRepository as n, widgetPetFromWire as w };