release: public alpha 0.6.0 baseline

This commit is contained in:
JWeBot Contributors
2026-10-15 03:58:31 +08:00
commit d4242ae07c
238 changed files with 37724 additions and 0 deletions
@@ -0,0 +1,18 @@
# repeat-ranking
Author: `jwebot`
查看北京时间今日复读排行
Help:
- `/复读榜`
Registered commands:
- `/复读榜`
- `/复读`
The adapter has no direct Ledger, GUI, environment, shell, or network access.
It delegates to the reviewed `repeat-ranking` Kernel service profile
and returns a structured `ReplyPlan`.
@@ -0,0 +1,14 @@
id = "repeat-ranking"
author = "jwebot"
description = "查看北京时间今日复读排行"
help = ["/复读榜"]
version = "1.0.0"
api_version = "1"
entrypoint = "repeat_ranking:plugin"
type = "command"
[capabilities]
commands = ["/复读榜", "/复读"]
storage = false
network_profiles = []
service_profiles = ["repeat-ranking"]
@@ -0,0 +1,37 @@
"""Generated reviewed adapter for repeat-ranking."""
from jwebot_sdk import Event, ExtensionResult, ReplyPlan, SingleGroupContext
PROFILE = 'repeat-ranking'
AUTHOR = 'jwebot'
DESCRIPTION = '查看北京时间今日复读排行'
HELP_ENTRIES = ('/复读榜',)
COMMANDS = ('/复读榜', '/复读')
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(),
},
)
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
def plugin(context: SingleGroupContext) -> None:
for command in COMMANDS:
context.commands.register(command, _handler(context, command))
@@ -0,0 +1,29 @@
import sys
import unittest
from pathlib import Path
from unittest import mock
SOURCE = Path(__file__).resolve().parents[1] / "src"
sys.path.insert(0, str(SOURCE))
from repeat_ranking import AUTHOR, DESCRIPTION, HELP_ENTRIES, plugin
class PluginTests(unittest.TestCase):
def test_registers_declared_commands_and_author(self):
context = mock.Mock()
plugin(context)
registered = [
call.args[0]
for call in context.commands.register.call_args_list
]
self.assertEqual(AUTHOR, 'jwebot')
self.assertEqual(DESCRIPTION, '查看北京时间今日复读排行')
self.assertEqual(HELP_ENTRIES, ('/复读榜',))
self.assertIn('/复读榜', registered)
self.assertEqual(len(registered), 2)
if __name__ == "__main__":
unittest.main()