@rookiestar/eng-lang-tutor 1.0.1

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 (61) hide show
  1. package/.claude/settings.local.json +22 -0
  2. package/.gitignore +32 -0
  3. package/CHANGELOG.md +37 -0
  4. package/CLAUDE.md +275 -0
  5. package/README.md +369 -0
  6. package/SKILL.md +613 -0
  7. package/bin/eng-lang-tutor.js +177 -0
  8. package/docs/OPENCLAW_DEPLOYMENT.md +241 -0
  9. package/examples/sample_keypoint_a1.json +112 -0
  10. package/examples/sample_keypoint_a2.json +124 -0
  11. package/examples/sample_keypoint_b1.json +135 -0
  12. package/examples/sample_keypoint_b2.json +137 -0
  13. package/examples/sample_keypoint_c1.json +134 -0
  14. package/examples/sample_keypoint_c2.json +141 -0
  15. package/examples/sample_quiz_a1.json +94 -0
  16. package/examples/sample_quiz_a2.json +94 -0
  17. package/examples/sample_quiz_b1.json +92 -0
  18. package/examples/sample_quiz_b2.json +94 -0
  19. package/examples/sample_quiz_c1.json +94 -0
  20. package/examples/sample_quiz_c2.json +104 -0
  21. package/package.json +41 -0
  22. package/references/resources.md +292 -0
  23. package/requirements.txt +16 -0
  24. package/scripts/__init__.py +28 -0
  25. package/scripts/audio/__init__.py +23 -0
  26. package/scripts/audio/composer.py +367 -0
  27. package/scripts/audio/converter.py +331 -0
  28. package/scripts/audio/feishu_voice.py +404 -0
  29. package/scripts/audio/tts/__init__.py +30 -0
  30. package/scripts/audio/tts/base.py +166 -0
  31. package/scripts/audio/tts/manager.py +306 -0
  32. package/scripts/audio/tts/providers/__init__.py +12 -0
  33. package/scripts/audio/tts/providers/edge.py +111 -0
  34. package/scripts/audio/tts/providers/xunfei.py +205 -0
  35. package/scripts/audio/utils.py +63 -0
  36. package/scripts/cli/__init__.py +7 -0
  37. package/scripts/cli/cli.py +229 -0
  38. package/scripts/cli/command_parser.py +336 -0
  39. package/scripts/core/__init__.py +30 -0
  40. package/scripts/core/constants.py +125 -0
  41. package/scripts/core/error_notebook.py +308 -0
  42. package/scripts/core/gamification.py +405 -0
  43. package/scripts/core/scorer.py +295 -0
  44. package/scripts/core/state_manager.py +814 -0
  45. package/scripts/eng-lang-tutor +16 -0
  46. package/scripts/scheduling/__init__.py +6 -0
  47. package/scripts/scheduling/cron_push.py +229 -0
  48. package/scripts/utils/__init__.py +12 -0
  49. package/scripts/utils/dedup.py +331 -0
  50. package/scripts/utils/helpers.py +82 -0
  51. package/templates/keypoint_schema.json +420 -0
  52. package/templates/prompt_templates.md +73 -0
  53. package/templates/prompts/display_guide.md +106 -0
  54. package/templates/prompts/initialization.md +350 -0
  55. package/templates/prompts/keypoint_generation.md +272 -0
  56. package/templates/prompts/output_rules.md +106 -0
  57. package/templates/prompts/quiz_generation.md +190 -0
  58. package/templates/prompts/responses.md +339 -0
  59. package/templates/prompts/shared_enums.md +252 -0
  60. package/templates/quiz_schema.json +214 -0
  61. package/templates/state_schema.json +277 -0
