@ckeditor/ckeditor5-ai 48.3.1 → 48.4.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.
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
@@ -11,6 +11,7 @@ import { AIConnector } from "../aicore/aiconnector.js";
11
11
  import { AIErrorSink } from "../aicore/aierrorreporter.js";
12
12
  import { Dialog } from "@ckeditor/ckeditor5-ui";
13
13
  import { AIEditing } from "../aicore/aiediting.js";
14
+ import { type AIContextRef } from "../aicore/model/aicontextref.js";
14
15
  import { AIBalloon } from "../aiballoon/aiballoon.js";
15
16
  import { DocumentCompare } from "@ckeditor/ckeditor5-collaboration-core";
16
17
  /**
@@ -72,11 +73,45 @@ export type AIActionsNames = "continue" | "fix-grammar" | "improve-writing" | "m
72
73
  * Defines the parameters for an AI action executed via
73
74
  * {@link module:ai/aiactions/aiactions~AIActions#executeAction `executeAction()`}.
74
75
  *
75
- * For system actions, provide `actionName`. For custom actions, provide `userMessage` and `model`.
76
+ * The definition supports a few different shapes, depending on the action type and its prompt source:
77
+ *
78
+ * A system action runs one of the predefined actions. Provide its `actionName`.
79
+ *
80
+ * ```ts
81
+ * {
82
+ * actionName: 'improve-writing'
83
+ * }
84
+ * ```
85
+ *
86
+ * A custom action runs an inline prompt. Provide the `model` together with a `userMessage` that carries the prompt.
87
+ *
88
+ * ```ts
89
+ * {
90
+ * model: 'claude-4-6-sonnet',
91
+ * userMessage: 'Rewrite the selected text in a more formal tone.'
92
+ * }
93
+ * ```
94
+ *
95
+ * A custom action can also rely on a context reference instead of an inline prompt. In that case neither `actionName`
96
+ * nor `userMessage` is set, and the referenced context is passed through `contexts`.
97
+ *
98
+ * ```ts
99
+ * {
100
+ * model: 'claude-4-6-sonnet',
101
+ * contexts: [ { id: 'style-guide', promptId: 'improve-writing' } ]
102
+ * }
103
+ * ```
76
104
  */
77
105
  export type AIActionDefinition = {
78
106
  actionName?: AIActionsNames;
79
107
  args?: Record<string, string>;
80
108
  userMessage?: string;
81
109
  model?: string;
110
+ /**
111
+ * Context references attached to the action.
112
+ *
113
+ * @experimental **Experimental:** This is a production-ready API but may change in minor releases
114
+ * without the standard deprecation policy. Check the changelog for migration guidance.
115
+ */
116
+ contexts?: Array<AIContextRef>;
82
117
  };
@@ -9,6 +9,7 @@ import { AIInteraction, type AIInteractionOptions } from "../../aicore/model/aii
9
9
  import { type AIConnectorRequest } from "../../aicore/aiconnector.js";
10
10
  import { type AIActionsNames, type AIActionDefinition } from "../aiactions.js";
11
11
  import { type AIContextItem } from "../../aicore/model/aicontext.js";
12
+ import { type AIContextRef } from "../../aicore/model/aicontextref.js";
12
13
  import type { Editor } from "@ckeditor/ckeditor5-core";
13
14
  import { AIActionsReply } from "./aiactionsreply.js";
