@mmon-co/ncept-default-theory 0.0.0-stage → 1.0.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -2
  3. package/dist/catalog-contract.d.ts +102 -0
  4. package/dist/catalog-contract.js +75 -0
  5. package/dist/catalog.d.ts +14 -0
  6. package/dist/catalog.js +164 -0
  7. package/dist/chat.d.ts +171 -0
  8. package/dist/chat.js +203 -0
  9. package/dist/completion.d.ts +74 -0
  10. package/dist/completion.js +277 -0
  11. package/dist/dependent-cone.d.ts +3 -0
  12. package/dist/dependent-cone.js +26 -0
  13. package/dist/diagnosis.d.ts +9 -0
  14. package/dist/diagnosis.js +1 -0
  15. package/dist/diagnostics.d.ts +25 -0
  16. package/dist/diagnostics.js +34 -0
  17. package/dist/evaluation.d.ts +33 -0
  18. package/dist/evaluation.js +376 -0
  19. package/dist/event.d.ts +7 -0
  20. package/dist/event.js +405 -0
  21. package/dist/history.d.ts +4 -0
  22. package/dist/history.js +61 -0
  23. package/dist/implementation.d.ts +170 -0
  24. package/dist/implementation.js +30 -0
  25. package/dist/index.d.ts +185 -0
  26. package/dist/index.js +26 -0
  27. package/dist/messages.d.ts +167 -0
  28. package/dist/messages.js +56 -0
  29. package/dist/outcomes.d.ts +143 -0
  30. package/dist/outcomes.js +323 -0
  31. package/dist/path.d.ts +17 -0
  32. package/dist/path.js +292 -0
  33. package/dist/reading.d.ts +12 -0
  34. package/dist/reading.js +75 -0
  35. package/dist/release.d.ts +1 -0
  36. package/dist/release.js +1 -0
  37. package/dist/roleplay.d.ts +17 -0
  38. package/dist/roleplay.js +2 -0
  39. package/dist/skills/sources.d.ts +12 -0
  40. package/dist/skills/sources.js +13 -0
  41. package/dist/skills.d.ts +12 -0
  42. package/dist/skills.js +70 -0
  43. package/dist/state.d.ts +316 -0
  44. package/dist/state.js +1309 -0
  45. package/dist/tags.d.ts +34 -0
  46. package/dist/tags.js +306 -0
  47. package/dist/timing.d.ts +21 -0
  48. package/dist/timing.js +79 -0
  49. package/dist/tools.d.ts +394 -0
  50. package/dist/tools.js +872 -0
  51. package/package.json +52 -4
