command-code 0.41.2 → 0.41.4
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.
- package/bin/run.mjs +20 -0
- package/dist/index.mjs +4 -4
- package/package.json +8 -7
- package/vsix/commandcode-vscode.vsix +0 -0
package/bin/run.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the bundled CLI. Its one job: default NODE_ENV to
|
|
3
|
+
// 'production' BEFORE the ESM graph loads.
|
|
4
|
+
//
|
|
5
|
+
// react/ink are runtime dependencies (external to the tsup bundle), and ESM
|
|
6
|
+
// evaluates a module's static imports before any of its own statements — so
|
|
7
|
+
// an assignment inside dist/index.mjs (or its bootstrap module) runs AFTER
|
|
8
|
+
// React has already picked its build. Without this, every end user runs the
|
|
9
|
+
// DEVELOPMENT react-reconciler, whose component-performance tracking records
|
|
10
|
+
// a PerformanceMeasure per render with the component's props serialized into
|
|
11
|
+
// the entry detail. Those entries are never cleared, pinning a copy of every
|
|
12
|
+
// rendered prompt, reasoning block, and tool output for the life of the
|
|
13
|
+
// session — the dominant retainer in issue #550's heap OOM (verified via
|
|
14
|
+
// --heapsnapshot-near-heap-limit). An explicitly set NODE_ENV (local dev,
|
|
15
|
+
// tests) is respected. The dynamic import defers evaluation until after the
|
|
16
|
+
// env is set.
|
|
17
|
+
if (!process.env.NODE_ENV) {
|
|
18
|
+
process.env.NODE_ENV = 'production';
|
|
19
|
+
}
|
|
20
|
+
await import(new URL('../dist/index.mjs', import.meta.url));
|