@tylertech/forge-ai 0.4.1 → 0.6.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.
- package/custom-elements.json +6894 -2090
- package/dist/ai-actions-toolbar/ai-actions-toolbar.d.ts +24 -1
- package/dist/ai-actions-toolbar/ai-actions-toolbar.mjs +171 -42
- package/dist/ai-actions-toolbar/ai-actions-toolbar.scss.mjs +1 -1
- package/dist/ai-agent-info/ai-agent-info.d.ts +29 -0
- package/dist/ai-agent-info/ai-agent-info.mjs +123 -0
- package/dist/ai-agent-info/ai-agent-info.scss.mjs +4 -0
- package/dist/ai-agent-info/index.d.ts +1 -0
- package/dist/ai-agent-info/index.mjs +5 -0
- package/dist/ai-artifact/ai-artifact.scss.mjs +1 -1
- package/dist/ai-attachment/ai-attachment.d.ts +39 -0
- package/dist/ai-attachment/ai-attachment.mjs +130 -0
- package/dist/ai-attachment/ai-attachment.scss.mjs +4 -0
- package/dist/ai-attachment/index.d.ts +1 -0
- package/dist/ai-attachment/index.mjs +5 -0
- package/dist/ai-button/ai-button.mjs +1 -0
- package/dist/ai-button/ai-button.scss.mjs +1 -1
- package/dist/ai-chain-of-thought/thought-base/thought-base.scss.mjs +1 -1
- package/dist/ai-chat-header/ai-chat-header.d.ts +39 -17
- package/dist/ai-chat-header/ai-chat-header.mjs +136 -30
- package/dist/ai-chat-header/ai-chat-header.scss.mjs +1 -1
- package/dist/ai-chat-header/index.d.ts +1 -0
- package/dist/ai-chat-interface/ai-chat-interface.d.ts +2 -4
- package/dist/ai-chat-interface/ai-chat-interface.mjs +24 -28
- package/dist/ai-chat-interface/ai-chat-interface.scss.mjs +1 -1
- package/dist/ai-chatbot/ag-ui-adapter.d.ts +22 -0
- package/dist/ai-chatbot/ag-ui-adapter.mjs +340 -0
- package/dist/ai-chatbot/agent-adapter.d.ts +133 -0
- package/dist/ai-chatbot/agent-adapter.mjs +136 -0
- package/dist/ai-chatbot/agent-runner.d.ts +41 -0
- package/dist/ai-chatbot/agent-runner.mjs +264 -0
- package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +24 -0
- package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +252 -0
- package/dist/ai-chatbot/ai-chatbot-tool-call.scss.mjs +4 -0
- package/dist/ai-chatbot/ai-chatbot.d.ts +134 -0
- package/dist/ai-chatbot/ai-chatbot.mjs +816 -0
- package/dist/ai-chatbot/ai-chatbot.scss.mjs +4 -0
- package/dist/ai-chatbot/create-tool-renderer.d.ts +9 -0
- package/dist/ai-chatbot/create-tool-renderer.mjs +16 -0
- package/dist/ai-chatbot/event-emitter.d.ts +43 -0
- package/dist/ai-chatbot/event-emitter.mjs +81 -0
- package/dist/ai-chatbot/file-upload-manager.d.ts +27 -0
- package/dist/ai-chatbot/file-upload-manager.mjs +106 -0
- package/dist/ai-chatbot/http-agent-with-credentials.d.ts +8 -0
- package/dist/ai-chatbot/http-agent-with-credentials.mjs +14 -0
- package/dist/ai-chatbot/index.d.ts +15 -0
- package/dist/ai-chatbot/index.mjs +30 -0
- package/dist/ai-chatbot/markdown-stream-controller.d.ts +13 -0
- package/dist/ai-chatbot/markdown-stream-controller.mjs +49 -0
- package/dist/ai-chatbot/message-state-controller.d.ts +49 -0
- package/dist/ai-chatbot/message-state-controller.mjs +257 -0
- package/dist/ai-chatbot/types.d.ts +209 -0
- package/dist/ai-chatbot/utils.d.ts +12 -0
- package/dist/ai-chatbot/utils.mjs +32 -0
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.d.ts +28 -0
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.mjs +89 -0
- package/dist/ai-confirmation-prompt/ai-confirmation-prompt.scss.mjs +4 -0
- package/dist/ai-confirmation-prompt/index.d.ts +1 -0
- package/dist/ai-confirmation-prompt/index.mjs +5 -0
- package/dist/ai-dialog/ai-dialog.scss.mjs +1 -1
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.d.ts +1 -9
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.mjs +3 -16
- package/dist/ai-dropdown-menu/ai-dropdown-menu-item.scss.mjs +1 -1
- package/dist/ai-dropdown-menu/ai-dropdown-menu.d.ts +11 -6
- package/dist/ai-dropdown-menu/ai-dropdown-menu.mjs +13 -3
- package/dist/ai-dropdown-menu/ai-dropdown-menu.scss.mjs +1 -1
- package/dist/ai-dropdown-menu/selection-manager.mjs +3 -3
- package/dist/ai-embedded-chat/ai-embedded-chat.d.ts +18 -5
- package/dist/ai-embedded-chat/ai-embedded-chat.mjs +44 -18
- package/dist/ai-empty-state/ai-empty-state.d.ts +4 -2
- package/dist/ai-empty-state/ai-empty-state.mjs +237 -57
- package/dist/ai-empty-state/ai-empty-state.scss.mjs +1 -1
- package/dist/ai-error-message/ai-error-message.d.ts +19 -0
- package/dist/ai-error-message/ai-error-message.mjs +44 -0
- package/dist/ai-error-message/ai-error-message.scss.mjs +4 -0
- package/dist/ai-error-message/index.d.ts +1 -0
- package/dist/ai-error-message/index.mjs +5 -0
- package/dist/ai-event-stream-viewer/ai-event-stream-viewer.d.ts +19 -0
- package/dist/ai-event-stream-viewer/ai-event-stream-viewer.mjs +164 -0
- package/dist/ai-event-stream-viewer/ai-event-stream-viewer.scss.mjs +4 -0
- package/dist/ai-event-stream-viewer/index.d.ts +1 -0
- package/dist/ai-event-stream-viewer/index.mjs +5 -0
- package/dist/ai-fab/ai-fab.scss.mjs +1 -1
- package/dist/ai-file-picker/ai-file-picker.d.ts +20 -14
- package/dist/ai-file-picker/ai-file-picker.mjs +67 -20
- package/dist/ai-file-picker/ai-file-picker.scss.mjs +1 -1
- package/dist/ai-file-picker/index.d.ts +1 -1
- package/dist/ai-floating-chat/ai-floating-chat.d.ts +5 -30
- package/dist/ai-floating-chat/ai-floating-chat.mjs +19 -42
- package/dist/ai-gradient-container/ai-gradient-container.scss.mjs +1 -1
- package/dist/ai-icon/ai-icon.scss.mjs +1 -1
- package/dist/ai-icon-button/ai-icon-button.d.ts +19 -0
- package/dist/ai-icon-button/ai-icon-button.mjs +63 -0
- package/dist/ai-icon-button/ai-icon-button.scss.mjs +4 -0
- package/dist/ai-icon-button/index.d.ts +1 -0
- package/dist/ai-icon-button/index.mjs +5 -0
- package/dist/ai-message-thread/ai-message-thread.d.ts +59 -0
- package/dist/ai-message-thread/ai-message-thread.mjs +238 -0
- package/dist/ai-message-thread/ai-message-thread.scss.mjs +4 -0
- package/dist/ai-message-thread/index.d.ts +2 -0
- package/dist/ai-message-thread/index.mjs +5 -0
- package/dist/ai-modal/ai-modal.d.ts +6 -0
- package/dist/ai-modal/ai-modal.mjs +31 -14
- package/dist/ai-modal/ai-modal.scss.mjs +1 -1
- package/dist/ai-prompt/ai-prompt.d.ts +21 -0
- package/dist/ai-prompt/ai-prompt.mjs +135 -15
- package/dist/ai-prompt/ai-prompt.scss.mjs +1 -1
- package/dist/ai-prompt/prompt-button/prompt-button.scss.mjs +1 -1
- package/dist/ai-response-message/ai-response-message.d.ts +17 -21
- package/dist/ai-response-message/ai-response-message.mjs +86 -85
- package/dist/ai-response-message/ai-response-message.scss.mjs +1 -1
- package/dist/ai-sidebar/ai-sidebar.mjs +1 -1
- package/dist/ai-sidebar-chat/ai-sidebar-chat.d.ts +5 -29
- package/dist/ai-sidebar-chat/ai-sidebar-chat.mjs +23 -43
- package/dist/ai-slash-command-menu/ai-slash-command-menu.d.ts +33 -0
- package/dist/ai-slash-command-menu/ai-slash-command-menu.mjs +200 -0
- package/dist/ai-slash-command-menu/ai-slash-command-menu.scss.mjs +4 -0
- package/dist/ai-slash-command-menu/index.d.ts +1 -0
- package/dist/ai-slash-command-menu/index.mjs +5 -0
- package/dist/ai-spinner/ai-spinner.d.ts +24 -0
- package/dist/ai-spinner/ai-spinner.mjs +41 -0
- package/dist/ai-spinner/ai-spinner.scss.mjs +4 -0
- package/dist/ai-spinner/index.d.ts +1 -0
- package/dist/ai-spinner/index.mjs +5 -0
- package/dist/ai-suggestions/ai-suggestions.d.ts +4 -0
- package/dist/ai-suggestions/ai-suggestions.mjs +66 -7
- package/dist/ai-suggestions/ai-suggestions.scss.mjs +1 -1
- package/dist/ai-suggestions/index.d.ts +2 -1
- package/dist/ai-thinking-indicator/ai-thinking-indicator.d.ts +6 -1
- package/dist/ai-thinking-indicator/ai-thinking-indicator.mjs +94 -5
- package/dist/ai-thinking-indicator/ai-thinking-indicator.scss.mjs +320 -1
- package/dist/ai-threads/ai-threads.d.ts +9 -4
- package/dist/ai-threads/ai-threads.mjs +21 -41
- package/dist/ai-threads/ai-threads.scss.mjs +1 -1
- package/dist/ai-user-message/ai-user-message.scss.mjs +1 -1
- package/dist/ai-voice-input/ai-voice-input.scss.mjs +1 -1
- package/dist/core/drag-controller.mjs +3 -0
- package/dist/core/overlay/index.d.ts +1 -1
- package/dist/core/overlay/overlay.d.ts +20 -5
- package/dist/core/overlay/overlay.mjs +29 -4
- package/dist/core/popover/index.d.ts +1 -1
- package/dist/core/popover/popover.d.ts +24 -13
- package/dist/core/popover/popover.mjs +22 -3
- package/dist/core/popover/popover.scss.mjs +1 -1
- package/dist/core/tooltip/tooltip.d.ts +10 -9
- package/dist/core/tooltip/tooltip.mjs +45 -16
- package/dist/core/tooltip/tooltip.scss.mjs +1 -1
- package/dist/index.d.ts +12 -4
- package/dist/index.mjs +58 -9
- package/dist/tools/ai-data-table/ai-data-table-definition.d.ts +2 -0
- package/dist/tools/ai-data-table/ai-data-table-definition.mjs +43 -0
- package/dist/tools/ai-data-table/ai-data-table.d.ts +33 -0
- package/dist/tools/ai-data-table/ai-data-table.mjs +206 -0
- package/dist/tools/ai-data-table/ai-data-table.scss.mjs +4 -0
- package/dist/tools/ai-data-table/index.d.ts +2 -0
- package/dist/tools/ai-data-table/index.mjs +6 -0
- package/dist/tools/ai-paginator/ai-paginator.d.ts +17 -0
- package/dist/tools/ai-paginator/ai-paginator.mjs +110 -0
- package/dist/tools/ai-paginator/ai-paginator.scss.mjs +4 -0
- package/dist/tools/ai-paginator/index.d.ts +1 -0
- package/dist/tools/ai-paginator/index.mjs +4 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.mjs +8 -0
- package/dist/utils/keyboard-navigation-controller.d.ts +13 -0
- package/dist/utils/keyboard-navigation-controller.mjs +71 -0
- package/package.json +65 -60
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { AgentInfo } from '../ai-agent-info';
|
|
3
|
+
import { Suggestion } from '../ai-suggestions';
|
|
4
|
+
import { ForgeAiVoiceInputResultEvent } from '../ai-voice-input';
|
|
5
|
+
import { AgentAdapter } from './agent-adapter.js';
|
|
6
|
+
import { ChatMessage, ForgeAiChatbotFileSelectEventData, HeadingLevel, ThreadState } from './types.js';
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'forge-ai-chatbot': AiChatbotComponent;
|
|
10
|
+
}
|
|
11
|
+
interface HTMLElementEventMap {
|
|
12
|
+
'forge-ai-chatbot-connected': CustomEvent<void>;
|
|
13
|
+
'forge-ai-chatbot-disconnected': CustomEvent<void>;
|
|
14
|
+
'forge-ai-chatbot-message-sent': CustomEvent<ForgeAiChatbotMessageEventData>;
|
|
15
|
+
'forge-ai-chatbot-message-received': CustomEvent<ForgeAiChatbotMessageEventData>;
|
|
16
|
+
'forge-ai-chatbot-tool-call': CustomEvent<ForgeAiChatbotToolCallEventData>;
|
|
17
|
+
'forge-ai-chatbot-error': CustomEvent<ForgeAiChatbotErrorEventData>;
|
|
18
|
+
'forge-ai-chatbot-expand': CustomEvent<void>;
|
|
19
|
+
'forge-ai-chatbot-minimize': CustomEvent<void>;
|
|
20
|
+
'forge-ai-chatbot-clear': CustomEvent<void>;
|
|
21
|
+
'forge-ai-chatbot-info': CustomEvent<void>;
|
|
22
|
+
'forge-ai-chatbot-file-select': CustomEvent<ForgeAiChatbotFileSelectEventData>;
|
|
23
|
+
'forge-ai-voice-input-result': CustomEvent<ForgeAiVoiceInputResultEvent>;
|
|
24
|
+
'forge-ai-chatbot-file-remove': CustomEvent<ForgeAiChatbotFileRemoveEventData>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export interface ForgeAiChatbotMessageEventData {
|
|
28
|
+
message: ChatMessage;
|
|
29
|
+
}
|
|
30
|
+
export interface ForgeAiChatbotToolCallEventData {
|
|
31
|
+
toolCallId: string;
|
|
32
|
+
toolName: string;
|
|
33
|
+
arguments: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface ForgeAiChatbotErrorEventData {
|
|
36
|
+
error: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ForgeAiChatbotFileRemoveEventData {
|
|
39
|
+
fileId: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const AiChatbotComponentTagName: keyof HTMLElementTagNameMap;
|
|
42
|
+
/**
|
|
43
|
+
* Type for feature toggle values
|
|
44
|
+
*/
|
|
45
|
+
export type FeatureToggle = 'on' | 'off';
|
|
46
|
+
/**
|
|
47
|
+
* @tag forge-ai-chatbot
|
|
48
|
+
*
|
|
49
|
+
* @summary A complete, self-contained AI chatbot component that implements the AG-UI protocol using an adapter pattern.
|
|
50
|
+
*
|
|
51
|
+
* @description
|
|
52
|
+
* The AI Chatbot component provides a full-featured chat interface with support for streaming responses,
|
|
53
|
+
* client-side tool execution, file attachments, markdown rendering, and programmatic control.
|
|
54
|
+
* It uses an adapter pattern to abstract communication, allowing for AG-UI or custom protocol implementations.
|
|
55
|
+
*
|
|
56
|
+
* @slot header - Slot for custom header content
|
|
57
|
+
* @slot empty-state - Slot for custom empty state content (overrides default suggestions)
|
|
58
|
+
*
|
|
59
|
+
* @property {string} titleText - The title text to display in the header (default: 'AI Assistant')
|
|
60
|
+
* @property {HeadingLevel} headingLevel - Controls the heading level for the title content (default: 2)
|
|
61
|
+
*
|
|
62
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-connected - Fired when adapter connects
|
|
63
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-disconnected - Fired when adapter disconnects
|
|
64
|
+
* @event {CustomEvent<ForgeAiChatbotMessageEventData>} forge-ai-chatbot-message-sent - Fired when user sends a message
|
|
65
|
+
* @event {CustomEvent<ForgeAiChatbotMessageEventData>} forge-ai-chatbot-message-received - Fired when assistant message is complete
|
|
66
|
+
* @event {CustomEvent<ForgeAiChatbotToolCallEventData>} forge-ai-chatbot-tool-call - Fired when a tool needs to be executed
|
|
67
|
+
* @event {CustomEvent<ForgeAiChatbotErrorEventData>} forge-ai-chatbot-error - Fired when an error occurs
|
|
68
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-expand - Fired when header expand button is clicked
|
|
69
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-minimize - Fired when header minimize button is clicked
|
|
70
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-clear - Fired when header clear option is selected (cancelable, prevents clearMessages() if default prevented)
|
|
71
|
+
* @event {CustomEvent<void>} forge-ai-chatbot-info - Fired when header info option is selected
|
|
72
|
+
*/
|
|
73
|
+
export declare class AiChatbotComponent extends LitElement {
|
|
74
|
+
#private;
|
|
75
|
+
static styles: import('lit').CSSResult;
|
|
76
|
+
adapter?: AgentAdapter;
|
|
77
|
+
fileUpload: FeatureToggle;
|
|
78
|
+
voiceInput: FeatureToggle;
|
|
79
|
+
placeholder: string;
|
|
80
|
+
suggestions?: Suggestion[];
|
|
81
|
+
showExpandButton: boolean;
|
|
82
|
+
showMinimizeButton: boolean;
|
|
83
|
+
expanded: boolean;
|
|
84
|
+
minimizeIcon: 'default' | 'panel';
|
|
85
|
+
enableReactions: boolean;
|
|
86
|
+
agentInfo?: AgentInfo;
|
|
87
|
+
titleText: string;
|
|
88
|
+
headingLevel: HeadingLevel;
|
|
89
|
+
debugMode: boolean;
|
|
90
|
+
connectedCallback(): void;
|
|
91
|
+
disconnectedCallback(): void;
|
|
92
|
+
willUpdate(changedProperties: PropertyValues<this>): void;
|
|
93
|
+
/**
|
|
94
|
+
* Clears all messages from the chat history.
|
|
95
|
+
*/
|
|
96
|
+
clearMessages(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Gets the current message history.
|
|
99
|
+
* @returns Array of chat messages
|
|
100
|
+
*/
|
|
101
|
+
getMessages(): ChatMessage[];
|
|
102
|
+
/**
|
|
103
|
+
* Sets the message history. Useful for restoring conversation state.
|
|
104
|
+
* @param messages - Array of chat messages to set
|
|
105
|
+
*/
|
|
106
|
+
setMessages(messages: ChatMessage[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Programmatically sends a message as the user.
|
|
109
|
+
* @param content - The message content to send
|
|
110
|
+
* @param files - Optional file objects to attach
|
|
111
|
+
*/
|
|
112
|
+
sendMessage(content: string, files?: File[]): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Aborts the current streaming response.
|
|
115
|
+
*/
|
|
116
|
+
abort(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Scrolls the chat interface to the bottom.
|
|
119
|
+
*/
|
|
120
|
+
scrollToBottom({ behavior }?: {
|
|
121
|
+
behavior?: ScrollBehavior;
|
|
122
|
+
}): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Gets the complete serializable thread state including threadId and messages.
|
|
125
|
+
* @returns ThreadState object containing threadId, messages, and timestamp
|
|
126
|
+
*/
|
|
127
|
+
getThreadState(): ThreadState;
|
|
128
|
+
/**
|
|
129
|
+
* Restores thread state from a serialized ThreadState object.
|
|
130
|
+
* @param state - ThreadState object to restore
|
|
131
|
+
*/
|
|
132
|
+
setThreadState(state: ThreadState): void;
|
|
133
|
+
render(): TemplateResult;
|
|
134
|
+
}
|