@okhay-p/mivra 0.1.6 → 0.1.7
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/{chunk-DYXNHODU.js → chunk-M62PZTK3.js} +117 -4
- package/dist/chunk-M62PZTK3.js.map +7 -0
- package/dist/{chunk-KE5ZEREE.js → chunk-T5WM74CI.js} +2 -1
- package/dist/{chunk-B47HA6IQ.js → chunk-TKDX5OCX.js} +739 -478
- package/dist/chunk-TKDX5OCX.js.map +7 -0
- package/dist/cli.js +492 -123
- package/dist/cli.js.map +4 -4
- package/dist/{client-4UG5W5NJ.js → client-76YUHG4T.js} +2 -2
- package/dist/exercise-child.js +1 -1
- package/dist/extract-child.js +2 -2
- package/dist/python-child.js +1 -1
- package/dist/{start-SX3BCBIN.js → start-GVAACONX.js} +14504 -12040
- package/dist/start-GVAACONX.js.map +7 -0
- package/drizzle/0021_strange_gamma_corps.sql +2 -0
- package/drizzle/0022_fast_forgotten_one.sql +28 -0
- package/drizzle/0023_low_wiccan.sql +17 -0
- package/drizzle/0024_windy_annihilus.sql +1 -0
- package/drizzle/0025_brief_rictor.sql +6 -0
- package/drizzle/0026_greedy_sally_floyd.sql +1 -0
- package/drizzle/0027_regular_calypso.sql +41 -0
- package/drizzle/0028_lazy_agent_zero.sql +17 -0
- package/drizzle/meta/0021_snapshot.json +2313 -0
- package/drizzle/meta/0022_snapshot.json +2529 -0
- package/drizzle/meta/0023_snapshot.json +2654 -0
- package/drizzle/meta/0024_snapshot.json +2662 -0
- package/drizzle/meta/0025_snapshot.json +2707 -0
- package/drizzle/meta/0026_snapshot.json +2714 -0
- package/drizzle/meta/0027_snapshot.json +2816 -0
- package/drizzle/meta/0028_snapshot.json +2940 -0
- package/drizzle/meta/_journal.json +56 -0
- package/package.json +1 -1
- package/web/assets/exercise-workers/{exercise.worker-DzC1lTCg.js → exercise.worker-LCHlYekD.js} +11 -11
- package/web/assets/exercise-workers/python-exercise.worker-DeTriNjh.js +236 -0
- package/web/assets/index-CQjNLnxP.js +540 -0
- package/web/assets/index-DpV5il_3.css +1 -0
- package/web/assets/{module-ES6BEMUI-Chb6aYUZ.js → module-ES6BEMUI-B2wjplZC.js} +1 -1
- package/web/assets/render.worker-OksjuBjV.js +537 -0
- package/web/index.html +2 -2
- package/dist/chunk-B47HA6IQ.js.map +0 -7
- package/dist/chunk-DYXNHODU.js.map +0 -7
- package/dist/start-SX3BCBIN.js.map +0 -7
- package/web/assets/exercise-workers/python-exercise.worker-CtSr-syJ.js +0 -236
- package/web/assets/index-D3M-SX0V.js +0 -538
- package/web/assets/index-DUFQVtIh.css +0 -1
- package/web/assets/render.worker-D6KYAHiU.js +0 -537
- /package/dist/{chunk-KE5ZEREE.js.map → chunk-T5WM74CI.js.map} +0 -0
- /package/dist/{client-4UG5W5NJ.js.map → client-76YUHG4T.js.map} +0 -0
|
@@ -540,7 +540,7 @@ function createPythonCaseRunner(pyodide, { now = Date.now } = {}) {
|
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
// ../protocol/src/index.ts
|
|
543
|
-
import { z as
|
|
543
|
+
import { z as z21 } from "zod";
|
|
544
544
|
|
|
545
545
|
// ../protocol/src/artifact-math-input.ts
|
|
546
546
|
import "zod";
|
|
@@ -972,20 +972,58 @@ var compositionArtifactKind = {
|
|
|
972
972
|
};
|
|
973
973
|
var CompositionArtifactView = z5.object({ id: z5.string(), createdAt: z5.string().datetime(), kind: z5.literal("composition"), version: z5.literal(1), spec: CompositionSpec }).strict();
|
|
974
974
|
|
|
975
|
-
// ../protocol/src/
|
|
975
|
+
// ../protocol/src/flashcard.ts
|
|
976
976
|
import { z as z6 } from "zod";
|
|
977
|
+
var MAX_FLASHCARDS = 30;
|
|
978
|
+
var Flashcard = z6.object({
|
|
979
|
+
id: z6.string().trim().min(1).max(40).regex(/^[A-Za-z0-9_-]+$/, "Use letters, digits, - or _").describe('A short id, unique in the deck, e.g. "c1".'),
|
|
980
|
+
front: z6.string().trim().min(1).max(500).describe("The prompt side: a question, term or cue."),
|
|
981
|
+
back: z6.string().trim().min(1).max(1e3).describe("The answer side, shown when the learner flips the card."),
|
|
982
|
+
concept: z6.string().trim().min(1).max(200).optional().describe("Optional concept the card practises, named as in <learner_concepts>.")
|
|
983
|
+
}).strict();
|
|
984
|
+
var FlashcardDeckSpec = z6.object({
|
|
985
|
+
title: z6.string().trim().min(1).max(120),
|
|
986
|
+
cards: z6.array(Flashcard).min(1).max(MAX_FLASHCARDS).superRefine((cards, ctx) => {
|
|
987
|
+
const seen = /* @__PURE__ */ new Set();
|
|
988
|
+
cards.forEach((card, i) => {
|
|
989
|
+
if (seen.has(card.id)) ctx.addIssue({ code: "custom", message: `Duplicate card id "${card.id}"`, path: [i, "id"] });
|
|
990
|
+
seen.add(card.id);
|
|
991
|
+
});
|
|
992
|
+
})
|
|
993
|
+
}).strict();
|
|
994
|
+
var FlashcardRating = z6.enum(["again", "good", "easy"]);
|
|
995
|
+
var RateFlashcard = z6.object({ rating: FlashcardRating }).strict();
|
|
996
|
+
var FlashcardSchedule = z6.object({
|
|
997
|
+
cardId: z6.string(),
|
|
998
|
+
rating: FlashcardRating,
|
|
999
|
+
/** Ratings of this card so far. */
|
|
1000
|
+
reviews: z6.number().int().positive(),
|
|
1001
|
+
/** Good or Easy ratings in a row; 0 after Again. */
|
|
1002
|
+
repetitions: z6.number().int().nonnegative(),
|
|
1003
|
+
/** Days until the card is due again: 0 after Again. */
|
|
1004
|
+
intervalDays: z6.number().int().nonnegative(),
|
|
1005
|
+
ease: z6.number().positive(),
|
|
1006
|
+
dueAt: z6.string().datetime(),
|
|
1007
|
+
ratedAt: z6.string().datetime()
|
|
1008
|
+
}).strict();
|
|
1009
|
+
var FlashcardDeckSchedule = z6.object({ artifactId: z6.string(), cards: z6.array(FlashcardSchedule) }).strict();
|
|
1010
|
+
|
|
1011
|
+
// ../protocol/src/course.ts
|
|
1012
|
+
import { z as z7 } from "zod";
|
|
977
1013
|
var MAX_GOAL_CHARS = 300;
|
|
978
|
-
var CourseGoal =
|
|
1014
|
+
var CourseGoal = z7.string().trim().min(1).max(MAX_GOAL_CHARS);
|
|
979
1015
|
var COURSE_KINDS = ["lessons", "project"];
|
|
980
|
-
var CourseKind =
|
|
981
|
-
var
|
|
982
|
-
var
|
|
983
|
-
var
|
|
1016
|
+
var CourseKind = z7.enum(COURSE_KINDS);
|
|
1017
|
+
var PLACEMENT_DEPTHS = ["quick", "thorough", "skip"];
|
|
1018
|
+
var PlacementDepth = z7.enum(PLACEMENT_DEPTHS);
|
|
1019
|
+
var StartCourse = z7.object({ goal: CourseGoal, kind: CourseKind.optional(), placementDepth: PlacementDepth.optional() }).strict();
|
|
1020
|
+
var ConceptName = z7.string().trim().min(1).max(80);
|
|
1021
|
+
var PlacementQuestionSpec = z7.object({
|
|
984
1022
|
concept: ConceptName.describe(`The single concept this question probes, e.g. "chain rule". Reuse the exact name from the learner's record when it is there.`),
|
|
985
|
-
question:
|
|
986
|
-
options:
|
|
987
|
-
correctOptionIndex:
|
|
988
|
-
explanation:
|
|
1023
|
+
question: z7.string().trim().min(1).max(1e3),
|
|
1024
|
+
options: z7.array(z7.object({ text: z7.string().trim().min(1).max(300) }).strict()).min(2).max(5).describe('2-5 options with distinct text. For true/false or yes/no use two options, e.g. "True" and "False". Never add a "Not sure" option: the UI always offers one.'),
|
|
1025
|
+
correctOptionIndex: z7.number().int().nonnegative().describe("0-based index of the single correct option."),
|
|
1026
|
+
explanation: z7.string().trim().min(1).max(600).describe("One or two sentences shown after answering: why the correct option is correct.")
|
|
989
1027
|
}).strict().superRefine((spec, ctx) => {
|
|
990
1028
|
if (spec.correctOptionIndex >= spec.options.length) {
|
|
991
1029
|
ctx.addIssue({ code: "custom", path: ["correctOptionIndex"], message: "correctOptionIndex must point at one of the options" });
|
|
@@ -1001,19 +1039,19 @@ var PlacementQuestionSpec = z6.object({
|
|
|
1001
1039
|
}
|
|
1002
1040
|
});
|
|
1003
1041
|
});
|
|
1004
|
-
var PlacementQuestionPublic =
|
|
1042
|
+
var PlacementQuestionPublic = z7.object({ concept: z7.string(), question: z7.string(), options: z7.array(z7.object({ text: z7.string() }).strict()) }).strict();
|
|
1005
1043
|
var toPlacementQuestionPublic = (spec) => ({
|
|
1006
1044
|
concept: spec.concept,
|
|
1007
1045
|
question: spec.question,
|
|
1008
1046
|
options: spec.options.map((o) => ({ text: o.text }))
|
|
1009
1047
|
});
|
|
1010
|
-
var PlacementAnswer =
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1048
|
+
var PlacementAnswer = z7.union([
|
|
1049
|
+
z7.object({ optionIndex: z7.number().int().nonnegative() }).strict(),
|
|
1050
|
+
z7.object({ unsure: z7.literal(true) }).strict(),
|
|
1051
|
+
z7.object({ skipped: z7.literal(true) }).strict()
|
|
1014
1052
|
]);
|
|
1015
|
-
var PlacementResult =
|
|
1016
|
-
var PlacementGrade =
|
|
1053
|
+
var PlacementResult = z7.enum(["correct", "incorrect", "unsure", "skipped"]);
|
|
1054
|
+
var PlacementGrade = z7.object({ result: PlacementResult, correctOptionIndex: z7.number().int().nonnegative(), explanation: z7.string() }).strict();
|
|
1017
1055
|
function gradePlacementQuestion(spec, answer) {
|
|
1018
1056
|
let result;
|
|
1019
1057
|
if ("optionIndex" in answer) {
|
|
@@ -1023,24 +1061,24 @@ function gradePlacementQuestion(spec, answer) {
|
|
|
1023
1061
|
return { result, correctOptionIndex: spec.correctOptionIndex, explanation: spec.explanation };
|
|
1024
1062
|
}
|
|
1025
1063
|
var MAX_INTERVIEW_CONTEXT_CHARS = 2e3;
|
|
1026
|
-
var InterviewContextSpec =
|
|
1027
|
-
question:
|
|
1064
|
+
var InterviewContextSpec = z7.object({
|
|
1065
|
+
question: z7.string().trim().min(1).max(300).describe(`The question, e.g. "Anything else you'd like us to know about what you already understand or what you want to explore?"`)
|
|
1028
1066
|
}).strict();
|
|
1029
|
-
var InterviewContextAnswer =
|
|
1030
|
-
|
|
1031
|
-
|
|
1067
|
+
var InterviewContextAnswer = z7.union([
|
|
1068
|
+
z7.object({ text: z7.string().trim().max(MAX_INTERVIEW_CONTEXT_CHARS) }).strict(),
|
|
1069
|
+
z7.object({ skipped: z7.literal(true) }).strict()
|
|
1032
1070
|
]);
|
|
1033
|
-
var InterviewContextGrade =
|
|
1071
|
+
var InterviewContextGrade = z7.object({ result: z7.enum(["answered", "skipped"]) }).strict();
|
|
1034
1072
|
var gradeInterviewContext = (answer) => ({
|
|
1035
1073
|
result: "text" in answer && answer.text.length > 0 ? "answered" : "skipped"
|
|
1036
1074
|
});
|
|
1037
|
-
var KnownSource =
|
|
1038
|
-
var SyllabusTopicInput =
|
|
1039
|
-
title:
|
|
1040
|
-
summary:
|
|
1041
|
-
reason:
|
|
1042
|
-
requestedByLearner:
|
|
1043
|
-
concepts:
|
|
1075
|
+
var KnownSource = z7.enum(["memory", "test", "guess"]);
|
|
1076
|
+
var SyllabusTopicInput = z7.object({
|
|
1077
|
+
title: z7.string().trim().min(1).max(120),
|
|
1078
|
+
summary: z7.string().trim().min(1).max(400).describe("What the lesson on this topic will cover, in one or two sentences."),
|
|
1079
|
+
reason: z7.string().trim().min(1).max(300).describe('Why this topic is here for this learner, e.g. "You missed the question on local minima".'),
|
|
1080
|
+
requestedByLearner: z7.boolean().describe("True if the learner explicitly asked for this topic. Such topics are never removed automatically."),
|
|
1081
|
+
concepts: z7.array(ConceptName).min(1).max(8).describe("Concept names this topic teaches; reuse names from the learner's record and the placement questions.")
|
|
1044
1082
|
}).strict();
|
|
1045
1083
|
var courseIcons = [
|
|
1046
1084
|
"sigma",
|
|
@@ -1074,18 +1112,18 @@ var courseIcons = [
|
|
|
1074
1112
|
"wrench",
|
|
1075
1113
|
"dumbbell"
|
|
1076
1114
|
];
|
|
1077
|
-
var CourseIcon =
|
|
1115
|
+
var CourseIcon = z7.enum(courseIcons);
|
|
1078
1116
|
var COURSE_TITLE_MAX = 60;
|
|
1079
|
-
var SyllabusInput =
|
|
1117
|
+
var SyllabusInput = z7.object({
|
|
1080
1118
|
// Bad values parse as missing rather than failing the call: a syllabus is worth more than its label (#58).
|
|
1081
|
-
title:
|
|
1119
|
+
title: z7.string().trim().min(1).max(COURSE_TITLE_MAX).optional().catch(void 0).describe(`A short name for the course, 2-5 words, shown in the sidebar, e.g. "Discrete Math: Induction". Name the scope of the whole syllabus, every topic in it, rather than one part of it or the learner's request word for word.`),
|
|
1082
1120
|
icon: CourseIcon.optional().catch(void 0).describe("The subject icon that best fits the course: sigma = maths, calculator = arithmetic or accounting, code/terminal = programming, cpu = hardware, flask-conical = chemistry, atom = physics, dna = biology, leaf = ecology, telescope = astronomy, globe = geography, landmark = history, book-open = literature, pen-tool = writing, languages = languages, palette = art, brain = psychology, users = sociology, chart-line = economics or statistics, briefcase = business, scale = law, stethoscope/heart-pulse = medicine, wrench = engineering, dumbbell = sport."),
|
|
1083
|
-
topics:
|
|
1084
|
-
known:
|
|
1085
|
-
|
|
1121
|
+
topics: z7.array(SyllabusTopicInput).min(1).max(20).describe("The ordered topics, first to learn first. Each topic gets one lesson."),
|
|
1122
|
+
known: z7.array(
|
|
1123
|
+
z7.object({
|
|
1086
1124
|
concept: ConceptName,
|
|
1087
1125
|
source: KnownSource.describe("memory = from their record or memories; test = from this placement interview; guess = your inference"),
|
|
1088
|
-
note:
|
|
1126
|
+
note: z7.string().trim().min(1).max(200)
|
|
1089
1127
|
}).strict()
|
|
1090
1128
|
).max(20).describe("What the learner already knows or doesn't, each labelled with where that comes from. Shown to the learner.")
|
|
1091
1129
|
}).strict().superRefine((input, ctx) => {
|
|
@@ -1096,67 +1134,80 @@ var SyllabusInput = z6.object({
|
|
|
1096
1134
|
seen.add(key);
|
|
1097
1135
|
});
|
|
1098
1136
|
});
|
|
1099
|
-
var SyllabusTopic = SyllabusTopicInput.extend({ id:
|
|
1100
|
-
var SyllabusView =
|
|
1101
|
-
version:
|
|
1102
|
-
source:
|
|
1103
|
-
reason:
|
|
1104
|
-
changedTopicIds:
|
|
1137
|
+
var SyllabusTopic = SyllabusTopicInput.extend({ id: z7.string() }).strict();
|
|
1138
|
+
var SyllabusView = z7.object({
|
|
1139
|
+
version: z7.number().int().positive(),
|
|
1140
|
+
source: z7.enum(["interview", "tutor", "adaptive", "undo"]),
|
|
1141
|
+
reason: z7.string().nullable(),
|
|
1142
|
+
changedTopicIds: z7.array(z7.string()),
|
|
1105
1143
|
/** Whether the learner can undo this version: an automatic change none of whose new topics has started. */
|
|
1106
|
-
canUndo:
|
|
1107
|
-
topics:
|
|
1144
|
+
canUndo: z7.boolean(),
|
|
1145
|
+
topics: z7.array(SyllabusTopic),
|
|
1108
1146
|
known: SyllabusInput.shape.known,
|
|
1109
|
-
createdAt:
|
|
1147
|
+
createdAt: z7.string().datetime()
|
|
1110
1148
|
}).strict();
|
|
1111
|
-
var CourseStatus =
|
|
1112
|
-
var CourseView =
|
|
1113
|
-
id:
|
|
1114
|
-
sessionId:
|
|
1115
|
-
goal:
|
|
1149
|
+
var CourseStatus = z7.enum(["interviewing", "active", "complete"]);
|
|
1150
|
+
var CourseView = z7.object({
|
|
1151
|
+
id: z7.string(),
|
|
1152
|
+
sessionId: z7.string(),
|
|
1153
|
+
goal: z7.string(),
|
|
1116
1154
|
kind: CourseKind,
|
|
1117
1155
|
status: CourseStatus,
|
|
1118
1156
|
syllabus: SyllabusView.nullable(),
|
|
1119
1157
|
/** The tutor's reply that wrote the first syllabus, which ends the placement interview; null if unknown. */
|
|
1120
|
-
interviewMessageId:
|
|
1121
|
-
createdAt:
|
|
1158
|
+
interviewMessageId: z7.string().nullable(),
|
|
1159
|
+
createdAt: z7.string().datetime()
|
|
1160
|
+
}).strict();
|
|
1161
|
+
var CourseSummaryView = z7.object({
|
|
1162
|
+
id: z7.string(),
|
|
1163
|
+
sessionId: z7.string(),
|
|
1164
|
+
title: z7.string(),
|
|
1165
|
+
icon: CourseIcon.nullable(),
|
|
1166
|
+
kind: CourseKind,
|
|
1167
|
+
status: CourseStatus,
|
|
1168
|
+
/** Topics in the latest syllabus with a finished lesson; 0 while there is no syllabus. */
|
|
1169
|
+
lessonsFinished: z7.number().int().nonnegative(),
|
|
1170
|
+
topicCount: z7.number().int().nonnegative(),
|
|
1171
|
+
/** When the course was completed; null unless it is complete. */
|
|
1172
|
+
completedAt: z7.string().datetime().nullable()
|
|
1122
1173
|
}).strict();
|
|
1123
1174
|
|
|
1124
1175
|
// ../protocol/src/graph.ts
|
|
1125
|
-
import { z as
|
|
1176
|
+
import { z as z8 } from "zod";
|
|
1126
1177
|
var MAX_NODES = 60;
|
|
1127
1178
|
var MAX_EDGES = 200;
|
|
1128
1179
|
var MAX_STEPS2 = 200;
|
|
1129
|
-
var Id2 =
|
|
1130
|
-
var Text =
|
|
1131
|
-
var GraphTone =
|
|
1180
|
+
var Id2 = z8.string().trim().min(1).max(24);
|
|
1181
|
+
var Text = z8.string().trim().min(1).max(24);
|
|
1182
|
+
var GraphTone = z8.enum(["active", "done", "muted"]);
|
|
1132
1183
|
var ToneField = GraphTone.optional().describe(
|
|
1133
1184
|
"active = current focus, done = finished/visited, muted = ruled out. Defaults to active."
|
|
1134
1185
|
);
|
|
1135
|
-
var GraphNode =
|
|
1186
|
+
var GraphNode = z8.object({
|
|
1136
1187
|
id: Id2.describe("Unique id, used by edges and steps. Shown on the node if it has no label."),
|
|
1137
1188
|
label: Text.optional().describe("Short text on the node. Only $...$ is a formula, e.g. $v_1$.")
|
|
1138
1189
|
}).strict();
|
|
1139
|
-
var GraphEdge =
|
|
1190
|
+
var GraphEdge = z8.object({
|
|
1140
1191
|
from: Id2.describe("Id of a node. In a tree, the parent."),
|
|
1141
1192
|
to: Id2.describe("Id of a node, the same as `from` for a self-loop. In a tree, the child; children appear left to right in edge order unless they have a `side`."),
|
|
1142
|
-
side:
|
|
1193
|
+
side: z8.enum(["left", "right"]).optional().describe(
|
|
1143
1194
|
"Only when kind is tree: which child this is of `from`, its parent. Set it on every edge of a binary search tree or binary tree traversal, because a lone left child and a lone right child are different trees. A node has at most one child per side, and either all of its children have a side or none do."
|
|
1144
1195
|
),
|
|
1145
|
-
weight:
|
|
1196
|
+
weight: z8.number().optional().describe("Numeric weight shown on the edge. Give a weight or a label, not both."),
|
|
1146
1197
|
label: Text.optional().describe("Text shown on the edge. Only $...$ is a formula.")
|
|
1147
1198
|
}).strict();
|
|
1148
|
-
var GraphNodeState =
|
|
1149
|
-
var GraphEdgeState =
|
|
1199
|
+
var GraphNodeState = z8.object({ id: Id2.describe("Id of a node."), tone: ToneField }).strict();
|
|
1200
|
+
var GraphEdgeState = z8.object({
|
|
1150
1201
|
from: Id2,
|
|
1151
1202
|
to: Id2,
|
|
1152
|
-
nth:
|
|
1203
|
+
nth: z8.number().int().nonnegative().optional().describe("Only for parallel edges, and then required: which of the edges joining these nodes, 0-based in the order of `edges`."),
|
|
1153
1204
|
tone: ToneField
|
|
1154
1205
|
}).strict().describe("An edge of the graph. In an undirected graph, from and to may be in either order.");
|
|
1155
|
-
var GraphStep =
|
|
1156
|
-
explanation:
|
|
1157
|
-
nodeStates:
|
|
1158
|
-
edgeStates:
|
|
1159
|
-
variables:
|
|
1206
|
+
var GraphStep = z8.object({
|
|
1207
|
+
explanation: z8.string().trim().min(1).max(500).describe("What happens in this step, in one or two sentences."),
|
|
1208
|
+
nodeStates: z8.array(GraphNodeState).max(MAX_NODES).optional().describe("The state of every node that has one at this step, at most one each. Not carried over from earlier steps: repeat any that still apply."),
|
|
1209
|
+
edgeStates: z8.array(GraphEdgeState).max(MAX_EDGES).optional().describe("The state of every edge that has one at this step, at most one each. Not carried over from earlier steps: repeat any that still apply."),
|
|
1210
|
+
variables: z8.array(TraceVariable).max(12).optional().describe("All running state at this step, e.g. the queue or current distances. Not carried over from earlier steps.")
|
|
1160
1211
|
}).strict();
|
|
1161
1212
|
var pairKey = (from, to, directed) => JSON.stringify(directed || from <= to ? [from, to] : [to, from]);
|
|
1162
1213
|
function graphEdgeLookup(spec) {
|
|
@@ -1225,15 +1276,15 @@ function checkSides(spec, ctx) {
|
|
|
1225
1276
|
}
|
|
1226
1277
|
}
|
|
1227
1278
|
}
|
|
1228
|
-
var GraphSpec =
|
|
1229
|
-
title:
|
|
1230
|
-
directed:
|
|
1231
|
-
kind:
|
|
1279
|
+
var GraphSpec = z8.object({
|
|
1280
|
+
title: z8.string().trim().min(1).max(120),
|
|
1281
|
+
directed: z8.boolean().describe("True draws arrowheads from `from` to `to`."),
|
|
1282
|
+
kind: z8.enum(["tree", "graph"]).optional().describe(
|
|
1232
1283
|
"Layout hint. tree draws a rooted tree top-down, and needs a real tree: connected with no cycles, and when directed, edges going parent to child from one root. When undirected, the first node is the root. Anything else falls back to the general layout, unless an edge has a `side`, which is then an error. Defaults to graph."
|
|
1233
1284
|
),
|
|
1234
|
-
nodes:
|
|
1235
|
-
edges:
|
|
1236
|
-
steps:
|
|
1285
|
+
nodes: z8.array(GraphNode).min(1).max(MAX_NODES),
|
|
1286
|
+
edges: z8.array(GraphEdge).max(MAX_EDGES).describe("Self-loops and parallel edges are allowed."),
|
|
1287
|
+
steps: z8.array(GraphStep).min(1).max(MAX_STEPS2).optional().describe("Omit to show the graph without stepping through it.")
|
|
1237
1288
|
}).strict().superRefine((spec, ctx) => {
|
|
1238
1289
|
const ids = /* @__PURE__ */ new Set();
|
|
1239
1290
|
spec.nodes.forEach((node, i) => {
|
|
@@ -1270,17 +1321,17 @@ var GraphSpec = z7.object({
|
|
|
1270
1321
|
});
|
|
1271
1322
|
|
|
1272
1323
|
// ../protocol/src/multiple-choice.ts
|
|
1273
|
-
import { z as
|
|
1274
|
-
var MultipleChoiceOption =
|
|
1275
|
-
text:
|
|
1276
|
-
feedback:
|
|
1277
|
-
}).strict();
|
|
1278
|
-
var MultipleChoiceSpec =
|
|
1279
|
-
concept:
|
|
1280
|
-
question:
|
|
1281
|
-
options:
|
|
1282
|
-
correctOptionIndex:
|
|
1283
|
-
explanation:
|
|
1324
|
+
import { z as z9 } from "zod";
|
|
1325
|
+
var MultipleChoiceOption = z9.object({
|
|
1326
|
+
text: z9.string().trim().min(1).max(300),
|
|
1327
|
+
feedback: z9.string().trim().min(1).max(500).optional().describe("Shown if the learner picks this option: why it is right or what misconception it reflects.")
|
|
1328
|
+
}).strict();
|
|
1329
|
+
var MultipleChoiceSpec = z9.object({
|
|
1330
|
+
concept: z9.string().trim().min(1).max(80).describe('Short label for the concept being checked, e.g. "sliding window invariant". Used to track progress.'),
|
|
1331
|
+
question: z9.string().trim().min(1).max(1e3),
|
|
1332
|
+
options: z9.array(MultipleChoiceOption).min(2).max(6).describe("2-6 options with distinct text."),
|
|
1333
|
+
correctOptionIndex: z9.number().int().nonnegative().describe("0-based index of the single correct option; must be less than the number of options."),
|
|
1334
|
+
explanation: z9.string().trim().min(1).max(1e3).describe("Shown after answering: why the correct option is correct.")
|
|
1284
1335
|
}).strict().superRefine((spec, ctx) => {
|
|
1285
1336
|
if (spec.correctOptionIndex >= spec.options.length) {
|
|
1286
1337
|
ctx.addIssue({
|
|
@@ -1300,10 +1351,10 @@ var MultipleChoiceSpec = z8.object({
|
|
|
1300
1351
|
}
|
|
1301
1352
|
});
|
|
1302
1353
|
});
|
|
1303
|
-
var MultipleChoicePublic =
|
|
1304
|
-
concept:
|
|
1305
|
-
question:
|
|
1306
|
-
options:
|
|
1354
|
+
var MultipleChoicePublic = z9.object({
|
|
1355
|
+
concept: z9.string(),
|
|
1356
|
+
question: z9.string(),
|
|
1357
|
+
options: z9.array(z9.object({ text: z9.string() }).strict())
|
|
1307
1358
|
}).strict();
|
|
1308
1359
|
function toMultipleChoicePublic(spec) {
|
|
1309
1360
|
return {
|
|
@@ -1312,12 +1363,12 @@ function toMultipleChoicePublic(spec) {
|
|
|
1312
1363
|
options: spec.options.map((o) => ({ text: o.text }))
|
|
1313
1364
|
};
|
|
1314
1365
|
}
|
|
1315
|
-
var MultipleChoiceAnswer =
|
|
1316
|
-
var MultipleChoiceGrade =
|
|
1317
|
-
correct:
|
|
1318
|
-
correctOptionIndex:
|
|
1319
|
-
explanation:
|
|
1320
|
-
feedback:
|
|
1366
|
+
var MultipleChoiceAnswer = z9.object({ optionIndex: z9.number().int().nonnegative() }).strict();
|
|
1367
|
+
var MultipleChoiceGrade = z9.object({
|
|
1368
|
+
correct: z9.boolean(),
|
|
1369
|
+
correctOptionIndex: z9.number().int().nonnegative(),
|
|
1370
|
+
explanation: z9.string(),
|
|
1371
|
+
feedback: z9.string().optional()
|
|
1321
1372
|
}).strict();
|
|
1322
1373
|
function gradeMultipleChoice(spec, answer) {
|
|
1323
1374
|
const chosen = spec.options[answer.optionIndex];
|
|
@@ -1331,33 +1382,33 @@ function gradeMultipleChoice(spec, answer) {
|
|
|
1331
1382
|
}
|
|
1332
1383
|
|
|
1333
1384
|
// ../protocol/src/project-milestone.ts
|
|
1334
|
-
import { z as
|
|
1385
|
+
import { z as z10 } from "zod";
|
|
1335
1386
|
var MILESTONE_CHECK_TYPES = ["tests", "review"];
|
|
1336
|
-
var MilestoneCheckType =
|
|
1337
|
-
var MilestoneCompare =
|
|
1387
|
+
var MilestoneCheckType = z10.enum(MILESTONE_CHECK_TYPES);
|
|
1388
|
+
var MilestoneCompare = z10.enum(["stdout", "run_output"]);
|
|
1338
1389
|
var MAX_MILESTONE_REFERENCE_CHARS = 2e4;
|
|
1339
1390
|
var MAX_MILESTONE_STDERR_CHARS = 2e3;
|
|
1340
1391
|
var MAX_REVIEW_FILES = 200;
|
|
1341
1392
|
var MAX_REVIEW_FILE_CHARS = 6e4;
|
|
1342
1393
|
var MAX_REVIEW_TOTAL_CHARS = 24e4;
|
|
1343
1394
|
var MAX_REVIEW_PATH_CHARS = 500;
|
|
1344
|
-
var CommitId =
|
|
1345
|
-
var MilestoneCaseInput =
|
|
1346
|
-
name:
|
|
1347
|
-
input:
|
|
1395
|
+
var CommitId = z10.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/);
|
|
1396
|
+
var MilestoneCaseInput = z10.object({
|
|
1397
|
+
name: z10.string().trim().min(1).max(80).describe('A short name the learner sees, e.g. "empty input" or "nested parentheses".'),
|
|
1398
|
+
input: z10.string().max(MAX_CASE_INPUT_CHARS).describe(`The case's input. The learner's program gets it on stdin and as a file whose path replaces {input} in their command. Use "" for none.`),
|
|
1348
1399
|
compare: MilestoneCompare.optional().describe(
|
|
1349
1400
|
"stdout (the default) compares what the learner's program prints. run_output is for programs whose output is itself a program, such as a compiler's generated assembly: Mivra runs that output with the learner's own run-output command and compares what it prints, so the reference prints what running it should print."
|
|
1350
1401
|
)
|
|
1351
1402
|
}).strict();
|
|
1352
1403
|
var milestoneFields = {
|
|
1353
|
-
concept:
|
|
1354
|
-
title:
|
|
1355
|
-
spec:
|
|
1356
|
-
outputFormat:
|
|
1404
|
+
concept: z10.string().trim().min(1).max(80).describe('Short label for what this milestone practises, e.g. "tokenizing". Used to track progress.'),
|
|
1405
|
+
title: z10.string().trim().min(1).max(120),
|
|
1406
|
+
spec: z10.string().trim().min(1).max(6e3).describe("What the learner's program must do at this milestone, as markdown: the behaviour to add, building on the earlier milestones."),
|
|
1407
|
+
outputFormat: z10.string().trim().min(1).max(2e3).describe("Exactly what the program prints for an input, as markdown with an example, so any language can match it. Trailing spaces and trailing blank lines are ignored."),
|
|
1357
1408
|
checkType: MilestoneCheckType.describe(
|
|
1358
1409
|
"tests: Mivra runs the learner's program on the cases and compares what it prints, and a code review must approve too. review: no cases or reference; the code review alone decides, for what output can't show (structure, a language feature, concurrency, performance)."
|
|
1359
1410
|
),
|
|
1360
|
-
reviewFocus:
|
|
1411
|
+
reviewFocus: z10.string().trim().min(1).max(2e3).optional().describe(
|
|
1361
1412
|
`What the code review must see in the learner's code for this milestone's concept, e.g. "the scanner walks the characters itself rather than splitting with a regex". Required for a review milestone; optional for tests.`
|
|
1362
1413
|
)
|
|
1363
1414
|
};
|
|
@@ -1371,51 +1422,51 @@ function milestoneRules(value, ctx) {
|
|
|
1371
1422
|
if (!value.reviewFocus) ctx.addIssue({ code: "custom", path: ["reviewFocus"], message: "A review milestone needs reviewFocus: what the review must see in the code." });
|
|
1372
1423
|
}
|
|
1373
1424
|
}
|
|
1374
|
-
var ProjectMilestoneInput =
|
|
1425
|
+
var ProjectMilestoneInput = z10.object({
|
|
1375
1426
|
...milestoneFields,
|
|
1376
|
-
cases:
|
|
1377
|
-
referenceSolution:
|
|
1427
|
+
cases: z10.array(MilestoneCaseInput).max(MAX_EXERCISE_CASES).optional().describe(`tests only: 1-${MAX_EXERCISE_CASES} cases, simplest first, covering the milestone's edge cases. Each reference run has a 2 s limit. Leave out for review.`),
|
|
1428
|
+
referenceSolution: z10.string().min(1).max(MAX_MILESTONE_REFERENCE_CHARS).optional().describe(
|
|
1378
1429
|
"tests only: a Python program (standard library only) that reads a case's input from stdin and prints exactly what the learner's program should print, or for a run_output case what running its output should print. Mivra runs it in Pyodide on every case to get the expected outputs and never shows it. It must be deterministic. Leave out for review."
|
|
1379
1430
|
)
|
|
1380
1431
|
}).strict().superRefine(milestoneRules);
|
|
1381
1432
|
var MilestoneCase = MilestoneCaseInput.extend({
|
|
1382
|
-
expected:
|
|
1433
|
+
expected: z10.string().max(MAX_CASE_OUTPUT_CHARS),
|
|
1383
1434
|
/** Withdrawn by the tutor after a dispute: kept for the record, never run or graded again. */
|
|
1384
|
-
withdrawn:
|
|
1435
|
+
withdrawn: z10.boolean().optional()
|
|
1385
1436
|
}).strict();
|
|
1386
1437
|
var MAX_MILESTONE_DISPUTES = 20;
|
|
1387
1438
|
var MAX_DISPUTE_REASON_CHARS = 2e3;
|
|
1388
|
-
var MilestoneDisputeOutcome =
|
|
1389
|
-
var MilestoneDispute =
|
|
1390
|
-
id:
|
|
1391
|
-
target:
|
|
1439
|
+
var MilestoneDisputeOutcome = z10.enum(["kept", "withdrawn", "corrected", "upheld", "overturned"]);
|
|
1440
|
+
var MilestoneDispute = z10.object({
|
|
1441
|
+
id: z10.string(),
|
|
1442
|
+
target: z10.enum(["case", "review"]),
|
|
1392
1443
|
/** The disputed case's index in `cases`, and its name then. */
|
|
1393
|
-
caseIndex:
|
|
1394
|
-
caseName:
|
|
1395
|
-
reason:
|
|
1444
|
+
caseIndex: z10.number().int().nonnegative().optional(),
|
|
1445
|
+
caseName: z10.string().optional(),
|
|
1446
|
+
reason: z10.string().max(MAX_DISPUTE_REASON_CHARS),
|
|
1396
1447
|
outcome: MilestoneDisputeOutcome,
|
|
1397
1448
|
/** The tutor's explanation, for the learner. */
|
|
1398
|
-
explanation:
|
|
1449
|
+
explanation: z10.string().max(2e3),
|
|
1399
1450
|
/** A corrected case as it was before. */
|
|
1400
|
-
before:
|
|
1401
|
-
createdAt:
|
|
1451
|
+
before: z10.object({ input: z10.string(), expected: z10.string() }).strict().optional(),
|
|
1452
|
+
createdAt: z10.string().datetime()
|
|
1402
1453
|
}).strict();
|
|
1403
|
-
var ProjectMilestoneSpec =
|
|
1454
|
+
var ProjectMilestoneSpec = z10.object({
|
|
1404
1455
|
...milestoneFields,
|
|
1405
|
-
cases:
|
|
1406
|
-
referenceSolution:
|
|
1407
|
-
disputes:
|
|
1456
|
+
cases: z10.array(MilestoneCase).max(MAX_EXERCISE_CASES),
|
|
1457
|
+
referenceSolution: z10.string().max(MAX_MILESTONE_REFERENCE_CHARS).optional(),
|
|
1458
|
+
disputes: z10.array(MilestoneDispute).max(MAX_MILESTONE_DISPUTES).optional()
|
|
1408
1459
|
}).strict();
|
|
1409
1460
|
var activeMilestoneCases = (spec) => spec.cases.flatMap((testCase, index) => testCase.withdrawn ? [] : [{ ...testCase, index }]);
|
|
1410
|
-
var ProjectMilestonePublic =
|
|
1411
|
-
concept:
|
|
1412
|
-
title:
|
|
1413
|
-
spec:
|
|
1414
|
-
outputFormat:
|
|
1461
|
+
var ProjectMilestonePublic = z10.object({
|
|
1462
|
+
concept: z10.string(),
|
|
1463
|
+
title: z10.string(),
|
|
1464
|
+
spec: z10.string(),
|
|
1465
|
+
outputFormat: z10.string(),
|
|
1415
1466
|
checkType: MilestoneCheckType,
|
|
1416
|
-
reviewFocus:
|
|
1417
|
-
cases:
|
|
1418
|
-
disputes:
|
|
1467
|
+
reviewFocus: z10.string().optional(),
|
|
1468
|
+
cases: z10.array(z10.object({ name: z10.string(), input: z10.string(), compare: MilestoneCompare, expected: z10.string(), withdrawn: z10.boolean().optional() }).strict()),
|
|
1469
|
+
disputes: z10.array(MilestoneDispute)
|
|
1419
1470
|
}).strict();
|
|
1420
1471
|
var toProjectMilestonePublic = (spec) => ({
|
|
1421
1472
|
concept: spec.concept,
|
|
@@ -1427,62 +1478,62 @@ var toProjectMilestonePublic = (spec) => ({
|
|
|
1427
1478
|
cases: spec.cases.map((c) => ({ name: c.name, input: c.input, compare: c.compare ?? "stdout", expected: c.expected, ...c.withdrawn ? { withdrawn: true } : {} })),
|
|
1428
1479
|
disputes: spec.disputes ?? []
|
|
1429
1480
|
});
|
|
1430
|
-
var MilestoneCases =
|
|
1431
|
-
courseId:
|
|
1432
|
-
lessonId:
|
|
1433
|
-
artifactId:
|
|
1481
|
+
var MilestoneCases = z10.object({
|
|
1482
|
+
courseId: z10.string(),
|
|
1483
|
+
lessonId: z10.string(),
|
|
1484
|
+
artifactId: z10.string(),
|
|
1434
1485
|
/** The milestone's place in the syllabus, from 1. */
|
|
1435
|
-
position:
|
|
1436
|
-
title:
|
|
1486
|
+
position: z10.number().int().positive(),
|
|
1487
|
+
title: z10.string(),
|
|
1437
1488
|
checkType: MilestoneCheckType,
|
|
1438
1489
|
/** Names this set of cases; a check reports it back, so results for cases a dispute changed meanwhile are refused. */
|
|
1439
|
-
revision:
|
|
1490
|
+
revision: z10.string().regex(/^[0-9a-f]{8,64}$/),
|
|
1440
1491
|
/**
|
|
1441
1492
|
* The commit the last passed milestone was checked at, if any: `mivra check` sends only what changed since. Only a
|
|
1442
1493
|
* commit id, which `mivra check` hands to git as data.
|
|
1443
1494
|
*/
|
|
1444
1495
|
since: CommitId.nullable(),
|
|
1445
1496
|
/** The cases to run; withdrawn ones are left out. A review milestone has none. */
|
|
1446
|
-
cases:
|
|
1497
|
+
cases: z10.array(z10.object({ name: z10.string(), input: z10.string().max(MAX_CASE_INPUT_CHARS), compare: MilestoneCompare }).strict()).max(MAX_EXERCISE_CASES)
|
|
1447
1498
|
}).strict();
|
|
1448
|
-
var MilestoneRunError =
|
|
1449
|
-
var MilestoneCaseResult =
|
|
1450
|
-
stdout:
|
|
1451
|
-
truncated:
|
|
1452
|
-
stderr:
|
|
1499
|
+
var MilestoneRunError = z10.enum(["timeout", "output_limit", "start_failed", "no_run_output_command"]);
|
|
1500
|
+
var MilestoneCaseResult = z10.object({
|
|
1501
|
+
stdout: z10.string().max(MAX_CASE_OUTPUT_CHARS),
|
|
1502
|
+
truncated: z10.boolean().optional(),
|
|
1503
|
+
stderr: z10.string().max(MAX_MILESTONE_STDERR_CHARS).optional(),
|
|
1453
1504
|
/** The exit code, or null if it was killed or never started. */
|
|
1454
|
-
exitCode:
|
|
1505
|
+
exitCode: z10.number().int().nullable(),
|
|
1455
1506
|
error: MilestoneRunError.optional()
|
|
1456
1507
|
}).strict();
|
|
1457
|
-
var ReviewFile =
|
|
1458
|
-
var ReviewSkipReason =
|
|
1508
|
+
var ReviewFile = z10.object({ path: z10.string().min(1).max(MAX_REVIEW_PATH_CHARS), content: z10.string().max(MAX_REVIEW_FILE_CHARS) }).strict();
|
|
1509
|
+
var ReviewSkipReason = z10.enum(["binary", "too_large", "size_cap", "lockfile"]);
|
|
1459
1510
|
var reviewFields = {
|
|
1460
1511
|
/** The commit checked out when the check ran (the files may have changed since), if the repository has one. */
|
|
1461
1512
|
commit: CommitId.optional(),
|
|
1462
1513
|
/** Where the files came from: git, or nowhere outside a git repository (nothing is sent then). */
|
|
1463
|
-
source:
|
|
1464
|
-
files:
|
|
1514
|
+
source: z10.enum(["git", "none"]).optional(),
|
|
1515
|
+
files: z10.array(ReviewFile).max(MAX_REVIEW_FILES).optional(),
|
|
1465
1516
|
/** Paths of changed files that weren't sent, and why. */
|
|
1466
|
-
skipped:
|
|
1517
|
+
skipped: z10.array(z10.object({ path: z10.string().max(MAX_REVIEW_PATH_CHARS), reason: ReviewSkipReason }).strict()).max(1e3).optional(),
|
|
1467
1518
|
/** Paths deleted since the last passed milestone. */
|
|
1468
|
-
deleted:
|
|
1519
|
+
deleted: z10.array(z10.string().max(MAX_REVIEW_PATH_CHARS)).max(1e3).optional()
|
|
1469
1520
|
};
|
|
1470
|
-
var MilestoneCheckAnswer =
|
|
1471
|
-
results:
|
|
1521
|
+
var MilestoneCheckAnswer = z10.object({
|
|
1522
|
+
results: z10.array(MilestoneCaseResult).max(MAX_EXERCISE_CASES),
|
|
1472
1523
|
/** The `revision` of the cases that ran. Left out by a `mivra check` from before disputes. */
|
|
1473
|
-
revision:
|
|
1524
|
+
revision: z10.string().max(64).optional(),
|
|
1474
1525
|
...reviewFields
|
|
1475
1526
|
}).strict().superRefine((answer, ctx) => {
|
|
1476
1527
|
const total = (answer.files ?? []).reduce((sum, file) => sum + file.content.length, 0);
|
|
1477
1528
|
if (total > MAX_REVIEW_TOTAL_CHARS) ctx.addIssue({ code: "custom", path: ["files"], message: `At most ${MAX_REVIEW_TOTAL_CHARS} characters of files can be sent.` });
|
|
1478
1529
|
});
|
|
1479
|
-
var MilestoneGrade =
|
|
1530
|
+
var MilestoneGrade = z10.object({
|
|
1480
1531
|
/** Every case that ran passed (true when there were none to run). Not the milestone's pass: that needs the review too. */
|
|
1481
|
-
correct:
|
|
1482
|
-
passed:
|
|
1483
|
-
total:
|
|
1532
|
+
correct: z10.boolean(),
|
|
1533
|
+
passed: z10.number().int().nonnegative(),
|
|
1534
|
+
total: z10.number().int().nonnegative(),
|
|
1484
1535
|
/** One per case that ran, with its index in the spec's `cases` (missing in grades from before disputes: then in order). */
|
|
1485
|
-
cases:
|
|
1536
|
+
cases: z10.array(z10.object({ passed: z10.boolean(), case: z10.number().int().nonnegative().optional() }).strict())
|
|
1486
1537
|
}).strict();
|
|
1487
1538
|
function milestoneCasePassed(expected, run) {
|
|
1488
1539
|
return run.error === void 0 && !run.truncated && run.exitCode === 0 && normaliseOutput(run.stdout) === normaliseOutput(expected);
|
|
@@ -1496,11 +1547,11 @@ function gradeMilestone(spec, answer) {
|
|
|
1496
1547
|
const passed = cases.filter((c) => c.passed).length;
|
|
1497
1548
|
return { correct: passed === cases.length, passed, total: cases.length, cases };
|
|
1498
1549
|
}
|
|
1499
|
-
var ReviewCriterion =
|
|
1500
|
-
passed:
|
|
1501
|
-
note:
|
|
1550
|
+
var ReviewCriterion = z10.object({
|
|
1551
|
+
passed: z10.boolean(),
|
|
1552
|
+
note: z10.string().trim().min(1).max(1e3).describe("One to three sentences for the learner, pointing at the file and the code you mean.")
|
|
1502
1553
|
}).strict();
|
|
1503
|
-
var MilestoneReviewInput =
|
|
1554
|
+
var MilestoneReviewInput = z10.object({
|
|
1504
1555
|
noHardCodedOutputs: ReviewCriterion.describe(
|
|
1505
1556
|
"passed is false if the program special-cases test inputs or prints canned answers instead of computing them, e.g. matching an input string and printing its expected output."
|
|
1506
1557
|
),
|
|
@@ -1508,14 +1559,14 @@ var MilestoneReviewInput = z9.object({
|
|
|
1508
1559
|
quality: ReviewCriterion.describe(
|
|
1509
1560
|
"passed is false only for serious problems for a learner at this stage: code that can't be followed, copy-pasted blocks instead of a loop or function, or obvious bugs the tests miss. Style preferences never fail it."
|
|
1510
1561
|
),
|
|
1511
|
-
summary:
|
|
1512
|
-
suggestions:
|
|
1562
|
+
summary: z10.string().trim().min(1).max(1500).describe("What you'd tell the learner: what's good, and what to change if anything."),
|
|
1563
|
+
suggestions: z10.array(z10.string().trim().min(1).max(500)).max(8).describe("Optional next steps, most useful first. Never write the solution.")
|
|
1513
1564
|
}).strict();
|
|
1514
1565
|
var MilestoneReview = MilestoneReviewInput.extend({
|
|
1515
|
-
approved:
|
|
1516
|
-
judgedBy:
|
|
1566
|
+
approved: z10.boolean(),
|
|
1567
|
+
judgedBy: z10.literal("model"),
|
|
1517
1568
|
/** The model that reviewed, as shown in the picker. */
|
|
1518
|
-
model:
|
|
1569
|
+
model: z10.string()
|
|
1519
1570
|
}).strict();
|
|
1520
1571
|
var reviewVerdict = (input, model) => ({
|
|
1521
1572
|
...input,
|
|
@@ -1523,33 +1574,33 @@ var reviewVerdict = (input, model) => ({
|
|
|
1523
1574
|
judgedBy: "model",
|
|
1524
1575
|
model
|
|
1525
1576
|
});
|
|
1526
|
-
var MilestoneReviewStatus =
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1577
|
+
var MilestoneReviewStatus = z10.discriminatedUnion("status", [
|
|
1578
|
+
z10.object({ status: z10.literal("done"), review: MilestoneReview }).strict(),
|
|
1579
|
+
z10.object({ status: z10.literal("skipped"), reason: z10.enum(["tests_failed", "no_files"]) }).strict(),
|
|
1580
|
+
z10.object({ status: z10.literal("failed"), error: z10.string() }).strict()
|
|
1530
1581
|
]);
|
|
1531
1582
|
var milestonePassed = (grade, review) => grade.correct && review?.approved === true;
|
|
1532
|
-
var MilestoneCheckResult =
|
|
1583
|
+
var MilestoneCheckResult = z10.object({
|
|
1533
1584
|
grade: MilestoneGrade,
|
|
1534
|
-
expected:
|
|
1585
|
+
expected: z10.array(z10.string()),
|
|
1535
1586
|
review: MilestoneReviewStatus,
|
|
1536
|
-
passed:
|
|
1587
|
+
passed: z10.boolean()
|
|
1537
1588
|
}).strict();
|
|
1538
|
-
var MilestoneDisputeRequest =
|
|
1539
|
-
|
|
1540
|
-
|
|
1589
|
+
var MilestoneDisputeRequest = z10.discriminatedUnion("target", [
|
|
1590
|
+
z10.object({ target: z10.literal("case"), caseIndex: z10.number().int().nonnegative().max(MAX_EXERCISE_CASES - 1), reason: z10.string().trim().min(1).max(MAX_DISPUTE_REASON_CHARS) }).strict(),
|
|
1591
|
+
z10.object({ target: z10.literal("review"), reason: z10.string().trim().min(1).max(MAX_DISPUTE_REASON_CHARS) }).strict()
|
|
1541
1592
|
]);
|
|
1542
|
-
var CaseDisputeDecision =
|
|
1543
|
-
outcome:
|
|
1544
|
-
explanation:
|
|
1545
|
-
input:
|
|
1546
|
-
referenceSolution:
|
|
1547
|
-
}).strict();
|
|
1548
|
-
var MilestoneCheckView =
|
|
1549
|
-
results:
|
|
1550
|
-
files:
|
|
1551
|
-
skipped:
|
|
1552
|
-
source:
|
|
1593
|
+
var CaseDisputeDecision = z10.object({
|
|
1594
|
+
outcome: z10.enum(["keep", "withdraw", "correct"]).describe("keep: the case is right. withdraw: it's wrong or unfair and can't simply be fixed. correct: fix its input or the reference."),
|
|
1595
|
+
explanation: z10.string().trim().min(1).max(2e3).describe("For the learner: why, in two or three sentences."),
|
|
1596
|
+
input: z10.string().max(MAX_CASE_INPUT_CHARS).optional().describe("correct only: the case's corrected input, if the input was wrong."),
|
|
1597
|
+
referenceSolution: z10.string().min(1).max(MAX_MILESTONE_REFERENCE_CHARS).optional().describe("correct only: the whole corrected Python reference, if its output was wrong. Mivra reruns it on every case.")
|
|
1598
|
+
}).strict();
|
|
1599
|
+
var MilestoneCheckView = z10.object({
|
|
1600
|
+
results: z10.array(MilestoneCaseResult),
|
|
1601
|
+
files: z10.array(z10.string()),
|
|
1602
|
+
skipped: z10.array(z10.object({ path: z10.string(), reason: ReviewSkipReason }).strict()).optional(),
|
|
1603
|
+
source: z10.enum(["git", "none"]).optional()
|
|
1553
1604
|
}).strict();
|
|
1554
1605
|
var toMilestoneCheckView = (answer) => ({
|
|
1555
1606
|
results: answer.results,
|
|
@@ -1559,43 +1610,43 @@ var toMilestoneCheckView = (answer) => ({
|
|
|
1559
1610
|
});
|
|
1560
1611
|
|
|
1561
1612
|
// ../protocol/src/set-diagram.ts
|
|
1562
|
-
import { z as
|
|
1613
|
+
import { z as z11 } from "zod";
|
|
1563
1614
|
var MAX_SETS = 3;
|
|
1564
1615
|
var MAX_REGIONS = 8;
|
|
1565
1616
|
var MAX_ELEMENTS = 30;
|
|
1566
1617
|
var MAX_STEPS3 = 40;
|
|
1567
|
-
var SetId =
|
|
1618
|
+
var SetId = z11.string().trim().min(1).max(24);
|
|
1568
1619
|
var ONE_LINE = /^[^\n\r\v\f\u0085\u2028\u2029]*$/;
|
|
1569
|
-
var oneLine = (max) =>
|
|
1570
|
-
var Element =
|
|
1620
|
+
var oneLine = (max) => z11.string().trim().min(1).max(max).regex(ONE_LINE, "must not contain line breaks");
|
|
1621
|
+
var Element = z11.union([z11.number(), oneLine(24)]);
|
|
1571
1622
|
function setRegionKey(ids) {
|
|
1572
1623
|
return JSON.stringify([...ids].sort());
|
|
1573
1624
|
}
|
|
1574
|
-
var RegionIn =
|
|
1575
|
-
var SetDiagramSet =
|
|
1625
|
+
var RegionIn = z11.array(SetId).max(MAX_SETS);
|
|
1626
|
+
var SetDiagramSet = z11.object({
|
|
1576
1627
|
id: SetId.describe('Short id used to refer to this set, e.g. "a". Unique within the diagram.'),
|
|
1577
1628
|
label: oneLine(32).describe('Shown next to the circle, e.g. "$A$" or "Multiples of 3", on one line. Only $...$ is a formula.')
|
|
1578
1629
|
}).strict();
|
|
1579
|
-
var SetDiagramRegion =
|
|
1630
|
+
var SetDiagramRegion = z11.object({
|
|
1580
1631
|
in: RegionIn.describe('Ids of the sets this region is inside. It is outside all the others: with sets a, b, c, ["a","b"] means in a and b, not c. [] means outside every set and needs `universe`. No id twice.'),
|
|
1581
|
-
elements:
|
|
1582
|
-
count:
|
|
1632
|
+
elements: z11.array(Element).max(MAX_ELEMENTS).describe('What the region contains, each short and on one line. No element may appear twice, in this list or across regions, and 1 and "1" count as the same element. Empty if you only know the count, or the region is empty.'),
|
|
1633
|
+
count: z11.number().int().nonnegative().max(1e6).optional().describe("How many elements the region has, when that's more than you list, e.g. for inclusion-exclusion. At least the number of elements listed.")
|
|
1583
1634
|
}).strict();
|
|
1584
|
-
var SetDiagramHighlight =
|
|
1635
|
+
var SetDiagramHighlight = z11.object({
|
|
1585
1636
|
in: RegionIn.describe("The region to highlight, named like a region's `in`, with no id twice. Any region of the diagram can be highlighted, listed or not."),
|
|
1586
|
-
tone:
|
|
1637
|
+
tone: z11.enum(["active", "done", "muted"]).optional().describe("active = current focus, done = finished, muted = ruled out. Defaults to active.")
|
|
1587
1638
|
}).strict();
|
|
1588
|
-
var SetDiagramStep =
|
|
1589
|
-
explanation:
|
|
1590
|
-
highlights:
|
|
1591
|
-
variables:
|
|
1639
|
+
var SetDiagramStep = z11.object({
|
|
1640
|
+
explanation: z11.string().trim().min(1).max(500).describe("What this step shows, in one or two sentences."),
|
|
1641
|
+
highlights: z11.array(SetDiagramHighlight).max(MAX_REGIONS).optional().describe("All regions highlighted at this step, each at most once. They apply to this step only, not carried over: repeat any that still apply."),
|
|
1642
|
+
variables: z11.array(TraceVariable).max(12).optional().describe("All running state at this step, e.g. |A \u222A B| so far. Not carried over from earlier steps.")
|
|
1592
1643
|
}).strict();
|
|
1593
|
-
var SetDiagramSpec =
|
|
1594
|
-
title:
|
|
1595
|
-
sets:
|
|
1644
|
+
var SetDiagramSpec = z11.object({
|
|
1645
|
+
title: z11.string().trim().min(1).max(120),
|
|
1646
|
+
sets: z11.array(SetDiagramSet).min(1).max(MAX_SETS).describe("The circles, 1 to 3."),
|
|
1596
1647
|
universe: oneLine(24).optional().describe('Label of the rectangle around the sets, e.g. "$U$", on one line. Needed to show or highlight the region outside every set, such as a complement.'),
|
|
1597
|
-
regions:
|
|
1598
|
-
steps:
|
|
1648
|
+
regions: z11.array(SetDiagramRegion).max(MAX_REGIONS).describe("What each region contains, each region at most once."),
|
|
1649
|
+
steps: z11.array(SetDiagramStep).min(1).max(MAX_STEPS3).optional().describe("Optional walk through the diagram. Omit for a static diagram.")
|
|
1599
1650
|
}).strict().superRefine((spec, ctx) => {
|
|
1600
1651
|
const ids = spec.sets.map((s) => s.id);
|
|
1601
1652
|
spec.sets.forEach((set, i) => {
|
|
@@ -1634,34 +1685,34 @@ var SetDiagramSpec = z10.object({
|
|
|
1634
1685
|
});
|
|
1635
1686
|
|
|
1636
1687
|
// ../protocol/src/table.ts
|
|
1637
|
-
import { z as
|
|
1688
|
+
import { z as z12 } from "zod";
|
|
1638
1689
|
var MAX_COLUMNS = 16;
|
|
1639
1690
|
var MAX_ROWS = 64;
|
|
1640
1691
|
var MAX_STEPS4 = 100;
|
|
1641
|
-
var Header =
|
|
1642
|
-
var CellValue =
|
|
1643
|
-
var Index2 =
|
|
1644
|
-
var TableHighlight =
|
|
1692
|
+
var Header = z12.string().trim().min(1).max(80);
|
|
1693
|
+
var CellValue = z12.union([z12.number(), z12.boolean(), z12.string().max(120)]);
|
|
1694
|
+
var Index2 = z12.number().int().nonnegative();
|
|
1695
|
+
var TableHighlight = z12.object({
|
|
1645
1696
|
row: Index2.optional().describe("0-based data row, below the number of rows. With no column, highlights the whole row. A highlight must give a row, a column or both."),
|
|
1646
1697
|
column: Index2.optional().describe("0-based data column, below the number of columns. With no row, highlights the whole column. With both, highlights one cell."),
|
|
1647
|
-
tone:
|
|
1698
|
+
tone: z12.enum(["active", "done", "muted"]).optional().describe("active = current focus, done = finished, muted = ruled out. Defaults to active. Where highlights overlap, the later one wins.")
|
|
1648
1699
|
}).strict();
|
|
1649
|
-
var TableCellChange =
|
|
1700
|
+
var TableCellChange = z12.object({
|
|
1650
1701
|
row: Index2.describe("0-based data row, below the number of rows."),
|
|
1651
1702
|
column: Index2.describe("0-based data column, below the number of columns."),
|
|
1652
1703
|
value: CellValue.describe("The cell's value from this step on.")
|
|
1653
1704
|
}).strict();
|
|
1654
|
-
var TableStep =
|
|
1655
|
-
explanation:
|
|
1656
|
-
highlight:
|
|
1657
|
-
cells:
|
|
1705
|
+
var TableStep = z12.object({
|
|
1706
|
+
explanation: z12.string().trim().min(1).max(500).describe("What happens in this step, in one or two sentences."),
|
|
1707
|
+
highlight: z12.array(TableHighlight).max(32).optional().describe("All cells, rows and columns to highlight at this step. Not carried over from earlier steps."),
|
|
1708
|
+
cells: z12.array(TableCellChange).max(64).optional().describe('Cells this step fills in or changes. They keep the new value on later steps. To reveal working, start a cell as "" and set it here.')
|
|
1658
1709
|
}).strict();
|
|
1659
|
-
var TableSpec =
|
|
1660
|
-
title:
|
|
1661
|
-
columns:
|
|
1662
|
-
rows:
|
|
1663
|
-
rowHeaders:
|
|
1664
|
-
steps:
|
|
1710
|
+
var TableSpec = z12.object({
|
|
1711
|
+
title: z12.string().trim().min(1).max(120),
|
|
1712
|
+
columns: z12.array(Header).min(1).max(MAX_COLUMNS).describe("Column headers, one per data column. Don't include a header for rowHeaders."),
|
|
1713
|
+
rows: z12.array(z12.array(CellValue).min(1).max(MAX_COLUMNS)).min(1).max(MAX_ROWS).describe('Data rows, each with exactly one cell per column. A boolean shows as T or F; "" is a blank cell.'),
|
|
1714
|
+
rowHeaders: z12.array(Header).max(MAX_ROWS).optional().describe("Optional label for each row, e.g. a relation matrix's elements. Exactly one per row."),
|
|
1715
|
+
steps: z12.array(TableStep).min(1).max(MAX_STEPS4).optional().describe("Omit for a static table. With steps, the learner steps through them.")
|
|
1665
1716
|
}).strict().superRefine((spec, ctx) => {
|
|
1666
1717
|
const rowCount = spec.rows.length;
|
|
1667
1718
|
const columnCount = spec.columns.length;
|
|
@@ -1694,32 +1745,60 @@ var TableSpec = z11.object({
|
|
|
1694
1745
|
});
|
|
1695
1746
|
|
|
1696
1747
|
// ../protocol/src/worked-steps.ts
|
|
1697
|
-
import { z as
|
|
1748
|
+
import { z as z13 } from "zod";
|
|
1698
1749
|
var MAX_STEPS5 = 50;
|
|
1699
|
-
var WorkedStep =
|
|
1700
|
-
label:
|
|
1701
|
-
statement:
|
|
1702
|
-
justification:
|
|
1750
|
+
var WorkedStep = z13.object({
|
|
1751
|
+
label: z13.string().trim().min(1).max(40).optional().describe('Optional heading for this part of the working, e.g. "Base case", "Inductive step".'),
|
|
1752
|
+
statement: z13.string().trim().min(1).max(1e3).describe("What this step establishes, mostly as a formula in $...$. For large sums and fractions, put \\displaystyle INSIDE the dollars, e.g. $\\displaystyle\\sum_{i=1}^{n} i$; $$ is not available."),
|
|
1753
|
+
justification: z13.string().trim().min(1).max(500).describe('Why it follows, e.g. "by the inductive hypothesis".')
|
|
1703
1754
|
}).strict();
|
|
1704
|
-
var WorkedStepsSpec =
|
|
1705
|
-
title:
|
|
1706
|
-
goal:
|
|
1707
|
-
steps:
|
|
1755
|
+
var WorkedStepsSpec = z13.object({
|
|
1756
|
+
title: z13.string().trim().min(1).max(120),
|
|
1757
|
+
goal: z13.string().trim().min(1).max(500).optional().describe("Optional statement of what is being shown, e.g. the claim to prove."),
|
|
1758
|
+
steps: z13.array(WorkedStep).min(1).max(MAX_STEPS5)
|
|
1708
1759
|
}).strict();
|
|
1709
1760
|
|
|
1761
|
+
// ../protocol/src/citation.ts
|
|
1762
|
+
import { z as z14 } from "zod";
|
|
1763
|
+
var ID = "[A-Za-z0-9-]{1,64}";
|
|
1764
|
+
var REF = `doc:${ID}:p[1-9]\\d{0,5}|note:${ID}:[0-9a-f]{8}`;
|
|
1765
|
+
var REF_PATTERN = new RegExp(`^(?:${REF})$`);
|
|
1766
|
+
var CITATION_MARKER = new RegExp(`\\[cite:(${REF})\\]`, "g");
|
|
1767
|
+
var ANY_CITATION_MARKER = /[ \t]*\[cite:[^\]\n]{0,200}\]/g;
|
|
1768
|
+
var MAX_CITATION_MARKER_CHARS = "[cite:".length + 200 + 1;
|
|
1769
|
+
var citationMarker = (ref) => `[cite:${ref}]`;
|
|
1770
|
+
function parseCitationRef(ref) {
|
|
1771
|
+
if (!REF_PATTERN.test(ref)) return void 0;
|
|
1772
|
+
const [kind, id, locator] = ref.split(":");
|
|
1773
|
+
return kind === "doc" ? { kind: "doc", documentId: id, page: Number(locator.slice(1)) } : { kind: "note", noteId: id, headingKey: locator };
|
|
1774
|
+
}
|
|
1775
|
+
var MAX_RESOLVE_REFS = 50;
|
|
1776
|
+
var CitationResolveRequest = z14.object({ refs: z14.array(z14.string().max(200)).min(1).max(MAX_RESOLVE_REFS) });
|
|
1777
|
+
var ResolvedCitation = z14.object({
|
|
1778
|
+
ref: z14.string(),
|
|
1779
|
+
status: z14.enum(["ok", "changed", "missing", "invalid"]),
|
|
1780
|
+
kind: z14.enum(["doc", "note"]).optional(),
|
|
1781
|
+
/** The document's file name or the note's title. */
|
|
1782
|
+
source: z14.string().optional(),
|
|
1783
|
+
/** "Page 3", "Slide 2", or the heading path, such as "Recursion › Base case". */
|
|
1784
|
+
locator: z14.string().optional(),
|
|
1785
|
+
text: z14.string().optional()
|
|
1786
|
+
});
|
|
1787
|
+
var CitationResolveResponse = z14.object({ citations: z14.array(ResolvedCitation) });
|
|
1788
|
+
|
|
1710
1789
|
// ../protocol/src/lesson.ts
|
|
1711
|
-
import { z as
|
|
1712
|
-
var LessonSectionKind =
|
|
1790
|
+
import { z as z15 } from "zod";
|
|
1791
|
+
var LessonSectionKind = z15.enum(["prose", "algorithm_trace", "code_exercise", "code_walkthrough", "composition", "flashcard_deck", "graph", "multiple_choice", "project_milestone", "set_diagram", "table", "worked_steps"]);
|
|
1713
1792
|
var MAX_LESSON_SECTIONS = 10;
|
|
1714
|
-
var LessonOutlineFields =
|
|
1715
|
-
title:
|
|
1716
|
-
sections:
|
|
1717
|
-
|
|
1718
|
-
title:
|
|
1793
|
+
var LessonOutlineFields = z15.object({
|
|
1794
|
+
title: z15.string().trim().min(1).max(120),
|
|
1795
|
+
sections: z15.array(
|
|
1796
|
+
z15.object({
|
|
1797
|
+
title: z15.string().trim().min(1).max(120),
|
|
1719
1798
|
kind: LessonSectionKind.describe(
|
|
1720
1799
|
"prose = write_lesson_text; multiple_choice = ask_multiple_choice (a check); code_exercise = ask_code_exercise (a JavaScript or Python exercise the learner solves and submits); project_milestone = set_project_milestone (project courses only: the milestone the learner builds in their repository); the others = the matching show_* tool."
|
|
1721
1800
|
),
|
|
1722
|
-
purpose:
|
|
1801
|
+
purpose: z15.string().trim().min(1).max(300).describe("What this section does for the learner, in one sentence.")
|
|
1723
1802
|
}).strict()
|
|
1724
1803
|
).min(2).max(MAX_LESSON_SECTIONS)
|
|
1725
1804
|
}).strict();
|
|
@@ -1743,212 +1822,338 @@ var ProjectLessonOutlineInput = LessonOutlineFields.extend({
|
|
|
1743
1822
|
ctx.addIssue({ code: "custom", path: ["sections"], message: "Include exactly one project_milestone section, as the last section" });
|
|
1744
1823
|
}
|
|
1745
1824
|
});
|
|
1746
|
-
var LessonTextInput =
|
|
1747
|
-
markdown:
|
|
1748
|
-
revisits:
|
|
1749
|
-
}).strict();
|
|
1750
|
-
var LessonStatus =
|
|
1751
|
-
var LessonOutlineView =
|
|
1752
|
-
title:
|
|
1753
|
-
sections:
|
|
1754
|
-
}).strict();
|
|
1755
|
-
var LessonView =
|
|
1756
|
-
id:
|
|
1757
|
-
courseId:
|
|
1758
|
-
topicId:
|
|
1759
|
-
topicTitle:
|
|
1760
|
-
position:
|
|
1825
|
+
var LessonTextInput = z15.object({
|
|
1826
|
+
markdown: z15.string().trim().min(1).max(6e3).describe("The section's prose, as markdown with $...$ and $$...$$ maths. Don't repeat the section title as a heading."),
|
|
1827
|
+
revisits: z15.array(z15.string().min(1)).max(5).optional().describe("sectionIds from <previous_lesson> this section revisits. The page links back to them, so don't write links yourself.")
|
|
1828
|
+
}).strict();
|
|
1829
|
+
var LessonStatus = z15.enum(["generating", "ready", "failed", "finished"]);
|
|
1830
|
+
var LessonOutlineView = z15.object({
|
|
1831
|
+
title: z15.string(),
|
|
1832
|
+
sections: z15.array(z15.object({ title: z15.string(), kind: LessonSectionKind }).strict())
|
|
1833
|
+
}).strict();
|
|
1834
|
+
var LessonView = z15.object({
|
|
1835
|
+
id: z15.string(),
|
|
1836
|
+
courseId: z15.string(),
|
|
1837
|
+
topicId: z15.string(),
|
|
1838
|
+
topicTitle: z15.string(),
|
|
1839
|
+
position: z15.number().int().nonnegative(),
|
|
1761
1840
|
status: LessonStatus,
|
|
1762
|
-
version:
|
|
1841
|
+
version: z15.number().int().positive().nullable(),
|
|
1763
1842
|
outline: LessonOutlineView.nullable(),
|
|
1764
|
-
sections:
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
id:
|
|
1768
|
-
title:
|
|
1769
|
-
kind:
|
|
1770
|
-
markdown:
|
|
1843
|
+
sections: z15.array(
|
|
1844
|
+
z15.discriminatedUnion("kind", [
|
|
1845
|
+
z15.object({
|
|
1846
|
+
id: z15.string(),
|
|
1847
|
+
title: z15.string(),
|
|
1848
|
+
kind: z15.literal("prose"),
|
|
1849
|
+
markdown: z15.string(),
|
|
1771
1850
|
/** Earlier sections this one revisits, for links back to exactly what the learner saw. */
|
|
1772
|
-
revisits:
|
|
1851
|
+
revisits: z15.array(z15.object({ lessonId: z15.string(), sectionId: z15.string(), title: z15.string(), lessonTitle: z15.string() }).strict())
|
|
1773
1852
|
}).strict(),
|
|
1774
|
-
|
|
1853
|
+
z15.object({ id: z15.string(), title: z15.string(), kind: z15.literal("artifact"), artifact: z15.unknown() }).strict()
|
|
1775
1854
|
])
|
|
1776
1855
|
),
|
|
1777
|
-
checks:
|
|
1856
|
+
checks: z15.object({ total: z15.number().int().nonnegative(), answered: z15.number().int().nonnegative() }).strict(),
|
|
1778
1857
|
/** The course's current syllabus version, so a page can notice a change made while it was open. */
|
|
1779
|
-
syllabusVersion:
|
|
1858
|
+
syllabusVersion: z15.number().int().positive().nullable(),
|
|
1780
1859
|
/** Sections the latest version added or changed, highlighted for the learner, and why. */
|
|
1781
|
-
changedSectionIds:
|
|
1782
|
-
changeReason:
|
|
1860
|
+
changedSectionIds: z15.array(z15.string()),
|
|
1861
|
+
changeReason: z15.string().nullable(),
|
|
1783
1862
|
/** Whether the learner can finish it now: fully written and every check answered. */
|
|
1784
|
-
canFinish:
|
|
1785
|
-
error:
|
|
1863
|
+
canFinish: z15.boolean(),
|
|
1864
|
+
error: z15.string().nullable(),
|
|
1786
1865
|
/** A failure the learner fixes elsewhere: "lesson-model" means the lesson model chosen in Settings can't be used. */
|
|
1787
|
-
errorAction:
|
|
1788
|
-
createdAt:
|
|
1789
|
-
finishedAt:
|
|
1790
|
-
}).strict();
|
|
1791
|
-
var CourseLessonsView =
|
|
1792
|
-
topics:
|
|
1793
|
-
|
|
1794
|
-
topicId:
|
|
1795
|
-
title:
|
|
1796
|
-
lesson:
|
|
1866
|
+
errorAction: z15.enum(["lesson-model"]).nullable(),
|
|
1867
|
+
createdAt: z15.string().datetime(),
|
|
1868
|
+
finishedAt: z15.string().datetime().nullable()
|
|
1869
|
+
}).strict();
|
|
1870
|
+
var CourseLessonsView = z15.object({
|
|
1871
|
+
topics: z15.array(
|
|
1872
|
+
z15.object({
|
|
1873
|
+
topicId: z15.string(),
|
|
1874
|
+
title: z15.string(),
|
|
1875
|
+
lesson: z15.object({ id: z15.string(), status: LessonStatus }).strict().nullable()
|
|
1797
1876
|
}).strict()
|
|
1798
1877
|
),
|
|
1799
1878
|
/** The lesson to show: the first unfinished one, or the last one once all are finished. */
|
|
1800
|
-
currentLessonId:
|
|
1879
|
+
currentLessonId: z15.string().nullable(),
|
|
1801
1880
|
/** The next topic without a lesson, if the learner may start it now. */
|
|
1802
|
-
nextTopicId:
|
|
1881
|
+
nextTopicId: z15.string().nullable()
|
|
1803
1882
|
}).strict();
|
|
1804
|
-
var SectionTitle =
|
|
1805
|
-
var SectionMarkdown =
|
|
1806
|
-
var Reason =
|
|
1807
|
-
var ChangeLessonInput =
|
|
1883
|
+
var SectionTitle = z15.string().trim().min(1).max(120);
|
|
1884
|
+
var SectionMarkdown = z15.string().trim().min(1).max(6e3);
|
|
1885
|
+
var Reason = z15.string().trim().min(1).max(300);
|
|
1886
|
+
var ChangeLessonInput = z15.object({
|
|
1808
1887
|
reason: Reason.describe('What the learner asked for, in a few words, e.g. "Simpler intro with an example".'),
|
|
1809
|
-
operations:
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1888
|
+
operations: z15.array(
|
|
1889
|
+
z15.discriminatedUnion("op", [
|
|
1890
|
+
z15.object({ op: z15.literal("rewrite"), sectionId: z15.string().min(1), markdown: SectionMarkdown, title: SectionTitle.optional() }).strict().describe("Replace a prose section's text (and optionally its title)."),
|
|
1891
|
+
z15.object({ op: z15.literal("insert"), afterSectionId: z15.string().min(1).nullable(), title: SectionTitle, markdown: SectionMarkdown }).strict().describe("Add a prose section after the given section, or first if null."),
|
|
1892
|
+
z15.object({ op: z15.literal("insert_artifact"), afterSectionId: z15.string().min(1).nullable(), title: SectionTitle, artifactId: z15.string().min(1) }).strict().describe("Add a card you created earlier in this reply (its artifactId) as a section."),
|
|
1893
|
+
z15.object({ op: z15.literal("remove"), sectionId: z15.string().min(1) }).strict(),
|
|
1894
|
+
z15.object({ op: z15.literal("move"), sectionId: z15.string().min(1), afterSectionId: z15.string().min(1).nullable() }).strict()
|
|
1816
1895
|
])
|
|
1817
1896
|
).min(1).max(10)
|
|
1818
1897
|
}).strict();
|
|
1819
|
-
var ChangeSyllabusInput =
|
|
1898
|
+
var ChangeSyllabusInput = z15.object({
|
|
1820
1899
|
reason: Reason.describe('What the learner asked for, e.g. "Add a topic on vectors before gradients".'),
|
|
1821
|
-
operations:
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
op:
|
|
1825
|
-
afterTopicId:
|
|
1900
|
+
operations: z15.array(
|
|
1901
|
+
z15.discriminatedUnion("op", [
|
|
1902
|
+
z15.object({
|
|
1903
|
+
op: z15.literal("insert"),
|
|
1904
|
+
afterTopicId: z15.string().min(1).nullable().describe("Insert after this topic; null to insert before the first future topic."),
|
|
1826
1905
|
title: SectionTitle,
|
|
1827
|
-
summary:
|
|
1906
|
+
summary: z15.string().trim().min(1).max(400),
|
|
1828
1907
|
reason: Reason,
|
|
1829
|
-
concepts:
|
|
1908
|
+
concepts: z15.array(z15.string().trim().min(1).max(80)).min(1).max(8)
|
|
1830
1909
|
}).strict(),
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1910
|
+
z15.object({ op: z15.literal("edit"), topicId: z15.string().min(1), title: SectionTitle.optional(), summary: z15.string().trim().min(1).max(400).optional() }).strict(),
|
|
1911
|
+
z15.object({ op: z15.literal("remove"), topicId: z15.string().min(1) }).strict(),
|
|
1912
|
+
z15.object({ op: z15.literal("move"), topicId: z15.string().min(1), afterTopicId: z15.string().min(1).nullable() }).strict()
|
|
1834
1913
|
])
|
|
1835
1914
|
).min(1).max(10)
|
|
1836
1915
|
}).strict();
|
|
1837
|
-
var AddToLesson =
|
|
1838
|
-
messageId:
|
|
1839
|
-
afterSectionId:
|
|
1916
|
+
var AddToLesson = z15.object({
|
|
1917
|
+
messageId: z15.string().min(1).max(128),
|
|
1918
|
+
afterSectionId: z15.string().min(1).max(128).nullable(),
|
|
1840
1919
|
title: SectionTitle
|
|
1841
1920
|
}).strict();
|
|
1842
|
-
var NewTopic =
|
|
1921
|
+
var NewTopic = z15.object({
|
|
1843
1922
|
title: SectionTitle,
|
|
1844
|
-
summary:
|
|
1845
|
-
concepts:
|
|
1923
|
+
summary: z15.string().trim().min(1).max(400),
|
|
1924
|
+
concepts: z15.array(z15.string().trim().min(1).max(80)).min(1).max(8)
|
|
1846
1925
|
}).strict();
|
|
1847
|
-
var AdaptSyllabusInput =
|
|
1926
|
+
var AdaptSyllabusInput = z15.object({
|
|
1848
1927
|
reason: Reason.describe('Shown to the learner, with the evidence, e.g. "Added a chain rule refresher: you missed 3 of 4 checks on derivatives".'),
|
|
1849
|
-
operation:
|
|
1850
|
-
NewTopic.extend({ op:
|
|
1851
|
-
|
|
1852
|
-
|
|
1928
|
+
operation: z15.discriminatedUnion("op", [
|
|
1929
|
+
NewTopic.extend({ op: z15.literal("insert"), afterTopicId: z15.string().min(1).nullable().describe("null = straight after this lesson's topic") }).strict(),
|
|
1930
|
+
z15.object({ op: z15.literal("split"), topicId: z15.string().min(1), into: z15.array(NewTopic).min(2).max(3) }).strict(),
|
|
1931
|
+
z15.object({ op: z15.literal("move"), topicId: z15.string().min(1), afterTopicId: z15.string().min(1).nullable() }).strict()
|
|
1853
1932
|
])
|
|
1854
1933
|
}).strict();
|
|
1855
1934
|
|
|
1935
|
+
// ../protocol/src/review.ts
|
|
1936
|
+
import { z as z16 } from "zod";
|
|
1937
|
+
var DueReason = z16.enum(["missed", "unsure", "retention"]);
|
|
1938
|
+
var MAX_REVIEW_CONCEPTS = 5;
|
|
1939
|
+
var DueReviewItem = z16.object({
|
|
1940
|
+
concept: z16.string(),
|
|
1941
|
+
reason: DueReason,
|
|
1942
|
+
/** When the concept was last answered on. */
|
|
1943
|
+
lastAttemptAt: z16.string().datetime(),
|
|
1944
|
+
/** Right scored answers in a row, newest first; 0 after a miss or a "Not sure". */
|
|
1945
|
+
streak: z16.number().int().nonnegative(),
|
|
1946
|
+
/** Days the streak earned before the next check: 0 for a miss or a "Not sure". */
|
|
1947
|
+
intervalDays: z16.number().int().nonnegative(),
|
|
1948
|
+
/** When it fell due: the last attempt plus the interval. */
|
|
1949
|
+
dueAt: z16.string().datetime(),
|
|
1950
|
+
/** Whole days since it fell due. */
|
|
1951
|
+
overdueDays: z16.number().int().nonnegative(),
|
|
1952
|
+
/** The course the concept was last practised in, if it was practised in one. */
|
|
1953
|
+
course: z16.object({ id: z16.string(), title: z16.string() }).strict().nullable()
|
|
1954
|
+
}).strict();
|
|
1955
|
+
var MAX_PREREQUISITE_RECOMMENDATIONS = 5;
|
|
1956
|
+
var PrerequisiteStatus = z16.enum(["focus", "unsure", "not_started"]);
|
|
1957
|
+
var PrerequisiteRecommendation = z16.object({
|
|
1958
|
+
/** The concept the learner is weak on. */
|
|
1959
|
+
concept: z16.string(),
|
|
1960
|
+
/** The concept the graph says comes before it. */
|
|
1961
|
+
prerequisite: z16.string(),
|
|
1962
|
+
prerequisiteStatus: PrerequisiteStatus
|
|
1963
|
+
}).strict();
|
|
1964
|
+
var DueReviewQueue = z16.object({
|
|
1965
|
+
/** The first of the due items, up to a cap. */
|
|
1966
|
+
items: z16.array(DueReviewItem),
|
|
1967
|
+
/** How many concepts are due in all. */
|
|
1968
|
+
total: z16.number().int().nonnegative(),
|
|
1969
|
+
/** When the queue was worked out. */
|
|
1970
|
+
asOf: z16.string().datetime(),
|
|
1971
|
+
/** True when the learner has more graded attempts than the queue's lookback window. */
|
|
1972
|
+
truncated: z16.boolean().optional(),
|
|
1973
|
+
/** Weak prerequisites to drill before the concepts that depend on them, if the concept graph shows any. */
|
|
1974
|
+
recommendations: z16.array(PrerequisiteRecommendation).max(MAX_PREREQUISITE_RECOMMENDATIONS).optional()
|
|
1975
|
+
}).strict();
|
|
1976
|
+
var StartReview = z16.object({
|
|
1977
|
+
concepts: z16.array(z16.string().trim().min(1).max(200)).min(1).max(MAX_REVIEW_CONCEPTS).optional()
|
|
1978
|
+
}).strict();
|
|
1979
|
+
var StartDrill = z16.object({
|
|
1980
|
+
prerequisite: z16.string().trim().min(1).max(200),
|
|
1981
|
+
concept: z16.string().trim().min(1).max(200)
|
|
1982
|
+
}).strict();
|
|
1983
|
+
|
|
1856
1984
|
// ../protocol/src/memory.ts
|
|
1857
|
-
import { z as
|
|
1858
|
-
var MemoryKind =
|
|
1859
|
-
var RememberKind =
|
|
1860
|
-
var MemoryText =
|
|
1861
|
-
var RememberInput =
|
|
1985
|
+
import { z as z17 } from "zod";
|
|
1986
|
+
var MemoryKind = z17.enum(["goal", "preference", "misconception", "known"]);
|
|
1987
|
+
var RememberKind = z17.enum(["goal", "preference", "misconception"]);
|
|
1988
|
+
var MemoryText = z17.string().trim().min(1).max(300);
|
|
1989
|
+
var RememberInput = z17.object({
|
|
1862
1990
|
kind: RememberKind.describe("goal = what they want to learn or do; preference = how they like to learn; misconception = something they believe that is wrong."),
|
|
1863
1991
|
text: MemoryText.describe("One short sentence about the learner. Never include the answer to a check they haven't answered."),
|
|
1864
|
-
concept:
|
|
1865
|
-
replaces:
|
|
1992
|
+
concept: z17.string().trim().min(1).max(80).optional().describe("Required for a misconception: the concept it is about. Use the exact name from the check or from their record, so it can be linked to their answers."),
|
|
1993
|
+
replaces: z17.string().min(1).optional().describe("The id of a known memory this one corrects or updates.")
|
|
1866
1994
|
}).strict().superRefine((input, ctx) => {
|
|
1867
1995
|
if (input.kind === "misconception" && !input.concept) {
|
|
1868
1996
|
ctx.addIssue({ code: "custom", path: ["concept"], message: "A misconception needs a concept" });
|
|
1869
1997
|
}
|
|
1870
1998
|
});
|
|
1871
|
-
var MemoryBasis =
|
|
1872
|
-
var MemoryView =
|
|
1873
|
-
id:
|
|
1999
|
+
var MemoryBasis = z17.enum(["wrong_answer", "chat", "import"]);
|
|
2000
|
+
var MemoryView = z17.object({
|
|
2001
|
+
id: z17.string(),
|
|
1874
2002
|
kind: MemoryKind,
|
|
1875
|
-
held:
|
|
1876
|
-
text:
|
|
1877
|
-
concept:
|
|
2003
|
+
held: z17.boolean(),
|
|
2004
|
+
text: z17.string().nullable(),
|
|
2005
|
+
concept: z17.string().nullable(),
|
|
1878
2006
|
basis: MemoryBasis.nullable(),
|
|
1879
2007
|
/** For basis `import`, the note it was drawn from. Null otherwise, and while held. */
|
|
1880
|
-
source:
|
|
1881
|
-
createdAt:
|
|
1882
|
-
editedAt:
|
|
2008
|
+
source: z17.object({ noteId: z17.string(), importId: z17.string(), importName: z17.string(), path: z17.string(), title: z17.string() }).strict().nullable(),
|
|
2009
|
+
createdAt: z17.string().datetime(),
|
|
2010
|
+
editedAt: z17.string().datetime().nullable()
|
|
1883
2011
|
}).strict();
|
|
1884
|
-
var MemoryEdit =
|
|
1885
|
-
var MemoryBulkDelete =
|
|
2012
|
+
var MemoryEdit = z17.object({ text: MemoryText }).strict();
|
|
2013
|
+
var MemoryBulkDelete = z17.object({ basis: z17.literal("import") }).strict();
|
|
1886
2014
|
|
|
1887
2015
|
// ../protocol/src/document.ts
|
|
1888
|
-
import { z as
|
|
2016
|
+
import { z as z18 } from "zod";
|
|
1889
2017
|
var MAX_DOCUMENT_BYTES = 25 * 1024 * 1024;
|
|
1890
|
-
var
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2018
|
+
var MAX_TEXT_SOURCE_CHARS = 5e5;
|
|
2019
|
+
var MAX_TEXT_SOURCE_TITLE_CHARS = 120;
|
|
2020
|
+
var DocumentKind = z18.enum(["pdf", "pptx", "text", "markdown"]);
|
|
2021
|
+
var DocumentView = z18.object({
|
|
2022
|
+
id: z18.string(),
|
|
2023
|
+
sessionId: z18.string(),
|
|
2024
|
+
messageId: z18.string().nullable(),
|
|
2025
|
+
filename: z18.string(),
|
|
2026
|
+
kind: DocumentKind,
|
|
2027
|
+
byteSize: z18.number().int(),
|
|
2028
|
+
pageCount: z18.number().int(),
|
|
2029
|
+
pagesWithText: z18.number().int(),
|
|
2030
|
+
status: z18.literal("ready"),
|
|
2031
|
+
createdAt: z18.string().datetime()
|
|
2032
|
+
});
|
|
2033
|
+
var SourceView = z18.object({
|
|
2034
|
+
id: z18.string(),
|
|
2035
|
+
filename: z18.string(),
|
|
2036
|
+
kind: DocumentKind,
|
|
2037
|
+
byteSize: z18.number().int(),
|
|
2038
|
+
textChars: z18.number().int(),
|
|
2039
|
+
pageCount: z18.number().int(),
|
|
2040
|
+
pagesWithText: z18.number().int(),
|
|
2041
|
+
status: z18.literal("ready"),
|
|
2042
|
+
attachmentCount: z18.number().int(),
|
|
2043
|
+
createdAt: z18.string().datetime()
|
|
1901
2044
|
});
|
|
1902
2045
|
|
|
1903
2046
|
// ../protocol/src/vault.ts
|
|
1904
|
-
import { z as
|
|
2047
|
+
import { z as z20 } from "zod";
|
|
1905
2048
|
|
|
1906
2049
|
// ../protocol/src/knowledge.ts
|
|
1907
|
-
import { z as
|
|
1908
|
-
var NoteRef =
|
|
1909
|
-
var ConceptName2 =
|
|
2050
|
+
import { z as z19 } from "zod";
|
|
2051
|
+
var NoteRef = z19.string().regex(/^n\d{1,3}$/);
|
|
2052
|
+
var ConceptName2 = z19.string().trim().min(1).max(80);
|
|
1910
2053
|
var MAX_PROPOSED_CONCEPTS = 30;
|
|
1911
2054
|
var MAX_PROPOSED_EDGES = 40;
|
|
1912
2055
|
var MAX_PROPOSED_MEMORIES = 30;
|
|
1913
|
-
var ConceptEdgeKind =
|
|
1914
|
-
var
|
|
1915
|
-
|
|
1916
|
-
|
|
2056
|
+
var ConceptEdgeKind = z19.enum(["prerequisite", "related"]);
|
|
2057
|
+
var LinkConceptsInput = z19.object({
|
|
2058
|
+
from: ConceptName2.describe(
|
|
2059
|
+
"The first concept name. For `prerequisite`, the concept that must be understood before `to`. Reuse an existing concept name from <learner_concepts> or <learner_concept_graph> when one fits."
|
|
2060
|
+
),
|
|
2061
|
+
to: ConceptName2.describe(
|
|
2062
|
+
"The second concept name. For `prerequisite`, the concept that builds on `from`. Reuse an existing concept name from <learner_concepts> or <learner_concept_graph> when one fits."
|
|
2063
|
+
),
|
|
2064
|
+
kind: ConceptEdgeKind.describe("prerequisite = `from` must be understood before `to`; related = the two concepts are closely linked.")
|
|
2065
|
+
}).strict();
|
|
2066
|
+
var RecordFromNotesInput = z19.object({
|
|
2067
|
+
concepts: z19.array(
|
|
2068
|
+
z19.object({
|
|
1917
2069
|
name: ConceptName2.describe("A name from <existing_concepts> or <vault_tags> when one fits. Otherwise a new name, written as it appears in the notes."),
|
|
1918
|
-
notes:
|
|
2070
|
+
notes: z19.array(NoteRef).min(1).max(20).describe("The refs of the notes that cover it.")
|
|
1919
2071
|
}).strict()
|
|
1920
2072
|
).max(MAX_PROPOSED_CONCEPTS),
|
|
1921
|
-
edges:
|
|
1922
|
-
|
|
2073
|
+
edges: z19.array(
|
|
2074
|
+
z19.object({
|
|
1923
2075
|
from: ConceptName2,
|
|
1924
2076
|
to: ConceptName2,
|
|
1925
2077
|
kind: ConceptEdgeKind.describe("prerequisite = from must be understood before to; related = they're closely linked."),
|
|
1926
2078
|
note: NoteRef.describe("The ref of the note that shows this link.")
|
|
1927
2079
|
}).strict()
|
|
1928
2080
|
).max(MAX_PROPOSED_EDGES).describe("Edges between concepts named in this call or in <existing_concepts>."),
|
|
1929
|
-
memories:
|
|
1930
|
-
|
|
1931
|
-
kind:
|
|
2081
|
+
memories: z19.array(
|
|
2082
|
+
z19.object({
|
|
2083
|
+
kind: z19.enum(["known", "goal", "misconception"]).describe("known = the notes cover this concept; goal = a goal the notes state; misconception = a wrong belief the notes state."),
|
|
1932
2084
|
text: MemoryText.describe("One short sentence about the learner."),
|
|
1933
2085
|
concept: ConceptName2.optional().describe("Required for known and misconception: a concept named in this call or in <existing_concepts>."),
|
|
1934
2086
|
note: NoteRef.describe("The ref of the note it comes from.")
|
|
1935
2087
|
}).strict()
|
|
1936
2088
|
).max(MAX_PROPOSED_MEMORIES)
|
|
1937
2089
|
}).strict();
|
|
1938
|
-
var DistillationStatus =
|
|
1939
|
-
var DistillationView =
|
|
2090
|
+
var DistillationStatus = z19.enum(["idle", "queued", "running", "cancelled", "failed"]);
|
|
2091
|
+
var DistillationView = z19.object({
|
|
1940
2092
|
status: DistillationStatus,
|
|
1941
|
-
pendingNotes:
|
|
1942
|
-
groups:
|
|
1943
|
-
groupsDone:
|
|
1944
|
-
error:
|
|
2093
|
+
pendingNotes: z19.number().int(),
|
|
2094
|
+
groups: z19.number().int(),
|
|
2095
|
+
groupsDone: z19.number().int(),
|
|
2096
|
+
error: z19.string().nullable(),
|
|
1945
2097
|
/** Concepts and memories drawn from this import's notes so far. */
|
|
1946
|
-
concepts:
|
|
1947
|
-
memories:
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
2098
|
+
concepts: z19.number().int(),
|
|
2099
|
+
memories: z19.number().int(),
|
|
2100
|
+
/** New concepts the current or last run left out because the concept graph was full (MAX_CONCEPT_NODES); absent when none. */
|
|
2101
|
+
conceptsSkipped: z19.number().int().optional()
|
|
2102
|
+
}).strict();
|
|
2103
|
+
var ConceptGraph = z19.object({
|
|
2104
|
+
concepts: z19.array(z19.object({ id: z19.string(), name: z19.string(), notes: z19.array(z19.string()), fromSessions: z19.boolean().optional() }).strict()),
|
|
2105
|
+
edges: z19.array(z19.object({ from: z19.string(), to: z19.string(), kind: ConceptEdgeKind, notes: z19.array(z19.string()), fromSessions: z19.boolean().optional() }).strict())
|
|
2106
|
+
}).strict();
|
|
2107
|
+
var ConceptSummary = z19.object({ id: z19.string(), name: z19.string() }).strict();
|
|
2108
|
+
var MasteryStatus = z19.enum(["strength", "focus", "practicing", "unsure", "not_started"]);
|
|
2109
|
+
var MasterySummary = z19.object({
|
|
2110
|
+
status: MasteryStatus,
|
|
2111
|
+
/** Every attempt on the concept: graded, model-judged and "Not sure". */
|
|
2112
|
+
attempts: z19.number().int(),
|
|
2113
|
+
/** Right answers by the deterministic grader. */
|
|
2114
|
+
correct: z19.number().int(),
|
|
2115
|
+
/** Wrong answers by the deterministic grader. */
|
|
2116
|
+
incorrect: z19.number().int(),
|
|
2117
|
+
/** Placement "Not sure" answers: not known yet, which isn't a mistake. */
|
|
2118
|
+
unsure: z19.number().int(),
|
|
2119
|
+
/** Project milestone code reviews a model judged (ADR-016): opinions, kept apart from the grader's verdicts. */
|
|
2120
|
+
modelJudged: z19.number().int(),
|
|
2121
|
+
/** How many of those reviews approved the code. */
|
|
2122
|
+
modelApproved: z19.number().int()
|
|
2123
|
+
}).strict();
|
|
2124
|
+
var ConceptMastery = MasterySummary.extend({
|
|
2125
|
+
concept: z19.string(),
|
|
2126
|
+
/** The newest attempt's result; null when not started. */
|
|
2127
|
+
lastResult: z19.enum(["correct", "incorrect", "unsure"]).nullable(),
|
|
2128
|
+
/** The newest attempt's date (YYYY-MM-DD); null when not started. */
|
|
2129
|
+
lastSeen: z19.string().nullable(),
|
|
2130
|
+
/** In a course's record: the titles of the syllabus topics that teach the concept. */
|
|
2131
|
+
topics: z19.array(z19.string()).optional()
|
|
2132
|
+
}).strict();
|
|
2133
|
+
var MasteryRecord = z19.object({
|
|
2134
|
+
scope: z19.enum(["global", "course"]),
|
|
2135
|
+
/** The course this record covers; absent on the global record. */
|
|
2136
|
+
courseId: z19.string().optional(),
|
|
2137
|
+
evidence: z19.object({
|
|
2138
|
+
/** Attempts the record was derived from. */
|
|
2139
|
+
attempts: z19.number().int(),
|
|
2140
|
+
/** Of those, answers the deterministic grader marked (right or wrong). */
|
|
2141
|
+
graded: z19.number().int(),
|
|
2142
|
+
/** Of those, model code reviews. */
|
|
2143
|
+
modelJudged: z19.number().int(),
|
|
2144
|
+
/** Of those, placement "Not sure" answers. */
|
|
2145
|
+
unsure: z19.number().int(),
|
|
2146
|
+
/** Attempts in the last RECENT_EVIDENCE_DAYS days. */
|
|
2147
|
+
recent: z19.number().int(),
|
|
2148
|
+
recentDays: z19.number().int()
|
|
2149
|
+
}).strict(),
|
|
2150
|
+
/** The oldest evidence was left out because the history passed the limit the record reads. */
|
|
2151
|
+
truncated: z19.boolean(),
|
|
2152
|
+
strengths: z19.array(ConceptMastery),
|
|
2153
|
+
focus: z19.array(ConceptMastery),
|
|
2154
|
+
practicing: z19.array(ConceptMastery),
|
|
2155
|
+
unsure: z19.array(ConceptMastery),
|
|
2156
|
+
notStarted: z19.array(ConceptMastery)
|
|
1952
2157
|
}).strict();
|
|
1953
2158
|
|
|
1954
2159
|
// ../protocol/src/vault.ts
|
|
@@ -1956,94 +2161,116 @@ var MAX_VAULT_FILES = 1e4;
|
|
|
1956
2161
|
var MAX_NOTE_CHARS = 1e6;
|
|
1957
2162
|
var MAX_VAULT_BYTES = 64 * 1024 * 1024;
|
|
1958
2163
|
var MAX_PATH_CHARS = 512;
|
|
1959
|
-
var VaultFile =
|
|
2164
|
+
var VaultFile = z20.object({
|
|
1960
2165
|
/** The file's path inside the vault, with `/` between folders, e.g. `Maths/Recursion.md`. */
|
|
1961
|
-
path:
|
|
1962
|
-
text:
|
|
1963
|
-
}).strict();
|
|
1964
|
-
var VaultFiles =
|
|
1965
|
-
var VaultName =
|
|
1966
|
-
var VaultImportInput =
|
|
1967
|
-
var VaultSnapshotInput =
|
|
1968
|
-
var VaultImportView =
|
|
1969
|
-
id:
|
|
1970
|
-
name:
|
|
1971
|
-
source:
|
|
1972
|
-
noteCount:
|
|
1973
|
-
createdAt:
|
|
1974
|
-
updatedAt:
|
|
2166
|
+
path: z20.string().min(1).max(MAX_PATH_CHARS),
|
|
2167
|
+
text: z20.string().max(MAX_NOTE_CHARS)
|
|
2168
|
+
}).strict();
|
|
2169
|
+
var VaultFiles = z20.array(VaultFile).max(MAX_VAULT_FILES);
|
|
2170
|
+
var VaultName = z20.string().trim().min(1).max(120);
|
|
2171
|
+
var VaultImportInput = z20.object({ name: VaultName, files: VaultFiles }).strict();
|
|
2172
|
+
var VaultSnapshotInput = z20.object({ files: VaultFiles }).strict();
|
|
2173
|
+
var VaultImportView = z20.object({
|
|
2174
|
+
id: z20.string(),
|
|
2175
|
+
name: z20.string(),
|
|
2176
|
+
source: z20.literal("obsidian"),
|
|
2177
|
+
noteCount: z20.number().int(),
|
|
2178
|
+
createdAt: z20.string().datetime(),
|
|
2179
|
+
updatedAt: z20.string().datetime(),
|
|
1975
2180
|
/** Distilling its notes into concepts and memories, which starts after every import (ADR-014). */
|
|
1976
2181
|
distillation: DistillationView
|
|
1977
2182
|
}).strict();
|
|
1978
|
-
var SkipReason =
|
|
1979
|
-
var VaultImportResult =
|
|
2183
|
+
var SkipReason = z20.enum(["not_markdown", "hidden", "bad_path", "duplicate", "too_long", "symlink", "generated"]);
|
|
2184
|
+
var VaultImportResult = z20.object({
|
|
1980
2185
|
import: VaultImportView,
|
|
1981
|
-
added:
|
|
1982
|
-
updated:
|
|
1983
|
-
removed:
|
|
1984
|
-
unchanged:
|
|
1985
|
-
skippedCount:
|
|
1986
|
-
skipped:
|
|
2186
|
+
added: z20.number().int(),
|
|
2187
|
+
updated: z20.number().int(),
|
|
2188
|
+
removed: z20.number().int(),
|
|
2189
|
+
unchanged: z20.number().int(),
|
|
2190
|
+
skippedCount: z20.number().int(),
|
|
2191
|
+
skipped: z20.array(z20.object({ path: z20.string(), reason: SkipReason }).strict()),
|
|
1987
2192
|
/** Links or tags left out because a note or the vault had more than the limit. */
|
|
1988
|
-
truncated:
|
|
1989
|
-
}).strict();
|
|
1990
|
-
var NoteView =
|
|
1991
|
-
id:
|
|
1992
|
-
importId:
|
|
1993
|
-
path:
|
|
1994
|
-
title:
|
|
1995
|
-
aliases:
|
|
1996
|
-
tags:
|
|
1997
|
-
body:
|
|
1998
|
-
updatedAt:
|
|
1999
|
-
}).strict();
|
|
2000
|
-
var NoteGraph =
|
|
2001
|
-
notes:
|
|
2002
|
-
links:
|
|
2193
|
+
truncated: z20.boolean()
|
|
2194
|
+
}).strict();
|
|
2195
|
+
var NoteView = z20.object({
|
|
2196
|
+
id: z20.string(),
|
|
2197
|
+
importId: z20.string(),
|
|
2198
|
+
path: z20.string(),
|
|
2199
|
+
title: z20.string(),
|
|
2200
|
+
aliases: z20.array(z20.string()),
|
|
2201
|
+
tags: z20.array(z20.string()),
|
|
2202
|
+
body: z20.string(),
|
|
2203
|
+
updatedAt: z20.string().datetime()
|
|
2204
|
+
}).strict();
|
|
2205
|
+
var NoteGraph = z20.object({
|
|
2206
|
+
notes: z20.array(z20.object({ id: z20.string(), path: z20.string(), title: z20.string(), tags: z20.array(z20.string()) }).strict()),
|
|
2207
|
+
links: z20.array(z20.object({ from: z20.string(), to: z20.string().nullable(), target: z20.string(), kind: z20.enum(["link", "embed"]) }).strict())
|
|
2003
2208
|
}).strict();
|
|
2004
2209
|
var WHOLE_GRAPH_NOTES = 500;
|
|
2005
2210
|
var MAX_GRAPH_VIEW_NOTES = 500;
|
|
2006
2211
|
var MAX_GRAPH_VIEW_NODES = 1e3;
|
|
2007
2212
|
var MAX_GRAPH_VIEW_EDGES = 5e3;
|
|
2008
2213
|
var MAX_GRAPH_FACETS = 200;
|
|
2009
|
-
var NoteGraphViewQuery =
|
|
2214
|
+
var NoteGraphViewQuery = z20.object({
|
|
2010
2215
|
/** `auto` draws the whole graph when at most WHOLE_GRAPH_NOTES notes match, and the local graph otherwise. */
|
|
2011
|
-
mode:
|
|
2216
|
+
mode: z20.enum(["auto", "local"]).default("auto"),
|
|
2012
2217
|
/** The note the local graph is drawn around. Defaults to the matching note with the most connections. */
|
|
2013
|
-
focus:
|
|
2218
|
+
focus: z20.string().max(64).optional(),
|
|
2014
2219
|
/** How many hops from the focus the local graph reaches. Sharing a tag or concept is one hop, as a link is. */
|
|
2015
|
-
depth:
|
|
2220
|
+
depth: z20.coerce.number().int().min(1).max(3).default(2),
|
|
2016
2221
|
/** Only notes carrying this tag, or one nested under it (`maths` matches `maths/algebra`). */
|
|
2017
|
-
tag:
|
|
2222
|
+
tag: z20.string().max(200).optional(),
|
|
2018
2223
|
/** Only notes in this folder or below it, without a trailing `/`. */
|
|
2019
|
-
folder:
|
|
2020
|
-
}).strict();
|
|
2021
|
-
var
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
focus:
|
|
2026
|
-
|
|
2027
|
-
|
|
2224
|
+
folder: z20.string().max(512).optional()
|
|
2225
|
+
}).strict();
|
|
2226
|
+
var ConceptGraphViewQuery = z20.object({
|
|
2227
|
+
/** `auto` draws the whole concept graph when at most WHOLE_GRAPH_NOTES concepts exist, and the local graph otherwise. */
|
|
2228
|
+
mode: z20.enum(["auto", "local"]).default("auto"),
|
|
2229
|
+
/** The concept node (`concept:<id>` or `<id>`) the local graph is drawn around. Defaults to the best-connected concept. */
|
|
2230
|
+
focus: z20.string().max(80).optional(),
|
|
2231
|
+
/** How many hops from the focus the local graph reaches along concept edges. */
|
|
2232
|
+
depth: z20.coerce.number().int().min(1).max(3).default(2)
|
|
2233
|
+
}).strict();
|
|
2234
|
+
var NoteGraphNodeKind = z20.enum(["note", "ghost", "tag", "concept"]);
|
|
2235
|
+
var NoteGraphEdgeKind = z20.enum(["link", "tag", "concept", "prerequisite", "related"]);
|
|
2236
|
+
var NoteGraphView = z20.object({
|
|
2237
|
+
mode: z20.enum(["whole", "local"]),
|
|
2238
|
+
focus: z20.string().nullable(),
|
|
2239
|
+
depth: z20.number().int(),
|
|
2240
|
+
totalNotes: z20.number().int(),
|
|
2028
2241
|
/** Notes matching the filters, drawn or not. */
|
|
2029
|
-
matchingNotes:
|
|
2242
|
+
matchingNotes: z20.number().int(),
|
|
2243
|
+
/** Total concepts in the global concept graph view (omitted on per-import note graph views). */
|
|
2244
|
+
totalConcepts: z20.number().int().optional(),
|
|
2030
2245
|
/** Whether the limits left matching nodes or edges out of the drawing. */
|
|
2031
|
-
truncated:
|
|
2032
|
-
nodes:
|
|
2033
|
-
|
|
2034
|
-
id:
|
|
2246
|
+
truncated: z20.boolean(),
|
|
2247
|
+
nodes: z20.array(
|
|
2248
|
+
z20.object({
|
|
2249
|
+
id: z20.string(),
|
|
2035
2250
|
kind: NoteGraphNodeKind,
|
|
2036
|
-
label:
|
|
2037
|
-
path:
|
|
2038
|
-
notes:
|
|
2039
|
-
hops:
|
|
2251
|
+
label: z20.string(),
|
|
2252
|
+
path: z20.string().optional(),
|
|
2253
|
+
notes: z20.number().int().optional(),
|
|
2254
|
+
hops: z20.number().int().optional(),
|
|
2255
|
+
/** On the global concept graph: a tutoring session recorded this concept, so the learner can delete it. */
|
|
2256
|
+
fromSessions: z20.boolean().optional(),
|
|
2257
|
+
/** On a concept node: where the concept stands in the learner's graded record; absent if never answered on. */
|
|
2258
|
+
mastery: MasterySummary.optional()
|
|
2040
2259
|
}).strict()
|
|
2041
2260
|
),
|
|
2042
|
-
edges:
|
|
2043
|
-
|
|
2044
|
-
|
|
2261
|
+
edges: z20.array(
|
|
2262
|
+
z20.object({
|
|
2263
|
+
from: z20.string(),
|
|
2264
|
+
to: z20.string(),
|
|
2265
|
+
kind: NoteGraphEdgeKind,
|
|
2266
|
+
/** On the global concept graph: a tutoring session recorded this edge, so the learner can delete it. */
|
|
2267
|
+
fromSessions: z20.boolean().optional()
|
|
2268
|
+
}).strict()
|
|
2269
|
+
),
|
|
2270
|
+
tags: z20.array(z20.object({ name: z20.string(), notes: z20.number().int() }).strict()),
|
|
2271
|
+
folders: z20.array(z20.object({ path: z20.string(), notes: z20.number().int() }).strict())
|
|
2045
2272
|
}).strict();
|
|
2046
|
-
var NoteSummary =
|
|
2273
|
+
var NoteSummary = z20.object({ id: z20.string(), title: z20.string(), path: z20.string() }).strict();
|
|
2047
2274
|
|
|
2048
2275
|
// ../protocol/src/index.ts
|
|
2049
2276
|
var artifactKinds = {
|
|
@@ -2069,6 +2296,13 @@ var artifactKinds = {
|
|
|
2069
2296
|
input: artifactMathInput(CodeWalkthroughSpec, ["title", "steps.*.explanation"])
|
|
2070
2297
|
},
|
|
2071
2298
|
composition: compositionArtifactKind,
|
|
2299
|
+
flashcard_deck: {
|
|
2300
|
+
version: 1,
|
|
2301
|
+
toolName: "show_flashcards",
|
|
2302
|
+
description: "Give the learner a short deck of flip cards to drill facts, terms or definitions they need to recall: each card has a front (a question or cue) and a back (the answer). They flip each card and rate their own recall Again, Good or Easy, which only schedules when the card comes back; it is never graded and never counts as evidence of what they know, so use ask_multiple_choice or ask_code_exercise to check understanding. Keep decks short (about 4-15 cards), one idea per card, with a short front and a back that answers it directly. Set a card's concept to the concept it practises, named as in <learner_concepts>, when one fits.",
|
|
2303
|
+
spec: FlashcardDeckSpec,
|
|
2304
|
+
input: artifactMathInput(FlashcardDeckSpec, ["title", "cards.*.front", "cards.*.back"])
|
|
2305
|
+
},
|
|
2072
2306
|
graph: {
|
|
2073
2307
|
version: 1,
|
|
2074
2308
|
toolName: "show_graph",
|
|
@@ -2130,62 +2364,63 @@ var artifactKinds = {
|
|
|
2130
2364
|
input: artifactMathInput(WorkedStepsSpec, ["title", "goal", "steps.*.label", "steps.*.statement", "steps.*.justification"])
|
|
2131
2365
|
}
|
|
2132
2366
|
};
|
|
2133
|
-
var ArtifactKind =
|
|
2134
|
-
var ArtifactBase = { id:
|
|
2135
|
-
var MultipleChoiceAttempt =
|
|
2136
|
-
var CodeExerciseAttempt =
|
|
2137
|
-
var InterviewContextAttempt =
|
|
2138
|
-
var MilestoneAttempt =
|
|
2139
|
-
var MilestoneReviewAttempt =
|
|
2140
|
-
var PlacementAttempt =
|
|
2141
|
-
var ArtifactView =
|
|
2142
|
-
|
|
2143
|
-
|
|
2367
|
+
var ArtifactKind = z21.enum(Object.keys(artifactKinds));
|
|
2368
|
+
var ArtifactBase = { id: z21.string(), createdAt: z21.string().datetime() };
|
|
2369
|
+
var MultipleChoiceAttempt = z21.object({ answer: MultipleChoiceAnswer, grade: MultipleChoiceGrade, createdAt: z21.string().datetime() }).strict();
|
|
2370
|
+
var CodeExerciseAttempt = z21.object({ answer: CodeExerciseAnswer, grade: CodeExerciseGrade, createdAt: z21.string().datetime() }).strict();
|
|
2371
|
+
var InterviewContextAttempt = z21.object({ answer: InterviewContextAnswer, grade: InterviewContextGrade, createdAt: z21.string().datetime() }).strict();
|
|
2372
|
+
var MilestoneAttempt = z21.object({ answer: MilestoneCheckView, grade: MilestoneGrade, createdAt: z21.string().datetime() }).strict();
|
|
2373
|
+
var MilestoneReviewAttempt = z21.object({ review: MilestoneReview, createdAt: z21.string().datetime() }).strict();
|
|
2374
|
+
var PlacementAttempt = z21.object({ answer: PlacementAnswer, grade: PlacementGrade, createdAt: z21.string().datetime() }).strict();
|
|
2375
|
+
var ArtifactView = z21.discriminatedUnion("kind", [
|
|
2376
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("algorithm_trace"), version: z21.literal(1), spec: AlgorithmTraceSpec }).strict(),
|
|
2377
|
+
z21.object({
|
|
2144
2378
|
...ArtifactBase,
|
|
2145
|
-
kind:
|
|
2146
|
-
version:
|
|
2379
|
+
kind: z21.literal("code_exercise"),
|
|
2380
|
+
version: z21.literal(1),
|
|
2147
2381
|
spec: CodeExercisePublic,
|
|
2148
2382
|
latestAttempt: CodeExerciseAttempt.optional()
|
|
2149
2383
|
}).strict(),
|
|
2150
|
-
|
|
2384
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("code_walkthrough"), version: z21.literal(1), spec: CodeWalkthroughSpec }).strict(),
|
|
2151
2385
|
CompositionArtifactView,
|
|
2152
|
-
|
|
2153
|
-
|
|
2386
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("flashcard_deck"), version: z21.literal(1), spec: FlashcardDeckSpec }).strict(),
|
|
2387
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("graph"), version: z21.literal(1), spec: GraphSpec }).strict(),
|
|
2388
|
+
z21.object({
|
|
2154
2389
|
...ArtifactBase,
|
|
2155
|
-
kind:
|
|
2156
|
-
version:
|
|
2390
|
+
kind: z21.literal("interview_context"),
|
|
2391
|
+
version: z21.literal(1),
|
|
2157
2392
|
spec: InterviewContextSpec,
|
|
2158
2393
|
latestAttempt: InterviewContextAttempt.optional()
|
|
2159
2394
|
}).strict(),
|
|
2160
|
-
|
|
2395
|
+
z21.object({
|
|
2161
2396
|
...ArtifactBase,
|
|
2162
|
-
kind:
|
|
2163
|
-
version:
|
|
2397
|
+
kind: z21.literal("multiple_choice"),
|
|
2398
|
+
version: z21.literal(1),
|
|
2164
2399
|
spec: MultipleChoicePublic,
|
|
2165
2400
|
latestAttempt: MultipleChoiceAttempt.optional()
|
|
2166
2401
|
}).strict(),
|
|
2167
|
-
|
|
2402
|
+
z21.object({
|
|
2168
2403
|
...ArtifactBase,
|
|
2169
|
-
kind:
|
|
2170
|
-
version:
|
|
2404
|
+
kind: z21.literal("placement_question"),
|
|
2405
|
+
version: z21.literal(1),
|
|
2171
2406
|
spec: PlacementQuestionPublic,
|
|
2172
2407
|
latestAttempt: PlacementAttempt.optional()
|
|
2173
2408
|
}).strict(),
|
|
2174
|
-
|
|
2409
|
+
z21.object({
|
|
2175
2410
|
...ArtifactBase,
|
|
2176
|
-
kind:
|
|
2177
|
-
version:
|
|
2411
|
+
kind: z21.literal("project_milestone"),
|
|
2412
|
+
version: z21.literal(1),
|
|
2178
2413
|
spec: ProjectMilestonePublic,
|
|
2179
2414
|
/** The latest `mivra check`: a milestone is checked as often as the learner likes, and each check replaces the last. */
|
|
2180
2415
|
latestAttempt: MilestoneAttempt.optional(),
|
|
2181
2416
|
/** The latest check's review, if it ran and finished. */
|
|
2182
2417
|
latestReview: MilestoneReviewAttempt.optional(),
|
|
2183
2418
|
/** Whether the latest check passed the milestone: every case, and the review's approval. */
|
|
2184
|
-
passed:
|
|
2419
|
+
passed: z21.boolean().optional()
|
|
2185
2420
|
}).strict(),
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2421
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("set_diagram"), version: z21.literal(1), spec: SetDiagramSpec }).strict(),
|
|
2422
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("table"), version: z21.literal(1), spec: TableSpec }).strict(),
|
|
2423
|
+
z21.object({ ...ArtifactBase, kind: z21.literal("worked_steps"), version: z21.literal(1), spec: WorkedStepsSpec }).strict()
|
|
2189
2424
|
]);
|
|
2190
2425
|
var CHATGPT_USAGE_LIMIT_ERROR = "ChatGPT usage limit reached. Review your plan or this app's limit in ChatGPT settings.";
|
|
2191
2426
|
|
|
@@ -2205,6 +2440,10 @@ export {
|
|
|
2205
2440
|
CodeWalkthroughSpec,
|
|
2206
2441
|
CompositionSpec,
|
|
2207
2442
|
compositionArtifactKind,
|
|
2443
|
+
FlashcardDeckSpec,
|
|
2444
|
+
RateFlashcard,
|
|
2445
|
+
FlashcardSchedule,
|
|
2446
|
+
FlashcardDeckSchedule,
|
|
2208
2447
|
StartCourse,
|
|
2209
2448
|
PlacementQuestionSpec,
|
|
2210
2449
|
toPlacementQuestionPublic,
|
|
@@ -2216,6 +2455,7 @@ export {
|
|
|
2216
2455
|
CourseIcon,
|
|
2217
2456
|
SyllabusInput,
|
|
2218
2457
|
CourseView,
|
|
2458
|
+
CourseSummaryView,
|
|
2219
2459
|
GraphSpec,
|
|
2220
2460
|
MultipleChoiceSpec,
|
|
2221
2461
|
toMultipleChoicePublic,
|
|
@@ -2247,6 +2487,12 @@ export {
|
|
|
2247
2487
|
SetDiagramSpec,
|
|
2248
2488
|
TableSpec,
|
|
2249
2489
|
WorkedStepsSpec,
|
|
2490
|
+
ANY_CITATION_MARKER,
|
|
2491
|
+
MAX_CITATION_MARKER_CHARS,
|
|
2492
|
+
citationMarker,
|
|
2493
|
+
parseCitationRef,
|
|
2494
|
+
CitationResolveRequest,
|
|
2495
|
+
CitationResolveResponse,
|
|
2250
2496
|
runExerciseCaseIsolated,
|
|
2251
2497
|
createPythonCaseRunner,
|
|
2252
2498
|
LessonSectionKind,
|
|
@@ -2260,15 +2506,29 @@ export {
|
|
|
2260
2506
|
ChangeSyllabusInput,
|
|
2261
2507
|
AddToLesson,
|
|
2262
2508
|
AdaptSyllabusInput,
|
|
2509
|
+
MAX_REVIEW_CONCEPTS,
|
|
2510
|
+
DueReviewItem,
|
|
2511
|
+
MAX_PREREQUISITE_RECOMMENDATIONS,
|
|
2512
|
+
PrerequisiteStatus,
|
|
2513
|
+
DueReviewQueue,
|
|
2514
|
+
StartReview,
|
|
2515
|
+
StartDrill,
|
|
2263
2516
|
RememberInput,
|
|
2264
2517
|
MemoryView,
|
|
2265
2518
|
MemoryEdit,
|
|
2266
2519
|
MemoryBulkDelete,
|
|
2267
2520
|
MAX_DOCUMENT_BYTES,
|
|
2521
|
+
MAX_TEXT_SOURCE_CHARS,
|
|
2522
|
+
MAX_TEXT_SOURCE_TITLE_CHARS,
|
|
2268
2523
|
DocumentView,
|
|
2524
|
+
SourceView,
|
|
2525
|
+
ConceptEdgeKind,
|
|
2526
|
+
LinkConceptsInput,
|
|
2269
2527
|
RecordFromNotesInput,
|
|
2270
2528
|
DistillationView,
|
|
2271
2529
|
ConceptGraph,
|
|
2530
|
+
ConceptSummary,
|
|
2531
|
+
MasteryRecord,
|
|
2272
2532
|
MAX_VAULT_FILES,
|
|
2273
2533
|
MAX_NOTE_CHARS,
|
|
2274
2534
|
MAX_VAULT_BYTES,
|
|
@@ -2285,10 +2545,11 @@ export {
|
|
|
2285
2545
|
MAX_GRAPH_VIEW_EDGES,
|
|
2286
2546
|
MAX_GRAPH_FACETS,
|
|
2287
2547
|
NoteGraphViewQuery,
|
|
2548
|
+
ConceptGraphViewQuery,
|
|
2288
2549
|
NoteGraphView,
|
|
2289
2550
|
NoteSummary,
|
|
2290
2551
|
artifactKinds,
|
|
2291
2552
|
ArtifactView,
|
|
2292
2553
|
CHATGPT_USAGE_LIMIT_ERROR
|
|
2293
2554
|
};
|
|
2294
|
-
//# sourceMappingURL=chunk-
|
|
2555
|
+
//# sourceMappingURL=chunk-TKDX5OCX.js.map
|