@altnovatrail/contracts 0.18.43 → 0.19.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.
@@ -3,9 +3,10 @@
3
3
  /* eslint-disable */
4
4
 
5
5
  // The checking of an attempt in the contract between `app` and `api`: the submission of the work
6
- // and the verdict, the tutor's words and marks, hints, the solution shown, and "Done" on a task with
7
- // a rubric. What each message means, what never reaches the device, and what a repeat with the same
8
- // idempotency key answers are the rules of contracts/README.md, section 15.
6
+ // and the verdict, the tutor's words and marks, hints, the solution shown, and "Done" on a task
7
+ // with a rubric — of a task of a module, and of a task from the learner's paper, whose attempts
8
+ // `PaperService` begins. What each message means, what never reaches the device, and what a repeat
9
+ // with the same idempotency key answers are the rules of contracts/README.md, section 15.
9
10
 
10
11
  import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
11
12
  import type { Message } from "@bufbuild/protobuf";
@@ -126,14 +127,15 @@ export declare type SubmitWorkResponse = Message<"novatrail.api.v1.SubmitWorkRes
126
127
  wrongAnswers: number;
127
128
 
128
129
  /**
129
- * The solved task, when every item is correct and the attempt is closed `CLOSE_REASON_CORRECT`.
130
+ * The solved task, when every item is correct and the attempt is closed `CLOSE_REASON_CORRECT`:
131
+ * empty on a task from paper, which shows neither its key nor a solution (R05).
130
132
  *
131
133
  * @generated from field: novatrail.api.v1.SolvedTask solved = 4;
132
134
  */
133
135
  solved?: SolvedTask | undefined;
134
136
 
135
137
  /**
136
- * What comes next, beside `solved`.
138
+ * What comes next, beside `solved`: absent on a task from paper.
137
139
  *
138
140
  * @generated from field: novatrail.api.v1.Next next = 5;
139
141
  */
