tywrap 0.5.1 → 0.6.1

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 (178) hide show
  1. package/dist/cli.js +8 -6
  2. package/dist/cli.js.map +1 -1
  3. package/dist/config/index.d.ts.map +1 -1
  4. package/dist/config/index.js +236 -147
  5. package/dist/config/index.js.map +1 -1
  6. package/dist/core/annotation-parser.d.ts.map +1 -1
  7. package/dist/core/annotation-parser.js +112 -97
  8. package/dist/core/annotation-parser.js.map +1 -1
  9. package/dist/core/discovery.d.ts +17 -0
  10. package/dist/core/discovery.d.ts.map +1 -1
  11. package/dist/core/discovery.js +85 -49
  12. package/dist/core/discovery.js.map +1 -1
  13. package/dist/core/emit-call.d.ts +58 -0
  14. package/dist/core/emit-call.d.ts.map +1 -0
  15. package/dist/core/emit-call.js +103 -0
  16. package/dist/core/emit-call.js.map +1 -0
  17. package/dist/core/generator.d.ts +2 -0
  18. package/dist/core/generator.d.ts.map +1 -1
  19. package/dist/core/generator.js +54 -211
  20. package/dist/core/generator.js.map +1 -1
  21. package/dist/core/mapper.d.ts.map +1 -1
  22. package/dist/core/mapper.js +118 -104
  23. package/dist/core/mapper.js.map +1 -1
  24. package/dist/core/validation.d.ts +23 -0
  25. package/dist/core/validation.d.ts.map +1 -1
  26. package/dist/core/validation.js +52 -48
  27. package/dist/core/validation.js.map +1 -1
  28. package/dist/dev.d.ts.map +1 -1
  29. package/dist/dev.js +175 -133
  30. package/dist/dev.js.map +1 -1
  31. package/dist/index.d.ts +6 -25
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +9 -31
  34. package/dist/index.js.map +1 -1
  35. package/dist/runtime/bounded-context.d.ts +2 -2
  36. package/dist/runtime/bounded-context.js +2 -2
  37. package/dist/runtime/{safe-codec.d.ts → bridge-codec.d.ts} +26 -11
  38. package/dist/runtime/bridge-codec.d.ts.map +1 -0
  39. package/dist/runtime/{safe-codec.js → bridge-codec.js} +69 -72
  40. package/dist/runtime/bridge-codec.js.map +1 -0
  41. package/dist/runtime/{http-io.d.ts → http-transport.d.ts} +6 -6
  42. package/dist/runtime/http-transport.d.ts.map +1 -0
  43. package/dist/runtime/{http-io.js → http-transport.js} +3 -3
  44. package/dist/runtime/http-transport.js.map +1 -0
  45. package/dist/runtime/http.d.ts +3 -3
  46. package/dist/runtime/http.d.ts.map +1 -1
  47. package/dist/runtime/http.js +4 -4
  48. package/dist/runtime/http.js.map +1 -1
  49. package/dist/runtime/index.d.ts +9 -1
  50. package/dist/runtime/index.d.ts.map +1 -1
  51. package/dist/runtime/index.js +9 -1
  52. package/dist/runtime/index.js.map +1 -1
  53. package/dist/runtime/node.d.ts +6 -6
  54. package/dist/runtime/node.d.ts.map +1 -1
  55. package/dist/runtime/node.js +7 -7
  56. package/dist/runtime/node.js.map +1 -1
  57. package/dist/runtime/pooled-transport.d.ts +11 -11
  58. package/dist/runtime/pooled-transport.d.ts.map +1 -1
  59. package/dist/runtime/pooled-transport.js +10 -10
  60. package/dist/runtime/pooled-transport.js.map +1 -1
  61. package/dist/runtime/pyodide-bootstrap-core.generated.d.ts.map +1 -1
  62. package/dist/runtime/pyodide-bootstrap-core.generated.js +1 -1
  63. package/dist/runtime/pyodide-bootstrap-core.generated.js.map +1 -1
  64. package/dist/runtime/{pyodide-io.d.ts → pyodide-transport.d.ts} +8 -8
  65. package/dist/runtime/pyodide-transport.d.ts.map +1 -0
  66. package/dist/runtime/{pyodide-io.js → pyodide-transport.js} +5 -5
  67. package/dist/runtime/pyodide-transport.js.map +1 -0
  68. package/dist/runtime/pyodide.d.ts +3 -3
  69. package/dist/runtime/pyodide.d.ts.map +1 -1
  70. package/dist/runtime/pyodide.js +5 -5
  71. package/dist/runtime/pyodide.js.map +1 -1
  72. package/dist/runtime/rpc-client.d.ts +23 -5
  73. package/dist/runtime/rpc-client.d.ts.map +1 -1
  74. package/dist/runtime/rpc-client.js +36 -31
  75. package/dist/runtime/rpc-client.js.map +1 -1
  76. package/dist/runtime/{process-io.d.ts → subprocess-transport.d.ts} +25 -9
  77. package/dist/runtime/subprocess-transport.d.ts.map +1 -0
  78. package/dist/runtime/{process-io.js → subprocess-transport.js} +60 -41
  79. package/dist/runtime/subprocess-transport.js.map +1 -0
  80. package/dist/runtime/{worker-pool.d.ts → transport-pool.d.ts} +15 -15
  81. package/dist/runtime/transport-pool.d.ts.map +1 -0
  82. package/dist/runtime/{worker-pool.js → transport-pool.js} +6 -6
  83. package/dist/runtime/transport-pool.js.map +1 -0
  84. package/dist/runtime/transport.d.ts +14 -8
  85. package/dist/runtime/transport.d.ts.map +1 -1
  86. package/dist/runtime/transport.js +10 -4
  87. package/dist/runtime/transport.js.map +1 -1
  88. package/dist/types/index.d.ts +10 -1
  89. package/dist/types/index.d.ts.map +1 -1
  90. package/dist/tywrap.d.ts +0 -5
  91. package/dist/tywrap.d.ts.map +1 -1
  92. package/dist/tywrap.js +0 -20
  93. package/dist/tywrap.js.map +1 -1
  94. package/dist/utils/cache.d.ts +13 -2
  95. package/dist/utils/cache.d.ts.map +1 -1
  96. package/dist/utils/cache.js +52 -60
  97. package/dist/utils/cache.js.map +1 -1
  98. package/dist/utils/codec.d.ts +1 -1
  99. package/dist/utils/codec.d.ts.map +1 -1
  100. package/dist/utils/codec.js +181 -182
  101. package/dist/utils/codec.js.map +1 -1
  102. package/dist/utils/python.d.ts.map +1 -1
  103. package/dist/utils/python.js +28 -17
  104. package/dist/utils/python.js.map +1 -1
  105. package/dist/utils/runtime.d.ts.map +1 -1
  106. package/dist/utils/runtime.js +22 -16
  107. package/dist/utils/runtime.js.map +1 -1
  108. package/dist/version.d.ts +12 -0
  109. package/dist/version.d.ts.map +1 -0
  110. package/dist/version.js +12 -0
  111. package/dist/version.js.map +1 -0
  112. package/package.json +3 -2
  113. package/runtime/__pycache__/safe_codec.cpython-311.pyc +0 -0
  114. package/runtime/__pycache__/tywrap_bridge_core.cpython-311.pyc +0 -0
  115. package/runtime/python_bridge.py +54 -6
  116. package/runtime/safe_codec.py +8 -8
  117. package/runtime/tywrap_bridge_core.py +159 -23
  118. package/src/cli.ts +8 -12
  119. package/src/config/index.ts +271 -165
  120. package/src/core/annotation-parser.ts +135 -123
  121. package/src/core/discovery.ts +102 -54
  122. package/src/core/emit-call.ts +171 -0
  123. package/src/core/generator.ts +67 -263
  124. package/src/core/mapper.ts +125 -110
  125. package/src/core/validation.ts +84 -48
  126. package/src/dev.ts +237 -153
  127. package/src/index.ts +11 -68
  128. package/src/runtime/bounded-context.ts +2 -2
  129. package/src/runtime/{safe-codec.ts → bridge-codec.ts} +83 -95
  130. package/src/runtime/{http-io.ts → http-transport.ts} +5 -5
  131. package/src/runtime/http.ts +5 -5
  132. package/src/runtime/index.ts +23 -1
  133. package/src/runtime/node.ts +15 -15
  134. package/src/runtime/pooled-transport.ts +15 -15
  135. package/src/runtime/pyodide-bootstrap-core.generated.ts +1 -1
  136. package/src/runtime/{pyodide-io.ts → pyodide-transport.ts} +7 -7
  137. package/src/runtime/pyodide.ts +6 -6
  138. package/src/runtime/rpc-client.ts +51 -40
  139. package/src/runtime/{process-io.ts → subprocess-transport.ts} +77 -47
  140. package/src/runtime/{worker-pool.ts → transport-pool.ts} +26 -26
  141. package/src/runtime/transport.ts +15 -8
  142. package/src/types/index.ts +10 -1
  143. package/src/tywrap.ts +0 -24
  144. package/src/utils/cache.ts +61 -63
  145. package/src/utils/codec.ts +217 -196
  146. package/src/utils/python.ts +33 -20
  147. package/src/utils/runtime.ts +24 -13
  148. package/src/version.ts +12 -0
  149. package/dist/runtime/http-io.d.ts.map +0 -1
  150. package/dist/runtime/http-io.js.map +0 -1
  151. package/dist/runtime/optimized-node.d.ts +0 -23
  152. package/dist/runtime/optimized-node.d.ts.map +0 -1
  153. package/dist/runtime/optimized-node.js +0 -23
  154. package/dist/runtime/optimized-node.js.map +0 -1
  155. package/dist/runtime/process-io.d.ts.map +0 -1
  156. package/dist/runtime/process-io.js.map +0 -1
  157. package/dist/runtime/protocol.d.ts +0 -3
  158. package/dist/runtime/protocol.d.ts.map +0 -1
  159. package/dist/runtime/protocol.js +0 -3
  160. package/dist/runtime/protocol.js.map +0 -1
  161. package/dist/runtime/pyodide-io.d.ts.map +0 -1
  162. package/dist/runtime/pyodide-io.js.map +0 -1
  163. package/dist/runtime/safe-codec.d.ts.map +0 -1
  164. package/dist/runtime/safe-codec.js.map +0 -1
  165. package/dist/runtime/worker-pool.d.ts.map +0 -1
  166. package/dist/runtime/worker-pool.js.map +0 -1
  167. package/dist/utils/bundle-optimizer.d.ts +0 -182
  168. package/dist/utils/bundle-optimizer.d.ts.map +0 -1
  169. package/dist/utils/bundle-optimizer.js +0 -680
  170. package/dist/utils/bundle-optimizer.js.map +0 -1
  171. package/dist/utils/memory-profiler.d.ts +0 -123
  172. package/dist/utils/memory-profiler.d.ts.map +0 -1
  173. package/dist/utils/memory-profiler.js +0 -426
  174. package/dist/utils/memory-profiler.js.map +0 -1
  175. package/src/runtime/optimized-node.ts +0 -25
  176. package/src/runtime/protocol.ts +0 -2
  177. package/src/utils/bundle-optimizer.ts +0 -876
  178. package/src/utils/memory-profiler.ts +0 -582
