@ckeditor/ckeditor5-ai 48.3.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.
Files changed (246) hide show
  1. package/dist/aiactions/aiactions.d.ts +36 -1
  2. package/dist/aiactions/model/aiactionsinteraction.d.ts +7 -1
  3. package/dist/aiassistant/aiassistantui.d.ts +0 -3
  4. package/dist/aiballoon/aiballoon.d.ts +0 -1
  5. package/dist/aichat/aichatballoon.d.ts +7 -2
  6. package/dist/aichat/aichatcontroller.d.ts +12 -2
  7. package/dist/aichat/aichatui.d.ts +20 -6
  8. package/dist/aichat/model/aichatcontext.d.ts +29 -10
  9. package/dist/aichat/model/aichatconversation.d.ts +10 -1
  10. package/dist/aichat/model/aichatinteraction.d.ts +6 -1
  11. package/dist/aichat/ui/aichatballoonview.d.ts +14 -19
  12. package/dist/aichat/ui/aichatcontrolsview.d.ts +0 -9
  13. package/dist/aichat/ui/aichatfeedview.d.ts +5 -11
  14. package/dist/aichat/ui/aichatview.d.ts +0 -4
  15. package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +4 -0
  16. package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +14 -29
  17. package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +7 -2
  18. package/dist/aichathistory/aichathistoryui.d.ts +0 -1
  19. package/dist/aichatshortcuts/aichatshortcuts.d.ts +2 -2
  20. package/dist/aiconfig.d.ts +109 -0
  21. package/dist/aicore/aiconnector.d.ts +78 -11
  22. package/dist/aicore/aicore.d.ts +53 -0
  23. package/dist/aicore/aiediting.d.ts +8 -2
  24. package/dist/aicore/aigateway.d.ts +43 -11
  25. package/dist/aicore/errors/normalizeerror.d.ts +4 -0
  26. package/dist/aicore/model/aicapabilities.d.ts +20 -5
  27. package/dist/aicore/model/aicontext.d.ts +57 -2
  28. package/dist/aicore/model/aicontextlibrary.d.ts +70 -0
  29. package/dist/aicore/model/aicontextref.d.ts +39 -0
  30. package/dist/aicore/model/aidefaultcontext.d.ts +95 -0
  31. package/dist/aicore/model/aieditorroot.d.ts +26 -0
  32. package/dist/aicore/model/aimodels.d.ts +11 -4
  33. package/dist/aicore/model/aireply.d.ts +12 -1
  34. package/dist/aicore/model/airunresult.d.ts +18 -73
  35. package/dist/aicore/model/airunsinglerootresult.d.ts +101 -0
  36. package/dist/aicore/ui/aidisclaimerview.d.ts +0 -1
  37. package/dist/aicore/ui/aiheaderview.d.ts +0 -1
  38. package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
  39. package/dist/aicore/ui/aiskeleton.d.ts +0 -1
  40. package/dist/aicore/ui/aispinner.d.ts +0 -1
  41. package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +0 -1
  42. package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +20 -5
  43. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +0 -1
  44. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +12 -1
  45. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +4 -12
  46. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +6 -1
  47. package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +11 -1
  48. package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +0 -1
  49. package/dist/aicore/utils/createandattachaibodycollection.d.ts +0 -1
  50. package/dist/aicore/utils/createresizebutton.d.ts +0 -1
  51. package/dist/aicore/utils/createstartconversationbutton.d.ts +0 -1
  52. package/dist/aicore/utils/geteditorconfig.d.ts +88 -0
  53. package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
  54. package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +4 -1
  55. package/dist/aicore/utils/htmlparser.d.ts +1 -0
  56. package/dist/aicore/utils/inlineroot.d.ts +1 -0
  57. package/dist/aicore/utils/tocontextrefrequestdata.d.ts +1 -0
  58. package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +48 -25
  59. package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +2 -2
  60. package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +0 -1
  61. package/dist/aiquickactions/aiquickactions.d.ts +60 -9
  62. package/dist/aiquickactions/aiquickactionsui.d.ts +10 -4
  63. package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +6 -1
  64. package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +2 -4
  65. package/dist/aireviewcore/aireviewcoreediting.d.ts +43 -6
  66. package/dist/aireviewcore/aireviewcoreui.d.ts +3 -10
  67. package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
  68. package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +12 -1
  69. package/dist/aireviewcore/model/aireviewcheckrun.d.ts +11 -1
  70. package/dist/aireviewcore/types.d.ts +7 -1
  71. package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -2
  72. package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +7 -0
  73. package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +1 -19
  74. package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +0 -1
  75. package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +0 -1
  76. package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +0 -1
  77. package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +10 -8
  78. package/dist/aireviewcore/ui/aireviewcoreview.d.ts +3 -4
  79. package/dist/aireviewmode/aireviewgateway.d.ts +63 -44
  80. package/dist/aireviewmode/aireviewmode.d.ts +73 -5
  81. package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +8 -1
  82. package/dist/aireviewmode/aireviewmodecontroller.d.ts +2 -1
  83. package/dist/aireviewmode/model/aireviewcheckextra.d.ts +7 -2
  84. package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +2 -1
  85. package/dist/aitabs/aitabsmainview.d.ts +0 -1
  86. package/dist/aitabs/tabs/aitabsview.d.ts +0 -1
  87. package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -1
  88. package/dist/aitranslate/aitranslatecontroller.d.ts +2 -1
  89. package/dist/aitranslate/aitranslategateway.d.ts +33 -21
  90. package/dist/aitranslate/aitranslateui.d.ts +0 -1
  91. package/dist/aitranslate/model/aitranslatecheckrun.d.ts +2 -1
  92. package/dist/augmentation.d.ts +2 -0
  93. package/dist/index-content.css +0 -97
  94. package/dist/index-editor.css +2640 -2631
  95. package/dist/index.css +36 -32
  96. package/dist/index.d.ts +17 -8
  97. package/dist/index.js +19 -19
  98. package/dist/translations/af.js +1 -1
  99. package/dist/translations/af.umd.js +1 -1
  100. package/dist/translations/ar.js +1 -1
  101. package/dist/translations/ar.umd.js +1 -1
  102. package/dist/translations/ast.js +1 -1
  103. package/dist/translations/ast.umd.js +1 -1
  104. package/dist/translations/az.js +1 -1
  105. package/dist/translations/az.umd.js +1 -1
  106. package/dist/translations/be.js +1 -1
  107. package/dist/translations/be.umd.js +1 -1
  108. package/dist/translations/bg.js +1 -1
  109. package/dist/translations/bg.umd.js +1 -1
  110. package/dist/translations/bn.js +1 -1
  111. package/dist/translations/bn.umd.js +1 -1
  112. package/dist/translations/bs.js +1 -1
  113. package/dist/translations/bs.umd.js +1 -1
  114. package/dist/translations/ca.js +1 -1
  115. package/dist/translations/ca.umd.js +1 -1
  116. package/dist/translations/cs.js +1 -1
  117. package/dist/translations/cs.umd.js +1 -1
  118. package/dist/translations/da.js +1 -1
  119. package/dist/translations/da.umd.js +1 -1
  120. package/dist/translations/de-ch.js +1 -1
  121. package/dist/translations/de-ch.umd.js +1 -1
  122. package/dist/translations/de.js +1 -1
  123. package/dist/translations/de.umd.js +1 -1
  124. package/dist/translations/el.js +1 -1
  125. package/dist/translations/el.umd.js +1 -1
  126. package/dist/translations/en-au.js +1 -1
  127. package/dist/translations/en-au.umd.js +1 -1
  128. package/dist/translations/en-gb.js +1 -1
  129. package/dist/translations/en-gb.umd.js +1 -1
  130. package/dist/translations/en.js +1 -1
  131. package/dist/translations/en.umd.js +1 -1
  132. package/dist/translations/eo.js +1 -1
  133. package/dist/translations/eo.umd.js +1 -1
  134. package/dist/translations/es-co.js +1 -1
  135. package/dist/translations/es-co.umd.js +1 -1
  136. package/dist/translations/es.js +1 -1
  137. package/dist/translations/es.umd.js +1 -1
  138. package/dist/translations/et.js +1 -1
  139. package/dist/translations/et.umd.js +1 -1
  140. package/dist/translations/eu.js +1 -1
  141. package/dist/translations/eu.umd.js +1 -1
  142. package/dist/translations/fa.js +1 -1
  143. package/dist/translations/fa.umd.js +1 -1
  144. package/dist/translations/fi.js +1 -1
  145. package/dist/translations/fi.umd.js +1 -1
  146. package/dist/translations/fr.js +1 -1
  147. package/dist/translations/fr.umd.js +1 -1
  148. package/dist/translations/gl.js +1 -1
  149. package/dist/translations/gl.umd.js +1 -1
  150. package/dist/translations/gu.js +1 -1
  151. package/dist/translations/gu.umd.js +1 -1
  152. package/dist/translations/he.js +1 -1
  153. package/dist/translations/he.umd.js +1 -1
  154. package/dist/translations/hi.js +1 -1
  155. package/dist/translations/hi.umd.js +1 -1
  156. package/dist/translations/hr.js +1 -1
  157. package/dist/translations/hr.umd.js +1 -1
  158. package/dist/translations/hu.js +1 -1
  159. package/dist/translations/hu.umd.js +1 -1
  160. package/dist/translations/hy.js +1 -1
  161. package/dist/translations/hy.umd.js +1 -1
  162. package/dist/translations/id.js +1 -1
  163. package/dist/translations/id.umd.js +1 -1
  164. package/dist/translations/it.js +1 -1
  165. package/dist/translations/it.umd.js +1 -1
  166. package/dist/translations/ja.js +1 -1
  167. package/dist/translations/ja.umd.js +1 -1
  168. package/dist/translations/jv.js +1 -1
  169. package/dist/translations/jv.umd.js +1 -1
  170. package/dist/translations/kk.js +1 -1
  171. package/dist/translations/kk.umd.js +1 -1
  172. package/dist/translations/km.js +1 -1
  173. package/dist/translations/km.umd.js +1 -1
  174. package/dist/translations/kn.js +1 -1
  175. package/dist/translations/kn.umd.js +1 -1
  176. package/dist/translations/ko.js +1 -1
  177. package/dist/translations/ko.umd.js +1 -1
  178. package/dist/translations/ku.js +1 -1
  179. package/dist/translations/ku.umd.js +1 -1
  180. package/dist/translations/lt.js +1 -1
  181. package/dist/translations/lt.umd.js +1 -1
  182. package/dist/translations/lv.js +1 -1
  183. package/dist/translations/lv.umd.js +1 -1
  184. package/dist/translations/ms.js +1 -1
  185. package/dist/translations/ms.umd.js +1 -1
  186. package/dist/translations/nb.js +1 -1
  187. package/dist/translations/nb.umd.js +1 -1
  188. package/dist/translations/ne.js +1 -1
  189. package/dist/translations/ne.umd.js +1 -1
  190. package/dist/translations/nl.js +1 -1
  191. package/dist/translations/nl.umd.js +1 -1
  192. package/dist/translations/no.js +1 -1
  193. package/dist/translations/no.umd.js +1 -1
  194. package/dist/translations/oc.js +1 -1
  195. package/dist/translations/oc.umd.js +1 -1
  196. package/dist/translations/pl.js +1 -1
  197. package/dist/translations/pl.umd.js +1 -1
  198. package/dist/translations/pt-br.js +1 -1
  199. package/dist/translations/pt-br.umd.js +1 -1
  200. package/dist/translations/pt.js +1 -1
  201. package/dist/translations/pt.umd.js +1 -1
  202. package/dist/translations/ro.js +1 -1
  203. package/dist/translations/ro.umd.js +1 -1
  204. package/dist/translations/ru.js +1 -1
  205. package/dist/translations/ru.umd.js +1 -1
  206. package/dist/translations/si.js +1 -1
  207. package/dist/translations/si.umd.js +1 -1
  208. package/dist/translations/sk.js +1 -1
  209. package/dist/translations/sk.umd.js +1 -1
  210. package/dist/translations/sl.js +1 -1
  211. package/dist/translations/sl.umd.js +1 -1
  212. package/dist/translations/sq.js +1 -1
  213. package/dist/translations/sq.umd.js +1 -1
  214. package/dist/translations/sr-latn.js +1 -1
  215. package/dist/translations/sr-latn.umd.js +1 -1
  216. package/dist/translations/sr.js +1 -1
  217. package/dist/translations/sr.umd.js +1 -1
  218. package/dist/translations/sv.js +1 -1
  219. package/dist/translations/sv.umd.js +1 -1
  220. package/dist/translations/th.js +1 -1
  221. package/dist/translations/th.umd.js +1 -1
  222. package/dist/translations/ti.js +1 -1
  223. package/dist/translations/ti.umd.js +1 -1
  224. package/dist/translations/tk.js +1 -1
  225. package/dist/translations/tk.umd.js +1 -1
  226. package/dist/translations/tr.js +1 -1
  227. package/dist/translations/tr.umd.js +1 -1
  228. package/dist/translations/tt.js +1 -1
  229. package/dist/translations/tt.umd.js +1 -1
  230. package/dist/translations/ug.js +1 -1
  231. package/dist/translations/ug.umd.js +1 -1
  232. package/dist/translations/uk.js +1 -1
  233. package/dist/translations/uk.umd.js +1 -1
  234. package/dist/translations/ur.js +1 -1
  235. package/dist/translations/ur.umd.js +1 -1
  236. package/dist/translations/uz.js +1 -1
  237. package/dist/translations/uz.umd.js +1 -1
  238. package/dist/translations/vi.js +1 -1
  239. package/dist/translations/vi.umd.js +1 -1
  240. package/dist/translations/zh-cn.js +1 -1
  241. package/dist/translations/zh-cn.umd.js +1 -1
  242. package/dist/translations/zh.js +1 -1
  243. package/dist/translations/zh.umd.js +1 -1
  244. package/package.json +30 -12
  245. package/dist/aireviewmode/model/aireviewrunresult.d.ts +0 -20
  246. package/dist/aitranslate/model/aitranslaterunresult.d.ts +0 -20
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { type Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ButtonView } from "@ckeditor/ckeditor5-ui";
10
- import "../../../theme/aireviewcore/aireviewcore-review-completed.css";
11
10
  export declare class AIReviewCoreFinishReviewButtonView extends ButtonView {
12
11
  constructor(buttonLabel: string, locale?: Locale);
13
12
  }
