@ckeditor/ckeditor5-ai 48.3.1-alpha.1 → 48.4.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 +36 -1
- package/dist/aiactions/model/aiactionsinteraction.d.ts +7 -1
- package/dist/aiassistant/aiassistantui.d.ts +0 -3
- package/dist/aiballoon/aiballoon.d.ts +0 -1
- package/dist/aichat/aichatballoon.d.ts +7 -2
- package/dist/aichat/aichatcontroller.d.ts +12 -2
- package/dist/aichat/aichatui.d.ts +20 -6
- package/dist/aichat/model/aichatcontext.d.ts +29 -10
- package/dist/aichat/model/aichatconversation.d.ts +10 -1
- package/dist/aichat/model/aichatinteraction.d.ts +6 -1
- package/dist/aichat/ui/aichatballoonview.d.ts +14 -19
- package/dist/aichat/ui/aichatcontrolsview.d.ts +0 -9
- package/dist/aichat/ui/aichatfeedview.d.ts +5 -11
- package/dist/aichat/ui/aichatview.d.ts +0 -4
- package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +4 -0
- package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +14 -29
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +7 -2
- package/dist/aichathistory/aichathistoryui.d.ts +0 -1
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
- package/dist/aiconfig.d.ts +109 -0
- package/dist/aicore/aiconnector.d.ts +78 -11
- package/dist/aicore/aicore.d.ts +53 -0
- package/dist/aicore/aiediting.d.ts +8 -2
- package/dist/aicore/aigateway.d.ts +43 -11
- package/dist/aicore/errors/normalizeerror.d.ts +4 -0
- package/dist/aicore/model/aicapabilities.d.ts +20 -5
- package/dist/aicore/model/aicontext.d.ts +57 -2
- package/dist/aicore/model/aicontextlibrary.d.ts +70 -0
- package/dist/aicore/model/aicontextref.d.ts +39 -0
- package/dist/aicore/model/aidefaultcontext.d.ts +95 -0
- package/dist/aicore/model/aieditorroot.d.ts +26 -0
- package/dist/aicore/model/aimodels.d.ts +11 -4
- package/dist/aicore/model/aireply.d.ts +12 -1
- package/dist/aicore/model/airunresult.d.ts +18 -73
- package/dist/aicore/model/airunsinglerootresult.d.ts +101 -0
- package/dist/aicore/ui/aidisclaimerview.d.ts +0 -1
- package/dist/aicore/ui/aiheaderview.d.ts +0 -1
- package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
- package/dist/aicore/ui/aiskeleton.d.ts +0 -1
- package/dist/aicore/ui/aispinner.d.ts +0 -1
- package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +0 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +20 -5
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +0 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +12 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +4 -12
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +6 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +11 -1
- package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +0 -1
- package/dist/aicore/utils/createandattachaibodycollection.d.ts +0 -1
- package/dist/aicore/utils/createresizebutton.d.ts +0 -1
- package/dist/aicore/utils/createstartconversationbutton.d.ts +0 -1
- package/dist/aicore/utils/geteditorconfig.d.ts +88 -0
- package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +4 -1
- package/dist/aicore/utils/htmlparser.d.ts +1 -0
- package/dist/aicore/utils/inlineroot.d.ts +1 -0
- package/dist/aicore/utils/tocontextrefrequestdata.d.ts +1 -0
- package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +48 -25
- package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +2 -2
- package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +0 -1
- package/dist/aiquickactions/aiquickactions.d.ts +60 -9
- package/dist/aiquickactions/aiquickactionsui.d.ts +10 -4
- package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +6 -1
- package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +2 -4
- package/dist/aireviewcore/aireviewcoreediting.d.ts +43 -6
- package/dist/aireviewcore/aireviewcoreui.d.ts +3 -10
- package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
- package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +12 -1
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +11 -1
- package/dist/aireviewcore/types.d.ts +7 -1
- package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -2
- package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +7 -0
- package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +1 -19
- package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +0 -1
- package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +0 -1
- package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +0 -1
- package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +10 -8
- package/dist/aireviewcore/ui/aireviewcoreview.d.ts +3 -4
- package/dist/aireviewmode/aireviewgateway.d.ts +63 -44
- package/dist/aireviewmode/aireviewmode.d.ts +73 -5
- package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +8 -1
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +2 -1
- package/dist/aireviewmode/model/aireviewcheckextra.d.ts +7 -2
- package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +2 -1
- package/dist/aitabs/aitabsmainview.d.ts +0 -1
- package/dist/aitabs/tabs/aitabsview.d.ts +0 -1
- package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -1
- package/dist/aitranslate/aitranslatecontroller.d.ts +2 -1
- package/dist/aitranslate/aitranslategateway.d.ts +33 -21
- package/dist/aitranslate/aitranslateui.d.ts +0 -1
- package/dist/aitranslate/model/aitranslatecheckrun.d.ts +2 -1
- package/dist/augmentation.d.ts +2 -0
- package/dist/index-content.css +0 -97
- package/dist/index-editor.css +2640 -2631
- package/dist/index.css +36 -32
- package/dist/index.d.ts +17 -8
- package/dist/index.js +19 -19
- 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 +30 -12
- package/dist/aireviewmode/model/aireviewrunresult.d.ts +0 -20
- package/dist/aitranslate/model/aitranslaterunresult.d.ts +0 -20
|
@@ -7,27 +7,50 @@
|
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
9
9
|
import { ContextPlugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
|
-
import {
|
|
10
|
+
import type { AIEditorRoot } from "../aicore/model/aieditorroot.js";
|
|
11
|
+
import { AIConnector } from "../aicore/aiconnector.js";
|
|
12
|
+
import { AICore } from "../aicore/aicore.js";
|
|
13
|
+
import { type AIModels } from "../aicore/model/aimodels.js";
|
|
11
14
|
import { AIEditing } from "../aicore/aiediting.js";
|
|
12
15
|
import { AIGateway, type AIRunBaseOptions, type AIGatewayApplyOptions } from "../aicore/aigateway.js";
|
|
16
|
+
import { type AICapabilitiesConfigAdvanced } from "../aicore/model/aicapabilities.js";
|
|
13
17
|
import { AIDocumentProcessingRunResult } from "./model/aidocumentprocessingrunresult.js";
|
|
18
|
+
import { AIRunResult } from "../aicore/model/airunresult.js";
|
|
14
19
|
export type AIDocumentProcessingRunOptions = AIRunBaseOptions & {
|
|
15
20
|
/**
|
|
16
21
|
* The model that will be used to run the document processing request.
|
|
17
|
-
* The
|
|
18
|
-
* via {@link module:ai/
|
|
22
|
+
* The IDs of an AI models can be acquired
|
|
23
|
+
* via {@link module:ai/aicore/model/aimodels~AIModels#getAvailableModels} call.
|
|
19
24
|
*/
|
|
20
25
|
model: string;
|
|
26
|
+
/**
|
|
27
|
+
* The roots to process. When omitted, every non-`$graveyard` root across every editor in the current
|
|
28
|
+
* {@link module:core/context~Context `Context`} is processed. When provided, only the listed roots are
|
|
29
|
+
* processed; the order of entries in `roots` is treated as a set-membership filter and does not affect
|
|
30
|
+
* the payload order.
|
|
31
|
+
*
|
|
32
|
+
* Each entry's `channelId` must match the `collaboration.channelId` config of the target editor instance.
|
|
33
|
+
* `rootName` must match an existing, non-`$graveyard` root within that editor.
|
|
34
|
+
*/
|
|
35
|
+
roots?: Array<AIEditorRoot>;
|
|
36
|
+
/**
|
|
37
|
+
* Per-call AI capability directives. `webSearch` toggles web search; `reasoning` toggles reasoning and
|
|
38
|
+
* optionally selects a level
|
|
39
|
+
* (see {@link module:ai/aicore/model/aicapabilities~AIReasoningLevel AIReasoningLevel}).
|
|
40
|
+
* Omitting the option or leaving all flags falsy disables both capabilities for this call.
|
|
41
|
+
*/
|
|
42
|
+
capabilities?: AICapabilitiesConfigAdvanced;
|
|
21
43
|
};
|
|
22
44
|
/**
|
|
23
45
|
* Headless, stateless API for performing AI-powered transformations on entire documents through the `/documents/process` endpoint.
|
|
24
46
|
* Similar to sending a single message through the {@link module:ai/aichat/aichat~AIChat AI Chat plugin}.
|
|
25
47
|
*
|
|
26
|
-
* This API provides a simple document-processing workflow: a single `prompt` is applied to
|
|
27
|
-
*
|
|
48
|
+
* This API provides a simple document-processing workflow: a single `prompt` is applied to one or more documents,
|
|
49
|
+
* producing transformed documents with all AI-generated changes already applied.
|
|
28
50
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
51
|
+
* By default, every non-`$graveyard` root across every editor in the context is processed. To restrict a run to a
|
|
52
|
+
* subset of roots, pass the `roots` option to
|
|
53
|
+
* {@link module:ai/aidocumentprocessing/aidocumentprocessinggateway~AIDocumentProcessingGateway#processDocument}.
|
|
31
54
|
*/
|
|
32
55
|
export declare class AIDocumentProcessingGateway extends ContextPlugin {
|
|
33
56
|
/**
|
|
@@ -37,7 +60,16 @@ export declare class AIDocumentProcessingGateway extends ContextPlugin {
|
|
|
37
60
|
/**
|
|
38
61
|
* @inheritDoc
|
|
39
62
|
*/
|
|
40
|
-
static get requires(): PluginDependenciesOf<[AIConnector, AIEditing, AIGateway]>;
|
|
63
|
+
static get requires(): PluginDependenciesOf<[AIConnector, AIEditing, AIGateway, AICore]>;
|
|
64
|
+
/**
|
|
65
|
+
* The shared model registry. Exposed here so headless gateways are self-sufficient — integrators can
|
|
66
|
+
* discover and resolve models (`getAvailableModels()`, `getModel()`, `resolveModel()`, …) without
|
|
67
|
+
* reaching for the `AICore` plugin directly.
|
|
68
|
+
*
|
|
69
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
70
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
71
|
+
*/
|
|
72
|
+
get models(): AIModels;
|
|
41
73
|
/**
|
|
42
74
|
* @inheritDoc
|
|
43
75
|
*/
|
|
@@ -47,31 +79,22 @@ export declare class AIDocumentProcessingGateway extends ContextPlugin {
|
|
|
47
79
|
*/
|
|
48
80
|
static override get isPremiumPlugin(): true;
|
|
49
81
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
55
|
-
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
56
|
-
*/
|
|
57
|
-
getAvailableModels(): Promise<Array<AIModelData>>;
|
|
58
|
-
/**
|
|
59
|
-
* Runs the document processing request and returns
|
|
60
|
-
* the {@link module:ai/aidocumentprocessing/model/aidocumentprocessingrunresult~AIDocumentProcessingRunResult detailed result}.
|
|
82
|
+
* Runs the document processing request and returns an
|
|
83
|
+
* {@link module:ai/aicore/model/airunresult~AIRunResult AIRunResult} — a container with one
|
|
84
|
+
* {@link module:ai/aidocumentprocessing/model/aidocumentprocessingrunresult~AIDocumentProcessingRunResult
|
|
85
|
+
* AIDocumentProcessingRunResult} per root and whole-run `status` / `error`.
|
|
61
86
|
*
|
|
62
87
|
* The result can then be applied to the editor via {@link #applyResult}. Transport, parsing, and merge failures
|
|
63
88
|
* are surfaced via `status: 'error'` plus the `error` field, not thrown. Aborts (via `options.signal`) are reported
|
|
64
89
|
* as `status: 'aborted'`.
|
|
65
90
|
*
|
|
66
|
-
* In multi-root editors, only the first non-`$graveyard` root is sent to the endpoint and reflected in the returned
|
|
67
|
-
* result. Other roots are ignored.
|
|
68
|
-
*
|
|
69
91
|
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
70
92
|
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
71
93
|
* @param prompt The prompt to run against the document.
|
|
72
|
-
* @param options
|
|
94
|
+
* @param options Run options: required `model`, optional `roots` to restrict the run to a subset of roots, optional `signal`
|
|
95
|
+
* to abort the run, and optional `capabilities` asking the AI service to use web search or reasoning for this call.
|
|
73
96
|
*/
|
|
74
|
-
processDocument(prompt: string, options: AIDocumentProcessingRunOptions): Promise<AIDocumentProcessingRunResult
|
|
97
|
+
processDocument(prompt: string, options: AIDocumentProcessingRunOptions): Promise<AIRunResult<AIDocumentProcessingRunResult>>;
|
|
75
98
|
/**
|
|
76
99
|
* Applies the document processing result (produced by {@link #processDocument}) to the editor content, either as direct
|
|
77
100
|
* changes or as track changes suggestions.
|
|
@@ -83,5 +106,5 @@ export declare class AIDocumentProcessingGateway extends ContextPlugin {
|
|
|
83
106
|
* @param result The result of a completed run.
|
|
84
107
|
* @param applyOptions Options for applying the changes to the editor content.
|
|
85
108
|
*/
|
|
86
|
-
applyResult(result: AIDocumentProcessingRunResult
|
|
109
|
+
applyResult(result: AIRunResult<AIDocumentProcessingRunResult>, applyOptions: AIGatewayApplyOptions): void;
|
|
87
110
|
}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module ai/aidocumentprocessing/model/aidocumentprocessingrunresult
|
|
7
7
|
* @publicApi
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { AIRunSingleRootResult } from "../../aicore/model/airunsinglerootresult.js";
|
|
10
10
|
/**
|
|
11
11
|
* The result of an AI document processing run.
|
|
12
12
|
*/
|
|
13
|
-
export declare class AIDocumentProcessingRunResult extends
|
|
13
|
+
export declare class AIDocumentProcessingRunResult extends AIRunSingleRootResult {
|
|
14
14
|
/**
|
|
15
15
|
* The summary of changes produced by the run.
|
|
16
16
|
*/
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
10
10
|
import { AITabs } from "../../aitabs/aitabs.js";
|
|
11
|
-
import "../../../theme/aieditorintegration/aitogglebutton.css";
|
|
12
11
|
/**
|
|
13
12
|
* Registers the `toggleAi` toolbar button that toggles the visibility of AI tabs.
|
|
14
13
|
*
|
|
@@ -10,6 +10,7 @@ import { type Editor, Plugin, type PluginDependenciesOf } from "@ckeditor/ckedit
|
|
|
10
10
|
import { AIQuickActionsUI } from "./aiquickactionsui.js";
|
|
11
11
|
import { AIQuickActionsEditing } from "./aiquickactionsediting.js";
|
|
12
12
|
import { AIActions } from "../aiactions/aiactions.js";
|
|
13
|
+
import { type AIContextRef } from "../aicore/model/aicontextref.js";
|
|
13
14
|
/**
|
|
14
15
|
* The AI Quick Actions feature.
|
|
15
16
|
*
|
|
@@ -107,7 +108,7 @@ export interface AIQuickActionsConfig {
|
|
|
107
108
|
*/
|
|
108
109
|
extraCommands?: Array<AIQuickActionCustomDefinition>;
|
|
109
110
|
/**
|
|
110
|
-
* The
|
|
111
|
+
* The IDs of the commands to remove from the AI Quick Actions feature. Removing all commands from a specific category
|
|
111
112
|
* will remove the category from the user interface.
|
|
112
113
|
*
|
|
113
114
|
* The defaults are as follows:
|
|
@@ -216,10 +217,6 @@ export interface AIQuickActionCustomBaseDefinition {
|
|
|
216
217
|
*/
|
|
217
218
|
readonly type: AIQuickActionType;
|
|
218
219
|
/**
|
|
219
|
-
* The prompt to be sent to the AI model when the action is executed.
|
|
220
|
-
*/
|
|
221
|
-
readonly prompt: string;
|
|
222
|
-
/**
|
|
223
220
|
* The AI model to use for the action. For `'action'` type, if not specified, the default model will be used.
|
|
224
221
|
* For `'chat'` type, if not specified, the model currently selected in the AI Chat will be used.
|
|
225
222
|
*/
|
|
@@ -228,8 +225,14 @@ export interface AIQuickActionCustomBaseDefinition {
|
|
|
228
225
|
/**
|
|
229
226
|
* A custom AI quick action definition.
|
|
230
227
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
228
|
+
* The action needs a prompt source, provided in one of three ways:
|
|
229
|
+
*
|
|
230
|
+
* * an inline `prompt` string - sent as the prompt,
|
|
231
|
+
* * a `context` reference - the referenced context drives the action (for example through a prompt it contains),
|
|
232
|
+
* * both - the inline `prompt` is used and the `context` is attached as additional reference material (for example a file).
|
|
233
|
+
*
|
|
234
|
+
* The `model` property is optional. If not specified, the default model (from the `ai.models.defaultModelId`
|
|
235
|
+
* configuration or the first available model) is used.
|
|
233
236
|
*
|
|
234
237
|
* ```ts
|
|
235
238
|
* {
|
|
@@ -240,10 +243,54 @@ export interface AIQuickActionCustomBaseDefinition {
|
|
|
240
243
|
* model: 'claude-4-6-sonnet'
|
|
241
244
|
* }
|
|
242
245
|
* ```
|
|
246
|
+
*
|
|
247
|
+
* The same action using a `context` reference instead of an inline `prompt`:
|
|
248
|
+
*
|
|
249
|
+
* ```ts
|
|
250
|
+
* {
|
|
251
|
+
* id: 'add-quote-from-famous-person',
|
|
252
|
+
* label: 'Add a quote from a famous person',
|
|
253
|
+
* context: { id: 'my-context', promptId: 'add-quote' },
|
|
254
|
+
* type: 'action',
|
|
255
|
+
* model: 'claude-4-6-sonnet'
|
|
256
|
+
* }
|
|
257
|
+
* ```
|
|
258
|
+
*
|
|
259
|
+
* An inline `prompt` combined with a `context` that attaches a single file as reference material:
|
|
260
|
+
*
|
|
261
|
+
* ```ts
|
|
262
|
+
* {
|
|
263
|
+
* id: 'add-quote-from-famous-person',
|
|
264
|
+
* label: 'Add a quote from a famous person',
|
|
265
|
+
* prompt: 'Add a quote from a known person, which would make sense in the context of the selected text.',
|
|
266
|
+
* context: { id: 'my-context', fileId: 'famous-quotes' },
|
|
267
|
+
* type: 'action',
|
|
268
|
+
* model: 'claude-4-6-sonnet'
|
|
269
|
+
* }
|
|
270
|
+
* ```
|
|
243
271
|
*/
|
|
244
|
-
export
|
|
272
|
+
export type AIQuickActionCustomActionDefinition = AIQuickActionCustomBaseDefinition & {
|
|
245
273
|
type: "action";
|
|
246
|
-
|
|
274
|
+
/**
|
|
275
|
+
* The prompt to be sent to the AI model when the action is executed.
|
|
276
|
+
*
|
|
277
|
+
* At least one prompt source is required: an inline `prompt`, a `context` that carries a prompt (a whole context
|
|
278
|
+
* or a `promptId` reference), or both. A `context` that references only a single file (`fileId`) cannot drive the
|
|
279
|
+
* action on its own and must be combined with an inline `prompt`.
|
|
280
|
+
*/
|
|
281
|
+
readonly prompt?: string;
|
|
282
|
+
/**
|
|
283
|
+
* A context reference attached to the action.
|
|
284
|
+
*
|
|
285
|
+
* When no inline `prompt` is provided, the referenced context drives the action (a whole context or a `promptId`
|
|
286
|
+
* reference). When combined with an inline `prompt`, it is attached as additional reference material (for example
|
|
287
|
+
* a single file).
|
|
288
|
+
*
|
|
289
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
290
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
291
|
+
*/
|
|
292
|
+
readonly context?: AIContextRef;
|
|
293
|
+
};
|
|
247
294
|
/**
|
|
248
295
|
* A custom AI quick action definition that interacts with {@link module:ai/aichat/aichat~AIChat AI Chat}.
|
|
249
296
|
*
|
|
@@ -264,6 +311,10 @@ export interface AIQuickActionCustomActionDefinition extends AIQuickActionCustom
|
|
|
264
311
|
export interface AIQuickActionCustomChatDefinition extends AIQuickActionCustomBaseDefinition {
|
|
265
312
|
type: "chat";
|
|
266
313
|
/**
|
|
314
|
+
* The prompt to be sent to the AI Chat when the action is executed.
|
|
315
|
+
*/
|
|
316
|
+
readonly prompt: string;
|
|
317
|
+
/**
|
|
267
318
|
* The prompt shown in the AI Chat UI when the action is executed. If not specified, the `prompt` property value will be used.
|
|
268
319
|
*/
|
|
269
320
|
displayedPrompt: string;
|
|
@@ -6,11 +6,10 @@ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
|
6
6
|
import { type Locale } from "@ckeditor/ckeditor5-utils";
|
|
7
7
|
import { AIErrorSink } from "../aicore/aierrorreporter.js";
|
|
8
8
|
import { BalloonToolbar } from "@ckeditor/ckeditor5-ui";
|
|
9
|
+
import { AICore } from "../aicore/aicore.js";
|
|
9
10
|
import { AIConnector } from "../aicore/aiconnector.js";
|
|
10
|
-
import "../../theme/common/aibutton.css";
|
|
11
|
-
import "../../theme/common/aicolor.css";
|
|
12
|
-
import "../../theme/aiquickactions/aiquickactions.css";
|
|
13
11
|
import { type AIQuickActionType } from "./aiquickactions.js";
|
|
12
|
+
import { type AIContextRef } from "../aicore/model/aicontextref.js";
|
|
14
13
|
/**
|
|
15
14
|
* UI plugin for AI Quick Actions that provides a set of predefined AI-powered tools.
|
|
16
15
|
*
|
|
@@ -26,7 +25,7 @@ export declare class AIQuickActionsUI extends Plugin {
|
|
|
26
25
|
/**
|
|
27
26
|
* @inheritDoc
|
|
28
27
|
*/
|
|
29
|
-
static get requires(): PluginDependenciesOf<[BalloonToolbar, AIConnector, AIErrorSink]>;
|
|
28
|
+
static get requires(): PluginDependenciesOf<[BalloonToolbar, AIConnector, AIErrorSink, AICore]>;
|
|
30
29
|
/**
|
|
31
30
|
* @inheritDoc
|
|
32
31
|
*/
|
|
@@ -124,6 +123,13 @@ export type AIQuickActionDefinition = {
|
|
|
124
123
|
*/
|
|
125
124
|
prompt?: string;
|
|
126
125
|
/**
|
|
126
|
+
* Optional reference to a context attached to the action.
|
|
127
|
+
*
|
|
128
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
129
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
130
|
+
*/
|
|
131
|
+
context?: AIContextRef;
|
|
132
|
+
/**
|
|
127
133
|
* Optional model to be used.
|
|
128
134
|
*/
|
|
129
135
|
model?: string;
|
|
@@ -12,7 +12,6 @@ import { type AIMiniToolbarConfig } from "../../../aicore/ui/suggestioncontainer
|
|
|
12
12
|
import { type AIContentRenderingStrategy } from "../../../aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js";
|
|
13
13
|
import { type AISuggestionContentPartDefinition } from "../../../aicore/utils/getsuggestionpartsfromreply.js";
|
|
14
14
|
import { AIBalloonView } from "../../../aiballoon/ui/aiballoonview.js";
|
|
15
|
-
import "../../../../theme/aiquickactions/aiquickactionsballoon.css";
|
|
16
15
|
/**
|
|
17
16
|
* Event names that can be fired by the AI Balloon view.
|
|
18
17
|
*/
|
|
@@ -41,6 +40,12 @@ export declare class AIActionsBalloonView extends AIBalloonView implements ViewW
|
|
|
41
40
|
* It is set to `true` when there are AI response being streamed or rendered.
|
|
42
41
|
*/
|
|
43
42
|
isBusy: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the target editor is read-only. When `true`, the apply/suggest buttons are disabled (running is still allowed).
|
|
45
|
+
*
|
|
46
|
+
* @observable
|
|
47
|
+
*/
|
|
48
|
+
isTargetReadOnly: boolean;
|
|
44
49
|
constructor(locale: Locale, config: AIActionsBalloonViewConfig);
|
|
45
50
|
/**
|
|
46
51
|
* @inheritDoc
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ai/aireviewcore/aireviewcorecheckregistry
|
|
7
7
|
*/
|
|
8
|
-
import { ContextPlugin, type
|
|
9
|
-
import { AIConnector } from "../aicore/aiconnector.js";
|
|
10
|
-
import { AIErrorSink } from "../aicore/aierrorreporter.js";
|
|
8
|
+
import { ContextPlugin, type PluginDependencies } from "@ckeditor/ckeditor5-core";
|
|
11
9
|
import type { AIReviewCheckList } from "./model/aireviewchecklist.js";
|
|
12
10
|
/**
|
|
13
11
|
* Base class for feature-specific check-list registries.
|
|
@@ -18,7 +16,7 @@ export declare abstract class AIReviewCoreCheckRegistry<T extends AIReviewCheckL
|
|
|
18
16
|
/**
|
|
19
17
|
* @inheritDoc
|
|
20
18
|
*/
|
|
21
|
-
static get requires():
|
|
19
|
+
static get requires(): PluginDependencies;
|
|
22
20
|
/**
|
|
23
21
|
* @inheritDoc
|
|
24
22
|
*/
|
|
@@ -11,6 +11,10 @@ import { ContextPlugin, Editor, type Context, type PluginDependenciesOf } from "
|
|
|
11
11
|
import { DocumentCompare } from "@ckeditor/ckeditor5-collaboration-core";
|
|
12
12
|
import { type AIReviewCheckResultChange } from "./model/aireviewcheckresultchange.js";
|
|
13
13
|
import { AIEditing } from "../aicore/aiediting.js";
|
|
14
|
+
import { type AIEditorRoot } from "../aicore/model/aieditorroot.js";
|
|
15
|
+
import { type AIReviewCheckRun } from "./model/aireviewcheckrun.js";
|
|
16
|
+
import { AIRunResult } from "../aicore/model/airunresult.js";
|
|
17
|
+
import { AICheckRunSingleRootResult } from "./model/aichecksinglerootresult.js";
|
|
14
18
|
export declare class AIReviewCoreEditing extends ContextPlugin {
|
|
15
19
|
/**
|
|
16
20
|
* @inheritDoc
|
|
@@ -41,15 +45,32 @@ export declare class AIReviewCoreEditing extends ContextPlugin {
|
|
|
41
45
|
*/
|
|
42
46
|
afterInit(): void;
|
|
43
47
|
/**
|
|
44
|
-
*
|
|
48
|
+
* Collects the document data (`content`, per-block `elements`, `roots`, `documentVersion`) sent to the AI
|
|
49
|
+
* endpoint. When `options.roots` is provided, only the listed roots are included; when omitted, every
|
|
50
|
+
* non-`$graveyard` root across every editor in the `Context` is included.
|
|
45
51
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
52
|
+
* Throws `ai-reviewcoreediting-empty-roots` for an explicitly empty `roots` array, and
|
|
53
|
+
* `ai-reviewcoreediting-root-not-found` (with `{ channelId, rootName }` on the error data) for any entry
|
|
54
|
+
* that does not resolve to a live, non-`$graveyard` root.
|
|
55
|
+
*/
|
|
56
|
+
getDocumentData(options?: {
|
|
57
|
+
roots?: Array<AIEditorRoot>;
|
|
58
|
+
}): AIDocumentData;
|
|
59
|
+
/**
|
|
60
|
+
* Runs an already-constructed check-run and returns an
|
|
61
|
+
* {@link module:ai/aicore/model/airunresult~AIRunResult}. On success the result holds one
|
|
62
|
+
* {@link module:ai/aireviewcore/model/aichecksinglerootresult~AICheckRunSingleRootResult} per root the check-run
|
|
63
|
+
* covered; on whole-run failures (transport / parse errors or abort) `results` stays empty and the outcome
|
|
64
|
+
* is described by `status` and `error`.
|
|
48
65
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
66
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
67
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
68
|
+
* @param checkRun The check-run to execute.
|
|
69
|
+
* @param options `signal` for aborting the run.
|
|
51
70
|
*/
|
|
52
|
-
|
|
71
|
+
runCheck(checkRun: AIReviewCheckRun, options?: {
|
|
72
|
+
signal?: AbortSignal;
|
|
73
|
+
}): Promise<AIRunResult<AICheckRunSingleRootResult>>;
|
|
53
74
|
/**
|
|
54
75
|
* Compares two pieces of content, calculates operations, groups them and returns diffed content
|
|
55
76
|
* and additional data for each group.
|
|
@@ -112,7 +133,14 @@ export declare class AIReviewCoreEditing extends ContextPlugin {
|
|
|
112
133
|
diffContent(editor: Editor, contentInitial: string, contentNew: string, asSingleGroup?: boolean): Array<AIReviewCoreChangeData>;
|
|
113
134
|
markChangePositionInEditorContent(changes: Array<AIReviewCheckResultChange>, documentData: AIDocumentData): void;
|
|
114
135
|
clearAllMarkers(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Locks all context editors read-only during a review. Programmatic accept/apply still works. Released by
|
|
138
|
+
* {@link #switchToEdit}.
|
|
139
|
+
*/
|
|
115
140
|
switchToReadOnly(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Releases the read-only lock added by {@link #switchToReadOnly} from all editors attached to the context.
|
|
143
|
+
*/
|
|
116
144
|
switchToEdit(): void;
|
|
117
145
|
applyChange(changeIds: Array<string>, aiSource?: string | null): void;
|
|
118
146
|
rejectChange(changeId: string): void;
|
|
@@ -178,6 +206,14 @@ export type AIDocumentData = {
|
|
|
178
206
|
*/
|
|
179
207
|
content: string;
|
|
180
208
|
elements: Map<string, AIDocumentDataElement>;
|
|
209
|
+
/**
|
|
210
|
+
* Every root this document data covers, in the natural document iteration order (editor order ×
|
|
211
|
+
* `editor.model.document.getRoots()` order). When
|
|
212
|
+
* {@link module:ai/aireviewcore/aireviewcoreediting~AIReviewCoreEditing#getDocumentData} was called
|
|
213
|
+
* without a `roots` filter, this is every non-`$graveyard` root across every editor in the context.
|
|
214
|
+
* When called with a filter, this is exactly the roots that appear in it.
|
|
215
|
+
*/
|
|
216
|
+
roots: Array<AIEditorRoot>;
|
|
181
217
|
};
|
|
182
218
|
export type AIDiffResult = {
|
|
183
219
|
content: string;
|
|
@@ -208,6 +244,7 @@ export type AIReviewCoreChangeRange = {
|
|
|
208
244
|
export type AIReviewCoreChangeData = AIReviewCoreChangeRange & {
|
|
209
245
|
content: () => string;
|
|
210
246
|
context: () => string;
|
|
247
|
+
wrapperTag?: string;
|
|
211
248
|
};
|
|
212
249
|
export type AIReviewCoreChangeMarkerClickedEvent = {
|
|
213
250
|
name: "changeMarkerClicked";
|
|
@@ -12,12 +12,6 @@ import { type AIReviewCheckResultChange } from "./model/aireviewcheckresultchang
|
|
|
12
12
|
import { AITabs } from "../aitabs/aitabs.js";
|
|
13
13
|
import { type AIReviewCoreView } from "./ui/aireviewcoreview.js";
|
|
14
14
|
export declare const AI_REVIEW_MODE_UI_EVENT_NAMES: readonly ["getReviewCheckList", "runReviewCheck", "abortReviewStream", "toggleDiff", "acceptAllChanges", "leaveReviewCoreResultList", "activateChange", "deactivateChange", "acceptChange", "dismissChange", "learnMore", "finishReview", "retryReview"];
|
|
15
|
-
import "../../theme/common/aiheader.css";
|
|
16
|
-
import "../../theme/common/ainotification.css";
|
|
17
|
-
import "../../theme/common/aibutton.css";
|
|
18
|
-
import "../../theme/common/aicolor.css";
|
|
19
|
-
import "../../theme/common/aitrackchanges.css";
|
|
20
|
-
import "../../theme/aireviewcore/aireviewcore.css";
|
|
21
15
|
export declare abstract class AIReviewCoreUI extends ContextPlugin {
|
|
22
16
|
/**
|
|
23
17
|
* @inheritDoc
|
|
@@ -52,14 +46,13 @@ export declare abstract class AIReviewCoreUI extends ContextPlugin {
|
|
|
52
46
|
* Shows the result of a review check run.
|
|
53
47
|
*/
|
|
54
48
|
showCheckRunResults(data: AIReviewCheckRunUpdatedEvent["args"][0]): void;
|
|
55
|
-
showCheckRunResult(result:
|
|
56
|
-
contentDiffed: string;
|
|
57
|
-
id: string;
|
|
58
|
-
}): void;
|
|
49
|
+
showCheckRunResult(result: AIReviewCheckResultChange): void;
|
|
59
50
|
showGeneralResultsErrorView(): void;
|
|
60
51
|
showGeneralReviewCoreErrorView(errorMessage?: string): void;
|
|
61
52
|
showChunkErrorView(): void;
|
|
53
|
+
showUnsupportedInlineChangeView(): void;
|
|
62
54
|
setCheckResultTitle(title: string, subtitle?: string): void;
|
|
55
|
+
setAcceptAllEnabled(isEnabled: boolean): void;
|
|
63
56
|
setActiveStateInResults(id: string): void;
|
|
64
57
|
resetActiveStateInResults(): void;
|
|
65
58
|
updateChangeState(id: string, status: AIReviewCheckResultChange["status"]): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
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
|
+
/**
|
|
6
|
+
* @module ai/aireviewcore/model/aichecksinglerootresult
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { type AIRunChangeData } from "../../aicore/aigateway.js";
|
|
10
|
+
import { AIRunSingleRootResult } from "../../aicore/model/airunsinglerootresult.js";
|
|
11
|
+
/**
|
|
12
|
+
* The result of a single AI check run, scoped to a single root. Adds `affectedBlocks` on top of
|
|
13
|
+
* {@link module:ai/aicore/model/airunsinglerootresult~AIRunSingleRootResult}.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AICheckRunSingleRootResult extends AIRunSingleRootResult {
|
|
16
|
+
/**
|
|
17
|
+
* The list of top-level blocks that were affected by the run. Returns a fresh copy on every call —
|
|
18
|
+
* mutating the returned array does not affect the result's internal state.
|
|
19
|
+
*/
|
|
20
|
+
get affectedBlocks(): ReadonlyArray<AIRunChangeData>;
|
|
21
|
+
set affectedBlocks(value: Array<AIRunChangeData>);
|
|
22
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module ai/aireviewcore/model/aireviewcheckresultchange
|
|
7
7
|
*/
|
|
8
8
|
import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import { type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
10
|
import { type Operation } from "@ckeditor/ckeditor5-engine";
|
|
10
11
|
import { type AIReviewCheckResult } from "./aireviewcheckresult.js";
|
|
11
12
|
import { type AIReviewCoreChangeData } from "../aireviewcoreediting.js";
|
|
@@ -27,6 +28,11 @@ export declare class AIReviewCheckResultChange extends AIReviewCheckResultChange
|
|
|
27
28
|
*/
|
|
28
29
|
readonly parent: AIReviewCheckResult;
|
|
29
30
|
/**
|
|
31
|
+
* The editor this change targets (where accepting it writes). Used to gate accepting the change by that
|
|
32
|
+
* editor's read-only state.
|
|
33
|
+
*/
|
|
34
|
+
readonly editor: Editor;
|
|
35
|
+
/**
|
|
30
36
|
* The status of the change.
|
|
31
37
|
*
|
|
32
38
|
* @observable
|
|
@@ -47,8 +53,13 @@ export declare class AIReviewCheckResultChange extends AIReviewCheckResultChange
|
|
|
47
53
|
/**
|
|
48
54
|
* Creates a new instance of the AIReviewCheckResult.
|
|
49
55
|
*/
|
|
50
|
-
constructor(id: string, data: AIReviewCoreChangeData, parent: AIReviewCheckResult);
|
|
56
|
+
constructor(id: string, data: AIReviewCoreChangeData, parent: AIReviewCheckResult, editor: Editor);
|
|
51
57
|
get contentDiffed(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Semantic element the preview should render this change's content under (an inline root's own element, for example
|
|
60
|
+
* `h2`), or `undefined` for a block root, where the default `div` host is used.
|
|
61
|
+
*/
|
|
62
|
+
get wrapperTag(): string | undefined;
|
|
52
63
|
get operations(): ReadonlyArray<Operation>;
|
|
53
64
|
get operationsIsolated(): ReadonlyArray<Operation>;
|
|
54
65
|
}
|
|
@@ -11,6 +11,7 @@ import { AIReviewCheckResultChange } from "./aireviewcheckresultchange.js";
|
|
|
11
11
|
import { type AIReviewCheck } from "./aireviewcheck.js";
|
|
12
12
|
import { type AIReviewCoreChangeData, type AIDocumentData } from "../aireviewcoreediting.js";
|
|
13
13
|
import { type AIConnector } from "../../aicore/aiconnector.js";
|
|
14
|
+
import { type AIContextRef } from "../../aicore/model/aicontextref.js";
|
|
14
15
|
import { type Editor } from "@ckeditor/ckeditor5-core";
|
|
15
16
|
declare const AIReviewCheckRunBase: ObservableMixinConstructor;
|
|
16
17
|
/**
|
|
@@ -29,16 +30,24 @@ export declare abstract class AIReviewCheckRun extends AIReviewCheckRunBase {
|
|
|
29
30
|
* The call ID returned by the AI API when the check run is started.
|
|
30
31
|
*/
|
|
31
32
|
callId?: string;
|
|
32
|
-
constructor(documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector, params?: Array<string>, args?: Record<string, any>);
|
|
33
|
+
constructor(documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector, params?: Array<string>, args?: Record<string, any>, contexts?: Array<AIContextRef>);
|
|
33
34
|
/**
|
|
34
35
|
* Returns the document data obtained at the time of the check run.
|
|
35
36
|
*/
|
|
36
37
|
get documentData(): AIDocumentData;
|
|
37
38
|
/**
|
|
39
|
+
* The check this run was constructed against.
|
|
40
|
+
*/
|
|
41
|
+
get sourceCheck(): AIReviewCheck;
|
|
42
|
+
/**
|
|
38
43
|
* Returns the number of successfully processed results.
|
|
39
44
|
*/
|
|
40
45
|
get processedResultsCount(): number;
|
|
41
46
|
/**
|
|
47
|
+
* Whether a proposed change was dropped because it would introduce block content into an inline root.
|
|
48
|
+
*/
|
|
49
|
+
get hasUnsupportedInlineChange(): boolean;
|
|
50
|
+
/**
|
|
42
51
|
* Returns the check title.
|
|
43
52
|
*/
|
|
44
53
|
get title(): string;
|
|
@@ -123,6 +132,7 @@ export type AIReviewCheckResultAddedEvent = {
|
|
|
123
132
|
result: AIReviewCheckResult;
|
|
124
133
|
source: AIReviewCheckRun;
|
|
125
134
|
editor: Editor;
|
|
135
|
+
rootName: string;
|
|
126
136
|
}];
|
|
127
137
|
};
|
|
128
138
|
export type AIReviewCheckResultReadyEvent = {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ai/aireviewcore/types
|
|
7
7
|
*/
|
|
8
|
+
import { type AIContextRef } from "../aicore/model/aicontextref.js";
|
|
8
9
|
export interface AIReviewCheckBaseDefinition {
|
|
9
10
|
id: string;
|
|
10
11
|
commandId: string;
|
|
@@ -20,7 +21,12 @@ export interface AIReviewCheckDefinition extends AIReviewCheckBaseDefinition {
|
|
|
20
21
|
}
|
|
21
22
|
export interface AIReviewCheckExtraDefinition extends AIReviewCheckBaseDefinition {
|
|
22
23
|
isExtra: true;
|
|
23
|
-
prompt
|
|
24
|
+
prompt?: string;
|
|
25
|
+
/**
|
|
26
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
27
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
28
|
+
*/
|
|
29
|
+
context?: AIContextRef;
|
|
24
30
|
model?: string;
|
|
25
31
|
}
|
|
26
32
|
export type AIReviewCheckOptions = {
|
|
@@ -9,8 +9,6 @@ import { type Locale } from "@ckeditor/ckeditor5-utils";
|
|
|
9
9
|
import { BalloonPanelView, type BodyCollection } from "@ckeditor/ckeditor5-ui";
|
|
10
10
|
import { AIReviewCoreReviewCheckListItemResultsView } from "./aireviewcorechecklistitemresultview.js";
|
|
11
11
|
import type { AIReviewCheckResultChange } from "../model/aireviewcheckresultchange.js";
|
|
12
|
-
import "../../../theme/aireviewcore/aireviewcore-balloon-panel-suggestion.css";
|
|
13
|
-
import "../../../theme/aireviewcore/aireviewcore-check-run-result.css";
|
|
14
12
|
export declare class AIReviewCoreBalloonSuggestionItemView extends BalloonPanelView {
|
|
15
13
|
/**
|
|
16
14
|
* Creates an instance of the review core suggestion panel view.
|
|
@@ -36,8 +36,15 @@ export declare class AIReviewCoreReviewCheckListItemResultsView extends View {
|
|
|
36
36
|
status: AIReviewCheckResultChange["status"];
|
|
37
37
|
readonly id: string;
|
|
38
38
|
constructor(locale: Locale, id: string);
|
|
39
|
+
override render(): void;
|
|
39
40
|
setItemAsActive(): void;
|
|
40
41
|
setItemAsInactive(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Sets the previewed content, rendering it under `tag` (an inline root's semantic element, for example `h2`) instead
|
|
44
|
+
* of the default `div`. The host element is swapped in place when the tag changes so the preview matches the editable
|
|
45
|
+
* and shares its `ck-content` styling. The CSS classes are preserved.
|
|
46
|
+
*/
|
|
47
|
+
updateResponseContent(html: string, tag?: string): void;
|
|
41
48
|
}
|
|
42
49
|
export type AIReviewCoreDeactivateChangeEventData = {
|
|
43
50
|
origin: "panel";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ai/aireviewcore/ui/aireviewcorecustomcheckview
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { KeystrokeHandler, FocusTracker } from "@ckeditor/ckeditor5-utils";
|
|
9
9
|
import { View, ButtonView, LabeledFieldView, FocusCycler } from "@ckeditor/ckeditor5-ui";
|
|
10
10
|
import { AIReviewCorePromptInputView } from "./aireviewcorepromptinputview.js";
|
|
11
11
|
export declare class AIReviewCoreCustomCheckView extends View {
|
|
@@ -23,32 +23,14 @@ export declare class AIReviewCoreCustomCheckView extends View {
|
|
|
23
23
|
readonly focusCycler: FocusCycler;
|
|
24
24
|
prompt: string;
|
|
25
25
|
modelId: string;
|
|
26
|
-
/**
|
|
27
|
-
* Determines the model display mode:
|
|
28
|
-
* * 'selector' – shows the dropdown,
|
|
29
|
-
* * 'name' – shows the model name,
|
|
30
|
-
* * 'hidden' – hides both.
|
|
31
|
-
*
|
|
32
|
-
* @observable
|
|
33
|
-
*/
|
|
34
|
-
modelDisplayMode: "selector" | "name" | "hidden";
|
|
35
|
-
/**
|
|
36
|
-
* The name of the currently active model.
|
|
37
|
-
*
|
|
38
|
-
* @observable
|
|
39
|
-
*/
|
|
40
|
-
activeModelName: string | null;
|
|
41
26
|
submitButtonView: ButtonView;
|
|
42
27
|
cancelButtonView: ButtonView;
|
|
43
28
|
promptInputView: LabeledFieldView<AIReviewCorePromptInputView>;
|
|
44
29
|
actionsFooterView: View;
|
|
45
|
-
constructor(locale: Locale, check: AIReviewCoreCustomCheckView["_check"], hideModels?: boolean);
|
|
46
30
|
/**
|
|
47
31
|
* @inheritDoc
|
|
48
32
|
*/
|
|
49
33
|
override render(): void;
|
|
50
|
-
get modelDefaultValue(): string;
|
|
51
|
-
get modelDefaultLabel(): string;
|
|
52
34
|
/**
|
|
53
35
|
* Resets the form to its default state.
|
|
54
36
|
*/
|