@decido/shell 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/.turbo/turbo-build.log +13 -0
  2. package/package.json +65 -0
  3. package/src/AgentPlayer.tsx +105 -0
  4. package/src/DecidoPlayer.tsx +117 -0
  5. package/src/bridge/BridgeAgent.ts +443 -0
  6. package/src/components/DecidoIcon.tsx +56 -0
  7. package/src/components/JsonTreeEditor.tsx +117 -0
  8. package/src/components/PanelSplitter.tsx +71 -0
  9. package/src/components/PluginErrorBoundary.tsx +69 -0
  10. package/src/components/SafeLiquidUI.tsx +114 -0
  11. package/src/components/TransientLayer.tsx +92 -0
  12. package/src/components/agent/AgentChat.tsx +134 -0
  13. package/src/components/chat-extensions/IntentCatalogPanel.tsx +81 -0
  14. package/src/components/chat-extensions/chatSlashCommands.ts +101 -0
  15. package/src/components/controls/CreatorInputBar.tsx +144 -0
  16. package/src/components/controls/OSToolbar.tsx +90 -0
  17. package/src/components/controls/TimelineTape.tsx +43 -0
  18. package/src/components/debug/ActionTimelineTab.tsx +111 -0
  19. package/src/components/debug/CSSInspectorTab.tsx +436 -0
  20. package/src/components/debug/ExportTab.tsx +192 -0
  21. package/src/components/debug/FlowHealthTab.tsx +86 -0
  22. package/src/components/debug/LogsTab.tsx +110 -0
  23. package/src/components/debug/MorphStackTab.tsx +241 -0
  24. package/src/components/debug/NetworkTab.tsx +173 -0
  25. package/src/components/debug/PerformanceTab.tsx +171 -0
  26. package/src/components/debug/ProfilesTab.tsx +238 -0
  27. package/src/components/debug/ReplayTab.tsx +70 -0
  28. package/src/components/debug/StoresTab.tsx +255 -0
  29. package/src/components/debug/TopologyTab.tsx +59 -0
  30. package/src/components/debug/debugConfig.tsx +66 -0
  31. package/src/components/playground/DebugPanel.tsx +112 -0
  32. package/src/components/playground/HeaderCenterControls.tsx +92 -0
  33. package/src/components/playground/KeyframeListItem.tsx +70 -0
  34. package/src/components/playground/PlaygroundAppSidebar.tsx +171 -0
  35. package/src/components/playground/PlaygroundBottomControls.tsx +132 -0
  36. package/src/components/playground/PlaygroundCanvas.tsx +87 -0
  37. package/src/components/playground/PlaygroundChat.tsx +236 -0
  38. package/src/components/playground/PlaygroundErrorBoundary.tsx +63 -0
  39. package/src/components/playground/PlaygroundFloatingInput.tsx +352 -0
  40. package/src/components/playground/PlaygroundHeader.tsx +222 -0
  41. package/src/components/playground/PlaygroundSidebar.tsx +136 -0
  42. package/src/components/playground/PlaygroundTerminal.tsx +44 -0
  43. package/src/components/playground/SuggestionCards.tsx +29 -0
  44. package/src/components/playground/demos/ClinicaAINode.tsx +221 -0
  45. package/src/components/playground/demos/FinanceAINode.tsx +226 -0
  46. package/src/components/playground/demos/KiaAcademyNode.tsx +250 -0
  47. package/src/components/playground/demos/KiaBotNode.tsx +207 -0
  48. package/src/components/playground/demos/KiaCampaignNode.tsx +191 -0
  49. package/src/components/playground/demos/KiaComplianceNode.tsx +140 -0
  50. package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +220 -0
  51. package/src/components/playground/demos/KiaCyberNode.tsx +203 -0
  52. package/src/components/playground/demos/KiaDashboardNode.tsx +399 -0
  53. package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +168 -0
  54. package/src/components/playground/demos/KiaExecutiveNode.tsx +169 -0
  55. package/src/components/playground/demos/KiaGamificationNode.tsx +229 -0
  56. package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +165 -0
  57. package/src/components/playground/demos/KiaInventoryNode.tsx +183 -0
  58. package/src/components/playground/demos/KiaLeadScoringNode.tsx +226 -0
  59. package/src/components/playground/demos/KiaLiveSimulationNode.tsx +177 -0
  60. package/src/components/playground/demos/KiaMultiDealerNode.tsx +223 -0
  61. package/src/components/playground/demos/KiaNPSVoiceNode.tsx +214 -0
  62. package/src/components/playground/demos/KiaOmnichannelNode.tsx +162 -0
  63. package/src/components/playground/demos/KiaPBIBudgetNode.tsx +152 -0
  64. package/src/components/playground/demos/KiaPBIConversionNode.tsx +206 -0
  65. package/src/components/playground/demos/KiaPBIFunnelNode.tsx +184 -0
  66. package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +113 -0
  67. package/src/components/playground/demos/KiaPBIPartnerNode.tsx +143 -0
  68. package/src/components/playground/demos/KiaPBIPreciosNode.tsx +120 -0
  69. package/src/components/playground/demos/KiaPBIRuntNode.tsx +205 -0
  70. package/src/components/playground/demos/KiaPartnerScoreNode.tsx +206 -0
  71. package/src/components/playground/demos/KiaPredictiveNode.tsx +226 -0
  72. package/src/components/playground/demos/KiaShowroomNode.tsx +194 -0
  73. package/src/components/playground/demos/KiaStoreNode.tsx +215 -0
  74. package/src/components/playground/demos/KiaSustainabilityNode.tsx +173 -0
  75. package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +163 -0
  76. package/src/components/playground/demos/KiaWorkshopNode.tsx +221 -0
  77. package/src/components/playground/demos/SmartCityNode.tsx +205 -0
  78. package/src/components/playground/demos/kia_campaign_manifest.json +112 -0
  79. package/src/components/playground/input-parts/AIModelSelector.tsx +156 -0
  80. package/src/components/playground/input-parts/InputActions.tsx +80 -0
  81. package/src/components/playground/input-parts/InputToolbar.tsx +245 -0
  82. package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +287 -0
  83. package/src/components/playground/sidebarDsdIO.ts +82 -0
  84. package/src/components/settings/SettingsPanel.tsx +267 -0
  85. package/src/components/shell/AppHeader.tsx +9 -0
  86. package/src/components/shell/AppShell.tsx +139 -0
  87. package/src/components/shell/ArtifactBar.tsx +97 -0
  88. package/src/components/shell/BootScreen.tsx +19 -0
  89. package/src/components/shell/CenterComposite.tsx +87 -0
  90. package/src/components/shell/CodeEditorPanel.tsx +88 -0
  91. package/src/components/shell/GlobalOverlays.tsx +228 -0
  92. package/src/components/shell/LayoutConfigurator.tsx +209 -0
  93. package/src/components/shell/LayoutGrid.tsx +178 -0
  94. package/src/components/shell/MorphShell.tsx +368 -0
  95. package/src/components/shell/PluginViewer.tsx +147 -0
  96. package/src/components/shell/ShellNexusPreview.tsx +458 -0
  97. package/src/components/shell/SlotRenderer.tsx +115 -0
  98. package/src/components/shell/TabBar.tsx +94 -0
  99. package/src/components/shell/TemplateLibrary.tsx +195 -0
  100. package/src/components/shell/layoutConstants.ts +35 -0
  101. package/src/components/shell/morphStageMeta.ts +15 -0
  102. package/src/components/shell/shells/BuiltInShells.tsx +443 -0
  103. package/src/components/shell/shells/DatawayChatShell.tsx +42 -0
  104. package/src/components/shell/shells/TokenPreview.tsx +339 -0
  105. package/src/components/shell/shells/bootShells.ts +31 -0
  106. package/src/components/shells/CreatorShell.tsx +37 -0
  107. package/src/components/shells/DecidoShell.tsx +447 -0
  108. package/src/components/shells/ExperimentalChatShell.tsx +245 -0
  109. package/src/components/shells/UserCanvas.tsx +44 -0
  110. package/src/components/studio/BlueprintManagerPanel.tsx +137 -0
  111. package/src/components/studio/DependencyTreePanel.tsx +192 -0
  112. package/src/components/studio/NodePalette.tsx +92 -0
  113. package/src/components/studio/NodePropertiesPanel.tsx +81 -0
  114. package/src/components/studio/ReactFlowEditor.tsx +242 -0
  115. package/src/components/studio/TimelineEditor.tsx +122 -0
  116. package/src/components/studio/TimelineKeyframeCard.tsx +99 -0
  117. package/src/components/studio/VariablePanel.tsx +181 -0
  118. package/src/components/studio/blueprint/BlueprintCard.tsx +82 -0
  119. package/src/components/studio/editor/CanvasContextMenu.tsx +107 -0
  120. package/src/components/studio/editor/EditorToolbar.tsx +80 -0
  121. package/src/components/studio/editor/StageContentRenderer.tsx +134 -0
  122. package/src/components/studio/editor/TrackPropertyEditors.tsx +133 -0
  123. package/src/components/studio/editor/TreeNodeItem.tsx +91 -0
  124. package/src/components/studio/editor/edgeStyles.ts +43 -0
  125. package/src/components/studio/editor/editorKeyHandler.ts +95 -0
  126. package/src/components/studio/editor/nodeTypeRegistry.ts +137 -0
  127. package/src/components/studio/editor/paletteCatalog.tsx +84 -0
  128. package/src/components/studio/nodes/shell/InteractionNodes.tsx +82 -0
  129. package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +69 -0
  130. package/src/components/studio/nodes/shell/RegisterActionNode.tsx +20 -0
  131. package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +22 -0
  132. package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +19 -0
  133. package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +19 -0
  134. package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +22 -0
  135. package/src/components/studio/nodes/shell/RegisterTabNode.tsx +21 -0
  136. package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +22 -0
  137. package/src/components/studio/nodes/shell/ShellConfigNode.tsx +51 -0
  138. package/src/components/studio/nodes/shell/ShellNodeBase.tsx +100 -0
  139. package/src/components/studio/nodes/shell/ThemeNodes.tsx +51 -0
  140. package/src/components/studio/nodes/shell/index.ts +12 -0
  141. package/src/components/widgets/BroadcastWidget.tsx +93 -0
  142. package/src/components/widgets/MarketplaceWidget.tsx +298 -0
  143. package/src/components/widgets/McpToolsWidget.tsx +231 -0
  144. package/src/components/widgets/OpsDashboard.tsx +59 -0
  145. package/src/components/widgets/QuickActionsWidget.tsx +60 -0
  146. package/src/components/widgets/UsageWidget.tsx +112 -0
  147. package/src/components/widgets/WidgetRenderer.tsx +892 -0
  148. package/src/components/widgets/WidgetSlotPanel.tsx +213 -0
  149. package/src/config/IconRegistry.ts +126 -0
  150. package/src/contexts/NetworkProvider.tsx +162 -0
  151. package/src/core/AIDirector.ts +71 -0
  152. package/src/core/EventBus.ts +37 -0
  153. package/src/core/PluginContext.tsx +141 -0
  154. package/src/hooks/listeners/useUIStateListener.ts +59 -0
  155. package/src/hooks/listeners/useWhatsAppListener.ts +110 -0
  156. package/src/hooks/morphBridge.ts +82 -0
  157. package/src/hooks/useAIModelSelector.ts +144 -0
  158. package/src/hooks/useAgentStream.ts +220 -0
  159. package/src/hooks/useAutoUpdater.ts +89 -0
  160. package/src/hooks/useBootSequence.ts +20 -0
  161. package/src/hooks/useExportDSD.ts +53 -0
  162. package/src/hooks/useFullscreen.ts +35 -0
  163. package/src/hooks/useGeminiStream.ts +282 -0
  164. package/src/hooks/useIntentLens.ts +224 -0
  165. package/src/hooks/useKeyboardShortcuts.ts +69 -0
  166. package/src/hooks/useLoggerBridge.ts +32 -0
  167. package/src/hooks/useMcpClient.ts +112 -0
  168. package/src/hooks/useNexusaiDeploy.ts +118 -0
  169. package/src/hooks/usePlaybackEngine.ts +21 -0
  170. package/src/hooks/usePlaygroundCommander.ts +475 -0
  171. package/src/hooks/usePluginEngine.ts +165 -0
  172. package/src/hooks/useScreenRecorder.ts +73 -0
  173. package/src/hooks/useShellKeyboard.ts +40 -0
  174. package/src/hooks/useShellShortcuts.ts +118 -0
  175. package/src/hooks/useSoundEffects.ts +35 -0
  176. package/src/hooks/useStudioConfig.ts +72 -0
  177. package/src/hooks/useSystemBoot.ts +84 -0
  178. package/src/hooks/useSystemTelemetry.ts +62 -0
  179. package/src/index.ts +97 -0
  180. package/src/lib/debugLogger.ts +80 -0
  181. package/src/lib/networkInterceptor.ts +100 -0
  182. package/src/mocks/decido.tsx +41 -0
  183. package/src/plugins/pluginAPI.ts +190 -0
  184. package/src/store/McpStore.ts +69 -0
  185. package/src/store/UpdaterStore.ts +60 -0
  186. package/src/store/engine.ts +392 -0
  187. package/src/store/index.ts +4 -0
  188. package/src/store/layoutPresets.ts +66 -0
  189. package/src/store/playgroundTypes.ts +98 -0
  190. package/src/store/useActionTimelineStore.ts +48 -0
  191. package/src/store/useDebugPanelStore.ts +98 -0
  192. package/src/store/useDebugProfileStore.ts +130 -0
  193. package/src/store/useLayoutStore.ts +205 -0
  194. package/src/store/useMorphInstanceStore.ts +289 -0
  195. package/src/store/useMorphologyStore.ts +103 -0
  196. package/src/store/usePlaygroundStore.ts +236 -0
  197. package/src/store/useShellRegistry.ts +123 -0
  198. package/src/store/useSuggestionsStore.ts +57 -0
  199. package/src/store/useThemeStore.ts +399 -0
  200. package/src/store/useUIComponentStore.ts +179 -0
  201. package/src/types/DecidoStoryDefinition.ts +43 -0
  202. package/src/utils/ai/ai-architect.ts +92 -0
  203. package/src/utils/ai/ai-code.ts +187 -0
  204. package/src/utils/ai/ai-core.ts +50 -0
  205. package/src/utils/ai/ai-media.ts +292 -0
  206. package/src/utils/layoutGraph.ts +67 -0
  207. package/tsconfig.json +17 -0
  208. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,139 @@
