@rookiestar/eng-lang-tutor 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +15 -0
  2. package/package.json +8 -6
  3. package/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  4. package/scripts/__pycache__/audio_composer.cpython-313.pyc +0 -0
  5. package/scripts/__pycache__/audio_converter.cpython-313.pyc +0 -0
  6. package/scripts/__pycache__/audio_enhancer.cpython-313.pyc +0 -0
  7. package/scripts/__pycache__/audio_utils.cpython-313.pyc +0 -0
  8. package/scripts/__pycache__/command_parser.cpython-313.pyc +0 -0
  9. package/scripts/__pycache__/constants.cpython-313.pyc +0 -0
  10. package/scripts/__pycache__/cron_push.cpython-313.pyc +0 -0
  11. package/scripts/__pycache__/dedup.cpython-313.pyc +0 -0
  12. package/scripts/__pycache__/error_notebook.cpython-313.pyc +0 -0
  13. package/scripts/__pycache__/feishu_voice.cpython-313.pyc +0 -0
  14. package/scripts/__pycache__/gamification.cpython-313.pyc +0 -0
  15. package/scripts/__pycache__/scorer.cpython-313.pyc +0 -0
  16. package/scripts/__pycache__/state_manager.cpython-313.pyc +0 -0
  17. package/scripts/__pycache__/utils.cpython-313.pyc +0 -0
  18. package/scripts/audio/__pycache__/__init__.cpython-313.pyc +0 -0
  19. package/scripts/audio/__pycache__/composer.cpython-313.pyc +0 -0
  20. package/scripts/audio/__pycache__/converter.cpython-313.pyc +0 -0
  21. package/scripts/audio/__pycache__/feishu_voice.cpython-313.pyc +0 -0
  22. package/scripts/audio/__pycache__/utils.cpython-313.pyc +0 -0
  23. package/scripts/audio/tts/__pycache__/__init__.cpython-313.pyc +0 -0
  24. package/scripts/audio/tts/__pycache__/base.cpython-313.pyc +0 -0
  25. package/scripts/audio/tts/__pycache__/manager.cpython-313.pyc +0 -0
  26. package/scripts/audio/tts/providers/__pycache__/__init__.cpython-313.pyc +0 -0
  27. package/scripts/audio/tts/providers/__pycache__/edge.cpython-313.pyc +0 -0
  28. package/scripts/audio/tts/providers/__pycache__/xunfei.cpython-313.pyc +0 -0
  29. package/scripts/cli/__pycache__/__init__.cpython-313.pyc +0 -0
  30. package/scripts/cli/__pycache__/cli.cpython-313.pyc +0 -0
  31. package/scripts/cli/__pycache__/command_parser.cpython-313.pyc +0 -0
  32. package/scripts/core/__pycache__/__init__.cpython-313.pyc +0 -0
  33. package/scripts/core/__pycache__/constants.cpython-313.pyc +0 -0
  34. package/scripts/core/__pycache__/error_notebook.cpython-313.pyc +0 -0
  35. package/scripts/core/__pycache__/gamification.cpython-313.pyc +0 -0
  36. package/scripts/core/__pycache__/scorer.cpython-313.pyc +0 -0
  37. package/scripts/core/__pycache__/state_manager.cpython-313.pyc +0 -0
  38. package/scripts/release.py +255 -0
  39. package/scripts/scheduling/__pycache__/__init__.cpython-313.pyc +0 -0
  40. package/scripts/scheduling/__pycache__/cron_push.cpython-313.pyc +0 -0
  41. package/scripts/utils/__pycache__/__init__.cpython-313.pyc +0 -0
  42. package/scripts/utils/__pycache__/dedup.cpython-313.pyc +0 -0
  43. package/scripts/utils/__pycache__/helpers.cpython-313.pyc +0 -0
  44. package/.claude/settings.local.json +0 -22
  45. package/.gitignore +0 -32
  46. package/CHANGELOG.md +0 -88
  47. package/CLAUDE.md +0 -275
  48. package/backups/state_backup_20260227_063358.json +0 -47
  49. package/backups/state_backup_20260227_063405.json +0 -47
  50. package/backups/state_backup_20260227_064016.json +0 -47
  51. package/bin/eng-lang-tutor.js +0 -177
  52. package/docs/OPENCLAW_DEPLOYMENT.md +0 -241
