recess-cli 3.22.1 → 3.24.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/args.js +1 -0
- package/dist/cli.js +49 -3
- package/dist/command-schema.js +4 -0
- package/dist/commands/apps.js +3 -0
- package/dist/commands/dms.js +72 -0
- package/dist/commands/mastery.js +1 -1
- package/dist/commands/rocky-free.js +22 -22
- package/dist/commands/skill-links.js +91 -0
- package/dist/help.js +15 -3
- package/package.json +1 -1
package/dist/args.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { runChatLogsCommand } from "./commands/chat-logs.js";
|
|
|
15
15
|
import { runLibraryBooksCommand } from "./commands/library-books.js";
|
|
16
16
|
import { runDbCommand } from "./commands/db.js";
|
|
17
17
|
import { runRoomsCommand } from "./commands/rooms.js";
|
|
18
|
+
import { runDmsCommand } from "./commands/dms.js";
|
|
18
19
|
import { runFeedCommand } from "./commands/feed.js";
|
|
19
20
|
import { runFamiliesCommand } from "./commands/families.js";
|
|
20
21
|
import { runFamilyCommand, runKidCommand } from "./commands/family.js";
|
|
@@ -374,6 +375,7 @@ async function localWriteCommand(parsed, preview, execute, options = {}) {
|
|
|
374
375
|
fingerprint,
|
|
375
376
|
target: preview.target,
|
|
376
377
|
...(preview.action.startsWith("mastery.") ||
|
|
378
|
+
preview.action.startsWith("apps.link") ||
|
|
377
379
|
preview.request.attendanceTakenAt ||
|
|
378
380
|
preview.request.zeroBalance === "true"
|
|
379
381
|
? { preview }
|
|
@@ -6028,6 +6030,9 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6028
6030
|
if (noun === "feed") {
|
|
6029
6031
|
return runFeedCommand({ parsed, api, writeCommand });
|
|
6030
6032
|
}
|
|
6033
|
+
if (noun === "dms") {
|
|
6034
|
+
return runDmsCommand({ parsed, api, writeCommand });
|
|
6035
|
+
}
|
|
6031
6036
|
if (noun === "students" && verb === "texts") {
|
|
6032
6037
|
return runStudentsTextsCommand({ parsed, api, writeCommand });
|
|
6033
6038
|
}
|
|
@@ -6138,6 +6143,34 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6138
6143
|
},
|
|
6139
6144
|
}));
|
|
6140
6145
|
}
|
|
6146
|
+
if (verb === "mastery") {
|
|
6147
|
+
const userId = flagString(parsed, "student", { required: true });
|
|
6148
|
+
const status = flagString(parsed, "status");
|
|
6149
|
+
return unwrap(await api.client.GET("/tutor/browser/students/{userId}/mastery/skills/", {
|
|
6150
|
+
params: {
|
|
6151
|
+
path: { userId },
|
|
6152
|
+
query: {
|
|
6153
|
+
domainSlug: flagString(parsed, "domain"),
|
|
6154
|
+
...(status
|
|
6155
|
+
? {
|
|
6156
|
+
status: assertChoice(status, [
|
|
6157
|
+
"UNSEEN",
|
|
6158
|
+
"EXPOSED",
|
|
6159
|
+
"PRACTICING",
|
|
6160
|
+
"PROFICIENT",
|
|
6161
|
+
"MASTERED",
|
|
6162
|
+
"STALE",
|
|
6163
|
+
"BLOCKED",
|
|
6164
|
+
], "--status"),
|
|
6165
|
+
}
|
|
6166
|
+
: {}),
|
|
6167
|
+
...(hasFlag(parsed, "struggling")
|
|
6168
|
+
? { struggling: "true" }
|
|
6169
|
+
: {}),
|
|
6170
|
+
},
|
|
6171
|
+
},
|
|
6172
|
+
}));
|
|
6173
|
+
}
|
|
6141
6174
|
if (verb === "math-academy") {
|
|
6142
6175
|
const studentId = flagString(parsed, "student", { required: true });
|
|
6143
6176
|
const startDate = flagString(parsed, "from");
|
|
@@ -6218,7 +6251,7 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6218
6251
|
return { studentId, flashcardReviewEnabled: on };
|
|
6219
6252
|
});
|
|
6220
6253
|
}
|
|
6221
|
-
throw new CliError("invalid_arguments", "Use students list|today|schedule|todos|analysis|xp-history|upload-map-scores|issue-email|web-todos|flashcards.");
|
|
6254
|
+
throw new CliError("invalid_arguments", "Use students list|today|schedule|todos|analysis|xp-history|mastery|upload-map-scores|issue-email|web-todos|flashcards.");
|
|
6222
6255
|
}
|
|
6223
6256
|
if (noun === "todos") {
|
|
6224
6257
|
if (verb === "create") {
|
|
@@ -6442,6 +6475,13 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6442
6475
|
const student = await studentFlag(api, parsed, { required: true });
|
|
6443
6476
|
const studentId = student.id;
|
|
6444
6477
|
const targetDueDateISO = flagDateOnly(parsed, "due-date");
|
|
6478
|
+
const mode = flagString(parsed, "mode");
|
|
6479
|
+
if (mode !== undefined &&
|
|
6480
|
+
mode !== "game" &&
|
|
6481
|
+
mode !== "lesson" &&
|
|
6482
|
+
mode !== "diagram") {
|
|
6483
|
+
throw new CliError("invalid_arguments", "--mode must be game, lesson or diagram.");
|
|
6484
|
+
}
|
|
6445
6485
|
const [todo, learningAnalysis] = await Promise.all([
|
|
6446
6486
|
api.client.GET("/tutor/browser/todos/{id}/", {
|
|
6447
6487
|
params: { path: { id: todoId } },
|
|
@@ -6468,15 +6508,21 @@ export async function executeRecessCommand(argv, options = {}) {
|
|
|
6468
6508
|
},
|
|
6469
6509
|
request: {
|
|
6470
6510
|
targetDueDateISO: targetDueDateISO ?? null,
|
|
6511
|
+
format: mode ?? null,
|
|
6471
6512
|
},
|
|
6472
6513
|
details: {
|
|
6473
6514
|
dueDate: targetDueDateISO ?? "tomorrow in the student's timezone",
|
|
6474
|
-
|
|
6515
|
+
format: mode
|
|
6516
|
+
? `always builds a ${mode}`
|
|
6517
|
+
: "always builds; the builder picks a game, lesson or diagram",
|
|
6475
6518
|
},
|
|
6476
6519
|
};
|
|
6477
6520
|
return previewBoundWrite(parsed, preview, async () => unwrap(await api.client.POST("/admin/learning-pipeline/{analysisId}/generate-applet/", {
|
|
6478
6521
|
params: { path: { analysisId: analysis.id } },
|
|
6479
|
-
body:
|
|
6522
|
+
body: {
|
|
6523
|
+
...(targetDueDateISO ? { targetDueDateISO } : {}),
|
|
6524
|
+
...(mode ? { format: mode } : {}),
|
|
6525
|
+
},
|
|
6480
6526
|
})));
|
|
6481
6527
|
}
|
|
6482
6528
|
throw new CliError("invalid_arguments", "Use todos create|edit|complete|delete|restore|generate-learning-analysis|generate-applet.");
|
package/dist/command-schema.js
CHANGED
|
@@ -302,6 +302,10 @@ const FAMILY_AI_COMMANDS = new Set([
|
|
|
302
302
|
"tutor-templates unassign",
|
|
303
303
|
]);
|
|
304
304
|
const STAFF_COMMANDS = new Set([
|
|
305
|
+
"students mastery",
|
|
306
|
+
"apps link",
|
|
307
|
+
"apps links",
|
|
308
|
+
"apps unlink",
|
|
305
309
|
"rooms transcripts get",
|
|
306
310
|
"rooms transcripts search",
|
|
307
311
|
"cohorts schedule get",
|
package/dist/commands/apps.js
CHANGED
|
@@ -6,6 +6,7 @@ import { unwrap } from "../api.js";
|
|
|
6
6
|
import { flagNumber, flagString, hasFlag } from "../args.js";
|
|
7
7
|
import { CliError } from "../errors.js";
|
|
8
8
|
import { positional } from "./shared.js";
|
|
9
|
+
import { runSkillLinkCommand, SKILL_LINK_VERBS } from "./skill-links.js";
|
|
9
10
|
const PROJECT_FILE = ".recess/app.json";
|
|
10
11
|
const CONTRACT_FILE = "contract.json";
|
|
11
12
|
const MANIFEST_FILE = "manifest.json";
|
|
@@ -559,6 +560,8 @@ export async function runAppsCommand(ctx) {
|
|
|
559
560
|
throw new CliError("remote_command_unavailable", `apps ${verb ?? ""} is not available over hosted MCP.`);
|
|
560
561
|
}
|
|
561
562
|
}
|
|
563
|
+
if (SKILL_LINK_VERBS.has(verb ?? ""))
|
|
564
|
+
return runSkillLinkCommand(ctx);
|
|
562
565
|
if (verb === "scaffold") {
|
|
563
566
|
const result = await scaffoldResult(ctx, flagString(parsed, "for-todo"));
|
|
564
567
|
return {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { currentOperationKey, unwrap } from "../api.js";
|
|
2
|
+
import { flagString } from "../args.js";
|
|
3
|
+
import { CliError } from "../errors.js";
|
|
4
|
+
import { flagIdList } from "./shared.js";
|
|
5
|
+
/**
|
|
6
|
+
* The send id is derived from the approved operation key; the server derives
|
|
7
|
+
* each message id from it, so a retried confirmation never DMs anyone twice.
|
|
8
|
+
*/
|
|
9
|
+
function sendIdForOperation() {
|
|
10
|
+
const hex = /^op_([a-f0-9]{32})_/.exec(currentOperationKey() ?? "")?.[1];
|
|
11
|
+
if (!hex) {
|
|
12
|
+
throw new CliError("confirmation_required", "A DM can only be sent through a confirmed operation.");
|
|
13
|
+
}
|
|
14
|
+
return [
|
|
15
|
+
hex.slice(0, 8),
|
|
16
|
+
hex.slice(8, 12),
|
|
17
|
+
hex.slice(12, 16),
|
|
18
|
+
hex.slice(16, 20),
|
|
19
|
+
hex.slice(20),
|
|
20
|
+
].join("-");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read-only preflight so the approval names every recipient. Sorted so a
|
|
24
|
+
* confirm-time rerun reproduces the approved preview byte for byte.
|
|
25
|
+
*/
|
|
26
|
+
async function resolveRecipients(api, userIds) {
|
|
27
|
+
const profiles = await Promise.all(userIds.map(async (userId) => unwrap(await api.client.GET("/admin/users/{userId}", {
|
|
28
|
+
params: { path: { userId } },
|
|
29
|
+
}))));
|
|
30
|
+
const disabled = profiles.filter(({ user }) => user.role === "DISABLED");
|
|
31
|
+
if (disabled.length) {
|
|
32
|
+
throw new CliError("invalid_arguments", `Disabled accounts cannot receive DMs: ${disabled
|
|
33
|
+
.map(({ user }) => user.id)
|
|
34
|
+
.join(", ")}.`);
|
|
35
|
+
}
|
|
36
|
+
return profiles
|
|
37
|
+
.map(({ user }) => ({
|
|
38
|
+
id: user.id,
|
|
39
|
+
name: [user.firstName, user.lastName].filter(Boolean).join(" "),
|
|
40
|
+
role: user.role,
|
|
41
|
+
}))
|
|
42
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
43
|
+
}
|
|
44
|
+
export async function runDmsCommand({ parsed, api, writeCommand, }) {
|
|
45
|
+
if (parsed.positionals[1] !== "send") {
|
|
46
|
+
throw new CliError("invalid_arguments", "Use `dms send`.");
|
|
47
|
+
}
|
|
48
|
+
const userIds = Array.from(new Set(flagIdList(parsed, "users")));
|
|
49
|
+
if (userIds.length === 0) {
|
|
50
|
+
throw new CliError("invalid_arguments", "--users is required.");
|
|
51
|
+
}
|
|
52
|
+
if (userIds.length > 50) {
|
|
53
|
+
throw new CliError("invalid_arguments", "--users takes at most 50 ids.");
|
|
54
|
+
}
|
|
55
|
+
const text = flagString(parsed, "text", { required: true }).trim();
|
|
56
|
+
if (!text || text.length > 4000) {
|
|
57
|
+
throw new CliError("invalid_arguments", "--text must be 1 to 4000 characters.");
|
|
58
|
+
}
|
|
59
|
+
return writeCommand(parsed, {
|
|
60
|
+
action: `send this Recess DM as you, 1:1, to ${userIds.length} user(s) (each gets their own DM thread, live and as a push notification)`,
|
|
61
|
+
target: { userIds },
|
|
62
|
+
request: { text },
|
|
63
|
+
details: { recipients: await resolveRecipients(api, userIds) },
|
|
64
|
+
}, async () => unwrap(await api.client.POST("/admin/chat/send-dm/", {
|
|
65
|
+
body: {
|
|
66
|
+
id: sendIdForOperation(),
|
|
67
|
+
recipientUserIds: userIds,
|
|
68
|
+
content: text,
|
|
69
|
+
},
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=dms.js.map
|
package/dist/commands/mastery.js
CHANGED
|
@@ -139,7 +139,7 @@ export async function runMasteryCommand({ parsed, api, writeCommand: gate, }) {
|
|
|
139
139
|
request: body,
|
|
140
140
|
details: {
|
|
141
141
|
graphSha256: hash(graph.graphJson),
|
|
142
|
-
consequence: "Makes this draft the active curriculum graph. Retires the previous release.
|
|
142
|
+
consequence: "Makes this draft the active curriculum graph. Retires the previous release. Content and page links move to the new release for every skill it keeps. First publication may queue historical todo evidence backfill.",
|
|
143
143
|
},
|
|
144
144
|
}, async () => unwrap(await api.client.POST("/ai/rcs/drafts/{id}/promote", {
|
|
145
145
|
params: { path: { id } },
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { unwrap } from "../api.js";
|
|
2
2
|
import { flagNumber, flagString, hasFlag } from "../args.js";
|
|
3
3
|
import { CliError } from "../errors.js";
|
|
4
|
-
const
|
|
4
|
+
const MAX_WEEKLY_BUDGET_USD = 100;
|
|
5
5
|
function budgetFlag(context) {
|
|
6
6
|
const budget = flagNumber(context.parsed, "budget");
|
|
7
7
|
if (budget === undefined)
|
|
8
8
|
return undefined;
|
|
9
|
-
if (budget <= 0 || budget >
|
|
10
|
-
throw new CliError("invalid_arguments", `--budget must be more than 0 and at most ${
|
|
9
|
+
if (budget <= 0 || budget > MAX_WEEKLY_BUDGET_USD) {
|
|
10
|
+
throw new CliError("invalid_arguments", `--budget must be more than 0 and at most ${MAX_WEEKLY_BUDGET_USD} (USD per week).`);
|
|
11
11
|
}
|
|
12
12
|
return budget;
|
|
13
13
|
}
|
|
@@ -19,9 +19,9 @@ function currentStatus(status) {
|
|
|
19
19
|
schoolTierId: status.schoolTierId,
|
|
20
20
|
viaFlag: status.viaFlag,
|
|
21
21
|
grant: status.grant,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
weeklyBudgetUsd: status.weeklyBudgetUsd,
|
|
23
|
+
defaultWeeklyBudgetUsd: status.defaultWeeklyBudgetUsd,
|
|
24
|
+
weekUsd: status.weekUsd,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export async function runRockyFreeCommand(context) {
|
|
@@ -42,36 +42,36 @@ export async function runRockyFreeCommand(context) {
|
|
|
42
42
|
}));
|
|
43
43
|
if (verb === "get")
|
|
44
44
|
return status;
|
|
45
|
-
const putBudget = (
|
|
45
|
+
const putBudget = (weeklyBudgetUsd) => async () => unwrap(await api.client.PUT("/tutor/students/{studentId}/free-rocky", {
|
|
46
46
|
params: { path: { studentId } },
|
|
47
|
-
body: {
|
|
47
|
+
body: { weeklyBudgetUsd },
|
|
48
48
|
}));
|
|
49
49
|
if (verb === "grant") {
|
|
50
50
|
if (hasFlag(parsed, "default")) {
|
|
51
51
|
throw new CliError("invalid_arguments", "grant takes --budget or nothing (the default budget); --default is for set-budget.");
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const weeklyBudgetUsd = budgetFlag(context) ?? null;
|
|
54
54
|
const alreadyGranted = status.grant?.active === true;
|
|
55
55
|
return writeCommand(parsed, {
|
|
56
56
|
action: alreadyGranted
|
|
57
|
-
? "change the
|
|
57
|
+
? "change the weekly budget of this user's existing free Rocky grant"
|
|
58
58
|
: "grant free Rocky to this user",
|
|
59
59
|
target: { studentUserId: studentId },
|
|
60
|
-
request: {
|
|
60
|
+
request: { weeklyBudgetUsd },
|
|
61
61
|
details: {
|
|
62
62
|
current: currentStatus(status),
|
|
63
63
|
warnings: status.warnings,
|
|
64
|
-
budgetAfterUsd:
|
|
65
|
-
budgetSource:
|
|
64
|
+
budgetAfterUsd: weeklyBudgetUsd ?? status.defaultWeeklyBudgetUsd,
|
|
65
|
+
budgetSource: weeklyBudgetUsd === null ? "default" : "custom",
|
|
66
66
|
consequences: [
|
|
67
67
|
alreadyGranted
|
|
68
|
-
? "The grant is already active: only its
|
|
68
|
+
? "The grant is already active: only its weekly budget changes; grantedAt and grantedBy stay."
|
|
69
69
|
: "Starts a new grant stamped with you as grantedBy; a revoked grant is re-granted.",
|
|
70
70
|
"ADMIN-only (exact-admin): a GUIDE session gets 403.",
|
|
71
71
|
],
|
|
72
72
|
reverse: `\`rocky free revoke --student ${studentId}\``,
|
|
73
73
|
},
|
|
74
|
-
}, putBudget(
|
|
74
|
+
}, putBudget(weeklyBudgetUsd));
|
|
75
75
|
}
|
|
76
76
|
if (!status.grant?.active) {
|
|
77
77
|
throw new CliError("not_found", `User ${studentId} has no active free Rocky grant${status.viaFlag ? " (free Rocky comes from the feature flag, not a grant)" : ""}. Use rocky free grant.`);
|
|
@@ -82,19 +82,19 @@ export async function runRockyFreeCommand(context) {
|
|
|
82
82
|
if ((budget === undefined) === !useDefault) {
|
|
83
83
|
throw new CliError("invalid_arguments", "Pass exactly one of --budget <usd> or --default.");
|
|
84
84
|
}
|
|
85
|
-
const
|
|
85
|
+
const weeklyBudgetUsd = budget ?? null;
|
|
86
86
|
return writeCommand(parsed, {
|
|
87
|
-
action: "change the
|
|
87
|
+
action: "change the weekly budget of this user's free Rocky grant",
|
|
88
88
|
target: { studentUserId: studentId },
|
|
89
|
-
request: {
|
|
89
|
+
request: { weeklyBudgetUsd },
|
|
90
90
|
details: {
|
|
91
91
|
current: currentStatus(status),
|
|
92
92
|
warnings: status.warnings,
|
|
93
|
-
budgetBeforeUsd: status.
|
|
94
|
-
budgetAfterUsd:
|
|
95
|
-
budgetSource:
|
|
93
|
+
budgetBeforeUsd: status.weeklyBudgetUsd,
|
|
94
|
+
budgetAfterUsd: weeklyBudgetUsd ?? status.defaultWeeklyBudgetUsd,
|
|
95
|
+
budgetSource: weeklyBudgetUsd === null ? "default" : "custom",
|
|
96
96
|
},
|
|
97
|
-
}, putBudget(
|
|
97
|
+
}, putBudget(weeklyBudgetUsd));
|
|
98
98
|
}
|
|
99
99
|
return writeCommand(parsed, {
|
|
100
100
|
action: "revoke this user's free Rocky grant",
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { unwrap } from "../api.js";
|
|
2
|
+
import { flagString, hasFlag } from "../args.js";
|
|
3
|
+
import { CliError } from "../errors.js";
|
|
4
|
+
import { getJob } from "../jobs.js";
|
|
5
|
+
import { positional } from "./shared.js";
|
|
6
|
+
export const SKILL_LINK_VERBS = new Set(["link", "links", "unlink"]);
|
|
7
|
+
export async function runSkillLinkCommand({ parsed, api, writeCommand, }) {
|
|
8
|
+
const verb = parsed.positionals[1];
|
|
9
|
+
if (verb === "links") {
|
|
10
|
+
return unwrap(await api.client.GET("/apps/links", {
|
|
11
|
+
params: { query: { domainSlug: flagString(parsed, "domain") } },
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
if (verb === "link") {
|
|
15
|
+
const url = positional(parsed, 2, "page URL");
|
|
16
|
+
// A confirmed run saves exactly the skill the human approved; picking again
|
|
17
|
+
// could land on a different one.
|
|
18
|
+
if (hasFlag(parsed, "confirm")) {
|
|
19
|
+
const key = flagString(parsed, "operation-key", { required: true });
|
|
20
|
+
const { history } = await getJob(key);
|
|
21
|
+
const approved = history.find((event) => event.status === "awaiting_confirmation")?.preview;
|
|
22
|
+
if ((approved?.action !== "apps.link" &&
|
|
23
|
+
approved?.action !== "apps.link-new-skill") ||
|
|
24
|
+
approved.target.url !== url)
|
|
25
|
+
throw new CliError("approval_mismatch", "Run an unchanged preview on this machine before confirming.");
|
|
26
|
+
return writeCommand(parsed, approved, async () => approved.action === "apps.link"
|
|
27
|
+
? unwrap(await api.client.POST("/apps/links", {
|
|
28
|
+
body: approved.request,
|
|
29
|
+
}))
|
|
30
|
+
: unwrap(await api.client.POST("/apps/links/new-skill", {
|
|
31
|
+
body: approved.request,
|
|
32
|
+
})));
|
|
33
|
+
}
|
|
34
|
+
const about = flagString(parsed, "about", { required: true });
|
|
35
|
+
const objectiveId = flagString(parsed, "skill");
|
|
36
|
+
const domainSlug = flagString(parsed, "domain");
|
|
37
|
+
const preview = unwrap(await api.client.GET("/apps/links/preview", {
|
|
38
|
+
params: { query: { url, about, objectiveId, domainSlug } },
|
|
39
|
+
}));
|
|
40
|
+
if (preview.newSkill) {
|
|
41
|
+
const plan = preview.newSkill;
|
|
42
|
+
const body = { url, about, title: preview.title, plan };
|
|
43
|
+
return writeCommand(parsed, {
|
|
44
|
+
action: "apps.link-new-skill",
|
|
45
|
+
target: { url },
|
|
46
|
+
request: body,
|
|
47
|
+
details: {
|
|
48
|
+
...preview,
|
|
49
|
+
consequence: plan.newGraph
|
|
50
|
+
? `No graph covers this. Generates a new "${plan.graphTitle}" mastery graph (${plan.domainSlug}) that includes the skill "${plan.skillTitle}", publishes it as soon as it is built (a few minutes), then links this page. Check with \`recess apps links\`.`
|
|
51
|
+
: `No skill on the "${plan.graphTitle}" graph fits. Adds the skill "${plan.skillTitle}" to it, publishes the graph, then links this page (a minute or two). Check with \`recess apps links\`.`,
|
|
52
|
+
},
|
|
53
|
+
}, async () => unwrap(await api.client.POST("/apps/links/new-skill", { body })));
|
|
54
|
+
}
|
|
55
|
+
if (!preview.skill)
|
|
56
|
+
throw new CliError("no_skill", "No mastery skill fits this description. Describe the one skill a kid shows on this page, or pass --skill <micro-skill-id>.");
|
|
57
|
+
if (!objectiveId && !preview.confident)
|
|
58
|
+
throw new CliError("skill_unclear", `Best guess is "${preview.skill.title}" (${preview.skill.objectiveId}) at ${preview.skill.confidence.toFixed(2)} confidence, too low to link. The page may cover several skills: describe the one it tests, or pass --skill <micro-skill-id>.`, 1, { preview });
|
|
59
|
+
const body = {
|
|
60
|
+
url,
|
|
61
|
+
about,
|
|
62
|
+
objectiveId: preview.skill.objectiveId,
|
|
63
|
+
domainSlug: preview.skill.domainSlug,
|
|
64
|
+
confidence: preview.skill.confidence,
|
|
65
|
+
};
|
|
66
|
+
return writeCommand(parsed, {
|
|
67
|
+
action: "apps.link",
|
|
68
|
+
target: { url },
|
|
69
|
+
request: body,
|
|
70
|
+
details: {
|
|
71
|
+
...preview,
|
|
72
|
+
consequence: "Links this page to one mastery skill, live at once. Kids who finish it as a todo get assessment credit on that skill, and kids who miss the skill can be given it.",
|
|
73
|
+
},
|
|
74
|
+
}, async () => unwrap(await api.client.POST("/apps/links", { body })));
|
|
75
|
+
}
|
|
76
|
+
if (verb === "unlink") {
|
|
77
|
+
const id = positional(parsed, 2, "link ID");
|
|
78
|
+
return writeCommand(parsed, {
|
|
79
|
+
action: "apps.unlink",
|
|
80
|
+
target: { linkId: id },
|
|
81
|
+
request: { id },
|
|
82
|
+
details: {
|
|
83
|
+
consequence: "Removes this page's skill link. Credit kids already earned stays.",
|
|
84
|
+
},
|
|
85
|
+
}, async () => unwrap(await api.client.DELETE("/apps/links/{id}", {
|
|
86
|
+
params: { path: { id } },
|
|
87
|
+
})));
|
|
88
|
+
}
|
|
89
|
+
throw new CliError("unknown_command", "Use recess help apps.");
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=skill-links.js.map
|
package/dist/help.js
CHANGED
|
@@ -100,6 +100,8 @@ Usage:
|
|
|
100
100
|
[--range week|month|quarter|year]
|
|
101
101
|
recess [--json] students math-academy --student <kid-id>
|
|
102
102
|
[--from YYYY-MM-DD] [--to YYYY-MM-DD]
|
|
103
|
+
recess [--json] students mastery --student <kid-id> [--domain <slug>]
|
|
104
|
+
[--status UNSEEN|EXPOSED|PRACTICING|PROFICIENT|MASTERED|STALE|BLOCKED] [--struggling]
|
|
103
105
|
recess [--json] enrollments list --user <user-id>
|
|
104
106
|
recess [--json] subscriptions list --family <family-id> [--kid <kid-id>]
|
|
105
107
|
recess [--json] invoices list --subscription <subscription-id>
|
|
@@ -120,6 +122,9 @@ Usage:
|
|
|
120
122
|
recess [--json] apps publish [dir] [--name TEXT] [--open] [--assign <kid-id>] [--due YYYY-MM-DD] [--no-wait]
|
|
121
123
|
recess [--json] apps assign [dir] --student <kid-id> [--due YYYY-MM-DD]
|
|
122
124
|
recess [--json] apps status <build-id>
|
|
125
|
+
recess [--json] apps link <url> --about TEXT [--skill <micro-skill-id>] [--domain <slug>] [--confirm]
|
|
126
|
+
recess [--json] apps links [--domain <slug>]
|
|
127
|
+
recess [--json] apps unlink <link-id> [--confirm]
|
|
123
128
|
recess [--json] applications list [--status SUBMITTED|CLAIMED|ENROLLED|CLOSED]
|
|
124
129
|
[--status-scope active|closed] [--disposition READY_TO_ENROLL|TRIAL|PENDING_FUNDING|NO]
|
|
125
130
|
[--dispositioned true|false] [--quality QUALIFIED|NEEDS_NURTURE|UNKNOWN]
|
|
@@ -306,6 +311,7 @@ Usage:
|
|
|
306
311
|
recess [--json] cohorts email <cohort-id> --target ALL_PARENTS|ALL_PARENTS_GUIDES
|
|
307
312
|
--content TEXT [--confirm]
|
|
308
313
|
recess [--json] feed post --users <id,id,...> --text TEXT [--send-email] [--confirm]
|
|
314
|
+
recess [--json] dms send --users <id,id,...> --text TEXT [--confirm]
|
|
309
315
|
recess [--json] events get <event-id>
|
|
310
316
|
recess [--json] events list --date YYYY-MM-DD [--timezone <iana>] [--search TEXT]
|
|
311
317
|
recess [--json] events take-attendance <event-id> --attended <id,id,...>
|
|
@@ -580,7 +586,7 @@ Usage:
|
|
|
580
586
|
[--confirm --approval-token TOKEN]
|
|
581
587
|
recess [--json] todos generate-learning-analysis <todo-id> [--confirm]
|
|
582
588
|
recess [--json] todos generate-applet <todo-id> --student <kid-id>
|
|
583
|
-
[--due-date YYYY-MM-DD] [--confirm --approval-token TOKEN]
|
|
589
|
+
[--mode game|lesson|diagram] [--due-date YYYY-MM-DD] [--confirm --approval-token TOKEN]
|
|
584
590
|
recess [--json] memories files --student <kid-id>
|
|
585
591
|
recess [--json] memories read --student <kid-id> --path <path>
|
|
586
592
|
recess [--json] memories edit --student <kid-id> --path <path> --content-file <file> [--confirm] [--approval-token <token>]
|
|
@@ -1111,6 +1117,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1111
1117
|
"students analysis": "Read the learning analysis for a completed todo.",
|
|
1112
1118
|
"students xp-history": "Show a kid's XP history over a range.",
|
|
1113
1119
|
"students math-academy": "Show a linked kid's Math Academy course, league and task activity.",
|
|
1120
|
+
"students mastery": "Show a kid's mastery-graph skills: status, confidence, assessments and struggles.",
|
|
1114
1121
|
"enrollments list": "List a user's enrollments.",
|
|
1115
1122
|
"subscriptions list": "List a family's Stripe subscriptions.",
|
|
1116
1123
|
"invoices list": "List a subscription's invoices.",
|
|
@@ -1129,6 +1136,9 @@ export const COMMAND_SUMMARIES = {
|
|
|
1129
1136
|
"apps publish": "Build and publish a Studio app (optionally assign it to a kid).",
|
|
1130
1137
|
"apps assign": "Assign a published Studio app to a kid as a todo.",
|
|
1131
1138
|
"apps status": "Check a Studio build's status.",
|
|
1139
|
+
"apps link": "Link a page on any site to the one mastery skill it tests.",
|
|
1140
|
+
"apps links": "List pages linked to mastery skills.",
|
|
1141
|
+
"apps unlink": "Remove a page's skill link.",
|
|
1132
1142
|
"applications list": "List enrollment applications with filters.",
|
|
1133
1143
|
"applications get": "Read one enrollment application.",
|
|
1134
1144
|
"applications quotes": "List an application's tuition quotes.",
|
|
@@ -1243,6 +1253,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1243
1253
|
"cohorts resume-billing": "Resume billing for a cohort.",
|
|
1244
1254
|
"cohorts email": "Email a cohort's parents (and guides).",
|
|
1245
1255
|
"feed post": "Post a message to users' feeds (optionally email).",
|
|
1256
|
+
"dms send": "Send a Recess chat DM as yourself to each user (1:1).",
|
|
1246
1257
|
"events get": "Read one class event.",
|
|
1247
1258
|
"events list": "List class events on a date.",
|
|
1248
1259
|
"events take-attendance": "Record attendance for an event.",
|
|
@@ -1404,7 +1415,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1404
1415
|
"todos delete": "Delete a todo (soft).",
|
|
1405
1416
|
"todos restore": "Restore a deleted todo.",
|
|
1406
1417
|
"todos generate-learning-analysis": "Generate a todo's learning analysis (LLM).",
|
|
1407
|
-
"todos generate-applet": "Generate a practice
|
|
1418
|
+
"todos generate-applet": "Generate a practice game, lesson or diagram todo from a todo (the builder picks unless --mode).",
|
|
1408
1419
|
"memories files": "List a kid's memory files.",
|
|
1409
1420
|
"memories read": "Read one kid memory file.",
|
|
1410
1421
|
"memories edit": "Edit a kid memory file (publication disabled).",
|
|
@@ -1418,7 +1429,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1418
1429
|
"rocky free list": "List everyone with an active free Rocky grant.",
|
|
1419
1430
|
"rocky free get": "Read a user's free Rocky plan, grant, budget, and usage.",
|
|
1420
1431
|
"rocky free grant": "Grant free Rocky to a kid or guardian.",
|
|
1421
|
-
"rocky free set-budget": "Change a free Rocky grant's
|
|
1432
|
+
"rocky free set-budget": "Change a free Rocky grant's weekly budget.",
|
|
1422
1433
|
"rocky free revoke": "Revoke a user's free Rocky grant.",
|
|
1423
1434
|
"tutor-templates list": "List tutor templates.",
|
|
1424
1435
|
"tutor-templates get": "Read one tutor template.",
|
|
@@ -1471,6 +1482,7 @@ export const NOUN_SUMMARIES = {
|
|
|
1471
1482
|
channels: "Community channels and their members.",
|
|
1472
1483
|
"tuition-plans": "Compute tuition plan sheets (stores nothing).",
|
|
1473
1484
|
feed: "Post messages to users' feeds.",
|
|
1485
|
+
dms: "Send Recess chat DMs as yourself.",
|
|
1474
1486
|
events: "Class events: list, attendance, cancel, reschedule, add.",
|
|
1475
1487
|
registrations: "Approve or deny cohort registrations.",
|
|
1476
1488
|
request: "Raw read-only GET of any API path.",
|