@@ -8,7 +8,6 @@
8
8
  import type { Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ListItemView } from "@ckeditor/ckeditor5-ui";
10
10
  import type { AIReviewCheck } from "../model/aireviewcheck.js";
11
- import "../../../theme/aireviewcore/aireviewcore-check-list.css";
12
11
  export declare class AIReviewCoreReviewCheckListView extends ListItemView {
13
12
  constructor(locale: Locale);
14
13
  /**
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { type Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { ListItemView } from "@ckeditor/ckeditor5-ui";
10
- import "../../../theme/aireviewcore/aireviewcore-review-completed.css";
11
10
  export type AIReviewCoreReviewCompletedViewContents = {
12
11
  headerText: string;
13
12
  emptyResultsText: string;
@@ -10,9 +10,6 @@ import { ListItemView, ViewCollection } from "@ckeditor/ckeditor5-ui";
10
10
  import { type AIReviewCheckResultChange } from "../model/aireviewcheckresultchange.js";
11
11
  import { AIDisclaimerView } from "../../aicore/ui/aidisclaimerview.js";
12
12
  import { AIReviewCoreReviewCheckListItemResultsView } from "./aireviewcorechecklistitemresultview.js";
13
- import "../../../theme/aireviewcore/aireviewcore-check-run.css";
14
- import "../../../theme/aireviewcore/aireviewcore-check-run-result.css";
15
- import "../../../theme/aireviewcore/aireviewcore-review-completed.css";
16
13
  export type AIReviewCoreUICheckResultsViewContents = {
17
14
  generalErrorText: string;
18
15
  };
@@ -59,14 +56,17 @@ export declare class AIReviewCoreUICheckResultsView extends ListItemView {
59
56
  isResultReady: boolean;
60
57
  isError: boolean;
61
58
  showErrorMessage: boolean;
62
- errorType: "chunk" | "general" | undefined;
59
+ errorType: "chunk" | "general" | "unsupported-inline" | undefined;
60
+ /**
61
+ * Whether "accept all" is enabled — pushed by the controller. Combined with the panel's own error state.
62
+ *
63
+ * @observable
64
+ */
65
+ isAcceptAllEnabled: boolean;
63
66
  constructor(locale: Locale, contents: AIReviewCoreUICheckResultsViewContents);
64
67
  clearResults(): void;
65
68
  getResults(): ViewCollection<AIReviewCoreReviewCheckListItemResultsView>;
66
- addResult(result: {
67
- contentDiffed: string;
68
- id: string;
69
- }): void;
69
+ addResult(result: AIReviewCheckResultChange): void;
70
70
  hideResult(id: string, status: AIReviewCheckResultChange["status"]): void;
71
71
  showResult(id: string, status: AIReviewCheckResultChange["status"]): void;
72
72
  /**
@@ -76,8 +76,10 @@ export declare class AIReviewCoreUICheckResultsView extends ListItemView {
76
76
  */
77
77
  setTitle(title: string, subtitle?: string): void;
78
78
  showChunkErrorMessage(): void;
79
+ showUnsupportedInlineChangeMessage(): void;
79
80
  showGeneralErrorMessage(): void;
80
81
  resetErrorState(): void;
82
+ setAcceptAllEnabled(isEnabled: boolean): void;
81
83
  }
