termi-kids 0.1.0

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 (64) hide show
  1. package/LICENSE +34 -0
  2. package/README.md +148 -0
  3. package/SAFETY.md +187 -0
  4. package/bin/termi.js +22 -0
  5. package/dist/agent/context.js +126 -0
  6. package/dist/agent/loop.js +172 -0
  7. package/dist/agent/prompts/system.js +45 -0
  8. package/dist/agent/tools.js +335 -0
  9. package/dist/auth/keychain.js +146 -0
  10. package/dist/auth/oauth.js +375 -0
  11. package/dist/auth/tokens.js +219 -0
  12. package/dist/cli.js +258 -0
  13. package/dist/config/paths.js +92 -0
  14. package/dist/config/pin.js +150 -0
  15. package/dist/config/settings.js +131 -0
  16. package/dist/grownups/panel.js +483 -0
  17. package/dist/learn/lessons.js +490 -0
  18. package/dist/learn/runner.js +193 -0
  19. package/dist/preview/server.js +407 -0
  20. package/dist/projects/create.js +103 -0
  21. package/dist/projects/ideas.js +182 -0
  22. package/dist/projects/quests.js +277 -0
  23. package/dist/projects/scaffolds/art.js +484 -0
  24. package/dist/projects/scaffolds/biggames.js +554 -0
  25. package/dist/projects/scaffolds/characters.js +580 -0
  26. package/dist/projects/scaffolds/games.js +516 -0
  27. package/dist/projects/scaffolds/index.js +24 -0
  28. package/dist/projects/scaffolds/music.js +528 -0
  29. package/dist/projects/scaffolds/pets.js +567 -0
  30. package/dist/projects/scaffolds/quizzes.js +757 -0
  31. package/dist/projects/scaffolds/stories.js +620 -0
  32. package/dist/projects/scaffolds/vendor/KAPLAY-LICENSE.txt +35 -0
  33. package/dist/projects/scaffolds/vendor/kaplay.mjs +57 -0
  34. package/dist/projects/scaffolds/websites.js +474 -0
  35. package/dist/projects/snapshots.js +203 -0
  36. package/dist/projects/store.js +325 -0
  37. package/dist/providers/errors.js +207 -0
  38. package/dist/providers/index.js +316 -0
  39. package/dist/providers/models.js +38 -0
  40. package/dist/safety/audit.js +195 -0
  41. package/dist/safety/blocks.js +29 -0
  42. package/dist/safety/classifier.js +337 -0
  43. package/dist/safety/codescan.js +168 -0
  44. package/dist/safety/guarddownload.js +79 -0
  45. package/dist/safety/guardrunner.js +125 -0
  46. package/dist/safety/localguard.js +227 -0
  47. package/dist/safety/modelstore.js +127 -0
  48. package/dist/safety/prefilter.js +214 -0
  49. package/dist/safety/session.js +118 -0
  50. package/dist/safety/taxonomy.js +246 -0
  51. package/dist/safety/textextract.js +193 -0
  52. package/dist/setup/launcher.js +65 -0
  53. package/dist/setup/wizard.js +469 -0
  54. package/dist/surfaces/chat.js +439 -0
  55. package/dist/surfaces/commands.js +206 -0
  56. package/dist/surfaces/home.js +438 -0
  57. package/dist/types.js +5 -0
  58. package/dist/ui/banner.js +35 -0
  59. package/dist/ui/celebrate.js +141 -0
  60. package/dist/ui/errors.js +97 -0
  61. package/dist/ui/mascot.js +223 -0
  62. package/dist/ui/text.js +156 -0
  63. package/dist/ui/theme.js +92 -0
  64. package/package.json +67 -0
