# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from ai.stigmer.agentic.skill.v1 import api_pb2 as ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2
from ai.stigmer.agentic.skill.v1 import io_pb2 as ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2
from ai.stigmer.commons.apiresource import io_pb2 as ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2


class SkillQueryControllerStub(object):
    """SkillQueryController handles read operations for skills.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.get = channel.unary_unary(
                '/ai.stigmer.agentic.skill.v1.SkillQueryController/get',
                request_serializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.SkillId.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.FromString,
                _registered_method=True)
        self.getByReference = channel.unary_unary(
                '/ai.stigmer.agentic.skill.v1.SkillQueryController/getByReference',
                request_serializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceReference.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.FromString,
                _registered_method=True)
        self.getArtifact = channel.unary_unary(
                '/ai.stigmer.agentic.skill.v1.SkillQueryController/getArtifact',
                request_serializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactRequest.SerializeToString,
                response_deserializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactResponse.FromString,
                _registered_method=True)


class SkillQueryControllerServicer(object):
    """SkillQueryController handles read operations for skills.
    """

    def get(self, request, context):
        """Get a single skill by ID.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getByReference(self, request, context):
        """Get a skill by API resource reference with version support.

        Version resolution (via ApiResourceReference.version field):
        - Empty/"latest" → Returns current version from main collection
        - Tag name (e.g., "stable", "v1.0") → Resolves to version with this tag
        - SHA256 hash (64 hex chars) → Returns exact immutable version

        Authorization is handled in the handler after resolving the reference to a skill ID.
        (Input doesn't contain skill ID, so proto-level auth cannot work)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getArtifact(self, request, context):
        """Download skill artifact from storage by its storage key.
        Returns the ZIP file containing SKILL.md and implementation files.

        This endpoint is used by the agent-runner to download and extract
        skill artifacts into the sandbox at /bin/skills/{version_hash}/.

        Authorization is skipped as the storage key itself acts as a capability token.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SkillQueryControllerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'get': grpc.unary_unary_rpc_method_handler(
                    servicer.get,
                    request_deserializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.SkillId.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.SerializeToString,
            ),
            'getByReference': grpc.unary_unary_rpc_method_handler(
                    servicer.getByReference,
                    request_deserializer=ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceReference.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.SerializeToString,
            ),
            'getArtifact': grpc.unary_unary_rpc_method_handler(
                    servicer.getArtifact,
                    request_deserializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactRequest.FromString,
                    response_serializer=ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ai.stigmer.agentic.skill.v1.SkillQueryController', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('ai.stigmer.agentic.skill.v1.SkillQueryController', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SkillQueryController(object):
    """SkillQueryController handles read operations for skills.
    """

    @staticmethod
    def get(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/ai.stigmer.agentic.skill.v1.SkillQueryController/get',
            ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.SkillId.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getByReference(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/ai.stigmer.agentic.skill.v1.SkillQueryController/getByReference',
            ai_dot_stigmer_dot_commons_dot_apiresource_dot_io__pb2.ApiResourceReference.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_api__pb2.Skill.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getArtifact(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/ai.stigmer.agentic.skill.v1.SkillQueryController/getArtifact',
            ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactRequest.SerializeToString,
            ai_dot_stigmer_dot_agentic_dot_skill_dot_v1_dot_io__pb2.GetArtifactResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
