@oh-my-pi/pi-natives 18.6.3 → 18.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.
package/README.md CHANGED
@@ -77,7 +77,7 @@ crates/pi-natives/ # Rust source (workspace member)
77
77
  native/ # Core loader files and local/CI native build outputs
78
78
  index.js # Public native export surface
79
79
  loader-state.js # Platform, ISA variant, and addon resolution
80
- embedded-addon.js # Standalone binary embed stub/generated metadata
80
+ embedded-addon.js # Null embed stub; binary builds replace it in memory
81
81
  pi_natives.<platform>-<arch>-modern.node # x64 modern ISA (local/CI artifact)
82
82
  pi_natives.<platform>-<arch>-baseline.node # x64 baseline ISA (local/CI artifact)
83
83
  pi_natives.<platform>-<arch>.node # non-x64 build artifact
@@ -1,6 +1,6 @@
1
1
 
2
- // AUTOGENERATED FILE -- DO NOT EDIT DIRECTLY
3
- // See scripts/embed-native.ts
2
+ // Always null on disk. Standalone binary builds replace this module in memory
3
+ // with the target's manifest and addon archive (scripts/embed-native.ts).
4
4
 
5
5
  /** @typedef {"modern" | "baseline" | "default"} EmbeddedAddonVariant */
6
6
 
package/native/index.d.ts CHANGED
@@ -2729,14 +2729,23 @@ export interface PtyStartOptions {
2729
2729
  /**
2730
2730
  * Rasterize SVG/SVGZ bytes into a bounded PNG without resolving local files.
2731
2731
  *
2732
- * Conversion runs on the native blocking pool so parsing and rendering do not
2733
- * stall the JavaScript event loop.
2732
+ * The image is drawn at `scale` times the SVG's intrinsic size (default 1;
2733
+ * above 1 renders vector content crisply at display resolution), then shrunk
2734
+ * as needed to fit `max_width_px` x `max_height_px` with its aspect ratio
2735
+ * kept. Conversion runs on the native blocking pool so parsing and rendering
2736
+ * do not stall the JavaScript event loop.
2737
+ *
2738
+ * With `cell`, the limits round down to whole cells and the canvas pads with
2739
+ * transparency, right and bottom, to whole cells: a terminal placing the PNG
2740
+ * over `width / cell.width_px` columns and `height / cell.height_px` rows
2741
+ * shows it 1:1 instead of resampling it.
2734
2742
  *
2735
2743
  * # Errors
2736
- * Returns an error for invalid SVG data, zero/oversized limits, allocation
2737
- * failure, or PNG encoding failure.
2744
+ * Returns an error for invalid SVG data, zero/oversized limits, a zero cell
2745
+ * size, a scale that is not finite and positive, allocation failure, or PNG
2746
+ * encoding failure.
2738
2747
  */
2739
- export declare function rasterizeSvg(input: Uint8Array, maxWidthPx: number, maxHeightPx: number): Promise<Uint8Array>
2748
+ export declare function rasterizeSvg(input: Uint8Array, maxWidthPx: number, maxHeightPx: number, scale?: number | undefined | null, cell?: SvgCell | undefined | null): Promise<Uint8Array>
2740
2749
 
2741
2750
  /**
2742
2751
  * Read an image from the system clipboard.
@@ -3390,6 +3399,15 @@ export interface SummarySegment {
3390
3399
  */
3391
3400
  export declare function supportsLanguage(lang: string): boolean
3392
3401
 
3402
+ /**
3403
+ * Terminal cell size in device pixels, for [`rasterize_svg`] canvases a
3404
+ * terminal shows over whole cells.
3405
+ */
3406
+ export interface SvgCell {
3407
+ widthPx: number
3408
+ heightPx: number
3409
+ }
3410
+
3393
3411
  /** Options for [`TextPredictor::new`]. */
3394
3412
  export interface TextPredictorOptions {
3395
3413
  /** Engine: `ngram`, `smollm`, or `apple`. */
@@ -3,11 +3,7 @@
3
3
  * pipeline, and the post-link stamp tool (`scripts/stamp-native-version.ts`).
4
4
  *
5
5
  * Kept in its own module so `scripts/embed-native.ts` can reuse them without
6
- * importing `loader-state.js` — which pulls in the generated
7
- * `embedded-addon.js` and its `with { type: "file" }` archive import. That
8
- * chain fails to resolve when the archive is missing, which would break
9
- * `gen:native:reset` on an inconsistent tree (populated manifest, deleted
10
- * archive) before it can restore the checked-in null stub.
6
+ * importing `loader-state.js` and the rest of the runtime loader.
11
7
  *
12
8
  * Current addons carry a fixed-size stamp slot (`VERSION_STAMP_MAGIC` + the
13
9
  * release version + NUL padding) written after linking and reported by
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "18.6.3",
3
+ "version": "18.8.0",
4
4
  "description": "Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API",
5
5
  "type": "module",
6
6
  "homepage": "https://omp.sh",
@@ -40,8 +40,6 @@
40
40
  "test": "bun test --parallel",
41
41
  "fix": "oxlint --fix --fix-suggestions . && bun run fmt",
42
42
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'",
43
- "gen:native": "bun scripts/embed-native.ts",
44
- "gen:native:reset": "bun scripts/embed-native.ts --reset",
45
43
  "gen:npm": "bun scripts/gen-npm-packages.ts",
46
44
  "bench": "bun bench/grep.ts",
47
45
  "bench:text": "bun bench/text.ts"
@@ -114,11 +112,11 @@
114
112
  }
115
113
  },
116
114
  "optionalDependencies": {
117
- "@oh-my-pi/pi-natives-linux-x64": "18.6.3",
118
- "@oh-my-pi/pi-natives-linux-arm64": "18.6.3",
119
- "@oh-my-pi/pi-natives-darwin-x64": "18.6.3",
120
- "@oh-my-pi/pi-natives-darwin-arm64": "18.6.3",
121
- "@oh-my-pi/pi-natives-win32-x64": "18.6.3",
122
- "@oh-my-pi/pi-natives-win32-arm64": "18.6.3"
115
+ "@oh-my-pi/pi-natives-linux-x64": "18.8.0",
116
+ "@oh-my-pi/pi-natives-linux-arm64": "18.8.0",
117
+ "@oh-my-pi/pi-natives-darwin-x64": "18.8.0",
118
+ "@oh-my-pi/pi-natives-darwin-arm64": "18.8.0",
119
+ "@oh-my-pi/pi-natives-win32-x64": "18.8.0",
120
+ "@oh-my-pi/pi-natives-win32-arm64": "18.8.0"
123
121
  }
124
122
  }