@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,199 @@
1
+ import { createRequire as __wkfCreateRequire } from "node:module";
2
+ if (typeof require === "undefined") globalThis.require = __wkfCreateRequire(import.meta.url);
3
+ // ../../node_modules/.bun/@tootallnate+zstd-wasm@0.0.2/node_modules/@tootallnate/zstd-wasm/dist/index.js
4
+ /**
5
+ * @tootallnate/zstd-wasm
6
+ *
7
+ * Streaming Zstandard decoder backed by a WebAssembly module compiled
8
+ * from upstream zstd 1.5.7's single-file decoder via wasi-sdk.
9
+ *
10
+ * The compiled `zstd.wasm` is shipped alongside this module but the
11
+ * caller is responsible for loading it. Pass the bytes (or a
12
+ * pre-compiled `WebAssembly.Module`) as the first argument to
13
+ * `ZstdDecoder.create` / `decompressBytes` / `new ZstdDecompressStream(...)`.
14
+ * That keeps this package free of `fetch` / `fs` assumptions and
15
+ * lets the caller decide how to source the WASM (bundler asset URL,
16
+ * `fs.readFile`, `fetch`, embedded base64, …).
17
+ *
18
+ * Public API:
19
+ *
20
+ * // Streaming (idiomatic — mirrors DecompressionStream):
21
+ * compressedReadable.pipeThrough(new ZstdDecompressStream(wasmBytes))
22
+ *
23
+ * // One-shot:
24
+ * const out = await decompressBytes(wasmBytes, compressedBytes);
25
+ *
26
+ * // Low-level (manual chunk feeding):
27
+ * const dec = await ZstdDecoder.create(wasmBytes);
28
+ * dec.push(chunk, (out) => { ... });
29
+ * dec.dispose();
30
+ */
31
+ var compiledCache = /* @__PURE__ */ new WeakMap();
32
+ async function compileSource(source) {
33
+ const resolved = await source;
34
+ if (resolved instanceof WebAssembly.Module) return resolved;
35
+ const buf = resolved;
36
+ const cacheKey = buf.buffer instanceof ArrayBuffer ? buf.buffer : buf;
37
+ const cached = compiledCache.get(cacheKey);
38
+ if (cached) return cached;
39
+ const compiled = await WebAssembly.compile(buf);
40
+ compiledCache.set(cacheKey, compiled);
41
+ return compiled;
42
+ }
43
+ /** Layout of the JsBuf struct in `c/wrapper.c`. */
44
+ var BUF_LAYOUT = {
45
+ src: 0,
46
+ srcSize: 4,
47
+ srcPos: 8,
48
+ dst: 12,
49
+ dstSize: 16,
50
+ dstPos: 20,
51
+ SIZE: 24
52
+ };
53
+ function readCString(memory, ptr) {
54
+ const bytes = new Uint8Array(memory.buffer, ptr);
55
+ let end = 0;
56
+ while (bytes[end] !== 0 && end < bytes.length) end++;
57
+ return new TextDecoder().decode(bytes.subarray(0, end));
58
+ }
59
+ /**
60
+ * One decoder owns one zstd `DCtx` plus a pair of input/output
61
+ * buffers in WASM linear memory. A decoder is single-threaded and
62
+ * stateful — feed input frames in order until `dstPos === 0` and
63
+ * the decoder reports the end of the frame.
64
+ *
65
+ * Allocations are reused across calls. Call `dispose()` when done
66
+ * (or just leave it to GC — the WASM memory is owned by the
67
+ * `WebAssembly.Instance` and goes away with it).
68
+ */
69
+ var ZstdDecoder = class ZstdDecoder {
70
+ constructor(exports, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr) {
71
+ this.exports = exports;
72
+ this.dctxPtr = dctxPtr;
73
+ this.inPtr = inPtr;
74
+ this.inCap = inCap;
75
+ this.outPtr = outPtr;
76
+ this.outCap = outCap;
77
+ this.bufPtr = bufPtr;
78
+ }
79
+ /**
80
+ * Compile the bundled `zstd.wasm` (or a pre-compiled module) and
81
+ * return a ready-to-use `ZstdDecoder`.
82
+ */
83
+ static async create(wasm) {
84
+ const module = await compileSource(wasm);
85
+ const exports = (await WebAssembly.instantiate(module, {})).exports;
86
+ const dctxPtr = exports.dctx_new();
87
+ if (!dctxPtr) throw new Error("zstd: failed to allocate decompression context");
88
+ const inCap = exports.dstream_in_size();
89
+ const outCap = exports.dstream_out_size();
90
+ const inPtr = exports.zstd_malloc(inCap);
91
+ const outPtr = exports.zstd_malloc(outCap);
92
+ const bufPtr = exports.zstd_malloc(BUF_LAYOUT.SIZE);
93
+ if (!inPtr || !outPtr || !bufPtr) throw new Error("zstd: failed to allocate streaming buffers");
94
+ return new ZstdDecoder(exports, dctxPtr, inPtr, inCap, outPtr, outCap, bufPtr);
95
+ }
96
+ dispose() {
97
+ if (!this.dctxPtr) return;
98
+ const e = this.exports;
99
+ e.dctx_free(this.dctxPtr);
100
+ e.zstd_free(this.inPtr);
101
+ e.zstd_free(this.outPtr);
102
+ e.zstd_free(this.bufPtr);
103
+ this.dctxPtr = 0;
104
+ }
105
+ /**
106
+ * Get a fresh `Uint8Array` view of WASM linear memory.
107
+ *
108
+ * IMPORTANT: any call into WASM may grow `memory.buffer`, which
109
+ * detaches all existing `ArrayBuffer`-backed views. Always
110
+ * re-acquire views from this getter (and `bufView`) AFTER each
111
+ * WASM call rather than caching them.
112
+ */
113
+ get heap() {
114
+ return new Uint8Array(this.exports.memory.buffer);
115
+ }
116
+ get bufView() {
117
+ return new DataView(this.exports.memory.buffer, this.bufPtr, BUF_LAYOUT.SIZE);
118
+ }
119
+ checkError(ret) {
120
+ if (this.exports.is_error(ret) !== 0) {
121
+ const name = readCString(this.exports.memory, this.exports.get_error_name(ret));
122
+ throw new Error(`zstd: ${name} (code ${ret})`);
123
+ }
124
+ }
125
+ /**
126
+ * Feed `chunk` to the decoder and pull out as much decoded data
127
+ * as fits in our output buffer. Calls `onOutput` zero or more
128
+ * times with non-empty `Uint8Array` slices into the WASM memory.
129
+ *
130
+ * IMPORTANT: the slices passed to `onOutput` are views into WASM
131
+ * memory and are only valid until the next decoder call. Callers
132
+ * that need to keep the data must copy it (`.slice()` or
133
+ * `.set()` into their own buffer).
134
+ */
135
+ push(chunk, onOutput) {
136
+ const e = this.exports;
137
+ let chunkOffset = 0;
138
+ while (chunkOffset < chunk.length) {
139
+ const copyLen = Math.min(chunk.length - chunkOffset, this.inCap);
140
+ this.heap.set(chunk.subarray(chunkOffset, chunkOffset + copyLen), this.inPtr);
141
+ chunkOffset += copyLen;
142
+ let srcPos = 0;
143
+ while (srcPos < copyLen) {
144
+ let view = this.bufView;
145
+ view.setUint32(BUF_LAYOUT.src, this.inPtr, true);
146
+ view.setUint32(BUF_LAYOUT.srcSize, copyLen, true);
147
+ view.setUint32(BUF_LAYOUT.srcPos, srcPos, true);
148
+ view.setUint32(BUF_LAYOUT.dst, this.outPtr, true);
149
+ view.setUint32(BUF_LAYOUT.dstSize, this.outCap, true);
150
+ view.setUint32(BUF_LAYOUT.dstPos, 0, true);
151
+ const ret = e.decompress_stream(this.dctxPtr, this.bufPtr);
152
+ this.checkError(ret);
153
+ view = this.bufView;
154
+ const dstPos = view.getUint32(BUF_LAYOUT.dstPos, true);
155
+ if (dstPos > 0) onOutput(this.heap.subarray(this.outPtr, this.outPtr + dstPos));
156
+ const newSrcPos = view.getUint32(BUF_LAYOUT.srcPos, true);
157
+ if (newSrcPos === srcPos && dstPos === 0) throw new Error("zstd: decoder made no progress");
158
+ srcPos = newSrcPos;
159
+ if (ret === 0 && srcPos === copyLen) break;
160
+ }
161
+ }
162
+ }
163
+ /**
164
+ * Decompress an entire compressed buffer in one shot. Convenient
165
+ * for small inputs; large inputs should prefer
166
+ * `ZstdDecompressStream` to avoid buffering everything in memory.
167
+ */
168
+ decode(compressed) {
169
+ const out = [];
170
+ let total = 0;
171
+ this.push(compressed, (chunk) => {
172
+ const copy = new Uint8Array(chunk);
173
+ out.push(copy);
174
+ total += copy.length;
175
+ });
176
+ const result = new Uint8Array(total);
177
+ let off = 0;
178
+ for (const c of out) {
179
+ result.set(c, off);
180
+ off += c.length;
181
+ }
182
+ return result;
183
+ }
184
+ };
185
+ TransformStream;
186
+ /**
187
+ * Decompress an entire compressed buffer in one shot. Reads
188
+ * everything into memory; only suitable for inputs that comfortably
189
+ * fit. For multi-MB / GB inputs, use `ZstdDecompressStream` instead.
190
+ */
191
+ async function decompressBytes(wasm, compressed) {
192
+ const dec = await ZstdDecoder.create(wasm);
193
+ try {
194
+ return dec.decode(compressed);
195
+ } finally {
196
+ dec.dispose();
197
+ }
198
+ }
199
+ export { decompressBytes };