@push.rocks/smartrust 2.3.0 → 2.5.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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.rustbridge.d.ts +20 -2
- package/dist_ts/classes.rustbridge.js +165 -55
- package/dist_ts/classes.rustbridgerequesterror.d.ts +31 -0
- package/dist_ts/classes.rustbridgerequesterror.js +11 -1
- package/dist_ts/index.d.ts +1 -1
- package/dist_ts/index.js +1 -1
- package/dist_ts/interfaces/config.d.ts +16 -1
- package/dist_ts/interfaces/ipc.d.ts +19 -0
- package/package.json +5 -5
- package/readme.md +116 -20
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.rustbridge.ts +224 -63
- package/ts/classes.rustbridgerequesterror.ts +39 -0
- package/ts/index.ts +2 -0
- package/ts/interfaces/config.ts +17 -1
- package/ts/interfaces/ipc.ts +20 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartrust',
|
|
6
|
-
version: '2.
|
|
6
|
+
version: '2.5.0',
|
|
7
7
|
description: 'A type-safe bridge between JavaScript engines and Rust binaries.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx1QkFBdUI7SUFDN0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLGtFQUFrRTtDQUNoRixDQUFBIn0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
2
|
import { StreamingResponse } from './classes.streamingresponse.js';
|
|
3
|
-
import type { IRustBridgeOptions, IRustBridgeRequestOptions, IRustBridgeTerminateOptions, ISocketConnectOptions, TCommandMap, TStreamingCommandKeys, TExtractChunk } from './interfaces/index.js';
|
|
3
|
+
import type { IRustBridgeOptions, IRustBridgeRequestOptions, IRustBridgeStreamingRequestOptions, IRustBridgeTerminateOptions, ISocketConnectOptions, TCommandMap, TStreamingCommandKeys, TExtractChunk } from './interfaces/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Generic bridge between TypeScript and a Rust binary.
|
|
6
6
|
* Communicates via JSON-over-stdin/stdout IPC protocol (stdio mode)
|
|
@@ -25,6 +25,9 @@ export declare class RustBridge<TCommands extends TCommandMap = TCommandMap> ext
|
|
|
25
25
|
private sensitiveRequestId;
|
|
26
26
|
private sensitiveUsedGeneration;
|
|
27
27
|
private regularRequestPreparations;
|
|
28
|
+
/** Whether the current transport generation's ready event advertised `cancel`. */
|
|
29
|
+
private remoteCancelSupported;
|
|
30
|
+
private remoteCancellations;
|
|
28
31
|
constructor(options: IRustBridgeOptions);
|
|
29
32
|
/**
|
|
30
33
|
* Spawn the Rust binary and wait for it to signal readiness.
|
|
@@ -65,7 +68,7 @@ export declare class RustBridge<TCommands extends TCommandMap = TCommandMap> ext
|
|
|
65
68
|
* Returns a StreamingResponse that yields chunks via `for await...of`
|
|
66
69
|
* and exposes `.result` for the final response.
|
|
67
70
|
*/
|
|
68
|
-
sendCommandStreaming<K extends string & TStreamingCommandKeys<TCommands>>(method: K, params: TCommands[K]['params']): StreamingResponse<TExtractChunk<TCommands[K]>, TCommands[K]['result']>;
|
|
71
|
+
sendCommandStreaming<K extends string & TStreamingCommandKeys<TCommands>>(method: K, params: TCommands[K]['params'], options?: IRustBridgeStreamingRequestOptions): StreamingResponse<TExtractChunk<TCommands[K]>, TCommands[K]['result']>;
|
|
69
72
|
/**
|
|
70
73
|
* Terminate the active transport and wait for confirmed closure.
|
|
71
74
|
* For stdio this confirms child exit after SIGTERM/SIGKILL escalation.
|
|
@@ -83,6 +86,21 @@ export declare class RustBridge<TCommands extends TCommandMap = TCommandMap> ext
|
|
|
83
86
|
private isStartingGeneration;
|
|
84
87
|
private isCurrentTransport;
|
|
85
88
|
private handleLine;
|
|
89
|
+
/** Start or restart the inactivity deadline of one streaming request. */
|
|
90
|
+
private armStreamingTimeout;
|
|
91
|
+
/**
|
|
92
|
+
* Reject a pending request on timeout or abort. When the request was
|
|
93
|
+
* already written to a transport that accepts cancel frames, send one and
|
|
94
|
+
* attach the remote settlement to the rejection.
|
|
95
|
+
*/
|
|
96
|
+
private abandonPendingRequest;
|
|
97
|
+
/** Write one cancel frame and track the original id until Rust answers it. */
|
|
98
|
+
private sendRemoteCancel;
|
|
99
|
+
private settleRemoteCancellation;
|
|
100
|
+
/** Settle every tracked cancellation as disconnected after transport closure. */
|
|
101
|
+
private settleAllRemoteCancellations;
|
|
102
|
+
/** Read the `cancel` opt-in from a ready event's `capabilities`. */
|
|
103
|
+
private readCancelCapability;
|
|
86
104
|
private acceptSensitiveResponse;
|
|
87
105
|
private markSensitiveWriteComplete;
|
|
88
106
|
private settleManagementResponse;
|