command-code 0.41.3 → 0.42.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.
- package/bin/run.mjs +25 -0
- package/dist/cli.mjs +16 -0
- package/dist/index.mjs +1 -15
- package/package.json +5 -4
- package/vsix/commandcode-vscode.vsix +0 -0
package/bin/run.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
// NOTE: dist/index.mjs is now itself a launcher (built from src/launcher.ts);
|
|
21
|
+
// the real bundle is dist/cli.mjs. This file is retained only as a safety net
|
|
22
|
+
// for installs whose bin symlink was linked to bin/run.mjs by the `npm i -g`
|
|
23
|
+
// fallback path of an older auto-update, so that they keep working after they
|
|
24
|
+
// atomic-update to a version where the canonical bin target is dist/index.mjs.
|
|
25
|
+
await import(new URL('../dist/cli.mjs', import.meta.url));
|