Files
4daa494cb8 feat(plugins): add MulticaAgent runner to chat with Multica agents (LANG-315) (#2889)
New Runner plugin plugins/Runner/multica-agent (plugin:langbot-team/MulticaAgent/default).
Each LangBot conversation maps to one Multica chat session; messages are posted
via the Multica chat API (PAT + X-Workspace-ID), and the runner polls until the
assistant reply for that task lands, then returns it.

In-chat commands (/multica agents|use|new) list agents and switch the agent per
conversation. Deleted sessions are recreated once; failed/cancelled/timed-out
agent tasks surface as run.failed with stable multica.* codes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 20:10:23 +08:00

28 lines
976 B
Python

"""Validate explicit endpoints. Network reachability remains a Host egress policy.
Private HTTP(S) service endpoints are intentional for self-hosted vendors; this
syntax check is NOT an SSRF sandbox or permission to access other workspaces.
"""
from urllib.parse import urlsplit
def endpoint(value, *, query=False):
try:
if not isinstance(value, str) or any(c.isspace() or ord(c) < 32 or ord(c) == 127 for c in value):
raise ValueError
parsed = urlsplit(value)
if (
parsed.scheme not in ("http", "https")
or not parsed.hostname
or parsed.username is not None
or parsed.password is not None
or parsed.fragment
or (parsed.query and not query)
):
raise ValueError
_ = parsed.port
except (ValueError, TypeError):
raise ValueError("Endpoint must be an HTTP(S) URL without credentials or fragment") from None
return value