hap.typesΒΆ

SubmodulesΒΆ

AttributesΒΆ

ClassesΒΆ

AgentExecutionRequest

Request to execute an agent with validation.

AgentExecutionResult

Result from agent execution with validation.

AgentInfo

Agent metadata for HAP with enhanced validation.

BaseInfo

Base class for all HAP info types.

EdgeInfo

Graph edge metadata with validation.

ErrorCode

Standard error codes.

ExecutionStatus

Agent execution status values.

GraphExecutionRequest

Request to execute a graph with validation.

GraphExecutionResult

Result from graph execution with validation.

GraphExecutionStatus

Graph execution status values.

GraphInfo

Graph metadata for HAP with validation.

HAPError

Error structure for HAP protocol with enhanced validation.

HAPRequest

Base request structure for HAP protocol with JSON-RPC 2.0 compliance.

HAPResponse

Base response structure for HAP protocol with validation.

NodeInfo

Graph node metadata with validation.

NodeType

Graph node types.

PromptArgument

Prompt argument definition with validation.

PromptInfo

Prompt metadata with enhanced validation.

ResourceInfo

Resource metadata with validation.

ServerCapability

Server capabilities.

ServerRegistration

Registration info for a HAP server.

ToolInfo

Tool metadata with enhanced validation.

Package ContentsΒΆ

class hap.types.AgentExecutionRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to execute an agent with validation.

Parameters:

data (Any)

config_overrides: Dict[str, Any] | None = NoneΒΆ
input_data: Dict[str, Any] = NoneΒΆ
metadata: Dict[str, Any] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

stream: bool = NoneΒΆ
timeout: float | None = NoneΒΆ
class hap.types.AgentExecutionResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result from agent execution with validation.

Parameters:

data (Any)

validate_result_consistency() AgentExecutionResultΒΆ

Ensure result/error fields are consistent with status.

Return type:

AgentExecutionResult

error: str | None = NoneΒΆ
execution_time: float = NoneΒΆ
metadata: Dict[str, Any] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

result: Any | None = NoneΒΆ
status: ExecutionStatus = NoneΒΆ
class hap.types.AgentInfo(/, **data: Any)ΒΆ

Bases: BaseInfo

Agent metadata for HAP with enhanced validation.

Parameters:

data (Any)

classmethod validate_capabilities(v: List[str]) List[str]ΒΆ

Validate capability names.

Parameters:

v (List[str])

Return type:

List[str]

classmethod validate_tool_names(v: List[str]) List[str]ΒΆ

Validate tool names format.

Parameters:

v (List[str])

Return type:

List[str]

capabilities: List[str] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

state_schema: Dict[str, Any] | None = NoneΒΆ
tools: List[str] = NoneΒΆ
type: str = NoneΒΆ
class hap.types.BaseInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Base class for all HAP info types.

Parameters:

data (Any)

classmethod validate_name_format(v: str) strΒΆ

Ensure name follows HAP naming conventions.

Parameters:

v (str)

Return type:

str

description: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str = NoneΒΆ
class hap.types.EdgeInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Graph edge metadata with validation.

Parameters:

data (Any)

validate_edge() EdgeInfoΒΆ

Validate edge constraints.

Return type:

EdgeInfo

condition: str | None = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

source: str = NoneΒΆ
target: str = NoneΒΆ
class hap.types.ErrorCodeΒΆ

Bases: int, enum.Enum

Standard error codes.

AGENT_NOT_FOUND = -32001ΒΆ
AUTHENTICATION_ERROR = -32007ΒΆ
EXECUTION_ERROR = -32005ΒΆ
GRAPH_NOT_FOUND = -32002ΒΆ
INTERNAL_ERROR = -32603ΒΆ
INVALID_PARAMS = -32602ΒΆ
INVALID_REQUEST = -32600ΒΆ
METHOD_NOT_FOUND = -32601ΒΆ
PARSE_ERROR = -32700ΒΆ
RESOURCE_NOT_FOUND = -32004ΒΆ
TOOL_NOT_FOUND = -32003ΒΆ
VALIDATION_ERROR = -32006ΒΆ
class hap.types.ExecutionStatusΒΆ

Bases: str, enum.Enum

Agent execution status values.

CANCELLED = 'cancelled'ΒΆ
ERROR = 'error'ΒΆ
SUCCESS = 'success'ΒΆ
TIMEOUT = 'timeout'ΒΆ
class hap.types.GraphExecutionRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to execute a graph with validation.

Parameters:

data (Any)

classmethod validate_input_not_empty(v: Dict[str, Any]) Dict[str, Any]ΒΆ

Ensure input data is not empty.

Parameters:

v (Dict[str, Any])

Return type:

Dict[str, Any]

end_node: str | None = NoneΒΆ
input_data: Dict[str, Any] = NoneΒΆ
metadata: Dict[str, Any] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

start_node: str | None = NoneΒΆ
stream_nodes: bool = NoneΒΆ
timeout: float | None = NoneΒΆ
class hap.types.GraphExecutionResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result from graph execution with validation.

Parameters:

data (Any)

classmethod validate_path_items(v: List[str]) List[str]ΒΆ

Validate all path items are valid node IDs.

Parameters:

v (List[str])

Return type:

List[str]

validate_result_consistency() GraphExecutionResultΒΆ

Ensure result fields are consistent with status.

Return type:

GraphExecutionResult

error: str | None = NoneΒΆ
execution_time: float = NoneΒΆ
final_output: Any | None = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

