@everfur/sdk 0.1.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/CHANGELOG.md +703 -4
  2. package/README.md +63 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-BZZ-Py5l.d.ts +128 -0
  5. package/dist/Chat-Dq4fffIO.d.cts +128 -0
  6. package/dist/DepthViews-BG3E25MD.d.ts +16 -0
  7. package/dist/DepthViews-B_hIypI6.d.cts +19 -0
  8. package/dist/DepthViews-CL75jyRA.d.cts +16 -0
  9. package/dist/DepthViews-CkYri51q.d.ts +19 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-BorG422I.d.cts +146 -0
  21. package/dist/attachments-BrUWQYNK.d.ts +257 -0
  22. package/dist/attachments-D_SECjr1.d.cts +257 -0
  23. package/dist/attachments-DpldrvIW.d.ts +146 -0
  24. package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
  25. package/dist/bookingCopy-SREvkG19.d.cts +732 -0
  26. package/dist/branding-CsRdeNwK.d.cts +566 -0
  27. package/dist/branding-CsRdeNwK.d.ts +566 -0
  28. package/dist/callCopy-DoQKG3-L.d.cts +40 -0
  29. package/dist/callCopy-DoQKG3-L.d.ts +40 -0
  30. package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
  31. package/dist/casesRepository-v6QczS9N.d.ts +51 -0
  32. package/dist/chat/index.cjs +1 -1170
  33. package/dist/chat/index.d.cts +32 -53
  34. package/dist/chat/index.d.ts +32 -53
  35. package/dist/chat/index.js +1 -1167
  36. package/dist/client/index.cjs +9 -2315
  37. package/dist/client/index.d.cts +80 -16
  38. package/dist/client/index.d.ts +80 -16
  39. package/dist/client/index.js +9 -2215
  40. package/dist/{config-CiJ0PVBB.d.ts → config--Wu1Umhd.d.cts} +64 -26
  41. package/dist/{config-BSjBdxrZ.d.cts → config-C7eb_IMD.d.ts} +64 -26
  42. package/dist/consent/index.cjs +1 -0
  43. package/dist/consent/index.d.cts +33 -0
  44. package/dist/consent/index.d.ts +33 -0
  45. package/dist/consent/index.js +1 -0
  46. package/dist/context-CL3lyuy1.d.cts +159 -0
  47. package/dist/context-CahAEha8.d.ts +159 -0
  48. package/dist/copy-DdVFDL01.d.ts +198 -0
  49. package/dist/copy-UeUJVk8X.d.cts +198 -0
  50. package/dist/core/index.cjs +13 -3178
  51. package/dist/core/index.d.cts +164 -29
  52. package/dist/core/index.d.ts +164 -29
  53. package/dist/core/index.js +13 -3166
  54. package/dist/depth-D5HwcvKC.d.cts +533 -0
  55. package/dist/depth-DvPwPuT_.d.ts +533 -0
  56. package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
  57. package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
  58. package/dist/{identity-Brl-lDd6.d.cts → identity-C2-08BZW.d.cts} +20 -7
  59. package/dist/{identity-DK9zORrG.d.ts → identity-CEi9GRFZ.d.ts} +20 -7
  60. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  61. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  62. package/dist/index.cjs +12 -4494
  63. package/dist/index.d.cts +30 -121
  64. package/dist/index.d.ts +30 -121
  65. package/dist/index.js +12 -4470
  66. package/dist/models-B-Uh2LTf.d.ts +214 -0
  67. package/dist/models-D2EUxPZY.d.cts +214 -0
  68. package/dist/notifications/index.cjs +2 -0
  69. package/dist/notifications/index.d.cts +17 -0
  70. package/dist/notifications/index.d.ts +17 -0
  71. package/dist/notifications/index.js +2 -0
  72. package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
  73. package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
  74. package/dist/pets-DJv2sj2H.d.ts +92 -0
  75. package/dist/pets-JVCXgRgR.d.cts +92 -0
  76. package/dist/petsRepository-B_gKbAzJ.d.cts +142 -0
  77. package/dist/petsRepository-Bk6GDwLs.d.ts +142 -0
  78. package/dist/photo/index.cjs +1 -2189
  79. package/dist/photo/index.d.cts +6 -6
  80. package/dist/photo/index.d.ts +6 -6
  81. package/dist/photo/index.js +1 -2186
  82. package/dist/ports-BN6RHF9W.d.cts +48 -0
  83. package/dist/ports-BN6RHF9W.d.ts +48 -0
  84. package/dist/ports-BY2ph0_y.d.cts +376 -0
  85. package/dist/ports-D7YW8qz9.d.ts +376 -0
  86. package/dist/profile-CSs1wlXT.d.cts +93 -0
  87. package/dist/profile-CSs1wlXT.d.ts +93 -0
  88. package/dist/records/depth/index.cjs +2 -0
  89. package/dist/records/depth/index.d.cts +13 -0
  90. package/dist/records/depth/index.d.ts +13 -0
  91. package/dist/records/depth/index.js +2 -0
  92. package/dist/records/index.cjs +3 -2839
  93. package/dist/records/index.d.cts +137 -203
  94. package/dist/records/index.d.ts +137 -203
  95. package/dist/records/index.js +3 -2833
  96. package/dist/requestFunnel-BjDpqqvm.d.cts +110 -0
  97. package/dist/requestFunnel-DFMGcluw.d.ts +110 -0
  98. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  99. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  100. package/dist/{runtime-Bvr8yqXm.d.cts → runtimeTypes-gZEJu-da.d.cts} +104 -132
  101. package/dist/{runtime-BIYzf9cK.d.ts → runtimeTypes-w5KqBMcs.d.ts} +104 -132
  102. package/dist/server/events/index.cjs +2 -0
  103. package/dist/server/events/index.d.cts +550 -0
  104. package/dist/server/events/index.d.ts +550 -0
  105. package/dist/server/events/index.js +2 -0
  106. package/dist/server/index.cjs +2 -533
  107. package/dist/server/index.d.cts +73 -18
  108. package/dist/server/index.d.ts +73 -18
  109. package/dist/server/index.js +2 -530
  110. package/dist/species-BXAIMh7I.d.cts +9 -0
  111. package/dist/species-BXAIMh7I.d.ts +9 -0
  112. package/dist/televet/booking/index.cjs +1 -0
  113. package/dist/televet/booking/index.d.cts +294 -0
  114. package/dist/televet/booking/index.d.ts +294 -0
  115. package/dist/televet/booking/index.js +1 -0
  116. package/dist/televet/call/index.cjs +1 -0
  117. package/dist/televet/call/index.d.cts +141 -0
  118. package/dist/televet/call/index.d.ts +141 -0
  119. package/dist/televet/call/index.js +1 -0
  120. package/dist/televet/index.cjs +1 -0
  121. package/dist/televet/index.d.cts +142 -0
  122. package/dist/televet/index.d.ts +142 -0
  123. package/dist/televet/index.js +1 -0
  124. package/dist/testing/index.cjs +5 -823
  125. package/dist/testing/index.d.cts +18 -4
  126. package/dist/testing/index.d.ts +18 -4
  127. package/dist/testing/index.js +5 -820
  128. package/dist/testing/rn/index.cjs +1 -449
  129. package/dist/testing/rn/index.d.cts +18 -29
  130. package/dist/testing/rn/index.d.ts +18 -29
  131. package/dist/testing/rn/index.js +1 -444
  132. package/dist/testing/web/index.cjs +1 -0
  133. package/dist/testing/web/index.d.cts +132 -0
  134. package/dist/testing/web/index.d.ts +132 -0
  135. package/dist/testing/web/index.js +1 -0
  136. package/dist/timelineRows-C15jxFFH.d.ts +19 -0
  137. package/dist/timelineRows-odO8g9r2.d.cts +19 -0
  138. package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
  139. package/dist/typeStyle-DmoyacDG.d.ts +111 -0
  140. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  141. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  142. package/dist/useRecordsDepth-C6rjEaLn.d.cts +237 -0
  143. package/dist/useRecordsDepth-crhBllQK.d.ts +237 -0
  144. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  145. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  146. package/dist/video/index.cjs +1 -1941
  147. package/dist/video/index.d.cts +4 -4
  148. package/dist/video/index.d.ts +4 -4
  149. package/dist/video/index.js +1 -1938
  150. package/dist/view-Bxwxp4xD.d.ts +310 -0
  151. package/dist/view-DyitEO0m.d.cts +310 -0
  152. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  153. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  154. package/dist/web/consent/index.cjs +1 -0
  155. package/dist/web/consent/index.d.cts +34 -0
  156. package/dist/web/consent/index.d.ts +34 -0
  157. package/dist/web/consent/index.js +1 -0
  158. package/dist/web/index.cjs +14 -0
  159. package/dist/web/index.d.cts +218 -0
  160. package/dist/web/index.d.ts +218 -0
  161. package/dist/web/index.js +14 -0
  162. package/dist/web/notifications/index.cjs +2 -0
  163. package/dist/web/notifications/index.d.cts +213 -0
  164. package/dist/web/notifications/index.d.ts +213 -0
  165. package/dist/web/notifications/index.js +2 -0
  166. package/dist/web/records/depth/index.cjs +2 -0
  167. package/dist/web/records/depth/index.d.cts +12 -0
  168. package/dist/web/records/depth/index.d.ts +12 -0
  169. package/dist/web/records/depth/index.js +2 -0
  170. package/dist/web/records/index.cjs +4 -0
  171. package/dist/web/records/index.d.cts +285 -0
  172. package/dist/web/records/index.d.ts +285 -0
  173. package/dist/web/records/index.js +4 -0
  174. package/dist/web/televet/booking/index.cjs +1 -0
  175. package/dist/web/televet/booking/index.d.cts +349 -0
  176. package/dist/web/televet/booking/index.d.ts +349 -0
  177. package/dist/web/televet/booking/index.js +1 -0
  178. package/dist/web/televet/call/index.cjs +1 -0
  179. package/dist/web/televet/call/index.d.cts +142 -0
  180. package/dist/web/televet/call/index.d.ts +142 -0
  181. package/dist/web/televet/call/index.js +1 -0
  182. package/dist/web/televet/index.cjs +1 -0
  183. package/dist/web/televet/index.d.cts +136 -0
  184. package/dist/web/televet/index.d.ts +136 -0
  185. package/dist/web/televet/index.js +1 -0
  186. package/notifications/package.json +8 -0
  187. package/package.json +266 -10
  188. package/records/depth/package.json +8 -0
  189. package/server/events/device-blocked.cjs +15 -0
  190. package/server/events/package.json +9 -0
  191. package/televet/booking/package.json +8 -0
  192. package/televet/call/package.json +8 -0
  193. package/televet/package.json +8 -0
  194. package/testing/web/native-blocked.cjs +12 -0
  195. package/testing/web/package.json +8 -0
  196. package/web/consent/native-blocked.cjs +12 -0
  197. package/web/consent/package.json +8 -0
  198. package/web/native-blocked.cjs +12 -0
  199. package/web/notifications/native-blocked.cjs +12 -0
  200. package/web/notifications/package.json +8 -0
  201. package/web/package.json +8 -0
  202. package/web/records/depth/native-blocked.cjs +12 -0
  203. package/web/records/depth/package.json +8 -0
  204. package/web/records/native-blocked.cjs +12 -0
  205. package/web/records/package.json +8 -0
  206. package/web/televet/booking/native-blocked.cjs +12 -0
  207. package/web/televet/booking/package.json +8 -0
  208. package/web/televet/call/native-blocked.cjs +12 -0
  209. package/web/televet/call/package.json +8 -0
  210. package/web/televet/native-blocked.cjs +12 -0
  211. package/web/televet/package.json +8 -0
  212. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  213. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  214. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  215. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  216. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  217. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  218. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  219. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../dist/web/notifications/index.js",
