mcp-ticketer 0.12.0__py3-none-any.whl → 2.2.13__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 +1 -1
- mcp_ticketer/_version_scm.py +1 -0
- mcp_ticketer/adapters/aitrackdown.py +507 -6
- mcp_ticketer/adapters/asana/adapter.py +229 -0
- mcp_ticketer/adapters/asana/mappers.py +14 -0
- mcp_ticketer/adapters/github/__init__.py +26 -0
- mcp_ticketer/adapters/github/adapter.py +3229 -0
- mcp_ticketer/adapters/github/client.py +335 -0
- mcp_ticketer/adapters/github/mappers.py +797 -0
- mcp_ticketer/adapters/github/queries.py +692 -0
- mcp_ticketer/adapters/github/types.py +460 -0
- mcp_ticketer/adapters/hybrid.py +47 -5
- mcp_ticketer/adapters/jira/__init__.py +35 -0
- mcp_ticketer/adapters/jira/adapter.py +1351 -0
- mcp_ticketer/adapters/jira/client.py +271 -0
- mcp_ticketer/adapters/jira/mappers.py +246 -0
- mcp_ticketer/adapters/jira/queries.py +216 -0
- mcp_ticketer/adapters/jira/types.py +304 -0
- mcp_ticketer/adapters/linear/adapter.py +2730 -139
- mcp_ticketer/adapters/linear/client.py +175 -3
- mcp_ticketer/adapters/linear/mappers.py +203 -8
- mcp_ticketer/adapters/linear/queries.py +280 -3
- mcp_ticketer/adapters/linear/types.py +120 -4
- mcp_ticketer/analysis/__init__.py +56 -0
- mcp_ticketer/analysis/dependency_graph.py +255 -0
- mcp_ticketer/analysis/health_assessment.py +304 -0
- mcp_ticketer/analysis/orphaned.py +218 -0
- mcp_ticketer/analysis/project_status.py +594 -0
- mcp_ticketer/analysis/similarity.py +224 -0
- mcp_ticketer/analysis/staleness.py +266 -0
- mcp_ticketer/automation/__init__.py +11 -0
- mcp_ticketer/automation/project_updates.py +378 -0
- mcp_ticketer/cli/adapter_diagnostics.py +3 -1
- mcp_ticketer/cli/auggie_configure.py +17 -5
- mcp_ticketer/cli/codex_configure.py +97 -61
- mcp_ticketer/cli/configure.py +1288 -105
- mcp_ticketer/cli/cursor_configure.py +314 -0
- mcp_ticketer/cli/diagnostics.py +13 -12
- mcp_ticketer/cli/discover.py +5 -0
- mcp_ticketer/cli/gemini_configure.py +17 -5
- mcp_ticketer/cli/init_command.py +880 -0
- mcp_ticketer/cli/install_mcp_server.py +418 -0
- mcp_ticketer/cli/instruction_commands.py +6 -0
- mcp_ticketer/cli/main.py +267 -3175
- mcp_ticketer/cli/mcp_configure.py +821 -119
- mcp_ticketer/cli/mcp_server_commands.py +415 -0
- mcp_ticketer/cli/platform_detection.py +77 -12
- mcp_ticketer/cli/platform_installer.py +545 -0
- mcp_ticketer/cli/project_update_commands.py +350 -0
- mcp_ticketer/cli/setup_command.py +795 -0
- mcp_ticketer/cli/simple_health.py +12 -10
- mcp_ticketer/cli/ticket_commands.py +705 -103
- mcp_ticketer/cli/utils.py +113 -0
- mcp_ticketer/core/__init__.py +56 -6
- mcp_ticketer/core/adapter.py +533 -2
- mcp_ticketer/core/config.py +21 -21
- mcp_ticketer/core/exceptions.py +7 -1
- mcp_ticketer/core/label_manager.py +732 -0
- mcp_ticketer/core/mappers.py +31 -19
- mcp_ticketer/core/milestone_manager.py +252 -0
- mcp_ticketer/core/models.py +480 -0
- mcp_ticketer/core/onepassword_secrets.py +1 -1
- mcp_ticketer/core/priority_matcher.py +463 -0
- mcp_ticketer/core/project_config.py +132 -14
- mcp_ticketer/core/project_utils.py +281 -0
- mcp_ticketer/core/project_validator.py +376 -0
- mcp_ticketer/core/session_state.py +176 -0
- mcp_ticketer/core/state_matcher.py +625 -0
- mcp_ticketer/core/url_parser.py +425 -0
- mcp_ticketer/core/validators.py +69 -0
- mcp_ticketer/mcp/server/__main__.py +2 -1
- mcp_ticketer/mcp/server/diagnostic_helper.py +175 -0
- mcp_ticketer/mcp/server/main.py +106 -25
- mcp_ticketer/mcp/server/routing.py +723 -0
- mcp_ticketer/mcp/server/server_sdk.py +58 -0
- mcp_ticketer/mcp/server/tools/__init__.py +33 -11
- mcp_ticketer/mcp/server/tools/analysis_tools.py +854 -0
- mcp_ticketer/mcp/server/tools/attachment_tools.py +5 -5
- mcp_ticketer/mcp/server/tools/bulk_tools.py +259 -202
- mcp_ticketer/mcp/server/tools/comment_tools.py +74 -12
- mcp_ticketer/mcp/server/tools/config_tools.py +1391 -145
- mcp_ticketer/mcp/server/tools/diagnostic_tools.py +211 -0
- mcp_ticketer/mcp/server/tools/hierarchy_tools.py +870 -460
- mcp_ticketer/mcp/server/tools/instruction_tools.py +7 -5
- mcp_ticketer/mcp/server/tools/label_tools.py +942 -0
- mcp_ticketer/mcp/server/tools/milestone_tools.py +338 -0
- mcp_ticketer/mcp/server/tools/pr_tools.py +3 -7
- mcp_ticketer/mcp/server/tools/project_status_tools.py +158 -0
- mcp_ticketer/mcp/server/tools/project_update_tools.py +473 -0
- mcp_ticketer/mcp/server/tools/search_tools.py +209 -97
- mcp_ticketer/mcp/server/tools/session_tools.py +308 -0
- mcp_ticketer/mcp/server/tools/ticket_tools.py +1107 -124
- mcp_ticketer/mcp/server/tools/user_ticket_tools.py +218 -236
- mcp_ticketer/queue/queue.py +68 -0
- mcp_ticketer/queue/worker.py +1 -1
- mcp_ticketer/utils/__init__.py +5 -0
- mcp_ticketer/utils/token_utils.py +246 -0
- mcp_ticketer-2.2.13.dist-info/METADATA +1396 -0
- mcp_ticketer-2.2.13.dist-info/RECORD +158 -0
- mcp_ticketer-2.2.13.dist-info/top_level.txt +2 -0
- py_mcp_installer/examples/phase3_demo.py +178 -0
- py_mcp_installer/scripts/manage_version.py +54 -0
- py_mcp_installer/setup.py +6 -0
- py_mcp_installer/src/py_mcp_installer/__init__.py +153 -0
- py_mcp_installer/src/py_mcp_installer/command_builder.py +445 -0
- py_mcp_installer/src/py_mcp_installer/config_manager.py +541 -0
- py_mcp_installer/src/py_mcp_installer/exceptions.py +243 -0
- py_mcp_installer/src/py_mcp_installer/installation_strategy.py +617 -0
- py_mcp_installer/src/py_mcp_installer/installer.py +656 -0
- py_mcp_installer/src/py_mcp_installer/mcp_inspector.py +750 -0
- py_mcp_installer/src/py_mcp_installer/platform_detector.py +451 -0
- py_mcp_installer/src/py_mcp_installer/platforms/__init__.py +26 -0
- py_mcp_installer/src/py_mcp_installer/platforms/claude_code.py +225 -0
- py_mcp_installer/src/py_mcp_installer/platforms/codex.py +181 -0
- py_mcp_installer/src/py_mcp_installer/platforms/cursor.py +191 -0
- py_mcp_installer/src/py_mcp_installer/types.py +222 -0
- py_mcp_installer/src/py_mcp_installer/utils.py +463 -0
- py_mcp_installer/tests/__init__.py +0 -0
- py_mcp_installer/tests/platforms/__init__.py +0 -0
- py_mcp_installer/tests/test_platform_detector.py +17 -0
- mcp_ticketer/adapters/github.py +0 -1574
- mcp_ticketer/adapters/jira.py +0 -1258
- mcp_ticketer-0.12.0.dist-info/METADATA +0 -550
- mcp_ticketer-0.12.0.dist-info/RECORD +0 -91
- mcp_ticketer-0.12.0.dist-info/top_level.txt +0 -1
- {mcp_ticketer-0.12.0.dist-info → mcp_ticketer-2.2.13.dist-info}/WHEEL +0 -0
- {mcp_ticketer-0.12.0.dist-info → mcp_ticketer-2.2.13.dist-info}/entry_points.txt +0 -0
- {mcp_ticketer-0.12.0.dist-info → mcp_ticketer-2.2.13.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"""Orphaned ticket detection - tickets without parent epic/project.
|
|
2
|
+
|
|
3
|
+
This module identifies tickets that are not properly organized in the hierarchy:
|
|
4
|
+
- Tickets without parent epic/milestone
|
|
5
|
+
- Tickets not assigned to any project/team
|
|
6
|
+
- Standalone issues that should be part of larger initiatives
|
|
7
|
+
|
|
8
|
+
Proper hierarchy ensures better organization and tracking of work.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import TYPE_CHECKING
|
|
12
|
+
|
|
13
|
+
from pydantic import BaseModel
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from ..core.models import Task
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class OrphanedResult(BaseModel):
|
|
20
|
+
"""Result of orphaned ticket analysis.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
ticket_id: ID of the orphaned ticket
|
|
24
|
+
ticket_title: Title of the orphaned ticket
|
|
25
|
+
ticket_type: Type of ticket (task, issue, epic)
|
|
26
|
+
orphan_type: Type of orphan condition (no_parent, no_epic, no_project)
|
|
27
|
+
suggested_action: Recommended action (assign_epic, assign_project, review)
|
|
28
|
+
reason: Human-readable explanation
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
ticket_id: str
|
|
33
|
+
ticket_title: str
|
|
34
|
+
ticket_type: str # "task", "issue", "epic"
|
|
35
|
+
orphan_type: str # "no_parent", "no_epic", "no_project"
|
|
36
|
+
suggested_action: str # "assign_epic", "assign_project", "review"
|
|
37
|
+
reason: str
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class OrphanedTicketDetector:
|
|
41
|
+
"""Detects orphaned tickets without proper hierarchy.
|
|
42
|
+
|
|
43
|
+
Analyzes tickets to find those missing proper parent relationships:
|
|
44
|
+
- Tasks without parent issues
|
|
45
|
+
- Issues without parent epics
|
|
46
|
+
- Tickets without project/team assignments
|
|
47
|
+
|
|
48
|
+
This helps identify organizational gaps in ticket management.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def find_orphaned_tickets(
|
|
52
|
+
self,
|
|
53
|
+
tickets: list["Task"],
|
|
54
|
+
epics: list["Task"] | None = None,
|
|
55
|
+
) -> list[OrphanedResult]:
|
|
56
|
+
"""Find tickets without parent epic/project associations.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
tickets: List of tickets to analyze
|
|
60
|
+
epics: Optional list of epics for validation
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
List of orphaned tickets with suggested actions
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
results = []
|
|
67
|
+
|
|
68
|
+
for ticket in tickets:
|
|
69
|
+
orphan_types = self._check_orphaned(ticket)
|
|
70
|
+
|
|
71
|
+
for orphan_type in orphan_types:
|
|
72
|
+
result = OrphanedResult(
|
|
73
|
+
ticket_id=ticket.id or "unknown",
|
|
74
|
+
ticket_title=ticket.title,
|
|
75
|
+
ticket_type=self._get_ticket_type(ticket),
|
|
76
|
+
orphan_type=orphan_type,
|
|
77
|
+
suggested_action=self._suggest_action(orphan_type),
|
|
78
|
+
reason=self._build_reason(orphan_type, ticket),
|
|
79
|
+
)
|
|
80
|
+
results.append(result)
|
|
81
|
+
|
|
82
|
+
return results
|
|
83
|
+
|
|
84
|
+
def _check_orphaned(self, ticket: "Task") -> list[str]:
|
|
85
|
+
"""Check if ticket is orphaned in various ways.
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
ticket: Ticket to check
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
List of orphan type strings
|
|
92
|
+
|
|
93
|
+
"""
|
|
94
|
+
orphan_types = []
|
|
95
|
+
metadata = ticket.metadata or {}
|
|
96
|
+
|
|
97
|
+
# Check ticket type
|
|
98
|
+
ticket_type = self._get_ticket_type(ticket)
|
|
99
|
+
|
|
100
|
+
# For tasks, check parent_issue
|
|
101
|
+
if ticket_type == "task":
|
|
102
|
+
if not getattr(ticket, "parent_issue", None):
|
|
103
|
+
orphan_types.append("no_parent")
|
|
104
|
+
return orphan_types
|
|
105
|
+
|
|
106
|
+
# For issues, check parent_epic and project
|
|
107
|
+
if ticket_type == "issue":
|
|
108
|
+
# Check for parent epic
|
|
109
|
+
has_epic = any(
|
|
110
|
+
[
|
|
111
|
+
getattr(ticket, "parent_epic", None),
|
|
112
|
+
metadata.get("parent_id"),
|
|
113
|
+
metadata.get("parentId"),
|
|
114
|
+
metadata.get("epic_id"),
|
|
115
|
+
metadata.get("epicId"),
|
|
116
|
+
metadata.get("milestone_id"), # GitHub milestones
|
|
117
|
+
metadata.get("epic"), # JIRA epics
|
|
118
|
+
]
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
if not has_epic:
|
|
122
|
+
orphan_types.append("no_epic")
|
|
123
|
+
|
|
124
|
+
# Check for project assignment
|
|
125
|
+
has_project = any(
|
|
126
|
+
[
|
|
127
|
+
metadata.get("project_id"),
|
|
128
|
+
metadata.get("projectId"),
|
|
129
|
+
metadata.get("team_id"),
|
|
130
|
+
metadata.get("teamId"),
|
|
131
|
+
metadata.get("board_id"), # JIRA boards
|
|
132
|
+
metadata.get("workspace_id"), # Asana workspaces
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
if not has_project:
|
|
137
|
+
orphan_types.append("no_project")
|
|
138
|
+
|
|
139
|
+
# If neither epic nor project
|
|
140
|
+
if not has_epic and not has_project:
|
|
141
|
+
orphan_types.append("no_parent")
|
|
142
|
+
|
|
143
|
+
return orphan_types
|
|
144
|
+
|
|
145
|
+
def _get_ticket_type(self, ticket: "Task") -> str:
|
|
146
|
+
"""Determine ticket type from metadata.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
ticket: Ticket to analyze
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
Ticket type string (task, issue, epic)
|
|
153
|
+
|
|
154
|
+
"""
|
|
155
|
+
from ..core.models import TicketType
|
|
156
|
+
|
|
157
|
+
# Check explicit ticket_type field
|
|
158
|
+
ticket_type = getattr(ticket, "ticket_type", None)
|
|
159
|
+
if ticket_type:
|
|
160
|
+
if ticket_type == TicketType.EPIC:
|
|
161
|
+
return "epic"
|
|
162
|
+
elif ticket_type in (TicketType.TASK, TicketType.SUBTASK):
|
|
163
|
+
return "task"
|
|
164
|
+
elif ticket_type == TicketType.ISSUE:
|
|
165
|
+
return "issue"
|
|
166
|
+
|
|
167
|
+
# Fallback to metadata inspection
|
|
168
|
+
metadata = ticket.metadata or {}
|
|
169
|
+
|
|
170
|
+
if metadata.get("type") == "epic":
|
|
171
|
+
return "epic"
|
|
172
|
+
elif metadata.get("issue_type") == "Epic":
|
|
173
|
+
return "epic"
|
|
174
|
+
elif metadata.get("type") == "task":
|
|
175
|
+
return "task"
|
|
176
|
+
elif getattr(ticket, "parent_issue", None):
|
|
177
|
+
return "task" # Has parent issue, so it's a task
|
|
178
|
+
else:
|
|
179
|
+
return "issue" # Default to issue
|
|
180
|
+
|
|
181
|
+
def _suggest_action(self, orphan_type: str) -> str:
|
|
182
|
+
"""Suggest action for orphaned ticket.
|
|
183
|
+
|
|
184
|
+
Args:
|
|
185
|
+
orphan_type: Type of orphan condition
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Suggested action string
|
|
189
|
+
|
|
190
|
+
"""
|
|
191
|
+
if orphan_type == "no_parent":
|
|
192
|
+
return "review" # Needs manual review
|
|
193
|
+
elif orphan_type == "no_epic":
|
|
194
|
+
return "assign_epic"
|
|
195
|
+
elif orphan_type == "no_project":
|
|
196
|
+
return "assign_project"
|
|
197
|
+
else:
|
|
198
|
+
return "review"
|
|
199
|
+
|
|
200
|
+
def _build_reason(self, orphan_type: str, ticket: "Task") -> str:
|
|
201
|
+
"""Build human-readable reason.
|
|
202
|
+
|
|
203
|
+
Args:
|
|
204
|
+
orphan_type: Type of orphan condition
|
|
205
|
+
ticket: The ticket being analyzed
|
|
206
|
+
|
|
207
|
+
Returns:
|
|
208
|
+
Human-readable explanation
|
|
209
|
+
|
|
210
|
+
"""
|
|
211
|
+
ticket_type = self._get_ticket_type(ticket)
|
|
212
|
+
|
|
213
|
+
reasons = {
|
|
214
|
+
"no_parent": f"{ticket_type.capitalize()} has no parent epic or project assigned",
|
|
215
|
+
"no_epic": f"{ticket_type.capitalize()} is missing parent epic/milestone",
|
|
216
|
+
"no_project": f"{ticket_type.capitalize()} is not assigned to any project/team",
|
|
217
|
+
}
|
|
218
|
+
return reasons.get(orphan_type, "Orphaned ticket")
|