14
15
  export declare class AIActionsInteraction extends AIInteraction {
@@ -36,13 +37,18 @@ export declare class AIActionsInteraction extends AIInteraction {
36
37
  * The model of the command. Specified only for custom actions.
37
38
  */
38
39
  readonly model?: string;
40
+ /**
41
+ * Context references attached to the request. Combines the global `ai.defaultContext` entries that apply to the
42
+ * invoked action with the action's own context.
43
+ */
44
+ readonly contexts?: Array<AIContextRef>;
39
45
  hasError: boolean;
40
46
  /**
41
47
  * Set when this interaction fires `interactionStopped` (see {@link module:ai/aicore/model/aiinteraction~AIInteraction#stop}).
42
48
  */
43
49
  stoppedExplicitly: boolean;
44
50
  constructor(options: AIActionsInteractionOptions);
45
- sendRequest(): Promise<AIConnectorRequest>;
51
+ sendRequest(): AIConnectorRequest;
46
52
  getDocumentContext(): AIContextItem | undefined;
47
53
  /**
48
54
  * Override createReply to use the same content that was sent to AI for comparison.
@@ -10,9 +10,6 @@ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckedit
10
10
  import { Dialog } from "@ckeditor/ckeditor5-ui";
11
11
  import { AIAssistantEditing } from "./aiassistantediting.js";
12
12
  import { AIAdapter } from "./adapters/aiadapter.js";
13
- import "../../theme/aiassistant/ai.css";
14
- import "../../theme/aiassistant/ai-dropdown.css";
15
- import "../../theme/aiassistant/ai-form.css";
16
13
  import { ClipboardMarkersUtils } from "@ckeditor/ckeditor5-clipboard";
17
14
  /**
18
15
  * The UI plugin of the AI assistant.
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { ContextPlugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
9
  import { AIEditing } from "../aicore/aiediting.js";
10
- import "../../theme/aiballoon/aiballoon.css";
11
10
  import { type ModelRange } from "@ckeditor/ckeditor5-engine";
12
11
  import { type AIBalloonView, AI_BALLOON_VIEW_EVENT_NAMES } from "./ui/aiballoonview.js";
13
12
  /**
@@ -9,7 +9,7 @@ import { type Editor, Plugin, type PluginDependenciesOf } from "@ckeditor/ckedit
9
9
  import { AIBalloon, type AIBalloonConfig } from "../aiballoon/aiballoon.js";
10
10
  import { type AISuggestionContentPartDefinition } from "../aicore/utils/getsuggestionpartsfromreply.js";
11
11
  import { type AIContentRenderingStrategy } from "../aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js";
12
- import { type AIReplyChangeGroupState } from "../aicore/model/aireply.js";
12
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../aicore/model/aireply.js";
13
13
  import { Dialog } from "@ckeditor/ckeditor5-ui";
14
14
  /**
15
15
  * The plugin responsible for the AI Balloon dialog in the Chat UI.
@@ -66,11 +66,16 @@ export declare class AIChatBalloon extends Plugin {
66
66
  /**
67
67
  * Sets the state of the suggestion part displayed in the balloon (accepted, rejected, pending, etc.).
68
68
  */
69
- setState(state: AIReplyChangeGroupState): void;
69
+ setState(state: AIReplyChangeGroupState, outdatedReason?: AIReplyChangeGroupOutdatedReason): void;
70
+ /**
71
+ * Updates the read-only state of the previewed suggestion's target editor. Called by the controller.
72
+ */
73
+ setTargetReadOnly(isReadOnly: boolean): void;
70
74
  }
71
75
  type AIChatBalloonConfig = AIBalloonConfig & {
72
76
  areActionsDisabled: boolean;
73
77
  showRotator: boolean;
78
+ isTargetReadOnly: boolean;
74
79
  };
75
80
  /**
76
81
  * Event fired when user toggles the suggestion display mode.
@@ -11,7 +11,9 @@ import { AIConnector } from "../aicore/aiconnector.js";
11
11
  import { AIErrorSink } from "../aicore/aierrorreporter.js";
12
12
  import { AIChatConversation, type AIChatInteractionCreatedEvent } from "./model/aichatconversation.js";
13
13
  import { type AIInteractionReplyCreatedEvent, type AIToolData } from "../aicore/model/aiinteraction.js";
14
+ import { type AIContextRef } from "../aicore/model/aicontextref.js";
14
15
  import { type AIChatInteraction } from "./model/aichatinteraction.js";
16
+ import { AICore } from "../aicore/aicore.js";
15
17
  import { DocumentCompare } from "@ckeditor/ckeditor5-collaboration-core";
16
18
  import { type AIChatFeedCustomElementView } from "./ui/feed/aichatfeedcustomelementview.js";
17
19
  /**
@@ -36,7 +38,7 @@ export declare class AIChatController extends ContextPlugin {
36
38
  /**
37
39
  * @inheritDoc
38
40
  */
39
- static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, DocumentCompare]>;
41
+ static get requires(): PluginDependenciesOf<[AIConnector, AIErrorSink, DocumentCompare, AICore]>;
40
42
  /**
41
43
  * @inheritDoc
42
44
  */
