@decido/shell-vscode-core 1.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +31 -0
  3. package/package.json +2 -2
  4. package/dist/appState.d.ts +0 -23
  5. package/dist/appState.d.ts.map +0 -1
  6. package/dist/appState.js +0 -138
  7. package/dist/core/AIService.d.ts +0 -33
  8. package/dist/core/AIService.d.ts.map +0 -1
  9. package/dist/core/AIService.js +0 -73
  10. package/dist/core/ApiService.d.ts +0 -34
  11. package/dist/core/ApiService.d.ts.map +0 -1
  12. package/dist/core/ApiService.js +0 -32
  13. package/dist/core/AuthService.d.ts +0 -31
  14. package/dist/core/AuthService.d.ts.map +0 -1
  15. package/dist/core/AuthService.js +0 -56
  16. package/dist/core/BaseService.d.ts +0 -29
  17. package/dist/core/BaseService.d.ts.map +0 -1
  18. package/dist/core/BaseService.js +0 -33
  19. package/dist/core/CalendarService.d.ts +0 -15
  20. package/dist/core/CalendarService.d.ts.map +0 -1
  21. package/dist/core/CalendarService.js +0 -32
  22. package/dist/core/CommandService.d.ts +0 -25
  23. package/dist/core/CommandService.d.ts.map +0 -1
  24. package/dist/core/CommandService.js +0 -52
  25. package/dist/core/DebugPanelService.d.ts +0 -12
  26. package/dist/core/DebugPanelService.d.ts.map +0 -1
  27. package/dist/core/DebugPanelService.js +0 -29
  28. package/dist/core/DebugService.d.ts +0 -57
  29. package/dist/core/DebugService.d.ts.map +0 -1
  30. package/dist/core/DebugService.js +0 -134
  31. package/dist/core/EventBus.d.ts +0 -32
  32. package/dist/core/EventBus.d.ts.map +0 -1
  33. package/dist/core/EventBus.js +0 -51
  34. package/dist/core/EventHandler.d.ts +0 -3
  35. package/dist/core/EventHandler.d.ts.map +0 -1
  36. package/dist/core/EventHandler.js +0 -82
  37. package/dist/core/GamificationService.d.ts +0 -19
  38. package/dist/core/GamificationService.d.ts.map +0 -1
  39. package/dist/core/GamificationService.js +0 -102
  40. package/dist/core/HookService.d.ts +0 -34
  41. package/dist/core/HookService.d.ts.map +0 -1
  42. package/dist/core/HookService.js +0 -64
  43. package/dist/core/LayoutService.d.ts +0 -61
  44. package/dist/core/LayoutService.d.ts.map +0 -1
  45. package/dist/core/LayoutService.js +0 -223
  46. package/dist/core/ModalService.d.ts +0 -21
  47. package/dist/core/ModalService.d.ts.map +0 -1
  48. package/dist/core/ModalService.js +0 -71
  49. package/dist/core/NotificationService.d.ts +0 -7
  50. package/dist/core/NotificationService.d.ts.map +0 -1
  51. package/dist/core/NotificationService.js +0 -42
  52. package/dist/core/RouterService.d.ts +0 -13
  53. package/dist/core/RouterService.d.ts.map +0 -1
  54. package/dist/core/RouterService.js +0 -54
  55. package/dist/core/ServiceContainer.d.ts +0 -18
  56. package/dist/core/ServiceContainer.d.ts.map +0 -1
  57. package/dist/core/ServiceContainer.js +0 -27
  58. package/dist/core/ShortcutService.d.ts +0 -17
  59. package/dist/core/ShortcutService.d.ts.map +0 -1
  60. package/dist/core/ShortcutService.js +0 -37
  61. package/dist/core/StorageService.d.ts +0 -36
  62. package/dist/core/StorageService.d.ts.map +0 -1
  63. package/dist/core/StorageService.js +0 -101
  64. package/dist/core/ThemeService.d.ts +0 -12
  65. package/dist/core/ThemeService.d.ts.map +0 -1
  66. package/dist/core/ThemeService.js +0 -60
  67. package/dist/core/WebSocketService.d.ts +0 -16
  68. package/dist/core/WebSocketService.d.ts.map +0 -1
  69. package/dist/core/WebSocketService.js +0 -22
  70. package/dist/core/api.d.ts +0 -70
  71. package/dist/core/api.d.ts.map +0 -1
  72. package/dist/core/api.js +0 -1
  73. package/dist/core/app/ModuleManager copy.d.ts +0 -23
  74. package/dist/core/app/ModuleManager copy.js +0 -52
  75. package/dist/core/app/ModuleManager.d.ts +0 -60
  76. package/dist/core/app/ModuleManager.d.ts.map +0 -1
  77. package/dist/core/app/ModuleManager.js +0 -217
  78. package/dist/core/app/apiFactory.d.ts +0 -4
  79. package/dist/core/app/apiFactory.d.ts.map +0 -1
  80. package/dist/core/app/apiFactory.js +0 -120
  81. package/dist/core/app/commandManager.d.ts +0 -3
  82. package/dist/core/app/commandManager.d.ts.map +0 -1
  83. package/dist/core/app/commandManager.js +0 -195
  84. package/dist/core/app/moduleLoader.d.ts +0 -11
  85. package/dist/core/app/moduleLoader.d.ts.map +0 -1
  86. package/dist/core/app/moduleLoader.js +0 -30
  87. package/dist/core/app/routeManager.d.ts +0 -2
  88. package/dist/core/app/routeManager.d.ts.map +0 -1
  89. package/dist/core/app/routeManager.js +0 -7
  90. package/dist/core/index.d.ts +0 -16
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/index.js +0 -15
  93. package/dist/core/layout/dragDropManager.d.ts +0 -8
  94. package/dist/core/layout/dragDropManager.d.ts.map +0 -1
  95. package/dist/core/layout/dragDropManager.js +0 -8
  96. package/dist/core/layout/paneManager.d.ts +0 -7
  97. package/dist/core/layout/paneManager.d.ts.map +0 -1
  98. package/dist/core/layout/paneManager.js +0 -7
  99. package/dist/core/layout/renderer.d.ts +0 -8
  100. package/dist/core/layout/renderer.d.ts.map +0 -1
  101. package/dist/core/layout/renderer.js +0 -8
  102. package/dist/core/layout/resizeManager.d.ts +0 -5
  103. package/dist/core/layout/resizeManager.d.ts.map +0 -1
  104. package/dist/core/layout/resizeManager.js +0 -5
  105. package/dist/core/signals.d.ts +0 -20
  106. package/dist/core/signals.d.ts.map +0 -1
  107. package/dist/core/signals.js +0 -66
  108. package/dist/core/uiState.d.ts +0 -9
  109. package/dist/core/uiState.d.ts.map +0 -1
  110. package/dist/core/uiState.js +0 -11
  111. package/dist/index.d.ts +0 -17
  112. package/dist/index.d.ts.map +0 -1
  113. package/dist/index.js +0 -15
  114. package/dist/lib/local-db.d.ts +0 -43
  115. package/dist/lib/local-db.d.ts.map +0 -1
  116. package/dist/lib/local-db.js +0 -23
  117. package/dist/lib/sync-service.d.ts +0 -7
  118. package/dist/lib/sync-service.d.ts.map +0 -1
  119. package/dist/lib/sync-service.js +0 -41
  120. package/dist/platform/ILayoutService.d.ts +0 -63
  121. package/dist/platform/ILayoutService.d.ts.map +0 -1
  122. package/dist/platform/ILayoutService.js +0 -1
  123. package/dist/platform/IRenderer.d.ts +0 -16
  124. package/dist/platform/IRenderer.d.ts.map +0 -1
  125. package/dist/platform/IRenderer.js +0 -1
  126. package/dist/platform/ServiceRegistry.d.ts +0 -43
  127. package/dist/platform/ServiceRegistry.d.ts.map +0 -1
  128. package/dist/platform/ServiceRegistry.js +0 -2
  129. package/dist/platform/extensionPoints.d.ts +0 -70
  130. package/dist/platform/extensionPoints.d.ts.map +0 -1
  131. package/dist/platform/extensionPoints.js +0 -22
  132. package/dist/platform/index.d.ts +0 -5
  133. package/dist/platform/index.d.ts.map +0 -1
  134. package/dist/platform/index.js +0 -4
  135. package/dist/stores/editorStore.d.ts +0 -5
  136. package/dist/stores/editorStore.d.ts.map +0 -1
  137. package/dist/stores/editorStore.js +0 -4
  138. package/dist/stores/gamificationStore.d.ts +0 -3
  139. package/dist/stores/gamificationStore.d.ts.map +0 -1
  140. package/dist/stores/gamificationStore.js +0 -2
  141. package/dist/stores/historyStore.d.ts +0 -12
  142. package/dist/stores/historyStore.d.ts.map +0 -1
  143. package/dist/stores/historyStore.js +0 -6
  144. package/dist/stores/workspaceStore.d.ts +0 -13
  145. package/dist/stores/workspaceStore.d.ts.map +0 -1
  146. package/dist/stores/workspaceStore.js +0 -6
  147. package/dist/types/app.d.ts +0 -31
  148. package/dist/types/app.d.ts.map +0 -1
  149. package/dist/types/app.js +0 -1
  150. package/dist/types/debug.d.ts +0 -68
  151. package/dist/types/debug.d.ts.map +0 -1
  152. package/dist/types/debug.js +0 -1
  153. package/dist/types/entities.d.ts +0 -42
  154. package/dist/types/entities.js +0 -2
  155. package/dist/types/index.d.ts +0 -3
  156. package/dist/types/index.d.ts.map +0 -1
  157. package/dist/types/index.js +0 -3
  158. package/dist/types/modules.d.ts +0 -66
  159. package/dist/types/modules.js +0 -2
  160. package/dist/types/platform.d.ts +0 -95
  161. package/dist/types/platform.d.ts.map +0 -1
  162. package/dist/types/platform.js +0 -2
  163. package/dist/ui/Palette.d.ts +0 -38
  164. package/dist/ui/Palette.d.ts.map +0 -1
  165. package/dist/ui/Palette.js +0 -144
  166. package/dist/ui/debug-panel/dragAndResize.d.ts +0 -6
  167. package/dist/ui/debug-panel/dragAndResize.d.ts.map +0 -1
  168. package/dist/ui/debug-panel/dragAndResize.js +0 -140
  169. package/dist/ui/debug-panel/eventBinder.d.ts +0 -5
  170. package/dist/ui/debug-panel/eventBinder.d.ts.map +0 -1
  171. package/dist/ui/debug-panel/eventBinder.js +0 -120
  172. package/dist/ui/debug-panel/layoutManager.d.ts +0 -16
  173. package/dist/ui/debug-panel/layoutManager.d.ts.map +0 -1
  174. package/dist/ui/debug-panel/layoutManager.js +0 -73
  175. package/dist/ui/debug-panel/main.d.ts +0 -12
  176. package/dist/ui/debug-panel/main.d.ts.map +0 -1
  177. package/dist/ui/debug-panel/main.js +0 -42
  178. package/dist/ui/debug-panel/panelManager.d.ts +0 -17
  179. package/dist/ui/debug-panel/panelManager.d.ts.map +0 -1
  180. package/dist/ui/debug-panel/panelManager.js +0 -123
  181. package/dist/ui/debug-panel/renderer.d.ts +0 -4
  182. package/dist/ui/debug-panel/renderer.d.ts.map +0 -1
  183. package/dist/ui/debug-panel/renderer.js +0 -181
  184. package/dist/ui/debug-panel/services.d.ts +0 -4
  185. package/dist/ui/debug-panel/services.d.ts.map +0 -1
  186. package/dist/ui/debug-panel/services.js +0 -134
  187. package/dist/ui/debug-panel/settings.d.ts +0 -5
  188. package/dist/ui/debug-panel/settings.d.ts.map +0 -1
  189. package/dist/ui/debug-panel/settings.js +0 -35
  190. package/dist/ui/debug-panel/state.d.ts +0 -128
  191. package/dist/ui/debug-panel/state.d.ts.map +0 -1
  192. package/dist/ui/debug-panel/state.js +0 -42
  193. package/dist/ui/debug-panel/stateEditor.d.ts +0 -9
  194. package/dist/ui/debug-panel/stateEditor.d.ts.map +0 -1
  195. package/dist/ui/debug-panel/stateEditor.js +0 -158
  196. package/dist/ui/debug-panel/types.d.ts +0 -68
  197. package/dist/ui/debug-panel/types.d.ts.map +0 -1
  198. package/dist/ui/debug-panel/types.js +0 -1
  199. package/dist/ui/debug-panel/ui.d.ts +0 -10
  200. package/dist/ui/debug-panel/ui.d.ts.map +0 -1
  201. package/dist/ui/debug-panel/ui.js +0 -199
  202. package/dist/ui/debug-panel/utils.d.ts +0 -16
  203. package/dist/ui/debug-panel/utils.d.ts.map +0 -1
  204. package/dist/ui/debug-panel/utils.js +0 -104
  205. package/dist/utils.d.ts +0 -22
  206. package/dist/utils.d.ts.map +0 -1
  207. package/dist/utils.js +0 -58
