forked from retoor/devplacepy
- Route Devii-driven AI gateway cost to the action/tool that triggered it instead of a blanket "internal" bucket, so per-feature AI spend is attributable. - Fix the quiz attempt review to show one previously-answered question at a time instead of all of them at once, and stop a quiz endpoint linked from the quiz flow from responding with raw JSON. - Add DB API async query result route and AI Usage Analyzer annotated source/media routes, with traversal-safe uid/path handling and matching tests. - Add Code Farm action audit logging (plant/harvest/buy-plot/upgrade/ fertilize) and related admin workspace/services/trash/gateway route and doc touch-ups. - Drop redundant docstrings from access_tokens.py per the no-comments convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VL9Xn57W5UR3HZbbuuzxdK
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from __future__ import annotations
|
|
|
|
from devplacepy.services.manager import ServiceManager
|
|
|
|
_SHELL_MANAGER: ServiceManager | None = None
|
|
|
|
|
|
def _instantiate_all():
|
|
from devplacepy.services.audit import AuditService
|
|
from devplacepy.services.backup.service import BackupService
|
|
from devplacepy.services.bot.service import BotsService
|
|
from devplacepy.services.containers.service import ContainerService
|
|
from devplacepy.services.devii import DeviiService
|
|
from devplacepy.services.gitea.service import IssueTrackerService
|
|
from devplacepy.services.news import NewsService
|
|
from devplacepy.services.openai_gateway import GatewayService
|
|
from devplacepy.services.pubsub import PubSubService
|
|
from devplacepy.services.telegram.outbox_service import TelegramOutboxService
|
|
from devplacepy.services.telegram.service import TelegramService
|
|
from devplacepy.services.xmlrpc import XmlrpcService
|
|
|
|
return (
|
|
AuditService(),
|
|
BackupService(),
|
|
BotsService(),
|
|
ContainerService(),
|
|
DeviiService(),
|
|
IssueTrackerService(),
|
|
NewsService(),
|
|
GatewayService(),
|
|
PubSubService(),
|
|
TelegramService(),
|
|
TelegramOutboxService(),
|
|
XmlrpcService(),
|
|
)
|
|
|
|
|
|
def admin_shell_manager() -> ServiceManager:
|
|
# Never supervised (no set_lock_owner/supervise call): only used for describe()/config metadata/key derivation, since the owning Tier 3 process is the only one that ever ticks these services.
|
|
global _SHELL_MANAGER
|
|
if _SHELL_MANAGER is None:
|
|
manager = ServiceManager()
|
|
for svc in _instantiate_all():
|
|
manager.register(svc)
|
|
_SHELL_MANAGER = manager
|
|
return _SHELL_MANAGER
|