dsh-diagnostic-tutor 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +316 -79
- package/lib/api.js +364 -78
- package/lib/api.js.map +1 -1
- package/lib/block-types.js +25 -0
- package/lib/block-types.js.map +1 -0
- package/lib/client.js +9952 -821
- package/lib/client.js.map +1 -1
- package/lib/diagnostics.js +170 -0
- package/lib/diagnostics.js.map +1 -0
- package/lib/execution-key.js +91 -0
- package/lib/execution-key.js.map +1 -0
- package/lib/handoff.js +44 -1
- package/lib/handoff.js.map +1 -1
- package/lib/index.js +87 -51
- package/lib/index.js.map +1 -1
- package/lib/insights.js +82 -0
- package/lib/insights.js.map +1 -0
- package/lib/interactions.js +70 -0
- package/lib/interactions.js.map +1 -0
- package/lib/journal.js +122 -0
- package/lib/journal.js.map +1 -0
- package/lib/lesson-markdown.js +72 -0
- package/lib/lesson-markdown.js.map +1 -0
- package/lib/lesson.js +152 -3
- package/lib/lesson.js.map +1 -1
- package/lib/math.js +126 -0
- package/lib/math.js.map +1 -0
- package/lib/path-api.js +140 -0
- package/lib/path-api.js.map +1 -0
- package/lib/path-runtime.js +361 -0
- package/lib/path-runtime.js.map +1 -0
- package/lib/path-tools.js +107 -0
- package/lib/path-tools.js.map +1 -0
- package/lib/path.js +179 -0
- package/lib/path.js.map +1 -0
- package/lib/plan-tools.js +89 -0
- package/lib/plan-tools.js.map +1 -0
- package/lib/plan.js +82 -0
- package/lib/plan.js.map +1 -0
- package/lib/project-session.js +48 -0
- package/lib/project-session.js.map +1 -0
- package/lib/prompt.js +4 -19
- package/lib/prompt.js.map +1 -1
- package/lib/review-sync.js +51 -0
- package/lib/review-sync.js.map +1 -0
- package/lib/review-tools.js +115 -0
- package/lib/review-tools.js.map +1 -0
- package/lib/review.js +103 -0
- package/lib/review.js.map +1 -0
- package/lib/source-schema.js +24 -0
- package/lib/source-schema.js.map +1 -0
- package/lib/source-tools.js +61 -0
- package/lib/source-tools.js.map +1 -0
- package/lib/sources.js +78 -0
- package/lib/sources.js.map +1 -0
- package/lib/state.js +353 -47
- package/lib/state.js.map +1 -1
- package/lib/tools.js +620 -123
- package/lib/tools.js.map +1 -1
- package/lib/types/api.d.ts +10 -3
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/block-types.d.ts +12 -0
- package/lib/types/block-types.d.ts.map +1 -0
- package/lib/types/contract.d.ts +81 -7
- package/lib/types/contract.d.ts.map +1 -1
- package/lib/types/diagnostics.d.ts +95 -0
- package/lib/types/diagnostics.d.ts.map +1 -0
- package/lib/types/execution-key.d.ts +59 -0
- package/lib/types/execution-key.d.ts.map +1 -0
- package/lib/types/handoff.d.ts +2 -2
- package/lib/types/handoff.d.ts.map +1 -1
- package/lib/types/index.d.ts +19 -14
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/insights.d.ts +57 -0
- package/lib/types/insights.d.ts.map +1 -0
- package/lib/types/interactions.d.ts +23 -0
- package/lib/types/interactions.d.ts.map +1 -0
- package/lib/types/journal.d.ts +57 -0
- package/lib/types/journal.d.ts.map +1 -0
- package/lib/types/lesson-markdown.d.ts +11 -0
- package/lib/types/lesson-markdown.d.ts.map +1 -0
- package/lib/types/lesson.d.ts +697 -5
- package/lib/types/lesson.d.ts.map +1 -1
- package/lib/types/math.d.ts +50 -0
- package/lib/types/math.d.ts.map +1 -0
- package/lib/types/path-api.d.ts +5 -0
- package/lib/types/path-api.d.ts.map +1 -0
- package/lib/types/path-runtime.d.ts +1558 -0
- package/lib/types/path-runtime.d.ts.map +1 -0
- package/lib/types/path-tools.d.ts +4 -0
- package/lib/types/path-tools.d.ts.map +1 -0
- package/lib/types/path.d.ts +744 -0
- package/lib/types/path.d.ts.map +1 -0
- package/lib/types/plan-tools.d.ts +4 -0
- package/lib/types/plan-tools.d.ts.map +1 -0
- package/lib/types/plan.d.ts +53 -0
- package/lib/types/plan.d.ts.map +1 -0
- package/lib/types/project-session.d.ts +33 -0
- package/lib/types/project-session.d.ts.map +1 -0
- package/lib/types/prompt.d.ts.map +1 -1
- package/lib/types/review-sync.d.ts +17 -0
- package/lib/types/review-sync.d.ts.map +1 -0
- package/lib/types/review-tools.d.ts +4 -0
- package/lib/types/review-tools.d.ts.map +1 -0
- package/lib/types/review.d.ts +65 -0
- package/lib/types/review.d.ts.map +1 -0
- package/lib/types/source-schema.d.ts +31 -0
- package/lib/types/source-schema.d.ts.map +1 -0
- package/lib/types/source-tools.d.ts +4 -0
- package/lib/types/source-tools.d.ts.map +1 -0
- package/lib/types/sources.d.ts +33 -0
- package/lib/types/sources.d.ts.map +1 -0
- package/lib/types/state.d.ts +607 -23
- package/lib/types/state.d.ts.map +1 -1
- package/lib/types/tools.d.ts +3 -1
- package/lib/types/tools.d.ts.map +1 -1
- package/lib/types/udt.d.ts +20 -24
- package/lib/types/udt.d.ts.map +1 -1
- package/lib/types/version.d.ts +11 -0
- package/lib/types/version.d.ts.map +1 -0
- package/lib/types/vocabulary.d.ts +2 -2
- package/lib/udt.js +72 -19
- package/lib/udt.js.map +1 -1
- package/lib/version.js +26 -0
- package/lib/version.js.map +1 -0
- package/package.json +27 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/path.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,iBAAiB;;;kBAA+E,CAAA;AAC7G,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;kBAmB1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;kBAUlB,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAA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CAE3D;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,EAAE,IAAI,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM;;;;;;EASzG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-tools.d.ts","sourceRoot":"","sources":["../../src/plan-tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AA+BzC,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CA+C1D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** Learner-owned plan items and ICS projection. No teaching decisions. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const TASK_STATUSES: readonly ["open", "done", "archived"];
|
|
4
|
+
export declare const TASKS_TABLE = "tasks";
|
|
5
|
+
export declare const MAX_TASKS = 200;
|
|
6
|
+
export declare const MAX_TASK_TITLE_CHARS = 200;
|
|
7
|
+
export declare const MAX_TASK_ESTIMATE_MINUTES = 480;
|
|
8
|
+
export declare const MIN_TASK_ESTIMATE_MINUTES = 5;
|
|
9
|
+
export declare const TaskSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
dueAt: z.ZodOptional<z.ZodString>;
|
|
15
|
+
estimateMin: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
open: "open";
|
|
19
|
+
done: "done";
|
|
20
|
+
archived: "archived";
|
|
21
|
+
}>;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
updatedAt: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export type TaskRecord = z.infer<typeof TaskSchema>;
|
|
26
|
+
export type TaskStatus = (typeof TASK_STATUSES)[number];
|
|
27
|
+
export declare const TaskInputSchema: z.ZodObject<{
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
dueAt: z.ZodOptional<z.ZodString>;
|
|
32
|
+
estimateMin: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type TaskInput = z.infer<typeof TaskInputSchema>;
|
|
36
|
+
/** The panel's task shape; no content that belongs to the model. */
|
|
37
|
+
export interface TaskView {
|
|
38
|
+
id: string;
|
|
39
|
+
courseId?: string;
|
|
40
|
+
nodeId?: string;
|
|
41
|
+
title: string;
|
|
42
|
+
dueAt?: string;
|
|
43
|
+
estimateMin?: number;
|
|
44
|
+
sourceId?: string;
|
|
45
|
+
status: TaskStatus;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function taskView(task: TaskRecord): TaskView;
|
|
49
|
+
/** Open tasks, earliest due first; undated tasks last. */
|
|
50
|
+
export declare function sortTasks(tasks: readonly TaskRecord[]): TaskRecord[];
|
|
51
|
+
/** Render open, dated tasks as one ICS calendar. */
|
|
52
|
+
export declare function buildIcs(tasks: readonly TaskRecord[], now?: Date): string;
|
|
53
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/plan.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,aAAa,uCAAwC,CAAA;AAClE,eAAO,MAAM,WAAW,UAAU,C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ning it is not.
|
|
5
|
+
* Focuses, course runs and project selections all carry a conversation id, in
|
|
6
|
+
* that order of strength: an active focus is a lesson in progress, a course run
|
|
7
|
+
* is a planned lesson that was explicitly started, and a selection only says the
|
|
8
|
+
* conversation once opened the project.
|
|
9
|
+
*
|
|
10
|
+
* The newest candidate wins. That keeps two conversations on the same project
|
|
11
|
+
* from stealing each other: whoever last acted is the one resumed, and a
|
|
12
|
+
* conversation that has not started anything never jumps ahead of one that has.
|
|
13
|
+
*
|
|
14
|
+
* Pure read-only resolution: it never selects, starts or writes anything.
|
|
15
|
+
*/
|
|
16
|
+
import type { UdState } from './state.js';
|
|
17
|
+
/** Why a conversation was chosen, for the UI and for tests. */
|
|
18
|
+
export type LearningSessionReason = 'active-focus' | 'active-run' | 'recent-project' | 'current';
|
|
19
|
+
export interface LearningSession {
|
|
20
|
+
readonly sessionId: string;
|
|
21
|
+
readonly reason: LearningSessionReason;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the conversation that should handle "enter learning" for a project.
|
|
25
|
+
*
|
|
26
|
+
* @param state - the open state handle.
|
|
27
|
+
* @param courseId - the project being entered.
|
|
28
|
+
* @param currentSessionId - the conversation asking, used only when no stored
|
|
29
|
+
* conversation has ever touched the project.
|
|
30
|
+
* @returns the target conversation, or `null` when the project does not exist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveLearningSession(state: UdState, courseId: string, currentSessionId?: string): LearningSession | null;
|
|
33
|
+
//# sourceMappingURL=project-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-session.d.ts","sourceRoot":"","sources":["../../src/project-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,+DAA+D;AAC/D,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,YAAY,GAAG,gBAAgB,GAAG,SAAS,CAAA;AAEhG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;CACvC;AAOD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,GACxB,eAAe,GAAG,IAAI,CA8BxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,qBAAqB,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,kBAAkB,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;SAAE,CAAA;KAC1D;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAM9E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,qBAAqB,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,gBAAgB;QACxB,kBAAkB,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;SAAE,CAAA;KAC1D;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAM9E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAsB1G"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LessonRecord } from './lesson.js';
|
|
2
|
+
import type { UdState } from './state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Create or refresh one review card per flashcard block in the lesson.
|
|
5
|
+
*
|
|
6
|
+
* This is projection, not teaching: it never grades, never resets an existing
|
|
7
|
+
* schedule and never changes node state. Replacing a lesson updates the visible
|
|
8
|
+
* front/back while preserving the card's schedule. Removed flashcards are left
|
|
9
|
+
* alone rather than silently deleting review history.
|
|
10
|
+
*/
|
|
11
|
+
export declare function syncLessonFlashcards(state: UdState, input: {
|
|
12
|
+
courseId: string;
|
|
13
|
+
nodeId: string;
|
|
14
|
+
lesson: LessonRecord;
|
|
15
|
+
now: string;
|
|
16
|
+
}): Promise<string[]>;
|
|
17
|
+
//# sourceMappingURL=review-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-sync.d.ts","sourceRoot":"","sources":["../../src/review-sync.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAMzC;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC7E,OAAO,CAAC,MAAM,EAAE,CAAC,CAgCnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-tools.d.ts","sourceRoot":"","sources":["../../src/review-tools.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAM5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AA2BzC,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CA4E5D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Review cards and a dependency-free local interval scheduler. No mastery claims. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const REVIEW_CARDS_TABLE = "review_cards";
|
|
4
|
+
export declare const REVIEW_LOG_TABLE = "review_log";
|
|
5
|
+
export declare const REVIEW_RATINGS: readonly ["again", "hard", "good", "easy"];
|
|
6
|
+
export declare const REVIEW_STATUSES: readonly ["open", "suspended"];
|
|
7
|
+
export declare const MAX_REVIEW_CARDS = 500;
|
|
8
|
+
export declare const MAX_REVIEW_FRONT_CHARS = 2000;
|
|
9
|
+
export declare const MAX_REVIEW_BACK_CHARS = 4000;
|
|
10
|
+
export declare const ReviewSourceRefSchema: z.ZodObject<{
|
|
11
|
+
sourceId: z.ZodString;
|
|
12
|
+
locator: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export declare const ReviewCardSchema: z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
nodeId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
blockId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
front: z.ZodString;
|
|
20
|
+
back: z.ZodString;
|
|
21
|
+
sourceRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
|
+
sourceId: z.ZodString;
|
|
23
|
+
locator: z.ZodString;
|
|
24
|
+
}, z.core.$strict>>>;
|
|
25
|
+
dueAt: z.ZodString;
|
|
26
|
+
intervalDays: z.ZodNumber;
|
|
27
|
+
ease: z.ZodNumber;
|
|
28
|
+
reps: z.ZodNumber;
|
|
29
|
+
lapses: z.ZodNumber;
|
|
30
|
+
status: z.ZodEnum<{
|
|
31
|
+
open: "open";
|
|
32
|
+
suspended: "suspended";
|
|
33
|
+
}>;
|
|
34
|
+
createdAt: z.ZodString;
|
|
35
|
+
updatedAt: z.ZodString;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type ReviewCard = z.infer<typeof ReviewCardSchema>;
|
|
38
|
+
export declare const ReviewLogSchema: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
cardId: z.ZodString;
|
|
41
|
+
rating: z.ZodEnum<{
|
|
42
|
+
again: "again";
|
|
43
|
+
hard: "hard";
|
|
44
|
+
good: "good";
|
|
45
|
+
easy: "easy";
|
|
46
|
+
}>;
|
|
47
|
+
at: z.ZodString;
|
|
48
|
+
previousDue: z.ZodString;
|
|
49
|
+
nextDue: z.ZodString;
|
|
50
|
+
intervalDays: z.ZodNumber;
|
|
51
|
+
ease: z.ZodNumber;
|
|
52
|
+
previousIntervalDays: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
previousEase: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
previousReps: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
previousLapses: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
export type ReviewLog = z.infer<typeof ReviewLogSchema>;
|
|
58
|
+
export type ReviewRating = (typeof REVIEW_RATINGS)[number];
|
|
59
|
+
/** Apply one grade. This is scheduling arithmetic, not a judgement about learning. */
|
|
60
|
+
export declare function scheduleReview(card: ReviewCard, rating: ReviewRating, now?: Date): {
|
|
61
|
+
card: ReviewCard;
|
|
62
|
+
log: ReviewLog;
|
|
63
|
+
};
|
|
64
|
+
export declare function dueCards(cards: readonly ReviewCard[], now?: Date): ReviewCard[];
|
|
65
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/review.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAChD,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAC5C,eAAO,MAAM,cAAc,4CAA6C,CAAA;AACxE,eAAO,MAAM,eAAe,gCAAiC,CAAA;AAC7D,eAAO,MAAM,gBAAgB,MAAM,CAAA;AACnC,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAC1C,eAAO,MAAM,qBAAqB,OAAO,CAAA;AAEzC,eAAO,MAAM,qBAAqB;;;kBAGvB,CAAA;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;kBAiBlB,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;kBAcjB,CAAA;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AACvD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAI1D,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAa,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,SAAS,CAAA;CAAE,CA4C7H;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,GAAG,OAAa,GAAG,UAAU,EAAE,CAKrF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Learner-owned source material. Pure schema, no DSH imports. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const SOURCE_KINDS: readonly ["text", "file", "markdown"];
|
|
4
|
+
export declare const SOURCE_STATUSES: readonly ["ready", "error"];
|
|
5
|
+
export declare const MAX_SOURCE_BYTES = 131072;
|
|
6
|
+
export declare const MAX_SOURCE_CHARS = 131072;
|
|
7
|
+
export declare const MAX_SOURCES = 40;
|
|
8
|
+
export declare const MAX_SOURCE_TITLE_CHARS = 200;
|
|
9
|
+
export declare const MAX_SOURCE_LOCATOR_CHARS = 500;
|
|
10
|
+
export declare const SourceRecordSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
kind: z.ZodEnum<{
|
|
13
|
+
text: "text";
|
|
14
|
+
file: "file";
|
|
15
|
+
markdown: "markdown";
|
|
16
|
+
}>;
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
locator: z.ZodString;
|
|
19
|
+
sha256: z.ZodString;
|
|
20
|
+
bytes: z.ZodNumber;
|
|
21
|
+
createdAt: z.ZodString;
|
|
22
|
+
status: z.ZodEnum<{
|
|
23
|
+
error: "error";
|
|
24
|
+
ready: "ready";
|
|
25
|
+
}>;
|
|
26
|
+
content: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type SourceRecord = z.infer<typeof SourceRecordSchema>;
|
|
29
|
+
export type SourceKind = (typeof SOURCE_KINDS)[number];
|
|
30
|
+
export declare const SOURCES_TABLE = "sources";
|
|
31
|
+
//# sourceMappingURL=source-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-schema.d.ts","sourceRoot":"","sources":["../../src/source-schema.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,YAAY,uCAAwC,CAAA;AACjE,eAAO,MAAM,eAAe,6BAA8B,CAAA;AAC1D,eAAO,MAAM,gBAAgB,SAAU,CAAA;AACvC,eAAO,MAAM,gBAAgB,SAAmB,CAAA;AAChD,eAAO,MAAM,WAAW,KAAK,CAAA;AAC7B,eAAO,MAAM,sBAAsB,MAAM,CAAA;AACzC,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;kBAYpB,CAAA;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtD,eAAO,MAAM,aAAa,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-tools.d.ts","sourceRoot":"","sources":["../../src/source-tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAUzC,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE,CAiD5D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type SourceRecord } from './source-schema.js';
|
|
2
|
+
export interface SourceDraft {
|
|
3
|
+
kind: 'text' | 'file' | 'markdown';
|
|
4
|
+
title: string;
|
|
5
|
+
locator: string;
|
|
6
|
+
content: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function sourceDraftFromText(input: {
|
|
9
|
+
text: string;
|
|
10
|
+
kind?: 'text' | 'markdown';
|
|
11
|
+
title?: string;
|
|
12
|
+
locator?: string;
|
|
13
|
+
}): SourceDraft;
|
|
14
|
+
/**
|
|
15
|
+
* Read one explicitly selected local markdown/text file.
|
|
16
|
+
*
|
|
17
|
+
* This is the only place the plugin reads outside its own storage domain. It
|
|
18
|
+
* refuses directories, symlinks, unsupported extensions and oversized files;
|
|
19
|
+
* it never scans a directory or follows a URL.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sourceDraftFromFile(path: string): Promise<SourceDraft>;
|
|
22
|
+
export declare function sourceRecord(draft: SourceDraft, now?: string): SourceRecord;
|
|
23
|
+
export interface SourceStore {
|
|
24
|
+
listSources(): SourceRecord[];
|
|
25
|
+
readSource(id: string): SourceRecord | undefined;
|
|
26
|
+
writeSource(record: SourceRecord): Promise<SourceRecord>;
|
|
27
|
+
}
|
|
28
|
+
/** Add one source, deduplicating identical content by SHA-256. */
|
|
29
|
+
export declare function addSource(store: SourceStore, draft: SourceDraft, now?: string): Promise<{
|
|
30
|
+
source: SourceRecord;
|
|
31
|
+
deduped: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/sources.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyD,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAK7G,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,WAAW,CAOd;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAgB5E;AAMD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,SAA2B,GAAG,YAAY,CAO7F;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,IAAI,YAAY,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAA;IAChD,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;CACzD;AAED,kEAAkE;AAClE,wBAAsB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAOzI"}
|