feat(matrix): land QA follow-ups and refresh docs
- harden Matrix onboarding/chat lifecycle after manual QA - refresh README and Matrix docs to match current behavior - add local ignores for runtime artifacts and include current planning/report docs Closes #7 Closes #9 Closes #14
This commit is contained in:
parent
7fce4c9b3e
commit
6ced154124
35 changed files with 8380 additions and 67 deletions
53
sdk/mock.py
53
sdk/mock.py
|
|
@ -22,6 +22,30 @@ from sdk.interface import (
|
|||
logger = structlog.get_logger(__name__)
|
||||
|
||||
|
||||
DEFAULT_SKILLS = {
|
||||
"web-search": True,
|
||||
"fetch-url": True,
|
||||
"email": False,
|
||||
"browser": False,
|
||||
"image-gen": False,
|
||||
"files": True,
|
||||
}
|
||||
|
||||
DEFAULT_SAFETY = {
|
||||
"email-send": True,
|
||||
"file-delete": True,
|
||||
"social-post": True,
|
||||
}
|
||||
|
||||
DEFAULT_SOUL = {"name": "Лямбда", "instructions": ""}
|
||||
|
||||
DEFAULT_PLAN = {
|
||||
"name": "Beta",
|
||||
"tokens_used": 0,
|
||||
"tokens_limit": 1000,
|
||||
}
|
||||
|
||||
|
||||
class MockPlatformClient:
|
||||
"""
|
||||
Заглушка SDK платформы Lambda.
|
||||
|
|
@ -119,26 +143,11 @@ class MockPlatformClient:
|
|||
await self._latency()
|
||||
stored = self._settings.get(user_id, {})
|
||||
return UserSettings(
|
||||
skills=stored.get("skills", {
|
||||
"web-search": True,
|
||||
"fetch-url": True,
|
||||
"email": False,
|
||||
"browser": False,
|
||||
"image-gen": False,
|
||||
"files": True,
|
||||
}),
|
||||
skills={**DEFAULT_SKILLS, **stored.get("skills", {})},
|
||||
connectors=stored.get("connectors", {}),
|
||||
soul=stored.get("soul", {"name": "Лямбда", "instructions": ""}),
|
||||
safety=stored.get("safety", {
|
||||
"email-send": True,
|
||||
"file-delete": True,
|
||||
"social-post": True,
|
||||
}),
|
||||
plan=stored.get("plan", {
|
||||
"name": "Beta",
|
||||
"tokens_used": 0,
|
||||
"tokens_limit": 1000,
|
||||
}),
|
||||
soul={**DEFAULT_SOUL, **stored.get("soul", {})},
|
||||
safety={**DEFAULT_SAFETY, **stored.get("safety", {})},
|
||||
plan={**DEFAULT_PLAN, **stored.get("plan", {})},
|
||||
)
|
||||
|
||||
async def update_settings(self, user_id: str, action: Any) -> None:
|
||||
|
|
@ -146,13 +155,13 @@ class MockPlatformClient:
|
|||
settings = self._settings.setdefault(user_id, {})
|
||||
|
||||
if action.action == "toggle_skill":
|
||||
skills = settings.setdefault("skills", {})
|
||||
skills = settings.setdefault("skills", DEFAULT_SKILLS.copy())
|
||||
skills[action.payload["skill"]] = action.payload.get("enabled", True)
|
||||
elif action.action == "set_soul":
|
||||
soul = settings.setdefault("soul", {})
|
||||
soul = settings.setdefault("soul", DEFAULT_SOUL.copy())
|
||||
soul[action.payload["field"]] = action.payload["value"]
|
||||
elif action.action == "set_safety":
|
||||
safety = settings.setdefault("safety", {})
|
||||
safety = settings.setdefault("safety", DEFAULT_SAFETY.copy())
|
||||
safety[action.payload["trigger"]] = action.payload.get("enabled", True)
|
||||
|
||||
logger.info("Settings updated", user_id=user_id, action=action.action)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue