@intellectif/lk-core 1.2.0 → 1.4.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 (105) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +2 -2
  3. package/dist/ai-CnmLPMzd.d.cts +2417 -0
  4. package/dist/ai-CnmLPMzd.d.cts.map +1 -0
  5. package/dist/ai-CnmLPMzd.d.ts +2417 -0
  6. package/dist/ai-CnmLPMzd.d.ts.map +1 -0
  7. package/dist/ai-check.cjs +845 -620
  8. package/dist/ai-check.cjs.map +1 -1
  9. package/dist/ai-check.d.cts +82 -80
  10. package/dist/ai-check.d.cts.map +1 -0
  11. package/dist/ai-check.d.ts +82 -80
  12. package/dist/ai-check.d.ts.map +1 -0
  13. package/dist/ai-check.js +843 -621
  14. package/dist/ai-check.js.map +1 -1
  15. package/dist/ai-writing-CPpH9Qxq.js +2601 -0
  16. package/dist/ai-writing-CPpH9Qxq.js.map +1 -0
  17. package/dist/ai-writing-G6tnCGzw.cjs +2846 -0
  18. package/dist/ai-writing-G6tnCGzw.cjs.map +1 -0
  19. package/dist/index-2nigSf4N.d.cts +339 -0
  20. package/dist/index-2nigSf4N.d.cts.map +1 -0
  21. package/dist/index-B54baFUA.d.ts +339 -0
  22. package/dist/index-B54baFUA.d.ts.map +1 -0
  23. package/dist/index-BAfEHCnD.d.cts +1071 -0
  24. package/dist/index-BAfEHCnD.d.cts.map +1 -0
  25. package/dist/index-BqMXWuNC.d.cts +153 -0
  26. package/dist/index-BqMXWuNC.d.cts.map +1 -0
  27. package/dist/index-CVWvymVb.d.ts +1071 -0
  28. package/dist/index-CVWvymVb.d.ts.map +1 -0
  29. package/dist/index-CcHDTxIZ.d.ts +153 -0
  30. package/dist/index-CcHDTxIZ.d.ts.map +1 -0
  31. package/dist/index.cjs +1211 -1146
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +941 -861
  34. package/dist/index.d.cts.map +1 -0
  35. package/dist/index.d.ts +941 -861
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +1063 -1147
  38. package/dist/index.js.map +1 -1
  39. package/dist/item-group-DXiR8nOr.js +445 -0
  40. package/dist/item-group-DXiR8nOr.js.map +1 -0
  41. package/dist/item-group-DroFXgLb.cjs +505 -0
  42. package/dist/item-group-DroFXgLb.cjs.map +1 -0
  43. package/dist/registry-DVi0LR_i.cjs +5915 -0
  44. package/dist/registry-DVi0LR_i.cjs.map +1 -0
  45. package/dist/registry-Dsx9mNsS.js +5449 -0
  46. package/dist/registry-Dsx9mNsS.js.map +1 -0
  47. package/dist/schemas-Bdw0nGPo.js +152 -0
  48. package/dist/schemas-Bdw0nGPo.js.map +1 -0
  49. package/dist/schemas-DVbAOrtd.cjs +224 -0
  50. package/dist/schemas-DVbAOrtd.cjs.map +1 -0
  51. package/dist/schemas.cjs +16 -34
  52. package/dist/schemas.d.cts +2 -2
  53. package/dist/schemas.d.ts +2 -2
  54. package/dist/schemas.js +3 -34
  55. package/dist/scoring-B2_HEhMT.cjs +1748 -0
  56. package/dist/scoring-B2_HEhMT.cjs.map +1 -0
  57. package/dist/scoring-BZqUkuDF.js +1604 -0
  58. package/dist/scoring-BZqUkuDF.js.map +1 -0
  59. package/dist/scoring.cjs +37 -75
  60. package/dist/scoring.d.cts +3 -1103
  61. package/dist/scoring.d.ts +3 -1103
  62. package/dist/scoring.js +3 -75
  63. package/dist/xapi-CMTph7wG.js +332 -0
  64. package/dist/xapi-CMTph7wG.js.map +1 -0
  65. package/dist/xapi-DNzkSJ0S.cjs +362 -0
  66. package/dist/xapi-DNzkSJ0S.cjs.map +1 -0
  67. package/dist/xapi.cjs +7 -16
  68. package/dist/xapi.d.cts +2 -150
  69. package/dist/xapi.d.ts +2 -150
  70. package/dist/xapi.js +2 -16
  71. package/package.json +4 -4
  72. package/dist/activity-D705CXng.d.cts +0 -2162
  73. package/dist/activity-D705CXng.d.ts +0 -2162
  74. package/dist/chunk-46BXIGLG.cjs +0 -272
  75. package/dist/chunk-46BXIGLG.cjs.map +0 -1
  76. package/dist/chunk-4YANYTFN.cjs +0 -1256
  77. package/dist/chunk-4YANYTFN.cjs.map +0 -1
  78. package/dist/chunk-7KOWU4RO.js +0 -2207
  79. package/dist/chunk-7KOWU4RO.js.map +0 -1
  80. package/dist/chunk-7THXD7AN.cjs +0 -5057
  81. package/dist/chunk-7THXD7AN.cjs.map +0 -1
  82. package/dist/chunk-CYCTIXUN.cjs +0 -118
  83. package/dist/chunk-CYCTIXUN.cjs.map +0 -1
  84. package/dist/chunk-CYPA5BW5.js +0 -118
  85. package/dist/chunk-CYPA5BW5.js.map +0 -1
  86. package/dist/chunk-JTNDIBZO.js +0 -272
  87. package/dist/chunk-JTNDIBZO.js.map +0 -1
  88. package/dist/chunk-MV2N2WNS.js +0 -352
  89. package/dist/chunk-MV2N2WNS.js.map +0 -1
  90. package/dist/chunk-MXI26H62.cjs +0 -2207
  91. package/dist/chunk-MXI26H62.cjs.map +0 -1
  92. package/dist/chunk-QS7B42ZR.js +0 -5057
  93. package/dist/chunk-QS7B42ZR.js.map +0 -1
  94. package/dist/chunk-QX2ERL72.js +0 -1256
  95. package/dist/chunk-QX2ERL72.js.map +0 -1
  96. package/dist/chunk-ZWXQSKCX.cjs +0 -352
  97. package/dist/chunk-ZWXQSKCX.cjs.map +0 -1
  98. package/dist/index-BChYtrEe.d.ts +0 -548
  99. package/dist/index-VXt_v3YI.d.cts +0 -548
  100. package/dist/schemas.cjs.map +0 -1
  101. package/dist/schemas.js.map +0 -1
  102. package/dist/scoring.cjs.map +0 -1
  103. package/dist/scoring.js.map +0 -1
  104. package/dist/xapi.cjs.map +0 -1
  105. package/dist/xapi.js.map +0 -1
