recess-cli 3.29.0 → 3.36.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 CHANGED
@@ -58,7 +58,7 @@ From the monolith root:
58
58
 
59
59
  ```bash
60
60
  pnpm install
61
- pnpm --dir apps/admin-cli run client:generate
61
+ pnpm client:generate
62
62
  pnpm --dir apps/admin-cli run install-persistent
63
63
  ```
64
64
 
package/dist/args.js CHANGED
@@ -36,6 +36,7 @@ export const BOOLEAN_FLAGS = new Set([
36
36
  "allow-assigned-edits",
37
37
  "allow-billing",
38
38
  "allow-possible-duplicate",
39
+ "allow-started",
39
40
  "allow-state-modification",
40
41
  "allow-strand",
41
42
  "analyzed",
@@ -92,6 +93,7 @@ export const BOOLEAN_FLAGS = new Set([
92
93
  "unlink",
93
94
  "visual-only",
94
95
  "wait",
96
+ "weekly",
95
97
  "whole-family",
96
98
  "zero-balance",
97
99
  ]);
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ import { runRoomsCommand } from "./commands/rooms.js";
21
21
  import { runDmsCommand } from "./commands/dms.js";
22
22
  import { runFeedCommand } from "./commands/feed.js";
23
23
  import { runFamiliesCommand } from "./commands/families.js";
24
- import { runFamilyCommand, runKidCommand } from "./commands/family.js";
24
+ import { runFamilyCommand, runKidCommand, runMeCommand, } from "./commands/family.js";
25
25
  import { runStudentsTextsCommand, runUsersPhoneCommand, } from "./commands/phone-and-texts.js";
26
26
  import { hasCommunityHour, runUsersCommunityHourCommand, } from "./commands/community-hour.js";
27
27
  import { runTuitionPlansCommand } from "./commands/tuition-plans.js";
@@ -47,7 +47,7 @@ import { ensureFreshSession, revokeSession } from "./session-refresh.js";
47
47
  import { compareVersions, updateSkillFromServer } from "./skill-update.js";
48
48
  import { readSkillCache, writeSkillCache } from "./skills-cache.js";
49
49
  import { sanitizeWorkspaceUploadName } from "./upload-names.js";
50
- import { appendJobEvent, getJob, listJobs, pruneJobs } from "./jobs.js";
50
+ import { appendJobEvent, findCompletedIntent, getJob, listJobs, pruneJobs, } from "./jobs.js";
51
51
  import { applyStudentsToAnswers, buildAnswersTemplate, buildGoalWorkspaceScaffold, resolveStudentReference, serverWorkspaceValidation, specValidationErrorLines, validateGoalWorkspaceLocally, } from "./goal-authoring.js";
52
52
  const localInvocations = new WeakMap();
53
53
  /** Never replayed from the ledger: they are what `recess confirm` supplies. */
@@ -350,6 +350,8 @@ async function skillStatus(config, reason) {
350
350
  };
351
351
  }
352
352
  }
353
+ /** How long an immediate write rerun with --confirm returns its first result. */
354
+ const IMMEDIATE_CONFIRM_DEDUPE_MS = 12 * 60 * 60 * 1000;
353
355
  const CONFIRM_RETRY_HINT = "Rerun the unchanged command with --confirm --operation-key <operationKey>. Reuse that same key after an interrupted invocation. Previewing again is harmless: it mints another key that is equally valid, because keys are bound to the payload rather than to one preview run.";
354
356
  function confirmNextHint(parsed, operationKey) {
355
357
  return localInvocations.has(parsed)
@@ -389,7 +391,25 @@ async function localWriteCommand(parsed, preview, execute, options = {}) {
389
391
  });
390
392
  requireConfirmation(false, boundPreview);
391
393
  }