@@ -157,14 +159,21 @@ export declare class AIChatController extends ContextPlugin {
157
159
  *
158
160
  * @param options Optional parameters for starting the conversation.
159
161
  * @param options.modelId If provided, this model will be selected for the new conversation instead of the default one.
162
+ * @param options.contexts Additional context references attached to every message of this conversation, merged with
163
+ * the {@link module:ai/aiconfig~AIConfig#defaultContext global default context} resolved for the `chat` feature.
164
+ * Used by features that seed a conversation (for example AI Quick Actions) to inject their own context.
165
+ *
166
+ * @experimental **Experimental:** The `contexts` option is a production-ready API but may change in minor releases
167
+ * without the standard deprecation policy. Check the changelog for migration guidance.
160
168
  */
161
169
  startConversation(options?: {
162
170
  modelId?: string;
171
+ contexts?: Array<AIContextRef>;
163
172
  }): Promise<void>;
164
173
  /**
165
174
  * Submits a user message to the currently active conversation.
166
175
  */
167
- sendMessage(messageData: AIChatUserMessageData): Promise<void>;
176
+ sendMessage({ message, attributes }: AIChatUserMessageData): Promise<void>;
168
177
  /**
169
178
  * Returns the ID under which conversations are grouped. All created conversations will have this `groupId` set. Conversation history
170
179
  * will fetch conversations with such `groupId`.
@@ -183,6 +192,7 @@ export declare class AIChatController extends ContextPlugin {
183
192
  protected _startConversationSafely(options?: {
184
193
  id?: string;
185
194
  modelId?: string;
195
+ contexts?: Array<AIContextRef>;
186
196
  }): Promise<void>;
187
197
  }
188
198
  /**
@@ -12,13 +12,12 @@ import { type AIContextItem } from "../aicore/model/aicontext.js";
12
12
  import { type Document } from "../aicore/utils/htmlparser.js";
13
13
  import { type AICapabilitiesConfig } from "../aicore/model/aicapabilities.js";
14
14
  import { type AIChatInputPaste } from "./utils/resolvepaste.js";
15
- import { type AIReply, type AIReplyChangeGroupState } from "../aicore/model/aireply.js";
15
+ import { type AIReply, type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../aicore/model/aireply.js";
16
16
  import { type AISuggestionContentPartDefinition } from "../aicore/utils/getsuggestionpartsfromreply.js";
17
- import { type AIChatConversationInitializedEvent } from "./model/aichatconversation.js";
17
+ import { type AISuggestionGating } from "../aicore/ui/suggestioncontainer/aisuggestionbodyview.js";
18
18
  import { type AIModelData, type AISource } from "../aicore/aiconnector.js";
19
19
  import { type AIChatInteraction } from "./model/aichatinteraction.js";
20
20
  import { type AIContentRenderingStrategy } from "../aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js";
21
- import "../../theme/aichat/aichat.css";
22
21
  import { type AIChatFeedCustomElementView } from "./ui/feed/aichatfeedcustomelementview.js";
23
22
  export declare class AIChatUI extends ContextPlugin {
24
23
  /**
@@ -40,7 +39,9 @@ export declare class AIChatUI extends ContextPlugin {
40
39
  /**
41
40
  * The busy state of the UI.
42
41
  *
43
- * It is set to `true` when there are AI response being streamed or rendered.
42
+ * It is set to `true` when the UI is busy for any reason, e.g.:
43
+ * - The AI response is still being streamed or rendered.
44
+ * - A whole conversation from history is still being loaded or rendered.
44
45
  *
45
46
  * @observable
46
47
  */
@@ -52,6 +53,10 @@ export declare class AIChatUI extends ContextPlugin {
52
53
  */
53
54
  isModelAvailable: boolean;
54
55
  /**
56
+ * @observable
57
+ */
58
+ isChatStreaming: boolean;
59
+ /**
55
60
  * @inheritDoc
56
61
  */
57
62
  constructor(context: Context | Editor);
@@ -59,7 +64,9 @@ export declare class AIChatUI extends ContextPlugin {
59
64
  /**
60
65
  * Creates a new conversation by greeting the user.
61
66
  */
62
- createConversation(data: AIChatConversationInitializedEvent["args"][0]): void;
67
+ createConversation({ availableModels }: {
68
+ availableModels: Array<AIModelData>;
69
+ }): void;
63
70
  /**
64
71
  * Adds a generic message to the chat feed.
65
72
  */
@@ -135,8 +142,13 @@ export declare class AIChatUI extends ContextPlugin {
135
142
  id: string;
136
143
  index: number;
137
144
  state: AIReplyChangeGroupState;
145
+ outdatedReason?: AIReplyChangeGroupOutdatedReason;
138
146
  }): void;
139
147
  /**
148
+ * Applies the gating state to a suggestion reply's views.
149
+ */
150
+ setSuggestionGating(replyId: string, gating: AISuggestionGating): void;
151
+ /**
140
152
  * Sets the part active or not (active parts are those currently previewed in a dialog by the user).
141
153
  */
142
154
  setFeedItemAIReplySuggestionPartActive(options: {
@@ -156,7 +168,7 @@ export declare class AIChatUI extends ContextPlugin {
156
168
  * Handles the user stopping the interaction. It terminates all scheduled UI update promises and unlocks the UI
157
169
  * immediately.
158
170
  */
159
- stopInteraction(interaction: AIChatInteraction): void;
171
+ stopInteraction(interaction?: AIChatInteraction): void;
160
172
  /**
161
173
  * Handles the interaction finishing due to lack of data to process (or an error). Waits for all pending UI
162
174
  * updates to finish, then unlocks the UI.
@@ -263,8 +275,10 @@ export declare class AIChatUI extends ContextPlugin {
263
275
  startAutoScroll(options?: {
264
276
  smooth?: boolean;
265
277
  }): void;
278
+ stopAutoScroll(): void;
266
279
  disableControls(): void;
267
280
  enableControls(): void;
281
+ toggleConversationLoading(updatedIsBusy: boolean): void;
268
282
  }
269
283
  /**
270
284
  * An event fired when the user starts a new conversation.
@@ -7,10 +7,8 @@
7
7
  * @publicApi
8
8
  */
9
9
  import { type Editor } from "@ckeditor/ckeditor5-core";
10
- import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
11
10
  import { type AIConnector, type AIUserMessage } from "../../aicore/aiconnector.js";
12
- import { type AIContextItemType, type AIContextTextResourceType, type AIContextItem, type AIContextItemRequestData, type AIToolContextItem } from "../../aicore/model/aicontext.js";
13
- declare const AIChatContextBase: ObservableMixinConstructor;
11
+ import { AIContext, type AIContextItemType, type AIContextTextResourceType, type AIContextItem, type AIContextItemRequestData, type AIToolContextItem } from "../../aicore/model/aicontext.js";
14
12
  export declare const AI_CONTEXT_MODEL_EVENT_NAMES: readonly ["contextItemAdded", "contextItemRemoved", "contextItemLoadingEnded", "contextSent", "error", "addContextOptionsChanged", "sourceResourcesLoaded", "resourceStateChanged", "uploadProgressChanged"];
15
13
  /**
16
14
  * Manages the context of the current conversation.
@@ -18,7 +16,7 @@ export declare const AI_CONTEXT_MODEL_EVENT_NAMES: readonly ["contextItemAdded",
18
16
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
19
17
  * without the standard deprecation policy. Check the changelog for migration guidance.
20
18
  */
21
- export declare class AIChatContext extends AIChatContextBase {
19
+ export declare class AIChatContext extends AIContext {
22
20
  constructor({ connector, config, ownerId }: {
23
21
  connector: AIConnector;
24
22
  config?: AIChatContextConfig;
@@ -45,17 +43,18 @@ export declare class AIChatContext extends AIChatContextBase {
45
43
  * (notably by `AIReply`) to route modifications back to the source editor and root; non-document content items
46
44
  * are turned into one context item each.
47
45
  *
48
- * Returns the assembled context items together with a `hasUnmatched` flag set when at least one document could
46
+ * Returns the assembled context items together with `unmatchedDocumentIds` — the IDs of documents that could
49
47
  * not be matched to a live editor root via `attributes.channelId` (compared against the editor's
50
- * `collaboration.channelId` config) and `attributes.rootName`. Callers should propagate `hasUnmatched` to reply
51
- * `areActionsDisabled` so suggestions from unmatched roots are shown with a "from previous session" note.
52
- *
48
+ * `collaboration.channelId` config) and `attributes.rootName`. Callers resolve a per-document outdated reason
49
+ * from these IDs so suggestions from unmatched roots render as outdated while their matched siblings stay
50
+ * actionable.
53
51
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
54
52
  * without the standard deprecation policy. Check the changelog for migration guidance.
55
53
  */
56
- populateFromMessage(messageContents: AIUserMessage["content"], editors: ReadonlyArray<Editor>): Promise<{
54
+ populateFromMessage(messageContents: AIUserMessage["content"], editors: ReadonlyArray<Editor>, defaultContextIds?: Set<string>): Promise<{
57
55
  contextItems: Map<string, AIContextItem>;
58
56
  hasUnmatched: boolean;
57
+ unmatchedDocumentIds: Set<string>;
59
58
  }>;
60
59
  /**
61
60
  * Creates a context item from a single non-document conversation content entry. Document content items are
@@ -83,6 +82,10 @@ export declare class AIChatContext extends AIChatContextBase {
83
82
  /**
84
83
  * Clears all pending context items and adds the current document to the conversation context if it exists.
85
84
  *
85
+ * Context references (`type: 'context'`) are non-persistent and are skipped here: the backend does not store them
86
+ * in the conversation state, so they must be re-attached to every message for as long as the user keeps them
87
+ * selected. Skipping them also keeps their chips visible and removable.
88
+ *
86
89
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
87
90
  * without the standard deprecation policy. Check the changelog for migration guidance.
88
91
  */
@@ -90,6 +93,10 @@ export declare class AIChatContext extends AIChatContextBase {
90
93
  /**
91
94
  * Adds context items to the conversation context and clears the pending context items.
92
95
  *
96
+ * Context references (`type: 'context'`) are non-persistent and never become conversation items: the backend does
97
+ * not store them in the conversation state (they are re-attached to every message while selected), and tracking
98
+ * them here would keep reporting the resource as in context after the user removes its chip.
99
+ *
93
100
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
94
101
  * without the standard deprecation policy. Check the changelog for migration guidance.
95
102
  */
@@ -150,6 +157,10 @@ export declare class AIChatContext extends AIChatContextBase {
150
157
  */
151
158
  addCurrentDocumentToContext(label: string): void;
152
159
  /**
160
+ * Returns context item for current document context, or undefined if the document context is not added.
161
+ */
162
+ getCurrentDocumentContext(): AIContextItem | undefined;
163
+ /**
153
164
  * @experimental **Experimental:** This is a production-ready API but may change in minor releases
154
165
  * without the standard deprecation policy. Check the changelog for migration guidance.
155
166
  */
@@ -384,6 +395,15 @@ export type AIChatContextConfig = {
384
395
  enabled: boolean;
385
396
  };
386
397
  /**
398
+ * When this option is enabled, the contexts available to the current token are offered in the context picker as a
399
+ * built-in source, excluding any context referenced by the global `ai.defaultContext` configuration.
400
+ *
401
+ * @default false
402
+ */
403
+ contextLibrary?: {
404
+ enabled: boolean;
405
+ };
406
+ /**
387
407
  * The configuration of the custom options in the context menu.
388
408
  *
389
409
  * Each configured {@link module:ai/aichat/model/aichatcontext~AIContextProvider} represents a single menu option that, when clicked,
@@ -660,4 +680,3 @@ export type AIContextCustomItem = {
660
680
  icon?: string;
661
681
  callback: () => void;
662
682
  };
663
- export {};
@@ -9,6 +9,7 @@ import { type EmitterMixinConstructor, type Locale } from "@ckeditor/ckeditor5-u
9
9
  import type { AIConnector, AIModelData } from "../../aicore/aiconnector.js";
10
10
  import { AIChatContext, type AIChatContextConfig, type AIContextProvider, type AIContextResource, type AIContextResourceState } from "./aichatcontext.js";
11
11
  import { type AIToolContextItem, type AIContextItem } from "../../aicore/model/aicontext.js";
12
+ import { type AIEditing } from "../../aicore/aiediting.js";
12
13
  import { AICapabilities, type AICapabilitiesConfig } from "../../aicore/model/aicapabilities.js";
13
14
  import type { AIModels } from "../../aicore/model/aimodels.js";
14
15
  import { type Editor } from "@ckeditor/ckeditor5-core";
@@ -98,6 +99,7 @@ export declare class AIChatConversation extends AIChatConversationBase {
98
99
  userMessage: string;
99
100
  attributes?: Record<string, unknown>;
100
101
  }): Promise<void>;
102
+ stopProcessing(): void;
101
103
  /**
102
104
  * Creates a new interaction and stores it in the conversation.
103
105
  */
@@ -272,9 +274,16 @@ export type AIChatConversationOptions = {
272
274
  selectedModelId?: string;
273
275
  isFromHistory: boolean;
274
276
  /**
275
- * Returns the session id of the given editor. Used by the conversation when detecting whether a stored
277
+ * Returns the session ID of the given editor. Used by the conversation when detecting whether a stored
276
278
  * AI chat reply was created during the current editing session of its source editor.
277
279
  */
278
280
  getSessionId: (editor: Editor) => string;
281
+ /**
282
+ * The {@link module:ai/aicore/aiediting~AIEditing} context plugin. The conversation uses its context-level utilities
283
+ * (e.g. {@link module:ai/aicore/aiediting~AIEditing#getDocumentData} and
284
+ * {@link module:ai/aicore/aiediting~AIEditing#getEditorsVersions}) to refresh the current-document context, instead of
285
+ * reaching for individual editor instances.
286
+ */
287
+ aiEditing: AIEditing;
279
288
  };
280
289
  export {};
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { type AICapabilitiesConfig } from "../../aicore/model/aicapabilities.js";
10
10
  import { AIInteraction, type AIInteractionOptions } from "../../aicore/model/aiinteraction.js";
11
- import { type AIContextItem } from "../../aicore/model/aicontext.js";
11
+ import { AIContext, type AIContextItem } from "../../aicore/model/aicontext.js";
12
12
  export declare class AIChatInteraction extends AIInteraction {
13
13
  /**
14
14
  * The user message that was sent to the AI endpoint.
@@ -34,6 +34,10 @@ export declare class AIChatInteraction extends AIInteraction {
34
34
  * Additional metadata properties passed together with the user message when it was submitted.
35
35
  */
36
36
  readonly attributes?: Record<string, unknown>;
37
+ /**
38
+ * The resolved context (default context merged with any injected contexts) attached to every message in the conversation.
39
+ */
40
+ readonly context: AIContext;
37
41
  constructor(options: AIChatInteractionOptions);
38
42
  }
39
43
  export type AIChatInteractionOptions = {
@@ -43,4 +47,5 @@ export type AIChatInteractionOptions = {
43
47
  userMessage: string;
44
48
  model: string;
45
49
  attributes?: Record<string, unknown>;
50
+ context?: AIContext;
46
51
  } & AIInteractionOptions;
@@ -11,8 +11,7 @@ import { type AISuggestionContentPartDefinition } from "../../aicore/utils/getsu
11
11
  import { type AIContentRenderingStrategy } from "../../aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js";
12
12
  import { AIBalloonView } from "../../aiballoon/ui/aiballoonview.js";
13
13
  import { ButtonView, FocusCycler, type ViewCollection } from "@ckeditor/ckeditor5-ui";
14
- import { type AIReplyChangeGroupState } from "../../aicore/model/aireply.js";
15
- import "../../../theme/aichat/aichatballoon.css";
14
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../aicore/model/aireply.js";
16
15
  export type AIChatBalloonViewConfig = {
17
16
  showApplyButton: boolean;
18
17
  showSuggestButton: boolean;
@@ -47,6 +46,18 @@ export declare class AIChatBalloonView extends AIBalloonView {
47
46
  */
48
47
  isTrackChangesOn: boolean;
49
48
  /**
49
+ * Whether the target editor is read-only. Forwarded to the part toolbar to disable the write actions (apply, suggest).
50
+ *
51
+ * @observable
52
+ */
53
+ isTargetReadOnly: boolean;
54
+ /**
55
+ * Whether the part toolbar actions are disabled by the reply itself (for example a history reply).
56
+ *
57
+ * @observable
58
+ */
59
+ areActionsDisabled: boolean;
60
+ /**
50
61
  * @inheritDoc
51
62
  */
52
63
  constructor(locale: Locale, config: AIChatBalloonViewConfig);
@@ -82,29 +93,13 @@ export declare class AIChatBalloonView extends AIBalloonView {
82
93
  /**
83
94
  * Sets the state of the suggestion part displayed in the balloon.
84
95
  */
85
- setState(state: AIReplyChangeGroupState): void;
96
+ setState(state: AIReplyChangeGroupState, outdatedReason?: AIReplyChangeGroupOutdatedReason): void;
86
97
  /**
87
98
  * Shows an error message in the balloon.
88
99
  */
89
100
  override showError(message: string): void;
90
101
  /**
91
- * Hides the error message in the balloon and re-enables the toolbar buttons.
92
- */
93
- override hideError(): void;
94
- /**
95
- * Displays a blocking error message and disables the toolbar buttons.
96
- */
97
- override showBlockingError(message: string): void;
98
- /**
99
102
  * Toggles the visibility of the rotator buttons.
100
103
  */
101
104
  toggleRotatorButtonsVisibility(isVisible: boolean): void;
102
- /**
103
- * Toggles the enabled state of the content part toolbar based on the flag.
104
- *
105
- * * Those buttons may become disabled because there's an error in the view.
106
- * * Those buttons may become disabled despite pending state of the suggestion part, for instance, if the suggestion
107
- * was loaded from the history.
108
- */
109
- togglePartToolbarEnabled(isEnabled: boolean): void;
110
105
  }
@@ -10,15 +10,6 @@ import { View, type BodyCollection } from "@ckeditor/ckeditor5-ui";
10
10
  import { type AIAddContextOptionsState, type AIContextProvider, type AIContextResourceState } from "../model/aichatcontext.js";
11
11
  import { type AIContextItem } from "../../aicore/model/aicontext.js";
12
12
  import { type AIModelData } from "../../aicore/aiconnector.js";
13
- import "../../../theme/aichat/aichat-controls.css";
14
- import "../../../theme/aichat/aichat-controls/prompt-input.css";
15
- import "../../../theme/aichat/aichat-controls/prompt-capabilities.css";
16
- import "../../../theme/aichat/aichat-controls/model-unavailable-message.css";
17
- import "../../../theme/aichat/aichat-controls/aichat-context-controls.css";
18
- import "../../../theme/aichat/aichat-controls/aichat-context-chip.css";
19
- import "../../../theme/aichat/aichat-controls/aichat-controls-button.css";
20
- import "../../../theme/aichat/aichat-controls/aichat-controls-loader.css";
21
- import "../../../theme/aichat/aichat-controls/aichat-context-controls-balloon-panels.css";
22
13
  export declare class AIChatControlsView extends View {
23
14
  /**
24
15
  * The loading state of the controls.
@@ -17,17 +17,9 @@ import { AIChatFeedErrorItemView } from "./feed/aichatfeederroritemview.js";
17
17
  import { AIChatFeedInteractionHeaderView } from "./feed/aichatfeedinteractionheaderview.js";
18
18
  import { type AISuggestionContentPartDefinition } from "../../aicore/utils/getsuggestionpartsfromreply.js";
19
19
  import { AIChatFeedCustomElementView } from "./feed/aichatfeedcustomelementview.js";
20
- import { type AIReplyChangeGroupState } from "../../aicore/model/aireply.js";
20
+ import { type AIReplyChangeGroupState, type AIReplyChangeGroupOutdatedReason } from "../../aicore/model/aireply.js";
21
21
  import { type AISource } from "../../aicore/aiconnector.js";
22
- import "../../../theme/aichat/aichatfeed.css";
23
- import "../../../theme/aichat/aichatcontent/_base.css";
24
- import "../../../theme/aichat/aichatcontent/_typography.css";
25
- import "../../../theme/aichat/aichatcontent/_link.css";
26
- import "../../../theme/aichat/aichatcontent/_code.css";
27
- import "../../../theme/aichat/aichatcontent/_list.css";
28
- import "../../../theme/aichat/aichatcontent/_table.css";
29
- import "../../../theme/aichat/aichatcontent/_blockquote.css";
30
- import "../../../theme/aichat/aichatcontent/_hr.css";
22
+ import { type AISuggestionGating } from "../../aicore/ui/suggestioncontainer/aisuggestionbodyview.js";
31
23
  /**
32
24
  * A view that displays the chat feed with various items.
33
25
  */
@@ -80,11 +72,13 @@ export declare class AIChatFeedView extends View {
80
72
  abortSignal: AbortSignal;
81
73
  skipLoadingEffects?: boolean;
82
74
  }): Promise<void>;
83
- updateSuggestionPartState({ id, index, state }: {
75
+ updateSuggestionPartState({ id, index, state, outdatedReason }: {
84
76
  id: string;
85
77
  index: number;
86
78
  state: AIReplyChangeGroupState;
79
+ outdatedReason?: AIReplyChangeGroupOutdatedReason;
87
80
  }): void;
81
+ updateSuggestionGating(replyId: string, gating: AISuggestionGating): void;
88
82
  /**
89
83
  * Sets the part active or not (active parts are those currently previewed in a dialog by the user).
90
84
  */
@@ -12,10 +12,6 @@ import { AIChatControlsView } from "./aichatcontrolsview.js";
12
12
  import { AIHeaderView } from "../../aicore/ui/aiheaderview.js";
13
13
  import { AIDisclaimerView } from "../../aicore/ui/aidisclaimerview.js";
14
14
  import { type AIContextProvider, type AIContextResourceState } from "../../aichat/model/aichatcontext.js";
15
- import "../../../theme/common/ainotification.css";
16
- import "../../../theme/common/aibutton.css";
17
- import "../../../theme/common/aicolor.css";
18
- import "../../../theme/common/aitrackchanges.css";
19
15
  /**
20
16
  * The main view of the AI chat plugin.
21
17
  *
@@ -14,6 +14,10 @@ import { type Locale } from "@ckeditor/ckeditor5-utils";
14
14
  * through one listener.
15
15
  */
16
16
  export declare class AIChatDropZoneView extends View {
17
+ /**
18
+ * @observable
19
+ */
20
+ isEnabled: boolean;
17
21
  constructor(locale: Locale);
18
22
  attach(target: HTMLElement): void;
19
23
  }
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { type Locale } from "@ckeditor/ckeditor5-utils";
9
9
  import { View } from "@ckeditor/ckeditor5-ui";
10
+ import { AIModelSelectorView } from "../../../aicore/ui/aimodelselectorview.js";
10
11
  import { type AIModelData } from "../../../aicore/aiconnector.js";
11
12
  /**
12
13
  * Manages the prompt capabilities UI for AI chat, including web search, commands functionality, and model selection.
@@ -25,39 +26,14 @@ export declare class AIChatPromptCapabilitiesView extends View {
25
26
  */
26
27
  reasoningActive: boolean;
27
28
  /**
28
- * Determines the model display mode:
29
- * * 'selector' shows the dropdown,
30
- * * 'name' – shows the model name,
31
- * * 'hidden' – hides both.
32
- *
33
- * @observable
34
- */
35
- modelDisplayMode: "selector" | "name" | "hidden";
36
- /**
37
- * Indicates whether the model selection UI is enabled. The selection gets disabled
38
- * after the first message is sent to the API, as the model cannot be changed then.
29
+ * Indicates whether the model selection UI is enabled. The selection gets disabled after the first
30
+ * message is sent to the API, as the model cannot be changed then.
39
31
  *
40
32
  * @observable
41
33
  */
42
34
  modelSelectorEnabled: boolean;
43
- /**
44
- * The ID of the currently active model.
45
- *
46
- * @observable
47
- */
48
- activeModelId: string | null;
49
- /**
50
- * The name of the currently active model.
51
- *
52
- * @observable
53
- */
54
- activeModelName: string | null;
55
35
  constructor(locale: Locale);
56
36
  /**
57
- * Sets model list dropdown.
58
- */
59
- setModelList(models: Array<AIModelData>, hideModels: boolean): void;
60
- /**
61
37
  * Sets the web search state.
62
38
  */
63
39
  setWebSearch(isWebSearchEnabled: boolean): void;
@@ -66,7 +42,11 @@ export declare class AIChatPromptCapabilitiesView extends View {
66
42
  */
67
43
  setReasoning(isReasoningEnabled: boolean): void;
68
44
  /**
69
- * Sets the selected model.
45
+ * Populates the model selector with the given models.
46
+ */
47
+ setModelList(models: Array<AIModelData>, hideModels: boolean): void;
48
+ /**
49
+ * Reflects the selected model in the selector and the capability buttons.
70
50
  */
71
51
  setModel(model: AIModelData | null): void;
72
52
  /**
@@ -74,10 +54,15 @@ export declare class AIChatPromptCapabilitiesView extends View {
74
54
  */
75
55
  enableModelSelector(): void;
76
56
  /**
77
- * Disables the model selector dropdown.
57
+ * Disables the model selector dropdown, optionally hiding it entirely.
78
58
  */
79
59
  disableModelSelector(hideSelector: boolean): void;
80
60
  }
61
+ /**
62
+ * Creates the shared model selector configured for AI Chat: chat-specific CSS classes, per-model
63
+ * capability rendering, and the "disabled" tooltip shown once the model can no longer be changed.
64
+ */
65
+ export declare function createChatModelSelector(locale: Locale): AIModelSelectorView;
81
66
  export type AIChatUIToggleWebSearchEvent = {
82
67
  name: "toggleWebSearch";
83
68
  args: [];