recess-cli 3.28.0 → 3.35.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.
- package/README.md +1 -1
- package/dist/args.js +2 -0
- package/dist/cli.js +40 -3
- package/dist/command-schema.js +131 -3
- package/dist/commands/family.js +1278 -16
- package/dist/commands/flags.js +185 -0
- package/dist/help.js +186 -12
- package/dist/jobs.js +32 -0
- package/package.json +2 -3
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { unwrap } from "../api.js";
|
|
2
|
+
import { flagString } from "../args.js";
|
|
3
|
+
import { CliError } from "../errors.js";
|
|
4
|
+
import { positional, readJsonFile } from "./shared.js";
|
|
5
|
+
const ROLES = [
|
|
6
|
+
"KID",
|
|
7
|
+
"GUARDIAN",
|
|
8
|
+
"GUIDE",
|
|
9
|
+
"MODERATOR",
|
|
10
|
+
"ADMIN",
|
|
11
|
+
"DISABLED",
|
|
12
|
+
"PROGRAM",
|
|
13
|
+
"GUEST",
|
|
14
|
+
];
|
|
15
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
16
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
17
|
+
function list(context, name) {
|
|
18
|
+
const raw = flagString(context.parsed, name);
|
|
19
|
+
return raw
|
|
20
|
+
? raw
|
|
21
|
+
.split(",")
|
|
22
|
+
.map((value) => value.trim())
|
|
23
|
+
.filter(Boolean)
|
|
24
|
+
: [];
|
|
25
|
+
}
|
|
26
|
+
function onOff(context, name) {
|
|
27
|
+
const raw = flagString(context.parsed, name);
|
|
28
|
+
if (raw === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (raw === "on")
|
|
31
|
+
return true;
|
|
32
|
+
if (raw === "off")
|
|
33
|
+
return false;
|
|
34
|
+
throw new CliError("invalid_arguments", `--${name} takes on or off.`);
|
|
35
|
+
}
|
|
36
|
+
function targets(context) {
|
|
37
|
+
const userIds = list(context, "user");
|
|
38
|
+
const emails = list(context, "email").map((email) => email.toLowerCase());
|
|
39
|
+
const roles = list(context, "role").map((role) => role.toUpperCase());
|
|
40
|
+
const badId = userIds.find((id) => !UUID.test(id));
|
|
41
|
+
if (badId) {
|
|
42
|
+
throw new CliError("invalid_arguments", `--user ${badId} is not a user id.`);
|
|
43
|
+
}
|
|
44
|
+
const badEmail = emails.find((email) => !EMAIL.test(email));
|
|
45
|
+
if (badEmail) {
|
|
46
|
+
throw new CliError("invalid_arguments", `--email ${badEmail} is not an email.`);
|
|
47
|
+
}
|
|
48
|
+
const badRole = roles.find((role) => !ROLES.includes(role));
|
|
49
|
+
if (badRole) {
|
|
50
|
+
throw new CliError("invalid_arguments", `--role ${badRole} is not one of ${ROLES.join(", ")}.`);
|
|
51
|
+
}
|
|
52
|
+
if (!userIds.length && !emails.length && !roles.length) {
|
|
53
|
+
throw new CliError("invalid_arguments", "Pass at least one of --user <id,...>, --email <email,...>, --role <ROLE,...>.");
|
|
54
|
+
}
|
|
55
|
+
return { userIds, emails, roles: roles };
|
|
56
|
+
}
|
|
57
|
+
function current(flag) {
|
|
58
|
+
return {
|
|
59
|
+
enabled: flag.enabled,
|
|
60
|
+
everyone: flag.everyone,
|
|
61
|
+
roles: flag.roles,
|
|
62
|
+
emails: flag.emails,
|
|
63
|
+
users: flag.users.map((user) => `${[user.firstName, user.lastName].filter(Boolean).join(" ") || user.email || user.id} (${user.role})`),
|
|
64
|
+
payload: flag.payload,
|
|
65
|
+
updatedAt: flag.updatedAt,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export async function runFlagsCommand(context) {
|
|
69
|
+
const { parsed, api, writeCommand } = context;
|
|
70
|
+
const verb = parsed.positionals[1];
|
|
71
|
+
if (verb === "list") {
|
|
72
|
+
return unwrap(await api.client.GET("/admin/feature-flags/"));
|
|
73
|
+
}
|
|
74
|
+
const verbs = ["get", "create", "set", "add", "remove", "delete"];
|
|
75
|
+
if (!verb || !verbs.includes(verb)) {
|
|
76
|
+
throw new CliError("invalid_arguments", "Use flags list|get|create|set|add|remove|delete.");
|
|
77
|
+
}
|
|
78
|
+
const key = positional(parsed, 2, "flag key");
|
|
79
|
+
if (verb === "create") {
|
|
80
|
+
const description = flagString(parsed, "description") ?? null;
|
|
81
|
+
const name = flagString(parsed, "name")?.trim() || undefined;
|
|
82
|
+
return writeCommand(parsed, {
|
|
83
|
+
action: "create a feature flag (off, targeting no one)",
|
|
84
|
+
target: { key },
|
|
85
|
+
request: { key, name, description },
|
|
86
|
+
details: {
|
|
87
|
+
consequences: [
|
|
88
|
+
"The flag starts disabled; code reading it sees it off until `flags set --enabled on` and a target.",
|
|
89
|
+
],
|
|
90
|
+
reverse: `\`flags delete ${key}\``,
|
|
91
|
+
},
|
|
92
|
+
}, async () => unwrap(await api.client.POST("/admin/feature-flags/", {
|
|
93
|
+
body: { key, name, description },
|
|
94
|
+
})));
|
|
95
|
+
}
|
|
96
|
+
const flag = unwrap(await api.client.GET("/admin/feature-flags/{key}", {
|
|
97
|
+
params: { path: { key } },
|
|
98
|
+
}));
|
|
99
|
+
if (verb === "get")
|
|
100
|
+
return flag;
|
|
101
|
+
const patch = (body) => async () => unwrap(await api.client.PATCH("/admin/feature-flags/{key}", {
|
|
102
|
+
params: { path: { key } },
|
|
103
|
+
body: { ...body, expectedUpdatedAt: flag.updatedAt },
|
|
104
|
+
}));
|
|
105
|
+
if (verb === "set") {
|
|
106
|
+
const body = {};
|
|
107
|
+
const enabled = onOff(context, "enabled");
|
|
108
|
+
const everyone = onOff(context, "everyone");
|
|
109
|
+
const name = flagString(parsed, "name")?.trim();
|
|
110
|
+
const description = flagString(parsed, "description");
|
|
111
|
+
const payloadFile = flagString(parsed, "payload-file");
|
|
112
|
+
if (name)
|
|
113
|
+
body.name = name;
|
|
114
|
+
if (enabled !== undefined)
|
|
115
|
+
body.enabled = enabled;
|
|
116
|
+
if (everyone !== undefined)
|
|
117
|
+
body.everyone = everyone;
|
|
118
|
+
if (description !== undefined)
|
|
119
|
+
body.description = description || null;
|
|
120
|
+
if (payloadFile !== undefined) {
|
|
121
|
+
body.payload =
|
|
122
|
+
payloadFile === "none"
|
|
123
|
+
? null
|
|
124
|
+
: await readJsonFile(payloadFile, "--payload-file");
|
|
125
|
+
}
|
|
126
|
+
if (!Object.keys(body).length) {
|
|
127
|
+
throw new CliError("invalid_arguments", "Pass at least one of --enabled, --everyone, --name, --description, --payload-file.");
|
|
128
|
+
}
|
|
129
|
+
const turningOnForEveryone = (body.everyone ?? flag.everyone) && (body.enabled ?? flag.enabled);
|
|
130
|
+
return writeCommand(parsed, {
|
|
131
|
+
action: "change a feature flag",
|
|
132
|
+
target: { key },
|
|
133
|
+
request: body,
|
|
134
|
+
details: {
|
|
135
|
+
current: current(flag),
|
|
136
|
+
consequences: [
|
|
137
|
+
turningOnForEveryone
|
|
138
|
+
? "On for EVERY user (and signed-out visitors) within ~15 seconds."
|
|
139
|
+
: "Takes effect for matching users within ~15 seconds.",
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
}, patch(body));
|
|
143
|
+
}
|
|
144
|
+
if (verb === "add" || verb === "remove") {
|
|
145
|
+
const { userIds, emails, roles } = targets(context);
|
|
146
|
+
const body = verb === "add"
|
|
147
|
+
? { addUserIds: userIds, addEmails: emails, addRoles: roles }
|
|
148
|
+
: { removeUserIds: userIds, removeEmails: emails, removeRoles: roles };
|
|
149
|
+
return writeCommand(parsed, {
|
|
150
|
+
action: verb === "add"
|
|
151
|
+
? "turn a feature flag on for these users, emails or roles"
|
|
152
|
+
: "stop targeting these users, emails or roles with a feature flag",
|
|
153
|
+
target: { key },
|
|
154
|
+
request: body,
|
|
155
|
+
details: {
|
|
156
|
+
current: current(flag),
|
|
157
|
+
consequences: [
|
|
158
|
+
flag.enabled
|
|
159
|
+
? "The flag is enabled, so this takes effect within ~15 seconds."
|
|
160
|
+
: "The flag is disabled: nothing changes for anyone until `flags set --enabled on`.",
|
|
161
|
+
...(flag.everyone
|
|
162
|
+
? [
|
|
163
|
+
"The flag is on for everyone, so targeting lists don't matter while it stays that way.",
|
|
164
|
+
]
|
|
165
|
+
: []),
|
|
166
|
+
],
|
|
167
|
+
reverse: `\`flags ${verb === "add" ? "remove" : "add"} ${key} …\` with the same targets`,
|
|
168
|
+
},
|
|
169
|
+
}, patch(body));
|
|
170
|
+
}
|
|
171
|
+
return writeCommand(parsed, {
|
|
172
|
+
action: "delete a feature flag",
|
|
173
|
+
target: { key },
|
|
174
|
+
request: {},
|
|
175
|
+
details: {
|
|
176
|
+
current: current(flag),
|
|
177
|
+
consequences: [
|
|
178
|
+
"Code reading this key sees it as unknown (off) everywhere; the targeting lists are gone.",
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
}, async () => unwrap(await api.client.DELETE("/admin/feature-flags/{key}", {
|
|
182
|
+
params: { path: { key } },
|
|
183
|
+
})));
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=flags.js.map
|
package/dist/help.js
CHANGED
|
@@ -79,7 +79,8 @@ Usage:
|
|
|
79
79
|
recess [--json] students upload-map-scores --student <kid-id>
|
|
80
80
|
--file </path/to/map-report.pdf> [--confirm]
|
|
81
81
|
recess [--json] students issue-email --student <kid-id> [--confirm]
|
|
82
|
-
recess [--json] students goblins --student <kid-id> [--course <slug>] [--
|
|
82
|
+
recess [--json] students goblins --student <kid-id> [--course <slug>] [--search TEXT]
|
|
83
|
+
[--confirm]
|
|
83
84
|
recess [--json] students web-todos --student <kid-id> [--on|--off] [--confirm]
|
|
84
85
|
recess [--json] students flashcards --student <kid-id> [--on|--off] [--confirm]
|
|
85
86
|
recess [--json] students notes add --student <kid-id> --text TEXT [--confirm]
|
|
@@ -203,6 +204,8 @@ Usage:
|
|
|
203
204
|
recess [--json] family set-phone --phone <+E.164> [--confirm]
|
|
204
205
|
recess [--json] family set-timezone --timezone <IANA-zone> [--confirm]
|
|
205
206
|
recess [--json] family guardians
|
|
207
|
+
recess [--json] family changes [--student <kid>]
|
|
208
|
+
recess [--json] family undo [--change <change-id>] [--confirm]
|
|
206
209
|
recess [--json] family school-classes
|
|
207
210
|
recess [--json] family school-class-options --student <kid>
|
|
208
211
|
recess [--json] family drop-class --student <kid> --cohort <cohort-id> [--confirm]
|
|
@@ -210,6 +213,28 @@ Usage:
|
|
|
210
213
|
recess [--json] family swap-class --student <kid> --from <cohort-id>
|
|
211
214
|
--to <cohort-id-or-none> [--confirm]
|
|
212
215
|
recess [--json] family register-class --student <kid> --cohort <cohort-id> [--confirm]
|
|
216
|
+
recess [--json] family remind --at "YYYY-MM-DD HH:mm" --body TEXT [--student <kid>] [--confirm]
|
|
217
|
+
recess [--json] family reminders
|
|
218
|
+
recess [--json] family cancel-reminder --reminder <reminder-id> [--confirm]
|
|
219
|
+
recess [--json] family config
|
|
220
|
+
recess [--json] family set --path <path> --value <value> [--confirm]
|
|
221
|
+
recess [--json] family feedback --kind wrong|too-much|wanted|loved|cant-do|other --quote TEXT
|
|
222
|
+
[--about TEXT] [--student <kid>] [--confirm]
|
|
223
|
+
recess [--json] family pause --student <kid> --weeks N [--enrollment <enrollment-id>] [--confirm]
|
|
224
|
+
recess [--json] family add-guardian --first-name TEXT [--last-name TEXT] --email EMAIL [--confirm]
|
|
225
|
+
recess [--json] family billing
|
|
226
|
+
recess [--json] family billing-link
|
|
227
|
+
recess [--json] family calendar
|
|
228
|
+
recess [--json] family login-link [--confirm]
|
|
229
|
+
recess [--json] family context [--student <kid>]
|
|
230
|
+
recess [--json] family memory [--query TEXT] [--date YYYY-MM-DD]
|
|
231
|
+
recess [--json] family memory save --text TEXT [--in journal|family|me] [--confirm]
|
|
232
|
+
recess [--json] family memory rewrite --in family|me --text TEXT [--confirm]
|
|
233
|
+
recess [--json] family memory forget --in journal|family|me --line TEXT
|
|
234
|
+
[--date YYYY-MM-DD] [--confirm]
|
|
235
|
+
recess [--json] family message-guide --text TEXT [--student <kid>] [--confirm]
|
|
236
|
+
recess [--json] family report-bug --text TEXT [--summary TEXT] [--student <kid>]
|
|
237
|
+
[--todo <todo-id>] [--confirm]
|
|
213
238
|
recess [--json] kid today --student <kid> [--date YYYY-MM-DD]
|
|
214
239
|
recess [--json] kid goals --student <kid>
|
|
215
240
|
recess [--json] kid xp --student <kid> [--range week|month|quarter|year]
|
|
@@ -234,7 +259,8 @@ Usage:
|
|
|
234
259
|
recess [--json] kid edit-login --student <kid> --login <login-id> [--platform TEXT]
|
|
235
260
|
[--url <site-url>] [--username TEXT] [--password TEXT] [--notes TEXT] [--confirm]
|
|
236
261
|
recess [--json] kid remove-login --student <kid> --login <login-id> [--confirm]
|
|
237
|
-
recess [--json] kid excuse --student <kid> --event <event-id> [--note TEXT] [--confirm]
|
|
262
|
+
recess [--json] kid excuse --student <kid> --event <event-id> [--note TEXT] [--weekly] [--confirm]
|
|
263
|
+
recess [--json] kid unexcuse-weekly --student <kid> --event <event-id> [--confirm]
|
|
238
264
|
recess [--json] kid cowork --student <kid>
|
|
239
265
|
recess [--json] kid switch-cowork --student <kid> --to <cohort-id> [--confirm]
|
|
240
266
|
recess [--json] kid friends --student <kid>
|
|
@@ -246,11 +272,63 @@ Usage:
|
|
|
246
272
|
recess [--json] kid goal-note --student <kid> --goal <goal-id>
|
|
247
273
|
recess [--json] kid set-goal-note --student <kid> --goal <goal-id>
|
|
248
274
|
(--note TEXT | --clear) [--confirm]
|
|
249
|
-
recess [--json] kid add-todo --student <kid> --title TEXT [--due-date YYYY-MM-DD]
|
|
275
|
+
recess [--json] kid add-todo --student <kid> --title TEXT [--due-date YYYY-MM-DD (defaults to today)]
|
|
250
276
|
[--url URL] [--minutes N] [--confirm]
|
|
251
277
|
recess [--json] kid todo --student <kid> --todo <todo-id>
|
|
252
278
|
recess [--json] kid move-todo --student <kid> --todo <todo-id> --due-date YYYY-MM-DD [--confirm]
|
|
253
279
|
recess [--json] kid end-session --student <kid> --todo <todo-id> [--confirm]
|
|
280
|
+
recess [--json] kid remove-todo --student <kid> --todo <todo-id> [--allow-started] [--confirm]
|
|
281
|
+
recess [--json] kid edit-todo --student <kid> --todo <todo-id> [--title TEXT] [--minutes N]
|
|
282
|
+
[--url URL] [--confirm]
|
|
283
|
+
recess [--json] kid join-challenge --student <kid> --challenge <template-id> [--answers JSON]
|
|
284
|
+
[--confirm]
|
|
285
|
+
recess [--json] kid leave-challenge --student <kid> --goal <goal-id> [--confirm]
|
|
286
|
+
recess [--json] kid set-goal-games --student <kid> --goal <goal-id> --value on|off [--confirm]
|
|
287
|
+
recess [--json] kid set-goal-required --student <kid> --goal <goal-id> --value on|off [--confirm]
|
|
288
|
+
recess [--json] kid set-goal-days --student <kid> --goal <goal-id>
|
|
289
|
+
--days <"Tue, Thu"|Mon-Fri|weekdays|daily> [--confirm]
|
|
290
|
+
recess [--json] kid help --student <kid> [--date YYYY-MM-DD]
|
|
291
|
+
recess [--json] kid help-done --student <kid> --item <help-item-id> [--date YYYY-MM-DD] [--confirm]
|
|
292
|
+
recess [--json] kid excuse-days --student <kid> --from YYYY-MM-DD [--to YYYY-MM-DD]
|
|
293
|
+
--reason SICK|VACATION|PAUSE|OTHER [--note TEXT] [--confirm]
|
|
294
|
+
recess [--json] kid excused-days --student <kid> [--from YYYY-MM-DD] [--to YYYY-MM-DD]
|
|
295
|
+
recess [--json] kid unexcuse-days --student <kid> --from YYYY-MM-DD [--to YYYY-MM-DD] [--confirm]
|
|
296
|
+
recess [--json] kid moments --student <kid> [--since YYYY-MM-DD]
|
|
297
|
+
recess [--json] kid config --student <kid>
|
|
298
|
+
recess [--json] kid set --student <kid> --path <path> --value <value> [--confirm]
|
|
299
|
+
recess [--json] kid repeat-todo --student <kid> --title TEXT --days <weekdays|daily|Mon,Wed,Fri>
|
|
300
|
+
[--weeks N] [--start YYYY-MM-DD] [--minutes N] [--url URL] [--confirm]
|
|
301
|
+
recess [--json] kid complete-challenge --student <kid> --goal <goal-id> [--confirm]
|
|
302
|
+
recess [--json] kid set-todo-reward --student <kid> --todo <todo-id> [--xp N] [--coins N]
|
|
303
|
+
--reason TEXT [--confirm]
|
|
304
|
+
recess [--json] kid progress --student <kid>
|
|
305
|
+
recess [--json] kid schedule --student <kid> [--days 1-31]
|
|
306
|
+
recess [--json] kid attendance --student <kid> [--days 1-60]
|
|
307
|
+
recess [--json] kid browse-challenges --student <kid> [--query TEXT]
|
|
308
|
+
recess [--json] kid sign-in-code --student <kid> [--confirm]
|
|
309
|
+
recess [--json] kid todos --student <kid> [--date YYYY-MM-DD] [--from YYYY-MM-DD]
|
|
310
|
+
[--to YYYY-MM-DD] [--completed-since YYYY-MM-DD] [--status TEXT] [--subject TEXT]
|
|
311
|
+
[--search TEXT] [--goal <goal-id>] [--limit 1-100]
|
|
312
|
+
recess [--json] kid goal --student <kid> --goal <goal-id>
|
|
313
|
+
recess [--json] kid conversations --student <kid> [--query TEXT] [--from YYYY-MM-DD]
|
|
314
|
+
[--to YYYY-MM-DD] [--limit 1-10]
|
|
315
|
+
recess [--json] kid social --student <kid> [--view overview|friends|activity]
|
|
316
|
+
[--section TEXT] [--days 1-90]
|
|
317
|
+
recess [--json] kid enrollments --student <kid>
|
|
318
|
+
recess [--json] kid math-progress --student <kid> [--view overview|activity]
|
|
319
|
+
[--since YYYY-MM-DD]
|
|
320
|
+
recess [--json] kid memory ls|cat|grep --student <kid> [--path TEXT] [--pattern TEXT]
|
|
321
|
+
recess [--json] kid observe --student <kid> --note TEXT [--confirm]
|
|
322
|
+
recess [--json] kid send-note --student <kid> --note TEXT [--confirm]
|
|
323
|
+
recess [--json] me today [--date YYYY-MM-DD]
|
|
324
|
+
recess [--json] me goals
|
|
325
|
+
recess [--json] me add-todo --title TEXT [--due-date YYYY-MM-DD] [--minutes N] [--url URL] [--confirm]
|
|
326
|
+
recess [--json] me remove-todo --todo <todo-id> [--confirm]
|
|
327
|
+
recess [--json] me repeat-todo --title TEXT --days <weekdays|daily|Mon,Wed,Fri>
|
|
328
|
+
[--weeks N] [--start YYYY-MM-DD] [--minutes N] [--url URL] [--confirm]
|
|
329
|
+
recess [--json] me browse-challenges [--query TEXT]
|
|
330
|
+
recess [--json] me join-challenge --challenge <template-id> [--answers JSON] [--confirm]
|
|
331
|
+
recess [--json] me leave-challenge --goal <goal-id> [--confirm]
|
|
254
332
|
recess [--json] channels list [<query>...] [--type <channel-type>] [--audience KID|PARENT]
|
|
255
333
|
[--status ACTIVE|HIDDEN|ARCHIVED] [--limit 1..200]
|
|
256
334
|
recess [--json] channels create --name TEXT [--type <channel-type>]
|
|
@@ -614,6 +692,15 @@ Usage:
|
|
|
614
692
|
recess [--json] rocky free set-budget --student <user-id> (--budget <usd> | --default)
|
|
615
693
|
[--confirm]
|
|
616
694
|
recess [--json] rocky free revoke --student <user-id> [--confirm]
|
|
695
|
+
recess [--json] flags list
|
|
696
|
+
recess [--json] flags get <key>
|
|
697
|
+
recess [--json] flags create <key> [--name TEXT] [--description TEXT] [--confirm]
|
|
698
|
+
recess [--json] flags set <key> [--enabled on|off] [--everyone on|off] [--name TEXT]
|
|
699
|
+
[--description TEXT] [--payload-file <path.json|none>] [--confirm]
|
|
700
|
+
recess [--json] flags add <key> [--user <id,...>] [--email <email,...>] [--role <ROLE,...>] [--confirm]
|
|
701
|
+
recess [--json] flags remove <key> [--user <id,...>] [--email <email,...>] [--role <ROLE,...>]
|
|
702
|
+
[--confirm]
|
|
703
|
+
recess [--json] flags delete <key> [--confirm]
|
|
617
704
|
recess [--json] tutor-templates list [--q TEXT] [--subject TEXT] [--grade N]
|
|
618
705
|
recess [--json] tutor-templates get <slug>
|
|
619
706
|
recess [--json] tutor-templates assign <slug> [--student <kid-id>] [--confirm]
|
|
@@ -805,7 +892,11 @@ usa-algebra-2 or pre-calculus; without it the kid's profile grade picks one. A
|
|
|
805
892
|
new kid takes a Goblins seat and keeps it. status eligible means a todo whose
|
|
806
893
|
url is https://app.goblins.com/?skill=<topic> signs them straight into problems
|
|
807
894
|
on that topic; unlicensed means no seat is free yet (rerun later). Never paste a
|
|
808
|
-
/handoff/ link into a todo: it works once and expires.
|
|
895
|
+
/handoff/ link into a todo: it works once and expires. --search TEXT only reads:
|
|
896
|
+
it lists Goblins problems (id and text) for a topic. To hand-pick a ramp, add
|
|
897
|
+
&problems=<id>,<id>,... to the todo url (todos create --url) and the kid gets
|
|
898
|
+
exactly those problems, in that order, e.g.
|
|
899
|
+
https://app.goblins.com/?skill=quadratic%20formula&problems=25867,25857,26068
|
|
809
900
|
|
|
810
901
|
Onboarding notes: "status" and "intake-session" are reads — "intake-session"
|
|
811
902
|
looks up the current IN_PROGRESS session without creating one (prints a "none
|
|
@@ -851,17 +942,28 @@ Family dashboard notes: "family" is a guardian's own parent dashboard: kids,
|
|
|
851
942
|
today, the family schedule, tutor, account and reminder settings, guardians, and
|
|
852
943
|
school classes (drop/restore/swap/register). --student takes one of your kids'
|
|
853
944
|
ids, full name, or a unique first name; ambiguous or unknown names list your
|
|
854
|
-
kids.
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
945
|
+
kids. Undoable writes apply at once (undo: family undo, or family undo
|
|
946
|
+
--change ID for an older one); the rest preview first, then need --confirm
|
|
947
|
+
after a human approves; messages to a person (family message-guide, kid
|
|
948
|
+
send-note) always do. "me" is your own to-dos and challenges, only when you
|
|
949
|
+
mean yourself. Dashboard-only, never
|
|
950
|
+
commands: removing a kid or a co-guardian, password/PIN, payment cards,
|
|
951
|
+
membership changes (pausing a weekly class is family pause), profile photo
|
|
952
|
+
and screen time. Send the guardian to https://recess.gg/settings (account, security,
|
|
858
953
|
guardians) or https://recess.gg/family?tab=billing (billing).
|
|
859
954
|
|
|
860
955
|
Kid dashboard notes: "kid" reads and manages one of your kids (--student takes
|
|
861
956
|
an id, full name, or unique first name): today, goals, XP, MAP scores, classes,
|
|
862
957
|
profile, the texts you get about them, live rooms, feed lock, saved site logins,
|
|
863
958
|
excusing an absence, the daily coworking pod, friends' parents, and pairing a
|
|
864
|
-
new device.
|
|
959
|
+
new device. Plan changes apply at once with no confirm step and are logged
|
|
960
|
+
(undo: family undo, or family undo --change ID): excuse, unexcuse-weekly,
|
|
961
|
+
goal-schedule, pause-goal, resume-goal, set-goal-note, add-todo, move-todo,
|
|
962
|
+
remove-todo, edit-todo, repeat-todo, join-challenge, set-goal-games,
|
|
963
|
+
set-goal-required, help-done, excuse-days, unexcuse-days, and "set" fields
|
|
964
|
+
that apply at once. --confirm on them changes nothing: a rerun with it returns
|
|
965
|
+
the first result (alreadyApplied) instead of applying twice. Every other write
|
|
966
|
+
previews first, then needs --confirm. Passwords are
|
|
865
967
|
never echoed in previews (redacted plus a sha256 prefix); "kid reveal-login" is
|
|
866
968
|
an audited read. --interests replaces the whole list. The daily summary is opt-in
|
|
867
969
|
per kid and shared by every guardian: "kid set-texts --summary true|false" turns
|
|
@@ -877,7 +979,7 @@ judged routine. Neither caps texts at one a day; the daily todo nudge and
|
|
|
877
979
|
recaps ignore it. --enabled false is the only way to stop every text about a
|
|
878
980
|
kid. Plan controls (any guardian): a goal's cadence ("goal-schedule": daily,
|
|
879
981
|
weekly, Mon,Wed,Fri or 3x/week), pausing/resuming a goal, the goal's note
|
|
880
|
-
("set-goal-note"), one-off todos ("add-todo"; no bonus/optional kind exists),
|
|
982
|
+
("set-goal-note"), one-off todos ("add-todo"; due today in the kid's timezone unless --due-date; no bonus/optional kind exists),
|
|
881
983
|
moving a not-started todo ("move-todo"), and ending a stuck session so started
|
|
882
984
|
work can be removed ("end-session"; never completes it or awards XP). The goal note
|
|
883
985
|
is how a parent changes how Rocky behaves on that goal ("ask fewer follow-ups",
|
|
@@ -1236,6 +1338,27 @@ export const COMMAND_SUMMARIES = {
|
|
|
1236
1338
|
"family set-phone": "Change your own phone number.",
|
|
1237
1339
|
"family set-timezone": "Set the whole family's timezone.",
|
|
1238
1340
|
"family guardians": "List the guardians in your family.",
|
|
1341
|
+
"family changes": "Recent changes for your family (anyone, any channel), with undo ids.",
|
|
1342
|
+
"family undo": "Undo one change from family changes, or your latest (at once).",
|
|
1343
|
+
"family billing": "Subscriptions, next charges, failed payments, plans, what can pause.",
|
|
1344
|
+
"family billing-link": "The billing page link (cards, plan, receipts).",
|
|
1345
|
+
"family calendar": "School-wide days off ahead this school year.",
|
|
1346
|
+
"family login-link": "Email yourself a fresh sign-in link and code (at once; not a change).",
|
|
1347
|
+
"family context": "Who's on the account: family, each kid's tutor and guide, school tier.",
|
|
1348
|
+
"family memory": "What Rocky remembers about the family: family, yours, recent journal, --query.",
|
|
1349
|
+
"family memory save": "Save one line to Rocky's family notes, with your name (at once).",
|
|
1350
|
+
"family memory rewrite": "Replace family.md or your own notes whole, tidied (at once).",
|
|
1351
|
+
"family memory forget": "Forget one exact line of the family notes (at once).",
|
|
1352
|
+
"family message-guide": "Message your kid's guide (Slack + the app chat); the person for anything.",
|
|
1353
|
+
"family report-bug": "Report something broken in Recess to the team (at once; not a change).",
|
|
1354
|
+
"family remind": "Have Rocky text you a reminder (applies at once).",
|
|
1355
|
+
"family reminders": "Your upcoming text-me reminders.",
|
|
1356
|
+
"family cancel-reminder": "Cancel an upcoming reminder (applies at once).",
|
|
1357
|
+
"family config": "The family's settings, one line each, with paths.",
|
|
1358
|
+
"family set": "Change one family setting by path (at once, or confirm when marked).",
|
|
1359
|
+
"family feedback": "Pass on what you think of Rocky's texts or abilities (at once; not a change).",
|
|
1360
|
+
"family pause": "Pause a kid's weekly class billing 1-6 weeks from Sunday (family undo resumes).",
|
|
1361
|
+
"family add-guardian": "Add a co-guardian with full parent access; they get an invite email.",
|
|
1239
1362
|
"family school-classes": "Your kids' school classes, slots, queued switches.",
|
|
1240
1363
|
"family school-class-options": "Classes a kid can switch to or join.",
|
|
1241
1364
|
"family drop-class": "Drop a kid's school class (at period end).",
|
|
@@ -1259,7 +1382,8 @@ export const COMMAND_SUMMARIES = {
|
|
|
1259
1382
|
"kid add-login": "Save a site login for a kid.",
|
|
1260
1383
|
"kid edit-login": "Edit a kid's saved site login.",
|
|
1261
1384
|
"kid remove-login": "Delete a kid's saved site login.",
|
|
1262
|
-
"kid excuse": "Excuse a
|
|
1385
|
+
"kid excuse": "Excuse a class session, upcoming or up to 14 days back; --weekly: that weekday every week (at once).",
|
|
1386
|
+
"kid unexcuse-weekly": "Stop a standing weekly class excuse for that class's weekday (at once).",
|
|
1263
1387
|
"kid cowork": "A kid's daily coworking pod and the options.",
|
|
1264
1388
|
"kid switch-cowork": "Move a kid to another coworking pod.",
|
|
1265
1389
|
"kid friends": "A kid's friends and their parents.",
|
|
@@ -1270,10 +1394,51 @@ export const COMMAND_SUMMARIES = {
|
|
|
1270
1394
|
"kid resume-goal": "Resume a paused goal.",
|
|
1271
1395
|
"kid goal-note": "Read the note that steers how Rocky works a goal.",
|
|
1272
1396
|
"kid set-goal-note": "Change how Rocky works a goal: replace or clear its note.",
|
|
1273
|
-
"kid add-todo": "Add a one-off todo for a kid.",
|
|
1397
|
+
"kid add-todo": "Add a one-off todo for a kid (due today unless --due-date).",
|
|
1274
1398
|
"kid todo": "One todo: status, due day, live session.",
|
|
1275
1399
|
"kid move-todo": "Move a not-started todo to another day.",
|
|
1276
1400
|
"kid end-session": "End a stuck todo session (no XP, not completed).",
|
|
1401
|
+
"kid remove-todo": "Remove a kid's todo (applies at once; family undo).",
|
|
1402
|
+
"kid edit-todo": "Rename, re-time or re-link a not-started todo (applies at once).",
|
|
1403
|
+
"kid join-challenge": "Join a kid to a challenge from the library (applies at once).",
|
|
1404
|
+
"kid leave-challenge": "Take a kid off a challenge; progress is kept.",
|
|
1405
|
+
"kid set-goal-games": "Practice games on/off after one challenge's lessons (at once).",
|
|
1406
|
+
"kid set-goal-required": "Whether a kid may drop one challenge themselves (at once).",
|
|
1407
|
+
"kid help": "The day's ways to help (from the daily summary).",
|
|
1408
|
+
"kid help-done": "Mark a help item done; the kid's Rocky hears (at once).",
|
|
1409
|
+
"kid excuse-days": "Give a kid days off; their todos move (at once).",
|
|
1410
|
+
"kid excused-days": "A kid's days off (sick, vacation, pause).",
|
|
1411
|
+
"kid unexcuse-days": "Make days off regular school days again (at once).",
|
|
1412
|
+
"kid moments": "A kid's recent moments (clips) with share links.",
|
|
1413
|
+
"kid config": "Every setting for a kid, one line each, with paths.",
|
|
1414
|
+
"kid set": "Change one kid setting by path (at once, or confirm when marked).",
|
|
1415
|
+
"kid repeat-todo": "Put a to-do on a kid's list on chosen weekdays for 1-4 weeks (at once).",
|
|
1416
|
+
"kid complete-challenge": "Mark a kid's challenge finished: no coins or badge (family undo reopens).",
|
|
1417
|
+
"kid set-todo-reward": "Set a to-do's XP and/or coins to new totals (family undo reverses).",
|
|
1418
|
+
"kid progress": "A kid's on-track progress per subject from the skill map.",
|
|
1419
|
+
"kid schedule": "A kid's upcoming class sessions in your timezone, with event ids and plan.",
|
|
1420
|
+
"kid attendance": "A kid's recent class sessions: attended, missed, excused.",
|
|
1421
|
+
"kid browse-challenges": "Library challenges a kid can join here (picked for them, or --query).",
|
|
1422
|
+
"kid sign-in-code": "The app link and a one-time sign-in code for a kid (at once; not a change).",
|
|
1423
|
+
"kid todos": "A kid's to-dos over any window, with status, XP and how each went.",
|
|
1424
|
+
"kid goal": "One of a kid's challenges in full.",
|
|
1425
|
+
"kid conversations": "Search or browse a kid's chats with Rocky (short excerpts).",
|
|
1426
|
+
"kid social": "A kid's friends, events, comments, chat counts, safety (view only).",
|
|
1427
|
+
"kid enrollments": "A kid's active enrollments: plan, price, pauses.",
|
|
1428
|
+
"kid math-progress": "A kid's Math Academy course, progress and activity.",
|
|
1429
|
+
"kid memory ls": "List the files in what Rocky knows about a kid.",
|
|
1430
|
+
"kid memory cat": "Read one file of what Rocky knows about a kid.",
|
|
1431
|
+
"kid memory grep": "Find lines in what Rocky knows about a kid.",
|
|
1432
|
+
"kid observe": "Tell a kid's Rocky something about them (at once; logged, no undo).",
|
|
1433
|
+
"kid send-note": "A note Rocky passes the kid next session, in his words (needs YES).",
|
|
1434
|
+
"me today": "Your OWN to-dos for a day (only about your own learning).",
|
|
1435
|
+
"me goals": "Your own challenges.",
|
|
1436
|
+
"me add-todo": "Add a to-do to your own list (at once; family undo).",
|
|
1437
|
+
"me remove-todo": "Remove a to-do from your own list (at once; family undo).",
|
|
1438
|
+
"me repeat-todo": "Put a to-do on your own list on chosen weekdays for 1-4 weeks (at once).",
|
|
1439
|
+
"me browse-challenges": "Library challenges you can join yourself.",
|
|
1440
|
+
"me join-challenge": "Join a challenge yourself (at once; family undo).",
|
|
1441
|
+
"me leave-challenge": "Leave one of your own challenges; progress is kept.",
|
|
1277
1442
|
"channels list": "List community channels with filters.",
|
|
1278
1443
|
"channels create": "Create a community channel.",
|
|
1279
1444
|
"channels set-image": "Set or clear a channel's image.",
|
|
@@ -1478,6 +1643,13 @@ export const COMMAND_SUMMARIES = {
|
|
|
1478
1643
|
"rocky free grant": "Grant free Rocky to a kid or guardian.",
|
|
1479
1644
|
"rocky free set-budget": "Change a free Rocky grant's weekly budget.",
|
|
1480
1645
|
"rocky free revoke": "Revoke a user's free Rocky grant.",
|
|
1646
|
+
"flags list": "List every feature flag with who it targets.",
|
|
1647
|
+
"flags get": "Read one feature flag: status, targets, payload.",
|
|
1648
|
+
"flags create": "Create a feature flag (off, targeting no one).",
|
|
1649
|
+
"flags set": "Turn a flag on/off, on for everyone, or change its description or payload.",
|
|
1650
|
+
"flags add": "Turn a flag on for more users, emails or roles.",
|
|
1651
|
+
"flags remove": "Stop targeting users, emails or roles with a flag.",
|
|
1652
|
+
"flags delete": "Delete a feature flag.",
|
|
1481
1653
|
"tutor-templates list": "List tutor templates.",
|
|
1482
1654
|
"tutor-templates get": "Read one tutor template.",
|
|
1483
1655
|
"tutor-templates assign": "Assign a tutor template to a kid.",
|
|
@@ -1544,6 +1716,7 @@ export const NOUN_SUMMARIES = {
|
|
|
1544
1716
|
families: "Bulk-set family mailing addresses.",
|
|
1545
1717
|
family: "Your parent dashboard: kids, schedule, account, school classes.",
|
|
1546
1718
|
kid: "One of your kids: today, goals, profile, texts, logins, pods.",
|
|
1719
|
+
me: "Your own to-dos and challenges (a parent learning too).",
|
|
1547
1720
|
channels: "Community channels and their members.",
|
|
1548
1721
|
"tuition-plans": "Compute tuition plan sheets (stores nothing).",
|
|
1549
1722
|
placement: "Give placement quests, one kid's results, results vs MAP, question bank, mastery sync.",
|
|
@@ -1564,6 +1737,7 @@ export const NOUN_SUMMARIES = {
|
|
|
1564
1737
|
todos: "Kids' todos: create, edit, complete, analysis, applets.",
|
|
1565
1738
|
memories: "Kid memory files and the context Rocky sees.",
|
|
1566
1739
|
rocky: "A kid's Rocky personality settings; free Rocky grants and budgets.",
|
|
1740
|
+
flags: "Feature flags: on/off, everyone, and who they target by user, email or role.",
|
|
1567
1741
|
"tutor-templates": "Tutor templates and their assignment to kids.",
|
|
1568
1742
|
"library-books": "Book library: search the web, add and delete books, read status, reader stages, tags.",
|
|
1569
1743
|
"math-curricula": "Math curricula and the goals a math review assigns (ADMIN, GUIDE).",
|
package/dist/jobs.js
CHANGED
|
@@ -59,6 +59,38 @@ export async function listJobs(limit = 20) {
|
|
|
59
59
|
total: jobs.length,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
/** Change-log ids a write's result reports (`change` or `changes`). */
|
|
63
|
+
function resultChangeIds(result) {
|
|
64
|
+
const r = result;
|
|
65
|
+
const changes = [r?.change, ...(Array.isArray(r?.changes) ? r.changes : [])];
|
|
66
|
+
return changes.flatMap((c) => {
|
|
67
|
+
const id = c?.id;
|
|
68
|
+
return typeof id === "string" ? [id] : [];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The newest completed immediate write of this intent since `sinceMs`, unless
|
|
73
|
+
* a later `family undo` undid it (then it may apply again).
|
|
74
|
+
*/
|
|
75
|
+
export async function findCompletedIntent(intent, sinceMs) {
|
|
76
|
+
const events = await readEvents();
|
|
77
|
+
const undone = new Set();
|
|
78
|
+
for (let i = events.length - 1; i >= 0; i--) {
|
|
79
|
+
const event = events[i];
|
|
80
|
+
if (Date.parse(event.timestamp) < sinceMs)
|
|
81
|
+
break;
|
|
82
|
+
if (event.status !== "completed")
|
|
83
|
+
continue;
|
|
84
|
+
if (event.undoneChangeId)
|
|
85
|
+
undone.add(event.undoneChangeId);
|
|
86
|
+
if (event.intent === intent) {
|
|
87
|
+
return resultChangeIds(event.result).some((id) => undone.has(id))
|
|
88
|
+
? null
|
|
89
|
+
: event;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
62
94
|
export async function getJob(jobId) {
|
|
63
95
|
const history = (await readEvents()).filter((event) => event.jobId === jobId);
|
|
64
96
|
return { job: foldJobs(history)[0] ?? null, history };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recess-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.35.0",
|
|
4
4
|
"description": "Safe Recess administration and family AI tools from the command line.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -42,16 +42,15 @@
|
|
|
42
42
|
"@types/react": "^19.2.18",
|
|
43
43
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
44
44
|
"esbuild": "^0.28.2",
|
|
45
|
-
"openapi-typescript": "^7.8.0",
|
|
46
45
|
"oxlint": "^1.28.0",
|
|
47
46
|
"oxlint-tsgolint": "^0.6.0",
|
|
48
47
|
"typescript": "^5.9.2",
|
|
49
48
|
"vitest": "^1.6.0",
|
|
49
|
+
"@tryrecess/api-types": "0.0.0",
|
|
50
50
|
"@tryrecess/typescript-config": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "node node_modules/@tryrecess/typescript-config/bin/tsc-fast.mjs",
|
|
54
|
-
"client:generate": "node scripts/generate-api-types.mjs",
|
|
55
54
|
"typecheck": "node node_modules/@tryrecess/typescript-config/bin/tsc-fast.mjs --noEmit",
|
|
56
55
|
"format": "oxfmt --ignore-path .oxfmtignore --check",
|
|
57
56
|
"format:fix": "oxfmt --ignore-path .oxfmtignore",
|