@tylertech/forge-ai 0.13.8 → 0.13.9
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
CHANGED
|
@@ -14651,11 +14651,11 @@
|
|
|
14651
14651
|
},
|
|
14652
14652
|
"MessageStateControllerConfig": {
|
|
14653
14653
|
"path": "src/lib/ai-chatbot/message-state-controller.ts",
|
|
14654
|
-
"lineNumber":
|
|
14654
|
+
"lineNumber": 22
|
|
14655
14655
|
},
|
|
14656
14656
|
"MessageStateController": {
|
|
14657
14657
|
"path": "src/lib/ai-chatbot/message-state-controller.ts",
|
|
14658
|
-
"lineNumber":
|
|
14658
|
+
"lineNumber": 35
|
|
14659
14659
|
},
|
|
14660
14660
|
"HeadingLevel": {
|
|
14661
14661
|
"path": "src/lib/ai-chatbot/types.ts",
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
import { ChatMessage, MessageItem, ToolCall,
|
|
2
|
+
import { ChatMessage, MessageItem, ToolCall, AssistantResponse, ResponseFeedback } from './types.js';
|
|
3
3
|
import { MessageStartEvent, MessageDeltaEvent, MessageEndEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, ToolResultEvent } from './agent-adapter.js';
|
|
4
4
|
export interface MessageStateControllerConfig {
|
|
5
|
-
tools: Map<string, ToolDefinition>;
|
|
6
5
|
onThreadSettled?: () => void;
|
|
7
6
|
}
|
|
8
7
|
/**
|
|
@@ -9,7 +9,6 @@ class ChatbotCoreController {
|
|
|
9
9
|
#fileUploadManager;
|
|
10
10
|
#adapterSubscriptions;
|
|
11
11
|
#adapter;
|
|
12
|
-
#toolsMap;
|
|
13
12
|
#executingToolHandlers = 0;
|
|
14
13
|
constructor(host, config) {
|
|
15
14
|
this.#host = host;
|
|
@@ -18,7 +17,6 @@ class ChatbotCoreController {
|
|
|
18
17
|
}
|
|
19
18
|
hostConnected() {
|
|
20
19
|
this.#messageStateController = new MessageStateController(this.#host, {
|
|
21
|
-
tools: this.tools,
|
|
22
20
|
onThreadSettled: () => this.#emitThreadStateChange()
|
|
23
21
|
});
|
|
24
22
|
this.#fileUploadManager = new FileUploadManager({
|
|
@@ -43,7 +41,6 @@ class ChatbotCoreController {
|
|
|
43
41
|
}
|
|
44
42
|
set adapter(value) {
|
|
45
43
|
this.#adapter = value;
|
|
46
|
-
this.#toolsMap = void 0;
|
|
47
44
|
if (value) {
|
|
48
45
|
this.#setupAdapter();
|
|
49
46
|
}
|
|
@@ -61,10 +58,7 @@ class ChatbotCoreController {
|
|
|
61
58
|
return this.messageItems.length > 0;
|
|
62
59
|
}
|
|
63
60
|
get tools() {
|
|
64
|
-
|
|
65
|
-
this.#toolsMap = new Map(this.#adapter?.getTools().map((t) => [t.name, t]) ?? []);
|
|
66
|
-
}
|
|
67
|
-
return this.#toolsMap;
|
|
61
|
+
return new Map(this.#adapter?.getTools().map((t) => [t.name, t]) ?? []);
|
|
68
62
|
}
|
|
69
63
|
get pendingAttachments() {
|
|
70
64
|
return this.#fileUploadManager?.pendingAttachments ?? [];
|
|
@@ -94,8 +88,6 @@ class ChatbotCoreController {
|
|
|
94
88
|
this.#adapter.onError(this.#handleError.bind(this)),
|
|
95
89
|
this.#adapter.onStateChange(this.#handleStateChange.bind(this))
|
|
96
90
|
);
|
|
97
|
-
this.#toolsMap = void 0;
|
|
98
|
-
this.#messageStateController?.updateConfig({ tools: this.tools });
|
|
99
91
|
this.#callbacks.onDispatchEvent("forge-ai-chatbot-connected");
|
|
100
92
|
}
|
|
101
93
|
#handleRunStarted() {
|