@decido/shell 1.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/package.json +27 -18
- package/.turbo/turbo-build.log +0 -13
- package/src/AgentPlayer.tsx +0 -105
- package/src/DecidoPlayer.tsx +0 -117
- package/src/bridge/BridgeAgent.ts +0 -443
- package/src/components/DecidoIcon.tsx +0 -56
- package/src/components/JsonTreeEditor.tsx +0 -117
- package/src/components/PanelSplitter.tsx +0 -71
- package/src/components/PluginErrorBoundary.tsx +0 -69
- package/src/components/SafeLiquidUI.tsx +0 -114
- package/src/components/TransientLayer.tsx +0 -92
- package/src/components/agent/AgentChat.tsx +0 -134
- package/src/components/chat-extensions/IntentCatalogPanel.tsx +0 -81
- package/src/components/chat-extensions/chatSlashCommands.ts +0 -101
- package/src/components/controls/CreatorInputBar.tsx +0 -144
- package/src/components/controls/OSToolbar.tsx +0 -90
- package/src/components/controls/TimelineTape.tsx +0 -43
- package/src/components/debug/ActionTimelineTab.tsx +0 -111
- package/src/components/debug/CSSInspectorTab.tsx +0 -436
- package/src/components/debug/ExportTab.tsx +0 -192
- package/src/components/debug/FlowHealthTab.tsx +0 -86
- package/src/components/debug/LogsTab.tsx +0 -110
- package/src/components/debug/MorphStackTab.tsx +0 -241
- package/src/components/debug/NetworkTab.tsx +0 -173
- package/src/components/debug/PerformanceTab.tsx +0 -171
- package/src/components/debug/ProfilesTab.tsx +0 -238
- package/src/components/debug/ReplayTab.tsx +0 -70
- package/src/components/debug/StoresTab.tsx +0 -255
- package/src/components/debug/TopologyTab.tsx +0 -59
- package/src/components/debug/debugConfig.tsx +0 -66
- package/src/components/playground/DebugPanel.tsx +0 -112
- package/src/components/playground/HeaderCenterControls.tsx +0 -92
- package/src/components/playground/KeyframeListItem.tsx +0 -70
- package/src/components/playground/PlaygroundAppSidebar.tsx +0 -171
- package/src/components/playground/PlaygroundBottomControls.tsx +0 -132
- package/src/components/playground/PlaygroundCanvas.tsx +0 -87
- package/src/components/playground/PlaygroundChat.tsx +0 -236
- package/src/components/playground/PlaygroundErrorBoundary.tsx +0 -63
- package/src/components/playground/PlaygroundFloatingInput.tsx +0 -352
- package/src/components/playground/PlaygroundHeader.tsx +0 -222
- package/src/components/playground/PlaygroundSidebar.tsx +0 -136
- package/src/components/playground/PlaygroundTerminal.tsx +0 -44
- package/src/components/playground/SuggestionCards.tsx +0 -29
- package/src/components/playground/demos/ClinicaAINode.tsx +0 -221
- package/src/components/playground/demos/FinanceAINode.tsx +0 -226
- package/src/components/playground/demos/KiaAcademyNode.tsx +0 -250
- package/src/components/playground/demos/KiaBotNode.tsx +0 -207
- package/src/components/playground/demos/KiaCampaignNode.tsx +0 -191
- package/src/components/playground/demos/KiaComplianceNode.tsx +0 -140
- package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +0 -220
- package/src/components/playground/demos/KiaCyberNode.tsx +0 -203
- package/src/components/playground/demos/KiaDashboardNode.tsx +0 -399
- package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +0 -168
- package/src/components/playground/demos/KiaExecutiveNode.tsx +0 -169
- package/src/components/playground/demos/KiaGamificationNode.tsx +0 -229
- package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +0 -165
- package/src/components/playground/demos/KiaInventoryNode.tsx +0 -183
- package/src/components/playground/demos/KiaLeadScoringNode.tsx +0 -226
- package/src/components/playground/demos/KiaLiveSimulationNode.tsx +0 -177
- package/src/components/playground/demos/KiaMultiDealerNode.tsx +0 -223
- package/src/components/playground/demos/KiaNPSVoiceNode.tsx +0 -214
- package/src/components/playground/demos/KiaOmnichannelNode.tsx +0 -162
- package/src/components/playground/demos/KiaPBIBudgetNode.tsx +0 -152
- package/src/components/playground/demos/KiaPBIConversionNode.tsx +0 -206
- package/src/components/playground/demos/KiaPBIFunnelNode.tsx +0 -184
- package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +0 -113
- package/src/components/playground/demos/KiaPBIPartnerNode.tsx +0 -143
- package/src/components/playground/demos/KiaPBIPreciosNode.tsx +0 -120
- package/src/components/playground/demos/KiaPBIRuntNode.tsx +0 -205
- package/src/components/playground/demos/KiaPartnerScoreNode.tsx +0 -206
- package/src/components/playground/demos/KiaPredictiveNode.tsx +0 -226
- package/src/components/playground/demos/KiaShowroomNode.tsx +0 -194
- package/src/components/playground/demos/KiaStoreNode.tsx +0 -215
- package/src/components/playground/demos/KiaSustainabilityNode.tsx +0 -173
- package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +0 -163
- package/src/components/playground/demos/KiaWorkshopNode.tsx +0 -221
- package/src/components/playground/demos/SmartCityNode.tsx +0 -205
- package/src/components/playground/demos/kia_campaign_manifest.json +0 -112
- package/src/components/playground/input-parts/AIModelSelector.tsx +0 -156
- package/src/components/playground/input-parts/InputActions.tsx +0 -80
- package/src/components/playground/input-parts/InputToolbar.tsx +0 -245
- package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +0 -287
- package/src/components/playground/sidebarDsdIO.ts +0 -82
- package/src/components/settings/SettingsPanel.tsx +0 -267
- package/src/components/shell/AppHeader.tsx +0 -9
- package/src/components/shell/AppShell.tsx +0 -139
- package/src/components/shell/ArtifactBar.tsx +0 -97
- package/src/components/shell/BootScreen.tsx +0 -19
- package/src/components/shell/CenterComposite.tsx +0 -87
- package/src/components/shell/CodeEditorPanel.tsx +0 -88
- package/src/components/shell/GlobalOverlays.tsx +0 -228
- package/src/components/shell/LayoutConfigurator.tsx +0 -209
- package/src/components/shell/LayoutGrid.tsx +0 -178
- package/src/components/shell/MorphShell.tsx +0 -368
- package/src/components/shell/PluginViewer.tsx +0 -147
- package/src/components/shell/ShellNexusPreview.tsx +0 -458
- package/src/components/shell/SlotRenderer.tsx +0 -115
- package/src/components/shell/TabBar.tsx +0 -94
- package/src/components/shell/TemplateLibrary.tsx +0 -195
- package/src/components/shell/layoutConstants.ts +0 -35
- package/src/components/shell/morphStageMeta.ts +0 -15
- package/src/components/shell/shells/BuiltInShells.tsx +0 -443
- package/src/components/shell/shells/DatawayChatShell.tsx +0 -42
- package/src/components/shell/shells/TokenPreview.tsx +0 -339
- package/src/components/shell/shells/bootShells.ts +0 -31
- package/src/components/shells/CreatorShell.tsx +0 -37
- package/src/components/shells/DecidoShell.tsx +0 -447
- package/src/components/shells/ExperimentalChatShell.tsx +0 -245
- package/src/components/shells/UserCanvas.tsx +0 -44
- package/src/components/studio/BlueprintManagerPanel.tsx +0 -137
- package/src/components/studio/DependencyTreePanel.tsx +0 -192
- package/src/components/studio/NodePalette.tsx +0 -92
- package/src/components/studio/NodePropertiesPanel.tsx +0 -81
- package/src/components/studio/ReactFlowEditor.tsx +0 -242
- package/src/components/studio/TimelineEditor.tsx +0 -122
- package/src/components/studio/TimelineKeyframeCard.tsx +0 -99
- package/src/components/studio/VariablePanel.tsx +0 -181
- package/src/components/studio/blueprint/BlueprintCard.tsx +0 -82
- package/src/components/studio/editor/CanvasContextMenu.tsx +0 -107
- package/src/components/studio/editor/EditorToolbar.tsx +0 -80
- package/src/components/studio/editor/StageContentRenderer.tsx +0 -134
- package/src/components/studio/editor/TrackPropertyEditors.tsx +0 -133
- package/src/components/studio/editor/TreeNodeItem.tsx +0 -91
- package/src/components/studio/editor/edgeStyles.ts +0 -43
- package/src/components/studio/editor/editorKeyHandler.ts +0 -95
- package/src/components/studio/editor/nodeTypeRegistry.ts +0 -137
- package/src/components/studio/editor/paletteCatalog.tsx +0 -84
- package/src/components/studio/nodes/shell/InteractionNodes.tsx +0 -82
- package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +0 -69
- package/src/components/studio/nodes/shell/RegisterActionNode.tsx +0 -20
- package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +0 -22
- package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +0 -19
- package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +0 -19
- package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +0 -22
- package/src/components/studio/nodes/shell/RegisterTabNode.tsx +0 -21
- package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +0 -22
- package/src/components/studio/nodes/shell/ShellConfigNode.tsx +0 -51
- package/src/components/studio/nodes/shell/ShellNodeBase.tsx +0 -100
- package/src/components/studio/nodes/shell/ThemeNodes.tsx +0 -51
- package/src/components/studio/nodes/shell/index.ts +0 -12
- package/src/components/widgets/BroadcastWidget.tsx +0 -93
- package/src/components/widgets/MarketplaceWidget.tsx +0 -298
- package/src/components/widgets/McpToolsWidget.tsx +0 -231
- package/src/components/widgets/OpsDashboard.tsx +0 -59
- package/src/components/widgets/QuickActionsWidget.tsx +0 -60
- package/src/components/widgets/UsageWidget.tsx +0 -112
- package/src/components/widgets/WidgetRenderer.tsx +0 -892
- package/src/components/widgets/WidgetSlotPanel.tsx +0 -213
- package/src/config/IconRegistry.ts +0 -126
- package/src/contexts/NetworkProvider.tsx +0 -162
- package/src/core/AIDirector.ts +0 -71
- package/src/core/EventBus.ts +0 -37
- package/src/core/PluginContext.tsx +0 -141
- package/src/hooks/listeners/useUIStateListener.ts +0 -59
- package/src/hooks/listeners/useWhatsAppListener.ts +0 -110
- package/src/hooks/morphBridge.ts +0 -82
- package/src/hooks/useAIModelSelector.ts +0 -144
- package/src/hooks/useAgentStream.ts +0 -220
- package/src/hooks/useAutoUpdater.ts +0 -89
- package/src/hooks/useBootSequence.ts +0 -20
- package/src/hooks/useExportDSD.ts +0 -53
- package/src/hooks/useFullscreen.ts +0 -35
- package/src/hooks/useGeminiStream.ts +0 -282
- package/src/hooks/useIntentLens.ts +0 -224
- package/src/hooks/useKeyboardShortcuts.ts +0 -69
- package/src/hooks/useLoggerBridge.ts +0 -32
- package/src/hooks/useMcpClient.ts +0 -112
- package/src/hooks/useNexusaiDeploy.ts +0 -118
- package/src/hooks/usePlaybackEngine.ts +0 -21
- package/src/hooks/usePlaygroundCommander.ts +0 -475
- package/src/hooks/usePluginEngine.ts +0 -165
- package/src/hooks/useScreenRecorder.ts +0 -73
- package/src/hooks/useShellKeyboard.ts +0 -40
- package/src/hooks/useShellShortcuts.ts +0 -118
- package/src/hooks/useSoundEffects.ts +0 -35
- package/src/hooks/useStudioConfig.ts +0 -72
- package/src/hooks/useSystemBoot.ts +0 -84
- package/src/hooks/useSystemTelemetry.ts +0 -62
- package/src/index.ts +0 -97
- package/src/lib/debugLogger.ts +0 -80
- package/src/lib/networkInterceptor.ts +0 -100
- package/src/mocks/decido.tsx +0 -41
- package/src/plugins/pluginAPI.ts +0 -190
- package/src/store/McpStore.ts +0 -69
- package/src/store/UpdaterStore.ts +0 -60
- package/src/store/engine.ts +0 -392
- package/src/store/index.ts +0 -4
- package/src/store/layoutPresets.ts +0 -66
- package/src/store/playgroundTypes.ts +0 -98
- package/src/store/useActionTimelineStore.ts +0 -48
- package/src/store/useDebugPanelStore.ts +0 -98
- package/src/store/useDebugProfileStore.ts +0 -130
- package/src/store/useLayoutStore.ts +0 -205
- package/src/store/useMorphInstanceStore.ts +0 -289
- package/src/store/useMorphologyStore.ts +0 -103
- package/src/store/usePlaygroundStore.ts +0 -236
- package/src/store/useShellRegistry.ts +0 -123
- package/src/store/useSuggestionsStore.ts +0 -57
- package/src/store/useThemeStore.ts +0 -399
- package/src/store/useUIComponentStore.ts +0 -179
- package/src/types/DecidoStoryDefinition.ts +0 -43
- package/src/utils/ai/ai-architect.ts +0 -92
- package/src/utils/ai/ai-code.ts +0 -187
- package/src/utils/ai/ai-core.ts +0 -50
- package/src/utils/ai/ai-media.ts +0 -292
- package/src/utils/layoutGraph.ts +0 -67
- package/tsconfig.json +0 -17
- package/tsconfig.tsbuildinfo +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 🚀 @decido/shell
|
|
2
|
+
|
|
3
|
+
> Decido OS Shell — Main facade: UI composition, morphology, auth, overlays, adapters
|
|
4
|
+
|
|
5
|
+
Bienvenido a la documentación oficial de **@decido/shell**, un componente integral del ecosistema **Decido OS**.
|
|
6
|
+
|
|
7
|
+
## 📦 Instalación
|
|
8
|
+
|
|
9
|
+
Para aprovisionar este módulo dentro de otra área del monorepo o consumirlo remotamente:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @decido/shell
|
|
13
|
+
# o mediante el gestor oficial del monorepo
|
|
14
|
+
pnpm add @decido/shell
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 🔧 Estructura y Dependencias
|
|
18
|
+
|
|
19
|
+
Este paquete está diseñado para interoperar de forma nativa con la infraestructura central.
|
|
20
|
+
Para su correcto funcionamiento en un entorno aislado (Sandboxed), se apoya en los siguientes cimientos tecnológicos:
|
|
21
|
+
|
|
22
|
+
- `react`
|
|
23
|
+
- `react-dom`
|
|
24
|
+
- `@decido/canvas-core`
|
|
25
|
+
- `@decido/commands`
|
|
26
|
+
- `@decido/chat`
|
|
27
|
+
|
|
28
|
+
## 🔐 Licencia y Privacidad
|
|
29
|
+
El código de este componente se encuentra auditado y restringido (Sin Sourcemaps).
|
|
30
|
+
Propiedad Intelectual Protegida - Framework Decido OS.
|
|
31
|
+
Distribuido bajo licencia **UNLICENSED**.
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decido/shell",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Decido OS Shell — Main facade: UI composition, morphology, auth, overlays, adapters",
|
|
5
|
-
"main": "./
|
|
6
|
-
"types": "
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
|
-
".":
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.mjs"
|
|
13
|
+
}
|
|
9
14
|
},
|
|
10
15
|
"dependencies": {
|
|
11
16
|
"@noble/curves": "^2.0.1",
|
|
@@ -28,19 +33,19 @@
|
|
|
28
33
|
"y-websocket": "^1.5.4",
|
|
29
34
|
"yjs": "^13.6.29",
|
|
30
35
|
"zustand": "^4.5.2",
|
|
31
|
-
"@decido/
|
|
32
|
-
"@decido/
|
|
33
|
-
"@decido/kernel-bridge": "
|
|
34
|
-
"@decido/logger": "^
|
|
35
|
-
"@decido/
|
|
36
|
-
"@decido/
|
|
37
|
-
"@decido/
|
|
38
|
-
"@decido/shell-
|
|
39
|
-
"@decido/
|
|
40
|
-
"@decido/
|
|
41
|
-
"@decido/chat": "
|
|
42
|
-
"@decido/
|
|
43
|
-
"@decido/
|
|
36
|
+
"@decido/core": "4.0.2",
|
|
37
|
+
"@decido/commands": "4.0.2",
|
|
38
|
+
"@decido/kernel-bridge": "4.0.2",
|
|
39
|
+
"@decido/logger": "^4.0.2",
|
|
40
|
+
"@decido/sentinel-browser": "4.0.2",
|
|
41
|
+
"@decido/canvas-core": "4.0.2",
|
|
42
|
+
"@decido/shell-auth": "4.0.2",
|
|
43
|
+
"@decido/shell-telemetry": "4.0.2",
|
|
44
|
+
"@decido/plugin-engine": "4.0.2",
|
|
45
|
+
"@decido/sdk": "4.0.2",
|
|
46
|
+
"@decido/chat": "4.0.2",
|
|
47
|
+
"@decido/engine": "4.0.2",
|
|
48
|
+
"@decido/macia-core": "4.0.2"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
51
|
"@types/react": "^18.2.0",
|
|
@@ -58,8 +63,12 @@
|
|
|
58
63
|
"access": "public"
|
|
59
64
|
},
|
|
60
65
|
"license": "UNLICENSED",
|
|
66
|
+
"files": [
|
|
67
|
+
"dist"
|
|
68
|
+
],
|
|
69
|
+
"module": "./dist/index.mjs",
|
|
61
70
|
"scripts": {
|
|
62
71
|
"lint": "eslint \"src/**/*.ts*\"",
|
|
63
|
-
"build": "tsup src/index.ts --format esm
|
|
72
|
+
"build": "tsup src/index.ts --format esm,cjs"
|
|
64
73
|
}
|
|
65
74
|
}
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Debugger listening on ws://127.0.0.1:49814/b16f304e-fd53-46c9-b073-7a75b1b9a411
|
|
3
|
-
For help, see: https://nodejs.org/en/docs/inspector
|
|
4
|
-
Debugger attached.
|
|
5
|
-
|
|
6
|
-
> @decido/shell@1.0.0 build /Users/julioramirez/dev/active/OnBoardingDecido/packages/shell
|
|
7
|
-
> tsc
|
|
8
|
-
|
|
9
|
-
Debugger listening on ws://127.0.0.1:49820/ba1bb555-8ad1-42ff-8292-b704d6166a48
|
|
10
|
-
For help, see: https://nodejs.org/en/docs/inspector
|
|
11
|
-
Debugger attached.
|
|
12
|
-
Waiting for the debugger to disconnect...
|
|
13
|
-
Waiting for the debugger to disconnect...
|
package/src/AgentPlayer.tsx
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { Panel, Group as PanelGroup } from 'react-resizable-panels';
|
|
3
|
-
import { AgentChat, AgentMessage } from './components/agent/AgentChat';
|
|
4
|
-
import { NetworkProvider } from './contexts/NetworkProvider';
|
|
5
|
-
|
|
6
|
-
export default function AgentPlayer({ socketInstance }: { socketInstance?: any }) {
|
|
7
|
-
const [messages, setMessages] = useState<AgentMessage[]>([]);
|
|
8
|
-
const [isGenerating, setIsGenerating] = useState(false);
|
|
9
|
-
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (!socketInstance) return;
|
|
12
|
-
|
|
13
|
-
const handleOrchestratorEvent = (event: any) => {
|
|
14
|
-
console.log('[AgentPlayer] Recibido orchestrator-event:', event);
|
|
15
|
-
|
|
16
|
-
// Filtramos eventos relevantes del stream del agente o arenas
|
|
17
|
-
if (event.event_type === 'AgentStreamEvent' && event.data) {
|
|
18
|
-
const streamData = event.data;
|
|
19
|
-
const agentId = event.agent_id || 'decido-agent';
|
|
20
|
-
|
|
21
|
-
setMessages(prev => {
|
|
22
|
-
// Buscar si ya hay un mensaje en curso para este agente (el último)
|
|
23
|
-
const lastMsg = prev[prev.length - 1];
|
|
24
|
-
const isSameAgent = lastMsg && lastMsg.role === 'agent' && lastMsg.id === agentId;
|
|
25
|
-
|
|
26
|
-
let newToolCalls = isSameAgent ? [...(lastMsg.toolCalls || [])] : [];
|
|
27
|
-
let newText = isSameAgent ? lastMsg.text : '';
|
|
28
|
-
|
|
29
|
-
if (streamData.type === 'Think') {
|
|
30
|
-
// El chunk de pensamiento se concatena al texto
|
|
31
|
-
newText += streamData.content;
|
|
32
|
-
} else if (streamData.type === 'ToolCall') {
|
|
33
|
-
// Se mandó a ejecutar una tool
|
|
34
|
-
newToolCalls.push({
|
|
35
|
-
name: streamData.tool_name || 'unknown_tool',
|
|
36
|
-
args: streamData.tool_args || {},
|
|
37
|
-
status: 'running'
|
|
38
|
-
});
|
|
39
|
-
} else if (streamData.type === 'ToolResult') {
|
|
40
|
-
// El resultado de una tool altera el status de la última tool agregada
|
|
41
|
-
if (newToolCalls.length > 0) {
|
|
42
|
-
newToolCalls[newToolCalls.length - 1].status = 'success';
|
|
43
|
-
newToolCalls[newToolCalls.length - 1].output = streamData.content;
|
|
44
|
-
}
|
|
45
|
-
} else if (streamData.type === 'Message') {
|
|
46
|
-
newText += streamData.content;
|
|
47
|
-
setIsGenerating(false);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (isSameAgent) {
|
|
51
|
-
const updated = [...prev];
|
|
52
|
-
updated[updated.length - 1] = { ...lastMsg, text: newText, toolCalls: newToolCalls };
|
|
53
|
-
return updated;
|
|
54
|
-
} else {
|
|
55
|
-
return [...prev, { id: agentId, role: 'agent', text: newText, toolCalls: newToolCalls }];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
} else if (event.event_type === 'SpawnAgentRequest') {
|
|
59
|
-
setIsGenerating(true);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
socketInstance.on('orchestrator-event', handleOrchestratorEvent);
|
|
64
|
-
return () => {
|
|
65
|
-
socketInstance.off('orchestrator-event', handleOrchestratorEvent);
|
|
66
|
-
};
|
|
67
|
-
}, [socketInstance]);
|
|
68
|
-
|
|
69
|
-
const handleSendMessage = (text: string) => {
|
|
70
|
-
if (!text.trim() || !socketInstance) return;
|
|
71
|
-
|
|
72
|
-
const newUserMsg: AgentMessage = { id: Date.now().toString(), role: 'user', text };
|
|
73
|
-
setMessages(prev => [...prev, newUserMsg]);
|
|
74
|
-
setIsGenerating(true);
|
|
75
|
-
|
|
76
|
-
socketInstance.emit('rpc_call', {
|
|
77
|
-
cmd: 'send_message',
|
|
78
|
-
args: {
|
|
79
|
-
from: 'AgentPlayerUI',
|
|
80
|
-
to: 'dev-master',
|
|
81
|
-
intent: 'chat_request',
|
|
82
|
-
payload: text,
|
|
83
|
-
priority: 'High'
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<NetworkProvider socketInstance={socketInstance} isConnected={!!socketInstance?.connected}>
|
|
90
|
-
<div className="bg-surface-primary flex font-sans relative overflow-hidden text-text-primary rounded-xl border border-border-default shadow-lg w-full h-[800px]">
|
|
91
|
-
<PanelGroup orientation="horizontal" className="flex-1 w-full h-full relative z-20">
|
|
92
|
-
<Panel id="agent-chat" defaultSize={100} minSize={30} className="flex flex-col relative h-full bg-surface-primary">
|
|
93
|
-
<div className="flex-1 w-full relative z-20 overflow-hidden flex flex-col pt-4">
|
|
94
|
-
<AgentChat
|
|
95
|
-
messages={messages}
|
|
96
|
-
onSendMessage={handleSendMessage}
|
|
97
|
-
isGenerating={isGenerating}
|
|
98
|
-
/>
|
|
99
|
-
</div>
|
|
100
|
-
</Panel>
|
|
101
|
-
</PanelGroup>
|
|
102
|
-
</div>
|
|
103
|
-
</NetworkProvider>
|
|
104
|
-
);
|
|
105
|
-
}
|
package/src/DecidoPlayer.tsx
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState, useMemo } from 'react';
|
|
2
|
-
import { Panel, Group as PanelGroup, Separator as PanelResizeHandle } from 'react-resizable-panels';
|
|
3
|
-
import { usePlaygroundStore } from './store/usePlaygroundStore';
|
|
4
|
-
import { useEngineStore } from '@decido/engine';
|
|
5
|
-
import { useTimelineStore } from '@decido/engine';
|
|
6
|
-
import { useUIStateListener } from './hooks/listeners/useUIStateListener';
|
|
7
|
-
import { usePlaybackSimulator } from '@decido/engine';
|
|
8
|
-
import { PlaygroundChat } from './components/playground/PlaygroundChat';
|
|
9
|
-
import { PlaygroundCanvas } from './components/playground/PlaygroundCanvas';
|
|
10
|
-
import { PlaygroundErrorBoundary } from './components/playground/PlaygroundErrorBoundary';
|
|
11
|
-
import { NetworkProvider } from './contexts/NetworkProvider';
|
|
12
|
-
import { DecidoStudioProps } from '@decido/engine';
|
|
13
|
-
import { SimulationTape } from '@decido/engine';
|
|
14
|
-
import { useRef } from 'react';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* DecidoPlayer Embebido
|
|
18
|
-
* Phase H: Runtime completo — auto-inicia flujos, ejecuta render nodes con formularios,
|
|
19
|
-
* y soporta toda la lógica del motor (condicionales, triggers, subflows).
|
|
20
|
-
*/
|
|
21
|
-
export default function DecidoPlayer({ aiProvider, VoiceWidget, config, socketInstance, width = '100%', height = '100%' }: DecidoStudioProps & { width?: string, height?: string }) {
|
|
22
|
-
|
|
23
|
-
// Core state
|
|
24
|
-
const { step, selectedProfile, isBooting, prototypeBrand, setInputValue } = usePlaygroundStore();
|
|
25
|
-
const { resetEngine } = useEngineStore();
|
|
26
|
-
const setActiveTimeline = useTimelineStore(state => state.setActiveTimeline);
|
|
27
|
-
|
|
28
|
-
// Listen to UI state nodes emitting in the timeline
|
|
29
|
-
const { demoState, showCanvas, setShowCanvas } = useUIStateListener();
|
|
30
|
-
const dragConstraintsRef = useRef<HTMLDivElement>(null);
|
|
31
|
-
|
|
32
|
-
// Auto-start: mock tape dispatches SYSTEM_START at t=0.1s
|
|
33
|
-
const mockTape: SimulationTape = useMemo(() => ({
|
|
34
|
-
id: `tape-${prototypeBrand}`,
|
|
35
|
-
events: [
|
|
36
|
-
{ t: 0.1, event: { type: 'SYSTEM_START' }, description: "Arranque Automático (Player)" }
|
|
37
|
-
]
|
|
38
|
-
}), [prototypeBrand]);
|
|
39
|
-
|
|
40
|
-
const { isPlaying, setIsPlaying, resetSimulation } = usePlaybackSimulator(mockTape);
|
|
41
|
-
|
|
42
|
-
// Sync active timeline + auto-start on brand change
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
setActiveTimeline(prototypeBrand);
|
|
45
|
-
resetEngine();
|
|
46
|
-
resetSimulation();
|
|
47
|
-
// Small delay to let store settle before starting playback
|
|
48
|
-
const timer = setTimeout(() => setIsPlaying(true), 100);
|
|
49
|
-
return () => clearTimeout(timer);
|
|
50
|
-
}, [prototypeBrand]);
|
|
51
|
-
|
|
52
|
-
const safeConfig = config || { environments: {}, voices: [] };
|
|
53
|
-
const activeConfig = (safeConfig.environments as Record<string, any>)[prototypeBrand] ||
|
|
54
|
-
Object.values(safeConfig.environments)[0] || {};
|
|
55
|
-
|
|
56
|
-
const [suggestions, setSuggestions] = useState<any[]>([]);
|
|
57
|
-
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
setSuggestions(prev => {
|
|
60
|
-
const next = activeConfig.suggestions || [];
|
|
61
|
-
if (JSON.stringify(prev) === JSON.stringify(next)) return prev;
|
|
62
|
-
return next;
|
|
63
|
-
});
|
|
64
|
-
}, [activeConfig.suggestions]);
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<NetworkProvider socketInstance={socketInstance} isConnected={!!socketInstance?.connected}>
|
|
68
|
-
<div style={{ width, height }} className="bg-surface-primary flex font-sans relative overflow-hidden text-text-primary rounded-xl border border-border-default shadow-lg">
|
|
69
|
-
<PanelGroup orientation="horizontal" className="flex-1 w-full h-full relative z-20">
|
|
70
|
-
|
|
71
|
-
{/* LEFT CHAT PANEL */}
|
|
72
|
-
<Panel id="player-chat" defaultSize={showCanvas ? 60 : 100} minSize={30} className="flex flex-col relative h-full bg-surface-primary">
|
|
73
|
-
<div className="flex-1 w-full relative z-20 overflow-hidden flex flex-col">
|
|
74
|
-
<PlaygroundErrorBoundary fallbackName="Motor de Chat (Player)">
|
|
75
|
-
<PlaygroundChat
|
|
76
|
-
step={step}
|
|
77
|
-
selectedProfile={selectedProfile}
|
|
78
|
-
authAvailableLicenses={[]}
|
|
79
|
-
handleProfileSelect={() => {}}
|
|
80
|
-
activeConfig={activeConfig}
|
|
81
|
-
demoState={demoState}
|
|
82
|
-
suggestions={suggestions}
|
|
83
|
-
setInputValue={setInputValue}
|
|
84
|
-
isGenerating={false}
|
|
85
|
-
config={safeConfig}
|
|
86
|
-
isCreatorMode={false}
|
|
87
|
-
handleGeneratePlayground={async () => {}}
|
|
88
|
-
/>
|
|
89
|
-
</PlaygroundErrorBoundary>
|
|
90
|
-
</div>
|
|
91
|
-
</Panel>
|
|
92
|
-
|
|
93
|
-
{/* RIGHT CANVAS PANEL */}
|
|
94
|
-
{showCanvas && (
|
|
95
|
-
<>
|
|
96
|
-
<PanelResizeHandle className="w-1.5 hover:bg-cyan-500/20 active:bg-cyan-500/30 transition-colors cursor-col-resize z-40 relative group flex items-center justify-center border-l-2 border-border-subtle">
|
|
97
|
-
</PanelResizeHandle>
|
|
98
|
-
<Panel id="player-canvas" defaultSize={40} minSize={20} className="bg-surface-secondary h-full relative z-30 overflow-hidden">
|
|
99
|
-
<PlaygroundErrorBoundary fallbackName="Lienzo 3D (Player)">
|
|
100
|
-
<PlaygroundCanvas
|
|
101
|
-
showCanvas={showCanvas}
|
|
102
|
-
setShowCanvas={setShowCanvas}
|
|
103
|
-
activeConfig={activeConfig}
|
|
104
|
-
prototypeBrand={prototypeBrand}
|
|
105
|
-
activeState={demoState}
|
|
106
|
-
chartData={[]}
|
|
107
|
-
dragConstraintsRef={dragConstraintsRef}
|
|
108
|
-
/>
|
|
109
|
-
</PlaygroundErrorBoundary>
|
|
110
|
-
</Panel>
|
|
111
|
-
</>
|
|
112
|
-
)}
|
|
113
|
-
</PanelGroup>
|
|
114
|
-
</div>
|
|
115
|
-
</NetworkProvider>
|
|
116
|
-
);
|
|
117
|
-
}
|