@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.
Files changed (209) hide show
  1. package/README.md +31 -0
  2. package/package.json +27 -18
  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/index.ts +0 -97
  181. package/src/lib/debugLogger.ts +0 -80
  182. package/src/lib/networkInterceptor.ts +0 -100
  183. package/src/mocks/decido.tsx +0 -41
  184. package/src/plugins/pluginAPI.ts +0 -190
  185. package/src/store/McpStore.ts +0 -69
  186. package/src/store/UpdaterStore.ts +0 -60
  187. package/src/store/engine.ts +0 -392
  188. package/src/store/index.ts +0 -4
  189. package/src/store/layoutPresets.ts +0 -66
  190. package/src/store/playgroundTypes.ts +0 -98
  191. package/src/store/useActionTimelineStore.ts +0 -48
  192. package/src/store/useDebugPanelStore.ts +0 -98
  193. package/src/store/useDebugProfileStore.ts +0 -130
  194. package/src/store/useLayoutStore.ts +0 -205
  195. package/src/store/useMorphInstanceStore.ts +0 -289
  196. package/src/store/useMorphologyStore.ts +0 -103
  197. package/src/store/usePlaygroundStore.ts +0 -236
  198. package/src/store/useShellRegistry.ts +0 -123
  199. package/src/store/useSuggestionsStore.ts +0 -57
  200. package/src/store/useThemeStore.ts +0 -399
  201. package/src/store/useUIComponentStore.ts +0 -179
  202. package/src/types/DecidoStoryDefinition.ts +0 -43
  203. package/src/utils/ai/ai-architect.ts +0 -92
  204. package/src/utils/ai/ai-code.ts +0 -187
  205. package/src/utils/ai/ai-core.ts +0 -50
  206. package/src/utils/ai/ai-media.ts +0 -292
  207. package/src/utils/layoutGraph.ts +0 -67
  208. package/tsconfig.json +0 -17
  209. package/tsconfig.tsbuildinfo +0 -1