1
+ import React, { useEffect } from 'react';
2
+ import { DecidoStudioProps } from '@decido/engine';
3
+ import { NetworkProvider } from '../../contexts/NetworkProvider';
4
+ import { useLayoutStore } from '../../store/useLayoutStore';
5
+ import { usePlaygroundStore } from '../../store/usePlaygroundStore';
6
+ import { useMorphologyStore } from '../../store/useMorphologyStore';
7
+ import { registerUIBridge } from '@decido/engine';
8
+ import { PluginRegistry } from '@decido/core';
9
+ import { DialoguePlugin, LogicPlugin, UIStatePlugin, SubflowPlugin, EndSubflowPlugin, UIRendererPlugin } from '@decido/engine';
10
+ import PlaygroundDecidoChannel from '../shells/DecidoShell';
11
+ import { GlobalOverlays } from './GlobalOverlays';
12
+ import { useShellShortcuts } from '../../hooks/useShellShortcuts';
13
+
14
+ /**
15
+ * AppShell — The global OS-level container.
16
+ *
17
+ * Responsibilities:
18
+ * 1. UIBridge registration (connects @decido/engine → UI stores)
19
+ * 2. Plugin initialization (Inversión de Control)
20
+ * 3. NetworkProvider context
21
+ * 4. Layout context via useLayoutStore
22
+ * 5. Our GlobalOverlays (Cmd+K Omnibar)
23
+ * 6. Renders OS-level overlays via renderOverlays prop (injected by host)
24
+ *
25
+ * NOTE: OS-level overlays (HitlModal, TransientLayer, Omnibar legacy,
26
+ * PluginMarketplace, etc.) are passed via renderOverlays prop to avoid
27
+ * circular dependency between @decido/studio and @decido/shell.
28
+ */
29
+
30
+ // ── UIBridge ──
31
+ let _uiBridgeRegistered = false;
32
+
33
+ function ensureUIBridge() {
34
+ if (_uiBridgeRegistered) return;
35
+ _uiBridgeRegistered = true;
36
+
37
+ registerUIBridge({
38
+ addLog: (msg, type) => usePlaygroundStore.getState().addLog(msg, type),
39
+ pushMorphStage: (stage) => {
40
+ useMorphologyStore.getState().pushStage(stage as any);
41
+ useLayoutStore.getState().pushStage(stage as any);
42
+ },
43
+ clearMorphStages: () => {
44
+ useMorphologyStore.getState().clearStages();
45
+ useLayoutStore.getState().clearStages();
46
+ },
47
+ showCanvas: (visible) => {
48
+ usePlaygroundStore.getState().setShowCanvas(visible);
49
+ useLayoutStore.getState().setShowCanvas(visible);
50
+ },
51
+ setSidebarOpen: (open) => {
52
+ usePlaygroundStore.getState().setIsSidebarOpen(open);
53
+ useLayoutStore.getState().setIsSidebarOpen(open);
54
+ },
55
+ setDemoState: (state) => usePlaygroundStore.getState().setDemoState(state),
56
+ getActiveBrand: () => usePlaygroundStore.getState().prototypeBrand,
57
+ setActiveBrand: (brand: string) => usePlaygroundStore.getState().setPrototypeBrand(brand),
58
+ addChatMessage: (msg) => usePlaygroundStore.getState().addChatMessage(msg as any),
59
+ isMuted: () => usePlaygroundStore.getState().isMuted,
60
+ getSelectedVoice: () => usePlaygroundStore.getState().selectedVoice,
61
+ });
62
+ }
63
+
64
+ // ── Plugins ──
65
+ let _pluginsInitialized = false;
66
+
67
+ function ensurePlugins() {
68
+ if (_pluginsInitialized) return;
69
+ _pluginsInitialized = true;
70
+
71
+ if (!PluginRegistry.get('ai:dialogue')) PluginRegistry.register(DialoguePlugin);
72
+ if (!PluginRegistry.get('mcp:execute')) PluginRegistry.register(LogicPlugin);
73
+ if (!PluginRegistry.get('ui:state')) PluginRegistry.register(UIStatePlugin);
74
+ if (!PluginRegistry.get('core:subflow')) PluginRegistry.register(SubflowPlugin);
75
+ if (!PluginRegistry.get('core:return')) PluginRegistry.register(EndSubflowPlugin);
76
+ if (!PluginRegistry.get('ui:render')) PluginRegistry.register(UIRendererPlugin);
77
+ }
78
+
79
+ export interface AppShellProps extends DecidoStudioProps {
80
+ children?: React.ReactNode;
81
+ /**
82
+ * Render function for OS-level overlays.
83
+ * Injected by the host to avoid circular dependency.
84
+ * Should return: HitlApprovalModal, Omnibar, TransientLayer,
85
+ * SwarmOnboarding, PluginMarketplace, UpdaterOverlay, etc.
86
+ */
87
+ renderOverlays?: () => React.ReactNode;
88
+ }
89
+
90
+ export function AppShell({
91
+ aiProvider,
92
+ VoiceWidget,
93
+ config,
94
+ socketInstance,
95
+ children,
96
+ renderOverlays,
97
+ }: AppShellProps) {
98
+ ensureUIBridge();
99
+ ensurePlugins();
100
+ useShellShortcuts();
101
+
102
+ // Sync useLayoutStore ↔ usePlaygroundStore during transition
103
+ useEffect(() => {
104
+ const unsub = usePlaygroundStore.subscribe((state) => {
105
+ const layout = useLayoutStore.getState();
106
+ if (state.isCreatorMode !== layout.isCreatorMode) {
107
+ layout.setIsCreatorMode(state.isCreatorMode);
108
+ }
109
+ if (state.showCanvas !== layout.showCanvas) {
110
+ layout.setShowCanvas(state.showCanvas);
111
+ }
112
+ if (state.isSidebarOpen !== layout.isSidebarOpen) {
113
+ layout.setIsSidebarOpen(state.isSidebarOpen);
114
+ }
115
+ });
116
+ return unsub;
117
+ }, []);
118
+
119
+ return (
120
+ <NetworkProvider socketInstance={socketInstance} isConnected={!!socketInstance?.connected}>
121
+ {/* ═══ OS-Level Overlays (injected by host) ═══ */}
122
+ {renderOverlays?.()}
123
+
124
+ {/* ═══ Global Overlays (our Cmd+K Omnibar) ═══ */}
125
+ <GlobalOverlays />
126
+
127
+ {/* ═══ Main Application Content ═══ */}
128
+ <PlaygroundDecidoChannel
129
+ aiProvider={aiProvider}
130
+ VoiceWidget={VoiceWidget}
131
+ config={config}
132
+ socketInstance={socketInstance}
133
+ />
134
+ {children}
135
+ </NetworkProvider>
136
+ );
137
+ }
138
+
139
+ export default AppShell;
@@ -0,0 +1,97 @@
1
+ import React from 'react';
2
+ import { motion, AnimatePresence } from 'motion/react';
3
+ import { X, FileCode, FileText, Globe, Layers, Plus, MessageSquare } from 'lucide-react';
4
+ import { useMorphInstanceStore } from '../../store/useMorphInstanceStore';
5
+ import type { MorphArtifact, ShellType } from '../../store/useShellRegistry';
6
+
7
+ /**
8
+ * ArtifactBar — Sub-artifact tab strip inside MorphShell.
9
+ *
10
+ * Displays artifacts within a MorphInstance (like Gemini Canvas file tabs).
11
+ * Each artifact can be a different version or different file.
12
+ *
13
+ * Example: Chat pushes v1 index.html, v2 index.html, style.css
14
+ * ArtifactBar shows: [v1 index.html] [v2 index.html ●] [style.css]
15
+ */
16
+
17
+ const SHELL_ICONS: Record<string, React.ComponentType<any>> = {
18
+ 'markdown': FileText,
19
+ 'iframe': Globe,
20
+ 'shell-vscode': FileCode,
21
+ 'shell-canvas': Layers,
22
+ 'shell-omnichannel': MessageSquare,
23
+ };
24
+
25
+ function getArtifactIcon(shellType: ShellType): React.ComponentType<any> {
26
+ return SHELL_ICONS[shellType] || FileCode;
27
+ }
28
+
29
+ interface ArtifactBarProps {
30
+ instanceId: string;
31
+ className?: string;
32
+ }
33
+
34
+ export function ArtifactBar({ instanceId, className = '' }: ArtifactBarProps) {
35
+ const instance = useMorphInstanceStore((s) => s.getInstance(instanceId));
36
+ const setActiveArtifact = useMorphInstanceStore((s) => s.setActiveArtifact);
37
+ const removeArtifact = useMorphInstanceStore((s) => s.removeArtifact);
38
+
39
+ if (!instance || instance.artifacts.length <= 1) return null;
40
+
41
+ return (
42
+ <div className={`flex items-center gap-0.5 px-2 py-1 bg-surface-primary border-b border-border-subtle overflow-x-auto scrollbar-hide ${className}`}>
43
+ <AnimatePresence mode="popLayout">
44
+ {instance.artifacts.map((artifact, index) => {
45
+ const isActive = index === instance.activeArtifactIndex;
46
+ const Icon = getArtifactIcon(artifact.shellType);
47
+
48
+ return (
49
+ <motion.button
50
+ key={artifact.id}
51
+ layout
52
+ initial={{ opacity: 0, scale: 0.9, width: 0 }}
53
+ animate={{ opacity: 1, scale: 1, width: 'auto' }}
54
+ exit={{ opacity: 0, scale: 0.9, width: 0 }}
55
+ onClick={() => setActiveArtifact(instanceId, index)}
56
+ className={`
57
+ flex items-center gap-1.5 px-2.5 py-1 rounded-md text-[10px] font-medium
58
+ transition-colors whitespace-nowrap group relative shrink-0
59
+ ${isActive
60
+ ? 'bg-surface-glass text-text-primary border border-border-default'
61
+ : 'text-text-muted hover:text-text-primary hover:bg-surface-glass border border-transparent'
62
+ }
63
+ `}
64
+ >
65
+ <Icon size={10} className={isActive ? 'text-cyan-400' : 'text-text-muted'} />
66
+ <span className="truncate max-w-[100px]">{artifact.name}</span>
67
+ {artifact.version > 1 && (
68
+ <span className="text-[8px] text-text-muted font-mono">v{artifact.version}</span>
69
+ )}
70
+
71
+ {instance.artifacts.length > 1 && (
72
+ <span
73
+ onClick={(e) => {
74
+ e.stopPropagation();
75
+ removeArtifact(instanceId, artifact.id);
76
+ }}
77
+ className="w-3.5 h-3.5 rounded flex items-center justify-center
78
+ opacity-0 group-hover:opacity-100 hover:bg-surface-glass hover:text-red-400
79
+ transition-all ml-0.5"
80
+ >
81
+ <X size={8} />
82
+ </span>
83
+ )}
84
+
85
+ {isActive && (
86
+ <motion.div
87
+ layoutId="artifact-indicator"
88
+ className="absolute bottom-0 left-1 right-1 h-[1.5px] bg-cyan-500/50 rounded-full"
89
+ />
90
+ )}
91
+ </motion.button>
92
+ );
93
+ })}
94
+ </AnimatePresence>
95
+ </div>
96
+ );
97
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { motion } from 'motion/react';
3
+
4
+ /**
5
+ * BootScreen — Shown while Decido Studio initializes.
6
+ * Extracted from PlaygroundDecidoChannel to reduce its weight.
7
+ */
8
+ export function BootScreen() {
9
+ return (
10
+ <div className="h-dvh w-full bg-surface-primary flex flex-col items-center justify-center font-mono text-cyan-400 relative overflow-hidden">
11
+ <div className="absolute inset-0 bg-[url('data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E')] opacity-[0.15] mix-blend-overlay pointer-events-none z-0"></div>
12
+ <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} className="z-10 flex flex-col items-center">
13
+ <div className="w-16 h-16 rounded-full border-[3px] border-cyan-500/30 border-t-cyan-400 animate-spin mb-6 shadow-[0_0_30px_rgba(34,211,238,0.2)]"></div>
14
+ <motion.div initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.5 }} className="text-sm tracking-widest uppercase mb-2 font-bold">Inicializando yo.decido</motion.div>
15
+ <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 1 }} className="text-xs text-text-muted">Cargando módulos de IA y telemetría...</motion.div>
16
+ </motion.div>
17
+ </div>
18
+ );
19
+ }
@@ -0,0 +1,87 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { Panel, Group as PanelGroup, Separator as PanelResizeHandle } from 'react-resizable-panels';
3
+ import { PlaygroundChat } from '../playground/PlaygroundChat';
4
+ import { PlaygroundTerminal } from '../playground/PlaygroundTerminal';
5
+ import { PlaygroundBottomControls } from '../playground/PlaygroundBottomControls';
6
+ import { PlaygroundErrorBoundary } from '../playground/PlaygroundErrorBoundary';
7
+ import { DebugPanel } from '../playground/DebugPanel';
8
+ import { usePlaygroundStore } from '../../store/usePlaygroundStore';
9
+ import { useDebugPanelStore } from '../../store/useDebugPanelStore';
10
+ import { useTimelineStore } from '@decido/engine';
11
+ import { usePlaygroundCommander } from '../../hooks/usePlaygroundCommander';
12
+ import { useUIStateListener } from '../../hooks/listeners/useUIStateListener';
13
+ import { useScreenRecorder } from '../../hooks/useScreenRecorder';
14
+ import { usePlaybackEngine } from '../../hooks/usePlaybackEngine';
15
+ import { useStudioConfig } from '../../hooks/useStudioConfig';
16
+ import { useExportDSD } from '../../hooks/useExportDSD';
17
+ import { useFullscreen } from '../../hooks/useFullscreen';
18
+
19
+ interface CenterCompositeProps { aiProvider?: any; VoiceWidget?: any; config?: any; }
20
+
21
+ /**
22
+ * CenterComposite — Self-contained center content compositor.
23
+ * Composes: Chat + Terminal + BottomControls + DebugPanel.
24
+ * Reads all state from stores/hooks; parent only provides runtime deps.
25
+ */
26
+ export function CenterComposite({ aiProvider, VoiceWidget, config }: CenterCompositeProps) {
27
+ // ─── Store state ───
28
+ const store = usePlaygroundStore();
29
+ const { step, selectedProfile, prototypeBrand, setPrototypeBrand, isMuted, setIsMuted,
30
+ selectedVoice, setSelectedVoice, isVoiceActive, setIsVoiceActive,
31
+ isTerminalOpen, setIsTerminalOpen, isCreatorMode, setIsCreatorMode,
32
+ inputValue, setInputValue, logs, setLogs } = store;
33
+
34
+ const logsEndRef = useRef<HTMLDivElement>(null);
35
+ useEffect(() => { if (logsEndRef.current) logsEndRef.current.scrollIntoView({ behavior: 'smooth' }); }, [logs]);
36
+
37
+ // ─── Hooks (self-contained) ───
38
+ const timelines = useTimelineStore(s => s.timelines);
39
+ const { handleGeneratePlayground, isGenerating } = usePlaygroundCommander(aiProvider);
40
+ const { demoState, showCanvas, setShowCanvas } = useUIStateListener();
41
+ const { currentTime, isPlaying, setIsPlaying, playbackSpeed, setPlaybackSpeed, seekTime, resetSimulation } = usePlaybackEngine(prototypeBrand);
42
+ const { safeConfig, activeConfig, suggestions, setSuggestions, dynamicPersona, authAvailableLicenses, handleProfileSelect } = useStudioConfig(config, prototypeBrand);
43
+ const { handleExport } = useExportDSD();
44
+ const { isFullscreen, toggleFullscreen } = useFullscreen();
45
+ const { isRecording } = useScreenRecorder();
46
+ const debugIsOpen = useDebugPanelStore(s => s.isOpen);
47
+
48
+ return (
49
+ <div className="flex flex-col h-full relative min-w-0 min-h-0">
50
+ <PanelGroup orientation="vertical" className="flex-1 min-h-0 min-w-0">
51
+ <Panel id="chat-area" defaultSize={debugIsOpen ? 65 : 100} className="flex flex-col relative min-h-0 min-w-0">
52
+ <div className={`flex-1 z-10 flex flex-col relative min-h-0 min-w-0 ${isCreatorMode ? 'overflow-y-auto p-4 md:p-6 pb-48 justify-end' : 'overflow-hidden'}`}>
53
+ <PlaygroundErrorBoundary fallbackName="Motor de Chat">
54
+ <PlaygroundChat step={step} selectedProfile={selectedProfile} authAvailableLicenses={authAvailableLicenses} handleProfileSelect={handleProfileSelect}
55
+ activeConfig={activeConfig} demoState={demoState} suggestions={suggestions} setInputValue={setInputValue} isGenerating={isGenerating} config={safeConfig}
56
+ isCreatorMode={isCreatorMode} handleGeneratePlayground={handleGeneratePlayground} isVoiceActive={isVoiceActive} setIsVoiceActive={setIsVoiceActive}
57
+ VoiceWidget={VoiceWidget} dynamicPersona={dynamicPersona} setSuggestions={setSuggestions as any} selectedVoice={selectedVoice} showCanvas={showCanvas} setShowCanvas={setShowCanvas} />
58
+ </PlaygroundErrorBoundary>
59
+ </div>
60
+ {isCreatorMode && (
61
+ <PlaygroundErrorBoundary fallbackName="Terminal de Logs">
62
+ <PlaygroundTerminal isOpen={isTerminalOpen} setIsOpen={setIsTerminalOpen} logs={logs} setLogs={setLogs} logsEndRef={logsEndRef} />
63
+ </PlaygroundErrorBoundary>
64
+ )}
65
+ <PlaygroundBottomControls step={step} isVoiceActive={isVoiceActive} setIsVoiceActive={setIsVoiceActive}
66
+ currentTime={currentTime} seekTime={seekTime} playbackSpeed={playbackSpeed} setPlaybackSpeed={setPlaybackSpeed}
67
+ dynamicTimelines={timelines} prototypeBrand={prototypeBrand} setPrototypeBrand={setPrototypeBrand}
68
+ inputValue={inputValue} setInputValue={setInputValue} isGenerating={isGenerating} handleGeneratePlayground={handleGeneratePlayground}
69
+ isPlaying={isPlaying} setIsPlaying={setIsPlaying} handleResetPlayground={resetSimulation}
70
+ showCanvas={showCanvas} setShowCanvas={setShowCanvas} isTerminalOpen={isTerminalOpen} setIsTerminalOpen={setIsTerminalOpen}
71
+ isMuted={isMuted} setIsMuted={setIsMuted} selectedVoice={selectedVoice} setSelectedVoice={setSelectedVoice}
72
+ isFullscreen={isFullscreen} toggleFullscreen={toggleFullscreen} demoState={demoState} isRecording={isRecording}
73
+ handleExport={handleExport} dynamicPersona={dynamicPersona} setSuggestions={setSuggestions as any}
74
+ isCreatorMode={isCreatorMode} setIsCreatorMode={setIsCreatorMode} VoiceWidget={VoiceWidget} config={safeConfig} />
75
+ </Panel>
76
+ {debugIsOpen && (
77
+ <>
78
+ <PanelResizeHandle className="h-2 hover:bg-cyan-500/20 active:bg-cyan-500/30 transition-colors cursor-row-resize z-40 relative group flex items-center justify-center">
79
+ <div className="h-[2px] w-12 bg-surface-glass rounded-full group-hover:bg-cyan-500 transition-colors" />
80
+ </PanelResizeHandle>
81
+ <Panel id="debug-panel" defaultSize={35} minSize={15}><DebugPanel /></Panel>
82
+ </>
83
+ )}
84
+ </PanelGroup>
85
+ </div>
86
+ );
87
+ }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * CodeEditorPanel — Inline code editor for HTML/CSS/JS with live sync.
3
+ *
4
+ * Sprint AJ: View and edit generated code. Changes sync to iframe in real-time.
5
+ */
6
+ import React, { useState, useCallback, useEffect, useRef } from 'react';
7
+ import { useMorphInstanceStore } from '../../store/useMorphInstanceStore';
8
+
9
+ type CodeTab = 'html' | 'css' | 'js';
10
+
11
+ const TAB_META: Record<CodeTab, { label: string; color: string }> = {
12
+ html: { label: 'HTML', color: '#e44d26' },
13
+ css: { label: 'CSS', color: '#2965f1' },
14
+ js: { label: 'JS', color: '#f7df1e' },
15
+ };
16
+
17
+ interface CodeEditorPanelProps {
18
+ code: { html: string; css: string; js: string };
19
+ onCodeChange: (code: { html: string; css: string; js: string }) => void;
20
+ }
21
+
22
+ export const CodeEditorPanel = React.memo(function CodeEditorPanel({
23
+ code = { html: '', css: '', js: '' },
24
+ onCodeChange
25
+ }: CodeEditorPanelProps) {
26
+ const [activeTab, setActiveTab] = useState<CodeTab>('html');
27
+ const textareaRef = useRef<HTMLTextAreaElement>(null);
28
+ const [localCode, setLocalCode] = useState(code);
29
+
30
+ // Sync external changes (e.g., from Gemini)
31
+ useEffect(() => {
32
+ setLocalCode(code);
33
+ }, [code]);
34
+
35
+ const handleChange = useCallback((value: string) => {
36
+ const updated = { ...localCode, [activeTab]: value };
37
+ setLocalCode(updated);
38
+ // Debounced sync to parent — propagate after user stops typing
39
+ onCodeChange(updated);
40
+ }, [activeTab, localCode, onCodeChange]);
41
+
42
+ const currentValue = activeTab === 'html' ? localCode.html : activeTab === 'css' ? localCode.css : localCode.js;
43
+ const lineCount = (currentValue || '').split('\n').length;
44
+
45
+ return (
46
+ <div className="flex flex-col h-full bg-surface-tertiary border-l border-border-subtle overflow-hidden" style={{ minWidth: 280 }}>
47
+ {/* Tabs */}
48
+ <div className="flex items-center gap-0.5 px-2 py-1.5 bg-surface-secondary border-b border-border-subtle shrink-0">
49
+ {(['html', 'css', 'js'] as CodeTab[]).map(tab => (
50
+ <button
51
+ key={tab}
52
+ onClick={() => setActiveTab(tab)}
53
+ className={`px-3 py-1 rounded text-[10px] font-mono uppercase tracking-wider transition-colors ${
54
+ activeTab === tab
55
+ ? 'bg-surface-glass text-text-primary'
56
+ : 'text-text-muted hover:text-text-primary hover:bg-surface-glass'
57
+ }`}
58
+ >
59
+ <span className="inline-block w-2 h-2 rounded-full mr-1.5" style={{ background: TAB_META[tab].color }} />
60
+ {TAB_META[tab].label}
61
+ </button>
62
+ ))}
63
+ <span className="ml-auto text-[9px] text-text-muted font-mono">{lineCount} líneas</span>
64
+ </div>
65
+
66
+ {/* Editor */}
67
+ <div className="flex-1 overflow-auto relative" style={{ fontFamily: 'ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace' }}>
68
+ <div className="flex min-h-full">
69
+ {/* Line numbers */}
70
+ <div className="select-none text-right pr-3 pl-3 py-3 text-[11px] text-text-muted leading-normal shrink-0 bg-surface-tertiary border-r border-border-subtle">
71
+ {Array.from({ length: lineCount }, (_, i) => (
72
+ <div key={i}>{i + 1}</div>
73
+ ))}
74
+ </div>
75
+ {/* Textarea */}
76
+ <textarea
77
+ ref={textareaRef}
78
+ value={currentValue}
79
+ onChange={e => handleChange(e.target.value)}
80
+ spellCheck={false}
81
+ className="flex-1 resize-none bg-transparent text-text-primary text-[11px] leading-normal p-3 outline-hidden min-h-full"
82
+ style={{ tabSize: 2 }}
83
+ />
84
+ </div>
85
+ </div>
86
+ </div>
87
+ );
88
+ });
@@ -0,0 +1,228 @@
1
+ import React, { useEffect, useCallback } from 'react';
2
+ import { AnimatePresence, motion } from 'motion/react';
3
+ import { Search, X, Command, Package, ArrowRight, Grid3X3, Maximize2, RotateCcw, Layout, MessageSquare } from 'lucide-react';
4
+ import { useLayoutStore, type SlotComponentId, type RegionId } from '../../store/useLayoutStore';
5
+ import { useMorphologyStore } from '../../store/useMorphologyStore';
6
+ import { useManifestRegistry } from '@decido/plugin-engine';
7
+
8
+ /**
9
+ * GlobalOverlays — Centralized overlay system managed by AppShell.
10
+ *
11
+ * Contains:
12
+ * - Omnibar (Cmd+K): Global command palette with slot/preset/mode actions
13
+ * - Plugin Marketplace (future): Browse and install plugins
14
+ *
15
+ * These overlays live ABOVE the LayoutGrid, never affected by MorphShell.
16
+ */
17
+
18
+ export function GlobalOverlays() {
19
+ const [isOmnibarOpen, setIsOmnibarOpen] = React.useState(false);
20
+ const [omnibarQuery, setOmnibarQuery] = React.useState('');
21
+ const inputRef = React.useRef<HTMLInputElement>(null);
22
+
23
+ const allManifests = useManifestRegistry((s) => s.manifests);
24
+
25
+ // Find all widgets with defaultZone === 'overlay' from all loaded manifests
26
+ const overlayWidgets = React.useMemo(() => {
27
+ const overlays: { id: string, component: any }[] = [];
28
+ Object.values(allManifests).forEach((manifest: any) => {
29
+ if (manifest.widgets) {
30
+ manifest.widgets.forEach((w: any) => {
31
+ if (w.defaultZone === 'overlay' && w.component) {
32
+ overlays.push({ id: w.id, component: w.component });
33
+ }
34
+ });
35
+ }
36
+ });
37
+ return overlays;
38
+ }, [allManifests]);
39
+
40
+ // ── Cmd+K global shortcut ──
41
+ useEffect(() => {
42
+ const handler = (e: KeyboardEvent) => {
43
+ if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
44
+ e.preventDefault();
45
+ setIsOmnibarOpen((prev) => !prev);
46
+ }
47
+ if (e.key === 'Escape' && isOmnibarOpen) {
48
+ setIsOmnibarOpen(false);
49
+ }
50
+ };
51
+ window.addEventListener('keydown', handler);
52
+ return () => window.removeEventListener('keydown', handler);
53
+ }, [isOmnibarOpen]);
54
+
55
+ // Auto-focus input when opened
56
+ useEffect(() => {
57
+ if (isOmnibarOpen && inputRef.current) {
58
+ setTimeout(() => inputRef.current?.focus(), 100);
59
+ }
60
+ }, [isOmnibarOpen]);
61
+
62
+ const handleSelect = useCallback((action: string) => {
63
+ setIsOmnibarOpen(false);
64
+ setOmnibarQuery('');
65
+
66
+ const layout = useLayoutStore.getState();
67
+
68
+ // Slot assignment actions: "slot:R3:graph-editor"
69
+ if (action.startsWith('slot:')) {
70
+ const [_, region, component] = action.split(':');
71
+ layout.setSlot(region as RegionId, (component || null) as SlotComponentId);
72
+ return;
73
+ }
74
+
75
+ // Prefix actions: "preset:creator"
76
+ if (action.startsWith('preset:')) {
77
+ const preset = action.split(':')[1];
78
+ layout.resetLayout(preset);
79
+ return;
80
+ }
81
+
82
+ if (action === 'open:omnichannel') {
83
+ useMorphologyStore.getState().pushStage({
84
+ id: `omni-${Date.now()}`,
85
+ name: 'Bandeja Omnicanal',
86
+ shellType: 'shell-omnichannel',
87
+ data: {}
88
+ } as any);
89
+ return;
90
+ }
91
+
92
+ switch (action) {
93
+ case 'toggle-creator':
94
+ layout.setIsCreatorMode(!layout.isCreatorMode);
95
+ break;
96
+ case 'toggle-sidebar':
97
+ layout.setIsSidebarOpen(!layout.isSidebarOpen);
98
+ break;
99
+ case 'toggle-canvas':
100
+ layout.setShowCanvas(!layout.showCanvas);
101
+ break;
102
+ case 'toggle-immersive':
103
+ layout.setIsImmersive(!layout.isImmersive);
104
+ break;
105
+ case 'reset-layout':
106
+ layout.resetLayout('player');
107
+ break;
108
+ default:
109
+ break;
110
+ }
111
+ }, []);
112
+
113
+ // Quick actions for the omnibar
114
+ const quickActions = [
115
+ // ── Mode & View ──
116
+ { id: 'toggle-creator', label: 'Toggle Creator Mode', shortcut: '⌘⇧C', icon: <Command size={14} />, category: 'Modo' },
117
+ { id: 'toggle-sidebar', label: 'Toggle Sidebar', shortcut: '⌘B', icon: <ArrowRight size={14} />, category: 'Modo' },
118
+ { id: 'toggle-canvas', label: 'Toggle Canvas', shortcut: '⌘⇧V', icon: <Package size={14} />, category: 'Modo' },
119
+ { id: 'toggle-immersive', label: 'Modo Inmersivo', shortcut: '⌘⇧F', icon: <Maximize2 size={14} />, category: 'Modo' },
120
+ // ── Presets ──
121
+ { id: 'preset:creator', label: 'Preset: Creator', shortcut: '', icon: <Layout size={14} />, category: 'Layout' },
122
+ { id: 'preset:player', label: 'Preset: Player', shortcut: '', icon: <Layout size={14} />, category: 'Layout' },
123
+ { id: 'preset:minimal', label: 'Preset: Minimal', shortcut: '', icon: <Layout size={14} />, category: 'Layout' },
124
+ { id: 'preset:studio', label: 'Preset: Studio', shortcut: '', icon: <Layout size={14} />, category: 'Layout' },
125
+ { id: 'reset-layout', label: 'Reset Layout', shortcut: '', icon: <RotateCcw size={14} />, category: 'Layout' },
126
+ // ── Slot Assignments ──
127
+ { id: 'slot:R1:chat', label: 'R1 → Chat', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
128
+ { id: 'slot:R1:debug', label: 'R1 → Debug', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
129
+ { id: 'slot:R3:graph-editor', label: 'R3 → Graph Editor', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
130
+ { id: 'slot:R3:canvas', label: 'R3 → Canvas', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
131
+ { id: 'slot:R4:terminal', label: 'R4 → Terminal', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
132
+ { id: 'slot:R4:debug', label: 'R4 → Debug', shortcut: '', icon: <Grid3X3 size={14} />, category: 'Slots' },
133
+ // ── Custom Tools ──
134
+ { id: 'open:omnichannel', label: 'Abrir Bandeja Omnicanal (WhatsApp)', shortcut: '', icon: <MessageSquare size={14} />, category: 'Herramientas' },
135
+ ];
136
+
137
+ const filteredActions = omnibarQuery
138
+ ? quickActions.filter((a) =>
139
+ a.label.toLowerCase().includes(omnibarQuery.toLowerCase())
140
+ )
141
+ : quickActions;
142
+
143
+ return (
144
+ <>
145
+ {/* ── OMNIBAR OVERLAY ── */}
146
+ <AnimatePresence>
147
+ {isOmnibarOpen && (
148
+ <>
149
+ {/* Backdrop */}
150
+ <motion.div
151
+ initial={{ opacity: 0 }}
152
+ animate={{ opacity: 1 }}
153
+ exit={{ opacity: 0 }}
154
+ onClick={() => setIsOmnibarOpen(false)}
155
+ className="fixed inset-0 bg-surface-overlay backdrop-blur-xs z-9998"
156
+ />
157
+
158
+ {/* Omnibar Panel */}
159
+ <motion.div
160
+ initial={{ opacity: 0, y: -20, scale: 0.95 }}
161
+ animate={{ opacity: 1, y: 0, scale: 1 }}
162
+ exit={{ opacity: 0, y: -20, scale: 0.95 }}
163
+ transition={{ type: 'spring', damping: 25, stiffness: 300 }}
164
+ className="fixed top-[15%] left-1/2 -translate-x-1/2 w-[540px] max-w-[90vw] z-9999
165
+ bg-surface-tertiary border border-border-default rounded-2xl shadow-2xl overflow-hidden"
166
+ >
167
+ {/* Search Input */}
168
+ <div className="flex items-center gap-3 px-4 py-3 border-b border-border-subtle">
169
+ <Search size={18} className="text-text-muted shrink-0" />
170
+ <input
171
+ ref={inputRef}
172
+ value={omnibarQuery}
173
+ onChange={(e) => setOmnibarQuery(e.target.value)}
174
+ placeholder="Buscar comandos, slots, plugins..."
175
+ className="flex-1 bg-transparent text-text-primary text-sm outline-hidden placeholder:text-text-muted"
176
+ />
177
+ <kbd className="text-[10px] text-text-muted bg-surface-glass px-1.5 py-0.5 rounded border border-border-default font-mono">
178
+ ESC
179
+ </kbd>
180
+ </div>
181
+
182
+ {/* Actions List */}
183
+ <div className="max-h-[300px] overflow-y-auto p-2">
184
+ {filteredActions.map((action) => (
185
+ <button
186
+ key={action.id}
187
+ onClick={() => handleSelect(action.id)}
188
+ className="w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm
189
+ text-text-secondary hover:text-text-primary hover:bg-surface-glass transition-colors group"
190
+ >
191
+ <span className="w-6 h-6 rounded-lg bg-surface-glass flex items-center justify-center
192
+ group-hover:bg-cyan-500/10 group-hover:text-cyan-400 transition-colors">
193
+ {action.icon}
194
+ </span>
195
+ <span className="flex-1 text-left">{action.label}</span>
196
+ {action.shortcut && (
197
+ <kbd className="text-[10px] text-text-muted font-mono">{action.shortcut}</kbd>
198
+ )}
199
+ </button>
200
+ ))}
201
+ {filteredActions.length === 0 && (
202
+ <div className="text-center py-8 text-text-muted text-sm">
203
+ No se encontraron comandos para "{omnibarQuery}"
204
+ </div>
205
+ )}
206
+ </div>
207
+
208
+ {/* Footer */}
209
+ <div className="flex items-center justify-between px-4 py-2 border-t border-border-subtle text-[10px] text-text-muted">
210
+ <span>⌘K para abrir · ESC para cerrar</span>
211
+ <span className="flex items-center gap-1">
212
+ <span className="w-1.5 h-1.5 rounded-full bg-emerald-500/60" />
213
+ Decido OS
214
+ </span>
215
+ </div>
216
+ </motion.div>
217
+ </>
218
+ )}
219
+ </AnimatePresence>
220
+
221
+ {/* ── PLUGIN OVERLAYS ── */}
222
+ {overlayWidgets.map(w => {
223
+ const Component = w.component;
224
+ return <Component key={w.id} />;
225
+ })}
226
+ </>
227
+ );
228
+ }