@decido/shell 4.0.3 → 4.0.4

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 (70) hide show
  1. package/dist/CenterComposite-V3LL23PG.mjs +64 -0
  2. package/dist/DebugPanel-NFXQOZQ6.mjs +1 -0
  3. package/dist/MorphShell-4JGDAN46.mjs +1 -0
  4. package/dist/PlaygroundAppSidebar-QI73PNRI.mjs +1 -0
  5. package/dist/PlaygroundChat-CBIIQMWU.mjs +1 -0
  6. package/dist/PlaygroundTerminal-MVZKXTYW.mjs +1 -0
  7. package/dist/PluginSandbox-MUNBFWGH.mjs +1 -0
  8. package/dist/ReactFlowEditor-2ALQWCHQ.mjs +6 -0
  9. package/dist/ReactFlowEditor-ROZ6RF3K.css +1 -0
  10. package/dist/TimelineEditor-UPRRXXVM.mjs +3 -0
  11. package/dist/WidgetSlotPanel-YX2VBQAP.mjs +1 -0
  12. package/dist/chunk-3YEFIKFH.mjs +1 -0
  13. package/dist/chunk-53FADIUX.mjs +1 -0
  14. package/dist/chunk-5FWJFDER.mjs +285 -0
  15. package/dist/chunk-6K3AFDP5.mjs +1 -0
  16. package/dist/chunk-AGAAZ2MU.mjs +1 -0
  17. package/dist/chunk-BCP43BRV.mjs +2 -0
  18. package/dist/chunk-BSJBW64M.mjs +1 -0
  19. package/dist/chunk-C5FD536O.mjs +1 -0
  20. package/dist/chunk-DTH34ILQ.mjs +1 -0
  21. package/dist/chunk-DWP77YZU.mjs +1 -0
  22. package/dist/chunk-O3OWL3Q2.mjs +1 -0
  23. package/dist/chunk-POBZMHZ5.mjs +7 -0
  24. package/dist/chunk-S3AQ4QDD.mjs +42 -0
  25. package/dist/chunk-XDA6ZRIQ.mjs +1 -0
  26. package/dist/chunk-XTDMHHMW.mjs +5 -0
  27. package/dist/chunk-YAYNNUEX.mjs +12 -0
  28. package/dist/chunk-YEKQJ4YC.mjs +1 -0
  29. package/dist/chunk-YHFKY5MB.mjs +1 -0
  30. package/dist/chunk-ZKD74U4X.mjs +1 -0
  31. package/dist/index.css +1 -561
  32. package/dist/index.js +462 -65086
  33. package/dist/index.mjs +50 -40209
  34. package/dist/useIntentLens-OCAUBNOQ.mjs +1 -0
  35. package/dist/useSuggestionsStore-Q4KVPU7L.mjs +1 -0
  36. package/dist/wasm-A4BTVJWV.mjs +1 -0
  37. package/package.json +15 -15
  38. package/dist/CenterComposite-RPEGBKQU.mjs +0 -1697
  39. package/dist/DebugPanel-KEKDMHDN.mjs +0 -14
  40. package/dist/MorphShell-FKDBB7E5.mjs +0 -14
  41. package/dist/PlaygroundAppSidebar-ALYJJGAO.mjs +0 -9
  42. package/dist/PlaygroundChat-MI2KXMK6.mjs +0 -15
  43. package/dist/PlaygroundTerminal-5AV4BJAI.mjs +0 -7
  44. package/dist/PluginSandbox-WMNAUQOJ.mjs +0 -188
  45. package/dist/ReactFlowEditor-RTF2652X.mjs +0 -3574
  46. package/dist/ReactFlowEditor-ZW5MCN5Y.css +0 -561
  47. package/dist/TimelineEditor-N4HRMHTB.mjs +0 -226
  48. package/dist/WidgetSlotPanel-KJI4CHHD.mjs +0 -11
  49. package/dist/chunk-2YMI4N5I.mjs +0 -2004
  50. package/dist/chunk-3BZX7LF2.mjs +0 -139
  51. package/dist/chunk-3P4P3M54.mjs +0 -136
  52. package/dist/chunk-F3OTFHNO.mjs +0 -40
  53. package/dist/chunk-IMHORBTL.mjs +0 -48
  54. package/dist/chunk-JF5QSJYT.mjs +0 -295
  55. package/dist/chunk-LWMMFTJC.mjs +0 -382
  56. package/dist/chunk-MSVEFEXE.mjs +0 -179
  57. package/dist/chunk-OCHGY2MN.mjs +0 -1662
  58. package/dist/chunk-PMYAM764.mjs +0 -813
  59. package/dist/chunk-Q64KZXPK.mjs +0 -43
  60. package/dist/chunk-QHQW2HMU.mjs +0 -155
  61. package/dist/chunk-RWZ4BOIN.mjs +0 -385
  62. package/dist/chunk-UHT6FIYF.mjs +0 -195
  63. package/dist/chunk-UJCSKKID.mjs +0 -30
  64. package/dist/chunk-V3CYNPGL.mjs +0 -8758
  65. package/dist/chunk-VBPGEFNM.mjs +0 -2381
  66. package/dist/chunk-XMSU6UWD.mjs +0 -158
  67. package/dist/chunk-ZCCCBHE6.mjs +0 -55
  68. package/dist/useIntentLens-LEQCAXCK.mjs +0 -13
  69. package/dist/useSuggestionsStore-4L2AIZ2D.mjs +0 -7
  70. package/dist/wasm-QFXGEYGP.mjs +0 -81
