@intellectif/lk-core 1.2.0 → 1.3.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.
- package/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/dist/ai-B222dtHH.d.cts +2154 -0
- package/dist/ai-B222dtHH.d.cts.map +1 -0
- package/dist/ai-B222dtHH.d.ts +2154 -0
- package/dist/ai-B222dtHH.d.ts.map +1 -0
- package/dist/ai-check.cjs +749 -617
- package/dist/ai-check.cjs.map +1 -1
- package/dist/ai-check.d.cts +82 -80
- package/dist/ai-check.d.cts.map +1 -0
- package/dist/ai-check.d.ts +82 -80
- package/dist/ai-check.d.ts.map +1 -0
- package/dist/ai-check.js +747 -618
- package/dist/ai-check.js.map +1 -1
- package/dist/ai-writing-CCBjTOM3.js +2496 -0
- package/dist/ai-writing-CCBjTOM3.js.map +1 -0
- package/dist/ai-writing-DCVkv4Zj.cjs +2735 -0
- package/dist/ai-writing-DCVkv4Zj.cjs.map +1 -0
- package/dist/{index-BChYtrEe.d.ts → index-BWPRPIXL.d.ts} +263 -258
- package/dist/index-BWPRPIXL.d.ts.map +1 -0
- package/dist/index-CXyOV8sm.d.cts +153 -0
- package/dist/index-CXyOV8sm.d.cts.map +1 -0
- package/dist/index-CegM8o15.d.ts +153 -0
- package/dist/index-CegM8o15.d.ts.map +1 -0
- package/dist/index-Dyu66R4-.d.cts +1071 -0
- package/dist/index-Dyu66R4-.d.cts.map +1 -0
- package/dist/{index-VXt_v3YI.d.cts → index-O4_ExlAD.d.cts} +263 -258
- package/dist/index-O4_ExlAD.d.cts.map +1 -0
- package/dist/index-UGxRSopE.d.ts +1071 -0
- package/dist/index-UGxRSopE.d.ts.map +1 -0
- package/dist/index.cjs +1210 -1146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +909 -857
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +909 -857
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1063 -1147
- package/dist/index.js.map +1 -1
- package/dist/item-group-DXiR8nOr.js +445 -0
- package/dist/item-group-DXiR8nOr.js.map +1 -0
- package/dist/item-group-DroFXgLb.cjs +505 -0
- package/dist/item-group-DroFXgLb.cjs.map +1 -0
- package/dist/registry-DVi0LR_i.cjs +5915 -0
- package/dist/registry-DVi0LR_i.cjs.map +1 -0
- package/dist/registry-Dsx9mNsS.js +5449 -0
- package/dist/registry-Dsx9mNsS.js.map +1 -0
- package/dist/schemas-Bdw0nGPo.js +152 -0
- package/dist/schemas-Bdw0nGPo.js.map +1 -0
- package/dist/schemas-DVbAOrtd.cjs +224 -0
- package/dist/schemas-DVbAOrtd.cjs.map +1 -0
- package/dist/schemas.cjs +16 -34
- package/dist/schemas.d.cts +2 -2
- package/dist/schemas.d.ts +2 -2
- package/dist/schemas.js +3 -34
- package/dist/scoring-B2_HEhMT.cjs +1748 -0
- package/dist/scoring-B2_HEhMT.cjs.map +1 -0
- package/dist/scoring-BZqUkuDF.js +1604 -0
- package/dist/scoring-BZqUkuDF.js.map +1 -0
- package/dist/scoring.cjs +37 -75
- package/dist/scoring.d.cts +3 -1103
- package/dist/scoring.d.ts +3 -1103
- package/dist/scoring.js +3 -75
- package/dist/xapi-CMTph7wG.js +332 -0
- package/dist/xapi-CMTph7wG.js.map +1 -0
- package/dist/xapi-DNzkSJ0S.cjs +362 -0
- package/dist/xapi-DNzkSJ0S.cjs.map +1 -0
- package/dist/xapi.cjs +7 -16
- package/dist/xapi.d.cts +2 -150
- package/dist/xapi.d.ts +2 -150
- package/dist/xapi.js +2 -16
- package/package.json +4 -4
- package/dist/activity-D705CXng.d.cts +0 -2162
- package/dist/activity-D705CXng.d.ts +0 -2162
- package/dist/chunk-46BXIGLG.cjs +0 -272
- package/dist/chunk-46BXIGLG.cjs.map +0 -1
- package/dist/chunk-4YANYTFN.cjs +0 -1256
- package/dist/chunk-4YANYTFN.cjs.map +0 -1
- package/dist/chunk-7KOWU4RO.js +0 -2207
- package/dist/chunk-7KOWU4RO.js.map +0 -1
- package/dist/chunk-7THXD7AN.cjs +0 -5057
- package/dist/chunk-7THXD7AN.cjs.map +0 -1
- package/dist/chunk-CYCTIXUN.cjs +0 -118
- package/dist/chunk-CYCTIXUN.cjs.map +0 -1
- package/dist/chunk-CYPA5BW5.js +0 -118
- package/dist/chunk-CYPA5BW5.js.map +0 -1
- package/dist/chunk-JTNDIBZO.js +0 -272
- package/dist/chunk-JTNDIBZO.js.map +0 -1
- package/dist/chunk-MV2N2WNS.js +0 -352
- package/dist/chunk-MV2N2WNS.js.map +0 -1
- package/dist/chunk-MXI26H62.cjs +0 -2207
- package/dist/chunk-MXI26H62.cjs.map +0 -1
- package/dist/chunk-QS7B42ZR.js +0 -5057
- package/dist/chunk-QS7B42ZR.js.map +0 -1
- package/dist/chunk-QX2ERL72.js +0 -1256
- package/dist/chunk-QX2ERL72.js.map +0 -1
- package/dist/chunk-ZWXQSKCX.cjs +0 -352
- package/dist/chunk-ZWXQSKCX.cjs.map +0 -1
- package/dist/schemas.cjs.map +0 -1
- package/dist/schemas.js.map +0 -1
- package/dist/scoring.cjs.map +0 -1
- package/dist/scoring.js.map +0 -1
- package/dist/xapi.cjs.map +0 -1
- package/dist/xapi.js.map +0 -1
package/dist/ai-check.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { B as AiRefusal, E as AiExplanationRequest, N as AiHintRequest, S as AiDrafts, W as AiTextResult, X as AiWritingFeedback, Z as AiWritingFeedbackRequest, a as AiCoachingRequest, i as AiCoaching, l as AiCritique, m as AiCritiqueRequest, w as AiDraftsRequest } from "./ai-B222dtHH.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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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 {
|
|
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":";;;;;;UAyMiB;;EAEf;;EAEA;;EAQA;;EAEA,SACI,uBACA,gBACA,2BACA,oBACA,oBACA;;;;;;;;;;;;;;wBA+MU,gBAAgB;;;;;;;;;;iBCxWf;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"}
|