Class ScriptServiceGrpc.ScriptServiceStub

java.lang.Object
io.grpc.stub.AbstractStub<ScriptServiceGrpc.ScriptServiceStub>
io.grpc.stub.AbstractAsyncStub<ScriptServiceGrpc.ScriptServiceStub>
com.soulfiremc.grpc.generated.ScriptServiceGrpc.ScriptServiceStub
Enclosing class:
ScriptServiceGrpc

public static final class ScriptServiceGrpc.ScriptServiceStub extends io.grpc.stub.AbstractAsyncStub<ScriptServiceGrpc.ScriptServiceStub>
A stub to allow clients to do asynchronous rpc calls to service ScriptService.
ScriptService provides management and execution capabilities for visual node-based
automation scripts within SoulFire.
The visual scripting system allows users to create automation workflows by connecting
nodes in a graph. Each node represents an action, condition, or event trigger.
Nodes are connected by edges that define execution flow and data transfer.
SCRIPT LIFECYCLE:
1. Create a script using CreateScript with initial nodes/edges or empty graph
2. Edit the script using UpdateScript to modify the node graph
3. Activate the script using ActivateScript to register event listeners
4. Monitor execution via SubscribeScriptEvents or GetScriptStatus
5. Deactivate using DeactivateScript when done
6. Delete unused scripts with DeleteScript
Scripts are reactive state machines - they don't "run" but rather listen for
trigger events and execute node chains in response. Activation registers the
listeners, deactivation removes them and cancels any pending async operations.
PERMISSIONS: Script operations require appropriate instance permissions.
The specific permissions are TBD but will likely include:
- READ_SCRIPT: View script definitions and status
- UPDATE_SCRIPT: Create, modify, and delete scripts
- EXECUTE_SCRIPT: Activate and deactivate scripts
LOGGING: Script execution logs can be streamed via SubscribeScriptLogs or
filtered using InstanceScriptLogScope in the LogsService (see logs.proto).
  • Method Details

    • build

      protected ScriptServiceGrpc.ScriptServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
      Specified by:
      build in class io.grpc.stub.AbstractStub<ScriptServiceGrpc.ScriptServiceStub>
    • createScript

      public void createScript(CreateScriptRequest request, io.grpc.stub.StreamObserver<CreateScriptResponse> responseObserver)
      Creates a new script in the specified instance.
      The script can be created with initial nodes and edges, or as a blank script
      to be edited later.
      Returns: The complete script data including the generated ID
      Errors: NOT_FOUND if instance does not exist
      Errors: PERMISSION_DENIED if user lacks script creation permission
      Errors: INVALID_ARGUMENT if required fields are missing or invalid
      
    • getScript

      public void getScript(GetScriptRequest request, io.grpc.stub.StreamObserver<GetScriptResponse> responseObserver)
      Retrieves a specific script by its ID.
      Returns the complete script data including all nodes and edges.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script read permission
      
    • updateScript

      public void updateScript(UpdateScriptRequest request, io.grpc.stub.StreamObserver<UpdateScriptResponse> responseObserver)
      Updates an existing script's metadata and/or node graph.
      Only specified fields are updated; others remain unchanged.
      Use update_nodes/update_edges flags to explicitly set empty lists.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script update permission
      Errors: INVALID_ARGUMENT if update data is invalid
      
    • deleteScript

      public void deleteScript(DeleteScriptRequest request, io.grpc.stub.StreamObserver<DeleteScriptResponse> responseObserver)
      Permanently deletes a script.
      If the script is currently active, it will be deactivated first.
      This operation cannot be undone.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script delete permission
      
    • listScripts

      public void listScripts(ListScriptsRequest request, io.grpc.stub.StreamObserver<ListScriptsResponse> responseObserver)
      Lists all scripts in the specified instance.
      Returns summary information (ScriptInfo) without full node/edge data
      to reduce response size.
      Errors: NOT_FOUND if instance does not exist
      Errors: PERMISSION_DENIED if user lacks script read permission
      
    • activateScript

      public void activateScript(ActivateScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver)
      Activates a script by registering its trigger event listeners.
      The script will begin responding to trigger events (tick, chat, etc.).
      Returns a stream of execution events as triggers fire and nodes execute.
      The stream remains open until the script is deactivated.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script execution permission
      Errors: FAILED_PRECONDITION if script is already active
      Errors: INVALID_ARGUMENT if script graph is invalid (e.g., no trigger nodes)
      
    • deactivateScript

      public void deactivateScript(DeactivateScriptRequest request, io.grpc.stub.StreamObserver<DeactivateScriptResponse> responseObserver)
      Deactivates an active script.
      Unregisters all event listeners and cancels any pending async operations.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script execution permission
      Errors: FAILED_PRECONDITION if script is not active
      
    • getScriptStatus

      public void getScriptStatus(GetScriptStatusRequest request, io.grpc.stub.StreamObserver<GetScriptStatusResponse> responseObserver)
      Gets the current status of a script.
      Returns whether the script is active, which node is executing, and activation count.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script read permission
      
    • subscribeScriptLogs

      public void subscribeScriptLogs(SubscribeScriptLogsRequest request, io.grpc.stub.StreamObserver<ScriptLogEntry> responseObserver)
      Subscribes to log entries generated during script execution.
      Returns a stream of log entries at or above the specified minimum level.
      The stream remains open until cancelled by the client.
      Errors: NOT_FOUND if instance or script does not exist
      Errors: PERMISSION_DENIED if user lacks script log subscription permission
      
    • getNodeTypes

      public void getNodeTypes(GetNodeTypesRequest request, io.grpc.stub.StreamObserver<GetNodeTypesResponse> responseObserver)
      Gets all available node types with their metadata.
      This enables clients to render the node editor without hardcoded knowledge
      of specific node types. The response includes port definitions, categories,
      display names, and all other information needed to render and validate nodes.
      This endpoint is cacheable - node types only change between server versions.
      
    • getRegistryData

      public void getRegistryData(GetRegistryDataRequest request, io.grpc.stub.StreamObserver<GetRegistryDataResponse> responseObserver)
      Gets Minecraft registry data for autocomplete and validation.
      Returns blocks, entities, items, and biomes that can be used in scripts.
      This endpoint is cacheable - registry data only changes between server versions.
      
    • validateScript

      public void validateScript(ValidateScriptRequest request, io.grpc.stub.StreamObserver<ValidateScriptResponse> responseObserver)
      Validates a script graph without saving it.
      Returns all diagnostics (errors and warnings) for the given nodes and edges.
      Useful for live validation in the editor without requiring a save.
      
    • dryRunScript

      public void dryRunScript(DryRunScriptRequest request, io.grpc.stub.StreamObserver<ScriptEvent> responseObserver)
      Dry-runs a script from a specified trigger with mock inputs.
      Executes the graph without requiring an active instance.
      Returns execution events as a stream for the editor to display.