/**
 * Chat Trigger Node - Version 1.1
 * Runs the workflow when an n8n generated webchat is submitted
 */


export interface LcChatTriggerV11Params {
/**
 * Whether the chat should be publicly available or only accessible through the manual chat interface
 * @default false
 */
    public?: boolean | Expression<boolean>;
/**
 * Mode
 * @displayOptions.show { public: [true] }
 * @default hostedChat
 */
    mode?: 'hostedChat' | 'webhook' | Expression<string>;
/**
 * The way to authenticate
 * @displayOptions.show { public: [true] }
 * @default none
 */
    authentication?: 'basicAuth' | 'n8nUserAuth' | 'none' | Expression<string>;
/**
 * Default messages shown at the start of the chat, one per line
 * @displayOptions.show { mode: ["hostedChat"], public: [true] }
 */
    initialMessages?: string | Expression<string> | PlaceholderValue;
/**
 * Whether to make the agent available in n8n Chat Hub for n8n instance users to chat with
 * @default false
 */
    availableInChat?: boolean;
/**
 * Options
 * @displayOptions.show { public: [false, true], mode: ["hostedChat", "webhook"] }
 * @default {}
 */
    options?: {
    /** Whether to allow file uploads in the chat
     * @default false
     */
    allowFileUploads?: boolean | Expression<boolean>;
    /** Allowed file types for upload. Comma-separated list of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types" target="_blank"&gt;MIME types&lt;/a&gt;.
     * @default *
     */
    allowedFilesMimeTypes?: string | Expression<string> | PlaceholderValue;
    /** Comma-separated list of URLs allowed for cross-origin non-preflight requests. Use * (default) to allow all origins.
     * @displayOptions.show { /mode: ["hostedChat", "webhook"] }
     * @default *
     */
    allowedOrigins?: string | Expression<string> | PlaceholderValue;
    /** Shown as placeholder text in the chat input field
     * @displayOptions.show { /mode: ["hostedChat"] }
     * @default Type your question..
     */
    inputPlaceholder?: string | Expression<string> | PlaceholderValue;
    /** If loading messages of a previous session should be enabled
     * @builderHint This ONLY rehydrates the chat widget UI when the user reopens it — it does NOT give the Agent memory. The Agent gets memory from its own memory subnode regardless of this setting. Only set to 'memory' if the user wants the widget to restore visible history on reload; if so, you MUST also attach a memory subnode to this trigger (use the same memory node as the Agent so widget history matches what the Agent remembers). Otherwise leave as 'notSupported'.
     * @default notSupported
     */
    loadPreviousSession?: 'notSupported' | 'memory' | 'manually' | Expression<string>;
    /** Whether to show the welcome screen at the start of the chat
     * @displayOptions.show { /mode: ["hostedChat"] }
     * @default false
     */
    showWelcomeScreen?: boolean | Expression<boolean>;
    /** Shown as part of the welcome screen, in the middle of the chat window
     * @displayOptions.show { showWelcomeScreen: [true], /mode: ["hostedChat"] }
     * @default New Conversation
     */
    getStarted?: string | Expression<string> | PlaceholderValue;
    /** Shown at the top of the chat, under the title
     * @displayOptions.show { /mode: ["hostedChat"] }
     * @default Start a chat. We're here to help you 24/7.
     */
    subtitle?: string | Expression<string> | PlaceholderValue;
    /** Shown at the top of the chat
     * @displayOptions.show { /mode: ["hostedChat"] }
     * @default Hi there! 👋
     */
    title?: string | Expression<string> | PlaceholderValue;
    /** Override default styling of the public chat interface with CSS
     * @displayOptions.show { /mode: ["hostedChat"] }
     */
    customCss?: string | Expression<string> | PlaceholderValue;
    /** When and how to respond to the webhook
     * @default lastNode
     */
    responseMode?: 'lastNode' | 'responseNode' | Expression<string>;
    /** Whether to automatically save &lt;a href="https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executiondata/" target="_blank"&gt;highlighted data&lt;/a&gt;. This data can then be used to filter executions in the Executions view. Available on Pro and Enterprise plans in n8n Cloud, and on Enterprise or registered Community Edition for self-hosted. Defaults to true.
     * @default true
     */
    autoSaveHighlightedData?: boolean | Expression<boolean>;
  };
}

export interface LcChatTriggerV11SubnodeConfig {
  /**
   * @displayOptions.show { options.loadPreviousSession: ["memory"] }
   */
  memory: MemoryInstance;
}

export interface LcChatTriggerV11Credentials {
  httpBasicAuth: CredentialReference;
}

interface LcChatTriggerV11NodeBase {
  type: '@n8n/n8n-nodes-langchain.chatTrigger';
  version: 1.1;
  credentials?: LcChatTriggerV11Credentials;
}

export type LcChatTriggerV11ParamsNode = LcChatTriggerV11NodeBase & {
  config: NodeConfig<LcChatTriggerV11Params> & { subnodes: LcChatTriggerV11SubnodeConfig };
};

export type LcChatTriggerV11Node = LcChatTriggerV11ParamsNode;