@mechane-ai/elements 0.47.0 → 0.49.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 (250) hide show
  1. package/README.md +288 -5
  2. package/bin/mechane-elements-catalog.mjs +104 -12
  3. package/dist/ai.js +5 -5
  4. package/dist/article-yyNPg6VU.js +1904 -0
  5. package/dist/article.js +1 -0
  6. package/dist/catalog.json +1691 -163
  7. package/dist/{categorical-values-DdfGIowV.js → categorical-values-DCznViFp.js} +1 -1
  8. package/dist/{cells--Bd1fQFR.js → cells-CNZE4us2.js} +2 -2
  9. package/dist/charts/cartesian.js +1 -1
  10. package/dist/charts/cells.js +1 -1
  11. package/dist/charts/comparison.js +1 -1
  12. package/dist/charts/distribution.js +1 -1
  13. package/dist/charts/figure.js +12 -12
  14. package/dist/charts/graph.js +1 -1
  15. package/dist/charts/hierarchy.js +1 -1
  16. package/dist/charts/image.js +1 -1
  17. package/dist/charts/matrix.js +3 -2
  18. package/dist/charts/plot.js +6 -6
  19. package/dist/charts/relationship.js +1 -1
  20. package/dist/charts/text.js +1 -1
  21. package/dist/charts/timeline.js +1 -1
  22. package/dist/charts/trend.js +1 -1
  23. package/dist/charts.js +2 -2
  24. package/dist/clock-DSm5lkNE.js +16 -0
  25. package/dist/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
  26. package/dist/collections.js +1 -1
  27. package/dist/content/code.js +1 -1
  28. package/dist/content/diff.js +3 -3
  29. package/dist/content/link.js +1 -1
  30. package/dist/content/markdown.js +2 -2
  31. package/dist/content/tree.js +1 -1
  32. package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
  33. package/dist/content.js +1 -1
  34. package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
  35. package/dist/describe-lesson-BmREzDpt.js +175 -0
  36. package/dist/{dumbbell-plot-B2ZTgQaI.js → dumbbell-plot-CMv9llfd.js} +9 -7
  37. package/dist/{embedding-map-CGM_k6lC.js → embedding-map-DC-lgzCq.js} +8 -8
  38. package/dist/feedback.js +1 -1
  39. package/dist/{figure-frame-wRkIEAwe.js → figure-frame-BjFzbl3m.js} +3 -3
  40. package/dist/forms/dates.js +1 -1
  41. package/dist/forms.js +3 -3
  42. package/dist/{image-grid-CVA4SOy_.js → image-grid-DHqtj_zs.js} +4 -4
  43. package/dist/index.js +1 -1
  44. package/dist/kits/evaluation.js +5 -5
  45. package/dist/kits/interpretability.js +320 -302
  46. package/dist/kits/operations.js +6 -6
  47. package/dist/kits/research.js +558 -0
  48. package/dist/kits/training.js +6 -6
  49. package/dist/layout.js +205 -110
  50. package/dist/lesson/agent.js +811 -0
  51. package/dist/lesson/spec.js +661 -0
  52. package/dist/lesson.js +5 -0
  53. package/dist/mdx.js +227 -0
  54. package/dist/navigation.js +2 -2
  55. package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
  56. package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
  57. package/dist/packages/charts/src/chart-theme.d.ts +1 -1
  58. package/dist/packages/charts/src/matrix/index.d.ts +1 -0
  59. package/dist/packages/charts/src/plot/plot-marks.d.ts +7 -3
  60. package/dist/packages/charts/src/plot/plot-surface.d.ts +3 -1
  61. package/dist/packages/collections/src/index.d.ts +1 -1
  62. package/dist/packages/collections/src/metrics.d.ts +9 -1
  63. package/dist/packages/content/src/index.d.ts +2 -0
  64. package/dist/packages/content/src/text-match.d.ts +22 -0
  65. package/dist/packages/core/src/index.d.ts +1 -0
  66. package/dist/packages/core/src/surfaces.d.ts +12 -2
  67. package/dist/packages/forms/src/index.d.ts +2 -0
  68. package/dist/packages/forms/src/token-input.d.ts +24 -0
  69. package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
  70. package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
  71. package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
  72. package/dist/packages/kits/src/research/index.d.ts +8 -0
  73. package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
  74. package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
  75. package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
  76. package/dist/packages/layout/src/figure-grid.d.ts +8 -0
  77. package/dist/packages/layout/src/index.d.ts +4 -1
  78. package/dist/packages/layout/src/sidebar.d.ts +7 -0
  79. package/dist/packages/layout/src/workbench.d.ts +4 -1
  80. package/dist/packages/teaching/src/agent/index.d.ts +11 -0
  81. package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
  82. package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
  83. package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
  84. package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
  85. package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
  86. package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
  87. package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
  88. package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
  89. package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
  90. package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
  91. package/dist/packages/teaching/src/article/article.d.ts +42 -0
  92. package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
  93. package/dist/packages/teaching/src/article/beat.d.ts +16 -0
  94. package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
  95. package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
  96. package/dist/packages/teaching/src/article/figure.d.ts +51 -0
  97. package/dist/packages/teaching/src/article/index.d.ts +31 -0
  98. package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
  99. package/dist/packages/teaching/src/article/notes.d.ts +36 -0
  100. package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
  101. package/dist/packages/teaching/src/article/predict.d.ts +58 -0
  102. package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
  103. package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
  104. package/dist/packages/{kits/src/explainers → teaching/src/article}/term.d.ts +8 -2
  105. package/dist/packages/teaching/src/article/tex.d.ts +12 -0
  106. package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
  107. package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
  108. package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
  109. package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
  110. package/dist/packages/teaching/src/article/walk.d.ts +34 -0
  111. package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
  112. package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
  113. package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
  114. package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
  115. package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
  116. package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
  117. package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
  118. package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
  119. package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
  120. package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
  121. package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
  122. package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
  123. package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
  124. package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
  125. package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
  126. package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
  127. package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
  128. package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
  129. package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
  130. package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
  131. package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
  132. package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
  133. package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
  134. package/dist/packages/teaching/src/scene/index.d.ts +77 -0
  135. package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
  136. package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
  137. package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
  138. package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
  139. package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
  140. package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
  141. package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
  142. package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
  143. package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
  144. package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
  145. package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
  146. package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
  147. package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
  148. package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
  149. package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
  150. package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
  151. package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
  152. package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
  153. package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
  154. package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
  155. package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
  156. package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
  157. package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
  158. package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
  159. package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
  160. package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
  161. package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
  162. package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
  163. package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
  164. package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
  165. package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
  166. package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
  167. package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
  168. package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
  169. package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
  170. package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
  171. package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
  172. package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
  173. package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
  174. package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
  175. package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
  176. package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
  177. package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
  178. package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
  179. package/dist/packages/teaching/src/spec/index.d.ts +14 -0
  180. package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
  181. package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
  182. package/dist/packages/teaching/src/time/clock.d.ts +7 -0
  183. package/dist/packages/teaching/src/time/tween.d.ts +19 -0
  184. package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
  185. package/dist/param-BE3VMSkH.js +450 -0
  186. package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
  187. package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
  188. package/dist/{plot-layout-BEuoOHbs.js → plot-layout-Bqe4-0qZ.js} +4 -3
  189. package/dist/{plot-marks-A64v7aTw.js → plot-marks-FVsbFkUs.js} +18 -15
  190. package/dist/{plot-surface-CJTIqtck.js → plot-surface-DON6WUmk.js} +11 -11
  191. package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
  192. package/dist/{reference-lines-CWA8VeUR.js → reference-lines-hjuD1rRZ.js} +2 -2
  193. package/dist/scene-BP0Ue0R5.js +4938 -0
  194. package/dist/scene.js +1 -0
  195. package/dist/{slope-chart-DT22h_ym.js → slope-chart-C8eeSgL4.js} +7 -7
  196. package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
  197. package/dist/{src-D5NXRJZe.js → src-B2rgpWap.js} +48 -14
  198. package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
  199. package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
  200. package/dist/{src-1EHkSFS-.js → src-Dxs3Buo_.js} +205 -139
  201. package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
  202. package/dist/styles2.css +542 -21
  203. package/dist/{time-series-IB3CB93O.js → time-series-BL933QyA.js} +787 -715
  204. package/dist/{token-heatmap-C00DnoNO.js → token-heatmap-BB65awva.js} +4 -4
  205. package/dist/{token-predictions-Cxx29iDr.js → token-predictions-Pa8eUGan.js} +6 -6
  206. package/dist/transport-DzyxVXbL.js +715 -0
  207. package/dist/{tree-diagram-DsckNKaW.js → tree-diagram-DJhKBiia.js} +6 -6
  208. package/dist/{treemap-9_DpLCW9.js → treemap-CxxgABUg.js} +5 -5
  209. package/dist/use-tween-5HZ55_9d.js +72 -0
  210. package/dist/{violin-plot-BhPHKXsN.js → violin-plot-CoAEF_7Z.js} +7 -6
  211. package/dist/{waterfall-CGksuTy5.js → waterfall-DdoEXEkT.js} +7 -7
  212. package/package.json +30 -5
  213. package/recipes/counting-cards.tsx +656 -0
  214. package/recipes/explorable-essay.tsx +172 -0
  215. package/skills/extend-elements/SKILL.md +21 -0
  216. package/skills/plan-lesson/SKILL.md +86 -0
  217. package/skills/plan-lesson/references/plan-format.md +114 -0
  218. package/skills/plan-lesson/references/worked-plan.md +171 -0
  219. package/skills/review-elements/SKILL.md +4 -2
  220. package/skills/review-explainer/SKILL.md +97 -0
  221. package/skills/upgrade-elements/references/releases.md +65 -0
  222. package/skills/use-elements/SKILL.md +18 -16
  223. package/skills/use-elements/references/kits.md +9 -26
  224. package/skills/use-elements/references/teaching.md +36 -0
  225. package/skills/write-explainer/SKILL.md +112 -0
  226. package/skills/write-explainer/references/article.md +164 -0
  227. package/skills/write-explainer/references/lesson.md +148 -0
  228. package/skills/write-explainer/references/mdx.md +78 -0
  229. package/skills/write-explainer/references/scene-parts.md +273 -0
  230. package/skills/write-explainer/references/scene.md +168 -0
  231. package/skills/write-explainer/references/tutor.md +104 -0
  232. package/skills/write-explainer/references/worked-essay.md +459 -0
  233. package/templates/essay/AGENTS.md +14 -0
  234. package/templates/essay/README.md +59 -0
  235. package/templates/essay/index.html +17 -0
  236. package/templates/essay/package.template.json +21 -0
  237. package/templates/essay/plan.json +96 -0
  238. package/templates/essay/src/essay.mdx +97 -0
  239. package/templates/essay/src/figures.tsx +92 -0
  240. package/templates/essay/src/lesson.ts +83 -0
  241. package/templates/essay/src/main.tsx +53 -0
  242. package/templates/essay/src/mdx.d.ts +7 -0
  243. package/templates/essay/tsconfig.template.json +15 -0
  244. package/templates/essay/vite.config.template.txt +8 -0
  245. package/dist/kits/explainers.js +0 -452
  246. package/dist/packages/kits/src/explainers/figures.d.ts +0 -31
  247. package/dist/packages/kits/src/explainers/index.d.ts +0 -8
  248. package/dist/packages/kits/src/explainers/story-steps.d.ts +0 -46
  249. /package/dist/packages/{kits/src/explainers → teaching/src/article}/linked-target.d.ts +0 -0
  250. /package/dist/packages/{kits/src/explainers → teaching/src/lesson}/bound-value.d.ts +0 -0
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { FigureProps } from '../../../charts/src/index.ts';
3
+ export type SpecimenOutcome = 'gained' | 'regressed' | 'both_pass' | 'both_fail';
4
+ export type SpecimenFilter = 'all' | SpecimenOutcome;
5
+ export type SpecimenDiffRow = {
6
+ readonly id: string;
7
+ readonly prompt: string;
8
+ readonly family: string;
9
+ readonly expected: string;
10
+ readonly baselineOutput: string;
11
+ readonly candidateOutput: string;
12
+ readonly outcome: SpecimenOutcome;
13
+ };
14
+ export type SpecimenDiffLabels = {
15
+ readonly breakdownTitle: string;
16
+ readonly all: string;
17
+ readonly gained: string;
18
+ readonly regressed: string;
19
+ readonly bothPass: string;
20
+ readonly bothFail: string;
21
+ readonly specimen: string;
22
+ readonly expected: string;
23
+ readonly baseline: string;
24
+ readonly candidate: string;
25
+ readonly outcome: string;
26
+ readonly empty: string;
27
+ };
28
+ export type SpecimenDiffProps = Pick<FigureProps, 'title' | 'description' | 'locale' | 'status' | 'source'> & {
29
+ readonly rows: ReadonlyArray<SpecimenDiffRow>;
30
+ readonly baselineLabel: string;
31
+ readonly candidateLabel: string;
32
+ readonly filter: SpecimenFilter;
33
+ readonly onFilterChange: (filter: SpecimenFilter) => void;
34
+ readonly onSelectRow?: ((row: SpecimenDiffRow) => void) | undefined;
35
+ readonly labels?: Partial<SpecimenDiffLabels> | undefined;
36
+ };
37
+ /**
38
+ * Paired before/after example inspection: a `BreakdownBar` of outcome flips above a searchable specimen table that
39
+ * highlights expected targets with `TextMatch`. Composes Elements families with zero custom SVG.
40
+ */
41
+ export declare function SpecimenDiff({ rows, baselineLabel, candidateLabel, filter, onFilterChange, onSelectRow, labels: given, ...figure }: SpecimenDiffProps): ReactNode;
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from 'react';
2
+ export type WorkHeartbeatState = 'running' | 'completed' | 'blocked' | 'overdue' | 'stopped';
3
+ export type WorkProgress = {
4
+ readonly completed: number;
5
+ readonly total: number;
6
+ readonly unit: string;
7
+ };
8
+ export type WorkReportItem = {
9
+ readonly id: string;
10
+ readonly title: string;
11
+ readonly state: WorkHeartbeatState;
12
+ readonly observedAt: string;
13
+ readonly observedLabel: string;
14
+ readonly executionRef?: string | undefined;
15
+ readonly nextCheckpoint?: string | undefined;
16
+ readonly progress?: WorkProgress | undefined;
17
+ };
18
+ export type WorkHeartbeatLabels = {
19
+ readonly title: string;
20
+ readonly empty: string;
21
+ readonly nextCheckpoint: string;
22
+ readonly states: Readonly<Record<WorkHeartbeatState, string>>;
23
+ };
24
+ export type WorkHeartbeatProps = {
25
+ readonly reports: ReadonlyArray<WorkReportItem>;
26
+ readonly locale: string;
27
+ readonly title?: string | undefined;
28
+ readonly labels?: Partial<WorkHeartbeatLabels> | undefined;
29
+ };
30
+ /**
31
+ * Displays reported execution checkpoints with explicit freshness and optional finite batch progress. The application
32
+ * owns the state (including when an expired report becomes `'overdue'`); the kit never infers failure from staleness.
33
+ */
34
+ export declare function WorkHeartbeat({ reports, locale, title, labels: given }: WorkHeartbeatProps): ReactNode;
@@ -0,0 +1,8 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ export type FigureGridLayout = '2-up' | 'hero-aside' | '3-up';
3
+ export type FigureGridProps = ComponentProps<'div'> & {
4
+ /** Responsive multi-figure arrangement that collapses cleanly by container width. */
5
+ readonly layout?: FigureGridLayout;
6
+ };
7
+ /** Arranges sibling analytical figures on a responsive container-aware grid with shared spacing. */
8
+ export declare function FigureGrid({ layout, children, ...props }: FigureGridProps): ReactNode;
@@ -5,6 +5,8 @@ export type { NavigationRailLink, NavigationRailProps } from './navigation-rail.
5
5
  export { NavigationRailMenu } from './navigation-rail-menu.tsx';
