@comake/skl-js-engine 1.0.8 → 1.0.9
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/JsExecutor/PermissionBuilder.d.ts +13 -0
- package/dist/JsExecutor/PermissionBuilder.js +58 -0
- package/dist/JsExecutor/PermissionBuilder.js.map +1 -0
- package/dist/JsExecutor/constants.d.ts +26 -0
- package/dist/JsExecutor/constants.js +30 -0
- package/dist/JsExecutor/constants.js.map +1 -0
- package/dist/JsExecutor/denoUtils.d.ts +9 -0
- package/dist/JsExecutor/denoUtils.js +24 -0
- package/dist/JsExecutor/denoUtils.js.map +1 -0
- package/dist/JsExecutor/errors.d.ts +39 -0
- package/dist/JsExecutor/errors.js +67 -0
- package/dist/JsExecutor/errors.js.map +1 -0
- package/dist/JsExecutor/examples/basic/index.d.ts +0 -0
- package/dist/JsExecutor/examples/basic/index.js +46 -0
- package/dist/JsExecutor/examples/basic/index.js.map +1 -0
- package/dist/JsExecutor/examples/basic/process.d.ts +0 -0
- package/dist/JsExecutor/examples/basic/process.js +34 -0
- package/dist/JsExecutor/examples/basic/process.js.map +1 -0
- package/dist/JsExecutor/examples/jsExecutor/index.d.ts +1 -0
- package/dist/JsExecutor/examples/jsExecutor/index.js +48 -0
- package/dist/JsExecutor/examples/jsExecutor/index.js.map +1 -0
- package/dist/JsExecutor/examples/jsExecutor/process.d.ts +1 -0
- package/dist/JsExecutor/examples/jsExecutor/process.js +59 -0
- package/dist/JsExecutor/examples/jsExecutor/process.js.map +1 -0
- package/dist/JsExecutor/index.d.ts +6 -0
- package/dist/JsExecutor/index.js +36 -0
- package/dist/JsExecutor/index.js.map +1 -0
- package/dist/JsExecutor/jsExecutor.d.ts +67 -0
- package/dist/JsExecutor/jsExecutor.js +159 -0
- package/dist/JsExecutor/jsExecutor.js.map +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.d.ts +164 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.js +334 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcClient.js.map +1 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.d.ts +124 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.js +391 -0
- package/dist/JsExecutor/jsonRpc/JsonRpcServer.js.map +1 -0
- package/dist/JsExecutor/jsonRpc/index.d.ts +3 -0
- package/dist/JsExecutor/jsonRpc/index.js +23 -0
- package/dist/JsExecutor/jsonRpc/index.js.map +1 -0
- package/dist/JsExecutor/jsonRpc/types.d.ts +192 -0
- package/dist/JsExecutor/jsonRpc/types.js +37 -0
- package/dist/JsExecutor/jsonRpc/types.js.map +1 -0
- package/dist/JsExecutor/transport/StdioTransport.d.ts +226 -0
- package/dist/JsExecutor/transport/StdioTransport.js +634 -0
- package/dist/JsExecutor/transport/StdioTransport.js.map +1 -0
- package/dist/JsExecutor/transport/Transport.d.ts +71 -0
- package/dist/JsExecutor/transport/Transport.js +14 -0
- package/dist/JsExecutor/transport/Transport.js.map +1 -0
- package/dist/JsExecutor/transport/base/BaseTransport.d.ts +50 -0
- package/dist/JsExecutor/transport/base/BaseTransport.js +68 -0
- package/dist/JsExecutor/transport/base/BaseTransport.js.map +1 -0
- package/dist/JsExecutor/transport/index.d.ts +12 -0
- package/dist/JsExecutor/transport/index.js +36 -0
- package/dist/JsExecutor/transport/index.js.map +1 -0
- package/dist/JsExecutor/transport/process/ProcessManager.d.ts +95 -0
- package/dist/JsExecutor/transport/process/ProcessManager.js +214 -0
- package/dist/JsExecutor/transport/process/ProcessManager.js.map +1 -0
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.d.ts +86 -0
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js +215 -0
- package/dist/JsExecutor/transport/stdio/ChildStdioTransport.js.map +1 -0
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.d.ts +80 -0
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js +263 -0
- package/dist/JsExecutor/transport/stdio/ParentStdioTransport.js.map +1 -0
- package/dist/JsExecutor/transport/utils/MessageUtils.d.ts +67 -0
- package/dist/JsExecutor/transport/utils/MessageUtils.js +135 -0
- package/dist/JsExecutor/transport/utils/MessageUtils.js.map +1 -0
- package/dist/JsExecutor/types.d.ts +112 -0
- package/dist/JsExecutor/types.js +3 -0
- package/dist/JsExecutor/types.js.map +1 -0
- package/dist/SklEngine.d.ts +9 -5
- package/dist/SklEngine.js +79 -87
- package/dist/SklEngine.js.map +1 -1
- package/dist/SklEngineOptions.d.ts +4 -0
- package/dist/constants.d.ts +1 -1
- package/dist/executor.js +9 -3
- package/dist/index.d.ts +12 -11
- package/dist/index.js +17 -15
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +5 -1
- package/dist/logger.js +21 -4
- package/dist/logger.js.map +1 -1
- package/dist/util/Vocabularies/Shared.d.ts +1 -1
- package/dist/util/Vocabularies/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Jsexecutor.d.ts +0 -77
- package/dist/Jsexecutor.js +0 -184
- package/dist/Jsexecutor.js.map +0 -1
- package/dist/storage/operator/ArrayEqual.d.ts +0 -3
- package/dist/storage/operator/ArrayEqual.js +0 -13
- package/dist/storage/operator/ArrayEqual.js.map +0 -1
- package/dist/util/Vocabularies/core.d.ts +0 -7
- package/dist/util/Vocabularies/core.js +0 -119
- package/dist/util/Vocabularies/core.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ExecutionOptions, ExecutionResult } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Message handler for incoming transport messages
|
|
4
|
+
*/
|
|
5
|
+
export declare type MessageHandler<T = any> = (message: T) => Promise<any> | any;
|
|
6
|
+
/**
|
|
7
|
+
* Transport connection status
|
|
8
|
+
*/
|
|
9
|
+
export declare enum TransportStatus {
|
|
10
|
+
disconnected = "disconnected",
|
|
11
|
+
connecting = "connecting",
|
|
12
|
+
connected = "connected",
|
|
13
|
+
error = "error"
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Transport events
|
|
17
|
+
*/
|
|
18
|
+
export interface TransportEvents {
|
|
19
|
+
statusChange: (status: TransportStatus) => void;
|
|
20
|
+
error: (error: Error) => void;
|
|
21
|
+
message: (message: any) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Transport configuration options
|
|
25
|
+
*/
|
|
26
|
+
export interface TransportConfig {
|
|
27
|
+
timeout?: number;
|
|
28
|
+
retryAttempts?: number;
|
|
29
|
+
retryDelay?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Abstract Transport interface for communication between JSExecutor and execution environment
|
|
33
|
+
*/
|
|
34
|
+
export interface Transport {
|
|
35
|
+
/**
|
|
36
|
+
* Current transport status
|
|
37
|
+
*/
|
|
38
|
+
readonly status: TransportStatus;
|
|
39
|
+
/**
|
|
40
|
+
* Initialize the transport connection
|
|
41
|
+
* @param config - Transport configuration
|
|
42
|
+
*/
|
|
43
|
+
initialize: (config?: TransportConfig) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Send a message through the transport
|
|
46
|
+
* @param message - Message to send
|
|
47
|
+
* @returns Promise resolving to response
|
|
48
|
+
*/
|
|
49
|
+
send: <TRequest, TResponse>(message: TRequest) => Promise<TResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Register a message handler for incoming messages
|
|
52
|
+
* @param handler - Message handler function
|
|
53
|
+
*/
|
|
54
|
+
onMessage: <T>(handler: MessageHandler<T>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Execute code using this transport
|
|
57
|
+
* @param code - JavaScript code to execute
|
|
58
|
+
* @param args - Arguments to pass to the code
|
|
59
|
+
* @param skdsEndpointUrl - SKDS endpoint URL
|
|
60
|
+
* @param options - Execution options
|
|
61
|
+
*/
|
|
62
|
+
execute?: (code: string, args: Record<string, any>, skdsEndpointUrl: string, options: Required<ExecutionOptions>) => Promise<ExecutionResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Close the transport connection
|
|
65
|
+
*/
|
|
66
|
+
close: () => Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if the transport is ready for communication
|
|
69
|
+
*/
|
|
70
|
+
isReady: () => boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransportStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Transport connection status
|
|
6
|
+
*/
|
|
7
|
+
var TransportStatus;
|
|
8
|
+
(function (TransportStatus) {
|
|
9
|
+
TransportStatus["disconnected"] = "disconnected";
|
|
10
|
+
TransportStatus["connecting"] = "connecting";
|
|
11
|
+
TransportStatus["connected"] = "connected";
|
|
12
|
+
TransportStatus["error"] = "error";
|
|
13
|
+
})(TransportStatus = exports.TransportStatus || (exports.TransportStatus = {}));
|
|
14
|
+
//# sourceMappingURL=Transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transport.js","sourceRoot":"","sources":["../../../src/JsExecutor/transport/Transport.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;IACvB,kCAAe,CAAA;AACjB,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'node:events';
|
|
3
|
+
import { Logger } from '../../../logger';
|
|
4
|
+
import type { MessageHandler, Transport, TransportConfig, TransportEvents } from '../Transport';
|
|
5
|
+
import { TransportStatus } from '../Transport';
|
|
6
|
+
/**
|
|
7
|
+
* Base transport class providing common functionality for all transport implementations
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class BaseTransport extends EventEmitter implements Transport {
|
|
10
|
+
protected internalStatus: TransportStatus;
|
|
11
|
+
protected messageHandler?: MessageHandler;
|
|
12
|
+
protected name?: string;
|
|
13
|
+
readonly logger: Logger;
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Set a name for this transport (used in logging)
|
|
17
|
+
*/
|
|
18
|
+
setName(name: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get current transport status
|
|
21
|
+
*/
|
|
22
|
+
get status(): TransportStatus;
|
|
23
|
+
/**
|
|
24
|
+
* Register a message handler for incoming messages
|
|
25
|
+
*/
|
|
26
|
+
onMessage<T>(handler: MessageHandler<T>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Register an event listener
|
|
29
|
+
*/
|
|
30
|
+
on<TKey extends keyof TransportEvents>(event: TKey, handler: TransportEvents[TKey]): this;
|
|
31
|
+
/**
|
|
32
|
+
* Remove an event listener
|
|
33
|
+
*/
|
|
34
|
+
off<TKey extends keyof TransportEvents>(event: TKey, handler: TransportEvents[TKey]): this;
|
|
35
|
+
/**
|
|
36
|
+
* Set transport status and emit event
|
|
37
|
+
*/
|
|
38
|
+
protected setStatus(status: TransportStatus): void;
|
|
39
|
+
/**
|
|
40
|
+
* Handle errors and emit error events
|
|
41
|
+
*/
|
|
42
|
+
handleError(error: Error, context?: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Abstract methods to be implemented by concrete transport classes
|
|
45
|
+
*/
|
|
46
|
+
abstract initialize(config?: TransportConfig): Promise<void>;
|
|
47
|
+
abstract send<TRequest, TResponse>(message: TRequest): Promise<TResponse>;
|
|
48
|
+
abstract close(): Promise<void>;
|
|
49
|
+
abstract isReady(): boolean;
|
|
50
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseTransport = void 0;
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
const logger_1 = require("../../../logger");
|
|
6
|
+
const Transport_1 = require("../Transport");
|
|
7
|
+
/**
|
|
8
|
+
* Base transport class providing common functionality for all transport implementations
|
|
9
|
+
*/
|
|
10
|
+
class BaseTransport extends node_events_1.EventEmitter {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.internalStatus = Transport_1.TransportStatus.disconnected;
|
|
14
|
+
this.logger = logger_1.Logger.getInstance();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Set a name for this transport (used in logging)
|
|
18
|
+
*/
|
|
19
|
+
setName(name) {
|
|
20
|
+
this.name = name;
|
|
21
|
+
this.logger.setMetadata({ name, transport: this.constructor.name });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get current transport status
|
|
25
|
+
*/
|
|
26
|
+
get status() {
|
|
27
|
+
return this.internalStatus;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Register a message handler for incoming messages
|
|
31
|
+
*/
|
|
32
|
+
onMessage(handler) {
|
|
33
|
+
this.messageHandler = handler;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Register an event listener
|
|
37
|
+
*/
|
|
38
|
+
on(event, handler) {
|
|
39
|
+
return super.on(event, handler);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Remove an event listener
|
|
43
|
+
*/
|
|
44
|
+
off(event, handler) {
|
|
45
|
+
return super.off(event, handler);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Set transport status and emit event
|
|
49
|
+
*/
|
|
50
|
+
setStatus(status) {
|
|
51
|
+
if (this.internalStatus !== status) {
|
|
52
|
+
const previousStatus = this.internalStatus;
|
|
53
|
+
this.internalStatus = status;
|
|
54
|
+
this.logger.log(`Transport status changed: ${previousStatus} -> ${status}`);
|
|
55
|
+
this.emit('statusChange', status);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Handle errors and emit error events
|
|
60
|
+
*/
|
|
61
|
+
handleError(error, context) {
|
|
62
|
+
const errorMessage = context ? `${context}: ${error.message}` : error.message;
|
|
63
|
+
this.logger.error(errorMessage, error);
|
|
64
|
+
this.emit('error', error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.BaseTransport = BaseTransport;
|
|
68
|
+
//# sourceMappingURL=BaseTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseTransport.js","sourceRoot":"","sources":["../../../../src/JsExecutor/transport/base/BaseTransport.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,4CAAyC;AAEzC,4CAA+C;AAE/C;;GAEG;AACH,MAAsB,aAAc,SAAQ,0BAAY;IAMtD;QACE,KAAK,EAAE,CAAC;QANA,mBAAc,GAAoB,2BAAe,CAAC,YAAY,CAAC;QAGzD,WAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;IAI9C,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,IAAY;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,SAAS,CAAI,OAA0B;QAC5C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,EAAE,CAAqC,KAAW,EAAE,OAA8B;QACvF,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,GAAG,CAAqC,KAAW,EAAE,OAA8B;QACxF,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACO,SAAS,CAAC,MAAuB;QACzC,IAAI,IAAI,CAAC,cAAc,KAAK,MAAM,EAAE;YAClC,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;YAC3C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,6BAA6B,cAAc,OAAO,MAAM,EAAE,CAAC,CAAC;YAC5E,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;SACnC;IACH,CAAC;IAED;;OAEG;IACI,WAAW,CAAC,KAAY,EAAE,OAAgB;QAC/C,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QAC9E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CASF;AA1ED,sCA0EC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { JsonRpcClient } from '../jsonRpc/JsonRpcClient';
|
|
2
|
+
export type { ClientTransport } from '../jsonRpc/JsonRpcClient';
|
|
3
|
+
export { JsonRpcServer } from '../jsonRpc/JsonRpcServer';
|
|
4
|
+
export { STANDARD_METHODS } from '../jsonRpc/types';
|
|
5
|
+
export type { ExecuteCodeRequest, ExecuteCodeResponse, JsonRpcClientConfig, JsonRpcError, JsonRpcErrorResponse, JsonRpcId, JsonRpcMethodHandler, JsonRpcMethodRegistry, JsonRpcNotification, JsonRpcNotification as RpcNotification, JsonRpcParams, JsonRpcRequest, JsonRpcRequest as RpcRequest, JsonRpcResponse, JsonRpcResponse as RpcResponse, JsonRpcServerConfig, JsonRpcSuccessResponse, LogNotification, PendingRequest, StatusRequest, StatusResponse, ValidationResult } from '../jsonRpc/types';
|
|
6
|
+
export { ProcessManager } from './process/ProcessManager';
|
|
7
|
+
export type { ProcessConfig } from './process/ProcessManager';
|
|
8
|
+
export { ChildStdioTransport } from './stdio/ChildStdioTransport';
|
|
9
|
+
export { ParentStdioTransport, ParentStdioTransport as StdioTransport, StdioClientTransport } from './stdio/ParentStdioTransport';
|
|
10
|
+
export { TransportStatus } from './Transport';
|
|
11
|
+
export type { MessageHandler, Transport, TransportConfig, TransportEvents } from './Transport';
|
|
12
|
+
export { createErrorResponse, createSuccessResponse, isNotification, isRequest, isResponse, isValidJsonRpc, MessageBuffer, safeParse } from './utils/MessageUtils';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safeParse = exports.MessageBuffer = exports.isValidJsonRpc = exports.isResponse = exports.isRequest = exports.isNotification = exports.createSuccessResponse = exports.createErrorResponse = exports.TransportStatus = exports.StdioClientTransport = exports.StdioTransport = exports.ParentStdioTransport = exports.ChildStdioTransport = exports.ProcessManager = exports.STANDARD_METHODS = exports.JsonRpcServer = exports.JsonRpcClient = void 0;
|
|
4
|
+
// Transport interfaces and types
|
|
5
|
+
var JsonRpcClient_1 = require("../jsonRpc/JsonRpcClient");
|
|
6
|
+
Object.defineProperty(exports, "JsonRpcClient", { enumerable: true, get: function () { return JsonRpcClient_1.JsonRpcClient; } });
|
|
7
|
+
// JSON-RPC server and client
|
|
8
|
+
var JsonRpcServer_1 = require("../jsonRpc/JsonRpcServer");
|
|
9
|
+
Object.defineProperty(exports, "JsonRpcServer", { enumerable: true, get: function () { return JsonRpcServer_1.JsonRpcServer; } });
|
|
10
|
+
// JSON-RPC types and protocol
|
|
11
|
+
var types_1 = require("../jsonRpc/types");
|
|
12
|
+
Object.defineProperty(exports, "STANDARD_METHODS", { enumerable: true, get: function () { return types_1.STANDARD_METHODS; } });
|
|
13
|
+
// Process management
|
|
14
|
+
var ProcessManager_1 = require("./process/ProcessManager");
|
|
15
|
+
Object.defineProperty(exports, "ProcessManager", { enumerable: true, get: function () { return ProcessManager_1.ProcessManager; } });
|
|
16
|
+
var ChildStdioTransport_1 = require("./stdio/ChildStdioTransport");
|
|
17
|
+
Object.defineProperty(exports, "ChildStdioTransport", { enumerable: true, get: function () { return ChildStdioTransport_1.ChildStdioTransport; } });
|
|
18
|
+
// Transport implementations
|
|
19
|
+
var ParentStdioTransport_1 = require("./stdio/ParentStdioTransport");
|
|
20
|
+
Object.defineProperty(exports, "ParentStdioTransport", { enumerable: true, get: function () { return ParentStdioTransport_1.ParentStdioTransport; } });
|
|
21
|
+
Object.defineProperty(exports, "StdioTransport", { enumerable: true, get: function () { return ParentStdioTransport_1.ParentStdioTransport; } });
|
|
22
|
+
Object.defineProperty(exports, "StdioClientTransport", { enumerable: true, get: function () { return ParentStdioTransport_1.StdioClientTransport; } });
|
|
23
|
+
// Transport core types and interfaces
|
|
24
|
+
var Transport_1 = require("./Transport");
|
|
25
|
+
Object.defineProperty(exports, "TransportStatus", { enumerable: true, get: function () { return Transport_1.TransportStatus; } });
|
|
26
|
+
// Utility functions
|
|
27
|
+
var MessageUtils_1 = require("./utils/MessageUtils");
|
|
28
|
+
Object.defineProperty(exports, "createErrorResponse", { enumerable: true, get: function () { return MessageUtils_1.createErrorResponse; } });
|
|
29
|
+
Object.defineProperty(exports, "createSuccessResponse", { enumerable: true, get: function () { return MessageUtils_1.createSuccessResponse; } });
|
|
30
|
+
Object.defineProperty(exports, "isNotification", { enumerable: true, get: function () { return MessageUtils_1.isNotification; } });
|
|
31
|
+
Object.defineProperty(exports, "isRequest", { enumerable: true, get: function () { return MessageUtils_1.isRequest; } });
|
|
32
|
+
Object.defineProperty(exports, "isResponse", { enumerable: true, get: function () { return MessageUtils_1.isResponse; } });
|
|
33
|
+
Object.defineProperty(exports, "isValidJsonRpc", { enumerable: true, get: function () { return MessageUtils_1.isValidJsonRpc; } });
|
|
34
|
+
Object.defineProperty(exports, "MessageBuffer", { enumerable: true, get: function () { return MessageUtils_1.MessageBuffer; } });
|
|
35
|
+
Object.defineProperty(exports, "safeParse", { enumerable: true, get: function () { return MessageUtils_1.safeParse; } });
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/JsExecutor/transport/index.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,0DAAyD;AAAhD,8GAAA,aAAa,OAAA;AAEtB,6BAA6B;AAC7B,0DAAyD;AAAhD,8GAAA,aAAa,OAAA;AACtB,8BAA8B;AAC9B,0CAAoD;AAA3C,yGAAA,gBAAgB,OAAA;AAyBzB,qBAAqB;AACrB,2DAA0D;AAAjD,gHAAA,cAAc,OAAA;AAEvB,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAC5B,4BAA4B;AAC5B,qEAIsC;AAHpC,4HAAA,oBAAoB,OAAA;AACpB,sHAAA,oBAAoB,OAAkB;AACtC,4HAAA,oBAAoB,OAAA;AAEtB,sCAAsC;AACtC,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AAExB,oBAAoB;AACpB,qDAS8B;AAR5B,mHAAA,mBAAmB,OAAA;AACnB,qHAAA,qBAAqB,OAAA;AACrB,8GAAA,cAAc,OAAA;AACd,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,8GAAA,cAAc,OAAA;AACd,6GAAA,aAAa,OAAA;AACb,yGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
import type { ChildProcess } from 'child_process';
|
|
7
|
+
import { EventEmitter } from 'node:events';
|
|
8
|
+
import { Logger } from '../../../logger';
|
|
9
|
+
import type { ExecutionOptions } from '../../types';
|
|
10
|
+
/**
|
|
11
|
+
* Events emitted by the ProcessManager
|
|
12
|
+
*/
|
|
13
|
+
export interface ProcessManagerEvents {
|
|
14
|
+
stdout: (data: Buffer) => void;
|
|
15
|
+
stderr: (data: Buffer) => void;
|
|
16
|
+
exit: (code: number | null, signal: NodeJS.Signals | null) => void;
|
|
17
|
+
error: (error: Error) => void;
|
|
18
|
+
ready: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for process spawning
|
|
22
|
+
*/
|
|
23
|
+
export interface ProcessConfig {
|
|
24
|
+
/** Script path to execute */
|
|
25
|
+
scriptPath: string;
|
|
26
|
+
/** Execution options */
|
|
27
|
+
executionOptions?: ExecutionOptions;
|
|
28
|
+
/** Timeout for process startup */
|
|
29
|
+
startupTimeout?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Manages the lifecycle of child processes for JavaScript execution
|
|
33
|
+
*/
|
|
34
|
+
export declare class ProcessManager extends EventEmitter {
|
|
35
|
+
private childProcess?;
|
|
36
|
+
readonly logger: Logger;
|
|
37
|
+
private name?;
|
|
38
|
+
constructor();
|
|
39
|
+
/**
|
|
40
|
+
* Set a name for this process manager (used in logging)
|
|
41
|
+
*/
|
|
42
|
+
setName(name: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get the current child process
|
|
45
|
+
*/
|
|
46
|
+
getProcess(): ChildProcess | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Check if the process is running
|
|
49
|
+
*/
|
|
50
|
+
isRunning(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Spawn a new child process
|
|
53
|
+
*/
|
|
54
|
+
spawn(config: ProcessConfig): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Terminate the child process
|
|
57
|
+
*/
|
|
58
|
+
terminate(timeout?: number): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Send data to the process stdin
|
|
61
|
+
*/
|
|
62
|
+
write(data: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Get process stdout stream
|
|
65
|
+
*/
|
|
66
|
+
getStdout(): NodeJS.ReadableStream | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Get process stdin stream
|
|
69
|
+
*/
|
|
70
|
+
getStdin(): NodeJS.WritableStream | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Register event listeners
|
|
73
|
+
*/
|
|
74
|
+
on<TKey extends keyof ProcessManagerEvents>(event: TKey, handler: ProcessManagerEvents[TKey]): this;
|
|
75
|
+
/**
|
|
76
|
+
* Remove event listeners
|
|
77
|
+
*/
|
|
78
|
+
off<TKey extends keyof ProcessManagerEvents>(event: TKey, handler: ProcessManagerEvents[TKey]): this;
|
|
79
|
+
/**
|
|
80
|
+
* Set up process event handlers
|
|
81
|
+
*/
|
|
82
|
+
private setupProcessHandlers;
|
|
83
|
+
/**
|
|
84
|
+
* Wait for the process to be ready
|
|
85
|
+
*/
|
|
86
|
+
private waitForReady;
|
|
87
|
+
/**
|
|
88
|
+
* Normalize execution options with defaults
|
|
89
|
+
*/
|
|
90
|
+
private normalizeExecutionOptions;
|
|
91
|
+
/**
|
|
92
|
+
* Extract permission configuration from execution options
|
|
93
|
+
*/
|
|
94
|
+
private extractPermissionConfig;
|
|
95
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessManager = void 0;
|
|
4
|
+
const node_events_1 = require("node:events");
|
|
5
|
+
const logger_1 = require("../../../logger");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const denoUtils_1 = require("../../denoUtils");
|
|
8
|
+
const errors_1 = require("../../errors");
|
|
9
|
+
const PermissionBuilder_1 = require("../../PermissionBuilder");
|
|
10
|
+
/**
|
|
11
|
+
* Manages the lifecycle of child processes for JavaScript execution
|
|
12
|
+
*/
|
|
13
|
+
class ProcessManager extends node_events_1.EventEmitter {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.logger = logger_1.Logger.getInstance();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Set a name for this process manager (used in logging)
|
|
20
|
+
*/
|
|
21
|
+
setName(name) {
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.logger.setMetadata({ name, component: 'ProcessManager' });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the current child process
|
|
27
|
+
*/
|
|
28
|
+
getProcess() {
|
|
29
|
+
return this.childProcess;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if the process is running
|
|
33
|
+
*/
|
|
34
|
+
isRunning() {
|
|
35
|
+
return this.childProcess !== undefined && !this.childProcess.killed;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Spawn a new child process
|
|
39
|
+
*/
|
|
40
|
+
async spawn(config) {
|
|
41
|
+
if (this.childProcess) {
|
|
42
|
+
throw new Error('Process already spawned. Call terminate() first.');
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const normalizedOptions = this.normalizeExecutionOptions(config.executionOptions);
|
|
46
|
+
const permissionConfig = this.extractPermissionConfig(normalizedOptions);
|
|
47
|
+
// Validate permissions before proceeding
|
|
48
|
+
(0, PermissionBuilder_1.validatePermissionConfig)(permissionConfig);
|
|
49
|
+
const permissions = (0, PermissionBuilder_1.buildDenoPermissions)(permissionConfig);
|
|
50
|
+
// Build command arguments
|
|
51
|
+
const commandArgs = [
|
|
52
|
+
...constants_1.EXECUTION_CONSTANTS.denoFlags,
|
|
53
|
+
...permissions,
|
|
54
|
+
config.scriptPath
|
|
55
|
+
];
|
|
56
|
+
this.logger.log('Spawning process with args:', commandArgs);
|
|
57
|
+
// Spawn the Deno process
|
|
58
|
+
this.childProcess = (0, denoUtils_1.spawnDenoProcess)(commandArgs);
|
|
59
|
+
this.setupProcessHandlers();
|
|
60
|
+
// Wait for process to be ready
|
|
61
|
+
await this.waitForReady(config.startupTimeout ?? 5000);
|
|
62
|
+
this.emit('ready');
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.childProcess = undefined;
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Terminate the child process
|
|
71
|
+
*/
|
|
72
|
+
async terminate(timeout = 3000) {
|
|
73
|
+
if (!this.childProcess || this.childProcess.killed) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.logger.log('Terminating process');
|
|
77
|
+
// First try graceful termination
|
|
78
|
+
this.childProcess.kill(constants_1.EXECUTION_CONSTANTS.processSignals.term);
|
|
79
|
+
// Wait for process to exit gracefully
|
|
80
|
+
await new Promise(resolve => {
|
|
81
|
+
const timeoutId = setTimeout(() => {
|
|
82
|
+
if (this.childProcess && !this.childProcess.killed) {
|
|
83
|
+
this.logger.log('Force killing process after timeout');
|
|
84
|
+
this.childProcess.kill('SIGKILL');
|
|
85
|
+
}
|
|
86
|
+
resolve();
|
|
87
|
+
}, timeout);
|
|
88
|
+
this.childProcess.on('exit', () => {
|
|
89
|
+
clearTimeout(timeoutId);
|
|
90
|
+
resolve();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
this.childProcess = undefined;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Send data to the process stdin
|
|
97
|
+
*/
|
|
98
|
+
write(data) {
|
|
99
|
+
if (!this.childProcess?.stdin) {
|
|
100
|
+
throw new Error('Process stdin not available');
|
|
101
|
+
}
|
|
102
|
+
return this.childProcess.stdin.write(data);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get process stdout stream
|
|
106
|
+
*/
|
|
107
|
+
getStdout() {
|
|
108
|
+
return this.childProcess?.stdout ?? undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get process stdin stream
|
|
112
|
+
*/
|
|
113
|
+
getStdin() {
|
|
114
|
+
return this.childProcess?.stdin ?? undefined;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Register event listeners
|
|
118
|
+
*/
|
|
119
|
+
on(event, handler) {
|
|
120
|
+
return super.on(event, handler);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Remove event listeners
|
|
124
|
+
*/
|
|
125
|
+
off(event, handler) {
|
|
126
|
+
return super.off(event, handler);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Set up process event handlers
|
|
130
|
+
*/
|
|
131
|
+
setupProcessHandlers() {
|
|
132
|
+
if (!this.childProcess) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// Handle stdout data
|
|
136
|
+
this.childProcess.stdout?.on('data', (data) => {
|
|
137
|
+
this.emit('stdout', data);
|
|
138
|
+
});
|
|
139
|
+
// Handle stderr data
|
|
140
|
+
this.childProcess.stderr?.on('data', (data) => {
|
|
141
|
+
this.emit('stderr', data);
|
|
142
|
+
});
|
|
143
|
+
// Handle process exit
|
|
144
|
+
this.childProcess.on('exit', (code, signal) => {
|
|
145
|
+
this.logger.log(`Process exited with code: ${code}, signal: ${signal}`);
|
|
146
|
+
this.emit('exit', code, signal);
|
|
147
|
+
});
|
|
148
|
+
// Handle process errors
|
|
149
|
+
this.childProcess.on('error', error => {
|
|
150
|
+
this.logger.error('Process error:', error);
|
|
151
|
+
this.emit('error', new errors_1.ProcessSpawnError(error));
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Wait for the process to be ready
|
|
156
|
+
*/
|
|
157
|
+
async waitForReady(timeout) {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
const timeoutId = setTimeout(() => {
|
|
160
|
+
reject(new Error(`Process startup timed out after ${timeout}ms`));
|
|
161
|
+
}, timeout);
|
|
162
|
+
// For now, just wait a short time for the process to start
|
|
163
|
+
// In a real implementation, you might check for a ready signal from the process
|
|
164
|
+
setTimeout(() => {
|
|
165
|
+
if (this.childProcess && !this.childProcess.killed) {
|
|
166
|
+
clearTimeout(timeoutId);
|
|
167
|
+
resolve();
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
clearTimeout(timeoutId);
|
|
171
|
+
reject(new Error('Process failed to start'));
|
|
172
|
+
}
|
|
173
|
+
}, 100);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Normalize execution options with defaults
|
|
178
|
+
*/
|
|
179
|
+
normalizeExecutionOptions(options) {
|
|
180
|
+
const DEFAULT_EXECUTION_OPTIONS = {
|
|
181
|
+
timeout: 30000,
|
|
182
|
+
functionName: 'main',
|
|
183
|
+
allowNetwork: false,
|
|
184
|
+
allowedDomains: [],
|
|
185
|
+
allowEnv: false,
|
|
186
|
+
allowRead: false,
|
|
187
|
+
debugMode: false,
|
|
188
|
+
retries: 0
|
|
189
|
+
};
|
|
190
|
+
return {
|
|
191
|
+
timeout: options?.timeout ?? DEFAULT_EXECUTION_OPTIONS.timeout,
|
|
192
|
+
functionName: options?.functionName ?? DEFAULT_EXECUTION_OPTIONS.functionName,
|
|
193
|
+
allowNetwork: options?.allowNetwork ?? DEFAULT_EXECUTION_OPTIONS.allowNetwork,
|
|
194
|
+
allowedDomains: options?.allowedDomains ?? [...DEFAULT_EXECUTION_OPTIONS.allowedDomains],
|
|
195
|
+
allowEnv: options?.allowEnv ?? DEFAULT_EXECUTION_OPTIONS.allowEnv,
|
|
196
|
+
allowRead: options?.allowRead ?? DEFAULT_EXECUTION_OPTIONS.allowRead,
|
|
197
|
+
debugMode: options?.debugMode ?? DEFAULT_EXECUTION_OPTIONS.debugMode,
|
|
198
|
+
retries: options?.retries ?? DEFAULT_EXECUTION_OPTIONS.retries
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Extract permission configuration from execution options
|
|
203
|
+
*/
|
|
204
|
+
extractPermissionConfig(options) {
|
|
205
|
+
return {
|
|
206
|
+
allowNetwork: options.allowNetwork,
|
|
207
|
+
allowedDomains: options.allowedDomains,
|
|
208
|
+
allowEnv: options.allowEnv,
|
|
209
|
+
allowRead: options.allowRead
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.ProcessManager = ProcessManager;
|
|
214
|
+
//# sourceMappingURL=ProcessManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessManager.js","sourceRoot":"","sources":["../../../../src/JsExecutor/transport/process/ProcessManager.ts"],"names":[],"mappings":";;;AAEA,6CAA2C;AAC3C,4CAAyC;AACzC,+CAAsD;AACtD,+CAAmD;AACnD,yCAAiD;AACjD,+DAAyF;AA0BzF;;GAEG;AACH,MAAa,cAAe,SAAQ,0BAAY;IAK9C;QACE,KAAK,EAAE,CAAC;QAJM,WAAM,GAAG,eAAM,CAAC,WAAW,EAAE,CAAC;IAK9C,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,IAAY;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACtE,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK,CAAC,MAAqB;QACtC,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;SACrE;QAED,IAAI;YACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;YAClF,MAAM,gBAAgB,GAAG,IAAI,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;YAEzE,yCAAyC;YACzC,IAAA,4CAAwB,EAAC,gBAAgB,CAAC,CAAC;YAE3C,MAAM,WAAW,G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