mcp-ticketer 0.3.1__py3-none-any.whl → 0.3.3__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.

Files changed (41) hide show
  1. mcp_ticketer/__version__.py +1 -1
  2. mcp_ticketer/adapters/aitrackdown.py +164 -36
  3. mcp_ticketer/adapters/github.py +11 -8
  4. mcp_ticketer/adapters/jira.py +29 -28
  5. mcp_ticketer/adapters/linear/__init__.py +1 -1
  6. mcp_ticketer/adapters/linear/adapter.py +105 -104
  7. mcp_ticketer/adapters/linear/client.py +78 -59
  8. mcp_ticketer/adapters/linear/mappers.py +93 -73
  9. mcp_ticketer/adapters/linear/queries.py +28 -7
  10. mcp_ticketer/adapters/linear/types.py +67 -60
  11. mcp_ticketer/adapters/linear.py +2 -2
  12. mcp_ticketer/cli/adapter_diagnostics.py +87 -52
  13. mcp_ticketer/cli/codex_configure.py +6 -6
  14. mcp_ticketer/cli/diagnostics.py +180 -88
  15. mcp_ticketer/cli/linear_commands.py +156 -113
  16. mcp_ticketer/cli/main.py +153 -82
  17. mcp_ticketer/cli/simple_health.py +74 -51
  18. mcp_ticketer/cli/utils.py +15 -10
  19. mcp_ticketer/core/config.py +23 -19
  20. mcp_ticketer/core/env_discovery.py +5 -4
  21. mcp_ticketer/core/env_loader.py +114 -91
  22. mcp_ticketer/core/exceptions.py +22 -20
  23. mcp_ticketer/core/models.py +9 -0
  24. mcp_ticketer/core/project_config.py +1 -1
  25. mcp_ticketer/mcp/constants.py +58 -0
  26. mcp_ticketer/mcp/dto.py +195 -0
  27. mcp_ticketer/mcp/response_builder.py +206 -0
  28. mcp_ticketer/mcp/server.py +361 -1182
  29. mcp_ticketer/queue/health_monitor.py +166 -135
  30. mcp_ticketer/queue/manager.py +70 -19
  31. mcp_ticketer/queue/queue.py +24 -5
  32. mcp_ticketer/queue/run_worker.py +1 -1
  33. mcp_ticketer/queue/ticket_registry.py +203 -145
  34. mcp_ticketer/queue/worker.py +79 -43
  35. {mcp_ticketer-0.3.1.dist-info → mcp_ticketer-0.3.3.dist-info}/METADATA +1 -1
  36. mcp_ticketer-0.3.3.dist-info/RECORD +62 -0
  37. mcp_ticketer-0.3.1.dist-info/RECORD +0 -59
  38. {mcp_ticketer-0.3.1.dist-info → mcp_ticketer-0.3.3.dist-info}/WHEEL +0 -0
  39. {mcp_ticketer-0.3.1.dist-info → mcp_ticketer-0.3.3.dist-info}/entry_points.txt +0 -0
  40. {mcp_ticketer-0.3.1.dist-info → mcp_ticketer-0.3.3.dist-info}/licenses/LICENSE +0 -0
  41. {mcp_ticketer-0.3.1.dist-info → mcp_ticketer-0.3.3.dist-info}/top_level.txt +0 -0
@@ -35,6 +35,7 @@ class QueueItem:
35
35
  retry_count: int = 0
36
36
  result: Optional[dict[str, Any]] = None
37
37
  project_dir: Optional[str] = None
38
+ adapter_config: Optional[dict[str, Any]] = None # Adapter configuration
38
39
 
39
40
  def to_dict(self) -> dict:
40
41
  """Convert to dictionary for storage."""
@@ -59,6 +60,7 @@ class QueueItem:
59
60
  retry_count=row[8],
60
61
  result=json.loads(row[9]) if row[9] else None,
61
62
  project_dir=row[10] if len(row) > 10 else None,
63
+ adapter_config=json.loads(row[11]) if len(row) > 11 and row[11] else None,
62
64
  )
