This commit is contained in:
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "jwebot-kernel"
|
||||
version = "0.6.5a0+1015"
|
||||
version = "0.6.6a0+1015"
|
||||
description = "Stable routing and extension authority for JWeBot"
|
||||
requires-python = ">=3.9"
|
||||
dependencies = [
|
||||
"jwebot-config==0.6.5a0+1015",
|
||||
"jwebot-sdk==0.6.5a0+1015",
|
||||
"jwebot-official-extensions==0.6.5a0+1015",
|
||||
"jwebot-config==0.6.6a0+1015",
|
||||
"jwebot-sdk==0.6.6a0+1015",
|
||||
"jwebot-official-extensions==0.6.6a0+1015",
|
||||
"tomli>=2; python_version < '3.11'",
|
||||
]
|
||||
|
||||
|
||||
@@ -107,4 +107,4 @@ __all__ = [
|
||||
"verify_installed_release_signature",
|
||||
]
|
||||
|
||||
__version__ = "0.6.5a0+1015"
|
||||
__version__ = "0.6.6a0+1015"
|
||||
|
||||
@@ -61,6 +61,8 @@ from jwebot_official_extensions import (
|
||||
extension_for_kind,
|
||||
local_command_parts,
|
||||
local_extension_command_token,
|
||||
pack_reply_parts,
|
||||
unpack_reply_parts,
|
||||
)
|
||||
from jwebot_official_extensions.steam import (
|
||||
DEFAULT_STEAM_MIHOMO_PROXY_URL,
|
||||
@@ -3760,7 +3762,16 @@ class Ledger:
|
||||
or not isinstance(state.get("players"), dict)
|
||||
):
|
||||
raise LocalCommandError("自走棋赛事结构无效")
|
||||
if status in {"active", "completed"}:
|
||||
phase = str(state.get("phase", ""))
|
||||
roster_required = (
|
||||
status == "completed"
|
||||
or (
|
||||
status == "active"
|
||||
and not phase.startswith("draft_")
|
||||
and phase != "registration"
|
||||
)
|
||||
)
|
||||
if roster_required:
|
||||
players = state["players"].values()
|
||||
if any(
|
||||
not isinstance(player, dict)
|
||||
@@ -4979,7 +4990,11 @@ class EdgeApplication:
|
||||
error_type=type(error).__name__,
|
||||
)
|
||||
raise EdgeError("隔离插件暂时不可用") from error
|
||||
if result.reply.kind is not PlanKind.TEXT:
|
||||
if result.reply.kind is PlanKind.MULTI_TEXT:
|
||||
reply_message = pack_reply_parts(list(result.reply.messages))
|
||||
elif result.reply.kind is PlanKind.TEXT:
|
||||
reply_message = result.reply.message
|
||||
else:
|
||||
raise EdgeError("隔离插件没有返回可见回复")
|
||||
self.telemetry.elapsed(
|
||||
"edge.extension.execute",
|
||||
@@ -4989,7 +5004,7 @@ class EdgeApplication:
|
||||
plugin_id=owner.extension_id,
|
||||
mode="host",
|
||||
)
|
||||
return result.reply.message
|
||||
return reply_message
|
||||
if (
|
||||
self.config.extension_mode == "host-only"
|
||||
or (
|
||||
@@ -5078,13 +5093,18 @@ class EdgeApplication:
|
||||
"duplicate": True,
|
||||
}
|
||||
if row["response_text"]:
|
||||
return {
|
||||
parts = unpack_reply_parts(row["response_text"])
|
||||
text = parts[0] if parts is not None else row["response_text"]
|
||||
response = {
|
||||
"status": "reply",
|
||||
"route": row["route"],
|
||||
"execution_path": stored_execution_path,
|
||||
"text": row["response_text"],
|
||||
"text": text,
|
||||
"duplicate": True,
|
||||
}
|
||||
if parts is not None:
|
||||
response["texts"] = parts
|
||||
return response
|
||||
return {
|
||||
"status": "fallback_cloud",
|
||||
"reason": "existing_incomplete_event",
|
||||
@@ -5206,6 +5226,13 @@ class EdgeApplication:
|
||||
status="local_completed",
|
||||
response_text=reply,
|
||||
)
|
||||
parts = unpack_reply_parts(reply)
|
||||
visible_reply = parts[0] if parts is not None else reply
|
||||
reply_chars = (
|
||||
sum(len(part) for part in parts)
|
||||
if parts is not None
|
||||
else len(reply)
|
||||
)
|
||||
self.telemetry.elapsed(
|
||||
"edge.local.complete",
|
||||
started,
|
||||
@@ -5214,14 +5241,18 @@ class EdgeApplication:
|
||||
route=route,
|
||||
reason=reason,
|
||||
execution_path=execution_path,
|
||||
chars=len(reply),
|
||||
chars=reply_chars,
|
||||
messages=len(parts) if parts is not None else 1,
|
||||
)
|
||||
return {
|
||||
response = {
|
||||
"status": "reply",
|
||||
"route": route,
|
||||
"execution_path": execution_path,
|
||||
"text": reply,
|
||||
"text": visible_reply,
|
||||
}
|
||||
if parts is not None:
|
||||
response["texts"] = parts
|
||||
return response
|
||||
alias_reply = self.ledger.local_alias_identity_reply(
|
||||
str(row["group_fingerprint"]),
|
||||
str(row["question"]),
|
||||
|
||||
Reference in New Issue
Block a user