@tylertech/forge-ai 0.13.6 → 0.13.7

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.
@@ -3548,6 +3548,17 @@
3548
3548
  "default": "false",
3549
3549
  "attribute": "show-conversation-delete"
3550
3550
  },
3551
+ {
3552
+ "kind": "field",
3553
+ "name": "selectedThreadId",
3554
+ "type": {
3555
+ "text": "string | null"
3556
+ },
3557
+ "privacy": "public",
3558
+ "default": "null",
3559
+ "description": "The id of the currently selected conversation thread. Set this to highlight a thread in the conversations panel (e.g. when restoring a conversation loaded from the backend). Updated internally when a thread is selected or a new chat starts.",
3560
+ "attribute": "selected-thread-id"
3561
+ },
3551
3562
  {
3552
3563
  "kind": "method",
3553
3564
  "name": "sendMessage",
@@ -4262,6 +4273,15 @@
4262
4273
  "default": "false",
4263
4274
  "fieldName": "showConversationDelete"
4264
4275
  },
4276
+ {
4277
+ "name": "selected-thread-id",
4278
+ "type": {
4279
+ "text": "string | null"
4280
+ },
4281
+ "default": "null",
4282
+ "description": "The id of the currently selected conversation thread. Set this to highlight a thread in the conversations panel (e.g. when restoring a conversation loaded from the backend). Updated internally when a thread is selected or a new chat starts.",
4283
+ "fieldName": "selectedThreadId"
4284
+ },
4265
4285
  {
4266
4286
  "name": "file-upload",
4267
4287
  "type": {
@@ -14563,7 +14583,7 @@
14563
14583
  },
14564
14584
  "AiChatbotComponent": {
14565
14585
  "path": "src/lib/ai-chatbot/ai-chatbot.ts",
14566
- "lineNumber": 174
14586
+ "lineNumber": 175
14567
14587
  },
14568
14588
  "CreateToolRendererElementConfig": {
14569
14589
  "path": "src/lib/ai-chatbot/create-tool-renderer.ts",
@@ -193,7 +193,7 @@ let AiChatHeaderComponent = class extends LitElement {
193
193
  `
194
194
  )}
195
195
  ${when(
196
- this.agentInfo && (this.exportOption === "enabled" || this.clearOption === "enabled"),
196
+ this.clearOption === "enabled" && (this.agentInfo || this.exportOption === "enabled"),
197
197
  () => html`<forge-ai-dropdown-menu-separator></forge-ai-dropdown-menu-separator>`
198
198
  )}
199
199
  ${when(
@@ -99,6 +99,7 @@ export declare const AiChatbotComponentTagName: keyof HTMLElementTagNameMap;
99
99
  * @property {Suggestion[]} suggestions - Suggestions to display in the empty state
100
100
  * @property {FeatureToggle} clearOption - Controls the clear-conversation header action. `'on'` (default) shows it when messages exist; `'off'` hides it entirely.
101
101
  * @property {FeatureToggle} exportOption - Controls the export-conversation header action. `'on'` (default) shows it when messages exist; `'off'` hides it entirely.
102
+ * @property {string | null} selectedThreadId - The id of the currently selected conversation thread. Set this to highlight a thread in the conversations panel (e.g. when restoring a conversation loaded from the backend). Updated internally when a thread is selected or a new chat starts.
102
103
  *
103
104
  * @cssproperty --forge-ai-chatbot-icon-color - The fill color for the AI icon. Defaults to `tertiary`.
104
105
  * @cssproperty --forge-ai-chatbot-suggestion-background - The background color for suggestion buttons. Defaults to `tertiary-container`.
@@ -140,7 +141,7 @@ export declare class AiChatbotComponent extends AiChatbotBase {
140
141
  conversationsOpen: boolean;
141
142
  showConversationRename: boolean;
142
143
  showConversationDelete: boolean;
143
- private _selectedThreadId;
144
+ selectedThreadId: string | null;
144
145
  protected _messageThreadRef: Ref<AiMessageThreadComponent>;
145
146
  protected _promptRef: Ref<AiPromptComponent>;
146
147
  protected _handleInfo(): void;
@@ -1,5 +1,5 @@
1
1
  import { unsafeCSS, html } from "lit";
2
- import { property, state, customElement } from "lit/decorators.js";
2
+ import { property, customElement } from "lit/decorators.js";
3
3
  import { createRef, ref } from "lit/directives/ref.js";
4
4
  import { when } from "lit/directives/when.js";
5
5
  import { AiChatbotBase } from "./ai-chatbot-base.mjs";
@@ -47,7 +47,7 @@ let AiChatbotComponent = class extends AiChatbotBase {
47
47
  this.conversationsOpen = false;
48
48
  this.showConversationRename = false;
49
49
  this.showConversationDelete = false;
50
- this._selectedThreadId = null;
50
+ this.selectedThreadId = null;
51
51
  __privateAdd(this, _chatInterfaceRef, createRef());
52
52
  this._messageThreadRef = createRef();
53
53
  this._promptRef = createRef();
@@ -147,7 +147,7 @@ let AiChatbotComponent = class extends AiChatbotBase {
147
147
  */
148
148
  startNewChat() {
149
149
  super.startNewChat();
150
- this._selectedThreadId = null;
150
+ this.selectedThreadId = null;
151
151
  }
152
152
  toggleConversations() {
153
153
  if (this.conversationsOpen) {
@@ -213,7 +213,7 @@ let AiChatbotComponent = class extends AiChatbotBase {
213
213
  <forge-ai-conversations-panel
214
214
  ${ref(__privateGet(this, _conversationsPanelRef))}
215
215
  .recentThreads=${this.recentThreads}
216
- .selectedThreadId=${this._selectedThreadId}
216
+ .selectedThreadId=${this.selectedThreadId}
217
217
  ?show-back-button=${true}
218
218
  ?show-conversation-rename=${this.showConversationRename}
219
219
  ?show-conversation-delete=${this.showConversationDelete}
@@ -275,7 +275,7 @@ handleConversationsToggle_fn = function() {
275
275
  };
276
276
  handleThreadSelect_fn = function(evt) {
277
277
  const { id, title } = evt.detail;
278
- this._selectedThreadId = id;
278
+ this.selectedThreadId = id;
279
279
  this._dispatchHostEvent({
280
280
  type: "forge-ai-chatbot-conversation-select",
281
281
  detail: { id, title }
@@ -401,8 +401,8 @@ __decorateClass([
401
401
  property({ type: Boolean, attribute: "show-conversation-delete" })
402
402
  ], AiChatbotComponent.prototype, "showConversationDelete", 2);
403
403
  __decorateClass([
404
- state()
405
- ], AiChatbotComponent.prototype, "_selectedThreadId", 2);
404
+ property({ type: String, attribute: "selected-thread-id" })
405
+ ], AiChatbotComponent.prototype, "selectedThreadId", 2);
406
406
  AiChatbotComponent = __decorateClass([
407
407
  customElement(AiChatbotComponentTagName)
408
408
  ], AiChatbotComponent);
@@ -4,7 +4,7 @@ export type { ForgeAiChatbotMessageEventData, ForgeAiChatbotToolCallEventData, F
4
4
  export { AiChatbotToolCallComponent, AiChatbotToolCallComponentTagName } from './ai-chatbot-tool-call.js';
5
5
  export type { Suggestion } from '../ai-suggestions/index.js';
6
6
  export { AgentAdapter, type MessageStartEvent, type MessageDeltaEvent, type MessageEndEvent, type ToolCallEvent, type ToolCallStartEvent, type ToolCallArgsEvent, type ToolCallEndEvent, type FileUploadEvent, type FileRemoveEvent, type AdapterState, type ErrorEvent, type CustomAgentEvent, type RawAgentEvent, type RunStartedAgentEvent, type StepStartedAgentEvent, type StepFinishedAgentEvent, type StateSnapshotAgentEvent, type StateDeltaAgentEvent, type ActivitySnapshotAgentEvent, type ActivityDeltaAgentEvent } from './agent-adapter.js';
7
- export type { Agent, ChatMessage, ContextItem, ToolDefinition, ToolCall, ToolRenderer, IToolRenderer, HandlerContext, ToolStartContext, ToolDeltaContext, ToolEndContext, FileAttachment, UploadedFileMetadata, FileUploadCallbacks, FileUploadHandler, FileRemoveCallbacks, ThreadState, FeedbackType, ResponseFeedback, MessageItem, ForgeAiChatbotContextRemoveEventData } from './types.js';
7
+ export type { Agent, ChatMessage, ContextItem, ToolDefinition, ToolCall, ToolRenderer, IToolRenderer, HandlerContext, ToolStartContext, ToolDeltaContext, ToolEndContext, FileAttachment, UploadedFileMetadata, FileUploadCallbacks, FileUploadHandler, FileRemoveCallbacks, ThreadState, FeedbackType, ResponseFeedback, MessageItem, ForgeAiChatbotContextRemoveEventData, ForgeAiChatbotConversationSelectEventData, ForgeAiChatbotConversationSearchEventData, ForgeAiChatbotConversationLoadMoreEventData, ForgeAiChatbotConversationRenameEventData, ForgeAiChatbotConversationDeleteEventData } from './types.js';
8
8
  export * from './ag-ui-adapter.js';
9
9
  export * from './http-agent-with-credentials.js';
10
10
  export * from './event-emitter.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylertech/forge-ai",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "description": "A library of Tyler Forge™ AI chat interface web components.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Tyler Technologies, Inc.",