@xom11/whiteboard 0.29.0 → 0.31.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 (93) hide show
  1. package/dist/ai.d.mts +259 -33
  2. package/dist/ai.d.ts +259 -33
  3. package/dist/ai.js +5424 -470
  4. package/dist/ai.js.map +1 -1
  5. package/dist/ai.mjs +4971 -351
  6. package/dist/ai.mjs.map +1 -1
  7. package/dist/catalog.json +5 -5
  8. package/dist/{chunk-V3YJ6JFL.mjs → chunk-44JY2AKC.mjs} +3 -3
  9. package/dist/{chunk-V3YJ6JFL.mjs.map → chunk-44JY2AKC.mjs.map} +1 -1
  10. package/dist/{chunk-GEC2D2EQ.mjs → chunk-BMYC2ILT.mjs} +4 -4
  11. package/dist/{chunk-GEC2D2EQ.mjs.map → chunk-BMYC2ILT.mjs.map} +1 -1
  12. package/dist/{chunk-PPKHCRRE.mjs → chunk-C76SOFXF.mjs} +3 -3
  13. package/dist/{chunk-PPKHCRRE.mjs.map → chunk-C76SOFXF.mjs.map} +1 -1
  14. package/dist/{chunk-IHUFOV7L.mjs → chunk-CH6SFONH.mjs} +15 -3
  15. package/dist/chunk-CH6SFONH.mjs.map +1 -0
  16. package/dist/{chunk-E6EDOPGT.mjs → chunk-DWIEVCGK.mjs} +254 -16
  17. package/dist/chunk-DWIEVCGK.mjs.map +1 -0
  18. package/dist/{chunk-SZDAS7LK.mjs → chunk-IE2GGHNF.mjs} +131 -81
  19. package/dist/chunk-IE2GGHNF.mjs.map +1 -0
  20. package/dist/{chunk-ZTQBUKLJ.mjs → chunk-JJ4FPCBE.mjs} +142 -22
  21. package/dist/chunk-JJ4FPCBE.mjs.map +1 -0
  22. package/dist/{chunk-QRUAEXLR.mjs → chunk-K5BS2H56.mjs} +5 -5
  23. package/dist/{chunk-QRUAEXLR.mjs.map → chunk-K5BS2H56.mjs.map} +1 -1
  24. package/dist/{chunk-BNBOIDO5.mjs → chunk-K7VJU7LQ.mjs} +3 -3
  25. package/dist/{chunk-BNBOIDO5.mjs.map → chunk-K7VJU7LQ.mjs.map} +1 -1
  26. package/dist/{chunk-H22OZYTW.mjs → chunk-KOXOC2FI.mjs} +48 -39
  27. package/dist/chunk-KOXOC2FI.mjs.map +1 -0
  28. package/dist/{chunk-CXHNVYMD.mjs → chunk-KWDBVLST.mjs} +5 -5
  29. package/dist/{chunk-CXHNVYMD.mjs.map → chunk-KWDBVLST.mjs.map} +1 -1
  30. package/dist/{chunk-OQIQNKPQ.mjs → chunk-LTLLQUMN.mjs} +4 -4
  31. package/dist/{chunk-OQIQNKPQ.mjs.map → chunk-LTLLQUMN.mjs.map} +1 -1
  32. package/dist/chunk-QK6OVDLC.mjs +103 -0
  33. package/dist/chunk-QK6OVDLC.mjs.map +1 -0
  34. package/dist/{chunk-QGNU34T7.mjs → chunk-QLQ4MJNO.mjs} +10 -4
  35. package/dist/chunk-QLQ4MJNO.mjs.map +1 -0
  36. package/dist/{chunk-BU5KLO3P.mjs → chunk-T3N4BSJV.mjs} +4 -4
  37. package/dist/{chunk-BU5KLO3P.mjs.map → chunk-T3N4BSJV.mjs.map} +1 -1
  38. package/dist/{chunk-5JM35CXV.mjs → chunk-TMRFSOM7.mjs} +4 -4
  39. package/dist/{chunk-5JM35CXV.mjs.map → chunk-TMRFSOM7.mjs.map} +1 -1
  40. package/dist/geometry-2d.d.mts +1 -1
  41. package/dist/geometry-2d.d.ts +1 -1
  42. package/dist/geometry-2d.js +841 -204
  43. package/dist/geometry-2d.js.map +1 -1
  44. package/dist/geometry-2d.mjs +5 -5
  45. package/dist/geometry-3d.d.mts +1 -1
  46. package/dist/geometry-3d.d.ts +1 -1
  47. package/dist/geometry-3d.js +172 -22
  48. package/dist/geometry-3d.js.map +1 -1
  49. package/dist/geometry-3d.mjs +4 -4
  50. package/dist/graph-2d.d.mts +1 -1
  51. package/dist/graph-2d.d.ts +1 -1
  52. package/dist/graph-2d.js +307 -100
  53. package/dist/graph-2d.js.map +1 -1
  54. package/dist/graph-2d.mjs +7 -7
  55. package/dist/handleExtractProblem-BrDY9ifM.d.mts +58 -0
  56. package/dist/handleExtractProblem-BrDY9ifM.d.ts +58 -0
  57. package/dist/{host-HOSJHQ5H.mjs → host-4FIUNIDQ.mjs} +13 -12
  58. package/dist/host-4FIUNIDQ.mjs.map +1 -0
  59. package/dist/{host-2ISGVO7O.mjs → host-4ZB4XD4S.mjs} +9 -8
  60. package/dist/host-4ZB4XD4S.mjs.map +1 -0
  61. package/dist/{host-ZQCDAT6O.mjs → host-H2IGOKJU.mjs} +3 -3
  62. package/dist/{host-ZQCDAT6O.mjs.map → host-H2IGOKJU.mjs.map} +1 -1
  63. package/dist/{host-HKMZSCIT.mjs → host-KMWP7KBT.mjs} +286 -74
  64. package/dist/host-KMWP7KBT.mjs.map +1 -0
  65. package/dist/index.d.mts +3 -2
  66. package/dist/index.d.ts +3 -2
  67. package/dist/index.js +849 -206
  68. package/dist/index.js.map +1 -1
  69. package/dist/index.mjs +22 -21
  70. package/dist/index.mjs.map +1 -1
  71. package/dist/latex.d.mts +1 -1
  72. package/dist/latex.d.ts +1 -1
  73. package/dist/latex.js +8 -2
  74. package/dist/latex.js.map +1 -1
  75. package/dist/latex.mjs +1 -1
  76. package/dist/render-NMS7OAV6.mjs +10 -0
  77. package/dist/{render-ZX2O2IK7.mjs.map → render-NMS7OAV6.mjs.map} +1 -1
  78. package/dist/serialize-PGHQZEPV.mjs +9 -0
  79. package/dist/{serialize-N4G6RFBB.mjs.map → serialize-PGHQZEPV.mjs.map} +1 -1
  80. package/dist/{types-C3FjpoUi.d.ts → types-tePd94vW.d.mts} +8 -0
  81. package/dist/{types-C3FjpoUi.d.mts → types-tePd94vW.d.ts} +8 -0
  82. package/package.json +2 -1
  83. package/dist/chunk-E6EDOPGT.mjs.map +0 -1
  84. package/dist/chunk-H22OZYTW.mjs.map +0 -1
  85. package/dist/chunk-IHUFOV7L.mjs.map +0 -1
  86. package/dist/chunk-QGNU34T7.mjs.map +0 -1
  87. package/dist/chunk-SZDAS7LK.mjs.map +0 -1
  88. package/dist/chunk-ZTQBUKLJ.mjs.map +0 -1
  89. package/dist/host-2ISGVO7O.mjs.map +0 -1
  90. package/dist/host-HKMZSCIT.mjs.map +0 -1
  91. package/dist/host-HOSJHQ5H.mjs.map +0 -1
  92. package/dist/render-ZX2O2IK7.mjs +0 -10
  93. package/dist/serialize-N4G6RFBB.mjs +0 -9
