screenreader-speech-capture 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 (206) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -0
  3. package/dist/cli.mjs +15 -5
  4. package/dist/ui/adapter-node.js +4 -4
  5. package/dist/ui/client/ui/_app/immutable/assets/0.CeDGT9MW.css +1 -0
  6. package/dist/ui/client/ui/_app/immutable/assets/0.CeDGT9MW.css.br +0 -0
  7. package/dist/ui/client/ui/_app/immutable/assets/0.CeDGT9MW.css.gz +0 -0
  8. package/dist/ui/client/ui/_app/immutable/assets/2.DJfIfRJB.css +1 -0
  9. package/dist/ui/client/ui/_app/immutable/assets/2.DJfIfRJB.css.br +0 -0
  10. package/dist/ui/client/ui/_app/immutable/assets/2.DJfIfRJB.css.gz +0 -0
  11. package/dist/ui/client/ui/_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2 +0 -0
  12. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-cyrillic-ext-opsz-normal.nDQikIyu.woff2 +0 -0
  13. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-cyrillic-opsz-normal.SjuC5rw5.woff2 +0 -0
  14. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-greek-opsz-normal.C14fFRny.woff2 +0 -0
  15. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-latin-ext-opsz-normal.xNclTVCo.woff2 +0 -0
  16. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-latin-opsz-normal.hy8fyBBC.woff2 +0 -0
  17. package/dist/ui/client/ui/_app/immutable/assets/roboto-flex-vietnamese-opsz-normal.C-H_yGOU.woff2 +0 -0
  18. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-400-normal.B3hIXASd.woff +0 -0
  19. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-400-normal.C-_K-ZCn.woff2 +0 -0
  20. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-500-normal.DGZ7-lUP.woff2 +0 -0
  21. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-500-normal.NpUJFYX7.woff +0 -0
  22. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.BHxv52bw.woff2 +0 -0
  23. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.W26xs1TL.woff +0 -0
  24. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.6xdwlG7p.woff +0 -0
  25. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.DC57U9n8.woff2 +0 -0
  26. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-400-normal.CH_u3Aru.woff2 +0 -0
  27. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-400-normal.P8xe1gs1.woff +0 -0
  28. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-500-normal.C2M8jX6G.woff +0 -0
  29. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-greek-500-normal.DpRFkptA.woff2 +0 -0
  30. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-400-normal.DBZPkcnn.woff +0 -0
  31. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-400-normal.GekRknry.woff2 +0 -0
  32. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-500-normal.D6j6AMzd.woff +0 -0
  33. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-500-normal.pxIOXZmA.woff2 +0 -0
  34. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-400-normal.BwLXVYNz.woff +0 -0
  35. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-400-normal.DLAV9S_w.woff2 +0 -0
  36. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-500-normal.B1IjfbhL.woff +0 -0
  37. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-latin-ext-500-normal.Db3ge6Oe.woff2 +0 -0
  38. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-400-normal.CzWHQABp.woff +0 -0
  39. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-400-normal.yYTFiTTs.woff2 +0 -0
  40. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-500-normal.Cq-quQMu.woff2 +0 -0
  41. package/dist/ui/client/ui/_app/immutable/assets/roboto-mono-vietnamese-500-normal.IxzxMIj7.woff +0 -0
  42. package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js +1 -0
  43. package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js.br +1 -0
  44. package/dist/ui/client/ui/_app/immutable/chunks/BaD2EyfF.js.gz +0 -0
  45. package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js +3 -0
  46. package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js.br +0 -0
  47. package/dist/ui/client/ui/_app/immutable/chunks/CcBdu3S8.js.gz +0 -0
  48. package/dist/ui/client/ui/_app/immutable/chunks/DSHrAZZ8.js +37 -0
  49. package/dist/ui/client/ui/_app/immutable/chunks/DSHrAZZ8.js.br +0 -0
  50. package/dist/ui/client/ui/_app/immutable/chunks/DSHrAZZ8.js.gz +0 -0
  51. package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js +1 -0
  52. package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js.br +2 -0
  53. package/dist/ui/client/ui/_app/immutable/chunks/DbiAGPgw.js.gz +0 -0
  54. package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js +1 -0
  55. package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js.br +0 -0
  56. package/dist/ui/client/ui/_app/immutable/chunks/Dg9MaatX.js.gz +0 -0
  57. package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js +3 -0
  58. package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js.br +0 -0
  59. package/dist/ui/client/ui/_app/immutable/chunks/DvmLiMpQ.js.gz +0 -0
  60. package/dist/ui/client/ui/_app/immutable/entry/app.2mjWY9ga.js +2 -0
  61. package/dist/ui/client/ui/_app/immutable/entry/app.2mjWY9ga.js.br +0 -0
  62. package/dist/ui/client/ui/_app/immutable/entry/app.2mjWY9ga.js.gz +0 -0
  63. package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js +2 -0
  64. package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js.br +0 -0
  65. package/dist/ui/client/ui/_app/immutable/entry/start.BHpKgjPx.js.gz +0 -0
  66. package/dist/ui/client/ui/_app/immutable/nodes/0.CQ_XophD.js +1 -0
  67. package/dist/ui/client/ui/_app/immutable/nodes/0.CQ_XophD.js.br +0 -0
  68. package/dist/ui/client/ui/_app/immutable/nodes/0.CQ_XophD.js.gz +0 -0
  69. package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js +1 -0
  70. package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js.br +0 -0
  71. package/dist/ui/client/ui/_app/immutable/nodes/1.Bd-KoKuj.js.gz +0 -0
  72. package/dist/ui/client/ui/_app/immutable/nodes/2.BTJ1n3E7.js +224 -0
  73. package/dist/ui/client/ui/_app/immutable/nodes/2.BTJ1n3E7.js.br +0 -0
  74. package/dist/ui/client/ui/_app/immutable/nodes/2.BTJ1n3E7.js.gz +0 -0
  75. package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js +1 -0
  76. package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js.br +0 -0
  77. package/dist/ui/client/ui/_app/immutable/nodes/3.CsdEJLWJ.js.gz +0 -0
  78. package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js +1 -0
  79. package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js.br +0 -0
  80. package/dist/ui/client/ui/_app/immutable/nodes/4.CXVi2Rvi.js.gz +0 -0
  81. package/dist/ui/client/ui/_app/version.json +1 -0
  82. package/dist/ui/client/ui/_app/version.json.br +0 -0
  83. package/dist/ui/client/ui/_app/version.json.gz +0 -0
  84. package/dist/ui/server/.vite/manifest.json +269 -4
  85. package/dist/ui/server/_app/immutable/assets/_layout.CeDGT9MW.css +1 -0
  86. package/dist/ui/server/_app/immutable/assets/_page.DJfIfRJB.css +1 -0
  87. package/dist/ui/server/_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2 +0 -0
  88. package/dist/ui/server/_app/immutable/assets/roboto-flex-cyrillic-ext-opsz-normal.nDQikIyu.woff2 +0 -0
  89. package/dist/ui/server/_app/immutable/assets/roboto-flex-cyrillic-opsz-normal.SjuC5rw5.woff2 +0 -0
  90. package/dist/ui/server/_app/immutable/assets/roboto-flex-greek-opsz-normal.C14fFRny.woff2 +0 -0
  91. package/dist/ui/server/_app/immutable/assets/roboto-flex-latin-ext-opsz-normal.xNclTVCo.woff2 +0 -0
  92. package/dist/ui/server/_app/immutable/assets/roboto-flex-latin-opsz-normal.hy8fyBBC.woff2 +0 -0
  93. package/dist/ui/server/_app/immutable/assets/roboto-flex-vietnamese-opsz-normal.C-H_yGOU.woff2 +0 -0
  94. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-400-normal.B3hIXASd.woff +0 -0
  95. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-400-normal.C-_K-ZCn.woff2 +0 -0
  96. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-500-normal.DGZ7-lUP.woff2 +0 -0
  97. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-500-normal.NpUJFYX7.woff +0 -0
  98. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.BHxv52bw.woff2 +0 -0
  99. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.W26xs1TL.woff +0 -0
  100. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.6xdwlG7p.woff +0 -0
  101. package/dist/ui/server/_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.DC57U9n8.woff2 +0 -0
  102. package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-400-normal.CH_u3Aru.woff2 +0 -0
  103. package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-400-normal.P8xe1gs1.woff +0 -0
  104. package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-500-normal.C2M8jX6G.woff +0 -0
  105. package/dist/ui/server/_app/immutable/assets/roboto-mono-greek-500-normal.DpRFkptA.woff2 +0 -0
  106. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-400-normal.DBZPkcnn.woff +0 -0
  107. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-400-normal.GekRknry.woff2 +0 -0
  108. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-500-normal.D6j6AMzd.woff +0 -0
  109. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-500-normal.pxIOXZmA.woff2 +0 -0
  110. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-400-normal.BwLXVYNz.woff +0 -0
  111. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-400-normal.DLAV9S_w.woff2 +0 -0
  112. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-500-normal.B1IjfbhL.woff +0 -0
  113. package/dist/ui/server/_app/immutable/assets/roboto-mono-latin-ext-500-normal.Db3ge6Oe.woff2 +0 -0
  114. package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-400-normal.CzWHQABp.woff +0 -0
  115. package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-400-normal.yYTFiTTs.woff2 +0 -0
  116. package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-500-normal.Cq-quQMu.woff2 +0 -0
  117. package/dist/ui/server/_app/immutable/assets/roboto-mono-vietnamese-500-normal.IxzxMIj7.woff +0 -0
  118. package/dist/ui/server/chunks/bridge-api.js +61 -0
  119. package/dist/ui/server/chunks/bridge-api.js.map +1 -0
  120. package/dist/ui/server/chunks/composition.js +232 -0
  121. package/dist/ui/server/chunks/composition.js.map +1 -0
  122. package/dist/ui/server/chunks/exports.js +69 -1
  123. package/dist/ui/server/chunks/exports.js.map +1 -1
  124. package/dist/ui/server/chunks/instance.js +20 -26
  125. package/dist/ui/server/chunks/instance.js.map +1 -1
  126. package/dist/ui/server/chunks/internal.js +102 -7
  127. package/dist/ui/server/chunks/internal.js.map +1 -1
  128. package/dist/ui/server/chunks/navigation.js +15 -0
  129. package/dist/ui/server/chunks/navigation.js.map +1 -0
  130. package/dist/ui/server/chunks/server2.js +30 -1
  131. package/dist/ui/server/chunks/server2.js.map +1 -1
  132. package/dist/ui/server/chunks/src.js +968 -0
  133. package/dist/ui/server/chunks/src.js.map +1 -0
  134. package/dist/ui/server/chunks/state.js +38 -0
  135. package/dist/ui/server/chunks/state.js.map +1 -0
  136. package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js +18 -0
  137. package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js.map +1 -0
  138. package/dist/ui/server/entries/endpoints/api/sessions/end/_server.ts.js +10 -0
  139. package/dist/ui/server/entries/endpoints/api/sessions/end/_server.ts.js.map +1 -0
  140. package/dist/ui/server/entries/endpoints/api/status/_server.ts.js +10 -0
  141. package/dist/ui/server/entries/endpoints/api/status/_server.ts.js.map +1 -0
  142. package/dist/ui/server/entries/fallbacks/error.svelte.js +2 -35
  143. package/dist/ui/server/entries/fallbacks/error.svelte.js.map +1 -1
  144. package/dist/ui/server/entries/pages/_layout.server.ts.js +5 -980
  145. package/dist/ui/server/entries/pages/_layout.server.ts.js.map +1 -1
  146. package/dist/ui/server/entries/pages/_layout.svelte.js +194 -7
  147. package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -1
  148. package/dist/ui/server/entries/pages/_page.server.ts.js +18 -0
  149. package/dist/ui/server/entries/pages/_page.server.ts.js.map +1 -0
  150. package/dist/ui/server/entries/pages/_page.svelte.js +213 -2
  151. package/dist/ui/server/entries/pages/_page.svelte.js.map +1 -1
  152. package/dist/ui/server/entries/pages/settings/_page.svelte.js +8 -0
  153. package/dist/ui/server/entries/pages/settings/_page.svelte.js.map +1 -0
  154. package/dist/ui/server/entries/pages/setup/_page.svelte.js +8 -0
  155. package/dist/ui/server/entries/pages/setup/_page.svelte.js.map +1 -0
  156. package/dist/ui/server/index.js +2 -2
  157. package/dist/ui/server/manifest-full.js +40 -3
  158. package/dist/ui/server/manifest.js +40 -3
  159. package/dist/ui/server/nodes/0.js +3 -3
  160. package/dist/ui/server/nodes/1.js +1 -1
  161. package/dist/ui/server/nodes/2.js +5 -3
  162. package/dist/ui/server/nodes/3.js +8 -0
  163. package/dist/ui/server/nodes/4.js +8 -0
  164. package/dist/ui/server/remote-entry.js +3 -3
  165. package/dist/ui/server/remote-entry.js.map +1 -1
  166. package/dist/ui/server/server.js +40 -3
  167. package/package.json +2 -2
  168. package/dist/ui/client/_app/immutable/chunks/BMrJcSB7.js +0 -3
  169. package/dist/ui/client/_app/immutable/chunks/BMrJcSB7.js.br +0 -0
  170. package/dist/ui/client/_app/immutable/chunks/BMrJcSB7.js.gz +0 -0
  171. package/dist/ui/client/_app/immutable/chunks/BueZJg5y.js +0 -2
  172. package/dist/ui/client/_app/immutable/chunks/BueZJg5y.js.br +0 -0
  173. package/dist/ui/client/_app/immutable/chunks/BueZJg5y.js.gz +0 -0
  174. package/dist/ui/client/_app/immutable/chunks/ZzrMKdp0.js +0 -1
  175. package/dist/ui/client/_app/immutable/chunks/ZzrMKdp0.js.br +0 -0
  176. package/dist/ui/client/_app/immutable/chunks/ZzrMKdp0.js.gz +0 -0
  177. package/dist/ui/client/_app/immutable/entry/app.BGREpuCm.js +0 -2
  178. package/dist/ui/client/_app/immutable/entry/app.BGREpuCm.js.br +0 -0
  179. package/dist/ui/client/_app/immutable/entry/app.BGREpuCm.js.gz +0 -0
  180. package/dist/ui/client/_app/immutable/entry/start.Bj3y6VYi.js +0 -2
  181. package/dist/ui/client/_app/immutable/entry/start.Bj3y6VYi.js.br +0 -0
  182. package/dist/ui/client/_app/immutable/entry/start.Bj3y6VYi.js.gz +0 -0
  183. package/dist/ui/client/_app/immutable/nodes/0.BdmtdjrF.js +0 -1
  184. package/dist/ui/client/_app/immutable/nodes/0.BdmtdjrF.js.br +0 -0
  185. package/dist/ui/client/_app/immutable/nodes/0.BdmtdjrF.js.gz +0 -0
  186. package/dist/ui/client/_app/immutable/nodes/1.B76I_t5U.js +0 -1
  187. package/dist/ui/client/_app/immutable/nodes/1.B76I_t5U.js.br +0 -0
  188. package/dist/ui/client/_app/immutable/nodes/1.B76I_t5U.js.gz +0 -0
  189. package/dist/ui/client/_app/immutable/nodes/2.CpNTEXmI.js +0 -1
  190. package/dist/ui/client/_app/immutable/nodes/2.CpNTEXmI.js.br +0 -0
  191. package/dist/ui/client/_app/immutable/nodes/2.CpNTEXmI.js.gz +0 -0
  192. package/dist/ui/client/_app/version.json +0 -1
  193. package/dist/ui/client/_app/version.json.br +0 -0
  194. package/dist/ui/client/_app/version.json.gz +0 -0
  195. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/Bjy-W4x2.js +0 -0
  196. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/Bjy-W4x2.js.br +0 -0
  197. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/Bjy-W4x2.js.gz +0 -0
  198. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/DclECHGd.js +0 -0
  199. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/DclECHGd.js.br +0 -0
  200. /package/dist/ui/client/{_app → ui/_app}/immutable/chunks/DclECHGd.js.gz +0 -0
  201. /package/dist/ui/client/{_app → ui/_app}/immutable/entry/payload.DSmR2FwN.js +0 -0
  202. /package/dist/ui/client/{_app → ui/_app}/immutable/entry/payload.DSmR2FwN.js.br +0 -0
  203. /package/dist/ui/client/{_app → ui/_app}/immutable/entry/payload.DSmR2FwN.js.gz +0 -0
  204. /package/dist/ui/client/{robots.txt → ui/robots.txt} +0 -0
  205. /package/dist/ui/client/{robots.txt.br → ui/robots.txt.br} +0 -0
  206. /package/dist/ui/client/{robots.txt.gz → ui/robots.txt.gz} +0 -0
