recess-cli 3.48.0 → 3.49.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/dist/cli.js CHANGED
@@ -2829,11 +2829,11 @@ export async function executeRecessCommand(argv, options = {}) {
2829
2829
  }
2830
2830
  throw new CliError("invalid_arguments", "Use village worlds export|import|promote.");
2831
2831
  }
2832
- if (verb === "events" || verb === "link-event") {
2832
+ if (verb === "events" || verb === "link-event" || verb === "age-exempt") {
2833
2833
  return runVillageEventsCommand({ parsed, api, writeCommand }, verb);
2834
2834
  }
2835
2835
  if (verb !== "models") {
2836
- throw new CliError("invalid_arguments", "Use village build …, village library …, village objects …, village worlds …, village models …, village events, village link-event …, or village render …");
2836
+ throw new CliError("invalid_arguments", "Use village build …, village library …, village objects …, village worlds …, village models …, village events, village link-event …, village age-exempt …, or village render …");
2837
2837
  }
2838
2838
  const action = positional(parsed, 2, "Village model action");
2839
2839
  if (action === "list") {
@@ -86,7 +86,6 @@ export const FAMILY_REMOTE_WRITES = [
86
86
  "family add-guardian",
87
87
  "family cancel-reminder",
88
88
  "family drop-class",
89
- "family feedback",
90
89
  "family pause",
91
90
  "family register-class",
92
91
  "family remind",
@@ -269,7 +268,6 @@ const FAMILY_COMMANDS = new Set([
269
268
  "family changes",
270
269
  "family config",
271
270
  "family drop-class",
272
- "family feedback",
273
271
  "family guardians",
274
272
  "family kids",
275
273
  "family pause",
@@ -621,6 +619,7 @@ const STAFF_COMMANDS = new Set([
621
619
  "users tier list-tiers",
622
620
  "village events",
623
621
  "village link-event",
622
+ "village age-exempt",
624
623
  ]);
625
624
  /**
626
625
  * Classify the command itself, not the target passed to it. Target-level
@@ -737,29 +737,6 @@ export async function runFamilyCommand({ parsed, api, writeCommand, }) {
737
737
  body: { path: raw, value },
738
738
  })), {}));
739
739
  }
740
- if (verb === "feedback") {
741
- const kind = assertChoice(flagString(parsed, "kind", { required: true }).trim().toLowerCase(), ["wrong", "too-much", "wanted", "loved", "cant-do", "other"], "--kind");
742
- const quote = flagString(parsed, "quote", { required: true }).trim();
743
- if (!quote)
744
- throw new CliError("invalid_arguments", "--quote cannot be empty.");
745
- const about = flagString(parsed, "about")?.trim();
746
- const kid = hasFlag(parsed, "student")
747
- ? await resolveFamilyKid(api, parsed)
748
- : undefined;
749
- const body = {
750
- kind,
751
- quote: quote.slice(0, 2000),
752
- ...(about ? { about: about.slice(0, 200) } : {}),
753
- ...(kid ? { studentId: kid.id } : {}),
754
- };
755
- // Not a change to the family: nothing to undo, so no confirm.
756
- return writeNow(parsed, {
757
- action: `pass on your feedback (${kind})`,
758
- target: { user: "@me", ...(kid ? kidTarget(kid) : {}) },
759
- request: body,
760
- details: { consequence: "The Recess team reads it; nothing changes." },
761
- }, async () => unwrap(await api.client.POST("/parent-v2/feedback/", { body })));
762
- }
763
740
  if (verb === "pause") {
764
741
  const kid = await resolveFamilyKid(api, parsed);
765
742
  const pauseWeeks = flagInteger(parsed, "weeks", {
@@ -908,6 +885,10 @@ export async function runFamilyCommand({ parsed, api, writeCommand, }) {
908
885
  if (verb === "report-bug") {
909
886
  const text = flagString(parsed, "text", { required: true }).trim();
910
887
  const summary = flagString(parsed, "summary")?.trim();
888
+ const rawKind = flagString(parsed, "kind")?.trim().toLowerCase();
889
+ const kind = rawKind
890
+ ? assertChoice(rawKind, ["bug", "request"], "--kind")
891
+ : undefined;
911
892
  const todoId = flagUuid(parsed, "todo");
912
893
  const kid = hasFlag(parsed, "student")
913
894
  ? await resolveFamilyKid(api, parsed)
@@ -915,20 +896,21 @@ export async function runFamilyCommand({ parsed, api, writeCommand, }) {
915
896
  const body = {
916
897
  text,
917
898
  ...(summary ? { summary } : {}),
899
+ ...(kind ? { kind } : {}),
918
900
  ...(kid ? { studentId: kid.id } : {}),
919
901
  ...(todoId ? { todoId } : {}),
920
902
  };
921
- // Goes to the engineering team; nothing in the family changes.
903
+ // Goes to the Recess team (Recess Issues); nothing in the family changes.
922
904
  return writeNow(parsed, {
923
- action: `report a bug to the Recess team: "${(summary ?? text).slice(0, 80)}"`,
905
+ action: `report ${kind === "request" ? "a request" : "a bug"} to the Recess team: "${(summary ?? text).slice(0, 80)}"`,
924
906
  target: { user: "@me", ...(kid ? kidTarget(kid) : {}) },
925
907
  request: body,
926
908
  details: {
927
- consequence: "The engineering team gets it; nothing changes.",
909
+ consequence: "The Recess team gets it; nothing changes.",
928
910
  },
929
911
  }, async () => unwrap(await api.client.POST("/parent-v2/report-bug/", { body })));
930
912
  }
931
- throw new CliError("invalid_arguments", "Use family kids|today|schedule|tutor|account|set-name|set-notifications|set-phone|set-timezone|guardians|changes|undo|remind|reminders|cancel-reminder|config|set|feedback|pause|add-guardian|billing|billing-link|calendar|login-link|school-classes|school-class-options|drop-class|restore-class|swap-class|register-class|context|memory|message-guide|report-bug.");
913
+ throw new CliError("invalid_arguments", "Use family kids|today|schedule|tutor|account|set-name|set-notifications|set-phone|set-timezone|guardians|changes|undo|remind|reminders|cancel-reminder|config|set|pause|add-guardian|billing|billing-link|calendar|login-link|school-classes|school-class-options|drop-class|restore-class|swap-class|register-class|context|memory|message-guide|report-bug.");
932
914
  }
933
915
  export async function runKidCommand({ parsed, api, writeCommand, }) {
934
916
  const verb = parsed.positionals[1];
@@ -1,5 +1,5 @@
1
1
  import { unwrap } from "../api.js";
2
- import { flagString, hasFlag } from "../args.js";
2
+ import { flagList, flagString, hasFlag } from "../args.js";
3
3
  import { apiError, CliError } from "../errors.js";
4
4
  import { renderColumns } from "./shared.js";
5
5
  const NONE = "—";
@@ -155,11 +155,71 @@ async function linkEvent(ctx) {
155
155
  };
156
156
  });
157
157
  }
158
+ /** `village age-exempt (--template <id> | --name <text>) (--add <kid-id> | --remove <kid-id>)…` */
159
+ async function ageExempt(ctx) {
160
+ const { parsed, api, writeCommand } = ctx;
161
+ const templateId = flagString(parsed, "template");
162
+ const name = flagString(parsed, "name")?.trim().toLowerCase();
163
+ const add = flagList(parsed, "add");
164
+ const remove = flagList(parsed, "remove");
165
+ if (Boolean(templateId) === Boolean(name)) {
166
+ throw new CliError("invalid_arguments", "Pass exactly one of --template <template-id> or --name <text>.");
167
+ }
168
+ if (add.length === 0 && remove.length === 0) {
169
+ throw new CliError("invalid_arguments", "Pass at least one --add <kid-id> or --remove <kid-id>.");
170
+ }
171
+ const { templates } = await fetchTemplatesAndRooms(ctx);
172
+ const targets = templates.filter((template) => templateId
173
+ ? template.id === templateId
174
+ : template.name.toLowerCase().includes(name));
175
+ if (targets.length === 0) {
176
+ throw new CliError("not_found", `No editable event template matches ${templateId ?? `"${name}"`}. Run \`recess village events\` to list them.`);
177
+ }
178
+ const changes = targets.map((template) => {
179
+ const next = new Set(template.ageExemptUserIds);
180
+ for (const id of add)
181
+ next.add(id);
182
+ for (const id of remove)
183
+ next.delete(id);
184
+ return {
185
+ templateId: template.id,
186
+ templateName: template.name,
187
+ ages: { minAge: template.minAge, maxAge: template.maxAge },
188
+ before: template.ageExemptUserIds,
189
+ ageExemptUserIds: [...next],
190
+ };
191
+ });
192
+ return writeCommand(parsed, {
193
+ action: `Set age exemptions on ${changes.length} event template(s): ${changes.map((change) => change.templateName).join(", ")}`,
194
+ target: { templateIds: changes.map((change) => change.templateId) },
195
+ request: { add, remove },
196
+ details: { templates: changes },
197
+ }, async () => {
198
+ for (const change of changes) {
199
+ const result = await api.client.PATCH("/recess/event-templates/{id}/", {
200
+ params: { path: { id: change.templateId } },
201
+ body: { ageExemptUserIds: change.ageExemptUserIds },
202
+ });
203
+ if (!result.response.ok) {
204
+ throw apiError(result.response.status, result.error);
205
+ }
206
+ }
207
+ return {
208
+ templates: changes.map(({ templateId, templateName, ageExemptUserIds }) => ({
209
+ templateId,
210
+ templateName,
211
+ ageExemptUserIds,
212
+ })),
213
+ };
214
+ });
215
+ }
158
216
  export async function runVillageEventsCommand(ctx, verb) {
159
217
  if (verb === "events")
160
218
  return listEvents(ctx);
161
219
  if (verb === "link-event")
162
220
  return linkEvent(ctx);
163
- throw new CliError("invalid_arguments", "Use village events or link-event.");
221
+ if (verb === "age-exempt")
222
+ return ageExempt(ctx);
223
+ throw new CliError("invalid_arguments", "Use village events, link-event or age-exempt.");
164
224
  }
165
225
  //# sourceMappingURL=village-events.js.map
package/dist/help.js CHANGED
@@ -228,8 +228,6 @@ Usage:
228
228
  recess [--json] family cancel-reminder --reminder <reminder-id> [--confirm]
229
229
  recess [--json] family config
230
230
  recess [--json] family set --path <path> --value <value> [--confirm]
231
- recess [--json] family feedback --kind wrong|too-much|wanted|loved|cant-do|other --quote TEXT
232
- [--about TEXT] [--student <kid>] [--confirm]
233
231
  recess [--json] family pause --student <kid> --weeks N [--enrollment <enrollment-id>] [--confirm]
234
232
  recess [--json] family add-guardian --first-name TEXT [--last-name TEXT] --email EMAIL [--confirm]
235
233
  recess [--json] family billing
@@ -243,7 +241,7 @@ Usage:
243
241
  recess [--json] family memory forget --in journal|family|me --line TEXT
244
242
  [--date YYYY-MM-DD] [--confirm]
245
243
  recess [--json] family message-guide --text TEXT [--student <kid>] [--confirm]
246
- recess [--json] family report-bug --text TEXT [--summary TEXT] [--student <kid>]
244
+ recess [--json] family report-bug --text TEXT [--summary TEXT] [--kind bug|request] [--student <kid>]
247
245
  [--todo <todo-id>] [--confirm]
248
246
  recess [--json] kid today --student <kid> [--date YYYY-MM-DD]
249
247
  recess [--json] kid goals --student <kid>
@@ -598,6 +596,8 @@ Usage:
598
596
  recess [--json] village events
599
597
  recess [--json] village link-event --template <template-id>
600
598
  [--room <zone-id>] [--unlink] [--url <https://…>] [--confirm]
599
+ recess [--json] village age-exempt (--template <template-id> | --name <text>)
600
+ [--add <kid-id>]… [--remove <kid-id>]… [--confirm]
601
601
  recess [--json] store-items list [--search TEXT]
602
602
  [--status ACTIVE|INACTIVE|COMING_SOON] [--item-type TYPE]
603
603
  [--page 0] [--limit 20] [--sort-by name|price|createdAt|updatedAt|order]
@@ -1405,13 +1405,12 @@ export const COMMAND_SUMMARIES = {
1405
1405
  "family memory rewrite": "Replace family.md or your own notes whole, tidied (at once).",
1406
1406
  "family memory forget": "Forget one exact line of the family notes (at once).",
1407
1407
  "family message-guide": "Message your kid's guide (Slack + the app chat); the person for anything.",
1408
- "family report-bug": "Report something broken in Recess to the team (at once; not a change).",
1408
+ "family report-bug": "Report a bug, or a request (--kind request: something missing, or what you think of Rocky), to the Recess team (at once; not a change).",
1409
1409
  "family remind": "Have Rocky text you a reminder (applies at once).",
1410
1410
  "family reminders": "Your upcoming text-me reminders.",
1411
1411
  "family cancel-reminder": "Cancel an upcoming reminder (applies at once).",
1412
1412
  "family config": "The family's settings, one line each, with paths.",
1413
1413
  "family set": "Change one family setting by path (at once, or confirm when marked).",
1414
- "family feedback": "Pass on what you think of Rocky's texts or abilities (at once; not a change).",
1415
1414
  "family pause": "Pause a kid's weekly class billing 1-6 weeks from Sunday (family undo resumes).",
1416
1415
  "family add-guardian": "Add a co-guardian with full parent access; they get an invite email.",
1417
1416
  "family school-classes": "Your kids' school classes, slots, queued switches.",
@@ -1647,6 +1646,7 @@ export const COMMAND_SUMMARIES = {
1647
1646
  "village worlds promote": "Promote a mirror/archive world to live.",
1648
1647
  "village events": "List event templates and their Village rooms.",
1649
1648
  "village link-event": "Link (or unlink) an event template to a Village room.",
1649
+ "village age-exempt": "Let kids join a recurring event outside its age range.",
1650
1650
  "store-items list": "List Village store items.",
1651
1651
  "store-items set-status": "Change a Village store item's status.",
1652
1652
  "db query": "Run a read-only SQL query against the API's database.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "3.48.0",
3
+ "version": "3.49.0",
4
4
  "description": "Safe Recess administration and family AI tools from the command line.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {