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.
- devscontext/__init__.py +3 -0
- devscontext/adapters/__init__.py +23 -0
- devscontext/adapters/base.py +105 -0
- devscontext/adapters/fireflies.py +585 -0
- devscontext/adapters/gmail.py +580 -0
- devscontext/adapters/jira.py +639 -0
- devscontext/adapters/local_docs.py +984 -0
- devscontext/adapters/slack.py +804 -0
- devscontext/agents/__init__.py +28 -0
- devscontext/agents/preprocessor.py +775 -0
- devscontext/agents/watcher.py +265 -0
- devscontext/cache.py +151 -0
- devscontext/cli.py +727 -0
- devscontext/config.py +264 -0
- devscontext/constants.py +107 -0
- devscontext/core.py +582 -0
- devscontext/exceptions.py +148 -0
- devscontext/logging.py +181 -0
- devscontext/models.py +504 -0
- devscontext/plugins/__init__.py +49 -0
- devscontext/plugins/base.py +321 -0
- devscontext/plugins/registry.py +544 -0
- devscontext/py.typed +0 -0
- devscontext/rag/__init__.py +113 -0
- devscontext/rag/embeddings.py +296 -0
- devscontext/rag/index.py +323 -0
- devscontext/server.py +374 -0
- devscontext/storage.py +321 -0
- devscontext/synthesis.py +1057 -0
- devscontext/utils.py +297 -0
- devscontext-0.1.0.dist-info/METADATA +253 -0
- devscontext-0.1.0.dist-info/RECORD +35 -0
- devscontext-0.1.0.dist-info/WHEEL +4 -0
- devscontext-0.1.0.dist-info/entry_points.txt +2 -0
- devscontext-0.1.0.dist-info/licenses/LICENSE +21 -0
devscontext/__init__.py
ADDED
|
@@ -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
|
+
...
|