-
Notifications
You must be signed in to change notification settings - Fork 21
article email support - fixes #205 #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4bc18ea
2a015ad
83238ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| zammad-mcp: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| environment: | ||
| - ZAMMAD_URL=${ZAMMAD_URL} | ||
| - ZAMMAD_HTTP_TOKEN=${ZAMMAD_HTTP_TOKEN} | ||
| - MCP_TRANSPORT=http | ||
| - MCP_HOST=0.0.0.0 | ||
| - MCP_PORT=8000 | ||
| ports: | ||
| - "9146:8000" | ||
| restart: unless-stopped | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -322,6 +322,10 @@ class ArticleCreate(StrictBaseModel): | |
| article_type: ArticleType = Field(default=ArticleType.NOTE, alias="type", description="Article type") | ||
| internal: bool = Field(default=False, description="Whether the article is internal") | ||
| sender: ArticleSender = Field(default=ArticleSender.AGENT, description="Sender type") | ||
| subject: str | None = Field(default=None, description="Article subject (for emails)") | ||
| to: str | None = Field(default=None, description="Email recipient (for email type)") | ||
| cc: str | None = Field(default=None, description="Email CC recipients") | ||
| content_type: str | None = Field(default=None, description="Content type (text/plain or text/html)") | ||
|
Comment on lines
+325
to
+328
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new header/content fields are all plain strings right now, and As per coding guidelines, "Validate all user inputs", "Check that all fields have appropriate defaults and constraints.", and "Verify HTML sanitization is applied where needed." Also applies to: 333-337 🤖 Prompt for AI Agents |
||
| attachments: list[AttachmentUpload] | None = Field( | ||
| default=None, description="Optional attachments to include", max_length=10 | ||
| ) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| import json | ||
| import logging | ||
| import os | ||
| import sys | ||
| import time | ||
| from collections.abc import AsyncIterator | ||
| from contextlib import asynccontextmanager | ||
|
|
@@ -819,7 +820,9 @@ async def lifespan(_app: FastMCP) -> AsyncIterator[None]: | |
| def get_client(self) -> ZammadClient: | ||
| """Get the Zammad client, ensuring it's initialized.""" | ||
| if not self.client: | ||
| raise RuntimeError("Zammad client not initialized") | ||
| logger.debug("Zammad client not initialized, performing lazy initialization") | ||
| # Lazy initialization for cases where lifespan initialization hasn't finished | ||
| self.client = ZammadClient() | ||
|
Comment on lines
+823
to
+825
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lazy
🤖 Prompt for AI Agents |
||
| return self.client | ||
|
|
||
| async def initialize(self) -> None: | ||
|
|
@@ -2548,7 +2551,7 @@ def _configure_logging() -> None: | |
|
|
||
| # Add handler if none exists | ||
| if not root_logger.handlers: | ||
| handler = logging.StreamHandler() | ||
| handler = logging.StreamHandler(sys.stderr) | ||
| handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")) | ||
| root_logger.addHandler(handler) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.