Class ScriptServiceGrpc.ScriptServiceBlockingV2Stub

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

public static final class ScriptServiceGrpc.ScriptServiceBlockingV2Stub extends io.grpc.stub.AbstractBlockingStub<ScriptServiceGrpc.ScriptServiceBlockingV2Stub>
A stub to allow clients to do synchronous 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.ScriptServiceBlockingV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)
      Specified by:
      build in class io.grpc.stub.AbstractStub<ScriptServiceGrpc.ScriptServiceBlockingV2Stub>
    • createScript

      public CreateScriptResponse createScript(CreateScriptRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • getScript

      public GetScriptResponse getScript(GetScriptRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • updateScript

      public UpdateScriptResponse updateScript(UpdateScriptRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • deleteScript

      public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • listScripts

      public ListScriptsResponse listScripts(ListScriptsRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • activateScript

      @ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") public io.grpc.stub.BlockingClientCall<?, ScriptEvent> activateScript(ActivateScriptRequest request)
      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 DeactivateScriptResponse deactivateScript(DeactivateScriptRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • getScriptStatus

      public GetScriptStatusResponse getScriptStatus(GetScriptStatusRequest request) throws io.grpc.StatusException
      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
      
      Throws:
      io.grpc.StatusException
    • subscribeScriptLogs

      @ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") public io.grpc.stub.BlockingClientCall<?, ScriptLogEntry> subscribeScriptLogs(SubscribeScriptLogsRequest request)
      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 GetNodeTypesResponse getNodeTypes(GetNodeTypesRequest request) throws io.grpc.StatusException
      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.
      
      Throws:
      io.grpc.StatusException
    • getRegistryData

      public GetRegistryDataResponse getRegistryData(GetRegistryDataRequest request) throws io.grpc.StatusException
      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.
      
      Throws:
      io.grpc.StatusException
    • validateScript

      public ValidateScriptResponse validateScript(ValidateScriptRequest request) throws io.grpc.StatusException
      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.
      
      Throws:
      io.grpc.StatusException
    • dryRunScript

      @ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") public io.grpc.stub.BlockingClientCall<?, ScriptEvent> dryRunScript(DryRunScriptRequest request)
      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.