@decido/shell-vscode-core 4.0.1 → 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 (52) hide show
  1. package/package.json +14 -13
  2. package/.turbo/turbo-build.log +0 -13
  3. package/CHANGELOG.md +0 -31
  4. package/src/appState.ts +0 -167
  5. package/src/core/AIService.ts +0 -109
  6. package/src/core/ApiService.ts +0 -40
  7. package/src/core/AuthService.ts +0 -85
  8. package/src/core/BaseService.ts +0 -47
  9. package/src/core/CalendarService.ts +0 -44
  10. package/src/core/CommandService.ts +0 -69
  11. package/src/core/DebugPanelService.ts +0 -38
  12. package/src/core/DebugService.ts +0 -181
  13. package/src/core/EventBus.ts +0 -60
  14. package/src/core/EventHandler.ts +0 -97
  15. package/src/core/GamificationService.ts +0 -120
  16. package/src/core/HookService.ts +0 -86
  17. package/src/core/ModalService.ts +0 -97
  18. package/src/core/NotificationService.ts +0 -53
  19. package/src/core/RouterService.ts +0 -68
  20. package/src/core/ServiceContainer.ts +0 -31
  21. package/src/core/ShortcutService.ts +0 -49
  22. package/src/core/StorageService.ts +0 -123
  23. package/src/core/ThemeService.ts +0 -71
  24. package/src/core/WebSocketService.ts +0 -32
  25. package/src/core/api.ts +0 -78
  26. package/src/core/app/ModuleManager.ts +0 -273
  27. package/src/core/app/apiFactory.ts +0 -130
  28. package/src/core/app/commandManager.ts +0 -218
  29. package/src/core/app/moduleLoader.ts +0 -39
  30. package/src/core/app/routeManager.ts +0 -8
  31. package/src/core/index.ts +0 -15
  32. package/src/core/signals.ts +0 -84
  33. package/src/core/uiState.ts +0 -13
  34. package/src/index.ts +0 -18
  35. package/src/lib/local-db.ts +0 -65
  36. package/src/lib/sync-service.ts +0 -44
  37. package/src/platform/ILayoutService.ts +0 -77
  38. package/src/platform/IRenderer.ts +0 -16
  39. package/src/platform/ServiceRegistry.ts +0 -53
  40. package/src/platform/extensionPoints.ts +0 -202
  41. package/src/platform/index.ts +0 -4
  42. package/src/stores/editorStore.ts +0 -6
  43. package/src/stores/gamificationStore.ts +0 -4
  44. package/src/stores/historyStore.ts +0 -14
  45. package/src/stores/workspaceStore.ts +0 -8
  46. package/src/types/app.ts +0 -36
  47. package/src/types/debug.ts +0 -69
  48. package/src/types/index.ts +0 -3
  49. package/src/types/platform.ts +0 -112
  50. package/src/ui/Palette.ts +0 -161
  51. package/src/utils.ts +0 -63
  52. package/tsconfig.json +0 -23
