@ckeditor/ckeditor5-ai 48.2.0-alpha.7 → 48.3.0-alpha.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/dist/aiactions/aiactions.d.ts +74 -73
- package/dist/aiactions/model/aiactionsinteraction.d.ts +53 -53
- package/dist/aiactions/model/aiactionsreply.d.ts +18 -18
- package/dist/aiassistant/adapters/aiadapter.d.ts +48 -48
- package/dist/aiassistant/adapters/aitextadapter.d.ts +133 -133
- package/dist/aiassistant/adapters/awstextadapter.d.ts +42 -42
- package/dist/aiassistant/adapters/openaitextadapter.d.ts +184 -184
- package/dist/aiassistant/aiassistant.d.ts +436 -436
- package/dist/aiassistant/aiassistantediting.d.ts +51 -51
- package/dist/aiassistant/aiassistantui.d.ts +53 -53
- package/dist/aiassistant/legacyerrors.d.ts +0 -4
- package/dist/aiassistant/ui/aiassistantcontroller.d.ts +106 -105
- package/dist/aiassistant/ui/form/aiformcontentarea.d.ts +43 -43
- package/dist/aiassistant/ui/form/aiformerrorview.d.ts +19 -19
- package/dist/aiassistant/ui/form/aiformpromptview.d.ts +38 -38
- package/dist/aiassistant/ui/form/aiformtoolbarview.d.ts +50 -50
- package/dist/aiassistant/ui/form/aiformview.d.ts +121 -121
- package/dist/aiassistant/ui/form/aihistorylistitemview.d.ts +13 -13
- package/dist/aiassistant/ui/form/aihistorylistview.d.ts +27 -27
- package/dist/aiassistant/ui/form/prompthistory.d.ts +15 -15
- package/dist/aiassistant/ui/showaiassistantcommand.d.ts +35 -35
- package/dist/aiassistant/utils/common-translations.d.ts +6 -6
- package/dist/aiassistant/utils/normalizecommandsconfig.d.ts +9 -9
- package/dist/aiballoon/aiballoon.d.ts +86 -86
- package/dist/aiballoon/ui/aiballoonview.d.ts +26 -26
- package/dist/aichat/aichat.d.ts +88 -87
- package/dist/aichat/aichatballoon.d.ts +83 -83
- package/dist/aichat/aichatcontroller.d.ts +265 -264
- package/dist/aichat/aichatui.d.ts +324 -336
- package/dist/aichat/model/aichatcontext.d.ts +623 -618
- package/dist/aichat/model/aichatconversation.d.ts +257 -268
- package/dist/aichat/model/aichatinteraction.d.ts +40 -40
- package/dist/aichat/ui/aichatballoonview.d.ts +103 -103
- package/dist/aichat/ui/aichatcontrolsview.d.ts +130 -130
- package/dist/aichat/ui/aichatfeedview.d.ts +136 -136
- package/dist/aichat/ui/aichatview.d.ts +41 -41
- package/dist/aichat/ui/controls/aichatchipsoverflowmanager.d.ts +63 -63
- package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +41 -41
- package/dist/aichat/ui/controls/aichatcontextpanelurlinputview.d.ts +79 -79
- package/dist/aichat/ui/controls/aichatcontextpanelview.d.ts +103 -103
- package/dist/aichat/ui/controls/aichatcontrolsloaderview.d.ts +8 -8
- package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +18 -18
- package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +81 -81
- package/dist/aichat/ui/controls/aichatpromptinputview.d.ts +44 -44
- package/dist/aichat/ui/controls/aichatpromptsuggestionslistview.d.ts +13 -13
- package/dist/aichat/ui/controls/resources/aichatcontextresourceslistview.d.ts +44 -44
- package/dist/aichat/ui/controls/resources/aichatcontextresourcesview.d.ts +52 -52
- package/dist/aichat/ui/controls/resources/aichatresourcelistitemview.d.ts +56 -56
- package/dist/aichat/ui/controls/resources/aichatresourcesballoonview.d.ts +104 -104
- package/dist/aichat/ui/controls/resources/aichatresourcessearchinputview.d.ts +53 -53
- package/dist/aichat/ui/feed/aichatfeedcontextchipsview.d.ts +22 -22
- package/dist/aichat/ui/feed/aichatfeedcustomelementview.d.ts +33 -33
- package/dist/aichat/ui/feed/aichatfeederroritemview.d.ts +32 -32
- package/dist/aichat/ui/feed/aichatfeedinteractionheaderview.d.ts +24 -24
- package/dist/aichat/ui/feed/aichatfeeditemview.d.ts +39 -39
- package/dist/aichat/ui/feed/aichatfeedreplyitemview.d.ts +40 -40
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +61 -61
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +82 -82
- package/dist/aichat/ui/feed/aichatfeedusermessageitem.d.ts +33 -33
- package/dist/aichat/utils/eventnames.d.ts +8 -4
- package/dist/aichat/utils/parsesingleurl.d.ts +0 -4
- package/dist/aichat/utils/promisequeue.d.ts +26 -25
- package/dist/aichat/utils/readdatatransferfiles.d.ts +9 -9
- package/dist/aichat/utils/resolvepaste.d.ts +58 -58
- package/dist/aichathistory/aichathistory.d.ts +26 -26
- package/dist/aichathistory/aichathistorycontroller.d.ts +36 -35
- package/dist/aichathistory/aichathistoryui.d.ts +81 -89
- package/dist/aichathistory/model/aichathistoryconversations.d.ts +95 -102
- package/dist/aichathistory/model/aichathistoryitem.d.ts +52 -53
- package/dist/aichathistory/ui/aichathistorylistitemview.d.ts +41 -40
- package/dist/aichathistory/ui/aichathistorylistview.d.ts +28 -28
- package/dist/aichathistory/ui/aichathistorysectionlistview.d.ts +16 -16
- package/dist/aichathistory/ui/aichathistoryview.d.ts +33 -33
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +295 -295
- package/dist/aichatshortcuts/ui/aichatshortcutsview.d.ts +24 -24
- package/dist/aichatshortcuts/ui/aichatshortcutview.d.ts +18 -18
- package/dist/aiconfig.d.ts +227 -227
- package/dist/aicore/aiconnector.d.ts +359 -354
- package/dist/aicore/aiediting.d.ts +97 -97
- package/dist/aicore/aierrorreporter.d.ts +73 -0
- package/dist/aicore/aigateway.d.ts +94 -54
- package/dist/aicore/errors/aicoreerror.d.ts +67 -0
- package/dist/aicore/errors/geterrorcode.d.ts +17 -0
- package/dist/aicore/errors/isaborterror.d.ts +12 -0
- package/dist/aicore/errors/normalizeerror.d.ts +18 -0
- package/dist/aicore/model/aicapabilities.d.ts +53 -52
- package/dist/aicore/model/aicontext.d.ts +61 -61
- package/dist/aicore/model/aiinteraction.d.ts +162 -168
- package/dist/aicore/model/aimodels.d.ts +73 -76
- package/dist/aicore/model/aireply.d.ts +118 -124
- package/dist/aicore/model/airunresult.d.ts +86 -86
- package/dist/aicore/pipeline/airesponseapplier.d.ts +284 -284
- package/dist/aicore/pipeline/airesponseparser.d.ts +24 -23
- package/dist/aicore/ui/aidisclaimerview.d.ts +13 -13
- package/dist/aicore/ui/aiheaderview.d.ts +28 -28
- package/dist/aicore/ui/aiskeleton.d.ts +31 -31
- package/dist/aicore/ui/aispinner.d.ts +11 -11
- package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +56 -56
- package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +80 -80
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +46 -46
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +41 -41
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +25 -28
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +25 -25
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +62 -62
- package/dist/aicore/ui/suggestioncontainer/aisuggestionheaderview.d.ts +32 -32
- package/dist/aicore/ui/suggestioncontainer/aisuggestionloaderview.d.ts +11 -11
- package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +31 -27
- package/dist/aicore/ui/suggestioncontainer/aiwebsourcesview.d.ts +24 -24
- package/dist/aicore/utils/abortabletimeout.d.ts +11 -11
- package/dist/aicore/utils/builddocumentsuggestionsmap.d.ts +30 -0
- package/dist/aicore/utils/buttonclasses.d.ts +8 -8
- package/dist/aicore/utils/cleanupstreamingartifacts.d.ts +12 -0
- package/dist/aicore/utils/common-translations.d.ts +6 -6
- package/dist/aicore/utils/createandattachaibodycollection.d.ts +19 -0
- package/dist/aicore/utils/createresizebutton.d.ts +9 -9
- package/dist/aicore/utils/createstartconversationbutton.d.ts +8 -8
- package/dist/aicore/utils/documentposition.d.ts +37 -37
- package/dist/aicore/utils/documentrange.d.ts +41 -41
- package/dist/aicore/utils/eventnames.d.ts +5 -5
- package/dist/aicore/utils/geteditorsfromcontext.d.ts +13 -13
- package/dist/aicore/utils/getoperationsfordocumentsuggestions.d.ts +22 -0
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +18 -18
- package/dist/aicore/utils/htmlparser.d.ts +17 -17
- package/dist/aicore/utils/htmlstreamer.d.ts +79 -79
- package/dist/aicore/utils/markoperationsasai.d.ts +23 -0
- package/dist/aicore/utils/scrollmanager.d.ts +24 -23
- package/dist/aicore/utils/showaitab.d.ts +1 -0
- package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +87 -0
- package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +19 -0
- package/dist/aieditorintegration/aieditorintegration.d.ts +32 -32
- package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +34 -34
- package/dist/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +12 -12
- package/dist/aiquickactions/aiquickactions.d.ts +250 -250
- package/dist/aiquickactions/aiquickactionscommand.d.ts +10 -10
- package/dist/aiquickactions/aiquickactionsediting.d.ts +22 -22
- package/dist/aiquickactions/aiquickactionsui.d.ts +125 -124
- package/dist/aiquickactions/ui/aiquickactionsbuttoncreator.d.ts +57 -57
- package/dist/aiquickactions/ui/aiquickactionsdropdowncontentview.d.ts +45 -45
- package/dist/aiquickactions/ui/aiquickactionsdropdowncreator.d.ts +59 -59
- package/dist/aiquickactions/ui/aiquickactionsfilteredlistview.d.ts +0 -4
- package/dist/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.d.ts +12 -12
- package/dist/aiquickactions/ui/balloon/aiactionsballoontoolbarview.d.ts +32 -32
- package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +129 -125
- package/dist/aiquickactions/ui/dropdownmenubuttonwithhighlightview.d.ts +24 -24
- package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +34 -29
- package/dist/aireviewcore/aireviewcorecontroller.d.ts +48 -48
- package/dist/aireviewcore/aireviewcoreediting.d.ts +216 -224
- package/dist/aireviewcore/aireviewcoreui.d.ts +84 -84
- package/dist/aireviewcore/model/aireviewcheck.d.ts +49 -49
- package/dist/aireviewcore/model/aireviewchecklist.d.ts +29 -28
- package/dist/aireviewcore/model/aireviewcheckresult.d.ts +36 -35
- package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +51 -50
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +140 -151
- package/dist/aireviewcore/model/aireviewsystemcheckrun.d.ts +16 -16
- package/dist/aireviewcore/types.d.ts +24 -24
- package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +34 -34
- package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +57 -65
- package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +56 -56
- package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +9 -9
- package/dist/aireviewcore/ui/aireviewcoregeneralerrorview.d.ts +20 -20
- package/dist/aireviewcore/ui/aireviewcorepromptinputview.d.ts +25 -25
- package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +22 -22
- package/dist/aireviewcore/ui/aireviewcorereviewcommandlistitemview.d.ts +37 -39
- package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +14 -14
- package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +85 -87
- package/dist/aireviewcore/ui/aireviewcoreview.d.ts +50 -50
- package/dist/aireviewcore/ui/form/aireviewcoreformdropdown.d.ts +16 -16
- package/dist/aireviewcore/ui/form/aireviewcoreformmanager.d.ts +12 -12
- package/dist/aireviewmode/aireviewcheckdefinitions.d.ts +12 -12
- package/dist/aireviewmode/aireviewgateway.d.ts +141 -149
- package/dist/aireviewmode/aireviewmode.d.ts +184 -184
- package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +34 -34
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +23 -22
- package/dist/aireviewmode/aireviewmodeui.d.ts +17 -17
- package/dist/aireviewmode/model/aireviewcheckcustom.d.ts +16 -16
- package/dist/aireviewmode/model/aireviewcheckextra.d.ts +30 -30
- package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +17 -17
- package/dist/aireviewmode/model/aireviewextracheckrun.d.ts +15 -15
- package/dist/aireviewmode/model/aireviewmodechecklist.d.ts +22 -22
- package/dist/aireviewmode/model/aireviewrunresult.d.ts +15 -15
- package/dist/aitabs/aitabs.d.ts +84 -84
- package/dist/aitabs/aitabsmainview.d.ts +46 -46
- package/dist/aitabs/tabs/aitabsview.d.ts +194 -188
- package/dist/aitabs/tabs/tabbuttonview.d.ts +39 -39
- package/dist/aitabs/tabs/tabpanelview.d.ts +39 -39
- package/dist/aitranslate/aitranslate.d.ts +162 -129
- package/dist/aitranslate/aitranslatecheckregistry.d.ts +22 -22
- package/dist/aitranslate/aitranslatecontroller.d.ts +17 -15
- package/dist/aitranslate/aitranslategateway.d.ts +77 -0
- package/dist/aitranslate/aitranslateui.d.ts +18 -18
- package/dist/aitranslate/model/aitranslatecheck.d.ts +12 -12
- package/dist/aitranslate/model/aitranslatechecklist.d.ts +11 -11
- package/dist/aitranslate/model/aitranslatecheckrun.d.ts +23 -23
- package/dist/aitranslate/model/aitranslaterunresult.d.ts +20 -0
- package/dist/aitranslate/ui/aitranslatechecklistview.d.ts +7 -8
- package/dist/aitranslate/ui/aitranslatecheckresultsview.d.ts +11 -11
- package/dist/augmentation.d.ts +77 -73
- package/dist/errors.d.ts +0 -4
- package/dist/errorsmap.d.ts +5 -5
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +11 -8
- package/dist/index.css +11 -8
- package/dist/index.d.ts +70 -63
- package/dist/index.js +19 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -12
- package/dist/aicore/utils/getoperationsfromreply.d.ts +0 -26
|
@@ -1,281 +1,282 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { ContextPlugin, Editor } from
|
|
10
|
-
import { AIConnector } from
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { type
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
6
|
+
* @module ai/aichat/aichatcontroller
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { AIConnector } from "../aicore/aiconnector.js";
|
|
11
|
+
import { AIErrorSink } from "../aicore/aierrorreporter.js";
|
|
12
|
+
import { AIChatConversation, type AIChatInteractionCreatedEvent } from "./model/aichatconversation.js";
|
|
13
|
+
import { type AIInteractionReplyCreatedEvent, type AIToolData } from "../aicore/model/aiinteraction.js";
|
|
14
|
+
import { type AIChatInteraction } from "./model/aichatinteraction.js";
|
|
15
|
+
import { DocumentCompare } from "@ckeditor/ckeditor5-collaboration-core";
|
|
16
|
+
import { type AIChatFeedCustomElementView } from "./ui/feed/aichatfeedcustomelementview.js";
|
|
16
17
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
* Implements integration layer between AI Chat feature UI and logic.
|
|
19
|
+
*
|
|
20
|
+
* Provides an API to interact with AI Chat feature.
|
|
21
|
+
*
|
|
22
|
+
* @experimental **Experimental:** Some methods of this class are production-ready but experimental and may change
|
|
23
|
+
* in minor releases without the standard deprecation policy. Check the changelog for migration guidance.
|
|
24
|
+
*/
|
|
24
25
|
export declare class AIChatController extends ContextPlugin {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Active conversation (currently open and visible in UI).
|
|
28
|
+
*/
|
|
29
|
+
activeConversation?: AIChatConversation;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the chat controller has finished its initialization (models loaded, conversation started).
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
*/
|
|
35
|
+
isConversationReady: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, DocumentCompare]>;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
static get pluginName(): "AIChatController";
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
static override get isOfficialPlugin(): true;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
static override get isPremiumPlugin(): true;
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
init(): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
afterInit(): void;
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
override destroy(): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Loads a conversation by its ID and sets it as the active conversation.
|
|
66
|
+
*/
|
|
67
|
+
loadConversation(conversationId: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Registers a function that is called when data from a custom AI tool is received from the backend service.
|
|
70
|
+
*
|
|
71
|
+
* This data can only be received if you connect your own custom AI tool with the Cloud Services AI backend. By registering a callback
|
|
72
|
+
* function, you can implement custom handling for this data, such as displaying custom elements inside the AI chat component, or
|
|
73
|
+
* setting a custom loading message.
|
|
74
|
+
*
|
|
75
|
+
* When data is received, the callback is immediately called with two parameters:
|
|
76
|
+
*
|
|
77
|
+
* * `toolData` – data returned by the AI tool,
|
|
78
|
+
* * `api` – {@link module:ai/aichat/aichatcontroller~AIChatFeedAPI set of tools} which you can use to reflect the received AI tool data
|
|
79
|
+
* in the AI chat feed.
|
|
80
|
+
*
|
|
81
|
+
* The callback is called for data received from all tools that you have connected, and both for tool results and tool notifications.
|
|
82
|
+
* Check `toolData.toolName` and `toolData.type` to handle various tools and actions. You can register multiple callbacks to better
|
|
83
|
+
* organize your code.
|
|
84
|
+
*
|
|
85
|
+
* Please remember, that your tool is fully responsible for generating the contents of `toolData.data` and `toolData.attributes`.
|
|
86
|
+
*
|
|
87
|
+
* Example usage:
|
|
88
|
+
*
|
|
89
|
+
* 1. Register a callback that changes the loading message when tool "my-tool" returns a notification:
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* aiChat.registerToolDataCallback( ( toolData, api ) => {
|
|
93
|
+
* if ( toolData.toolName === 'my-tool' && toolData.type === 'notification' ) {
|
|
94
|
+
* api.setLoadingMessage( toolData.data.message );
|
|
95
|
+
* }
|
|
96
|
+
* } );
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* 2. Register a callback to create a custom text chat reply based on custom tool data:
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* aiChat.registerToolDataCallback( ( toolData, api ) => {
|
|
103
|
+
* if ( toolData.type == 'result' ) {
|
|
104
|
+
* api.insertTextReply( toolData.toolName + ': ' + toolData.data.msg );
|
|
105
|
+
* }
|
|
106
|
+
* } );
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* 3. Register a callback to insert a custom element into the chat feed based on custom tool data:
|
|
110
|
+
*
|
|
111
|
+
* ```ts
|
|
112
|
+
* aiChat.registerToolDataCallback( async ( toolData, api ) => {
|
|
113
|
+
* if ( toolData.type == 'result' && toolData.data.html ) {
|
|
114
|
+
* api.insertCustomElement( toolData.data.html )
|
|
115
|
+
* .then( ( customElementView ) => {
|
|
116
|
+
* // You can further manipulate the inserted custom element using `customElementView`.
|
|
117
|
+
* // For example, you can fetch some data asynchronously and put it into the element.
|
|
118
|
+
* // Use `customElementView.element` to reference the created DOM structure.
|
|
119
|
+
* // The `customElementView.element` is a wrapper element of a custom UI HTML provided.
|
|
120
|
+
* } );
|
|
121
|
+
* }
|
|
122
|
+
* } );
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
126
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
127
|
+
* @param callback A callback function that is called when tool data is received.
|
|
128
|
+
*/
|
|
129
|
+
registerToolDataCallback(callback: AIToolEventCallback): void;
|
|
130
|
+
/**
|
|
131
|
+
* Adds the current document to the chat context.
|
|
132
|
+
*/
|
|
133
|
+
addCurrentDocumentToChatContext(): void;
|
|
134
|
+
/**
|
|
135
|
+
* Adds current document selection to the conversation context. If document is not added to the context, it is added as well.
|
|
136
|
+
*
|
|
137
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
138
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
139
|
+
*/
|
|
140
|
+
addSelectionToChatContext(editor: Editor): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Removes current document selection from the conversation context.
|
|
143
|
+
*
|
|
144
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
145
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
146
|
+
*/
|
|
147
|
+
removeSelectionFromChatContext(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Moves focus to the AI Chat prompt input field.
|
|
150
|
+
*
|
|
151
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
152
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
153
|
+
*/
|
|
154
|
+
focusPromptInput(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new, empty conversation.
|
|
157
|
+
*
|
|
158
|
+
* @param options Optional parameters for starting the conversation.
|
|
159
|
+
* @param options.modelId If provided, this model will be selected for the new conversation instead of the default one.
|
|
160
|
+
*/
|
|
161
|
+
startConversation(options?: {
|
|
162
|
+
modelId?: string;
|
|
163
|
+
}): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Submits a user message to the currently active conversation.
|
|
166
|
+
*/
|
|
167
|
+
sendMessage(messageData: AIChatUserMessageData): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Returns the ID under which conversations are grouped. All created conversations will have this `groupId` set. Conversation history
|
|
170
|
+
* will fetch conversations with such `groupId`.
|
|
171
|
+
*
|
|
172
|
+
* This is equal to the channelId passed in context/editor configuration.
|
|
173
|
+
*/
|
|
174
|
+
getGroupId(): string;
|
|
175
|
+
/**
|
|
176
|
+
* Starts an AI chat conversation safely, catching and logging any errors.
|
|
177
|
+
*
|
|
178
|
+
* @param options Options for starting the conversation.
|
|
179
|
+
* @param options.id Optional conversation ID. If provided, initializes an existing conversation.
|
|
180
|
+
* If not defined, starts a new conversation with a generated ID.
|
|
181
|
+
* @param options.modelId Optional model ID to use for the conversation. If not provided, the default model is used.
|
|
182
|
+
*/
|
|
183
|
+
protected _startConversationSafely(options?: {
|
|
184
|
+
id?: string;
|
|
185
|
+
modelId?: string;
|
|
186
|
+
}): Promise<void>;
|
|
186
187
|
}
|
|
187
188
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
* Data for the message send by the user in the AI chat.
|
|
190
|
+
*/
|
|
190
191
|
export type AIChatUserMessageData = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
192
|
+
/**
|
|
193
|
+
* The query that the user provided for the message. Displayed in the chat feed as the user's message.
|
|
194
|
+
*/
|
|
195
|
+
message: string;
|
|
196
|
+
/**
|
|
197
|
+
* Additional parameters for the message. This data is stored together with the message and can influence how the message is processed
|
|
198
|
+
* or displayed.
|
|
199
|
+
*
|
|
200
|
+
* You can pass following properties to alter how the message behaves:
|
|
201
|
+
*
|
|
202
|
+
* * `displayedPrompt: string` - If set, will be displayed instead of the actual `message`. You can use it to display a shorter,
|
|
203
|
+
* or a friendlier user message. This is also respected in the conversation history. Original `message` will still be used to query
|
|
204
|
+
* the AI model.
|
|
205
|
+
*
|
|
206
|
+
* Besides supported properties, `attributes` can be used to save any additional metadata with the message, which can be used by your
|
|
207
|
+
* integration in any way. Data passed in `attributes` will be saved in the conversation history. If your integration connects external
|
|
208
|
+
* custom AI tools, `attributes` are passed to the tool calls and can be used by these tools.
|
|
209
|
+
*
|
|
210
|
+
* Additionally, other official features that interact with the AI chat feature may introduce their own attributes.
|
|
211
|
+
*/
|
|
212
|
+
attributes?: Record<string, unknown>;
|
|
212
213
|
};
|
|
213
214
|
/**
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
* Set of helpers dedicated to be used inside {@link module:ai/aichat/aichatcontroller~AIToolEventCallback callbacks} registered
|
|
216
|
+
* through {@link module:ai/aichat/aichatcontroller~AIChatController#registerToolDataCallback}.
|
|
217
|
+
*
|
|
218
|
+
* Using this tools you can manipulate AI chat feed (e.g. add custom replies) in response to the received custom AI tool data.
|
|
219
|
+
*
|
|
220
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
221
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
222
|
+
*/
|
|
222
223
|
export interface AIChatFeedAPI {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Creates a new reply in the current interaction. The created reply becomes the current reply of the interaction.
|
|
226
|
+
*
|
|
227
|
+
* Passing an `id` is optional. When passed, it is added to the wrapping HTML element as `data-cke-ai-id` attribute,
|
|
228
|
+
* allowing to query it later with native DOM methods.
|
|
229
|
+
*
|
|
230
|
+
* This method allows adding custom text replies to the AI chat feed. You can pass plain text or Markdown-formatted text
|
|
231
|
+
* as the `content` parameter. Markdown is automatically converted to proper HTML formatting when rendered in the chat feed.
|
|
232
|
+
*
|
|
233
|
+
* Note, that the text reply is **not** immediately inserted into the UI when this method is called. Insertions are queued
|
|
234
|
+
* to ensure the reply is rendered after currently processed content.
|
|
235
|
+
*
|
|
236
|
+
* Note also, that the content of the reply is visually streamed in the chat feed (word by word),
|
|
237
|
+
* so it will appear gradually.
|
|
238
|
+
*/
|
|
239
|
+
insertTextReply: (content: string, id?: string) => ReturnType<AIChatInteraction["createReply"]>;
|
|
240
|
+
/**
|
|
241
|
+
* Inserts a custom element into the AI chat feed. The element can be provided as a HTML string or as a `HTMLElement`.
|
|
242
|
+
*
|
|
243
|
+
* Passing an `id` is optional. When passed, it is added to the wrapping HTML element as `data-cke-ai-id` attribute,
|
|
244
|
+
* allowing to query it later with native DOM methods.
|
|
245
|
+
*
|
|
246
|
+
* Note, that the element is **not** immediately inserted into the UI when this method is called. Insertions are queued
|
|
247
|
+
* to ensure the element is rendered after currently processed content.
|
|
248
|
+
*
|
|
249
|
+
* Returns a promise which is resolved after the element is finally attached to the DOM. You can use this promise to further
|
|
250
|
+
* manage the displayed content, for example, fetch asynchronous data and display it inside the inserted element.
|
|
251
|
+
*/
|
|
252
|
+
insertCustomElement: (element: string | HTMLElement, id?: string) => Promise<AIChatFeedCustomElementView>;
|
|
253
|
+
/**
|
|
254
|
+
* Sets the currently displayed AI chat loading message.
|
|
255
|
+
*/
|
|
256
|
+
setLoadingMessage: (message: string) => void;
|
|
257
|
+
/**
|
|
258
|
+
* Clears the currently displayed AI chat loading message. No text will be shown.
|
|
259
|
+
*/
|
|
260
|
+
clearLoadingMessage: () => void;
|
|
260
261
|
}
|
|
261
262
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
* A callback type for handling custom AI tools data.
|
|
264
|
+
*
|
|
265
|
+
* This callback receives two parameters:
|
|
266
|
+
*
|
|
267
|
+
* * `toolData` - data returned by the AI tool.
|
|
268
|
+
* * `api` - set of tools which you can use to reflect the received AI tool data in the AI chat feed.
|
|
269
|
+
*/
|
|
269
270
|
export type AIToolEventCallback = (toolData: AIToolData, api: AIChatFeedAPI) => void | Promise<void>;
|
|
270
271
|
/**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
* An event emitted by `AIChatController` when an AI reply is created.
|
|
273
|
+
*
|
|
274
|
+
* @eventName ~AIChatController#replyCreated
|
|
275
|
+
*/
|
|
275
276
|
export type AIChatControllerAIReplyCreatedEvent = AIInteractionReplyCreatedEvent;
|
|
276
277
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
278
|
+
* An event emitted by `AIChatController` when an AI chat interaction is created.
|
|
279
|
+
*
|
|
280
|
+
* @eventName ~AIChatController#interactionCreated
|
|
281
|
+
*/
|
|
281
282
|
export type AIChatControllerAIInteractionCreatedEvent = AIChatInteractionCreatedEvent;
|