mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-12-01 11:37:48 +08:00
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>
28 lines
976 B
Python
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
|