392
- if (options.ungated && !suppliedOperationKey) {
394
+ // An immediate write has no confirm step. Agents often rerun it with
395
+ // --confirm after a human says yes; return the earlier result, never apply
396
+ // the same write twice.
397
+ const intent = options.ungated
398
+ ? createHash("sha256")
399
+ .update(JSON.stringify([preview.action, preview.target, preview.request]))
400
+ .digest("hex")
401
+ : undefined;
402
+ if (intent && !suppliedOperationKey) {
403
+ if (hasFlag(parsed, "confirm")) {
404
+ const prior = await findCompletedIntent(intent, Date.now() - IMMEDIATE_CONFIRM_DEDUPE_MS);
405
+ if (prior) {
406
+ return (prior.result &&
407
+ typeof prior.result === "object" &&
408
+ !Array.isArray(prior.result)
409
+ ? { ...prior.result, alreadyApplied: true }
410
+ : prior.result);
411
+ }
412
+ }
393
413
  suppliedOperationKey = operationKeyFor(fingerprint);
394
414
  }
395
415
  if (!suppliedOperationKey) {
@@ -414,6 +434,10 @@ async function localWriteCommand(parsed, preview, execute, options = {}) {
414
434
  fingerprint,
415
435
  target: preview.target,
416
436
  result,
437
+ ...(intent ? { intent } : {}),
438
+ ...(options.undoneChange?.(result)
439
+ ? { undoneChangeId: options.undoneChange(result) }
440
+ : {}),
417
441
  });
418
442
  return result;
419
443
  }
