@oh-my-pi/pi-natives 18.2.5 → 18.2.7

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.
@@ -335,43 +335,6 @@ This license allows the work and adaptations of it to be shared and used
335
335
  commercially, as long as it is attributed to Poppy Works. The font is bundled
336
336
  here (crates/pi-natives/src/fonts/Silver.ttf) as a CJK/Unicode bitmap fallback.
337
337
 
338
- -------------------------------------------------------------------------------
339
- packages/utils/src/vendor/mermaid-ascii/NOTICE
340
-
341
- This directory contains an in-house Mermaid-diagram-to-ASCII renderer adapted
342
- from beautiful-mermaid (https://github.com/lukilabs/beautiful-mermaid), used
343
- under the MIT License.
344
-
345
- Copyright (c) 2026 Craft Docs
346
-
347
- Only the ASCII rendering pipeline is ported (flowchart/state, sequence, class,
348
- ER, and xychart diagrams); the SVG renderer and its `elkjs` graph-layout
349
- dependency, the browser entry point, and the SVG theme/style modules were
350
- dropped. Terminal display width is reimplemented on `Bun.stringWidth`, and
351
- inline label formatting (HTML tags, markdown emphasis) is reduced to plain text
352
- for ASCII output. Layout and edge-routing logic is preserved faithfully so
353
- ASCII output matches the upstream package.
354
-
355
- MIT License
356
-
357
- Permission is hereby granted, free of charge, to any person obtaining a copy
358
- of this software and associated documentation files (the "Software"), to deal
359
- in the Software without restriction, including without limitation the rights
360
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
361
- copies of the Software, and to permit persons to whom the Software is
362
- furnished to do so, subject to the following conditions:
363
-
364
- The above copyright notice and this permission notice shall be included in all
365
- copies or substantial portions of the Software.
366
-
367
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
368
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
369
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
370
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
371
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
372
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
373
- SOFTWARE.
374
-
375
338
  -------------------------------------------------------------------------------
376
339
  packages/coding-agent/src/markit/NOTICE
377
340
 
package/native/index.d.ts CHANGED
@@ -648,7 +648,7 @@ export declare function __ompInstallTokioRuntime(): void
648
648
  * `packages/natives/native/index.js` (which derives the name from
649
649
  * `package.json#version`).
650
650
  */
651
- export declare function __piNativesV18_2_5(): void
651
+ export declare function __piNativesV18_2_7(): void
652
652
 
653
653
  /**
654
654
  * Apply ast-grep rewrite rules to matching files; honors `dryRun` and returns
@@ -1479,7 +1479,7 @@ export declare function execReplace(argv: Array<string>): void
1479
1479
  */
1480
1480
  export declare function executeShell(options: ShellExecuteOptions, onChunk?: ((error: Error | null, chunk: string) => void) | undefined | null): Promise<ShellRunResult>
1481
1481
 
1482
- /** Locate `<SM:EDIT path="…">` payloads the model emitted as plain text. */
1482
+ /** Locate `*** SM:EDIT path` payloads the model emitted as plain text. */
1483
1483
  export declare function extractInlineSloppyRegions(text: string): Array<InlineSloppyRegion>
1484
1484
 
1485
1485
  /**
@@ -2104,6 +2104,36 @@ export declare function matchesKittySequence(data: string, expectedCodepoint: nu
2104
2104
  */
2105
2105
  export declare function matchesLegacySequence(data: string, keyName: string): boolean
2106
2106
 
2107
+ /**
2108
+ * Options for [`render_mermaid_ascii`]; every field defaults like the
2109
+ * TypeScript renderer (`useAscii: false`, paddings 5, border padding 1,
2110
+ * `colorMode: "auto"`).
2111
+ */
2112
+ export interface MermaidRenderOptions {
2113
+ /** `+-|>` instead of Unicode box-drawing characters. */
2114
+ useAscii?: boolean
2115
+ paddingX?: number
2116
+ paddingY?: number
2117
+ boxBorderPadding?: number
2118
+ /** Force the flowchart/state layout direction. */
2119
+ direction?: 'TD' | 'TB' | 'LR' | 'BT' | 'RL'
2120
+ /** `auto` (or omitted) detects from the terminal environment. */
2121
+ colorMode?: 'none' | 'auto' | 'ansi16' | 'ansi256' | 'truecolor' | 'html'
2122
+ theme?: MermaidTheme
2123
+ }
2124
+
2125
+ /** Theme colors for [`render_mermaid_ascii`]; hex strings, all optional. */
2126
+ export interface MermaidTheme {
2127
+ fg?: string
2128
+ border?: string
2129
+ line?: string
2130
+ arrow?: string
2131
+ accent?: string
2132
+ bg?: string
2133
+ corner?: string
2134
+ junction?: string
2135
+ }
2136
+
2107
2137
  /** N-API opt-in handle for the minimizer. */
2108
2138
  export interface MinimizerOptions {
2109
2139
  /** Master switch. Absent / false = disabled. */
@@ -2433,6 +2463,16 @@ export declare function rasterizeSvg(input: Uint8Array, maxWidthPx: number, maxH
2433
2463
  */
2434
2464
  export declare function readImageFromClipboard(): Promise<ClipboardImage | undefined | null>
2435
2465
 
2466
+ /**
2467
+ * Render Mermaid diagram text (flowchart, state, sequence, class, ER, or
2468
+ * xychart) to ASCII/Unicode art. Synchronous: callers render inside the
2469
+ * TUI compositor.
2470
+ *
2471
+ * # Errors
2472
+ * Unparseable flowchart source or an unknown `direction`/`colorMode` value.
2473
+ */
2474
+ export declare function renderMermaidAscii(text: string, options?: MermaidRenderOptions | undefined | null): string
2475
+
2436
2476
  /**
2437
2477
  * Render one snapcompact frame on a libuv worker: print pre-normalized text
2438
2478
  * onto a `size`-wide bitmap and encode it as PNG.
package/native/index.js CHANGED
@@ -39,7 +39,7 @@ export const VcsRepo = nativeBindings.VcsRepo;
39
39
 
40
40
  // functions
41
41
  export const __ompInstallTokioRuntime = nativeBindings.__ompInstallTokioRuntime;
42
- export const __piNativesV18_2_5 = nativeBindings.__piNativesV18_2_5;
42
+ export const __piNativesV18_2_7 = nativeBindings.__piNativesV18_2_7;
43
43
  export const astEdit = nativeBindings.astEdit;
44
44
  export const astGrep = nativeBindings.astGrep;
45
45
  export const astMatch = nativeBindings.astMatch;
@@ -103,6 +103,7 @@ export const parseKittySequence = nativeBindings.parseKittySequence;
103
103
  export const pdfToMarkdown = nativeBindings.pdfToMarkdown;
104
104
  export const rasterizeSvg = nativeBindings.rasterizeSvg;
105
105
  export const readImageFromClipboard = nativeBindings.readImageFromClipboard;
106
+ export const renderMermaidAscii = nativeBindings.renderMermaidAscii;
106
107
  export const renderSnapcompactPng = nativeBindings.renderSnapcompactPng;
107
108
  export const search = nativeBindings.search;
108
109
  export const setHangulCompatJamoWidthOverride = nativeBindings.setHangulCompatJamoWidthOverride;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "18.2.5",
3
+ "version": "18.2.7",
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",
@@ -84,27 +84,31 @@
84
84
  "exports": {
85
85
  ".": {
86
86
  "types": "./native/index.d.ts",
87
- "import": "./native/index.js"
87
+ "import": "./native/index.js",
88
+ "default": "./native/index.js"
88
89
  },
89
90
  "./desktop": {
90
91
  "types": "./native/desktop.d.ts",
91
- "import": "./native/desktop.js"
92
+ "import": "./native/desktop.js",
93
+ "default": "./native/desktop.js"
92
94
  },
93
95
  "./clipboard": {
94
96
  "types": "./native/clipboard.d.ts",
95
- "import": "./native/clipboard.js"
97
+ "import": "./native/clipboard.js",
98
+ "default": "./native/clipboard.js"
96
99
  },
97
100
  "./vcs": {
98
101
  "types": "./native/vcs.d.ts",
99
- "import": "./native/vcs.js"
102
+ "import": "./native/vcs.js",
103
+ "default": "./native/vcs.js"
100
104
  }
101
105
  },
102
106
  "optionalDependencies": {
103
- "@oh-my-pi/pi-natives-linux-x64": "18.2.5",
104
- "@oh-my-pi/pi-natives-linux-arm64": "18.2.5",
105
- "@oh-my-pi/pi-natives-darwin-x64": "18.2.5",
106
- "@oh-my-pi/pi-natives-darwin-arm64": "18.2.5",
107
- "@oh-my-pi/pi-natives-win32-x64": "18.2.5",
108
- "@oh-my-pi/pi-natives-win32-arm64": "18.2.5"
107
+ "@oh-my-pi/pi-natives-linux-x64": "18.2.7",
108
+ "@oh-my-pi/pi-natives-linux-arm64": "18.2.7",
109
+ "@oh-my-pi/pi-natives-darwin-x64": "18.2.7",
110
+ "@oh-my-pi/pi-natives-darwin-arm64": "18.2.7",
111
+ "@oh-my-pi/pi-natives-win32-x64": "18.2.7",
112
+ "@oh-my-pi/pi-natives-win32-arm64": "18.2.7"
109
113
  }
110
114
  }