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