@gajae-code/natives 0.13.3 → 0.14.0

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
@@ -103,56 +103,6 @@ export declare class NativeRetainedBrokerPublication {
103
103
  close(): NativeBrokerPublicationOperation
104
104
  }
105
105
 
106
- /**
107
- * In-process, session-independent lifecycle **control** server exposed to TS.
108
- *
109
- * Transport-only: it authenticates (handshake + per-frame), forwards valid
110
- * lifecycle requests to the TS daemon, and routes TS-produced responses back
111
- * by request id. All policy/spawn/idempotency/rate-limit/audit lives in TS.
112
- *
113
- * Call order: construct, [`Self::on_lifecycle_request`] (before start), then
114
- * [`Self::start`].
115
- */
116
- export declare class NotificationControlServer {
117
- /**
118
- * Create a control server authenticated by `token` and owned by `owner_id`.
119
- *
120
- * `agent_dir` (when given) is where the control discovery file is written
121
- * (e.g. the daemon agent dir).
122
- */
123
- constructor(token: string, ownerId: string, agentDir?: string | undefined | null)
124
- /**
125
- * Register the lifecycle-request callback. Must be called before
126
- * [`Self::start`].
127
- */
128
- onLifecycleRequest(callback: (err: null | Error, req: LifecycleRequestEvent) => void): void
129
- /**
130
- * Bind the loopback control endpoint and start serving. Resolves with the
131
- * bound endpoint info once the socket is bound.
132
- *
133
- * # Errors
134
- * Fails if already started, a non-loopback bind is requested, or the socket
135
- * cannot be bound.
136
- */
137
- start(): Promise<ControlEndpoint>
138
- /**
139
- * Send a host-produced lifecycle response, routed back to the originating
140
- * client by request id. `response_json` is a JSON `LifecycleServerMessage`.
141
- *
142
- * # Errors
143
- * Fails if not started or `response_json` is not a valid
144
- * `LifecycleServerMessage`.
145
- */
146
- respond(responseJson: string): void
147
- /** Number of currently connected control clients. */
148
- clientCount(): number
149
- /**
150
- * Stop the control server (idempotent) and remove the control discovery
151
- * file.
152
- */
153
- stop(): void
154
- }
155
-
156
106
  /** In-process notification server handle exposed to TypeScript. */
