soulfire.command_connect.CommandService¶
- class soulfire.command_connect.CommandService[source]¶
Bases:
ProtocolService for executing server commands and retrieving tab-completion suggestions. Commands are executed using the Brigadier command framework and support various operations including bot control, pathfinding, inventory management, and administration. All operations require appropriate permissions based on the specified command scope.
- async execute_command(request: soulfire.command_pb2.CommandRequest, ctx: connectrpc.request.RequestContext[soulfire.command_pb2.CommandRequest, soulfire.command_pb2.CommandResponse], /) soulfire.command_pb2.CommandResponse[source]¶
Executes a command string within the specified scope. The command is parsed and executed using the Brigadier command dispatcher.
Permission requirements depend on the scope: - Global scope: Requires GLOBAL_COMMAND_EXECUTION permission - Instance scope: Requires INSTANCE_COMMAND_EXECUTION for the instance - Bot scope: Requires INSTANCE_COMMAND_EXECUTION for the parent instance
Returns: - CommandResponse with the command’s exit code
Errors: - INVALID_ARGUMENT: If the scope is not set - PERMISSION_DENIED: If the user lacks required permissions - INTERNAL: If an unexpected error occurs during execution
- async tab_complete_command(request: soulfire.command_pb2.CommandCompletionRequest, ctx: connectrpc.request.RequestContext[soulfire.command_pb2.CommandCompletionRequest, soulfire.command_pb2.CommandCompletionResponse], /) soulfire.command_pb2.CommandCompletionResponse[source]¶
Retrieves tab-completion suggestions for a partial command. Uses Brigadier’s completion system to generate context-aware suggestions based on the command structure and current cursor position.
Permission requirements depend on the scope (same as ExecuteCommand).
Returns: - CommandCompletionResponse with a list of possible completions
Errors: - INVALID_ARGUMENT: If the scope is not set - PERMISSION_DENIED: If the user lacks required permissions - INTERNAL: If an unexpected error occurs during completion