@@ -1,241 +0,0 @@
1
- # OpenClaw 部署指南
2
-
3
- 本文档说明如何将 `eng-lang-tutor` skill 部署到 OpenClaw 服务器,并通过 Discord 等渠道使用。
4
-
5
- ## 1. 前置条件
6
-
7
- - 一台已安装 OpenClaw 的服务器
8
- - OpenClaw Gateway 正在运行
9
- - 已配置好 Discord Bot(可选其他渠道)
10
-
11
- ## 2. 部署步骤
12
-
13
- ### 2.1 上传 Skill 到服务器
14
-
15
- **方式 A:使用 SCP 上传**
16
-
17
- ```bash
18
- # 在本地机器上执行
19
- scp -r /path/to/eng-lang-tutor user@your-server:~/.openclaw/skills/
20
- ```
21
-
22
- **方式 B:使用 Git Clone**
23
-
24
- ```bash
25
- # 在服务器上执行
26
- cd ~/.openclaw/skills/
27
- git clone https://github.com/rookiestar/eng-lang-tutor.git
28
- ```
29
-
30
- ### 2.2 确认目录结构
31
-
32
- 确保目录结构如下:
33
-
34
- ```
35
- ~/.openclaw/skills/eng-lang-tutor/
36
- ├── SKILL.md # 核心技能文件(必需)
37
- ├── scripts/ # Python 脚本
38
- │ ├── core/ # 核心模块
39
- │ │ ├── state_manager.py
40
- │ │ ├── scorer.py
41
- │ │ ├── gamification.py
42
- │ │ ├── constants.py
43
- │ │ └── error_notebook.py
44
- │ ├── cli/ # 命令行模块
45
- │ ├── scheduling/ # 调度模块
46
- │ ├── utils/ # 工具模块
47
- │ └── audio/ # 音频模块
48
- ├── templates/ # JSON Schema + Prompt 模板
49
- ├── references/ # 参考资源
50
- ├── examples/ # 示例文件(按 CEFR 级别)
51
- └── (数据存储在外部目录)
52
- ~/.openclaw/state/eng-lang-tutor/ # 运行时数据(自动创建)
53
- ```
54
-
55
- ### 2.3 验证 Skill 加载
56
-
57
- ```bash
58
- # 查看已加载的 skills
59
- openclaw skills list
60
-
61
- # 查看特定 skill 详情
62
- openclaw skills info eng-lang-tutor
63
- ```
64
-
65
- ## 3. 配置 Discord 渠道
66
-
67
- ### 3.1 创建 Discord Bot
68
-
69
- 1. 访问 [Discord Developer Portal](https://discord.com/developers/applications)
70
- 2. 创建新应用,命名为你的 Bot
71
- 3. 进入 Bot 页面,创建 Bot 并获取 Token
72
- 4. 启用 Message Content Intent
73
-
74
- ### 3.2 配置 OpenClaw
75
-
76
- ```bash
77
- # 设置 Discord Token
78
- openclaw config set discord.token YOUR_BOT_TOKEN
79
-
80
- # 设置服务器 ID(可选)
81
- openclaw config set discord.guildId YOUR_SERVER_ID
82
- ```
83
-
84
- ### 3.3 邀请 Bot 到服务器
85
-
86
- 1. 在 Discord Developer Portal 中,进入 OAuth2 > URL Generator
87
- 2. 选择 `bot` 和 `applications.commands` scope
88
- 3. 选择所需权限(Send Messages, Read Messages 等)
89
- 4. 复制生成的邀请链接并在浏览器中打开
90
- 5. 选择要添加 Bot 的服务器
91
-
92
- ### 3.4 完成配对
93
-
94
- 首次与 Bot 对话时,会收到配对码:
95
-
96
- ```bash
97
- # 在服务器上执行配对
98
- openclaw pairing approve discord YOUR_PAIRING_CODE
99
- ```
100
-
101
- ## 4. 使用 Skill
102
-
103
- ### 4.1 通过 Discord 使用
104
-
105
- 在 Discord 中与 Bot 对话,触发英语学习功能:
106
-
107
- ```
108
- # 触发今日知识点
109
- 今天有什么英语知识点?
110
-
111
- # 触发 Quiz
112
- 给我出个 Quiz
113
-
114
- # 查看学习进度
115
- 我的学习进度怎么样?
116
- ```
117
-
118
- ### 4.2 设置定时推送(cron)
119
-
120
- ```bash
121
- # 编辑 crontab
122
- crontab -e
123
-
124
- # 添加每日定时推送
125
- # 早上 6:45 推送知识点
126
- 45 6 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's keypoint." --mode now
127
-
128
- # 晚上 22:45 推送 Quiz
129
- 45 22 * * * openclaw system event --text "Use eng-lang-tutor skill. Push today's quiz invitation." --mode now
130
- ```
131
-
132
- ## 5. 进阶配置
133
-
134
- ### 5.1 配置用户偏好
135
-
136
- 在 Discord 中与 Bot 对话设置:
137
-
138
- ```
139
- 设置我的 CEFR 等级为 B2
140
- 我的导师风格设为严谨
141
- 调整主题配比,增加职场内容的比例
142
- ```
143
-
144
- ### 5.2 配置环境变量
145
-
146
- 在服务器上设置 API 密钥(如果使用外部 LLM):
147
-
148
- ```bash
149
- # 编辑 OpenClaw 配置
150
- openclaw config set model.provider anthropic
151
- openclaw config set model.api_key YOUR_API_KEY
152
- ```
153
-
154
- ### 5.3 数据持久化
155
-
156
- 数据存储在 `~/.openclaw/state/eng-lang-tutor/` 目录,确保有正确的写入权限:
157
-
158
- ```bash
159
- chmod -R 755 ~/.openclaw/state/eng-lang-tutor/
160
- ```
161
-
162
- 可通过环境变量 `OPENCLAW_STATE_DIR` 自定义数据目录。
163
-
164
- ## 6. 故障排查
165
-
166
- ### 6.1 Skill 未加载
167
-
168
- ```bash
169
- # 检查 skill 目录
170
- ls -la ~/.openclaw/skills/eng-lang-tutor/
171
-
172
- # 检查 SKILL.md 是否存在
173
- cat ~/.openclaw/skills/eng-lang-tutor/SKILL.md
174
-
175
- # 重启 Gateway
176
- openclaw gateway restart
177
- ```
178
-
179
- ### 6.2 Discord 无响应
180
-
181
- ```bash
182
- # 检查 Gateway 日志
183
- openclaw logs
184
-
185
- # 验证 Discord Token
186
- openclaw config get discord.token
187
-
188
- # 检查 Bot 状态
189
- openclaw doctor
190
- ```
191
-
192
- ### 6.3 Python 脚本错误
193
-
194
- ```bash
195
- # 检查 Python 环境
196
- python3 --version
197
-
198
- # 安装依赖(如有需要)
199
- pip3 install -r ~/.openclaw/skills/eng-lang-tutor/requirements.txt
200
-
201
- # 手动测试脚本
202
- cd ~/.openclaw/skills/eng-lang-tutor/
203
- python3 -m scripts.cli.cli stats
204
- ```
205
-
206
- ## 7. 架构图
207
-
208
- ```
209
- ┌─────────────────────────────────────────────────────────┐
210
- │ Discord │
211
- │ (用户交互) │
212
- └─────────────────────────┬───────────────────────────────┘
213
-
214
-
215
- ┌─────────────────────────────────────────────────────────┐
216
- │ OpenClaw Gateway │
217
- │ (消息路由 + 会话管理) │
218
- └─────────────────────────┬───────────────────────────────┘
219
-
220
-
221
- ┌─────────────────────────────────────────────────────────┐
222
- │ eng-lang-tutor Skill │
223
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
224
- │ │ SKILL.md │ │ scripts/ │ │ ~/.openclaw │ │
225
- │ │ (技能描述) │ │ (Python代码) │ │ (状态存储) │ │
226
- │ └─────────────┘ └─────────────┘ └─────────────┘ │
227
- └─────────────────────────────────────────────────────────┘
228
-
229
-
230
- ┌─────────────────────────────────────────────────────────┐
231
- │ LLM Provider │
232
- │ (Claude/GPT/Qwen 等) │
233
- └─────────────────────────────────────────────────────────┘
234
- ```
235
-
236
- ## 8. 参考链接
237
-
238
- - [OpenClaw 官方文档](https://docs.openclaw.ai)
239
- - [OpenClaw GitHub](https://github.com/openclaw/openclaw)
240
- - [Discord 开发者门户](https://discord.com/developers/applications)
241
- - [OpenClaw Skills 开发指南](https://docs.openclaw.ai/skills)