node_metadata: Dict[str, Any] = NoneΒΆ
path: List[str] = NoneΒΆ
results: Dict[str, Any] = NoneΒΆ
status: GraphExecutionStatus = NoneΒΆ
class hap.types.GraphExecutionStatusΒΆ

Bases: str, enum.Enum

Graph execution status values.

CANCELLED = 'cancelled'ΒΆ
ERROR = 'error'ΒΆ
PARTIAL = 'partial'ΒΆ
SUCCESS = 'success'ΒΆ
TIMEOUT = 'timeout'ΒΆ
class hap.types.GraphInfo(/, **data: Any)ΒΆ

Bases: BaseInfo

Graph metadata for HAP with validation.

Parameters:

data (Any)

validate_graph_structure() GraphInfoΒΆ

Validate overall graph structure.

Return type:

GraphInfo

classmethod validate_unique_node_ids(v: List[NodeInfo]) List[NodeInfo]ΒΆ

Ensure node IDs are unique.

Parameters:

v (List[NodeInfo])

Return type:

List[NodeInfo]

edges: List[EdgeInfo] = NoneΒΆ
entry_point: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nodes: List[NodeInfo] = NoneΒΆ
class hap.types.HAPError(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Error structure for HAP protocol with enhanced validation.

Parameters:

data (Any)

classmethod validate_error_code(v: int) intΒΆ

Validate error code is in expected ranges.

Parameters:

v (int)

Return type:

int

code: int = NoneΒΆ
data: Any | None = NoneΒΆ
message: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hap.types.HAPRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Base request structure for HAP protocol with JSON-RPC 2.0 compliance.

Parameters:

data (Any)

classmethod validate_method(v: str) strΒΆ

Validate method follows HAP conventions.

Parameters:

v (str)

Return type:

str

id: str | int = NoneΒΆ
jsonrpc: str = NoneΒΆ
method: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

params: Dict[str, Any] = NoneΒΆ
class hap.types.HAPResponse(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Base response structure for HAP protocol with validation.

Parameters:

data (Any)

validate_result_or_error() HAPResponseΒΆ

Ensure response has either result or error, not both.

Return type:

HAPResponse

error: HAPError | None = NoneΒΆ
id: str | int = NoneΒΆ
jsonrpc: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

result: Any | None = NoneΒΆ
class hap.types.NodeInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Graph node metadata with validation.

Parameters:

data (Any)

validate_node_requirements() NodeInfoΒΆ

Validate node-type specific requirements.

Return type:

NodeInfo

agent_name: str | None = NoneΒΆ
description: str | None = NoneΒΆ
id: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: NodeType = NoneΒΆ
class hap.types.NodeTypeΒΆ

Bases: str, enum.Enum

Graph node types.

AGENT = 'agent'ΒΆ
DECISION = 'decision'ΒΆ
END = 'end'ΒΆ
MERGE = 'merge'ΒΆ
PARALLEL = 'parallel'ΒΆ
START = 'start'ΒΆ
TOOL = 'tool'ΒΆ
class hap.types.PromptArgument(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Prompt argument definition with validation.

Parameters:

data (Any)

description: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str = NoneΒΆ
required: bool = NoneΒΆ
class hap.types.PromptInfo(/, **data: Any)ΒΆ

Bases: BaseInfo

Prompt metadata with enhanced validation.

Parameters:

data (Any)

classmethod validate_unique_arguments(v: List[PromptArgument]) List[PromptArgument]ΒΆ

Ensure argument names are unique.

Parameters:

v (List[PromptArgument])

Return type:

List[PromptArgument]

arguments: List[PromptArgument] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hap.types.ResourceInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Resource metadata with validation.

Parameters:

data (Any)

classmethod validate_uri_format(v: str) strΒΆ

Validate URI has proper format.

Parameters:

v (str)

Return type:

str

description: str = NoneΒΆ
mime_type: str = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str = NoneΒΆ
uri: str = NoneΒΆ
class hap.types.ServerCapabilityΒΆ

Bases: str, enum.Enum

Server capabilities.

AUTHENTICATION = 'authentication'ΒΆ
PROMPTS = 'prompts'ΒΆ
RESOURCES = 'resources'ΒΆ
STATE_PERSISTENCE = 'state_persistence'ΒΆ
STREAMING = 'streaming'ΒΆ
TOOLS = 'tools'ΒΆ
class hap.types.ServerRegistration(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Registration info for a HAP server.

Parameters:

data (Any)

capabilities: List[ServerCapability] = NoneΒΆ
endpoint: strΒΆ
health_check_url: str | None = NoneΒΆ
metadata: dict = NoneΒΆ
name: strΒΆ
registered_at: datetime.datetime = NoneΒΆ
type: strΒΆ
class hap.types.ToolInfo(/, **data: Any)ΒΆ

Bases: BaseInfo

Tool metadata with enhanced validation.

Parameters:

data (Any)

classmethod validate_json_schema(v: Dict[str, Any] | None) Dict[str, Any] | NoneΒΆ

Validate that schema is a valid JSON Schema structure.

Parameters:

v (Optional[Dict[str, Any]])

Return type:

Optional[Dict[str, Any]]

input_schema: Dict[str, Any] = NoneΒΆ
model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_schema: Dict[str, Any] | None = NoneΒΆ
hap.types.AgentIdΒΆ
hap.types.EntrypointΒΆ
hap.types.JSONMapΒΆ