Skip to main content

executionGateway

@codebolt/plugin-sdk


Variable: executionGateway

const executionGateway: {
claim: () => Promise<ExecutionGatewayClaimResponse>;
offNotification: (callback: (notification: ExecutionNotification) => void) => void;
offRequest: (callback: (request: ExecutionRequest) => void) => void;
onNotification: (callback: (notification: ExecutionNotification) => void) => void;
onRequest: (callback: (request: ExecutionRequest) => void) => void;
relinquish: () => Promise<ExecutionGatewayResponse>;
sendReply: (requestId: string, result: any, success: boolean) => void;
subscribe: () => Promise<ExecutionGatewayResponse>;
unsubscribe: () => Promise<ExecutionGatewayResponse>;
};

Defined in: CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:116

Type Declaration

NameTypeDescriptionDefined in
claim()() => Promise<ExecutionGatewayClaimResponse>Claim exclusive handling of execution requests. Only one plugin can claim at a time. Returns an error if already claimed.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:121
offNotification()(callback: (notification: ExecutionNotification) => void) => voidRemove a previously registered notification callback.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:214
offRequest()(callback: (request: ExecutionRequest) => void) => voidRemove a previously registered request callback.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:155
onNotification()(callback: (notification: ExecutionNotification) => void) => voidRegister a callback for execution notifications. These are broadcast after any locally-executed agent action.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:206
onRequest()(callback: (request: ExecutionRequest) => void) => voidRegister a callback for incoming execution requests. These are proxied agent messages that the claiming plugin must handle. After processing, call sendReply() with the requestId and result.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:147
relinquish()() => Promise<ExecutionGatewayResponse>Release the claim on the execution gateway.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:132
sendReply()(requestId: string, result: any, success: boolean) => voidSend a reply for a specific execution request.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:167
subscribe()() => Promise<ExecutionGatewayResponse>Subscribe to execution notifications. Notifications are broadcast whenever the server handles a message locally.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:181
unsubscribe()() => Promise<ExecutionGatewayResponse>Unsubscribe from execution notifications.CodeBolt/packages/pluginSdk/src/modules/executionGateway.ts:192