@@ -1,292 +0,0 @@
1
- // ═══════════════════════════════════════════════════════
2
- // AI Media — Video, Audio, Image Generation
3
- // ═══════════════════════════════════════════════════════
4
-
5
- import { Type, Modality } from "@google/genai";
6
- import { getClient, getGlobalSettings, logger } from './ai-core';
7
- import { ScriptScene } from '@decido/canvas-core';
8
-
9
- // --- WAV HELPERS ---
10
-
11
- function addWavHeader(samples: Uint8Array, sampleRate: number = 24000, numChannels: number = 1): ArrayBuffer {
12
- const buffer = new ArrayBuffer(44 + samples.length);
13
- const view = new DataView(buffer);
14
-
15
- writeString(view, 0, 'RIFF');
16
- view.setUint32(4, 36 + samples.length, true);
17
- writeString(view, 8, 'WAVE');
18
- writeString(view, 12, 'fmt ');
19
- view.setUint32(16, 16, true);
20
- view.setUint16(20, 1, true);
21
- view.setUint16(22, numChannels, true);
22
- view.setUint32(24, sampleRate, true);
23
- view.setUint32(28, sampleRate * numChannels * 2, true);
24
- view.setUint16(32, numChannels * 2, true);
25
- view.setUint16(34, 16, true);
26
- writeString(view, 36, 'data');
27
- view.setUint32(40, samples.length, true);
28
-
29
- const dataView = new Uint8Array(buffer, 44);
30
- dataView.set(samples);
31
-
32
- return buffer;
33
- }
34
-
35
- function writeString(view: DataView, offset: number, string: string) {
36
- for (let i = 0; i < string.length; i++) {
37
- view.setUint8(offset + i, string.charCodeAt(i));
38
- }
39
- }
40
-
41
- export function base64ToUint8Array(base64: string): Uint8Array {
42
- const binaryString = atob(base64);
43
- const len = binaryString.length;
44
- const bytes = new Uint8Array(len);
45
- for (let i = 0; i < len; i++) {
46
- bytes[i] = binaryString.charCodeAt(i);
47
- }
48
- return bytes;
49
- }
50
-
51
- export function arrayBufferToBase64(buffer: ArrayBuffer): string {
52
- let binary = '';
53
- const bytes = new Uint8Array(buffer);
54
- const len = bytes.byteLength;
55
- for (let i = 0; i < len; i++) {
56
- binary += String.fromCharCode(bytes[i]);
57
- }
58
- return btoa(binary);
59
- }
60
-
61
- export const blobToBase64 = (blob: Blob): Promise<string> => {
62
- return new Promise((resolve, reject) => {
63
- const reader = new FileReader();
64
- reader.onloadend = () => {
65
- const base64String = reader.result as string;
66
- const base64Data = base64String.split(',')[1];
67
- resolve(base64Data);
68
- };
69
- reader.onerror = reject;
70
- reader.readAsDataURL(blob);
71
- });
72
- };
73
-
74
-
75
- // --- VIDEO SCRIPT ---
76
-
77
- export const generateVideoScript = async (concept: string, style: string): Promise<ScriptScene[]> => {
78
- const client = getClient('text');
79
- if (!client) return [];
80
- const settings = getGlobalSettings();
81
-
82
- try {
83
- const response = await client.models.generateContent({
84
- model: settings.text.model || 'gemini-3-flash-preview',
85
- contents: `Write a 4-scene video script for: "${concept}". Style: ${style}.
86
-
87
- IMPORTANT RULES:
88
- 1. Detect the language of the concept (e.g., Spanish, French, English).
89
- 2. Write the 'narration' and 'visualPrompt' in that SAME language.
90
- 3. Return a JSON array.`,
91
- config: {
92
- responseMimeType: "application/json",
93
- responseSchema: {
94
- type: Type.ARRAY,
95
- items: {
96
- type: Type.OBJECT,
97
- properties: {
98
- sceneNumber: { type: Type.INTEGER },
99
- narration: { type: Type.STRING },
100
- visualPrompt: { type: Type.STRING },
101
- cameraAngle: { type: Type.STRING },
102
- duration: { type: Type.NUMBER }
103
- },
104
- required: ["sceneNumber", "narration", "visualPrompt", "duration"]
105
- }
106
- }
107
- }
108
- });
109
-
110
- const text = response.text;
111
- if (!text) return [];
112
- const rawScenes = JSON.parse(text);
113
-
114
- return rawScenes.map((s: any) => ({
115
- ...s,
116
- id: `scene-${Date.now()}-${Math.random()}`,
117
- status: 'idle'
118
- }));
119
-
120
- } catch (error) {
121
- logger.error("Script Gen Error:", error);
122
- return [];
123
- }
124
- };
125
-
126
- // --- IMAGE GENERATION ---
127
-
128
- export const generateKeyframe = async (prompt: string, aspectRatio: '16:9' | '9:16' | '1:1' = '16:9'): Promise<{ url: string | null; error?: string }> => {
129
- const client = getClient('image');
130
- if (!client) return { url: null, error: "API Key Config Missing" };
131
- const settings = getGlobalSettings();
132
- const selectedModel = settings.image.model || 'gemini-3-pro-image-preview';
133
-
134
- const attemptGeneration = async (model: string, config: any) => {
135
- const response = await client.models.generateContent({
136
- model: model,
137
- contents: { parts: [{ text: prompt }] },
138
- config: config
139
- });
140
- for (const part of response.candidates?.[0]?.content?.parts || []) {
141
- if (part.inlineData) {
142
- return `data:image/png;base64,${part.inlineData.data}`;
143
- }
144
- }
145
- return null;
146
- };
147
-
148
- try {
149
- const url = await attemptGeneration(selectedModel, {
150
- imageConfig: {
151
- aspectRatio: aspectRatio,
152
- imageSize: selectedModel.includes('pro') ? '1K' : undefined
153
- }
154
- });
155
- return { url };
156
-
157
- } catch (error: any) {
158
- logger.warn(`${selectedModel} failed, checking fallback...`, error);
159
-
160
- if (selectedModel.includes('pro') && (error.status === 429 || (error.message && error.message.includes('429')))) {
161
- try {
162
- const url = await attemptGeneration('gemini-2.5-flash-image', {
163
- imageConfig: { aspectRatio: aspectRatio }
164
- });
165
- if (url) return { url };
166
- } catch (fallbackError: any) {
167
- return { url: null, error: "Quota Exceeded (All Models). Try again later." };
168
- }
169
- }
170
-
171
- return { url: null, error: error.message || "Image Generation Failed" };
172
- }
173
- };
174
-
175
- // --- VIDEO GENERATION (VEO) ---
176
-
177
- export const generateVeoVideo = async (imageBase64: string, prompt: string, aspectRatio: '16:9' | '9:16' = '16:9'): Promise<{ url: string | null; error?: string }> => {
178
- const client = getClient('video');
179
- if (!client) return { url: null, error: "API Key Config Missing" };
180
- const settings = getGlobalSettings();
181
-
182
- // Check implementation specific window object if needed, skipping for shared package
183
-
184
- try {
185
- const base64Data = imageBase64.split(',')[1] || imageBase64;
186
-
187
- let operation = await client.models.generateVideos({
188
- model: settings.video.model || 'veo-3.1-generate-preview',
189
- prompt: prompt,
190
- image: {
191
- imageBytes: base64Data,
192
- mimeType: 'image/png'
193
- },
194
- config: {
195
- numberOfVideos: 1,
196
- resolution: '720p',
197
- aspectRatio: aspectRatio
198
- }
199
- });
200
-
201
- while (!operation.done) {
202
- await new Promise(resolve => setTimeout(resolve, 5000));
203
- operation = await client.operations.getVideosOperation({ operation: operation });
204
- }
205
-
206
- const videoUri = operation.response?.generatedVideos?.[0]?.video?.uri;
207
-
208
- if (videoUri) {
209
- const keyToUse = settings.video.apiKey || process.env.VITE_API_KEY;
210
- return { url: `${videoUri}&key=${keyToUse}` };
211
- }
212
- return { url: null, error: "Video generation completed but returned no URI." };
213
-
214
- } catch (error: any) {
215
- logger.error("Veo Gen Error:", error);
216
- return { url: null, error: error.message || "Video Generation Failed (Quota or Server Error)" };
217
- }
218
- };
219
-
220
- // --- SPEECH GENERATION ---
221
-
222
- export const generateSpeech = async (text: string, voiceName: string = 'Kore'): Promise<string | null> => {
223
- const client = getClient('audio');
224
- if (!client) return null;
225
- const settings = getGlobalSettings();
226
-
227
- try {
228
- const response = await client.models.generateContent({
229
- model: settings.audio.model || "gemini-2.5-flash-preview-tts",
230
- contents: [{ parts: [{ text }] }],
231
- config: {
232
- responseModalities: [Modality.AUDIO],
233
- speechConfig: {
234
- voiceConfig: {
235
- prebuiltVoiceConfig: { voiceName }
236
- },
237
- },
238
- },
239
- });
240
-
241
- const base64PCM = response.candidates?.[0]?.content?.parts?.[0]?.inlineData?.data;
242
-
243
- if (base64PCM) {
244
- const pcmData = base64ToUint8Array(base64PCM);
245
- const wavBuffer = addWavHeader(pcmData, 24000, 1);
246
- const wavBase64 = arrayBufferToBase64(wavBuffer);
247
- return `data:audio/wav;base64,${wavBase64}`;
248
- }
249
- return null;
250
- } catch (error) {
251
- logger.error("TTS Error:", error);
252
- return null;
253
- }
254
- };
255
-
256
- export const analyzeAudio = async (audioBlob: Blob, task: 'TRANSCRIPTION' | 'SUMMARY'): Promise<string> => {
257
- const client = getClient('text');
258
- if (!client) return "API Key Missing";
259
- const settings = getGlobalSettings();
260
-
261
- try {
262
- const base64Audio = await blobToBase64(audioBlob);
263
-
264
- let prompt = "";
265
- if (task === 'TRANSCRIPTION') {
266
- prompt = "Transcribe the following audio accurately. Return only the text. Detect the language automatically.";
267
- } else {
268
- prompt = "Provide a concise summary of the key points discussed in this audio. Respond in the same language as the audio.";
269
- }
270
-
271
- const response = await client.models.generateContent({
272
- model: settings.text.model || 'gemini-3-flash-preview',
273
- contents: {
274
- parts: [
275
- {
276
- inlineData: {
277
- mimeType: audioBlob.type,
278
- data: base64Audio
279
- }
280
- },
281
- { text: prompt }
282
- ]
283
- }
284
- });
285
-
286
- return response.text || "No result generated.";
287
-
288
- } catch (error) {
289
- logger.error("AI Audio Error:", error);
290
- return "Failed to process audio.";
291
- }
292
- };
@@ -1,67 +0,0 @@
1
- import Dagre from '@dagrejs/dagre';
2
- import type { Node, Edge } from '@xyflow/react';
3
-
4
- interface LayoutOptions {
5
- direction?: 'TB' | 'LR' | 'BT' | 'RL'; // Top-Bottom, Left-Right, etc.
6
- nodeWidth?: number;
7
- nodeHeight?: number;
8
- rankSep?: number; // Vertical gap between ranks
9
- nodeSep?: number; // Horizontal gap between nodes in same rank
10
- }
11
-
12
- /**
13
- * Uses Dagre to compute a hierarchical auto-layout for React Flow nodes.
14
- * Returns new nodes with updated positions. Does NOT mutate input.
15
- */
16
- export function getLayoutedElements(
17
- nodes: Node[],
18
- edges: Edge[],
19
- options: LayoutOptions = {}
20
- ): { nodes: Node[]; edges: Edge[] } {
21
- const {
22
- direction = 'TB',
23
- nodeWidth = 260,
24
- nodeHeight = 180,
25
- rankSep = 100,
26
- nodeSep = 80,
27
- } = options;
28
-
29
- const g = new Dagre.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
30
-
31
- g.setGraph({
32
- rankdir: direction,
33
- ranksep: rankSep,
34
- nodesep: nodeSep,
35
- marginx: 50,
36
- marginy: 50,
37
- });
38
-
39
- nodes.forEach((node) => {
40
- // Use actual node dimensions if available, fallback to defaults
41
- const w = (node.measured?.width) || nodeWidth;
42
- const h = (node.measured?.height) || nodeHeight;
43
- g.setNode(node.id, { width: w, height: h });
44
- });
45
-
46
- edges.forEach((edge) => {
47
- g.setEdge(edge.source, edge.target);
48
- });
49
-
50
- Dagre.layout(g);
51
-
52
- const layoutedNodes = nodes.map((node) => {
53
- const dagNode = g.node(node.id);
54
- const w = (node.measured?.width) || nodeWidth;
55
- const h = (node.measured?.height) || nodeHeight;
56
-
57
- return {
58
- ...node,
59
- position: {
60
- x: dagNode.x - w / 2,
61
- y: dagNode.y - h / 2,
62
- },
63
- };
64
- });
65
-
66
- return { nodes: layoutedNodes, edges };
67
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "strict": true,
5
- "baseUrl": ".",
6
- "paths": {
7
- "~/*": ["./src/*"],
8
- "@decido/contracts": ["../contracts/src"],
9
- "@decido/plugin-engine": ["../plugin-engine/src"],
10
- "@decido/shell-auth": ["../shell-auth/src"],
11
- "@decido/shell-telemetry": ["../shell-telemetry/src"]
12
- }
13
- },
14
- "include": [
15
- "src"
16
- ]
17
- }
@@ -1 +0,0 @@
1
- {"root":["./src/agentplayer.tsx","./src/decidoplayer.tsx","./src/index.ts","./src/bridge/bridgeagent.ts","./src/components/decidoicon.tsx","./src/components/jsontreeeditor.tsx","./src/components/panelsplitter.tsx","./src/components/pluginerrorboundary.tsx","./src/components/safeliquidui.tsx","./src/components/transientlayer.tsx","./src/components/agent/agentchat.tsx","./src/components/chat-extensions/intentcatalogpanel.tsx","./src/components/chat-extensions/chatslashcommands.ts","./src/components/controls/creatorinputbar.tsx","./src/components/controls/ostoolbar.tsx","./src/components/controls/timelinetape.tsx","./src/components/debug/actiontimelinetab.tsx","./src/components/debug/cssinspectortab.tsx","./src/components/debug/exporttab.tsx","./src/components/debug/flowhealthtab.tsx","./src/components/debug/logstab.tsx","./src/components/debug/morphstacktab.tsx","./src/components/debug/networktab.tsx","./src/components/debug/performancetab.tsx","./src/components/debug/profilestab.tsx","./src/components/debug/replaytab.tsx","./src/components/debug/storestab.tsx","./src/components/debug/topologytab.tsx","./src/components/debug/debugconfig.tsx","./src/components/playground/debugpanel.tsx","./src/components/playground/headercentercontrols.tsx","./src/components/playground/keyframelistitem.tsx","./src/components/playground/playgroundappsidebar.tsx","./src/components/playground/playgroundbottomcontrols.tsx","./src/components/playground/playgroundcanvas.tsx","./src/components/playground/playgroundchat.tsx","./src/components/playground/playgrounderrorboundary.tsx","./src/components/playground/playgroundfloatinginput.tsx","./src/components/playground/playgroundheader.tsx","./src/components/playground/playgroundsidebar.tsx","./src/components/playground/playgroundterminal.tsx","./src/components/playground/suggestioncards.tsx","./src/components/playground/sidebardsdio.ts","./src/components/playground/demos/clinicaainode.tsx","./src/components/playground/demos/financeainode.tsx","./src/components/playground/demos/kiaacademynode.tsx","./src/components/playground/demos/kiabotnode.tsx","./src/components/playground/demos/kiacampaignnode.tsx","./src/components/playground/demos/kiacompliancenode.tsx","./src/components/playground/demos/kiacustomerjourneynode.tsx","./src/components/playground/demos/kiacybernode.tsx","./src/components/playground/demos/kiadashboardnode.tsx","./src/components/playground/demos/kiaembudooverviewnode.tsx","./src/components/playground/demos/kiaexecutivenode.tsx","./src/components/playground/demos/kiagamificationnode.tsx","./src/components/playground/demos/kiaintelligencehubnode.tsx","./src/components/playground/demos/kiainventorynode.tsx","./src/components/playground/demos/kialeadscoringnode.tsx","./src/components/playground/demos/kialivesimulationnode.tsx","./src/components/playground/demos/kiamultidealernode.tsx","./src/components/playground/demos/kianpsvoicenode.tsx","./src/components/playground/demos/kiaomnichannelnode.tsx","./src/components/playground/demos/kiapbibudgetnode.tsx","./src/components/playground/demos/kiapbiconversionnode.tsx","./src/components/playground/demos/kiapbifunnelnode.tsx","./src/components/playground/demos/kiapbiownershipnode.tsx","./src/components/playground/demos/kiapbipartnernode.tsx","./src/components/playground/demos/kiapbipreciosnode.tsx","./src/components/playground/demos/kiapbiruntnode.tsx","./src/components/playground/demos/kiapartnerscorenode.tsx","./src/components/playground/demos/kiapredictivenode.tsx","./src/components/playground/demos/kiashowroomnode.tsx","./src/components/playground/demos/kiastorenode.tsx","./src/components/playground/demos/kiasustainabilitynode.tsx","./src/components/playground/demos/kiausedvehiclesnode.tsx","./src/components/playground/demos/kiaworkshopnode.tsx","./src/components/playground/demos/smartcitynode.tsx","./src/components/playground/input-parts/aimodelselector.tsx","./src/components/playground/input-parts/inputactions.tsx","./src/components/playground/input-parts/inputtoolbar.tsx","./src/components/playground/input-parts/resourcelibrarypanel.tsx","./src/components/settings/settingspanel.tsx","./src/components/shell/appheader.tsx","./src/components/shell/appshell.tsx","./src/components/shell/artifactbar.tsx","./src/components/shell/bootscreen.tsx","./src/components/shell/centercomposite.tsx","./src/components/shell/codeeditorpanel.tsx","./src/components/shell/globaloverlays.tsx","./src/components/shell/layoutconfigurator.tsx","./src/components/shell/layoutgrid.tsx","./src/components/shell/morphshell.tsx","./src/components/shell/pluginviewer.tsx","./src/components/shell/shellnexuspreview.tsx","./src/components/shell/slotrenderer.tsx","./src/components/shell/tabbar.tsx","./src/components/shell/templatelibrary.tsx","./src/components/shell/layoutconstants.ts","./src/components/shell/morphstagemeta.ts","./src/components/shell/shells/builtinshells.tsx","./src/components/shell/shells/datawaychatshell.tsx","./src/components/shell/shells/tokenpreview.tsx","./src/components/shell/shells/bootshells.ts","./src/components/shells/creatorshell.tsx","./src/components/shells/decidoshell.tsx","./src/components/shells/experimentalchatshell.tsx","./src/components/shells/usercanvas.tsx","./src/components/studio/blueprintmanagerpanel.tsx","./src/components/studio/dependencytreepanel.tsx","./src/components/studio/nodepalette.tsx","./src/components/studio/nodepropertiespanel.tsx","./src/components/studio/reactfloweditor.tsx","./src/components/studio/timelineeditor.tsx","./src/components/studio/timelinekeyframecard.tsx","./src/components/studio/variablepanel.tsx","./src/components/studio/blueprint/blueprintcard.tsx","./src/components/studio/editor/canvascontextmenu.tsx","./src/components/studio/editor/editortoolbar.tsx","./src/components/studio/editor/stagecontentrenderer.tsx","./src/components/studio/editor/trackpropertyeditors.tsx","./src/components/studio/editor/treenodeitem.tsx","./src/components/studio/editor/edgestyles.ts","./src/components/studio/editor/editorkeyhandler.ts","./src/components/studio/editor/nodetyperegistry.ts","./src/components/studio/editor/palettecatalog.tsx","./src/components/studio/nodes/shell/interactionnodes.tsx","./src/components/studio/nodes/shell/layoutcontrolnodes.tsx","./src/components/studio/nodes/shell/registeractionnode.tsx","./src/components/studio/nodes/shell/registerbuttonnode.tsx","./src/components/studio/nodes/shell/registerpanelnode.tsx","./src/components/studio/nodes/shell/registersidebarnode.tsx","./src/components/studio/nodes/shell/registerstatusbarnode.tsx","./src/components/studio/nodes/shell/registertabnode.tsx","./src/components/studio/nodes/shell/registertopbarnode.tsx","./src/components/studio/nodes/shell/shellconfignode.tsx","./src/components/studio/nodes/shell/shellnodebase.tsx","./src/components/studio/nodes/shell/themenodes.tsx","./src/components/studio/nodes/shell/index.ts","./src/components/widgets/broadcastwidget.tsx","./src/components/widgets/marketplacewidget.tsx","./src/components/widgets/mcptoolswidget.tsx","./src/components/widgets/opsdashboard.tsx","./src/components/widgets/quickactionswidget.tsx","./src/components/widgets/usagewidget.tsx","./src/components/widgets/widgetrenderer.tsx","./src/components/widgets/widgetslotpanel.tsx","./src/config/iconregistry.ts","./src/contexts/networkprovider.tsx","./src/core/aidirector.ts","./src/core/eventbus.ts","./src/core/plugincontext.tsx","./src/hooks/morphbridge.ts","./src/hooks/useaimodelselector.ts","./src/hooks/useagentstream.ts","./src/hooks/useautoupdater.ts","./src/hooks/usebootsequence.ts","./src/hooks/useexportdsd.ts","./src/hooks/usefullscreen.ts","./src/hooks/usegeministream.ts","./src/hooks/useintentlens.ts","./src/hooks/usekeyboardshortcuts.ts","./src/hooks/useloggerbridge.ts","./src/hooks/usemcpclient.ts","./src/hooks/usenexusaideploy.ts","./src/hooks/useplaybackengine.ts","./src/hooks/useplaygroundcommander.ts","./src/hooks/usepluginengine.ts","./src/hooks/usescreenrecorder.ts","./src/hooks/useshellkeyboard.ts","./src/hooks/useshellshortcuts.ts","./src/hooks/usesoundeffects.ts","./src/hooks/usestudioconfig.ts","./src/hooks/usesystemboot.ts","./src/hooks/usesystemtelemetry.ts","./src/hooks/listeners/useuistatelistener.ts","./src/hooks/listeners/usewhatsapplistener.ts","./src/lib/debuglogger.ts","./src/lib/networkinterceptor.ts","./src/mocks/decido.tsx","./src/plugins/pluginapi.ts","./src/store/mcpstore.ts","./src/store/updaterstore.ts","./src/store/engine.ts","./src/store/index.ts","./src/store/layoutpresets.ts","./src/store/playgroundtypes.ts","./src/store/useactiontimelinestore.ts","./src/store/usedebugpanelstore.ts","./src/store/usedebugprofilestore.ts","./src/store/uselayoutstore.ts","./src/store/usemorphinstancestore.ts","./src/store/usemorphologystore.ts","./src/store/useplaygroundstore.ts","./src/store/useshellregistry.ts","./src/store/usesuggestionsstore.ts","./src/store/usethemestore.ts","./src/store/useuicomponentstore.ts","./src/types/decidostorydefinition.ts","./src/utils/layoutgraph.ts","./src/utils/ai/ai-architect.ts","./src/utils/ai/ai-code.ts","./src/utils/ai/ai-core.ts","./src/utils/ai/ai-media.ts"],"errors":true,"version":"5.9.3"}