@bendyline/docblocks-react 2.7.5 → 2.7.6
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/THIRD_PARTY_NOTICES.txt +14 -14
- package/dist/{AiDiagrams-5P657GFC.js → AiDiagrams-VOCEZS6U.js} +4 -2
- package/dist/{AiEditorAssistant-V4MZRC6Q.js → AiEditorAssistant-2MW6UYNI.js} +51 -11
- package/dist/{AiStudyDialog-GSCFTG3G.js → AiStudyDialog-DQZVTBI7.js} +14 -4
- package/dist/{AudioExportDialog-IOYIEAER.js → AudioExportDialog-EICCBSSE.js} +1 -1
- package/dist/{ExportToolbarControls-HOV424TO.js → ExportToolbarControls-4LYTXGT3.js} +1 -1
- package/dist/{PresentationMaker-H5B44Q7P.js → PresentationMaker-T526TBRJ.js} +2 -2
- package/dist/{SpeechToolbarControl-KNI2C4JJ.js → SpeechToolbarControl-E6OSJGHL.js} +217 -71
- package/dist/{TextFromNarration-EYOMW2IW.js → TextFromNarration-ME6FAYWO.js} +1 -1
- package/dist/{WorkspaceSearchPanel-J6BKEZQJ.js → WorkspaceSearchPanel-MEBBTK7F.js} +3 -3
- package/dist/{chunk-I44HKDQX.js → chunk-3TSJQESW.js} +16 -3
- package/dist/chunk-45YTIVYS.js +1162 -0
- package/dist/{chunk-FBPCURCS.js → chunk-7HBKKXRV.js} +291 -82
- package/dist/{chunk-KBDZDFPU.js → chunk-BNKIPCXO.js} +4 -1
- package/dist/{chunk-2IYBBFQX.js → chunk-BZRYQENB.js} +59 -16
- package/dist/{chunk-DICE7VBJ.js → chunk-KHQ44ZFA.js} +16 -1
- package/dist/chunk-NOYDVL6M.js +180 -0
- package/dist/{chunk-USKX66SA.js → chunk-PRUEYW3G.js} +1 -1
- package/dist/{chunk-CUCWCZRO.js → chunk-T42BH6YX.js} +122 -91
- package/dist/editor.js +2 -2
- package/dist/index.js +20 -19
- package/dist/settings/index.js +2 -1
- package/package.json +5 -5
- package/src/styles/docblocks.css +501 -11
- package/dist/chunk-I4JURPYS.js +0 -812
- package/dist/{QuickOpenDialog-ENVFGIHS.js → QuickOpenDialog-3QEX7RZG.js} +3 -3
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -17,13 +17,13 @@ This notice is included in the published npm tarball. Transitive packages instal
|
|
|
17
17
|
| @antfu/install-pkg | 2.1.0 | MIT | https://github.com/antfu-collective/install-pkg |
|
|
18
18
|
| @bendyline/squisq | 2.13.0 | MIT | https://github.com/bendyline/squisq |
|
|
19
19
|
| @bendyline/squisq-calc | 2.11.2 | MIT | https://github.com/bendyline/squisq |
|
|
20
|
-
| @bendyline/squisq-editor-react | 2.13.
|
|
20
|
+
| @bendyline/squisq-editor-react | 2.13.2 | MIT | https://github.com/bendyline/squisq |
|
|
21
21
|
| @bendyline/squisq-formats | 2.8.1 | MIT | https://github.com/bendyline/squisq |
|
|
22
22
|
| @bendyline/squisq-graph | 2.13.0 | MIT | https://github.com/bendyline/squisq |
|
|
23
23
|
| @bendyline/squisq-grid-react | 2.11.29 | MIT | https://github.com/bendyline/squisq |
|
|
24
|
-
| @bendyline/squisq-react | 2.12.
|
|
24
|
+
| @bendyline/squisq-react | 2.12.9 | MIT | https://github.com/bendyline/squisq |
|
|
25
25
|
| @bendyline/squisq-video | 2.4.6 | MIT | https://github.com/bendyline/squisq |
|
|
26
|
-
| @bendyline/squisq-video-react | 2.5.
|
|
26
|
+
| @bendyline/squisq-video-react | 2.5.10 | MIT | https://github.com/bendyline/squisq |
|
|
27
27
|
| @braintree/sanitize-url | 7.1.2 | MIT | https://github.com/braintree/sanitize-url |
|
|
28
28
|
| @chevrotain/types | 11.1.2 | Apache-2.0 | https://github.com/Chevrotain/chevrotain |
|
|
29
29
|
| @ffmpeg/core | 0.12.10 | GPL-2.0-or-later | https://github.com/ffmpegwasm/ffmpeg.wasm |
|
|
@@ -205,7 +205,7 @@ This notice is included in the published npm tarball. Transitive packages instal
|
|
|
205
205
|
| dequal | 2.0.3 | MIT | https://github.com/lukeed/dequal |
|
|
206
206
|
| devlop | 1.1.0 | MIT | https://github.com/wooorm/devlop |
|
|
207
207
|
| dijkstrajs | 1.0.3 | MIT | https://github.com/tcort/dijkstrajs |
|
|
208
|
-
| dompurify | 3.4.
|
|
208
|
+
| dompurify | 3.4.17 | (MPL-2.0 OR Apache-2.0) | https://github.com/cure53/DOMPurify |
|
|
209
209
|
| emoji-regex | 8.0.0 | MIT | https://github.com/mathiasbynens/emoji-regex |
|
|
210
210
|
| entities | 4.5.0 | BSD-2-Clause | https://github.com/fb55/entities |
|
|
211
211
|
| entities | 6.0.1 | BSD-2-Clause | https://github.com/fb55/entities |
|
|
@@ -438,7 +438,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
438
438
|
SOFTWARE.
|
|
439
439
|
|
|
440
440
|
==============================================================================
|
|
441
|
-
Components: @bendyline/squisq-calc@2.11.2, @bendyline/squisq-editor-react@2.13.
|
|
441
|
+
Components: @bendyline/squisq-calc@2.11.2, @bendyline/squisq-editor-react@2.13.2, @bendyline/squisq-formats@2.8.1, @bendyline/squisq-graph@2.13.0, @bendyline/squisq-grid-react@2.11.29, @bendyline/squisq-react@2.12.9, @bendyline/squisq-video-react@2.5.10, @bendyline/squisq-video@2.4.6, @bendyline/squisq@2.13.0
|
|
442
442
|
Source files: node_modules/@bendyline/squisq-calc/LICENSE, node_modules/@bendyline/squisq-editor-react/LICENSE, node_modules/@bendyline/squisq-formats/LICENSE, node_modules/@bendyline/squisq-graph/LICENSE, node_modules/@bendyline/squisq-grid-react/LICENSE, node_modules/@bendyline/squisq-react/LICENSE, node_modules/@bendyline/squisq-video-react/LICENSE, node_modules/@bendyline/squisq-video/LICENSE, node_modules/@bendyline/squisq/LICENSE
|
|
443
443
|
==============================================================================
|
|
444
444
|
MIT License
|
|
@@ -638,7 +638,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
638
638
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
639
639
|
|
|
640
640
|
==============================================================================
|
|
641
|
-
Components: @bendyline/squisq-editor-react@2.13.
|
|
641
|
+
Components: @bendyline/squisq-editor-react@2.13.2
|
|
642
642
|
Source files: node_modules/@bendyline/squisq-editor-react/NOTICE.md
|
|
643
643
|
==============================================================================
|
|
644
644
|
# Third-Party Notices for @bendyline/squisq-editor-react
|
|
@@ -687,7 +687,7 @@ Exact third-party license texts for the bundled adapter, loader, state helper,
|
|
|
687
687
|
and Font Awesome assets are shipped in THIRD_PARTY_LICENSES.txt.
|
|
688
688
|
|
|
689
689
|
==============================================================================
|
|
690
|
-
Components: @bendyline/squisq-editor-react@2.13.
|
|
690
|
+
Components: @bendyline/squisq-editor-react@2.13.2, @tiptap/core@2.27.3, @tiptap/extension-blockquote@2.27.3, @tiptap/extension-bold@2.27.3, @tiptap/extension-bubble-menu@2.27.3, @tiptap/extension-bullet-list@2.27.3, @tiptap/extension-code-block@2.27.3, @tiptap/extension-code@2.27.3, @tiptap/extension-document@2.27.3, @tiptap/extension-dropcursor@2.27.3, @tiptap/extension-floating-menu@2.27.3, @tiptap/extension-gapcursor@2.27.3, @tiptap/extension-hard-break@2.27.3, @tiptap/extension-heading@2.27.3, @tiptap/extension-history@2.27.3, @tiptap/extension-horizontal-rule@2.27.3, @tiptap/extension-image@2.27.3, @tiptap/extension-italic@2.27.3, @tiptap/extension-link@2.27.3, @tiptap/extension-list-item@2.27.3, @tiptap/extension-mention@2.27.3, @tiptap/extension-ordered-list@2.27.3, @tiptap/extension-paragraph@2.27.3, @tiptap/extension-placeholder@2.27.3, @tiptap/extension-strike@2.27.3, @tiptap/extension-table-cell@2.27.3, @tiptap/extension-table-header@2.27.3, @tiptap/extension-table-row@2.27.3, @tiptap/extension-table@2.27.3, @tiptap/extension-task-item@2.27.3, @tiptap/extension-task-list@2.27.3, @tiptap/extension-text-style@2.27.3, @tiptap/extension-text@2.27.3, @tiptap/pm@2.27.3, @tiptap/react@2.27.3, @tiptap/starter-kit@2.27.3, @tiptap/suggestion@2.27.3
|
|
691
691
|
Source files: node_modules/@bendyline/squisq-editor-react/THIRD_PARTY_LICENSES.txt
|
|
692
692
|
==============================================================================
|
|
693
693
|
THIRD-PARTY LICENSES FOR @bendyline/squisq-editor-react
|
|
@@ -2091,7 +2091,7 @@ repository license, the pinned upstream copy is vendored and identified below.
|
|
|
2091
2091
|
COMPONENTS
|
|
2092
2092
|
|
|
2093
2093
|
==============================================================================
|
|
2094
|
-
Components: @bendyline/squisq-react@2.12.
|
|
2094
|
+
Components: @bendyline/squisq-react@2.12.9
|
|
2095
2095
|
Source files: node_modules/@bendyline/squisq-react/NOTICE.md
|
|
2096
2096
|
==============================================================================
|
|
2097
2097
|
# Third-Party Notices for @bendyline/squisq-react
|
|
@@ -2116,7 +2116,7 @@ third-party license texts for the complete standalone bundle graph are shipped
|
|
|
2116
2116
|
in THIRD_PARTY_LICENSES.txt.
|
|
2117
2117
|
|
|
2118
2118
|
==============================================================================
|
|
2119
|
-
Components: @bendyline/squisq-react@2.12.
|
|
2119
|
+
Components: @bendyline/squisq-react@2.12.9
|
|
2120
2120
|
Source files: node_modules/@bendyline/squisq-react/THIRD_PARTY_LICENSES.txt
|
|
2121
2121
|
==============================================================================
|
|
2122
2122
|
THIRD-PARTY LICENSES FOR @bendyline/squisq-react
|
|
@@ -6603,7 +6603,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
6603
6603
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6604
6604
|
|
|
6605
6605
|
==============================================================================
|
|
6606
|
-
Components: @bendyline/squisq-video-react@2.5.
|
|
6606
|
+
Components: @bendyline/squisq-video-react@2.5.10
|
|
6607
6607
|
Source files: node_modules/@bendyline/squisq-video-react/COPYING.GPL-2.0.txt
|
|
6608
6608
|
==============================================================================
|
|
6609
6609
|
GNU GENERAL PUBLIC LICENSE
|
|
@@ -6946,7 +6946,7 @@ library. If this is what you want to do, use the GNU Lesser General
|
|
|
6946
6946
|
Public License instead of this License.
|
|
6947
6947
|
|
|
6948
6948
|
==============================================================================
|
|
6949
|
-
Components: @bendyline/squisq-video-react@2.5.
|
|
6949
|
+
Components: @bendyline/squisq-video-react@2.5.10
|
|
6950
6950
|
Source files: node_modules/@bendyline/squisq-video-react/NOTICE.md
|
|
6951
6951
|
==============================================================================
|
|
6952
6952
|
# Third-Party Notices for @bendyline/squisq-video-react
|
|
@@ -7002,7 +7002,7 @@ at the version listed above and from https://github.com/Vanilagy/mediabunny.
|
|
|
7002
7002
|
The complete MPL-2.0 text is shipped in THIRD_PARTY_LICENSES.txt.
|
|
7003
7003
|
|
|
7004
7004
|
==============================================================================
|
|
7005
|
-
Components: @bendyline/squisq-video-react@2.5.
|
|
7005
|
+
Components: @bendyline/squisq-video-react@2.5.10, @ffmpeg/core@0.12.10, @ffmpeg/ffmpeg@0.12.15, @ffmpeg/types@0.12.4, @ffmpeg/util@0.12.2
|
|
7006
7006
|
Source files: node_modules/@bendyline/squisq-video-react/THIRD_PARTY_LICENSES.txt
|
|
7007
7007
|
==============================================================================
|
|
7008
7008
|
THIRD-PARTY LICENSES FOR @bendyline/squisq-video-react
|
|
@@ -7720,7 +7720,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
7720
7720
|
SOFTWARE.
|
|
7721
7721
|
|
|
7722
7722
|
==============================================================================
|
|
7723
|
-
Components: @chevrotain/types@11.1.2, dompurify@3.4.
|
|
7723
|
+
Components: @chevrotain/types@11.1.2, dompurify@3.4.17
|
|
7724
7724
|
Source files: node_modules/@chevrotain/types/LICENSE.txt, node_modules/dompurify/LICENSE
|
|
7725
7725
|
==============================================================================
|
|
7726
7726
|
|
|
@@ -9848,7 +9848,7 @@ THE SOFTWARE.
|
|
|
9848
9848
|
```
|
|
9849
9849
|
|
|
9850
9850
|
==============================================================================
|
|
9851
|
-
Components: dompurify@3.4.
|
|
9851
|
+
Components: dompurify@3.4.17
|
|
9852
9852
|
Source files: node_modules/dompurify/LICENSE-MPL
|
|
9853
9853
|
==============================================================================
|
|
9854
9854
|
Mozilla Public License Version 2.0
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
AiDiagramDialog,
|
|
3
3
|
AiIllustratePanel,
|
|
4
4
|
DiagramPreview
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-45YTIVYS.js";
|
|
6
|
+
import "./chunk-NOYDVL6M.js";
|
|
7
|
+
import "./chunk-KHQ44ZFA.js";
|
|
8
|
+
import "./chunk-T42BH6YX.js";
|
|
7
9
|
import "./chunk-K4I3NJFL.js";
|
|
8
10
|
import "./chunk-VJPGZCFS.js";
|
|
9
11
|
export {
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AiDiagramDialog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-45YTIVYS.js";
|
|
4
4
|
import {
|
|
5
5
|
AiGenerationStatus,
|
|
6
6
|
STUDY_AID_KINDS,
|
|
7
7
|
STUDY_AID_LABELS
|
|
8
8
|
} from "./chunk-XNT66JC2.js";
|
|
9
|
+
import {
|
|
10
|
+
AiFactsIndicator,
|
|
11
|
+
AiKnowledgeIndicator,
|
|
12
|
+
factCheckRequest,
|
|
13
|
+
factsNeedReview,
|
|
14
|
+
useAiKnowledge,
|
|
15
|
+
useFactCheck
|
|
16
|
+
} from "./chunk-NOYDVL6M.js";
|
|
9
17
|
import {
|
|
10
18
|
useConfirmDialog
|
|
11
19
|
} from "./chunk-KBUHWZCF.js";
|
|
20
|
+
import "./chunk-KHQ44ZFA.js";
|
|
12
21
|
import {
|
|
13
22
|
useMenuKeyboard
|
|
14
23
|
} from "./chunk-GMA4KGGO.js";
|
|
@@ -28,7 +37,7 @@ import {
|
|
|
28
37
|
reviewDocumentCharacters,
|
|
29
38
|
sanitizeGeneratedMarkdown,
|
|
30
39
|
withoutPictureFindings
|
|
31
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-T42BH6YX.js";
|
|
32
41
|
import {
|
|
33
42
|
unavailableSentence,
|
|
34
43
|
useAiStatus
|
|
@@ -83,7 +92,7 @@ function draftCapacityNotice(request, model, expectedOutput = "") {
|
|
|
83
92
|
// src/Ai/AiEditorAssistant.tsx
|
|
84
93
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
85
94
|
var AiStudyDialog = lazy(
|
|
86
|
-
() => import("./AiStudyDialog-
|
|
95
|
+
() => import("./AiStudyDialog-DQZVTBI7.js").then((module) => ({ default: module.AiStudyDialog }))
|
|
87
96
|
);
|
|
88
97
|
function AiToolbarControl({
|
|
89
98
|
ai,
|
|
@@ -340,7 +349,13 @@ function AiDraftDialog({
|
|
|
340
349
|
const handleRef = useRef(null);
|
|
341
350
|
const requestRef = useRef(0);
|
|
342
351
|
const { confirm: confirmAction, confirmDialog } = useConfirmDialog();
|
|
352
|
+
const { knowledge, ai: knowledgeAi, reset: resetKnowledge } = useAiKnowledge(ai);
|
|
343
353
|
const selectedMarkdown = capturedSelection.markdown ?? capturedSelection.text;
|
|
354
|
+
const factsGiven = useMemo(
|
|
355
|
+
() => originalRequest?.messages.filter((message) => message.role === "user").map((message) => message.content).join("\n\n") ?? "",
|
|
356
|
+
[originalRequest]
|
|
357
|
+
);
|
|
358
|
+
const facts = useFactCheck(ai, running ? null : draft, knowledge, factsGiven);
|
|
344
359
|
const draftRequest = useMemo(
|
|
345
360
|
() => ({
|
|
346
361
|
...buildDraftRequest({
|
|
@@ -377,10 +392,11 @@ function AiDraftDialog({
|
|
|
377
392
|
setFinishNote(null);
|
|
378
393
|
setIncomplete(false);
|
|
379
394
|
setRunning(true);
|
|
395
|
+
if (!prefix) resetKnowledge();
|
|
380
396
|
const startedAt = Date.now();
|
|
381
397
|
setGeneration({ progress: null, startedAt, lastActivityAt: startedAt });
|
|
382
|
-
const handle =
|
|
383
|
-
if (requestRef.current !== requestId) return;
|
|
398
|
+
const handle = knowledgeAi.chat(request, (event) => {
|
|
399
|
+
if (requestRef.current !== requestId || event.kind === "knowledge") return;
|
|
384
400
|
if (event.kind === "progress") {
|
|
385
401
|
setGeneration(
|
|
386
402
|
(current) => current && {
|
|
@@ -435,7 +451,7 @@ function AiDraftDialog({
|
|
|
435
451
|
});
|
|
436
452
|
handleRef.current = handle;
|
|
437
453
|
},
|
|
438
|
-
[
|
|
454
|
+
[knowledgeAi, resetKnowledge, documentSource]
|
|
439
455
|
);
|
|
440
456
|
const generate = useCallback(async () => {
|
|
441
457
|
if (running || draftCapacityNotice(draftRequest, model)?.blocked) return;
|
|
@@ -463,6 +479,22 @@ function AiDraftDialog({
|
|
|
463
479
|
if (running) return;
|
|
464
480
|
const replacement = sanitizeGeneratedMarkdown(draft ?? "", documentSource);
|
|
465
481
|
if (!replacement) return;
|
|
482
|
+
const factCheck = !incomplete && ai.checkFacts && factCheckRequest(replacement, knowledge, factsGiven);
|
|
483
|
+
if (factCheck) {
|
|
484
|
+
const previousRequest = requestRef.current;
|
|
485
|
+
const checked = await ai.checkFacts?.(factCheck);
|
|
486
|
+
if (requestRef.current !== previousRequest) return;
|
|
487
|
+
if (checked?.ok && factsNeedReview(checked.value)) {
|
|
488
|
+
const count = checked.value.unsourced.length;
|
|
489
|
+
const accepted = await confirmAction({
|
|
490
|
+
title: "Use details no source shows?",
|
|
491
|
+
message: `${count} ${count === 1 ? "statement in this draft includes" : "statements in this draft include"} names, dates or numbers that neither your document nor the reference passages show. The model may have written them from memory. Check them before you rely on them.`,
|
|
492
|
+
confirmLabel: mode === "rewrite" ? "Replace anyway" : "Insert anyway",
|
|
493
|
+
cancelLabel: "Review draft"
|
|
494
|
+
});
|
|
495
|
+
if (!accepted || requestRef.current !== previousRequest) return;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
466
498
|
if (incomplete) {
|
|
467
499
|
const previousRequest = requestRef.current;
|
|
468
500
|
const accepted = await confirmAction({
|
|
@@ -502,7 +534,10 @@ function AiDraftDialog({
|
|
|
502
534
|
replaceSelection,
|
|
503
535
|
running,
|
|
504
536
|
incomplete,
|
|
505
|
-
confirmAction
|
|
537
|
+
confirmAction,
|
|
538
|
+
ai,
|
|
539
|
+
knowledge,
|
|
540
|
+
factsGiven
|
|
506
541
|
]);
|
|
507
542
|
const dialog = /* @__PURE__ */ jsxs(
|
|
508
543
|
Dialog,
|
|
@@ -516,7 +551,7 @@ function AiDraftDialog({
|
|
|
516
551
|
bodyClassName: "db-ai-draft-body",
|
|
517
552
|
footerClassName: "db-ai-draft-footer",
|
|
518
553
|
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
519
|
-
(running || finishNote || error || capacity) && /* @__PURE__ */ jsxs("div", { className: "db-ai-footer-status", children: [
|
|
554
|
+
(running || finishNote || error || capacity || knowledge || facts?.checked) && /* @__PURE__ */ jsxs("div", { className: "db-ai-footer-status", children: [
|
|
520
555
|
running && generation && /* @__PURE__ */ jsx(
|
|
521
556
|
AiGenerationStatus,
|
|
522
557
|
{
|
|
@@ -524,6 +559,8 @@ function AiDraftDialog({
|
|
|
524
559
|
characters: Math.max(0, (draft?.length ?? 0) - prefixCharacters)
|
|
525
560
|
}
|
|
526
561
|
),
|
|
562
|
+
/* @__PURE__ */ jsx(AiKnowledgeIndicator, { knowledge }),
|
|
563
|
+
!running && /* @__PURE__ */ jsx(AiFactsIndicator, { check: facts }),
|
|
527
564
|
finishNote && /* @__PURE__ */ jsx("p", { className: "db-ai-note", children: finishNote }),
|
|
528
565
|
!running && capacity && /* @__PURE__ */ jsx("p", { className: "db-ai-note", role: "status", children: capacity.message }),
|
|
529
566
|
error && /* @__PURE__ */ jsx("p", { className: "db-ai-error", role: "alert", children: error })
|
|
@@ -618,6 +655,7 @@ function AiReviewPanel({ ai, onClose }) {
|
|
|
618
655
|
const handleRef = useRef(null);
|
|
619
656
|
const requestRef = useRef(0);
|
|
620
657
|
const startedRef = useRef(false);
|
|
658
|
+
const { knowledge, ai: knowledgeAi, reset: resetKnowledge } = useAiKnowledge(ai);
|
|
621
659
|
const cancelReview = useCallback(() => {
|
|
622
660
|
requestRef.current += 1;
|
|
623
661
|
handleRef.current?.cancel();
|
|
@@ -647,8 +685,9 @@ function AiReviewPanel({ ai, onClose }) {
|
|
|
647
685
|
setResolvedIds(/* @__PURE__ */ new Set());
|
|
648
686
|
setApplyErrorId(null);
|
|
649
687
|
setError(null);
|
|
650
|
-
|
|
651
|
-
|
|
688
|
+
resetKnowledge();
|
|
689
|
+
const handle = knowledgeAi.chat(buildReviewRequest(source), (event) => {
|
|
690
|
+
if (requestRef.current !== requestId || event.kind === "delta" || event.kind === "progress" || event.kind === "knowledge")
|
|
652
691
|
return;
|
|
653
692
|
handleRef.current = null;
|
|
654
693
|
if (event.kind === "error") {
|
|
@@ -672,7 +711,7 @@ function AiReviewPanel({ ai, onClose }) {
|
|
|
672
711
|
setPhase("ready");
|
|
673
712
|
});
|
|
674
713
|
handleRef.current = handle;
|
|
675
|
-
}, [
|
|
714
|
+
}, [knowledgeAi, resetKnowledge, markdownSource]);
|
|
676
715
|
useEffect(() => {
|
|
677
716
|
if (startedRef.current) return;
|
|
678
717
|
startedRef.current = true;
|
|
@@ -733,6 +772,7 @@ function AiReviewPanel({ ai, onClose }) {
|
|
|
733
772
|
/* @__PURE__ */ jsx("span", { className: "db-ai-spinner", "aria-hidden": "true" }),
|
|
734
773
|
" Reviewing this document\u2026"
|
|
735
774
|
] }),
|
|
775
|
+
phase !== "idle" && knowledge && /* @__PURE__ */ jsx("div", { className: "db-ai-review-knowledge", children: /* @__PURE__ */ jsx(AiKnowledgeIndicator, { knowledge }) }),
|
|
736
776
|
phase === "error" && error && /* @__PURE__ */ jsx("div", { className: "db-ai-review-empty db-ai-error", role: "alert", children: error }),
|
|
737
777
|
cutOff && phase === "ready" && /* @__PURE__ */ jsxs("div", { className: "db-ai-review-stale", role: "status", children: [
|
|
738
778
|
"The AI ran out of room after ",
|
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
withStudyAidFrontmatter,
|
|
10
10
|
writeStudyAid
|
|
11
11
|
} from "./chunk-XNT66JC2.js";
|
|
12
|
+
import {
|
|
13
|
+
AiKnowledgeIndicator,
|
|
14
|
+
useAiKnowledge
|
|
15
|
+
} from "./chunk-NOYDVL6M.js";
|
|
16
|
+
import "./chunk-KHQ44ZFA.js";
|
|
12
17
|
import {
|
|
13
18
|
AiReportButton,
|
|
14
19
|
bodyLine,
|
|
@@ -25,7 +30,7 @@ import {
|
|
|
25
30
|
extractNumbers,
|
|
26
31
|
sanitizeGeneratedMarkdown,
|
|
27
32
|
stripReasoning
|
|
28
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-T42BH6YX.js";
|
|
29
34
|
import {
|
|
30
35
|
unavailableSentence,
|
|
31
36
|
useAiStatus
|
|
@@ -902,6 +907,7 @@ function AiStudyDialog({
|
|
|
902
907
|
const primaryRef = useRef(null);
|
|
903
908
|
const controllerRef = useRef(null);
|
|
904
909
|
const requestRef = useRef(0);
|
|
910
|
+
const { knowledge, ai: knowledgeAi, reset: resetKnowledge } = useAiKnowledge(ai);
|
|
905
911
|
useEffect(
|
|
906
912
|
() => () => {
|
|
907
913
|
requestRef.current += 1;
|
|
@@ -972,8 +978,9 @@ function AiStudyDialog({
|
|
|
972
978
|
setNotes([]);
|
|
973
979
|
setShowSource(false);
|
|
974
980
|
setGeneration({ progress: null, startedAt, lastActivityAt: startedAt });
|
|
981
|
+
resetKnowledge();
|
|
975
982
|
const outcome = await generateStudyAid({
|
|
976
|
-
ai,
|
|
983
|
+
ai: knowledgeAi,
|
|
977
984
|
kind,
|
|
978
985
|
source: documentSource,
|
|
979
986
|
sourceName: documentName,
|
|
@@ -1008,7 +1015,7 @@ function AiStudyDialog({
|
|
|
1008
1015
|
if (saveError === null) setSaved({ status: "found", aid });
|
|
1009
1016
|
else setError(`The ${labels.noun} could not be saved: ${saveError}`);
|
|
1010
1017
|
}, [
|
|
1011
|
-
|
|
1018
|
+
knowledgeAi,
|
|
1012
1019
|
budget,
|
|
1013
1020
|
container,
|
|
1014
1021
|
documentName,
|
|
@@ -1018,6 +1025,7 @@ function AiStudyDialog({
|
|
|
1018
1025
|
model,
|
|
1019
1026
|
onEvent,
|
|
1020
1027
|
ready,
|
|
1028
|
+
resetKnowledge,
|
|
1021
1029
|
running
|
|
1022
1030
|
]);
|
|
1023
1031
|
const stop = useCallback(() => controllerRef.current?.abort(), []);
|
|
@@ -1072,6 +1080,7 @@ function AiStudyDialog({
|
|
|
1072
1080
|
const viewer = shown && /* @__PURE__ */ jsxs("div", { className: "db-ai-study-result", children: [
|
|
1073
1081
|
/* @__PURE__ */ jsx(StudyAidViewer, { kind, markdown: shown.markdown }),
|
|
1074
1082
|
notes.map((note) => /* @__PURE__ */ jsx("p", { className: "db-ai-note", children: note }, note)),
|
|
1083
|
+
/* @__PURE__ */ jsx(AiKnowledgeIndicator, { knowledge }),
|
|
1075
1084
|
/* @__PURE__ */ jsxs("div", { className: "db-ai-study-meta", children: [
|
|
1076
1085
|
/* @__PURE__ */ jsxs("p", { className: "db-ai-disclaimer", children: [
|
|
1077
1086
|
describeProvenance(shown.provenance),
|
|
@@ -1107,7 +1116,8 @@ function AiStudyDialog({
|
|
|
1107
1116
|
] });
|
|
1108
1117
|
const progress = running && /* @__PURE__ */ jsxs("div", { className: "db-ai-study-running", children: [
|
|
1109
1118
|
/* @__PURE__ */ jsx("p", { className: "db-ai-study-stage", "aria-live": "polite", children: stageLabel(kind, stage) }),
|
|
1110
|
-
generation && /* @__PURE__ */ jsx(AiGenerationStatus, { state: generation, characters: 0 })
|
|
1119
|
+
generation && /* @__PURE__ */ jsx(AiGenerationStatus, { state: generation, characters: 0 }),
|
|
1120
|
+
/* @__PURE__ */ jsx(AiKnowledgeIndicator, { knowledge })
|
|
1111
1121
|
] });
|
|
1112
1122
|
const dialog = /* @__PURE__ */ jsx(
|
|
1113
1123
|
Dialog,
|
|
@@ -79,7 +79,7 @@ function loadRunExportModule() {
|
|
|
79
79
|
var ExportCancelledError = class extends Error {
|
|
80
80
|
};
|
|
81
81
|
var AudioExportDialog = lazy(
|
|
82
|
-
() => import("./AudioExportDialog-
|
|
82
|
+
() => import("./AudioExportDialog-EICCBSSE.js").then((module) => ({
|
|
83
83
|
default: module.AudioExportDialog
|
|
84
84
|
}))
|
|
85
85
|
);
|