26 lines
797 B
Python
26 lines
797 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
from ..states.ingestion_state import IngestionState
|
|
|
|
|
|
def discovery_node(state: IngestionState) -> dict[str, Any]:
|
|
"""Discovery Phase: Check existing capabilities and resources non-blockingly."""
|
|
request = state.get("request")
|
|
source = request.source if request else "unknown"
|
|
locator = request.locator if request else "unknown"
|
|
|
|
# Non-blocking check for existing ingestion resources
|
|
existing_resources = {
|
|
"source": source,
|
|
"locator": locator,
|
|
"previously_ingested": False,
|
|
"connector_available": source in {"github", "sharepoint"},
|
|
}
|
|
|
|
return {
|
|
"existing_resources": existing_resources,
|
|
"current_step": "discovery",
|
|
"next_step": "validation",
|
|
}
|