5
+ "main": "../../dist/web/notifications/index.cjs",
6
+ "types": "../../dist/web/notifications/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../dist/web/index.js",
5
+ "main": "../dist/web/index.cjs",
6
+ "types": "../dist/web/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../../dist/web/records/depth/index.js",
5
+ "main": "../../../dist/web/records/depth/index.cjs",
6
+ "types": "../../../dist/web/records/depth/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../dist/web/records/index.js",
5
+ "main": "../../dist/web/records/index.cjs",
6
+ "types": "../../dist/web/records/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../../dist/web/televet/booking/index.js",
5
+ "main": "../../../dist/web/televet/booking/index.cjs",
6
+ "types": "../../../dist/web/televet/booking/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../../dist/web/televet/call/index.js",
5
+ "main": "../../../dist/web/televet/call/index.cjs",
6
+ "types": "../../../dist/web/televet/call/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -0,0 +1,12 @@
1
+ // GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
2
+ 'use strict';
3
+
4
+ /*
5
+ * "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
6
+ * bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
7
+ * in a native app; import "@everfur/sdk/web" only from a web build.
8
+ */
9
+ throw new Error(
10
+ '@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
11
+ 'Import @everfur/sdk in a React Native app instead.',
12
+ );
@@ -0,0 +1,8 @@
1
+ {
2
+ "//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
3
+ "react-native": "./native-blocked.cjs",
4
+ "module": "../../dist/web/televet/index.js",
5
+ "main": "../../dist/web/televet/index.cjs",
6
+ "types": "../../dist/web/televet/index.d.ts",
7
+ "sideEffects": false
8
+ }
@@ -1,146 +0,0 @@
1
- import { R as RequestFunnel } from './requestFunnel-dio5OmR9.js';
2
- import { A as AuthContext } from './identity-DK9zORrG.js';
3
- import { a as EverfurErrorCode, f as EverfurError, E as EverfurResult } from './EverfurResult-D92-uL82.js';
4
- import { b as ResponseId, a as ConversationId, P as PetRef } from './ids-CJ1S6adf.js';
5
- import { F as Frame } from './config-CiJ0PVBB.js';
6
- import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.js';
7
-
8
- /**
9
- * Recovery policy. A host may narrow retry ceilings (e.g. a metered plan) but can never widen the SDK's
10
- * settle-don't-throw contract. `attempt` is 0-based (the first try is attempt 0).
11
- */
12
- interface ErrorPolicyPort {
13
- /** Whether to retry `code` on this attempt. Default: `isAutoRetryable(code) && attempt < maxAttempts(code)`. */
14
- shouldRetry(code: EverfurErrorCode, attempt: number): boolean;
15
- /** Total attempts (the initial try plus retries) before the terminal error surfaces. Default 4. */
16
- maxAttempts(code: EverfurErrorCode): number;
17
- /** Observation hook for a handled, product-expected failure. Never rendered, never thrown. */
18
- onExpectedFailure?(error: EverfurError): void;
19
- }
20
- /**
21
- * The shipped default policy (applied when EverfurConfig omits `errorPolicy`). Pure and total.
22
- * `authExpired` is deliberately NOT auto-retried here: it is a token refresh + single replay handled by the
23
- * controller / authedSend, not a backoff retry (SPEC-00 §3.2 / §4.3).
24
- */
25
- declare const defaultErrorPolicy: ErrorPolicyPort;
26
-
27
- /** Injectable timers so the watchdog + deadlines are testable with a fake clock (no direct setTimeout). */
28
- interface Timers {
29
- setTimeout(handler: () => void, ms: number): unknown;
30
- clearTimeout(handle: unknown): void;
31
- now(): number;
32
- }
33
-
34
- type ChatStatus = 'idle' | 'streaming' | 'complete' | 'error';
35
- /** Opaque citation record (DoneFrame.citations shape). Rendered by the UI layer, never trusted for logic. */
36
- type Citation = Readonly<Record<string, unknown>>;
37
- interface ChatMessage {
38
- /** Stable list key: a client id for a user turn, the responseId for a finalized assistant turn. */
39
- readonly id: string;
40
- readonly role: 'user' | 'assistant';
41
- readonly text: string;
42
- readonly citations?: readonly Citation[];
43
- readonly responseId?: ResponseId;
44
- /** Optimistic user bubble; removed if the turn fails BEFORE the first delta. */
45
- readonly pending?: boolean;
46
- }
47
- interface ChatSnapshot {
48
- readonly status: ChatStatus;
49
- /** [] => Empty state; length > 0 => Populated. */
50
- readonly messages: readonly ChatMessage[];
51
- /** nulled on a 404 before recreate. */
52
- readonly conversationId: ConversationId | null;
53
- /** present iff status === 'error'; NEVER thrown. */
54
- readonly error: EverfurError | null;
55
- readonly isStreaming: boolean;
56
- /** true during the initial conversation prime => Loading. */
57
- readonly isBootstrapping: boolean;
58
- /**
59
- * Flattened, de-duplicated suggested-prompt strings from the prompts bootstrap (backend-owned copy; empty
60
- * until the bootstrap resolves, empty when the backend returns none). The UI renders these as the tappable
61
- * "Follow up questions" list; each string is a ready-to-send message.
62
- */
63
- readonly suggestedPrompts: readonly string[];
64
- }
65
- interface SendOptions {
66
- readonly conversationId?: ConversationId;
67
- readonly petRef?: PetRef;
68
- readonly signal?: AbortSignal;
69
- readonly idempotencyKey?: string;
70
- }
71
- interface ChatHandlers {
72
- onFrame(frame: Frame): void;
73
- onDone(responseId: ResponseId | null): void;
74
- onError(error: EverfurError): void;
75
- }
76
- /** A suggested-prompt category returned by the prompts bootstrap endpoint. */
77
- interface SuggestedPromptCategory {
78
- readonly category: string;
79
- readonly prompts: readonly string[];
80
- }
81
- interface ChatControllerDeps {
82
- /** Device auth context (bearer-XOR-pk precedence + lazy token). Carries the TransportPort. */
83
- readonly auth: AuthContext;
84
- readonly telemetry?: TelemetryPort;
85
- readonly errorPolicy?: ErrorPolicyPort;
86
- readonly timers?: Timers;
87
- /** Injected RNG for deterministic backoff in tests. */
88
- readonly rng?: () => number;
89
- /** Injected id factory (client message ids) for deterministic tests. */
90
- readonly newId?: () => string;
91
- /** Injected idempotency-key factory for the TURN identity (see `buildSendRequest`). */
92
- readonly makeIdempotencyKey?: () => string;
93
- /** The ONE request funnel. Built from `auth` when absent; injected in tests for a deterministic clock. */
94
- readonly funnel?: RequestFunnel;
95
- readonly budget?: {
96
- readonly idleMs?: number;
97
- readonly overallMs?: number;
98
- };
99
- readonly initialConversationId?: ConversationId | null;
100
- }
101
- interface ChatController {
102
- /** useSyncExternalStore subscribe. Returns an unsubscribe. */
103
- subscribe(listener: () => void): () => void;
104
- /** A stable frozen snapshot; identity changes only on real change. */
105
- getSnapshot(): ChatSnapshot;
106
- /** Stream a reply. The iterable ALWAYS completes cleanly; a failure is a terminal Frame, never a throw. */
107
- send(text: string, opts?: SendOptions): AsyncIterable<Frame>;
108
- /** Imperative escape hatch; returns a teardown, also torn down on dispose(). */
109
- send(text: string, opts: SendOptions, handlers: ChatHandlers): () => void;
110
- /** Re-send the last turn without a duplicate user bubble, reusing its idempotency key. */
111
- retryLast(): AsyncIterable<Frame>;
112
- /** Abort in-flight; not an error. Returns to pre-send (idle) and drops a never-answered optimistic bubble. */
113
- stop(): void;
114
- /** Idempotent. Aborts in-flight, bumps the epoch, drops listeners + handler subscriptions. */
115
- dispose(): void;
116
- /** Re-scope on user/pet switch: aborts in-flight and bumps the epoch so a late write drops. */
117
- rescope(): void;
118
- /** Bootstrap helper (§8): create a conversation. Unary, authed, settles. */
119
- createConversation(opts?: {
120
- readonly petRef?: PetRef;
121
- }): Promise<EverfurResult<ConversationId>>;
122
- /** Bootstrap helper (§8): fetch the session's suggested prompts, optionally personalized to a pet. Settles; never throws. */
123
- getPrompts(opts?: {
124
- readonly petRef?: PetRef;
125
- }): Promise<EverfurResult<readonly SuggestedPromptCategory[]>>;
126
- /** Adopt (or clear) the active conversation id, e.g. after bootstrap primes one. */
127
- adoptConversation(id: ConversationId | null): void;
128
- /**
129
- * Adopt the suggested-prompt categories fetched by the bootstrap (§8): flattened + de-duplicated onto the
130
- * snapshot's `suggestedPrompts` so the prebuilt UI can render the tappable follow-up list. Idempotent; a
131
- * no-op when the flattened set is empty and none are shown.
132
- */
133
- adoptPrompts(categories: readonly SuggestedPromptCategory[]): void;
134
- }
135
- declare function createChatController(deps: ChatControllerDeps): ChatController;
136
- /**
137
- * The server's own limits on a chat message, mirrored here so a violation is caught before any UI is
138
- * rendered for it. `SendWidgetMessageRequest.message` on EFBackend main declares
139
- * `min_length=1, max_length=4000`; the server remains authoritative and still enforces both.
140
- *
141
- * These are NOT in the generated contract projection, so they are pinned here with their source rather
142
- * than derived. If the server relaxes either bound, this is the one place to update.
143
- */
144
- declare const MESSAGE_MAX_CHARS = 4000;
145
-
146
- export { type ChatController as C, type ErrorPolicyPort as E, MESSAGE_MAX_CHARS as M, type SuggestedPromptCategory as S, type Timers as T, type ChatControllerDeps as a, type ChatHandlers as b, type ChatMessage as c, type ChatSnapshot as d, type ChatStatus as e, type Citation as f, type SendOptions as g, createChatController as h, defaultErrorPolicy as i };
@@ -1,146 +0,0 @@
1
- import { R as RequestFunnel } from './requestFunnel-DuUH-kAe.cjs';
2
- import { A as AuthContext } from './identity-Brl-lDd6.cjs';
3
- import { a as EverfurErrorCode, f as EverfurError, E as EverfurResult } from './EverfurResult-D92-uL82.cjs';
4
- import { b as ResponseId, a as ConversationId, P as PetRef } from './ids-CJ1S6adf.cjs';
5
- import { F as Frame } from './config-BSjBdxrZ.cjs';
6
- import { T as TelemetryPort } from './TelemetryPort-BDNr00hu.cjs';
7
-
8
- /**
9
- * Recovery policy. A host may narrow retry ceilings (e.g. a metered plan) but can never widen the SDK's
10
- * settle-don't-throw contract. `attempt` is 0-based (the first try is attempt 0).
11
- */
12
- interface ErrorPolicyPort {
13
- /** Whether to retry `code` on this attempt. Default: `isAutoRetryable(code) && attempt < maxAttempts(code)`. */
14
- shouldRetry(code: EverfurErrorCode, attempt: number): boolean;
15
- /** Total attempts (the initial try plus retries) before the terminal error surfaces. Default 4. */
16
- maxAttempts(code: EverfurErrorCode): number;
17
- /** Observation hook for a handled, product-expected failure. Never rendered, never thrown. */
18
- onExpectedFailure?(error: EverfurError): void;
19
- }
20
- /**
21
- * The shipped default policy (applied when EverfurConfig omits `errorPolicy`). Pure and total.
22
- * `authExpired` is deliberately NOT auto-retried here: it is a token refresh + single replay handled by the
23
- * controller / authedSend, not a backoff retry (SPEC-00 §3.2 / §4.3).
24
- */
25
- declare const defaultErrorPolicy: ErrorPolicyPort;
26
-
27
- /** Injectable timers so the watchdog + deadlines are testable with a fake clock (no direct setTimeout). */
28
- interface Timers {
29
- setTimeout(handler: () => void, ms: number): unknown;
30
- clearTimeout(handle: unknown): void;
31
- now(): number;
32
- }
33
-
34
- type ChatStatus = 'idle' | 'streaming' | 'complete' | 'error';
35
- /** Opaque citation record (DoneFrame.citations shape). Rendered by the UI layer, never trusted for logic. */
36
- type Citation = Readonly<Record<string, unknown>>;
37
- interface ChatMessage {
38
- /** Stable list key: a client id for a user turn, the responseId for a finalized assistant turn. */
39
- readonly id: string;
40
- readonly role: 'user' | 'assistant';
41
- readonly text: string;
42
- readonly citations?: readonly Citation[];
43
- readonly responseId?: ResponseId;
44
- /** Optimistic user bubble; removed if the turn fails BEFORE the first delta. */
45
- readonly pending?: boolean;
46
- }
47
- interface ChatSnapshot {
48
- readonly status: ChatStatus;
49
- /** [] => Empty state; length > 0 => Populated. */
50
- readonly messages: readonly ChatMessage[];
51
- /** nulled on a 404 before recreate. */
52
- readonly conversationId: ConversationId | null;
53
- /** present iff status === 'error'; NEVER thrown. */
54
- readonly error: EverfurError | null;
55
- readonly isStreaming: boolean;
56
- /** true during the initial conversation prime => Loading. */
57
- readonly isBootstrapping: boolean;
58
- /**
59
- * Flattened, de-duplicated suggested-prompt strings from the prompts bootstrap (backend-owned copy; empty
60
- * until the bootstrap resolves, empty when the backend returns none). The UI renders these as the tappable
61
- * "Follow up questions" list; each string is a ready-to-send message.
62
- */
63
- readonly suggestedPrompts: readonly string[];
64
- }
65
- interface SendOptions {
66
- readonly conversationId?: ConversationId;
67
- readonly petRef?: PetRef;
68
- readonly signal?: AbortSignal;
69
- readonly idempotencyKey?: string;
70
- }
71
- interface ChatHandlers {
72
- onFrame(frame: Frame): void;
73
- onDone(responseId: ResponseId | null): void;
74
- onError(error: EverfurError): void;
75
- }
76
- /** A suggested-prompt category returned by the prompts bootstrap endpoint. */
77
- interface SuggestedPromptCategory {
78
- readonly category: string;
79
- readonly prompts: readonly string[];
80
- }
81
- interface ChatControllerDeps {
82
- /** Device auth context (bearer-XOR-pk precedence + lazy token). Carries the TransportPort. */
83
- readonly auth: AuthContext;
84
- readonly telemetry?: TelemetryPort;
85
- readonly errorPolicy?: ErrorPolicyPort;
86
- readonly timers?: Timers;
87
- /** Injected RNG for deterministic backoff in tests. */
88
- readonly rng?: () => number;
89
- /** Injected id factory (client message ids) for deterministic tests. */
90
- readonly newId?: () => string;
91
- /** Injected idempotency-key factory for the TURN identity (see `buildSendRequest`). */
92
- readonly makeIdempotencyKey?: () => string;
93
- /** The ONE request funnel. Built from `auth` when absent; injected in tests for a deterministic clock. */
94
- readonly funnel?: RequestFunnel;
95
- readonly budget?: {
96
- readonly idleMs?: number;
97
- readonly overallMs?: number;
98
- };
99
- readonly initialConversationId?: ConversationId | null;
100
- }
101
- interface ChatController {
102
- /** useSyncExternalStore subscribe. Returns an unsubscribe. */
103
- subscribe(listener: () => void): () => void;
104
- /** A stable frozen snapshot; identity changes only on real change. */
105
- getSnapshot(): ChatSnapshot;
106
- /** Stream a reply. The iterable ALWAYS completes cleanly; a failure is a terminal Frame, never a throw. */
107
- send(text: string, opts?: SendOptions): AsyncIterable<Frame>;
108
- /** Imperative escape hatch; returns a teardown, also torn down on dispose(). */
109
- send(text: string, opts: SendOptions, handlers: ChatHandlers): () => void;
110
- /** Re-send the last turn without a duplicate user bubble, reusing its idempotency key. */
111
- retryLast(): AsyncIterable<Frame>;
112
- /** Abort in-flight; not an error. Returns to pre-send (idle) and drops a never-answered optimistic bubble. */
113
- stop(): void;
114
- /** Idempotent. Aborts in-flight, bumps the epoch, drops listeners + handler subscriptions. */
115
- dispose(): void;
116
- /** Re-scope on user/pet switch: aborts in-flight and bumps the epoch so a late write drops. */
117
- rescope(): void;
118
- /** Bootstrap helper (§8): create a conversation. Unary, authed, settles. */
119
- createConversation(opts?: {
120
- readonly petRef?: PetRef;
121
- }): Promise<EverfurResult<ConversationId>>;
122
- /** Bootstrap helper (§8): fetch the session's suggested prompts, optionally personalized to a pet. Settles; never throws. */
123
- getPrompts(opts?: {
124
- readonly petRef?: PetRef;
125
- }): Promise<EverfurResult<readonly SuggestedPromptCategory[]>>;
126
- /** Adopt (or clear) the active conversation id, e.g. after bootstrap primes one. */
127
- adoptConversation(id: ConversationId | null): void;
128
- /**
129
- * Adopt the suggested-prompt categories fetched by the bootstrap (§8): flattened + de-duplicated onto the
130
- * snapshot's `suggestedPrompts` so the prebuilt UI can render the tappable follow-up list. Idempotent; a
131
- * no-op when the flattened set is empty and none are shown.
132
- */
133
- adoptPrompts(categories: readonly SuggestedPromptCategory[]): void;
134
- }
135
- declare function createChatController(deps: ChatControllerDeps): ChatController;
136
- /**
137
- * The server's own limits on a chat message, mirrored here so a violation is caught before any UI is
138
- * rendered for it. `SendWidgetMessageRequest.message` on EFBackend main declares
139
- * `min_length=1, max_length=4000`; the server remains authoritative and still enforces both.
140
- *
141
- * These are NOT in the generated contract projection, so they are pinned here with their source rather
142
- * than derived. If the server relaxes either bound, this is the one place to update.
143
- */
144
- declare const MESSAGE_MAX_CHARS = 4000;
145
-
146
- export { type ChatController as C, type ErrorPolicyPort as E, MESSAGE_MAX_CHARS as M, type SuggestedPromptCategory as S, type Timers as T, type ChatControllerDeps as a, type ChatHandlers as b, type ChatMessage as c, type ChatSnapshot as d, type ChatStatus as e, type Citation as f, type SendOptions as g, createChatController as h, defaultErrorPolicy as i };
@@ -1,22 +0,0 @@
1
- /** Opaque handle to a local file to upload. Server-owned upload target is defined by records/video specs. */
2
- interface FileHandle {
3
- /** Local file URI. */
4
- readonly uri: string;
5
- readonly mimeType: string;
6
- readonly sizeBytes?: number;
7
- /** Original file name, when the host has one. */
8
- readonly name?: string;
9
- }
10
- /**
11
- * Presigned PUT upload. `idempotencyKey` is reused on every retry (a re-uploaded identical file dedupes
12
- * server-side). `signal` cancels an in-flight upload. Settles at the controller; this port itself may reject,
13
- * which the controller normalizes to a typed EverfurError.
14
- */
15
- interface FilePort {
16
- presignedPut(file: FileHandle, opts: {
17
- readonly idempotencyKey: string;
18
- readonly signal?: AbortSignal;
19
- }): Promise<void>;
20
- }
21
-
22
- export type { FileHandle as F, FilePort as a };
@@ -1,22 +0,0 @@
1
- /** Opaque handle to a local file to upload. Server-owned upload target is defined by records/video specs. */
2
- interface FileHandle {
3
- /** Local file URI. */
4
- readonly uri: string;
5
- readonly mimeType: string;
6
- readonly sizeBytes?: number;
7
- /** Original file name, when the host has one. */
8
- readonly name?: string;
9
- }
10
- /**
11
- * Presigned PUT upload. `idempotencyKey` is reused on every retry (a re-uploaded identical file dedupes
12
- * server-side). `signal` cancels an in-flight upload. Settles at the controller; this port itself may reject,
13
- * which the controller normalizes to a typed EverfurError.
14
- */
15
- interface FilePort {
16
- presignedPut(file: FileHandle, opts: {
17
- readonly idempotencyKey: string;
18
- readonly signal?: AbortSignal;
19
- }): Promise<void>;
20
- }
21
-
22
- export type { FileHandle as F, FilePort as a };