@@ -1,25 +0,0 @@
1
- import { IPlatformAPI } from './api.js';
2
- type SpyCommandHandler = (commandId: string, data?: any) => void;
3
- export interface Command {
4
- id: string;
5
- title: string;
6
- icon?: string;
7
- category?: string;
8
- execute: (api: IPlatformAPI, arg?: any) => void;
9
- }
10
- export declare class CommandService {
11
- private commands;
12
- api: IPlatformAPI;
13
- private spy;
14
- constructor();
15
- register(command: Command): void;
16
- execute(commandId: string, arg?: any, callerId?: string): void;
17
- getAll(): Command[];
18
- /**
19
- * Registra una única función que recibirá TODOS los eventos emitidos.
20
- * @param handler La función espía.
21
- */
22
- spyOn(handler: SpyCommandHandler): void;
23
- }
24
- export {};
25
- //# sourceMappingURL=CommandService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommandService.d.ts","sourceRoot":"","sources":["../../src/core/CommandService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,KAAK,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAEjE,MAAM,WAAW,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnD;AAED,qBAAa,cAAc;IACvB,OAAO,CAAC,QAAQ,CAAmC;IAC5C,GAAG,EAAG,YAAY,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAkC;;IAM7C,QAAQ,CAAC,OAAO,EAAE,OAAO;IAOzB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM;IA6BvD,MAAM,IAAI,OAAO,EAAE;IAInB;;;GAGD;IACC,KAAK,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;CAG1C"}
@@ -1,52 +0,0 @@
1
- export class CommandService {
2
- commands = new Map();
3
- api;
4
- spy = null;
5
- constructor() {
6
- // The API is injected after construction to break circular dependencies.
7
- }
8
- register(command) {
9
- if (this.commands.has(command.id)) {
10
- console.warn(`[CommandService] El comando "${command.id}" ya está registrado. Se sobrescribirá.`);
11
- }
12
- this.commands.set(command.id, command);
13
- }
14
- execute(commandId, arg, callerId) {
15
- const command = this.commands.get(commandId);
16
- if (command) {
17
- try {
18
- // Asumimos que un comando mapea a un servicio.
19
- // TODO: Hay qye mejorar la implementación real, el comando podría declarar qué servicio utiliza.
20
- // Por ahora, usamos una convención: 'kanban.moveTask' activa 'svc:KanbanService'.
21
- const targetServiceId = `svc:${command.id.split('.')[0]}Service`;
22
- const startTime = performance.now(); // <-- INICIA EL CRONÓMETRO
23
- command.execute(this.api, arg);
24
- const endTime = performance.now(); // <-- DETIENE EL CRONÓMETRO
25
- const duration = (endTime - startTime).toFixed(2);
26
- this.api.debug?.probe(targetServiceId, 'active', {
27
- sourceNodeId: callerId,
28
- command: commandId, // <-- PASAMOS LA FUENTE
29
- duration: `${duration} ms` // <-- AÑADE LA MÉTRICA
30
- });
31
- this.api.events.emit(`command:${commandId}:executed`, { arg });
32
- }
33
- catch (error) {
34
- console.error(`Error ejecutando el comando "${commandId}":`, error);
35
- this.api.notifications.show('error', 'Error de Comando', `No se pudo ejecutar "${command.title}".`);
36
- }
37
- }
38
- else {
39
- console.error(`[CommandService] Intento de ejecutar un comando no registrado: "${commandId}"`);
40
- }
41
- }
42
- getAll() {
43
- return Array.from(this.commands.values());
44
- }
45
- /**
46
- * Registra una única función que recibirá TODOS los eventos emitidos.
47
- * @param handler La función espía.
48
- */
49
- spyOn(handler) {
50
- this.spy = handler;
51
- }
52
- }
@@ -1,12 +0,0 @@
1
- interface PanelConfig {
2
- id: string;
3
- isVisible: boolean;
4
- }
5
- export declare class DebugPanelService {
6
- panels: import("./signals").Signal<Record<string, PanelConfig>>;
7
- create(panelId: string): void;
8
- toggle(panelId: string): void;
9
- destroy(panelId: string): void;
10
- }
11
- export {};
12
- //# sourceMappingURL=DebugPanelService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugPanelService.d.ts","sourceRoot":"","sources":["../../src/core/DebugPanelService.ts"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;CAEtB;AAED,qBAAa,iBAAiB;IACnB,MAAM,0DAAiD;IAEvD,MAAM,CAAC,OAAO,EAAE,MAAM;IAOtB,MAAM,CAAC,OAAO,EAAE,MAAM;IAWtB,OAAO,CAAC,OAAO,EAAE,MAAM;CAOjC"}
@@ -1,29 +0,0 @@
1
- // packages/core/src/core/DebugPanelService.ts
2
- import { createSignal } from './signals';
3
- export class DebugPanelService {
4
- panels = createSignal({});
5
- create(panelId) {
6
- this.panels[1](prev => ({
7
- ...prev,
8
- [panelId]: { id: panelId, isVisible: true }
9
- }));
10
- }
11
- toggle(panelId) {
12
- this.panels[1](prev => {
13
- const panel = prev[panelId];
14
- if (!panel)
15
- return prev;
16
- return {
17
- ...prev,
18
- [panelId]: { ...panel, isVisible: !panel.isVisible }
19
- };
20
- });
21
- }
22
- destroy(panelId) {
23
- this.panels[1](prev => {
24
- const newPanels = { ...prev };
25
- delete newPanels[panelId];
26
- return newPanels;
27
- });
28
- }
29
- }
@@ -1,57 +0,0 @@
1
- import { ConsoleLog } from '../types/debug.js';
2
- import { IPlatformAPI } from './api';
3
- type NodeType = 'app' | 'package' | 'service' | 'module' | 'ui-component';
4
- type NodeStatus = 'idle' | 'active' | 'error' | 'loaded';
5
- interface Node {
6
- id: string;
7
- label: string;
8
- type: NodeType;
9
- description: string;
10
- status: NodeStatus;
11
- metadata?: any;
12
- }
13
- interface Link {
14
- source: string;
15
- target: string;
16
- label: string;
17
- type: string;
18
- }
19
- interface ArchitectureGraph {
20
- nodes: Node[];
21
- links: Link[];
22
- lastActivatedLink?: {
23
- source: string;
24
- target: string;
25
- };
26
- }
27
- interface ProbeEvent {
28
- timestamp: number;
29
- nodeId: string;
30
- status: NodeStatus;
31
- metadata?: any;
32
- }
33
- export declare class DebugService {
34
- api: IPlatformAPI;
35
- graphState: import("./signals").Signal<ArchitectureGraph>;
36
- probeLog: import("./signals").Signal<ProbeEvent[]>;
37
- playbackState: import("./signals").Signal<{
38
- isPlaying: boolean;
39
- currentIndex: number;
40
- }>;
41
- consoleLogs: import("./signals").Signal<ConsoleLog[]>;
42
- private statusTimeouts;
43
- constructor(api: IPlatformAPI);
44
- private setupInterceptors;
45
- private interceptConsole;
46
- clearLogs(logType: 'console'): void;
47
- loadArchitectureGraph(path: string): Promise<void>;
48
- /**
49
- * El "sensor" principal de nuestro sistema de diagnóstico.
50
- * Llama a este método desde cualquier parte del código para actualizar el estado de un nodo.
51
- */
52
- probe(nodeId: string, status: NodeStatus, metadata?: any): void;
53
- private applyProbeToGraph;
54
- goToLogIndex(index: number): void;
55
- }
56
- export {};
57
- //# sourceMappingURL=DebugService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugService.d.ts","sourceRoot":"","sources":["../../src/core/DebugService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrC,KAAK,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAC1E,KAAK,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzD,UAAU,IAAI;IACV,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,UAAU,IAAI;IACV,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,iBAAiB;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iBAAiB,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D;AAED,UAAU,UAAU;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAClB;AAED,qBAAa,YAAY;IACd,GAAG,EAAE,YAAY,CAAC;IAClB,UAAU,gDAA6D;IACvE,QAAQ,2CAAkC;IAC1C,aAAa;;;OAAwD;IAErE,WAAW,2CAAkC;IACpD,OAAO,CAAC,cAAc,CAA6B;gBAEvC,GAAG,EAAE,YAAY;IAU7B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;IAsBjB,SAAS,CAAC,OAAO,EAAE,SAAS;IAkBtB,qBAAqB,CAAC,IAAI,EAAE,MAAM;IAkB/C;;;OAGG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,GAAG;IAY/D,OAAO,CAAC,iBAAiB;IAsBlB,YAAY,CAAC,KAAK,EAAE,MAAM;CAwBpC"}
@@ -1,134 +0,0 @@
1
- import { createSignal } from './signals';
2
- export class DebugService {
3
- api;
4
- graphState = createSignal({ nodes: [], links: [] });
5
- probeLog = createSignal([]);
6
- playbackState = createSignal({ isPlaying: false, currentIndex: -1 });
7
- // --- NUEVAS SEÑALES PARA LOGS ---
8
- consoleLogs = createSignal([]);
9
- statusTimeouts = new Map();
10
- constructor(api) {
11
- this.api = api;
12
- this.setupInterceptors();
13
- // Espía todos los comandos
14
- this.api.commands.spyOn((commandId) => {
15
- this.probe(`cmd:${commandId}`, 'active'); // Asume un prefijo "cmd:"
16
- });
17
- }
18
- // --- NUEVOS MÉTODOS (Movidos desde tu 'services.ts') ---
19
- setupInterceptors() {
20
- this.interceptConsole();
21
- // Aquí añadiríamos interceptFetch, interceptErrors, etc.
22
- }
23
- interceptConsole() {
24
- const originalConsole = { ...window.console };
25
- ['log', 'info', 'warn', 'error'].forEach(level => {
26
- window.console[level] = (...args) => {
27
- const newLog = {
28
- id: `log_${Date.now()}`,
29
- type: level,
30
- timestamp: new Date(),
31
- message: args,
32
- stack: level === 'error' ? new Error().stack : undefined
33
- };
34
- // Actualizamos la señal de logs de la consola
35
- this.consoleLogs[1](prevLogs => [...prevLogs, newLog]);
36
- // Llamamos al método original para que la consola del navegador siga funcionando
37
- originalConsole[level](...args);
38
- };
39
- });
40
- }
41
- // --- FIN DE NUEVOS MÉTODOS ---
42
- clearLogs(logType /* | 'network' ... */) {
43
- if (logType === 'console') {
44
- this.consoleLogs[1]([]);
45
- }
46
- }
47
- // public async loadArchitectureGraph(path: string) {
48
- // try {
49
- // const response = await fetch(path);
50
- // const graphData = await response.json();
51
- // // Inicializa todos los nodos con estado 'idle'
52
- // graphData.nodes.forEach((node: Node) => node.status = 'idle');
53
- // this.graphState[1](graphData);
54
- // console.log('✅ Mapa de arquitectura cargado en el DebugService.');
55
- // } catch (error) {
56
- // console.error('❌ Error al cargar el mapa de arquitectura:', error);
57
- // }
58
- // }
59
- async loadArchitectureGraph(path) {
60
- try {
61
- const response = await fetch(path);
62
- const graphData = await response.json();
63
- graphData.nodes.forEach((node) => {
64
- node.status = 'idle';
65
- // node.x = Math.random() * 800; // Reset positions
66
- // node.y = Math.random() * 500;
67
- });
68
- this.graphState[1](graphData); // Reemplaza el grafo actual
69
- this.probeLog[1]([]); // Limpia el log de reproducción
70
- this.playbackState[1]({ isPlaying: false, currentIndex: -1 });
71
- console.log(`✅ Nuevo mapa de arquitectura cargado: ${path}`);
72
- }
73
- catch (error) {
74
- console.error(`❌ Error al cargar el mapa: ${path}`, error);
75
- }
76
- }
77
- /**
78
- * El "sensor" principal de nuestro sistema de diagnóstico.
79
- * Llama a este método desde cualquier parte del código para actualizar el estado de un nodo.
80
- */
81
- probe(nodeId, status, metadata) {
82
- // 1. Siempre registra el evento
83
- const logEntry = { timestamp: Date.now(), nodeId, status, metadata };
84
- this.probeLog[1](prevLog => [...prevLog, logEntry]);
85
- // 2. Si no estamos en reproducción, actualiza el grafo en vivo
86
- if (!this.playbackState[0]().isPlaying) {
87
- this.applyProbeToGraph(logEntry);
88
- this.playbackState[1](prev => ({ ...prev, currentIndex: this.probeLog[0]().length - 1 }));
89
- }
90
- }
91
- applyProbeToGraph(probe) {
92
- const [getGraph, setGraph] = this.graphState;
93
- const currentGraph = getGraph();
94
- const node = currentGraph.nodes.find((n) => n.id === probe.nodeId);
95
- if (node) {
96
- node.status = probe.status;
97
- node.metadata = probe.metadata;
98
- setGraph({ ...currentGraph });
99
- if (probe.status === 'active') {
100
- if (this.statusTimeouts.has(probe.nodeId))
101
- clearTimeout(this.statusTimeouts.get(probe.nodeId));
102
- const timeoutId = window.setTimeout(() => {
103
- const latestNodeState = this.probeLog[0]().filter(p => p.nodeId === probe.nodeId).pop();
104
- this.applyProbeToGraph({ ...latestNodeState, status: 'loaded' });
105
- }, 1500);
106
- this.statusTimeouts.set(probe.nodeId, timeoutId);
107
- }
108
- }
109
- }
110
- // --- CONTROL ---
111
- goToLogIndex(index) {
112
- const log = this.probeLog[0]();
113
- if (index < 0 || index >= log.length)
114
- return;
115
- this.playbackState[1](prev => ({ ...prev, currentIndex: index, isPlaying: false }));
116
- // Reconstruye el estado del grafo hasta ese punto en el tiempo
117
- const snapshot = log.slice(0, index + 1).reduce((acc, probe) => {
118
- acc[probe.nodeId] = probe;
119
- return acc;
120
- }, {});
121
- const [getGraph, setGraph] = this.graphState;
122
- const currentGraph = getGraph();
123
- currentGraph.nodes.forEach((node) => {
124
- if (snapshot[node.id]) {
125
- node.status = snapshot[node.id].status;
126
- node.metadata = snapshot[node.id].metadata;
127
- }
128
- else {
129
- node.status = 'idle';
130
- }
131
- });
132
- setGraph({ ...currentGraph });
133
- }
134
- }
@@ -1,32 +0,0 @@
1
- type EventHandler = (data?: any) => void;
2
- type SpyHandler = (eventName: string, data?: any) => void;
3
- export declare class EventBus {
4
- private events;
5
- private spy;
6
- constructor();
7
- /**
8
- * Se suscribe a un evento.
9
- * @param eventName El nombre del evento (e.g., 'app:ready', 'view:changed').
10
- * @param handler La función a ejecutar cuando el evento se emita.
11
- */
12
- on(eventName: string, handler: EventHandler): void;
13
- /**
14
- * Se desuscribe de un evento.
15
- * @param eventName El nombre del evento.
16
- * @param handler La función a remover.
17
- */
18
- off(eventName: string, handler: EventHandler): void;
19
- /**
20
- * Emite un evento, llamando a todos los suscriptores.
21
- * @param eventName El nombre del evento a emitir.
22
- * @param data Datos opcionales para pasar a los manejadores.
23
- */
24
- emit(eventName: string, data?: any): void;
25
- /**
26
- * Registra una única función que recibirá TODOS los eventos emitidos.
27
- * @param handler La función espía.
28
- */
29
- spyOn(handler: SpyHandler): void;
30
- }
31
- export {};
32
- //# sourceMappingURL=EventBus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventBus.d.ts","sourceRoot":"","sources":["../../src/core/EventBus.ts"],"names":[],"mappings":"AACA,KAAK,YAAY,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AACzC,KAAK,UAAU,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAE1D,qBAAa,QAAQ;IACjB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,GAAG,CAA2B;;IAMtC;;;;OAIG;IACH,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAOlD;;;;OAIG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAOnD;;;;OAIG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAWzC;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;CAGnC"}
@@ -1,51 +0,0 @@
1
- export class EventBus {
2
- events;
3
- spy = null;
4
- constructor() {
5
- this.events = new Map();
6
- }
7
- /**
8
- * Se suscribe a un evento.
9
- * @param eventName El nombre del evento (e.g., 'app:ready', 'view:changed').
10
- * @param handler La función a ejecutar cuando el evento se emita.
11
- */
12
- on(eventName, handler) {
13
- if (!this.events.has(eventName)) {
14
- this.events.set(eventName, new Set());
15
- }
16
- this.events.get(eventName).add(handler);
17
- }
18
- /**
19
- * Se desuscribe de un evento.
20
- * @param eventName El nombre del evento.
21
- * @param handler La función a remover.
22
- */
23
- off(eventName, handler) {
24
- const handlers = this.events.get(eventName);
25
- if (handlers) {
26
- handlers.delete(handler);
27
- }
28
- }
29
- /**
30
- * Emite un evento, llamando a todos los suscriptores.
31
- * @param eventName El nombre del evento a emitir.
32
- * @param data Datos opcionales para pasar a los manejadores.
33
- */
34
- emit(eventName, data) {
35
- const handlers = this.events.get(eventName);
36
- if (handlers) {
37
- handlers.forEach(handler => handler(data));
38
- }
39
- // Notificar al espía, si existe
40
- if (this.spy) {
41
- this.spy(eventName, data);
42
- }
43
- }
44
- /**
45
- * Registra una única función que recibirá TODOS los eventos emitidos.
46
- * @param handler La función espía.
47
- */
48
- spyOn(handler) {
49
- this.spy = handler;
50
- }
51
- }
@@ -1,3 +0,0 @@
1
- import { IPlatformAPI } from "./api.js";
2
- export declare function initEventListeners(api: IPlatformAPI): void;
3
- //# sourceMappingURL=EventHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EventHandler.d.ts","sourceRoot":"","sources":["../../src/core/EventHandler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,QA2FnD"}
@@ -1,82 +0,0 @@
1
- // /src/EventHandler.ts (CORREGIDO Y COMPLETO CON DRAG & DROP)
2
- export function initEventListeners(api) {
3
- const { commands } = api;
4
- /**
5
- * MANEJADOR DE CLICS
6
- * Escucha clics en todo el cuerpo y despacha comandos si un elemento
7
- * con `data-command` es clickeado.
8
- */
9
- document.body.addEventListener('click', (e) => {
10
- const commandTarget = e.target.closest('[data-command]');
11
- if (!commandTarget || commandTarget.tagName === 'FORM')
12
- return; // Ignora los formularios aquí
13
- e.preventDefault();
14
- const commandId = commandTarget.getAttribute('data-command');
15
- const commandArg = commandTarget.getAttribute('data-command-arg');
16
- // Encuentra el ID del componente de UI padre para usarlo como fuente
17
- const componentId = commandTarget.closest('[data-component-id]')?.getAttribute('data-component-id') ?? undefined;
18
- if (commandId) {
19
- commands.execute(commandId, commandArg, componentId);
20
- }
21
- });
22
- /**
23
- * MANEJADOR DE FORMULARIOS
24
- * Escucha el evento 'submit' en todo el cuerpo. Es más eficiente y seguro
25
- * que los listeners de clic en los botones de envío.
26
- */
27
- document.body.addEventListener('submit', (e) => {
28
- const form = e.target;
29
- if (form.dataset.command) {
30
- e.preventDefault();
31
- commands.execute(form.dataset.command, new FormData(form));
32
- }
33
- });
34
- // --- MANEJO DE DRAG & DROP ---
35
- let draggedTaskId = null;
36
- // Se dispara cuando el usuario empieza a arrastrar una tarjeta
37
- document.body.addEventListener('dragstart', (e) => {
38
- const target = e.target;
39
- if (target.classList.contains('task-card-premium')) {
40
- draggedTaskId = Number(target.dataset.taskId);
41
- // Añadimos un efecto visual al elemento arrastrado
42
- setTimeout(() => target.classList.add('dragging'), 0);
43
- }
44
- });
45
- // Se dispara continuamente mientras un elemento se arrastra SOBRE una zona válida
46
- document.body.addEventListener('dragover', (e) => {
47
- const column = e.target.closest('.kanban-column');
48
- if (column) {
49
- // ✅ ESTA LÍNEA ES LA CLAVE: Prevenimos el comportamiento por defecto
50
- // para permitir que se pueda "soltar" el elemento aquí.
51
- e.preventDefault();
52
- // Añadimos feedback visual a la columna
53
- document.querySelectorAll('.kanban-column').forEach(c => c.classList.remove('drag-over'));
54
- column.classList.add('drag-over');
55
- }
56
- });
57
- // Se dispara cuando un elemento arrastrado sale de una zona válida
58
- document.body.addEventListener('dragleave', (e) => {
59
- e.target.closest('.kanban-column')?.classList.remove('drag-over');
60
- });
61
- // Se dispara cuando el usuario suelta el elemento en una zona válida
62
- document.body.addEventListener('drop', (e) => {
63
- e.preventDefault();
64
- const column = e.target.closest('.kanban-column');
65
- document.querySelectorAll('.kanban-column').forEach(c => c.classList.remove('drag-over'));
66
- if (column && draggedTaskId !== null) {
67
- const newStatus = column.dataset.status;
68
- // Despachamos un comando en lugar de ejecutar la lógica aquí
69
- api.commands.execute('kanban.moveTask', { taskId: draggedTaskId, newStatus });
70
- }
71
- document.querySelectorAll('.kanban-column').forEach(c => c.classList.remove('drag-over'));
72
- draggedTaskId = null;
73
- });
74
- // Se dispara cuando la operación de arrastre termina (se suelte o se cancele)
75
- document.body.addEventListener('dragend', (e) => {
76
- const target = e.target;
77
- if (target.classList.contains('task-card-premium')) {
78
- target.classList.remove('dragging');
79
- }
80
- draggedTaskId = null;
81
- });
82
- }
@@ -1,19 +0,0 @@
1
- import { IPlatformAPI } from "./api.js";
2
- export declare class GamificationService {
3
- api: IPlatformAPI;
4
- private levelFormula;
5
- /**
6
- * Añade una cantidad de XP, gestiona subidas de nivel y devuelve el estado actualizado.
7
- * YA NO llama a checkAndUnlockAchievements para romper el bucle.
8
- */
9
- addXP(amount: number, reason?: string): void;
10
- /**
11
- * Actualiza la racha del diario. Ahora también es más simple.
12
- */
13
- updateJournalStreak(): void;
14
- /**
15
- * Comprueba los logros, y si desbloquea alguno, añade el XP y actualiza el estado UNA SOLA VEZ.
16
- */
17
- checkAndUnlockAchievements(): void;
18
- }
19
- //# sourceMappingURL=GamificationService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GamificationService.d.ts","sourceRoot":"","sources":["../../src/core/GamificationService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,qBAAa,mBAAmB;IACrB,GAAG,EAAG,YAAY,CAAC;IAC1B,OAAO,CAAC,YAAY,CAA6D;IAEjF;;;OAGG;IACI,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,MAA4B;IA2BjE;;OAEG;IACI,mBAAmB;IA4B1B;;OAEG;IACI,0BAA0B;CA8CpC"}
@@ -1,102 +0,0 @@
1
- // /src/core/GamificationService.ts (CORREGIDO)
2
- export class GamificationService {
3
- api;
4
- levelFormula = (level) => Math.floor(100 * Math.pow(level, 1.5));
5
- /**
6
- * Añade una cantidad de XP, gestiona subidas de nivel y devuelve el estado actualizado.
7
- * YA NO llama a checkAndUnlockAchievements para romper el bucle.
8
- */
9
- addXP(amount, reason = 'Acción completada') {
10
- const { state, notifications } = this.api;
11
- const gamificationState = state.gamification();
12
- const newXP = gamificationState.xp + amount;
13
- const currentLevel = gamificationState.level;
14
- let newLevel = currentLevel;
15
- let leveledUp = false;
16
- let xpForNextLevel = this.levelFormula(currentLevel);
17
- while (newXP >= xpForNextLevel) {
18
- newLevel++;
19
- leveledUp = true;
20
- xpForNextLevel = this.levelFormula(newLevel);
21
- }
22
- // Actualizamos el estado una sola vez
23
- state.setGamification({ ...gamificationState, xp: newXP, level: newLevel });
24
- notifications.show('success', `+${amount} XP!`, reason);
25
- if (leveledUp) {
26
- setTimeout(() => {
27
- notifications.show('success', `¡Subiste de Nivel!`, `🚀 ¡Felicidades! Has alcanzado el Nivel ${newLevel}.`);
28
- }, 500); // Pequeño delay para que no se solapen las notificaciones
29
- }
30
- }
31
- /**
32
- * Actualiza la racha del diario. Ahora también es más simple.
33
- */
34
- updateJournalStreak() {
35
- const { state } = this.api;
36
- const gamificationState = state.gamification();
37
- const today = new Date();
38
- const lastDate = gamificationState.lastJournalDate ? new Date(gamificationState.lastJournalDate) : null;
39
- let newStreak = gamificationState.streak;
40
- const isSameDay = (d1, d2) => d1.toDateString() === d2.toDateString();
41
- if (lastDate && isSameDay(today, lastDate))
42
- return;
43
- const yesterday = new Date();
44
- yesterday.setDate(today.getDate() - 1);
45
- newStreak = (lastDate && isSameDay(yesterday, lastDate)) ? newStreak + 1 : 1;
46
- if (newStreak > gamificationState.streak) {
47
- const streakBonusXP = Math.min(newStreak * 5, 50);
48
- this.addXP(streakBonusXP, `Racha de ${newStreak} días`);
49
- }
50
- state.setGamification({
51
- ...state.gamification(),
52
- streak: newStreak,
53
- lastJournalDate: today.toISOString().slice(0, 10),
54
- });
55
- }
56
- /**
57
- * Comprueba los logros, y si desbloquea alguno, añade el XP y actualiza el estado UNA SOLA VEZ.
58
- */
59
- checkAndUnlockAchievements() {
60
- const { state, notifications } = this.api;
61
- const gamificationState = state.gamification();
62
- // const tasks = state.tasks();
63
- // const goals = state.goals();
64
- let totalXpFromAchievements = 0;
65
- const newlyUnlockedIds = [];
66
- gamificationState.achievements.forEach(achievement => {
67
- if (gamificationState.unlockedAchievements.includes(achievement.id))
68
- return;
69
- let conditionMet = false;
70
- switch (achievement.conditionType) {
71
- // case 'tasks_completed':
72
- // if (tasks.filter(t => t.status === 'done').length >= achievement.conditionValue) conditionMet = true;
73
- // break;
74
- // case 'goals_created':
75
- // if (goals.length >= achievement.conditionValue) conditionMet = true;
76
- // break;
77
- case 'journal_streak':
78
- if (gamificationState.streak >= achievement.conditionValue)
79
- conditionMet = true;
80
- break;
81
- case 'level':
82
- if (gamificationState.level >= achievement.conditionValue)
83
- conditionMet = true;
84
- break;
85
- }
86
- if (conditionMet) {
87
- newlyUnlockedIds.push(achievement.id);
88
- totalXpFromAchievements += achievement.reward_xp;
89
- notifications.show('success', '¡Logro Desbloqueado!', `🏆 ${achievement.title}`);
90
- }
91
- });
92
- if (newlyUnlockedIds.length > 0) {
93
- this.addXP(totalXpFromAchievements, `Recompensa por ${newlyUnlockedIds.length} logros`);
94
- // Obtenemos el estado más reciente después del addXP y añadimos los IDs
95
- const finalGamificationState = state.gamification();
96
- state.setGamification({
97
- ...finalGamificationState,
98
- unlockedAchievements: [...finalGamificationState.unlockedAchievements, ...newlyUnlockedIds]
99
- });
100
- }
101
- }
102
- }
@@ -1,34 +0,0 @@
1
- import { HookName, HookPayloads } from "../platform/extensionPoints";
2
- type HookCallback<T> = (data: T) => void | Promise<void>;
3
- /**
4
- * Gestiona el registro y la ejecución de hooks de ciclo de vida de forma
5
- * segura, asíncrona y desacoplada.
6
- */
7
- export declare class HookService {
8
- private hooks;
9
- /**
10
- * Registra un callback para un hook y devuelve una función para desregistrarlo.
11
- * @param hookName El nombre del hook al que suscribirse.
12
- * @param callback La función a ejecutar cuando el hook se dispare.
13
- * @returns Una función que, al llamarla, desuscribe el callback.
14
- */
15
- on<K extends HookName>(hookName: K, callback: HookCallback<HookPayloads[K]>): () => void;
16
- /**
17
- * Alias para el método `on`.
18
- */
19
- register<K extends HookName>(hookName: K, callback: HookCallback<HookPayloads[K]>): () => void;
20
- /**
21
- * Elimina un callback previamente registrado para un hook.
22
- * @param hookName El nombre del hook.
23
- * @param callbackToRemove La instancia exacta del callback a eliminar.
24
- */
25
- off<K extends HookName>(hookName: K, callbackToRemove: HookCallback<HookPayloads[K]>): void;
26
- /**
27
- * Dispara un hook, ejecutando todos los callbacks registrados para él.
28
- * @param hookName El nombre del hook a disparar.
29
- * @param data Los datos a pasar a los callbacks.
30
- */
31
- trigger<K extends HookName>(hookName: K, data: HookPayloads[K]): Promise<void>;
32
- }
33
- export {};
34
- //# sourceMappingURL=HookService.d.ts.map