recess-cli 3.17.0 → 3.18.1
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/args.js +2 -0
- package/dist/cli.js +265 -2
- package/dist/command-schema.js +13 -1
- package/dist/commands/admissions.js +33 -1
- package/dist/goal-authoring.js +3 -8
- package/dist/help.js +51 -10
- package/package.json +1 -1
- package/skill/recess-cli/agents/version.json +2 -2
package/dist/args.js
CHANGED
|
@@ -29,6 +29,7 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
29
29
|
"no-paywall",
|
|
30
30
|
"no-text",
|
|
31
31
|
"all",
|
|
32
|
+
"all-goals",
|
|
32
33
|
"all-references",
|
|
33
34
|
"allow-assigned-edits",
|
|
34
35
|
"allow-billing",
|
|
@@ -36,6 +37,7 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
36
37
|
"allow-state-modification",
|
|
37
38
|
"allow-strand",
|
|
38
39
|
"analyzed",
|
|
40
|
+
"append",
|
|
39
41
|
"apply",
|
|
40
42
|
"archived",
|
|
41
43
|
"cancel-subscriptions",
|
package/dist/cli.js
CHANGED
|
@@ -1824,6 +1824,44 @@ function resolvedStudentDetails(student) {
|
|
|
1824
1824
|
function goalTemplatePreviewUrl(webOrigin, templateId) {
|
|
1825
1825
|
return new URL(`/challenges-v2/${encodeURIComponent(templateId)}`, webOrigin).toString();
|
|
1826
1826
|
}
|
|
1827
|
+
/**
|
|
1828
|
+
* The classic-challenge fields passed as flags (`classic-create`/`-update`);
|
|
1829
|
+
* only flags present land, so an update changes exactly what was sent. The
|
|
1830
|
+
* server owns the real validation (`classic-challenge-source.ts`).
|
|
1831
|
+
*/
|
|
1832
|
+
async function classicChallengeFlags(parsed) {
|
|
1833
|
+
const instructionsFile = flagString(parsed, "instructions-file");
|
|
1834
|
+
if (instructionsFile && flagString(parsed, "instructions") !== undefined) {
|
|
1835
|
+
throw new CliError("invalid_arguments", "Pass --instructions or --instructions-file, not both.");
|
|
1836
|
+
}
|
|
1837
|
+
const instructions = instructionsFile
|
|
1838
|
+
? await fs.readFile(path.resolve(instructionsFile), "utf8")
|
|
1839
|
+
: flagString(parsed, "instructions");
|
|
1840
|
+
const integer = (flag, min, max) => {
|
|
1841
|
+
const value = flagNumber(parsed, flag);
|
|
1842
|
+
if (value !== undefined &&
|
|
1843
|
+
(!Number.isInteger(value) || value < min || value > max)) {
|
|
1844
|
+
throw new CliError("invalid_arguments", `--${flag} must be an integer from ${min} to ${max}.`);
|
|
1845
|
+
}
|
|
1846
|
+
return value;
|
|
1847
|
+
};
|
|
1848
|
+
const coinAmount = integer("coin-amount", 0, 1000);
|
|
1849
|
+
const estimatedMinutes = integer("estimated-minutes", 5, 600);
|
|
1850
|
+
const text = {
|
|
1851
|
+
title: flagString(parsed, "title"),
|
|
1852
|
+
description: flagString(parsed, "description"),
|
|
1853
|
+
instructions,
|
|
1854
|
+
submissionPrompt: flagString(parsed, "submission-prompt"),
|
|
1855
|
+
gradeTag: flagString(parsed, "grade-tag"),
|
|
1856
|
+
category: flagString(parsed, "category"),
|
|
1857
|
+
imageUrl: flagString(parsed, "image-url"),
|
|
1858
|
+
};
|
|
1859
|
+
return {
|
|
1860
|
+
...Object.fromEntries(Object.entries(text).filter(([, value]) => value !== undefined)),
|
|
1861
|
+
...(coinAmount === undefined ? {} : { coinAmount }),
|
|
1862
|
+
...(estimatedMinutes === undefined ? {} : { estimatedMinutes }),
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1827
1865
|
/** Runs the template with Rocky as a kid would (staff only; ephemeral, never touches real todos). */
|
|
1828
1866
|
function goalTemplatePlayTestUrl(webOrigin, templateId) {
|
|
1829
1867
|
return new URL(`/challenges-v2/${encodeURIComponent(templateId)}?play=1`, webOrigin).toString();
|
|
@@ -4566,6 +4604,78 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
4566
4604
|
};
|
|
4567
4605
|
});
|
|
4568
4606
|
}
|
|
4607
|
+
// Classic challenges: one photo-upload module a guide approves, authored
|
|
4608
|
+
// from a few fields (`routes/ai/goal-templates/classic-routes.ts`).
|
|
4609
|
+
if (verb === "classic-create") {
|
|
4610
|
+
const fields = await classicChallengeFlags(parsed);
|
|
4611
|
+
const { title, description, instructions, gradeTag, coinAmount } = fields;
|
|
4612
|
+
if (!title ||
|
|
4613
|
+
!description ||
|
|
4614
|
+
!instructions ||
|
|
4615
|
+
!gradeTag ||
|
|
4616
|
+
coinAmount === undefined) {
|
|
4617
|
+
throw new CliError("invalid_arguments", "classic-create needs --title, --description, --instructions (or --instructions-file), --grade-tag and --coin-amount.");
|
|
4618
|
+
}
|
|
4619
|
+
const body = {
|
|
4620
|
+
...fields,
|
|
4621
|
+
title,
|
|
4622
|
+
description,
|
|
4623
|
+
instructions,
|
|
4624
|
+
gradeTag,
|
|
4625
|
+
coinAmount,
|
|
4626
|
+
};
|
|
4627
|
+
return writeCommand(parsed, {
|
|
4628
|
+
action: "create a PRIVATE classic challenge (kid uploads photos; a guide approves from /challenges-v2/review)",
|
|
4629
|
+
target: { title },
|
|
4630
|
+
request: body,
|
|
4631
|
+
details: {
|
|
4632
|
+
note: "Starts PRIVATE. Card art is painted automatically when no --image-url is given. Publish with goal-templates set-metadata <id> --visibility PUBLIC once it looks right.",
|
|
4633
|
+
},
|
|
4634
|
+
}, async () => {
|
|
4635
|
+
const created = unwrap(await api.client.POST("/ai/goal-templates/classic", { body }));
|
|
4636
|
+
return {
|
|
4637
|
+
...created,
|
|
4638
|
+
previewUrl: goalTemplatePreviewUrl(config.webOrigin, created.templateId),
|
|
4639
|
+
};
|
|
4640
|
+
});
|
|
4641
|
+
}
|
|
4642
|
+
if (verb === "classic-get" || verb === "classic-update") {
|
|
4643
|
+
const id = await resolveGoalTemplateId(api, positional(parsed, 2, "template ID or slug"));
|
|
4644
|
+
const current = unwrap(await api.client.GET("/ai/goal-templates/{id}/classic", {
|
|
4645
|
+
params: { path: { id } },
|
|
4646
|
+
}));
|
|
4647
|
+
if (verb === "classic-get") {
|
|
4648
|
+
return {
|
|
4649
|
+
...current,
|
|
4650
|
+
previewUrl: goalTemplatePreviewUrl(config.webOrigin, id),
|
|
4651
|
+
};
|
|
4652
|
+
}
|
|
4653
|
+
const body = await classicChallengeFlags(parsed);
|
|
4654
|
+
const changed = Object.keys(body);
|
|
4655
|
+
if (changed.length === 0) {
|
|
4656
|
+
throw new CliError("invalid_arguments", "Pass at least one field to change (--title, --description, --instructions/--instructions-file, --submission-prompt, --grade-tag, --coin-amount, --estimated-minutes, --category, --image-url).");
|
|
4657
|
+
}
|
|
4658
|
+
const before = {
|
|
4659
|
+
...current.source,
|
|
4660
|
+
imageUrl: current.imageUrl,
|
|
4661
|
+
};
|
|
4662
|
+
return writeCommand(parsed, {
|
|
4663
|
+
action: "edit a classic challenge (only the fields sent change; cuts a new version)",
|
|
4664
|
+
target: {
|
|
4665
|
+
templateId: id,
|
|
4666
|
+
title: current.source.title,
|
|
4667
|
+
version: current.version,
|
|
4668
|
+
visibility: current.visibility,
|
|
4669
|
+
},
|
|
4670
|
+
request: body,
|
|
4671
|
+
details: {
|
|
4672
|
+
current: Object.fromEntries(changed.map((key) => [key, before[key] ?? null])),
|
|
4673
|
+
},
|
|
4674
|
+
}, async () => unwrap(await api.client.PUT("/ai/goal-templates/{id}/classic", {
|
|
4675
|
+
params: { path: { id } },
|
|
4676
|
+
body,
|
|
4677
|
+
})));
|
|
4678
|
+
}
|
|
4569
4679
|
if (verb === "policy") {
|
|
4570
4680
|
const id = await resolveGoalTemplateId(api, positional(parsed, 2, "template ID or slug"));
|
|
4571
4681
|
return unwrap(await api.client.GET("/ai/goal-templates/{id}/policy", {
|
|
@@ -5235,7 +5345,151 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
5235
5345
|
body: { studentUserId, answers },
|
|
5236
5346
|
})));
|
|
5237
5347
|
}
|
|
5238
|
-
|
|
5348
|
+
if (verb === "publish") {
|
|
5349
|
+
const id = await resolveGoalTemplateId(api, positional(parsed, 2, "template ID or slug"));
|
|
5350
|
+
const commitOid = flagString(parsed, "commit");
|
|
5351
|
+
const sourceDraft = flagString(parsed, "source-draft");
|
|
5352
|
+
if ([commitOid, sourceDraft, flagString(parsed, "source-dir")].filter(Boolean).length !== 1) {
|
|
5353
|
+
throw new CliError("invalid_arguments", "Pass exactly one of --source-draft <draft-slug> --student <kid>, --source-dir <course-dir>, or --commit <course-repo-commit>.");
|
|
5354
|
+
}
|
|
5355
|
+
const local = commitOid || sourceDraft
|
|
5356
|
+
? null
|
|
5357
|
+
: await readGoalWorkspaceWriteSource(parsed);
|
|
5358
|
+
const source = local
|
|
5359
|
+
? { kind: "files", files: local.files }
|
|
5360
|
+
: sourceDraft
|
|
5361
|
+
? {
|
|
5362
|
+
kind: "draft",
|
|
5363
|
+
draft: sourceDraft,
|
|
5364
|
+
studentUserId: (await studentFlag(api, parsed, { required: true })).id,
|
|
5365
|
+
}
|
|
5366
|
+
: { kind: "commit", commitOid: commitOid };
|
|
5367
|
+
const audience = hasFlag(parsed, "all-goals")
|
|
5368
|
+
? "all"
|
|
5369
|
+
: "shared";
|
|
5370
|
+
const preflight = unwrap(await api.client.POST("/ai/goal-templates/{id}/publish", {
|
|
5371
|
+
params: { path: { id } },
|
|
5372
|
+
body: { source, dryRun: true, audience },
|
|
5373
|
+
}));
|
|
5374
|
+
if (preflight.action !== "preview_course_publish") {
|
|
5375
|
+
throw new CliError("unexpected_response", "Course publish did not return a preview; nothing was published.");
|
|
5376
|
+
}
|
|
5377
|
+
if (hasFlag(parsed, "dry-run"))
|
|
5378
|
+
return preflight;
|
|
5379
|
+
const { plan } = preflight;
|
|
5380
|
+
if (plan.problems.length > 0) {
|
|
5381
|
+
throw new CliError("invalid_course", `The course cannot be published; nothing was published:\n- ${plan.problems.join("\n- ")}`, 1, { problems: plan.problems });
|
|
5382
|
+
}
|
|
5383
|
+
if (plan.unchanged) {
|
|
5384
|
+
return {
|
|
5385
|
+
...preflight,
|
|
5386
|
+
next: "No course file changed; nothing to publish.",
|
|
5387
|
+
};
|
|
5388
|
+
}
|
|
5389
|
+
if (!preflight.publishEnabled) {
|
|
5390
|
+
throw new CliError("publish_disabled", "Course publishing is off on this server (COURSE_PUBLISH_ENABLED). Run with --dry-run to see the plan; nothing was published.", 1, { affectedKids: plan.affectedKids, midLesson: plan.midLesson });
|
|
5391
|
+
}
|
|
5392
|
+
const preview = {
|
|
5393
|
+
action: `publish a new course version that every kid on it reads at once (affects ${plan.affectedKids} kids, ${plan.midLesson} mid-lesson)`,
|
|
5394
|
+
target: {
|
|
5395
|
+
templateId: plan.goalTemplateId,
|
|
5396
|
+
slug: plan.slug,
|
|
5397
|
+
title: plan.title,
|
|
5398
|
+
version: plan.templateVersion,
|
|
5399
|
+
},
|
|
5400
|
+
request: {
|
|
5401
|
+
source: local
|
|
5402
|
+
? {
|
|
5403
|
+
kind: "directory",
|
|
5404
|
+
absolutePath: local.source.absolutePath,
|
|
5405
|
+
fileCount: local.files.length,
|
|
5406
|
+
sha256: local.sha256,
|
|
5407
|
+
}
|
|
5408
|
+
: source,
|
|
5409
|
+
audience,
|
|
5410
|
+
digest: plan.digest,
|
|
5411
|
+
},
|
|
5412
|
+
details: {
|
|
5413
|
+
affectedKids: plan.affectedKids,
|
|
5414
|
+
affectedGoals: plan.affectedGoals,
|
|
5415
|
+
midLesson: plan.midLesson,
|
|
5416
|
+
warnings: plan.warnings.map((warning) => ({
|
|
5417
|
+
kind: warning.kind,
|
|
5418
|
+
lesson: warning.title,
|
|
5419
|
+
detail: warning.detail,
|
|
5420
|
+
goals: warning.goalIds.length,
|
|
5421
|
+
midLesson: warning.midLessonGoalIds.length,
|
|
5422
|
+
})),
|
|
5423
|
+
lessons: plan.lessons,
|
|
5424
|
+
changes: plan.changes,
|
|
5425
|
+
stampedKeys: plan.stampedKeys,
|
|
5426
|
+
dropped: plan.dropped,
|
|
5427
|
+
...(plan.killSwitchActive
|
|
5428
|
+
? {
|
|
5429
|
+
killSwitch: "GOAL_CONTENT_SOURCE_OVERRIDE=COPY: no goal reads the course until it is lifted.",
|
|
5430
|
+
}
|
|
5431
|
+
: {}),
|
|
5432
|
+
note: "Every kid on this course (SHARED goals) reads the new version from their next session; progress and notes are keyed by Item key. The confirmed publish is fenced to this exact plan digest.",
|
|
5433
|
+
},
|
|
5434
|
+
};
|
|
5435
|
+
return previewBoundWrite(parsed, preview, async () => unwrap(await api.client.POST("/ai/goal-templates/{id}/publish", {
|
|
5436
|
+
params: { path: { id } },
|
|
5437
|
+
body: {
|
|
5438
|
+
source,
|
|
5439
|
+
dryRun: false,
|
|
5440
|
+
audience,
|
|
5441
|
+
expectedDigest: plan.digest,
|
|
5442
|
+
},
|
|
5443
|
+
})));
|
|
5444
|
+
}
|
|
5445
|
+
throw new CliError("invalid_arguments", "Use goal-templates list|get|versions|validate-spec|create|classic-create|classic-get|classic-update|patch-spec|set-metadata|generate-image|delete|snapshot-files|capture-snapshot|publish|answers-template|apply|apply-starter.");
|
|
5446
|
+
}
|
|
5447
|
+
if (noun === "goals" && (verb === "notes" || verb === "progress")) {
|
|
5448
|
+
const student = await studentFlag(api, parsed, { required: true });
|
|
5449
|
+
const studentId = student.id;
|
|
5450
|
+
const goalId = flagString(parsed, "goal", { required: true });
|
|
5451
|
+
const params = { params: { path: { studentId, goalId } } };
|
|
5452
|
+
if (verb === "progress") {
|
|
5453
|
+
return unwrap(await api.client.GET("/tutor/students/{studentId}/goals/{goalId}/progress", params));
|
|
5454
|
+
}
|
|
5455
|
+
const action = positional(parsed, 2, "goals notes action");
|
|
5456
|
+
const lesson = flagString(parsed, "lesson");
|
|
5457
|
+
if (action === "list" || action === "get") {
|
|
5458
|
+
const notes = unwrap(await api.client.GET("/tutor/students/{studentId}/goals/{goalId}/notes", params));
|
|
5459
|
+
if (action === "list")
|
|
5460
|
+
return notes;
|
|
5461
|
+
if (!lesson) {
|
|
5462
|
+
return { goalId, contentSource: notes.contentSource, note: notes.goal };
|
|
5463
|
+
}
|
|
5464
|
+
const match = notes.lessons.find((entry) => entry.key === lesson || entry.ref === lesson);
|
|
5465
|
+
if (!match) {
|
|
5466
|
+
throw new CliError("not_found", `No lesson ${lesson} on goal ${goalId}; goals notes list shows each lesson's key.`);
|
|
5467
|
+
}
|
|
5468
|
+
return { goalId, contentSource: notes.contentSource, lesson: match };
|
|
5469
|
+
}
|
|
5470
|
+
if (action === "set") {
|
|
5471
|
+
const textFile = flagString(parsed, "text-file");
|
|
5472
|
+
const text = textFile
|
|
5473
|
+
? await fs.readFile(path.resolve(textFile), "utf8")
|
|
5474
|
+
: flagString(parsed, "text");
|
|
5475
|
+
if (!text?.trim() || (textFile && flagString(parsed, "text"))) {
|
|
5476
|
+
throw new CliError("invalid_arguments", "Pass exactly one of --text TEXT or --text-file <path>.");
|
|
5477
|
+
}
|
|
5478
|
+
const mode = hasFlag(parsed, "append")
|
|
5479
|
+
? "append"
|
|
5480
|
+
: "replace";
|
|
5481
|
+
const body = { lesson: lesson ?? null, text: text.trim(), mode };
|
|
5482
|
+
return writeCommand(parsed, {
|
|
5483
|
+
action: `${mode} Rocky's note for this kid on ${lesson ? "a lesson" : "the goal"} (never changes the lesson or its criteria)`,
|
|
5484
|
+
target: { studentId, goalId, lesson: lesson ?? "goal" },
|
|
5485
|
+
request: body,
|
|
5486
|
+
details: {
|
|
5487
|
+
...resolvedStudentDetails(student),
|
|
5488
|
+
note: "Notes exist only on shared-course goals. To change the lesson itself for every kid, edit the course and run goal-templates publish.",
|
|
5489
|
+
},
|
|
5490
|
+
}, async () => unwrap(await api.client.PUT("/tutor/students/{studentId}/goals/{goalId}/notes", { ...params, body })));
|
|
5491
|
+
}
|
|
5492
|
+
throw new CliError("invalid_arguments", "Use goals notes list|get|set.");
|
|
5239
5493
|
}
|
|
5240
5494
|
if (noun === "goals" && verb === "adaptations") {
|
|
5241
5495
|
const action = positional(parsed, 2, "goals adaptations action");
|
|
@@ -6778,12 +7032,21 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6778
7032
|
}
|
|
6779
7033
|
if (action === "checkout") {
|
|
6780
7034
|
const response = await readRemoteWorkspaceSnapshot(api, studentId, target);
|
|
6781
|
-
|
|
7035
|
+
const checkedOut = await checkoutGoalWorkspace({
|
|
6782
7036
|
outputDirectory,
|
|
6783
7037
|
studentId,
|
|
6784
7038
|
target,
|
|
6785
7039
|
snapshot: response.snapshot,
|
|
6786
7040
|
});
|
|
7041
|
+
// SHARED goal: the checkout is the merged view; lesson files are
|
|
7042
|
+
// read-only (a push to them is refused), so say so up front.
|
|
7043
|
+
if (!response.sharedCourse)
|
|
7044
|
+
return checkedOut;
|
|
7045
|
+
return {
|
|
7046
|
+
...checkedOut,
|
|
7047
|
+
sharedCourse: response.sharedCourse,
|
|
7048
|
+
next: `${response.sharedCourse.message} ${checkedOut.next}`,
|
|
7049
|
+
};
|
|
6787
7050
|
}
|
|
6788
7051
|
// The server scaffold is a fixed two-lesson tree; an explicit --modules
|
|
6789
7052
|
// count keeps the local scaffold, as does a server without the init route.
|
package/dist/command-schema.js
CHANGED
|
@@ -117,13 +117,21 @@ const FAMILY_AI_COMMANDS = new Set([
|
|
|
117
117
|
"goal-templates apply",
|
|
118
118
|
"goal-templates apply-starter",
|
|
119
119
|
"goal-templates capture-snapshot",
|
|
120
|
+
"goal-templates classic-create",
|
|
121
|
+
// classic-get/-update: staff, or the author on their own PRIVATE draft.
|
|
122
|
+
"goal-templates classic-get",
|
|
123
|
+
"goal-templates classic-update",
|
|
120
124
|
"goal-templates create",
|
|
121
125
|
// set-metadata/delete/patch-spec: the server lets a non-staff author touch
|
|
122
|
-
// only their own PRIVATE templates
|
|
126
|
+
// only their own PRIVATE templates, plus unpublish (set-metadata
|
|
127
|
+
// --visibility PRIVATE alone) their own published one.
|
|
123
128
|
"goal-templates delete",
|
|
124
129
|
"goal-templates get",
|
|
125
130
|
"goal-templates list",
|
|
126
131
|
"goal-templates patch-spec",
|
|
132
|
+
// publish: the server allows staff or the author, and only while every kid
|
|
133
|
+
// reading the course is one the caller manages.
|
|
134
|
+
"goal-templates publish",
|
|
127
135
|
"goal-templates set-metadata",
|
|
128
136
|
"goal-templates snapshot-files",
|
|
129
137
|
"goal-templates validate-spec",
|
|
@@ -142,7 +150,11 @@ const FAMILY_AI_COMMANDS = new Set([
|
|
|
142
150
|
"goals launch-todo",
|
|
143
151
|
"goals list",
|
|
144
152
|
"goals move-module",
|
|
153
|
+
"goals notes get",
|
|
154
|
+
"goals notes list",
|
|
155
|
+
"goals notes set",
|
|
145
156
|
"goals pdf upload",
|
|
157
|
+
"goals progress",
|
|
146
158
|
"goals video upload",
|
|
147
159
|
"goals queue get",
|
|
148
160
|
"goals queue set",
|
|
@@ -486,6 +486,38 @@ export async function runAdmissionsCommand({ parsed, api, writeCommand, }) {
|
|
|
486
486
|
return json ? result : { help: await render(result.packet) };
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
+
if (verb === "set-paywall") {
|
|
490
|
+
const packetId = positional(parsed, 2, "packet ID");
|
|
491
|
+
const paywallRaw = flagString(parsed, "paywall")?.replace(/[$,]/g, "");
|
|
492
|
+
const paywall = paywallRaw === undefined ? undefined : Number(paywallRaw);
|
|
493
|
+
if (paywall !== undefined && (!Number.isFinite(paywall) || paywall <= 0)) {
|
|
494
|
+
throw new CliError("invalid_arguments", "--paywall must be a positive dollar amount; --no-paywall removes it.");
|
|
495
|
+
}
|
|
496
|
+
const offlinePaywall = hasFlag(parsed, "paywall-offline");
|
|
497
|
+
const noPaywall = hasFlag(parsed, "no-paywall");
|
|
498
|
+
if ([paywall !== undefined, noPaywall, offlinePaywall].filter(Boolean)
|
|
499
|
+
.length !== 1) {
|
|
500
|
+
throw new CliError("invalid_arguments", "Use exactly one of --paywall DOLLARS, --paywall-offline or --no-paywall.");
|
|
501
|
+
}
|
|
502
|
+
const note = flagString(parsed, "note")?.trim();
|
|
503
|
+
const body = {
|
|
504
|
+
...(offlinePaywall
|
|
505
|
+
? { paywallOutOfBand: true }
|
|
506
|
+
: { paywallCents: noPaywall ? null : Math.round(paywall * 100) }),
|
|
507
|
+
...(note ? { note } : {}),
|
|
508
|
+
};
|
|
509
|
+
return writeCommand(parsed, {
|
|
510
|
+
action: `set admission packet ${packetId}'s paywall to ${offlinePaywall ? "the signed plan's first invoice, paid out of band" : noPaywall ? "none" : `${dollars(Math.round(paywall * 100))} by card`}, keeping the agreement and signature; a packet at the payment step reopens the new paywall or completes`,
|
|
511
|
+
target: { packetId },
|
|
512
|
+
request: body,
|
|
513
|
+
}, async () => {
|
|
514
|
+
const result = unwrap(await api.client.POST("/admin/admissions/{packetId}/paywall", {
|
|
515
|
+
params: { path: { packetId } },
|
|
516
|
+
body,
|
|
517
|
+
}));
|
|
518
|
+
return json ? result : { help: await render(result.packet) };
|
|
519
|
+
});
|
|
520
|
+
}
|
|
489
521
|
if (verb === "contract") {
|
|
490
522
|
const packetId = positional(parsed, 2, "packet ID");
|
|
491
523
|
const option = flagString(parsed, "option");
|
|
@@ -540,6 +572,6 @@ export async function runAdmissionsCommand({ parsed, api, writeCommand, }) {
|
|
|
540
572
|
};
|
|
541
573
|
});
|
|
542
574
|
}
|
|
543
|
-
throw new CliError("invalid_arguments", "Usage: recess admissions create|get|list|resend|void|mark-signed|upload-signed|contract|mark-paid|requote|archive-agreement. See `recess help`.");
|
|
575
|
+
throw new CliError("invalid_arguments", "Usage: recess admissions create|get|list|resend|void|mark-signed|upload-signed|contract|mark-paid|set-paywall|requote|archive-agreement. See `recess help`.");
|
|
544
576
|
}
|
|
545
577
|
//# sourceMappingURL=admissions.js.map
|
package/dist/goal-authoring.js
CHANGED
|
@@ -44,7 +44,7 @@ You are Rocky, running **${title}** with one student.
|
|
|
44
44
|
|
|
45
45
|
## File discipline
|
|
46
46
|
|
|
47
|
-
-
|
|
47
|
+
- Recess tracks progress; the review after the student taps Submit completes a module.
|
|
48
48
|
- Put student-facing work under \`resources/\`; student uploads arrive under \`uploads/\`.`),
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -87,11 +87,7 @@ Where to start: name the exact page, app, file, or tab Rocky opens first, then t
|
|
|
87
87
|
|
|
88
88
|
## Completion criteria
|
|
89
89
|
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
## State updates
|
|
93
|
-
|
|
94
|
-
- Keep the current step in \`state/progress.json\` current; \`complete_module\` records the completion.`),
|
|
90
|
+
- What the student does or makes that proves the learning target${index === modules.length - 1 ? " and finishes the path" : ""}.`),
|
|
95
91
|
})),
|
|
96
92
|
];
|
|
97
93
|
}
|
|
@@ -117,7 +113,6 @@ const READY_MODULE_REQUIREMENTS = [
|
|
|
117
113
|
patterns: [/^Resources(?: and surfaces)?\b/i],
|
|
118
114
|
},
|
|
119
115
|
{ label: "completion criteria", patterns: [/^Completion criteria\b/i] },
|
|
120
|
-
{ label: "state updates", patterns: [/^State updates\b/i] },
|
|
121
116
|
];
|
|
122
117
|
const SIMPLE_DAILY_TODO_GOAL_MODES = new Set([
|
|
123
118
|
"simple_daily_todos",
|
|
@@ -224,7 +219,7 @@ function moduleContentErrors(path, content) {
|
|
|
224
219
|
}
|
|
225
220
|
const errors = missing.length
|
|
226
221
|
? [
|
|
227
|
-
`${path} is not a complete runtime module; missing ${missing.join(", ")}. Required: a Summary line or ## Summary, an Estimated time line, and populated ## Learning targets, ## Tutor guidance, ## Resources and surfaces, ## Completion criteria
|
|
222
|
+
`${path} is not a complete runtime module; missing ${missing.join(", ")}. Required: a Summary line or ## Summary, an Estimated time line, and populated ## Learning targets, ## Tutor guidance, ## Resources and surfaces, ## Completion criteria.`,
|
|
228
223
|
]
|
|
229
224
|
: [];
|
|
230
225
|
const itemKey = headerField(lines, "Item key");
|
package/dist/help.js
CHANGED
|
@@ -226,6 +226,7 @@ Usage:
|
|
|
226
226
|
[--paywall DOLLARS|--paywall-offline|--no-paywall] [--note TEXT] [--confirm]
|
|
227
227
|
recess [--json] admissions archive-agreement <packet-id> [--confirm]
|
|
228
228
|
recess [--json] admissions mark-paid <packet-id> [--note TEXT] [--confirm]
|
|
229
|
+
recess [--json] admissions set-paywall <packet-id> (--paywall DOLLARS | --paywall-offline | --no-paywall) [--note TEXT] [--confirm]
|
|
229
230
|
recess [--json] admissions contract <packet-id> [--option <term:payment>] [--out <file>]
|
|
230
231
|
recess [--json] admissions upload-signed <packet-id> --file <pdf> [--option <term:payment>] [--note TEXT] [--confirm]
|
|
231
232
|
recess [--json] reports activity [--partner-school <slug|id>] [--guide <name|email|id>]
|
|
@@ -462,6 +463,15 @@ Usage:
|
|
|
462
463
|
recess [--json] goal-templates validate-spec --file <path/template.json>
|
|
463
464
|
recess [--json] goal-templates create --file <path/template.json>
|
|
464
465
|
[--coin-amount N] [--confirm]
|
|
466
|
+
recess [--json] goal-templates classic-create --title TEXT --description TEXT
|
|
467
|
+
(--instructions TEXT | --instructions-file <path.md>) --grade-tag "Grades 3-6"
|
|
468
|
+
--coin-amount N [--submission-prompt TEXT] [--estimated-minutes N]
|
|
469
|
+
[--category TEXT] [--image-url URL] [--confirm]
|
|
470
|
+
recess [--json] goal-templates classic-get <template-id|slug>
|
|
471
|
+
recess [--json] goal-templates classic-update <template-id|slug> [--title TEXT]
|
|
472
|
+
[--description TEXT] [--instructions TEXT | --instructions-file <path.md>]
|
|
473
|
+
[--grade-tag TEXT] [--coin-amount N] [--submission-prompt TEXT]
|
|
474
|
+
[--estimated-minutes N] [--category TEXT] [--image-url URL] [--confirm]
|
|
465
475
|
recess [--json] goal-templates patch-spec <template-id|slug> [--expected-version N]
|
|
466
476
|
--patches-file <path/patches.json> [--confirm --approval-token TOKEN]
|
|
467
477
|
[--confirm-destructive-changes --destructive-change-token TOKEN]
|
|
@@ -479,6 +489,10 @@ Usage:
|
|
|
479
489
|
(--source-goal <goal-id> | --source-draft <draft-slug> --student <goal-owner-id>
|
|
480
490
|
| --source-dir <local-checkout>)
|
|
481
491
|
[--dry-run] [--confirm --approval-token TOKEN]
|
|
492
|
+
recess [--json] goal-templates publish <template-id|slug>
|
|
493
|
+
(--source-draft <draft-slug> --student <draft-owner-id>
|
|
494
|
+
| --source-dir <course-dir> | --commit <course-repo-commit>) [--all-goals]
|
|
495
|
+
[--dry-run] [--confirm --approval-token TOKEN]
|
|
482
496
|
recess [--json] goal-templates answers-template <template-id|slug>
|
|
483
497
|
[--student <kid-id-or-name>]
|
|
484
498
|
recess [--json] goal-templates apply <template-id> [--student <kid-id-or-name>]
|
|
@@ -552,6 +566,13 @@ Usage:
|
|
|
552
566
|
[--lessons-dir <dir>] [--emoji TEXT] [--grade-min N] [--grade-max N]
|
|
553
567
|
[--visibility PUBLIC|STAFF] [--confirm]
|
|
554
568
|
recess [--json] tutor-templates delete <slug> [--confirm]
|
|
569
|
+
recess [--json] goals notes list --student <goal-owner-id> --goal <goal-id>
|
|
570
|
+
recess [--json] goals notes get --student <goal-owner-id> --goal <goal-id>
|
|
571
|
+
[--lesson <item-key|module-ref>]
|
|
572
|
+
recess [--json] goals notes set --student <goal-owner-id> --goal <goal-id>
|
|
573
|
+
[--lesson <item-key|module-ref>] (--text TEXT | --text-file <path>) [--append]
|
|
574
|
+
[--confirm --approval-token TOKEN]
|
|
575
|
+
recess [--json] goals progress --student <goal-owner-id> --goal <goal-id>
|
|
555
576
|
recess [--json] goals adaptations list --student <goal-owner-id> --goal <goal-id>
|
|
556
577
|
recess [--json] goals adaptations diff <run-id> --student <goal-owner-id>
|
|
557
578
|
--goal <goal-id> [--path P]
|
|
@@ -583,6 +604,11 @@ bundled into this npm package. Load os-v2-goal-template-builder and its
|
|
|
583
604
|
references/deterministic-workflow-setup.md BEFORE authoring a template; that is
|
|
584
605
|
the same guidance the recess.gg/ai agent follows, so there is exactly one
|
|
585
606
|
standard. Responses cache under ~/.recess-cli/skills-cache/ (--refresh re-fetches).
|
|
607
|
+
Shared courses (a goal with contentSource SHARED): every kid reads the course's
|
|
608
|
+
latest published version, so "goal-templates publish" is the one way to change a
|
|
609
|
+
lesson; it previews "affects N kids (M mid-lesson)". Per-kid tailoring is a note
|
|
610
|
+
("goals notes set"), never a lesson edit: goal file pushes to lesson paths are
|
|
611
|
+
refused. capture-snapshot and the curriculum commands are deprecated for them.
|
|
586
612
|
Goal file writes/pushes warn and refuse curriculum edits with unfinished assignments
|
|
587
613
|
unless --allow-assigned-edits is supplied. This can change lessons while a student
|
|
588
614
|
is working; assignments are not retired/completed and student answers are not merged.
|
|
@@ -606,6 +632,9 @@ the backend's own dryRun before the gate and previews the per-student outcome.
|
|
|
606
632
|
"set-metadata", "delete", "patch-spec" and "set-policy" take an optional
|
|
607
633
|
--expected-version; omitted, the current version is read and pinned into the
|
|
608
634
|
preview, so a change before confirm is refused. A stale one 409s STALE_WRITE.
|
|
635
|
+
"classic-create" makes a single human-reviewed module (kid submits photos, a guide
|
|
636
|
+
approves from /challenges-v2/review) from a few fields, as a PRIVATE draft; publish
|
|
637
|
+
with "set-metadata <id> --visibility PUBLIC". Edit it with "classic-update", not patch-spec.
|
|
609
638
|
--student on goal, todo, goal-file and template-apply commands takes an ID or an
|
|
610
639
|
exact roster name. "answers-template" prints a fillable answers file for "apply". The spec is unreachable from "set-metadata"
|
|
611
640
|
by design — an existing spec is edited only through the guarded /ai patch path.
|
|
@@ -853,7 +882,11 @@ plan flags as create, or --keep-plan to reopen the payment choice on the plan
|
|
|
853
882
|
as it is; --paywall/--no-paywall changes the family share): the Documenso
|
|
854
883
|
envelope is cancelled, the family signs again from the same link, and their
|
|
855
884
|
account, consent and answers stand (a completed packet completes again on its
|
|
856
|
-
own); paid packets need a refund first and voided ones a new packet. "
|
|
885
|
+
own); paid packets need a refund first and voided ones a new packet. "set-paywall" changes only the paywall (--paywall DOLLARS, --paywall-offline or
|
|
886
|
+
--no-paywall) with no re-signing: the agreement stands, an open admission
|
|
887
|
+
charge Stripe never saw is canceled, and a packet at the payment step reopens
|
|
888
|
+
the new paywall or completes. It refuses while the parent is mid-signing.
|
|
889
|
+
"mark-signed" records a signature taken outside the dashboard (or local
|
|
857
890
|
testing without Documenso) so the parent can continue. Status moves on its own:
|
|
858
891
|
the Documenso webhook marks SIGNED, each parent step advances it, and a packet
|
|
859
892
|
with no paywall completes when the questions are in.
|
|
@@ -1192,22 +1225,26 @@ export const COMMAND_SUMMARIES = {
|
|
|
1192
1225
|
"goal-templates migrate-policy": "Migrate students' goals to the template policy.",
|
|
1193
1226
|
"goal-templates student-policy": "Edit one student's goal policy.",
|
|
1194
1227
|
"goal-templates retire-assignments": "Retire a goal's open assignments.",
|
|
1195
|
-
"goal-templates curriculum backlog": "Show goals' curriculum backlog.",
|
|
1196
|
-
"goal-templates curriculum preview": "Preview a curriculum version upgrade.",
|
|
1197
|
-
"goal-templates curriculum validate-resolutions": "Validate curriculum-upgrade conflict resolutions.",
|
|
1198
|
-
"goal-templates curriculum apply": "Apply a curriculum version to goals.",
|
|
1199
|
-
"goal-templates curriculum reverse": "Reverse a curriculum upgrade on goals.",
|
|
1200
|
-
"goal-templates curriculum status": "Check a curriculum job's status.",
|
|
1201
|
-
"goal-templates curriculum retry": "Retry a failed curriculum job.",
|
|
1228
|
+
"goal-templates curriculum backlog": "Show goals' curriculum backlog (deprecated for shared courses).",
|
|
1229
|
+
"goal-templates curriculum preview": "Preview a curriculum version upgrade (deprecated for shared courses).",
|
|
1230
|
+
"goal-templates curriculum validate-resolutions": "Validate curriculum-upgrade conflict resolutions (deprecated for shared courses).",
|
|
1231
|
+
"goal-templates curriculum apply": "Apply a curriculum version to goals (deprecated for shared courses).",
|
|
1232
|
+
"goal-templates curriculum reverse": "Reverse a curriculum upgrade on goals (deprecated for shared courses).",
|
|
1233
|
+
"goal-templates curriculum status": "Check a curriculum job's status (deprecated for shared courses).",
|
|
1234
|
+
"goal-templates curriculum retry": "Retry a failed curriculum job (deprecated for shared courses).",
|
|
1202
1235
|
"goal-templates versions": "List a template's version history.",
|
|
1203
1236
|
"goal-templates validate-spec": "Validate a template file (no write).",
|
|
1204
1237
|
"goal-templates create": "Create a goal template from a file.",
|
|
1238
|
+
"goal-templates classic-create": "Create a classic challenge: kid uploads photos, a guide approves (starts PRIVATE).",
|
|
1239
|
+
"goal-templates classic-get": "Read a classic challenge's editable fields.",
|
|
1240
|
+
"goal-templates classic-update": "Edit a classic challenge's fields (only those passed change).",
|
|
1205
1241
|
"goal-templates patch-spec": "Patch a template's setup-workflow spec (own PRIVATE ones for guardians).",
|
|
1206
|
-
"goal-templates set-metadata": "Edit a template's title, art, tags, visibility (own PRIVATE ones for guardians).",
|
|
1242
|
+
"goal-templates set-metadata": "Edit a template's title, art, tags, visibility (own PRIVATE ones for guardians, who may also unpublish their own: --visibility PRIVATE alone).",
|
|
1207
1243
|
"goal-templates delete": "Delete a goal template (own PRIVATE ones for guardians).",
|
|
1208
1244
|
"goal-templates generate-image": "Generate a template's cover art.",
|
|
1209
1245
|
"goal-templates snapshot-files": "List or read a template's snapshot files.",
|
|
1210
|
-
"goal-templates capture-snapshot": "Capture a goal/draft/checkout into a template snapshot.",
|
|
1246
|
+
"goal-templates capture-snapshot": "Capture a goal/draft/checkout into a template snapshot (deprecated for shared courses: use publish).",
|
|
1247
|
+
"goal-templates publish": "Publish a course version every kid on it reads (own templates for guardians); previews 'affects N kids'.",
|
|
1211
1248
|
"goal-templates answers-template": "Print a fillable answers file for a template's wizard.",
|
|
1212
1249
|
"goal-templates apply": "Apply a template for a student from answers.",
|
|
1213
1250
|
"goal-templates apply-starter": "Apply a starter template for a kid.",
|
|
@@ -1249,6 +1286,10 @@ export const COMMAND_SUMMARIES = {
|
|
|
1249
1286
|
"tutor-templates create": "Create a tutor template.",
|
|
1250
1287
|
"tutor-templates update": "Update a tutor template.",
|
|
1251
1288
|
"tutor-templates delete": "Delete a tutor template.",
|
|
1289
|
+
"goals notes list": "List Rocky's per-kid notes on a shared-course goal.",
|
|
1290
|
+
"goals notes get": "Read the goal's or one lesson's note.",
|
|
1291
|
+
"goals notes set": "Write Rocky's note for this kid on a lesson (never the lesson itself).",
|
|
1292
|
+
"goals progress": "Per-lesson progress for one kid's goal.",
|
|
1252
1293
|
"goals adaptations list": "List a goal's adaptation runs.",
|
|
1253
1294
|
"goals adaptations diff": "Diff the files an adaptation run changed.",
|
|
1254
1295
|
"goals files list": "List a goal workspace's files.",
|
package/package.json
CHANGED