Files
devplacepy/devplacepy/services/devii/registry.py
T
retoor 6ceca3d0d4 docs: document server-side rendering pipeline, response timing middleware, and Telegram pairing API
- Add comprehensive documentation for backend content rendering in AGENTS.md, detailing the new `render_content` and `render_title` Jinja globals built on mistune with media processing, emoji shortcodes, and XSS protection
- Document the `X-Response-Time` header and bottom-left render time indicator in README.md
- Update bot token pricing documentation to clarify fallback vs gateway cost headers
- Add `email_accounts` to soft-delete tables and `idx_users_role` composite index in database schema
- Implement `telegram_pairings` and `telegram_links` table creation with column migration and indexes
- Add `/profile/{username}/telegram` endpoint to docs API with request/unpair actions
- Register `TelegramService` in main.py lifespan and add `response_timing` middleware emitting `X-Response-Time` header
- Introduce `TelegramPairForm` model and `guard_public_host_sync` synchronous host validation function
2026-06-18 22:09:34 +00:00

69 lines
2.3 KiB
Python

# retoor <retoor@molodetz.nl>
from __future__ import annotations
from .actions.ai_correction_actions import AI_CORRECTION_ACTIONS
from .actions.ai_modifier_actions import AI_MODIFIER_ACTIONS
from .actions.avatar_actions import AVATAR_ACTIONS
from .actions.behavior_actions import BEHAVIOR_ACTIONS
from .actions.catalog import ACTIONS
from .actions.chunk_actions import CHUNK_ACTIONS
from .actions.client_actions import CLIENT_ACTIONS
from .actions.container_actions import CONTAINER_ACTIONS
from .actions.cost_actions import COST_ACTIONS
from .actions.customization_actions import CUSTOMIZATION_ACTIONS
from .actions.docs_actions import DOCS_ACTIONS
from .actions.email_actions import EMAIL_ACTIONS
from .actions.fetch_actions import FETCH_ACTIONS
from .actions.notification_actions import NOTIFICATION_ACTIONS
from .actions.rsearch_actions import RSEARCH_ACTIONS
from .actions.spec import Catalog
from .actions.telegram_actions import TELEGRAM_ACTIONS
from .virtual_tools.actions import VIRTUAL_TOOL_ACTIONS
from .agentic.actions import AGENTIC_ACTIONS
from .tasks.actions import TASK_ACTIONS
CATALOG = Catalog(
actions=ACTIONS
+ TASK_ACTIONS
+ AGENTIC_ACTIONS
+ AVATAR_ACTIONS
+ CLIENT_ACTIONS
+ FETCH_ACTIONS
+ DOCS_ACTIONS
+ COST_ACTIONS
+ CHUNK_ACTIONS
+ RSEARCH_ACTIONS
+ CONTAINER_ACTIONS
+ CUSTOMIZATION_ACTIONS
+ BEHAVIOR_ACTIONS
+ NOTIFICATION_ACTIONS
+ AI_CORRECTION_ACTIONS
+ AI_MODIFIER_ACTIONS
+ EMAIL_ACTIONS
+ TELEGRAM_ACTIONS
+ VIRTUAL_TOOL_ACTIONS
)
def _assert_confirm_params(catalog: Catalog) -> None:
from .actions.dispatcher import CONFIRM_REQUIRED, CONDITIONAL_CONFIRM
by_name = catalog.by_name()
gated = set(CONFIRM_REQUIRED) | set(CONDITIONAL_CONFIRM)
missing = sorted(
name
for name in gated
if name in by_name
and not any(param.name == "confirm" for param in by_name[name].params)
)
if missing:
raise RuntimeError(
"Confirmation-gated Devii tools lack a declared 'confirm' parameter, so the model can "
"never satisfy the gate and the agent loops forever: " + ", ".join(missing) + ". Add "
"confirm() (catalog.py) or arg('confirm', ..., kind='boolean') to each."
)
_assert_confirm_params(CATALOG)