@oh-my-pi/pi-natives 17.2.4 → 17.2.5
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/clipboard.d.ts +9 -0
- package/native/clipboard.js +11 -0
- package/native/index.d.ts +106 -56
- package/native/index.js +1 -1
- package/package.json +12 -6
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ClipboardImage } from "./index.js";
|
|
2
|
+
|
|
3
|
+
export type { ClipboardImage } from "./index.js";
|
|
4
|
+
|
|
5
|
+
/** Copy text to the clipboard, loading the native addon on first use. */
|
|
6
|
+
export declare function copyToClipboard(text: string): void;
|
|
7
|
+
|
|
8
|
+
/** Read an image from the clipboard, loading the native addon on first use. */
|
|
9
|
+
export declare function readImageFromClipboard(): Promise<ClipboardImage | undefined | null>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { loadNative } from "./loader-state.js";
|
|
2
|
+
|
|
3
|
+
/** Copy text to the clipboard, loading the native addon on first use. */
|
|
4
|
+
export function copyToClipboard(text) {
|
|
5
|
+
return loadNative().copyToClipboard(text);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Read an image from the clipboard, loading the native addon on first use. */
|
|
9
|
+
export function readImageFromClipboard() {
|
|
10
|
+
return loadNative().readImageFromClipboard();
|
|
11
|
+
}
|
package/native/index.d.ts
CHANGED
|
@@ -28,19 +28,36 @@ export declare class AudioPlayback {
|
|
|
28
28
|
stop(): void
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/** Persistent, serialized native desktop capture/input session. */
|
|
31
|
+
/** Persistent, serialized native desktop capture/input/accessibility session. */
|
|
32
32
|
export declare class DesktopSession {
|
|
33
33
|
constructor(options?: DesktopSessionOptions | undefined | null)
|
|
34
|
-
/** Current backend capability and permission state. */
|
|
35
34
|
get capabilities(): DesktopCapabilities
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
listDisplays(): Promise<Array<DesktopDisplay>>
|
|
36
|
+
listWindows(): Promise<Array<DesktopWindow>>
|
|
37
|
+
capture(target: string, caps?: CaptureCaps | undefined | null): Promise<DesktopCapture>
|
|
38
|
+
click(target: string, x: number, y: number, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
39
|
+
moveMouse(target: string, x: number, y: number, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
40
|
+
drag(target: string, path: Array<DesktopPoint>, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
41
|
+
scroll(target: string, x: number, y: number, dx: number, dy: number, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
42
|
+
typeText(target: string, text: string, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
43
|
+
keyChord(target: string, keys: Array<string>, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
44
|
+
raiseWindow(windowId: string): Promise<undefined>
|
|
45
|
+
axSnapshot(target: string, opts?: AxSnapshotOptions | undefined | null): Promise<AxSnapshot>
|
|
46
|
+
axQuery(target: string, query: AxQuery): Promise<Array<AxNode>>
|
|
38
47
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
48
|
+
* Accessibility hit-test at global logical desktop coordinates; needs no
|
|
49
|
+
* prior capture.
|
|
41
50
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
axElementAt(target: string, x: number, y: number): Promise<AxNode | undefined | null>
|
|
52
|
+
axFocused(): Promise<AxNode | undefined | null>
|
|
53
|
+
axNode(reference: string): Promise<AxNode>
|
|
54
|
+
axAttributes(reference: string): Promise<Array<[string, string]>>
|
|
55
|
+
axChildren(reference: string): Promise<Array<AxNode>>
|
|
56
|
+
axParent(reference: string): Promise<AxNode | undefined | null>
|
|
57
|
+
axPerform(reference: string, action: string): Promise<undefined>
|
|
58
|
+
axSetValue(reference: string, value: string): Promise<undefined>
|
|
59
|
+
axFocus(reference: string): Promise<undefined>
|
|
60
|
+
axClick(reference: string, opts?: PointerOptions | undefined | null): Promise<undefined>
|
|
44
61
|
close(): Promise<undefined>
|
|
45
62
|
}
|
|
46
63
|
|
|
@@ -246,7 +263,7 @@ export declare function __ompInstallTokioRuntime(): void
|
|
|
246
263
|
* `packages/natives/native/index.js` (which derives the name from
|
|
247
264
|
* `package.json#version`).
|
|
248
265
|
*/
|
|
249
|
-
export declare function
|
|
266
|
+
export declare function __piNativesV17_2_5(): void
|
|
250
267
|
|
|
251
268
|
/**
|
|
252
269
|
* Apply ast-grep rewrite rules to matching files; honors `dryRun` and returns
|
|
@@ -487,6 +504,42 @@ export interface AstReplaceResult {
|
|
|
487
504
|
parseErrors?: Array<string>
|
|
488
505
|
}
|
|
489
506
|
|
|
507
|
+
export interface AxNode {
|
|
508
|
+
ref: string
|
|
509
|
+
role: string
|
|
510
|
+
nativeRole: string
|
|
511
|
+
title?: string
|
|
512
|
+
value?: string
|
|
513
|
+
description?: string
|
|
514
|
+
enabled: boolean
|
|
515
|
+
focused: boolean
|
|
516
|
+
x?: number
|
|
517
|
+
y?: number
|
|
518
|
+
width?: number
|
|
519
|
+
height?: number
|
|
520
|
+
actions?: Array<string>
|
|
521
|
+
childCount: number
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export interface AxQuery {
|
|
525
|
+
role?: string
|
|
526
|
+
title?: string
|
|
527
|
+
value?: string
|
|
528
|
+
limit?: number
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface AxSnapshot {
|
|
532
|
+
text: string
|
|
533
|
+
nodeCount: number
|
|
534
|
+
truncated: boolean
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export interface AxSnapshotOptions {
|
|
538
|
+
maxDepth?: number
|
|
539
|
+
maxNodes?: number
|
|
540
|
+
all?: boolean
|
|
541
|
+
}
|
|
542
|
+
|
|
490
543
|
export interface BlockRange {
|
|
491
544
|
/** 1-indexed inclusive first line of the resolved block. */
|
|
492
545
|
startLine: number
|
|
@@ -514,6 +567,11 @@ export interface BlockRangeOptions {
|
|
|
514
567
|
line: number
|
|
515
568
|
}
|
|
516
569
|
|
|
570
|
+
export interface CaptureCaps {
|
|
571
|
+
maxWidth?: number
|
|
572
|
+
maxHeight?: number
|
|
573
|
+
}
|
|
574
|
+
|
|
517
575
|
/** Clipboard image payload encoded as PNG bytes. */
|
|
518
576
|
export interface ClipboardImage {
|
|
519
577
|
/** PNG-encoded image bytes. */
|
|
@@ -566,59 +624,35 @@ export declare function cosineSimilarityPairs(vectors: Float64Array, count: numb
|
|
|
566
624
|
*/
|
|
567
625
|
export declare function countTokens(input: string | Array<string>, encoding?: Encoding | undefined | null): number
|
|
568
626
|
|
|
569
|
-
/**
|
|
570
|
-
* One `OpenAI` GA computer action.
|
|
571
|
-
*
|
|
572
|
-
* This is an optional-field carrier because napi-rs object generation cannot
|
|
573
|
-
* emit TypeScript discriminated unions. Native validation enforces the exact
|
|
574
|
-
* fields required and allowed by each `type` before any input is emitted.
|
|
575
|
-
*/
|
|
576
|
-
export interface DesktopAction {
|
|
577
|
-
type: string
|
|
578
|
-
x?: number
|
|
579
|
-
y?: number
|
|
580
|
-
button?: string
|
|
581
|
-
path?: Array<DesktopPoint>
|
|
582
|
-
keys?: Array<string>
|
|
583
|
-
scroll_x?: number
|
|
584
|
-
scroll_y?: number
|
|
585
|
-
text?: string
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/** Native desktop backend and permission state. */
|
|
589
627
|
export interface DesktopCapabilities {
|
|
590
|
-
/**
|
|
591
|
-
* Concrete selected backend: `quartz`, `x11`, `wayland`, `win32`, or
|
|
592
|
-
* `unavailable`.
|
|
593
|
-
*/
|
|
594
628
|
backend: string
|
|
595
|
-
/** OS display-server endpoint or subsystem label. */
|
|
596
629
|
displayServer?: string
|
|
597
|
-
/** Whether screen capture is currently usable. */
|
|
598
630
|
capture: boolean
|
|
599
|
-
/** Whether native input is currently usable. */
|
|
600
631
|
input: boolean
|
|
601
|
-
|
|
632
|
+
ax: boolean
|
|
633
|
+
backgroundWindowInput: boolean
|
|
634
|
+
deliveryModes: Array<string>
|
|
602
635
|
capturePermission: string
|
|
603
|
-
/** `granted`, `denied`, `unknown`, or `unavailable`. */
|
|
604
636
|
inputPermission: string
|
|
605
|
-
|
|
637
|
+
axPermission: string
|
|
606
638
|
displayCount: number
|
|
607
639
|
}
|
|
608
640
|
|
|
609
|
-
/**
|
|
610
|
-
* A PNG composite and the exact geometry needed to map its pixels back to the
|
|
611
|
-
* global logical desktop.
|
|
612
|
-
*/
|
|
613
641
|
export interface DesktopCapture {
|
|
614
642
|
data: Uint8Array
|
|
615
643
|
width: number
|
|
616
644
|
height: number
|
|
645
|
+
/** Pre-scaling capture width in native pixels; equals `width` when unscaled. */
|
|
646
|
+
sourceWidth: number
|
|
647
|
+
/**
|
|
648
|
+
* Pre-scaling capture height in native pixels; equals `height` when
|
|
649
|
+
* unscaled.
|
|
650
|
+
*/
|
|
651
|
+
sourceHeight: number
|
|
652
|
+
target: string
|
|
617
653
|
displays: Array<DesktopDisplay>
|
|
618
654
|
backend: string
|
|
619
655
|
displayServer?: string
|
|
620
|
-
capturePermission: string
|
|
621
|
-
inputPermission: string
|
|
622
656
|
}
|
|
623
657
|
|
|
624
658
|
/**
|
|
@@ -640,25 +674,34 @@ export interface DesktopDisplay {
|
|
|
640
674
|
isPrimary: boolean
|
|
641
675
|
}
|
|
642
676
|
|
|
643
|
-
/** One point in a drag path, in pixels of the preceding screenshot. */
|
|
644
677
|
export interface DesktopPoint {
|
|
645
678
|
x: number
|
|
646
679
|
y: number
|
|
647
680
|
}
|
|
648
681
|
|
|
649
|
-
/** Options for a persistent native desktop session. */
|
|
650
682
|
export interface DesktopSessionOptions {
|
|
683
|
+
display?: string
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/** One capturable top-level window in global logical desktop coordinates. */
|
|
687
|
+
export interface DesktopWindow {
|
|
651
688
|
/**
|
|
652
|
-
*
|
|
653
|
-
*
|
|
689
|
+
* Stable numeric window id, valid as a capture target while the window
|
|
690
|
+
* lives.
|
|
654
691
|
*/
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
|
|
692
|
+
id: string
|
|
693
|
+
/** Window title; may be empty for untitled windows. */
|
|
694
|
+
title: string
|
|
695
|
+
/** Owning application name. */
|
|
696
|
+
app: string
|
|
697
|
+
/** Owning process id when the platform exposes it. */
|
|
698
|
+
pid?: number
|
|
699
|
+
x: number
|
|
700
|
+
y: number
|
|
701
|
+
width: number
|
|
702
|
+
height: number
|
|
703
|
+
/** Whether the window currently holds input focus. */
|
|
704
|
+
focused: boolean
|
|
662
705
|
}
|
|
663
706
|
|
|
664
707
|
/**
|
|
@@ -1517,6 +1560,13 @@ export interface PatchHunk {
|
|
|
1517
1560
|
lines: Array<string>
|
|
1518
1561
|
}
|
|
1519
1562
|
|
|
1563
|
+
export interface PointerOptions {
|
|
1564
|
+
button?: string
|
|
1565
|
+
count?: number
|
|
1566
|
+
modifiers?: Array<string>
|
|
1567
|
+
deliveryMode?: string
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1520
1570
|
/** Current state of a process reference. */
|
|
1521
1571
|
export declare enum ProcessStatus {
|
|
1522
1572
|
/** The referenced process is still running. */
|
package/native/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export const Shell = nativeBindings.Shell;
|
|
|
28
28
|
|
|
29
29
|
// functions
|
|
30
30
|
export const __ompInstallTokioRuntime = nativeBindings.__ompInstallTokioRuntime;
|
|
31
|
-
export const
|
|
31
|
+
export const __piNativesV17_2_5 = nativeBindings.__piNativesV17_2_5;
|
|
32
32
|
export const astEdit = nativeBindings.astEdit;
|
|
33
33
|
export const astGrep = nativeBindings.astGrep;
|
|
34
34
|
export const astMatch = nativeBindings.astMatch;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-pi/pi-natives",
|
|
3
|
-
"version": "17.2.
|
|
3
|
+
"version": "17.2.5",
|
|
4
4
|
"description": "Native Rust bindings for 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",
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
"files": [
|
|
57
57
|
"native/index.js",
|
|
58
58
|
"native/index.d.ts",
|
|
59
|
+
"native/clipboard.js",
|
|
60
|
+
"native/clipboard.d.ts",
|
|
59
61
|
"native/desktop.js",
|
|
60
62
|
"native/desktop.d.ts",
|
|
61
63
|
"native/loader-state.js",
|
|
@@ -71,13 +73,17 @@
|
|
|
71
73
|
"./desktop": {
|
|
72
74
|
"types": "./native/desktop.d.ts",
|
|
73
75
|
"import": "./native/desktop.js"
|
|
76
|
+
},
|
|
77
|
+
"./clipboard": {
|
|
78
|
+
"types": "./native/clipboard.d.ts",
|
|
79
|
+
"import": "./native/clipboard.js"
|
|
74
80
|
}
|
|
75
81
|
},
|
|
76
82
|
"optionalDependencies": {
|
|
77
|
-
"@oh-my-pi/pi-natives-linux-x64": "17.2.
|
|
78
|
-
"@oh-my-pi/pi-natives-linux-arm64": "17.2.
|
|
79
|
-
"@oh-my-pi/pi-natives-darwin-x64": "17.2.
|
|
80
|
-
"@oh-my-pi/pi-natives-darwin-arm64": "17.2.
|
|
81
|
-
"@oh-my-pi/pi-natives-win32-x64": "17.2.
|
|
83
|
+
"@oh-my-pi/pi-natives-linux-x64": "17.2.5",
|
|
84
|
+
"@oh-my-pi/pi-natives-linux-arm64": "17.2.5",
|
|
85
|
+
"@oh-my-pi/pi-natives-darwin-x64": "17.2.5",
|
|
86
|
+
"@oh-my-pi/pi-natives-darwin-arm64": "17.2.5",
|
|
87
|
+
"@oh-my-pi/pi-natives-win32-x64": "17.2.5"
|
|
82
88
|
}
|
|
83
89
|
}
|