Skip to content

feat(tools): 新增 IslandCaller 随机点名联动工具 - #3

Open
PANDAJSR wants to merge 2 commits into
mainfrom
feat/island-caller-support
Open

feat(tools): 新增 IslandCaller 随机点名联动工具#3
PANDAJSR wants to merge 2 commits into
mainfrom
feat/island-caller-support

Conversation

@PANDAJSR

@PANDAJSR PANDAJSR commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

概述

响应 #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 错误。
  • 说明:IslandCaller 现基于 ClassIsland 2.x(net10),本插件目前仍构建于 ClassIsland 1.7 PluginSdk;若需与 IslandCaller 同进程运行,建议后续把本插件升级到 ClassIsland 2.x PluginSdk。触发点名窗口等端到端行为需在 Windows + ClassIsland 实际环境中验证。

配套改动在同名连接插件仓库 PR 中:SECTL/ClassIsland-SecAgent-Connector(新增 agent.pre_rules 前置规则匹配“点名”类指令并调用 call_island_caller)。

top20List 最多保留 20 条,超出时从尾部淘汰,因此点名前后 Count 差值在
历史打满后恒为 0,导致 call_island_caller 误报“没有返回学生”或人数
偏少。改为:点名前复制历史快照,点名后用“去掉头部 k 条后与旧历史
按序对齐”的方式确定本次实际新增条数,再反转为抽取顺序。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant