@ckeditor/ckeditor5-ai 48.1.1 → 48.2.0-alpha.1
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/model/aiactionsinteraction.d.ts +3 -0
- package/dist/aiactions/model/aiactionsreply.d.ts +7 -0
- package/dist/aiballoon/aiballoon.d.ts +2 -5
- package/dist/aichat/aichatballoon.d.ts +4 -0
- package/dist/aichat/aichatcontroller.d.ts +9 -3
- package/dist/aichat/aichatui.d.ts +11 -0
- package/dist/aichat/model/aichatcontext.d.ts +29 -62
- package/dist/aichat/model/aichatconversation.d.ts +18 -23
- package/dist/aichat/model/aichatinteraction.d.ts +0 -9
- package/dist/aichat/ui/aichatballoonview.d.ts +4 -0
- package/dist/aichat/ui/aichatcontrolsview.d.ts +5 -0
- package/dist/aichat/ui/aichatfeedview.d.ts +8 -0
- package/dist/aichat/ui/aichatview.d.ts +1 -0
- package/dist/aichat/ui/controls/aichatcontextpanelview.d.ts +4 -0
- package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +26 -0
- package/dist/aichat/ui/controls/resources/aichatresourcesballoonview.d.ts +4 -0
- package/dist/aichat/utils/eventnames.d.ts +1 -1
- package/dist/aichat/utils/parsesingleurl.d.ts +5 -0
- package/dist/aichat/utils/readdatatransferfiles.d.ts +14 -0
- package/dist/aichat/utils/resolvepaste.d.ts +71 -0
- package/dist/aichatshortcuts/ui/aichatshortcutsview.d.ts +6 -0
- package/dist/aiconfig.d.ts +1 -1
- package/dist/aicore/aiconnector.d.ts +22 -0
- package/dist/aicore/aiediting.d.ts +14 -5
- package/dist/aicore/aigateway.d.ts +63 -0
- package/dist/aicore/model/aicontext.d.ts +4 -20
- package/dist/aicore/model/aiinteraction.d.ts +7 -1
- package/dist/aicore/model/aireply.d.ts +20 -17
- package/dist/aicore/model/airunresult.d.ts +95 -0
- package/dist/aicore/pipeline/airesponseapplier.d.ts +3 -15
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +4 -0
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +4 -0
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +4 -0
- package/dist/aicore/utils/{geteditorfromcontext.d.ts → geteditorsfromcontext.d.ts} +1 -2
- package/dist/aicore/utils/getoperationsfromreply.d.ts +6 -4
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +6 -3
- package/dist/aicore/utils/htmlparser.d.ts +8 -2
- package/dist/aiquickactions/aiquickactions.d.ts +4 -4
- package/dist/aiquickactions/aiquickactionsui.d.ts +1 -1
- package/dist/aiquickactions/ui/aiquickactionsdropdowncontentview.d.ts +2 -2
- package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +34 -0
- package/dist/aireviewcore/aireviewcorecontroller.d.ts +31 -6
- package/dist/aireviewcore/aireviewcoreediting.d.ts +1 -1
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +4 -0
- package/dist/aireviewmode/aireviewgateway.d.ts +161 -0
- package/dist/aireviewmode/aireviewmode.d.ts +60 -2
- package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +39 -0
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +7 -2
- package/dist/aireviewmode/model/aireviewmodechecklist.d.ts +4 -0
- package/dist/aireviewmode/model/aireviewrunresult.d.ts +20 -0
- package/dist/aitranslate/aitranslatecheckregistry.d.ts +27 -0
- package/dist/aitranslate/aitranslatecontroller.d.ts +2 -2
- package/dist/augmentation.d.ts +11 -1
- package/dist/index-content.css +1 -1
- package/dist/index-editor.css +212 -8
- package/dist/index.css +212 -8
- package/dist/index.d.ts +7 -3
- package/dist/index.js +6 -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
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
* @module ai/aireviewcore/aireviewcorecontroller
|
|
7
7
|
*/
|
|
8
8
|
import { ContextPlugin } from '@ckeditor/ckeditor5-core';
|
|
9
|
-
import {
|
|
9
|
+
import { type AIReviewCheck } from './model/aireviewcheck.js';
|
|
10
|
+
import { type AIReviewCheckRun } from './model/aireviewcheckrun.js';
|
|
11
|
+
import { type AIReviewCoreUIRunReviewCheckEvent } from './ui/aireviewcorereviewcommandlistitemview.js';
|
|
10
12
|
export declare abstract class AIReviewCoreController extends ContextPlugin {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
static get requires(): readonly [typeof AIConnector];
|
|
15
13
|
/**
|
|
16
14
|
* @inheritDoc
|
|
17
15
|
*/
|
|
@@ -23,5 +21,32 @@ export declare abstract class AIReviewCoreController extends ContextPlugin {
|
|
|
23
21
|
/**
|
|
24
22
|
* @inheritDoc
|
|
25
23
|
*/
|
|
26
|
-
init():
|
|
24
|
+
init(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Runs the given review check on the currently loaded document and wires the check
|
|
27
|
+
* run into the UI (results panel, error views, balloons).
|
|
28
|
+
*
|
|
29
|
+
* This is the programmatic entry point used by {@link module:ai/aireviewmode/aireviewmode~AIReviewMode#startReview}
|
|
30
|
+
* and by the `runReviewCheck` UI event fired from the check list view — both paths end up here.
|
|
31
|
+
*
|
|
32
|
+
* Rejection of `data.id` (unknown check) is logged via `_logError` and the method returns without
|
|
33
|
+
* throwing, matching the original UI-event behavior. Stream errors surface via the existing UI
|
|
34
|
+
* error views; only unexpected apply-phase errors are thrown as `ai-review-mode-check-run-failed`.
|
|
35
|
+
*/
|
|
36
|
+
runCheck(data: AIReviewCoreUIRunReviewCheckEvent['args'][0]): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Aborts the currently running review check, if any. No-op when no check is in flight.
|
|
39
|
+
*
|
|
40
|
+
* Called by the `abortReviewStream` UI event and by programmatic callers (e.g. the `AbortSignal`
|
|
41
|
+
* wiring in {@link module:ai/aireviewmode/aireviewmode~AIReviewMode#startReview}).
|
|
42
|
+
*/
|
|
43
|
+
abort(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Exposes the list of review checks visible in the UI.
|
|
46
|
+
*/
|
|
47
|
+
getAvailableChecks(): Array<AIReviewCheck>;
|
|
48
|
+
/**
|
|
49
|
+
* Exposes the currently active review check run, if any.
|
|
50
|
+
*/
|
|
51
|
+
getCurrentCheckRun(): AIReviewCheckRun | undefined;
|
|
27
52
|
}
|
|
@@ -118,7 +118,7 @@ export declare class AIReviewCoreEditing extends ContextPlugin {
|
|
|
118
118
|
rejectChange(changeId: string): void;
|
|
119
119
|
getEditor(): Editor;
|
|
120
120
|
/**
|
|
121
|
-
* All editors attached to this context (same order as {@link module:ai/aicore/utils/
|
|
121
|
+
* All editors attached to this context (same order as {@link module:ai/aicore/utils/geteditorsfromcontext~getEditorsFromContext}).
|
|
122
122
|
*/
|
|
123
123
|
getEditors(): Array<Editor>;
|
|
124
124
|
/**
|
|
@@ -57,6 +57,10 @@ export declare abstract class AIReviewCheckRun extends /* #__PURE__ */ AIReviewC
|
|
|
57
57
|
* Returns the current error that occurred during the check run, if any.
|
|
58
58
|
*/
|
|
59
59
|
get currentError(): Error | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the list of results made by the check run.
|
|
62
|
+
*/
|
|
63
|
+
get results(): Array<AIReviewCheckResult>;
|
|
60
64
|
/**
|
|
61
65
|
* Updates the document data used for the check run. It allows to rerun the same check with different data.
|
|
62
66
|
*/
|
|
@@ -0,0 +1,161 @@
|
|
|
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/aireviewmode/aireviewgateway
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin } from '@ckeditor/ckeditor5-core';
|
|
10
|
+
import { AIConnector, type AIModelData } from '../aicore/aiconnector.js';
|
|
11
|
+
import { AIReviewCoreEditing } from '../aireviewcore/aireviewcoreediting.js';
|
|
12
|
+
import { AIReviewModeCheckRegistry } from './aireviewmodecheckregistry.js';
|
|
13
|
+
import { AIEditing } from '../aicore/aiediting.js';
|
|
14
|
+
import { AIReviewRunResult } from './model/aireviewrunresult.js';
|
|
15
|
+
import { AIGateway, type AIRunApplyMethod } from '../aicore/aigateway.js';
|
|
16
|
+
/**
|
|
17
|
+
* Review command data.
|
|
18
|
+
*/
|
|
19
|
+
export interface AIReviewCommandData {
|
|
20
|
+
/**
|
|
21
|
+
* Id of the review command.
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* Human-readable command title.
|
|
26
|
+
*/
|
|
27
|
+
title: string;
|
|
28
|
+
/**
|
|
29
|
+
* Human-readable description of what the command does.
|
|
30
|
+
*/
|
|
31
|
+
description: string;
|
|
32
|
+
/**
|
|
33
|
+
* Selectable parameters for parameterized commands (e.g. `length`, `tone`). One of these ids can be
|
|
34
|
+
* passed as `options.parameterId` when invoking the command.
|
|
35
|
+
*/
|
|
36
|
+
parameters?: Array<{
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export type AIReviewRunOptions = {
|
|
42
|
+
/**
|
|
43
|
+
* Id of one of the values in {@link module:ai/aireviewmode/aireviewgateway~AIReviewCommandData#parameters}.
|
|
44
|
+
* Applicable to parameterized commands (e.g. `length`, `tone`), ignored otherwise.
|
|
45
|
+
*/
|
|
46
|
+
parameterId?: string;
|
|
47
|
+
};
|
|
48
|
+
export type AIReviewCustomRunOptions = {
|
|
49
|
+
/**
|
|
50
|
+
* The model that will be used to run the custom command.
|
|
51
|
+
* The ids of an AI models can be acquired via {@link module:ai/aireviewmode/aireviewgateway~AIReviewGateway#getAvailableModels} call.
|
|
52
|
+
*/
|
|
53
|
+
model?: string;
|
|
54
|
+
};
|
|
55
|
+
export type AIReviewHeadlessRunOptions = AIReviewRunOptions & {
|
|
56
|
+
/**
|
|
57
|
+
* An `AbortSignal` that cancels the run when aborted. Aborted runs resolve with `status: 'aborted'`.
|
|
58
|
+
*/
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
};
|
|
61
|
+
export type AIReviewHeadlessCustomRunOptions = AIReviewCustomRunOptions & {
|
|
62
|
+
/**
|
|
63
|
+
* An `AbortSignal` that cancels the run when aborted. Aborted runs resolve with `status: 'aborted'`.
|
|
64
|
+
*/
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Headless, stateless public API for running AI reviews end-to-end.
|
|
69
|
+
*
|
|
70
|
+
* This plugin can be loaded standalone (without `AIReviewMode` plugin) to expose a programmatic
|
|
71
|
+
* review API. It is also transparently loaded by `AIReviewMode` to back the UI-driven flow.
|
|
72
|
+
*/
|
|
73
|
+
export declare class AIReviewGateway extends ContextPlugin {
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
static get pluginName(): "AIReviewGateway";
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
static get requires(): readonly [typeof AIReviewCoreEditing, typeof AIReviewModeCheckRegistry, typeof AIConnector, typeof AIEditing, typeof AIGateway];
|
|
82
|
+
/**
|
|
83
|
+
* @inheritDoc
|
|
84
|
+
*/
|
|
85
|
+
static get isOfficialPlugin(): true;
|
|
86
|
+
/**
|
|
87
|
+
* @inheritDoc
|
|
88
|
+
*/
|
|
89
|
+
static get isPremiumPlugin(): true;
|
|
90
|
+
/**
|
|
91
|
+
* Returns the list of review commands that can be run with {@link #runReview}.
|
|
92
|
+
*
|
|
93
|
+
* The list combines built-in system checks with any extra checks declared
|
|
94
|
+
* via the {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}
|
|
95
|
+
* configuration.
|
|
96
|
+
*
|
|
97
|
+
* The method returns all review commands regardless of the editor configuration (which affects the UI only), meaning the commands
|
|
98
|
+
* that are not visible in the UI can be still invoked via the {@link module:ai/aireviewmode/aireviewgateway~AIReviewGateway} API.
|
|
99
|
+
*
|
|
100
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
101
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
102
|
+
*/
|
|
103
|
+
getAllCommands(): Promise<Array<AIReviewCommandData>>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the list of AI models that the built-in `custom` review command can be run against.
|
|
106
|
+
*
|
|
107
|
+
* The returned model ids are valid values to supply as `options.model` when invoking the `custom`
|
|
108
|
+
* command. Built-in system command and additionally configured commands do not accept a model override — system
|
|
109
|
+
* checks always run against their default backend configuration, and extras use the model declared in their
|
|
110
|
+
* {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`} entry.
|
|
111
|
+
*
|
|
112
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
113
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
114
|
+
*/
|
|
115
|
+
getAvailableModels(): Promise<Array<AIModelData>>;
|
|
116
|
+
/**
|
|
117
|
+
* Runs the given review command and returns
|
|
118
|
+
* the {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult detailed result}.
|
|
119
|
+
*
|
|
120
|
+
* The result can then be processed in various ways. To insert or suggest changes directly
|
|
121
|
+
* to the editor use {@link #applyReview}. Accepts built-in commands and extra commands configured
|
|
122
|
+
* via {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}
|
|
123
|
+
*
|
|
124
|
+
* The returned {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult} always resolves — transport, parsing
|
|
125
|
+
* and merge failures are surfaced via `status: 'error'` plus the `error` field, not thrown. Aborts (via `options.signal`)
|
|
126
|
+
* are reported as `status: 'aborted'`.
|
|
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
|
+
* @param commandId Id of a command returned by {@link #getAllCommands}.
|
|
131
|
+
* @param options Optional `parameterId` (selected from the command's `parameters`) and `signal` to allow aborting the run.
|
|
132
|
+
*/
|
|
133
|
+
runReview(commandId: string, options?: AIReviewHeadlessRunOptions): Promise<AIReviewRunResult>;
|
|
134
|
+
/**
|
|
135
|
+
* Runs the `custom` review command and returns
|
|
136
|
+
* the {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult detailed result}.
|
|
137
|
+
*
|
|
138
|
+
* The command requires a prompt to run, and optional model id. The list of available models
|
|
139
|
+
* can be discovered via {@link #getAvailableModels}.
|
|
140
|
+
*
|
|
141
|
+
* Analogical to {@link #runReview} but restricted to the `custom` command only.
|
|
142
|
+
*
|
|
143
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
144
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
145
|
+
* @param prompt The prompt to run the `custom` command with.
|
|
146
|
+
* @param options Optional `model` (optional override), plus optional `signal` to allow aborting the run.
|
|
147
|
+
*/
|
|
148
|
+
runCustomReview(prompt: string, options?: AIReviewHeadlessCustomRunOptions): Promise<AIReviewRunResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Applies the review run result (produced by {@link #runReview} or {@link #runCustomReview}) to the editor content, either
|
|
151
|
+
* as direct changes or as track changes suggestions.
|
|
152
|
+
*
|
|
153
|
+
* This is a proxy to the {@link module:ai/aicore/aigateway~AIGateway#apply} method.
|
|
154
|
+
*
|
|
155
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
156
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
157
|
+
* @param result The result of a completed AI review run.
|
|
158
|
+
* @param applyMethod Method of applying the review suggestions to the editor content.
|
|
159
|
+
*/
|
|
160
|
+
applyReview(result: AIReviewRunResult, applyMethod: AIRunApplyMethod): void;
|
|
161
|
+
}
|
|
@@ -10,10 +10,11 @@ import { ContextPlugin } from '@ckeditor/ckeditor5-core';
|
|
|
10
10
|
import { AIReviewModeUI } from './aireviewmodeui.js';
|
|
11
11
|
import { AIReviewCoreEditing } from '../aireviewcore/aireviewcoreediting.js';
|
|
12
12
|
import { AIReviewModeController } from './aireviewmodecontroller.js';
|
|
13
|
+
import { type AIReviewCommandData, type AIReviewCustomRunOptions, AIReviewGateway, type AIReviewRunOptions } from './aireviewgateway.js';
|
|
13
14
|
/**
|
|
14
15
|
* The AI Review Mode feature.
|
|
15
16
|
*
|
|
16
|
-
* The Review feature provides users with AI-powered quality assurance for their content by automatically running
|
|
17
|
+
* The Review feature provides users with AI-powered quality assurance for their content by automatically running commands
|
|
17
18
|
* for grammar, style, tone, and more.
|
|
18
19
|
*
|
|
19
20
|
* Learn more about AI features in CKEditor in the {@glink features/ai/ckeditor-ai-overview AI Overview} documentation.
|
|
@@ -22,7 +23,7 @@ export declare class AIReviewMode extends ContextPlugin {
|
|
|
22
23
|
/**
|
|
23
24
|
* @inheritDoc
|
|
24
25
|
*/
|
|
25
|
-
static get requires(): readonly [typeof AIReviewModeController, typeof AIReviewModeUI, typeof AIReviewCoreEditing];
|
|
26
|
+
static get requires(): readonly [typeof AIReviewModeController, typeof AIReviewModeUI, typeof AIReviewCoreEditing, typeof AIReviewGateway];
|
|
26
27
|
/**
|
|
27
28
|
* @inheritDoc
|
|
28
29
|
*/
|
|
@@ -35,6 +36,63 @@ export declare class AIReviewMode extends ContextPlugin {
|
|
|
35
36
|
* @inheritDoc
|
|
36
37
|
*/
|
|
37
38
|
static get isPremiumPlugin(): true;
|
|
39
|
+
/**
|
|
40
|
+
* Launches a review command on the UI — the programmatic equivalent of clicking a command in the review panel.
|
|
41
|
+
*
|
|
42
|
+
* Unlike the headless {@link module:ai/aireviewmode/aireviewgateway~AIReviewGateway} API, this method drives
|
|
43
|
+
* the full UI-driven flow.
|
|
44
|
+
*
|
|
45
|
+
* Preconditions:
|
|
46
|
+
* - The command must be available in the UI. Not available commands or unknown ids throw `ai-reviewmode-unknown-command`.
|
|
47
|
+
* - The `commandId` must point at a built-in system command or an extra command configured via
|
|
48
|
+
* {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}.
|
|
49
|
+
* The built-in `custom` command throws `ai-reviewmode-not-a-system-command`. Use {@link #startCustomReview} instead
|
|
50
|
+
* to run the `custom` command.
|
|
51
|
+
*
|
|
52
|
+
* The returned promise resolves once the review run is dispatched to the controller. The command itself continues
|
|
53
|
+
* to run asynchronously and the UI reflects its progress. Stream-phase failures surface via the existing UI error
|
|
54
|
+
* views, not via this promise.
|
|
55
|
+
*
|
|
56
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
57
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
58
|
+
* @param commandId Id of a command returned by {@link #getAvailableCommands}.
|
|
59
|
+
* @param options Optional `parameterId` (for parameterized system commands like `length` or `tone`).
|
|
60
|
+
*/
|
|
61
|
+
startReview(commandId: string, options?: AIReviewRunOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Launches the built-in `custom` review command on the UI — the programmatic equivalent of clicking the
|
|
64
|
+
* `custom` command (and submitting the prompt modal) in the review panel.
|
|
65
|
+
*
|
|
66
|
+
* Analogical to {@link #startReview}, but restricted to the built-in `custom` command only.
|
|
67
|
+
*
|
|
68
|
+
* Preconditions:
|
|
69
|
+
* - The `custom` command must be available in the UI. If not, the method throws `ai-reviewmode-unknown-command`.
|
|
70
|
+
* - A model must be resolvable from `options.model` or the command's default. Otherwise the method throws
|
|
71
|
+
* `ai-reviewmode-missing-custom-command-model`. Use {@link module:ai/aireviewmode/aireviewgateway~AIReviewGateway#getAvailableModels}
|
|
72
|
+
* for valid model ids.
|
|
73
|
+
*
|
|
74
|
+
* The returned promise resolves once the review run is dispatched to the controller. The command itself
|
|
75
|
+
* continues to run asynchronously and the UI reflects its progress. Stream-phase failures surface via
|
|
76
|
+
* the existing UI error views, not via this promise.
|
|
77
|
+
*
|
|
78
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
79
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
80
|
+
* @param prompt The prompt to run the `custom` command with.
|
|
81
|
+
* @param options Optional `model` to run command with this specific model, instead of the default one.
|
|
82
|
+
* Use {@link module:ai/aireviewmode/aireviewgateway~AIReviewGateway#getAvailableModels} for valid model ids.
|
|
83
|
+
*/
|
|
84
|
+
startCustomReview(prompt: string, options?: AIReviewCustomRunOptions): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Returns the list of review commands that can be run via {@link #startReview} and are visible in the UI.
|
|
87
|
+
* The list will include `custom` command if it's available (meaning {@link #startCustomReview} can be used).
|
|
88
|
+
*
|
|
89
|
+
* The list combines built-in system commands with any extra commands declared
|
|
90
|
+
* via the {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`} configuration.
|
|
91
|
+
*
|
|
92
|
+
* @experimental **Experimental:** This is a production-ready API but may change in minor releases
|
|
93
|
+
* without the standard deprecation policy. Check the changelog for migration guidance.
|
|
94
|
+
*/
|
|
95
|
+
getAvailableCommands(): Array<AIReviewCommandData>;
|
|
38
96
|
}
|
|
39
97
|
export interface AIReviewModeConfig {
|
|
40
98
|
/**
|
|
@@ -0,0 +1,39 @@
|
|
|
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/aireviewmode/aireviewmodecheckregistry
|
|
7
|
+
*/
|
|
8
|
+
import { type Context, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import { AIReviewCoreCheckRegistry } from '../aireviewcore/aireviewcorecheckregistry.js';
|
|
11
|
+
import { type AIReviewCheckExtraDefinition } from '../aireviewcore/types.js';
|
|
12
|
+
import { AIReviewModeCheckList } from './model/aireviewmodechecklist.js';
|
|
13
|
+
/**
|
|
14
|
+
* Headless registry for the AI review check list. Owns the merge of built-in checks with `ai.review.extraCommands`,
|
|
15
|
+
* the model list fetch required by custom/extra checks, and caching.
|
|
16
|
+
*
|
|
17
|
+
* Used by both `AIReviewModeController` (UI-driven flow) and `AIReviewGateway` (headless API) so they share the same source of truth
|
|
18
|
+
* without the gateway depending on the UI controller.
|
|
19
|
+
*/
|
|
20
|
+
export declare class AIReviewModeCheckRegistry extends AIReviewCoreCheckRegistry<AIReviewModeCheckList> {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get pluginName(): "AIReviewModeCheckRegistry";
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
constructor(context: Context | Editor);
|
|
29
|
+
/**
|
|
30
|
+
* The error captured during the last models fetch, or `null` if the fetch succeeded
|
|
31
|
+
* (or was not required because no custom/extra check was in scope).
|
|
32
|
+
*/
|
|
33
|
+
get modelsLoadError(): CKEditorError | null;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the extra commands definitions from the configuration and returns
|
|
36
|
+
* them as an array of `AIReviewCheckExtraDefinition` objects.
|
|
37
|
+
*/
|
|
38
|
+
getExtraChecks(): Array<AIReviewCheckExtraDefinition>;
|
|
39
|
+
}
|
|
@@ -2,13 +2,18 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import { type Context, type Editor } from '@ckeditor/ckeditor5-core';
|
|
6
5
|
import { AIReviewCoreController } from '../aireviewcore/aireviewcorecontroller.js';
|
|
6
|
+
import { AIReviewModeCheckRegistry } from './aireviewmodecheckregistry.js';
|
|
7
|
+
import { type Context, type Editor } from '@ckeditor/ckeditor5-core';
|
|
7
8
|
export declare class AIReviewModeController extends AIReviewCoreController {
|
|
8
9
|
/**
|
|
9
10
|
* @inheritDoc
|
|
10
11
|
*/
|
|
11
12
|
static get pluginName(): "AIReviewModeController";
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get requires(): readonly [typeof AIReviewModeCheckRegistry];
|
|
12
17
|
/**
|
|
13
18
|
* @inheritDoc
|
|
14
19
|
*/
|
|
@@ -16,5 +21,5 @@ export declare class AIReviewModeController extends AIReviewCoreController {
|
|
|
16
21
|
/**
|
|
17
22
|
* @inheritDoc
|
|
18
23
|
*/
|
|
19
|
-
init():
|
|
24
|
+
init(): void;
|
|
20
25
|
}
|
|
@@ -16,6 +16,10 @@ export declare class AIReviewModeCheckList extends AIReviewCheckList {
|
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
18
18
|
constructor(allModels: Array<AIModelData>, recommendedModels: Array<AIModelData>, defaultModel: AIModelData | null);
|
|
19
|
+
/**
|
|
20
|
+
* The list of available models for the checks that require it.
|
|
21
|
+
*/
|
|
22
|
+
get allModels(): Array<AIModelData>;
|
|
19
23
|
/**
|
|
20
24
|
* @inheritDoc
|
|
21
25
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
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/aireviewmode/model/aireviewrunresult
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { type AIRunChangeData } from '../../aicore/aigateway.js';
|
|
10
|
+
import { AIRunResult } from '../../aicore/model/airunresult.js';
|
|
11
|
+
/**
|
|
12
|
+
* The result of an AI review run.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AIReviewRunResult extends AIRunResult {
|
|
15
|
+
/**
|
|
16
|
+
* The list of top-level blocks that were affected by the run.
|
|
17
|
+
*/
|
|
18
|
+
get affectedBlocks(): Array<AIRunChangeData>;
|
|
19
|
+
set affectedBlocks(value: Array<AIRunChangeData>);
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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/aitranslate/aitranslatecheckregistry
|
|
7
|
+
*/
|
|
8
|
+
import { type Context, type Editor } from '@ckeditor/ckeditor5-core';
|
|
9
|
+
import { AIReviewCoreCheckRegistry } from '../aireviewcore/aireviewcorecheckregistry.js';
|
|
10
|
+
import { AITranslateCheckList } from './model/aitranslatechecklist.js';
|
|
11
|
+
/**
|
|
12
|
+
* Headless registry for the AI translate check list. Reads the `ai.translate.languages` configuration,
|
|
13
|
+
* builds a check definition per language, applies translations, and returns an {@link AITranslateCheckList}.
|
|
14
|
+
*
|
|
15
|
+
* Counterpart to `AIReviewModeCheckRegistry`: each feature that plugs into `AIReviewCoreController`
|
|
16
|
+
* ships its own registry so the controller stays a thin orchestration layer.
|
|
17
|
+
*/
|
|
18
|
+
export declare class AITranslateCheckRegistry extends AIReviewCoreCheckRegistry<AITranslateCheckList> {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "AITranslateCheckRegistry";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
constructor(context: Context | Editor);
|
|
27
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module ai/aitranslate/aitranslatecontroller
|
|
7
7
|
*/
|
|
8
8
|
import { AIReviewCoreController } from '../aireviewcore/aireviewcorecontroller.js';
|
|
9
|
-
import {
|
|
9
|
+
import { AITranslateCheckRegistry } from './aitranslatecheckregistry.js';
|
|
10
10
|
export declare class AITranslateController extends AIReviewCoreController {
|
|
11
11
|
/**
|
|
12
12
|
* @inheritDoc
|
|
@@ -15,5 +15,5 @@ export declare class AITranslateController extends AIReviewCoreController {
|
|
|
15
15
|
/**
|
|
16
16
|
* @inheritDoc
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
static get requires(): readonly [typeof AITranslateCheckRegistry];
|
|
19
19
|
}
|
package/dist/augmentation.d.ts
CHANGED
|
@@ -26,7 +26,12 @@ import type { AIReviewModeUI } from './aireviewmode/aireviewmodeui.js';
|
|
|
26
26
|
import type { AITranslate } from './aitranslate/aitranslate.js';
|
|
27
27
|
import type { AITranslateController } from './aitranslate/aitranslatecontroller.js';
|
|
28
28
|
import type { AITranslateUI } from './aitranslate/aitranslateui.js';
|
|
29
|
-
import {
|
|
29
|
+
import type { AIChatShortcuts } from './aichatshortcuts/aichatshortcuts.js';
|
|
30
|
+
import type { AIReviewModeCheckRegistry } from './aireviewmode/aireviewmodecheckregistry.js';
|
|
31
|
+
import type { AIReviewCoreEditing } from './aireviewcore/aireviewcoreediting.js';
|
|
32
|
+
import type { AITranslateCheckRegistry } from './aitranslate/aitranslatecheckregistry.js';
|
|
33
|
+
import type { AIReviewGateway } from './aireviewmode/aireviewgateway.js';
|
|
34
|
+
import type { AIGateway } from './aicore/aigateway.js';
|
|
30
35
|
declare module '@ckeditor/ckeditor5-core' {
|
|
31
36
|
interface EditorConfig {
|
|
32
37
|
/**
|
|
@@ -51,12 +56,17 @@ declare module '@ckeditor/ckeditor5-core' {
|
|
|
51
56
|
[AIChatUI.pluginName]: AIChatUI;
|
|
52
57
|
[AIActions.pluginName]: AIActions;
|
|
53
58
|
[AIBalloon.pluginName]: AIBalloon;
|
|
59
|
+
[AIReviewCoreEditing.pluginName]: AIReviewCoreEditing;
|
|
60
|
+
[AIGateway.pluginName]: AIGateway;
|
|
54
61
|
[AIReviewMode.pluginName]: AIReviewMode;
|
|
55
62
|
[AIReviewModeController.pluginName]: AIReviewModeController;
|
|
56
63
|
[AIReviewModeUI.pluginName]: AIReviewModeUI;
|
|
64
|
+
[AIReviewModeCheckRegistry.pluginName]: AIReviewModeCheckRegistry;
|
|
65
|
+
[AIReviewGateway.pluginName]: AIReviewGateway;
|
|
57
66
|
[AITranslate.pluginName]: AITranslate;
|
|
58
67
|
[AITranslateController.pluginName]: AITranslateController;
|
|
59
68
|
[AITranslateUI.pluginName]: AITranslateUI;
|
|
69
|
+
[AITranslateCheckRegistry.pluginName]: AITranslateCheckRegistry;
|
|
60
70
|
}
|
|
61
71
|
interface CommandsMap {
|
|
62
72
|
showAIAssistant: ShowAIAssistantCommand;
|