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