package/src/core/index.ts DELETED
@@ -1,15 +0,0 @@
1
- export * from './api.js'
2
- export * from './ApiService.js'
3
- export * from './AuthService.js'
4
- export * from './BaseService.js'
5
- export * from './CalendarService.js'
6
- export * from './CommandService.js'
7
- export * from './GamificationService.js'
8
- export * from './HookService.js'
9
- export * from './ModalService.js'
10
- export * from './NotificationService.js'
11
- export * from './RouterService.js'
12
- export * from './ShortcutService.js'
13
- export * from './StorageService.js'
14
- export * from './ThemeService.js'
15
- export * from './EventHandler.js'
@@ -1,84 +0,0 @@
1
- // File: packages/core/src/core/signals.ts
2
-
3
- export type Setter<T> = (newValue: T | ((prev: T) => T)) => void;
4
- export type Signal<T> = [() => T, Setter<T>];
5
-
6
- const context: (() => void)[] = [];
7
-
8
- /**
9
- * Crea una señal reactiva.
10
- * @param value El valor inicial de la señal.
11
- * @param options Opciones de configuración.
12
- * @param options.equals Una función para comparar valores antiguos y nuevos. Si devuelve `true`, los suscriptores no se activan. Por defecto usa `Object.is`. Pasa `false` para forzar siempre la actualización.
13
- */
14
- export function createSignal<T>(
15
- value: T,
16
- options?: { equals?: boolean | ((prev: T, next: T) => boolean) }
17
- ): Signal<T> {
18
- const subscribers = new Set<() => void>();
19
-
20
- const get = (): T => {
21
- const runningEffect = context[context.length - 1];
22
- if (runningEffect) {
23
- subscribers.add(runningEffect);
24
- }
25
- return value;
26
- };
27
-
28
- const set = (newValue: T | ((prev: T) => T)) => {
29
- const finalValue = typeof newValue === 'function'
30
- ? (newValue as (prev: T) => T)(value)
31
- : newValue;
32
-
33
- // --- LÓGICA DE COMPARACIÓN MEJORADA ---
34
- // Determina si los valores son iguales basándose en las opciones.
35
- const areEqual =
36
- options?.equals === false
37
- ? false // Si `equals` es `false`, nunca son iguales, siempre se actualiza.
38
- : typeof options?.equals === 'function'
39
- ? options.equals(value, finalValue) // Usa la función de comparación personalizada.
40
- : Object.is(value, finalValue); // Comportamiento por defecto.
41
-
42
- if (areEqual) {
43
- return;
44
- }
45
-
46
- value = finalValue;
47
- // Hacemos una copia del set antes de iterar para evitar problemas si un
48
- // efecto modifica las suscripciones durante la ejecución.
49
- [...subscribers].forEach(effect => effect());
50
- };
51
-
52
- return [get, set];
53
- }
54
-
55
- export function createEffect(fn: () => void) {
56
- const effect = () => {
57
- context.push(effect);
58
- try {
59
- fn();
60
- } finally {
61
- context.pop();
62
- }
63
- };
64
- effect();
65
- }
66
-
67
- /**
68
- * Crea una señal computada de solo lectura que se actualiza automáticamente
69
- * cuando las señales de las que depende cambian.
70
- * @param fn La función que calcula el valor.
71
- * @returns Un getter de solo lectura para el valor computado.
72
- */
73
- export function createMemo<T>(fn: () => T): () => T {
74
- // Usamos la nueva opción `equals: false` para asegurar que el efecto
75
- // siempre actualice el valor del memo, incluso si el objeto/array es
76
- // estructuralmente idéntico pero una nueva instancia.
77
- const [get, set] = createSignal<T | undefined>(undefined, { equals: false });
78
-
79
- createEffect(() => {
80
- set(fn());
81
- });
82
-
83
- return get as () => T;
84
- }
@@ -1,13 +0,0 @@
1
- // src/core/uiState.ts
2
- import { createSignal } from './signals.js';
3
- import { ActivityBarItem, MainView, PanelView, SidebarView, StatusBarItem, TopBarItem, SidebarRightView } from '../types';
4
-
5
- // ESTADO GLOBAL para todos los componentes de la UI registrados.
6
- // LayoutService leerá de aquí. Los módulos escribirán aquí.
7
- export const registeredActivityBarItems = createSignal<Record<string, ActivityBarItem>>({});
8
- export const registeredSidebarViews = createSignal<Record<string, SidebarView>>({});
9
- export const registeredSidebarRightViews = createSignal<Record<string, SidebarRightView>>({});
10
- export const registeredMainViews = createSignal<Record<string, MainView>>({});
11
- export const registeredPanelViews = createSignal<Record<string, PanelView>>({});
12
- export const registeredStatusBarItems = createSignal<Record<string, StatusBarItem>>({});
13
- export const registeredTopBarItems = createSignal<Record<string, TopBarItem>>({});
package/src/index.ts DELETED
@@ -1,18 +0,0 @@
1
- export { IPlatformAPI } from './core/api.js';
2
- export { ServiceContainer } from './core/ServiceContainer.js';
3
- export { ModuleManager, RegisteredModule } from './core/app/ModuleManager.js';
4
- export { createPlatformAPI } from './core/app/apiFactory.js';
5
- export { authService } from './core/AuthService.js';
6
- export { DebugService } from './core/DebugService.js';
7
- export * from './core/app/moduleLoader.js';
8
- export * from './core/signals.js';
9
- export * from './core';
10
- export * from './platform';
11
- export * from './utils.js'
12
- export * from './lib/sync-service.js';
13
- export * from './lib/local-db.js';
14
- export * from './types/platform.js'; // Export platform types (Pane, etc)
15
- export * from './types/debug.js';
16
-
17
- export * from './core/app/commandManager.js'
18
-
@@ -1,65 +0,0 @@
1
- // src/lib/local-db.ts
2
- import Dexie, { Table } from 'dexie';
3
-
4
- // Interfaces para las tablas
5
- export interface ModuleData {
6
- id: string; // ej: "task-123"
7
- entityId: string | number;
8
- moduleId: string; // ej: "tasks"
9
- entityType: string; // ej: "task"
10
- userId?: string;
11
- data: any; // El objeto de la tarea, meta, etc.
12
- }
13
-
14
- export interface SyncQueueItem {
15
- id?: number;
16
- type: 'create' | 'update' | 'delete';
17
- status: 'pending' | 'syncing' | 'synced' | 'failed';
18
- entityType: string;
19
- payload: any;
20
- timestamp: number;
21
- }
22
-
23
- export interface DailySnapshot {
24
- date: string; // YYYY-MM-DD
25
- data: any;
26
- timestamp: Date;
27
- }
28
-
29
- // Nuevas interfaces para Local-First
30
- export interface LocalProject {
31
- id: string;
32
- name: string;
33
- data: any; // El JSON gigante de reactflow (nodes, edges)
34
- updatedAt: number;
35
- thumbnail?: string; // Base64 preview
36
- }
37
-
38
- export interface LocalSettings {
39
- key: string;
40
- value: any;
41
- }
42
-
43
- // Clase de DB tipada
44
- export class DecidoDB extends Dexie {
45
- moduleData!: Table<ModuleData, string>;
46
- syncQueue!: Table<SyncQueueItem, number>;
47
- dailySnapshots!: Table<DailySnapshot, string>;
48
- projects!: Table<LocalProject, string>;
49
- settings!: Table<LocalSettings, string>;
50
-
51
- constructor() {
52
- super('DecidoDB');
53
- this.version(4).stores({
54
- // Añadimos 'entityType' como un índice individual.
55
- moduleData: 'id, entityId, [moduleId+entityType], userId, entityType',
56
- syncQueue: '++id, type, status',
57
- dailySnapshots: 'date',
58
- // Schemas nuevos
59
- projects: 'id, name, updatedAt', // Índices para búsqueda rápida
60
- settings: 'key'
61
- }); // No upgrade needed for adding new tables usually, but good to be safe implies auto-creation.
62
- }
63
- }
64
-
65
- export const db = new DecidoDB();
@@ -1,44 +0,0 @@
1
- import { db } from './local-db';
2
- import { apiService } from '../core/ApiService';
3
-
4
- export class SyncService {
5
- private isSyncing = false;
6
-
7
- // Llamar esto en el arranque de la app
8
- startSyncLoop() {
9
- setInterval(() => this.sync(), 10000); // Sincronizar cada 10s
10
- window.addEventListener('online', () => this.sync());
11
- }
12
-
13
- async sync() {
14
- if (this.isSyncing || !navigator.onLine) return;
15
- this.isSyncing = true;
16
-
17
- try {
18
- // 1. Obtener proyectos modificados localmente (necesitarías un flag 'dirty' en DB)
19
- // Por simplicidad, supongamos que enviamos el activo
20
- const activeProjectId = localStorage.getItem('active_project_id');
21
- if (activeProjectId) {
22
- const localProj = await db.projects.get(activeProjectId);
23
-
24
- if (localProj) {
25
- console.log("☁️ Sincronizando con la nube...");
26
- // Enviar a tu API V2
27
- await apiService.fetch(`/module-data/projects/${localProj.id}`, {
28
- method: 'PUT',
29
- body: JSON.stringify({
30
- data: localProj.data,
31
- name: localProj.name
32
- })
33
- });
34
- }
35
- }
36
- } catch (e) {
37
- console.error("Error de sincronización", e);
38
- } finally {
39
- this.isSyncing = false;
40
- }
41
- }
42
- }
43
-
44
- export const syncService = new SyncService();
@@ -1,77 +0,0 @@
1
- import { IPlatformAPI } from '../core/api.js';
2
- import { Tab, ActivityBarItem, SidebarView, SidebarRightView, MainView, PanelView, StatusBarItem, TopBarItem } from '../types';
3
- import { Signal } from '../core/signals.js';
4
-
5
- export interface ILayoutService {
6
- api: IPlatformAPI;
7
-
8
- state: {
9
- activeActivityId: Signal<string>;
10
- isSidebarVisible: Signal<boolean>;
11
- isSidebarRightVisible: Signal<boolean>;
12
- isPanelVisible: Signal<boolean>;
13
- activePanelId: Signal<string>;
14
- activeSidebarRightId: Signal<string>;
15
- panelHeight: Signal<number>;
16
- sidebarWidth: Signal<number>;
17
- sidebarRightWidth: Signal<number>;
18
- };
19
-
20
- dom: {
21
- appGrid: HTMLElement | null;
22
- mainContent: HTMLElement | null;
23
- activityBar: HTMLElement | null;
24
- sidebarContainer: HTMLElement | null;
25
- sidebarRightContainer: HTMLElement | null;
26
- panelContainer: HTMLElement | null;
27
- panelResizeHandle: HTMLElement | null;
28
- sidebarResizeHandle: HTMLElement | null;
29
- sidebarRightResizeHandle: HTMLElement | null;
30
- statusBarContainer: HTMLElement | null;
31
- topBar: HTMLElement | null;
32
- };
33
-
34
- openTab(tab: Tab): void;
35
- closeTab(tabId: string, paneId?: string): void;
36
- setActiveTab(tabId: string, paneId?: string): void;
37
- setActivePane(paneId: string): void;
38
- splitPane(paneId: string, tab: Tab): void;
39
- closePane(paneId: string): void;
40
-
41
- renderMainContent(): void;
42
- renderActivityBar(): void;
43
- renderSidebar(): void;
44
- renderSidebarRight(): void;
45
- renderPanel(): void;
46
- renderStatusBar(): void;
47
- renderTopBar(): void;
48
-
49
- attachVerticalResizeHandler(): void;
50
- attachHorizontalResizeHandler(resizer: HTMLElement, position: 'left' | 'right'): void;
51
- handleResizeMouseMove(e: MouseEvent): void;
52
- handleResizeMouseUp(e: MouseEvent): void;
53
-
54
- // addDragDropListeners(): void;
55
- // handleDragStart(e: DragEvent): void;
56
- // handleDragOver(e: DragEvent): void;
57
- // handleDragLeave(e: DragEvent): void;
58
- // handleDrop(e: DragEvent): void;
59
- // handleDragEnd(e: DragEvent): void;
60
- // cleanupDropVisuals(): void;
61
-
62
- registerActivityBarItem(item: ActivityBarItem): void;
63
- registerSidebarView(view: SidebarView): void;
64
- registerSidebarRightView(view: SidebarRightView): void;
65
- registerMainView(view: MainView): void;
66
- registerPanelView(view: PanelView): void;
67
- registerStatusBarItem(item: StatusBarItem): void;
68
- registerTopBarItem(item: TopBarItem): void;
69
-
70
- listenToEvents(): void;
71
- initLayout(container: HTMLElement): void;
72
- activateEffects(): void;
73
- initCommands(): void;
74
-
75
- renderComponent(tag: string, options?: { isFullscreen?: boolean }): void;
76
- _toggleUserMenu(e: Event): void;
77
- }
@@ -1,16 +0,0 @@
1
- import { IPlatformAPI } from "../core/api";
2
- import React from 'react';
3
-
4
- /**
5
- * Define el contrato que cualquier motor de renderizado debe cumplir
6
- * para ser utilizado por el LayoutService del núcleo.
7
- */
8
- export interface IRenderer {
9
- /**
10
- * Renderiza un componente de React en un contenedor del DOM.
11
- * @param target El elemento del DOM donde se renderizará el contenido.
12
- * @param component El componente de React a renderizar.
13
- * @param api La API de la plataforma, por si el componente la necesita.
14
- */
15
- render(target: HTMLElement, component: React.ReactNode, api: IPlatformAPI): void;
16
- }
@@ -1,53 +0,0 @@
1
- // src/platform/ServiceRegistry.ts
2
-
3
- import { IPlatformAPI } from "../core/api";
4
- import { ModuleManager } from "../core/app/ModuleManager";
5
- import { CalendarService } from "../core/CalendarService";
6
- import { CommandService } from "../core/CommandService";
7
- import { EventBus } from "../core/EventBus";
8
- import { GamificationService } from "../core/GamificationService";
9
- import { HookService } from "../core/HookService";
10
- import { ILayoutService } from "./ILayoutService.js"
11
- import { ModalService } from "../core/ModalService";
12
- import { NotificationService } from "../core/NotificationService";
13
- import { ShortcutService } from "../core/ShortcutService";
14
- import { StorageService } from "../core/StorageService";
15
- import { ThemeService } from "../core/ThemeService";
16
- import { SyncService } from "../lib/sync-service";
17
- import { IRenderer } from "./IRenderer";
18
- import { AuthService } from "../core";
19
- import { WebSocketService } from "../core/WebSocketService";
20
-
21
- // Importa las clases de servicio que serán registrables.
22
- // Estos servicios vivirán dentro de sus respectivos módulos, pero importamos
23
- // sus tipos aquí para crear un contrato centralizado.
24
- // import { GoalService } from '../modules/decido.goals/GoalService.js';
25
-
26
- /**
27
- * Define un mapa de claves de servicio a sus tipos de clase.
28
- * Este es el corazón de nuestro sistema de servicios tipado.
29
- * Cualquier servicio que un módulo quiera compartir con otros debe ser listado aquí.
30
- */
31
- export interface ServiceRegistry {
32
- 'api': IPlatformAPI;
33
- 'events': EventBus;
34
- 'notifications': NotificationService;
35
- 'modals': ModalService;
36
- 'layout': ILayoutService;
37
- 'commands': CommandService;
38
- 'shortcuts': ShortcutService;
39
- 'gamification': GamificationService;
40
- 'calendar': CalendarService;
41
- 'storage': StorageService;
42
- 'sync': SyncService;
43
- 'hooks': HookService;
44
- 'theme': ThemeService;
45
- 'moduleManager': ModuleManager;
46
- 'renderer': IRenderer;
47
- 'auth': AuthService;
48
- 'websocket': WebSocketService;
49
-
50
- }
51
-
52
- // Creamos un tipo para las claves, lo que nos dará autocompletado.
53
- export type ServiceKey = keyof ServiceRegistry;
@@ -1,202 +0,0 @@
1
- // // ===================================================================
2
- // // 1. DICCIONARIO DE PUNTOS DE EXTENSIÓN (NOMBRES)
3
- // // ===================================================================
4
-
5
- // import { IPlatformAPI } from "../core";
6
-
7
- // // import { Task } from "../types";
8
-
9
- // /**
10
- // * Define todos los nombres de los HOOKS de ciclo de vida disponibles en la plataforma.
11
- // * Usamos 'as const' para que TypeScript trate estos valores como literales inmutables,
12
- // * lo que nos da autocompletado y seguridad de tipos.
13
- // */
14
- // export const HOOK_NAMES = {
15
- // // Hooks del ciclo de vida de la Aplicación
16
- // APP_BEFORE_START: 'app:beforeStart',
17
- // APP_READY: 'app:ready',
18
- // APP_SHUTDOWN: 'app:shutdown',
19
- // WORKBENCH_BEFORE_START: 'workbench:before-start',
20
- // WORKBENCH_LAYOUT_READY: 'workbench:layout-ready',
21
- // WORKBENCH_USER_AUTHENTICATED: 'workbench:user-authenticated',
22
- // WORKBENCH_READY: 'workbench:ready',
23
-
24
- // // Hooks de Entidades (ejemplo con Tareas)
25
- // // TASK_AFTER_CREATE: 'task:afterCreate',
26
- // // TASK_AFTER_UPDATE: 'task:afterUpdate',
27
- // // TASK_AFTER_DELETE: 'task:afterDelete',
28
-
29
- // // ... aquí añadirías los de Project, Goal, etc.
30
- // } as const;
31
-
32
- // /**
33
- // * Define todos los nombres de los SLOTS de UI disponibles donde los módulos
34
- // * pueden inyectar componentes visuales.
35
- // */
36
- // export const SLOT_NAMES = {
37
- // // UI Principal
38
- // ACTIVITY_BAR: 'ui:activityBar',
39
- // STATUS_BAR_LEFT: 'ui:statusBar.left',
40
- // STATUS_BAR_RIGHT: 'ui:statusBar.right',
41
- // TOP_BAR_LEFT: 'ui:topBar.left',
42
- // TOP_BAR_CENTER: 'ui:topBar.center',
43
- // TOP_BAR_RIGHT: 'ui:topBar.right',
44
- // SIDEBAR_MAIN: 'ui:sidebar.main',
45
- // PANEL_BOTTOM: 'ui:panel.bottom',
46
-
47
- // // UI Específica de una Vista (ejemplo con la vista de una tarea)
48
- // TASK_VIEW_ACTIONS: 'view:task.actions',
49
- // TASK_VIEW_METADATA: 'view:task.metadata',
50
- // } as const;
51
-
52
- // // ===================================================================
53
- // // 2. TIPOS DERIVADOS DE LOS DICCIONARIOS
54
- // // ===================================================================
55
-
56
- // // El tipo HookName será una unión de todos los valores de HOOK_NAMES.
57
- // // Ej: 'app:ready' | 'task:afterCreate' | ...
58
- // export type HookName = typeof HOOK_NAMES[keyof typeof HOOK_NAMES];
59
-
60
- // // El tipo SlotName será una unión de todos los valores de SLOT_NAMES.
61
- // export type SlotName = typeof SLOT_NAMES[keyof typeof SLOT_NAMES];
62
-
63
- // // ===================================================================
64
- // // 3. MAPA DE PAYLOADS DE HOOKS
65
- // // Conecta cada hook con la estructura de datos que transporta.
66
- // // ===================================================================
67
-
68
- // // Primero, definimos las interfaces para los datos de cada hook.
69
- // // export interface TaskAfterCreatePayload {
70
- // // createdTask: Task;
71
- // // }
72
-
73
- // // export interface TaskAfterUpdatePayload {
74
- // // oldTask: Task;
75
- // // newValues: Partial<Task>;
76
- // // }
77
-
78
- // // export interface TaskAfterDeletePayload {
79
- // // deletedTask: Task;
80
- // // }
81
-
82
- // /**
83
- // * Mapeo central que conecta un nombre de hook con la interfaz de su payload.
84
- // * Esto nos dará una seguridad de tipos completa al registrar y disparar hooks.
85
- // */
86
- // export interface HookPayloads {
87
- // [HOOK_NAMES.APP_BEFORE_START]: undefined; // Un hook puede no tener payload
88
- // [HOOK_NAMES.APP_READY]: { timestamp: number };
89
- // [HOOK_NAMES.APP_SHUTDOWN]: undefined;
90
- // [HOOK_NAMES.WORKBENCH_BEFORE_START]: undefined;
91
- // [HOOK_NAMES.WORKBENCH_LAYOUT_READY]: undefined;
92
- // [HOOK_NAMES.WORKBENCH_USER_AUTHENTICATED]: undefined;
93
- // [HOOK_NAMES.WORKBENCH_READY]: { api: IPlatformAPI };
94
-
95
- // }
96
-
97
-
98
-
99
- // // Hooks de Entidades (ejemplo con Tareas)
100
-
101
- // // [HOOK_NAMES.TASK_AFTER_CREATE]: TaskAfterCreatePayload;
102
- // // [HOOK_NAMES.TASK_AFTER_UPDATE]: TaskAfterUpdatePayload;
103
- // // [HOOK_NAMES.TASK_AFTER_DELETE]: TaskAfterDeletePayload;
104
-
105
- // // ... aquí se añadirían los payloads de otros hooks ...
106
-
107
- import { IPlatformAPI } from "../core";
108
-
109
- // ===================================================================
110
- // DEFINICIÓN DE INTERFACES EXTENSIBLES
111
- // Estas interfaces son la "fuente de la verdad" y serán aumentadas
112
- // por los módulos de funcionalidades.
113
- // ===================================================================
114
-
115
- /**
116
- * Define la estructura genérica de un componente que puede ser renderizado en un slot.
117
- * Podría ser un componente de React, Svelte, Lit, o una clase personalizada.
118
- * Usaremos una interfaz simple como ejemplo.
119
- */
120
- export interface IRenderable {
121
- render(element: HTMLElement): void;
122
- dispose?(): void;
123
- }
124
-
125
- /**
126
- * 🧱 MAPA DE PAYLOADS DE HOOKS
127
- * Conecta un nombre de hook (string literal) con la interfaz de su payload.
128
- * Esta interfaz es AUMENTABLE por otros módulos.
129
- */
130
- export interface HookPayloads {
131
- 'app:beforeStart': undefined;
132
- 'app:ready': { timestamp: number };
133
- 'app:shutdown': undefined;
134
- 'workbench:before-start': undefined;
135
- 'workbench:layout-ready': undefined;
136
- 'workbench:user-authenticated': undefined;
137
- 'workbench:ready': { api: IPlatformAPI };
138
- 'auth:logout': undefined;
139
- 'auth:login': undefined;
140
-
141
-
142
- // Ejemplo: 'task:afterCreate': TaskAfterCreatePayload; (será añadido por el módulo de tareas)
143
- }
144
-
145
- /**
146
- * 🧱 MAPA DE RENDERABLES DE SLOTS
147
- * Conecta un nombre de slot (string literal) con el TIPO de componente que puede renderizar.
148
- * Esta interfaz es AUMENTABLE por otros módulos.
149
- */
150
- export interface SlotRenderables {
151
- 'ui:activityBar': IRenderable;
152
- 'ui:statusBar.left': IRenderable;
153
- 'ui:statusBar.right': IRenderable;
154
- 'ui:topBar.left': IRenderable;
155
- 'ui:topBar.center': IRenderable;
156
- 'ui:topBar.right': IRenderable;
157
- 'ui:sidebar.main': IRenderable;
158
- 'ui:panel.bottom': IRenderable;
159
-
160
- // Ejemplo: 'view:task.actions': IRenderable; (será añadido por el módulo de tareas)
161
- }
162
-
163
-
164
- // ===================================================================
165
- // TIPOS DERIVADOS (NO NECESITAN MODIFICACIÓN)
166
- // Estos tipos se actualizan automáticamente gracias a la aumentación.
167
- // ===================================================================
168
-
169
- /**
170
- * El tipo HookName se deriva de todas las claves registradas en HookPayloads.
171
- * Crece automáticamente a medida que otros módulos aumentan la interfaz.
172
- */
173
- export type HookName = keyof HookPayloads;
174
-
175
- /**
176
- * El tipo SlotName se deriva de todas las claves registradas en SlotRenderables.
177
- * Crece automáticamente a medida que otros módulos aumentan la interfaz.
178
- */
179
- export type SlotName = keyof SlotRenderables;
180
-
181
-
182
- // ===================================================================
183
- // CONSTANTES PARA USO INTERNO DEL CORE (OPCIONAL PERO RECOMENDADO)
184
- // ===================================================================
185
-
186
- export const CORE_HOOK_NAMES = {
187
- APP_BEFORE_START: 'app:beforeStart',
188
- APP_READY: 'app:ready',
189
- APP_SHUTDOWN: 'app:shutdown',
190
- WORKBENCH_BEFORE_START: 'workbench:before-start',
191
- WORKBENCH_LAYOUT_READY: 'workbench:layout-ready',
192
- WORKBENCH_USER_AUTHENTICATED: 'workbench:user-authenticated',
193
- WORKBENCH_READY: 'workbench:ready',
194
- // ...etc
195
- } as const;
196
-
197
- export const CORE_SLOT_NAMES = {
198
- ACTIVITY_BAR: 'ui:activityBar',
199
- STATUS_BAR_LEFT: 'ui:statusBar.left',
200
- STATUS_BAR_RIGHT: 'ui:statusBar.right',
201
- // ...etc
202
- } as const;
@@ -1,4 +0,0 @@
1
- export * from './ServiceRegistry.js'
2
- export * from './IRenderer.js'
3
- export * from './extensionPoints.js'
4
- export * from './ILayoutService.js'
@@ -1,6 +0,0 @@
1
- import { createSignal } from "../core/signals";
2
- import { Pane } from "../types";
3
-
4
- export const [editorPanes, setEditorPanes] = createSignal<Pane[]>([]);
5
- export const [activePaneId, setActivePaneId] = createSignal<string | null>(null);
6
- export const [viewData, setViewData] = createSignal<any>(null);
@@ -1,4 +0,0 @@
1
- import { createSignal } from "../core/signals";
2
- import { GamificationState } from "../types";
3
-
4
- export const [gamification, setGamification] = createSignal<GamificationState>({ xp: 0, level: 1, streak: 0, lastJournalDate: null, unlockedAchievements: [], achievements: [] });
@@ -1,14 +0,0 @@
1
- import { createSignal } from "../core/signals";
2
-
3
- export interface HistoryEntry {
4
- id: number;
5
- timestamp: Date;
6
- action: string;
7
- snapshot: any;
8
- }
9
-
10
- export const [isTimeTraveling, setIsTimeTraveling] = createSignal<boolean>(false);
11
- export const [timeTravelState, setTimeTravelState] = createSignal<any | null>(null);
12
- export const [timeTravelDate, setTimeTravelDate] = createSignal(new Date());
13
- export const [snapshotDates, setSnapshotDates] = createSignal<string[]>([]);
14
- export const [history, setHistory] = createSignal<HistoryEntry[]>([]);
@@ -1,8 +0,0 @@
1
- import { createSignal } from "../core/signals";
2
- import { CalendarEvent } from "../types";
3
-
4
- export const [activeCalendarId, setActiveCalendarId] = createSignal<string | 'all'>('all');
5
- export const [activeDashboardContext, setActiveDashboardContext] = createSignal<{ type: 'global' | 'goal' | 'project' | 'today', id: number | null }>({ type: 'global', id: null });
6
- export const [activeGoalId, setActiveGoalId] = createSignal<number | null>(null);
7
- export const [activeProjectId, setActiveProjectId] = createSignal<number | null>(null);
8
- export const [calendar, setCalendar] = createSignal<CalendarEvent[]>([]);