/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ /** * @module ai/aiactions/model/aiactionsinteraction */ import { AIInteraction, type AIInteractionOptions } from "../../aicore/model/aiinteraction.js"; import { type AIConnectorRequest } from "../../aicore/aiconnector.js"; import { type AIActionsNames, type AIActionDefinition } from "../aiactions.js"; import { AIContext, type AIContextItem } from "../../aicore/model/aicontext.js"; import type { Editor } from "@ckeditor/ckeditor5-core"; import { AIActionsReply } from "./aiactionsreply.js"; export declare class AIActionsInteraction extends AIInteraction { /** * The content of the document for the command to refer to. */ readonly content: string; /** * The version of the document the content was extracted from. */ readonly version: number; /** * The name of the action to execute. Specified only for predefined actions. */ readonly actionName?: AIActionsNames; /** * The arguments to pass to the action. Specified only for predefined actions. */ readonly args?: Record; /** * The user message that was sent to the AI endpoint. Specified only for custom actions. */ readonly userMessage?: string; /** * The model of the command. Specified only for custom actions. */ readonly model?: string; /** * The context attached to the request. Combines the global `ai.defaultContext` entries that apply to the * invoked action with the action's own context. */ readonly context: AIContext; hasError: boolean; /** * Set when this interaction fires `interactionStopped` (see {@link module:ai/aicore/model/aiinteraction~AIInteraction#stop}). */ stoppedExplicitly: boolean; constructor(options: AIActionsInteractionOptions); sendRequest(): AIConnectorRequest; getDocumentContext(): AIContextItem | undefined; /** * Override createReply to use the same content that was sent to AI for comparison. * This ensures we compare AI response against the selection, not the entire document. * Uses AIActionsReply for single suggestion without context. */ override createReply(options: ConstructorParameters[0]): AIActionsReply; } export type AIActionsInteractionOptions = { content: string; version: number; editor: Editor; rootName: string; } & AIActionDefinition & AIInteractionOptions;