acrylblends 0.8.1 → 0.9.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 (235) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.js +83 -7
  3. package/dist/index.js.map +1 -1
  4. package/lib/audit-BXnYsLge.d.ts +58 -0
  5. package/lib/cell-ChU41DZD.d.ts +32 -0
  6. package/lib/client-modules-CLvWOjbd.js +267 -0
  7. package/lib/connection-ZLEso7XL.d.ts +25 -0
  8. package/lib/conninfo.d.ts +1 -23
  9. package/lib/cordis/db-sqlite.d.ts +56 -0
  10. package/lib/cordis/db-sqlite.js +58 -0
  11. package/lib/cordis/db.d.ts +8 -0
  12. package/lib/cordis/db.js +1 -0
  13. package/lib/cordis/door.d.ts +159 -0
  14. package/lib/cordis/door.js +757 -0
  15. package/lib/cordis/inspect.d.ts +77 -0
  16. package/lib/cordis/inspect.js +149 -0
  17. package/lib/cordis/kv-db.d.ts +16 -0
  18. package/lib/cordis/kv-db.js +18 -0
  19. package/lib/cordis/kv-json.d.ts +16 -0
  20. package/lib/cordis/kv-json.js +44 -0
  21. package/lib/cordis/kv.d.ts +8 -0
  22. package/lib/cordis/kv.js +1 -0
  23. package/lib/cordis/node-server.d.ts +45 -0
  24. package/lib/cordis/node-server.js +93 -0
  25. package/lib/cordis/router-http.d.ts +56 -0
  26. package/lib/cordis/router-http.js +117 -0
  27. package/lib/cordis/router.d.ts +8 -0
  28. package/lib/cordis/router.js +7 -0
  29. package/lib/cordis/state/react.d.ts +6 -0
  30. package/lib/cordis/state/react.js +11 -0
  31. package/lib/cordis/state.d.ts +33 -0
  32. package/lib/cordis/state.js +163 -0
  33. package/lib/core-CaY8XDZ6.js +19 -0
  34. package/lib/database-DBHdwefi.d.ts +44 -0
  35. package/lib/db/conformance.d.ts +11 -0
  36. package/lib/db/conformance.js +267 -0
  37. package/lib/db/sqlite.d.ts +1 -1
  38. package/lib/db/sqlite.js +1 -196
  39. package/lib/db.d.ts +2 -1
  40. package/lib/{src-0hI7M7cN.js → deprecated-BP4fPt38.js} +0 -17
  41. package/lib/door/host.d.ts +24 -0
  42. package/lib/door/host.js +2 -0
  43. package/lib/door/page.d.ts +105 -0
  44. package/lib/door/page.js +1030 -0
  45. package/lib/door/protocol.d.ts +2 -0
  46. package/lib/door/protocol.js +197 -0
  47. package/lib/error-t4N2js2I.d.ts +8 -0
  48. package/lib/etag-DaKMOjty.js +135 -0
  49. package/lib/etag.js +1 -134
  50. package/lib/helpers-CvTauQT5.js +5 -0
  51. package/lib/http-exception-kpGJkmpi.d.ts +57 -0
  52. package/lib/http-exception.d.ts +1 -56
  53. package/lib/{index-BLTYsyc1.d.ts → index-BnGgRKTv.d.ts} +3 -39
  54. package/lib/index-BqVQkTnu.d.ts +98 -0
  55. package/lib/index-Dmst2QCQ.d.ts +44 -0
  56. package/lib/index.d.ts +1 -1
  57. package/lib/index.js +2 -1
  58. package/lib/jwk-LkzeoaU8.js +117 -0
  59. package/lib/jwk.js +1 -116
  60. package/lib/jwt-CskdhEW9.js +115 -0
  61. package/lib/jwt.js +2 -114
  62. package/lib/kv/conformance.d.ts +13 -0
  63. package/lib/kv/conformance.js +301 -0
  64. package/lib/kv/db.d.ts +2 -2
  65. package/lib/kv/json.d.ts +1 -1
  66. package/lib/kv-9f-AlRKN.d.ts +39 -0
  67. package/lib/kv.d.ts +2 -1
  68. package/lib/language-D9a4zqvn.js +198 -0
  69. package/lib/language.js +1 -197
  70. package/lib/middleware-CPQ8himN.js +12 -0
  71. package/lib/node-server/serve-static.d.ts +0 -1
  72. package/lib/node-server/serve-static.js +1 -1
  73. package/lib/node-server.d.ts +1 -7
  74. package/lib/node-server.js +3 -1586
  75. package/lib/open-CMhnJODn.js +197 -0
  76. package/lib/protocol-BizVt4J6.d.ts +144 -0
  77. package/lib/request-id-CKVvHOO1.js +34 -0
  78. package/lib/request-id.js +1 -33
  79. package/lib/secure-headers-mP3j6Hm6.js +163 -0
  80. package/lib/secure-headers.js +1 -162
  81. package/lib/{serve-static-B849HlX2.js → serve-static-3uo_9rjF.js} +1 -4
  82. package/lib/server-DvgMGtzo.js +1323 -0
  83. package/lib/snapshot-text-D3NspDyT.js +338 -0
  84. package/lib/src-CwABFr6r.js +328 -0
  85. package/lib/timeout.d.ts +1 -1
  86. package/lib/timing-Cky7C1Jf.js +183 -0
  87. package/lib/timing.js +1 -182
  88. package/package.json +89 -1
  89. package/plugins/acryl-db/plugin.json +6 -1
  90. package/plugins/acryl-db-sqlite/plugin.json +4 -0
  91. package/plugins/acryl-db-sqlite/src/facade/node.ts +1 -1
  92. package/plugins/acryl-db-sqlite/src/index.ts +2 -2
  93. package/plugins/acryl-db-sqlite/src/open.ts +2 -2
  94. package/plugins/acryl-door/plugin.json +4 -1
  95. package/plugins/acryl-door/src/host/http.ts +2 -2
  96. package/plugins/acryl-door/src/host/mcp-routes.ts +1 -1
  97. package/plugins/acryl-door/src/host/operator-routes.ts +1 -1
  98. package/plugins/acryl-door/src/host/page-routes.ts +3 -3
  99. package/plugins/acryl-door/src/index.ts +2 -2
  100. package/plugins/acryl-inspect/plugin.json +4 -1
  101. package/plugins/acryl-inspect/src/service.ts +2 -2
  102. package/plugins/acryl-kv/plugin.json +6 -1
  103. package/plugins/acryl-kv-db/plugin.json +4 -0
  104. package/plugins/acryl-kv-db/src/index.ts +1 -1
  105. package/plugins/acryl-kv-db/src/open.ts +3 -3
  106. package/plugins/acryl-kv-json/plugin.json +4 -0
  107. package/plugins/acryl-kv-json/src/index.ts +1 -1
  108. package/plugins/acryl-kv-json/src/open.ts +2 -2
  109. package/plugins/acryl-node-server/plugin.json +5 -1
  110. package/plugins/acryl-node-server/src/adapter/conninfo.ts +1 -1
  111. package/plugins/acryl-node-server/src/adapter/early-hints.ts +1 -1
  112. package/plugins/acryl-node-server/src/adapter/serve-static.ts +2 -2
  113. package/plugins/acryl-node-server/src/adapter/websocket.ts +2 -2
  114. package/plugins/acryl-node-server/src/client-modules.ts +2 -2
  115. package/plugins/acryl-node-server/src/index.ts +1 -1
  116. package/plugins/acryl-router/plugin.json +11 -1
  117. package/plugins/acryl-router/src/connection.d.ts +25 -0
  118. package/plugins/acryl-router/src/core/app-base.d.ts +215 -0
  119. package/plugins/acryl-router/src/core/app.d.ts +19 -0
  120. package/plugins/acryl-router/src/core/client/client.d.ts +4 -0
  121. package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +35 -0
  122. package/plugins/acryl-router/src/core/client/index.d.ts +7 -0
  123. package/plugins/acryl-router/src/core/client/types.d.ts +229 -0
  124. package/plugins/acryl-router/src/core/client/utils.d.ts +18 -0
  125. package/plugins/acryl-router/src/core/compose.d.ts +14 -0
  126. package/plugins/acryl-router/src/core/context.d.ts +443 -0
  127. package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +30 -0
  128. package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +5 -0
  129. package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +5 -0
  130. package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +36 -0
  131. package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +25 -0
  132. package/plugins/acryl-router/src/core/helper/css/common.d.ts +59 -0
  133. package/plugins/acryl-router/src/core/helper/css/index.d.ts +80 -0
  134. package/plugins/acryl-router/src/core/helper/dev/index.d.ts +20 -0
  135. package/plugins/acryl-router/src/core/helper/factory/index.d.ts +82 -0
  136. package/plugins/acryl-router/src/core/helper/html/index.d.ts +8 -0
  137. package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +73 -0
  138. package/plugins/acryl-router/src/core/helper/route/index.d.ts +75 -0
  139. package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +7 -0
  140. package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +44 -0
  141. package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +27 -0
  142. package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +91 -0
  143. package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +16 -0
  144. package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +8 -0
  145. package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +13 -0
  146. package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +3 -0
  147. package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +3 -0
  148. package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +1 -0
  149. package/plugins/acryl-router/src/core/helper/testing/index.d.ts +13 -0
  150. package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +70 -0
  151. package/plugins/acryl-router/src/core/http-exception.d.ts +58 -0
  152. package/plugins/acryl-router/src/core/index.d.ts +37 -0
  153. package/plugins/acryl-router/src/core/jsx/base.d.ts +61 -0
  154. package/plugins/acryl-router/src/core/jsx/children.d.ts +9 -0
  155. package/plugins/acryl-router/src/core/jsx/components.d.ts +15 -0
  156. package/plugins/acryl-router/src/core/jsx/constants.d.ts +6 -0
  157. package/plugins/acryl-router/src/core/jsx/context.d.ts +51 -0
  158. package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +10 -0
  159. package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +3 -0
  160. package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +83 -0
  161. package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +39 -0
  162. package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +16 -0
  163. package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +8 -0
  164. package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +7 -0
  165. package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +73 -0
  166. package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +1 -0
  167. package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +47 -0
  168. package/plugins/acryl-router/src/core/jsx/index.d.ts +76 -0
  169. package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +6 -0
  170. package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +13 -0
  171. package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +735 -0
  172. package/plugins/acryl-router/src/core/jsx/streaming.d.ts +36 -0
  173. package/plugins/acryl-router/src/core/jsx/types.d.ts +36 -0
  174. package/plugins/acryl-router/src/core/jsx/utils.d.ts +4 -0
  175. package/plugins/acryl-router/src/core/request/constants.d.ts +1 -0
  176. package/plugins/acryl-router/src/core/request.d.ts +306 -0
  177. package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +6 -0
  178. package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +7 -0
  179. package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +13 -0
  180. package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +17 -0
  181. package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +11 -0
  182. package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +8 -0
  183. package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +5 -0
  184. package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +11 -0
  185. package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +5 -0
  186. package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +6 -0
  187. package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +7 -0
  188. package/plugins/acryl-router/src/core/router/utils.d.ts +1 -0
  189. package/plugins/acryl-router/src/core/router.d.ts +97 -0
  190. package/plugins/acryl-router/src/core/types.d.ts +573 -0
  191. package/plugins/acryl-router/src/core/utils/accept.d.ts +6 -0
  192. package/plugins/acryl-router/src/core/utils/body.d.ts +79 -0
  193. package/plugins/acryl-router/src/core/utils/buffer.d.ts +17 -0
  194. package/plugins/acryl-router/src/core/utils/color.d.ts +21 -0
  195. package/plugins/acryl-router/src/core/utils/concurrent.d.ts +11 -0
  196. package/plugins/acryl-router/src/core/utils/constants.d.ts +4 -0
  197. package/plugins/acryl-router/src/core/utils/cookie.d.ts +41 -0
  198. package/plugins/acryl-router/src/core/utils/crypto.d.ts +15 -0
  199. package/plugins/acryl-router/src/core/utils/handler.d.ts +6 -0
  200. package/plugins/acryl-router/src/core/utils/headers.d.ts +8 -0
  201. package/plugins/acryl-router/src/core/utils/html.d.ts +44 -0
  202. package/plugins/acryl-router/src/core/utils/http-status.d.ts +32 -0
  203. package/plugins/acryl-router/src/core/utils/mime.d.ts +70 -0
  204. package/plugins/acryl-router/src/core/utils/stream.d.ts +31 -0
  205. package/plugins/acryl-router/src/core/utils/types.d.ts +128 -0
  206. package/plugins/acryl-router/src/core/utils/url.d.ts +44 -0
  207. package/plugins/acryl-router/src/core/validator/index.d.ts +7 -0
  208. package/plugins/acryl-router/src/core/validator/utils.d.ts +29 -0
  209. package/plugins/acryl-router/src/core/validator/validator.d.ts +16 -0
  210. package/plugins/acryl-router/src/helpers/index.d.ts +17 -0
  211. package/plugins/acryl-router/src/helpers/schema-validator.d.ts +54 -0
  212. package/plugins/acryl-router-http/plugin.json +4 -1
  213. package/plugins/acryl-router-http/src/index.ts +1 -1
  214. package/plugins/acryl-state/plugin.json +5 -1
  215. package/plugins/acryl-state/src/service.ts +3 -3
  216. package/plugins/tsconfig.json +32 -20
  217. package/docs/framework/UPSTREAM.md +0 -3
  218. package/docs/framework/upstream.json +0 -9
  219. package/lib/index-D4FAsBZu.d.ts +0 -85
  220. package/plugins/acryl-db/upstream.json +0 -18
  221. package/plugins/acryl-db-sqlite/upstream.json +0 -21
  222. package/plugins/acryl-door/upstream.json +0 -28
  223. package/plugins/acryl-inspect/upstream.json +0 -18
  224. package/plugins/acryl-kv/upstream.json +0 -18
  225. package/plugins/acryl-kv-db/upstream.json +0 -21
  226. package/plugins/acryl-kv-json/upstream.json +0 -22
  227. package/plugins/acryl-node-server/upstream.json +0 -21
  228. package/plugins/acryl-router/upstream.json +0 -20
  229. package/plugins/acryl-router-http/upstream.json +0 -22
  230. package/plugins/acryl-state/NOTICE +0 -30
  231. package/plugins/acryl-state/upstream.json +0 -22
  232. package/plugins/desktop/upstream.json +0 -12
  233. package/plugins/desktop-web/upstream.json +0 -12
  234. package/templates/todo/upstream.json +0 -12
  235. /package/lib/{index-CTy4N7ng.d.ts → deprecated-CTy4N7ng.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ import { S as parseUiRequest, _ as UiResult, a as MAX_SNAPSHOT_NODES, b as parseChannelToHost, c as MUTATING_OPS, d as UiActionResult, f as UiControlError, g as UiRequest, h as UiOp, i as DEFAULT_SNAPSHOT_NODES, l as UI_ERROR_CODES, m as UiNode, n as ChannelToHost, o as MAX_TEXT_LENGTH, p as UiErrorCode, r as ChannelToPage, s as MAX_WAIT_MS, t as AuditEntry, u as UI_OPS, v as UiSnapshot, x as parseChannelToPage, y as WINDOW_ID } from "../protocol-BizVt4J6.js";
2
+ export { AuditEntry, ChannelToHost, ChannelToPage, DEFAULT_SNAPSHOT_NODES, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiActionResult, UiControlError, UiErrorCode, UiNode, UiOp, UiRequest, UiResult, UiSnapshot, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
@@ -0,0 +1,197 @@
1
+ //#region ../../plugins/acryl-door/src/page/protocol.ts
2
+ /**
3
+ * The one shape of a door call, shared by the Host and the in-page driver (moved from `acryl-agent-control`, spec 041).
4
+ *
5
+ * The Host turns a verb's arguments into a {@link UiRequest}, sends it to the page over the channel, and gets a {@link UiResult} back.
6
+ * Everything crossing the channel is validated here once, so neither side trusts the other's JSON. The page imports this file too, so it
7
+ * lives with the page code and has no Node imports.
8
+ */
9
+ /** The operations the driver performs on the page. */
10
+ const UI_OPS = [
11
+ "snapshot",
12
+ "click",
13
+ "type",
14
+ "select",
15
+ "press",
16
+ "scroll",
17
+ "wait"
18
+ ];
19
+ /** Operations that change the page, so each call needs approval. `snapshot`, `scroll` and `wait` only look. */
20
+ const MUTATING_OPS = [
21
+ "click",
22
+ "type",
23
+ "select",
24
+ "press"
25
+ ];
26
+ const MAX_TEXT_LENGTH = 1e4;
27
+ const MAX_WAIT_MS = 1e4;
28
+ const MAX_SNAPSHOT_NODES = 1e3;
29
+ const DEFAULT_SNAPSHOT_NODES = 300;
30
+ var UiControlError = class extends Error {
31
+ code;
32
+ constructor(code, message) {
33
+ super(message);
34
+ this.code = code;
35
+ this.name = "UiControlError";
36
+ }
37
+ };
38
+ const KEYS = /^(?:[A-Za-z0-9]|Enter|Escape|Tab|Backspace|Delete|Space|Arrow(?:Up|Down|Left|Right)|Home|End|PageUp|PageDown)$/;
39
+ const REF = /^\d{1,9}\.\d{1,6}$/;
40
+ const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
41
+ const invalid = (message) => {
42
+ throw new UiControlError("invalid", message);
43
+ };
44
+ function ref(value) {
45
+ if (typeof value !== "string" || !REF.test(value)) return invalid("ref must look like 3.17, from the latest snapshot");
46
+ return value;
47
+ }
48
+ function text(value, max = MAX_TEXT_LENGTH) {
49
+ if (typeof value !== "string" || value.length > max || value.includes("\0")) return invalid(`text must be a string of at most ${String(max)} characters`);
50
+ return value;
51
+ }
52
+ /** @param value - untrusted JSON. @throws UiControlError `invalid`. */
53
+ function parseUiRequest(value) {
54
+ if (!isRecord(value) || typeof value.op !== "string") return invalid("a call needs an op");
55
+ const op = value.op;
56
+ const only = (allowed) => {
57
+ const extra = Object.keys(value).find((key) => key !== "op" && !allowed.includes(key));
58
+ if (extra !== void 0) invalid(`unknown field ${extra}`);
59
+ };
60
+ switch (op) {
61
+ case "snapshot": {
62
+ only(["cursor", "maxNodes"]);
63
+ const cursor = value.cursor === void 0 ? void 0 : Number(value.cursor);
64
+ const maxNodes = value.maxNodes === void 0 ? void 0 : Number(value.maxNodes);
65
+ if (cursor !== void 0 && (!Number.isInteger(cursor) || cursor < 0) || maxNodes !== void 0 && (!Number.isInteger(maxNodes) || maxNodes < 1 || maxNodes > 1e3)) return invalid("cursor and maxNodes must be small positive integers");
66
+ return {
67
+ op,
68
+ ...cursor === void 0 ? {} : { cursor },
69
+ ...maxNodes === void 0 ? {} : { maxNodes }
70
+ };
71
+ }
72
+ case "click":
73
+ only(["ref"]);
74
+ return {
75
+ op,
76
+ ref: ref(value.ref)
77
+ };
78
+ case "type":
79
+ only([
80
+ "ref",
81
+ "text",
82
+ "submit",
83
+ "clear"
84
+ ]);
85
+ if (value.submit !== void 0 && typeof value.submit !== "boolean" || value.clear !== void 0 && typeof value.clear !== "boolean") return invalid("submit and clear must be true or false");
86
+ return {
87
+ op,
88
+ ref: ref(value.ref),
89
+ text: text(value.text),
90
+ ...value.submit === void 0 ? {} : { submit: value.submit },
91
+ ...value.clear === void 0 ? {} : { clear: value.clear }
92
+ };
93
+ case "select":
94
+ only(["ref", "option"]);
95
+ return {
96
+ op,
97
+ ref: ref(value.ref),
98
+ option: text(value.option, 500)
99
+ };
100
+ case "press":
101
+ only(["key", "ref"]);
102
+ if (typeof value.key !== "string" || !KEYS.test(value.key)) return invalid("key must be a single character or a name such as Enter, Escape, Tab or ArrowDown");
103
+ return {
104
+ op,
105
+ key: value.key,
106
+ ...value.ref === void 0 ? {} : { ref: ref(value.ref) }
107
+ };
108
+ case "scroll": {
109
+ only([
110
+ "direction",
111
+ "ref",
112
+ "amount"
113
+ ]);
114
+ if (value.direction !== "up" && value.direction !== "down" && value.direction !== "left" && value.direction !== "right") return invalid("direction must be up, down, left or right");
115
+ const amount = value.amount === void 0 ? void 0 : Number(value.amount);
116
+ if (amount !== void 0 && (!Number.isFinite(amount) || amount <= 0 || amount > 1e4)) return invalid("amount must be between 1 and 10000 pixels");
117
+ return {
118
+ op,
119
+ direction: value.direction,
120
+ ...value.ref === void 0 ? {} : { ref: ref(value.ref) },
121
+ ...amount === void 0 ? {} : { amount }
122
+ };
123
+ }
124
+ case "wait": {
125
+ only([
126
+ "text",
127
+ "role",
128
+ "name",
129
+ "gone",
130
+ "timeoutMs"
131
+ ]);
132
+ const timeoutMs = value.timeoutMs === void 0 ? void 0 : Number(value.timeoutMs);
133
+ if (timeoutMs !== void 0 && (!Number.isFinite(timeoutMs) || timeoutMs < 0 || timeoutMs > 1e4)) return invalid(`timeoutMs must be between 0 and ${String(MAX_WAIT_MS)}`);
134
+ if (value.gone !== void 0 && typeof value.gone !== "boolean") return invalid("gone must be true or false");
135
+ if (value.text === void 0 && value.role === void 0 && value.name === void 0) return invalid("wait needs text, or a role and name");
136
+ return {
137
+ op,
138
+ ...value.text === void 0 ? {} : { text: text(value.text, 500) },
139
+ ...value.role === void 0 ? {} : { role: text(value.role, 60) },
140
+ ...value.name === void 0 ? {} : { name: text(value.name, 500) },
141
+ ...value.gone === void 0 ? {} : { gone: value.gone },
142
+ ...timeoutMs === void 0 ? {} : { timeoutMs }
143
+ };
144
+ }
145
+ default: return invalid(`unknown op ${String(op)}`);
146
+ }
147
+ }
148
+ /** @param text - one `call` event's data from the Host. @throws when it is not a well-formed call. */
149
+ function parseChannelToPage(text) {
150
+ const value = JSON.parse(text);
151
+ if (isRecord(value) && value.t === "call" && typeof value.id === "number" && Number.isSafeInteger(value.id)) return {
152
+ t: "call",
153
+ id: value.id,
154
+ request: parseUiRequest(value.request)
155
+ };
156
+ throw new UiControlError("invalid", "not a channel call");
157
+ }
158
+ /** Every code a {@link UiControlError} can carry, so a code read off the wire is validated, not cast. */
159
+ const UI_ERROR_CODES = [
160
+ "no-window",
161
+ "stale-ref",
162
+ "unknown-ref",
163
+ "sensitive",
164
+ "protected",
165
+ "not-actionable",
166
+ "not-found",
167
+ "killed",
168
+ "timeout",
169
+ "aborted",
170
+ "unloaded",
171
+ "disconnected",
172
+ "invalid"
173
+ ];
174
+ /** A window id the page chose: short, printable, so it can travel in a query string and a log line. */
175
+ const WINDOW_ID = /^[A-Za-z0-9-]{1,80}$/u;
176
+ /** @param value - one parsed message from the page; null when it is not a well-formed message. */
177
+ function parseChannelToHost(value) {
178
+ if (!isRecord(value)) return null;
179
+ if (value.t === "focus" && typeof value.focused === "boolean") return {
180
+ t: "focus",
181
+ focused: value.focused
182
+ };
183
+ if (value.t === "result" && typeof value.id === "number" && isRecord(value.value)) return {
184
+ t: "result",
185
+ id: value.id,
186
+ value: value.value
187
+ };
188
+ if (value.t === "error" && typeof value.id === "number" && typeof value.message === "string" && UI_ERROR_CODES.includes(value.code)) return {
189
+ t: "error",
190
+ id: value.id,
191
+ code: value.code,
192
+ message: value.message.slice(0, 500)
193
+ };
194
+ return null;
195
+ }
196
+ //#endregion
197
+ export { DEFAULT_SNAPSHOT_NODES, MAX_SNAPSHOT_NODES, MAX_TEXT_LENGTH, MAX_WAIT_MS, MUTATING_OPS, UI_ERROR_CODES, UI_OPS, UiControlError, WINDOW_ID, parseChannelToHost, parseChannelToPage, parseUiRequest };
@@ -0,0 +1,8 @@
1
+ //#region ../../plugins/acryl-node-server/src/adapter/error.d.ts
2
+ declare class RequestError extends Error {
3
+ constructor(message: string, options?: {
4
+ cause?: unknown;
5
+ });
6
+ }
7
+ //#endregion
8
+ export { RequestError as t };
@@ -0,0 +1,135 @@
1
+ //#region ../../plugins/acryl-router/src/core/middleware/etag/digest.ts
2
+ const mergeBuffers = (buffer1, buffer2) => {
3
+ if (!buffer1) return buffer2;
4
+ const merged = new Uint8Array(new ArrayBuffer(buffer1.byteLength + buffer2.byteLength));
5
+ merged.set(new Uint8Array(buffer1), 0);
6
+ merged.set(buffer2, buffer1.byteLength);
7
+ return merged;
8
+ };
9
+ const CHUNK_SIZE = 256 * 1024;
10
+ const generateDigest = async (stream, generator) => {
11
+ if (!stream) return null;
12
+ let result = void 0;
13
+ let chunk;
14
+ let chunkLength = 0;
15
+ const digest = async (body) => {
16
+ result = await generator(mergeBuffers(result, body));
17
+ };
18
+ const reader = stream.getReader();
19
+ for (;;) {
20
+ const { value, done } = await reader.read();
21
+ if (done) break;
22
+ let offset = 0;
23
+ while (offset < value.byteLength) {
24
+ const remaining = value.byteLength - offset;
25
+ if (chunkLength === 0 && remaining >= CHUNK_SIZE) {
26
+ await digest(value.subarray(offset, offset + CHUNK_SIZE));
27
+ offset += CHUNK_SIZE;
28
+ continue;
29
+ }
30
+ const requiredLength = chunkLength + remaining;
31
+ if (requiredLength < CHUNK_SIZE) {
32
+ if (!chunk) chunk = value.slice(offset);
33
+ else {
34
+ if (chunk.byteLength < requiredLength) {
35
+ const nextChunk = new Uint8Array(new ArrayBuffer(Math.min(CHUNK_SIZE, Math.max(requiredLength, chunk.byteLength * 2))));
36
+ nextChunk.set(chunk.subarray(0, chunkLength));
37
+ chunk = nextChunk;
38
+ }
39
+ chunk.set(value.subarray(offset), chunkLength);
40
+ }
41
+ chunkLength = requiredLength;
42
+ break;
43
+ }
44
+ const length = CHUNK_SIZE - chunkLength;
45
+ if (chunk?.byteLength !== CHUNK_SIZE) {
46
+ const nextChunk = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(CHUNK_SIZE));
47
+ if (chunk) nextChunk.set(chunk.subarray(0, chunkLength));
48
+ chunk = nextChunk;
49
+ }
50
+ chunk.set(value.subarray(offset, offset + length), chunkLength);
51
+ await digest(chunk);
52
+ chunkLength = 0;
53
+ offset += length;
54
+ }
55
+ }
56
+ if (chunk && chunkLength > 0) await digest(chunk.subarray(0, chunkLength));
57
+ if (!result) return null;
58
+ return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join("");
59
+ };
60
+ //#endregion
61
+ //#region ../../plugins/acryl-router/src/core/middleware/etag/index.ts
62
+ /**
63
+ * Default headers to pass through on 304 responses. From the spec:
64
+ * > The response must not contain a body and must include the headers that
65
+ * > would have been sent in an equivalent 200 OK response: Cache-Control,
66
+ * > Content-Location, Date, ETag, Expires, and Vary.
67
+ */
68
+ const RETAINED_304_HEADERS = [
69
+ "cache-control",
70
+ "content-location",
71
+ "date",
72
+ "etag",
73
+ "expires",
74
+ "vary"
75
+ ];
76
+ const stripWeak = (tag) => tag.replace(/^W\//, "");
77
+ function etagMatches(etag, ifNoneMatch) {
78
+ return ifNoneMatch != null && ifNoneMatch.split(",").some((t) => stripWeak(t.trim()) === stripWeak(etag));
79
+ }
80
+ function initializeGenerator(generator) {
81
+ if (!generator) {
82
+ if (crypto && crypto.subtle) generator = (body) => crypto.subtle.digest({ name: "SHA-1" }, body);
83
+ }
84
+ return generator;
85
+ }
86
+ /**
87
+ * ETag Middleware for Acryl.
88
+ *
89
+ *
90
+ * @param {ETagOptions} [options] - The options for the ETag middleware.
91
+ * @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value.
92
+ * @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response.
93
+ * @param {function(Uint8Array): ArrayBuffer | Promise<ArrayBuffer>} [options.generateDigest] -
94
+ * A custom digest generation function. By default, it uses 'SHA-1'
95
+ * This function is called with the response body as a `Uint8Array` and should return a hash as an `ArrayBuffer` or a Promise of one.
96
+ * @returns {MiddlewareHandler} The middleware handler function.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * const app = new Acryl()
101
+ *
102
+ * app.use('/etag/*', etag())
103
+ * app.get('/etag/abc', (c) => {
104
+ * return c.text('Acryl is hot')
105
+ * })
106
+ * ```
107
+ */
108
+ const etag = (options) => {
109
+ const retainedHeaders = new Set((options?.retainedHeaders ?? RETAINED_304_HEADERS).map((header) => header.toLowerCase()));
110
+ const weak = options?.weak ?? false;
111
+ const generator = initializeGenerator(options?.generateDigest);
112
+ return async function etag(c, next) {
113
+ const ifNoneMatch = c.req.header("If-None-Match") ?? null;
114
+ await next();
115
+ if (!(c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") || !c.res.ok) return;
116
+ const res = c.res;
117
+ let etag = res.headers.get("ETag");
118
+ if (!etag) {
119
+ if (!generator) return;
120
+ const hash = await generateDigest(res.clone().body, generator);
121
+ if (hash === null) return;
122
+ etag = weak ? `W/"${hash}"` : `"${hash}"`;
123
+ }
124
+ if (ifNoneMatch === "*" || etagMatches(etag, ifNoneMatch)) {
125
+ c.res = new Response(null, {
126
+ status: 304,
127
+ statusText: "Not Modified",
128
+ headers: { ETag: etag }
129
+ });
130
+ for (const key of Array.from(c.res.headers.keys())) if (!retainedHeaders.has(key.toLowerCase())) c.res.headers.delete(key);
131
+ } else c.res.headers.set("ETag", etag);
132
+ };
133
+ };
134
+ //#endregion
135
+ export { etag as n, RETAINED_304_HEADERS as t };
package/lib/etag.js CHANGED
@@ -1,135 +1,2 @@
1
- //#region ../../plugins/acryl-router/src/core/middleware/etag/digest.ts
2
- const mergeBuffers = (buffer1, buffer2) => {
3
- if (!buffer1) return buffer2;
4
- const merged = new Uint8Array(new ArrayBuffer(buffer1.byteLength + buffer2.byteLength));
5
- merged.set(new Uint8Array(buffer1), 0);
6
- merged.set(buffer2, buffer1.byteLength);
7
- return merged;
8
- };
9
- const CHUNK_SIZE = 256 * 1024;
10
- const generateDigest = async (stream, generator) => {
11
- if (!stream) return null;
12
- let result = void 0;
13
- let chunk;
14
- let chunkLength = 0;
15
- const digest = async (body) => {
16
- result = await generator(mergeBuffers(result, body));
17
- };
18
- const reader = stream.getReader();
19
- for (;;) {
20
- const { value, done } = await reader.read();
21
- if (done) break;
22
- let offset = 0;
23
- while (offset < value.byteLength) {
24
- const remaining = value.byteLength - offset;
25
- if (chunkLength === 0 && remaining >= CHUNK_SIZE) {
26
- await digest(value.subarray(offset, offset + CHUNK_SIZE));
27
- offset += CHUNK_SIZE;
28
- continue;
29
- }
30
- const requiredLength = chunkLength + remaining;
31
- if (requiredLength < CHUNK_SIZE) {
32
- if (!chunk) chunk = value.slice(offset);
33
- else {
34
- if (chunk.byteLength < requiredLength) {
35
- const nextChunk = new Uint8Array(new ArrayBuffer(Math.min(CHUNK_SIZE, Math.max(requiredLength, chunk.byteLength * 2))));
36
- nextChunk.set(chunk.subarray(0, chunkLength));
37
- chunk = nextChunk;
38
- }
39
- chunk.set(value.subarray(offset), chunkLength);
40
- }
41
- chunkLength = requiredLength;
42
- break;
43
- }
44
- const length = CHUNK_SIZE - chunkLength;
45
- if (chunk?.byteLength !== CHUNK_SIZE) {
46
- const nextChunk = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(CHUNK_SIZE));
47
- if (chunk) nextChunk.set(chunk.subarray(0, chunkLength));
48
- chunk = nextChunk;
49
- }
50
- chunk.set(value.subarray(offset, offset + length), chunkLength);
51
- await digest(chunk);
52
- chunkLength = 0;
53
- offset += length;
54
- }
55
- }
56
- if (chunk && chunkLength > 0) await digest(chunk.subarray(0, chunkLength));
57
- if (!result) return null;
58
- return Array.prototype.map.call(new Uint8Array(result), (x) => x.toString(16).padStart(2, "0")).join("");
59
- };
60
- //#endregion
61
- //#region ../../plugins/acryl-router/src/core/middleware/etag/index.ts
62
- /**
63
- * Default headers to pass through on 304 responses. From the spec:
64
- * > The response must not contain a body and must include the headers that
65
- * > would have been sent in an equivalent 200 OK response: Cache-Control,
66
- * > Content-Location, Date, ETag, Expires, and Vary.
67
- */
68
- const RETAINED_304_HEADERS = [
69
- "cache-control",
70
- "content-location",
71
- "date",
72
- "etag",
73
- "expires",
74
- "vary"
75
- ];
76
- const stripWeak = (tag) => tag.replace(/^W\//, "");
77
- function etagMatches(etag, ifNoneMatch) {
78
- return ifNoneMatch != null && ifNoneMatch.split(",").some((t) => stripWeak(t.trim()) === stripWeak(etag));
79
- }
80
- function initializeGenerator(generator) {
81
- if (!generator) {
82
- if (crypto && crypto.subtle) generator = (body) => crypto.subtle.digest({ name: "SHA-1" }, body);
83
- }
84
- return generator;
85
- }
86
- /**
87
- * ETag Middleware for Acryl.
88
- *
89
- *
90
- * @param {ETagOptions} [options] - The options for the ETag middleware.
91
- * @param {boolean} [options.weak=false] - Define using or not using a weak validation. If true is set, then `W/` is added to the prefix of the value.
92
- * @param {string[]} [options.retainedHeaders=RETAINED_304_HEADERS] - The headers that you want to retain in the 304 Response.
93
- * @param {function(Uint8Array): ArrayBuffer | Promise<ArrayBuffer>} [options.generateDigest] -
94
- * A custom digest generation function. By default, it uses 'SHA-1'
95
- * This function is called with the response body as a `Uint8Array` and should return a hash as an `ArrayBuffer` or a Promise of one.
96
- * @returns {MiddlewareHandler} The middleware handler function.
97
- *
98
- * @example
99
- * ```ts
100
- * const app = new Acryl()
101
- *
102
- * app.use('/etag/*', etag())
103
- * app.get('/etag/abc', (c) => {
104
- * return c.text('Acryl is hot')
105
- * })
106
- * ```
107
- */
108
- const etag = (options) => {
109
- const retainedHeaders = new Set((options?.retainedHeaders ?? RETAINED_304_HEADERS).map((header) => header.toLowerCase()));
110
- const weak = options?.weak ?? false;
111
- const generator = initializeGenerator(options?.generateDigest);
112
- return async function etag(c, next) {
113
- const ifNoneMatch = c.req.header("If-None-Match") ?? null;
114
- await next();
115
- if (!(c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") || !c.res.ok) return;
116
- const res = c.res;
117
- let etag = res.headers.get("ETag");
118
- if (!etag) {
119
- if (!generator) return;
120
- const hash = await generateDigest(res.clone().body, generator);
121
- if (hash === null) return;
122
- etag = weak ? `W/"${hash}"` : `"${hash}"`;
123
- }
124
- if (ifNoneMatch === "*" || etagMatches(etag, ifNoneMatch)) {
125
- c.res = new Response(null, {
126
- status: 304,
127
- statusText: "Not Modified",
128
- headers: { ETag: etag }
129
- });
130
- for (const key of Array.from(c.res.headers.keys())) if (!retainedHeaders.has(key.toLowerCase())) c.res.headers.delete(key);
131
- } else c.res.headers.set("ETag", etag);
132
- };
133
- };
134
- //#endregion
1
+ import { n as etag, t as RETAINED_304_HEADERS } from "./etag-DaKMOjty.js";
135
2
  export { RETAINED_304_HEADERS, etag };
@@ -0,0 +1,5 @@
1
+ import "./factory.js";
2
+ import "./ssg-BwjcA-Ge.js";
3
+ import "./css.js";
4
+ import "./connection-C7xgP1hP.js";
5
+ export {};
@@ -0,0 +1,57 @@
1
+ import { n as ContentfulStatusCode } from "./http-status-DaAwGAFL.js";
2
+
3
+ //#region ../../plugins/acryl-router/src/core/http-exception.d.ts
4
+ /**
5
+ * Options for creating an `HTTPException`.
6
+ * @property res - Optional response object to use.
7
+ * @property message - Optional custom error message.
8
+ * @property cause - Optional cause of the error.
9
+ */
10
+ type HTTPExceptionOptions = {
11
+ res?: Response;
12
+ message?: string;
13
+ cause?: unknown;
14
+ };
15
+ /**
16
+ * `HTTPException` must be used when a fatal error such as authentication failure occurs.
17
+ *
18
+ *
19
+ * @param {StatusCode} status - status code of HTTPException
20
+ * @param {HTTPExceptionOptions} options - options of HTTPException
21
+ * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
22
+ * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
23
+ * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { HTTPException } from 'acrylblends/http-exception'
28
+ *
29
+ * // ...
30
+ *
31
+ * app.post('/auth', async (c, next) => {
32
+ * // authentication
33
+ * if (authorized === false) {
34
+ * throw new HTTPException(401, { message: 'Custom error message' })
35
+ * }
36
+ * await next()
37
+ * })
38
+ * ```
39
+ */
40
+ declare class HTTPException extends Error {
41
+ readonly res?: Response;
42
+ readonly status: ContentfulStatusCode;
43
+ /**
44
+ * Creates an instance of `HTTPException`.
45
+ * @param status - HTTP status code for the exception. Defaults to 500.
46
+ * @param options - Additional options for the exception.
47
+ */
48
+ constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions);
49
+ /**
50
+ * Returns the response object associated with the exception.
51
+ * If a response object is not provided, a new response is created with the error message and status code.
52
+ * @returns The response object.
53
+ */
54
+ getResponse(): Response;
55
+ }
56
+ //#endregion
57
+ export { HTTPException as t };
@@ -1,57 +1,2 @@
1
- import { n as ContentfulStatusCode } from "./http-status-DaAwGAFL.js";
2
-
3
- //#region ../../plugins/acryl-router/src/core/http-exception.d.ts
4
- /**
5
- * Options for creating an `HTTPException`.
6
- * @property res - Optional response object to use.
7
- * @property message - Optional custom error message.
8
- * @property cause - Optional cause of the error.
9
- */
10
- type HTTPExceptionOptions = {
11
- res?: Response;
12
- message?: string;
13
- cause?: unknown;
14
- };
15
- /**
16
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
17
- *
18
- *
19
- * @param {StatusCode} status - status code of HTTPException
20
- * @param {HTTPExceptionOptions} options - options of HTTPException
21
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
22
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
23
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
24
- *
25
- * @example
26
- * ```ts
27
- * import { HTTPException } from 'acrylblends/http-exception'
28
- *
29
- * // ...
30
- *
31
- * app.post('/auth', async (c, next) => {
32
- * // authentication
33
- * if (authorized === false) {
34
- * throw new HTTPException(401, { message: 'Custom error message' })
35
- * }
36
- * await next()
37
- * })
38
- * ```
39
- */
40
- declare class HTTPException extends Error {
41
- readonly res?: Response;
42
- readonly status: ContentfulStatusCode;
43
- /**
44
- * Creates an instance of `HTTPException`.
45
- * @param status - HTTP status code for the exception. Defaults to 500.
46
- * @param options - Additional options for the exception.
47
- */
48
- constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions);
49
- /**
50
- * Returns the response object associated with the exception.
51
- * If a response object is not provided, a new response is created with the error message and status code.
52
- * @returns The response object.
53
- */
54
- getResponse(): Response;
55
- }
56
- //#endregion
1
+ import { t as HTTPException } from "./http-exception-kpGJkmpi.js";
57
2
  export { HTTPException };
@@ -1,41 +1,5 @@
1
- //#region ../../plugins/acryl-kv/src/kv.d.ts
2
- /** `T`, except a promise: the callback of `update` is synchronous, and an async one is a type error. */
3
- type NotPromise<T> = T extends PromiseLike<unknown> ? never : T;
4
- /** Anything JSON can hold. */
5
- type JsonValue = null | boolean | number | string | JsonValue[] | {
6
- [key: string]: JsonValue;
7
- };
8
- /**
9
- * Named JSON documents. Every call returns a promise, so a file, SQLite and Postgres answer alike.
10
- *
11
- * Keys are non-empty strings. Values are JSON: `undefined`, functions, symbols, bigints and non-finite numbers are refused with a
12
- * `TypeError` before anything is written, and a value read back is a copy.
13
- *
14
- * There is no `close`: the code that opened a store closes it (see {@link KvOpened}), so a plugin cannot close the store another uses.
15
- */
16
- interface Kv {
17
- /** The value stored under the key, or `undefined`. */
18
- get<T = JsonValue>(key: string): Promise<T | undefined>;
19
- /** Store a value under the key, replacing any. Resolves once it is durable. */
20
- set<T = JsonValue>(key: string, value: T): Promise<void>;
21
- /**
22
- * Replace the value under the key by `change(current)`, atomically: `current` is `undefined` when the key is missing, `change` is
23
- * synchronous (an `async` function is a type error, and a returned promise is rejected at run time: read what you need first, then update), and no other write to the key happens between reading it and writing the result. Resolves the new value. A `change` that
24
- * throws, or returns something that is not JSON, leaves the value as it was and rejects with its error.
25
- */
26
- update<T = JsonValue>(key: string, change: (current: T | undefined) => NotPromise<T>): Promise<T>;
27
- /** Remove the key. A missing key is not an error. */
28
- delete(key: string): Promise<void>;
29
- /** The keys that start with the prefix (all of them without one), sorted by code point (the order of their UTF-8 bytes, not of UTF-16 units). */
30
- list(prefix?: string): Promise<string[]>;
31
- }
32
- /** An open store and the one function that closes it. */
33
- interface KvOpened {
34
- readonly kv: Kv;
35
- /** Waits for the writes in flight, then releases the storage. Calling it again does nothing; calls on `kv` after it reject. */
36
- close(): Promise<void>;
37
- }
38
- //#endregion
1
+ import { n as Kv } from "./kv-9f-AlRKN.js";
2
+
39
3
  //#region ../../plugins/acryl-kv/src/check.d.ts
40
4
  /**
41
5
  * What every `kv` provider checks the same way, so a bad call fails alike on a file and on SQL: the key, the value, and the order of keys.
@@ -90,4 +54,4 @@ declare function copyKv(source: Kv, target: Kv, options?: CopyKvOptions): Promis
90
54
  /** The service name every `kv` provider registers. */
91
55
  declare const KV_SERVICE = "kv";
92
56
  //#endregion
93
- export { checkKey as a, decodeValue as c, JsonValue as d, Kv as f, copyKv as i, encodeValue as l, NotPromise as m, CopyKvOptions as n, codePoints as o, KvOpened as p, CopyKvResult as r, compareKeys as s, KV_SERVICE as t, runChange as u };
57
+ export { checkKey as a, decodeValue as c, copyKv as i, encodeValue as l, CopyKvOptions as n, codePoints as o, CopyKvResult as r, compareKeys as s, KV_SERVICE as t, runChange as u };