package/dist/ai.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import { c as State, b as AiFigureUiResult } from './types-C3FjpoUi.js';
1
+ import { c as State, b as AiFigureUiResult } from './types-tePd94vW.js';
2
2
  import { z } from 'zod';
3
+ import { I as ImagePart } from './handleExtractProblem-BrDY9ifM.js';
4
+ export { a as ExtractProblemOptions, b as ExtractProblemOutcome, E as ExtractUiResult, H as HandleExtractProblemOptions, e as extractProblemFromImage, h as handleExtractProblem } from './handleExtractProblem-BrDY9ifM.js';
3
5
  import 'react';
4
6
  import '@excalidraw/excalidraw/element/types';
5
7
 
@@ -34,6 +36,12 @@ type DslPointT = {
34
36
  p1: Name;
35
37
  p2: Name;
36
38
  visible?: boolean;
39
+ } | {
40
+ name: Name;
41
+ kind: 'onPerpBisector';
42
+ p1: Name;
43
+ p2: Name;
44
+ t?: number;
37
45
  } | {
38
46
  name: Name;
39
47
  kind: 'onSegment';
@@ -111,12 +119,18 @@ type DslPointT = {
111
119
  circle: Name;
112
120
  a: Name;
113
121
  b: Name;
114
- notContaining: Name;
122
+ notContaining?: Name;
123
+ containing?: Name;
115
124
  } | {
116
125
  name: Name;
117
126
  kind: 'excenter';
118
127
  vertices: [Name, Name, Name];
119
128
  opposite: Name;
129
+ } | {
130
+ name: Name;
131
+ kind: 'mixtilinearPoint';
132
+ vertices: [Name, Name, Name];
133
+ which: 'center' | 'touch';
120
134
  } | {
121
135
  name: Name;
122
136
  kind: 'reflectPoint';
@@ -274,6 +288,18 @@ declare const AddPointIntentZ: z.ZodObject<{
274
288
  }, {
275
289
  kind: "midpoint";
276
290
  of: string;
291
+ }>, z.ZodObject<{
292
+ kind: z.ZodLiteral<"onPerpBisector">;
293
+ p1: z.ZodString;
294
+ p2: z.ZodString;
295
+ }, "strip", z.ZodTypeAny, {
296
+ kind: "onPerpBisector";
297
+ p1: string;
298
+ p2: string;
299
+ }, {
300
+ kind: "onPerpBisector";
301
+ p1: string;
302
+ p2: string;
277
303
  }>, z.ZodObject<{
278
304
  kind: z.ZodLiteral<"perpFoot">;
279
305
  from: z.ZodString;
@@ -477,19 +503,22 @@ declare const AddPointIntentZ: z.ZodObject<{
477
503
  circle: z.ZodString;
478
504
  a: z.ZodString;
479
505
  b: z.ZodString;
480
- notContaining: z.ZodString;
506
+ notContaining: z.ZodOptional<z.ZodString>;
507
+ containing: z.ZodOptional<z.ZodString>;
481
508
  }, "strip", z.ZodTypeAny, {
482
509
  kind: "arcMidpoint";
483
510
  circle: string;
484
511
  a: string;
485
512
  b: string;
486
- notContaining: string;
513
+ notContaining?: string | undefined;
514
+ containing?: string | undefined;
487
515
  }, {
488
516
  kind: "arcMidpoint";
489
517
  circle: string;
490
518
  a: string;
491
519
  b: string;
492
- notContaining: string;
520
+ notContaining?: string | undefined;
521
+ containing?: string | undefined;
493
522
  }>, z.ZodObject<{
494
523
  kind: z.ZodLiteral<"reflectPoint">;
495
524
  of: z.ZodString;
@@ -526,6 +555,18 @@ declare const AddPointIntentZ: z.ZodObject<{
526
555
  kind: "excenter";
527
556
  opposite: string;
528
557
  of: [string, string, string];
558
+ }>, z.ZodObject<{
559
+ kind: z.ZodLiteral<"mixtilinearPoint">;
560
+ of: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
561
+ which: z.ZodUnion<[z.ZodLiteral<"center">, z.ZodLiteral<"touch">]>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ kind: "mixtilinearPoint";
564
+ which: "center" | "touch";
565
+ of: [string, string, string];
566
+ }, {
567
+ kind: "mixtilinearPoint";
568
+ which: "center" | "touch";
569
+ of: [string, string, string];
529
570
  }>, z.ZodObject<{
530
571
  kind: z.ZodLiteral<"rightAngleViewing">;
531
572
  a: z.ZodString;
@@ -644,6 +685,10 @@ declare const AddPointIntentZ: z.ZodObject<{
644
685
  constraint: {
645
686
  kind: "midpoint";
646
687
  of: string;
688
+ } | {
689
+ kind: "onPerpBisector";
690
+ p1: string;
691
+ p2: string;
647
692
  } | {
648
693
  kind: "perpFoot";
649
694
  onLine: string;
@@ -715,7 +760,8 @@ declare const AddPointIntentZ: z.ZodObject<{
715
760
  circle: string;
716
761
  a: string;
717
762
  b: string;
718
- notContaining: string;
763
+ notContaining?: string | undefined;
764
+ containing?: string | undefined;
719
765
  } | {
720
766
  kind: "reflectPoint";
721
767
  through: string;
@@ -728,6 +774,10 @@ declare const AddPointIntentZ: z.ZodObject<{
728
774
  kind: "excenter";
729
775
  opposite: string;
730
776
  of: [string, string, string];
777
+ } | {
778
+ kind: "mixtilinearPoint";
779
+ which: "center" | "touch";
780
+ of: [string, string, string];
731
781
  } | {
732
782
  kind: "rightAngleViewing";
733
783
  onLine: string;
@@ -762,6 +812,10 @@ declare const AddPointIntentZ: z.ZodObject<{
762
812
  constraint: {
763
813
  kind: "midpoint";
764
814
  of: string;
815
+ } | {
816
+ kind: "onPerpBisector";
817
+ p1: string;
818
+ p2: string;
765
819
  } | {
766
820
  kind: "perpFoot";
767
821
  onLine: string;
@@ -833,7 +887,8 @@ declare const AddPointIntentZ: z.ZodObject<{
833
887
  circle: string;
834
888
  a: string;
835
889
  b: string;
836
- notContaining: string;
890
+ notContaining?: string | undefined;
891
+ containing?: string | undefined;
837
892
  } | {
838
893
  kind: "reflectPoint";
839
894
  through: string;
@@ -846,6 +901,10 @@ declare const AddPointIntentZ: z.ZodObject<{
846
901
  kind: "excenter";
847
902
  opposite: string;
848
903
  of: [string, string, string];
904
+ } | {
905
+ kind: "mixtilinearPoint";
906
+ which: "center" | "touch";
907
+ of: [string, string, string];
849
908
  } | {
850
909
  kind: "rightAngleViewing";
851
910
  onLine: string;
@@ -954,6 +1013,18 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
954
1013
  }, {
955
1014
  kind: "midpoint";
956
1015
  of: string;
1016
+ }>, z.ZodObject<{
1017
+ kind: z.ZodLiteral<"onPerpBisector">;
1018
+ p1: z.ZodString;
1019
+ p2: z.ZodString;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ kind: "onPerpBisector";
1022
+ p1: string;
1023
+ p2: string;
1024
+ }, {
1025
+ kind: "onPerpBisector";
1026
+ p1: string;
1027
+ p2: string;
957
1028
  }>, z.ZodObject<{
958
1029
  kind: z.ZodLiteral<"perpFoot">;
959
1030
  from: z.ZodString;
@@ -1157,19 +1228,22 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1157
1228
  circle: z.ZodString;
1158
1229
  a: z.ZodString;
1159
1230
  b: z.ZodString;
1160
- notContaining: z.ZodString;
1231
+ notContaining: z.ZodOptional<z.ZodString>;
1232
+ containing: z.ZodOptional<z.ZodString>;
1161
1233
  }, "strip", z.ZodTypeAny, {
1162
1234
  kind: "arcMidpoint";
1163
1235
  circle: string;
1164
1236
  a: string;
1165
1237
  b: string;
1166
- notContaining: string;
1238
+ notContaining?: string | undefined;
1239
+ containing?: string | undefined;
1167
1240
  }, {
1168
1241
  kind: "arcMidpoint";
1169
1242
  circle: string;
1170
1243
  a: string;
1171
1244
  b: string;
1172
- notContaining: string;
1245
+ notContaining?: string | undefined;
1246
+ containing?: string | undefined;
1173
1247
  }>, z.ZodObject<{
1174
1248
  kind: z.ZodLiteral<"reflectPoint">;
1175
1249
  of: z.ZodString;
@@ -1206,6 +1280,18 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1206
1280
  kind: "excenter";
1207
1281
  opposite: string;
1208
1282
  of: [string, string, string];
1283
+ }>, z.ZodObject<{
1284
+ kind: z.ZodLiteral<"mixtilinearPoint">;
1285
+ of: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
1286
+ which: z.ZodUnion<[z.ZodLiteral<"center">, z.ZodLiteral<"touch">]>;
1287
+ }, "strip", z.ZodTypeAny, {
1288
+ kind: "mixtilinearPoint";
1289
+ which: "center" | "touch";
1290
+ of: [string, string, string];
1291
+ }, {
1292
+ kind: "mixtilinearPoint";
1293
+ which: "center" | "touch";
1294
+ of: [string, string, string];
1209
1295
  }>, z.ZodObject<{
1210
1296
  kind: z.ZodLiteral<"rightAngleViewing">;
1211
1297
  a: z.ZodString;
@@ -1324,6 +1410,10 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1324
1410
  constraint: {
1325
1411
  kind: "midpoint";
1326
1412
  of: string;
1413
+ } | {
1414
+ kind: "onPerpBisector";
1415
+ p1: string;
1416
+ p2: string;
1327
1417
  } | {
1328
1418
  kind: "perpFoot";
1329
1419
  onLine: string;
@@ -1395,7 +1485,8 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1395
1485
  circle: string;
1396
1486
  a: string;
1397
1487
  b: string;
1398
- notContaining: string;
1488
+ notContaining?: string | undefined;
1489
+ containing?: string | undefined;
1399
1490
  } | {
1400
1491
  kind: "reflectPoint";
1401
1492
  through: string;
@@ -1408,6 +1499,10 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1408
1499
  kind: "excenter";
1409
1500
  opposite: string;
1410
1501
  of: [string, string, string];
1502
+ } | {
1503
+ kind: "mixtilinearPoint";
1504
+ which: "center" | "touch";
1505
+ of: [string, string, string];
1411
1506
  } | {
1412
1507
  kind: "rightAngleViewing";
1413
1508
  onLine: string;
@@ -1442,6 +1537,10 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1442
1537
  constraint: {
1443
1538
  kind: "midpoint";
1444
1539
  of: string;
1540
+ } | {
1541
+ kind: "onPerpBisector";
1542
+ p1: string;
1543
+ p2: string;
1445
1544
  } | {
1446
1545
  kind: "perpFoot";
1447
1546
  onLine: string;
@@ -1513,7 +1612,8 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1513
1612
  circle: string;
1514
1613
  a: string;
1515
1614
  b: string;
1516
- notContaining: string;
1615
+ notContaining?: string | undefined;
1616
+ containing?: string | undefined;
1517
1617
  } | {
1518
1618
  kind: "reflectPoint";
1519
1619
  through: string;
@@ -1526,6 +1626,10 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1526
1626
  kind: "excenter";
1527
1627
  opposite: string;
1528
1628
  of: [string, string, string];
1629
+ } | {
1630
+ kind: "mixtilinearPoint";
1631
+ which: "center" | "touch";
1632
+ of: [string, string, string];
1529
1633
  } | {
1530
1634
  kind: "rightAngleViewing";
1531
1635
  onLine: string;
@@ -1604,7 +1708,7 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1604
1708
  }>, z.ZodObject<{
1605
1709
  op: z.ZodLiteral<"draw-line">;
1606
1710
  name: z.ZodString;
1607
- kind: z.ZodEnum<["perpThrough", "parallelThrough", "tangentAt", "tangentFromExt", "angleBisector", "lineThrough", "radicalAxis"]>;
1711
+ kind: z.ZodEnum<["perpThrough", "parallelThrough", "tangentAt", "tangentFromExt", "angleBisector", "lineThrough", "radicalAxis", "perpBisector"]>;
1608
1712
  through: z.ZodOptional<z.ZodString>;
1609
1713
  to: z.ZodOptional<z.ZodString>;
1610
1714
  from: z.ZodOptional<z.ZodString>;
@@ -1617,7 +1721,7 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1617
1721
  vertex: z.ZodOptional<z.ZodString>;
1618
1722
  p2: z.ZodOptional<z.ZodString>;
1619
1723
  }, "strip", z.ZodTypeAny, {
1620
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
1724
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
1621
1725
  name: string;
1622
1726
  op: "draw-line";
1623
1727
  circle?: string | undefined;
@@ -1632,7 +1736,7 @@ declare const IntentZ: z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
1632
1736
  which?: "first" | "second" | "both" | undefined;
1633
1737
  to?: string | undefined;
1634
1738
  }, {
1635
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
1739
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
1636
1740
  name: string;
1637
1741
  op: "draw-line";
1638
1742
  circle?: string | undefined;
@@ -1697,6 +1801,18 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
1697
1801
  }, {
1698
1802
  kind: "midpoint";
1699
1803
  of: string;
1804
+ }>, z.ZodObject<{
1805
+ kind: z.ZodLiteral<"onPerpBisector">;
1806
+ p1: z.ZodString;
1807
+ p2: z.ZodString;
1808
+ }, "strip", z.ZodTypeAny, {
1809
+ kind: "onPerpBisector";
1810
+ p1: string;
1811
+ p2: string;
1812
+ }, {
1813
+ kind: "onPerpBisector";
1814
+ p1: string;
1815
+ p2: string;
1700
1816
  }>, z.ZodObject<{
1701
1817
  kind: z.ZodLiteral<"perpFoot">;
1702
1818
  from: z.ZodString;
@@ -1900,19 +2016,22 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
1900
2016
  circle: z.ZodString;
1901
2017
  a: z.ZodString;
1902
2018
  b: z.ZodString;
1903
- notContaining: z.ZodString;
2019
+ notContaining: z.ZodOptional<z.ZodString>;
2020
+ containing: z.ZodOptional<z.ZodString>;
1904
2021
  }, "strip", z.ZodTypeAny, {
1905
2022
  kind: "arcMidpoint";
1906
2023
  circle: string;
1907
2024
  a: string;
1908
2025
  b: string;
1909
- notContaining: string;
2026
+ notContaining?: string | undefined;
2027
+ containing?: string | undefined;
1910
2028
  }, {
1911
2029
  kind: "arcMidpoint";
1912
2030
  circle: string;
1913
2031
  a: string;
1914
2032
  b: string;
1915
- notContaining: string;
2033
+ notContaining?: string | undefined;
2034
+ containing?: string | undefined;
1916
2035
  }>, z.ZodObject<{
1917
2036
  kind: z.ZodLiteral<"reflectPoint">;
1918
2037
  of: z.ZodString;
@@ -1949,6 +2068,18 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
1949
2068
  kind: "excenter";
1950
2069
  opposite: string;
1951
2070
  of: [string, string, string];
2071
+ }>, z.ZodObject<{
2072
+ kind: z.ZodLiteral<"mixtilinearPoint">;
2073
+ of: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodString], null>;
2074
+ which: z.ZodUnion<[z.ZodLiteral<"center">, z.ZodLiteral<"touch">]>;
2075
+ }, "strip", z.ZodTypeAny, {
2076
+ kind: "mixtilinearPoint";
2077
+ which: "center" | "touch";
2078
+ of: [string, string, string];
2079
+ }, {
2080
+ kind: "mixtilinearPoint";
2081
+ which: "center" | "touch";
2082
+ of: [string, string, string];
1952
2083
  }>, z.ZodObject<{
1953
2084
  kind: z.ZodLiteral<"rightAngleViewing">;
1954
2085
  a: z.ZodString;
@@ -2067,6 +2198,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2067
2198
  constraint: {
2068
2199
  kind: "midpoint";
2069
2200
  of: string;
2201
+ } | {
2202
+ kind: "onPerpBisector";
2203
+ p1: string;
2204
+ p2: string;
2070
2205
  } | {
2071
2206
  kind: "perpFoot";
2072
2207
  onLine: string;
@@ -2138,7 +2273,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2138
2273
  circle: string;
2139
2274
  a: string;
2140
2275
  b: string;
2141
- notContaining: string;
2276
+ notContaining?: string | undefined;
2277
+ containing?: string | undefined;
2142
2278
  } | {
2143
2279
  kind: "reflectPoint";
2144
2280
  through: string;
@@ -2151,6 +2287,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2151
2287
  kind: "excenter";
2152
2288
  opposite: string;
2153
2289
  of: [string, string, string];
2290
+ } | {
2291
+ kind: "mixtilinearPoint";
2292
+ which: "center" | "touch";
2293
+ of: [string, string, string];
2154
2294
  } | {
2155
2295
  kind: "rightAngleViewing";
2156
2296
  onLine: string;
@@ -2185,6 +2325,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2185
2325
  constraint: {
2186
2326
  kind: "midpoint";
2187
2327
  of: string;
2328
+ } | {
2329
+ kind: "onPerpBisector";
2330
+ p1: string;
2331
+ p2: string;
2188
2332
  } | {
2189
2333
  kind: "perpFoot";
2190
2334
  onLine: string;
@@ -2256,7 +2400,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2256
2400
  circle: string;
2257
2401
  a: string;
2258
2402
  b: string;
2259
- notContaining: string;
2403
+ notContaining?: string | undefined;
2404
+ containing?: string | undefined;
2260
2405
  } | {
2261
2406
  kind: "reflectPoint";
2262
2407
  through: string;
@@ -2269,6 +2414,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2269
2414
  kind: "excenter";
2270
2415
  opposite: string;
2271
2416
  of: [string, string, string];
2417
+ } | {
2418
+ kind: "mixtilinearPoint";
2419
+ which: "center" | "touch";
2420
+ of: [string, string, string];
2272
2421
  } | {
2273
2422
  kind: "rightAngleViewing";
2274
2423
  onLine: string;
@@ -2347,7 +2496,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2347
2496
  }>, z.ZodObject<{
2348
2497
  op: z.ZodLiteral<"draw-line">;
2349
2498
  name: z.ZodString;
2350
- kind: z.ZodEnum<["perpThrough", "parallelThrough", "tangentAt", "tangentFromExt", "angleBisector", "lineThrough", "radicalAxis"]>;
2499
+ kind: z.ZodEnum<["perpThrough", "parallelThrough", "tangentAt", "tangentFromExt", "angleBisector", "lineThrough", "radicalAxis", "perpBisector"]>;
2351
2500
  through: z.ZodOptional<z.ZodString>;
2352
2501
  to: z.ZodOptional<z.ZodString>;
2353
2502
  from: z.ZodOptional<z.ZodString>;
@@ -2360,7 +2509,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2360
2509
  vertex: z.ZodOptional<z.ZodString>;
2361
2510
  p2: z.ZodOptional<z.ZodString>;
2362
2511
  }, "strip", z.ZodTypeAny, {
2363
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2512
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2364
2513
  name: string;
2365
2514
  op: "draw-line";
2366
2515
  circle?: string | undefined;
@@ -2375,7 +2524,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2375
2524
  which?: "first" | "second" | "both" | undefined;
2376
2525
  to?: string | undefined;
2377
2526
  }, {
2378
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2527
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2379
2528
  name: string;
2380
2529
  op: "draw-line";
2381
2530
  circle?: string | undefined;
@@ -2416,6 +2565,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2416
2565
  constraint: {
2417
2566
  kind: "midpoint";
2418
2567
  of: string;
2568
+ } | {
2569
+ kind: "onPerpBisector";
2570
+ p1: string;
2571
+ p2: string;
2419
2572
  } | {
2420
2573
  kind: "perpFoot";
2421
2574
  onLine: string;
@@ -2487,7 +2640,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2487
2640
  circle: string;
2488
2641
  a: string;
2489
2642
  b: string;
2490
- notContaining: string;
2643
+ notContaining?: string | undefined;
2644
+ containing?: string | undefined;
2491
2645
  } | {
2492
2646
  kind: "reflectPoint";
2493
2647
  through: string;
@@ -2500,6 +2654,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2500
2654
  kind: "excenter";
2501
2655
  opposite: string;
2502
2656
  of: [string, string, string];
2657
+ } | {
2658
+ kind: "mixtilinearPoint";
2659
+ which: "center" | "touch";
2660
+ of: [string, string, string];
2503
2661
  } | {
2504
2662
  kind: "rightAngleViewing";
2505
2663
  onLine: string;
@@ -2546,7 +2704,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2546
2704
  triangle?: [string, string, string] | undefined;
2547
2705
  endpoints?: [string, string] | undefined;
2548
2706
  } | {
2549
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2707
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2550
2708
  name: string;
2551
2709
  op: "draw-line";
2552
2710
  circle?: string | undefined;
@@ -2578,6 +2736,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2578
2736
  constraint: {
2579
2737
  kind: "midpoint";
2580
2738
  of: string;
2739
+ } | {
2740
+ kind: "onPerpBisector";
2741
+ p1: string;
2742
+ p2: string;
2581
2743
  } | {
2582
2744
  kind: "perpFoot";
2583
2745
  onLine: string;
@@ -2649,7 +2811,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2649
2811
  circle: string;
2650
2812
  a: string;
2651
2813
  b: string;
2652
- notContaining: string;
2814
+ notContaining?: string | undefined;
2815
+ containing?: string | undefined;
2653
2816
  } | {
2654
2817
  kind: "reflectPoint";
2655
2818
  through: string;
@@ -2662,6 +2825,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2662
2825
  kind: "excenter";
2663
2826
  opposite: string;
2664
2827
  of: [string, string, string];
2828
+ } | {
2829
+ kind: "mixtilinearPoint";
2830
+ which: "center" | "touch";
2831
+ of: [string, string, string];
2665
2832
  } | {
2666
2833
  kind: "rightAngleViewing";
2667
2834
  onLine: string;
@@ -2708,7 +2875,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2708
2875
  triangle?: [string, string, string] | undefined;
2709
2876
  endpoints?: [string, string] | undefined;
2710
2877
  } | {
2711
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2878
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2712
2879
  name: string;
2713
2880
  op: "draw-line";
2714
2881
  circle?: string | undefined;
@@ -2740,6 +2907,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2740
2907
  constraint: {
2741
2908
  kind: "midpoint";
2742
2909
  of: string;
2910
+ } | {
2911
+ kind: "onPerpBisector";
2912
+ p1: string;
2913
+ p2: string;
2743
2914
  } | {
2744
2915
  kind: "perpFoot";
2745
2916
  onLine: string;
@@ -2811,7 +2982,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2811
2982
  circle: string;
2812
2983
  a: string;
2813
2984
  b: string;
2814
- notContaining: string;
2985
+ notContaining?: string | undefined;
2986
+ containing?: string | undefined;
2815
2987
  } | {
2816
2988
  kind: "reflectPoint";
2817
2989
  through: string;
@@ -2824,6 +2996,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2824
2996
  kind: "excenter";
2825
2997
  opposite: string;
2826
2998
  of: [string, string, string];
2999
+ } | {
3000
+ kind: "mixtilinearPoint";
3001
+ which: "center" | "touch";
3002
+ of: [string, string, string];
2827
3003
  } | {
2828
3004
  kind: "rightAngleViewing";
2829
3005
  onLine: string;
@@ -2870,7 +3046,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2870
3046
  triangle?: [string, string, string] | undefined;
2871
3047
  endpoints?: [string, string] | undefined;
2872
3048
  } | {
2873
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
3049
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
2874
3050
  name: string;
2875
3051
  op: "draw-line";
2876
3052
  circle?: string | undefined;
@@ -2902,6 +3078,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2902
3078
  constraint: {
2903
3079
  kind: "midpoint";
2904
3080
  of: string;
3081
+ } | {
3082
+ kind: "onPerpBisector";
3083
+ p1: string;
3084
+ p2: string;
2905
3085
  } | {
2906
3086
  kind: "perpFoot";
2907
3087
  onLine: string;
@@ -2973,7 +3153,8 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2973
3153
  circle: string;
2974
3154
  a: string;
2975
3155
  b: string;
2976
- notContaining: string;
3156
+ notContaining?: string | undefined;
3157
+ containing?: string | undefined;
2977
3158
  } | {
2978
3159
  kind: "reflectPoint";
2979
3160
  through: string;
@@ -2986,6 +3167,10 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
2986
3167
  kind: "excenter";
2987
3168
  opposite: string;
2988
3169
  of: [string, string, string];
3170
+ } | {
3171
+ kind: "mixtilinearPoint";
3172
+ which: "center" | "touch";
3173
+ of: [string, string, string];
2989
3174
  } | {
2990
3175
  kind: "rightAngleViewing";
2991
3176
  onLine: string;
@@ -3032,7 +3217,7 @@ declare const IntentEnvelopeZ: z.ZodEffects<z.ZodObject<{
3032
3217
  triangle?: [string, string, string] | undefined;
3033
3218
  endpoints?: [string, string] | undefined;
3034
3219
  } | {
3035
- kind: "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
3220
+ kind: "perpBisector" | "angleBisector" | "lineThrough" | "radicalAxis" | "perpThrough" | "parallelThrough" | "tangentAt" | "tangentFromExt";
3036
3221
  name: string;
3037
3222
  op: "draw-line";
3038
3223
  circle?: string | undefined;
@@ -3095,6 +3280,13 @@ interface IntentSuccessResult {
3095
3280
  verify: VerifyReport;
3096
3281
  usage: IntentTokenUsage;
3097
3282
  provider: string;
3283
+ /**
3284
+ * Có mặt khi đây là PARTIAL render: rule base chỉ dựng được một phần đề (phần
3285
+ * chắc chắn đúng), `message` là to-do list cho user tự dựng nốt. Vắng = full.
3286
+ */
3287
+ partial?: {
3288
+ message: string;
3289
+ };
3098
3290
  }
3099
3291
  interface IntentFailureResult {
3100
3292
  ok: false;
@@ -3265,6 +3457,10 @@ type AiFigureIntentUiResult = {
3265
3457
  inputTokens: number;
3266
3458
  outputTokens: number;
3267
3459
  };
3460
+ /** Có mặt khi partial render: `message` là to-do list cho user tự dựng nốt. */
3461
+ partial?: {
3462
+ message: string;
3463
+ };
3268
3464
  } | {
3269
3465
  kind: 'refused';
3270
3466
  message: string;
@@ -3307,7 +3503,7 @@ type TryDeterministicResult = {
3307
3503
  detail?: string;
3308
3504
  coverage?: CoverageReport;
3309
3505
  };
3310
- declare function tryDeterministicFigure(problem: string): TryDeterministicResult;
3506
+ declare function tryDeterministicFigure(rawProblem: string): TryDeterministicResult;
3311
3507
 
3312
3508
  interface PartialDeterministicResult {
3313
3509
  /** Intent deterministic từ các clause đã được rule claim (deduped). */
@@ -3337,4 +3533,34 @@ declare function tryPartialDeterministic(problem: string): PartialDeterministicR
3337
3533
  */
3338
3534
  declare function mergeIntents(det: readonly IntentT[], llm: readonly IntentT[]): IntentT[];
3339
3535
 
3340
- export { type AddPointIntentT, type AiFigureIntentUiResult, type ConnectIntentT, type DeterministicFigure, type DrawCircleIntentT, type DrawShapeIntentT, type FigureEnvelopeT, FigureEnvelopeZ, type GenerateIntentOptions, type HandleGenerateFigureInput, type HandleGenerateFigureIntentInput, type HandleGenerateFigureIntentOptions, type HandleGenerateFigureOptions, IntentBuilderError, type IntentEnvelopeT, IntentEnvelopeZ, type IntentFailureResult, type IntentGenerateResult, type IntentSuccessResult, type IntentT, IntentZ, type PartialDeterministicResult, type TryDeterministicResult, type VerifyIssue, type VerifyReport, buildIntentSystemPrompt, compareIntents, envelopeBuildDsl, envelopeIntentList, envelopeJsonSchema, generateFigureIntent, handleGenerateFigure, handleGenerateFigureIntent, intentEnvelopeJsonSchema, intentsToDsl, mergeIntents, tryDeterministicFigure, tryPartialDeterministic, verifyGeometry };
3536
+ declare const ALLOWED_TYPES: readonly ["image/png", "image/jpeg", "image/webp"];
3537
+ type AllowedType = (typeof ALLOWED_TYPES)[number];
3538
+ type ValidationResult = {
3539
+ ok: true;
3540
+ mediaType: AllowedType;
3541
+ } | {
3542
+ ok: false;
3543
+ code: 'invalid-format' | 'too-large';
3544
+ message: string;
3545
+ };
3546
+ declare function inferMediaType(file: File): AllowedType | null;
3547
+ declare function validateFile(file: File): ValidationResult;
3548
+ /**
3549
+ * Convert File → ImagePart. Auto-downscale nếu max edge > MAX_EDGE_PX.
3550
+ * Throws nếu file invalid hoặc decode fail.
3551
+ */
3552
+ declare function fileToImagePart(file: File): Promise<ImagePart>;
3553
+
3554
+ interface TesseractOcrOptions {
3555
+ /** Tesseract language code. Default 'vie+eng' cho đề toán VN. */
3556
+ lang?: string;
3557
+ signal?: AbortSignal;
3558
+ }
3559
+ interface TesseractOcrResult {
3560
+ text: string;
3561
+ /** Confidence 0–100 (Tesseract scale). */
3562
+ confidence: number;
3563
+ }
3564
+ declare function runTesseractOcr(image: ImagePart, opts?: TesseractOcrOptions): Promise<TesseractOcrResult>;
3565
+
3566
+ export { type AddPointIntentT, type AiFigureIntentUiResult, type ConnectIntentT, type DeterministicFigure, type DrawCircleIntentT, type DrawShapeIntentT, type FigureEnvelopeT, FigureEnvelopeZ, type GenerateIntentOptions, type HandleGenerateFigureInput, type HandleGenerateFigureIntentInput, type HandleGenerateFigureIntentOptions, type HandleGenerateFigureOptions, ImagePart, IntentBuilderError, type IntentEnvelopeT, IntentEnvelopeZ, type IntentFailureResult, type IntentGenerateResult, type IntentSuccessResult, type IntentT, IntentZ, type PartialDeterministicResult, type TryDeterministicResult, type ValidationResult, type VerifyIssue, type VerifyReport, buildIntentSystemPrompt, compareIntents, envelopeBuildDsl, envelopeIntentList, envelopeJsonSchema, fileToImagePart, generateFigureIntent, handleGenerateFigure, handleGenerateFigureIntent, inferMediaType, intentEnvelopeJsonSchema, intentsToDsl, mergeIntents, runTesseractOcr, tryDeterministicFigure, tryPartialDeterministic, validateFile, verifyGeometry };