Skip to content

feat: IslandCaller 随机点名前置规则与名单管理工具 - #2

Open
PANDAJSR wants to merge 1 commit into
mainfrom
feat/island-caller-support
Open

PANDAJSR wants to merge 1 commit into
mainfrom
feat/island-caller-support

Conversation

@PANDAJSR

@PANDAJSR PANDAJSR commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

概述

响应 SECTL/SecAgent#3:让「ClassIsland 联动」连接插件能够调用 ClassIsland 端插件的 call_island_caller 工具驱动 IslandCaller 随机点名,并仿照 SecRandom-SecAgent-Connector 的前置规则在匹配“点名”类指令时绕过 LLM 直接触发。

改动

  • secagent-plugin.json:版本 1.0.2 → 1.1.0;权限新增 agent.pre_rules
  • main.mjs
    • 新增 parseIslandCallerPreRule / renderIslandCallerResult(已导出便于测试)。正则匹配「点名/点个名/随机点名/抽人/抽N个同学/在ClassIsland里点名」等(含中文/阿拉伯数字人数)。
    • 仅当 ClassIsland 端探测到 IslandCaller 真实可用(调用无副作用的 list_island_caller_profiles)才注册 islandcaller_call 前置规则,避免同时安装 SecRandom 联动插件时抢占「点名/抽人」关键词;连接时注册、断开时注销(与现有 5 秒刷新机制一致)。
    • 命中后直接调用 call_island_caller 并渲染「已随机点名 N 人:…」;未安装/未就绪时渲染工具返回的友好文案。
  • skills/classisland/SKILL.mdREADME.md:补充 IslandCaller 工具契约与名单管理说明(call_island_callerlist_island_caller_profilesread_island_caller_rosterwrite_island_caller_roster)。
  • package.json / test/main.test.mjs(新增):npm test 用例覆盖规则匹配、人数解析与结果渲染。

验证

  • node --check main.mjs 通过;npm test 8/8 通过;npm run build 产出 dist/classisland-connector-1.1.0.zip

注意事项

  • 若同时安装 SecRandom 联动插件,两者都可能命中「点名/抽人」类关键词,SecAgent 按先注册的插件执行;已在 README 注明。
  • 合并后需发布 v1.1.0 release(含 classisland-connector-1.1.0.zip),市场索引刷新后 SecAgent 会自动更新。

- 注册 agent.pre_rules 权限与 islandcaller_call 前置规则
- 命中“点名/随机点名/抽N个同学”时直接调用 call_island_caller
- 仅当 ClassIsland 端探测到 IslandCaller 可用时才注册规则,避免抢占 SecRandom 关键词
- 增加前置规则解析/渲染单测(npm test)
- SKILL.md / README 补充 IslandCaller 工具与名单管理说明
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