agent-tracegraph 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ """Ingestion adapters: external trace source -> RawTrace."""
2
+
3
+ from tracegraph.adapters.base import TraceAdapter
4
+ from tracegraph.adapters.langgraph_checkpoint import LangGraphCheckpointAdapter
5
+ from tracegraph.adapters.otlp_spans import OTLPSpanAdapter
6
+ from tracegraph.adapters.phoenix_export import PhoenixExportAdapter
7
+
8
+ __all__ = [
9
+ "TraceAdapter",
10
+ "LangGraphCheckpointAdapter",
11
+ "OTLPSpanAdapter",
12
+ "PhoenixExportAdapter",
13
+ ]
@@ -0,0 +1,22 @@
1
+ """The adapter interface: turn an external trace source into a :class:`RawTrace`.
2
+
3
+ An adapter never computes the derived tree — it only reconstructs the raw causal graph
4
+ (steps + ``CAUSED_BY`` edges). ``normalize`` does the rest.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import Protocol, runtime_checkable
10
+
11
+ from tracegraph.model import RawTrace
12
+
13
+
14
+ @runtime_checkable
15
+ class TraceAdapter(Protocol):
16
+ def discover(self) -> list[str]:
17
+ """Best-effort list of available trace ids (may be unsupported by a source)."""
18
+ ...
19
+
20
+ def ingest(self, trace_id: str) -> RawTrace:
21
+ """Reconstruct one trace's raw causal graph. Raises ``KeyError`` if not found."""
22
+ ...