feat(tools): 新增 IslandCaller 随机点名联动工具 - #3
Open
PANDAJSR wants to merge 2 commits into
Open
Conversation
top20List 最多保留 20 条,超出时从尾部淘汰,因此点名前后 Count 差值在 历史打满后恒为 0,导致 call_island_caller 误报“没有返回学生”或人数 偏少。改为:点名前复制历史快照,点名后用“去掉头部 k 条后与旧历史 按序对齐”的方式确定本次实际新增条数,再反转为抽取顺序。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
响应 #3:让 ClassIsland 侧「SecAgent 联动」插件支持驱动 IslandCaller 随机点名。两个插件运行在同一个 ClassIsland 进程中,本实现通过 DI 容器反射解析 IslandCaller 服务并驱动点名,不引用 IslandCaller 程序集(无需改动 IslandCaller 本体)。
改动
Plugin.cs:工具目录与CallTool分发新增 4 个工具:call_island_caller(非 hidden):可选count(1-20,默认 1) 与profile_id(先切换名单);校验Status.IsPluginReady后在 Avalonia UI 线程调用ShowRandomStudent(count),读取HistoryService.top20List本次新增条目返回被点学生名单。list_island_caller_profiles(hidden):列出 IslandCaller 名单的 GUID/名称/默认/当前/成员数。read_island_caller_roster(hidden):读取名单 CSV 与结构化成员。write_island_caller_roster(hidden):写入成员并热重载当前激活名单。IslandCallerTools.cs(新):反射桥接实现(类型扫描 +IAppHost.Host.Services解析 + UI 线程调度 + CSV 读写)。所有环境性失败(未安装/未就绪/名单为空等)返回结构化{ok:false, message}而非抛异常,便于 SecAgent 前置规则渲染友好文案。manifest.yml:版本 0.1.0.1 → 0.1.1.0。README.md:补充 IslandCaller 工具说明。验证
dotnet build:0 警告 0 错误。配套改动在同名连接插件仓库 PR 中:
SECTL/ClassIsland-SecAgent-Connector(新增agent.pre_rules前置规则匹配“点名”类指令并调用call_island_caller)。