@@ -1,18 +1,18 @@
1
- import { F as AiExplanationRequest, M as AiHintRequest, a2 as AiWritingFeedbackRequest, j as AiCoachingRequest, s as AiCritiqueRequest, D as AiDraftsRequest, T as AiRefusal, X as AiTextResult, a1 as AiWritingFeedback, i as AiCoaching, n as AiCritique, B as AiDrafts } from './activity-D705CXng.js';
2
-
1
+ import { $ as AiWritingFeedbackRequest, E as AiExplanationRequest, H as AiRefusal, K as AiTextResult, P as AiHintRequest, Q as AiWritingFeedback, S as AiDrafts, a as AiCoachingRequest, i as AiCoaching, l as AiCritique, m as AiCritiqueRequest, w as AiDraftsRequest } from "./ai-CnmLPMzd.js";
2
+ //#region src/ai-check/cases.d.ts
3
3
  /**
4
4
  * One call to make against a host's port, and what a learner was looking at
5
5
  * when the SDK would have made it.
6
6
  */
7
7
  interface AiCheckCase {
8
- /** Stable across releases, so a host can name one in an allow-list or a report. */
9
- id: string;
10
- /** Which port the case is for. */
11
- feature: 'explanation' | 'hint' | 'writing-feedback' | 'pronunciation-coaching' | 'item-critique' | 'draft-generation';
12
- /** What the learner did, in a few words, for a report a person reads. */
13
- about: string;
14
- /** The request, built by the SDK exactly as a component builds it. */
15
- request: AiExplanationRequest | AiHintRequest | AiWritingFeedbackRequest | AiCoachingRequest | AiCritiqueRequest | AiDraftsRequest;
8
+ /** Stable across releases, so a host can name one in an allow-list or a report. */
9
+ id: string;
10
+ /** Which port the case is for. */
11
+ feature: 'explanation' | 'hint' | 'writing-feedback' | 'pronunciation-coaching' | 'item-critique' | 'draft-generation';
12
+ /** What the learner did, in a few words, for a report a person reads. */
13
+ about: string;
14
+ /** The request, built by the SDK exactly as a component builds it. */
15
+ request: AiExplanationRequest | AiHintRequest | AiWritingFeedbackRequest | AiCoachingRequest | AiCritiqueRequest | AiDraftsRequest;
16
16
  }
