@oneciel-ai/claude-any 0.1.89 → 0.1.90
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.
- package/claude_any.py +17 -4
- package/package.json +1 -1
package/claude_any.py
CHANGED
|
@@ -105,7 +105,7 @@ OFFICIAL_CHANNEL_PLUGINS = {
|
|
|
105
105
|
"fakechat": "plugin:fakechat@claude-plugins-official",
|
|
106
106
|
}
|
|
107
107
|
APP_NAME = "Claude Any"
|
|
108
|
-
VERSION = "0.1.
|
|
108
|
+
VERSION = "0.1.90"
|
|
109
109
|
CREDITS = "Credits: One Ciel LLC"
|
|
110
110
|
|
|
111
111
|
LOG_LEVELS = {"SILENT": 0, "ERROR": 1, "WARN": 2, "INFO": 3, "DEBUG": 4, "TRACE": 5}
|
|
@@ -3840,6 +3840,15 @@ def write_empty_response(handler: BaseHTTPRequestHandler, status: int = 202) ->
|
|
|
3840
3840
|
handler.end_headers()
|
|
3841
3841
|
|
|
3842
3842
|
|
|
3843
|
+
def write_accepted_response(handler: BaseHTTPRequestHandler) -> None:
|
|
3844
|
+
body = b"Accepted"
|
|
3845
|
+
handler.send_response(202)
|
|
3846
|
+
handler.send_header("content-type", "text/plain")
|
|
3847
|
+
handler.send_header("content-length", str(len(body)))
|
|
3848
|
+
handler.end_headers()
|
|
3849
|
+
handler.wfile.write(body)
|
|
3850
|
+
|
|
3851
|
+
|
|
3843
3852
|
def reject_external_router_request(handler: BaseHTTPRequestHandler, cfg: dict[str, Any] | None = None) -> bool:
|
|
3844
3853
|
if router_request_allowed(handler, cfg):
|
|
3845
3854
|
return False
|
|
@@ -4965,6 +4974,10 @@ def _channel_mcp_take_outbox(session: str) -> list[dict[str, Any]]:
|
|
|
4965
4974
|
|
|
4966
4975
|
|
|
4967
4976
|
def _channel_mcp_initialize_response(request_id: Any, protocol: str) -> dict[str, Any]:
|
|
4977
|
+
# This endpoint implements the legacy HTTP+SSE transport, whose stable
|
|
4978
|
+
# protocol version is 2024-11-05 even when newer clients initiate the
|
|
4979
|
+
# handshake with a newer preferred protocol.
|
|
4980
|
+
protocol = "2024-11-05"
|
|
4968
4981
|
return {
|
|
4969
4982
|
"jsonrpc": "2.0",
|
|
4970
4983
|
"id": request_id,
|
|
@@ -5060,7 +5073,7 @@ def handle_channel_mcp_get(handler: BaseHTTPRequestHandler, path: str) -> bool:
|
|
|
5060
5073
|
started_at = time.time()
|
|
5061
5074
|
close_reason = "finished"
|
|
5062
5075
|
_send_channel_mcp_sse_headers(handler)
|
|
5063
|
-
_write_sse_event(handler, "endpoint", f"/ca/mcp/messages?
|
|
5076
|
+
_write_sse_event(handler, "endpoint", f"/ca/mcp/messages?sessionId={urllib.parse.quote(session)}")
|
|
5064
5077
|
try:
|
|
5065
5078
|
while True:
|
|
5066
5079
|
with _CHANNEL_MCP_LOCK:
|
|
@@ -5115,7 +5128,7 @@ def handle_channel_mcp_post(handler: BaseHTTPRequestHandler, path: str, body: di
|
|
|
5115
5128
|
if path != "/ca/mcp/messages":
|
|
5116
5129
|
return False
|
|
5117
5130
|
params = _query_params(handler)
|
|
5118
|
-
session = _first_param(params, "session")
|
|
5131
|
+
session = _first_param(params, "sessionId") or _first_param(params, "session")
|
|
5119
5132
|
with _CHANNEL_MCP_LOCK:
|
|
5120
5133
|
if session and session in _CHANNEL_MCP_SESSIONS:
|
|
5121
5134
|
_CHANNEL_MCP_SESSIONS[session]["last_seen_at"] = time.time()
|
|
@@ -5152,7 +5165,7 @@ def handle_channel_mcp_post(handler: BaseHTTPRequestHandler, path: str, body: di
|
|
|
5152
5165
|
)
|
|
5153
5166
|
return True
|
|
5154
5167
|
router_log("INFO", f"channel_mcp_rpc_queued session={session or '-'} method={method} request_id={request_id}")
|
|
5155
|
-
|
|
5168
|
+
write_accepted_response(handler)
|
|
5156
5169
|
return True
|
|
5157
5170
|
|
|
5158
5171
|
|
package/package.json
CHANGED