recess-cli 3.46.0 → 3.47.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.
@@ -53,6 +53,9 @@ export const FAMILY_REMOTE_READS = [
53
53
  "kid help",
54
54
  "kid logins",
55
55
  "kid map-scores",
56
+ "kid evidence",
57
+ "kid screenshots",
58
+ "kid send-screenshot",
56
59
  "kid moments",
57
60
  "kid profile",
58
61
  "kid reveal-login",
@@ -122,6 +125,9 @@ export const FAMILY_REMOTE_WRITES = [
122
125
  "kid set-goal-required",
123
126
  "kid set-challenge-order",
124
127
  "kid set-goal-coins",
128
+ "kid create-challenge",
129
+ "kid edit-challenge",
130
+ "kid refresh-todo",
125
131
  "kid set-goal-days",
126
132
  "kid mark-done",
127
133
  "kid set-todo-required",
@@ -308,6 +314,9 @@ const FAMILY_COMMANDS = new Set([
308
314
  "kid leave-challenge",
309
315
  "kid logins",
310
316
  "kid map-scores",
317
+ "kid evidence",
318
+ "kid screenshots",
319
+ "kid send-screenshot",
311
320
  "kid moments",
312
321
  "kid move-todo",
313
322
  "kid pair-device",
@@ -325,6 +334,9 @@ const FAMILY_COMMANDS = new Set([
325
334
  "kid set-goal-required",
326
335
  "kid set-challenge-order",
327
336
  "kid set-goal-coins",
337
+ "kid create-challenge",
338
+ "kid edit-challenge",
339
+ "kid refresh-todo",
328
340
  "kid set-goal-days",
329
341
  "kid mark-done",
330
342
  "kid set-todo-required",
@@ -380,6 +392,7 @@ const GUIDE_FAMILY_COMMANDS = new Set([
380
392
  "skills guardian get",
381
393
  "skills guardian list",
382
394
  "kid set-goal-coins",
395
+ "kid edit-challenge",
383
396
  ]);
384
397
  const FAMILY_AI_COMMANDS = new Set([
385
398
  "apps assign",
@@ -932,7 +932,7 @@ export async function runFamilyCommand({ parsed, api, writeCommand, }) {
932
932
  }
933
933
  export async function runKidCommand({ parsed, api, writeCommand, }) {
934
934
  const verb = parsed.positionals[1];
935
- const kid = verb === "set-goal-coins"
935
+ const kid = verb === "set-goal-coins" || verb === "edit-challenge"
936
936
  ? await resolveFamilyOrTutoredKid(api, parsed)
937
937
  : await resolveFamilyKid(api, parsed);
938
938
  const kidId = kid.id;
@@ -1615,11 +1615,21 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
1615
1615
  min: 1,
1616
1616
  max: 600,
1617
1617
  });
1618
+ const goal = flagUuid(parsed, "goal");
1619
+ const requiredFlag = flagString(parsed, "required");
1620
+ if (requiredFlag !== undefined &&
1621
+ requiredFlag !== "on" &&
1622
+ requiredFlag !== "off")
1623
+ throw new CliError("invalid_arguments", "--required must be on or off.");
1618
1624
  const body = {
1619
1625
  title,
1620
1626
  ...(dueDate !== undefined ? { dueDate } : {}),
1621
1627
  ...(url !== undefined ? { url } : {}),
1622
1628
  ...(targetDurationInMins !== undefined ? { targetDurationInMins } : {}),
1629
+ ...(goal !== undefined ? { goalId: goal } : {}),
1630
+ ...(requiredFlag !== undefined
1631
+ ? { required: requiredFlag === "on" }
1632
+ : {}),
1623
1633
  };
1624
1634
  return writeNow(parsed, {
1625
1635
  action: `add the todo "${title}" for ${name}`,
@@ -1673,7 +1683,7 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
1673
1683
  throw new CliError("invalid_arguments", `"${todo.title}" has no active session to end.`);
1674
1684
  }
1675
1685
  return writeCommand(parsed, {
1676
- action: `end the stuck session on ${name}'s todo "${todo.title}"`,
1686
+ action: `end the session on ${name}'s todo "${todo.title}"`,
1677
1687
  target: { ...kidTarget(kid), todoId },
1678
1688
  request: {},
1679
1689
  details: {
@@ -1690,7 +1700,7 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
1690
1700
  target: { ...kidTarget(kid), todoId },
1691
1701
  request: allowStarted ? { allowStarted: true } : {},
1692
1702
  details: {
1693
- consequence: "It comes off the kid's list (undo: family undo). Completed work, work awaiting review and a live session are never removed; started work only with --allow-started.",
1703
+ consequence: "It comes off the kid's list (undo: family undo). Completed work and work awaiting review are never removed; started work only with --allow-started, which also closes a live session and sends the kid to Today.",
1694
1704
  },
1695
1705
  }, async () => unwrap(await api.client.DELETE("/parent-v2/kid/{kidId}/todos/{todoId}/", {
1696
1706
  params: {
@@ -1883,6 +1893,123 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
1883
1893
  };
1884
1894
  });
1885
1895
  }
1896
+ if (verb === "evidence") {
1897
+ const todoId = flagUuid(parsed, "todo", { required: true });
1898
+ const search = flagString(parsed, "search")?.trim();
1899
+ return unwrap(await api.client.GET("/parent-v2/kid/{kidId}/todos/{todoId}/evidence/", {
1900
+ params: {
1901
+ path: { kidId, todoId },
1902
+ query: { ...(search ? { search } : {}) },
1903
+ },
1904
+ }));
1905
+ }
1906
+ if (verb === "screenshots") {
1907
+ const todoId = flagUuid(parsed, "todo", { required: true });
1908
+ const frames = flagString(parsed, "frames")?.trim();
1909
+ return unwrap(await api.client.GET("/parent-v2/kid/{kidId}/todos/{todoId}/screenshots/", {
1910
+ params: {
1911
+ path: { kidId, todoId },
1912
+ query: { ...(frames ? { frames } : {}) },
1913
+ },
1914
+ }));
1915
+ }
1916
+ if (verb === "send-screenshot") {
1917
+ const todoId = flagUuid(parsed, "todo", { required: true });
1918
+ const frames = flagString(parsed, "frames", { required: true })
1919
+ .split(",")
1920
+ .map((frame) => Number(frame.trim()));
1921
+ if (frames.some((frame) => !Number.isInteger(frame) || frame < 0))
1922
+ throw new CliError("invalid_arguments", "--frames must be frame numbers like 269,280.");
1923
+ const caption = flagString(parsed, "caption");
1924
+ const body = { frames, ...(caption ? { caption } : {}) };
1925
+ return writeNow(parsed, {
1926
+ action: `show screenshots ${frames.join(", ")} from ${name}'s to-do ${todoId}`,
1927
+ target: { ...kidTarget(kid), todoId },
1928
+ request: body,
1929
+ details: {
1930
+ consequence: "On a Rocky text they go out as pictures; elsewhere you get links to show.",
1931
+ },
1932
+ }, async () => unwrap(await api.client.POST("/parent-v2/kid/{kidId}/todos/{todoId}/screenshots/send/", { params: { path: { kidId, todoId } }, body })));
1933
+ }
1934
+ if (verb === "create-challenge") {
1935
+ const title = flagString(parsed, "title", { required: true }).trim();
1936
+ const days = flagString(parsed, "days", { required: true }).trim();
1937
+ const requiredFlag = flagString(parsed, "required", { required: true });
1938
+ if (requiredFlag !== "on" && requiredFlag !== "off")
1939
+ throw new CliError("invalid_arguments", "--required must be on or off.");
1940
+ const minutes = flagInteger(parsed, "minutes", { min: 1, max: 600 });
1941
+ const url = flagString(parsed, "url");
1942
+ const start = flagDate(parsed, "start");
1943
+ const weeks = flagInteger(parsed, "weeks", { min: 1, max: 104 });
1944
+ const endsOn = flagDate(parsed, "until");
1945
+ const todoLimit = flagInteger(parsed, "todos", { min: 1, max: 1000 });
1946
+ const body = {
1947
+ title,
1948
+ days,
1949
+ required: requiredFlag === "on",
1950
+ ...(minutes !== undefined ? { minutes } : {}),
1951
+ ...(url !== undefined ? { url } : {}),
1952
+ ...(start !== undefined ? { start } : {}),
1953
+ ...(weeks !== undefined ? { weeks } : {}),
1954
+ ...(endsOn !== undefined ? { endsOn } : {}),
1955
+ ...(todoLimit !== undefined ? { todoLimit } : {}),
1956
+ };
1957
+ return writeNow(parsed, {
1958
+ action: `make "${title}" a fixed challenge for ${name}, ${days}`,
1959
+ target: kidTarget(kid),
1960
+ request: body,
1961
+ details: {
1962
+ consequence: "This exact to-do lands on those days, with no planner rewriting it. Accounts that can create challenges only.",
1963
+ },
1964
+ }, async () => unwrap(await api.client.POST("/parent-v2/kid/{kidId}/challenges/private/", {
1965
+ params: { path: { kidId } },
1966
+ body,
1967
+ })));
1968
+ }
1969
+ if (verb === "edit-challenge") {
1970
+ const goalId = flagUuid(parsed, "goal", { required: true });
1971
+ const title = flagString(parsed, "title");
1972
+ const description = flagString(parsed, "description");
1973
+ const todoTitle = flagString(parsed, "todo-title");
1974
+ const minutes = flagInteger(parsed, "minutes", { min: 1, max: 600 });
1975
+ const url = flagString(parsed, "url");
1976
+ const endsOn = flagDate(parsed, "until");
1977
+ const todoLimit = flagInteger(parsed, "todos", { min: 1, max: 1000 });
1978
+ const body = {
1979
+ ...(title !== undefined ? { title } : {}),
1980
+ ...(description !== undefined ? { description } : {}),
1981
+ ...(todoTitle !== undefined ? { todoTitle } : {}),
1982
+ ...(minutes !== undefined ? { minutes } : {}),
1983
+ ...(url !== undefined ? { url } : {}),
1984
+ ...(endsOn !== undefined ? { endsOn } : {}),
1985
+ ...(todoLimit !== undefined ? { todoLimit } : {}),
1986
+ ...(hasFlag(parsed, "no-limit") ? { endsOn: null, todoLimit: null } : {}),
1987
+ };
1988
+ return writeNow(parsed, {
1989
+ action: `edit ${name}'s challenge ${goalId}`,
1990
+ target: { ...kidTarget(kid), goalId },
1991
+ request: body,
1992
+ details: {
1993
+ consequence: "Only a challenge with no template behind it can change here; a template-backed one is shared with other kids.",
1994
+ },
1995
+ }, async () => unwrap(await api.client.PATCH("/parent-v2/kid/{kidId}/challenges/{goalId}/", {
1996
+ params: { path: { kidId, goalId } },
1997
+ body,
1998
+ })));
1999
+ }
2000
+ if (verb === "refresh-todo") {
2001
+ const goalId = flagUuid(parsed, "goal", { required: true });
2002
+ const date = flagDate(parsed, "date");
2003
+ const body = { ...(date !== undefined ? { date } : {}) };
2004
+ return writeNow(parsed, {
2005
+ action: `make a new to-do from ${name}'s challenge ${goalId}`,
2006
+ target: { ...kidTarget(kid), goalId },
2007
+ request: body,
2008
+ details: {
2009
+ consequence: "Queued: the planner writes it in a minute or two. Started and finished work stays, so remove an unwanted open to-do first.",
2010
+ },
2011
+ }, async () => unwrap(await api.client.POST("/parent-v2/kid/{kidId}/challenges/{goalId}/refresh/", { params: { path: { kidId, goalId } }, body })));
2012
+ }
1886
2013
  if (verb === "set-goal-coins") {
1887
2014
  const goalId = flagUuid(parsed, "goal", { required: true });
1888
2015
  const raw = flagString(parsed, "value", { required: true })
package/dist/help.js CHANGED
@@ -283,7 +283,7 @@ Usage:
283
283
  recess [--json] kid set-goal-note --student <kid> --goal <goal-id>
284
284
  (--note TEXT | --clear) [--confirm]
285
285
  recess [--json] kid add-todo --student <kid> --title TEXT [--due-date YYYY-MM-DD (defaults to today)]
286
- [--url URL] [--minutes N] [--confirm]
286
+ [--url URL] [--minutes N] [--goal <goal-id>] [--required on|off] [--confirm]
287
287
  recess [--json] kid todo --student <kid> --todo <todo-id>
288
288
  recess [--json] kid move-todo --student <kid> --todo <todo-id> --due-date YYYY-MM-DD [--confirm]
289
289
  recess [--json] kid end-session --student <kid> --todo <todo-id> [--confirm]
@@ -298,6 +298,17 @@ Usage:
298
298
  recess [--json] kid set-challenge-order --student <kid> (--order "<goal-id|title>,…,rocky" | --auto)
299
299
  [--confirm]
300
300
  recess [--json] kid set-goal-coins --student <kid> --goal <goal-id> --value 0-20|default [--confirm]
301
+ recess [--json] kid evidence --student <kid> --todo <todo-id> [--search TEXT]
302
+ recess [--json] kid screenshots --student <kid> --todo <todo-id> [--frames 269,280]
303
+ recess [--json] kid send-screenshot --student <kid> --todo <todo-id> --frames 269,280
304
+ [--caption TEXT] [--confirm]
305
+ recess [--json] kid create-challenge --student <kid> --title TEXT --days <weekdays|daily|Mon,Wed>
306
+ --required on|off [--minutes N] [--url URL] [--start YYYY-MM-DD]
307
+ [--weeks N | --until YYYY-MM-DD | --todos N] [--confirm]
308
+ recess [--json] kid edit-challenge --student <kid> --goal <goal-id> [--title TEXT]
309
+ [--description TEXT] [--todo-title TEXT] [--minutes N] [--url URL]
310
+ [--until YYYY-MM-DD | --todos N | --no-limit] [--confirm]
311
+ recess [--json] kid refresh-todo --student <kid> --goal <goal-id> [--date YYYY-MM-DD] [--confirm]
301
312
  recess [--json] kid set-goal-days --student <kid> --goal <goal-id>
302
313
  --days <"Tue, Thu"|Mon-Fri|weekdays|daily> [--confirm]
303
314
  recess [--json] kid challenges --student <kid>
@@ -909,8 +920,8 @@ settings. --frequency gates only two text types: all (default) also gets the
909
920
  per-todo Math Academy/Beast Academy texts; daily drops those; important drops
910
921
  those and any daily summary the summary agent labels routine. Neither daily nor
911
922
  important caps texts at one a day: a recipient with a focus still gets live
912
- progress summaries during the day, and the todo nudge, parent recap and a
913
- manual "send summary" ignore frequency. Only --texts-enabled false stops all of
923
+ progress summaries during the day, and the parent recap and a manual "send
924
+ summary" ignore frequency. Only --texts-enabled false stops all of
914
925
  them. --focus is that adult's own instructions for the daily summary (what to
915
926
  cover and how). A recipient with no phone number receives nothing, so check
916
927
  "users phone get" too.
@@ -989,7 +1000,8 @@ new device. Plan changes apply at once with no confirm step and are logged
989
1000
  (undo: family undo, or family undo --change ID): excuse, unexcuse-weekly,
990
1001
  goal-schedule, pause-goal, resume-goal, set-goal-note, add-todo, move-todo,
991
1002
  remove-todo, edit-todo, repeat-todo, join-challenge, set-goal-games,
992
- set-goal-required, set-challenge-order, set-goal-coins, set-goal-days, mark-done,
1003
+ set-goal-required, set-challenge-order, set-goal-coins, create-challenge,
1004
+ edit-challenge, refresh-todo, send-screenshot, set-goal-days, mark-done,
993
1005
  set-todo-required, rename-challenge, set-todo-naming, help-done, excuse-days,
994
1006
  unexcuse-days, and "set" fields that apply at once. --confirm on them changes
995
1007
  nothing: a rerun with it returns the first result (alreadyApplied) instead of applying twice. Every other write
@@ -1005,13 +1017,12 @@ replaces your previous text, and other guardians keep theirs. A focus also
1005
1017
  makes you eligible for live progress texts during the day. --frequency gates
1006
1018
  only two text types: ALL (default) also sends per-todo Math Academy/Beast
1007
1019
  Academy texts; DAILY drops those; IMPORTANT drops those and any daily summary
1008
- judged routine. Neither caps texts at one a day; the daily todo nudge and
1009
- recaps ignore it. --enabled false is the only way to stop every text about a
1020
+ judged routine. Neither caps texts at one a day; recaps ignore it. --enabled false is the only way to stop every text about a
1010
1021
  kid. Plan controls (any guardian): a goal's cadence ("goal-schedule": daily,
1011
1022
  weekly, Mon,Wed,Fri or 3x/week), pausing/resuming a goal, the goal's note
1012
- ("set-goal-note"), one-off todos ("add-todo"; due today in the kid's timezone unless --due-date; no bonus/optional kind exists),
1013
- moving a not-started todo ("move-todo"), and ending a stuck session so started
1014
- work can be removed ("end-session"; never completes it or awards XP). The goal note
1023
+ ("set-goal-note"), one-off todos ("add-todo"; due today in the kid's timezone unless --due-date; --goal attaches it to a challenge, --required off makes it an extra),
1024
+ moving a not-started todo ("move-todo"), and ending a session, live or stuck
1025
+ ("end-session": the kid goes back to Today; never completes it or awards XP). The goal note
1015
1026
  is how a parent changes how Rocky behaves on that goal ("ask fewer follow-ups",
1016
1027
  "Scratch is an ongoing project, not daily", "skip the video"): Rocky's goal
1017
1028
  sessions and the daily planner read it. It replaces the current note; max 2000
@@ -1441,7 +1452,7 @@ export const COMMAND_SUMMARIES = {
1441
1452
  "kid add-todo": "Add a one-off todo for a kid (due today unless --due-date).",
1442
1453
  "kid todo": "One todo: status, due day, live session.",
1443
1454
  "kid move-todo": "Move a not-started todo to another day.",
1444
- "kid end-session": "End a stuck todo session (no XP, not completed).",
1455
+ "kid end-session": "End a todo session now, live or stuck: the kid goes back to Today (no XP, not completed).",
1445
1456
  "kid remove-todo": "Remove a kid's todo (applies at once; family undo).",
1446
1457
  "kid edit-todo": "Rename, re-time or re-link a not-started todo (applies at once).",
1447
1458
  "kid join-challenge": "Join a kid to a challenge from the library (applies at once).",
@@ -1450,6 +1461,12 @@ export const COMMAND_SUMMARIES = {
1450
1461
  "kid set-goal-required": "Whether a kid may drop one challenge themselves (at once).",
1451
1462
  "kid set-challenge-order": "Set the order a kid's challenges run in; their to-dos follow it (at once).",
1452
1463
  "kid set-goal-coins": "Coins each of one challenge's to-dos pays, 0-20 or default, fixed (at once; tutors too).",
1464
+ "kid evidence": "What one to-do's session record shows: analysis, stretches, frame numbers.",
1465
+ "kid screenshots": "Links to up to five session screenshots of one to-do.",
1466
+ "kid send-screenshot": "Show a parent session screenshots: pictures on a Rocky text, links elsewhere.",
1467
+ "kid create-challenge": "A private fixed challenge: the same to-do on set days, optionally limited (at once; accounts that can create challenges).",
1468
+ "kid edit-challenge": "Edit a challenge with no template behind it, including its limit (at once; tutors too).",
1469
+ "kid refresh-todo": "Make a challenge's to-do again for a day (at once; queued).",
1453
1470
  "kid challenges": "A kid's challenges, one line each, plus the page with the rest.",
1454
1471
  "kid mark-done": "Mark a to-do done a parent vouches for; it pays as usual (at once).",
1455
1472
  "kid set-todo-required": "Make one to-do required, optional (an extra) or follow its challenge (at once).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "3.46.0",
3
+ "version": "3.47.0",
4
4
  "description": "Safe Recess administration and family AI tools from the command line.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -46,8 +46,8 @@
46
46
  "oxlint-tsgolint": "^0.6.0",
47
47
  "typescript": "^5.9.2",
48
48
  "vitest": "^1.6.0",
49
- "@tryrecess/api-types": "0.0.0",
50
- "@tryrecess/typescript-config": "0.0.0"
49
+ "@tryrecess/typescript-config": "0.0.0",
50
+ "@tryrecess/api-types": "0.0.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "node node_modules/@tryrecess/typescript-config/bin/tsc-fast.mjs",