17
17
  /**
18
18
  * The cases {@link runAiCheck} runs: every type the SDK explains, answered
@@ -26,8 +26,9 @@ interface AiCheckCase {
26
26
  * A fresh array each call, so a caller may filter, slice or add to it without
27
27
  * changing what the next caller gets.
28
28
  */
29
- declare function aiCheckCases(): AiCheckCase[];
30
-
29
+ export declare function aiCheckCases(): AiCheckCase[];
30
+ //#endregion
31
+ //#region src/ai-check/index.d.ts
31
32
  /**
32
33
  * Your ports, as this kit calls them. The same functions
33
34
  * `<LkAiProvider ai={…}>` takes, minus the `AbortSignal` a browser passes —
@@ -35,75 +36,75 @@ declare function aiCheckCases(): AiCheckCase[];
35
36
  *
36
37
  * Leave one out and its cases are skipped rather than failed.
37
38
  */
38
- interface AiCheckPorts {
39
- explain?(request: AiExplanationRequest): Promise<unknown> | unknown;
40
- hint?(request: AiHintRequest): Promise<unknown> | unknown;
41
- writingFeedback?(request: AiWritingFeedbackRequest): Promise<unknown> | unknown;
42
- pronunciationCoaching?(request: AiCoachingRequest): Promise<unknown> | unknown;
43
- /** Reviews an item for its author: the port an editor's "Review with AI" calls. */
44
- critique?(request: AiCritiqueRequest): Promise<unknown> | unknown;
45
- /** Drafts items from a source, for an author to approve. */
46
- drafts?(request: AiDraftsRequest): Promise<unknown> | unknown;
39
+ export interface AiCheckPorts {
40
+ explain?(request: AiExplanationRequest): Promise<unknown> | unknown;
41
+ hint?(request: AiHintRequest): Promise<unknown> | unknown;
42
+ writingFeedback?(request: AiWritingFeedbackRequest): Promise<unknown> | unknown;
43
+ pronunciationCoaching?(request: AiCoachingRequest): Promise<unknown> | unknown;
44
+ /** Reviews an item for its author: the port an editor's "Review with AI" calls. */
45
+ critique?(request: AiCritiqueRequest): Promise<unknown> | unknown;
46
+ /** Drafts items from a source, for an author to approve. */
47
+ drafts?(request: AiDraftsRequest): Promise<unknown> | unknown;
47
48
  }
48
49
  /** What happened on one case. */
49
- interface AiCheckResult {
50
- case: AiCheckCase;
51
- /** Whether a learner would have been shown what came back. */
52
- ok: boolean;
53
- /** Why it would not have been shown. */
54
- refusal?: AiRefusal;
55
- /** The port threw or rejected. Its message, as a string. */
56
- error?: string;
57
- /**
58
- * What came back, once the SDK had read it — so a refusal can be read beside
59
- * the text that caused it. Absent when the port failed or answered with
60
- * nothing the SDK could read.
61
- */
62
- result?: AiTextResult;
63
- /** For a writing case a learner would have been shown: the feedback, as the SDK accepted it. */
64
- feedback?: AiWritingFeedback;
65
- /** For a coaching case a learner would have been shown: the coaching, as the SDK accepted it. */
66
- coaching?: AiCoaching;
67
- /** For a critique case an author would have been shown: the findings, as the SDK accepted them. */
68
- critique?: AiCritique;
69
- /**
70
- * For a drafts case the SDK read: the drafts, each with what `validateDraft`
71
- * and the item critic say of it. A reply read is not a good one — check how
72
- * many came back `complete` and without warnings.
73
- */
74
- drafts?: AiDrafts;
75
- /** How long the call took, in milliseconds. */
76
- ms: number;
50
+ export interface AiCheckResult {
51
+ case: AiCheckCase;
52
+ /** Whether a learner would have been shown what came back. */
53
+ ok: boolean;
54
+ /** Why it would not have been shown. */
55
+ refusal?: AiRefusal;
56
+ /** The port threw or rejected. Its message, as a string. */
57
+ error?: string;
58
+ /**
59
+ * What came back, once the SDK had read it — so a refusal can be read beside
60
+ * the text that caused it. Absent when the port failed or answered with
61
+ * nothing the SDK could read.
62
+ */
63
+ result?: AiTextResult;
64
+ /** For a writing case a learner would have been shown: the feedback, as the SDK accepted it. */
65
+ feedback?: AiWritingFeedback;
66
+ /** For a coaching case a learner would have been shown: the coaching, as the SDK accepted it. */
67
+ coaching?: AiCoaching;
68
+ /** For a critique case an author would have been shown: the findings, as the SDK accepted them. */
69
+ critique?: AiCritique;
70
+ /**
71
+ * For a drafts case the SDK read: the drafts, each with what `validateDraft`
72
+ * and the item critic say of it. A reply read is not a good one — check how
73
+ * many came back `complete` and without warnings.
74
+ */
75
+ drafts?: AiDrafts;
76
+ /** How long the call took, in milliseconds. */
77
+ ms: number;
77
78
  }
78
79
  /** What a run came to. */
79
- interface AiCheckReport {
80
- /** Cases run: the ones a port was supplied for. */
81
- total: number;
82
- /** Cases whose answer a learner would have been shown. */
83
- shown: number;
84
- /** Cases whose answer the SDK refused. */
85
- refused: number;
86
- /** Cases where the port itself failed. */
87
- errors: number;
88
- /** Cases skipped because no port was supplied for that feature. */
89
- skipped: number;
90
- /** How many refusals of each reason. */
91
- byRefusal: Record<AiRefusal, number>;
92
- results: AiCheckResult[];
80
+ export interface AiCheckReport {
81
+ /** Cases run: the ones a port was supplied for. */
82
+ total: number;
83
+ /** Cases whose answer a learner would have been shown. */
84
+ shown: number;
85
+ /** Cases whose answer the SDK refused. */
86
+ refused: number;
87
+ /** Cases where the port itself failed. */
88
+ errors: number;
89
+ /** Cases skipped because no port was supplied for that feature. */
90
+ skipped: number;
91
+ /** How many refusals of each reason. */
92
+ byRefusal: Record<AiRefusal, number>;
93
+ results: AiCheckResult[];
93
94
  }
94
- interface AiCheckOptions {
95
- /**
96
- * The cases to run. Defaults to {@link aiCheckCases}. Pass a filtered list to
97
- * run one type, or your own cases — built with `aiExplanationRequest` and
98
- * `aiHintRequest` on your own items, which is how you test a prompt against
99
- * the content your learners actually see.
100
- */
101
- cases?: readonly AiCheckCase[];
102
- /**
103
- * How many cases to have in flight at once. Default 1: a run in CI hits a
104
- * rate limit far more often than it runs out of patience.
105
- */
106
- concurrency?: number;
95
+ export interface AiCheckOptions {
96
+ /**
97
+ * The cases to run. Defaults to {@link aiCheckCases}. Pass a filtered list to
98
+ * run one type, or your own cases — built with `aiExplanationRequest` and
99
+ * `aiHintRequest` on your own items, which is how you test a prompt against
100
+ * the content your learners actually see.
101
+ */
102
+ cases?: readonly AiCheckCase[];
103
+ /**
104
+ * How many cases to have in flight at once. Default 1: a run in CI hits a
105
+ * rate limit far more often than it runs out of patience.
106
+ */
107
+ concurrency?: number;
107
108
  }
108
109
  /**
109
110
  * Calls your ports on every case and reports what a learner would have seen.
@@ -111,7 +112,7 @@ interface AiCheckOptions {
111
112
  * It never throws for a failing case: a port that rejects is an `error` in the
112
113
  * report, so one bad call cannot hide the rest.
113
114
  */
114
- declare function runAiCheck(ports: AiCheckPorts, options?: AiCheckOptions): Promise<AiCheckReport>;
115
+ export declare function runAiCheck(ports: AiCheckPorts, options?: AiCheckOptions): Promise<AiCheckReport>;
115
116
  /**
116
117
  * The report as a few lines for a CI log: the counts, then every case that
117
118
  * failed, with what came back.
@@ -120,6 +121,7 @@ declare function runAiCheck(ports: AiCheckPorts, options?: AiCheckOptions): Prom
120
121
  * screen, and a hint that gives the answer away is only fixable if you can
121
122
  * read it.
122
123
  */
123
- declare function formatAiCheckReport(report: AiCheckReport): string;
124
-
125
- export { type AiCheckCase, type AiCheckOptions, type AiCheckPorts, type AiCheckReport, type AiCheckResult, aiCheckCases, formatAiCheckReport, runAiCheck };
124
+ export declare function formatAiCheckReport(report: AiCheckReport): string;
125
+ //#endregion
126
+ export type { AiCheckCase };
127
+ //# sourceMappingURL=ai-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-check.d.ts","names":[],"sources":["../src/ai-check/cases.ts","../src/ai-check/index.ts"],"mappings":";;;;;;UAmRiB;;EAEf;;EAEA;;EAQA;;EAEA,SACI,uBACA,gBACA,2BACA,oBACA,oBACA;;;;;;;;;;;;;;wBAmNU,gBAAgB;;;;;;;;;;iBCtbf;EACf,SAAS,SAAS,uBAAuB;EACzC,MAAM,SAAS,gBAAgB;EAC/B,iBAAiB,SAAS,2BAA2B;EACrD,uBAAuB,SAAS,oBAAoB;;EAEpD,UAAU,SAAS,oBAAoB;;EAEvC,QAAQ,SAAS,kBAAkB;;;iBAIpB;EACf,MAAM;;EAEN;;EAEA,UAAU;;EAEV;;;;;;EAMA,SAAS;;EAET,WAAW;;EAEX,WAAW;;EAEX,WAAW;;;;;;EAMX,SAAS;;EAET;;;iBAIe;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,OAAO;EAClB,SAAS;;iBAGM;;;;;;;EAOf,iBAAiB;;;;;EAKjB;;;;;;;;wBA4IoB,WACpB,OAAO,cACP,UAAS,iBACR,QAAQ;;;;;;;;;wBAwDK,oBAAoB,QAAQ"}