82
84
  export type AIAbortReviewStreamEvent = {
83
85
  name: "abortReviewStream";
@@ -11,6 +11,7 @@ import { type AIReviewCoreReviewCheckListView } from "./aireviewcorereviewcheckl
11
11
  import { type AIReviewCoreReviewCompletedView } from "./aireviewcorereviewcompletedview.js";
12
12
  import { AIReviewCoreGeneralErrorView } from "./aireviewcoregeneralerrorview.js";
13
13
  import { type AIReviewCoreUICheckResultsView } from "./aireviewcoreuicheckresultsview.js";
14
+ import { type AIReviewCheckResultChange } from "../model/aireviewcheckresultchange.js";
14
15
  export declare class AIReviewCoreView extends View {
15
16
  /**
16
17
  * The header of the AI Review Core.
@@ -40,10 +41,7 @@ export declare class AIReviewCoreView extends View {
40
41
  });
41
42
  showReviewCheckListView(): void;
42
43
  showReviewCheckResultsView(): void;
43
- addCheckRunResult(result: {
44
- contentDiffed: string;
45
- id: string;
46
- }): void;
44
+ addCheckRunResult(result: AIReviewCheckResultChange): void;
47
45
  showReviewCompletedView(): void;
48
46
  showActionsWhenResultIsReady(): void;
49
47
  showNoChangesView(): void;
@@ -51,4 +49,5 @@ export declare class AIReviewCoreView extends View {
51
49
  showGeneralReviewCoreErrorView(errorMessage: string): void;
52
50
  showGeneralResultsErrorView(): void;
53
51
  showChunkErrorView(): void;
52
+ showUnsupportedInlineChangeView(): void;
54
53
  }
@@ -7,12 +7,16 @@
7
7
  * @publicApi
8
8
  */
9
9
  import { ContextPlugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
10
- import { AIConnector, type AIModelData } from "../aicore/aiconnector.js";
10
+ import { AIConnector } from "../aicore/aiconnector.js";
11
11
  import { AIReviewCoreEditing } from "../aireviewcore/aireviewcoreediting.js";
12
12
  import { AIReviewModeCheckRegistry } from "./aireviewmodecheckregistry.js";
13
13
  import { AIEditing } from "../aicore/aiediting.js";
14
- import { AIReviewRunResult } from "./model/aireviewrunresult.js";
15
- import { AIGateway, type AIRunBaseOptions, type AIRunApplyMethod } from "../aicore/aigateway.js";
14
+ import { type AIRunResult } from "../aicore/model/airunresult.js";
15
+ import { type AICheckRunSingleRootResult } from "../aireviewcore/model/aichecksinglerootresult.js";
16
+ import { AIGateway, type AIRunBaseOptions, type AIGatewayApplyOptions } from "../aicore/aigateway.js";
17
+ import { AICore } from "../aicore/aicore.js";
18
+ import { type AIModels } from "../aicore/model/aimodels.js";
19
+ import { type AIEditorRoot } from "../aicore/model/aieditorroot.js";
16
20
  /**
17
21
  * Review command data.
18
22
  */
@@ -30,7 +34,7 @@ export interface AIReviewCommandData {
30
34
  */
31
35
  description: string;
32
36
  /**
33
- * Selectable parameters for parameterized commands (e.g. `length`, `tone`). One of these ids can be
37
+ * Selectable parameters for parameterized commands (e.g. `length`, `tone`). One of these IDs can be
34
38
  * passed as `options.parameterId` when invoking the command.
35
39
  */
36
40
  parameters?: Array<{
@@ -38,17 +42,31 @@ export interface AIReviewCommandData {
38
42
  label: string;
39
43
  }>;
40
44
  }
41
- export type AIReviewRunOptions = {
45
+ /**
46
+ * Roots filter shared by both `AIReviewRunOptions` and `AIReviewCustomRunOptions`.
47
+ */
48
+ export type AIReviewRootsOption = {
49
+ /**
50
+ * The roots to run the review against. When omitted, every visible root across every editor in the current
51
+ * {@link module:core/context~Context `Context`} is reviewed. When provided, only the listed roots are reviewed;
52
+ * the order of entries in `roots` is treated as a set-membership filter and does not affect the payload order.
53
+ *
54
+ * Each entry's `channelId` must match an editor's `collaboration.channelId`; `rootName` must match a live,
55
+ * visible (non-`$graveyard`) root within that editor.
56
+ */
57
+ roots?: Array<AIEditorRoot>;
58
+ };
59
+ export type AIReviewRunOptions = AIReviewRootsOption & {
42
60
  /**
43
61
  * Id of one of the values in {@link module:ai/aireviewmode/aireviewgateway~AIReviewCommandData#parameters}.
44
62
  * Applicable to parameterized commands (e.g. `length`, `tone`), ignored otherwise.
45
63
  */
46
64
  parameterId?: string;
47
65
  };
48
- export type AIReviewCustomRunOptions = {
66
+ export type AIReviewCustomRunOptions = AIReviewRootsOption & {
49
67
  /**
50
68
  * 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.
69
+ * The IDs of an AI models can be acquired via {@link module:ai/aicore/model/aimodels~AIModels#getAvailableModels}.
52
70
  */
53
71
  model?: string;
54
72
  };
@@ -68,7 +86,16 @@ export declare class AIReviewGateway extends ContextPlugin {
68
86
  /**
69
87
  * @inheritDoc
70
88
  */
71
- static get requires(): PluginDependenciesOf<[AIReviewCoreEditing, AIReviewModeCheckRegistry, AIConnector, AIEditing, AIGateway]>;
89
+ static get requires(): PluginDependenciesOf<[AIReviewCoreEditing, AIReviewModeCheckRegistry, AIConnector, AIEditing, AIGateway, AICore]>;
90
+ /**
91
+ * The shared model registry. Exposed here so headless gateways are self-sufficient — integrators can
92
+ * discover and resolve models (`getAvailableModels()`, `getModel()`, `resolveModel()`, …) without
93
+ * reaching for the `AICore` plugin directly.
94
+ *
95
+ * @experimental **Experimental:** This is a production-ready API but may change in minor releases
96
+ * without the standard deprecation policy. Check the changelog for migration guidance.
97
+ */
98
+ get models(): AIModels;
72
99
  /**
73
100
  * @inheritDoc
74
101
  */
@@ -92,62 +119,54 @@ export declare class AIReviewGateway extends ContextPlugin {
92
119
  */
93
120
  getAllCommands(): Promise<Array<AIReviewCommandData>>;
94
121
  /**
95
- * Returns the list of AI models that the built-in `custom` review command can be run against.
96
- *
97
- * The returned model ids are valid values to supply as `options.model` when invoking the `custom`
98
- * command. Built-in system command and additionally configured commands do not accept a model override — system
99
- * checks always run against their default backend configuration, and extras use the model declared in their
100
- * {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`} entry.
101
- *
102
- * This is a convenience proxy to the {@link module:ai/aicore/aigateway~AIGateway#getAvailableModels} method.
103
- *
104
- * @experimental **Experimental:** This is a production-ready API but may change in minor releases
105
- * without the standard deprecation policy. Check the changelog for migration guidance.
106
- */
107
- getAvailableModels(): Promise<Array<AIModelData>>;
108
- /**
109
- * Runs the given review command and returns
110
- * the {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult detailed result}.
122
+ * Runs the given review command against every visible root across every editor in the current
123
+ * {@link module:core/context~Context `Context`} and returns an
124
+ * {@link module:ai/aicore/model/airunresult~AIRunResult} a container with one
125
+ * {@link module:ai/aireviewcore/model/aichecksinglerootresult~AICheckRunSingleRootResult} per root and whole-run
126
+ * `status` / `error`. Accepts built-in commands and extra commands configured via
127
+ * {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}.
111
128
  *
112
- * The result can then be processed in various ways. To insert or suggest changes directly
113
- * to the editor use {@link #applyReview}. Accepts built-in commands and extra commands configured
114
- * via {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}
129
+ * To insert or suggest changes back to the editor, pass the returned result to {@link #applyReview}.
115
130
  *
116
- * The returned {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult} always resolves transport, parsing
117
- * and merge failures are surfaced via `status: 'error'` plus the `error` field, not thrown. Aborts (via `options.signal`)
118
- * are reported as `status: 'aborted'`.
131
+ * When the `roots` option is provided, its entries are validated at the call boundary; an entry that does not
132
+ * resolve to a live, visible (non-`$graveyard`) root throws `ai-reviewcoreediting-root-not-found`, and an
133
+ * explicitly empty `roots` array throws `ai-reviewcoreediting-empty-roots`.
119
134
  *
120
135
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
121
136
  * without the standard deprecation policy. Check the changelog for migration guidance.
122
137
  * @param commandId Id of a command returned by {@link #getAllCommands}.
123
- * @param options Optional `parameterId` (selected from the command's `parameters`) and `signal` to allow aborting the run.
138
+ * @param options Optional `parameterId`, `roots` filter, and `signal` to allow aborting the run.
124
139
  */
125
- runReview(commandId: string, options?: AIReviewHeadlessRunOptions): Promise<AIReviewRunResult>;
140
+ runReview(commandId: string, options?: AIReviewHeadlessRunOptions): Promise<AIRunResult<AICheckRunSingleRootResult>>;
126
141
  /**
127
- * Runs the `custom` review command and returns
128
- * the {@link module:ai/aireviewmode/model/aireviewrunresult~AIReviewRunResult detailed result}.
142
+ * Runs the `custom` review command against every visible root across every editor in the current
143
+ * {@link module:core/context~Context `Context`} and returns an
144
+ * {@link module:ai/aicore/model/airunresult~AIRunResult}.
129
145
  *
130
- * The command requires a prompt to run, and optional model id. The list of available models
131
- * can be discovered via {@link #getAvailableModels}.
146
+ * The command requires a prompt to run, and optional model ID. The list of available models can be discovered
147
+ * via {@link module:ai/aicore/model/aimodels~AIModels#getAvailableModels}.
132
148
  *
133
149
  * Analogical to {@link #runReview} but restricted to the `custom` command only.
134
150
  *
135
151
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
136
152
  * without the standard deprecation policy. Check the changelog for migration guidance.
137
153
  * @param prompt The prompt to run the `custom` command with.
138
- * @param options Optional `model` (optional override), plus optional `signal` to allow aborting the run.
154
+ * @param options Optional `model` (optional override), `roots` filter, and `signal` to allow aborting the run.
139
155
  */
140
- runCustomReview(prompt: string, options?: AIReviewHeadlessCustomRunOptions): Promise<AIReviewRunResult>;
156
+ runCustomReview(prompt: string, options?: AIReviewHeadlessCustomRunOptions): Promise<AIRunResult<AICheckRunSingleRootResult>>;
141
157
  /**
142
- * Applies the review run result (produced by {@link #runReview} or {@link #runCustomReview}) to the editor content, either
143
- * as direct changes or as track changes suggestions.
158
+ * Applies a review run result (produced by {@link #runReview} or {@link #runCustomReview}) to the editor content,
159
+ * either as direct changes or as track-changes suggestions. Each per-root sub-result is applied to the root
160
+ * identified by its own `channelId` and `rootName`. Pass `options.roots` to restrict the apply to a subset of
161
+ * roots — the filter is symmetric with the one accepted by {@link #runReview} / {@link #runCustomReview}.
144
162
  *
145
- * This is a proxy to the {@link module:ai/aicore/aigateway~AIGateway#apply} method.
163
+ * By default the apply is stamped with `aiSource: 'review'`; pass `options.aiSource` to override.
146
164
  *
147
165
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
148
166
  * without the standard deprecation policy. Check the changelog for migration guidance.
149
- * @param result The result of a completed AI review run.
150
- * @param applyMethod Method of applying the review suggestions to the editor content.
167
+ * @param result The result returned by {@link #runReview} or {@link #runCustomReview}.
168
+ * @param options Apply options forwarded to {@link module:ai/aicore/aigateway~AIGateway#apply}, including the
169
+ * `applyMethod` and an optional `roots` filter.
151
170
  */
152
- applyReview(result: AIReviewRunResult, applyMethod: AIRunApplyMethod): void;
171
+ applyReview(result: AIRunResult<AICheckRunSingleRootResult>, options: AIGatewayApplyOptions): void;
153
172
  }
@@ -11,6 +11,7 @@ import { AIReviewModeUI } from "./aireviewmodeui.js";
11
11
  import { AIReviewCoreEditing } from "../aireviewcore/aireviewcoreediting.js";
12
12
  import { AIReviewModeController } from "./aireviewmodecontroller.js";
13
13
  import { type AIReviewCommandData, type AIReviewCustomRunOptions, AIReviewGateway, type AIReviewRunOptions } from "./aireviewgateway.js";
14
+ import { type AIContextRef } from "../aicore/model/aicontextref.js";
14
15
  /**
15
16
  * The AI Review Mode feature.
16
17
  *
@@ -43,7 +44,7 @@ export declare class AIReviewMode extends ContextPlugin {
43
44
  * the full UI-driven flow.
44
45
  *
45
46
  * Preconditions:
46
- * - The command must be available in the UI. Not available commands or unknown ids throw `ai-reviewmode-unknown-command`.
47
+ * - The command must be available in the UI. Not available commands or unknown IDs throw `ai-reviewmode-unknown-command`.
47
48
  * - The `commandId` must point at a built-in system command or an extra command configured via
48
49
  * {@link module:ai/aireviewmode/aireviewmode~AIReviewModeConfig#extraCommands `ai.review.extraCommands`}.
49
50
  * The built-in `custom` command throws `ai-reviewmode-not-a-system-command`. Use {@link #startCustomReview} instead
@@ -68,8 +69,8 @@ export declare class AIReviewMode extends ContextPlugin {
68
69
  * Preconditions:
69
70
  * - The `custom` command must be available in the UI. If not, the method throws `ai-reviewmode-unknown-command`.
70
71
  * - 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.
72
+ * `ai-reviewmode-missing-custom-command-model`. Use {@link module:ai/aicore/model/aimodels~AIModels#getAvailableModels}
73
+ * for valid model IDs.
73
74
  *
74
75
  * The returned promise resolves once the review run is dispatched to the controller. The command itself
75
76
  * continues to run asynchronously and the UI reflects its progress. Stream-phase failures surface via
@@ -79,7 +80,7 @@ export declare class AIReviewMode extends ContextPlugin {
79
80
  * without the standard deprecation policy. Check the changelog for migration guidance.
80
81
  * @param prompt The prompt to run the `custom` command with.
81
82
  * @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
+ * Use {@link module:ai/aicore/model/aimodels~AIModels#getAvailableModels} for valid model IDs.
83
84
  */
84
85
  startCustomReview(prompt: string, options?: AIReviewCustomRunOptions): Promise<void>;
85
86
  /**
@@ -153,6 +154,12 @@ export interface AIReviewModeConfig {
153
154
  * description: 'Expand abbreviations in the document.',
154
155
  * prompt: 'Suggest expansions for abbreviations in the document.',
155
156
  * model: 'gpt-5-2' // Optional, if not set, default model will be used.
157
+ * },
158
+ * {
159
+ * id: 'style-guide',
160
+ * label: 'Style Guide',
161
+ * description: 'Check the document against the style guide.',
162
+ * context: { id: 'style-guide', promptId: 'review-rules' }
156
163
  * }
157
164
  * ]
158
165
  * }
@@ -184,10 +191,71 @@ export interface AIReviewModeConfig {
184
191
  */
185
192
  extraCommands?: Array<AIReviewCustomCommand>;
186
193
  }
194
+ /**
195
+ * An extra review command definition.
196
+ *
197
+ * The command needs a prompt source, provided in one of three ways:
198
+ *
199
+ * * an inline `prompt` string - sent as the prompt,
200
+ * * a `context` reference - the referenced context drives the command (for example through a prompt it contains),
201
+ * * both - the inline `prompt` is used and the `context` is attached as additional reference material (for example a file).
202
+ *
203
+ * The `model` property is optional. If not specified, the default model is used.
204
+ *
205
+ * ```ts
206
+ * {
207
+ * id: 'improve-captions',
208
+ * label: 'Improve Captions',
209
+ * description: 'Improve image captions in the document.',
210
+ * prompt: 'Suggest improvements for the image captions in the document.'
211
+ * }
212
+ * ```
213
+ *
214
+ * The same command using a `context` reference instead of an inline `prompt`:
215
+ *
216
+ * ```ts
217
+ * {
218
+ * id: 'improve-captions',
219
+ * label: 'Improve Captions',
220
+ * description: 'Improve image captions in the document.',
221
+ * context: { id: 'style-guide', promptId: 'improve-captions' }
222
+ * }
223
+ * ```
224
+ *
225
+ * An inline `prompt` combined with a `context` that attaches a single file as reference material:
226
+ *
227
+ * ```ts
228
+ * {
229
+ * id: 'improve-captions',
230
+ * label: 'Improve Captions',
231
+ * description: 'Improve image captions in the document.',
232
+ * prompt: 'Suggest improvements for the image captions in the document.',
233
+ * context: { id: 'style-guide', fileId: 'caption-examples' }
234
+ * }
235
+ * ```
236
+ */
187
237
  export type AIReviewCustomCommand = {
188
238
  id: string;
189
239
  label: string;
190
240
  description: string;
191
- prompt: string;
192
241
  model?: string;
242
+ /**
243
+ * The prompt to be sent to the AI model when the command is executed.
244
+ *
245
+ * At least one prompt source is required: an inline `prompt`, a `context` that carries a prompt (a whole context
246
+ * or a `promptId` reference), or both. A `context` that references only a single file (`fileId`) cannot drive the
247
+ * command on its own and must be combined with an inline `prompt`.
248
+ */
249
+ readonly prompt?: string;
250
+ /**
251
+ * A context reference attached to the command.
252
+ *
253
+ * When no inline `prompt` is provided, the referenced context drives the command (a whole context or a `promptId`
254
+ * reference). When combined with an inline `prompt`, it is attached as additional reference material (for example
255
+ * a single file).
256
+ *
257
+ * @experimental **Experimental:** This is a production-ready API but may change in minor releases
258
+ * without the standard deprecation policy. Check the changelog for migration guidance.
259
+ */
260
+ readonly context?: AIContextRef;
193
261
  };
@@ -5,8 +5,11 @@
5
5
  /**
6
6
  * @module ai/aireviewmode/aireviewmodecheckregistry
7
7
  */
8
- import { type Context, type Editor } from "@ckeditor/ckeditor5-core";
8
+ import { type Context, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
9
  import { CKEditorError } from "@ckeditor/ckeditor5-utils";
10
+ import { AICore } from "../aicore/aicore.js";
11
+ import { AIConnector } from "../aicore/aiconnector.js";
12
+ import { AIErrorSink } from "../aicore/aierrorreporter.js";
10
13
  import { AIReviewCoreCheckRegistry } from "../aireviewcore/aireviewcorecheckregistry.js";
11
14
  import { type AIReviewCheckExtraDefinition } from "../aireviewcore/types.js";
12
15
  import { AIReviewModeCheckList } from "./model/aireviewmodechecklist.js";
@@ -25,6 +28,10 @@ export declare class AIReviewModeCheckRegistry extends AIReviewCoreCheckRegistry
25
28
  /**
26
29
  * @inheritDoc
27
30
  */
31
+ static override get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, AICore]>;
32
+ /**
33
+ * @inheritDoc
34
+ */
28
35
  constructor(context: Context | Editor);
29
36
  /**
30
37
  * The error captured during the last models fetch, or `null` if the fetch succeeded
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { AIReviewCoreController } from "../aireviewcore/aireviewcorecontroller.js";
6
6
  import { AIErrorSink } from "../aicore/aierrorreporter.js";
7
+ import { AICore } from "../aicore/aicore.js";
7
8
  import { AIReviewModeCheckRegistry } from "./aireviewmodecheckregistry.js";
8
9
  import type { PluginDependenciesOf, Context, Editor } from "@ckeditor/ckeditor5-core";
9
10
  export declare class AIReviewModeController extends AIReviewCoreController {
@@ -14,7 +15,7 @@ export declare class AIReviewModeController extends AIReviewCoreController {
14
15
  /**
15
16
  * @inheritDoc
16
17
  */
17
- static get requires(): PluginDependenciesOf<[AIErrorSink, AIReviewModeCheckRegistry]>;
18
+ static get requires(): PluginDependenciesOf<[AIErrorSink, AIReviewModeCheckRegistry, AICore]>;
18
19
  /**
19
20
  * @inheritDoc
20
21
  */
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { type AIReviewCheckExtraDefinition } from "../../aireviewcore/types.js";
9
9
  import { type AIModelData } from "../../aicore/aiconnector.js";
10
+ import { type AIContextRef } from "../../aicore/model/aicontextref.js";
10
11
  import { AIReviewCheck } from "../../aireviewcore/model/aireviewcheck.js";
11
12
  /**
12
13
  * Represents the extra check that can be added via
@@ -20,9 +21,13 @@ export declare class AIReviewCheckExtra extends AIReviewCheck {
20
21
  */
21
22
  isExtra: boolean;
22
23
  /**
23
- * The prompt text for this extra check run.
24
+ * The prompt text for this extra check run. Not set when the check references a prompt through {@link #context}.
24
25
  */
25
- prompt: string;
26
+ prompt: string | undefined;
27
+ /**
28
+ * The context reference used instead of an inline {@link #prompt}.
29
+ */
30
+ context: AIContextRef | undefined;
26
31
  /**
27
32
  * The model for this extra check run.
28
33
  */
@@ -9,12 +9,13 @@ import { AIReviewCheckRun } from "../../aireviewcore/model/aireviewcheckrun.js";
9
9
  import { type AIConnector } from "../../aicore/aiconnector.js";
10
10
  import { type AIDocumentData } from "../../aireviewcore/aireviewcoreediting.js";
11
11
  import { type AIReviewCheck } from "../../aireviewcore/model/aireviewcheck.js";
12
+ import { type AIContextRef } from "../../aicore/model/aicontextref.js";
12
13
  /**
13
14
  * Represents a single custom review check
14
15
  * ({@link module:ai/aireviewmode/model/aireviewcheckcustom~AIReviewCheckCustom}) run and its results.
15
16
  */
16
17
  export declare class AIReviewCustomCheckRun extends AIReviewCheckRun {
17
- constructor(prompt: string, model: string, documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector);
18
+ constructor(prompt: string | undefined, model: string, documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector, contexts?: Array<AIContextRef>);
18
19
  /**
19
20
  * @inheritDoc
20
21
  */
@@ -8,7 +8,6 @@
8
8
  */
9
9
  import type { Locale } from "@ckeditor/ckeditor5-utils";
10
10
  import { AITabsView, type AITabsViewOptions } from "./tabs/aitabsview.js";
11
- import "../../theme/aitabs/aitabsview.css";
12
11
  /**
13
12
  * The supported types of the `AITabsView`.
14
13
  */
@@ -10,7 +10,6 @@ import { View, type ViewCollection } from "@ckeditor/ckeditor5-ui";
10
10
  import { type ArrayOrItem, type Locale } from "@ckeditor/ckeditor5-utils";
11
11
  import { TabButtonView } from "./tabbuttonview.js";
12
12
  import { TabPanelView } from "./tabpanelview.js";
13
- import "../../../theme/aitabs/tabs/tabsview.css";
14
13
  export declare const AI_TABS_POSITIONS: readonly ["top", "left", "right"];
15
14
  /**
16
15
  * A view component that manages the tabs and their panels.
@@ -8,7 +8,6 @@
8
8
  import { ButtonView } from "@ckeditor/ckeditor5-ui";
9
9
  import { type ArrayOrItem, type Locale } from "@ckeditor/ckeditor5-utils";
10
10
  import type { AI_TABS_POSITIONS } from "./aitabsview.js";
11
- import "../../../theme/aitabs/tabs/tabbuttonview.css";
12
11
  /**
13
12
  * A button that toggles the visibility of a tab in the tabs view component.
14
13
  */
@@ -6,6 +6,7 @@
6
6
  * @module ai/aitranslate/aitranslatecontroller
7
7
  */
8
8
  import { AIReviewCoreController } from "../aireviewcore/aireviewcorecontroller.js";
9
+ import { AICore } from "../aicore/aicore.js";
9
10
  import { AIErrorSink } from "../aicore/aierrorreporter.js";
10
11
  import { AITranslateCheckRegistry } from "./aitranslatecheckregistry.js";
11
12
  import type { PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
@@ -17,5 +18,5 @@ export declare class AITranslateController extends AIReviewCoreController {
17
18
  /**
18
19
  * @inheritDoc
19
20
  */
20
- static get requires(): PluginDependenciesOf<[AIErrorSink, AITranslateCheckRegistry]>;
21
+ static get requires(): PluginDependenciesOf<[AIErrorSink, AITranslateCheckRegistry, AICore]>;
21
22
  }
@@ -9,14 +9,21 @@
9
9
  import { ContextPlugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
10
10
  import { AIConnector } from "../aicore/aiconnector.js";
11
11
  import { AIReviewCoreEditing } from "../aireviewcore/aireviewcoreediting.js";
12
- import { AITranslateRunResult } from "./model/aitranslaterunresult.js";
12
+ import type { AIRunResult } from "../aicore/model/airunresult.js";
13
+ import type { AICheckRunSingleRootResult } from "../aireviewcore/model/aichecksinglerootresult.js";
13
14
  import { AIEditing } from "../aicore/aiediting.js";
14
- import { AIGateway, type AIGatewayApplyOptions } from "../aicore/aigateway.js";
15
- export type AITranslateRunOptions = {
15
+ import { AIGateway, type AIGatewayApplyOptions, type AIRunBaseOptions } from "../aicore/aigateway.js";
16
+ import { type AIEditorRoot } from "../aicore/model/aieditorroot.js";
17
+ export type AITranslateRunOptions = AIRunBaseOptions & {
16
18
  /**
17
- * An `AbortSignal` that cancels the run when aborted. Aborted runs resolve with `status: 'aborted'`.
19
+ * The roots to translate. When omitted, every non-`$graveyard` root across every editor in the current
20
+ * `Context` is translated. When provided, only the listed roots are translated; the order of entries in
21
+ * `roots` is treated as a set-membership filter and does not affect the payload order.
22
+ *
23
+ * Each entry's `channelId` must match an editor's `collaboration.channelId`; `rootName` must match a
24
+ * non-`$graveyard` root within that editor.
18
25
  */
19
- signal?: AbortSignal;
26
+ roots?: Array<AIEditorRoot>;
20
27
  };
21
28
  /**
22
29
  * Headless, stateless public API for running AI translations end-to-end.
@@ -42,15 +49,20 @@ export declare class AITranslateGateway extends ContextPlugin {
42
49
  */
43
50
  static override get isPremiumPlugin(): true;
44
51
  /**
45
- * Translates the editor content into the given language and returns
46
- * the {@link module:ai/aitranslate/model/aitranslaterunresult~AITranslateRunResult detailed result}.
52
+ * Translates every non-`$graveyard` root across every editor in the current `Context` into the given language and
53
+ * returns one {@link module:ai/aireviewcore/model/aichecksinglerootresult~AICheckRunSingleRootResult result} per root. Each
54
+ * result carries its own `channelId` and `rootName`, identifying the editor/root it belongs to.
47
55
  *
48
- * The result can then be processed in various ways. To insert or suggest changes directly
49
- * to the editor use {@link #applyTranslate}.
56
+ * Each per-root result can then be processed independently. To insert or suggest changes back to the editor,
57
+ * pass the full array (or any caller-filtered subset) to {@link #applyTranslate}.
50
58
  *
51
- * The returned {@link module:ai/aitranslate/model/aitranslaterunresult~AITranslateRunResult} always resolves —
59
+ * Each per-root {@link module:ai/aireviewcore/model/aichecksinglerootresult~AICheckRunSingleRootResult} always resolves —
52
60
  * transport, parsing and merge failures are surfaced via `status: 'error'` plus the `error` field, not thrown.
53
- * Aborts (via `options.signal`) are reported as `status: 'aborted'`.
61
+ * Aborts (via `options.signal`) are reported as `status: 'aborted'` on every per-root entry.
62
+ *
63
+ * When the `roots` option is provided, its entries are validated at the call boundary. An entry that does not
64
+ * resolve to a live, non-`$graveyard` root throws `ai-reviewcoreediting-root-not-found`; an empty `roots` array
65
+ * throws `ai-reviewcoreediting-empty-roots`.
54
66
  *
55
67
  * The target language is not restricted to a predefined list and is forwarded to the translate endpoint as-is.
56
68
  * See the {@glink features/ai/ckeditor-ai-translate#supported-languages supported languages} guide.
@@ -58,20 +70,20 @@ export declare class AITranslateGateway extends ContextPlugin {
58
70
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
59
71
  * without the standard deprecation policy. Check the changelog for migration guidance.
60
72
  * @param language The target language to translate the content into.
61
- * @param options Optional `signal` to allow aborting the run.
73
+ * @param options Optional `roots` filter and `signal` to allow aborting the run.
62
74
  */
63
- runTranslate(language: string, options?: AITranslateRunOptions): Promise<AITranslateRunResult>;
75
+ runTranslate(language: string, options?: AITranslateRunOptions): Promise<AIRunResult<AICheckRunSingleRootResult>>;
64
76
  /**
65
- * Applies the translate run result (produced by {@link #runTranslate}) to the editor content, either
66
- * as direct changes or as track changes suggestions.
67
- *
68
- * This is a proxy to the {@link module:ai/aicore/aigateway~AIGateway#apply} method.
77
+ * Applies a translate run result (produced by {@link #runTranslate}) to the editor content, either as direct
78
+ * changes or as track-changes suggestions. Each per-root sub-result is applied to the root identified by its own
79
+ * `channelId` and `rootName`. Pass `options.roots` to restrict the apply to a subset of roots — the filter is
80
+ * symmetric with the one accepted by {@link #runTranslate}.
69
81
  *
70
82
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
71
83
  * without the standard deprecation policy. Check the changelog for migration guidance.
72
- * @param result The result of a completed AI translate run.
73
- * @param options Apply options forwarded to {@link module:ai/aicore/aigateway~AIGateway#apply} (for example the
74
- * `applyMethod`).
84
+ * @param result The result returned by {@link #runTranslate}.
85
+ * @param options Apply options forwarded to {@link module:ai/aicore/aigateway~AIGateway#apply}, including the
86
+ * `applyMethod` and an optional `roots` filter.
75
87
  */
76
- applyTranslate(result: AITranslateRunResult, options: AIGatewayApplyOptions): void;
88
+ applyTranslate(result: AIRunResult<AICheckRunSingleRootResult>, options: AIGatewayApplyOptions): void;
77
89
  }
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { AIReviewCoreUI } from "../aireviewcore/aireviewcoreui.js";
6
6
  import { AIReviewCoreView } from "../aireviewcore/ui/aireviewcoreview.js";
7
- import "../../theme/aitranslate/aitranslate.css";
8
7
  export declare class AITranslateUI extends AIReviewCoreUI {
9
8
  /**
10
9
  * @inheritDoc
@@ -9,6 +9,7 @@ import { type AIConnector } from "../../aicore/aiconnector.js";
9
9
  import { type AIDocumentData } from "../../aireviewcore/aireviewcoreediting.js";
10
10
  import { type AIReviewCheck } from "../../aireviewcore/model/aireviewcheck.js";
11
11
  import { AIReviewSystemCheckRun } from "../../aireviewcore/model/aireviewsystemcheckrun.js";
12
+ import { type AIContextRef } from "../../aicore/model/aicontextref.js";
12
13
  /**
13
14
  * Represents a single translate check run and its results.
14
15
  */
@@ -16,7 +17,7 @@ export declare class AITranslateCheckRun extends AIReviewSystemCheckRun {
16
17
  /**
17
18
  * @inheritDoc
18
19
  */
19
- constructor(documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector, title: string, params?: Array<string>, args?: Record<string, any>);
20
+ constructor(documentData: AIDocumentData, sourceCheck: AIReviewCheck, connector: AIConnector, title: string, params?: Array<string>, args?: Record<string, any>, contexts?: Array<AIContextRef>);
20
21
  /**
21
22
  * @inheritDoc
22
23
  */