Merge branch 'main' into claude/issue-3011-20260128-0658

This commit is contained in:
Bill Easton 2026-01-28 09:28:27 -06:00 committed by GitHub
commit 82a00dde41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 24 additions and 17 deletions

View file

@ -6,9 +6,10 @@ on:
jobs:
martian-issue-triage:
# For labeled events, verify the labeler is a repo member to prevent privilege escalation
if: |
(github.event.action == 'opened' && github.actor == 'strawgate') ||
(github.event.action == 'labeled' && github.event.label.name == 'triage-martian')
(github.event.action == 'opened' && contains(fromJSON('["strawgate", "jlowin"]'), github.actor)) ||
(github.event.action == 'labeled' && github.event.label.name == 'triage-martian' && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.sender.author_association))
concurrency:
group: triage-martian-${{ github.event.issue.number }}

View file

@ -19,16 +19,22 @@ permissions:
jobs:
marvin:
# Restrict all triggers to repo members (OWNER, MEMBER, COLLABORATOR)
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/marvin')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/marvin')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin')) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/marvin')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '/marvin')) ||
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/marvin')) ||
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/marvin')) ||
(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') ||
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'marvin')
(
(github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion_comment') &&
contains(github.event.comment.body, '/marvin') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) ||
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/marvin') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.discussion.author_association)) ||
(
github.event_name == 'issues' &&
((github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') || (github.event.action == 'labeled' && github.event.label.name == 'marvin')) &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.sender.author_association)
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

View file

@ -1,5 +1,5 @@
from mcp.types import ToolAnnotations
from phue2 import Bridge
from phue import Bridge
from fastmcp import FastMCP
from smart_home.lights.server import lights_mcp

View file

@ -1,7 +1,7 @@
from typing import Any
from phue2 import Bridge
from phue2.exceptions import PhueException
from phue import Bridge
from phue.exceptions import PhueException
from smart_home.settings import settings
@ -23,12 +23,12 @@ def _get_bridge() -> Bridge | None:
def handle_phue_error(
light_or_group: str, operation: str, error: Exception
) -> dict[str, Any]:
"""Creates a standardized error response for phue2 operations."""
"""Creates a standardized error response for phue operations."""
base_info = {"target": light_or_group, "operation": operation, "success": False}
if isinstance(error, KeyError):
base_info["error"] = f"Target '{light_or_group}' not found"
elif isinstance(error, PhueException):
base_info["error"] = f"phue2 error during {operation}: {error}"
base_info["error"] = f"phue error during {operation}: {error}"
else:
base_info["error"] = f"Unexpected error during {operation}: {error}"
return base_info

View file

@ -8,7 +8,7 @@
from typing import Annotated, Any, Literal, TypedDict
from mcp.types import ToolAnnotations
from phue2.exceptions import PhueException
from phue.exceptions import PhueException
from pydantic import Field
from typing_extensions import NotRequired