@@ -0,0 +1,277 @@
1
+ /**
2
+ * Build Quests: step-by-step guided builds, one per project type.
3
+ * A quest is a short trail of steps. Each step tells the kid what we are
4
+ * doing and hands them a ready prompt, so "I do not know what to say"
5
+ * never blocks a first build. Quests cost nothing extra: the prompts go
6
+ * through the normal chat turn, safety pipeline and all.
7
+ */
8
+ export const QUESTS = [
9
+ {
10
+ id: 'quest-games',
11
+ scaffoldId: 'games',
12
+ title: 'Make your dodge game yours',
13
+ emoji: '\u{1F3AE}',
14
+ steps: [
15
+ {
16
+ say: 'First, let us make the game feel right. We start with speed.',
17
+ prompt: 'Make the player move a little faster.',
18
+ },
19
+ {
20
+ say: 'Great! Now give yourself room to make mistakes.',
21
+ prompt: 'Give the player three lives and show them on screen.',
22
+ },
23
+ {
24
+ say: 'Time for treasure. A bonus makes dodging worth it.',
25
+ prompt: 'Add a bonus star that gives 10 points when you grab it.',
26
+ },
27
+ {
28
+ say: 'Let us make it exciting. The game should grow with you.',
29
+ prompt: 'Make the game speed up a little every 20 points.',
30
+ },
31
+ {
32
+ say: 'Last step: brag rights. A high score keeps you coming back.',
33
+ prompt: 'Add a high score that saves on this computer.',
34
+ },
35
+ ],
36
+ },
37
+ {
38
+ id: 'quest-biggames',
39
+ scaffoldId: 'biggames',
40
+ title: 'Level up your platform game',
41
+ emoji: '\u{1F579}',
42
+ steps: [
43
+ {
44
+ say: 'Let us tune the jump first. Jumping is the whole game.',
45
+ prompt: 'Make the player jump a little higher.',
46
+ },
47
+ {
48
+ say: 'Now add more shiny things to hunt for.',
49
+ prompt: 'Add three more things to collect in level one.',
50
+ },
51
+ {
52
+ say: 'A moving platform makes players plan their jumps.',
53
+ prompt: 'Add a platform that moves up and down.',
54
+ },
55
+ {
56
+ say: 'Every good game hides a secret. Let us hide one.',
57
+ prompt: 'Add a secret room with a big bonus inside.',
58
+ },
59
+ {
60
+ say: 'Finish strong: a timer turns your level into a race.',
61
+ prompt: 'Add a timer that shows how fast you finish the level.',
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ id: 'quest-art',
67
+ scaffoldId: 'art',
68
+ title: 'Build a super paint studio',
69
+ emoji: '\u{1F3A8}',
70
+ steps: [
71
+ {
72
+ say: 'Every artist needs colors. Let us add your favorite.',
73
+ prompt: 'Add a bright new color to the paint set.',
74
+ },
75
+ {
76
+ say: 'Mistakes happen. An eraser makes them no big deal.',
77
+ prompt: 'Add an eraser so I can fix mistakes.',
78
+ },
79
+ {
80
+ say: 'Now the fun one: a brush that changes color as you draw.',
81
+ prompt: 'Add a rainbow brush that changes color as you draw.',
82
+ },
83
+ {
84
+ say: 'Stamps make art fast and silly. Pick fun shapes.',
85
+ prompt: 'Add a stamp tool with a star, a heart, and a smiley.',
86
+ },
87
+ {
88
+ say: 'Last step: keep your art. Let us add saving.',
89
+ prompt: 'Let me save my picture to the computer.',
90
+ },
91
+ ],
92
+ },
93
+ {
94
+ id: 'quest-music',
95
+ scaffoldId: 'music',
96
+ title: 'Drop your first beat',
97
+ emoji: '\u{1F3B5}',
98
+ steps: [
99
+ {
100
+ say: 'Every song starts with a beat. Let us add a drum.',
101
+ prompt: 'Add one new drum sound.',
102
+ },
103
+ {
104
+ say: 'Now make it move. A little faster feels more alive.',
105
+ prompt: 'Make the beat a little faster.',
106
+ },
107
+ {
108
+ say: 'Lights make it a show, not just a song.',
109
+ prompt: 'Make the lights flash with the beat.',
110
+ },
111
+ {
112
+ say: 'Give yourself a speed control, like a real DJ.',
113
+ prompt: 'Add a slider that changes the speed.',
114
+ },
115
+ {
116
+ say: 'Big finish: a song that builds up and then drops.',
117
+ prompt: 'Make a song that builds up and then drops.',
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ id: 'quest-pets',
123
+ scaffoldId: 'pets',
124
+ title: 'Raise a happy pet',
125
+ emoji: '\u{1F43E}',
126
+ steps: [
127
+ {
128
+ say: 'Pets love snacks. Let us add a new one.',
129
+ prompt: 'Give my pet a new snack to eat.',
130
+ },
131
+ {
132
+ say: 'Now let us see its feelings. Hearts work great.',
133
+ prompt: 'Add a happiness meter with hearts.',
134
+ },
135
+ {
136
+ say: 'Pets need play time. A tiny game inside is perfect.',
137
+ prompt: 'Add a play button with a tiny game inside.',
138
+ },
139
+ {
140
+ say: 'Style time! Every pet looks better in a hat.',
141
+ prompt: 'Add a closet with hats for my pet.',
142
+ },
143
+ {
144
+ say: 'Last step: teach it a trick. Treats help.',
145
+ prompt: 'Let my pet learn a trick after ten treats.',
146
+ },
147
+ ],
148
+ },
149
+ {
150
+ id: 'quest-stories',
151
+ scaffoldId: 'stories',
152
+ title: 'Write a story with a twist',
153
+ emoji: '\u{1F4D6}',
154
+ steps: [
155
+ {
156
+ say: 'Choices make stories fun. Let us add one more.',
157
+ prompt: 'Add one more choice to the first scene.',
158
+ },
159
+ {
160
+ say: 'Give a character a line people will remember.',
161
+ prompt: 'Give a character a funny catchphrase.',
162
+ },
163
+ {
164
+ say: 'Now the twist. Every good story has one.',
165
+ prompt: 'Add a new scene with a surprise twist.',
166
+ },
167
+ {
168
+ say: 'Add an item readers can grab now and use later.',
169
+ prompt: 'Add an item you can pick up and use later.',
170
+ },
171
+ {
172
+ say: 'End big: a happy ending worth finding.',
173
+ prompt: 'Make a new ending where everyone celebrates.',
174
+ },
175
+ ],
176
+ },
177
+ {
178
+ id: 'quest-quizzes',
179
+ scaffoldId: 'quizzes',
180
+ title: 'Host your own quiz show',
181
+ emoji: '❓',
182
+ steps: [
183
+ {
184
+ say: 'Every quiz needs questions. Add one you love.',
185
+ prompt: 'Add one new question to the quiz.',
186
+ },
187
+ {
188
+ say: 'Silly wrong answers make everyone laugh.',
189
+ prompt: 'Add a silly wrong answer to a question.',
190
+ },
191
+ {
192
+ say: 'Reward the champs with a happy message.',
193
+ prompt: 'Show a happy message for a perfect score.',
194
+ },
195
+ {
196
+ say: 'A timer turns questions into a game show.',
197
+ prompt: 'Add a timer for each question.',
198
+ },
199
+ {
200
+ say: 'Grand finale: one big question worth double.',
201
+ prompt: 'Add a final boss question worth double points.',
202
+ },
203
+ ],
204
+ },
205
+ {
206
+ id: 'quest-websites',
207
+ scaffoldId: 'websites',
208
+ title: 'Make your page pop',
209
+ emoji: '\u{1F310}',
210
+ steps: [
211
+ {
212
+ say: 'Your page, your colors. Let us start there.',
213
+ prompt: 'Change the page colors to my favorites.',
214
+ },
215
+ {
216
+ say: 'A big welcome banner says this page is yours.',
217
+ prompt: 'Add a big welcome banner at the top.',
218
+ },
219
+ {
220
+ say: 'Little moves make pages feel alive.',
221
+ prompt: 'Make the buttons wiggle when you point at them.',
222
+ },
223
+ {
224
+ say: 'Day and night mode is a classic. Add the switch.',
225
+ prompt: 'Add a day and night switch.',
226
+ },
227
+ {
228
+ say: 'Sneaky finish: hide a tiny game on the page.',
229
+ prompt: 'Hide a tiny game somewhere on the page.',
230
+ },
231
+ ],
232
+ },
233
+ {
234
+ id: 'quest-characters',
235
+ scaffoldId: 'characters',
236
+ title: 'Bring your character to life',
237
+ emoji: '\u{1F916}',
238
+ steps: [
239
+ {
240
+ say: 'First words matter. Give your character a fresh hello.',
241
+ prompt: 'Give your character a new greeting.',
242
+ },
243
+ {
244
+ say: 'A good joke makes a character a friend.',
245
+ prompt: 'Add a joke your character can tell.',
246
+ },
247
+ {
248
+ say: 'Let players ask something new.',
249
+ prompt: 'Add a new question players can ask.',
250
+ },
251
+ {
252
+ say: 'Moods make characters feel real. Add two.',
253
+ prompt: 'Give your character a happy mood and a grumpy mood.',
254
+ },
255
+ {
256
+ say: 'Last step: a sidekick who butts in sometimes.',
257
+ prompt: 'Add a second character who butts in sometimes.',
258
+ },
259
+ ],
260
+ },
261
+ ];
262
+ /** Quests that fit the given project type. */
263
+ export function questsFor(scaffoldId) {
264
+ return QUESTS.filter((quest) => quest.scaffoldId === scaffoldId);
265
+ }
266
+ /** Looks up one quest by id. */
267
+ export function questById(id) {
268
+ return QUESTS.find((quest) => quest.id === id);
269
+ }
270
+ /** The kid-facing header line for one step of a quest. */
271
+ export function questStepLine(quest, stepIndex) {
272
+ const step = quest.steps[stepIndex];
273
+ if (step === undefined) {
274
+ return '';
275
+ }
276
+ return `${quest.emoji} Step ${stepIndex + 1} of ${quest.steps.length}: ${step.say}`;
277
+ }