@gajae-code/natives 0.12.8 → 0.12.11
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 +52 -7
- package/native/index.js +2 -1
- package/package.json +6 -6
package/native/index.d.ts
CHANGED
|
@@ -7,8 +7,40 @@
|
|
|
7
7
|
* consumers can import them portably; the native controller itself is built
|
|
8
8
|
* only on macOS.
|
|
9
9
|
*/
|
|
10
|
+
export interface ComputerInputAction {
|
|
11
|
+
action: "screenshot" | "click" | "double_click" | "move" | "drag" | "scroll" | "type" | "keypress" | "wait"
|
|
12
|
+
x?: number
|
|
13
|
+
y?: number
|
|
14
|
+
toX?: number
|
|
15
|
+
toY?: number
|
|
16
|
+
scrollX?: number
|
|
17
|
+
scrollY?: number
|
|
18
|
+
button?: string
|
|
19
|
+
text?: string
|
|
20
|
+
keys?: Array<string>
|
|
21
|
+
ms?: number
|
|
22
|
+
timeoutMs?: number
|
|
23
|
+
timeoutGroup?: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ComputerBatchStepResult {
|
|
27
|
+
index: number
|
|
28
|
+
action: string
|
|
29
|
+
screenshot?: ComputerScreenshot
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ComputerBatchResult {
|
|
33
|
+
results: Array<ComputerBatchStepResult>
|
|
34
|
+
failureCode?: string
|
|
35
|
+
failureIndex?: number
|
|
36
|
+
failureMessage?: string
|
|
37
|
+
primaryFailureCode?: string
|
|
38
|
+
primaryFailureMessage?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
10
41
|
export declare class ComputerController {
|
|
11
42
|
constructor()
|
|
43
|
+
executeBatch(expectedEpoch: number | undefined | null, actions: Array<ComputerInputAction>, timeoutMs?: number | undefined | null, signal?: unknown): Promise<ComputerBatchResult>
|
|
12
44
|
screenshot(): ComputerScreenshot
|
|
13
45
|
click(expectedEpoch: number | undefined | null, x: number, y: number, button?: string | undefined | null): void
|
|
14
46
|
doubleClick(expectedEpoch: number | undefined | null, x: number, y: number, button?: string | undefined | null): void
|
|
@@ -491,7 +523,7 @@ export declare function __piNativesPublishOutcomeV1(): void
|
|
|
491
523
|
* `packages/natives/native/index.js` (which derives the name from
|
|
492
524
|
* `package.json#version`).
|
|
493
525
|
*/
|
|
494
|
-
export declare function
|
|
526
|
+
export declare function __piNativesV0_12_11(): void
|
|
495
527
|
|
|
496
528
|
/**
|
|
497
529
|
* Apply conservative pre-execution rewrites to a bash command.
|
|
@@ -844,13 +876,12 @@ export declare function encodeSixel(bytes: Uint8Array, targetWidthPx: number, ta
|
|
|
844
876
|
export declare function exactRemoveDirectoryTree(path: string, snapshot: NativeDirectoryTreeSnapshot, parentIdentity?: NativeDirectoryParentIdentity | undefined | null): NativeExactUnlinkResult
|
|
845
877
|
|
|
846
878
|
/**
|
|
847
|
-
*
|
|
848
|
-
*
|
|
879
|
+
* Atomically replace a staged regular file only after validating the exact
|
|
880
|
+
* staged source and expected destination.
|
|
849
881
|
*
|
|
850
|
-
* Both identities must describe regular files
|
|
851
|
-
* requests. Publication uses
|
|
852
|
-
*
|
|
853
|
-
* successor is preserved.
|
|
882
|
+
* Both identities must describe regular files in the same retained parent, not
|
|
883
|
+
* directories or detach-only requests. Publication uses an atomic namespace
|
|
884
|
+
* exchange so a substituted source or destination is never overwritten.
|
|
854
885
|
*/
|
|
855
886
|
export declare function exactReplacePath(sourcePath: string, destinationPath: string, expectedSource: NativeExactFileIdentity, expectedDestination: NativeExactFileIdentity): NativeExactUnlinkResult
|
|
856
887
|
|
|
@@ -1464,6 +1495,20 @@ export interface LineDiffPart {
|
|
|
1464
1495
|
value: string
|
|
1465
1496
|
}
|
|
1466
1497
|
|
|
1498
|
+
/**
|
|
1499
|
+
* Publish a staged regular file under a destination name that must not already
|
|
1500
|
+
* exist, using `linkat(2)` instead of a rename flag. This is the stand-in for
|
|
1501
|
+
* `rename_no_replace_path` on filesystems that implement no rename flag at all
|
|
1502
|
+
* (NFS answers `EINVAL`, pre-3.15 kernels `ENOSYS`), and it carries the same
|
|
1503
|
+
* no-overwrite guarantee because `linkat` fails with `EEXIST`.
|
|
1504
|
+
*
|
|
1505
|
+
* The source name survives the call. Callers holding a descriptor on the
|
|
1506
|
+
* staged object must keep it across this publication and unlink the staging
|
|
1507
|
+
* name only after releasing it: NFS silly-renames a still-open name instead of
|
|
1508
|
+
* removing it, leaving a second link on the published inode.
|
|
1509
|
+
*/
|
|
1510
|
+
export declare function linkNoReplacePath(sourcePath: string, destinationPath: string): NativeNoReplaceResult
|
|
1511
|
+
|
|
1467
1512
|
/**
|
|
1468
1513
|
* Walk the workspace once and return tree entries plus AGENTS.md candidates.
|
|
1469
1514
|
*
|
package/native/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export const Shell = nativeBindings.Shell;
|
|
|
30
30
|
|
|
31
31
|
// functions
|
|
32
32
|
export const __piNativesPublishOutcomeV1 = nativeBindings.__piNativesPublishOutcomeV1;
|
|
33
|
-
export const
|
|
33
|
+
export const __piNativesV0_12_11 = nativeBindings.__piNativesV0_12_11;
|
|
34
34
|
export const applyBashFixups = nativeBindings.applyBashFixups;
|
|
35
35
|
export const applyOwnerOnlyFdSecurity = nativeBindings.applyOwnerOnlyFdSecurity;
|
|
36
36
|
export const applyOwnerOnlyPathSecurity = nativeBindings.applyOwnerOnlyPathSecurity;
|
|
@@ -68,6 +68,7 @@ export const isoProbe = nativeBindings.isoProbe;
|
|
|
68
68
|
export const isoResolve = nativeBindings.isoResolve;
|
|
69
69
|
export const isoStart = nativeBindings.isoStart;
|
|
70
70
|
export const isoStop = nativeBindings.isoStop;
|
|
71
|
+
export const linkNoReplacePath = nativeBindings.linkNoReplacePath;
|
|
71
72
|
export const listWorkspace = nativeBindings.listWorkspace;
|
|
72
73
|
export const matchesKey = nativeBindings.matchesKey;
|
|
73
74
|
export const matchesKittySequence = nativeBindings.matchesKittySequence;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gajae-code/natives",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.11",
|
|
4
4
|
"description": "Native Rust bindings for grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"README.md"
|
|
62
62
|
],
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@gajae-code/natives-darwin-arm64": "0.12.
|
|
65
|
-
"@gajae-code/natives-darwin-x64": "0.12.
|
|
66
|
-
"@gajae-code/natives-linux-arm64": "0.12.
|
|
67
|
-
"@gajae-code/natives-linux-x64": "0.12.
|
|
68
|
-
"@gajae-code/natives-win32-x64": "0.12.
|
|
64
|
+
"@gajae-code/natives-darwin-arm64": "0.12.11",
|
|
65
|
+
"@gajae-code/natives-darwin-x64": "0.12.11",
|
|
66
|
+
"@gajae-code/natives-linux-arm64": "0.12.11",
|
|
67
|
+
"@gajae-code/natives-linux-x64": "0.12.11",
|
|
68
|
+
"@gajae-code/natives-win32-x64": "0.12.11"
|
|
69
69
|
},
|
|
70
70
|
"exports": {
|
|
71
71
|
".": {
|