Release beta 2.0.0.1021
check / local-gate (push) Failing after 1m38s

This commit is contained in:
JWeBot Contributors
2026-10-21 17:05:09 +08:00
parent 5a3c4fb94c
commit e4365841ed
79 changed files with 1572 additions and 1840 deletions
+6 -33
View File
@@ -68,7 +68,7 @@ def module_text(descriptor) -> str:
extension_id = descriptor.extension_id
return f'''"""Generated reviewed adapter for {extension_id}."""
from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
from jwebot_sdk import ServiceCommandAdapter, SingleGroupContext
PROFILE = {extension_id!r}
@@ -76,41 +76,14 @@ AUTHOR = {descriptor.author!r}
DESCRIPTION = {descriptor.description!r}
HELP_ENTRIES = {descriptor.help_entries!r}
COMMANDS = {descriptor.commands!r}
def _handler(context: SingleGroupContext, command: str):
def handle(event: Event, arguments: str) -> ExtensionResult:
response = context.services.call(
PROFILE,
operation="execute",
payload={{
"command": command,
"arguments": arguments,
"event": event.to_mapping(),
}},
)
texts = response.get("texts")
if isinstance(texts, list) and texts and all(
isinstance(item, str) and item.strip() for item in texts
):
return ExtensionResult(
reply=ReplyPlan.multi_text(texts),
metadata={{"local_extension": PROFILE, "author": AUTHOR}},
)
text = response.get("text")
if not isinstance(text, str) or not text.strip():
raise ValueError("local service returned invalid text")
return ExtensionResult(
reply=ReplyPlan.text(text),
metadata={{"local_extension": PROFILE, "author": AUTHOR}},
)
return handle
ADAPTER = ServiceCommandAdapter(
PROFILE,
metadata={{"local_extension": PROFILE, "author": AUTHOR}},
)
def plugin(context: SingleGroupContext) -> None:
for command in COMMANDS:
context.commands.register(command, _handler(context, command))
ADAPTER.register(context, COMMANDS)
'''