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 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";
@@ -30,6 +30,7 @@ import { runMasteryCommand } from "./commands/mastery.js";
30
30
  import { runOnboardingCommand } from "./commands/onboarding.js";
31
31
  import { runScheduleCommand, runMemoryFilesCommand, } from "./commands/safe-staff-operations.js";
32
32
  import { runPlacementCommand } from "./commands/placement.js";
33
+ import { runFlagsCommand } from "./commands/flags.js";
33
34
  import { runRockyFreeCommand } from "./commands/rocky-free.js";
34
35
  import { runSchoolCommand } from "./commands/school.js";
35
36
  import { runVillageEventsCommand } from "./commands/village-events.js";
@@ -46,7 +47,7 @@ import { ensureFreshSession, revokeSession } from "./session-refresh.js";
46
47
  import { compareVersions, updateSkillFromServer } from "./skill-update.js";
47
48
  import { readSkillCache, writeSkillCache } from "./skills-cache.js";
48
49
  import { sanitizeWorkspaceUploadName } from "./upload-names.js";
49
- import { appendJobEvent, getJob, listJobs, pruneJobs } from "./jobs.js";
50
+ import { appendJobEvent, findCompletedIntent, getJob, listJobs, pruneJobs, } from "./jobs.js";
50
51
  import { applyStudentsToAnswers, buildAnswersTemplate, buildGoalWorkspaceScaffold, resolveStudentReference, serverWorkspaceValidation, specValidationErrorLines, validateGoalWorkspaceLocally, } from "./goal-authoring.js";
51
52
  const localInvocations = new WeakMap();
52
53
  /** Never replayed from the ledger: they are what `recess confirm` supplies. */
@@ -349,6 +350,8 @@ async function skillStatus(config, reason) {
349
350
  };
350
351
  }
351
352
  }
353
+ /** How long an immediate write rerun with --confirm returns its first result. */
354
+ const IMMEDIATE_CONFIRM_DEDUPE_MS = 12 * 60 * 60 * 1000;
352
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.";
353
356
  function confirmNextHint(parsed, operationKey) {
354
357
  return localInvocations.has(parsed)
@@ -388,7 +391,25 @@ async function localWriteCommand(parsed, preview, execute, options = {}) {
388
391
  });
389
392
  requireConfirmation(false, boundPreview);
390
393
  }
391
- 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
+ }
392
413
  suppliedOperationKey = operationKeyFor(fingerprint);
393
414
  }
394
415
  if (!suppliedOperationKey) {
@@ -413,6 +434,10 @@ async function localWriteCommand(parsed, preview, execute, options = {}) {
413
434
  fingerprint,
414
435
  target: preview.target,
415
436
  result,
437
+ ...(intent ? { intent } : {}),
438
+ ...(options.undoneChange?.(result)
439
+ ? { undoneChangeId: options.undoneChange(result) }
440
+ : {}),
416
441
  });
417
442
  return result;
418
443
  }
