devscontext 0.1.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,3 @@
1
+ """DevsContext - MCP server for aggregating development context."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,23 @@
1
+ """Adapters for various context sources.
2
+
3
+ This package contains adapters for fetching context from different sources:
4
+ - JiraAdapter: Jira tickets, comments, and linked issues
5
+ - FirefliesAdapter: Meeting transcripts from Fireflies.ai
6
+ - LocalDocsAdapter: Local markdown documentation
7
+
8
+ All adapters implement the Adapter interface from the plugins module.
9
+ """
10
+
11
+ from devscontext.adapters.fireflies import FirefliesAdapter
12
+ from devscontext.adapters.jira import JiraAdapter
13
+ from devscontext.adapters.local_docs import LocalDocsAdapter
14
+ from devscontext.models import ContextData
15
+ from devscontext.plugins.base import Adapter
16
+
17
+ __all__ = [
18
+ "Adapter",
19
+ "ContextData",
20
+ "FirefliesAdapter",
21
+ "JiraAdapter",
22
+ "LocalDocsAdapter",
23
+ ]
@@ -0,0 +1,105 @@
1
+ """Base adapter interface for context sources.
2
+
3
+ This module defines the abstract base class that all context adapters must
4
+ implement. Adapters are responsible for fetching context from a specific
5
+ source (Jira, Fireflies, local docs, etc.) and returning it in a standardized
6
+ ContextData format.
7
+
8
+ Example:
9
+ class MyAdapter(Adapter):
10
+ @property
11
+ def name(self) -> str:
12
+ return "my_adapter"
13
+
14
+ @property
15
+ def source_type(self) -> str:
16
+ return "custom"
17
+
18
+ async def fetch_context(self, task_id: str) -> list[ContextData]:
19
+ # Fetch and return context
20
+ ...
21
+
22
+ async def health_check(self) -> bool:
23
+ # Check if adapter is healthy
24
+ ...
25
+ """
26
+
27
+ from abc import ABC, abstractmethod
28
+
29
+ from devscontext.models import ContextData
30
+
31
+ # Re-export ContextData for backwards compatibility
32
+ __all__ = ["Adapter", "ContextData"]
33
+
34
+
35
+ class Adapter(ABC):
36
+ """Abstract base class for all context adapters.
37
+
38
+ Subclasses must implement:
39
+ - name: A unique identifier for this adapter
40
+ - source_type: The category of source (issue_tracker, meeting, docs)
41
+ - fetch_context: Fetch context related to a task
42
+ - health_check: Verify the adapter is properly configured
43
+
44
+ Adapters should:
45
+ - Never raise exceptions that crash the MCP server
46
+ - Return empty lists on errors (with logging)
47
+ - Use async for all I/O operations
48
+ - Cache HTTP clients for reuse
49
+ """
50
+
51
+ @property
52
+ @abstractmethod
53
+ def name(self) -> str:
54
+ """Return the unique adapter name.
55
+
56
+ Returns:
57
+ A short, lowercase identifier (e.g., 'jira', 'fireflies').
58
+ """
59
+ ...
60
+
61
+ @property
62
+ @abstractmethod
63
+ def source_type(self) -> str:
64
+ """Return the type of source this adapter provides.
65
+
66
+ Common values:
67
+ - 'issue_tracker': Jira, Linear, GitHub Issues
68
+ - 'meeting': Fireflies, Otter.ai
69
+ - 'documentation': Local docs, Confluence
70
+
71
+ Returns:
72
+ The source type string.
73
+ """
74
+ ...
75
+
76
+ @abstractmethod
77
+ async def fetch_context(self, task_id: str) -> list[ContextData]:
78
+ """Fetch context related to a task.
79
+
80
+ This method should:
81
+ - Return all relevant context for the given task ID
82
+ - Handle errors gracefully (log and return empty list)
83
+ - Use caching when appropriate
84
+
85
+ Args:
86
+ task_id: The task identifier (e.g., Jira ticket ID like 'PROJ-123').
87
+
88
+ Returns:
89
+ A list of ContextData items. Empty list if nothing found or on error.
90
+ """
91
+ ...
92
+
93
+ @abstractmethod
94
+ async def health_check(self) -> bool:
95
+ """Check if the adapter is properly configured and can connect.
96
+
97
+ This method should:
98
+ - Verify configuration is valid
99
+ - Test connectivity to the external service
100
+ - Return True for disabled adapters (they're "healthy" by definition)
101
+
102
+ Returns:
103
+ True if the adapter is healthy/disabled, False if there's an issue.
104
+ """
105
+ ...