@@ -291,9 +293,9 @@ export declare type DoneRequest = Message<"novatrail.api.v1.DoneRequest"> & {
291
293
  attemptId: string;
292
294
 
293
295
  /**
294
- * The provider of the learner's own key, by its code in the admission table, without the key: with
295
- * a profile of its owner that checks the tasks by its own key, so that the engine's choice in
296
- * `next` goes by that route, though the request calls no AI. Empty on platform AI (R84; R99).
296
+ * The provider of the learner's own key, by its code in the admission table, without the key:
297
+ * with a profile of its owner that checks the tasks by its own key, so that the engine's choice
298
+ * in `next` goes by that route, though the request calls no AI. Empty on platform AI (R84; R99).
297
299
  *
298
300
  * @generated from field: string own_key_provider = 3;
299
301
  */
@@ -611,8 +613,8 @@ export declare type ExplainDifferentlyResponse = Message<"novatrail.api.v1.Expla
611
613
  words: string;
612
614
 
613
615
  /**
614
- * What the call came to, when the words are not the model's: a failure of AI, a refusal of the own
615
- * key, or `CAUSE_NO_OTHER_WORDS` when they are the words the learner reads already.
616
+ * What the call came to, when the words are not the model's: a failure of AI, a refusal of the
617
+ * own key, or `CAUSE_NO_OTHER_WORDS` when they are the words the learner reads already.
616
618
  *
617
619
  * @generated from field: novatrail.api.v1.Outcome outcome = 2;
618
620
  */
@@ -652,6 +654,98 @@ export declare type GetHintRequest = Message<"novatrail.api.v1.GetHintRequest">
652
654
  */
653
655
  export declare const GetHintRequestSchema: GenMessage<GetHintRequest>;
654
656
 
657
+ /**
658
+ * The opening question of a task from paper.
659
+ *
660
+ * @generated from message novatrail.api.v1.GetOpeningWordsRequest
661
+ */
662
+ export declare type GetOpeningWordsRequest = Message<"novatrail.api.v1.GetOpeningWordsRequest"> & {
663
+ /**
664
+ * The profile whose attempt it is.
665
+ *
666
+ * @generated from field: string profile_id = 1;
667
+ */
668
+ profileId: string;
669
+
670
+ /**
671
+ * The attempt, of a task from paper.
672
+ *
673
+ * @generated from field: string attempt_id = 2;
674
+ */
675
+ attemptId: string;
676
+
677
+ /**
678
+ * The idempotency key of this action of the learner.
679
+ *
680
+ * @generated from field: string idempotency_key = 3;
681
+ */
682
+ idempotencyKey: string;
683
+
684
+ /**
685
+ * The task's crop without the learner's strokes, as `PaperWork.statement`: a JPEG or a PNG of at
686
+ * most 4 MiB.
687
+ *
688
+ * @generated from field: bytes statement = 4;
689
+ */
690
+ statement: Uint8Array;
691
+
692
+ /**
693
+ * The learner's own key and its provider: with a profile of its owner.
694
+ *
695
+ * @generated from field: novatrail.api.v1.OwnKey own_key = 5;
696
+ */
697
+ ownKey?: OwnKey | undefined;
698
+
699
+ /**
700
+ * The offset of the device's clock from UTC, in minutes: with a request on platform AI alone.
701
+ *
702
+ * @generated from field: optional int32 clock_offset_minutes = 6;
703
+ */
704
+ clockOffsetMinutes?: number | undefined;
705
+ };
706
+
707
+ /**
708
+ * Describes the message novatrail.api.v1.GetOpeningWordsRequest.
709
+ * Use `create(GetOpeningWordsRequestSchema)` to create a new message.
710
+ */
711
+ export declare const GetOpeningWordsRequestSchema: GenMessage<GetOpeningWordsRequest>;
712
+
713
+ /**
714
+ * The tutor's opening question.
715
+ *
716
+ * @generated from message novatrail.api.v1.GetOpeningWordsResponse
717
+ */
718
+ export declare type GetOpeningWordsResponse = Message<"novatrail.api.v1.GetOpeningWordsResponse"> & {
719
+ /**
720
+ * The tutor's words, whole, once they passed the leak check and the form check, or the opening
721
+ * question's fallback text.
722
+ *
723
+ * @generated from field: string words = 1;
724
+ */
725
+ words: string;
726
+
727
+ /**
728
+ * Why the words are the fallback text, when a call of AI came to an outcome. Absent when the
729
+ * model's words came, or when they failed a check.
730
+ *
731
+ * @generated from field: novatrail.api.v1.Outcome outcome = 2;
732
+ */
733
+ outcome?: Outcome | undefined;
734
+
735
+ /**
736
+ * The answer of a repeat, or of a request once the attempt keeps the words: no AI was called.
737
+ *
738
+ * @generated from field: bool repeated = 3;
739
+ */
740
+ repeated: boolean;
741
+ };
742
+
743
+ /**
744
+ * Describes the message novatrail.api.v1.GetOpeningWordsResponse.
745
+ * Use `create(GetOpeningWordsResponseSchema)` to create a new message.
746
+ */
747
+ export declare const GetOpeningWordsResponseSchema: GenMessage<GetOpeningWordsResponse>;
748
+
655
749
  /**
656
750
  * What a hint asked for gives. "What is known and what to find" `app` shows from the open view of
657
751
  * the task: they are open, and the server records nothing of them.
@@ -660,8 +754,8 @@ export declare const GetHintRequestSchema: GenMessage<GetHintRequest>;
660
754
  */
661
755
  export declare type GetHintResponse = Message<"novatrail.api.v1.GetHintResponse"> & {
662
756
  /**
663
- * Before the first wrong answer, and on a task with a rubric, the task's techniques; after it, the
664
- * current rung's words.
757
+ * Before the first wrong answer, and on a task with a rubric, the task's techniques; after it,
758
+ * the current rung's words.
665
759
  *
666
760
  * @generated from oneof novatrail.api.v1.GetHintResponse.hint
667
761
  */
@@ -838,9 +932,9 @@ export declare type ShowSolutionRequest = Message<"novatrail.api.v1.ShowSolution
838
932
  action: Action;
839
933
 
840
934
  /**
841
- * The provider of the learner's own key, by its code in the admission table, without the key: with
842
- * a profile of its owner that checks the tasks by its own key, so that the engine's choice in
843
- * `next` goes by that route, though the request calls no AI. Empty on platform AI (R84; R99).
935
+ * The provider of the learner's own key, by its code in the admission table, without the key:
936
+ * with a profile of its owner that checks the tasks by its own key, so that the engine's choice
937
+ * in `next` goes by that route, though the request calls no AI. Empty on platform AI (R84; R99).
844
938
  *
845
939
  * @generated from field: string own_key_provider = 5;
846
940
  */
@@ -979,9 +1073,10 @@ export declare type ReportProblemResponse = Message<"novatrail.api.v1.ReportProb
979
1073
  export declare const ReportProblemResponseSchema: GenMessage<ReportProblemResponse>;
980
1074
 
981
1075
  /**
982
- * The work for checking: a sheet's crop, or the crops of a workbook's filled boxes. Nothing of the
983
- * writing history, of the context of the submission, of the groups of strokes or of the text of an
984
- * item goes with it.
1076
+ * The work for checking: a sheet's crop, the crops of a workbook's filled boxes, or the work of a
1077
+ * task from paper. Nothing of the writing history, of the context of the submission, of the groups
1078
+ * of strokes or of the text of an item goes with it. An attempt of a task from paper takes `paper`
1079
+ * alone, and an attempt of a task of a module never takes it: another gets `invalid_argument`.
985
1080
  *
986
1081
  * @generated from message novatrail.api.v1.Work
987
1082
  */
@@ -1007,6 +1102,14 @@ export declare type Work = Message<"novatrail.api.v1.Work"> & {
1007
1102
  */
1008
1103
  value: WorkbookWork;
1009
1104
  case: "workbook";
1105
+ } | {
1106
+ /**
1107
+ * A dotted sheet under the crop of a task from paper, as tracing paper (R162).
1108
+ *
1109
+ * @generated from field: novatrail.api.v1.PaperWork paper = 3;
1110
+ */
1111
+ value: PaperWork;
1112
+ case: "paper";
1010
1113
  } | { case: undefined; value?: undefined };
1011
1114
  };
1012
1115
 
@@ -1057,6 +1160,38 @@ export declare type WorkbookWork = Message<"novatrail.api.v1.WorkbookWork"> & {
1057
1160
  */
1058
1161
  export declare const WorkbookWorkSchema: GenMessage<WorkbookWork>;
1059
1162
 
1163
+ /**
1164
+ * The work of a task from paper: the task's crop, by which `api` derives the key and the analysis
1165
+ * reads the statement, and the crop of what the learner wrote, which the readers read. Every
1166
+ * request that carries the work of a task from paper carries both: the server keeps no crop.
1167
+ *
1168
+ * @generated from message novatrail.api.v1.PaperWork
1169
+ */
1170
+ export declare type PaperWork = Message<"novatrail.api.v1.PaperWork"> & {
1171
+ /**
1172
+ * The task's crop as `app` cut it from the photo of the page by its frame, without the learner's
1173
+ * strokes: a JPEG or a PNG of at most 4 MiB.
1174
+ *
1175
+ * @generated from field: bytes statement = 1;
1176
+ */
1177
+ statement: Uint8Array;
1178
+
1179
+ /**
1180
+ * The PNG of the crop of the work, without its `sheet_box`: the tracing paper at its place, with
1181
+ * the strokes on it, and the sheet's visible strokes, whether the tracing paper is shown or
1182
+ * hidden. A box of a mark is a box on this crop.
1183
+ *
1184
+ * @generated from field: bytes crop = 2;
1185
+ */
1186
+ crop: Uint8Array;
1187
+ };
1188
+
1189
+ /**
1190
+ * Describes the message novatrail.api.v1.PaperWork.
1191
+ * Use `create(PaperWorkSchema)` to create a new message.
1192
+ */
1193
+ export declare const PaperWorkSchema: GenMessage<PaperWork>;
1194
+
1060
1195
  /**
1061
1196
  * The crop of one filled box.
1062
1197
  *
@@ -1202,6 +1337,15 @@ export declare type AnswerSlotVerdict = Message<"novatrail.api.v1.AnswerSlotVerd
1202
1337
  * @generated from field: optional string value = 4;
1203
1338
  */
1204
1339
  value?: string | undefined;
1340
+
1341
+ /**
1342
+ * Where on the crop the answer was read, in whole thousandths of the crop's height and width:
1343
+ * on a task from paper alone, and only when the reading gave a value, so that `app` puts the
1344
+ * slot's verdict by the answer.
1345
+ *
1346
+ * @generated from field: novatrail.observation.v1.CropBox crop_box = 5;
1347
+ */
1348
+ cropBox?: CropBox | undefined;
1205
1349
  };
1206
1350
 
1207
1351
  /**
@@ -1256,9 +1400,9 @@ export declare type SolvedTask = Message<"novatrail.api.v1.SolvedTask"> & {
1256
1400
  export declare const SolvedTaskSchema: GenMessage<SolvedTask>;
1257
1401
 
1258
1402
  /**
1259
- * What comes next once an attempt is closed by a correct answer, by the solution shown or by "Done".
1260
- * A repeat gets the same: of `SubmitWork` and `ShowSolution` with the same idempotency key, and of
1261
- * `Done` by the state of the attempt.
1403
+ * What comes next once an attempt is closed by a correct answer, by the solution shown or by
1404
+ * "Done". A repeat gets the same: of `SubmitWork` and `ShowSolution` with the same idempotency key,
1405
+ * and of `Done` by the state of the attempt.
1262
1406
  *
1263
1407
  * @generated from message novatrail.api.v1.Next
1264
1408
  */
@@ -1359,7 +1503,8 @@ export declare type Mark = Message<"novatrail.api.v1.Mark"> & {
1359
1503
  case: "answerSlot";
1360
1504
  } | {
1361
1505
  /**
1362
- * A box on the crop the device sent, in whole thousandths: on a handwriting sheet alone.
1506
+ * A box on the crop the device sent, in whole thousandths: on a handwriting sheet and on a task
1507
+ * from paper alone.
1363
1508
  *
1364
1509
  * @generated from field: novatrail.observation.v1.CropBox crop_box = 3;
1365
1510
  */
@@ -1454,6 +1599,13 @@ export enum TutorReply {
1454
1599
  * @generated from enum value: TUTOR_REPLY_ESSAY_FEEDBACK = 4;
1455
1600
  */
1456
1601
  ESSAY_FEEDBACK = 4,
1602
+
1603
+ /**
1604
+ * The opening question of a task from paper, `GetOpeningWords`.
1605
+ *
1606
+ * @generated from enum value: TUTOR_REPLY_OPENING = 5;
1607
+ */
1608
+ OPENING = 5,
1457
1609
  }
1458
1610
 
1459
1611
  /**
@@ -1574,6 +1726,14 @@ export enum MarkKind {
1574
1726
  * @generated from enum value: MARK_KIND_FRAME = 1;
1575
1727
  */
1576
1728
  FRAME = 1,
1729
+
1730
+ /**
1731
+ * A wavy line under the place of the first mistake: on a task from paper alone, at a box on the
1732
+ * crop, and only while the profile's hint mode is `HINT_MODE_SHOW_WHERE` (R162).
1733
+ *
1734
+ * @generated from enum value: MARK_KIND_WAVY_LINE = 2;
1735
+ */
1736
+ WAVY_LINE = 2,
1577
1737
  }
1578
1738
 
1579
1739
  /**
@@ -1594,7 +1754,10 @@ export declare const MarkKindSchema: GenEnum<MarkKind>;
1594
1754
  * solution shown or by "Done" says what comes next, `next`: an attempt begins by
1595
1755
  * `LearningService`. The engine's choice in `next` goes by the route to AI that the request
1596
1756
  * names, the own key's by the provider of its `own_key` or by its `own_key_provider`, or platform
1597
- * AI's without either, as `ChooseNext` judges it (R84; R99).
1757
+ * AI's without either, as `ChooseNext` judges it (R84; R99). An attempt of a task from paper
1758
+ * (R162) has an item with one answer slot for each task its crop holds, from 1 to 20, no `next`,
1759
+ * and nothing to show: its key, the solver's or the AI's, the first submission derives, `api`
1760
+ * keeps it while the attempt is open, and it never reaches the device (R05).
1598
1761
  *
1599
1762
  * @generated from service novatrail.api.v1.AttemptService
1600
1763
  */
@@ -1602,10 +1765,14 @@ export declare const AttemptService: GenService<{
1602
1765
  /**
1603
1766
  * Sends the work of a task with a verdict for checking: the handwriting, the options tapped, or
1604
1767
  * both. The answer is the verdict of every item and answer slot, on the whole observation, and
1605
- * what was read. Refusals: `CAUSE_ATTEMPT_CLOSED`, `CAUSE_KEY_NOT_FOR_PROFILE`,
1606
- * `CAUSE_KEY_ALREADY_USED` and `CAUSE_STILL_GOING`. A call of AI that gives no reading is no
1607
- * refusal: its slots get "unchecked", and the answer names the outcome. A repeat with the same
1608
- * idempotency key gets the verdicts and the reading recorded, with no AI.
1768
+ * what was read. On a task from paper the first submission derives the key too, from the task's
1769
+ * crop, a key for each task on it: a task whose solution of AI gives no one answer a program
1770
+ * can compare has none, and its item is unchecked; with none in any task the outcome is
1771
+ * `CAUSE_NO_KEY`, which every later submission of the attempt gets with no AI. Refusals:
1772
+ * `CAUSE_ATTEMPT_CLOSED`, `CAUSE_KEY_NOT_FOR_PROFILE`, `CAUSE_KEY_ALREADY_USED` and
1773
+ * `CAUSE_STILL_GOING`. A call of AI that gives no reading is no refusal: its slots get
1774
+ * "unchecked", and the answer names the outcome. A repeat with the same idempotency key gets the
1775
+ * verdicts and the reading recorded, with no AI.
1609
1776
  *
1610
1777
  * @generated from rpc novatrail.api.v1.AttemptService.SubmitWork
1611
1778
  */
@@ -1647,8 +1814,8 @@ export declare const AttemptService: GenService<{
1647
1814
  * keeps no crop. Refusals: `CAUSE_NOT_CURRENT`, `CAUSE_NO_RUNG`, `CAUSE_NO_MORE_WORDS`,
1648
1815
  * `CAUSE_ATTEMPT_CLOSED`, `CAUSE_KEY_NOT_FOR_PROFILE`, `CAUSE_KEY_ALREADY_USED` and
1649
1816
  * `CAUSE_STILL_GOING`. A call of AI that gives no words is no refusal: the answer holds the
1650
- * rung's fallback text and names the outcome. A repeat with the same idempotency key, or a request
1651
- * for the same wrong answer, gets the words the attempt keeps, with no AI and no marks.
1817
+ * rung's fallback text and names the outcome. A repeat with the same idempotency key, or a
1818
+ * request for the same wrong answer, gets the words the attempt keeps, with no AI and no marks.
1652
1819
  *
1653
1820
  * @generated from rpc novatrail.api.v1.AttemptService.GetRungWords
1654
1821
  */
@@ -1680,9 +1847,9 @@ export declare const AttemptService: GenService<{
1680
1847
  * without the work, for the wrong answer it names. Refusals: `CAUSE_NOT_CURRENT`,
1681
1848
  * `CAUSE_ALREADY_ASKED`, `CAUSE_NO_RUNG`, `CAUSE_ATTEMPT_CLOSED`, `CAUSE_KEY_NOT_FOR_PROFILE`,
1682
1849
  * `CAUSE_KEY_ALREADY_USED` and `CAUSE_STILL_GOING`; on platform AI, `CAUSE_QUOTA`,
1683
- * `CAUSE_PLATFORM_LIMIT` and `CAUSE_NOT_ADMITTED` too: it makes no call without the reserve of the
1684
- * quota, and the right to it on the rung stays. A repeat with the same idempotency key gets the
1685
- * words the attempt keeps, with no AI.
1850
+ * `CAUSE_PLATFORM_LIMIT` and `CAUSE_NOT_ADMITTED` too: it makes no call without the reserve of
1851
+ * the quota, and the right to it on the rung stays. A repeat with the same idempotency key gets
1852
+ * the words the attempt keeps, with no AI.
1686
1853
  *
1687
1854
  * @generated from rpc novatrail.api.v1.AttemptService.ExplainDifferently
1688
1855
  */
@@ -1694,8 +1861,9 @@ export declare const AttemptService: GenService<{
1694
1861
  /**
1695
1862
  * "Hint", a hint the learner asks for, without the work and with no AI: before the first wrong
1696
1863
  * answer, and on a task with a rubric, the IDs of the task's techniques and its leading question,
1697
- * when it has one; after it, the words of the current rung. Refusals: `CAUSE_ATTEMPT_CLOSED`. It
1698
- * carries no idempotency key: it repeats by the attempt's state.
1864
+ * when it has one, both empty on a task from paper, which has neither and asks
1865
+ * `GetOpeningWords` instead; after it, the words of the current rung. Refusals:
1866
+ * `CAUSE_ATTEMPT_CLOSED`. It carries no idempotency key: it repeats by the attempt's state.
1699
1867
  *
1700
1868
  * @generated from rpc novatrail.api.v1.AttemptService.GetHint
1701
1869
  */
@@ -1704,6 +1872,24 @@ export declare const AttemptService: GenService<{
1704
1872
  input: typeof GetHintRequestSchema;
1705
1873
  output: typeof GetHintResponseSchema;
1706
1874
  },
1875
+ /**
1876
+ * "Hint" on a task from paper before its first wrong answer: the tutor's opening question, one
1877
+ * call of AI on the attempt, sending the task's crop without the learner's strokes, a question on
1878
+ * how to begin the task it holds, or the first of a frame of several (R82; R162). Refusals:
1879
+ * `CAUSE_NOT_CURRENT` once the attempt has a wrong answer, whose rung `GetHint` gives,
1880
+ * `CAUSE_ATTEMPT_CLOSED`, `CAUSE_KEY_NOT_FOR_PROFILE`, `CAUSE_KEY_ALREADY_USED` and
1881
+ * `CAUSE_STILL_GOING`; a task of a module gets `invalid_argument`. A call of AI that gives no
1882
+ * words is no refusal: the answer holds the opening question's fallback text and names the
1883
+ * outcome. The model's words the attempt keeps: a repeat with the same idempotency key, or a
1884
+ * request once it keeps them, gets them with no AI; a fallback text is not kept.
1885
+ *
1886
+ * @generated from rpc novatrail.api.v1.AttemptService.GetOpeningWords
1887
+ */
1888
+ getOpeningWords: {
1889
+ methodKind: "unary";
1890
+ input: typeof GetOpeningWordsRequestSchema;
1891
+ output: typeof GetOpeningWordsResponseSchema;
1892
+ },
1707
1893
  /**
1708
1894
  * Begins a step of the task's solving steps whose `gives` gives techniques, in the mode "by
1709
1895
  * steps": the answer is the IDs of the task's techniques. "Step done" sends no request. Refusals:
@@ -1718,7 +1904,8 @@ export declare const AttemptService: GenService<{
1718
1904
  },
1719
1905
  /**
1720
1906
  * Shows the solution, by a learning action or by an action of an adult, and closes the attempt
1721
- * `CLOSE_REASON_SOLUTION_SHOWN`. A learning action needs the right `can_learn`, and an action of
1907
+ * `CLOSE_REASON_SOLUTION_SHOWN`; a task with a rubric and a task from paper have none to show,
1908
+ * `CAUSE_NO_SHOWING`. A learning action needs the right `can_learn`, and an action of
1722
1909
  * an adult `can_manage`: a request without it gets the code `permission_denied`. The PIN of the
1723
1910
  * section for adults is a barrier of the interface, not of the server (R04 api). Refusals:
1724
1911
  * `CAUSE_ADULT_NEEDED`, `CAUSE_LADDER_NOT_PASSED`, by either kind of action,