@gajae-code/natives 0.12.7 → 0.12.8

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_8(): 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
@@ -1735,6 +1747,15 @@ export interface NativeExactFileIdentity {
1735
1747
  export interface NativeExactUnlinkResult {
1736
1748
  ok: boolean
1737
1749
  code?: string
1750
+ /**
1751
+ * True only when retained directory payloads were descriptor-scrubbed and
1752
+ * every file plus containing directory namespace was fsynced before return.
1753
+ */
1754
+ payloadDurable?: boolean
1755
+ /**
1756
+ * On Windows this is returned in the caller's namespace; retained handle
1757
+ * operations continue to use the volume-GUID canonical path internally.
1758
+ */
1738
1759
  detachedPath?: string
1739
1760
  retainedSuccessorPath?: string
1740
1761
  /**
@@ -1988,6 +2009,7 @@ export declare function readImageFromClipboard(): Promise<ClipboardImage | undef
1988
2009
  export interface RecoveryFsIdentity {
1989
2010
  dev: string
1990
2011
  ino: string
2012
+ nlink: string
1991
2013
  size: string
1992
2014
  mtimeNs: string
1993
2015
  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_8 = nativeBindings.__piNativesV0_12_8;
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;
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.8",
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.8",
65
+ "@gajae-code/natives-darwin-x64": "0.12.8",
66
+ "@gajae-code/natives-linux-arm64": "0.12.8",
67
+ "@gajae-code/natives-linux-x64": "0.12.8",
68
+ "@gajae-code/natives-win32-x64": "0.12.8"
69
69
  },
70
70
  "exports": {
71
71
  ".": {