@@ -1,158 +0,0 @@
1
- // src/store/usePlaygroundStore.ts
2
- import { create } from "zustand";
3
- import { persist, createJSONStorage } from "zustand/middleware";
4
- import { get, set as idbSet, del } from "idb-keyval";
5
- var idbStorage = {
6
- getItem: async (name) => await get(name) || null,
7
- setItem: async (name, value) => {
8
- await idbSet(name, value);
9
- },
10
- removeItem: async (name) => {
11
- await del(name);
12
- }
13
- };
14
- var usePlaygroundStore = create()(
15
- persist(
16
- (set) => ({
17
- // 1. Core State
18
- isBooting: true,
19
- setIsBooting: (val) => set({ isBooting: val }),
20
- step: "chat",
21
- setStep: (val) => set({ step: val }),
22
- selectedProfile: null,
23
- setSelectedProfile: (val) => set({ selectedProfile: val }),
24
- prototypeBrand: "decido",
25
- setPrototypeBrand: (val) => set((state) => ({ prototypeBrand: typeof val === "function" ? val(state.prototypeBrand) : val })),
26
- activeArtifactData: null,
27
- setActiveArtifactData: (val) => set({ activeArtifactData: val }),
28
- // Canvas & UI Integration
29
- demoState: "idle",
30
- setDemoState: (val) => set({ demoState: val }),
31
- showCanvas: false,
32
- setShowCanvas: (val) => set({ showCanvas: val }),
33
- showChat: true,
34
- setShowChat: (val) => set({ showChat: val }),
35
- // 2. UI Toggles
36
- isMuted: false,
37
- setIsMuted: (val) => set((state) => ({ isMuted: typeof val === "function" ? val(state.isMuted) : val })),
38
- selectedVoice: "Kore",
39
- setSelectedVoice: (val) => set({ selectedVoice: val }),
40
- isFullscreen: false,
41
- setIsFullscreen: (val) => set({ isFullscreen: val }),
42
- isVoiceActive: false,
43
- setIsVoiceActive: (val) => set({ isVoiceActive: val }),
44
- isSidebarOpen: false,
45
- setIsSidebarOpen: (val) => set({ isSidebarOpen: val }),
46
- isTerminalOpen: false,
47
- setIsTerminalOpen: (val) => set({ isTerminalOpen: val }),
48
- inputValue: "",
49
- setInputValue: (val) => set({ inputValue: val }),
50
- isCreatorMode: false,
51
- setIsCreatorMode: (val) => set({ isCreatorMode: val }),
52
- creatorViewMode: "graph",
53
- setCreatorViewMode: (val) => set({ creatorViewMode: val }),
54
- // 4. Logs Management
55
- logs: [],
56
- addLog: (msg, type = "info") => set((state) => ({
57
- logs: [...state.logs.slice(-49), { time: (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour12: false }), msg, type }]
58
- })),
59
- setLogs: (val) => set((state) => ({ logs: typeof val === "function" ? val(state.logs) : val })),
60
- // 5. Timelines
61
- // Moved to useTimelineStore
62
- // 6. Saved Sequences
63
- savedSequences: [],
64
- addSavedSequence: (seq) => set((state) => ({ savedSequences: [...state.savedSequences, seq] })),
65
- removeSavedSequence: (id) => set((state) => ({ savedSequences: state.savedSequences.filter((s) => s.id !== id) })),
66
- // 7. Chat Messages (per-instance isolation)
67
- chatMessagesByInstance: {},
68
- addChatMessage: (msg) => set((state) => {
69
- const chatId = state.activeChatId || "_default";
70
- const existing = state.chatMessagesByInstance[chatId] || [];
71
- const newMsg = { ...msg, id: Math.random().toString(36).substring(2, 9), timestamp: Date.now() };
72
- const updated = { ...state.chatMessagesByInstance, [chatId]: [...existing, newMsg] };
73
- const chatInstances = state.chatInstances.map((c) => {
74
- if (c.id === chatId) {
75
- const preview = msg.sender === "user" ? msg.text.slice(0, 60) : c.preview;
76
- const title = c.title === "Nueva conversaci\xF3n" && msg.sender === "user" ? msg.text.slice(0, 40) : c.title;
77
- return { ...c, preview, title, messageCount: (c.messageCount || 0) + 1, updatedAt: Date.now() };
78
- }
79
- return c;
80
- });
81
- return { chatMessagesByInstance: updated, chatInstances };
82
- }),
83
- upsertChatMessage: (id, msg) => set((state) => {
84
- const chatId = state.activeChatId || "_default";
85
- const existing = state.chatMessagesByInstance[chatId] || [];
86
- const idx = existing.findIndex((m) => m.id === id);
87
- let updated;
88
- if (idx >= 0) {
89
- updated = [...existing];
90
- updated[idx] = { ...updated[idx], ...msg };
91
- } else {
92
- updated = [...existing, msg];
93
- }
94
- return { chatMessagesByInstance: { ...state.chatMessagesByInstance, [chatId]: updated } };
95
- }),
96
- clearChatMessages: () => set((state) => {
97
- const chatId = state.activeChatId || "_default";
98
- return { chatMessagesByInstance: { ...state.chatMessagesByInstance, [chatId]: [] } };
99
- }),
100
- getChatMessages: () => {
101
- const state = usePlaygroundStore.getState();
102
- const chatId = state.activeChatId || "_default";
103
- return state.chatMessagesByInstance[chatId] || [];
104
- },
105
- // 8. Chat Instances (Sidebar History)
106
- chatInstances: [],
107
- activeChatId: null,
108
- addChatInstance: (title) => {
109
- const id = Date.now().toString(36) + Math.random().toString(36).substring(2, 7);
110
- const now = Date.now();
111
- const model = localStorage.getItem("decido_gemini_model") || void 0;
112
- const shellType = localStorage.getItem("decido_selected_shell") || void 0;
113
- set((state) => ({
114
- chatInstances: [{ id, title: title || "Nueva conversaci\xF3n", createdAt: now, updatedAt: now, model, shellType }, ...state.chatInstances],
115
- activeChatId: id
116
- }));
117
- return id;
118
- },
119
- removeChatInstance: (id) => set((state) => {
120
- const { [id]: _, ...rest } = state.chatMessagesByInstance;
121
- return {
122
- chatInstances: state.chatInstances.filter((c) => c.id !== id),
123
- activeChatId: state.activeChatId === id ? state.chatInstances.find((c) => c.id !== id)?.id ?? null : state.activeChatId,
124
- chatMessagesByInstance: rest
125
- };
126
- }),
127
- renameChatInstance: (id, title) => set((state) => ({
128
- chatInstances: state.chatInstances.map((c) => c.id === id ? { ...c, title, updatedAt: Date.now() } : c)
129
- })),
130
- setActiveChatId: (id) => set({ activeChatId: id })
131
- }),
132
- {
133
- name: "playground-storage",
134
- storage: createJSONStorage(() => idbStorage),
135
- partialize: (state) => ({
136
- showChat: state.showChat,
137
- logs: state.logs,
138
- inputValue: state.inputValue,
139
- prototypeBrand: state.prototypeBrand,
140
- isCreatorMode: state.isCreatorMode,
141
- isMuted: state.isMuted,
142
- selectedVoice: state.selectedVoice,
143
- isTerminalOpen: state.isTerminalOpen,
144
- isSidebarOpen: state.isSidebarOpen,
145
- step: state.step,
146
- selectedProfile: state.selectedProfile,
147
- savedSequences: state.savedSequences,
148
- chatMessagesByInstance: state.chatMessagesByInstance,
149
- chatInstances: state.chatInstances,
150
- activeChatId: state.activeChatId
151
- })
152
- }
153
- )
154
- );
155
-
156
- export {
157
- usePlaygroundStore
158
- };
@@ -1,55 +0,0 @@
1
- import {
2
- dlog
3
- } from "./chunk-3P4P3M54.mjs";
4
-
5
- // src/store/useMorphologyStore.ts
6
- import { create } from "zustand";
7
- var componentRegistry = /* @__PURE__ */ new Map();
8
- var useMorphologyStore = create((set, get) => ({
9
- activeStage: null,
10
- stageHistory: [],
11
- setStage: (stage) => {
12
- dlog.morph(`setStage \u2192 ${stage?.type || "null"}${stage?.label ? ` (${stage.label})` : ""}`, stage);
13
- set({ activeStage: stage });
14
- },
15
- pushStage: (stage) => {
16
- const { activeStage, stageHistory } = get();
17
- dlog.morph(`pushStage \u2192 ${stage.type}${stage.label ? ` (${stage.label})` : ""} | depth: ${stageHistory.length + 1}`, { stage, previousStage: activeStage?.type });
18
- const newHistory = activeStage ? [...stageHistory, activeStage] : stageHistory;
19
- set({ activeStage: stage, stageHistory: newHistory });
20
- },
21
- popStage: () => {
22
- const { stageHistory, activeStage } = get();
23
- if (stageHistory.length === 0) {
24
- dlog.morph("popStage \u2192 null (history empty)", { poppedStage: activeStage?.type }, "warn");
25
- set({ activeStage: null });
26
- return;
27
- }
28
- const prev = stageHistory[stageHistory.length - 1];
29
- dlog.morph(`popStage \u2192 ${prev.type}${prev.label ? ` (${prev.label})` : ""} | depth: ${stageHistory.length - 1}`, { poppedStage: activeStage?.type, restoredStage: prev.type });
30
- set({
31
- activeStage: prev,
32
- stageHistory: stageHistory.slice(0, -1)
33
- });
34
- },
35
- clearStages: () => {
36
- dlog.morph("clearStages \u2192 all stages cleared", { previousDepth: get().stageHistory.length });
37
- set({ activeStage: null, stageHistory: [] });
38
- }
39
- }));
40
- function registerMorphComponent(id, component) {
41
- componentRegistry.set(id, component);
42
- }
43
- function getMorphComponent(id) {
44
- return componentRegistry.get(id);
45
- }
46
- function getRegisteredMorphComponents() {
47
- return Array.from(componentRegistry.keys());
48
- }
49
-
50
- export {
51
- useMorphologyStore,
52
- registerMorphComponent,
53
- getMorphComponent,
54
- getRegisteredMorphComponents
55
- };
@@ -1,13 +0,0 @@
1
- import {
2
- INTENT_PATTERNS,
3
- getIntentPatterns,
4
- registerIntentPattern,
5
- useIntentLens
6
- } from "./chunk-QHQW2HMU.mjs";
7
- import "./chunk-UJCSKKID.mjs";
8
- export {
9
- INTENT_PATTERNS,
10
- getIntentPatterns,
11
- registerIntentPattern,
12
- useIntentLens
13
- };
@@ -1,7 +0,0 @@
1
- import {
2
- useSuggestionsStore
3
- } from "./chunk-F3OTFHNO.mjs";
4
- import "./chunk-UJCSKKID.mjs";
5
- export {
6
- useSuggestionsStore
7
- };
@@ -1,81 +0,0 @@
1
- import "./chunk-UJCSKKID.mjs";
2
-
3
- // ../sdk/src/wasm.ts
4
- import { useEffect, useState, useCallback, useRef } from "react";
5
- var tauriInvoke = null;
6
- async function getInvoke() {
7
- if (!tauriInvoke) {
8
- try {
9
- const mod = await import("@tauri-apps/api/core");
10
- tauriInvoke = mod.invoke;
11
- } catch {
12
- throw new Error(
13
- "[WASM Bridge] @tauri-apps/api not available. WASM plugins are only supported in the desktop app."
14
- );
15
- }
16
- }
17
- return tauriInvoke;
18
- }
19
- async function runWasmPlugin(name, fn = "run") {
20
- const invoke = await getInvoke();
21
- return invoke("run_wasm_plugin", { name, function: fn });
22
- }
23
- async function checkWasmPermission(pluginName, permission) {
24
- const invoke = await getInvoke();
25
- return invoke("check_plugin_permission", {
26
- pluginName,
27
- permission
28
- });
29
- }
30
- async function getWasmManifest(name) {
31
- const invoke = await getInvoke();
32
- return invoke("get_wasm_manifest", { name });
33
- }
34
- async function onWasmPluginEvent(callback) {
35
- try {
36
- const { listen } = await import("@tauri-apps/api/event");
37
- const unlisten = await listen("wasm-plugin-event", (e) => {
38
- callback(e.payload);
39
- });
40
- return unlisten;
41
- } catch {
42
- console.warn("[WASM Bridge] Event listener not available outside Tauri desktop.");
43
- return () => {
44
- };
45
- }
46
- }
47
- function useWasmPluginEvents(maxHistory = 50) {
48
- const [events, setEvents] = useState([]);
49
- const [lastEvent, setLastEvent] = useState(null);
50
- const unlistenRef = useRef(null);
51
- useEffect(() => {
52
- let cancelled = false;
53
- onWasmPluginEvent((event) => {
54
- if (cancelled) return;
55
- setLastEvent(event);
56
- setEvents((prev) => [...prev.slice(-(maxHistory - 1)), event]);
57
- }).then((unlisten) => {
58
- if (cancelled) {
59
- unlisten();
60
- } else {
61
- unlistenRef.current = unlisten;
62
- }
63
- });
64
- return () => {
65
- cancelled = true;
66
- unlistenRef.current?.();
67
- };
68
- }, [maxHistory]);
69
- const clear = useCallback(() => {
70
- setEvents([]);
71
- setLastEvent(null);
72
- }, []);
73
- return { events, lastEvent, clear };
74
- }
75
- export {
76
- checkWasmPermission,
77
- getWasmManifest,
78
- onWasmPluginEvent,
79
- runWasmPlugin,
80
- useWasmPluginEvents
81
- };