Update client and plugin integrations

- Client improvements
- Update augment, claudecode, cursor, gemini, kiro, opencode plugins

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-02-28 21:23:27 -05:00
1 parent 05746ffaab
commit 3c77b4a31d
7 files changed
+23 -13

No files matched your search

+16 -8
View File
@@ -29,6 +29,10 @@ from .types import (
) )
from .utils import generate_nonce, generate_uuidv7 from .utils import generate_nonce, generate_uuidv7
# The genesis chain hash: base64url encoding of 32 zero bytes.
# Must match the backend's GENESIS_CHAIN_HASH constant exactly.
GENESIS_CHAIN_HASH = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
class ElydoraClient: class ElydoraClient:
"""Synchronous client for the Elydora API. """Synchronous client for the Elydora API.
@@ -62,7 +66,7 @@ class ElydoraClient:
self.max_retries = max_retries self.max_retries = max_retries
self.token = token self.token = token
self._prev_chain_hash = "" self._prev_chain_hash = GENESIS_CHAIN_HASH
self._kid = "" self._kid = ""
self._session = requests.Session() self._session = requests.Session()
@@ -102,16 +106,20 @@ class ElydoraClient:
resp = self._session.request( resp = self._session.request(
method, url, json=json_body, params=params, headers=hdrs, timeout=30 method, url, json=json_body, params=params, headers=hdrs, timeout=30
) )
# Retry on 429 or 5xx
if resp.status_code == 429 or resp.status_code >= 500:
if attempt < self.max_retries - 1:
retry_after = resp.headers.get("Retry-After")
if retry_after and retry_after.isdigit():
delay = int(retry_after)
else:
delay = min(2 ** attempt, 8)
time.sleep(delay)
continue
return self._handle_response(resp) return self._handle_response(resp)
except ElydoraError: except ElydoraError:
raise raise
except requests.exceptions.ConnectionError as exc: except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as exc:
last_exc = exc
if attempt < self.max_retries - 1:
time.sleep(min(2 ** attempt, 8))
continue
raise
except requests.exceptions.Timeout as exc:
last_exc = exc last_exc = exc
if attempt < self.max_retries - 1: if attempt < self.max_retries - 1:
time.sleep(min(2 ** attempt, 8)) time.sleep(min(2 ** attempt, 8))
+1 -1
View File
@@ -33,7 +33,7 @@ class AugmentPlugin(AgentPlugin):
hook_path = self._hook_path() hook_path = self._hook_path()
with open(hook_path, "w", encoding="utf-8") as f: with open(hook_path, "w", encoding="utf-8") as f:
f.write(script) f.write(script)
os.chmod(hook_path, os.stat(hook_path).st_mode | stat.S_IEXEC) os.chmod(hook_path, stat.S_IRWXU)
guard_script_path = config.get("guard_script_path", "") guard_script_path = config.get("guard_script_path", "")
+1 -1
View File
@@ -34,7 +34,7 @@ class ClaudeCodePlugin(AgentPlugin):
hook_path = self._hook_path() hook_path = self._hook_path()
with open(hook_path, "w", encoding="utf-8") as f: with open(hook_path, "w", encoding="utf-8") as f:
f.write(script) f.write(script)
os.chmod(hook_path, os.stat(hook_path).st_mode | stat.S_IEXEC) os.chmod(hook_path, stat.S_IRWXU)
guard_script_path = config.get("guard_script_path", "") guard_script_path = config.get("guard_script_path", "")
+1 -1
View File
@@ -33,7 +33,7 @@ class CursorPlugin(AgentPlugin):
hook_path = self._hook_path() hook_path = self._hook_path()
with open(hook_path, "w", encoding="utf-8") as f: with open(hook_path, "w", encoding="utf-8") as f:
f.write(script) f.write(script)
os.chmod(hook_path, os.stat(hook_path).st_mode | stat.S_IEXEC) os.chmod(hook_path, stat.S_IRWXU)
guard_script_path = config.get("guard_script_path", "") guard_script_path = config.get("guard_script_path", "")
+1 -1
View File
@@ -33,7 +33,7 @@ class GeminiPlugin(AgentPlugin):
hook_path = self._hook_path() hook_path = self._hook_path()
with open(hook_path, "w", encoding="utf-8") as f: with open(hook_path, "w", encoding="utf-8") as f:
f.write(script) f.write(script)
os.chmod(hook_path, os.stat(hook_path).st_mode | stat.S_IEXEC) os.chmod(hook_path, stat.S_IRWXU)
guard_script_path = config.get("guard_script_path", "") guard_script_path = config.get("guard_script_path", "")
+1 -1
View File
@@ -37,7 +37,7 @@ class KiroPlugin(AgentPlugin):
script_path = self._script_path() script_path = self._script_path()
with open(script_path, "w", encoding="utf-8") as f: with open(script_path, "w", encoding="utf-8") as f:
f.write(script) f.write(script)
os.chmod(script_path, os.stat(script_path).st_mode | stat.S_IEXEC) os.chmod(script_path, stat.S_IRWXU)
guard_script_path = config.get("guard_script_path", "") guard_script_path = config.get("guard_script_path", "")
+2
View File
@@ -3,6 +3,7 @@
from __future__ import annotations from __future__ import annotations
import os import os
import stat
from .base import AgentPlugin, InstallConfig, PluginStatus from .base import AgentPlugin, InstallConfig, PluginStatus
@@ -42,6 +43,7 @@ class OpenCodePlugin(AgentPlugin):
plugin_path = self._plugin_path() plugin_path = self._plugin_path()
with open(plugin_path, "w", encoding="utf-8") as f: with open(plugin_path, "w", encoding="utf-8") as f:
f.write(js_content) f.write(js_content)
os.chmod(plugin_path, stat.S_IRWXU)
print(f"Elydora hook installed for OpenCode.") print(f"Elydora hook installed for OpenCode.")
print(f" Plugin: {plugin_path}") print(f" Plugin: {plugin_path}")