@push.rocks/smartrust 2.2.0 → 2.4.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.
@@ -61,6 +61,15 @@ export interface IRustBridgeOptions extends IBinaryLocatorOptions {
61
61
  * closes the caller's source descriptors.
62
62
  */
63
63
  inheritedFileDescriptors?: readonly number[];
64
+ /**
65
+ * Opt in to one owned, one-shot binary pipe for a sensitive request in each
66
+ * spawned stdio generation. The pipe is appended after caller-owned inherited
67
+ * descriptors, so their child descriptor numbers remain unchanged.
68
+ */
69
+ sensitiveByteChannel?: {
70
+ /** Maximum raw sensitive payload size accepted by the bridge. */
71
+ maxPayloadSize: number;
72
+ };
64
73
  /** Timeout for individual requests in ms (default: 30000) */
65
74
  requestTimeoutMs?: number;
66
75
  /** Timeout for the ready event during spawn in ms (default: 10000) */
@@ -5,6 +5,20 @@ export interface IManagementRequest {
5
5
  id: string;
6
6
  method: string;
7
7
  params: Record<string, any>;
8
+ /** Value-free metadata for an associated one-shot binary frame. */
9
+ sensitive?: IManagementSensitivePayload;
10
+ }
11
+
12
+ export interface IManagementSensitivePayload {
13
+ protocol: 'smartrust-sensitive-v1';
14
+ fileDescriptor: number;
15
+ byteLength: number;
16
+ }
17
+
18
+ export interface IManagementSensitiveAck {
19
+ protocol: 'smartrust-sensitive-v1';
20
+ consumed: true;
21
+ byteLength: number;
8
22
  }
9
23
 
10
24
  /**
@@ -16,6 +30,10 @@ export interface IManagementResponse {
16
30
  result?: any;
17
31
  error?: string;
18
32
  errorCode?: string;
33
+ /** Optional structured details of a failure, for example per-field validation errors. */
34
+ errorData?: unknown;
35
+ /** Required after the receiver consumed the exact associated binary frame. */
36
+ sensitiveAck?: IManagementSensitiveAck;
19
37
  }
20
38
 
21
39
  /**
@@ -35,6 +35,12 @@ export interface IRustTransport extends plugins.events.EventEmitter {
35
35
  /** Write a string to the transport. Handles backpressure. */
36
36
  write(data: string): Promise<void>;
37
37
 
38
+ /** Child descriptor for the optional one-shot sensitive byte pipe. */
39
+ readonly sensitiveFileDescriptor?: number | null;
40
+
41
+ /** Write and close one correlated binary frame. Available only in stdio mode. */
42
+ writeSensitiveFrame?(requestId: string, data: Uint8Array<ArrayBuffer>): Promise<void>;
43
+
38
44
  /** Disconnect the transport. For stdio: kills the process. For socket: closes the connection. */
39
45
  disconnect(): void;
40
46
 
package/ts/plugins.ts CHANGED
@@ -5,8 +5,9 @@ import * as childProcess from 'child_process';
5
5
  import * as events from 'events';
6
6
  import * as url from 'url';
7
7
  import * as net from 'net';
8
+ import * as stream from 'stream';
8
9
 
9
- export { path, fs, childProcess, events, url, net };
10
+ export { path, fs, childProcess, events, url, net, stream };
10
11
 
11
12
  // @push.rocks scope
12
13
  import * as smartpath from '@push.rocks/smartpath';