@gajae-code/natives 0.12.7 → 0.12.10

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
@@ -491,7 +491,7 @@ export declare function __piNativesPublishOutcomeV1(): void
491
491
  * `packages/natives/native/index.js` (which derives the name from
492
492
  * `package.json#version`).
493
493
  */
494
- export declare function __piNativesV0_12_7(): void
494
+ export declare function __piNativesV0_12_10(): void
495
495
 
496
496
  /**
497
497
  * Apply conservative pre-execution rewrites to a bash command.
@@ -835,13 +835,25 @@ export declare enum Ellipsis {
835
835
  export declare function encodeSixel(bytes: Uint8Array, targetWidthPx: number, targetHeightPx: number): string
836
836
 
837
837
  /**
838
- * Remove an already durably planned detached directory only when a fresh
839
- * descriptor-relative snapshot exactly equals the persisted snapshot. The
840
- * caller-planned root remains in place while its opened descriptor is
841
- * authoritative throughout recursive removal.
838
+ * Remove a directory tree only when a fresh descriptor-relative snapshot
839
+ * exactly equals the persisted snapshot. POSIX first no-replace detaches the
840
+ * verified root to its deterministic `.removing` sibling; the reopened
841
+ * detached descriptor remains authoritative throughout payload scrubbing and
842
+ * replay.
842
843
  */
843
844
  export declare function exactRemoveDirectoryTree(path: string, snapshot: NativeDirectoryTreeSnapshot, parentIdentity?: NativeDirectoryParentIdentity | undefined | null): NativeExactUnlinkResult
844
845
 
846
+ /**
847
+ * Replace a staged regular file only after validating the exact staged source
848
+ * and deleting the exact expected destination.
849
+ *
850
+ * Both identities must describe regular files, not directories or detach-only
851
+ * requests. Publication uses the retained verified source handle and a
852
+ * no-replace rename, so source substitution is rejected and a destination
853
+ * successor is preserved.
854
+ */
855
+ export declare function exactReplacePath(sourcePath: string, destinationPath: string, expectedSource: NativeExactFileIdentity, expectedDestination: NativeExactFileIdentity): NativeExactUnlinkResult
856
+
845
857
  /**
846
858
  * Restore only the detached object that still has the supplied platform
847
859
  * identity. The detached and original paths must retain the same validated
@@ -1452,6 +1464,20 @@ export interface LineDiffPart {
1452
1464
  value: string
1453
1465
  }
1454
1466
 
1467
+ /**
1468
+ * Publish a staged regular file under a destination name that must not already
1469
+ * exist, using `linkat(2)` instead of a rename flag. This is the stand-in for
1470
+ * `rename_no_replace_path` on filesystems that implement no rename flag at all
1471
+ * (NFS answers `EINVAL`, pre-3.15 kernels `ENOSYS`), and it carries the same
1472
+ * no-overwrite guarantee because `linkat` fails with `EEXIST`.
1473
+ *
1474
+ * The source name survives the call. Callers holding a descriptor on the
1475
+ * staged object must keep it across this publication and unlink the staging
1476
+ * name only after releasing it: NFS silly-renames a still-open name instead of
1477
+ * removing it, leaving a second link on the published inode.
1478
+ */
1479
+ export declare function linkNoReplacePath(sourcePath: string, destinationPath: string): NativeNoReplaceResult
1480
+
1455
1481
  /**
1456
1482
  * Walk the workspace once and return tree entries plus AGENTS.md candidates.
1457
1483
  *
@@ -1735,6 +1761,15 @@ export interface NativeExactFileIdentity {
1735
1761
  export interface NativeExactUnlinkResult {
1736
1762
  ok: boolean
1737
1763
  code?: string
1764
+ /**
1765
+ * True only when retained directory payloads were descriptor-scrubbed and
1766
+ * every file plus containing directory namespace was fsynced before return.
1767
+ */
1768
+ payloadDurable?: boolean
1769
+ /**
1770
+ * On Windows this is returned in the caller's namespace; retained handle
1771
+ * operations continue to use the volume-GUID canonical path internally.
1772
+ */
1738
1773
  detachedPath?: string
1739
1774
  retainedSuccessorPath?: string
1740
1775
  /**
@@ -1988,6 +2023,7 @@ export declare function readImageFromClipboard(): Promise<ClipboardImage | undef
1988
2023
  export interface RecoveryFsIdentity {
1989
2024
  dev: string
1990
2025
  ino: string
2026
+ nlink: string
1991
2027
  size: string
1992
2028
  mtimeNs: string
1993
2029
  ctimeNs: string
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 __piNativesV0_12_7 = nativeBindings.__piNativesV0_12_7;
33
+ export const __piNativesV0_12_10 = nativeBindings.__piNativesV0_12_10;
34
34
  export const applyBashFixups = nativeBindings.applyBashFixups;
35
35
  export const applyOwnerOnlyFdSecurity = nativeBindings.applyOwnerOnlyFdSecurity;
36
36
  export const applyOwnerOnlyPathSecurity = nativeBindings.applyOwnerOnlyPathSecurity;
@@ -43,6 +43,7 @@ export const detectMacOSAppearance = nativeBindings.detectMacOSAppearance;
43
43
  export const diffLines = nativeBindings.diffLines;
44
44
  export const encodeSixel = nativeBindings.encodeSixel;
45
45
  export const exactRemoveDirectoryTree = nativeBindings.exactRemoveDirectoryTree;
46
+ export const exactReplacePath = nativeBindings.exactReplacePath;
46
47
  export const exactRestore = nativeBindings.exactRestore;
47
48
  export const exactUnlink = nativeBindings.exactUnlink;
48
49
  export const executeShell = nativeBindings.executeShell;
@@ -67,6 +68,7 @@ export const isoProbe = nativeBindings.isoProbe;
67
68
  export const isoResolve = nativeBindings.isoResolve;
68
69
  export const isoStart = nativeBindings.isoStart;
69
70
  export const isoStop = nativeBindings.isoStop;
71
+ export const linkNoReplacePath = nativeBindings.linkNoReplacePath;
70
72
  export const listWorkspace = nativeBindings.listWorkspace;
71
73
  export const matchesKey = nativeBindings.matchesKey;
72
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.7",
3
+ "version": "0.12.10",
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.7",
65
- "@gajae-code/natives-darwin-x64": "0.12.7",
66
- "@gajae-code/natives-linux-arm64": "0.12.7",
67
- "@gajae-code/natives-linux-x64": "0.12.7",
68
- "@gajae-code/natives-win32-x64": "0.12.7"
64
+ "@gajae-code/natives-darwin-arm64": "0.12.10",
65
+ "@gajae-code/natives-darwin-x64": "0.12.10",
66
+ "@gajae-code/natives-linux-arm64": "0.12.10",
67
+ "@gajae-code/natives-linux-x64": "0.12.10",
68
+ "@gajae-code/natives-win32-x64": "0.12.10"
69
69
  },
70
70
  "exports": {
71
71
  ".": {