@brickkit/cli 0.11.0 → 0.13.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 (177) hide show
  1. package/dashboard-dist/CollapsiblePanel-CbUysOp5.js +2 -0
  2. package/dashboard-dist/CompositeRoot-D4sRkYq3.js +1 -0
  3. package/dashboard-dist/Geist-Variable.woff2 +0 -0
  4. package/dashboard-dist/GeistMono-Variable.woff2 +0 -0
  5. package/dashboard-dist/PopoverPopup-CiI2avT_.js +1 -0
  6. package/dashboard-dist/api-reference-mT9VNcPb.js +265 -0
  7. package/dashboard-dist/app.css +2 -2
  8. package/dashboard-dist/app.js +12 -13
  9. package/dashboard-dist/ccount-CcG1m-Yh.js +1 -0
  10. package/dashboard-dist/client-CwATkLJa.js +1 -0
  11. package/dashboard-dist/core-BEUWp6B5.js +1 -0
  12. package/dashboard-dist/docs-BRrtyxDB.js +4 -0
  13. package/dashboard-dist/docs.css +1 -1
  14. package/dashboard-dist/kit.js +1 -1
  15. package/dashboard-dist/popover-Bj9x-88h.js +1 -0
  16. package/dist/bin.d.ts +0 -2
  17. package/dist/bin.js +309 -211
  18. package/dist/bin.js.map +1 -1
  19. package/dist/build.js +463 -0
  20. package/dist/build.js.map +1 -0
  21. package/dist/client-contract-file.js +356 -1
  22. package/dist/client-contract-file.js.map +1 -0
  23. package/dist/compiler.d.ts +12 -3
  24. package/dist/compiler.js +1 -1
  25. package/dist/compiler2.js +13 -7
  26. package/dist/compiler2.js.map +1 -1
  27. package/dist/config.d.ts +3 -0
  28. package/dist/config.js +1 -252
  29. package/dist/config2.d.ts +122 -0
  30. package/dist/config2.js +207 -0
  31. package/dist/config2.js.map +1 -0
  32. package/dist/dashboard-extension.d.ts +3 -2
  33. package/dist/{dev-telemetry-store.js → dashboard-host.js} +1381 -1432
  34. package/dist/dashboard-host.js.map +1 -0
  35. package/dist/dashboard-protocol.js +189 -0
  36. package/dist/dashboard-protocol.js.map +1 -0
  37. package/dist/dashboard.d.ts +8 -135
  38. package/dist/definitions.js +33 -0
  39. package/dist/definitions.js.map +1 -0
  40. package/dist/dev-application.js +34 -0
  41. package/dist/dev-application.js.map +1 -0
  42. package/dist/dev-protocol.js +21 -0
  43. package/dist/dev-protocol.js.map +1 -0
  44. package/dist/dev-reporter.d.ts +0 -2
  45. package/dist/dev-reporter.js +3 -3
  46. package/dist/dev-reporter.js.map +1 -1
  47. package/dist/dev-telemetry.js +8 -24
  48. package/dist/dev-telemetry.js.map +1 -1
  49. package/dist/dev-worker.js +80 -21
  50. package/dist/dev-worker.js.map +1 -1
  51. package/dist/index.d.ts +18 -87
  52. package/dist/index.js +12 -6
  53. package/dist/index.js.map +1 -0
  54. package/dist/lint/oxlint.d.ts +0 -2
  55. package/dist/lint/oxlint.js +6 -5
  56. package/dist/lint/oxlint.js.map +1 -1
  57. package/dist/own-module.js +7 -0
  58. package/dist/own-module.js.map +1 -0
  59. package/dist/plugin.d.ts +6 -11
  60. package/dist/plugin.js +6 -42
  61. package/dist/plugin.js.map +1 -1
  62. package/dist/production-dashboard.d.ts +2 -0
  63. package/dist/production-dashboard.js +51 -0
  64. package/dist/production-dashboard.js.map +1 -0
  65. package/dist/production-dashboard2.d.ts +34 -0
  66. package/dist/{presets.js → project.js} +107 -113
  67. package/dist/project.js.map +1 -0
  68. package/dist/serve.d.ts +24 -0
  69. package/dist/serve.js +1 -0
  70. package/dist/serve2.js +49 -0
  71. package/dist/serve2.js.map +1 -0
  72. package/dist/vite.d.ts +0 -2
  73. package/dist/vite.js +28 -51
  74. package/dist/vite.js.map +1 -1
  75. package/dist/workflows.d.ts +2 -4
  76. package/dist/workflows2.js +60 -39
  77. package/dist/workflows2.js.map +1 -1
  78. package/inspector-dist/client/assets/api.rpc-BvRk9kiK.js +0 -0
  79. package/inspector-dist/client/assets/api.stream._streamId-BvRk9kiK.js +0 -0
  80. package/inspector-dist/client/assets/app-CeSwVsRm.css +2 -0
  81. package/inspector-dist/client/assets/dist-BK8w6xOr.js +3930 -0
  82. package/inspector-dist/client/assets/dist-CG2aVufI.js +197 -0
  83. package/inspector-dist/client/assets/entry.client-D9jbgmTR.js +9391 -0
  84. package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-CfRnuITN.js +34 -0
  85. package/inspector-dist/client/assets/home-hwPlkNhv.js +4034 -0
  86. package/inspector-dist/client/assets/jsx-runtime-CPEah4WQ.js +7084 -0
  87. package/inspector-dist/client/assets/manifest-0e76e9ac.js +1 -0
  88. package/inspector-dist/client/assets/mermaid-3ZIDBTTL-ZDR2PNY_.js +1 -0
  89. package/inspector-dist/client/assets/root-ChBNTZd2.css +2 -0
  90. package/inspector-dist/client/assets/root-SLeEf-sT.js +320 -0
  91. package/inspector-dist/client/assets/run-detail-DYbVkIFH.js +1871 -0
  92. package/inspector-dist/client/assets/tabs-CaJisoyb.js +73751 -0
  93. package/inspector-dist/client/assets/tabs-L5XKzOpP.css +1 -0
  94. package/inspector-dist/client/assets/zstd-browser-decoder-D94wmfAU.js +41 -0
  95. package/inspector-dist/server/assets/app-DGlfWVUI.js +99330 -0
  96. package/inspector-dist/server/assets/chunk-RLXIAIE6-F0SJZlei.js +42975 -0
  97. package/inspector-dist/server/assets/dist-BCbwm6jl.js +10325 -0
  98. package/inspector-dist/server/assets/dist-CG2aVufI.js +197 -0
  99. package/inspector-dist/server/assets/dist-Ce0I2PUv.js +1137 -0
  100. package/inspector-dist/server/assets/dist-DY0UlahA.js +1642 -0
  101. package/inspector-dist/server/assets/encryption-DdQgC8Rk.js +886 -0
  102. package/inspector-dist/server/assets/event-metadata-n7E4zEmT.js +145 -0
  103. package/inspector-dist/server/assets/functions-CNVQtbgg.js +1170 -0
  104. package/inspector-dist/server/assets/global-singleton-D8sIN5du.js +80 -0
  105. package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-CWRzMxYD.js +34 -0
  106. package/inspector-dist/server/assets/mermaid-3ZIDBTTL-D0v0ngVr.js +1 -0
  107. package/inspector-dist/server/assets/parse-Begau9cA.js +469 -0
  108. package/inspector-dist/server/assets/rolldown-runtime-C1I3wEg2.js +43 -0
  109. package/inspector-dist/server/assets/serialization-format-BbuGfHog.js +476 -0
  110. package/inspector-dist/server/assets/token-BgMmJNP5.js +60 -0
  111. package/inspector-dist/server/assets/token-BrUX0bxz.js +55 -0
  112. package/inspector-dist/server/assets/token-util-DZN32qmT.js +455 -0
  113. package/inspector-dist/server/assets/wrapper-CIC3w0oC.js +3624 -0
  114. package/inspector-dist/server/assets/ws-transport-CxTYB11n.js +29476 -0
  115. package/inspector-dist/server/assets/zstd-browser-decoder-D7bCXbGg.js +38 -0
  116. package/inspector-dist/server/index.js +1 -58
  117. package/package.json +39 -28
  118. package/vite-client.d.ts +1 -1
  119. package/dashboard-dist/CollapsiblePanel-BX79_W-b.js +0 -2
  120. package/dashboard-dist/CompositeRoot-xzybXjnx.js +0 -1
  121. package/dashboard-dist/PopoverPopup-CvlmC7EL.js +0 -1
  122. package/dashboard-dist/api-reference-BcAYVYwJ.js +0 -260
  123. package/dashboard-dist/core-BGO9JZ1r.js +0 -1
  124. package/dashboard-dist/docs-DHikPD2v.js +0 -4
  125. package/dashboard-dist/popover-DG498XHH.js +0 -1
  126. package/dist/app-entry.js +0 -1
  127. package/dist/app-entry2.js +0 -19
  128. package/dist/app-entry2.js.map +0 -1
  129. package/dist/bin.d.ts.map +0 -1
  130. package/dist/client-contract-file2.js +0 -34
  131. package/dist/client-contract-file2.js.map +0 -1
  132. package/dist/client-contract.js +0 -1
  133. package/dist/client-contract2.js +0 -294
  134. package/dist/client-contract2.js.map +0 -1
  135. package/dist/config.js.map +0 -1
  136. package/dist/dashboard-extension.d.ts.map +0 -1
  137. package/dist/dev-reporter.d.ts.map +0 -1
  138. package/dist/dev-telemetry-store.js.map +0 -1
  139. package/dist/emit.d.ts +0 -7
  140. package/dist/emit.d.ts.map +0 -1
  141. package/dist/index.d.ts.map +0 -1
  142. package/dist/lint/oxlint.d.ts.map +0 -1
  143. package/dist/plugin.d.ts.map +0 -1
  144. package/dist/presets.js.map +0 -1
  145. package/dist/runner.js +0 -523
  146. package/dist/runner.js.map +0 -1
  147. package/dist/vite.d.ts.map +0 -1
  148. package/dist/workflows.d.ts.map +0 -1
  149. package/inspector-dist/client/assets/api.rpc-l0sNRNKZ.js +0 -1
  150. package/inspector-dist/client/assets/api.stream._streamId-l0sNRNKZ.js +0 -1
  151. package/inspector-dist/client/assets/app-CvoGgWcV.css +0 -1
  152. package/inspector-dist/client/assets/entry.client-BJ6G3n5t.js +0 -11697
  153. package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-C-3wZnxf.js +0 -19
  154. package/inspector-dist/client/assets/home-CSKAS4P2.js +0 -4979
  155. package/inspector-dist/client/assets/index-DECCyMR0.js +0 -4482
  156. package/inspector-dist/client/assets/index-Dot7CgrA.js +0 -9837
  157. package/inspector-dist/client/assets/index-HqNj_XIX.js +0 -200
  158. package/inspector-dist/client/assets/manifest-139c9319.js +0 -1
  159. package/inspector-dist/client/assets/mermaid-3ZIDBTTL-DC0K8uTy.js +0 -58626
  160. package/inspector-dist/client/assets/mermaid-3ZIDBTTL-F88p7PFX.css +0 -1
  161. package/inspector-dist/client/assets/root-BMHd_XHz.css +0 -1
  162. package/inspector-dist/client/assets/root-cbi6iYwg.js +0 -305
  163. package/inspector-dist/client/assets/run-detail-CWoGxu_0.css +0 -1
  164. package/inspector-dist/client/assets/run-detail-Cc7tSGNq.js +0 -6237
  165. package/inspector-dist/client/assets/world-config-context-BAD1QCrR.js +0 -26
  166. package/inspector-dist/client/assets/zstd-browser-decoder-BQoRpP7L.js +0 -28
  167. package/inspector-dist/server/assets/app-DUP5RybL.js +0 -174880
  168. package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-D2g4hL2-.js +0 -71
  169. package/inspector-dist/server/assets/index-BfLBLRRi.js +0 -204
  170. package/inspector-dist/server/assets/index-BzrGWk7J.js +0 -1164
  171. package/inspector-dist/server/assets/index-D71yP6AL.js +0 -191
  172. package/inspector-dist/server/assets/index-wGSWRns3.js +0 -1296
  173. package/inspector-dist/server/assets/mermaid-3ZIDBTTL-DsvuKoEV.js +0 -58
  174. package/inspector-dist/server/assets/token-ClUZZwXl.js +0 -95
  175. package/inspector-dist/server/assets/token-util-DSxMZ6nI.js +0 -33
  176. package/inspector-dist/server/assets/wrapper-B3vstpCO.js +0 -67
  177. package/inspector-dist/server/assets/zstd-browser-decoder-Dn82m2BU.js +0 -77
