@nimbus-sh/core 0.7.0 → 0.8.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.
@@ -27,7 +27,8 @@ export interface TarballWriteResult {
27
27
  * Stream a gzipped npm archive into a package directory. Entry names are
28
28
  * already canonical and prefix-stripped by streamTarEntries. Hold only the
29
29
  * current entry and the manifest; write the manifest last so a failed install
30
- * is not mistaken for a complete package on retry. Filesystem failures reject.
30
+ * is not mistaken for a complete package on retry. A second manifest in one
31
+ * archive is a malformed package, not an overwrite. Filesystem failures reject.
31
32
  */
32
33
  export declare function writeTarballStream(body: ReadableStream<Uint8Array>, targetDir: string, vfs: TarballWriteTarget): Promise<TarballWriteResult>;
33
34
  /** Extract every regular file. Gzipped input is decompressed first. */
@@ -1 +1 @@
1
- {"version":3,"file":"tarball.d.ts","sourceRoot":"","sources":["../../src/_shared/tarball.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;CAC7D;AAED,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CA0B7B;AAED,uEAAuE;AACvE,wBAAsB,cAAc,CAClC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAsBlC"}
1
+ {"version":3,"file":"tarball.d.ts","sourceRoot":"","sources":["../../src/_shared/tarball.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;CAC7D;AAED,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CA6B7B;AAED,uEAAuE;AACvE,wBAAsB,cAAc,CAClC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAsBlC"}
@@ -16,7 +16,8 @@ const PACKAGE_MANIFEST = 'package.json';
16
16
  * Stream a gzipped npm archive into a package directory. Entry names are
17
17
  * already canonical and prefix-stripped by streamTarEntries. Hold only the
18
18
  * current entry and the manifest; write the manifest last so a failed install
19
- * is not mistaken for a complete package on retry. Filesystem failures reject.
19
+ * is not mistaken for a complete package on retry. A second manifest in one
20
+ * archive is a malformed package, not an overwrite. Filesystem failures reject.
20
21
  */
21
22
  export async function writeTarballStream(body, targetDir, vfs) {
22
23
  const ensureDir = (path) => {
@@ -30,6 +31,9 @@ export async function writeTarballStream(body, targetDir, vfs) {
30
31
  const entries = streamTarEntries(readableStreamToAsyncIterable(body.pipeThrough(new DecompressionStream('gzip'))));
31
32
  for await (const entry of entries) {
32
33
  if (entry.name === PACKAGE_MANIFEST) {
34
+ if (manifest !== null) {
35
+ throw new Error(`tarball for ${targetDir} carried two ${PACKAGE_MANIFEST} entries`);
36
+ }
33
37
  manifest = entry.data;
34
38
  continue;
35
39
  }
@@ -1,2 +1,40 @@
1
+ /**
2
+ * One JavaScript source scanner shared by the two comment-stripping
3
+ * call sites — prefetch's import detection and the esbuild transform
4
+ * pipeline's classifiers.
5
+ *
6
+ * `scanJsSource(src, literals)` walks `src` once and returns a
7
+ * byte-aligned copy in which `//` and `/* … *\/` comments are blanked
8
+ * (each comment becomes a space; newlines inside a block comment are
9
+ * preserved so line numbers still match the input). String, template
10
+ * and regex literals are what `literals` decides:
11
+ *
12
+ * - `'blank'`: literal content is replaced too — templates keep their
13
+ * `${…}` interpolation expression as code so a depth-tracked caller
14
+ * sees `await` etc. inside it. This is the transform pipeline's
15
+ * classification view: nothing quoted can read as an `import`.
16
+ * - `'keep'`: literals are copied verbatim. This is prefetch's
17
+ * import-detection view: IMPORT_RE/REQUIRE_RE must see the
18
+ * specifier string, and a `//` or `/*` inside a literal must NOT
19
+ * open a comment that swallows a following real import.
20
+ *
21
+ * The output is assembled from input slices and joined once. It used to
22
+ * be built one character at a time (`stripped += c`), which V8 keeps as
23
+ * a rope of one node per append — ~30 bytes of heap per character, all
24
+ * live until the string is first read. On typescript's 6.15 MB
25
+ * `lib/_tsc.js` that rope measured 174 MB against a 128 MB isolate —
26
+ * the session Durable Object was killed inside `tsc`'s spawn before the
27
+ * facet existed. Spans hold the input, the output and a short array.
28
+ *
29
+ * Serialized by name: `generateEsbuildTransformRuntimeSource` embeds
30
+ * this function's `.toString()` in the transform runtime, so every
31
+ * constant it reads is declared inside the body.
32
+ */
33
+ export declare function scanJsSource(src: string, literals: 'keep' | 'blank'): string;
34
+ /**
35
+ * Strip comments for import/require detection. Literals are kept: the
36
+ * specifier the regexes extract lives inside a string, and a comment
37
+ * marker inside a string must not swallow the code that follows it.
38
+ */
1
39
  export declare function stripCommentsForImports(src: string): string;
2
40
  //# sourceMappingURL=comment-strip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment-strip.d.ts","sourceRoot":"","sources":["../../src/runtime/comment-strip.ts"],"names":[],"mappings":"AAkDA,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyC3D"}
1
+ {"version":3,"file":"comment-strip.d.ts","sourceRoot":"","sources":["../../src/runtime/comment-strip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAqM5E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -1,102 +1,296 @@
1
1
  /**
2
- * Minimal byte-aligned comment stripper for prefetch's import detection.
2
+ * One JavaScript source scanner shared by the two comment-stripping
3
+ * call sites — prefetch's import detection and the esbuild transform
4
+ * pipeline's classifiers.
3
5
  *
4
- * Scope: strip `//` line comments and `/* … *\/` block comments by
5
- * replacing each comment with a single space. Newlines INSIDE the
6
- * comment are preserved so that line numbers stay aligned with the
7
- * input (matches the strip-and-classify pattern used by
8
- * `esbuild-service.ts:stripCommentsAndStrings` for the transform
9
- * pipeline).
6
+ * `scanJsSource(src, literals)` walks `src` once and returns a
7
+ * byte-aligned copy in which `//` and `/* *\/` comments are blanked
8
+ * (each comment becomes a space; newlines inside a block comment are
9
+ * preserved so line numbers still match the input). String, template
10
+ * and regex literals are what `literals` decides:
10
11
  *
11
- * Why a separate, smaller scanner: prefetch's IMPORT_RE / REQUIRE_RE
12
- * in `require-resolver.ts:41,87` are detection-only they extract
13
- * specifier strings, not shapes. The full string-and-template-literal
14
- * stripper in `esbuild-service.ts` is overkill for that, and crossing
15
- * the anti-touch boundary on `esbuild-service.ts` to extend a single
16
- * shared helper isn't worth it right now.
12
+ * - `'blank'`: literal content is replaced too templates keep their
13
+ * `${…}` interpolation expression as code so a depth-tracked caller
14
+ * sees `await` etc. inside it. This is the transform pipeline's
15
+ * classification view: nothing quoted can read as an `import`.
16
+ * - `'keep'`: literals are copied verbatim. This is prefetch's
17
+ * import-detection view: IMPORT_RE/REQUIRE_RE must see the
18
+ * specifier string, and a `//` or `/*` inside a literal must NOT
19
+ * open a comment that swallows a following real import.
17
20
  *
18
- * Empirical justification (esbuild-ast-rewrite wave, P2 measurement):
19
- * - Per-file AST-based extraction: ~5 ms warm avg
20
- * - 100-file session bootstrap with AST: ~553 ms (over the 500 ms gate)
21
- * - Regex with this stripper: ~0.1 ms per file
22
- * - Correctness gap closed: chalk `import { // eslint-disable\n a,\n b\n} from './utilities.js'` now matches
23
- *
24
- * String-literal handling is intentionally OUT of scope. A literal
25
- * `import x from 'y'` inside a JavaScript string would still produce
26
- * a false-positive prefetch attempt. The resolver no-ops on misses,
27
- * so it's a minor wasted-work cost — see IMPORT_RE header comment in
28
- * `require-resolver.ts:84-86`.
29
- *
30
- * Memory: the output is assembled from slices of the input — one per
31
- * comment-free span — and joined once. It used to be built one character
32
- * at a time with `out += c`, which every JS engine represents as a rope
33
- * of one node per append: ~30 bytes of heap per character of output, all
34
- * of it live until the string is first read. The require walk runs this
35
- * over every file in the closure, and on typescript's 6.15 MB `lib/_tsc.js`
36
- * that rope measured 174 MB (V8) / 172 MB (JSC) against a 128 MB isolate —
21
+ * The output is assembled from input slices and joined once. It used to
22
+ * be built one character at a time (`stripped += c`), which V8 keeps as
23
+ * a rope of one node per append — ~30 bytes of heap per character, all
24
+ * live until the string is first read. On typescript's 6.15 MB
25
+ * `lib/_tsc.js` that rope measured 174 MB against a 128 MB isolate
37
26
  * the session Durable Object was killed inside `tsc`'s spawn before the
38
- * facet existed. A span-sliced build holds the input, the output and a
39
- * short array of slices, and nothing else.
27
+ * facet existed. Spans hold the input, the output and a short array.
40
28
  *
41
- * TODO(CLN-X): when the `src/runtime/esbuild-service.ts` anti-touch
42
- * window opens, unify with the canonical
43
- * `stripCommentsAndStrings(src)` helper there. Both implement the
44
- * same logical pass over comments; only the string/regex-literal
45
- * handling differs.
29
+ * Serialized by name: `generateEsbuildTransformRuntimeSource` embeds
30
+ * this function's `.toString()` in the transform runtime, so every
31
+ * constant it reads is declared inside the body.
46
32
  */
47
- const SLASH = 0x2f;
48
- const STAR = 0x2a;
49
- const NEWLINE = 0x0a;
50
- export function stripCommentsForImports(src) {
51
- const N = src.length;
33
+ export function scanJsSource(src, literals) {
34
+ const NEWLINE = 0x0a;
35
+ // Identifier-suffix detection: `/` after one of these is division;
36
+ // after anything else (operators, punctuators, keywords, start-of-file)
37
+ // it opens a regex literal. Word chars + `)` + `]` cover `foo()/x` and
38
+ // `a[i]/y`; the quote characters cover `'…' /re/` and `` `…` /re/ ``.
39
+ const DIVISION_AFTER = /[A-Za-z0-9_$\)\]'\"`]/;
52
40
  const parts = [];
53
- // Start of the comment-free span not yet copied to `parts`.
41
+ // Start of the span not yet copied to `parts`.
54
42
  let spanStart = 0;
55
43
  let i = 0;
56
- while (i < N) {
57
- if (src.charCodeAt(i) !== SLASH) {
44
+ const N = src.length;
45
+ let lastNonWs = '';
46
+ const record = (ch) => {
47
+ if (ch !== ' ' && ch !== '\t' && ch !== '\n' && ch !== '\r')
48
+ lastNonWs = ch;
49
+ };
50
+ // The division/regex discriminator needs the last non-ws char the loop
51
+ // has passed — stepped chars record themselves; spans already landed in
52
+ // `parts` only need their final char re-derived.
53
+ const step = () => { record(src[i]); i++; };
54
+ const copy = (end) => {
55
+ if (end > spanStart)
56
+ parts.push(src.slice(spanStart, end));
57
+ };
58
+ const emit = (ch) => { parts.push(ch); };
59
+ // A shebang is the file's first line and never a comment or a regex —
60
+ // `#!/` at offset 0 is copied whole before the loop sees the `/`.
61
+ if (src.charCodeAt(0) === 0x23 && src.charCodeAt(1) === 0x21) {
62
+ i = 2;
63
+ while (i < N && src.charCodeAt(i) !== NEWLINE)
58
64
  i++;
59
- continue;
60
- }
61
- const next = src.charCodeAt(i + 1);
62
- // Line comment: `//` to end-of-line, replaced by one space. The
63
- // newline is not part of the comment and stays in the next span.
64
- if (next === SLASH) {
65
- parts.push(src.slice(spanStart, i), ' ');
66
- i += 2;
67
- while (i < N && src.charCodeAt(i) !== NEWLINE)
65
+ record('!');
66
+ }
67
+ while (i < N) {
68
+ if (src.charCodeAt(i) === 0x2f /* / */) {
69
+ const next = src.charCodeAt(i + 1);
70
+ if (next === 0x2f) {
71
+ // Line comment: to end-of-line, one space. The newline itself is
72
+ // not part of the comment and stays in the next span.
73
+ copy(i);
74
+ i += 2;
75
+ while (i < N && src.charCodeAt(i) !== NEWLINE)
76
+ i++;
77
+ emit(' ');
78
+ spanStart = i;
79
+ continue;
80
+ }
81
+ if (next === 0x2a) {
82
+ // Block comment: replaced by its own newlines plus one space; an
83
+ // unterminated one runs to the end of input and gets no space.
84
+ copy(i);
85
+ i += 2;
86
+ let newlines = 0;
87
+ let closed = false;
88
+ while (i < N) {
89
+ const bc = src.charCodeAt(i);
90
+ if (bc === NEWLINE)
91
+ newlines++;
92
+ else if (bc === 0x2a && src.charCodeAt(i + 1) === 0x2f) {
93
+ i += 2;
94
+ closed = true;
95
+ break;
96
+ }
97
+ i++;
98
+ }
99
+ if (newlines > 0)
100
+ parts.push('\n'.repeat(newlines));
101
+ if (closed)
102
+ emit(' ');
103
+ spanStart = i;
104
+ continue;
105
+ }
106
+ // Regex literal when the previous non-ws char can't end a value.
107
+ if (!DIVISION_AFTER.test(lastNonWs)) {
108
+ // A regex needs its closing `/` on the same line; without one the
109
+ // slash is division (or a lone `/`), and treating the rest of the
110
+ // line as a literal would drop real code — imports included.
111
+ let j = i + 1;
112
+ let closes = false;
113
+ while (j < N) {
114
+ const rc = src.charCodeAt(j);
115
+ if (rc === 0x5c) {
116
+ j += 2;
117
+ continue;
118
+ }
119
+ if (rc === 0x5b) {
120
+ j++;
121
+ while (j < N && src.charCodeAt(j) !== 0x5d) {
122
+ if (src.charCodeAt(j) === 0x5c) {
123
+ j += 2;
124
+ continue;
125
+ }
126
+ j++;
127
+ }
128
+ if (j < N)
129
+ j++;
130
+ continue;
131
+ }
132
+ if (rc === 0x2f) {
133
+ closes = true;
134
+ break;
135
+ }
136
+ if (rc === NEWLINE)
137
+ break;
138
+ j++;
139
+ }
140
+ if (!closes) {
141
+ step();
142
+ continue;
143
+ }
144
+ copy(i);
145
+ emit(' ');
68
146
  i++;
69
- spanStart = i;
147
+ while (i < N) {
148
+ const rc = src.charCodeAt(i);
149
+ if (rc === 0x5c) {
150
+ i += 2;
151
+ continue;
152
+ }
153
+ if (rc === 0x5b) {
154
+ // Character class: `/` inside it is content.
155
+ i++;
156
+ while (i < N && src.charCodeAt(i) !== 0x5d) {
157
+ if (src.charCodeAt(i) === 0x5c) {
158
+ i += 2;
159
+ continue;
160
+ }
161
+ i++;
162
+ }
163
+ if (i < N)
164
+ i++;
165
+ continue;
166
+ }
167
+ if (rc === 0x2f) {
168
+ i++;
169
+ break;
170
+ }
171
+ i++;
172
+ }
173
+ // Flags: g, i, m, s, u, y, d.
174
+ while (i < N && /[gimsuyd]/.test(src[i]))
175
+ i++;
176
+ record('/');
177
+ spanStart = i;
178
+ continue;
179
+ }
180
+ // Division or a lone slash — plain source.
181
+ step();
70
182
  continue;
71
183
  }
72
- // Block comment: `/*` to `*/`, replaced by its own newlines (so line
73
- // numbers stay aligned) and one space. An unterminated one runs to
74
- // the end of input and gets no closing space.
75
- if (next === STAR) {
76
- parts.push(src.slice(spanStart, i));
77
- i += 2;
78
- let newlines = 0;
79
- let closed = false;
184
+ const ch = src[i];
185
+ if (ch === '"' || ch === "'" || ch === '`') {
186
+ if (literals === 'keep') {
187
+ i++;
188
+ while (i < N) {
189
+ const cc = src[i];
190
+ if (cc === '\\') {
191
+ i += 2;
192
+ continue;
193
+ }
194
+ if (cc === ch) {
195
+ i++;
196
+ break;
197
+ }
198
+ i++;
199
+ }
200
+ // The literal ends a value: a following `/` is division.
201
+ record(ch);
202
+ continue;
203
+ }
204
+ // blank: the delimiters and content become one space; a template's
205
+ // `${…}` interpolation keeps its expression as code.
206
+ copy(i);
207
+ emit(' ');
208
+ i++;
80
209
  while (i < N) {
81
- const c = src.charCodeAt(i);
82
- if (c === NEWLINE)
83
- newlines++;
84
- else if (c === STAR && src.charCodeAt(i + 1) === SLASH) {
210
+ const cc = src[i];
211
+ if (cc === '\\') {
85
212
  i += 2;
86
- closed = true;
213
+ continue;
214
+ }
215
+ if (cc === ch) {
216
+ i++;
87
217
  break;
88
218
  }
219
+ if (ch === '`' && cc === '$' && src[i + 1] === '{') {
220
+ emit('${');
221
+ i += 2;
222
+ let depth = 1;
223
+ while (i < N && depth > 0) {
224
+ const ic = src[i];
225
+ // Nested string inside the interpolation: blank its content
226
+ // so a `}` inside it doesn't drop the depth early.
227
+ if (ic === '"' || ic === "'" || ic === '`') {
228
+ const iq = ic;
229
+ emit(' ');
230
+ i++;
231
+ while (i < N) {
232
+ const icc = src[i];
233
+ if (icc === '\\') {
234
+ i += 2;
235
+ continue;
236
+ }
237
+ if (icc === iq) {
238
+ i++;
239
+ break;
240
+ }
241
+ // A nested template's own ${…} recurses once more —
242
+ // deeper nesting falls back to brace counting.
243
+ if (iq === '`' && icc === '$' && src[i + 1] === '{') {
244
+ emit('${');
245
+ i += 2;
246
+ let d2 = 1;
247
+ while (i < N && d2 > 0) {
248
+ const i2 = src[i];
249
+ if (i2 === '{')
250
+ d2++;
251
+ else if (i2 === '}')
252
+ d2--;
253
+ if (d2 > 0)
254
+ emit(i2);
255
+ i++;
256
+ }
257
+ emit('}');
258
+ continue;
259
+ }
260
+ if (icc === '\n')
261
+ emit('\n');
262
+ i++;
263
+ }
264
+ continue;
265
+ }
266
+ if (ic === '{')
267
+ depth++;
268
+ else if (ic === '}')
269
+ depth--;
270
+ if (depth > 0)
271
+ emit(ic);
272
+ i++;
273
+ }
274
+ emit('}');
275
+ continue;
276
+ }
277
+ if (cc === '\n')
278
+ emit('\n');
89
279
  i++;
90
280
  }
91
- if (newlines > 0)
92
- parts.push('\n'.repeat(newlines));
93
- if (closed)
94
- parts.push(' ');
95
281
  spanStart = i;
96
282
  continue;
97
283
  }
98
- i++;
284
+ step();
99
285
  }
100
- parts.push(src.slice(spanStart));
286
+ copy(N);
101
287
  return parts.join('');
102
288
  }
289
+ /**
290
+ * Strip comments for import/require detection. Literals are kept: the
291
+ * specifier the regexes extract lives inside a string, and a comment
292
+ * marker inside a string must not swallow the code that follows it.
293
+ */
294
+ export function stripCommentsForImports(src) {
295
+ return scanJsSource(src, 'keep');
296
+ }
@@ -71,6 +71,7 @@ export interface CPythonFacetResult {
71
71
  * that has none does not get a degraded version — it gets none, and says so.
72
72
  */
73
73
  export type CPythonResidentStart = (spawn: {
74
+ argv: string[];
74
75
  /** VFS path of the interpreter. By path, not by value: it is 10.6 MiB. */
75
76
  wasmVfsPath: string;
76
77
  startArgs: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"cpython-runner.d.ts","sourceRoot":"","sources":["../../src/runtime/cpython-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAkB,MAAM,qCAAqC,CAAC;AAEnF,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAKvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AASjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAsB7D;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAM7C;AAkFD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM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,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsCD;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE;IACzC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElC,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,MAAM,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,SAAS,CAAC;IACf,iFAAiF;IACjF,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,KAC7F,OAAO,CAkQV"}
@@ -391,7 +391,7 @@ export function makeCPythonRunnerFactory(deps) {
391
391
  return 1;
392
392
  }
393
393
  const command = [binName, ...argv].map((part) => (/^[A-Za-z0-9_./:=@+-]+$/.test(part) ? part : JSON.stringify(part))).join(' ');
394
- const spawnResult = await deps.startResident({ wasmVfsPath: wasmVfs, startArgs: facetArgs, cwd, command });
394
+ const spawnResult = await deps.startResident({ wasmVfsPath: wasmVfs, startArgs: facetArgs, cwd, command, argv: [binName, ...argv] });
395
395
  if (spawnResult.stdout)
396
396
  ctx.stdout.write(spawnResult.stdout);
397
397
  if (spawnResult.stderr)
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild-service.d.ts","sourceRoot":"","sources":["../../src/runtime/esbuild-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAa5D;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