mcp-ticketer 0.4.11__py3-none-any.whl → 2.0.1__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 +394 -9
- 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 +836 -105
- mcp_ticketer/adapters/hybrid.py +47 -5
- mcp_ticketer/adapters/jira.py +772 -1
- mcp_ticketer/adapters/linear/adapter.py +2293 -108
- mcp_ticketer/adapters/linear/client.py +146 -12
- mcp_ticketer/adapters/linear/mappers.py +105 -11
- mcp_ticketer/adapters/linear/queries.py +168 -1
- mcp_ticketer/adapters/linear/types.py +80 -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/cache/memory.py +3 -3
- mcp_ticketer/cli/adapter_diagnostics.py +4 -2
- mcp_ticketer/cli/auggie_configure.py +18 -6
- mcp_ticketer/cli/codex_configure.py +175 -60
- mcp_ticketer/cli/configure.py +884 -146
- mcp_ticketer/cli/cursor_configure.py +314 -0
- mcp_ticketer/cli/diagnostics.py +31 -28
- mcp_ticketer/cli/discover.py +293 -21
- mcp_ticketer/cli/gemini_configure.py +18 -6
- mcp_ticketer/cli/init_command.py +880 -0
- mcp_ticketer/cli/instruction_commands.py +435 -0
- mcp_ticketer/cli/linear_commands.py +99 -15
- mcp_ticketer/cli/main.py +109 -2055
- mcp_ticketer/cli/mcp_configure.py +673 -99
- mcp_ticketer/cli/mcp_server_commands.py +415 -0
- mcp_ticketer/cli/migrate_config.py +12 -8
- mcp_ticketer/cli/platform_commands.py +6 -6
- mcp_ticketer/cli/platform_detection.py +477 -0
- mcp_ticketer/cli/platform_installer.py +536 -0
- mcp_ticketer/cli/project_update_commands.py +350 -0
- mcp_ticketer/cli/queue_commands.py +15 -15
- mcp_ticketer/cli/setup_command.py +639 -0
- mcp_ticketer/cli/simple_health.py +13 -11
- mcp_ticketer/cli/ticket_commands.py +277 -36
- mcp_ticketer/cli/update_checker.py +313 -0
- mcp_ticketer/cli/utils.py +45 -41
- mcp_ticketer/core/__init__.py +35 -1
- mcp_ticketer/core/adapter.py +170 -5
- mcp_ticketer/core/config.py +38 -31
- mcp_ticketer/core/env_discovery.py +33 -3
- mcp_ticketer/core/env_loader.py +7 -6
- mcp_ticketer/core/exceptions.py +10 -4
- mcp_ticketer/core/http_client.py +10 -10
- mcp_ticketer/core/instructions.py +405 -0
- mcp_ticketer/core/label_manager.py +732 -0
- mcp_ticketer/core/mappers.py +32 -20
- mcp_ticketer/core/models.py +136 -1
- mcp_ticketer/core/onepassword_secrets.py +379 -0
- mcp_ticketer/core/priority_matcher.py +463 -0
- mcp_ticketer/core/project_config.py +148 -14
- mcp_ticketer/core/registry.py +1 -1
- 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 +2 -2
- mcp_ticketer/mcp/server/__init__.py +2 -2
- mcp_ticketer/mcp/server/diagnostic_helper.py +175 -0
- mcp_ticketer/mcp/server/main.py +187 -93
- mcp_ticketer/mcp/server/routing.py +655 -0
- mcp_ticketer/mcp/server/server_sdk.py +58 -0
- mcp_ticketer/mcp/server/tools/__init__.py +37 -9
- mcp_ticketer/mcp/server/tools/analysis_tools.py +854 -0
- mcp_ticketer/mcp/server/tools/attachment_tools.py +65 -20
- 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 +1429 -0
- mcp_ticketer/mcp/server/tools/diagnostic_tools.py +211 -0
- mcp_ticketer/mcp/server/tools/hierarchy_tools.py +878 -319
- mcp_ticketer/mcp/server/tools/instruction_tools.py +295 -0
- mcp_ticketer/mcp/server/tools/label_tools.py +942 -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 +180 -97
- mcp_ticketer/mcp/server/tools/session_tools.py +308 -0
- mcp_ticketer/mcp/server/tools/ticket_tools.py +1182 -82
- mcp_ticketer/mcp/server/tools/user_ticket_tools.py +364 -0
- mcp_ticketer/queue/health_monitor.py +1 -0
- mcp_ticketer/queue/manager.py +4 -4
- mcp_ticketer/queue/queue.py +3 -3
- mcp_ticketer/queue/run_worker.py +1 -1
- mcp_ticketer/queue/ticket_registry.py +2 -2
- mcp_ticketer/queue/worker.py +15 -13
- mcp_ticketer/utils/__init__.py +5 -0
- mcp_ticketer/utils/token_utils.py +246 -0
- mcp_ticketer-2.0.1.dist-info/METADATA +1366 -0
- mcp_ticketer-2.0.1.dist-info/RECORD +122 -0
- mcp_ticketer-0.4.11.dist-info/METADATA +0 -496
- mcp_ticketer-0.4.11.dist-info/RECORD +0 -77
- {mcp_ticketer-0.4.11.dist-info → mcp_ticketer-2.0.1.dist-info}/WHEEL +0 -0
- {mcp_ticketer-0.4.11.dist-info → mcp_ticketer-2.0.1.dist-info}/entry_points.txt +0 -0
- {mcp_ticketer-0.4.11.dist-info → mcp_ticketer-2.0.1.dist-info}/licenses/LICENSE +0 -0
- {mcp_ticketer-0.4.11.dist-info → mcp_ticketer-2.0.1.dist-info}/top_level.txt +0 -0
|
@@ -3,10 +3,43 @@
|
|
|
3
3
|
This module implements tools for adding and retrieving comments on tickets.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
import logging
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
9
|
+
from ....core.adapter import BaseAdapter
|
|
8
10
|
from ....core.models import Comment
|
|
9
|
-
from
|
|
11
|
+
from ....core.url_parser import is_url
|
|
12
|
+
from ..server_sdk import get_adapter, get_router, has_router, mcp
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _build_adapter_metadata(
|
|
16
|
+
adapter: BaseAdapter,
|
|
17
|
+
ticket_id: str | None = None,
|
|
18
|
+
is_routed: bool = False,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
"""Build adapter metadata for MCP responses.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
adapter: The adapter that handled the operation
|
|
24
|
+
ticket_id: Optional ticket ID to include in metadata
|
|
25
|
+
is_routed: Whether this was routed via URL detection
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
Dictionary with adapter metadata fields
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
metadata = {
|
|
32
|
+
"adapter": adapter.adapter_type,
|
|
33
|
+
"adapter_name": adapter.adapter_display_name,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if ticket_id:
|
|
37
|
+
metadata["ticket_id"] = ticket_id
|
|
38
|
+
|
|
39
|
+
if is_routed:
|
|
40
|
+
metadata["routed_from_url"] = True
|
|
41
|
+
|
|
42
|
+
return metadata
|
|
10
43
|
|
|
11
44
|
|
|
12
45
|
@mcp.tool()
|
|
@@ -17,14 +50,17 @@ async def ticket_comment(
|
|
|
17
50
|
limit: int = 10,
|
|
18
51
|
offset: int = 0,
|
|
19
52
|
) -> dict[str, Any]:
|
|
20
|
-
"""Add or list comments on a ticket.
|
|
53
|
+
"""Add or list comments on a ticket using ID or URL.
|
|
21
54
|
|
|
22
55
|
This tool supports two operations:
|
|
23
56
|
- 'add': Add a new comment to a ticket (requires 'text' parameter)
|
|
24
57
|
- 'list': Retrieve comments from a ticket (supports pagination)
|
|
25
58
|
|
|
59
|
+
Supports both plain ticket IDs and full URLs from multiple platforms.
|
|
60
|
+
See ticket_read for supported URL formats.
|
|
61
|
+
|
|
26
62
|
Args:
|
|
27
|
-
ticket_id:
|
|
63
|
+
ticket_id: Ticket ID or URL
|
|
28
64
|
operation: Operation to perform - must be 'add' or 'list'
|
|
29
65
|
text: Comment text (required when operation='add')
|
|
30
66
|
limit: Maximum number of comments to return (used when operation='list', default: 10)
|
|
@@ -35,8 +71,6 @@ async def ticket_comment(
|
|
|
35
71
|
|
|
36
72
|
"""
|
|
37
73
|
try:
|
|
38
|
-
adapter = get_adapter()
|
|
39
|
-
|
|
40
74
|
# Validate operation
|
|
41
75
|
if operation not in ["add", "list"]:
|
|
42
76
|
return {
|
|
@@ -54,29 +88,57 @@ async def ticket_comment(
|
|
|
54
88
|
|
|
55
89
|
# Create comment object
|
|
56
90
|
comment = Comment(
|
|
57
|
-
ticket_id=ticket_id,
|
|
91
|
+
ticket_id=ticket_id, # Will be normalized by router if URL
|
|
58
92
|
content=text,
|
|
59
93
|
)
|
|
60
94
|
|
|
61
|
-
#
|
|
62
|
-
|
|
95
|
+
# Route to appropriate adapter
|
|
96
|
+
is_routed = False
|
|
97
|
+
if is_url(ticket_id) and has_router():
|
|
98
|
+
router = get_router()
|
|
99
|
+
logging.info(f"Routing add_comment for URL: {ticket_id}")
|
|
100
|
+
created = await router.route_add_comment(ticket_id, comment)
|
|
101
|
+
is_routed = True
|
|
102
|
+
normalized_id, _, _ = router._normalize_ticket_id(ticket_id)
|
|
103
|
+
adapter = router._get_adapter(
|
|
104
|
+
router._detect_adapter_from_url(ticket_id)
|
|
105
|
+
)
|
|
106
|
+
else:
|
|
107
|
+
adapter = get_adapter()
|
|
108
|
+
created = await adapter.add_comment(comment)
|
|
63
109
|
|
|
64
110
|
return {
|
|
65
111
|
"status": "completed",
|
|
112
|
+
**_build_adapter_metadata(adapter, created.ticket_id, is_routed),
|
|
66
113
|
"operation": "add",
|
|
67
114
|
"comment": created.model_dump(),
|
|
68
115
|
}
|
|
69
116
|
|
|
70
117
|
else: # operation == "list"
|
|
71
118
|
# List comments operation
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
119
|
+
# Route to appropriate adapter
|
|
120
|
+
is_routed = False
|
|
121
|
+
if is_url(ticket_id) and has_router():
|
|
122
|
+
router = get_router()
|
|
123
|
+
logging.info(f"Routing get_comments for URL: {ticket_id}")
|
|
124
|
+
comments = await router.route_get_comments(
|
|
125
|
+
ticket_id, limit=limit, offset=offset
|
|
126
|
+
)
|
|
127
|
+
is_routed = True
|
|
128
|
+
normalized_id, _, _ = router._normalize_ticket_id(ticket_id)
|
|
129
|
+
adapter = router._get_adapter(
|
|
130
|
+
router._detect_adapter_from_url(ticket_id)
|
|
131
|
+
)
|
|
132
|
+
else:
|
|
133
|
+
adapter = get_adapter()
|
|
134
|
+
comments = await adapter.get_comments(
|
|
135
|
+
ticket_id=ticket_id, limit=limit, offset=offset
|
|
136
|
+
)
|
|
75
137
|
|
|
76
138
|
return {
|
|
77
139
|
"status": "completed",
|
|
140
|
+
**_build_adapter_metadata(adapter, ticket_id, is_routed),
|
|
78
141
|
"operation": "list",
|
|
79
|
-
"ticket_id": ticket_id,
|
|
80
142
|
"comments": [comment.model_dump() for comment in comments],
|
|
81
143
|
"count": len(comments),
|
|
82
144
|
"limit": limit,
|