@gui-chat-plugin/moodboard 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Mood Board Tool Definition
3
+ */
4
+ import type { ToolDefinition } from "gui-chat-protocol";
5
+ export declare const TOOL_NAME = "createMoodBoard";
6
+ export declare const TOOL_DEFINITION: ToolDefinition;
7
+ export declare const SYSTEM_PROMPT = "Use createMoodBoard to create visual mood boards when:\n- The user wants to capture an aesthetic or vibe\n- Exploring color palettes and themes\n- Visualizing brand identity or style direction\n- Collecting inspiration for a project\n- Expressing emotions or moods visually\n\nWhen creating a mood board:\n- Start with colors that represent the core mood\n- Add emojis for quick visual communication\n- Include text for key concepts and words\n- Consider balance and visual harmony\n\nColor meanings:\n- Warm colors (red, orange, yellow): energy, passion, warmth\n- Cool colors (blue, green, purple): calm, nature, creativity\n- Neutral colors (black, white, gray): sophistication, balance";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Mood Board Plugin - Core (Framework-agnostic)
3
+ */
4
+ export type { MoodBoardData, MoodBoardArgs, MoodBoardJsonData, MoodBoardItem, } from "./types";
5
+ export { TOOL_NAME, TOOL_DEFINITION, SYSTEM_PROMPT, executeMoodBoard, pluginCore, } from "./plugin";
6
+ export { samples } from "./samples";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Mood Board Plugin Core
3
+ */
4
+ import type { ToolPluginCore, ToolContext, ToolResult } from "gui-chat-protocol";
5
+ import type { MoodBoardData, MoodBoardArgs, MoodBoardJsonData } from "./types";
6
+ export { TOOL_NAME, TOOL_DEFINITION, SYSTEM_PROMPT } from "./definition";
7
+ export declare const executeMoodBoard: (_context: ToolContext, args: MoodBoardArgs) => Promise<ToolResult<MoodBoardData, MoodBoardJsonData>>;
8
+ export declare const pluginCore: ToolPluginCore<MoodBoardData, MoodBoardJsonData, MoodBoardArgs>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Mood Board Plugin Samples
3
+ */
4
+ import type { ToolSample } from "gui-chat-protocol";
5
+ export declare const samples: ToolSample[];
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Mood Board Plugin - Type Definitions
3
+ */
4
+ /** An item on the mood board */
5
+ export interface MoodBoardItem {
6
+ id: string;
7
+ type: "color" | "text" | "emoji";
8
+ content: string;
9
+ label?: string;
10
+ mood?: string;
11
+ x: number;
12
+ y: number;
13
+ width: number;
14
+ height: number;
15
+ rotation?: number;
16
+ }
17
+ /** Data stored in result.data (for UI display) */
18
+ export interface MoodBoardData {
19
+ title: string;
20
+ theme?: string;
21
+ items: MoodBoardItem[];
22
+ backgroundColor?: string;
23
+ }
24
+ /** JSON data returned in result.jsonData */
25
+ export interface MoodBoardJsonData {
26
+ itemCount: number;
27
+ theme?: string;
28
+ items: Array<{
29
+ id: string;
30
+ type: string;
31
+ label?: string;
32
+ }>;
33
+ }
34
+ /** Arguments passed to the tool */
35
+ export interface MoodBoardArgs {
36
+ action: "create" | "add_item" | "update_theme" | "rearrange";
37
+ title?: string;
38
+ theme?: string;
39
+ concepts?: string[];
40
+ existingBoard?: MoodBoardData;
41
+ itemType?: "color" | "text" | "emoji";
42
+ itemContent?: string;
43
+ itemLabel?: string;
44
+ itemMood?: string;
45
+ }
package/dist/core.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c="createMoodBoard",b={type:"function",name:c,description:"Create or update a visual mood board to capture inspiration, themes, and aesthetics. Use colors, emojis, and text to represent moods, concepts, and ideas visually.",parameters:{type:"object",properties:{action:{type:"string",enum:["create","add_item","update_theme","rearrange"],description:"Action to perform: create (new mood board), add_item (add element), update_theme (change style), rearrange (reorganize)"},title:{type:"string",description:"Title of the mood board (required for create action)"},theme:{type:"string",description:"Overall theme (e.g., 'minimal', 'vibrant', 'vintage', 'modern')"},concepts:{type:"array",items:{type:"string"},description:"Concepts, keywords, or moods to visualize on the board"},existingBoard:{type:"object",description:"Current mood board state for updates"},itemType:{type:"string",enum:["color","text","emoji"],description:"Type of item to add"},itemContent:{type:"string",description:"Content for the item (hex color, text, or emoji)"},itemLabel:{type:"string",description:"Optional label describing the item"},itemMood:{type:"string",description:"Mood or feeling associated with the item"}},required:["action"]}},y=`Use ${c} to create visual mood boards when:
2
+ - The user wants to capture an aesthetic or vibe
3
+ - Exploring color palettes and themes
4
+ - Visualizing brand identity or style direction
5
+ - Collecting inspiration for a project
6
+ - Expressing emotions or moods visually
7
+
8
+ When creating a mood board:
9
+ - Start with colors that represent the core mood
10
+ - Add emojis for quick visual communication
11
+ - Include text for key concepts and words
12
+ - Consider balance and visual harmony
13
+
14
+ Color meanings:
15
+ - Warm colors (red, orange, yellow): energy, passion, warmth
16
+ - Cool colors (blue, green, purple): calm, nature, creativity
17
+ - Neutral colors (black, white, gray): sophistication, balance`,p={vibrant:["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#F7DC6F"],minimal:["#2C3E50","#ECF0F1","#95A5A6","#BDC3C7","#34495E","#FFFFFF"],vintage:["#D4A373","#CCD5AE","#E9EDC9","#FEFAE0","#FAEDCD","#A8DADC"],modern:["#6366F1","#8B5CF6","#EC4899","#14B8A6","#F59E0B","#10B981"],nature:["#2D5016","#52734D","#91C788","#FEFFDE","#DDFFBC","#BFEDC1"],ocean:["#0077B6","#00B4D8","#90E0EF","#CAF0F8","#03045E","#48CAE4"]},g={happy:["😊","🌟","✨","🎉","💫","🌈"],calm:["🌿","🍃","☁️","🌙","💭","🕊️"],creative:["🎨","💡","🎭","🖌️","📐","🎬"],energy:["⚡","🔥","💪","🚀","⭐","💥"],love:["❤️","💕","💖","🌹","💝","🥰"],nature:["🌸","🌺","🌻","🍀","🌴","🌊"]};function h(){return`item_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function f(i){return p[i]||p.modern}function E(i){const e=i.toLowerCase();for(const[t,o]of Object.entries(g))if(e.includes(t))return o;return g.creative}function u(i,e,t,o){const r=Math.ceil(Math.sqrt(e)),n=Math.floor(i/r),a=i%r,m=t/r,d=o/Math.ceil(e/r),l=(Math.random()-.5)*20,s=(Math.random()-.5)*20;return{x:a*m+m/2+l,y:n*d+d/2+s}}function M(i,e,t){const n=f(e),a=[];return n.slice(0,4).forEach((d,l)=>{const s=u(l,t.length+8,800,600);a.push({id:h(),type:"color",content:d,x:s.x,y:s.y,width:80,height:80,rotation:(Math.random()-.5)*10})}),t.forEach((d,l)=>{const s=u(l+4,t.length+8,800,600);a.push({id:h(),type:"text",content:d,label:d,x:s.x,y:s.y,width:120,height:40,rotation:(Math.random()-.5)*8})}),E(e).slice(0,4).forEach((d,l)=>{const s=u(t.length+4+l,t.length+8,800,600);a.push({id:h(),type:"emoji",content:d,x:s.x,y:s.y,width:60,height:60,rotation:(Math.random()-.5)*15})}),{title:i,theme:e,items:a,backgroundColor:n[n.length-1]+"20"}}function F(i,e,t,o,r){const n={id:h(),type:e,content:t,label:o,mood:r,x:400+(Math.random()-.5)*200,y:300+(Math.random()-.5)*200,width:e==="color"?80:e==="emoji"?60:120,height:e==="color"?80:e==="emoji"?60:40,rotation:(Math.random()-.5)*10};return{...i,items:[...i.items,n]}}function w(i,e){const t=f(e);let o=0;const r=i.items.map(n=>{if(n.type==="color"){const a=t[o%t.length];return o++,{...n,content:a}}return n});return{...i,theme:e,items:r,backgroundColor:t[t.length-1]+"20"}}const C=async(i,e)=>{const{action:t}=e;let o,r,n;switch(t){case"create":{if(!e.title)return{toolName:c,message:"Title is required for creating a mood board",instructions:"Ask the user for a title and theme."};o=M(e.title,e.theme||"modern",e.concepts||[]),r=`Created mood board "${e.title}" with ${o.items.length} elements`,n="Tell the user the mood board has been created. Ask if they want to add more elements or change the theme.";break}case"add_item":{if(!e.existingBoard||!e.itemType||!e.itemContent)return{toolName:c,message:"Existing board, item type, and content are required",instructions:"Ask the user what type of item to add."};o=F(e.existingBoard,e.itemType,e.itemContent,e.itemLabel,e.itemMood),r=`Added ${e.itemType} to the mood board`,n="Confirm the item was added. Ask if they want to add more or adjust the layout.";break}case"update_theme":{if(!e.existingBoard||!e.theme)return{toolName:c,message:"Existing board and new theme are required",instructions:"Ask the user which theme they prefer."};o=w(e.existingBoard,e.theme),r=`Updated mood board theme to "${e.theme}"`,n="Confirm the theme was changed. Ask if they like the new look.";break}case"rearrange":{if(!e.existingBoard)return{toolName:c,message:"Existing board is required for rearranging",instructions:"The mood board data is missing."};o=e.existingBoard,r="Mood board rearranged",n="The mood board has been refreshed.";break}default:return{toolName:c,message:`Unknown action: ${t}`,instructions:"Invalid action specified."}}const a={itemCount:o.items.length,theme:o.theme,items:o.items.map(m=>({id:m.id,type:m.type,label:m.label}))};return{toolName:c,message:r,title:o.title,data:o,jsonData:a,instructions:n,updating:t!=="create"}},x={toolDefinition:b,execute:C,generatingMessage:"Creating mood board...",isEnabled:()=>!0,systemPrompt:y},D=[{name:"Vibrant Energy",args:{action:"create",title:"Vibrant Energy",theme:"vibrant",concepts:["Bold","Dynamic","Exciting","Fresh"]}},{name:"Minimal Zen",args:{action:"create",title:"Minimal Zen",theme:"minimal",concepts:["Simple","Clean","Peaceful","Balanced"]}},{name:"Vintage Charm",args:{action:"create",title:"Vintage Charm",theme:"vintage",concepts:["Nostalgic","Warm","Classic","Timeless"]}},{name:"Ocean Dreams",args:{action:"create",title:"Ocean Dreams",theme:"ocean",concepts:["Calm","Flowing","Deep","Refreshing"]}},{name:"Nature Escape",args:{action:"create",title:"Nature Escape",theme:"nature",concepts:["Organic","Growth","Harmony","Life"]}}];exports.SYSTEM_PROMPT=y;exports.TOOL_DEFINITION=b;exports.TOOL_NAME=c;exports.executeMoodBoard=C;exports.pluginCore=x;exports.samples=D;
package/dist/core.js ADDED
@@ -0,0 +1,325 @@
1
+ const c = "createMoodBoard", y = {
2
+ type: "function",
3
+ name: c,
4
+ description: "Create or update a visual mood board to capture inspiration, themes, and aesthetics. Use colors, emojis, and text to represent moods, concepts, and ideas visually.",
5
+ parameters: {
6
+ type: "object",
7
+ properties: {
8
+ action: {
9
+ type: "string",
10
+ enum: ["create", "add_item", "update_theme", "rearrange"],
11
+ description: "Action to perform: create (new mood board), add_item (add element), update_theme (change style), rearrange (reorganize)"
12
+ },
13
+ title: {
14
+ type: "string",
15
+ description: "Title of the mood board (required for create action)"
16
+ },
17
+ theme: {
18
+ type: "string",
19
+ description: "Overall theme (e.g., 'minimal', 'vibrant', 'vintage', 'modern')"
20
+ },
21
+ concepts: {
22
+ type: "array",
23
+ items: { type: "string" },
24
+ description: "Concepts, keywords, or moods to visualize on the board"
25
+ },
26
+ existingBoard: {
27
+ type: "object",
28
+ description: "Current mood board state for updates"
29
+ },
30
+ itemType: {
31
+ type: "string",
32
+ enum: ["color", "text", "emoji"],
33
+ description: "Type of item to add"
34
+ },
35
+ itemContent: {
36
+ type: "string",
37
+ description: "Content for the item (hex color, text, or emoji)"
38
+ },
39
+ itemLabel: {
40
+ type: "string",
41
+ description: "Optional label describing the item"
42
+ },
43
+ itemMood: {
44
+ type: "string",
45
+ description: "Mood or feeling associated with the item"
46
+ }
47
+ },
48
+ required: ["action"]
49
+ }
50
+ }, f = `Use ${c} to create visual mood boards when:
51
+ - The user wants to capture an aesthetic or vibe
52
+ - Exploring color palettes and themes
53
+ - Visualizing brand identity or style direction
54
+ - Collecting inspiration for a project
55
+ - Expressing emotions or moods visually
56
+
57
+ When creating a mood board:
58
+ - Start with colors that represent the core mood
59
+ - Add emojis for quick visual communication
60
+ - Include text for key concepts and words
61
+ - Consider balance and visual harmony
62
+
63
+ Color meanings:
64
+ - Warm colors (red, orange, yellow): energy, passion, warmth
65
+ - Cool colors (blue, green, purple): calm, nature, creativity
66
+ - Neutral colors (black, white, gray): sophistication, balance`, p = {
67
+ vibrant: ["#FF6B6B", "#4ECDC4", "#45B7D1", "#FFA07A", "#98D8C8", "#F7DC6F"],
68
+ minimal: ["#2C3E50", "#ECF0F1", "#95A5A6", "#BDC3C7", "#34495E", "#FFFFFF"],
69
+ vintage: ["#D4A373", "#CCD5AE", "#E9EDC9", "#FEFAE0", "#FAEDCD", "#A8DADC"],
70
+ modern: ["#6366F1", "#8B5CF6", "#EC4899", "#14B8A6", "#F59E0B", "#10B981"],
71
+ nature: ["#2D5016", "#52734D", "#91C788", "#FEFFDE", "#DDFFBC", "#BFEDC1"],
72
+ ocean: ["#0077B6", "#00B4D8", "#90E0EF", "#CAF0F8", "#03045E", "#48CAE4"]
73
+ }, g = {
74
+ happy: ["😊", "🌟", "✨", "🎉", "💫", "🌈"],
75
+ calm: ["🌿", "🍃", "☁️", "🌙", "💭", "🕊️"],
76
+ creative: ["🎨", "💡", "🎭", "🖌️", "📐", "🎬"],
77
+ energy: ["⚡", "🔥", "💪", "🚀", "⭐", "💥"],
78
+ love: ["❤️", "💕", "💖", "🌹", "💝", "🥰"],
79
+ nature: ["🌸", "🌺", "🌻", "🍀", "🌴", "🌊"]
80
+ };
81
+ function h() {
82
+ return `item_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
83
+ }
84
+ function b(i) {
85
+ return p[i] || p.modern;
86
+ }
87
+ function C(i) {
88
+ const e = i.toLowerCase();
89
+ for (const [t, o] of Object.entries(g))
90
+ if (e.includes(t))
91
+ return o;
92
+ return g.creative;
93
+ }
94
+ function u(i, e, t, o) {
95
+ const r = Math.ceil(Math.sqrt(e)), n = Math.floor(i / r), a = i % r, m = t / r, d = o / Math.ceil(e / r), l = (Math.random() - 0.5) * 20, s = (Math.random() - 0.5) * 20;
96
+ return {
97
+ x: a * m + m / 2 + l,
98
+ y: n * d + d / 2 + s
99
+ };
100
+ }
101
+ function E(i, e, t) {
102
+ const n = b(e), a = [];
103
+ return n.slice(0, 4).forEach((d, l) => {
104
+ const s = u(l, t.length + 8, 800, 600);
105
+ a.push({
106
+ id: h(),
107
+ type: "color",
108
+ content: d,
109
+ x: s.x,
110
+ y: s.y,
111
+ width: 80,
112
+ height: 80,
113
+ rotation: (Math.random() - 0.5) * 10
114
+ });
115
+ }), t.forEach((d, l) => {
116
+ const s = u(l + 4, t.length + 8, 800, 600);
117
+ a.push({
118
+ id: h(),
119
+ type: "text",
120
+ content: d,
121
+ label: d,
122
+ x: s.x,
123
+ y: s.y,
124
+ width: 120,
125
+ height: 40,
126
+ rotation: (Math.random() - 0.5) * 8
127
+ });
128
+ }), C(e).slice(0, 4).forEach((d, l) => {
129
+ const s = u(t.length + 4 + l, t.length + 8, 800, 600);
130
+ a.push({
131
+ id: h(),
132
+ type: "emoji",
133
+ content: d,
134
+ x: s.x,
135
+ y: s.y,
136
+ width: 60,
137
+ height: 60,
138
+ rotation: (Math.random() - 0.5) * 15
139
+ });
140
+ }), {
141
+ title: i,
142
+ theme: e,
143
+ items: a,
144
+ backgroundColor: n[n.length - 1] + "20"
145
+ // Light tint of last color
146
+ };
147
+ }
148
+ function F(i, e, t, o, r) {
149
+ const n = {
150
+ id: h(),
151
+ type: e,
152
+ content: t,
153
+ label: o,
154
+ mood: r,
155
+ x: 400 + (Math.random() - 0.5) * 200,
156
+ y: 300 + (Math.random() - 0.5) * 200,
157
+ width: e === "color" ? 80 : e === "emoji" ? 60 : 120,
158
+ height: e === "color" ? 80 : e === "emoji" ? 60 : 40,
159
+ rotation: (Math.random() - 0.5) * 10
160
+ };
161
+ return {
162
+ ...i,
163
+ items: [...i.items, n]
164
+ };
165
+ }
166
+ function w(i, e) {
167
+ const t = b(e);
168
+ let o = 0;
169
+ const r = i.items.map((n) => {
170
+ if (n.type === "color") {
171
+ const a = t[o % t.length];
172
+ return o++, { ...n, content: a };
173
+ }
174
+ return n;
175
+ });
176
+ return {
177
+ ...i,
178
+ theme: e,
179
+ items: r,
180
+ backgroundColor: t[t.length - 1] + "20"
181
+ };
182
+ }
183
+ const x = async (i, e) => {
184
+ const { action: t } = e;
185
+ let o, r, n;
186
+ switch (t) {
187
+ case "create": {
188
+ if (!e.title)
189
+ return {
190
+ toolName: c,
191
+ message: "Title is required for creating a mood board",
192
+ instructions: "Ask the user for a title and theme."
193
+ };
194
+ o = E(
195
+ e.title,
196
+ e.theme || "modern",
197
+ e.concepts || []
198
+ ), r = `Created mood board "${e.title}" with ${o.items.length} elements`, n = "Tell the user the mood board has been created. Ask if they want to add more elements or change the theme.";
199
+ break;
200
+ }
201
+ case "add_item": {
202
+ if (!e.existingBoard || !e.itemType || !e.itemContent)
203
+ return {
204
+ toolName: c,
205
+ message: "Existing board, item type, and content are required",
206
+ instructions: "Ask the user what type of item to add."
207
+ };
208
+ o = F(
209
+ e.existingBoard,
210
+ e.itemType,
211
+ e.itemContent,
212
+ e.itemLabel,
213
+ e.itemMood
214
+ ), r = `Added ${e.itemType} to the mood board`, n = "Confirm the item was added. Ask if they want to add more or adjust the layout.";
215
+ break;
216
+ }
217
+ case "update_theme": {
218
+ if (!e.existingBoard || !e.theme)
219
+ return {
220
+ toolName: c,
221
+ message: "Existing board and new theme are required",
222
+ instructions: "Ask the user which theme they prefer."
223
+ };
224
+ o = w(
225
+ e.existingBoard,
226
+ e.theme
227
+ ), r = `Updated mood board theme to "${e.theme}"`, n = "Confirm the theme was changed. Ask if they like the new look.";
228
+ break;
229
+ }
230
+ case "rearrange": {
231
+ if (!e.existingBoard)
232
+ return {
233
+ toolName: c,
234
+ message: "Existing board is required for rearranging",
235
+ instructions: "The mood board data is missing."
236
+ };
237
+ o = e.existingBoard, r = "Mood board rearranged", n = "The mood board has been refreshed.";
238
+ break;
239
+ }
240
+ default:
241
+ return {
242
+ toolName: c,
243
+ message: `Unknown action: ${t}`,
244
+ instructions: "Invalid action specified."
245
+ };
246
+ }
247
+ const a = {
248
+ itemCount: o.items.length,
249
+ theme: o.theme,
250
+ items: o.items.map((m) => ({
251
+ id: m.id,
252
+ type: m.type,
253
+ label: m.label
254
+ }))
255
+ };
256
+ return {
257
+ toolName: c,
258
+ message: r,
259
+ title: o.title,
260
+ data: o,
261
+ jsonData: a,
262
+ instructions: n,
263
+ updating: t !== "create"
264
+ };
265
+ }, M = {
266
+ toolDefinition: y,
267
+ execute: x,
268
+ generatingMessage: "Creating mood board...",
269
+ isEnabled: () => !0,
270
+ systemPrompt: f
271
+ }, D = [
272
+ {
273
+ name: "Vibrant Energy",
274
+ args: {
275
+ action: "create",
276
+ title: "Vibrant Energy",
277
+ theme: "vibrant",
278
+ concepts: ["Bold", "Dynamic", "Exciting", "Fresh"]
279
+ }
280
+ },
281
+ {
282
+ name: "Minimal Zen",
283
+ args: {
284
+ action: "create",
285
+ title: "Minimal Zen",
286
+ theme: "minimal",
287
+ concepts: ["Simple", "Clean", "Peaceful", "Balanced"]
288
+ }
289
+ },
290
+ {
291
+ name: "Vintage Charm",
292
+ args: {
293
+ action: "create",
294
+ title: "Vintage Charm",
295
+ theme: "vintage",
296
+ concepts: ["Nostalgic", "Warm", "Classic", "Timeless"]
297
+ }
298
+ },
299
+ {
300
+ name: "Ocean Dreams",
301
+ args: {
302
+ action: "create",
303
+ title: "Ocean Dreams",
304
+ theme: "ocean",
305
+ concepts: ["Calm", "Flowing", "Deep", "Refreshing"]
306
+ }
307
+ },
308
+ {
309
+ name: "Nature Escape",
310
+ args: {
311
+ action: "create",
312
+ title: "Nature Escape",
313
+ theme: "nature",
314
+ concepts: ["Organic", "Growth", "Harmony", "Life"]
315
+ }
316
+ }
317
+ ];
318
+ export {
319
+ f as SYSTEM_PROMPT,
320
+ y as TOOL_DEFINITION,
321
+ c as TOOL_NAME,
322
+ x as executeMoodBoard,
323
+ M as pluginCore,
324
+ D as samples
325
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs");exports.SYSTEM_PROMPT=e.SYSTEM_PROMPT;exports.TOOL_DEFINITION=e.TOOL_DEFINITION;exports.TOOL_NAME=e.TOOL_NAME;exports.executeMoodBoard=e.executeMoodBoard;exports.pluginCore=e.pluginCore;exports.samples=e.samples;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Mood Board Plugin
3
+ */
4
+ export * from "./core";
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import { SYSTEM_PROMPT as O, TOOL_DEFINITION as T, TOOL_NAME as r, executeMoodBoard as M, pluginCore as p, samples as E } from "./core.js";
2
+ export {
3
+ O as SYSTEM_PROMPT,
4
+ T as TOOL_DEFINITION,
5
+ r as TOOL_NAME,
6
+ M as executeMoodBoard,
7
+ p as pluginCore,
8
+ E as samples
9
+ };
package/dist/react.cjs ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const f=require("./core.cjs"),N=require("react");var b={exports:{}},x={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var F;function ae(){if(F)return x;F=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function u(d,c,r){var p=null;if(r!==void 0&&(p=""+r),c.key!==void 0&&(p=""+c.key),"key"in c){r={};for(var h in c)h!=="key"&&(r[h]=c[h])}else r=c;return c=r.ref,{$$typeof:a,type:d,key:p,ref:c!==void 0?c:null,props:r}}return x.Fragment=i,x.jsx=u,x.jsxs=u,x}var _={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var D;function se(){return D||(D=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case G:return"Profiler";case J:return"StrictMode";case Q:return"Suspense";case K:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case U:return"Portal";case H:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:a(e.type)||"Memo";case g:t=e._payload,e=e._init;try{return a(e(t))}catch{}}return null}function i(e){return""+e}function u(e){try{i(e);var t=!1}catch{t=!0}if(t){t=console;var n=t.error,s=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),i(e)}}function d(e){if(e===T)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===g)return"<...>";try{var t=a(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function c(){var e=R.A;return e===null?null:e.getOwner()}function r(){return Error("react-stack-top-frame")}function p(e){if(P.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function h(e,t){function n(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function q(){var e=a(this.type);return I[e]||(I[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function B(e,t,n,s,v,w){var l=n.ref;return e={$$typeof:S,type:e,key:t,props:n,_owner:s},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:q}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:v}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e,t,n,s,v,w){var l=t.children;if(l!==void 0)if(s)if(ne(l)){for(s=0;s<l.length;s++)k(l[s]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else k(l);if(P.call(t,"key")){l=a(e);var m=Object.keys(t).filter(function(oe){return oe!=="key"});s=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",M[l+s]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,s,l,m,l),M[l+s]=!0)}if(l=null,n!==void 0&&(u(n),l=""+n),p(t)&&(u(t.key),l=""+t.key),"key"in t){n={};for(var O in t)O!=="key"&&(n[O]=t[O])}else n=t;return l&&h(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),B(e,l,n,c(),v,w)}function k(e){A(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===g&&(e._payload.status==="fulfilled"?A(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}var E=N,S=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),H=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),R=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,ne=Array.isArray,j=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var C,I={},$=E.react_stack_bottom_frame.bind(E,r)(),Y=j(d(r)),M={};_.Fragment=T,_.jsx=function(e,t,n){var s=1e4>R.recentlyCreatedOwnerStacks++;return y(e,t,n,!1,s?Error("react-stack-top-frame"):$,s?j(d(e)):Y)},_.jsxs=function(e,t,n){var s=1e4>R.recentlyCreatedOwnerStacks++;return y(e,t,n,!0,s?Error("react-stack-top-frame"):$,s?j(d(e)):Y)}})()),_}var L;function le(){return L||(L=1,process.env.NODE_ENV==="production"?b.exports=ae():b.exports=se()),b.exports}var o=le();const ie=800,ce=600;function ue(a,i){return a.length<=i?a:a.slice(0,i-3)+"..."}function W({selectedResult:a,sendTextMessage:i}){const[u,d]=N.useState(null);N.useEffect(()=>{(a==null?void 0:a.toolName)===f.TOOL_NAME&&a.data&&d(a.data)},[a]);const c=r=>{i&&(r.type==="color"?i(`Add more elements that complement the color ${r.content}`):r.type==="text"?i(`Expand on the concept "${r.content}" - add related moods and colors`):r.type==="emoji"&&i(`Add more elements that match the mood of ${r.content}`))};return u?o.jsx("div",{className:"size-full overflow-hidden",style:{backgroundColor:u.backgroundColor||"#F9FAFB"},children:o.jsxs("div",{className:"size-full relative",children:[o.jsxs("div",{className:"absolute top-4 left-4 z-10",children:[o.jsx("h2",{className:"text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow",children:u.title}),u.theme&&o.jsx("span",{className:"text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block",children:u.theme})]}),o.jsx("svg",{className:"size-full",viewBox:`0 0 ${ie} ${ce}`,preserveAspectRatio:"xMidYMid meet",children:o.jsx("g",{className:"items",children:u.items.map(r=>o.jsxs("g",{transform:`translate(${r.x}, ${r.y}) rotate(${r.rotation||0})`,className:"cursor-pointer transition-transform duration-200 hover:scale-110",onClick:()=>c(r),children:[r.type==="color"&&o.jsx("rect",{x:-r.width/2,y:-r.height/2,width:r.width,height:r.height,fill:r.content,rx:8,className:"drop-shadow-lg",stroke:"white",strokeWidth:3}),r.type==="emoji"&&o.jsx("text",{textAnchor:"middle",dominantBaseline:"middle",className:"select-none pointer-events-none",style:{fontSize:`${r.width}px`},children:r.content}),r.type==="text"&&o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:-r.width/2,y:-r.height/2,width:r.width,height:r.height,fill:"white",rx:4,className:"drop-shadow-md"}),o.jsx("text",{textAnchor:"middle",dominantBaseline:"middle",fill:"#374151",className:"text-sm font-medium select-none pointer-events-none",children:ue(r.content,15)})]})]},r.id))})}),o.jsx("div",{className:"absolute bottom-4 left-4 right-4 text-center",children:o.jsx("p",{className:"text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block",children:"Click an item to explore related concepts"})})]})}):o.jsx("div",{className:"size-full flex items-center justify-center",children:o.jsx("p",{className:"text-gray-400",children:"No mood board data"})})}function z({result:a}){var c;const i=a.data;if(!i)return null;const u=i.title||"Mood Board",d=((c=i.items)==null?void 0:c.length)||0;return o.jsxs("div",{className:"p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center",children:[o.jsx("div",{className:"text-2xl mb-1",children:"🎨"}),o.jsx("div",{className:"text-purple-700 font-medium text-sm truncate",children:u}),o.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[d," elements"]})]})}const V={...f.pluginCore,ViewComponent:W,PreviewComponent:z,samples:f.samples},de={plugin:V};exports.SYSTEM_PROMPT=f.SYSTEM_PROMPT;exports.TOOL_DEFINITION=f.TOOL_DEFINITION;exports.TOOL_NAME=f.TOOL_NAME;exports.executeMoodBoard=f.executeMoodBoard;exports.pluginCore=f.pluginCore;exports.samples=f.samples;exports.Preview=z;exports.View=W;exports.default=de;exports.plugin=V;
package/dist/react.js ADDED
@@ -0,0 +1,415 @@
1
+ /* empty css */
2
+ import { TOOL_NAME as ee, samples as re, pluginCore as te } from "./core.js";
3
+ import { SYSTEM_PROMPT as Te, TOOL_DEFINITION as Re, executeMoodBoard as ge } from "./core.js";
4
+ import ne, { useState as oe, useEffect as ae } from "react";
5
+ var v = { exports: {} }, h = {};
6
+ /**
7
+ * @license React
8
+ * react-jsx-runtime.production.js
9
+ *
10
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ var Y;
16
+ function se() {
17
+ if (Y) return h;
18
+ Y = 1;
19
+ var a = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
20
+ function u(d, c, r) {
21
+ var m = null;
22
+ if (r !== void 0 && (m = "" + r), c.key !== void 0 && (m = "" + c.key), "key" in c) {
23
+ r = {};
24
+ for (var p in c)
25
+ p !== "key" && (r[p] = c[p]);
26
+ } else r = c;
27
+ return c = r.ref, {
28
+ $$typeof: a,
29
+ type: d,
30
+ key: m,
31
+ ref: c !== void 0 ? c : null,
32
+ props: r
33
+ };
34
+ }
35
+ return h.Fragment = i, h.jsx = u, h.jsxs = u, h;
36
+ }
37
+ var x = {};
38
+ /**
39
+ * @license React
40
+ * react-jsx-runtime.development.js
41
+ *
42
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ */
47
+ var F;
48
+ function le() {
49
+ return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
50
+ function a(e) {
51
+ if (e == null) return null;
52
+ if (typeof e == "function")
53
+ return e.$$typeof === Z ? null : e.displayName || e.name || null;
54
+ if (typeof e == "string") return e;
55
+ switch (e) {
56
+ case b:
57
+ return "Fragment";
58
+ case V:
59
+ return "Profiler";
60
+ case L:
61
+ return "StrictMode";
62
+ case J:
63
+ return "Suspense";
64
+ case G:
65
+ return "SuspenseList";
66
+ case H:
67
+ return "Activity";
68
+ }
69
+ if (typeof e == "object")
70
+ switch (typeof e.tag == "number" && console.error(
71
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
+ ), e.$$typeof) {
73
+ case z:
74
+ return "Portal";
75
+ case U:
76
+ return e.displayName || "Context";
77
+ case B:
78
+ return (e._context.displayName || "Context") + ".Consumer";
79
+ case q:
80
+ var t = e.render;
81
+ return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
82
+ case X:
83
+ return t = e.displayName || null, t !== null ? t : a(e.type) || "Memo";
84
+ case T:
85
+ t = e._payload, e = e._init;
86
+ try {
87
+ return a(e(t));
88
+ } catch {
89
+ }
90
+ }
91
+ return null;
92
+ }
93
+ function i(e) {
94
+ return "" + e;
95
+ }
96
+ function u(e) {
97
+ try {
98
+ i(e);
99
+ var t = !1;
100
+ } catch {
101
+ t = !0;
102
+ }
103
+ if (t) {
104
+ t = console;
105
+ var n = t.error, s = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
106
+ return n.call(
107
+ t,
108
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
+ s
110
+ ), i(e);
111
+ }
112
+ }
113
+ function d(e) {
114
+ if (e === b) return "<>";
115
+ if (typeof e == "object" && e !== null && e.$$typeof === T)
116
+ return "<...>";
117
+ try {
118
+ var t = a(e);
119
+ return t ? "<" + t + ">" : "<...>";
120
+ } catch {
121
+ return "<...>";
122
+ }
123
+ }
124
+ function c() {
125
+ var e = R.A;
126
+ return e === null ? null : e.getOwner();
127
+ }
128
+ function r() {
129
+ return Error("react-stack-top-frame");
130
+ }
131
+ function m(e) {
132
+ if (A.call(e, "key")) {
133
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
134
+ if (t && t.isReactWarning) return !1;
135
+ }
136
+ return e.key !== void 0;
137
+ }
138
+ function p(e, t) {
139
+ function n() {
140
+ S || (S = !0, console.error(
141
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
+ t
143
+ ));
144
+ }
145
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
146
+ get: n,
147
+ configurable: !0
148
+ });
149
+ }
150
+ function M() {
151
+ var e = a(this.type);
152
+ return P[e] || (P[e] = !0, console.error(
153
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
+ )), e = this.props.ref, e !== void 0 ? e : null;
155
+ }
156
+ function W(e, t, n, s, _, j) {
157
+ var l = n.ref;
158
+ return e = {
159
+ $$typeof: O,
160
+ type: e,
161
+ key: t,
162
+ props: n,
163
+ _owner: s
164
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
165
+ enumerable: !1,
166
+ get: M
167
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
168
+ configurable: !1,
169
+ enumerable: !1,
170
+ writable: !0,
171
+ value: 0
172
+ }), Object.defineProperty(e, "_debugInfo", {
173
+ configurable: !1,
174
+ enumerable: !1,
175
+ writable: !0,
176
+ value: null
177
+ }), Object.defineProperty(e, "_debugStack", {
178
+ configurable: !1,
179
+ enumerable: !1,
180
+ writable: !0,
181
+ value: _
182
+ }), Object.defineProperty(e, "_debugTask", {
183
+ configurable: !1,
184
+ enumerable: !1,
185
+ writable: !0,
186
+ value: j
187
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
188
+ }
189
+ function k(e, t, n, s, _, j) {
190
+ var l = t.children;
191
+ if (l !== void 0)
192
+ if (s)
193
+ if (Q(l)) {
194
+ for (s = 0; s < l.length; s++)
195
+ y(l[s]);
196
+ Object.freeze && Object.freeze(l);
197
+ } else
198
+ console.error(
199
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
200
+ );
201
+ else y(l);
202
+ if (A.call(t, "key")) {
203
+ l = a(e);
204
+ var f = Object.keys(t).filter(function(K) {
205
+ return K !== "key";
206
+ });
207
+ s = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", I[l + s] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ `A props object containing a "key" prop is being spread into JSX:
209
+ let props = %s;
210
+ <%s {...props} />
211
+ React keys must be passed directly to JSX without using spread:
212
+ let props = %s;
213
+ <%s key={someKey} {...props} />`,
214
+ s,
215
+ l,
216
+ f,
217
+ l
218
+ ), I[l + s] = !0);
219
+ }
220
+ if (l = null, n !== void 0 && (u(n), l = "" + n), m(t) && (u(t.key), l = "" + t.key), "key" in t) {
221
+ n = {};
222
+ for (var w in t)
223
+ w !== "key" && (n[w] = t[w]);
224
+ } else n = t;
225
+ return l && p(
226
+ n,
227
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
228
+ ), W(
229
+ e,
230
+ l,
231
+ n,
232
+ c(),
233
+ _,
234
+ j
235
+ );
236
+ }
237
+ function y(e) {
238
+ N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? N(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
239
+ }
240
+ function N(e) {
241
+ return typeof e == "object" && e !== null && e.$$typeof === O;
242
+ }
243
+ var E = ne, O = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), U = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), R = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, Q = Array.isArray, g = console.createTask ? console.createTask : function() {
244
+ return null;
245
+ };
246
+ E = {
247
+ react_stack_bottom_frame: function(e) {
248
+ return e();
249
+ }
250
+ };
251
+ var S, P = {}, C = E.react_stack_bottom_frame.bind(
252
+ E,
253
+ r
254
+ )(), $ = g(d(r)), I = {};
255
+ x.Fragment = b, x.jsx = function(e, t, n) {
256
+ var s = 1e4 > R.recentlyCreatedOwnerStacks++;
257
+ return k(
258
+ e,
259
+ t,
260
+ n,
261
+ !1,
262
+ s ? Error("react-stack-top-frame") : C,
263
+ s ? g(d(e)) : $
264
+ );
265
+ }, x.jsxs = function(e, t, n) {
266
+ var s = 1e4 > R.recentlyCreatedOwnerStacks++;
267
+ return k(
268
+ e,
269
+ t,
270
+ n,
271
+ !0,
272
+ s ? Error("react-stack-top-frame") : C,
273
+ s ? g(d(e)) : $
274
+ );
275
+ };
276
+ })()), x;
277
+ }
278
+ var D;
279
+ function ie() {
280
+ return D || (D = 1, process.env.NODE_ENV === "production" ? v.exports = se() : v.exports = le()), v.exports;
281
+ }
282
+ var o = ie();
283
+ const ce = 800, ue = 600;
284
+ function de(a, i) {
285
+ return a.length <= i ? a : a.slice(0, i - 3) + "...";
286
+ }
287
+ function fe({ selectedResult: a, sendTextMessage: i }) {
288
+ const [u, d] = oe(null);
289
+ ae(() => {
290
+ (a == null ? void 0 : a.toolName) === ee && a.data && d(a.data);
291
+ }, [a]);
292
+ const c = (r) => {
293
+ i && (r.type === "color" ? i(
294
+ `Add more elements that complement the color ${r.content}`
295
+ ) : r.type === "text" ? i(
296
+ `Expand on the concept "${r.content}" - add related moods and colors`
297
+ ) : r.type === "emoji" && i(
298
+ `Add more elements that match the mood of ${r.content}`
299
+ ));
300
+ };
301
+ return u ? /* @__PURE__ */ o.jsx(
302
+ "div",
303
+ {
304
+ className: "size-full overflow-hidden",
305
+ style: { backgroundColor: u.backgroundColor || "#F9FAFB" },
306
+ children: /* @__PURE__ */ o.jsxs("div", { className: "size-full relative", children: [
307
+ /* @__PURE__ */ o.jsxs("div", { className: "absolute top-4 left-4 z-10", children: [
308
+ /* @__PURE__ */ o.jsx("h2", { className: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow", children: u.title }),
309
+ u.theme && /* @__PURE__ */ o.jsx("span", { className: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block", children: u.theme })
310
+ ] }),
311
+ /* @__PURE__ */ o.jsx(
312
+ "svg",
313
+ {
314
+ className: "size-full",
315
+ viewBox: `0 0 ${ce} ${ue}`,
316
+ preserveAspectRatio: "xMidYMid meet",
317
+ children: /* @__PURE__ */ o.jsx("g", { className: "items", children: u.items.map((r) => /* @__PURE__ */ o.jsxs(
318
+ "g",
319
+ {
320
+ transform: `translate(${r.x}, ${r.y}) rotate(${r.rotation || 0})`,
321
+ className: "cursor-pointer transition-transform duration-200 hover:scale-110",
322
+ onClick: () => c(r),
323
+ children: [
324
+ r.type === "color" && /* @__PURE__ */ o.jsx(
325
+ "rect",
326
+ {
327
+ x: -r.width / 2,
328
+ y: -r.height / 2,
329
+ width: r.width,
330
+ height: r.height,
331
+ fill: r.content,
332
+ rx: 8,
333
+ className: "drop-shadow-lg",
334
+ stroke: "white",
335
+ strokeWidth: 3
336
+ }
337
+ ),
338
+ r.type === "emoji" && /* @__PURE__ */ o.jsx(
339
+ "text",
340
+ {
341
+ textAnchor: "middle",
342
+ dominantBaseline: "middle",
343
+ className: "select-none pointer-events-none",
344
+ style: { fontSize: `${r.width}px` },
345
+ children: r.content
346
+ }
347
+ ),
348
+ r.type === "text" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
349
+ /* @__PURE__ */ o.jsx(
350
+ "rect",
351
+ {
352
+ x: -r.width / 2,
353
+ y: -r.height / 2,
354
+ width: r.width,
355
+ height: r.height,
356
+ fill: "white",
357
+ rx: 4,
358
+ className: "drop-shadow-md"
359
+ }
360
+ ),
361
+ /* @__PURE__ */ o.jsx(
362
+ "text",
363
+ {
364
+ textAnchor: "middle",
365
+ dominantBaseline: "middle",
366
+ fill: "#374151",
367
+ className: "text-sm font-medium select-none pointer-events-none",
368
+ children: de(r.content, 15)
369
+ }
370
+ )
371
+ ] })
372
+ ]
373
+ },
374
+ r.id
375
+ )) })
376
+ }
377
+ ),
378
+ /* @__PURE__ */ o.jsx("div", { className: "absolute bottom-4 left-4 right-4 text-center", children: /* @__PURE__ */ o.jsx("p", { className: "text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block", children: "Click an item to explore related concepts" }) })
379
+ ] })
380
+ }
381
+ ) : /* @__PURE__ */ o.jsx("div", { className: "size-full flex items-center justify-center", children: /* @__PURE__ */ o.jsx("p", { className: "text-gray-400", children: "No mood board data" }) });
382
+ }
383
+ function me({ result: a }) {
384
+ var c;
385
+ const i = a.data;
386
+ if (!i)
387
+ return null;
388
+ const u = i.title || "Mood Board", d = ((c = i.items) == null ? void 0 : c.length) || 0;
389
+ return /* @__PURE__ */ o.jsxs("div", { className: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center", children: [
390
+ /* @__PURE__ */ o.jsx("div", { className: "text-2xl mb-1", children: "🎨" }),
391
+ /* @__PURE__ */ o.jsx("div", { className: "text-purple-700 font-medium text-sm truncate", children: u }),
392
+ /* @__PURE__ */ o.jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
393
+ d,
394
+ " elements"
395
+ ] })
396
+ ] });
397
+ }
398
+ const pe = {
399
+ ...te,
400
+ ViewComponent: fe,
401
+ PreviewComponent: me,
402
+ samples: re
403
+ }, _e = { plugin: pe };
404
+ export {
405
+ me as Preview,
406
+ Te as SYSTEM_PROMPT,
407
+ Re as TOOL_DEFINITION,
408
+ ee as TOOL_NAME,
409
+ fe as View,
410
+ _e as default,
411
+ ge as executeMoodBoard,
412
+ pe as plugin,
413
+ te as pluginCore,
414
+ re as samples
415
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-600:oklch(66.6% .179 58.318);--color-green-600:oklch(62.7% .194 149.214);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-50:oklch(97.1% .014 343.198);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--drop-shadow-md:0 3px 3px #0000001f;--drop-shadow-lg:0 4px 4px #00000026;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-4{bottom:calc(var(--spacing)*4)}.left-4{left:calc(var(--spacing)*4)}.z-10{z-index:10}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.contents{display:contents}.flex{display:flex}.grid{display:grid}.inline-block{display:inline-block}.size-full{width:100%;height:100%}.h-4{height:calc(var(--spacing)*4)}.h-\[600px\]{height:600px}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing)*4)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[85\%\]{max-width:85%}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-100{background-color:var(--color-red-100)}.bg-white{background-color:var(--color-white)}.bg-white\/60{background-color:#fff9}@supports (color:color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white)60%,transparent)}}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-purple-50{--tw-gradient-from:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-pink-50{--tw-gradient-to:var(--color-pink-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-8{padding:calc(var(--spacing)*8)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-green-600{color:var(--color-green-600)}.text-indigo-600{color:var(--color-indigo-600)}.text-indigo-700{color:var(--color-indigo-700)}.text-purple-700{color:var(--color-purple-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.drop-shadow-lg{--tw-drop-shadow-size:drop-shadow(0 4px 4px var(--tw-drop-shadow-color,#00000026));--tw-drop-shadow:drop-shadow(var(--drop-shadow-lg));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-md{--tw-drop-shadow-size:drop-shadow(0 3px 3px var(--tw-drop-shadow-color,#0000001f));--tw-drop-shadow:drop-shadow(var(--drop-shadow-md));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-100:disabled{background-color:var(--color-gray-100)}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}body{margin:calc(var(--spacing)*0);background-color:var(--color-gray-100);padding:calc(var(--spacing)*5);font-family:var(--font-sans)}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes pulse{50%{opacity:.5}}
@@ -0,0 +1,7 @@
1
+ import type { ToolResult } from "gui-chat-protocol";
2
+ import type { MoodBoardData } from "../core/types";
3
+ type __VLS_Props = {
4
+ result: ToolResult<MoodBoardData>;
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { ToolResult } from "gui-chat-protocol";
2
+ import type { MoodBoardData } from "../core/types";
3
+ type __VLS_Props = {
4
+ selectedResult: ToolResult<MoodBoardData>;
5
+ sendTextMessage?: (text?: string) => void;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Mood Board Plugin - Vue Implementation
3
+ */
4
+ import "../style.css";
5
+ import type { ToolPlugin } from "gui-chat-protocol/vue";
6
+ import type { MoodBoardData, MoodBoardArgs, MoodBoardJsonData } from "../core/types";
7
+ import View from "./View.vue";
8
+ import Preview from "./Preview.vue";
9
+ export declare const plugin: ToolPlugin<MoodBoardData, MoodBoardJsonData, MoodBoardArgs>;
10
+ export type { MoodBoardData, MoodBoardArgs, MoodBoardJsonData } from "../core/types";
11
+ export { TOOL_NAME, TOOL_DEFINITION, SYSTEM_PROMPT, executeMoodBoard, pluginCore, } from "../core/plugin";
12
+ export { samples } from "../core/samples";
13
+ export { View, Preview };
14
+ declare const _default: {
15
+ plugin: ToolPlugin<MoodBoardData, MoodBoardJsonData, MoodBoardArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
16
+ };
17
+ export default _default;
package/dist/vue.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */const l=require("./core.cjs"),e=require("vue"),g={key:0,class:"size-full relative"},x={class:"absolute top-4 left-4 z-10"},_={class:"text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow"},f={key:0,class:"text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block"},k=["viewBox"],v={class:"items"},y=["transform","onClick"],B=["x","y","width","height","fill"],E=["x","y","width","height"],w={"text-anchor":"middle","dominant-baseline":"middle",fill:"#374151",class:"text-sm font-medium select-none pointer-events-none"},N={key:1,class:"size-full flex items-center justify-center"},b=800,M=600,u=e.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},setup(i){const r=i,a=e.ref(null),n=e.ref(null);e.watch(()=>r.selectedResult,t=>{(t==null?void 0:t.toolName)===l.TOOL_NAME&&t.data&&(n.value=t.data)},{immediate:!0});function d(t,c){return t.length<=c?t:t.slice(0,c-3)+"..."}function s(t){r.sendTextMessage&&(t.type==="color"?r.sendTextMessage(`Add more elements that complement the color ${t.content}`):t.type==="text"?r.sendTextMessage(`Expand on the concept "${t.content}" - add related moods and colors`):t.type==="emoji"&&r.sendTextMessage(`Add more elements that match the mood of ${t.content}`))}return(t,c)=>{var p;return e.openBlock(),e.createElementBlock("div",{class:"size-full overflow-hidden",style:e.normalizeStyle({backgroundColor:((p=n.value)==null?void 0:p.backgroundColor)||"#F9FAFB"})},[n.value?(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("div",x,[e.createElementVNode("h2",_,e.toDisplayString(n.value.title),1),n.value.theme?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(n.value.theme),1)):e.createCommentVNode("",!0)]),(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:a,class:"size-full",viewBox:`0 0 ${b} ${M}`,preserveAspectRatio:"xMidYMid meet"},[e.createElementVNode("g",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.items,o=>(e.openBlock(),e.createElementBlock("g",{key:o.id,transform:`translate(${o.x}, ${o.y}) rotate(${o.rotation||0})`,class:"cursor-pointer transition-transform duration-200 hover:scale-110",onClick:V=>s(o)},[o.type==="color"?(e.openBlock(),e.createElementBlock("rect",{key:0,x:-o.width/2,y:-o.height/2,width:o.width,height:o.height,fill:o.content,rx:"8",class:"drop-shadow-lg",stroke:"white","stroke-width":"3"},null,8,B)):o.type==="emoji"?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle","dominant-baseline":"middle",class:"select-none pointer-events-none",style:e.normalizeStyle({fontSize:`${o.width}px`})},e.toDisplayString(o.content),5)):o.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("rect",{x:-o.width/2,y:-o.height/2,width:o.width,height:o.height,fill:"white",rx:"4",class:"drop-shadow-md"},null,8,E),e.createElementVNode("text",w,e.toDisplayString(d(o.content,15)),1)],64)):e.createCommentVNode("",!0)],8,y))),128))])],8,k)),c[0]||(c[0]=e.createElementVNode("div",{class:"absolute bottom-4 left-4 right-4 text-center"},[e.createElementVNode("p",{class:"text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block"}," Click an item to explore related concepts ")],-1))])):(e.openBlock(),e.createElementBlock("div",N,[...c[1]||(c[1]=[e.createElementVNode("p",{class:"text-gray-400"},"No mood board data",-1)])]))],4)}}}),T={class:"p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center"},C={class:"text-purple-700 font-medium text-sm truncate"},O={class:"text-xs text-gray-500 mt-1"},m=e.defineComponent({__name:"Preview",props:{result:{}},setup(i){const r=i,a=e.computed(()=>r.result.data),n=e.computed(()=>{var s;return((s=a.value)==null?void 0:s.title)||"Mood Board"}),d=e.computed(()=>{var s,t;return((t=(s=a.value)==null?void 0:s.items)==null?void 0:t.length)||0});return(s,t)=>(e.openBlock(),e.createElementBlock("div",T,[t[0]||(t[0]=e.createElementVNode("div",{class:"text-2xl mb-1"},"🎨",-1)),e.createElementVNode("div",C,e.toDisplayString(n.value),1),e.createElementVNode("div",O,e.toDisplayString(d.value)+" elements ",1)]))}}),h={...l.pluginCore,viewComponent:u,previewComponent:m,samples:l.samples},S={plugin:h};exports.SYSTEM_PROMPT=l.SYSTEM_PROMPT;exports.TOOL_DEFINITION=l.TOOL_DEFINITION;exports.TOOL_NAME=l.TOOL_NAME;exports.executeMoodBoard=l.executeMoodBoard;exports.pluginCore=l.pluginCore;exports.samples=l.samples;exports.Preview=m;exports.View=u;exports.default=S;exports.plugin=h;
package/dist/vue.js ADDED
@@ -0,0 +1,148 @@
1
+ /* empty css */
2
+ import { TOOL_NAME as y, samples as w, pluginCore as k } from "./core.js";
3
+ import { SYSTEM_PROMPT as U, TOOL_DEFINITION as X, executeMoodBoard as Z } from "./core.js";
4
+ import { defineComponent as _, ref as m, watch as b, openBlock as o, createElementBlock as s, normalizeStyle as f, createElementVNode as n, toDisplayString as a, createCommentVNode as g, Fragment as v, renderList as $, computed as u } from "vue";
5
+ const C = {
6
+ key: 0,
7
+ class: "size-full relative"
8
+ }, M = { class: "absolute top-4 left-4 z-10" }, T = { class: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow" }, B = {
9
+ key: 0,
10
+ class: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block"
11
+ }, z = ["viewBox"], N = { class: "items" }, E = ["transform", "onClick"], F = ["x", "y", "width", "height", "fill"], O = ["x", "y", "width", "height"], A = {
12
+ "text-anchor": "middle",
13
+ "dominant-baseline": "middle",
14
+ fill: "#374151",
15
+ class: "text-sm font-medium select-none pointer-events-none"
16
+ }, S = {
17
+ key: 1,
18
+ class: "size-full flex items-center justify-center"
19
+ }, I = 800, P = 600, V = /* @__PURE__ */ _({
20
+ __name: "View",
21
+ props: {
22
+ selectedResult: {},
23
+ sendTextMessage: { type: Function }
24
+ },
25
+ setup(h) {
26
+ const i = h, c = m(null), l = m(null);
27
+ b(
28
+ () => i.selectedResult,
29
+ (e) => {
30
+ (e == null ? void 0 : e.toolName) === y && e.data && (l.value = e.data);
31
+ },
32
+ { immediate: !0 }
33
+ );
34
+ function p(e, d) {
35
+ return e.length <= d ? e : e.slice(0, d - 3) + "...";
36
+ }
37
+ function r(e) {
38
+ i.sendTextMessage && (e.type === "color" ? i.sendTextMessage(
39
+ `Add more elements that complement the color ${e.content}`
40
+ ) : e.type === "text" ? i.sendTextMessage(
41
+ `Expand on the concept "${e.content}" - add related moods and colors`
42
+ ) : e.type === "emoji" && i.sendTextMessage(
43
+ `Add more elements that match the mood of ${e.content}`
44
+ ));
45
+ }
46
+ return (e, d) => {
47
+ var x;
48
+ return o(), s("div", {
49
+ class: "size-full overflow-hidden",
50
+ style: f({ backgroundColor: ((x = l.value) == null ? void 0 : x.backgroundColor) || "#F9FAFB" })
51
+ }, [
52
+ l.value ? (o(), s("div", C, [
53
+ n("div", M, [
54
+ n("h2", T, a(l.value.title), 1),
55
+ l.value.theme ? (o(), s("span", B, a(l.value.theme), 1)) : g("", !0)
56
+ ]),
57
+ (o(), s("svg", {
58
+ ref_key: "svgRef",
59
+ ref: c,
60
+ class: "size-full",
61
+ viewBox: `0 0 ${I} ${P}`,
62
+ preserveAspectRatio: "xMidYMid meet"
63
+ }, [
64
+ n("g", N, [
65
+ (o(!0), s(v, null, $(l.value.items, (t) => (o(), s("g", {
66
+ key: t.id,
67
+ transform: `translate(${t.x}, ${t.y}) rotate(${t.rotation || 0})`,
68
+ class: "cursor-pointer transition-transform duration-200 hover:scale-110",
69
+ onClick: (W) => r(t)
70
+ }, [
71
+ t.type === "color" ? (o(), s("rect", {
72
+ key: 0,
73
+ x: -t.width / 2,
74
+ y: -t.height / 2,
75
+ width: t.width,
76
+ height: t.height,
77
+ fill: t.content,
78
+ rx: "8",
79
+ class: "drop-shadow-lg",
80
+ stroke: "white",
81
+ "stroke-width": "3"
82
+ }, null, 8, F)) : t.type === "emoji" ? (o(), s("text", {
83
+ key: 1,
84
+ "text-anchor": "middle",
85
+ "dominant-baseline": "middle",
86
+ class: "select-none pointer-events-none",
87
+ style: f({ fontSize: `${t.width}px` })
88
+ }, a(t.content), 5)) : t.type === "text" ? (o(), s(v, { key: 2 }, [
89
+ n("rect", {
90
+ x: -t.width / 2,
91
+ y: -t.height / 2,
92
+ width: t.width,
93
+ height: t.height,
94
+ fill: "white",
95
+ rx: "4",
96
+ class: "drop-shadow-md"
97
+ }, null, 8, O),
98
+ n("text", A, a(p(t.content, 15)), 1)
99
+ ], 64)) : g("", !0)
100
+ ], 8, E))), 128))
101
+ ])
102
+ ], 8, z)),
103
+ d[0] || (d[0] = n("div", { class: "absolute bottom-4 left-4 right-4 text-center" }, [
104
+ n("p", { class: "text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block" }, " Click an item to explore related concepts ")
105
+ ], -1))
106
+ ])) : (o(), s("div", S, [...d[1] || (d[1] = [
107
+ n("p", { class: "text-gray-400" }, "No mood board data", -1)
108
+ ])]))
109
+ ], 4);
110
+ };
111
+ }
112
+ }), j = { class: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center" }, D = { class: "text-purple-700 font-medium text-sm truncate" }, L = { class: "text-xs text-gray-500 mt-1" }, Y = /* @__PURE__ */ _({
113
+ __name: "Preview",
114
+ props: {
115
+ result: {}
116
+ },
117
+ setup(h) {
118
+ const i = h, c = u(() => i.result.data), l = u(() => {
119
+ var r;
120
+ return ((r = c.value) == null ? void 0 : r.title) || "Mood Board";
121
+ }), p = u(() => {
122
+ var r, e;
123
+ return ((e = (r = c.value) == null ? void 0 : r.items) == null ? void 0 : e.length) || 0;
124
+ });
125
+ return (r, e) => (o(), s("div", j, [
126
+ e[0] || (e[0] = n("div", { class: "text-2xl mb-1" }, "🎨", -1)),
127
+ n("div", D, a(l.value), 1),
128
+ n("div", L, a(p.value) + " elements ", 1)
129
+ ]));
130
+ }
131
+ }), H = {
132
+ ...k,
133
+ viewComponent: V,
134
+ previewComponent: Y,
135
+ samples: w
136
+ }, K = { plugin: H };
137
+ export {
138
+ Y as Preview,
139
+ U as SYSTEM_PROMPT,
140
+ X as TOOL_DEFINITION,
141
+ y as TOOL_NAME,
142
+ V as View,
143
+ K as default,
144
+ Z as executeMoodBoard,
145
+ H as plugin,
146
+ k as pluginCore,
147
+ w as samples
148
+ };
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@gui-chat-plugin/moodboard",
3
+ "version": "0.1.1",
4
+ "description": "Interactive mood board plugin for visual inspiration and brainstorming",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./core": {
16
+ "types": "./dist/core/index.d.ts",
17
+ "import": "./dist/core.js",
18
+ "require": "./dist/core.cjs"
19
+ },
20
+ "./vue": {
21
+ "types": "./dist/vue/index.d.ts",
22
+ "import": "./dist/vue.js",
23
+ "require": "./dist/vue.cjs"
24
+ },
25
+ "./react": {
26
+ "types": "./dist/react/index.d.ts",
27
+ "import": "./dist/react.js",
28
+ "require": "./dist/react.cjs"
29
+ },
30
+ "./style.css": "./dist/style.css"
31
+ },
32
+ "files": ["dist"],
33
+ "scripts": {
34
+ "dev": "vite",
35
+ "dev:react": "vite --config vite.config.react.ts",
36
+ "build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
37
+ "typecheck": "vue-tsc --noEmit",
38
+ "lint": "eslint src demo"
39
+ },
40
+ "peerDependencies": {
41
+ "gui-chat-protocol": "^0.0.3",
42
+ "vue": "^3.5.0",
43
+ "react": "^18.0.0 || ^19.0.0",
44
+ "react-dom": "^18.0.0 || ^19.0.0"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "vue": { "optional": true },
48
+ "react": { "optional": true },
49
+ "react-dom": { "optional": true }
50
+ },
51
+ "devDependencies": {
52
+ "@tailwindcss/vite": "^4.1.18",
53
+ "@types/react": "^19.1.8",
54
+ "@types/react-dom": "^19.1.6",
55
+ "@typescript-eslint/eslint-plugin": "^8.32.1",
56
+ "@typescript-eslint/parser": "^8.32.1",
57
+ "@vitejs/plugin-react": "^4.5.2",
58
+ "@vitejs/plugin-vue": "^6.0.0",
59
+ "eslint": "^9.27.0",
60
+ "eslint-plugin-react": "^7.37.5",
61
+ "eslint-plugin-react-hooks": "^5.2.0",
62
+ "eslint-plugin-vue": "^10.0.0",
63
+ "globals": "^16.1.0",
64
+ "gui-chat-protocol": "^0.0.3",
65
+ "react": "^19.1.0",
66
+ "react-dom": "^19.1.0",
67
+ "tailwindcss": "^4.1.7",
68
+ "typescript": "~5.8.3",
69
+ "vite": "^6.3.5",
70
+ "vue": "^3.5.13",
71
+ "vue-eslint-parser": "^10.1.3",
72
+ "vue-tsc": "^2.2.10"
73
+ },
74
+ "keywords": ["guichat", "plugin", "moodboard", "inspiration", "visual", "brainstorming"],
75
+ "license": "MIT",
76
+ "dependencies": {
77
+ "gui-chat-protocol": "^0.0.3",
78
+ "openai": "^4.77.0"
79
+ }
80
+ }