@@ -0,0 +1,30 @@
1
+ import { chat, modes } from "./chat.js";
2
+ import { describeDefaultObservation } from "./history.js";
3
+ import { event } from "./event.js";
4
+ import { isAttemptOutcome, isQuizOutcome, isRecallOutcome } from "./outcomes.js";
5
+ import { DEFAULT_THEORY_REF, initDefaultState, isCompletionOutcome } from "./state.js";
6
+ import { defaultTags, projectDefault } from "./tags.js";
7
+ import { pathDefault } from "./path.js";
8
+ import { progressDefault, estimateDefault, prepareEstimateDefault } from "./reading.js";
9
+ /** The single default implementation assembly. */
10
+ export const implementation = {
11
+ id: DEFAULT_THEORY_REF.theory,
12
+ version: DEFAULT_THEORY_REF.version,
13
+ initState: initDefaultState,
14
+ project: projectDefault,
15
+ progress: progressDefault,
16
+ estimate: estimateDefault,
17
+ prepareEstimate: prepareEstimateDefault,
18
+ path: pathDefault,
19
+ describeObservation: describeDefaultObservation,
20
+ tags: defaultTags,
21
+ outcomes: {
22
+ completion: isCompletionOutcome,
23
+ recall: isRecallOutcome,
24
+ quiz: isQuizOutcome,
25
+ attempt: isAttemptOutcome,
26
+ },
27
+ chat,
28
+ modes,
29
+ event,
30
+ };
@@ -0,0 +1,185 @@
1
+ /** Build metadata identifies the Theory's source and dependencies; semver ranges ignore it. */
2
+ export declare const defaultTheory: {
3
+ version: string;
4
+ id: "default";
5
+ initState: typeof import("./state.js").initDefaultState;
6
+ project: typeof import("./tags.js").projectDefault;
7
+ progress: typeof import("./reading.js").progressDefault;
8
+ estimate: typeof import("./reading.js").estimateDefault;
9
+ prepareEstimate: typeof import("./reading.js").prepareEstimateDefault;
10
+ path: typeof import("./path.js").pathDefault;
11
+ describeObservation: typeof import("./history.js").describeDefaultObservation;
12
+ tags: readonly [...string[], "item-outcomes", "instability", "unused", "coarse", "lesson-split", "self-report", "edge-contradiction", "homeless"];
13
+ outcomes: {
14
+ completion: typeof import("./state.js").isCompletionOutcome;
15
+ recall: typeof import("./outcomes.js").isRecallOutcome;
16
+ quiz: typeof import("./outcomes.js").isQuizOutcome;
17
+ attempt: typeof import("./outcomes.js").isAttemptOutcome;
18
+ };
19
+ chat: {
20
+ open: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>, mode?: "empty" | "charting" | "authoring" | "lesson") => import("@mmon-co/ncept-core/observations").Program<import("@mmon-co/ncept-core/theory").ChatSetup<import("./state.js").DefaultState>>;
21
+ turn: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>, mode?: "empty" | "charting" | "authoring" | "lesson") => import("@mmon-co/ncept-core/observations").Program<import("@mmon-co/ncept-core/theory").ChatSetup<import("./state.js").DefaultState>>;
22
+ reply: typeof import("./evaluation.js").evaluateWatchedReply;
23
+ };
24
+ modes: {
25
+ empty: {
26
+ title: "Chat";
27
+ frontTab: string;
28
+ entry: {
29
+ required: false;
30
+ kinds: never[];
31
+ };
32
+ capabilities: readonly import("@mmon-co/ncept-core/theory").HostCapability[];
33
+ switches: {
34
+ mode: string;
35
+ then: "here";
36
+ }[];
37
+ setup: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>) => import("@mmon-co/ncept-core/observations").Program<Readonly<{
38
+ prompt: string;
39
+ context?: string;
40
+ tools: readonly Readonly<{
41
+ name: string;
42
+ description: string;
43
+ schema: import("@mmon-co/ncept-core/observations").JsonSchema;
44
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
45
+ run(args: unknown, ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>): import("@mmon-co/ncept-core/observations").Program<unknown>;
46
+ }>[];
47
+ skills: readonly Readonly<{
48
+ name: string;
49
+ description: string;
50
+ body: string;
51
+ resources?: readonly import("@mmon-co/ncept-core/theory").SkillResource[];
52
+ }>[];
53
+ }>>;
54
+ };
55
+ charting: {
56
+ title: "Chart";
57
+ frontTab: string;
58
+ noteTemplates: {
59
+ id: string;
60
+ defaultMessage: string;
61
+ }[];
62
+ entry: {
63
+ required: false;
64
+ kinds: ("mission" | "checkpoint" | "goal" | "target")[];
65
+ };
66
+ capabilities: readonly import("@mmon-co/ncept-core/theory").HostCapability[];
67
+ switches: {
68
+ mode: string;
69
+ then: "next";
70
+ carry: {
71
+ kind: "brief";
72
+ };
73
+ }[];
74
+ setup: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>) => import("@mmon-co/ncept-core/observations").Program<Readonly<{
75
+ prompt: string;
76
+ context?: string;
77
+ tools: readonly Readonly<{
78
+ name: string;
79
+ description: string;
80
+ schema: import("@mmon-co/ncept-core/observations").JsonSchema;
81
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
82
+ run(args: unknown, ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>): import("@mmon-co/ncept-core/observations").Program<unknown>;
83
+ }>[];
84
+ skills: readonly Readonly<{
85
+ name: string;
86
+ description: string;
87
+ body: string;
88
+ resources?: readonly import("@mmon-co/ncept-core/theory").SkillResource[];
89
+ }>[];
90
+ }>>;
91
+ };
92
+ authoring: {
93
+ title: "Author";
94
+ frontTab: string;
95
+ entry: {
96
+ required: false;
97
+ kinds: ("mission" | "goal")[];
98
+ };
99
+ capabilities: readonly import("@mmon-co/ncept-core/theory").HostCapability[];
100
+ switches: never[];
101
+ setup: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>) => import("@mmon-co/ncept-core/observations").Program<Readonly<{
102
+ prompt: string;
103
+ context?: string;
104
+ tools: readonly Readonly<{
105
+ name: string;
106
+ description: string;
107
+ schema: import("@mmon-co/ncept-core/observations").JsonSchema;
108
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
109
+ run(args: unknown, ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>): import("@mmon-co/ncept-core/observations").Program<unknown>;
110
+ }>[];
111
+ skills: readonly Readonly<{
112
+ name: string;
113
+ description: string;
114
+ body: string;
115
+ resources?: readonly import("@mmon-co/ncept-core/theory").SkillResource[];
116
+ }>[];
117
+ }>>;
118
+ };
119
+ lesson: {
120
+ title: "Lesson";
121
+ frontTab: string;
122
+ entry: {
123
+ required: true;
124
+ kinds: ("lesson" | "review")[];
125
+ };
126
+ capabilities: readonly import("@mmon-co/ncept-core/theory").HostCapability[];
127
+ metadataKeys: readonly string[] | undefined;
128
+ switches: ({
129
+ mode: string;
130
+ then: "next";
131
+ carry: {
132
+ kind: "brief";
133
+ focus?: undefined;
134
+ };
135
+ } | {
136
+ mode: string;
137
+ then: "aside";
138
+ carry: {
139
+ kind: "compacted";
140
+ focus: string;
141
+ };
142
+ })[];
143
+ setup: (ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>) => import("@mmon-co/ncept-core/observations").Program<Readonly<{
144
+ prompt: string;
145
+ context?: string;
146
+ tools: readonly Readonly<{
147
+ name: string;
148
+ description: string;
149
+ schema: import("@mmon-co/ncept-core/observations").JsonSchema;
150
+ members?: readonly Readonly</*elided*/ any>[] | undefined;
151
+ run(args: unknown, ctx: import("@mmon-co/ncept-core/theory").ChatContext<import("./state.js").DefaultState>): import("@mmon-co/ncept-core/observations").Program<unknown>;
152
+ }>[];
153
+ skills: readonly Readonly<{
154
+ name: string;
155
+ description: string;
156
+ body: string;
157
+ resources?: readonly import("@mmon-co/ncept-core/theory").SkillResource[];
158
+ }>[];
159
+ }>>;
160
+ };
161
+ };
162
+ event: typeof import("./event.js").event;
163
+ };
164
+ /** The range a new Profile accepts: the default Theory's current minor, which a patch deploy keeps. */
165
+ export declare const DEFAULT_THEORY_REQUIREMENT: {
166
+ readonly theory: "default";
167
+ readonly range: "~1.0";
168
+ };
169
+ export * from "./path.js";
170
+ export * from "./reading.js";
171
+ export * from "./timing.js";
172
+ export * from "./diagnosis.js";
173
+ export * from "./diagnostics.js";
174
+ export * from "./messages.js";
175
+ export * from "./state.js";
176
+ export * from "./completion.js";
177
+ export * from "./tags.js";
178
+ export * from "./outcomes.js";
179
+ export * from "./roleplay.js";
180
+ export * from "./chat.js";
181
+ export * from "./tools.js";
182
+ export * from "./skills.js";
183
+ export * from "./catalog-contract.js";
184
+ export * from "./catalog.js";
185
+ export * from "./evaluation.js";
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ import { implementation } from "./implementation.js";
2
+ import { theoryContent } from "./release.js";
3
+ /** Build metadata identifies the Theory's source and dependencies; semver ranges ignore it. */
4
+ export const defaultTheory = {
5
+ ...implementation,
6
+ version: `${implementation.version}+${theoryContent}`,
7
+ };
8
+ /** The range a new Profile accepts: the default Theory's current minor, which a patch deploy keeps. */
9
+ export const DEFAULT_THEORY_REQUIREMENT = { theory: defaultTheory.id, range: "~1.0" };
10
+ export * from "./path.js";
11
+ export * from "./reading.js";
12
+ export * from "./timing.js";
13
+ export * from "./diagnosis.js";
14
+ export * from "./diagnostics.js";
15
+ export * from "./messages.js";
16
+ export * from "./state.js";
17
+ export * from "./completion.js";
18
+ export * from "./tags.js";
19
+ export * from "./outcomes.js";
20
+ export * from "./roleplay.js";
21
+ export * from "./chat.js";
22
+ export * from "./tools.js";
23
+ export * from "./skills.js";
24
+ export * from "./catalog-contract.js";
25
+ export * from "./catalog.js";
26
+ export * from "./evaluation.js";
@@ -0,0 +1,167 @@
1
+ /** Locale resources owned by the default Pedagogy package, resolved by the Application. */
2
+ export declare const defaultTheoryMessages: {
3
+ readonly "default.observation.claim": {
4
+ readonly en: "Claim ({stance}): “{statement}”";
5
+ readonly "zh-CN": "自述({stance}):“{statement}”";
6
+ };
7
+ readonly "default.observation.demonstration": {
8
+ readonly en: "Evidence: {outcome} {help} — “{task}”; response: “{response}”";
9
+ readonly "zh-CN": "证据:{help}{outcome} — “{task}”;回答:“{response}”";
10
+ };
11
+ readonly "default.observation.teaching": {
12
+ readonly en: "Teaching: {explanation}";
13
+ readonly "zh-CN": "教学:{explanation}";
14
+ };
15
+ readonly "default.observation.grade": {
16
+ readonly en: "Evidence: {rating} retention grade for {day}";
17
+ readonly "zh-CN": "证据:{day} 的记忆保持评分为{rating}";
18
+ };
19
+ readonly "default.observation.lapse": {
20
+ readonly en: "Evidence: lapse recorded";
21
+ readonly "zh-CN": "证据:已记录遗忘";
22
+ };
23
+ readonly "default.observation.review-pass": {
24
+ readonly en: "Evidence: Review passed";
25
+ readonly "zh-CN": "证据:复习已通过";
26
+ };
27
+ readonly "default.observation.completion": {
28
+ readonly en: "Evidence: {playground} {state}";
29
+ readonly "zh-CN": "证据:{playground} {state}";
30
+ };
31
+ readonly "default.observation.retraction": {
32
+ readonly en: "Evidence retracted: {of}";
33
+ readonly "zh-CN": "已撤回证据:{of}";
34
+ };
35
+ readonly "default.observation.homing": {
36
+ readonly en: "Evidence {of} reassigned to {homes}";
37
+ readonly "zh-CN": "证据 {of} 已重新归属到{homes}";
38
+ };
39
+ readonly "default.observation.no-nodes": {
40
+ readonly en: "no Nodes";
41
+ readonly "zh-CN": "无节点";
42
+ };
43
+ readonly "default.observation.feature-use": {
44
+ readonly en: "Evidence: used {operation}";
45
+ readonly "zh-CN": "证据:已使用 {operation}";
46
+ };
47
+ readonly "default.observation.memory": {
48
+ readonly en: "Memory: {text}";
49
+ readonly "zh-CN": "记忆:{text}";
50
+ };
51
+ readonly "default.observation.interpretation": {
52
+ readonly en: "Interpretation: {text}";
53
+ readonly "zh-CN": "解读:{text}";
54
+ };
55
+ readonly "default.observation.memory-summary": {
56
+ readonly en: "Memory summary: {text}";
57
+ readonly "zh-CN": "记忆摘要:{text}";
58
+ };
59
+ readonly "default.observation.stance.knows": {
60
+ readonly en: "knows";
61
+ readonly "zh-CN": "已会";
62
+ };
63
+ readonly "default.observation.stance.forgotten": {
64
+ readonly en: "forgotten";
65
+ readonly "zh-CN": "已忘记";
66
+ };
67
+ readonly "default.observation.stance.unfamiliar": {
68
+ readonly en: "unfamiliar";
69
+ readonly "zh-CN": "不熟悉";
70
+ };
71
+ readonly "default.observation.outcome.success": {
72
+ readonly en: "success";
73
+ readonly "zh-CN": "成功";
74
+ };
75
+ readonly "default.observation.outcome.failure": {
76
+ readonly en: "failure";
77
+ readonly "zh-CN": "失败";
78
+ };
79
+ readonly "default.observation.outcome.dont-know": {
80
+ readonly en: "dont-know";
81
+ readonly "zh-CN": "不知道";
82
+ };
83
+ readonly "default.observation.help.unaided": {
84
+ readonly en: "unaided";
85
+ readonly "zh-CN": "独立作答,";
86
+ };
87
+ readonly "default.observation.help.aided": {
88
+ readonly en: "with help";
89
+ readonly "zh-CN": "借助帮助,";
90
+ };
91
+ readonly "default.observation.rating.Again": {
92
+ readonly en: "Again";
93
+ readonly "zh-CN": "重来";
94
+ };
95
+ readonly "default.observation.rating.Hard": {
96
+ readonly en: "Hard";
97
+ readonly "zh-CN": "困难";
98
+ };
99
+ readonly "default.observation.rating.Good": {
100
+ readonly en: "Good";
101
+ readonly "zh-CN": "良好";
102
+ };
103
+ readonly "default.observation.rating.Easy": {
104
+ readonly en: "Easy";
105
+ readonly "zh-CN": "轻松";
106
+ };
107
+ readonly "default.observation.state.complete": {
108
+ readonly en: "complete";
109
+ readonly "zh-CN": "已完成";
110
+ };
111
+ readonly "default.observation.state.incomplete": {
112
+ readonly en: "incomplete";
113
+ readonly "zh-CN": "未完成";
114
+ };
115
+ readonly "default.state.done": {
116
+ readonly en: "Demonstrated";
117
+ readonly "zh-CN": "已掌握";
118
+ };
119
+ readonly "default.state.tentative": {
120
+ readonly en: "Probably known";
121
+ readonly "zh-CN": "可能已掌握";
122
+ };
123
+ readonly "default.state.open": {
124
+ readonly en: "Unknown";
125
+ readonly "zh-CN": "未知";
126
+ };
127
+ readonly "default.checklist.done": {
128
+ readonly en: "Demonstrated";
129
+ readonly "zh-CN": "已展示掌握";
130
+ };
131
+ readonly "default.checklist.tentative": {
132
+ readonly en: "Probably known · confirm with a check";
133
+ readonly "zh-CN": "可能已掌握 · 仍需检验确认";
134
+ };
135
+ readonly "default.checklist.open": {
136
+ readonly en: "Not yet demonstrated";
137
+ readonly "zh-CN": "尚未展示掌握";
138
+ };
139
+ readonly "default.node-progress.counts": {
140
+ readonly en: "{counts}, ";
141
+ readonly "zh-CN": "{counts},";
142
+ };
143
+ readonly "default.node-progress.no-success": {
144
+ readonly en: "{counts}last success none; aided practice {aidedPractice}";
145
+ readonly "zh-CN": "{counts}尚无成功;辅助练习 {aidedPractice}";
146
+ };
147
+ readonly "default.node-progress.last-success": {
148
+ readonly en: "{counts}last success {lastSuccess}; aided practice {aidedPractice}";
149
+ readonly "zh-CN": "{counts}最近成功:{lastSuccess};辅助练习 {aidedPractice}";
150
+ };
151
+ readonly "default.charting.note.known": {
152
+ readonly en: "I already know this.";
153
+ readonly "zh-CN": "这个我已经会了。";
154
+ };
155
+ readonly "default.charting.note.unwanted": {
156
+ readonly en: "I don't need this.";
157
+ readonly "zh-CN": "这个我不需要。";
158
+ };
159
+ readonly "default.charting.note.why": {
160
+ readonly en: "Why is this needed?";
161
+ readonly "zh-CN": "为什么需要这个?";
162
+ };
163
+ readonly "default.charting.note.merge": {
164
+ readonly en: "These are one thing for me.";
165
+ readonly "zh-CN": "对我来说这些是一回事。";
166
+ };
167
+ };
@@ -0,0 +1,56 @@
1
+ /** Locale resources owned by the default Pedagogy package, resolved by the Application. */
2
+ export const defaultTheoryMessages = {
3
+ "default.observation.claim": { en: "Claim ({stance}): “{statement}”", "zh-CN": "自述({stance}):“{statement}”" },
4
+ "default.observation.demonstration": {
5
+ en: "Evidence: {outcome} {help} — “{task}”; response: “{response}”",
6
+ "zh-CN": "证据:{help}{outcome} — “{task}”;回答:“{response}”",
7
+ },
8
+ "default.observation.teaching": { en: "Teaching: {explanation}", "zh-CN": "教学:{explanation}" },
9
+ "default.observation.grade": {
10
+ en: "Evidence: {rating} retention grade for {day}",
11
+ "zh-CN": "证据:{day} 的记忆保持评分为{rating}",
12
+ },
13
+ "default.observation.lapse": { en: "Evidence: lapse recorded", "zh-CN": "证据:已记录遗忘" },
14
+ "default.observation.review-pass": { en: "Evidence: Review passed", "zh-CN": "证据:复习已通过" },
15
+ "default.observation.completion": { en: "Evidence: {playground} {state}", "zh-CN": "证据:{playground} {state}" },
16
+ "default.observation.retraction": { en: "Evidence retracted: {of}", "zh-CN": "已撤回证据:{of}" },
17
+ "default.observation.homing": { en: "Evidence {of} reassigned to {homes}", "zh-CN": "证据 {of} 已重新归属到{homes}" },
18
+ "default.observation.no-nodes": { en: "no Nodes", "zh-CN": "无节点" },
19
+ "default.observation.feature-use": { en: "Evidence: used {operation}", "zh-CN": "证据:已使用 {operation}" },
20
+ "default.observation.memory": { en: "Memory: {text}", "zh-CN": "记忆:{text}" },
21
+ "default.observation.interpretation": { en: "Interpretation: {text}", "zh-CN": "解读:{text}" },
22
+ "default.observation.memory-summary": { en: "Memory summary: {text}", "zh-CN": "记忆摘要:{text}" },
23
+ "default.observation.stance.knows": { en: "knows", "zh-CN": "已会" },
24
+ "default.observation.stance.forgotten": { en: "forgotten", "zh-CN": "已忘记" },
25
+ "default.observation.stance.unfamiliar": { en: "unfamiliar", "zh-CN": "不熟悉" },
26
+ "default.observation.outcome.success": { en: "success", "zh-CN": "成功" },
27
+ "default.observation.outcome.failure": { en: "failure", "zh-CN": "失败" },
28
+ "default.observation.outcome.dont-know": { en: "dont-know", "zh-CN": "不知道" },
29
+ "default.observation.help.unaided": { en: "unaided", "zh-CN": "独立作答," },
30
+ "default.observation.help.aided": { en: "with help", "zh-CN": "借助帮助," },
31
+ "default.observation.rating.Again": { en: "Again", "zh-CN": "重来" },
32
+ "default.observation.rating.Hard": { en: "Hard", "zh-CN": "困难" },
33
+ "default.observation.rating.Good": { en: "Good", "zh-CN": "良好" },
34
+ "default.observation.rating.Easy": { en: "Easy", "zh-CN": "轻松" },
35
+ "default.observation.state.complete": { en: "complete", "zh-CN": "已完成" },
36
+ "default.observation.state.incomplete": { en: "incomplete", "zh-CN": "未完成" },
37
+ "default.state.done": { en: "Demonstrated", "zh-CN": "已掌握" },
38
+ "default.state.tentative": { en: "Probably known", "zh-CN": "可能已掌握" },
39
+ "default.state.open": { en: "Unknown", "zh-CN": "未知" },
40
+ "default.checklist.done": { en: "Demonstrated", "zh-CN": "已展示掌握" },
41
+ "default.checklist.tentative": { en: "Probably known · confirm with a check", "zh-CN": "可能已掌握 · 仍需检验确认" },
42
+ "default.checklist.open": { en: "Not yet demonstrated", "zh-CN": "尚未展示掌握" },
43
+ "default.node-progress.counts": { en: "{counts}, ", "zh-CN": "{counts}," },
44
+ "default.node-progress.no-success": {
45
+ en: "{counts}last success none; aided practice {aidedPractice}",
46
+ "zh-CN": "{counts}尚无成功;辅助练习 {aidedPractice}",
47
+ },
48
+ "default.node-progress.last-success": {
49
+ en: "{counts}last success {lastSuccess}; aided practice {aidedPractice}",
50
+ "zh-CN": "{counts}最近成功:{lastSuccess};辅助练习 {aidedPractice}",
51
+ },
52
+ "default.charting.note.known": { en: "I already know this.", "zh-CN": "这个我已经会了。" },
53
+ "default.charting.note.unwanted": { en: "I don't need this.", "zh-CN": "这个我不需要。" },
54
+ "default.charting.note.why": { en: "Why is this needed?", "zh-CN": "为什么需要这个?" },
55
+ "default.charting.note.merge": { en: "These are one thing for me.", "zh-CN": "对我来说这些是一回事。" },
56
+ };
@@ -0,0 +1,143 @@
1
+ import type { Demonstration, NodeRef } from "./state.js";
2
+ import type { ExactPatchRef, NodeId } from "@mmon-co/ncept-core/patch";
3
+ export { isCompletionOutcome } from "./state.js";
4
+ export type { CompletionOutcome } from "./state.js";
5
+ /** Content captured when retrieval happened, not a pointer to an editable card. */
6
+ export interface RecallOutcome {
7
+ readonly kind: "recall";
8
+ readonly card: {
9
+ readonly id: string;
10
+ readonly front: string;
11
+ readonly back: string;
12
+ readonly nodes: readonly NodeRef[];
13
+ };
14
+ readonly grade: {
15
+ readonly id: string;
16
+ readonly cardId: string;
17
+ readonly gradedAt: string;
18
+ readonly answer: string;
19
+ readonly grade: "again" | "hard" | "good" | "easy";
20
+ };
21
+ }
22
+ export interface QuizOutcome {
23
+ readonly kind: "quiz";
24
+ readonly id: string;
25
+ readonly at: string;
26
+ readonly node: NodeRef;
27
+ readonly questions: readonly {
28
+ readonly id: string;
29
+ readonly prompt: string;
30
+ readonly options: readonly {
31
+ readonly id: string;
32
+ readonly label: string;
33
+ readonly correct: boolean;
34
+ readonly error?: string;
35
+ }[];
36
+ }[];
37
+ readonly responses: readonly {
38
+ readonly questionId: string;
39
+ readonly selectedOptionId?: string;
40
+ readonly skipped: boolean;
41
+ readonly comment?: string;
42
+ }[];
43
+ }
44
+ export interface CheckResult {
45
+ readonly outcome: "shown" | "absent" | "mistaken" | "skipped";
46
+ readonly error?: string;
47
+ }
48
+ /**
49
+ * One assessed Quizzes Playground response, with the Problem captured at open and the revision pinned there.
50
+ * Answer describes the response surface; grader records who judged it.
51
+ */
52
+ export interface AttemptOutcome {
53
+ readonly kind: "attempt";
54
+ readonly problem: {
55
+ readonly id: string;
56
+ readonly digest: string;
57
+ readonly about: readonly NodeId[];
58
+ readonly prompt: string;
59
+ readonly presentation?: string;
60
+ readonly answer: {
61
+ readonly kind: "choice";
62
+ readonly options: readonly {
63
+ id: string;
64
+ label: string;
65
+ correct: boolean;
66
+ error?: string;
67
+ }[];
68
+ } | {
69
+ readonly kind: "short";
70
+ } | {
71
+ readonly kind: "text";
72
+ } | {
73
+ readonly kind: "roleplay";
74
+ readonly material: {
75
+ readonly id: string;
76
+ readonly revision: ExactPatchRef;
77
+ };
78
+ } | {
79
+ readonly kind: "applet";
80
+ readonly material: {
81
+ readonly id: string;
82
+ readonly revision: ExactPatchRef;
83
+ };
84
+ readonly setup?: readonly {
85
+ readonly command: string;
86
+ readonly input: unknown;
87
+ }[];
88
+ readonly read: string;
89
+ };
90
+ readonly grader: {
91
+ readonly by: "mechanical";
92
+ readonly accepted?: readonly string[];
93
+ } | {
94
+ readonly by: "tutor" | "learner";
95
+ readonly rubric?: string;
96
+ } | {
97
+ readonly by: "checks";
98
+ readonly help: "pump" | "hint" | "correct";
99
+ readonly checks: readonly {
100
+ id: string;
101
+ about: readonly NodeId[];
102
+ ask: string;
103
+ shown: string;
104
+ absent: string;
105
+ mistaken?: Readonly<Record<string, string>>;
106
+ hint?: string;
107
+ corrections?: Readonly<Record<string, string>>;
108
+ }[];
109
+ readonly pumps: readonly {
110
+ text: string;
111
+ checks: readonly string[];
112
+ }[];
113
+ };
114
+ };
115
+ /** A choice option id, a literal short/text answer, the applet query value as JSON, or a speaker-labelled roleplay transcript. */
116
+ readonly response: string;
117
+ readonly assessment: {
118
+ readonly correct: boolean;
119
+ /** Answer supplied or reference available: practice, not independent evidence. */
120
+ readonly aided?: true;
121
+ readonly dontKnow?: boolean;
122
+ readonly grader: "mechanical" | "tutor" | "learner" | "decision";
123
+ readonly feedback?: string;
124
+ /** Expectations: each check as the final response left it, and as it stood when help first touched it. */
125
+ readonly checks?: Readonly<Record<string, CheckResult>>;
126
+ readonly helped?: Readonly<Record<string, CheckResult>>;
127
+ };
128
+ readonly revision: ExactPatchRef;
129
+ }
130
+ export declare function isAttemptOutcome(value: unknown): value is AttemptOutcome;
131
+ /** Guards validate the supported payload, including the captured grading invariants. */
132
+ export declare function isRecallOutcome(value: unknown): value is RecallOutcome;
133
+ export declare function isQuizOutcome(value: unknown): value is QuizOutcome;
134
+ /** The existing verbatim unaided-card rule, recomputed from the attempt's content. */
135
+ export declare function recallUnaided(card: Pick<RecallOutcome["card"], "front" | "back">): boolean;
136
+ export interface OriginalAttempt {
137
+ readonly at: string;
138
+ readonly payload: Demonstration;
139
+ }
140
+ /** One demonstration per Node and help state, pinned to the revision the Problem was opened at. */
141
+ export declare function problemAttempts(outcome: AttemptOutcome, at: string): readonly OriginalAttempt[];
142
+ /** Pure scoring over captured values; no current Material or graph read can rewrite an attempt. */
143
+ export declare function practiceAttempts(outcome: RecallOutcome | QuizOutcome): readonly OriginalAttempt[];