mcp-ticketer 0.1.30__py3-none-any.whl → 1.2.11__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.
Potentially problematic release.
This version of mcp-ticketer might be problematic. Click here for more details.
- mcp_ticketer/__init__.py +10 -10
- mcp_ticketer/__version__.py +3 -3
- mcp_ticketer/adapters/__init__.py +2 -0
- mcp_ticketer/adapters/aitrackdown.py +796 -46
- mcp_ticketer/adapters/asana/__init__.py +15 -0
- mcp_ticketer/adapters/asana/adapter.py +1416 -0
- mcp_ticketer/adapters/asana/client.py +292 -0
- mcp_ticketer/adapters/asana/mappers.py +348 -0
- mcp_ticketer/adapters/asana/types.py +146 -0
- mcp_ticketer/adapters/github.py +879 -129
- mcp_ticketer/adapters/hybrid.py +11 -11
- mcp_ticketer/adapters/jira.py +973 -73
- mcp_ticketer/adapters/linear/__init__.py +24 -0
- mcp_ticketer/adapters/linear/adapter.py +2732 -0
- mcp_ticketer/adapters/linear/client.py +344 -0
- mcp_ticketer/adapters/linear/mappers.py +420 -0
- mcp_ticketer/adapters/linear/queries.py +479 -0
- mcp_ticketer/adapters/linear/types.py +360 -0
- mcp_ticketer/adapters/linear.py +10 -2315
- mcp_ticketer/analysis/__init__.py +23 -0
- mcp_ticketer/analysis/orphaned.py +218 -0
- mcp_ticketer/analysis/similarity.py +224 -0
- mcp_ticketer/analysis/staleness.py +266 -0
- mcp_ticketer/cache/memory.py +9 -8
- mcp_ticketer/cli/adapter_diagnostics.py +421 -0
- mcp_ticketer/cli/auggie_configure.py +116 -15
- mcp_ticketer/cli/codex_configure.py +274 -82
- mcp_ticketer/cli/configure.py +888 -151
- mcp_ticketer/cli/diagnostics.py +400 -157
- mcp_ticketer/cli/discover.py +297 -26
- mcp_ticketer/cli/gemini_configure.py +119 -26
- mcp_ticketer/cli/init_command.py +880 -0
- mcp_ticketer/cli/instruction_commands.py +435 -0
- mcp_ticketer/cli/linear_commands.py +616 -0
- mcp_ticketer/cli/main.py +203 -1165
- mcp_ticketer/cli/mcp_configure.py +474 -90
- mcp_ticketer/cli/mcp_server_commands.py +415 -0
- mcp_ticketer/cli/migrate_config.py +12 -8
- mcp_ticketer/cli/platform_commands.py +123 -0
- mcp_ticketer/cli/platform_detection.py +418 -0
- mcp_ticketer/cli/platform_installer.py +513 -0
- mcp_ticketer/cli/python_detection.py +126 -0
- mcp_ticketer/cli/queue_commands.py +15 -15
- mcp_ticketer/cli/setup_command.py +639 -0
- mcp_ticketer/cli/simple_health.py +90 -65
- mcp_ticketer/cli/ticket_commands.py +1013 -0
- mcp_ticketer/cli/update_checker.py +313 -0
- mcp_ticketer/cli/utils.py +114 -66
- mcp_ticketer/core/__init__.py +24 -1
- mcp_ticketer/core/adapter.py +250 -16
- mcp_ticketer/core/config.py +145 -37
- mcp_ticketer/core/env_discovery.py +101 -22
- mcp_ticketer/core/env_loader.py +349 -0
- mcp_ticketer/core/exceptions.py +160 -0
- mcp_ticketer/core/http_client.py +26 -26
- mcp_ticketer/core/instructions.py +405 -0
- mcp_ticketer/core/label_manager.py +732 -0
- mcp_ticketer/core/mappers.py +42 -30
- mcp_ticketer/core/models.py +280 -28
- mcp_ticketer/core/onepassword_secrets.py +379 -0
- mcp_ticketer/core/project_config.py +183 -49
- mcp_ticketer/core/registry.py +3 -3
- mcp_ticketer/core/session_state.py +171 -0
- mcp_ticketer/core/state_matcher.py +592 -0
- mcp_ticketer/core/url_parser.py +425 -0
- mcp_ticketer/core/validators.py +69 -0
- mcp_ticketer/defaults/ticket_instructions.md +644 -0
- mcp_ticketer/mcp/__init__.py +29 -1
- mcp_ticketer/mcp/__main__.py +60 -0
- mcp_ticketer/mcp/server/__init__.py +25 -0
- mcp_ticketer/mcp/server/__main__.py +60 -0
- mcp_ticketer/mcp/server/constants.py +58 -0
- mcp_ticketer/mcp/server/diagnostic_helper.py +175 -0
- mcp_ticketer/mcp/server/dto.py +195 -0
- mcp_ticketer/mcp/server/main.py +1343 -0
- mcp_ticketer/mcp/server/response_builder.py +206 -0
- mcp_ticketer/mcp/server/routing.py +655 -0
- mcp_ticketer/mcp/server/server_sdk.py +151 -0
- mcp_ticketer/mcp/server/tools/__init__.py +56 -0
- mcp_ticketer/mcp/server/tools/analysis_tools.py +495 -0
- mcp_ticketer/mcp/server/tools/attachment_tools.py +226 -0
- mcp_ticketer/mcp/server/tools/bulk_tools.py +273 -0
- mcp_ticketer/mcp/server/tools/comment_tools.py +152 -0
- mcp_ticketer/mcp/server/tools/config_tools.py +1439 -0
- mcp_ticketer/mcp/server/tools/diagnostic_tools.py +211 -0
- mcp_ticketer/mcp/server/tools/hierarchy_tools.py +921 -0
- mcp_ticketer/mcp/server/tools/instruction_tools.py +300 -0
- mcp_ticketer/mcp/server/tools/label_tools.py +948 -0
- mcp_ticketer/mcp/server/tools/pr_tools.py +152 -0
- mcp_ticketer/mcp/server/tools/search_tools.py +215 -0
- mcp_ticketer/mcp/server/tools/session_tools.py +170 -0
- mcp_ticketer/mcp/server/tools/ticket_tools.py +1268 -0
- mcp_ticketer/mcp/server/tools/user_ticket_tools.py +547 -0
- mcp_ticketer/queue/__init__.py +1 -0
- mcp_ticketer/queue/health_monitor.py +168 -136
- mcp_ticketer/queue/manager.py +95 -25
- mcp_ticketer/queue/queue.py +40 -21
- mcp_ticketer/queue/run_worker.py +6 -1
- mcp_ticketer/queue/ticket_registry.py +213 -155
- mcp_ticketer/queue/worker.py +109 -49
- mcp_ticketer-1.2.11.dist-info/METADATA +792 -0
- mcp_ticketer-1.2.11.dist-info/RECORD +110 -0
- mcp_ticketer/mcp/server.py +0 -1895
- mcp_ticketer-0.1.30.dist-info/METADATA +0 -413
- mcp_ticketer-0.1.30.dist-info/RECORD +0 -49
- {mcp_ticketer-0.1.30.dist-info → mcp_ticketer-1.2.11.dist-info}/WHEEL +0 -0
- {mcp_ticketer-0.1.30.dist-info → mcp_ticketer-1.2.11.dist-info}/entry_points.txt +0 -0
- {mcp_ticketer-0.1.30.dist-info → mcp_ticketer-1.2.11.dist-info}/licenses/LICENSE +0 -0
- {mcp_ticketer-0.1.30.dist-info → mcp_ticketer-1.2.11.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"""Response builder utility for consistent MCP responses."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from .constants import JSONRPC_VERSION, STATUS_COMPLETED
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ResponseBuilder:
|
|
9
|
+
"""Build consistent JSON-RPC and MCP responses."""
|
|
10
|
+
|
|
11
|
+
@staticmethod
|
|
12
|
+
def success(
|
|
13
|
+
request_id: Any,
|
|
14
|
+
result: dict[str, Any],
|
|
15
|
+
status: str = STATUS_COMPLETED,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
"""Build successful response.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
request_id: Request ID
|
|
21
|
+
result: Result data
|
|
22
|
+
status: Status value
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
JSON-RPC response
|
|
26
|
+
|
|
27
|
+
"""
|
|
28
|
+
return {
|
|
29
|
+
"jsonrpc": JSONRPC_VERSION,
|
|
30
|
+
"result": {"status": status, **result},
|
|
31
|
+
"id": request_id,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def error(
|
|
36
|
+
request_id: Any,
|
|
37
|
+
code: int,
|
|
38
|
+
message: str,
|
|
39
|
+
data: dict[str, Any] | None = None,
|
|
40
|
+
) -> dict[str, Any]:
|
|
41
|
+
"""Build error response.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
request_id: Request ID
|
|
45
|
+
code: Error code
|
|
46
|
+
message: Error message
|
|
47
|
+
data: Additional error data
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
JSON-RPC error response
|
|
51
|
+
|
|
52
|
+
"""
|
|
53
|
+
error_obj = {"code": code, "message": message}
|
|
54
|
+
if data:
|
|
55
|
+
error_obj["data"] = data
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
"jsonrpc": JSONRPC_VERSION,
|
|
59
|
+
"error": error_obj,
|
|
60
|
+
"id": request_id,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@staticmethod
|
|
64
|
+
def status_result(status: str, **kwargs: Any) -> dict[str, Any]:
|
|
65
|
+
"""Build status result with additional fields.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
status: Status value
|
|
69
|
+
**kwargs: Additional fields
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Result dictionary
|
|
73
|
+
|
|
74
|
+
"""
|
|
75
|
+
return {"status": status, **kwargs}
|
|
76
|
+
|
|
77
|
+
@staticmethod
|
|
78
|
+
def ticket_result(ticket: Any) -> dict[str, Any]:
|
|
79
|
+
"""Build ticket result.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
ticket: Ticket object
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Result dictionary with ticket data
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
return {"ticket": ticket.model_dump()}
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def tickets_result(tickets: list[Any]) -> dict[str, Any]:
|
|
92
|
+
"""Build tickets list result.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
tickets: List of ticket objects
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Result dictionary with tickets data
|
|
99
|
+
|
|
100
|
+
"""
|
|
101
|
+
return {"tickets": [t.model_dump() for t in tickets]}
|
|
102
|
+
|
|
103
|
+
@staticmethod
|
|
104
|
+
def comment_result(comment: Any) -> dict[str, Any]:
|
|
105
|
+
"""Build comment result.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
comment: Comment object
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Result dictionary with comment data
|
|
112
|
+
|
|
113
|
+
"""
|
|
114
|
+
return {"comment": comment.model_dump()}
|
|
115
|
+
|
|
116
|
+
@staticmethod
|
|
117
|
+
def comments_result(comments: list[Any]) -> dict[str, Any]:
|
|
118
|
+
"""Build comments list result.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
comments: List of comment objects
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Result dictionary with comments data
|
|
125
|
+
|
|
126
|
+
"""
|
|
127
|
+
return {"comments": [c.model_dump() for c in comments]}
|
|
128
|
+
|
|
129
|
+
@staticmethod
|
|
130
|
+
def deletion_result(ticket_id: str, success: bool) -> dict[str, Any]:
|
|
131
|
+
"""Build deletion result.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
ticket_id: ID of deleted ticket
|
|
135
|
+
success: Whether deletion was successful
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Result dictionary with deletion status
|
|
139
|
+
|
|
140
|
+
"""
|
|
141
|
+
return {"success": success, "ticket_id": ticket_id}
|
|
142
|
+
|
|
143
|
+
@staticmethod
|
|
144
|
+
def bulk_result(results: list[dict[str, Any]]) -> dict[str, Any]:
|
|
145
|
+
"""Build bulk operation result.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
results: List of operation results
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Result dictionary with bulk operation data
|
|
152
|
+
|
|
153
|
+
"""
|
|
154
|
+
return {"results": results, "count": len(results)}
|
|
155
|
+
|
|
156
|
+
@staticmethod
|
|
157
|
+
def epics_result(epics: list[Any]) -> dict[str, Any]:
|
|
158
|
+
"""Build epics list result.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
epics: List of epic objects
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
Result dictionary with epics data
|
|
165
|
+
|
|
166
|
+
"""
|
|
167
|
+
return {"epics": [epic.model_dump() for epic in epics]}
|
|
168
|
+
|
|
169
|
+
@staticmethod
|
|
170
|
+
def issues_result(issues: list[Any]) -> dict[str, Any]:
|
|
171
|
+
"""Build issues list result.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
issues: List of issue objects
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
Result dictionary with issues data
|
|
178
|
+
|
|
179
|
+
"""
|
|
180
|
+
return {"issues": [issue.model_dump() for issue in issues]}
|
|
181
|
+
|
|
182
|
+
@staticmethod
|
|
183
|
+
def tasks_result(tasks: list[Any]) -> dict[str, Any]:
|
|
184
|
+
"""Build tasks list result.
|
|
185
|
+
|
|
186
|
+
Args:
|
|
187
|
+
tasks: List of task objects
|
|
188
|
+
|
|
189
|
+
Returns:
|
|
190
|
+
Result dictionary with tasks data
|
|
191
|
+
|
|
192
|
+
"""
|
|
193
|
+
return {"tasks": [task.model_dump() for task in tasks]}
|
|
194
|
+
|
|
195
|
+
@staticmethod
|
|
196
|
+
def attachments_result(attachments: list[Any]) -> dict[str, Any]:
|
|
197
|
+
"""Build attachments list result.
|
|
198
|
+
|
|
199
|
+
Args:
|
|
200
|
+
attachments: List of attachment objects
|
|
201
|
+
|
|
202
|
+
Returns:
|
|
203
|
+
Result dictionary with attachments data
|
|
204
|
+
|
|
205
|
+
"""
|
|
206
|
+
return {"attachments": attachments}
|