recess-cli 1.3.3 → 1.4.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
@@ -28,6 +28,11 @@ Usage:
28
28
  [--slots N]
29
29
  recess [--json] users tier set <kid-id> --tier social|academics|lite|complete|platform
30
30
  [--slots N] --expected-updated-at <iso> [--allow-strand] [--confirm]
31
+ recess [--json] guides create --email <email> --first-name TEXT
32
+ [--last-name TEXT] [--no-invite] [--confirm]
33
+ recess [--json] guides invite --user <user-id> [--confirm]
34
+ recess [--json] guardians invite --family <family-id> --email <email>
35
+ --first-name TEXT [--last-name TEXT] [--no-invite] [--confirm]
31
36
  recess [--json] students upload-map-scores --student <kid-id>
32
37
  --file </path/to/map-report.pdf> [--confirm]
33
38
  recess [--json] enrollments list --user <user-id>
@@ -1274,6 +1279,96 @@ export async function runCommand(argv) {
1274
1279
  params: { path: { userId } },
1275
1280
  }));
1276
1281
  }
1282
+ if (noun === "guides" && verb === "create") {
1283
+ const email = flagString(parsed, "email", { required: true })
1284
+ .trim()
1285
+ .toLowerCase();
1286
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
1287
+ throw new CliError("invalid_arguments", "--email does not look like a valid email address.");
1288
+ }
1289
+ const firstName = flagString(parsed, "first-name", { required: true });
1290
+ const lastName = flagString(parsed, "last-name");
1291
+ const sendInvite = !hasFlag(parsed, "no-invite");
1292
+ const body = {
1293
+ email,
1294
+ firstName,
1295
+ ...(lastName !== undefined ? { lastName } : {}),
1296
+ sendInvite,
1297
+ };
1298
+ return writeCommand(parsed, {
1299
+ action: sendInvite
1300
+ ? "provision a GUIDE staff account and email its sign-in invite (outward email)"
1301
+ : "provision a GUIDE staff account without sending the invite email",
1302
+ target: { email },
1303
+ request: body,
1304
+ }, async () => unwrap(await api.client.POST("/admin/guides/", { body })));
1305
+ }
1306
+ if (noun === "guardians" && verb === "invite") {
1307
+ const familyId = flagString(parsed, "family", { required: true });
1308
+ const email = flagString(parsed, "email", { required: true })
1309
+ .trim()
1310
+ .toLowerCase();
1311
+ if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
1312
+ throw new CliError("invalid_arguments", "--email does not look like a valid email address.");
1313
+ }
1314
+ const firstName = flagString(parsed, "first-name", { required: true });
1315
+ const lastName = flagString(parsed, "last-name");
1316
+ const sendInvite = !hasFlag(parsed, "no-invite");
1317
+ // Read-only preflight: the approval preview must name the exact family
1318
+ // this guardian is being granted over — a wrong family id hands a
1319
+ // stranger full guardian access to someone's kids.
1320
+ const family = unwrap(await api.client.GET("/admin/onboarding/families/{familyId}/status", {
1321
+ params: { path: { familyId } },
1322
+ }));
1323
+ const body = {
1324
+ email,
1325
+ firstName,
1326
+ ...(lastName !== undefined ? { lastName } : {}),
1327
+ sendInvite,
1328
+ };
1329
+ return writeCommand(parsed, {
1330
+ action: sendInvite
1331
+ ? "invite a new GUARDIAN into an existing family and email the sign-in invite (outward email)"
1332
+ : "add a new GUARDIAN to an existing family without sending the invite email",
1333
+ target: { familyId, email },
1334
+ request: body,
1335
+ details: {
1336
+ familyName: family.familyName,
1337
+ kids: family.kids.map((kid) => kid.firstName),
1338
+ },
1339
+ }, async () => unwrap(await api.client.POST("/admin/users/family/{familyId}/guardians/", {
1340
+ params: { path: { familyId } },
1341
+ body,
1342
+ })));
1343
+ }
1344
+ if (noun === "guides" && verb === "invite") {
1345
+ const userId = flagString(parsed, "user", { required: true });
1346
+ // Read-only preflight: the approval preview must name the exact person
1347
+ // about to receive an outward email, and refuse a non-guide before the
1348
+ // gate rather than after approval (the backend enforces the same rule).
1349
+ const { user } = unwrap(await api.client.GET("/admin/users/{userId}", {
1350
+ params: { path: { userId } },
1351
+ }));
1352
+ if (user.role !== "GUIDE") {
1353
+ throw new CliError("invalid_arguments", `User ${userId} has role ${user.role}; only GUIDE accounts can be invited. Use guides create for a new guide.`);
1354
+ }
1355
+ if (!user.email) {
1356
+ throw new CliError("invalid_arguments", `Guide ${userId} has no email address on file, so no invite can be sent.`);
1357
+ }
1358
+ return writeCommand(parsed, {
1359
+ action: "send the guide sign-in invite email (outward email)",
1360
+ target: { userId },
1361
+ request: {},
1362
+ details: {
1363
+ to: user.email,
1364
+ firstName: user.firstName,
1365
+ lastName: user.lastName,
1366
+ role: user.role,
1367
+ },
1368
+ }, async () => unwrap(await api.client.POST("/admin/guides/{userId}/invite/", {
1369
+ params: { path: { userId } },
1370
+ })));
1371
+ }
1277
1372
  if (noun === "students" && verb === "upload-map-scores") {
1278
1373
  const studentId = flagString(parsed, "student", { required: true });
1279
1374
  const pdf = await readMapScorePdf(flagString(parsed, "file", { required: true }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "Safe Recess staff administration from the command line, for humans and coding agents.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: recess-cli
3
- description: Safely perform Recess staff administration through the recess CLI. Use when a Recess admin asks Codex to find a kid, parent, family, enrollment, subscription, invoice, or cohort; edit the Recess Village map or manage store-catalog availability; search the curated Content Library; inspect or change a school kid's tier and capability gates; upload a kid's MAP Growth report; pause or resume billing; refund or credit an invoice item; extend a trial; cancel or restore a subscription; register or unregister a cohort against an enrollment; switch or move kids from one cohort to another; manage guide payout invoices (biweekly pay-cycle line-item changes, invoice status moves, payout recipient lookups); run class operations (take attendance, cancel or reschedule a class session, add a one-off session, end a cohort, pause cohort billing, email a cohort's families, approve or deny pending registrations); process class-cancellation credits (the "Please credit these students accordingly" Slack message — credit every registered kid for a guide-canceled session); or author learning content — build, validate, publish, and loss-safely patch a deterministic GoalTemplate, apply a template to a kid or a roster, create a goal directly on a kid, write a Mesa draft or goal workspace, capture a template snapshot, and read Mesa workspace or snapshot files.
3
+ description: Safely perform Recess staff administration through the recess CLI. Use when a Recess admin asks Codex to find a kid, parent, family, enrollment, subscription, invoice, or cohort; provision a new GUIDE staff account and email its sign-in invite (or resend one); edit the Recess Village map or manage store-catalog availability; search the curated Content Library; inspect or change a school kid's tier and capability gates; upload a kid's MAP Growth report; pause or resume billing; refund or credit an invoice item; extend a trial; cancel or restore a subscription; register or unregister a cohort against an enrollment; switch or move kids from one cohort to another; manage guide payout invoices (biweekly pay-cycle line-item changes, invoice status moves, payout recipient lookups); run class operations (take attendance, cancel or reschedule a class session, add a one-off session, end a cohort, pause cohort billing, email a cohort's families, approve or deny pending registrations); process class-cancellation credits (the "Please credit these students accordingly" Slack message — credit every registered kid for a guide-canceled session); or author learning content — build, validate, publish, and loss-safely patch a deterministic GoalTemplate, apply a template to a kid or a roster, create a goal directly on a kid, write a Mesa draft or goal workspace, capture a template snapshot, and read Mesa workspace or snapshot files.
4
4
  # Bundle version. Bump on every substantive edit; the CLI reports it and `doctor`
5
5
  # compares it against the served copy to tell an operator a refresh is available.
6
- version: 1.4.4
6
+ version: 1.5.0
7
7
  # The lowest `recess` version this bundle is safe to install onto. Raise it ONLY
8
8
  # when the bundle documents a command, flag, or changed semantic that an older
9
9
  # binary does not have — an older CLI keeps its bundled copy instead of taking
10
10
  # this one. Prose, formatting, and Gotcha edits must NOT raise it; that is the
11
11
  # whole point of serving the bundle.
12
- minCliVersion: 1.3.3
12
+ minCliVersion: 1.4.0
13
13
  ---
14
14
 
15
15
  # Recess CLI (`recess`)
@@ -51,6 +51,9 @@ Never infer approval from the original task, prior approval, urgency, or a succe
51
51
  | `invoices refund … --who-pays recess` | Recess absorbs the cost instead of the guide |
52
52
  | `cohorts end --cancel-subscriptions` | sets EVERY active enrollment's Stripe subscription to cancel at period end |
53
53
  | `cohorts email` | real outward email blast to families (include the recipient count from `cohorts parent-emails`) |
54
+ | `guides create` | mints a staff-privileged GUIDE account (the `/admin` gate admits GUIDE) and by default emails the sign-in invite; quote the exact email address — the address IS the credential handle for passwordless login |
55
+ | `guides invite` | real outward email to the previewed recipient telling them their account is live; quote `details.to` |
56
+ | `guardians invite` | grants a new email address FULL guardian access over an existing family's kids and by default emails the sign-in invite; quote the previewed `details.familyName` + kid list and the exact email address |
54
57
  | `events cancel` | family-facing fan-out: chat messages, parent email blast, credit-owed notes, Slack |
55
58
  | `payout invoices set-status` to `OPEN`/`PAID`/`CANCELED` | moves real account balances; `--send-email` additionally emails the guide |
56
59
  | destructive `goal-templates patch-spec` | removes subjects, recipes, plans, queue items, source URLs, or missing-coverage records from a global template; quote the exact `details.safety.removed` inventory and hashes, then use the fresh token only after approval |
@@ -155,6 +158,14 @@ recess --json users tier set <kid-id> --tier <id> [--slots N] \
155
158
  recess --json enrollments list --user <user-id>
156
159
  recess --json enrollments get-for-subscription --subscription <id>
157
160
 
161
+ # Guide staff accounts (ADMIN-only; both send outward email by default)
162
+ recess --json guides create --email <email> --first-name TEXT [--last-name TEXT] [--no-invite] [--confirm]
163
+ recess --json guides invite --user <user-id> [--confirm]
164
+
165
+ # Invite a guardian into an EXISTING family (ADMIN-only; outward email by default;
166
+ # the preview names the family + kids — verify them before requesting approval)
167
+ recess --json guardians invite --family <family-id> --email <email> --first-name TEXT [--last-name TEXT] [--no-invite] [--confirm]
168
+
158
169
  # Billing & subscriptions (reference/billing.md)
159
170
  recess --json subscriptions list --family <family-id> [--kid <kid-id>]
160
171
  recess --json invoices list --subscription <subscription-id>
@@ -500,3 +511,4 @@ Dated, newest last. Add an entry every time reality surprises you.
500
511
  - 2026-08-05 — **`set-metadata --output-template-file` edits an AI_CHAT template's `outputTemplate`** (the goal-description payload DailyTodoGeneration consumes for description-only goals). Like `--agent-instructions-file`, it reads a local file and the server bumps the version + freezes a `GoalTemplateVersion` row. Editing a template never rewrites goals already created from it — the description was copied at goal-creation time; re-apply or edit live goals separately.
501
512
  - 2026-08-05 — **Content Library search now has a content/Pipeline-read-only CLI command.** `content-library search <query> [--limit 8]` calls the same hybrid/vector + rerank `/agent/search` funnel as Rocky's `search_gem_library`, returns the full fit/gist/coverage payload, and attributes the funnel's standard `offered` telemetry to `admin-cli`. It cannot inspect, ingest, file requests, curate, or edit the Pipeline; the permanent library token stays on the web server.
502
513
  - 2026-08-07 — **Village store goods do not live in the Village database.** They are ordinary main-Recess `StoreItem` rows with `itemType=VILLAGE_ITEM`; use `store-items list --item-type VILLAGE_ITEM` and the confirmation-gated `store-items set-status`, while `village models …` remains the separate Village-island map/model boundary. `set-status` refuses non-Village IDs and its live preflight names the item, current status, purchase count, and feed consequence before approval. A checked-in seed still owns fresh-database defaults, so an operational status edit does not replace updating that seed when the product default itself changes.
514
+ - 2026-08-11 — **An external bundle leaf does not infer its grade answer from `availableWhen`.** When an `EXTERNAL_SKILL_QUEUE_SETUP` recipe has grade-specific plans and the shared wizard step is not named `grade`, set `handler.config.gradeLevelStepKey` to that exact step key. The server preview can validate without this optional binding, but apply dry-run then returns `No plan matched subject="…"`. Compare the new leaf with a working grade-bound sibling and dry-run the exact answers before calling the template finished.