@oh-my-pi/pi-natives 18.4.0 → 18.4.2

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/native/index.d.ts CHANGED
@@ -416,9 +416,9 @@ export declare class TextPredictor {
416
416
  /**
417
417
  * Dedicated writer thread for one terminal fd.
418
418
  *
419
- * Constructed by the TUI's `ProcessTerminal` around stdout. The fd is
420
- * `dup(2)`'d at construction and closed on drop, so later manipulation of the
421
- * original descriptor does not affect the pump.
419
+ * `dup(2)`'d at construction and closed on drop. The duplicate keeps the
420
+ * pump's fd alive if the original is closed or replaced; file-status flags
421
+ * such as `O_NONBLOCK` are shared and handled by polling for `POLLOUT`.
422
422
  */
423
423
  export declare class TtyWriter {
424
424
  /**
@@ -1739,7 +1739,8 @@ export interface GlobResult {
1739
1739
  *
1740
1740
  * # Arguments
1741
1741
  * - `options`: Pattern, path, filters, and output mode.
1742
- * - `on_match`: Optional callback invoked per match/result.
1742
+ * - `on_match`: Optional callback invoked per returned match/result, after the
1743
+ * search (never called when `options.onMatches` streams instead).
1743
1744
  *
1744
1745
  * # Returns
1745
1746
  * Aggregated results across matching files.
@@ -1816,6 +1817,17 @@ export interface GrepOptions {
1816
1817
  * absent).
1817
1818
  */
1818
1819
  filesystem?: ShellFilesystem
1820
+ /**
1821
+ * Stream results instead of returning them: called on the JS thread with
1822
+ * batches (at most 1024 entries, files in no particular order) of what
1823
+ * `matches` would hold, while the search runs. A slow callback pauses the
1824
+ * search instead of buffering. Successful completion waits for every
1825
+ * callback and carries counts with empty `matches`; cancellation also
1826
+ * interrupts delivery waits, though already queued callbacks may still run.
1827
+ * A throw rejects the search with it. Incompatible with `maxCount` and
1828
+ * `offset`.
1829
+ */
1830
+ onMatches?: (matches: GrepMatch[]) => void
1819
1831
  }
1820
1832
 
1821
1833
  /** Output mode for [`search`] and [`grep`] (string values match JS callers). */
@@ -3136,8 +3148,22 @@ export interface SpellingRange {
3136
3148
  */
3137
3149
  export declare function structuredPatchHunks(oldText: string, newText: string, context?: number | undefined | null): Array<PatchHunk>
3138
3150
 
3151
+ /**
3152
+ * Summarize source structure synchronously on the calling thread.
3153
+ *
3154
+ * Prefer [`summarize_code_async`] on hot paths: the tree-sitter parse blocks
3155
+ * the JS thread for the whole call.
3156
+ */
3139
3157
  export declare function summarizeCode(options: SummaryOptions): SummaryResult
3140
3158
 
3159
+ /**
3160
+ * Summarize source structure on libuv's thread pool.
3161
+ *
3162
+ * Same result as [`summarize_code`], but the parse and summary run off the
3163
+ * JS thread; only argument and result marshalling happen on it.
3164
+ */
3165
+ export declare function summarizeCodeAsync(options: SummaryOptions): Promise<SummaryResult>
3166
+
3141
3167
  export interface SummaryOptions {
3142
3168
  /** Source code to summarize. */
3143
3169
  code: string
package/native/index.js CHANGED
@@ -122,6 +122,7 @@ export const sliceWithWidth = nativeBindings.sliceWithWidth ?? missingNativeExpo
122
122
  export const snapcompactSupportedChars = nativeBindings.snapcompactSupportedChars ?? missingNativeExport("snapcompactSupportedChars");
123
123
  export const structuredPatchHunks = nativeBindings.structuredPatchHunks ?? missingNativeExport("structuredPatchHunks");
124
124
  export const summarizeCode = nativeBindings.summarizeCode ?? missingNativeExport("summarizeCode");
125
+ export const summarizeCodeAsync = nativeBindings.summarizeCodeAsync ?? missingNativeExport("summarizeCodeAsync");
125
126
  export const supportsLanguage = nativeBindings.supportsLanguage ?? missingNativeExport("supportsLanguage");
126
127
  export const truncateToWidth = nativeBindings.truncateToWidth ?? missingNativeExport("truncateToWidth");
127
128
  export const vcsDetachGitDir = nativeBindings.vcsDetachGitDir ?? missingNativeExport("vcsDetachGitDir");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-natives",
3
- "version": "18.4.0",
3
+ "version": "18.4.2",
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",
@@ -114,11 +114,11 @@
114
114
  }
115
115
  },
116
116
  "optionalDependencies": {
117
- "@oh-my-pi/pi-natives-linux-x64": "18.4.0",
118
- "@oh-my-pi/pi-natives-linux-arm64": "18.4.0",
119
- "@oh-my-pi/pi-natives-darwin-x64": "18.4.0",
120
- "@oh-my-pi/pi-natives-darwin-arm64": "18.4.0",
121
- "@oh-my-pi/pi-natives-win32-x64": "18.4.0",
122
- "@oh-my-pi/pi-natives-win32-arm64": "18.4.0"
117
+ "@oh-my-pi/pi-natives-linux-x64": "18.4.2",
118
+ "@oh-my-pi/pi-natives-linux-arm64": "18.4.2",
119
+ "@oh-my-pi/pi-natives-darwin-x64": "18.4.2",
120
+ "@oh-my-pi/pi-natives-darwin-arm64": "18.4.2",
121
+ "@oh-my-pi/pi-natives-win32-x64": "18.4.2",
122
+ "@oh-my-pi/pi-natives-win32-arm64": "18.4.2"
123
123
  }
124
124
  }