@amaster.ai/components-templates 1.6.0 → 1.8.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.
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
4
4
  import { ChatHeader } from "./components/ChatHeader";
5
5
  import { ChatInput } from "./components/ChatInput";
6
6
  import { ChatMessages } from "./components/ChatMessages";
7
- import { useConversationProcessor } from "./hooks/useConversation";
7
+ import { useConversation } from "./hooks/useConversation";
8
8
  import { useAiAssistantI18n } from "./i18n";
9
9
  import type { AIAssistantProps } from "./types";
10
10
 
@@ -26,7 +26,7 @@ const AIAssistantInner: React.FC<AIAssistantProps> = (props) => {
26
26
  loadMoreHistory,
27
27
  resetConversation,
28
28
  cancelChat,
29
- } = useConversationProcessor();
29
+ } = useConversation();
30
30
 
31
31
  useEffect(() => {
32
32
  !starting && conversations.length === 0 && resetConversation(greeting);
@@ -29,10 +29,26 @@ export interface ToolMessage extends BaseMessage {
29
29
  toolDescription?: string;
30
30
  }
31
31
 
32
+ export interface UIRenderMessage extends BaseMessage {
33
+ kind: "ui-render";
34
+ spec: {
35
+ root: string;
36
+ elements: Record<
37
+ string,
38
+ {
39
+ type: string;
40
+ props?: Record<string, unknown>;
41
+ children?: string[];
42
+ }
43
+ >;
44
+ };
45
+ }
46
+
32
47
  export type MessagesItem =
33
48
  | TextMessage
34
49
  | ThoughtMessage
35
50
  | ToolMessage
51
+ | UIRenderMessage
36
52
  | BaseMessage;
37
53
 
38
54
  export interface Conversation {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/components-templates",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Amaster component templates collection",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/cli",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Amaster CLI tool for component templates",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",