@@ -0,0 +1,80 @@
1
+ // ../../node_modules/.bun/@workflow+utils@5.0.2/node_modules/@workflow/utils/dist/global-singleton.js
2
+ /**
3
+ * Process-wide state for packages a bundler may duplicate.
4
+ *
5
+ * # Why this exists
6
+ *
7
+ * A module's top-level `const`/`let` is a singleton per *module instance*, not
8
+ * per process, and a Next.js server routinely holds several instances of the
9
+ * same file. Next compiles its server output into independent module graphs
10
+ * (`instrument`, app-route, `ssr`, `edge`), and a bundled module is compiled
11
+ * into each one separately, with its own module-scope bindings. Only a package
12
+ * left in `serverExternalPackages` collapses to one instance, because that
13
+ * emits a runtime `require()` and Node's module cache dedupes it.
14
+ *
15
+ * `@workflow/core` has always been bundled, hence the `Symbol.for` World cache
16
+ * in `runtime/world.ts`. `@workflow/world-vercel` was external until
17
+ * vercel/workflow#3493 bundled it, and every module-scope singleton in it
18
+ * quietly became one-per-layer. The visible casualty was the WS events
19
+ * transport: the queue consumer registered its channel in the route copy's
20
+ * registry and the write path looked it up in the instrumentation copy's empty
21
+ * one, so every event fell back to HTTP for the life of the process.
22
+ *
23
+ * The combination that makes this bite rather than merely waste memory is that
24
+ * core caches the *World object* on `globalThis` while the module state that
25
+ * World closes over stays layer-local. Anything a World reaches at request time
26
+ * therefore has to be process-wide too.
27
+ *
28
+ * # Using it
29
+ *
30
+ * Hold the state in one object and read through it, rather than reaching for a
31
+ * top-level `let`:
32
+ *
33
+ * ```ts
34
+ * const state = globalSingleton('@workflow/world-vercel//wsEventsTransports', 1, () => ({
35
+ * transports: new Map<string, WsEventsTransport>(),
36
+ * loggedWsInUse: false,
37
+ * }));
38
+ *
39
+ * state.transports.set(url, transport);
40
+ * state.loggedWsInUse = true;
41
+ * ```
42
+ *
43
+ * A `let` cannot be shared by reference, so log-once latches and lazy caches
44
+ * become fields on the state object. That is the whole migration.
45
+ *
46
+ * # Shape versions
47
+ *
48
+ * `shapeVersion` is part of the key. Two *different releases* of a package can
49
+ * share one process (a transitive dependency pinning an older copy), and they
50
+ * would otherwise meet on the same key with different expectations of the
51
+ * object. Bump it whenever the state's shape changes incompatibly; an older
52
+ * copy then keeps its own state instead of misreading yours.
53
+ */
54
+ /**
55
+ * Get the process-wide state for `name`, creating it on first use.
56
+ *
57
+ * Every copy of the calling module in the process gets the same object back,
58
+ * because the object hangs off a `Symbol.for` key on `globalThis` rather than
59
+ * off the module.
60
+ *
61
+ * @param name - Stable identifier, conventionally `<package>//<what>` (e.g.
62
+ * `@workflow/world-vercel//httpDispatchers`). It is global to the process, so
63
+ * qualify it with the package name.
64
+ * @param shapeVersion - Version of the state object's shape. Bump on an
65
+ * incompatible change so copies expecting the old shape do not read the new
66
+ * one. See "Shape versions" above.
67
+ * @param create - Builds the initial state. Runs at most once per process:
68
+ * whichever copy asks first wins, so it must not close over anything
69
+ * copy-specific.
70
+ */
71
+ function globalSingleton(name, shapeVersion, create) {
72
+ const key = Symbol.for(`${name}/v${shapeVersion}`);
73
+ const store = globalThis;
74
+ const existing = store[key];
75
+ if (existing !== void 0) return existing;
76
+ const created = create();
77
+ store[key] = created;
78
+ return created;
79
+ }
80
+ export { globalSingleton as t };
@@ -0,0 +1,34 @@
1
+ import { o as __toESM } from "./rolldown-runtime-C1I3wEg2.js";
2
+ import { d as require_react, i as R, l as require_jsx_runtime, r as Qe, t as Ks } from "./chunk-RLXIAIE6-F0SJZlei.js";
3
+ // ../../node_modules/.bun/streamdown@2.3.0+04238d267197158c/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js
4
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
+ var import_jsx_runtime = require_jsx_runtime();
6
+ var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
7
+ let { shikiTheme: l } = (0, import_react.useContext)(R), o = Ks(), [m, i] = (0, import_react.useState)(e);
8
+ return (0, import_react.useEffect)(() => {
9
+ if (!o) {
10
+ i(e);
11
+ return;
12
+ }
13
+ let g = o.highlight({
14
+ code: s,
15
+ language: t,
16
+ themes: l
17
+ }, (p) => {
18
+ i(p);
19
+ });
20
+ g && i(g);
21
+ }, [
22
+ s,
23
+ t,
24
+ l,
25
+ o,
26
+ e
27
+ ]), (0, import_jsx_runtime.jsx)(Qe, {
28
+ className: n,
29
+ language: t,
30
+ result: m,
31
+ ...d$1
32
+ });
33
+ };
34
+ export { L as HighlightedCodeBlockBody };
@@ -0,0 +1 @@
1
+ export { n as Mermaid } from "./chunk-RLXIAIE6-F0SJZlei.js";
@@ -0,0 +1,469 @@
1
+ // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/constants.js
2
+ var MAX_ARRAY_LEN = 2 ** 32 - 1;
3
+ var MAX_ARRAY_INDEX = MAX_ARRAY_LEN - 1;
4
+ // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/utils.js
5
+ var DevalueError = class extends Error {
6
+ /**
7
+ * @param {string} message
8
+ * @param {string[]} keys
9
+ * @param {any} [value] - The value that failed to be serialized
10
+ * @param {any} [root] - The root value being serialized
11
+ */
12
+ constructor(message, keys, value, root) {
13
+ super(message);
14
+ this.name = "DevalueError";
15
+ this.path = keys.join("");
16
+ this.value = value;
17
+ this.root = root;
18
+ }
19
+ };
20
+ /**
21
+ * Marks a Map key on the path being serialized. The key itself is recorded
22
+ * right after the marker, so nothing is formatted or allocated per entry.
23
+ */
24
+ var MAP_KEY = Symbol();
25
+ /**
26
+ * Formats the path recorded on the way to the value being serialized — a
27
+ * property key, an array index, or `MAP_KEY` followed by a Map key — into
28
+ * the segments a `DevalueError` joins. Only runs when an error is raised.
29
+ * @param {any[]} keys
30
+ * @param {(key: any) => string} format_map_key
31
+ * @returns {string[]}
32
+ */
33
+ function format_path(keys, format_map_key) {
34
+ /** @type {string[]} */
35
+ const path = [];
36
+ for (let i = 0; i < keys.length; i += 1) {
37
+ const segment = keys[i];
38
+ if (segment === MAP_KEY) path.push(`.get(${format_map_key(keys[++i])})`);
39
+ else if (typeof segment === "number") path.push(`[${segment}]`);
40
+ else path.push(stringify_key(segment));
41
+ }
42
+ return path;
43
+ }
44
+ var object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
45
+ /** @param {any} thing */
46
+ function is_plain_object(thing) {
47
+ const proto = Object.getPrototypeOf(thing);
48
+ return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
49
+ }
50
+ /** @param {any} thing */
51
+ function get_type(thing) {
52
+ return Object.prototype.toString.call(thing).slice(8, -1);
53
+ }
54
+ /** @param {any} thing */
55
+ function is_buffer(thing) {
56
+ return typeof Buffer !== "undefined" && Buffer.isBuffer(thing);
57
+ }
58
+ var needs_escape = /["<\\\u0000-\u001f\u2028\u2029]/;
59
+ var json_leaves_raw = /[<\u2028\u2029]/g;
60
+ /** @type {Record<string, string>} */
61
+ var raw_escapes = {
62
+ "<": "\\u003C",
63
+ "\u2028": "\\u2028",
64
+ "\u2029": "\\u2029"
65
+ };
66
+ /** @param {string} char */
67
+ function escape_raw(char) {
68
+ return raw_escapes[char];
69
+ }
70
+ /** @param {string} str */
71
+ function stringify_string(str) {
72
+ if (!needs_escape.test(str) && str.isWellFormed()) return `"${str}"`;
73
+ return JSON.stringify(str).replace(json_leaves_raw, escape_raw);
74
+ }
75
+ var MAX_CACHED_KEY_LENGTH = 64;
76
+ /** @type {Map<string, string>} */
77
+ var quoted_keys = /* @__PURE__ */ new Map();
78
+ /** @param {string} key */
79
+ function quote_key(key) {
80
+ if (key.length > MAX_CACHED_KEY_LENGTH) return stringify_string(key);
81
+ let quoted = quoted_keys.get(key);
82
+ if (quoted === void 0) {
83
+ if (quoted_keys.size >= 1024) quoted_keys.clear();
84
+ quoted = stringify_string(key);
85
+ quoted_keys.set(key, quoted);
86
+ }
87
+ return quoted;
88
+ }
89
+ /** @param {Record<string | symbol, any>} object */
90
+ function enumerable_symbols(object) {
91
+ const symbols = Object.getOwnPropertySymbols(object);
92
+ return symbols.length === 0 ? symbols : symbols.filter((symbol) => Object.getOwnPropertyDescriptor(object, symbol)?.enumerable);
93
+ }
94
+ var is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
95
+ /** @param {string} key */
96
+ function stringify_key(key) {
97
+ return is_identifier.test(key) ? "." + key : "[" + JSON.stringify(key) + "]";
98
+ }
99
+ /** @param {number} n */
100
+ function is_valid_array_index(n) {
101
+ if (!Number.isInteger(n)) return false;
102
+ if (n < 0) return false;
103
+ if (n > MAX_ARRAY_INDEX) return false;
104
+ return true;
105
+ }
106
+ /** @param {number} n */
107
+ function is_valid_array_len(n) {
108
+ if (!Number.isInteger(n)) return false;
109
+ if (n < 0) return false;
110
+ if (n > MAX_ARRAY_LEN) return false;
111
+ return true;
112
+ }
113
+ /** @param {string} s */
114
+ function is_valid_array_index_string(s) {
115
+ if (s.length === 0) return false;
116
+ if (s.length > 1 && s.charCodeAt(0) === 48) return false;
117
+ for (let i = 0; i < s.length; i++) {
118
+ const c = s.charCodeAt(i);
119
+ if (c < 48 || c > 57) return false;
120
+ }
121
+ return is_valid_array_index(+s);
122
+ }
123
+ /**
124
+ * Returns the length of the leading run of valid array indices in `keys`.
125
+ * @param {readonly string[]} keys
126
+ */
127
+ function array_index_cut(keys) {
128
+ for (var i = keys.length - 1; i >= 0; i--) if (is_valid_array_index_string(keys[i])) break;
129
+ return i + 1;
130
+ }
131
+ /**
132
+ * Finds the populated indices of an array.
133
+ * @param {unknown[]} array
134
+ */
135
+ function valid_array_indices(array) {
136
+ const keys = Object.keys(array);
137
+ keys.length = array_index_cut(keys);
138
+ return keys;
139
+ }
140
+ // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/base64.js
141
+ /** @type {(array_buffer: ArrayBuffer) => string} */
142
+ function encode_native(array_buffer) {
143
+ return new Uint8Array(array_buffer).toBase64();
144
+ }
145
+ /** @type {(base64: string) => ArrayBuffer} */
146
+ function decode_native(base64) {
147
+ return Uint8Array.fromBase64(base64).buffer;
148
+ }
149
+ /** @type {(array_buffer: ArrayBuffer) => string} */
150
+ function encode_buffer(array_buffer) {
151
+ return Buffer.from(array_buffer).toString("base64");
152
+ }
153
+ /** @type {(base64: string) => ArrayBuffer} */
154
+ function decode_buffer(base64) {
155
+ return Uint8Array.from(Buffer.from(base64, "base64")).buffer;
156
+ }
157
+ /** @type {(array_buffer: ArrayBuffer) => string} */
158
+ function encode_legacy(array_buffer) {
159
+ const array = new Uint8Array(array_buffer);
160
+ let binary = "";
161
+ const chunk_size = 32768;
162
+ for (let i = 0; i < array.length; i += chunk_size) {
163
+ const chunk = array.subarray(i, i + chunk_size);
164
+ binary += String.fromCharCode.apply(null, chunk);
165
+ }
166
+ return btoa(binary);
167
+ }
168
+ /** @type {(base64: string) => ArrayBuffer} */
169
+ function decode_legacy(base64) {
170
+ const binary_string = atob(base64);
171
+ const len = binary_string.length;
172
+ const array = new Uint8Array(len);
173
+ for (let i = 0; i < len; i++) array[i] = binary_string.charCodeAt(i);
174
+ return array.buffer;
175
+ }
176
+ var native = typeof Uint8Array.fromBase64 === "function";
177
+ var buffer = typeof process === "object" && process.versions?.node !== void 0;
178
+ var encode64 = native ? encode_native : buffer ? encode_buffer : encode_legacy;
179
+ var decode64 = native ? decode_native : buffer ? decode_buffer : decode_legacy;
180
+ // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/operations.js
181
+ /**
182
+ * Merges caller-provided operation overrides over the defaults. Iterating the
183
+ * default keys (rather than the override's own keys) means nullish members
184
+ * fall back to the default, and inherited members — e.g. from a class
185
+ * instance — are picked up.
186
+ *
187
+ * @template {Record<string, any>} T
188
+ * @param {T} defaults
189
+ * @param {Partial<T> | undefined} overrides
190
+ * @returns {T}
191
+ */
192
+ function merge_operations(defaults, overrides) {
193
+ if (!overrides) return defaults;
194
+ const merged = {};
195
+ for (const key of Object.keys(defaults)) merged[key] = overrides[key] ?? defaults[key];
196
+ return merged;
197
+ }
198
+ /** @type {{ kind: 'not-plain' }} */
199
+ var NOT_PLAIN = /* @__PURE__ */ Object.freeze({ kind: "not-plain" });
200
+ /** @type {{ kind: 'symbol-keys' }} */
201
+ var SYMBOL_KEYS = /* @__PURE__ */ Object.freeze({ kind: "symbol-keys" });
202
+ var default_stringify_operations = /* @__PURE__ */ Object.freeze({
203
+ identify: (value) => value,
204
+ typeOf: (value) => value === null ? "null" : typeof value,
205
+ toPrimitive: (value) => value,
206
+ tagOf: (value) => get_type(value),
207
+ isThenable: (value) => typeof value.then === "function",
208
+ toPromise: (thenable) => Promise.resolve(thenable),
209
+ unbox: (boxed) => boxed.valueOf(),
210
+ toISOString: (date) => isNaN(date.getDate()) ? "" : date.toISOString(),
211
+ toStringValue: (value) => value.toString(),
212
+ regExpInfo: (regexp) => ({
213
+ source: regexp.source,
214
+ flags: regexp.flags
215
+ }),
216
+ valuesOf: (set) => set,
217
+ entriesOf: (map) => map,
218
+ viewInfo: (view) => {
219
+ if (is_buffer(view)) view = new Uint8Array(view);
220
+ return {
221
+ buffer: view.buffer,
222
+ byteOffset: view.byteOffset,
223
+ byteLength: view.byteLength,
224
+ length: view.length,
225
+ bufferByteLength: view.buffer.byteLength
226
+ };
227
+ },
228
+ toArrayBuffer: (buffer) => buffer,
229
+ lengthOf: (array) => array.length,
230
+ hasOwn: (value, key) => Object.hasOwn(value, key),
231
+ indicesOf: (array) => valid_array_indices(array),
232
+ shapeOf: (value) => {
233
+ if (!is_plain_object(value)) return NOT_PLAIN;
234
+ if (enumerable_symbols(value).length > 0) return SYMBOL_KEYS;
235
+ return {
236
+ kind: Object.getPrototypeOf(value) === null ? "null-proto" : "plain",
237
+ keys: Object.keys(value)
238
+ };
239
+ },
240
+ get: (value, key) => value[key]
241
+ });
242
+ var array_buffer_byte_length = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength")?.get;
243
+ var shared_array_buffer_byte_length = typeof SharedArrayBuffer === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength")?.get;
244
+ var default_parse_operations = /* @__PURE__ */ Object.freeze({
245
+ fromPrimitive: (primitive) => primitive,
246
+ fromISOString: (iso) => new Date(iso),
247
+ fromStringValue: (tag, text) => {
248
+ if (tag === "URL") return new URL(text);
249
+ if (tag === "URLSearchParams") return new URLSearchParams(text);
250
+ return Temporal[tag.slice(9)].from(text);
251
+ },
252
+ fromArrayBuffer: (buffer) => buffer,
253
+ fromRegExpInfo: (source, flags) => new RegExp(source, flags),
254
+ fromViewInfo: (tag, buffer, byteOffset, length) => {
255
+ try {
256
+ array_buffer_byte_length.call(buffer);
257
+ } catch (error) {
258
+ if (!shared_array_buffer_byte_length) throw error;
259
+ shared_array_buffer_byte_length.call(buffer);
260
+ }
261
+ const Constructor = globalThis[tag];
262
+ return byteOffset !== void 0 ? new Constructor(buffer, byteOffset, length) : new Constructor(buffer);
263
+ },
264
+ box: (value) => Object(value),
265
+ createArray: (length) => new Array(length),
266
+ createSparseArray: (length) => {
267
+ /** @type {any[]} */
268
+ const array = [];
269
+ array[MAX_ARRAY_INDEX] = void 0;
270
+ delete array[MAX_ARRAY_INDEX];
271
+ array.length = length;
272
+ return array;
273
+ },
274
+ createObject: () => ({}),
275
+ createNullPrototypeObject: () => Object.create(null),
276
+ createSet: () => /* @__PURE__ */ new Set(),
277
+ createMap: () => /* @__PURE__ */ new Map(),
278
+ set: (target, key, value) => {
279
+ target[key] = value;
280
+ },
281
+ addValue: (set, value) => {
282
+ set.add(value);
283
+ },
284
+ addEntry: (map, key, value) => {
285
+ map.set(key, value);
286
+ }
287
+ });
288
+ // ../../node_modules/.bun/devalue@6.0.3/node_modules/devalue/src/parse.js
289
+ function invalid() {
290
+ throw new Error("Invalid input");
291
+ }
292
+ /**
293
+ * Revive a value serialized with `devalue.stringify`
294
+ * @param {string} serialized
295
+ * @param {Record<string, (value: any) => any>} [revivers]
296
+ * @param {import('./types.js').ParseOptions} [options]
297
+ */
298
+ function parse(serialized, revivers, options) {
299
+ return unflatten(JSON.parse(serialized), revivers, options);
300
+ }
301
+ /**
302
+ * Revive a value flattened with `devalue.stringify`
303
+ * @param {number | any[]} parsed
304
+ * @param {Record<string, (value: any) => any>} [revivers]
305
+ * @param {import('./types.js').ParseOptions} [options]
306
+ */
307
+ function unflatten(parsed, revivers, options) {
308
+ /** @type {import('./types.js').ParseOperations} */
309
+ const ops = merge_operations(default_parse_operations, options?.operations);
310
+ if (typeof parsed === "number") return hydrate(parsed, true);
311
+ if (!Array.isArray(parsed) || parsed.length === 0) invalid();
312
+ const values = parsed;
313
+ const hydrated = Array(values.length);
314
+ /**
315
+ * A set of values currently being hydrated with custom revivers,
316
+ * used to detect invalid cyclical dependencies
317
+ * @type {Set<number> | null}
318
+ */
319
+ let hydrating = null;
320
+ /**
321
+ * @param {number} index
322
+ * @returns {any}
323
+ */
324
+ function get_raw(index) {
325
+ if (!is_valid_array_index(index) || index >= values.length) invalid();
326
+ return values[index];
327
+ }
328
+ /**
329
+ * @param {number} index
330
+ * @returns {any}
331
+ */
332
+ function hydrate(index, standalone = false) {
333
+ if (index === -1) return ops.fromPrimitive(void 0);
334
+ if (index === -3) return ops.fromPrimitive(NaN);
335
+ if (index === -4) return ops.fromPrimitive(Infinity);
336
+ if (index === -5) return ops.fromPrimitive(-Infinity);
337
+ if (index === -6) return ops.fromPrimitive(-0);
338
+ if (standalone || typeof index !== "number") invalid();
339
+ if (index in hydrated) return hydrated[index];
340
+ if (index >= values.length) invalid();
341
+ const value = values[index];
342
+ if (!value || typeof value !== "object") hydrated[index] = ops.fromPrimitive(value);
343
+ else if (Array.isArray(value)) {
344
+ if (typeof value[0] === "string") {
345
+ const type = value[0];
346
+ const reviver = revivers && Object.hasOwn(revivers, type) ? revivers[type] : void 0;
347
+ if (reviver) {
348
+ let i = value[1];
349
+ if (typeof i !== "number") i = values.push(value[1]) - 1;
350
+ if (Object.hasOwn(hydrated, i)) return hydrated[index] = reviver(hydrated[i]);
351
+ hydrating ??= /* @__PURE__ */ new Set();
352
+ if (hydrating.has(i)) throw new Error("Invalid circular reference");
353
+ hydrating.add(i);
354
+ hydrated[index] = reviver(hydrate(i));
355
+ hydrating.delete(i);
356
+ return hydrated[index];
357
+ }
358
+ switch (type) {
359
+ case "Date":
360
+ hydrated[index] = ops.fromISOString(value[1]);
361
+ break;
362
+ case "Set":
363
+ const set = ops.createSet();
364
+ hydrated[index] = set;
365
+ for (let i = 1; i < value.length; i += 1) ops.addValue(set, hydrate(value[i]));
366
+ break;
367
+ case "Map":
368
+ const map = ops.createMap();
369
+ hydrated[index] = map;
370
+ for (let i = 1; i < value.length; i += 2) ops.addEntry(map, hydrate(value[i]), hydrate(value[i + 1]));
371
+ break;
372
+ case "RegExp":
373
+ hydrated[index] = ops.fromRegExpInfo(value[1], value[2]);
374
+ break;
375
+ case "Object": {
376
+ const wrapped_index = value[1];
377
+ if (!(wrapped_index === -3 || wrapped_index === -4 || wrapped_index === -5 || wrapped_index === -6)) {
378
+ const wrapped = get_raw(wrapped_index);
379
+ const is_bigint = Array.isArray(wrapped) && wrapped[0] === "BigInt";
380
+ if ((wrapped === void 0 || typeof wrapped === "object") && !is_bigint) invalid();
381
+ }
382
+ hydrated[index] = ops.box(hydrate(wrapped_index));
383
+ break;
384
+ }
385
+ case "BigInt":
386
+ hydrated[index] = ops.fromPrimitive(BigInt(value[1]));
387
+ break;
388
+ case "null":
389
+ const obj = ops.createNullPrototypeObject();
390
+ hydrated[index] = obj;
391
+ for (let i = 1; i < value.length; i += 2) {
392
+ const key = value[i];
393
+ if (typeof key !== "string") throw new Error("Cannot parse an object with a non-string key");
394
+ if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
395
+ ops.set(obj, key, hydrate(value[i + 1]));
396
+ }
397
+ break;
398
+ case "Int8Array":
399
+ case "Uint8Array":
400
+ case "Uint8ClampedArray":
401
+ case "Int16Array":
402
+ case "Uint16Array":
403
+ case "Float16Array":
404
+ case "Int32Array":
405
+ case "Uint32Array":
406
+ case "Float32Array":
407
+ case "Float64Array":
408
+ case "BigInt64Array":
409
+ case "BigUint64Array":
410
+ case "DataView": {
411
+ const buffer_index = value[1];
412
+ const raw = get_raw(buffer_index);
413
+ if (!Array.isArray(raw) || raw[0] !== "ArrayBuffer") invalid();
414
+ const buffer = hydrate(buffer_index);
415
+ hydrated[index] = ops.fromViewInfo(type, buffer, value[2], value[3]);
416
+ break;
417
+ }
418
+ case "ArrayBuffer": {
419
+ const base64 = value[1];
420
+ if (typeof base64 !== "string") throw new Error("Invalid ArrayBuffer encoding");
421
+ hydrated[index] = ops.fromArrayBuffer(decode64(base64));
422
+ break;
423
+ }
424
+ case "URL":
425
+ case "URLSearchParams":
426
+ case "Temporal.Duration":
427
+ case "Temporal.Instant":
428
+ case "Temporal.PlainDate":
429
+ case "Temporal.PlainTime":
430
+ case "Temporal.PlainDateTime":
431
+ case "Temporal.PlainMonthDay":
432
+ case "Temporal.PlainYearMonth":
433
+ case "Temporal.ZonedDateTime":
434
+ hydrated[index] = ops.fromStringValue(type, value[1]);
435
+ break;
436
+ default: throw new Error(`Unknown type ${type}`);
437
+ }
438
+ } else if (value[0] === -7) {
439
+ const len = value[1];
440
+ if (!is_valid_array_len(len)) invalid();
441
+ const array = ops.createSparseArray(len);
442
+ hydrated[index] = array;
443
+ for (let i = 2; i < value.length; i += 2) {
444
+ const idx = value[i];
445
+ if (!is_valid_array_index(idx) || idx >= len) invalid();
446
+ ops.set(array, idx, hydrate(value[i + 1]));
447
+ }
448
+ } else {
449
+ const array = ops.createArray(value.length);
450
+ hydrated[index] = array;
451
+ for (let i = 0; i < value.length; i += 1) {
452
+ const n = value[i];
453
+ if (n === -2) continue;
454
+ ops.set(array, i, hydrate(n));
455
+ }
456
+ }
457
+ } else {
458
+ const object = ops.createObject();
459
+ hydrated[index] = object;
460
+ for (const key of Object.keys(value)) {
461
+ if (key === "__proto__") throw new Error("Cannot parse an object with a `__proto__` property");
462
+ ops.set(object, key, hydrate(value[key]));
463
+ }
464
+ }
465
+ return hydrated[index];
466
+ }
467
+ return hydrate(0);
468
+ }
469
+ export { merge_operations as a, MAP_KEY as c, stringify_string as d, default_stringify_operations as i, format_path as l, unflatten as n, encode64 as o, default_parse_operations as r, DevalueError as s, parse as t, quote_key as u };
@@ -0,0 +1,43 @@
1
+ import { createRequire } from "node:module";
2
+ // \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __esmMin = (fn, res, err) => () => {
10
+ if (err) throw err[0];
11
+ try {
12
+ return fn && (res = fn(fn = 0)), res;
13
+ } catch (e) {
14
+ throw err = [e], e;
15
+ }
16
+ };
17
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
18
+ var __exportAll = (all, no_symbols) => {
19
+ let target = {};
20
+ for (var name in all) __defProp(target, name, {
21
+ get: all[name],
22
+ enumerable: true
23
+ });
24
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
25
+ return target;
26
+ };
27
+ var __copyProps = (to, from, except, desc) => {
28
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
29
+ key = keys[i];
30
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
31
+ get: ((k) => from[k]).bind(null, key),
32
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
33
+ });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
38
+ value: mod,
39
+ enumerable: true
40
+ }) : target, mod));
41
+ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
43
+ export { __toCommonJS as a, __require as i, __esmMin as n, __toESM as o, __exportAll as r, __commonJSMin as t };