63
65
 
64
66
 
@@ -127,6 +129,8 @@ class Queue:
127
129
  columns = [row[1] for row in cursor.fetchall()]
128
130
  if "project_dir" not in columns:
129
131
  conn.execute("ALTER TABLE queue ADD COLUMN project_dir TEXT")
132
+ if "adapter_config" not in columns:
133
+ conn.execute("ALTER TABLE queue ADD COLUMN adapter_config TEXT")
130
134
 
131
135
  conn.commit()
132
136
 
@@ -136,6 +140,7 @@ class Queue:
136
140
  adapter: str,
137
141
  operation: str,
138
142
  project_dir: Optional[str] = None,
143
+ adapter_config: Optional[dict[str, Any]] = None,
139
144
  ) -> str:
140
145
  """Add item to queue.
141
146
 
@@ -144,6 +149,7 @@ class Queue:
144
149
  adapter: Name of the adapter to use
145
150
  operation: Operation to perform (create, update, delete, etc.)
146
151
  project_dir: Project directory for config resolution (defaults to current directory)
152
+ adapter_config: Adapter configuration to use (optional, for explicit config passing)
147
153
 
148
154
  Returns:
149
155
  Queue ID for tracking
@@ -161,8 +167,8 @@ class Queue:
161
167
  """
162
168
  INSERT INTO queue (
163
169
  id, ticket_data, adapter, operation,
164
- status, created_at, retry_count, project_dir
165
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
170
+ status, created_at, retry_count, project_dir, adapter_config
171
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
166
172
  """,
167
173
  (
168
174
  queue_id,
@@ -173,6 +179,7 @@ class Queue:
173
179
  datetime.now().isoformat(),
174
180
  0,
175
181
  project_dir,
182
+ json.dumps(adapter_config) if adapter_config else None,
176
183
  ),
177
184
  )
178
185
  conn.commit()
@@ -211,7 +218,12 @@ class Queue:
211
218
  SET status = ?, processed_at = ?
212
219
  WHERE id = ? AND status = ?
213
220
  """,
214
- (QueueStatus.PROCESSING.value, datetime.now().isoformat(), row[0], QueueStatus.PENDING.value),
221
+ (
222
+ QueueStatus.PROCESSING.value,
223
+ datetime.now().isoformat(),
224
+ row[0],
225
+ QueueStatus.PENDING.value,
226
+ ),
215
227
  )
216
228
 
217
229
  # Check if update was successful (prevents race conditions)
@@ -254,6 +266,7 @@ class Queue:
254
266
 
255
267
  Returns:
256
268
  True if update was successful, False if item was in unexpected state
269
+
257
270
  """
258
271
  with self._lock:
259
272
  with sqlite3.connect(self.db_path) as conn:
@@ -314,7 +327,9 @@ class Queue:
314
327
  conn.rollback()
315
328
  raise
316
329
 
317
- def increment_retry(self, queue_id: str, expected_status: Optional[QueueStatus] = None) -> int:
330
+ def increment_retry(
331
+ self, queue_id: str, expected_status: Optional[QueueStatus] = None
332
+ ) -> int:
318
333
  """Increment retry count and reset to pending atomically.
319
334
 
320
335
  Args:
@@ -340,7 +355,11 @@ class Queue:
340
355
  WHERE id = ? AND status = ?
341
356
  RETURNING retry_count
342
357
  """,
343
- (QueueStatus.PENDING.value, queue_id, expected_status.value),
358
+ (
359
+ QueueStatus.PENDING.value,
360
+ queue_id,
361
+ expected_status.value,
362
+ ),
344
363
  )
345
364
  else:
346
365
  # Regular increment
@@ -15,8 +15,8 @@ logger = logging.getLogger(__name__)
15
15
 
16
16
  def main():
17
17
  """Run the worker process."""
18
- import sys
19
18
  import os
19
+
20
20
  logger.info("Starting standalone worker process")
21
21
  logger.info(f"Worker Python executable: {sys.executable}")
22
22
  logger.info(f"Worker working directory: {os.getcwd()}")