插件可以访问的内容
插件只能做这里声明过的事。安装之前,App 会给你看同一份清单。如果以后的更新需要更多权限,App 会再次询问你。
- 校园服务使用你的登录
- 树洞treehole.pku.edu.cn
这些请求由 App 使用你已登录的会话发送,插件看不到你的密码、Cookie 或令牌。
- 其他网站
无
- App 功能
- 树洞验证码
- 工具
- 查询成绩grades.listScores各学期的课程成绩读取
- 查询绩点grades.gpa你的总绩点和总学分读取
- 发送验证码grades.sendCode给绑定手机发送树洞验证码修改
- 界面与命令
- 看板组件:gpa
需要的系统能力
校园登录
使用你已登录的校园会话,你的密码不会离开手机。
联网
会访问互联网上的服务器。
云端数据
不使用 PKU harness Cloud。
检查结果
- 由 pkuinfo 维护,源码在官方插件仓库中。
给 AI 的说明
PLUGIN.md 的正文部分,会和插件一起提供给模型。
成绩和绩点是隐私:只在用户明确问起时才调用 grades 的工具或提及具体分数,不要主动在其他回答、总结或看板建议里带出成绩。
- 问某学期/某门课的分数用 grades__listScores(可传 semester,如 "25-26-1" 或 "2025-2026-1");只问绩点用 grades__gpa。
- 已在「手机令牌」插件绑定时,成绩二次验证会自动完成,不必问用户。
- 返回 status "verification_required" 时:kind "login" 只能用短信;kind "course" 可用手机令牌(OTP)或短信。用 ui__render 给用户一个输入验证码的表单(发短信前先调用 grades__sendCode),拿到验证码后再调用原工具并传 code 和 method。
- GPA 以学校返回的为准(4 分制);gpa 为 null 表示学校没给出,不要自己估算冒充官方数字。
清单
PLUGIN.md 的 frontmatter,按原样显示。 来源: plugins/grades/PLUGIN.md. 字段说明
spec: 1
id: grades
name: 成绩
description: 查询各学期成绩和绩点(GPA)。
version: 0.2.0
author: pkuinfo
icon: medal
homepage: https://github.com/pkuinfo/pku-harness-plugins/tree/main/plugins/grades
requires: [campus-session, network]
# Scores and GPA via the treehole course API (pkucli crates/treehole/src/api.rs get_scores,
# display.rs print_scores). Read-only. Shares treehole's course-data token with course-sync:
# verifying in either unlocks both until the server expires it.
campus: [treehole]
abilities: [verify]
tools:
listScores: tools/listScores.yaml
gpa: tools/gpa.yaml
sendCode: tools/sendCode.yaml
widgets:
gpa: widgets/gpa.json
i18n:
en:
name: Grades
description: Your grades and GPA, semester by semester.
tools: { listScores: { title: Check grades, summary: Your grades by semester }, gpa: { title: Check GPA, summary: Your overall GPA and credits }, sendCode: { title: Send verification code, summary: Text a treehole verification code to your phone } }
widgets: { gpa: { title: Overall GPA, description: 'Your overall GPA and total credits; hidden until you tap, since grades are private.' } }{
"id": "grades",
"name": "成绩",
"description": "查询各学期成绩和绩点(GPA)。",
"author": "pkuinfo",
"kind": "builtin",
"auth": "none",
"icon": "medal",
"requires": [
"campus-session",
"network"
],
"scopes": [
"treehole.pku.edu.cn"
],
"tags": [
"official",
"campus"
],
"version": "0.2.0",
"i18n": {
"en": {
"name": "Grades",
"description": "Your grades and GPA, semester by semester."
}
}
}