@@ -6045,6 +6069,9 @@ export async function executeRecessCommand(argv, options = {}) {
6045
6069
  if (noun === "kid") {
6046
6070
  return runKidCommand({ parsed, api, writeCommand });
6047
6071
  }
6072
+ if (noun === "me") {
6073
+ return runMeCommand({ parsed, api, writeCommand });
6074
+ }
6048
6075
  if (noun === "chat-logs") {
6049
6076
  return runChatLogsCommand({ parsed, api, writeCommand });
6050
6077
  }
@@ -6237,6 +6264,12 @@ export async function executeRecessCommand(argv, options = {}) {
6237
6264
  }
6238
6265
  if (verb === "goblins") {
6239
6266
  const studentId = flagString(parsed, "student", { required: true });
6267
+ const search = flagString(parsed, "search");
6268
+ if (search) {
6269
+ return unwrap(await api.client.GET("/admin/browser/students/{userId}/goblins/problems/", {
6270
+ params: { path: { userId: studentId }, query: { q: search } },
6271
+ }));
6272
+ }
6240
6273
  const course = flagString(parsed, "course");
6241
6274
  if (course && !GOBLINS_COURSES.includes(course)) {
6242
6275
  throw new CliError("invalid_arguments", `--course must be one of ${GOBLINS_COURSES.join(", ")}.`);
@@ -26,57 +26,122 @@ export const RECESS_MCP_SCOPES = {
26
26
  familyWrite: "recess:family:write",
27
27
  };
28
28
  /** Parent-dashboard reads/writes parent Rocky runs in-process over hosted transport. */
29
- const FAMILY_REMOTE_READS = [
29
+ export const FAMILY_REMOTE_READS = [
30
30
  "family account",
31
+ "family billing",
32
+ "family billing-link",
33
+ "family calendar",
34
+ "family changes",
35
+ "family config",
31
36
  "family guardians",
32
37
  "family kids",
38
+ "family reminders",
33
39
  "family schedule",
34
40
  "family school-class-options",
35
41
  "family school-classes",
36
42
  "family today",
37
43
  "family tutor",
38
44
  "kid classes",
45
+ "kid config",
39
46
  "kid cowork",
47
+ "kid excused-days",
40
48
  "kid feed-lock",
41
49
  "kid friends",
42
50
  "kid goal-note",
43
51
  "kid goals",
52
+ "kid help",
44
53
  "kid logins",
45
54
  "kid map-scores",
55
+ "kid moments",
46
56
  "kid profile",
47
57
  "kid reveal-login",
48
58
  "kid texts",
49
59
  "kid today",
50
60
  "kid todo",
51
61
  "kid xp",
62
+ "kid progress",
63
+ "kid schedule",
64
+ "kid attendance",
65
+ "kid browse-challenges",
66
+ "me today",
67
+ "me goals",
68
+ "me browse-challenges",
69
+ "family context",
70
+ "family memory",
71
+ "kid todos",
72
+ "kid goal",
73
+ "kid conversations",
74
+ "kid social",
75
+ "kid enrollments",
76
+ "kid math-progress",
77
+ "kid memory ls",
78
+ "kid memory cat",
79
+ "kid memory grep",
52
80
  ];
53
- const FAMILY_REMOTE_WRITES = [
81
+ export const FAMILY_REMOTE_WRITES = [
82
+ "family add-guardian",
83
+ "family cancel-reminder",
54
84
  "family drop-class",
85
+ "family feedback",
86
+ "family pause",
55
87
  "family register-class",
88
+ "family remind",
56
89
  "family restore-class",
90
+ "family set",
57
91
  "family set-name",
58
92
  "family set-notifications",
59
93
  "family set-phone",
60
94
  "family set-timezone",
61
95
  "family swap-class",
96
+ "family undo",
62
97
  "kid add-login",
63
98
  "kid add-todo",
99
+ "kid complete-challenge",
64
100
  "kid edit-login",
101
+ "kid edit-todo",
65
102
  "kid end-session",
66
103
  "kid excuse",
104
+ "kid excuse-days",
67
105
  "kid friend-parent",
68
106
  "kid goal-schedule",
107
+ "kid help-done",
108
+ "kid join-challenge",
109
+ "kid leave-challenge",
69
110
  "kid move-todo",
70
111
  "kid pair-device",
71
112
  "kid pause-goal",
72
113
  "kid remove-login",
114
+ "kid remove-todo",
115
+ "kid repeat-todo",
73
116
  "kid resume-goal",
117
+ "kid set",
74
118
  "kid set-feed-lock",
119
+ "kid set-goal-games",
75
120
  "kid set-goal-note",
121
+ "kid set-goal-required",
122
+ "kid set-goal-coins",
123
+ "kid set-goal-days",
76
124
  "kid set-profile",
77
125
  "kid set-rooms",
78
126
  "kid set-texts",
127
+ "kid set-todo-reward",
79
128
  "kid switch-cowork",
129
+ "kid unexcuse-days",
130
+ "kid unexcuse-weekly",
131
+ "kid sign-in-code",
132
+ "family login-link",
133
+ "me add-todo",
134
+ "me remove-todo",
135
+ "me repeat-todo",
136
+ "me join-challenge",
137
+ "me leave-challenge",
138
+ "family memory save",
139
+ "family memory rewrite",
140
+ "family memory forget",
141
+ "family message-guide",
142
+ "family report-bug",
143
+ "kid observe",
144
+ "kid send-note",
80
145
  ];
81
146
  const REMOTE_COMMAND_SCOPES = new Map([
82
147
  ["goal-templates list", [RECESS_MCP_SCOPES.templatesRead]],
@@ -169,14 +234,27 @@ const AUTHENTICATED_COMMAND_PREFIXES = [
169
234
  */
170
235
  const FAMILY_COMMANDS = new Set([
171
236
  "family account",
237
+ "family billing",
238
+ "family billing-link",
239
+ "family calendar",
240
+ "family login-link",
241
+ "family add-guardian",
242
+ "family cancel-reminder",
243
+ "family changes",
244
+ "family config",
172
245
  "family drop-class",
246
+ "family feedback",
173
247
  "family guardians",
174
248
  "family kids",
249
+ "family pause",
175
250
  "family register-class",
251
+ "family remind",
252
+ "family reminders",
176
253
  "family restore-class",
177
254
  "family schedule",
178
255
  "family school-class-options",
179
256
  "family school-classes",
257
+ "family set",
180
258
  "family set-name",
181
259
  "family set-notifications",
182
260
  "family set-phone",
@@ -184,38 +262,90 @@ const FAMILY_COMMANDS = new Set([
184
262
  "family swap-class",
185
263
  "family today",
186
264
  "family tutor",
265
+ "family undo",
187
266
  "kid add-login",
188
267
  "kid add-todo",
189
268
  "kid classes",
269
+ "kid complete-challenge",
270
+ "kid config",
190
271
  "kid cowork",
191
272
  "kid edit-login",
273
+ "kid edit-todo",
192
274
  "kid end-session",
193
275
  "kid excuse",
276
+ "kid excuse-days",
277
+ "kid excused-days",
194
278
  "kid feed-lock",
195
279
  "kid friend-parent",
196
280
  "kid friends",
197
281
  "kid goal-note",
198
282
  "kid goal-schedule",
199
283
  "kid goals",
284
+ "kid help",
285
+ "kid help-done",
286
+ "kid join-challenge",
287
+ "kid leave-challenge",
200
288
  "kid logins",
201
289
  "kid map-scores",
290
+ "kid moments",
202
291
  "kid move-todo",
203
292
  "kid pair-device",
204
293
  "kid pause-goal",
205
294
  "kid profile",
206
295
  "kid remove-login",
296
+ "kid remove-todo",
297
+ "kid repeat-todo",
207
298
  "kid resume-goal",
208
299
  "kid reveal-login",
300
+ "kid set",
209
301
  "kid set-feed-lock",
302
+ "kid set-goal-games",
210
303
  "kid set-goal-note",
304
+ "kid set-goal-required",
305
+ "kid set-goal-coins",
306
+ "kid set-goal-days",
211
307
  "kid set-profile",
212
308
  "kid set-rooms",
213
309
  "kid set-texts",
310
+ "kid set-todo-reward",
214
311
  "kid switch-cowork",
215
312
  "kid texts",
216
313
  "kid today",
217
314
  "kid todo",
315
+ "kid unexcuse-days",
316
+ "kid unexcuse-weekly",
218
317
  "kid xp",
318
+ "kid progress",
319
+ "kid schedule",
320
+ "kid attendance",
321
+ "kid browse-challenges",
322
+ "kid sign-in-code",
323
+ "me today",
324
+ "me goals",
325
+ "me add-todo",
326
+ "me remove-todo",
327
+ "me repeat-todo",
328
+ "me browse-challenges",
329
+ "me join-challenge",
330
+ "me leave-challenge",
331
+ "family context",
332
+ "family memory",
333
+ "family memory save",
334
+ "family memory rewrite",
335
+ "family memory forget",
336
+ "family message-guide",
337
+ "family report-bug",
338
+ "kid todos",
339
+ "kid goal",
340
+ "kid conversations",
341
+ "kid social",
342
+ "kid enrollments",
343
+ "kid math-progress",
344
+ "kid memory ls",
345
+ "kid memory cat",
346
+ "kid memory grep",
347
+ "kid observe",
348
+ "kid send-note",
219
349
  "skills guardian get",
220
350
  "skills guardian list",
221
351
  ]);
@@ -328,6 +458,7 @@ const STAFF_COMMANDS = new Set([
328
458
  "rooms transcripts search",
329
459
  "cohorts schedule get",
330
460
  "cohorts schedule set",
461
+ "cohorts schedule realign",
331
462
  "cohorts schedule changes",
332
463
  "cohorts schedule change",
333
464
  "memories files",
@@ -708,7 +839,7 @@ const NOTE_LABEL_NOUNS = {
708
839
  "Class-ops": ["events"],
709
840
  Channel: ["channels"],
710
841
  "Family address": ["families"],
711
- "Family dashboard": ["family"],
842
+ "Family dashboard": ["family", "me"],
712
843
  "Kid dashboard": ["kid"],
713
844
  "Tuition-plan": ["tuition-plans"],
714
845
  Payout: ["payout"],