@@ -0,0 +1,968 @@
1
+ var DEFAULT_CONFIG = {
2
+ lang: void 0,
3
+ message: void 0,
4
+ abortEarly: void 0,
5
+ abortPipeEarly: void 0
6
+ };
7
+ /**
8
+ * Returns the global configuration.
9
+ *
10
+ * @param config The config to merge.
11
+ *
12
+ * @returns The configuration.
13
+ */
14
+ /* @__NO_SIDE_EFFECTS__ */
15
+ function getGlobalConfig(config$1) {
16
+ if (!config$1 && true) return DEFAULT_CONFIG;
17
+ return {
18
+ lang: config$1?.lang ?? void 0,
19
+ message: config$1?.message,
20
+ abortEarly: config$1?.abortEarly ?? void 0,
21
+ abortPipeEarly: config$1?.abortPipeEarly ?? void 0
22
+ };
23
+ }
24
+ /**
25
+ * Stringifies an unknown input to a literal or type string.
26
+ *
27
+ * @param input The unknown input.
28
+ *
29
+ * @returns A literal or type string.
30
+ *
31
+ * @internal
32
+ */
33
+ /* @__NO_SIDE_EFFECTS__ */
34
+ function _stringify(input) {
35
+ const type = typeof input;
36
+ if (type === "string") return `"${input}"`;
37
+ if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
38
+ if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
39
+ return type;
40
+ }
41
+ /**
42
+ * Adds an issue to the dataset.
43
+ *
44
+ * @param context The issue context.
45
+ * @param label The issue label.
46
+ * @param dataset The input dataset.
47
+ * @param config The configuration.
48
+ * @param other The optional props.
49
+ *
50
+ * @internal
51
+ */
52
+ function _addIssue(context, label, dataset, config$1, other) {
53
+ const input = other && "input" in other ? other.input : dataset.value;
54
+ const expected = other?.expected ?? context.expects ?? null;
55
+ const received = other?.received ?? /* @__PURE__ */ _stringify(input);
56
+ const issue = {
57
+ kind: context.kind,
58
+ type: context.type,
59
+ input,
60
+ expected,
61
+ received,
62
+ message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
63
+ requirement: context.requirement,
64
+ path: other?.path,
65
+ issues: other?.issues,
66
+ lang: config$1.lang,
67
+ abortEarly: config$1.abortEarly,
68
+ abortPipeEarly: config$1.abortPipeEarly
69
+ };
70
+ const isSchema = context.kind === "schema";
71
+ const message$1 = other?.message ?? context.message ?? (context.reference, issue.lang, void 0) ?? (isSchema ? (issue.lang, void 0) : null) ?? config$1.message ?? (issue.lang, void 0);
72
+ if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
73
+ if (isSchema) dataset.typed = false;
74
+ if (dataset.issues) dataset.issues.push(issue);
75
+ else dataset.issues = [issue];
76
+ }
77
+ /**
78
+ * Disallows inherited object properties and prevents object prototype
79
+ * pollution by disallowing certain keys.
80
+ *
81
+ * @param object The object to check.
82
+ * @param key The key to check.
83
+ *
84
+ * @returns Whether the key is allowed.
85
+ *
86
+ * @internal
87
+ */
88
+ /* @__NO_SIDE_EFFECTS__ */
89
+ function _isValidObjectKey(object$1, key) {
90
+ return Object.prototype.hasOwnProperty.call(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
91
+ }
92
+ /**
93
+ * Joins multiple `expects` values with the given separator.
94
+ *
95
+ * @param values The `expects` values.
96
+ * @param separator The separator.
97
+ *
98
+ * @returns The joined `expects` property.
99
+ *
100
+ * @internal
101
+ */
102
+ /* @__NO_SIDE_EFFECTS__ */
103
+ function _joinExpects(values$1, separator) {
104
+ const list = [...new Set(values$1)];
105
+ if (list.length > 1) return `(${list.join(` ${separator} `)})`;
106
+ return list[0] ?? "never";
107
+ }
108
+ /**
109
+ * Eagerly creates and attaches the Standard Schema properties of a schema.
110
+ *
111
+ * Hint: The contextual `this` type includes the standard properties that are
112
+ * attached before the schema is returned.
113
+ *
114
+ * @param schema The schema to attach standard properties to.
115
+ *
116
+ * @returns The schema with standard properties attached.
117
+ *
118
+ * @internal
119
+ */
120
+ function _standardSchema(schema) {
121
+ schema["~standard"] = {
122
+ version: 1,
123
+ vendor: "valibot",
124
+ validate: (value$1) => schema["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig())
125
+ };
126
+ return schema;
127
+ }
128
+ /* @__NO_SIDE_EFFECTS__ */
129
+ function getDotPath(issue) {
130
+ if (issue.path) {
131
+ let key = "";
132
+ for (const item of issue.path) if (typeof item.key === "string" || typeof item.key === "number") if (key) key += `.${item.key}`;
133
+ else key += item.key;
134
+ else return null;
135
+ return key;
136
+ }
137
+ return null;
138
+ }
139
+ /**
140
+ * [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a
141
+ * space as a date/time separator and an optional space before the UTC offset.
142
+ */
143
+ var ISO_TIMESTAMP_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;
144
+ /* @__NO_SIDE_EFFECTS__ */
145
+ function check(requirement, message$1) {
146
+ return {
147
+ kind: "validation",
148
+ type: "check",
149
+ reference: check,
150
+ async: false,
151
+ expects: null,
152
+ requirement,
153
+ message: message$1,
154
+ "~run"(dataset, config$1) {
155
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1);
156
+ return dataset;
157
+ }
158
+ };
159
+ }
160
+ /**
161
+ * Creates a description metadata action.
162
+ *
163
+ * @param description_ The description text.
164
+ *
165
+ * @returns A description action.
166
+ */
167
+ /* @__NO_SIDE_EFFECTS__ */
168
+ function description(description_) {
169
+ return {
170
+ kind: "metadata",
171
+ type: "description",
172
+ reference: description,
173
+ description: description_
174
+ };
175
+ }
176
+ /**
177
+ * Creates an examples metadata action.
178
+ *
179
+ * @param examples_ The examples.
180
+ *
181
+ * @returns An examples action.
182
+ *
183
+ * @beta
184
+ */
185
+ /* @__NO_SIDE_EFFECTS__ */
186
+ function examples(examples_) {
187
+ return {
188
+ kind: "metadata",
189
+ type: "examples",
190
+ reference: examples,
191
+ examples: examples_
192
+ };
193
+ }
194
+ /* @__NO_SIDE_EFFECTS__ */
195
+ function integer$3(message$1) {
196
+ return {
197
+ kind: "validation",
198
+ type: "integer",
199
+ reference: integer$3,
200
+ async: false,
201
+ expects: null,
202
+ requirement: Number.isInteger,
203
+ message: message$1,
204
+ "~run"(dataset, config$1) {
205
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
206
+ return dataset;
207
+ }
208
+ };
209
+ }
210
+ /* @__NO_SIDE_EFFECTS__ */
211
+ function isoTimestamp(message$1) {
212
+ return {
213
+ kind: "validation",
214
+ type: "iso_timestamp",
215
+ reference: isoTimestamp,
216
+ async: false,
217
+ expects: null,
218
+ requirement: ISO_TIMESTAMP_REGEX,
219
+ message: message$1,
220
+ "~run"(dataset, config$1) {
221
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1);
222
+ return dataset;
223
+ }
224
+ };
225
+ }
226
+ /* @__NO_SIDE_EFFECTS__ */
227
+ function maxValue(requirement, message$1) {
228
+ return {
229
+ kind: "validation",
230
+ type: "max_value",
231
+ reference: maxValue,
232
+ async: false,
233
+ expects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,
234
+ requirement,
235
+ message: message$1,
236
+ "~run"(dataset, config$1) {
237
+ if (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });
238
+ return dataset;
239
+ }
240
+ };
241
+ }
242
+ /* @__NO_SIDE_EFFECTS__ */
243
+ function minValue(requirement, message$1) {
244
+ return {
245
+ kind: "validation",
246
+ type: "min_value",
247
+ reference: minValue,
248
+ async: false,
249
+ expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,
250
+ requirement,
251
+ message: message$1,
252
+ "~run"(dataset, config$1) {
253
+ if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });
254
+ return dataset;
255
+ }
256
+ };
257
+ }
258
+ /* @__NO_SIDE_EFFECTS__ */
259
+ function regex(requirement, message$1) {
260
+ return {
261
+ kind: "validation",
262
+ type: "regex",
263
+ reference: regex,
264
+ async: false,
265
+ expects: `${requirement}`,
266
+ requirement,
267
+ message: message$1,
268
+ "~run"(dataset, config$1) {
269
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1);
270
+ return dataset;
271
+ }
272
+ };
273
+ }
274
+ /**
275
+ * Returns the fallback value of the schema.
276
+ *
277
+ * @param schema The schema to get it from.
278
+ * @param dataset The output dataset if available.
279
+ * @param config The config if available.
280
+ *
281
+ * @returns The fallback value.
282
+ */
283
+ /* @__NO_SIDE_EFFECTS__ */
284
+ function getFallback(schema, dataset, config$1) {
285
+ return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
286
+ }
287
+ /**
288
+ * Returns the default value of the schema.
289
+ *
290
+ * @param schema The schema to get it from.
291
+ * @param dataset The input dataset if available.
292
+ * @param config The config if available.
293
+ *
294
+ * @returns The default value.
295
+ */
296
+ /* @__NO_SIDE_EFFECTS__ */
297
+ function getDefault(schema, dataset, config$1) {
298
+ return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
299
+ }
300
+ /* @__NO_SIDE_EFFECTS__ */
301
+ function array(item, message$1) {
302
+ return _standardSchema({
303
+ kind: "schema",
304
+ type: "array",
305
+ reference: array,
306
+ expects: "Array",
307
+ async: false,
308
+ item,
309
+ message: message$1,
310
+ "~run"(dataset, config$1) {
311
+ const input = dataset.value;
312
+ if (Array.isArray(input)) {
313
+ dataset.typed = true;
314
+ dataset.value = [];
315
+ for (let key = 0; key < input.length; key++) {
316
+ const value$1 = input[key];
317
+ const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
318
+ if (itemDataset.issues) {
319
+ const pathItem = {
320
+ type: "array",
321
+ origin: "value",
322
+ input,
323
+ key,
324
+ value: value$1
325
+ };
326
+ for (const issue of itemDataset.issues) {
327
+ if (issue.path) issue.path.unshift(pathItem);
328
+ else issue.path = [pathItem];
329
+ dataset.issues?.push(issue);
330
+ }
331
+ if (!dataset.issues) dataset.issues = itemDataset.issues;
332
+ if (config$1.abortEarly) {
333
+ dataset.typed = false;
334
+ break;
335
+ }
336
+ }
337
+ if (!itemDataset.typed) dataset.typed = false;
338
+ dataset.value.push(itemDataset.value);
339
+ }
340
+ } else _addIssue(this, "type", dataset, config$1);
341
+ return dataset;
342
+ }
343
+ });
344
+ }
345
+ /* @__NO_SIDE_EFFECTS__ */
346
+ function boolean(message$1) {
347
+ return _standardSchema({
348
+ kind: "schema",
349
+ type: "boolean",
350
+ reference: boolean,
351
+ expects: "boolean",
352
+ async: false,
353
+ message: message$1,
354
+ "~run"(dataset, config$1) {
355
+ if (typeof dataset.value === "boolean") dataset.typed = true;
356
+ else _addIssue(this, "type", dataset, config$1);
357
+ return dataset;
358
+ }
359
+ });
360
+ }
361
+ /* @__NO_SIDE_EFFECTS__ */
362
+ function nullable(wrapped, default_) {
363
+ return _standardSchema({
364
+ kind: "schema",
365
+ type: "nullable",
366
+ reference: nullable,
367
+ expects: `(${wrapped.expects} | null)`,
368
+ async: false,
369
+ wrapped,
370
+ default: default_,
371
+ "~run"(dataset, config$1) {
372
+ if (dataset.value === null) {
373
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
374
+ if (dataset.value === null) {
375
+ dataset.typed = true;
376
+ return dataset;
377
+ }
378
+ }
379
+ return this.wrapped["~run"](dataset, config$1);
380
+ }
381
+ });
382
+ }
383
+ /* @__NO_SIDE_EFFECTS__ */
384
+ function number(message$1) {
385
+ return _standardSchema({
386
+ kind: "schema",
387
+ type: "number",
388
+ reference: number,
389
+ expects: "number",
390
+ async: false,
391
+ message: message$1,
392
+ "~run"(dataset, config$1) {
393
+ if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
394
+ else _addIssue(this, "type", dataset, config$1);
395
+ return dataset;
396
+ }
397
+ });
398
+ }
399
+ /* @__NO_SIDE_EFFECTS__ */
400
+ function object(entries$1, message$1) {
401
+ return _standardSchema({
402
+ kind: "schema",
403
+ type: "object",
404
+ reference: object,
405
+ expects: "Object",
406
+ async: false,
407
+ entries: entries$1,
408
+ message: message$1,
409
+ "~run"(dataset, config$1) {
410
+ const input = dataset.value;
411
+ if (input && typeof input === "object") {
412
+ dataset.typed = true;
413
+ dataset.value = {};
414
+ for (const key in this.entries) {
415
+ const valueSchema = this.entries[key];
416
+ if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
417
+ const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
418
+ const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
419
+ if (valueDataset.issues) {
420
+ const pathItem = {
421
+ type: "object",
422
+ origin: "value",
423
+ input,
424
+ key,
425
+ value: value$1
426
+ };
427
+ for (const issue of valueDataset.issues) {
428
+ if (issue.path) issue.path.unshift(pathItem);
429
+ else issue.path = [pathItem];
430
+ dataset.issues?.push(issue);
431
+ }
432
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
433
+ if (config$1.abortEarly) {
434
+ dataset.typed = false;
435
+ break;
436
+ }
437
+ }
438
+ if (!valueDataset.typed) dataset.typed = false;
439
+ dataset.value[key] = valueDataset.value;
440
+ } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
441
+ else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
442
+ _addIssue(this, "key", dataset, config$1, {
443
+ input: void 0,
444
+ expected: `"${key}"`,
445
+ path: [{
446
+ type: "object",
447
+ origin: "key",
448
+ input,
449
+ key,
450
+ value: input[key]
451
+ }]
452
+ });
453
+ if (config$1.abortEarly) break;
454
+ }
455
+ }
456
+ } else _addIssue(this, "type", dataset, config$1);
457
+ return dataset;
458
+ }
459
+ });
460
+ }
461
+ /* @__NO_SIDE_EFFECTS__ */
462
+ function optional(wrapped, default_) {
463
+ return _standardSchema({
464
+ kind: "schema",
465
+ type: "optional",
466
+ reference: optional,
467
+ expects: `(${wrapped.expects} | undefined)`,
468
+ async: false,
469
+ wrapped,
470
+ default: default_,
471
+ "~run"(dataset, config$1) {
472
+ if (dataset.value === void 0) {
473
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
474
+ if (dataset.value === void 0) {
475
+ dataset.typed = true;
476
+ return dataset;
477
+ }
478
+ }
479
+ return this.wrapped["~run"](dataset, config$1);
480
+ }
481
+ });
482
+ }
483
+ /* @__NO_SIDE_EFFECTS__ */
484
+ function picklist(options, message$1) {
485
+ return _standardSchema({
486
+ kind: "schema",
487
+ type: "picklist",
488
+ reference: picklist,
489
+ expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
490
+ async: false,
491
+ options,
492
+ message: message$1,
493
+ "~run"(dataset, config$1) {
494
+ if (this.options.includes(dataset.value)) dataset.typed = true;
495
+ else _addIssue(this, "type", dataset, config$1);
496
+ return dataset;
497
+ }
498
+ });
499
+ }
500
+ /* @__NO_SIDE_EFFECTS__ */
501
+ function record(key, value$1, message$1) {
502
+ return _standardSchema({
503
+ kind: "schema",
504
+ type: "record",
505
+ reference: record,
506
+ expects: "Object",
507
+ async: false,
508
+ key,
509
+ value: value$1,
510
+ message: message$1,
511
+ "~run"(dataset, config$1) {
512
+ const input = dataset.value;
513
+ if (input && typeof input === "object") {
514
+ dataset.typed = true;
515
+ dataset.value = {};
516
+ for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
517
+ const entryValue = input[entryKey];
518
+ const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
519
+ if (keyDataset.issues) {
520
+ const pathItem = {
521
+ type: "object",
522
+ origin: "key",
523
+ input,
524
+ key: entryKey,
525
+ value: entryValue
526
+ };
527
+ for (const issue of keyDataset.issues) {
528
+ issue.path = [pathItem];
529
+ dataset.issues?.push(issue);
530
+ }
531
+ if (!dataset.issues) dataset.issues = keyDataset.issues;
532
+ if (config$1.abortEarly) {
533
+ dataset.typed = false;
534
+ break;
535
+ }
536
+ }
537
+ const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
538
+ if (valueDataset.issues) {
539
+ const pathItem = {
540
+ type: "object",
541
+ origin: "value",
542
+ input,
543
+ key: entryKey,
544
+ value: entryValue
545
+ };
546
+ for (const issue of valueDataset.issues) {
547
+ if (issue.path) issue.path.unshift(pathItem);
548
+ else issue.path = [pathItem];
549
+ dataset.issues?.push(issue);
550
+ }
551
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
552
+ if (config$1.abortEarly) {
553
+ dataset.typed = false;
554
+ break;
555
+ }
556
+ }
557
+ if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
558
+ if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
559
+ }
560
+ } else _addIssue(this, "type", dataset, config$1);
561
+ return dataset;
562
+ }
563
+ });
564
+ }
565
+ /* @__NO_SIDE_EFFECTS__ */
566
+ function strictObject(entries$1, message$1) {
567
+ return _standardSchema({
568
+ kind: "schema",
569
+ type: "strict_object",
570
+ reference: strictObject,
571
+ expects: "Object",
572
+ async: false,
573
+ entries: entries$1,
574
+ message: message$1,
575
+ "~run"(dataset, config$1) {
576
+ const input = dataset.value;
577
+ if (input && typeof input === "object") {
578
+ dataset.typed = true;
579
+ dataset.value = {};
580
+ for (const key in this.entries) {
581
+ const valueSchema = this.entries[key];
582
+ if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
583
+ const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
584
+ const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
585
+ if (valueDataset.issues) {
586
+ const pathItem = {
587
+ type: "object",
588
+ origin: "value",
589
+ input,
590
+ key,
591
+ value: value$1
592
+ };
593
+ for (const issue of valueDataset.issues) {
594
+ if (issue.path) issue.path.unshift(pathItem);
595
+ else issue.path = [pathItem];
596
+ dataset.issues?.push(issue);
597
+ }
598
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
599
+ if (config$1.abortEarly) {
600
+ dataset.typed = false;
601
+ break;
602
+ }
603
+ }
604
+ if (!valueDataset.typed) dataset.typed = false;
605
+ dataset.value[key] = valueDataset.value;
606
+ } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
607
+ else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
608
+ _addIssue(this, "key", dataset, config$1, {
609
+ input: void 0,
610
+ expected: `"${key}"`,
611
+ path: [{
612
+ type: "object",
613
+ origin: "key",
614
+ input,
615
+ key,
616
+ value: input[key]
617
+ }]
618
+ });
619
+ if (config$1.abortEarly) break;
620
+ }
621
+ }
622
+ if (!dataset.issues || !config$1.abortEarly) {
623
+ for (const key in input) if (!Object.prototype.hasOwnProperty.call(this.entries, key)) {
624
+ _addIssue(this, "key", dataset, config$1, {
625
+ input: key,
626
+ expected: "never",
627
+ path: [{
628
+ type: "object",
629
+ origin: "key",
630
+ input,
631
+ key,
632
+ value: input[key]
633
+ }]
634
+ });
635
+ break;
636
+ }
637
+ }
638
+ } else _addIssue(this, "type", dataset, config$1);
639
+ return dataset;
640
+ }
641
+ });
642
+ }
643
+ /* @__NO_SIDE_EFFECTS__ */
644
+ function string(message$1) {
645
+ return _standardSchema({
646
+ kind: "schema",
647
+ type: "string",
648
+ reference: string,
649
+ expects: "string",
650
+ async: false,
651
+ message: message$1,
652
+ "~run"(dataset, config$1) {
653
+ if (typeof dataset.value === "string") dataset.typed = true;
654
+ else _addIssue(this, "type", dataset, config$1);
655
+ return dataset;
656
+ }
657
+ });
658
+ }
659
+ /**
660
+ * Creates a unknown schema.
661
+ *
662
+ * @returns A unknown schema.
663
+ */
664
+ /* @__NO_SIDE_EFFECTS__ */
665
+ function unknown() {
666
+ return _standardSchema({
667
+ kind: "schema",
668
+ type: "unknown",
669
+ reference: unknown,
670
+ expects: "unknown",
671
+ async: false,
672
+ "~run"(dataset) {
673
+ dataset.typed = true;
674
+ return dataset;
675
+ }
676
+ });
677
+ }
678
+ /* @__NO_SIDE_EFFECTS__ */
679
+ function pipe(...pipe$1) {
680
+ return _standardSchema({
681
+ ...pipe$1[0],
682
+ pipe: pipe$1,
683
+ "~run"(dataset, config$1) {
684
+ for (const item of pipe$1) if (item.kind !== "metadata") {
685
+ if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
686
+ dataset.typed = false;
687
+ break;
688
+ }
689
+ if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
690
+ }
691
+ return dataset;
692
+ }
693
+ });
694
+ }
695
+ /**
696
+ * Parses an unknown input based on a schema.
697
+ *
698
+ * @param schema The schema to be used.
699
+ * @param input The input to be parsed.
700
+ * @param config The parse configuration.
701
+ *
702
+ * @returns The parse result.
703
+ */
704
+ /* @__NO_SIDE_EFFECTS__ */
705
+ function safeParse(schema, input, config$1) {
706
+ const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
707
+ return {
708
+ typed: dataset.typed,
709
+ success: !dataset.issues,
710
+ output: dataset.value,
711
+ issues: dataset.issues
712
+ };
713
+ }
714
+ // ../shared/src/limits.ts
715
+ /** Ranges of the speech endpoints. */
716
+ var API_LIMITS = {
717
+ /** `GET /speech?limit=`: the default and the most a caller may ask for. */
718
+ list: {
719
+ default: 1e3,
720
+ max: 1e4
721
+ },
722
+ wait: {
723
+ /** `GET /speech/wait?timeoutMs=`. */
724
+ timeoutMs: {
725
+ default: 5e3,
726
+ max: 3e5
727
+ },
728
+ /** Entries the timeout answer holds at most: the last ones seen. */
729
+ seen: 1e3,
730
+ /** Longest `regex`. */
731
+ regexLength: 500
732
+ },
733
+ /** Longest marker label (trimmed). */
734
+ markerLength: 1e3,
735
+ /** Longest session `name`, `run` or client name (trimmed). */
736
+ sessionLabelLength: 1e3,
737
+ /** `POST /input/click` and `POST /input/keys`. */
738
+ input: {
739
+ /** Largest absolute screen coordinate (physical pixels). */
740
+ coordinate: 1e5,
741
+ /** Pause between the chords of a sequence. */
742
+ delayMs: {
743
+ default: 50,
744
+ max: 1e4
745
+ },
746
+ /** Most chords in one request. */
747
+ maxKeys: 100
748
+ }
749
+ };
750
+ /** Ranges of the settings (`GET` / `PUT /config`). */
751
+ var CONFIG_LIMITS = {
752
+ port: {
753
+ min: 0,
754
+ max: 65535
755
+ },
756
+ maxLineBytes: {
757
+ min: 1024,
758
+ max: 16777216
759
+ },
760
+ maxEntries: {
761
+ min: 1,
762
+ max: 1e6
763
+ }
764
+ };
765
+ /**
766
+ * An exact npm version (`1.56.1`, `1.57.0-beta-1`): `playwright.version` ends up on an
767
+ * `npm install` command line, so nothing else may get through.
768
+ */
769
+ var EXACT_VERSION_PATTERN = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$/;
770
+ /** A host name without port or scheme, or `*` (`http.allowedHosts`). */
771
+ var HOST_NAME_PATTERN = /^(\*|[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?)$/;
772
+ /** Whether `text` is a usable label: not empty after trimming, at most `max` characters trimmed. */
773
+ var isTrimmedLabel = (text, max) => {
774
+ const trimmed = text.trim();
775
+ return trimmed !== "" && trimmed.length <= max;
776
+ };
777
+ // ../shared/src/config.ts
778
+ /** A `TextDecoder` label other than UTF-16 (the framing splits the bytes on 0x0A first). */
779
+ function isSupportedEncoding(label) {
780
+ try {
781
+ return !new TextDecoder(label).encoding.startsWith("utf-16");
782
+ } catch {
783
+ return false;
784
+ }
785
+ }
786
+ var LOG_LEVELS = [
787
+ "error",
788
+ "warn",
789
+ "info",
790
+ "debug"
791
+ ];
792
+ var range = ({ min, max }) => /* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(min), /* @__PURE__ */ maxValue(max));
793
+ var port = range(CONFIG_LIMITS.port);
794
+ /** Port of a child service: `0` ("any free port") would leave the bridge no port to proxy to. */
795
+ var childPort = range({
796
+ min: 1,
797
+ max: CONFIG_LIMITS.port.max
798
+ });
799
+ var nonBlank = /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ regex(/\S/), /* @__PURE__ */ description("Not empty or blank."));
800
+ var AllowedHostsSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ array(/* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ regex(HOST_NAME_PATTERN))), /* @__PURE__ */ description("Host names the API answers to besides IP addresses, `localhost` and the machine's name. Without port or scheme. `[\"*\"]` accepts any name. Added in API 1.5."));
801
+ var ServiceConfigSchema = /* @__PURE__ */ object({
802
+ enabled: /* @__PURE__ */ boolean(),
803
+ port: childPort,
804
+ version: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(/* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ regex(EXACT_VERSION_PATTERN))), /* @__PURE__ */ description("`null` = bundled version. Otherwise an exact version like `1.65.0`."))
805
+ });
806
+ var sections = {
807
+ tcp: {
808
+ host: nonBlank,
809
+ port,
810
+ encoding: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ check(isSupportedEncoding), /* @__PURE__ */ description("TextDecoder label of the socket voice's code page. Not `utf-16*`: lines are split on bytes.")),
811
+ maxLineBytes: range(CONFIG_LIMITS.maxLineBytes)
812
+ },
813
+ http: {
814
+ host: nonBlank,
815
+ port,
816
+ allowedHosts: AllowedHostsSchema
817
+ },
818
+ buffer: { maxEntries: range(CONFIG_LIMITS.maxEntries) },
819
+ log: {
820
+ level: /* @__PURE__ */ picklist(LOG_LEVELS),
821
+ file: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(nonBlank), /* @__PURE__ */ description("Bridge log file, `null` = default path.")),
822
+ consoleSpeech: /* @__PURE__ */ pipe(/* @__PURE__ */ boolean(), /* @__PURE__ */ description("Also write the speech text to the console."))
823
+ }
824
+ };
825
+ sections.tcp, sections.http, sections.buffer, sections.log;
826
+ /** A section with every setting optional and no others allowed. */
827
+ var patchOf = (entries) => /* @__PURE__ */ strictObject(Object.fromEntries(Object.entries(entries).map(([key, schema]) => [key, /* @__PURE__ */ optional(schema)])));
828
+ patchOf(ServiceConfigSchema.entries);
829
+ patchOf({
830
+ enabled: /* @__PURE__ */ boolean(),
831
+ port: childPort
832
+ });
833
+ patchOf(sections.tcp), patchOf(sections.http), patchOf(sections.buffer), patchOf(sections.log);
834
+ // ../shared/src/input.ts
835
+ var { coordinate, delayMs, maxKeys } = API_LIMITS.input;
836
+ -coordinate, -coordinate;
837
+ `${maxKeys}`, delayMs.max, `${delayMs.default}`;
838
+ // ../shared/src/session.ts
839
+ var integer$2 = (min) => /* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(min));
840
+ var timestamp$2 = /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ isoTimestamp());
841
+ var label = (text) => /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ check((text) => isTrimmedLabel(text, API_LIMITS.sessionLabelLength)), /* @__PURE__ */ description(`${text} Trimmed, must not be empty, at most ${API_LIMITS.sessionLabelLength} characters.`));
842
+ var sessionEntries = {
843
+ id: /* @__PURE__ */ pipe(integer$2(1), /* @__PURE__ */ description("Increasing, restarts at 1 with the bridge.")),
844
+ name: /* @__PURE__ */ string(),
845
+ run: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), /* @__PURE__ */ description("Optional label that groups sessions.")),
846
+ client: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), /* @__PURE__ */ description("Who started it: the `X-SR-Speech-Client` header, `null` if it wasn't sent. Added in API 1.10.")),
847
+ startedAt: timestamp$2,
848
+ endedAt: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(timestamp$2), /* @__PURE__ */ description("`null` while the session is current.")),
849
+ startSeq: /* @__PURE__ */ pipe(integer$2(0), /* @__PURE__ */ description("The last `seq` given out before the session started: `since=startSeq` reads the session from its start. Added in API 1.9.")),
850
+ firstSeq: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(integer$2(1)), /* @__PURE__ */ description("First entry still in the buffer, `null` if none.")),
851
+ lastSeq: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(integer$2(1)), /* @__PURE__ */ description("Last entry still in the buffer, `null` if none.")),
852
+ entries: /* @__PURE__ */ pipe(integer$2(0), /* @__PURE__ */ description("Entries of this session still in the buffer."))
853
+ };
854
+ var SessionSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object(sessionEntries), /* @__PURE__ */ description("A session (docs/usage/speech-capture.md#sessions). Added in API 1.3."), /* @__PURE__ */ examples([{
855
+ id: 7,
856
+ name: "form › submit button is announced",
857
+ run: "nightly-42",
858
+ client: "ci-runner pid 4242",
859
+ startedAt: "2026-11-12T09:31:04.120Z",
860
+ endedAt: null,
861
+ startSeq: 339,
862
+ firstSeq: 340,
863
+ lastSeq: 342,
864
+ entries: 3
865
+ }]));
866
+ var StartSessionRequestSchema = /* @__PURE__ */ object({
867
+ name: /* @__PURE__ */ pipe(label("For example the test title."), /* @__PURE__ */ examples(["checkout test"])),
868
+ run: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ nullable(label("Optional label that groups sessions, for example one per test run."))), /* @__PURE__ */ examples(["nightly-42"]))
869
+ });
870
+ var StartSessionResponseSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
871
+ ...sessionEntries,
872
+ replaced: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(SessionSchema), /* @__PURE__ */ description("The session this start ended if another client had started it, `null` otherwise. Added in API 1.10."))
873
+ }), /* @__PURE__ */ description("`POST /sessions`: the new session, plus `replaced`."));
874
+ /**
875
+ * Request header naming the client (for example `host pid 1234`), so the bridge can tell when
876
+ * one client ends or replaces another one's session. Optional. API 1.10.
877
+ */
878
+ var CLIENT_HEADER = "x-sr-speech-client";
879
+ var SessionListSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
880
+ sessions: /* @__PURE__ */ array(SessionSchema),
881
+ currentId: /* @__PURE__ */ nullable(integer$2(1)),
882
+ outsideEntries: /* @__PURE__ */ pipe(integer$2(0), /* @__PURE__ */ description("Entries in the buffer that were recorded outside any session (`session=none`). Added in API 1.15."))
883
+ }), /* @__PURE__ */ description("`GET /sessions`: the current session and the ended ones with entries in the buffer, newest first, and how many entries lie outside any session."));
884
+ API_LIMITS.wait.seen, `${API_LIMITS.wait.seen}`;
885
+ `${API_LIMITS.markerLength}`;
886
+ // ../shared/src/status.ts
887
+ var integer = (min) => /* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3(), /* @__PURE__ */ minValue(min));
888
+ var timestamp = /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ isoTimestamp());
889
+ var BRIDGE_STATES = [
890
+ "starting",
891
+ "ready",
892
+ "stopping"
893
+ ];
894
+ var ServiceStatusSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
895
+ state: /* @__PURE__ */ pipe(/* @__PURE__ */ picklist([
896
+ "stopped",
897
+ "starting",
898
+ "running",
899
+ "crashed",
900
+ "failed"
901
+ ]), /* @__PURE__ */ description("`starting` includes the install. `crashed`: it exited and restarts after a delay. `failed`: 5 crashes in a row; restart the bridge (or change the service's settings).")),
902
+ version: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ description("The version that runs (configured or bundled)."), /* @__PURE__ */ examples(["1.65.0"])),
903
+ port: integer(0),
904
+ restarts: /* @__PURE__ */ pipe(integer(0), /* @__PURE__ */ description("Restarts after crashes since the service was last started (bridge start or config change).")),
905
+ exitCode: /* @__PURE__ */ pipe(/* @__PURE__ */ nullable(/* @__PURE__ */ pipe(/* @__PURE__ */ number(), /* @__PURE__ */ integer$3())), /* @__PURE__ */ description("Exit code of the last unexpected exit. `null` if none, or killed by a signal."))
906
+ }), /* @__PURE__ */ description("A child service (docs/usage/operations.md#child-service-crashes)."));
907
+ var ConnectionSchema = /* @__PURE__ */ object({
908
+ id: integer(1),
909
+ voice: /* @__PURE__ */ nullable(/* @__PURE__ */ string()),
910
+ connectedAt: timestamp
911
+ });
912
+ var StatusSchema = /* @__PURE__ */ pipe(/* @__PURE__ */ object({
913
+ bridge: /* @__PURE__ */ object({
914
+ version: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ description("Package version of the bridge."), /* @__PURE__ */ examples(["0.3.0"])),
915
+ apiVersion: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ description("`<major>.<minor>` of this API."), /* @__PURE__ */ examples(["1.13"])),
916
+ state: /* @__PURE__ */ picklist(BRIDGE_STATES),
917
+ startedAt: /* @__PURE__ */ pipe(timestamp, /* @__PURE__ */ description("When this bridge run started. Added in API 1.4."))
918
+ }),
919
+ tcp: /* @__PURE__ */ object({
920
+ listening: /* @__PURE__ */ boolean(),
921
+ host: /* @__PURE__ */ string(),
922
+ port: integer(0),
923
+ encoding: /* @__PURE__ */ pipe(/* @__PURE__ */ string(), /* @__PURE__ */ description("Code page used to decode the socket voice.")),
924
+ connections: /* @__PURE__ */ pipe(/* @__PURE__ */ array(ConnectionSchema), /* @__PURE__ */ description("Open connections, oldest first."))
925
+ }),
926
+ buffer: /* @__PURE__ */ object({
927
+ size: integer(0),
928
+ maxEntries: integer(1),
929
+ firstSeq: /* @__PURE__ */ nullable(integer(1)),
930
+ lastSeq: /* @__PURE__ */ nullable(integer(1))
931
+ }),
932
+ playwright: ServiceStatusSchema,
933
+ mcp: ServiceStatusSchema,
934
+ session: /* @__PURE__ */ pipe(/* @__PURE__ */ object({
935
+ current: /* @__PURE__ */ nullable(SessionSchema),
936
+ count: /* @__PURE__ */ pipe(integer(0), /* @__PURE__ */ description("Number of sessions `GET /sessions` lists."))
937
+ }), /* @__PURE__ */ description("Added in API 1.3."))
938
+ }), /* @__PURE__ */ description("`GET /status`. `playwright` since API 1.1, `mcp` since 1.2, `session` since 1.3."));
939
+ // ../shared/src/validate.ts
940
+ /**
941
+ * Checks `value` against `schema`. Unknown keys don't fail it and are left out of the result: a
942
+ * newer bridge of the same major version may add fields.
943
+ */
944
+ function checkDto(schema, value) {
945
+ const result = /* @__PURE__ */ safeParse(schema, value);
946
+ if (result.success) return {
947
+ ok: true,
948
+ value: result.output
949
+ };
950
+ const [issue] = result.issues;
951
+ return {
952
+ ok: false,
953
+ field: /* @__PURE__ */ getDotPath(issue) ?? "(body)",
954
+ message: issue.message
955
+ };
956
+ }
957
+ /**
958
+ * An error body as a client must accept it: like `ErrorBodySchema`, but with any `code`, since
959
+ * new codes may come in minor versions.
960
+ */
961
+ var AnyErrorBodySchema = /* @__PURE__ */ object({ error: /* @__PURE__ */ object({
962
+ code: /* @__PURE__ */ string(),
963
+ message: /* @__PURE__ */ string(),
964
+ details: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ unknown()))
965
+ }) });
966
+ export { SessionListSchema as a, API_LIMITS as c, CLIENT_HEADER as i, checkDto as n, StartSessionRequestSchema as o, StatusSchema as r, StartSessionResponseSchema as s, AnyErrorBodySchema as t };
967
+
968
+ //# sourceMappingURL=src.js.map