@decido/shell 1.0.0 → 4.0.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.
Files changed (208) hide show
  1. package/README.md +31 -0
  2. package/package.json +17 -14
  3. package/.turbo/turbo-build.log +0 -13
  4. package/src/AgentPlayer.tsx +0 -105
  5. package/src/DecidoPlayer.tsx +0 -117
  6. package/src/bridge/BridgeAgent.ts +0 -443
  7. package/src/components/DecidoIcon.tsx +0 -56
  8. package/src/components/JsonTreeEditor.tsx +0 -117
  9. package/src/components/PanelSplitter.tsx +0 -71
  10. package/src/components/PluginErrorBoundary.tsx +0 -69
  11. package/src/components/SafeLiquidUI.tsx +0 -114
  12. package/src/components/TransientLayer.tsx +0 -92
  13. package/src/components/agent/AgentChat.tsx +0 -134
  14. package/src/components/chat-extensions/IntentCatalogPanel.tsx +0 -81
  15. package/src/components/chat-extensions/chatSlashCommands.ts +0 -101
  16. package/src/components/controls/CreatorInputBar.tsx +0 -144
  17. package/src/components/controls/OSToolbar.tsx +0 -90
  18. package/src/components/controls/TimelineTape.tsx +0 -43
  19. package/src/components/debug/ActionTimelineTab.tsx +0 -111
  20. package/src/components/debug/CSSInspectorTab.tsx +0 -436
  21. package/src/components/debug/ExportTab.tsx +0 -192
  22. package/src/components/debug/FlowHealthTab.tsx +0 -86
  23. package/src/components/debug/LogsTab.tsx +0 -110
  24. package/src/components/debug/MorphStackTab.tsx +0 -241
  25. package/src/components/debug/NetworkTab.tsx +0 -173
  26. package/src/components/debug/PerformanceTab.tsx +0 -171
  27. package/src/components/debug/ProfilesTab.tsx +0 -238
  28. package/src/components/debug/ReplayTab.tsx +0 -70
  29. package/src/components/debug/StoresTab.tsx +0 -255
  30. package/src/components/debug/TopologyTab.tsx +0 -59
  31. package/src/components/debug/debugConfig.tsx +0 -66
  32. package/src/components/playground/DebugPanel.tsx +0 -112
  33. package/src/components/playground/HeaderCenterControls.tsx +0 -92
  34. package/src/components/playground/KeyframeListItem.tsx +0 -70
  35. package/src/components/playground/PlaygroundAppSidebar.tsx +0 -171
  36. package/src/components/playground/PlaygroundBottomControls.tsx +0 -132
  37. package/src/components/playground/PlaygroundCanvas.tsx +0 -87
  38. package/src/components/playground/PlaygroundChat.tsx +0 -236
  39. package/src/components/playground/PlaygroundErrorBoundary.tsx +0 -63
  40. package/src/components/playground/PlaygroundFloatingInput.tsx +0 -352
  41. package/src/components/playground/PlaygroundHeader.tsx +0 -222
  42. package/src/components/playground/PlaygroundSidebar.tsx +0 -136
  43. package/src/components/playground/PlaygroundTerminal.tsx +0 -44
  44. package/src/components/playground/SuggestionCards.tsx +0 -29
  45. package/src/components/playground/demos/ClinicaAINode.tsx +0 -221
  46. package/src/components/playground/demos/FinanceAINode.tsx +0 -226
  47. package/src/components/playground/demos/KiaAcademyNode.tsx +0 -250
  48. package/src/components/playground/demos/KiaBotNode.tsx +0 -207
  49. package/src/components/playground/demos/KiaCampaignNode.tsx +0 -191
  50. package/src/components/playground/demos/KiaComplianceNode.tsx +0 -140
  51. package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +0 -220
  52. package/src/components/playground/demos/KiaCyberNode.tsx +0 -203
  53. package/src/components/playground/demos/KiaDashboardNode.tsx +0 -399
  54. package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +0 -168
  55. package/src/components/playground/demos/KiaExecutiveNode.tsx +0 -169
  56. package/src/components/playground/demos/KiaGamificationNode.tsx +0 -229
  57. package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +0 -165
  58. package/src/components/playground/demos/KiaInventoryNode.tsx +0 -183
  59. package/src/components/playground/demos/KiaLeadScoringNode.tsx +0 -226
  60. package/src/components/playground/demos/KiaLiveSimulationNode.tsx +0 -177
  61. package/src/components/playground/demos/KiaMultiDealerNode.tsx +0 -223
  62. package/src/components/playground/demos/KiaNPSVoiceNode.tsx +0 -214
  63. package/src/components/playground/demos/KiaOmnichannelNode.tsx +0 -162
  64. package/src/components/playground/demos/KiaPBIBudgetNode.tsx +0 -152
  65. package/src/components/playground/demos/KiaPBIConversionNode.tsx +0 -206
  66. package/src/components/playground/demos/KiaPBIFunnelNode.tsx +0 -184
  67. package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +0 -113
  68. package/src/components/playground/demos/KiaPBIPartnerNode.tsx +0 -143
  69. package/src/components/playground/demos/KiaPBIPreciosNode.tsx +0 -120
  70. package/src/components/playground/demos/KiaPBIRuntNode.tsx +0 -205
  71. package/src/components/playground/demos/KiaPartnerScoreNode.tsx +0 -206
  72. package/src/components/playground/demos/KiaPredictiveNode.tsx +0 -226
  73. package/src/components/playground/demos/KiaShowroomNode.tsx +0 -194
  74. package/src/components/playground/demos/KiaStoreNode.tsx +0 -215
  75. package/src/components/playground/demos/KiaSustainabilityNode.tsx +0 -173
  76. package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +0 -163
  77. package/src/components/playground/demos/KiaWorkshopNode.tsx +0 -221
  78. package/src/components/playground/demos/SmartCityNode.tsx +0 -205
  79. package/src/components/playground/demos/kia_campaign_manifest.json +0 -112
  80. package/src/components/playground/input-parts/AIModelSelector.tsx +0 -156
  81. package/src/components/playground/input-parts/InputActions.tsx +0 -80
  82. package/src/components/playground/input-parts/InputToolbar.tsx +0 -245
  83. package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +0 -287
  84. package/src/components/playground/sidebarDsdIO.ts +0 -82
  85. package/src/components/settings/SettingsPanel.tsx +0 -267
  86. package/src/components/shell/AppHeader.tsx +0 -9
  87. package/src/components/shell/AppShell.tsx +0 -139
  88. package/src/components/shell/ArtifactBar.tsx +0 -97
  89. package/src/components/shell/BootScreen.tsx +0 -19
  90. package/src/components/shell/CenterComposite.tsx +0 -87
  91. package/src/components/shell/CodeEditorPanel.tsx +0 -88
  92. package/src/components/shell/GlobalOverlays.tsx +0 -228
  93. package/src/components/shell/LayoutConfigurator.tsx +0 -209
  94. package/src/components/shell/LayoutGrid.tsx +0 -178
  95. package/src/components/shell/MorphShell.tsx +0 -368
  96. package/src/components/shell/PluginViewer.tsx +0 -147
  97. package/src/components/shell/ShellNexusPreview.tsx +0 -458
  98. package/src/components/shell/SlotRenderer.tsx +0 -115
  99. package/src/components/shell/TabBar.tsx +0 -94
  100. package/src/components/shell/TemplateLibrary.tsx +0 -195
  101. package/src/components/shell/layoutConstants.ts +0 -35
  102. package/src/components/shell/morphStageMeta.ts +0 -15
  103. package/src/components/shell/shells/BuiltInShells.tsx +0 -443
  104. package/src/components/shell/shells/DatawayChatShell.tsx +0 -42
  105. package/src/components/shell/shells/TokenPreview.tsx +0 -339
  106. package/src/components/shell/shells/bootShells.ts +0 -31
  107. package/src/components/shells/CreatorShell.tsx +0 -37
  108. package/src/components/shells/DecidoShell.tsx +0 -447
  109. package/src/components/shells/ExperimentalChatShell.tsx +0 -245
  110. package/src/components/shells/UserCanvas.tsx +0 -44
  111. package/src/components/studio/BlueprintManagerPanel.tsx +0 -137
  112. package/src/components/studio/DependencyTreePanel.tsx +0 -192
  113. package/src/components/studio/NodePalette.tsx +0 -92
  114. package/src/components/studio/NodePropertiesPanel.tsx +0 -81
  115. package/src/components/studio/ReactFlowEditor.tsx +0 -242
  116. package/src/components/studio/TimelineEditor.tsx +0 -122
  117. package/src/components/studio/TimelineKeyframeCard.tsx +0 -99
  118. package/src/components/studio/VariablePanel.tsx +0 -181
  119. package/src/components/studio/blueprint/BlueprintCard.tsx +0 -82
  120. package/src/components/studio/editor/CanvasContextMenu.tsx +0 -107
  121. package/src/components/studio/editor/EditorToolbar.tsx +0 -80
  122. package/src/components/studio/editor/StageContentRenderer.tsx +0 -134
  123. package/src/components/studio/editor/TrackPropertyEditors.tsx +0 -133
  124. package/src/components/studio/editor/TreeNodeItem.tsx +0 -91
  125. package/src/components/studio/editor/edgeStyles.ts +0 -43
  126. package/src/components/studio/editor/editorKeyHandler.ts +0 -95
  127. package/src/components/studio/editor/nodeTypeRegistry.ts +0 -137
  128. package/src/components/studio/editor/paletteCatalog.tsx +0 -84
  129. package/src/components/studio/nodes/shell/InteractionNodes.tsx +0 -82
  130. package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +0 -69
  131. package/src/components/studio/nodes/shell/RegisterActionNode.tsx +0 -20
  132. package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +0 -22
  133. package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +0 -19
  134. package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +0 -19
  135. package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +0 -22
  136. package/src/components/studio/nodes/shell/RegisterTabNode.tsx +0 -21
  137. package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +0 -22
  138. package/src/components/studio/nodes/shell/ShellConfigNode.tsx +0 -51
  139. package/src/components/studio/nodes/shell/ShellNodeBase.tsx +0 -100
  140. package/src/components/studio/nodes/shell/ThemeNodes.tsx +0 -51
  141. package/src/components/studio/nodes/shell/index.ts +0 -12
  142. package/src/components/widgets/BroadcastWidget.tsx +0 -93
  143. package/src/components/widgets/MarketplaceWidget.tsx +0 -298
  144. package/src/components/widgets/McpToolsWidget.tsx +0 -231
  145. package/src/components/widgets/OpsDashboard.tsx +0 -59
  146. package/src/components/widgets/QuickActionsWidget.tsx +0 -60
  147. package/src/components/widgets/UsageWidget.tsx +0 -112
  148. package/src/components/widgets/WidgetRenderer.tsx +0 -892
  149. package/src/components/widgets/WidgetSlotPanel.tsx +0 -213
  150. package/src/config/IconRegistry.ts +0 -126
  151. package/src/contexts/NetworkProvider.tsx +0 -162
  152. package/src/core/AIDirector.ts +0 -71
  153. package/src/core/EventBus.ts +0 -37
  154. package/src/core/PluginContext.tsx +0 -141
  155. package/src/hooks/listeners/useUIStateListener.ts +0 -59
  156. package/src/hooks/listeners/useWhatsAppListener.ts +0 -110
  157. package/src/hooks/morphBridge.ts +0 -82
  158. package/src/hooks/useAIModelSelector.ts +0 -144
  159. package/src/hooks/useAgentStream.ts +0 -220
  160. package/src/hooks/useAutoUpdater.ts +0 -89
  161. package/src/hooks/useBootSequence.ts +0 -20
  162. package/src/hooks/useExportDSD.ts +0 -53
  163. package/src/hooks/useFullscreen.ts +0 -35
  164. package/src/hooks/useGeminiStream.ts +0 -282
  165. package/src/hooks/useIntentLens.ts +0 -224
  166. package/src/hooks/useKeyboardShortcuts.ts +0 -69
  167. package/src/hooks/useLoggerBridge.ts +0 -32
  168. package/src/hooks/useMcpClient.ts +0 -112
  169. package/src/hooks/useNexusaiDeploy.ts +0 -118
  170. package/src/hooks/usePlaybackEngine.ts +0 -21
  171. package/src/hooks/usePlaygroundCommander.ts +0 -475
  172. package/src/hooks/usePluginEngine.ts +0 -165
  173. package/src/hooks/useScreenRecorder.ts +0 -73
  174. package/src/hooks/useShellKeyboard.ts +0 -40
  175. package/src/hooks/useShellShortcuts.ts +0 -118
  176. package/src/hooks/useSoundEffects.ts +0 -35
  177. package/src/hooks/useStudioConfig.ts +0 -72
  178. package/src/hooks/useSystemBoot.ts +0 -84
  179. package/src/hooks/useSystemTelemetry.ts +0 -62
  180. package/src/lib/debugLogger.ts +0 -80
  181. package/src/lib/networkInterceptor.ts +0 -100
  182. package/src/mocks/decido.tsx +0 -41
  183. package/src/plugins/pluginAPI.ts +0 -190
  184. package/src/store/McpStore.ts +0 -69
  185. package/src/store/UpdaterStore.ts +0 -60
  186. package/src/store/engine.ts +0 -392
  187. package/src/store/index.ts +0 -4
  188. package/src/store/layoutPresets.ts +0 -66
  189. package/src/store/playgroundTypes.ts +0 -98
  190. package/src/store/useActionTimelineStore.ts +0 -48
  191. package/src/store/useDebugPanelStore.ts +0 -98
  192. package/src/store/useDebugProfileStore.ts +0 -130
  193. package/src/store/useLayoutStore.ts +0 -205
  194. package/src/store/useMorphInstanceStore.ts +0 -289
  195. package/src/store/useMorphologyStore.ts +0 -103
  196. package/src/store/usePlaygroundStore.ts +0 -236
  197. package/src/store/useShellRegistry.ts +0 -123
  198. package/src/store/useSuggestionsStore.ts +0 -57
  199. package/src/store/useThemeStore.ts +0 -399
  200. package/src/store/useUIComponentStore.ts +0 -179
  201. package/src/types/DecidoStoryDefinition.ts +0 -43
  202. package/src/utils/ai/ai-architect.ts +0 -92
  203. package/src/utils/ai/ai-code.ts +0 -187
  204. package/src/utils/ai/ai-core.ts +0 -50
  205. package/src/utils/ai/ai-media.ts +0 -292
  206. package/src/utils/layoutGraph.ts +0 -67
  207. package/tsconfig.json +0 -17
  208. package/tsconfig.tsbuildinfo +0 -1