@@ -0,0 +1,292 @@
1
+ # English Learning Resources
2
+
3
+ > This file contains themed resources for generating authentic American English content.
4
+ > LLM should reference these resources when generating knowledge points and quizzes.
5
+
6
+ ---
7
+
8
+ ## 1. Native American English Expressions
9
+
10
+ ### 1.1 Classic Learning Materials
11
+
12
+ | Resource | Description | Key Features |
13
+ |----------|-------------|--------------|
14
+ | **Speak English Like an American** | Classic textbook with 350+ idioms | Dialogue-based learning, everyday situations |
15
+ | **NTC's Dictionary of American Slang** | Comprehensive slang dictionary | Colloquial expressions, usage examples |
16
+ | **American Colloquial Expressions** | Collection of spoken phrases | Almost all idioms are colloquial language |
17
+
18
+ ### 1.2 Common Chinglish Corrections
19
+
20
+ | Chinglish (Wrong) | American (Correct) | Explanation |
21
+ |-------------------|-------------------|-------------|
22
+ | "It was just so-so." | "It was just ok/alright." | Americans rarely use "so-so" |
23
+ | "Let's go out to play." | "Let's go out!" | "Play" is for children; adults "go out" |
24
+ | "Bad for your health." | "It's not good for you." | More natural phrasing |
25
+ | "I very like it." | "I really like it." | "Very" doesn't modify "like" |
26
+ | "How to say?" | "How do I put this?" / "What's the word?" | Natural hesitation phrases |
27
+
28
+ ---
29
+
30
+ ## 2. TV Shows & Movies (Topic: movies)
31
+
32
+ ### 2.1 Recommended Shows for Learning
33
+
34
+ | Show | Genre | Learning Focus | Classic Lines |
35
+ |------|-------|----------------|---------------|
36
+ | **Friends** | Sitcom | Daily conversation, humor, sarcasm | "How you doin'?", "Oh. My. God!" |
37
+ | **The Office** | Workplace Comedy | Office idioms, corporate culture | "That's what she said", water-cooler chat |
38
+ | **Gossip Girl** | Teen Drama | Youth slang, fashion, social dynamics | "No offense." / "None taken.", "Done and done." |
39
+ | **Desperate Housewives** | Drama | Formal/informal switching, life situations | "Take a rain check", "Serves him right" |
40
+ | **House of Cards** | Political Thriller | Business/political vocabulary, formal speech | Complex sentence structures |
41
+ | **Modern Family** | Sitcom | Family dynamics, generational differences | "I'm not a regular mom, I'm a cool mom" |
42
+ | **How I Met Your Mother** | Sitcom | Dating slang, friendship expressions | "Legendary", "Suit up!" |
43
+
44
+ ### 2.2 Expression Examples from TV Shows
45
+
46
+ **From Friends:**
47
+ - "We were on a break!" - Defending oneself
48
+ - "Could I BE any more...?" - Emphasis (Chandler's style)
49
+ - "Pivot!" - When moving something difficult
50
+
51
+ **From The Office:**
52
+ - "Touch base" - Briefly connect with someone
53
+ - "Circle back" - Return to a topic later
54
+ - "Low-hanging fruit" - Easy wins
55
+
56
+ **From Gossip Girl:**
57
+ - "Any interest in fresh air?" - Casual invitation
58
+ - "You set me up!" - Accusing someone of a trap
59
+ - "It was a last minute thing." - Explaining spontaneity
60
+
61
+ ---
62
+
63
+ ## 3. News & Media (Topic: news)
64
+
65
+ ### 3.1 News Sources for Learning
66
+
67
+ | Source | Accent | Features | Topics |
68
+ |--------|--------|----------|--------|
69
+ | **CNN 10** | American | 10-min daily news for students | Current events, explained clearly |
70
+ | **VOA Learning English** | American | Slow pace, simplified vocabulary | World news, American life |
71
+ | **BBC Learning English** | British/American | Grammar focus, pronunciation | General English |
72
+ | **Engoo** | Various | Graded by difficulty, daily updates | News, culture, lifestyle |
73
+ | **NPR** | American | Natural pace, diverse topics | Culture, science, stories |
74
+
75
+ ### 3.2 News English Vocabulary
76
+
77
+ **Politics & Government:**
78
+ - bill, veto, legislation, incumbent, poll, constituency
79
+ - "The bill passed with a narrow margin."
80
+ - "The incumbent is seeking re-election."
81
+
82
+ **Business & Economy:**
83
+ - earnings, quarterly, forecast, market trends, inflation
84
+ - "Stocks rallied after the announcement."
85
+ - "The company exceeded earnings expectations."
86
+
87
+ **Technology:**
88
+ - breakthrough, innovation, cybersecurity, AI, startup
89
+ - "The startup secured Series B funding."
90
+ - "The breakthrough could revolutionize..."
91
+
92
+ ---
93
+
94
+ ## 4. Gaming (Topic: gaming)
95
+
96
+ ### 4.1 Gaming Terminology
97
+
98
+ | Category | Terms & Expressions |
99
+ |----------|-------------------|
100
+ | **Core Terms** | NPC, spawn, respawn, loot, grind, level up, XP, HP, MP |
101
+ | **Gameplay** | buff, nerf, patch, DLC, speedrun, playthrough |
102
+ | **Multiplayer** | party, squad, team up, PvP, PvE, co-op, matchmaking, lobby |
103
+ | **Competition** | GG (good game), noob, pro, clutch, carry, feed, throw, smurf |
104
+ | **Actions** | camp, kite, tank, heal, revive, reload, flank, rush |
105
+
106
+ ### 4.2 Gaming Expressions in Daily Use
107
+
108
+ | Expression | Meaning | Example |
109
+ |------------|---------|---------|
110
+ | "GG" | Good game, well done | "That presentation was GG." |
111
+ | "Nerf" | Weaken or reduce effectiveness | "They nerfed the office coffee machine." |
112
+ | "Grind" | Repetitive hard work | "I'm grinding through these reports." |
113
+ | "Carry" | Do most of the work | "She carried the whole project." |
114
+ | "Clutch" | Success under pressure | "That was a clutch presentation." |
115
+ | "Buff up" | Improve or strengthen | "Need to buff up my resume." |
116
+
117
+ ### 4.3 Gaming Dialogue Examples
118
+
119
+ ```
120
+ A: "Wanna squad up tonight?"
121
+ B: "Sure, I'll be on around 8."
122
+ A: "Cool, let's grind some ranked matches."
123
+ B: "Hopefully we don't get matched with noobs."
124
+ ```
125
+
126
+ ---
127
+
128
+ ## 5. Sports (Topic: sports)
129
+
130
+ ### 5.1 Basketball Vocabulary
131
+
132
+ | Category | Terms |
133
+ |----------|-------|
134
+ | **Scoring** | dunk, layup, three-pointer, free throw, buzzer beater |
135
+ | **Defense** | block, steal, rebound, turnover, foul |
136
+ | **Tactics** | pick and roll, fast break, zone defense, press |
137
+ | **Positions** | point guard, shooting guard, forward, center |
138
+
139
+ **Common Expressions:**
140
+ - "He hit a buzzer beater to win the game!"
141
+ - "She's on fire tonight!" (scoring consistently)
142
+ - "They're running away with this one." (winning easily)
143
+ - "It's a game of runs." (momentum shifts)
144
+
145
+ ### 5.2 Sports Idioms in Business/Daily Life
146
+
147
+ | Idiom | Meaning | Example |
148
+ |-------|---------|---------|
149
+ | "Step up to the plate" | Take responsibility | "It's time to step up to the plate." |
150
+ | "Ballpark figure" | Rough estimate | "Give me a ballpark figure." |
151
+ | "Drop the ball" | Make a mistake | "Don't drop the ball on this project." |
152
+ | "Hit it out of the park" | Do excellently | "She hit it out of the park with that pitch." |
153
+ | "On the ball" | Alert, competent | "He's really on the ball today." |
154
+ | "Full court press" | Intense effort | "We need a full court press on this deal." |
155
+
156
+ ---
157
+
158
+ ## 6. Workplace & Business (Topic: workplace)
159
+
160
+ ### 6.1 Office Idioms
161
+
162
+ | Expression | Meaning | Context |
163
+ |------------|---------|---------|
164
+ | "Touch base" | Briefly connect | "Let's touch base next week." |
165
+ | "Circle back" | Return to a topic | "Let's circle back on this later." |
166
+ | "Low-hanging fruit" | Easy wins | "Let's tackle the low-hanging fruit first." |
167
+ | "Bandwidth" | Capacity/availability | "I don't have the bandwidth for this." |
168
+ | "Synergy" | Combined effect | "Looking for synergy between teams." |
169
+ | "Pain point" | Problem area | "What are the customer pain points?" |
170
+ | "Value-add" | Benefit provided | "What's the value-add here?" |
171
+ | "Action items" | Tasks to complete | "Let's review the action items." |
172
+
173
+ ### 6.2 Meeting Phrases
174
+
175
+ **Starting:**
176
+ - "Let's get the ball rolling."
177
+ - "Shall we dive in?"
178
+ - "Thanks for hopping on this call."
179
+
180
+ **Contributing:**
181
+ - "I'd like to add something here."
182
+ - "Building on what [name] said..."
183
+ - "Here's my take on this."
184
+
185
+ **Disagreeing Politely:**
186
+ - "I see where you're coming from, but..."
187
+ - "That's an interesting perspective. Have we considered...?"
188
+ - "I'm not sure I entirely agree."
189
+
190
+ **Ending:**
191
+ - "Let's wrap this up."
192
+ - "To summarize, we've agreed on..."
193
+ - "I think we're good to go."
194
+
195
+ ### 6.3 Workplace Dialogue Examples
196
+
197
+ ```
198
+ A: "Hey, do you have a minute to touch base on the project?"
199
+ B: "Sure, what's up?"
200
+ A: "I wanted to circle back on the timeline. We might need more bandwidth."
201
+ B: "Got it. Let's identify the pain points and see what low-hanging fruit we can tackle first."
202
+ ```
203
+
204
+ ---
205
+
206
+ ## 7. Daily Life (Topic: daily_life)
207
+
208
+ ### 7.1 Shopping Expressions
209
+
210
+ | Situation | Expressions |
211
+ |-----------|-------------|
212
+ | **Asking for help** | "Can I help you?" / "Just looking, thanks." / "Where can I find...?" |
213
+ | **Asking about products** | "Do you have this in a different size/color?" / "Is this on sale?" |
214
+ | **Trying on** | "Can I try this on?" / "Where's the fitting room?" |
215
+ | **Price negotiation** | "Is this the best price?" / "Can you give me a discount?" |
216
+ | **At checkout** | "I'll take it." / "Do you take credit cards?" / "Can I get a receipt?" |
217
+
218
+ ### 7.2 Restaurant Expressions
219
+
220
+ | Situation | Expressions |
221
+ |-----------|-------------|
222
+ | **Ordering** | "I'd like the..." / "Could I get...?" / "What do you recommend?" |
223
+ | **Special requests** | "Could I get this without...?" / "Is this vegetarian?" |
224
+ | **During meal** | "Could I get some more water?" / "This is delicious!" |
225
+ | **Paying** | "Could I get the check, please?" / "Separate checks, please." |
226
+ | **To-go** | "Can I get this to go?" / "I'll have the rest to go." |
227
+
228
+ ### 7.3 Social Expressions
229
+
230
+ **Greetings:**
231
+ - "What's up?" / "How's it going?" / "How have you been?"
232
+ - "Long time no see!" / "Good to see you!"
233
+
234
+ **Casual Responses:**
235
+ - "Not much, you?" / "Can't complain." / "Same old, same old."
236
+ - "Take it easy!" / "Catch you later!" / "See ya!"
237
+
238
+ **Making Plans:**
239
+ - "We should hang out sometime." / "Let's grab coffee."
240
+ - "Are you free this weekend?" / "What are you up to tonight?"
241
+
242
+ **Polite Refusals:**
243
+ - "I'd love to, but I can't make it." / "Maybe another time."
244
+ - "I'll have to take a rain check."
245
+
246
+ ---
247
+
248
+ ## 8. Casual & Slang (All Topics)
249
+
250
+ ### 8.1 Common American Slang
251
+
252
+ | Slang | Meaning | Example |
253
+ |-------|---------|---------|
254
+ | "Gonna" | Going to | "I'm gonna grab some food." |
255
+ | "Gotta" | Have to | "I gotta run." |
256
+ | "Wanna" | Want to | "Do you wanna come?" |
257
+ | "Kinda" | Kind of | "It's kinda cold today." |
258
+ | "Lemme" | Let me | "Lemme see that." |
259
+ | "Dunno" | Don't know | "I dunno, maybe?" |
260
+ | "Ya" | You | "See ya later!" |
261
+ | "Y'all" | You all | "Y'all coming?" |
262
+
263
+ ### 8.2 Fillers and Hesitation
264
+
265
+ | Filler | Usage |
266
+ |--------|-------|
267
+ | "Like" | "It was, like, really expensive." |
268
+ | "You know" | "It's that place, you know, near the mall." |
269
+ | "I mean" | "I mean, I could try, but..." |
270
+ | "Sort of / Kind of" | "It's sort of complicated." |
271
+ | "Basically" | "Basically, what happened was..." |
272
+ | "Actually" | "Actually, I think you're right." |
273
+
274
+ ---
275
+
276
+ ## 9. Usage Notes for LLM
277
+
278
+ When generating content, reference these resources based on the selected topic:
279
+
280
+ 1. **Movies**: Use expressions from TV shows section
281
+ 2. **News**: Reference news vocabulary and formal expressions
282
+ 3. **Gaming**: Include gaming terminology and slang
283
+ 4. **Sports**: Use sports idioms and expressions
284
+ 5. **Workplace**: Focus on office idioms and meeting phrases
285
+ 6. **Social**: Use casual greetings and social expressions
286
+ 7. **Daily Life**: Reference shopping/restaurant dialogues
287
+
288
+ Always include:
289
+ - Scene context matching the topic
290
+ - Chinglish trap with correction
291
+ - Natural American alternatives
292
+ - Pronunciation tips for casual speech (gonna, gotta, etc.)
@@ -0,0 +1,16 @@
1
+ # Core dependencies
2
+ websocket-client>=1.6.0 # For XunFei TTS WebSocket API
3
+ certifi>=2024.0.0 # SSL certificate bundle for HTTPS/WebSocket connections
4
+ aiohttp>=3.8.0 # Async HTTP client for Feishu API
5
+
6
+ # Edge-TTS support (default TTS provider)
7
+ edge-tts>=6.1.0
8
+
9
+ # Development dependencies
10
+ pytest>=7.0.0
11
+ pytest-asyncio>=0.21.0
12
+
13
+ # System dependencies (must be installed separately):
14
+ # - ffmpeg: Required for audio composition
15
+ # macOS: brew install ffmpeg
16
+ # Ubuntu/Debian: sudo apt-get install ffmpeg
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ eng-lang-tutor scripts package
4
+
5
+ Main entry points:
6
+ - StateManager: Core state persistence
7
+ - Scorer: Quiz evaluation
8
+ - GamificationManager: XP/levels/streaks/badges
9
+ - CommandParser: User command parsing
10
+ - AudioComposer: Audio generation
11
+ """
12
+
13
+ from .core.state_manager import StateManager
14
+ from .core.scorer import Scorer
15
+ from .core.gamification import GamificationManager
16
+ from .core.constants import LEVEL_THRESHOLDS, calculate_level, get_level_name, get_streak_multiplier
17
+ from .core.error_notebook import ErrorNotebookManager
18
+
19
+ __all__ = [
20
+ 'StateManager',
21
+ 'Scorer',
22
+ 'GamificationManager',
23
+ 'ErrorNotebookManager',
24
+ 'LEVEL_THRESHOLDS',
25
+ 'calculate_level',
26
+ 'get_level_name',
27
+ 'get_streak_multiplier',
28
+ ]
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env python3
2
+ """Audio functionality: TTS, composition, conversion, Feishu integration."""
3
+
4
+ from .composer import AudioComposer, CompositionResult
5
+ from .converter import AudioConverter, ConversionResult, convert_mp3_to_opus
6
+ from .utils import get_ffmpeg_path, get_audio_duration
7
+ from .feishu_voice import FeishuVoiceSender, VoiceSendResult
8
+ from .tts import TTSManager, TTSProvider, TTSResult
9
+
10
+ __all__ = [
11
+ 'AudioComposer',
12
+ 'CompositionResult',
13
+ 'AudioConverter',
14
+ 'ConversionResult',
15
+ 'convert_mp3_to_opus',
16
+ 'get_ffmpeg_path',
17
+ 'get_audio_duration',
18
+ 'FeishuVoiceSender',
19
+ 'VoiceSendResult',
20
+ 'TTSManager',
21
+ 'TTSProvider',
22
+ 'TTSResult',
23
+ ]