157
107
  export declare class NotificationServer {
158
108
  /**
@@ -266,7 +216,7 @@ export declare class NotificationServer {
266
216
  /**
267
217
  * Publish a replayable `session_ready` readiness signal. `ready_json` is a
268
218
  * JSON `SessionReady`. Unlike [`Self::push_frame`], this frame is buffered
269
- * and replayed to late-connecting clients, so a lifecycle control client
219
+ * and replayed to late-connecting clients, so an SDK client
270
220
  * can wait for readiness deterministically instead of treating WS-open as
271
221
  * readiness.
272
222
  *
@@ -396,6 +346,16 @@ export declare class PtySession {
396
346
  kill(): void
397
347
  }
398
348
 
349
+ /** Retained descriptor-relative regular-file authority for streamed imports. */
350
+ export declare class RecoveryFsFile {
351
+ /** Return the current identity of the retained regular file. */
352
+ identity(): RecoveryFsResult
353
+ /** Read one bounded chunk from the retained file descriptor. */
354
+ readChunk(offset: number, maxBytes: number): RecoveryFsResult
355
+ /** Close the retained regular-file descriptor. */
356
+ close(): RecoveryFsResult
357
+ }
358
+
399
359
  /** Retained trusted-root authority for Linux recovery artifacts. */
400
360
  export declare class RecoveryFsRoot {
401
361
  /** Return the stable identity of the retained root descriptor. */
@@ -405,6 +365,16 @@ export declare class RecoveryFsRoot {
405
365
  * identity evidence.
406
366
  */
407
367
  retainManagedDirectory(relativePath: string, expectedDev: string, expectedIno: string): RecoveryFsRoot
368
+ /**
369
+ * Open one regular, single-linked descendant through retained no-follow
370
+ * traversal.
371
+ */
372
+ openFile(relativePath: string): RecoveryFsFile
373
+ /**
374
+ * Enumerate regular, single-linked descendants through retained directory
375
+ * descriptors. The returned data is a JSON array of relative paths.
376
+ */
377
+ listFiles(maxEntries: number): RecoveryFsResult
408
378
  /** Stat one existing regular, single-linked file without following links. */
409
379
  stat(relativePath: string): RecoveryFsResult
410
380
  /** Read one existing regular, single-linked file without following links. */
@@ -494,6 +464,14 @@ export declare class Shell {
494
464
  * Returns `Ok(())` even when no commands are running.
495
465
  */
496
466
  abort(): Promise<void>
467
+ /**
468
+ * Abort in-flight commands and release the retained shell session.
469
+ *
470
+ * `abort` leaves a completed session alive for reuse, so a caller that is
471
+ * finished with a shell must call this to release the native process and
472
+ * let the host exit. Returns `Ok(())` even when nothing is retained.
473
+ */
474
+ close(): Promise<void>
497
475
  }
498
476
 
499
477
  /**
@@ -523,7 +501,7 @@ export declare function __piNativesPublishOutcomeV1(): void
523
501
  * `packages/natives/native/index.js` (which derives the name from
524
502
  * `package.json#version`).
525
503
  */
526
- export declare function __piNativesV0_13_3(): void
504
+ export declare function __piNativesV0_14_0(): void
527
505
 
528
506
  /**
529
507
  * Apply conservative pre-execution rewrites to a bash command.
@@ -765,9 +743,10 @@ export interface ClipboardImage {
765
743
  /**
766
744
  * Capture the primary display for JS callers (macOS).
767
745
  *
768
- * Requires the Screen Recording permission. This is the read-only `screenshot`
769
- * primitive of the computer-use tool; input primitives land behind the same
770
- * surface once the Accessibility gate is satisfied in a granted `gjc` process.
746
+ * Requires the Screen & System Audio Recording permission. This is the
747
+ * read-only `screenshot` primitive of the computer-use tool; input primitives
748
+ * land behind the same surface once the Accessibility gate is satisfied in a
749
+ * granted `gjc` process.
771
750
  *
772
751
  * # Errors
773
752
  * Returns an error when capture fails (e.g. Screen Recording not granted).
@@ -810,18 +789,6 @@ export interface ContextLine {
810
789
  line: string
811
790
  }
812
791
 
813
- /** Bound endpoint info returned from [`NotificationControlServer::start`]. */
814
- export interface ControlEndpoint {
815
- /** Bind host (loopback). */
816
- host: string
817
- /** Bound port. */
818
- port: number
819
- /** `ws://host:port` URL. */
820
- url: string
821
- /** The daemon owner id this control endpoint serves. */
822
- ownerId: string
823
- }
824
-
825
792
  /**
826
793
  * Copy plain text to the system clipboard.
827
794
  *
@@ -1471,20 +1438,6 @@ export interface KnownGoodFrameStats {
1471
1438
  fileAttachmentRustBase64Chars: number
1472
1439
  }
1473
1440
 
1474
- /** A lifecycle request forwarded to the TypeScript daemon for orchestration. */
1475
- export interface LifecycleRequestEvent {
1476
- /** One of `"session_create"`, `"session_close"`, `"session_resume"`. */
1477
- kind: string
1478
- /** The request correlation id to echo in the response. */
1479
- requestId: string
1480
- /**
1481
- * JSON-encoded `LifecycleClientMessage` with the control `token` stripped.
1482
- * The ingress already authenticated the frame, so the secret is never
1483
- * forwarded into JS; all other (non-token) fields are preserved.
1484
- */
1485
- payloadJson: string
1486
- }
1487
-
1488
1441
  /**
1489
1442
  * One diff component, mirroring jsdiff's change object (sans `count`, which
1490
1443
  * the TS `generateDiffString` formatter does not consume).
@@ -1825,6 +1778,13 @@ export interface NativeExactUnlinkResult {
1825
1778
  * neither a stale detached object nor a publisher successor.
1826
1779
  */
1827
1780
  retainedUnknownPath?: string
1781
+ /**
1782
+ * Hex-formatted Windows NTSTATUS of the underlying pre-mutation failure
1783
+ * (e.g. `0xC0000043` for `STATUS_SHARING_VIOLATION`). Path-free by design;
1784
+ * always absent on success, on non-Windows platforms, and after any
1785
+ * namespace mutation.
1786
+ */
1787
+ windowsErrorCode?: string
1828
1788
  }
1829
1789
 
1830
1790
  /** Dedicated result for an atomic no-replace namespace publication. */
package/native/index.js CHANGED
@@ -21,16 +21,16 @@ export const ComputerController = nativeBindings.ComputerController;
21
21
  export const MacAppearanceObserver = nativeBindings.MacAppearanceObserver;
22
22
  export const MacOSPowerAssertion = nativeBindings.MacOSPowerAssertion;
23
23
  export const NativeRetainedBrokerPublication = nativeBindings.NativeRetainedBrokerPublication;
24
- export const NotificationControlServer = nativeBindings.NotificationControlServer;
25
24
  export const NotificationServer = nativeBindings.NotificationServer;
26
25
  export const Process = nativeBindings.Process;
27
26
  export const PtySession = nativeBindings.PtySession;
27
+ export const RecoveryFsFile = nativeBindings.RecoveryFsFile;
28
28
  export const RecoveryFsRoot = nativeBindings.RecoveryFsRoot;
29
29
  export const Shell = nativeBindings.Shell;
30
30
 
31
31
  // functions
32
32
  export const __piNativesPublishOutcomeV1 = nativeBindings.__piNativesPublishOutcomeV1;
33
- export const __piNativesV0_13_3 = nativeBindings.__piNativesV0_13_3;
33
+ export const __piNativesV0_14_0 = nativeBindings.__piNativesV0_14_0;
34
34
  export const applyBashFixups = nativeBindings.applyBashFixups;
35
35
  export const applyOwnerOnlyFdSecurity = nativeBindings.applyOwnerOnlyFdSecurity;
36
36
  export const applyOwnerOnlyPathSecurity = nativeBindings.applyOwnerOnlyPathSecurity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gajae-code/natives",
3
- "version": "0.13.3",
3
+ "version": "0.14.0",
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.13.3",
65
- "@gajae-code/natives-darwin-x64": "0.13.3",
66
- "@gajae-code/natives-linux-arm64": "0.13.3",
67
- "@gajae-code/natives-linux-x64": "0.13.3",
68
- "@gajae-code/natives-win32-x64": "0.13.3"
64
+ "@gajae-code/natives-darwin-arm64": "0.14.0",
65
+ "@gajae-code/natives-darwin-x64": "0.14.0",
66
+ "@gajae-code/natives-linux-arm64": "0.14.0",
67
+ "@gajae-code/natives-linux-x64": "0.14.0",
68
+ "@gajae-code/natives-win32-x64": "0.14.0"
69
69
  },
70
70
  "exports": {
71
71
  ".": {