bstp-agent-widget 0.2.82 → 0.2.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bstp-agent-widget",
3
- "version": "0.2.82",
3
+ "version": "0.2.83",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/agent-widget.js",
@@ -3,7 +3,7 @@ export interface GenaiAgentMessageRequest {
3
3
  chat_id: number | null;
4
4
  assistant_id: number;
5
5
  is_sync: boolean;
6
- unique_user_id: string;
6
+ unique_user_id?: string;
7
7
  tool_headers: {
8
8
  _default: {
9
9
  Authorization: string;
@@ -0,0 +1,18 @@
1
+ export interface AgentChatAction {
2
+ buttonText: string;
3
+ agentMessage: string;
4
+ targetAgent?: string;
5
+ }
6
+
7
+ export function isActionsPayload(value: unknown): value is { actions: AgentChatAction[] } {
8
+ if (!value || typeof value !== 'object') return false;
9
+ const obj = value as Record<string, unknown>;
10
+ if (!Array.isArray(obj.actions)) return false;
11
+ return obj.actions.every(
12
+ (item: unknown) =>
13
+ typeof item === 'object' &&
14
+ item !== null &&
15
+ typeof (item as Record<string, unknown>).buttonText === 'string' &&
16
+ typeof (item as Record<string, unknown>).agentMessage === 'string',
17
+ );
18
+ }
@@ -1,7 +1,10 @@
1
+ import type { AgentChatAction } from './agent-chat-action';
2
+
1
3
  export interface MdWidgetConfig {
2
4
  type: string;
3
5
  data?: Record<string, unknown>;
4
6
  visualizationConfig?: Record<string, unknown>;
5
7
  responseType?: string;
6
8
  items?: unknown[];
9
+ actions?: AgentChatAction[];
7
10
  }