6
6
  export type { NavigationRailMenuProps } from './navigation-rail-menu.tsx';
7
7
  export { DetailPage } from './detail-page.tsx';
8
+ export type { FigureGridLayout, FigureGridProps } from './figure-grid.tsx';
9
+ export { FigureGrid } from './figure-grid.tsx';
8
10
  export { FocusPage } from './focus-page.tsx';
9
11
  export { Workbench, WorkbenchScroll, WorkbenchFooter } from './workbench.tsx';
10
12
  export { ViewStack } from './view-stack.tsx';
@@ -17,4 +19,5 @@ export type { RecordPageBodyProps, RecordPageHeaderProps, RecordPageContentProps
17
19
  export { RecordPage } from './record-page.tsx';
18
20
  export type { ResizableRootProps, ResizablePaneProps, ResizableHandleProps } from './resizable.tsx';
19
21
  export { Resizable } from './resizable.tsx';
20
- export { Navigation, NavigationSection, NavigationItem, NavigationLink, SidebarLabel, SidebarFooter, } from './sidebar.tsx';
22
+ export type { SidebarBrandProps } from './sidebar.tsx';
23
+ export { Navigation, NavigationSection, NavigationItem, NavigationLink, SidebarBrand, SidebarLabel, SidebarFooter, } from './sidebar.tsx';
@@ -50,6 +50,13 @@ export declare function NavigationSection({ children, label, }: {
50
50
  }): ReactNode;
51
51
  export declare function NavigationItem({ children, icon, isSelected, shouldCloseOnActivate, onClick, className, style, ...props }: NavigationItemProps): ReactNode;
52
52
  export declare function NavigationLink({ children, icon, isSelected, onClick, className, style, ...props }: NavigationLinkProps): ReactNode;
53
+ export type SidebarBrandProps = {
54
+ readonly title: string;
55
+ readonly subtitle?: string | undefined;
56
+ readonly icon?: ReactNode;
57
+ };
58
+ /** Fits a workspace title, optional subtitle, and optional icon cleanly inside the 48px sidebar header. */
59
+ export declare function SidebarBrand({ title, subtitle, icon }: SidebarBrandProps): ReactNode;
53
60
  export declare function SidebarLabel({ children, shouldGrow }: SidebarLabelProps): ReactNode;
54
61
  export declare function SidebarFooter({ children, layout }: SidebarFooterProps): ReactNode;
55
62
  export declare function SidebarToggle(): ReactNode;
@@ -1,11 +1,14 @@
1
1
  import type { ReactNode } from 'react';
2
- export declare function Workbench({ header, children, inspector, }: {
2
+ export declare function Workbench({ header, children, inspector, isResizable, inspectorInitialPercent, }: {
3
3
  readonly header?: ReactNode;
4
4
  readonly children: ReactNode;
5
5
  readonly inspector?: {
6
6
  readonly label: string;
7
7
  readonly content: ReactNode;
8
8
  } | undefined;
9
+ /** Lets desktop readers drag the divider between the main column and the inspector pane. */
10
+ readonly isResizable?: boolean;
11
+ readonly inspectorInitialPercent?: number;
9
12
  }): ReactNode;
10
13
  export declare function WorkbenchScroll({ label, children, isFlush, scrollRestorationId, }: {
11
14
  readonly label: string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agents beside a reader. Tutor tools read and move a lesson through the UI SDK agent bridge. A learner trace records
3
+ * what the reader did, and a tour plays a guided walk that pauses when the reader acts.
4
+ */
5
+ export type { LearnerEvent, LearnerEventKind, LearnerRecord, LearnerTrace } from './learner-trace.ts';
6
+ export { LEARNER_TRACE_LIMIT, createLearnerTrace, summarizeTrace } from './learner-trace.ts';
7
+ export type { AnswerSources, LessonAgent, TutorChange } from './lesson-bridge.ts';
8
+ export type { LessonTour, LessonTourStep, TourHold, TourPlayer, TourStatus } from './lesson-tour.ts';
9
+ export { playTour, tourFromTrace, tourHolds, validateTour } from './lesson-tour.ts';
10
+ export type { ReaderPlace, TutorNotes, TutorResult, TutorSchema, TutorSchemaProperty, TutorTool, } from './tutor-tools.ts';
11
+ export { tutorTools } from './tutor-tools.ts';
@@ -0,0 +1,84 @@
1
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
2
+ import type { AnswerSources, LessonAgent } from './lesson-bridge.ts';
3
+ /**
4
+ * What the reader did: moved a param, changed beat or step, started a player, committed a prediction, asked for a hint
5
+ * or reached a challenge.
6
+ */
7
+ export type LearnerEventKind = 'param' | 'beat' | 'step' | 'play' | 'prediction' | 'hint' | 'challenge';
8
+ /** One thing the reader did, as plain JSON. Repeated moves of one control close together are one event. */
9
+ export type LearnerEvent = {
10
+ /** Milliseconds since the trace began. */
11
+ readonly at: number;
12
+ readonly kind: LearnerEventKind;
13
+ /** The param, `beat`, `step`, or the `Predict` or `Challenge` id. */
14
+ readonly name: string;
15
+ /** Before the change. A hint's count, a player's value at its start. */
16
+ readonly from: LessonValue | null;
17
+ /** After the change. A prediction's guess, a hint's count, a player's value where it stopped. */
18
+ readonly to: LessonValue | null;
19
+ /** A committed prediction's answer. Only a prediction the reader committed has one. */
20
+ readonly answer?: number | string | undefined;
21
+ /** Whether a committed prediction was right, within its tolerance. */
22
+ readonly isCorrect?: boolean | undefined;
23
+ /** The beat the reader was on. */
24
+ readonly beat: string | null;
25
+ /** How the reader made the change: `mouse`, `keyboard`, `touch`, `pen`, `virtual`, or `programmatic` for a play. */
26
+ readonly source: string;
27
+ readonly reason: string;
28
+ /** How many changes this event stands for. */
29
+ readonly count: number;
30
+ };
31
+ /** A learner trace as plain JSON, for a tutor prompt, a log or `tourFromTrace`. */
32
+ export type LearnerRecord = {
33
+ readonly lesson: string;
34
+ /** The beat the reader was on when the trace began. */
35
+ readonly startBeat: string | null;
36
+ /** Milliseconds since the trace began. */
37
+ readonly elapsed: number;
38
+ /** The most events the trace keeps; older ones are dropped first. */
39
+ readonly limit: number;
40
+ /** How many older events were dropped. */
41
+ readonly dropped: number;
42
+ readonly events: ReadonlyArray<LearnerEvent>;
43
+ /** Every move to a beat, by the reader or anyone else, so time on each beat is known. */
44
+ readonly visits: ReadonlyArray<{
45
+ readonly at: number;
46
+ readonly beat: string | null;
47
+ }>;
48
+ };
49
+ /** A running record of what the reader did. */
50
+ export type LearnerTrace = {
51
+ readonly read: () => LearnerRecord;
52
+ readonly subscribe: (listener: () => void) => () => void;
53
+ /** Forgets every event and starts the clock again. */
54
+ readonly clear: () => void;
55
+ /** Stops listening. The record stays readable. */
56
+ readonly stop: () => void;
57
+ };
58
+ /** How many events a learner trace keeps unless told otherwise. */
59
+ export declare const LEARNER_TRACE_LIMIT = 400;
60
+ /**
61
+ * Records what the reader does in a lesson, in order, through the agent bridge: param, beat and step moves, players
62
+ * started, and the article's predictions, hints and challenges. Changes an agent makes are left out, and so are a
63
+ * player's own steps. It keeps the last `limit` events.
64
+ */
65
+ export declare function createLearnerTrace({ agent, lesson, article, limit, now, }: {
66
+ readonly agent: LessonAgent;
67
+ readonly lesson: AnyLesson;
68
+ /** The title of the article whose progress to read. Defaults to the lesson's title, or the page's only article. */
69
+ readonly article?: string | undefined;
70
+ readonly limit?: number | undefined;
71
+ /** The clock, in milliseconds. Defaults to `performance.now`. */
72
+ readonly now?: (() => number) | undefined;
73
+ }): LearnerTrace;
74
+ /**
75
+ * A few sentences of plain facts about what the reader did, for a tutor prompt: time on each beat, how each param
76
+ * moved, plays, predictions, hints and challenges. It interprets nothing.
77
+ */
78
+ export declare function summarizeTrace({ record, lesson, locale, answers, }: {
79
+ readonly record: LearnerRecord;
80
+ readonly lesson: AnyLesson;
81
+ readonly locale: string;
82
+ /** Where each prediction's answer comes from, so guesses and answers are written in its format. */
83
+ readonly answers?: AnswerSources | undefined;
84
+ }): string;
@@ -0,0 +1,59 @@
1
+ import type { AgentComponent, createAgent, ObservedChange } from '../../../foundations/src/agent/index.ts';
2
+ import type { LessonProgress } from '../article/progress-store.ts';
3
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
4
+ /** The UI SDK agent bridge a tutor reads and acts through, as `createAgent()` returns it. */
5
+ export type LessonAgent = ReturnType<typeof createAgent>;
6
+ /** One value that changed: a param, a derived value, the beat or the reveal step. */
7
+ export type TutorChange = {
8
+ readonly name: string;
9
+ readonly from: LessonValue | null;
10
+ readonly to: LessonValue | null;
11
+ };
12
+ /** The lesson as the bridge reports it now: where the reader is and every value. */
13
+ export type LessonReading = {
14
+ /** The lesson's ref in the bridge, for `act` steps. */
15
+ readonly ref: string;
16
+ readonly beat: string | null;
17
+ readonly step: number;
18
+ /** The param whose player is running, or null. */
19
+ readonly playing: string | null;
20
+ /** Every param and derived value. */
21
+ readonly values: Readonly<Record<string, LessonValue>>;
22
+ };
23
+ /**
24
+ * The lesson value each `Predict` takes its answer from, by the `Predict` id, as its `answerFrom` prop names it. Tutor
25
+ * tools withhold that value until the reader commits the prediction.
26
+ */
27
+ export type AnswerSources = Readonly<Record<string, string>>;
28
+ /** The sources of changes a person makes with a pointer, a key or assistive technology. */
29
+ export declare const readerSources: ReadonlySet<string>;
30
+ /** A bridge value as a lesson value, or null when it is not one. */
31
+ export declare function lessonValueOf(value: unknown): LessonValue | null;
32
+ /** Whether a value is a plain object, the shape JSON writes with braces. */
33
+ export declare function isPlainObject(value: unknown): boolean;
34
+ /** The fields of a plain object, or an empty map for anything else. */
35
+ export declare function fieldMap(value: unknown): ReadonlyMap<string, unknown>;
36
+ /** The reader's progress a `lesson-progress` value holds, with anything it does not hold left empty. */
37
+ export declare function progressOf(value: unknown): LessonProgress;
38
+ /** Whether a snapshot entry or a change belongs to this lesson: the `lesson` primitive named by its title. */
39
+ export declare function isLessonEntry(entry: {
40
+ readonly component: string;
41
+ readonly label?: string;
42
+ }, lesson: AnyLesson): boolean;
43
+ /** The lesson's entry in the bridge snapshot, or undefined while it is not on the page or is read-only. */
44
+ export declare function lessonEntry(agent: LessonAgent, lesson: AnyLesson): AgentComponent | undefined;
45
+ /**
46
+ * The `lesson-progress` entry of the article titled `title` in the bridge snapshot. When no entry has that title and
47
+ * the page has only one, it is that one.
48
+ */
49
+ export declare function progressEntry(agent: LessonAgent, title: string): AgentComponent | undefined;
50
+ /** The param values a bridge value holds, over the lesson's defaults for any it lacks. */
51
+ export declare function paramsOf(lesson: AnyLesson, value: unknown): Readonly<Record<string, LessonValue>>;
52
+ /** Reads the lesson through the bridge snapshot, or undefined while the bridge cannot see it. */
53
+ export declare function readLesson(agent: LessonAgent, lesson: AnyLesson): LessonReading | undefined;
54
+ /** Every value that differs between two readings, the beat, step and player first. */
55
+ export declare function changesBetween(before: LessonReading, after: LessonReading): ReadonlyArray<TutorChange>;
56
+ /** The params that differ between the values before and after a reported lesson change. */
57
+ export declare function paramChanges(lesson: AnyLesson, change: ObservedChange): ReadonlyArray<TutorChange>;
58
+ /** Resolves after the next shared frame, once the page has drawn what an action changed. */
59
+ export declare function nextFrame(): Promise<void>;
@@ -0,0 +1,63 @@
1
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
2
+ import type { LessonFinding } from '../spec/findings.ts';
3
+ import type { LearnerRecord } from './learner-trace.ts';
4
+ import type { LessonAgent } from './lesson-bridge.ts';
5
+ /** How long a tour stays on a step, in seconds, by name. Tours name a pace and never hold raw durations. */
6
+ export declare const tourHolds: {
7
+ readonly short: 1.5;
8
+ readonly regular: 3;
9
+ readonly long: 6;
10
+ };
11
+ /** A named time a tour stays on one step. */
12
+ export type TourHold = keyof typeof tourHolds;
13
+ /** One step of a tour: where to go, what to show, what to say and how long to stay. Every field is optional. */
14
+ export type LessonTourStep = {
15
+ readonly beat?: string | undefined;
16
+ /** The reveal step inside the beat, from 0. */
17
+ readonly step?: number | undefined;
18
+ /** A state the beat declares, shown in one change. */
19
+ readonly state?: string | undefined;
20
+ readonly values?: Readonly<Record<string, LessonValue>> | undefined;
21
+ /** What the tutor says at this step, handed to `onSay`. */
22
+ readonly say?: string | undefined;
23
+ /** Defaults to `regular`. */
24
+ readonly hold?: TourHold | undefined;
25
+ };
26
+ /** A guided walk through a lesson as plain JSON, written by an author or recorded with `tourFromTrace`. */
27
+ export type LessonTour = ReadonlyArray<LessonTourStep>;
28
+ /** Where a playing tour is: running, paused because the reader acted, finished, stopped or failed on a step. */
29
+ export type TourStatus = 'playing' | 'paused' | 'done' | 'stopped' | 'failed';
30
+ /** A tour that is playing. */
31
+ export type TourPlayer = {
32
+ readonly status: () => TourStatus;
33
+ /** The step shown now, from 0, or -1 before the first. */
34
+ readonly index: () => number;
35
+ /** Why the tour failed, or null. */
36
+ readonly error: () => string | null;
37
+ readonly pause: () => void;
38
+ /** Goes on from the step it paused on, with that step's hold started again. */
39
+ readonly resume: () => void;
40
+ readonly stop: () => void;
41
+ readonly subscribe: (listener: () => void) => () => void;
42
+ };
43
+ /**
44
+ * Plays a tour through the agent bridge on the shared clock: each step moves the lesson, says its line and holds. The
45
+ * tour pauses when the reader changes the lesson, and `resume` goes on.
46
+ */
47
+ export declare function playTour({ agent, lesson, tour, onSay, }: {
48
+ readonly agent: LessonAgent;
49
+ readonly lesson: AnyLesson;
50
+ readonly tour: LessonTour;
51
+ /** Hears each step's line, with the step's index. */
52
+ readonly onSay?: ((say: string, index: number) => void) | undefined;
53
+ }): TourPlayer;
54
+ /**
55
+ * Checks a tour against its lesson before it plays: known beats, reveal steps in range, declared states, values the
56
+ * params take and named holds. Every finding has a path and a sentence.
57
+ */
58
+ export declare function validateTour(tour: unknown, lesson: AnyLesson): ReadonlyArray<LessonFinding>;
59
+ /**
60
+ * Turns a recorded demonstration into a tour an author can edit: each beat move becomes a step, and the param moves
61
+ * after it become that step's values. Add `say` lines and change holds by hand.
62
+ */
63
+ export declare function tourFromTrace(record: LearnerRecord): LessonTour;
@@ -0,0 +1,86 @@
1
+ import type { LessonProgress } from '../article/progress-store.ts';
2
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
3
+ import type { LessonOutline } from '../spec/describe-lesson.ts';
4
+ import type { AnswerSources, LessonAgent, TutorChange } from './lesson-bridge.ts';
5
+ /** A tool input property as JSON Schema. */
6
+ export type TutorSchemaProperty = {
7
+ readonly type: string | ReadonlyArray<string>;
8
+ readonly description: string;
9
+ readonly enum?: ReadonlyArray<string> | undefined;
10
+ };
11
+ /** A tool's input as JSON Schema: an object with named properties. */
12
+ export type TutorSchema = {
13
+ readonly type: 'object';
14
+ readonly properties: Readonly<Record<string, TutorSchemaProperty>>;
15
+ readonly required: ReadonlyArray<string>;
16
+ };
17
+ /** The current beat's tutor notes. They are for the tutor and are never shown to the reader. */
18
+ export type TutorNotes = {
19
+ readonly goal: string | null;
20
+ readonly misconception: string | null;
21
+ readonly hints: ReadonlyArray<string>;
22
+ };
23
+ /**
24
+ * Where the reader is: the beat and reveal step, every value as a number and as the reader reads it. A value a
25
+ * prediction the reader has not committed takes its answer from is left out.
26
+ */
27
+ export type ReaderPlace = {
28
+ readonly beat: {
29
+ readonly id: string;
30
+ readonly title: string;
31
+ readonly number: number;
32
+ readonly of: number;
33
+ } | null;
34
+ readonly step: number;
35
+ /** The last reveal step of the beat. */
36
+ readonly steps: number;
37
+ /** The param whose player is running, or null. */
38
+ readonly playing: string | null;
39
+ readonly values: Readonly<Record<string, LessonValue>>;
40
+ /** Each value written in its declared format, as the page shows it. */
41
+ readonly written: Readonly<Record<string, string>>;
42
+ readonly notes: TutorNotes;
43
+ /**
44
+ * What the reader has done, from the article's `lesson-progress`: committed predictions with their answers, reached
45
+ * challenges, hints used and beats visited. Null where the page has no article.
46
+ */
47
+ readonly progress: LessonProgress | null;
48
+ /** The values left out until the reader commits the prediction that takes its answer from each. */
49
+ readonly withheld: ReadonlyArray<string>;
50
+ };
51
+ /** What a tutor tool returns: plain JSON that says what changed, or why nothing could. */
52
+ export type TutorResult = {
53
+ readonly kind: 'ok';
54
+ readonly changed?: ReadonlyArray<TutorChange> | undefined;
55
+ readonly at?: {
56
+ readonly beat: string | null;
57
+ readonly step: number;
58
+ } | undefined;
59
+ readonly place?: ReaderPlace | undefined;
60
+ readonly outline?: LessonOutline | undefined;
61
+ readonly note?: string | undefined;
62
+ } | {
63
+ readonly kind: 'error';
64
+ readonly message: string;
65
+ };
66
+ /** A tool a model can call: its name, what it does, its input as JSON Schema, and the function that runs it. */
67
+ export type TutorTool = {
68
+ readonly name: string;
69
+ readonly description: string;
70
+ readonly inputSchema: TutorSchema;
71
+ readonly run: (input?: unknown) => Promise<TutorResult>;
72
+ };
73
+ /**
74
+ * Tools a tutor model can call beside a reader. They read the outline and where the reader is, set params, show states,
75
+ * move between beats, play, pause and inspect figures. Every tool acts through the UI SDK agent bridge, and none
76
+ * reveals a prediction's answer before the reader commits it.
77
+ */
78
+ export declare function tutorTools({ agent, lesson, locale, article, answers, }: {
79
+ readonly agent: LessonAgent;
80
+ readonly lesson: AnyLesson;
81
+ readonly locale: string;
82
+ /** The title of the article whose progress to read. Defaults to the lesson's title, or the page's only article. */
83
+ readonly article?: string | undefined;
84
+ /** The lesson value each `Predict` takes its answer from, by its id. Tools withhold it until the reader commits. */
85
+ readonly answers?: AnswerSources | undefined;
86
+ }): ReadonlyArray<TutorTool>;
@@ -0,0 +1,9 @@
1
+ import type { AnyLesson } from '../lesson/define-lesson.ts';
2
+ import type { ArticleOutline } from './outline-types.ts';
3
+ /** One problem a beat sheet finds in an article: the beat it concerns, when there is one, and a sentence. */
4
+ export type ArticleFinding = {
5
+ readonly beat: string | null;
6
+ readonly message: string;
7
+ };
8
+ /** The problems a beat sheet lists: missing beats, figures or descriptions, players without controls, idle params. */
9
+ export declare function articleChecks(lesson: AnyLesson, outline: ArticleOutline): ReadonlyArray<ArticleFinding>;
@@ -0,0 +1,49 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
3
+ import type { ArticleLabels } from './article-labels.ts';
4
+ import type { ArticleOutline } from './outline-types.ts';
5
+ import type { LessonProgress, ProgressApi } from './progress-store.ts';
6
+ /** How an article arranges its children: a scrolling essay, one beat at a time, a page for print, or a beat sheet. */
7
+ export type ArticleView = 'article' | 'present' | 'static' | 'sheet';
8
+ /** Typesets TeX into React nodes. The application supplies it, such as one built on KaTeX's MathML output. */
9
+ export type ArticleMath = (tex: string, options: {
10
+ readonly isDisplay: boolean;
11
+ }) => ReactNode;
12
+ /** The challenges of an article, kept so a reader's change can be checked against each of them. */
13
+ export type ChallengeRegistry = {
14
+ readonly add: (id: string, isReached: (values: Readonly<Record<string, LessonValue>>) => boolean) => () => void;
15
+ readonly entries: () => ReadonlyArray<readonly [string, (values: Readonly<Record<string, LessonValue>>) => boolean]>;
16
+ /** The lesson's values as the reader last saw them, so a change is judged against where it started. */
17
+ readonly seen: () => Readonly<Record<string, LessonValue>>;
18
+ readonly remember: (values: Readonly<Record<string, LessonValue>>) => void;
19
+ };
20
+ /** What an `Article` shares with its parts. */
21
+ export type ArticleScope = {
22
+ readonly view: ArticleView;
23
+ readonly title: string;
24
+ readonly lesson: AnyLesson;
25
+ readonly locale: string;
26
+ readonly labels: ArticleLabels;
27
+ readonly math: ArticleMath | undefined;
28
+ readonly outline: ArticleOutline;
29
+ readonly progress: LessonProgress;
30
+ readonly progressApi: ProgressApi;
31
+ readonly challenges: ChallengeRegistry;
32
+ };
33
+ export declare const ArticleContext: import("react").Context<ArticleScope | null>;
34
+ /** The nearest article, or null outside every `Article`. */
35
+ export declare function useArticle(): ArticleScope | null;
36
+ /** The beat a part sits in, and whether the reader is on it now. */
37
+ export type BeatScope = {
38
+ readonly id: string;
39
+ readonly isCurrent: boolean;
40
+ /** The reveal step shown, from 0. */
41
+ readonly step: number;
42
+ /** The scrolly step the present view shows, across the beat's scrollies, or null where scrolling walks them. */
43
+ readonly scrolly: number | null;
44
+ };
45
+ export declare const BeatContext: import("react").Context<BeatScope | null>;
46
+ /** The beat around a part, or null outside every `Beat`. */
47
+ export declare function useBeat(): BeatScope | null;
48
+ /** Creates the list of challenges an article checks on each reader's change. */
49
+ export declare function createChallengeRegistry(initial: Readonly<Record<string, LessonValue>>): ChallengeRegistry;
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ /** The lesson's inline error on a line of its own, for a part that stands between paragraphs, such as a figure. */
3
+ export declare function BlockError({ children }: {
4
+ readonly children: string;
5
+ }): ReactNode;
6
+ /**
7
+ * The error a part shows when it rendered but the article's outline lacks it, because the author wrapped it in a
8
+ * component of their own. The outline reads only the markup the author writes, so it must sit in the children.
9
+ */
10
+ export declare function unlistedText(part: string, id: string): string;
11
+ /** The error a part shows outside every `Article`. */
12
+ export declare function outsideText(part: string): string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The words an article writes around the author's content. The present view's position reads "Beat 2 of 5, step 1":
3
+ * `beat`, the number, `of`, the count, then `step` and its number.
4
+ */
5
+ export type ArticleLabels = {
6
+ readonly contents: string;
7
+ readonly figure: string;
8
+ readonly notes: string;
9
+ readonly note: string;
10
+ readonly references: string;
11
+ readonly backToText: string;
12
+ readonly by: string;
13
+ readonly previous: string;
14
+ readonly next: string;
15
+ readonly beat: string;
16
+ readonly of: string;
17
+ readonly step: string;
18
+ readonly figureDescription: string;
19
+ readonly showAnswer: string;
20
+ readonly sheet: string;
21
+ readonly checks: string;
22
+ readonly noProblems: string;
23
+ readonly opening: string;
24
+ readonly goal: string;
25
+ readonly misconception: string;
26
+ readonly tutorHints: string;
27
+ readonly steps: string;
28
+ readonly progress: string;
29
+ };
30
+ export declare const defaultArticleLabels: {
31
+ readonly contents: 'Contents';
32
+ readonly figure: 'Figure';
33
+ readonly notes: 'Notes';
34
+ readonly note: 'Note';
35
+ readonly references: 'References';
36
+ readonly backToText: 'Back to the text';
37
+ readonly by: 'By';
38
+ readonly previous: 'Previous';
39
+ readonly next: 'Next';
40
+ readonly beat: 'Beat';
41
+ readonly of: 'of';
42
+ readonly step: 'step';
43
+ readonly figureDescription: 'What the figure shows';
44
+ readonly showAnswer: 'Show the answer';
45
+ readonly sheet: 'Beat sheet';
46
+ readonly checks: 'Checks';
47
+ readonly noProblems: 'No problems found.';
48
+ readonly opening: 'Opening';
49
+ readonly goal: 'Goal';
50
+ readonly misconception: 'Misconception';
51
+ readonly tutorHints: 'Tutor hints';
52
+ readonly steps: 'Reveal steps';
53
+ readonly progress: 'Reading progress';
54
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The geometry every article view shares. Essay text keeps a measure of about 68 characters. From `withMargin` the text
3
+ * gains a margin column for asides and wide figures, and from `withContents` the contents list sits beside it.
4
+ */
5
+ export declare const articleLayout: {
6
+ measure: string;
7
+ marginWidth: string;
8
+ marginGap: string;
9
+ marginSpan: string;
10
+ contentsWidth: string;
11
+ withMargin: string;
12
+ withContents: string;
13
+ narrow: string;
14
+ };
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ArticleOutline } from './outline-types.ts';
3
+ /** Reads an article's markup: its beats, figures, notes, references, players and the names each part takes. */
4
+ export declare function articleOutline(children: ReactNode): ArticleOutline;
5
+ /**
6
+ * The lesson value each prediction's answer comes from, by the `Predict` id. Tutor tools take it as their `answers`
7
+ * option, so a value a pending prediction asks about stays out of their results until the reader commits.
8
+ */
9
+ export declare function answerSources(outline: ArticleOutline): Readonly<Record<string, string>>;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../charts/src/index.ts';
3
+ import type { LessonDefinition, LessonParams } from '../lesson/define-lesson.ts';
4
+ import type { LessonProps } from '../lesson/lesson.tsx';
5
+ import type { ArticleMath, ArticleView } from './article-context.ts';
6
+ import type { ArticleLabels } from './article-labels.ts';
7
+ import type { LessonProgress, ProgressChangeDetails } from './progress-store.ts';
8
+ export type ArticleProps<Params extends LessonParams, Derived extends string, Beat extends string> = {
9
+ readonly lesson: LessonDefinition<Params, Derived, Beat>;
10
+ /** The locale every value, date and figure of the article is written in. */
11
+ readonly locale: string;
12
+ readonly title: string;
13
+ readonly authors?: ReadonlyArray<string> | undefined;
14
+ /** The publication date as an ISO date, such as `2026-11-23`. */
15
+ readonly date?: string | undefined;
16
+ /** A sentence or two under the title that says what the reader will learn. */
17
+ readonly summary?: ReactNode;
18
+ /** The lesson's color meaning, declared once: the tone of each id every figure and term of the article shares. */
19
+ readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
20
+ /** How the same children are arranged. Defaults to `article`, the scrolling essay. */
21
+ readonly view?: ArticleView | undefined;
22
+ /** Typesets the source of each `TeX`. Without it, math shows its TeX source. */
23
+ readonly math?: ArticleMath | undefined;
24
+ /** Keeps the lesson's values and the reader's progress in local storage under this key. */
25
+ readonly storageKey?: string | undefined;
26
+ /** The reader's progress, when the application holds it. */
27
+ readonly progress?: LessonProgress | undefined;
28
+ readonly defaultProgress?: LessonProgress | undefined;
29
+ /** Hears each change of the reader's progress. A change an agent makes is refused before it gets here. */
30
+ readonly onProgressChange?: ((progress: LessonProgress, details: ProgressChangeDetails) => void) | undefined;
31
+ readonly labels?: Partial<ArticleLabels> | undefined;
32
+ /** Passed to the `Lesson` the article renders: controlled values, beat and step, or address bar sync. */
33
+ readonly lessonProps?: Omit<LessonProps<Params, Derived, Beat>, 'lesson' | 'locale' | 'storageKey' | 'children'> | undefined;
34
+ /** The essay: `Beat`s, and around them `References` and anything else. */
35
+ readonly children: ReactNode;
36
+ };
37
+ /**
38
+ * An explorable essay on one lesson: a title block, beats of prose and figures, and the exercises, notes and references
39
+ * around them. It renders the `Lesson`, the tone scope and one link scope, and arranges the same children in four
40
+ * views. The reader's progress is the UI SDK primitive `lesson-progress`, which counts only what the reader did.
41
+ */
42
+ export declare function Article<Params extends LessonParams, Derived extends string, Beat extends string>({ lesson, locale, title, authors, date, summary, tones, view, math, storageKey, progress, defaultProgress, onProgressChange, labels, lessonProps, children, }: ArticleProps<Params, Derived, Beat>): ReactNode;