@@ -1,236 +0,0 @@
1
- import React from 'react';
2
- import { motion, AnimatePresence } from 'motion/react';
3
- import { Building2, BrainCircuit, Sparkles, Download } from 'lucide-react';
4
- import { SuggestionCards } from './SuggestionCards';
5
- import { LicenseTarget } from '../../mocks/decido';
6
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
7
- import { useMorphInstanceStore } from '../../store/useMorphInstanceStore';
8
- import { useLayoutStore } from '../../store/useLayoutStore';
9
- import { useTimelineStore } from '@decido/engine';
10
- import { PlaygroundFloatingInput } from './PlaygroundFloatingInput';
11
- import { ChatProvider, ChatMessageRow, ChatExportMenu } from '@decido/chat';
12
- import { handleSlashCommand } from '../chat-extensions/chatSlashCommands';
13
-
14
- export interface PlaygroundChatProps {
15
- step: 'chat' | 'profile' | 'action';
16
- selectedProfile: string | null;
17
- authAvailableLicenses: LicenseTarget[];
18
- handleProfileSelect: (license: LicenseTarget) => void;
19
- activeConfig: any;
20
- demoState: string;
21
- suggestions: any[];
22
- setInputValue: (val: string) => void;
23
- isGenerating?: boolean;
24
- config?: any;
25
- handleGeneratePlayground?: (val?: string) => void;
26
- isCreatorMode?: boolean;
27
- isVoiceActive?: boolean;
28
- setIsVoiceActive?: (active: boolean) => void;
29
- VoiceWidget?: React.ComponentType<any>;
30
- dynamicPersona?: any;
31
- setSuggestions?: (sugs: any) => void;
32
- selectedVoice?: string;
33
- showCanvas?: boolean;
34
- setShowCanvas?: (show: boolean) => void;
35
- }
36
-
37
- export const PlaygroundChat = React.memo(function PlaygroundChat({
38
- step, selectedProfile, authAvailableLicenses, handleProfileSelect,
39
- activeConfig, demoState, suggestions, setInputValue, isGenerating, config,
40
- handleGeneratePlayground, isCreatorMode = true,
41
- isVoiceActive = false, setIsVoiceActive, VoiceWidget, dynamicPersona,
42
- setSuggestions: setSuggestionsFromParent, selectedVoice, showCanvas, setShowCanvas
43
- }: PlaygroundChatProps) {
44
- const activeChatId = usePlaygroundStore(state => state.activeChatId);
45
- const chatMessages = usePlaygroundStore(state => state.chatMessagesByInstance[state.activeChatId || '_default'] || []);
46
- const addChatMessage = usePlaygroundStore(state => state.addChatMessage);
47
- const prototypeBrand = usePlaygroundStore(state => state.prototypeBrand);
48
- const setPrototypeBrand = usePlaygroundStore(state => state.setPrototypeBrand);
49
-
50
- // Auto-Scroll
51
- const scrollRef = React.useRef<HTMLDivElement>(null);
52
- const [isAtBottom, setIsAtBottom] = React.useState(true);
53
- const [showExportMenu, setShowExportMenu] = React.useState(false);
54
- const isAtBottomRef = React.useRef(true);
55
-
56
- const handleScroll = () => {
57
- if (!scrollRef.current) return;
58
- const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
59
- const atBottom = scrollHeight - scrollTop - clientHeight < 100;
60
- setIsAtBottom(atBottom);
61
- isAtBottomRef.current = atBottom;
62
- };
63
-
64
- // Auto-scroll — trigger on new messages AND on upserts (text length changes)
65
- const lastMsg = chatMessages[chatMessages.length - 1];
66
- const scrollKey = `${chatMessages.length}-${lastMsg?.text?.length || 0}`;
67
-
68
- React.useEffect(() => {
69
- if (isAtBottomRef.current && scrollRef.current) {
70
- scrollRef.current.scrollTo({ top: scrollRef.current.scrollHeight, behavior: 'smooth' });
71
- }
72
- }, [scrollKey]);
73
-
74
- const runStressTest = () => {
75
- let count = 0;
76
- const interval = setInterval(() => {
77
- if (count > 200) { clearInterval(interval); return; }
78
- addChatMessage({ type: count % 3 === 0 ? 'alert' : count % 5 === 0 ? 'card' : 'text', sender: count % 2 === 0 ? 'agent' : 'system', text: `Stresstesting message ${count} para medir rendimiento en el sistema.` });
79
- count++;
80
- }, 10);
81
- };
82
-
83
- const handleThemeSwitch = () => {
84
- const brands = activeConfig && typeof activeConfig === 'object' && config?.environments ? Object.keys(config.environments) : ['brand-a', 'brand-b', 'brand-c'];
85
- const nextIndex = (brands.indexOf(prototypeBrand) + 1) % brands.length;
86
- setPrototypeBrand(brands[nextIndex]);
87
- };
88
-
89
- const chatContextValue = React.useMemo(() => ({
90
- activeConfig,
91
- onMorphInstanceSelect: (instanceId: string) => {
92
- useMorphInstanceStore.getState().setActiveInstance(instanceId);
93
- useLayoutStore.getState().setActiveTab(`morph-${instanceId}`);
94
- if (setShowCanvas) setShowCanvas(true);
95
- },
96
- extensions: {
97
- getPreviewHTML: () => useMorphInstanceStore.getState().getActiveInstance?.()?.data?.html || null,
98
- onSendMessage: (text: string) => addChatMessage({ type: 'text', sender: 'user', text }),
99
- renderMessageActions: (msgId: string) => null
100
- }
101
- }), [activeConfig, setShowCanvas, addChatMessage]);
102
-
103
- return (
104
- <AnimatePresence mode="wait">
105
- {step === 'action' ? (
106
- <motion.div key="action-step" initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} className="flex flex-col items-center justify-center h-full text-center">
107
- <div className="w-24 h-24 mx-auto rounded-full border-[3px] border-cyan-500/30 border-t-cyan-400 animate-spin mb-8 shadow-[0_0_30px_rgba(34,211,238,0.2)]"></div>
108
- <h2 className="text-3xl font-bold text-text-primary mb-4">Reestructurando el OS...</h2>
109
- <p className="text-cyan-400 font-mono text-sm tracking-widest uppercase bg-cyan-500/10 py-2 px-6 rounded-full inline-block border border-cyan-500/20">Cargando módulos para: {selectedProfile}</p>
110
- </motion.div>
111
- ) : step === 'profile' ? (
112
- <motion.div key="profile-step" initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} className="flex flex-col items-center justify-center h-full w-full max-w-4xl mx-auto pb-20">
113
- <h2 className="text-2xl md:text-3xl font-bold text-text-primary text-center mb-8">Selecciona tu Perfil</h2>
114
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full">
115
- {authAvailableLicenses.map((license: LicenseTarget) => (
116
- <button key={license.id} onClick={() => handleProfileSelect(license)} className={`group relative p-6 rounded-3xl bg-surface-tertiary border border-border-subtle transition-all text-left overflow-hidden ${license.type === 'enterprise' ? 'hover:border-emerald-500/50' : 'hover:border-cyan-500/50'}`}>
117
- <div className="flex items-center gap-4 mb-4">
118
- <div className={`w-12 h-12 rounded-full flex items-center justify-center shadow-inner ${license.type === 'enterprise' ? 'bg-emerald-500/10 text-emerald-400' : 'bg-cyan-500/10 text-cyan-400'}`}>
119
- {license.type === 'enterprise' ? <Building2 size={24} /> : <BrainCircuit size={24} />}
120
- </div>
121
- <h3 className="text-xl font-bold text-text-primary">{license.name}</h3>
122
- </div>
123
- </button>
124
- ))}
125
- </div>
126
- </motion.div>
127
- ) : (
128
- <motion.div key="chat-greeting" initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0 }} className="flex flex-col h-full overflow-hidden w-full max-w-full lg:max-w-4xl mx-auto pb-4 px-3 sm:px-6 md:px-8 lg:px-4 min-w-0 min-h-0 box-border">
129
- <div ref={scrollRef} onScroll={handleScroll} className={`flex-1 overflow-y-auto overflow-x-hidden custom-scrollbar scroll-smooth flex flex-col gap-6 md:gap-8 min-w-0 min-h-0 ${!isCreatorMode ? 'justify-end pb-6' : 'pb-48 md:pb-64'}`}>
130
- {/* Greeting */}
131
- <div className="flex flex-col gap-3 md:gap-4 transition-all mt-4 sm:mt-6 md:mt-8">
132
- <h1 className="text-2xl sm:text-3xl md:text-5xl font-semibold leading-tight text-text-primary/50">
133
- <span className={`bg-linear-to-r ${activeConfig.gradient} text-transparent bg-clip-text transition-all duration-700`}>{activeConfig.greetingText}</span><br />
134
- {activeConfig.greetingPrompt || "¿En qué puedo ayudarte hoy?"}
135
- </h1>
136
- <div className="flex items-center gap-4 flex-wrap mt-2">
137
- <p className="text-sm text-text-muted font-mono transition-all duration-700">{activeConfig.subtitle}</p>
138
- <div className="hidden md:flex gap-2 items-center">
139
- <button onClick={handleThemeSwitch} className="text-[10px] text-text-secondary hover:text-text-primary uppercase tracking-wider transition-colors bg-surface-glass hover:bg-surface-glass px-3 py-1.5 rounded-full border border-border-default flex items-center gap-2">
140
- <span className={`w-2 h-2 rounded-full ${prototypeBrand === 'brand-b' ? 'bg-emerald-400' : prototypeBrand === 'brand-c' ? 'bg-purple-400' : 'bg-cyan-400'}`}></span>
141
- Tema: {prototypeBrand}
142
- </button>
143
- <button onClick={runStressTest} className="text-[10px] text-text-secondary hover:text-orange-400 uppercase tracking-wider transition-colors bg-orange-500/5 hover:bg-orange-500/10 px-3 py-1.5 rounded-full border border-orange-500/20 border-dashed flex items-center gap-2">
144
- <span className="text-orange-500 font-bold">⚠</span> Estrés (200 msgs)
145
- </button>
146
- <div className="relative">
147
- <button onClick={() => setShowExportMenu(!showExportMenu)} className="text-[10px] text-text-secondary hover:text-cyan-400 uppercase tracking-wider transition-colors bg-surface-glass hover:bg-surface-glass px-3 py-1.5 rounded-full border border-border-default flex items-center gap-2">
148
- <Download size={10} /> Export
149
- </button>
150
- <ChatExportMenu isOpen={showExportMenu} onClose={() => setShowExportMenu(false)} />
151
- </div>
152
- </div>
153
- </div>
154
- </div>
155
-
156
- {/* Messages wrapped in Provider */}
157
- <ChatProvider value={chatContextValue}>
158
- {(chatMessages.length > 0 || isGenerating) && (
159
- <div className="flex flex-col gap-6 mt-6 max-w-full md:max-w-3xl min-w-0">
160
- {chatMessages.map(msg => <ChatMessageRow key={msg.id} msg={msg} />)}
161
- <AnimatePresence>
162
- {isGenerating && (
163
- <motion.div initial={{ opacity: 0, y: 10, scale: 0.95 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, scale: 0.95 }} className="flex gap-4">
164
- <div className="w-10 h-10 rounded-full flex items-center justify-center shadow-lg border shrink-0 bg-transparent border-border-strong text-text-primary">
165
- <Sparkles size={18} className="text-text-muted animate-pulse" />
166
- </div>
167
- <div className="flex-1 space-y-2 flex flex-col items-start justify-center">
168
- <div className="bg-surface-tertiary border border-border-subtle rounded-2xl p-4 shadow-xl inline-flex gap-1.5 items-center justify-center">
169
- <div className="w-1.5 h-1.5 rounded-full bg-surface-elevated animate-bounce" style={{ animationDelay: '0ms' }}></div>
170
- <div className="w-1.5 h-1.5 rounded-full bg-surface-elevated animate-bounce" style={{ animationDelay: '150ms' }}></div>
171
- <div className="w-1.5 h-1.5 rounded-full bg-surface-elevated animate-bounce" style={{ animationDelay: '300ms' }}></div>
172
- </div>
173
- </div>
174
- </motion.div>
175
- )}
176
- </AnimatePresence>
177
- </div>
178
- )}
179
- </ChatProvider>
180
-
181
- {!chatMessages.length && demoState !== 'idle' && (
182
- <div className="flex flex-col gap-6 mt-6 max-w-full md:max-w-3xl opacity-50 min-w-0">
183
- <p className="text-sm text-text-muted italic">Ejecutando secuencia en el simulador sin salida de chat...</p>
184
- </div>
185
- )}
186
-
187
- {/* Suggestions */}
188
- {!chatMessages.length && demoState === 'idle' && (
189
- <SuggestionCards suggestions={suggestions} onSelect={setInputValue} />
190
- )}
191
- </div>
192
-
193
- {/* Scroll-to-bottom button */}
194
- {!isAtBottom && chatMessages.length > 5 && (
195
- <motion.button
196
- initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: 10 }}
197
- onClick={() => scrollRef.current?.scrollTo({ top: scrollRef.current.scrollHeight, behavior: 'smooth' })}
198
- className={`absolute ${!isCreatorMode ? 'bottom-20' : 'bottom-[100px]'} left-1/2 transform -translate-x-1/2 bg-cyan-500 text-text-primary rounded-full px-4 py-2 text-xs font-bold shadow-[0_0_15px_rgba(34,211,238,0.5)] border border-cyan-400 flex items-center gap-2 z-50 hover:bg-cyan-400`}
199
- >
200
- ⬇ Nuevos Mensajes
201
- </motion.button>
202
- )}
203
-
204
- {/* Player Mode Floating Input */}
205
- {!isCreatorMode && (
206
- <div className="shrink-0 w-full max-w-full lg:max-w-3xl mx-auto pb-2">
207
- <PlaygroundFloatingInput
208
- isGenerating={isGenerating}
209
- onSend={(val) => {
210
- if (handleSlashCommand(val, { prototypeBrand, setPrototypeBrand, addChatMessage })) return;
211
- setInputValue(val);
212
- if (handleGeneratePlayground) {
213
- handleGeneratePlayground(val);
214
- } else if ((window as any).__DECIDO__?.geminiStream) {
215
- // Fallback: stream via Gemini directly
216
- (window as any).__DECIDO__.geminiStream(val);
217
- }
218
- }}
219
- isVoiceActive={isVoiceActive}
220
- setIsVoiceActive={setIsVoiceActive}
221
- VoiceWidget={VoiceWidget}
222
- dynamicPersona={dynamicPersona}
223
- setSuggestions={setSuggestionsFromParent}
224
- selectedVoice={selectedVoice}
225
- showCanvas={showCanvas}
226
- setShowCanvas={setShowCanvas}
227
- prototypeBrand={prototypeBrand}
228
- setPrototypeBrand={setPrototypeBrand}
229
- />
230
- </div>
231
- )}
232
- </motion.div>
233
- )}
234
- </AnimatePresence>
235
- );
236
- });
@@ -1,63 +0,0 @@
1
- import React, { Component, ErrorInfo, ReactNode } from 'react';
2
- import { AlertTriangle, RefreshCw } from 'lucide-react';
3
-
4
- interface Props {
5
- children: ReactNode;
6
- fallbackName?: string;
7
- }
8
-
9
- interface State {
10
- hasError: boolean;
11
- error: Error | null;
12
- }
13
-
14
- export class PlaygroundErrorBoundary extends Component<Props, State> {
15
- public state: State = {
16
- hasError: false,
17
- error: null
18
- };
19
-
20
- public static getDerivedStateFromError(error: Error): State {
21
- return { hasError: true, error };
22
- }
23
-
24
- public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
25
- // @ts-ignore
26
- console.error(`[PlaygroundErrorBoundary] Error capturado en ${this.props.fallbackName || 'componente'}:`, error, errorInfo);
27
- }
28
-
29
- private handleReset = () => {
30
- // @ts-ignore
31
- this.setState({ hasError: false, error: null });
32
- };
33
-
34
- public render() {
35
- // @ts-ignore
36
- if (this.state.hasError) {
37
- return (
38
- <div className="flex flex-col items-center justify-center w-full h-full min-h-[150px] bg-red-500/10 border border-red-500/20 rounded-xl p-4 text-center backdrop-blur-xs">
39
- <AlertTriangle className="text-red-400 mb-3" size={32} />
40
- <h3 className="text-red-400 font-bold mb-1">
41
- {/* @ts-ignore */}
42
- Fallo en {this.props.fallbackName || 'Módulo'}
43
- </h3>
44
- {/* @ts-ignore */}
45
- <p className="text-xs text-red-300/80 mb-4 max-w-xs truncate" title={this.state.error?.message}>
46
- {/* @ts-ignore */}
47
- {this.state.error?.message || 'Excepción desconocida en el renderizado.'}
48
- </p>
49
- <button
50
- onClick={this.handleReset}
51
- className="flex items-center gap-2 px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded-lg text-xs transition-colors border border-red-500/20"
52
- >
53
- <RefreshCw size={12} />
54
- Reiniciar Módulo
55
- </button>
56
- </div>
57
- );
58
- }
59
-
60
- // @ts-ignore
61
- return this.props.children;
62
- }
63
- }
@@ -1,352 +0,0 @@
1
- import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
2
- import { motion, AnimatePresence } from 'motion/react';
3
- import { Camera, Paperclip, FolderOpen } from 'lucide-react';
4
- import { useTimelineStore } from '@decido/engine';
5
- import { useUIComponentStore } from '../../store/useUIComponentStore';
6
- import { usePlaygroundStore } from '../../store/usePlaygroundStore';
7
- import { getRegisteredShellTypes, getShellMeta } from '../../store/useShellRegistry';
8
- import { SlashCommandMenu, VoiceLiveMode } from '@decido/chat';
9
- import { useIntentLens } from '../../hooks/useIntentLens';
10
- import { useAIModelSelector } from '../../hooks/useAIModelSelector';
11
- import { IntentCatalogPanel } from '../chat-extensions/IntentCatalogPanel';
12
- import { useSuggestionsStore } from '../../store/useSuggestionsStore';
13
- import { useMorphInstanceStore } from '../../store/useMorphInstanceStore';
14
- import { InputToolbar } from './input-parts/InputToolbar';
15
- import { InputActions } from './input-parts/InputActions';
16
- import { ResourceLibraryPanel } from './input-parts/ResourceLibraryPanel';
17
-
18
- // ─── Slash commands ─────────────────────────────────────────
19
-
20
- interface SlashCommand {
21
- command: string;
22
- label: string;
23
- description: string;
24
- icon: React.ReactNode;
25
- subCommands?: { id: string; label: string; description?: string }[];
26
- }
27
-
28
- // ─── Props ──────────────────────────────────────────────────
29
-
30
- export interface PlaygroundFloatingInputProps {
31
- onSend: (value: string) => void;
32
- isGenerating?: boolean;
33
- isVoiceActive?: boolean;
34
- setIsVoiceActive?: (active: boolean) => void;
35
- VoiceWidget?: React.ComponentType<any>;
36
- dynamicPersona?: any;
37
- setSuggestions?: (sugs: any) => void;
38
- selectedVoice?: string;
39
- showCanvas?: boolean;
40
- setShowCanvas?: (show: boolean) => void;
41
- prototypeBrand?: string;
42
- setPrototypeBrand?: (brand: string) => void;
43
- }
44
-
45
- // ─── Component ──────────────────────────────────────────────
46
-
47
- export const PlaygroundFloatingInput = ({
48
- onSend, isGenerating,
49
- isVoiceActive = false, setIsVoiceActive, VoiceWidget,
50
- dynamicPersona, setSuggestions, selectedVoice,
51
- showCanvas, setShowCanvas,
52
- prototypeBrand = 'decido', setPrototypeBrand,
53
- }: PlaygroundFloatingInputProps) => {
54
- const [inputValue, setInputValue] = useState('');
55
- const [isTranscribing, setIsTranscribing] = useState(false);
56
- const [slashMenuOpen, setSlashMenuOpen] = useState(false);
57
- const [slashMenuIndex, setSlashMenuIndex] = useState(0);
58
- const [showIntentPanel, setShowIntentPanel] = useState(false);
59
- const [showLibrary, setShowLibrary] = useState(false);
60
- const [intentEnabled, setIntentEnabled] = useState(true);
61
- const [selectedShell, setSelectedShell] = useState<string | null>(
62
- () => localStorage.getItem('decido_selected_shell')
63
- );
64
- const inputRef = useRef<HTMLTextAreaElement>(null);
65
-
66
- // ── AI Model Selector (dynamic, multi-provider) ──
67
- const { selectedModelId, selectedModel, providerGroups, selectModel } = useAIModelSelector();
68
-
69
- // Sync intentEnabled to window.__DECIDO__
70
- useEffect(() => {
71
- if (typeof window !== 'undefined' && (window as any).__DECIDO__) {
72
- (window as any).__DECIDO__.intentEnabled = intentEnabled;
73
- }
74
- }, [intentEnabled]);
75
-
76
- // Sync model to ChatInstance
77
- const activeChatId = usePlaygroundStore(s => s.activeChatId);
78
- useEffect(() => {
79
- if (!activeChatId) return;
80
- usePlaygroundStore.setState(s => ({
81
- chatInstances: s.chatInstances.map(c =>
82
- c.id === activeChatId ? { ...c, model: selectedModelId } : c
83
- ),
84
- }));
85
- }, [selectedModelId, activeChatId]);
86
-
87
- // Sync shell to ChatInstance + MorphInstance
88
- useEffect(() => {
89
- if (selectedShell) localStorage.setItem('decido_selected_shell', selectedShell);
90
- else localStorage.removeItem('decido_selected_shell');
91
- if (typeof window !== 'undefined' && (window as any).__DECIDO__) {
92
- (window as any).__DECIDO__.selectedShell = selectedShell;
93
- }
94
- if (!activeChatId) return;
95
- usePlaygroundStore.setState(s => ({
96
- chatInstances: s.chatInstances.map(c =>
97
- c.id === activeChatId ? { ...c, shellType: selectedShell || undefined } : c
98
- ),
99
- }));
100
- if (selectedShell) {
101
- const meta = getShellMeta(selectedShell);
102
- useMorphInstanceStore.getState().upsertInstance({
103
- id: activeChatId,
104
- sourceChatId: activeChatId,
105
- shellType: selectedShell,
106
- label: meta.label || selectedShell,
107
- data: {},
108
- });
109
- } else {
110
- useMorphInstanceStore.getState().removeInstance(activeChatId);
111
- }
112
- }, [selectedShell, activeChatId]);
113
-
114
- // Sync from ChatInstance → local selectors on switch
115
- const activeInstance = usePlaygroundStore(s => s.chatInstances.find(c => c.id === s.activeChatId));
116
- useEffect(() => {
117
- if (!activeInstance) return;
118
- if (activeInstance.model && activeInstance.model !== selectedModelId) {
119
- selectModel(activeInstance.model);
120
- }
121
- const instanceShell = activeInstance.shellType || null;
122
- if (instanceShell !== selectedShell) {
123
- setSelectedShell(instanceShell);
124
- }
125
- }, [activeChatId]);
126
-
127
- // Intent Lens — real-time detection
128
- const { primaryIntent } = useIntentLens(intentEnabled ? inputValue : '');
129
-
130
- // Rotating placeholder
131
- const seeds = useSuggestionsStore(s => s.seeds);
132
- const generated = useSuggestionsStore(s => s.generated);
133
- const pluginSuggestions = useSuggestionsStore(s => s.pluginSuggestions);
134
- const allSuggestions = useMemo(() => {
135
- const plugin = Object.values(pluginSuggestions).flat();
136
- return [...generated, ...seeds, ...plugin];
137
- }, [generated, seeds, pluginSuggestions]);
138
- const [placeholderIndex, setPlaceholderIndex] = useState(0);
139
- useEffect(() => {
140
- if (allSuggestions.length <= 1) return;
141
- const timer = setInterval(() => setPlaceholderIndex(i => (i + 1) % allSuggestions.length), 4000);
142
- return () => clearInterval(timer);
143
- }, [allSuggestions.length]);
144
- const rotatingPlaceholder = allSuggestions.length > 0
145
- ? allSuggestions[placeholderIndex % allSuggestions.length]
146
- : 'Escribe / para comandos... (Shift+Enter nueva línea)';
147
-
148
- // Auto-resize textarea
149
- useEffect(() => {
150
- const ta = inputRef.current;
151
- if (ta) { ta.style.height = 'auto'; ta.style.height = `${Math.min(ta.scrollHeight, 200)}px`; }
152
- }, [inputValue]);
153
-
154
- // ── Slash Commands ──
155
- const timelines = useTimelineStore(s => s.timelines);
156
- const blueprintLibrary = useTimelineStore(s => s.blueprintLibrary);
157
- const uiComponents = useUIComponentStore(s => s.components);
158
-
159
- const slashCommands = useMemo<SlashCommand[]>(() => {
160
- const flowList = Object.keys(timelines).map(id => ({ id, label: id, description: timelines[id]?.name || id }));
161
- const bpList = Object.entries(blueprintLibrary).map(([id, bp]) => ({ id, label: bp.name || id, description: `v${bp.metadata?.version || '?'} · ${bp.metadata?.tags?.join(', ') || ''}` }));
162
- const uiList = Object.values(uiComponents).map(c => ({ id: c.id, label: c.name, description: c.category }));
163
- return [
164
- { command: '/run', label: 'Run Flow', description: 'Ejecutar un flujo', icon: '▶', subCommands: flowList },
165
- { command: '/flows', label: 'List Flows', description: 'Ver todos los flujos', icon: '📋' },
166
- { command: '/blueprints', label: 'Blueprints', description: 'Subflujos disponibles', icon: '🔗', subCommands: bpList },
167
- { command: '/ui', label: 'UI Components', description: 'Biblioteca de componentes', icon: '🎨', subCommands: uiList },
168
- { command: '/reset', label: 'Reset Engine', description: 'Reiniciar el motor', icon: '🔄' },
169
- { command: '/tts', label: 'Voice Synthesis', description: 'Generar audio TTS con Kokoro', icon: '🎙️' },
170
- ];
171
- }, [timelines, blueprintLibrary, uiComponents]);
172
-
173
- const filteredCommands = useMemo(() => {
174
- if (!inputValue.startsWith('/')) return [];
175
- const parts = inputValue.split(' ');
176
- const cmd = parts[0].toLowerCase();
177
- const arg = parts.slice(1).join(' ').toLowerCase();
178
- const matched = slashCommands.find(c => c.command === cmd);
179
- if (matched?.subCommands) {
180
- return matched.subCommands
181
- .filter(sc => !arg || sc.id.toLowerCase().includes(arg) || sc.label.toLowerCase().includes(arg))
182
- .map(sc => ({ ...sc, type: 'sub', parentCommand: cmd }));
183
- }
184
- return slashCommands
185
- .filter(c => c.command.startsWith(cmd))
186
- .map(c => ({ id: c.command, label: c.label, description: c.description, icon: c.icon, type: 'command', subCommands: c.subCommands }));
187
- }, [inputValue, slashCommands]);
188
-
189
- useEffect(() => {
190
- setSlashMenuOpen(inputValue.startsWith('/') && filteredCommands.length > 0);
191
- setSlashMenuIndex(0);
192
- }, [inputValue, filteredCommands.length]);
193
-
194
- const handleSlashSelect = (item: any) => {
195
- if (item.type === 'command') {
196
- if (item.subCommands) { setInputValue(item.id + ' '); inputRef.current?.focus(); }
197
- else { onSend(item.id); setInputValue(''); setSlashMenuOpen(false); }
198
- } else if (item.type === 'sub') {
199
- onSend(`${item.parentCommand} ${item.id}`);
200
- setInputValue('');
201
- setSlashMenuOpen(false);
202
- }
203
- };
204
-
205
- // ── Key handling ──
206
- const handleKeyDown = (e: React.KeyboardEvent) => {
207
- if (slashMenuOpen) {
208
- if (e.key === 'ArrowDown') { e.preventDefault(); setSlashMenuIndex(i => Math.min(i + 1, filteredCommands.length - 1)); }
209
- else if (e.key === 'ArrowUp') { e.preventDefault(); setSlashMenuIndex(i => Math.max(i - 1, 0)); }
210
- else if (e.key === 'Enter' && filteredCommands[slashMenuIndex]) { e.preventDefault(); handleSlashSelect(filteredCommands[slashMenuIndex]); }
211
- else if (e.key === 'Escape') setSlashMenuOpen(false);
212
- return;
213
- }
214
- if (e.key === 'Enter' && !e.shiftKey) {
215
- e.preventDefault();
216
- if (inputValue.trim() && !isGenerating) { onSend(inputValue.trim()); setInputValue(''); }
217
- }
218
- };
219
-
220
- const handleSubmit = (e: React.FormEvent) => {
221
- e.preventDefault();
222
- if (inputValue.trim() && !isGenerating) { onSend(inputValue.trim()); setInputValue(''); }
223
- };
224
-
225
- const handleSendClick = useCallback(() => {
226
- if (inputValue.trim() && !isGenerating) { onSend(inputValue.trim()); setInputValue(''); }
227
- }, [inputValue, isGenerating, onSend]);
228
-
229
- // ─── Render ───────────────────────────────────────────────
230
-
231
- return (
232
- <motion.div layout className={`w-full relative ${isVoiceActive ? 'h-64' : ''}`}>
233
- <SlashCommandMenu isOpen={slashMenuOpen} items={filteredCommands} activeIndex={slashMenuIndex} onSelect={handleSlashSelect} onHover={setSlashMenuIndex} />
234
-
235
- {/* Intent Catalog Panel */}
236
- <AnimatePresence>
237
- {showIntentPanel && (
238
- <motion.div initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: 10 }} className="absolute bottom-full left-0 right-0 mb-2 z-50">
239
- <IntentCatalogPanel onSelect={(text) => { setInputValue(text); setShowIntentPanel(false); inputRef.current?.focus(); }} />
240
- </motion.div>
241
- )}
242
- </AnimatePresence>
243
-
244
- {/* Resource Library Panel */}
245
- <ResourceLibraryPanel
246
- isOpen={showLibrary}
247
- onClose={() => setShowLibrary(false)}
248
- onLoadTemplate={(html) => {
249
- // Send the template HTML as a message to trigger the preview
250
- onSend(`/template ${html.slice(0, 100)}`);
251
- }}
252
- onOpenInstance={(id) => {
253
- useMorphInstanceStore.getState().setActiveInstance(id);
254
- if (setShowCanvas) setShowCanvas(true);
255
- }}
256
- />
257
-
258
- <div className={`bg-white/80 dark:bg-surface-tertiary border border-black/[0.08] dark:border-border-default rounded-4xl flex flex-col p-2 shadow-sm dark:shadow-2xl transition-all duration-300
259
- ${isVoiceActive ? 'h-full border-cyan-500/30' : 'focus-within:border-black/[0.12] dark:focus-within:border-border-strong focus-within:shadow-md dark:focus-within:shadow-lg'}`}>
260
- <AnimatePresence mode="wait">
261
- {!isVoiceActive ? (
262
- <motion.div
263
- key="text-mode"
264
- initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }}
265
- className="flex flex-col w-full h-full cursor-text"
266
- onClick={e => { const ta = e.currentTarget.querySelector('textarea'); if (ta && e.target === e.currentTarget) ta.focus(); }}
267
- >
268
- {/* Textarea */}
269
- <form onSubmit={handleSubmit} className="relative flex items-center px-3 sm:px-4 py-2 sm:py-3 min-h-[48px] sm:min-h-[60px]">
270
- <textarea
271
- ref={inputRef}
272
- placeholder={isTranscribing ? 'Escuchando...' : rotatingPlaceholder}
273
- value={inputValue}
274
- onChange={e => setInputValue(e.target.value)}
275
- onKeyDown={handleKeyDown}
276
- rows={1}
277
- className="w-full bg-transparent text-text-primary placeholder-text-muted outline-hidden text-sm sm:text-[15px] leading-relaxed resize-none"
278
- disabled={isGenerating}
279
- style={{ maxHeight: '200px' }}
280
- />
281
- {/* Intent badge */}
282
- {primaryIntent && !slashMenuOpen && (
283
- <div
284
- className="absolute right-4 top-1/2 -translate-y-1/2 flex items-center gap-1 px-2 py-1 rounded-full text-[10px] font-semibold border"
285
- style={{ background: `${primaryIntent.color}15`, borderColor: `${primaryIntent.color}30`, color: primaryIntent.color }}
286
- >
287
- <span>{primaryIntent.icon}</span>
288
- <span>{primaryIntent.label}</span>
289
- </div>
290
- )}
291
- </form>
292
-
293
- {/* Bottom bar: attach + toolbar + actions */}
294
- <div className="flex flex-wrap items-center justify-between px-2 pb-1 relative z-10 w-full gap-y-2">
295
- {/* Left: library + attachment */}
296
- <div className="flex items-center gap-1 shrink-0">
297
- <button
298
- type="button"
299
- onClick={() => { setShowLibrary(!showLibrary); setShowIntentPanel(false); }}
300
- className={`w-10 h-10 rounded-full flex items-center justify-center transition-colors
301
- ${showLibrary ? 'text-cyan-400 bg-cyan-500/10' : 'text-text-secondary hover:text-text-primary hover:bg-surface-glass'}`}
302
- title="Librería de recursos"
303
- >
304
- <FolderOpen size={20} />
305
- </button>
306
- <button type="button" className="w-10 h-10 rounded-full text-text-secondary hover:text-text-primary hover:bg-surface-glass flex items-center justify-center transition-colors" title="Adjuntar">
307
- <Paperclip size={20} />
308
- </button>
309
- </div>
310
-
311
- {/* Center: toolbar */}
312
- <InputToolbar
313
- selectedModelId={selectedModelId}
314
- selectedModel={selectedModel}
315
- providerGroups={providerGroups}
316
- onModelSelect={selectModel}
317
- selectedShell={selectedShell}
318
- onShellSelect={setSelectedShell}
319
- showCanvas={showCanvas}
320
- setShowCanvas={setShowCanvas}
321
- prototypeBrand={prototypeBrand}
322
- setPrototypeBrand={setPrototypeBrand}
323
- intentEnabled={intentEnabled}
324
- onIntentToggle={() => setIntentEnabled(!intentEnabled)}
325
- showIntentPanel={showIntentPanel}
326
- onIntentPanelToggle={() => setShowIntentPanel(!showIntentPanel)}
327
- />
328
-
329
- {/* Right: actions */}
330
- <InputActions
331
- inputHasText={!!inputValue.trim()}
332
- isGenerating={isGenerating}
333
- isTranscribing={isTranscribing}
334
- onToggleTranscribing={() => setIsTranscribing(!isTranscribing)}
335
- onSend={handleSendClick}
336
- setIsVoiceActive={setIsVoiceActive}
337
- />
338
- </div>
339
- </motion.div>
340
- ) : (
341
- <VoiceLiveMode VoiceWidget={VoiceWidget} dynamicPersona={dynamicPersona} setSuggestions={setSuggestions} selectedVoice={selectedVoice} onClose={() => setIsVoiceActive?.(false)} />
342
- )}
343
- </AnimatePresence>
344
- </div>
345
- <div className="text-center mt-3">
346
- <p className="text-[10px] md:text-[11px] text-text-muted font-medium tracking-wide">
347
- Decido puede equivocarse. Considera revisar la información importante.
348
- </p>
349
- </div>
350
- </motion.div>
351
- );
352
- };