@@ -40,7 +40,7 @@ export interface SklearnEstimator {
40
40
  params: Record<string, unknown>;
41
41
  }
42
42
 
43
- export type CodecEnvelope =
43
+ export type ValueEnvelope =
44
44
  | {
45
45
  readonly __tywrap__: 'dataframe';
46
46
  readonly codecVersion?: number;
@@ -337,7 +337,7 @@ function reshapeArray(flat: unknown[], shape: readonly number[]): unknown {
337
337
  // Why: decoding needs to reject incompatible envelopes before we attempt to interpret payloads.
338
338
  const CODEC_VERSION = 1;
339
339
 
340
- function assertCodecVersion(envelope: { codecVersion?: unknown }, marker: string): void {
340
+ function assertCodecVersion(envelope: { codecVersion?: unknown }, typeTag: string): void {
341
341
  if (!('codecVersion' in envelope)) {
342
342
  return;
343
343
  }
@@ -346,235 +346,256 @@ function assertCodecVersion(envelope: { codecVersion?: unknown }, marker: string
346
346
  return;
347
347
  }
348
348
  if (typeof version !== 'number' || !Number.isFinite(version)) {
349
- throw new Error(`Invalid ${marker} envelope: codecVersion must be a number`);
349
+ throw new Error(`Invalid ${typeTag} envelope: codecVersion must be a number`);
350
350
  }
351
351
  if (version !== CODEC_VERSION) {
352
- throw new Error(`Unsupported ${marker} envelope codecVersion: ${version}`);
352
+ throw new Error(`Unsupported ${typeTag} envelope codecVersion: ${version}`);
353
353
  }
354
354
  }
355
355
 
356
- function decodeEnvelopeCore<T>(
357
- value: unknown,
356
+ /**
357
+ * Per-typeTag decode handler.
358
+ *
359
+ * Why: each scientific value envelope type (dataframe, series, ndarray, scipy.sparse,
360
+ * torch.tensor, sklearn.estimator) has its own validation and decode logic. Splitting
361
+ * the dispatch into one handler per type keeps each branch focused and testable while
362
+ * preserving byte-identical decoded output.
363
+ */
364
+ type EnvelopeHandler = <T>(
365
+ value: { [k: string]: unknown },
358
366
  decodeArrow: (bytes: Uint8Array) => MaybePromise<T>,
359
367
  recurse: (value: unknown) => MaybePromise<T | unknown>
360
- ): MaybePromise<T | unknown> {
361
- if (!isObject(value)) {
362
- return value;
363
- }
364
- const marker = (value as { __tywrap__?: unknown }).__tywrap__;
365
- if (typeof marker !== 'string') {
366
- return value as unknown;
367
- }
368
+ ) => MaybePromise<T | unknown>;
368
369
 
369
- if (
370
- marker === 'dataframe' ||
371
- marker === 'series' ||
372
- marker === 'ndarray' ||
373
- marker === 'scipy.sparse' ||
374
- marker === 'torch.tensor' ||
375
- marker === 'sklearn.estimator'
376
- ) {
377
- assertCodecVersion(value as { codecVersion?: unknown }, marker);
378
- }
379
-
380
- if (marker === 'dataframe') {
381
- const encoding = (value as { encoding?: unknown }).encoding;
382
- if (encoding === 'arrow') {
383
- const b64 = (value as { b64?: unknown }).b64;
384
- if (typeof b64 !== 'string') {
385
- throw new Error('Invalid dataframe envelope: missing b64');
386
- }
387
- const bytes = fromBase64(b64);
388
- return decodeArrow(bytes);
389
- }
390
- if (encoding === 'json') {
391
- if (!('data' in (value as object))) {
392
- throw new Error('Invalid dataframe envelope: missing data');
393
- }
394
- return (value as { data: unknown }).data;
370
+ /**
371
+ * Decode an Arrow-or-JSON envelope (dataframe / series).
372
+ *
373
+ * Why: dataframe and series share identical arrow/json handling; the only difference
374
+ * is the typeTag name used in error messages.
375
+ */
376
+ function decodeArrowOrJsonEnvelope<T>(
377
+ value: { [k: string]: unknown },
378
+ decodeArrow: (bytes: Uint8Array) => MaybePromise<T>,
379
+ typeTag: string
380
+ ): MaybePromise<T | unknown> {
381
+ const encoding = value.encoding;
382
+ if (encoding === 'arrow') {
383
+ const b64 = value.b64;
384
+ if (typeof b64 !== 'string') {
385
+ throw new Error(`Invalid ${typeTag} envelope: missing b64`);
395
386
  }
396
- throw new Error(`Invalid dataframe envelope: unsupported encoding ${String(encoding)}`);
387
+ const bytes = fromBase64(b64);
388
+ return decodeArrow(bytes);
397
389
  }
398
-
399
- if (marker === 'series') {
400
- const encoding = (value as { encoding?: unknown }).encoding;
401
- if (encoding === 'arrow') {
402
- const b64 = (value as { b64?: unknown }).b64;
403
- if (typeof b64 !== 'string') {
404
- throw new Error('Invalid series envelope: missing b64');
405
- }
406
- const bytes = fromBase64(b64);
407
- return decodeArrow(bytes);
390
+ if (encoding === 'json') {
391
+ if (!('data' in value)) {
392
+ throw new Error(`Invalid ${typeTag} envelope: missing data`);
408
393
  }
409
- if (encoding === 'json') {
410
- if (!('data' in (value as object))) {
411
- throw new Error('Invalid series envelope: missing data');
412
- }
413
- return (value as { data: unknown }).data;
414
- }
415
- throw new Error(`Invalid series envelope: unsupported encoding ${String(encoding)}`);
394
+ return value.data;
416
395
  }
396
+ throw new Error(`Invalid ${typeTag} envelope: unsupported encoding ${String(encoding)}`);
397
+ }
417
398
 
418
- if (marker === 'ndarray') {
419
- const encoding = (value as { encoding?: unknown }).encoding;
420
- const shapeValue = (value as { shape?: unknown }).shape;
421
- const shape = isNumberArray(shapeValue) ? shapeValue : undefined;
399
+ const decodeDataframeEnvelope: EnvelopeHandler = (value, decodeArrow) =>
400
+ decodeArrowOrJsonEnvelope(value, decodeArrow, 'dataframe');
422
401
 
423
- if (encoding === 'arrow') {
424
- const b64 = (value as { b64?: unknown }).b64;
425
- if (typeof b64 !== 'string') {
426
- throw new Error('Invalid ndarray envelope: missing b64');
427
- }
428
- const bytes = fromBase64(b64);
429
- const decoded = decodeArrow(bytes);
430
-
431
- // Extract values from Arrow table and reshape if needed
432
- // Arrow only handles 1D arrays, so we flatten on encode and reshape here
433
- // Reshape for: scalars (shape.length === 0) and multi-dim (shape.length > 1)
434
- // Skip reshape for: 1D arrays (shape.length === 1) - return as-is
435
- if (isPromiseLike(decoded)) {
436
- return decoded.then(data => {
437
- const values = extractArrowValues(data);
438
- if (!values) {
439
- return data; // Fallback: return raw data if extraction fails
440
- }
441
- // Reshape scalars and multi-dimensional arrays, but not 1D
442
- if (shape && shape.length !== 1) {
443
- return reshapeArray(values, shape);
444
- }
445
- return values;
446
- });
447
- }
448
- const values = extractArrowValues(decoded);
449
- if (!values) {
450
- return decoded; // Fallback: return raw data if extraction fails
451
- }
452
- // Reshape scalars and multi-dimensional arrays, but not 1D
453
- if (shape && shape.length !== 1) {
454
- return reshapeArray(values, shape);
455
- }
456
- return values;
457
- }
458
- if (encoding === 'json') {
459
- if (!('data' in (value as object))) {
460
- throw new Error('Invalid ndarray envelope: missing data');
461
- }
462
- return (value as { data: unknown }).data;
463
- }
464
- throw new Error(`Invalid ndarray envelope: unsupported encoding ${String(encoding)}`);
465
- }
402
+ const decodeSeriesEnvelope: EnvelopeHandler = (value, decodeArrow) =>
403
+ decodeArrowOrJsonEnvelope(value, decodeArrow, 'series');
466
404
 
467
- if (marker === 'scipy.sparse') {
468
- const encoding = (value as { encoding?: unknown }).encoding;
469
- if (encoding !== 'json') {
470
- throw new Error(`Invalid scipy.sparse envelope: unsupported encoding ${String(encoding)}`);
405
+ const decodeNdarrayEnvelope: EnvelopeHandler = (value, decodeArrow) => {
406
+ const encoding = value.encoding;
407
+ const shapeValue = value.shape;
408
+ const shape = isNumberArray(shapeValue) ? shapeValue : undefined;
409
+
410
+ if (encoding === 'arrow') {
411
+ const b64 = value.b64;
412
+ if (typeof b64 !== 'string') {
413
+ throw new Error('Invalid ndarray envelope: missing b64');
471
414
  }
472
- const format = (value as { format?: unknown }).format;
473
- if (format !== 'csr' && format !== 'csc' && format !== 'coo') {
474
- throw new Error(`Invalid scipy.sparse envelope: unsupported format ${String(format)}`);
415
+ const bytes = fromBase64(b64);
416
+ const decoded = decodeArrow(bytes);
417
+
418
+ // Extract values from Arrow table and reshape if needed
419
+ // Arrow only handles 1D arrays, so we flatten on encode and reshape here
420
+ // Reshape for: scalars (shape.length === 0) and multi-dim (shape.length > 1)
421
+ // Skip reshape for: 1D arrays (shape.length === 1) - return as-is
422
+ if (isPromiseLike(decoded)) {
423
+ return decoded.then(data => {
424
+ const values = extractArrowValues(data);
425
+ if (!values) {
426
+ return data; // Fallback: return raw data if extraction fails
427
+ }
428
+ // Reshape scalars and multi-dimensional arrays, but not 1D
429
+ if (shape && shape.length !== 1) {
430
+ return reshapeArray(values, shape);
431
+ }
432
+ return values;
433
+ });
475
434
  }
476
- const shape = (value as { shape?: unknown }).shape;
477
- if (
478
- !Array.isArray(shape) ||
479
- shape.length !== 2 ||
480
- typeof shape[0] !== 'number' ||
481
- typeof shape[1] !== 'number'
482
- ) {
483
- throw new Error('Invalid scipy.sparse envelope: shape must be a 2-item number[]');
435
+ const values = extractArrowValues(decoded);
436
+ if (!values) {
437
+ return decoded; // Fallback: return raw data if extraction fails
484
438
  }
485
- const data = (value as { data?: unknown }).data;
486
- if (!Array.isArray(data)) {
487
- throw new Error('Invalid scipy.sparse envelope: data must be an array');
439
+ // Reshape scalars and multi-dimensional arrays, but not 1D
440
+ if (shape && shape.length !== 1) {
441
+ return reshapeArray(values, shape);
488
442
  }
489
- const dtypeValue = (value as { dtype?: unknown }).dtype;
490
- const dtype = typeof dtypeValue === 'string' ? dtypeValue : undefined;
491
-
492
- if (format === 'coo') {
493
- const row = (value as { row?: unknown }).row;
494
- const col = (value as { col?: unknown }).col;
495
- if (!Array.isArray(row) || !Array.isArray(col)) {
496
- throw new Error('Invalid scipy.sparse envelope: coo requires row and col arrays');
497
- }
498
- return {
499
- format,
500
- shape,
501
- data,
502
- row,
503
- col,
504
- dtype,
505
- } satisfies SparseMatrix;
443
+ return values;
444
+ }
445
+ if (encoding === 'json') {
446
+ if (!('data' in value)) {
447
+ throw new Error('Invalid ndarray envelope: missing data');
506
448
  }
449
+ return value.data;
450
+ }
451
+ throw new Error(`Invalid ndarray envelope: unsupported encoding ${String(encoding)}`);
452
+ };
507
453
 
508
- const indices = (value as { indices?: unknown }).indices;
509
- const indptr = (value as { indptr?: unknown }).indptr;
510
- if (!Array.isArray(indices) || !Array.isArray(indptr)) {
511
- throw new Error('Invalid scipy.sparse envelope: csr/csc requires indices and indptr arrays');
454
+ const decodeScipySparseEnvelope: EnvelopeHandler = value => {
455
+ const encoding = value.encoding;
456
+ if (encoding !== 'json') {
457
+ throw new Error(`Invalid scipy.sparse envelope: unsupported encoding ${String(encoding)}`);
458
+ }
459
+ const format = value.format;
460
+ if (format !== 'csr' && format !== 'csc' && format !== 'coo') {
461
+ throw new Error(`Invalid scipy.sparse envelope: unsupported format ${String(format)}`);
462
+ }
463
+ const shape = value.shape;
464
+ if (
465
+ !Array.isArray(shape) ||
466
+ shape.length !== 2 ||
467
+ typeof shape[0] !== 'number' ||
468
+ typeof shape[1] !== 'number'
469
+ ) {
470
+ throw new Error('Invalid scipy.sparse envelope: shape must be a 2-item number[]');
471
+ }
472
+ const data = value.data;
473
+ if (!Array.isArray(data)) {
474
+ throw new Error('Invalid scipy.sparse envelope: data must be an array');
475
+ }
476
+ const dtypeValue = value.dtype;
477
+ const dtype = typeof dtypeValue === 'string' ? dtypeValue : undefined;
478
+
479
+ if (format === 'coo') {
480
+ const row = value.row;
481
+ const col = value.col;
482
+ if (!Array.isArray(row) || !Array.isArray(col)) {
483
+ throw new Error('Invalid scipy.sparse envelope: coo requires row and col arrays');
512
484
  }
513
485
  return {
514
486
  format,
515
487
  shape,
516
488
  data,
517
- indices,
518
- indptr,
489
+ row,
490
+ col,
519
491
  dtype,
520
492
  } satisfies SparseMatrix;
521
493
  }
522
494
 
523
- if (marker === 'torch.tensor') {
524
- const encoding = (value as { encoding?: unknown }).encoding;
525
- if (encoding !== 'ndarray') {
526
- throw new Error(`Invalid torch.tensor envelope: unsupported encoding ${String(encoding)}`);
527
- }
528
- if (!('value' in (value as object))) {
529
- throw new Error('Invalid torch.tensor envelope: missing value');
530
- }
531
- const nested = (value as { value: unknown }).value;
532
- if (!isObject(nested) || (nested as { __tywrap__?: unknown }).__tywrap__ !== 'ndarray') {
533
- throw new Error('Invalid torch.tensor envelope: value must be an ndarray envelope');
534
- }
535
- const decoded = recurse(nested);
536
- const shapeValue = (value as { shape?: unknown }).shape;
537
- const shape = isNumberArray(shapeValue) ? shapeValue : undefined;
538
- const dtypeValue = (value as { dtype?: unknown }).dtype;
539
- const dtype = typeof dtypeValue === 'string' ? dtypeValue : undefined;
540
- const deviceValue = (value as { device?: unknown }).device;
541
- const device = typeof deviceValue === 'string' ? deviceValue : undefined;
495
+ const indices = value.indices;
496
+ const indptr = value.indptr;
497
+ if (!Array.isArray(indices) || !Array.isArray(indptr)) {
498
+ throw new Error('Invalid scipy.sparse envelope: csr/csc requires indices and indptr arrays');
499
+ }
500
+ return {
501
+ format,
502
+ shape,
503
+ data,
504
+ indices,
505
+ indptr,
506
+ dtype,
507
+ } satisfies SparseMatrix;
508
+ };
509
+
510
+ const decodeTorchTensorEnvelope: EnvelopeHandler = <T>(
511
+ value: { [k: string]: unknown },
512
+ _decodeArrow: (bytes: Uint8Array) => MaybePromise<T>,
513
+ recurse: (value: unknown) => MaybePromise<T | unknown>
514
+ ): MaybePromise<T | unknown> => {
515
+ const encoding = value.encoding;
516
+ if (encoding !== 'ndarray') {
517
+ throw new Error(`Invalid torch.tensor envelope: unsupported encoding ${String(encoding)}`);
518
+ }
519
+ if (!('value' in value)) {
520
+ throw new Error('Invalid torch.tensor envelope: missing value');
521
+ }
522
+ const nested = value.value;
523
+ if (!isObject(nested) || (nested as { __tywrap__?: unknown }).__tywrap__ !== 'ndarray') {
524
+ throw new Error('Invalid torch.tensor envelope: value must be an ndarray envelope');
525
+ }
526
+ const decoded = recurse(nested);
527
+ const shapeValue = value.shape;
528
+ const shape = isNumberArray(shapeValue) ? shapeValue : undefined;
529
+ const dtypeValue = value.dtype;
530
+ const dtype = typeof dtypeValue === 'string' ? dtypeValue : undefined;
531
+ const deviceValue = value.device;
532
+ const device = typeof deviceValue === 'string' ? deviceValue : undefined;
542
533
 
543
- if (isPromiseLike(decoded)) {
544
- return decoded.then(data => ({ data, shape, dtype, device })) as Promise<T | unknown>;
545
- }
546
- return { data: decoded, shape, dtype, device } satisfies TorchTensor;
534
+ if (isPromiseLike(decoded)) {
535
+ return decoded.then(data => ({ data, shape, dtype, device })) as Promise<T | unknown>;
547
536
  }
537
+ return { data: decoded, shape, dtype, device } satisfies TorchTensor;
538
+ };
548
539
 
549
- if (marker === 'sklearn.estimator') {
550
- const encoding = (value as { encoding?: unknown }).encoding;
551
- if (encoding !== 'json') {
552
- throw new Error(
553
- `Invalid sklearn.estimator envelope: unsupported encoding ${String(encoding)}`
554
- );
555
- }
556
- const className = (value as { className?: unknown }).className;
557
- const module = (value as { module?: unknown }).module;
558
- const params = (value as { params?: unknown }).params;
559
- if (typeof className !== 'string' || typeof module !== 'string' || !isObject(params)) {
560
- throw new Error(
561
- 'Invalid sklearn.estimator envelope: expected className/module strings + params object'
562
- );
563
- }
564
- const versionValue = (value as { version?: unknown }).version;
565
- if (versionValue !== undefined && typeof versionValue !== 'string') {
566
- throw new Error('Invalid sklearn.estimator envelope: version must be a string when provided');
567
- }
568
- const version = typeof versionValue === 'string' ? versionValue : undefined;
569
- return {
570
- className,
571
- module,
572
- version,
573
- params,
574
- } satisfies SklearnEstimator;
540
+ const decodeSklearnEstimatorEnvelope: EnvelopeHandler = value => {
541
+ const encoding = value.encoding;
542
+ if (encoding !== 'json') {
543
+ throw new Error(`Invalid sklearn.estimator envelope: unsupported encoding ${String(encoding)}`);
544
+ }
545
+ const className = value.className;
546
+ const module = value.module;
547
+ const params = value.params;
548
+ if (typeof className !== 'string' || typeof module !== 'string' || !isObject(params)) {
549
+ throw new Error(
550
+ 'Invalid sklearn.estimator envelope: expected className/module strings + params object'
551
+ );
552
+ }
553
+ const versionValue = value.version;
554
+ if (versionValue !== undefined && typeof versionValue !== 'string') {
555
+ throw new Error('Invalid sklearn.estimator envelope: version must be a string when provided');
556
+ }
557
+ const version = typeof versionValue === 'string' ? versionValue : undefined;
558
+ return {
559
+ className,
560
+ module,
561
+ version,
562
+ params,
563
+ } satisfies SklearnEstimator;
564
+ };
565
+
566
+ // Why: dispatch over the __tywrap__ typeTag instead of a long if-chain so each type's
567
+ // decode logic lives in one focused handler. The typeTag strings are the on-the-wire keys
568
+ // emitted by the Python bridge and MUST stay byte-identical. A Map keyed by the typeTag
569
+ // avoids prototype-chain lookups when dispatching on attacker-controlled typeTag strings.
570
+ const ENVELOPE_HANDLERS: ReadonlyMap<string, EnvelopeHandler> = new Map([
571
+ ['dataframe', decodeDataframeEnvelope],
572
+ ['series', decodeSeriesEnvelope],
573
+ ['ndarray', decodeNdarrayEnvelope],
574
+ ['scipy.sparse', decodeScipySparseEnvelope],
575
+ ['torch.tensor', decodeTorchTensorEnvelope],
576
+ ['sklearn.estimator', decodeSklearnEstimatorEnvelope],
577
+ ]);
578
+
579
+ function decodeEnvelopeCore<T>(
580
+ value: unknown,
581
+ decodeArrow: (bytes: Uint8Array) => MaybePromise<T>,
582
+ recurse: (value: unknown) => MaybePromise<T | unknown>
583
+ ): MaybePromise<T | unknown> {
584
+ if (!isObject(value)) {
585
+ return value;
586
+ }
587
+ const typeTag = (value as { __tywrap__?: unknown }).__tywrap__;
588
+ if (typeof typeTag !== 'string') {
589
+ return value as unknown;
590
+ }
591
+
592
+ const handler = ENVELOPE_HANDLERS.get(typeTag);
593
+ if (!handler) {
594
+ return value as unknown;
575
595
  }
576
596
 
577
- return value as unknown;
597
+ assertCodecVersion(value as { codecVersion?: unknown }, typeTag);
598
+ return handler(value, decodeArrow, recurse);
578
599
  }
579
600
 
580
601
  function decodeEnvelope<T>(value: unknown, decodeArrow: (bytes: Uint8Array) => T): T | unknown {
@@ -44,30 +44,43 @@ export function getDefaultPythonPath(): string {
44
44
  return getPythonExecutableName();
45
45
  }
46
46
 
47
+ /**
48
+ * Whether the configured pythonPath is the default interpreter (or unset),
49
+ * meaning a virtual environment lookup should take precedence.
50
+ */
51
+ function usesDefaultPython(pythonPath: string | undefined): boolean {
52
+ return !pythonPath || pythonPath === 'python3' || pythonPath === 'python';
53
+ }
54
+
55
+ /**
56
+ * Resolve the Python executable inside a virtual environment, preferring the
57
+ * Node path module when available and falling back to cross-runtime pathUtils.
58
+ */
59
+ async function resolveVenvPython(virtualEnv: string, cwd: string): Promise<string> {
60
+ const binDir = getVenvBinDir();
61
+ const exe = getVenvPythonExe();
62
+ const pathMod = await loadNodePathModule();
63
+
64
+ if (pathMod) {
65
+ const venvRoot = pathMod.resolve(cwd, virtualEnv);
66
+ return pathMod.join(venvRoot, binDir, exe);
67
+ }
68
+
69
+ const venvRoot = isAbsolutePath(virtualEnv)
70
+ ? pathUtils.join(virtualEnv)
71
+ : pathUtils.join(cwd, virtualEnv);
72
+ return pathUtils.join(venvRoot, binDir, exe);
73
+ }
74
+
47
75
  export async function resolvePythonExecutable(options: PythonResolveOptions = {}): Promise<string> {
48
76
  const pythonPath = options.pythonPath?.trim();
49
77
  const virtualEnv = options.virtualEnv?.trim();
50
78
 
51
- if (virtualEnv) {
52
- const usesDefaultPython = !pythonPath || pythonPath === 'python3' || pythonPath === 'python';
53
- if (usesDefaultPython) {
54
- const cwd =
55
- options.cwd ??
56
- (typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '.');
57
- const binDir = getVenvBinDir();
58
- const exe = getVenvPythonExe();
59
- const pathMod = await loadNodePathModule();
60
-
61
- if (pathMod) {
62
- const venvRoot = pathMod.resolve(cwd, virtualEnv);
63
- return pathMod.join(venvRoot, binDir, exe);
64
- }
65
-
66
- const venvRoot = isAbsolutePath(virtualEnv)
67
- ? pathUtils.join(virtualEnv)
68
- : pathUtils.join(cwd, virtualEnv);
69
- return pathUtils.join(venvRoot, binDir, exe);
70
- }
79
+ if (virtualEnv && usesDefaultPython(pythonPath)) {
80
+ const cwd =
81
+ options.cwd ??
82
+ (typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '.');
83
+ return resolveVenvPython(virtualEnv, cwd);
71
84
  }
72
85
 
73
86
  if (pythonPath) {
@@ -229,26 +229,37 @@ async function loadPathModule(): Promise<PathModule | null> {
229
229
  return null;
230
230
  }
231
231
 
232
+ /**
233
+ * Apply a single path segment to the accumulated normalized segments,
234
+ * resolving '..' and dropping '.'/empty segments in place.
235
+ */
236
+ function applyPathSegment(normalized: string[], segment: string, isAbsolute: boolean): void {
237
+ if (segment === '.' || segment === '') {
238
+ return; // Skip current directory and empty segments
239
+ }
240
+
241
+ if (segment !== '..') {
242
+ normalized.push(segment);
243
+ return;
244
+ }
245
+
246
+ // '..' segment: go up one directory when possible.
247
+ if (normalized.length > 0 && normalized[normalized.length - 1] !== '..') {
248
+ normalized.pop();
249
+ } else if (!isAbsolute) {
250
+ normalized.push(segment); // Keep '..' if not absolute and at root
251
+ }
252
+ }
253
+
232
254
  /**
233
255
  * Normalize path by stripping '.' and resolving '..' components
234
256
  */
235
257
  function normalizePath(path: string): string {
236
258
  const isAbsolute = path.startsWith('/');
237
- const segments = path.split('/');
238
259
  const normalized: string[] = [];
239
260
 
240
- for (const segment of segments) {
241
- if (segment === '.' || segment === '') {
242
- continue; // Skip current directory and empty segments
243
- } else if (segment === '..') {
244
- if (normalized.length > 0 && normalized[normalized.length - 1] !== '..') {
245
- normalized.pop(); // Go up one directory
246
- } else if (!isAbsolute) {
247
- normalized.push(segment); // Keep '..' if not absolute and at root
248
- }
249
- } else {
250
- normalized.push(segment);
251
- }
261
+ for (const segment of path.split('/')) {
262
+ applyPathSegment(normalized, segment, isAbsolute);
252
263
  }
253
264
 
254
265
  const result = normalized.join('/');
package/src/version.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * AUTO-GENERATED — DO NOT EDIT.
3
+ *
4
+ * Source: package.json (version field)
5
+ * Generator: scripts/generate-version.mjs (runs in `npm run build`)
6
+ *
7
+ * Single-sources the package version so the public API can re-export it without
8
+ * importing package.json from outside tsconfig `rootDir`.
9
+ * Regenerate with: node scripts/generate-version.mjs
10
+ */
11
+
12
+ export const VERSION: string = "0.6.1";
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-io.d.ts","sourceRoot":"","sources":["../../src/runtime/http-io.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAEhB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,MAAO,YAAW,SAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;IACjD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,WAAW,CAAS;gBAEhB,OAAO,EAAE,aAAa;IAclC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;OAIG;IACH,IAAI,OAAO,IAAI,OAAO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AAC;YACtF,CAAC;YAED,sBAAsB;YACtB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,MAAM,IAAI,oBAAoB,CAAC,mBAAmB,YAAY,EAAE,EAAE;gBAChE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aAClD,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,mBAAmB;YACnB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,YAAY,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;YAED,oCAAoC;YACpC,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,UAAU;IACV,8EAA8E;IAE9E;;OAEG;IACK,KAAK,CAAC,YAAY,CAAC,QAAkB;QAC3C,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF"}
@@ -1,23 +0,0 @@
1
- /**
2
- * @deprecated Import from './node.js' instead.
3
- *
4
- * Backward-compat shim for older deep imports. NodeBridge is the public API,
5
- * and it now supports both single-process mode (default) and multi-process
6
- * pooling via the minProcesses/maxProcesses options.
7
- *
8
- * Migration:
9
- * ```typescript
10
- * // Before
11
- * import { OptimizedNodeBridge, ProcessPoolOptions } from './optimized-node.js';
12
- * const bridge = new OptimizedNodeBridge({ minProcesses: 2, maxProcesses: 4 });
13
- *
14
- * // After
15
- * import { NodeBridge, NodeBridgeOptions } from './node.js';
16
- * const bridge = new NodeBridge({ minProcesses: 2, maxProcesses: 4 });
17
- * ```
18
- *
19
- * This file is not exposed through the package exports map and is maintained
20
- * for backward compatibility only.
21
- */
22
- export { NodeBridge as OptimizedNodeBridge, type NodeBridgeOptions as ProcessPoolOptions, } from './node.js';
23
- //# sourceMappingURL=optimized-node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optimized-node.d.ts","sourceRoot":"","sources":["../../src/runtime/optimized-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EACL,UAAU,IAAI,mBAAmB,EACjC,KAAK,iBAAiB,IAAI,kBAAkB,GAC7C,MAAM,WAAW,CAAC"}