38 行
1.1 KiB
Python
38 行
1.1 KiB
Python
"""AstrBot ImageStudio plugin entrypoint helpers.
|
|
|
|
The plugin is mounted inside AstrBot. This module exposes pure metadata and
|
|
dispatch helpers for the runtime layer without starting a standalone server.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from adapters.astrbot_adapter import dispatch_extension_request, runtime_route_table
|
|
from adapters.webui_adapter import get_web_mount_manifest
|
|
from backend.services.ui_service import API_BASE
|
|
from core.identity import RequestContext
|
|
|
|
|
|
PLUGIN_NAME = "astrbot_plugin_imagestudio"
|
|
|
|
|
|
def get_plugin_manifest() -> dict[str, Any]:
|
|
web_manifest = get_web_mount_manifest()
|
|
return {
|
|
"plugin_name": PLUGIN_NAME,
|
|
"api_base": API_BASE,
|
|
"web": web_manifest,
|
|
"routes": runtime_route_table(),
|
|
}
|
|
|
|
|
|
def dispatch_web_request(
|
|
ctx: RequestContext,
|
|
method: str,
|
|
path: str,
|
|
*,
|
|
query: dict[str, Any] | None = None,
|
|
payload: dict[str, Any] | None = None,
|
|
) -> dict[str, Any]:
|
|
return dispatch_extension_request(ctx, method, path, query=query, payload=payload)
|