hap.types.graphsΒΆ

HAP type definitions for Haive graphs and nodes.

This module defines HAP protocol types for exposing Haive graph structures, nodes, edges, and graph execution capabilities.

ClassesΒΆ

BranchInfo

Information about a conditional branch.

EdgeInfo

Information about an edge in a graph.

GraphCheckpointInfo

Information about a graph checkpoint.

GraphExecutionRequest

Request to execute a graph.

GraphExecutionResult

Result from graph execution.

GraphInfo

Information about a Haive graph exposed through HAP.

GraphModificationRequest

Request to modify a graph structure.

GraphValidationResult

Result of graph validation.

GraphVisualizationRequest

Request for graph visualization.

NodeExecutionInfo

Information about a single node execution.

NodeInfo

Information about a node in a graph.

Module ContentsΒΆ

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

Bases: pydantic.BaseModel

Information about a conditional branch.

Parameters:

data (Any)

branch_type: Literal['function', 'key_value', 'send', 'command'] = NoneΒΆ
conditions: dict[str, str] = NoneΒΆ
default_target: str | None = NoneΒΆ
name: str = NoneΒΆ
source_node: str = NoneΒΆ
class hap.types.graphs.EdgeInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Information about an edge in a graph.

Parameters:

data (Any)

condition: str | None = NoneΒΆ
edge_type: Literal['direct', 'conditional', 'dynamic'] = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
source: str = NoneΒΆ
target: str = NoneΒΆ
class hap.types.graphs.GraphCheckpointInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Information about a graph checkpoint.

Parameters:

data (Any)

checkpoint_id: str = NoneΒΆ
created_at: str = NoneΒΆ
current_node: str = NoneΒΆ
graph_name: str = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
state: dict[str, Any] = NoneΒΆ
class hap.types.graphs.GraphExecutionRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to execute a graph.

Parameters:

data (Any)

checkpoint_id: str | None = NoneΒΆ
config: dict[str, Any] | None = NoneΒΆ
graph_name: str = NoneΒΆ
input_data: dict[str, Any] = NoneΒΆ
interrupt_after: list[str] | None = NoneΒΆ
interrupt_before: list[str] | None = NoneΒΆ
stream: bool = NoneΒΆ
class hap.types.graphs.GraphExecutionResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result from graph execution.

Parameters:

data (Any)

checkpoint_id: str | None = NoneΒΆ
duration_ms: float | None = NoneΒΆ
error: str | None = NoneΒΆ
executed_nodes: list[str] = NoneΒΆ
execution_path: list[str] = NoneΒΆ
metadata: dict[str, Any] = NoneΒΆ
result: dict[str, Any] | None = NoneΒΆ
status: Literal['success', 'error', 'interrupted'] = NoneΒΆ
class hap.types.graphs.GraphInfo(/, **data: Any)ΒΆ

Bases: haive.hap.types.BaseInfo

Information about a Haive graph exposed through HAP.

Parameters:

data (Any)

allow_cycles: bool = NoneΒΆ
branches: list[BranchInfo] = NoneΒΆ
edges: list[EdgeInfo] = NoneΒΆ
entry_points: list[str] = NoneΒΆ
finish_points: list[str] = NoneΒΆ
graph_class: str = NoneΒΆ
graph_id: str = NoneΒΆ
is_compiled: bool = NoneΒΆ
needs_recompile: bool = NoneΒΆ
nodes: list[NodeInfo] = NoneΒΆ
require_end_path: bool = NoneΒΆ
state_schema: str | None = NoneΒΆ
subgraphs: list[str] = NoneΒΆ
class hap.types.graphs.GraphModificationRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request to modify a graph structure.

Parameters:

data (Any)

graph_name: str = NoneΒΆ
node_config: dict[str, Any] | None = NoneΒΆ
node_name: str | None = NoneΒΆ
operation: Literal['add_node', 'remove_node', 'add_edge', 'remove_edge', 'update_node'] = NoneΒΆ
source: str | None = NoneΒΆ
target: str | None = NoneΒΆ
updates: dict[str, Any] | None = NoneΒΆ
class hap.types.graphs.GraphValidationResult(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Result of graph validation.

Parameters:

data (Any)

cycles_detected: list[list[str]] = NoneΒΆ
errors: list[str] = NoneΒΆ
missing_handlers: list[str] = NoneΒΆ
unreachable_nodes: list[str] = NoneΒΆ
valid: bool = NoneΒΆ
warnings: list[str] = NoneΒΆ
class hap.types.graphs.GraphVisualizationRequest(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Request for graph visualization.

Parameters:

data (Any)

format: Literal['mermaid', 'graphviz', 'json', 'ascii'] = NoneΒΆ
graph_name: str = NoneΒΆ
highlight_path: list[str] | None = NoneΒΆ
include_subgraphs: bool = NoneΒΆ
class hap.types.graphs.NodeExecutionInfo(/, **data: Any)ΒΆ

Bases: pydantic.BaseModel

Information about a single node execution.

Parameters:

data (Any)

duration_ms: float | None = NoneΒΆ
end_time: str | None = NoneΒΆ
error: str | None = NoneΒΆ
input_state: dict[str, Any] = NoneΒΆ
node_name: str = NoneΒΆ
output_state: dict[str, Any] | None = NoneΒΆ
start_time: str = NoneΒΆ
status: Literal['success', 'error', 'skipped'] = NoneΒΆ
class hap.types.graphs.NodeInfo(/, **data: Any)ΒΆ

Bases: haive.hap.types.BaseInfo

Information about a node in a graph.

Parameters:

data (Any)

command_goto: str | list[str] | None = NoneΒΆ
created_at: str | None = NoneΒΆ
input_mapping: dict[str, str] | None = NoneΒΆ
node_class: str = NoneΒΆ
node_id: str = NoneΒΆ
node_type: str = NoneΒΆ
output_mapping: dict[str, str] | None = NoneΒΆ
retry_policy: dict[str, Any] | None = NoneΒΆ