@@ -6044,6 +6069,9 @@ export async function executeRecessCommand(argv, options = {}) {
6044
6069
  if (noun === "kid") {
6045
6070
  return runKidCommand({ parsed, api, writeCommand });
6046
6071
  }
6072
+ if (noun === "me") {
6073
+ return runMeCommand({ parsed, api, writeCommand });
6074
+ }
6047
6075
  if (noun === "chat-logs") {
6048
6076
  return runChatLogsCommand({ parsed, api, writeCommand });
6049
6077
  }
@@ -6236,6 +6264,12 @@ export async function executeRecessCommand(argv, options = {}) {
6236
6264
  }
6237
6265
  if (verb === "goblins") {
6238
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
+ }
6239
6273
  const course = flagString(parsed, "course");
6240
6274
  if (course && !GOBLINS_COURSES.includes(course)) {
6241
6275
  throw new CliError("invalid_arguments", `--course must be one of ${GOBLINS_COURSES.join(", ")}.`);
@@ -6604,6 +6638,9 @@ export async function executeRecessCommand(argv, options = {}) {
6604
6638
  if (noun === "rocky" && verb === "free") {
6605
6639
  return runRockyFreeCommand({ parsed, api, writeCommand });
6606
6640
  }
6641
+ if (noun === "flags") {
6642
+ return runFlagsCommand({ parsed, api, writeCommand });
6643
+ }
6607
6644
  if (noun === "rocky") {
6608
6645
  const studentId = flagString(parsed, "student", { required: true });
6609
6646
  if (verb === "get") {
@@ -26,57 +26,121 @@ 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-days",
76
123
  "kid set-profile",
77
124
  "kid set-rooms",
78
125
  "kid set-texts",
126
+ "kid set-todo-reward",
79
127
  "kid switch-cowork",
128
+ "kid unexcuse-days",
129
+ "kid unexcuse-weekly",
130
+ "kid sign-in-code",
131
+ "family login-link",
132
+ "me add-todo",
133
+ "me remove-todo",
134
+ "me repeat-todo",
135
+ "me join-challenge",
136
+ "me leave-challenge",
137
+ "family memory save",
138
+ "family memory rewrite",
139
+ "family memory forget",
140
+ "family message-guide",
141
+ "family report-bug",
142
+ "kid observe",
143
+ "kid send-note",
80
144
  ];
81
145
  const REMOTE_COMMAND_SCOPES = new Map([
82
146
  ["goal-templates list", [RECESS_MCP_SCOPES.templatesRead]],
@@ -169,14 +233,27 @@ const AUTHENTICATED_COMMAND_PREFIXES = [
169
233
  */
170
234
  const FAMILY_COMMANDS = new Set([
171
235
  "family account",
236
+ "family billing",
237
+ "family billing-link",
238
+ "family calendar",
239
+ "family login-link",
240
+ "family add-guardian",
241
+ "family cancel-reminder",
242
+ "family changes",
243
+ "family config",
172
244
  "family drop-class",
245
+ "family feedback",
173
246
  "family guardians",
174
247
  "family kids",
248
+ "family pause",
175
249
  "family register-class",
250
+ "family remind",
251
+ "family reminders",
176
252
  "family restore-class",
177
253
  "family schedule",
178
254
  "family school-class-options",
179
255
  "family school-classes",
256
+ "family set",
180
257
  "family set-name",
181
258
  "family set-notifications",
182
259
  "family set-phone",
@@ -184,38 +261,89 @@ const FAMILY_COMMANDS = new Set([
184
261
  "family swap-class",
185
262
  "family today",
186
263
  "family tutor",
264
+ "family undo",
187
265
  "kid add-login",
188
266
  "kid add-todo",
189
267
  "kid classes",
268
+ "kid complete-challenge",
269
+ "kid config",
190
270
  "kid cowork",
191
271
  "kid edit-login",
272
+ "kid edit-todo",
192
273
  "kid end-session",
193
274
  "kid excuse",
275
+ "kid excuse-days",
276
+ "kid excused-days",
194
277
  "kid feed-lock",
195
278
  "kid friend-parent",
196
279
  "kid friends",
197
280
  "kid goal-note",
198
281
  "kid goal-schedule",
199
282
  "kid goals",
283
+ "kid help",
284
+ "kid help-done",
285
+ "kid join-challenge",
286
+ "kid leave-challenge",
200
287
  "kid logins",
201
288
  "kid map-scores",
289
+ "kid moments",
202
290
  "kid move-todo",
203
291
  "kid pair-device",
204
292
  "kid pause-goal",
205
293
  "kid profile",
206
294
  "kid remove-login",
295
+ "kid remove-todo",
296
+ "kid repeat-todo",
207
297
  "kid resume-goal",
208
298
  "kid reveal-login",
299
+ "kid set",
209
300
  "kid set-feed-lock",
301
+ "kid set-goal-games",
210
302
  "kid set-goal-note",
303
+ "kid set-goal-required",
304
+ "kid set-goal-days",
211
305
  "kid set-profile",
212
306
  "kid set-rooms",
213
307
  "kid set-texts",
308
+ "kid set-todo-reward",
214
309
  "kid switch-cowork",
215
310
  "kid texts",
216
311
  "kid today",
217
312
  "kid todo",
313
+ "kid unexcuse-days",
314
+ "kid unexcuse-weekly",
218
315
  "kid xp",
316
+ "kid progress",
317
+ "kid schedule",
318
+ "kid attendance",
319
+ "kid browse-challenges",
320
+ "kid sign-in-code",
321
+ "me today",
322
+ "me goals",
323
+ "me add-todo",
324
+ "me remove-todo",
325
+ "me repeat-todo",
326
+ "me browse-challenges",
327
+ "me join-challenge",
328
+ "me leave-challenge",
329
+ "family context",
330
+ "family memory",
331
+ "family memory save",
332
+ "family memory rewrite",
333
+ "family memory forget",
334
+ "family message-guide",
335
+ "family report-bug",
336
+ "kid todos",
337
+ "kid goal",
338
+ "kid conversations",
339
+ "kid social",
340
+ "kid enrollments",
341
+ "kid math-progress",
342
+ "kid memory ls",
343
+ "kid memory cat",
344
+ "kid memory grep",
345
+ "kid observe",
346
+ "kid send-note",
219
347
  "skills guardian get",
220
348
  "skills guardian list",
221
349
  ]);
@@ -708,7 +836,7 @@ const NOTE_LABEL_NOUNS = {
708
836
  "Class-ops": ["events"],
709
837
  Channel: ["channels"],
710
838
  "Family address": ["families"],
711
- "Family dashboard": ["family"],
839
+ "Family dashboard": ["family", "me"],
712
840
  "Kid dashboard": ["kid"],
713
841
  "Tuition-plan": ["tuition-plans"],
714
842
  Payout: ["payout"],