@johpaz/hive-sdk 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/index.js +171573 -11091
- package/dist/channels/index.js +3702 -51
- package/dist/cron/index.js +806 -7
- package/dist/database/index.js +2636 -2
- package/dist/ethics/index.js +2636 -2
- package/dist/hivelearn/index.d.ts +11 -0
- package/dist/hivelearn/index.js +5033 -0
- package/dist/hivelearn/src/agent/agent-loop.d.ts +14 -0
- package/dist/hivelearn/src/agent/executor.d.ts +10 -0
- package/dist/hivelearn/src/agent/prompts.d.ts +1 -0
- package/dist/hivelearn/src/agent/runner.d.ts +8 -0
- package/dist/hivelearn/src/agent/tool-map.d.ts +12 -0
- package/dist/hivelearn/src/agents/coordinator.prompt.d.ts +9 -0
- package/dist/hivelearn/src/agents/prompts/audio.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/challenge.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/code.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/evaluation.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/exercise.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/explanation.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/feedback.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/gamification.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/gif.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/infographic.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/intent.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/profile.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/quiz.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/structure.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/prompts/svg.prompt.d.ts +1 -0
- package/dist/hivelearn/src/agents/registry.d.ts +43 -0
- package/dist/hivelearn/src/cache/CacheInvalidator.d.ts +9 -0
- package/dist/hivelearn/src/cache/NodeCache.d.ts +15 -0
- package/dist/hivelearn/src/events/swarm-events.d.ts +12 -0
- package/dist/hivelearn/src/index.d.ts +17 -0
- package/dist/hivelearn/src/persistence/LessonPersistence.d.ts +90 -0
- package/dist/hivelearn/src/scheduler/dag/DAGScheduler.d.ts +29 -0
- package/dist/hivelearn/src/scheduler/dag/EventBridge.d.ts +16 -0
- package/dist/hivelearn/src/scheduler/dag/TaskGraph.d.ts +18 -0
- package/dist/hivelearn/src/scheduler/dag/TaskNode.d.ts +40 -0
- package/dist/hivelearn/src/scheduler/dag/TaskResult.d.ts +19 -0
- package/dist/hivelearn/src/scheduler/dag/errors.d.ts +17 -0
- package/dist/hivelearn/src/scheduler/dag/index.d.ts +13 -0
- package/dist/hivelearn/src/scheduler/dag/strategies/ParallelStrategy.d.ts +11 -0
- package/dist/hivelearn/src/swarm/HiveLearnSwarm.d.ts +16 -0
- package/dist/hivelearn/src/swarm/orchestrator.d.ts +15 -0
- package/dist/hivelearn/src/swarm/presets/HiveLearnPreset.d.ts +35 -0
- package/dist/hivelearn/src/swarm/session.d.ts +15 -0
- package/dist/hivelearn/src/tools/canvas/disenar-estructura.tool.d.ts +3 -0
- package/dist/hivelearn/src/tools/canvas/poblar-nodo.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-audio.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-codigo.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-ejercicio.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-explicacion.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-frames-gif.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-imagen.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-infografia.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-quiz.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-reto.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/content/generar-svg.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/coordinator/delegar-enjambre.tool.d.ts +6 -0
- package/dist/hivelearn/src/tools/coordinator/revisar-programa.tool.d.ts +6 -0
- package/dist/hivelearn/src/tools/evaluation/calificar-evaluacion.tool.d.ts +20 -0
- package/dist/hivelearn/src/tools/evaluation/generar-evaluacion.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/index.d.ts +26 -0
- package/dist/hivelearn/src/tools/profile/clasificar-intencion.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/search/buscar-curriculo-existente.tool.d.ts +2 -0
- package/dist/hivelearn/src/tools/search/buscar-en-hivelearn.tool.d.ts +2 -0
- package/dist/hivelearn/src/types/tool.d.ts +17 -0
- package/dist/hivelearn/src/types.d.ts +187 -0
- package/dist/hivelearn/src/utils/logger.d.ts +21 -0
- package/dist/index.js +172848 -11349
- package/dist/mcp/index.js +25 -0
- package/dist/skills/index.js +2636 -2
- package/dist/tools/index.js +167497 -7015
- package/package.json +9 -3
- package/src/hivelearn/index.ts +43 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Tool } from '../../types/tool';
|
|
2
|
+
import type { FeedbackOutput, PreguntaEvaluacion } from '../../types';
|
|
3
|
+
export interface CalificacionInput {
|
|
4
|
+
preguntas: PreguntaEvaluacion[];
|
|
5
|
+
respuestasAlumno: Array<string | number>;
|
|
6
|
+
}
|
|
7
|
+
export interface CalificacionOutput {
|
|
8
|
+
puntaje: number;
|
|
9
|
+
correctas: number;
|
|
10
|
+
total: number;
|
|
11
|
+
feedback: FeedbackOutput[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Evalúa directamente las respuestas del alumno sin necesitar un agente LLM.
|
|
15
|
+
* - multiple_choice: compara índice seleccionado con indiceCorrecto
|
|
16
|
+
* - respuesta_corta: similitud de palabras clave (umbral 0.5)
|
|
17
|
+
*/
|
|
18
|
+
export declare function evaluarRespuestas(input: CalificacionInput): CalificacionOutput;
|
|
19
|
+
export declare const calificarEvaluacionTool: Tool;
|
|
20
|
+
export declare const calificarRespuestaTool: Tool;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { disenarEstructuraTool } from './canvas/disenar-estructura.tool';
|
|
2
|
+
export { poblarNodoTool } from './canvas/poblar-nodo.tool';
|
|
3
|
+
export { generarExplicacionTool } from './content/generar-explicacion.tool';
|
|
4
|
+
export { generarEjercicioTool } from './content/generar-ejercicio.tool';
|
|
5
|
+
export { generarQuizTool } from './content/generar-quiz.tool';
|
|
6
|
+
export { generarRetoTool } from './content/generar-reto.tool';
|
|
7
|
+
export { generarCodigoTool } from './content/generar-codigo.tool';
|
|
8
|
+
export { generarSvgTool } from './content/generar-svg.tool';
|
|
9
|
+
export { generarFramesGifTool } from './content/generar-frames-gif.tool';
|
|
10
|
+
export { generarInfografiaTool } from './content/generar-infografia.tool';
|
|
11
|
+
export { generarEvaluacionTool } from './evaluation/generar-evaluacion.tool';
|
|
12
|
+
export { calificarEvaluacionTool, calificarRespuestaTool } from './evaluation/calificar-evaluacion.tool';
|
|
13
|
+
export { generarImagenTool } from './content/generar-imagen.tool';
|
|
14
|
+
export { clasificarIntencionTool } from './profile/clasificar-intencion.tool';
|
|
15
|
+
export { buscarCurriculoExistenteTool } from './search/buscar-curriculo-existente.tool';
|
|
16
|
+
export { buscarEnHiveLearnTool } from './search/buscar-en-hivelearn.tool';
|
|
17
|
+
export { revisarProgramaTool } from './coordinator/revisar-programa.tool';
|
|
18
|
+
export { delegarEnjambreTool } from './coordinator/delegar-enjambre.tool';
|
|
19
|
+
import type { LLMToolDef } from '../types/tool';
|
|
20
|
+
export declare const PROFILE_TOOLS: LLMToolDef[];
|
|
21
|
+
export declare const INTENT_TOOLS: LLMToolDef[];
|
|
22
|
+
export declare const STRUCTURE_TOOLS: LLMToolDef[];
|
|
23
|
+
export declare const CONTENT_TOOLS: LLMToolDef[];
|
|
24
|
+
export declare const VISUAL_TOOLS: LLMToolDef[];
|
|
25
|
+
export declare const EVALUATION_TOOLS: LLMToolDef[];
|
|
26
|
+
export declare const GAMIFICATION_TOOLS: LLMToolDef[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HiveLearn — Tool types (local copy, no core dependency)
|
|
3
|
+
*/
|
|
4
|
+
export interface Tool {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
parameters: Record<string, any>;
|
|
8
|
+
execute?: (params: Record<string, unknown>, config?: any) => Promise<string | object>;
|
|
9
|
+
}
|
|
10
|
+
export interface LLMToolDef {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
parameters: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/** Tipos compartidos entre backend y UI de HiveLearn */
|
|
2
|
+
export type RangoEdad = 'nino' | 'adolescente' | 'adulto';
|
|
3
|
+
export type TipoPedagogico = 'concept' | 'exercise' | 'quiz' | 'challenge' | 'milestone' | 'evaluation';
|
|
4
|
+
export type TipoVisual = 'text_card' | 'code_block' | 'svg_diagram' | 'gif_guide' | 'infographic' | 'chart' | 'animated_card' | 'image_ai' | 'audio_ai';
|
|
5
|
+
export type TipoPregunta = 'verdadero_falso' | 'multiple_choice' | 'respuesta_corta' | 'completar_codigo';
|
|
6
|
+
export type NivelPrevio = 'principiante' | 'principiante_base' | 'intermedio';
|
|
7
|
+
export type EstiloAprendizaje = 'visual' | 'lectura' | 'retos' | 'balanceado' | 'mis_retos';
|
|
8
|
+
export type EstadoNodo = 'bloqueado' | 'disponible' | 'completado';
|
|
9
|
+
export type AgentStatus = 'idle' | 'pending' | 'running' | 'thinking' | 'tool_call' | 'completed' | 'failed';
|
|
10
|
+
export type CoordinatorStatus = 'idle' | 'analyzing' | 'delegating' | 'assembling' | 'rendering' | 'completed' | 'error';
|
|
11
|
+
export interface CoordinatorState {
|
|
12
|
+
status: CoordinatorStatus;
|
|
13
|
+
currentWorker: string | null;
|
|
14
|
+
activeWorkers: string[];
|
|
15
|
+
totalWorkers: number;
|
|
16
|
+
}
|
|
17
|
+
export interface StudentProfile {
|
|
18
|
+
alumnoId: string;
|
|
19
|
+
nombre: string;
|
|
20
|
+
edad: number;
|
|
21
|
+
rangoEdad: RangoEdad;
|
|
22
|
+
tiempoSesion: 15 | 30 | 45;
|
|
23
|
+
nivelPrevio: NivelPrevio;
|
|
24
|
+
estilo: EstiloAprendizaje;
|
|
25
|
+
sesionesTotal: number;
|
|
26
|
+
xpAcumulado: number;
|
|
27
|
+
nivelActual: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PerfilAdaptacion {
|
|
30
|
+
rangoEdad: RangoEdad;
|
|
31
|
+
duracionSesion: number;
|
|
32
|
+
nodosRecomendados: number;
|
|
33
|
+
estilo: EstiloAprendizaje;
|
|
34
|
+
nivelPrevio: NivelPrevio;
|
|
35
|
+
tono: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IntentResult {
|
|
38
|
+
tema: string;
|
|
39
|
+
nivelDetectado: NivelPrevio;
|
|
40
|
+
topicSlug: string | null;
|
|
41
|
+
tono: string;
|
|
42
|
+
confianza: number;
|
|
43
|
+
}
|
|
44
|
+
export interface NodoLesson {
|
|
45
|
+
id: string;
|
|
46
|
+
tipoPedagogico: TipoPedagogico;
|
|
47
|
+
tipoVisual: TipoVisual;
|
|
48
|
+
titulo: string;
|
|
49
|
+
concepto: string;
|
|
50
|
+
nivel: NivelPrevio;
|
|
51
|
+
rangoEdad: RangoEdad;
|
|
52
|
+
posX: number;
|
|
53
|
+
posY: number;
|
|
54
|
+
estado: EstadoNodo;
|
|
55
|
+
xpRecompensa: number;
|
|
56
|
+
contenido?: NodoContenido;
|
|
57
|
+
}
|
|
58
|
+
export interface MicroEvaluacion {
|
|
59
|
+
tipo: TipoPregunta;
|
|
60
|
+
pregunta: string;
|
|
61
|
+
opciones?: string[];
|
|
62
|
+
respuestaCorrecta: string;
|
|
63
|
+
pista?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface NodoContenido {
|
|
66
|
+
explicacion?: ExplicacionOutput;
|
|
67
|
+
ejercicio?: EjercicioOutput;
|
|
68
|
+
quiz?: QuizOutput;
|
|
69
|
+
reto?: RetoOutput;
|
|
70
|
+
codigo?: CodigoOutput;
|
|
71
|
+
svg?: SvgOutput;
|
|
72
|
+
gifFrames?: GifOutput;
|
|
73
|
+
infografia?: InfografiaOutput;
|
|
74
|
+
evaluacion?: EvaluacionOutput;
|
|
75
|
+
microEval?: MicroEvaluacion;
|
|
76
|
+
imagen?: ImagenOutput;
|
|
77
|
+
audio?: AudioOutput;
|
|
78
|
+
}
|
|
79
|
+
export interface ImagenOutput {
|
|
80
|
+
prompt: string;
|
|
81
|
+
estilo: 'diagram' | 'illustration' | 'chart';
|
|
82
|
+
alt_text: string;
|
|
83
|
+
caption: string;
|
|
84
|
+
svg_fallback: string;
|
|
85
|
+
url?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface AudioOutput {
|
|
88
|
+
narration_text: string;
|
|
89
|
+
voice_tone: 'friendly' | 'professional' | 'motivating';
|
|
90
|
+
key_pauses: string[];
|
|
91
|
+
speed: 'slow' | 'normal' | 'fast';
|
|
92
|
+
title: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ExplicacionOutput {
|
|
95
|
+
titulo: string;
|
|
96
|
+
explicacion: string;
|
|
97
|
+
ejemploConcreto: string;
|
|
98
|
+
}
|
|
99
|
+
export interface EjercicioOutput {
|
|
100
|
+
enunciado: string;
|
|
101
|
+
ejemploRespuesta: string;
|
|
102
|
+
respuestaCorrecta: string;
|
|
103
|
+
pistaOpcional?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface QuizOutput {
|
|
106
|
+
pregunta: string;
|
|
107
|
+
opciones: string[];
|
|
108
|
+
indicesCorrecto: number;
|
|
109
|
+
explicacionesIncorrectas: string[];
|
|
110
|
+
}
|
|
111
|
+
export interface RetoOutput {
|
|
112
|
+
titulo: string;
|
|
113
|
+
contexto: string;
|
|
114
|
+
pasos: string[];
|
|
115
|
+
criteriosExito: string[];
|
|
116
|
+
}
|
|
117
|
+
export interface CodigoOutput {
|
|
118
|
+
lenguaje: string;
|
|
119
|
+
codigo: string;
|
|
120
|
+
descripcionBreve: string;
|
|
121
|
+
}
|
|
122
|
+
export interface SvgOutput {
|
|
123
|
+
svgString: string;
|
|
124
|
+
}
|
|
125
|
+
export interface GifFrame {
|
|
126
|
+
emoji: string;
|
|
127
|
+
texto: string;
|
|
128
|
+
duracionMs: number;
|
|
129
|
+
}
|
|
130
|
+
export interface GifOutput {
|
|
131
|
+
frames: GifFrame[];
|
|
132
|
+
}
|
|
133
|
+
export interface InfografiaSeccion {
|
|
134
|
+
emoji: string;
|
|
135
|
+
titulo: string;
|
|
136
|
+
valor: string;
|
|
137
|
+
}
|
|
138
|
+
export interface InfografiaOutput {
|
|
139
|
+
secciones: InfografiaSeccion[];
|
|
140
|
+
}
|
|
141
|
+
export interface GamificacionOutput {
|
|
142
|
+
xpRecompensa: number;
|
|
143
|
+
logros: Logro[];
|
|
144
|
+
mensajeCelebracion: string;
|
|
145
|
+
badge?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface Logro {
|
|
148
|
+
id: string;
|
|
149
|
+
nombre: string;
|
|
150
|
+
descripcion: string;
|
|
151
|
+
emoji: string;
|
|
152
|
+
xp: number;
|
|
153
|
+
}
|
|
154
|
+
export interface EvaluacionOutput {
|
|
155
|
+
preguntas: PreguntaEvaluacion[];
|
|
156
|
+
}
|
|
157
|
+
export interface PreguntaEvaluacion {
|
|
158
|
+
tipo: 'multiple_choice' | 'respuesta_corta';
|
|
159
|
+
pregunta: string;
|
|
160
|
+
opciones?: string[];
|
|
161
|
+
indiceCorrecto?: number;
|
|
162
|
+
respuestaEsperada?: string;
|
|
163
|
+
}
|
|
164
|
+
export interface FeedbackOutput {
|
|
165
|
+
correcto: boolean;
|
|
166
|
+
mensajePrincipal: string;
|
|
167
|
+
pistaSiIncorrecto?: string;
|
|
168
|
+
xpGanado: number;
|
|
169
|
+
razonamiento?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface LessonProgram {
|
|
172
|
+
sessionId: string;
|
|
173
|
+
alumnoId: string;
|
|
174
|
+
tema: string;
|
|
175
|
+
topicSlug: string | null;
|
|
176
|
+
rangoEdad: RangoEdad;
|
|
177
|
+
nodos: NodoLesson[];
|
|
178
|
+
gamificacion: GamificacionOutput;
|
|
179
|
+
evaluacion: EvaluacionOutput;
|
|
180
|
+
perfilAdaptacion: PerfilAdaptacion;
|
|
181
|
+
}
|
|
182
|
+
export interface SwarmProgress {
|
|
183
|
+
etapa: string;
|
|
184
|
+
agenteActivo: string;
|
|
185
|
+
porcentaje: number;
|
|
186
|
+
mensaje: string;
|
|
187
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HiveLearn — Logger simple (no depende de core)
|
|
3
|
+
*/
|
|
4
|
+
declare class ChildLogger {
|
|
5
|
+
private context;
|
|
6
|
+
constructor(context: string);
|
|
7
|
+
debug(msg: string): void;
|
|
8
|
+
info(msg: string): void;
|
|
9
|
+
warn(msg: string): void;
|
|
10
|
+
error(msg: string): void;
|
|
11
|
+
child(sub: string): ChildLogger;
|
|
12
|
+
}
|
|
13
|
+
declare class RootLogger {
|
|
14
|
+
debug(msg: string): void;
|
|
15
|
+
info(msg: string): void;
|
|
16
|
+
warn(msg: string): void;
|
|
17
|
+
error(msg: string): void;
|
|
18
|
+
child(context: string): ChildLogger;
|
|
19
|
+
}
|
|
20
|
+
export declare const logger: RootLogger;
|
|
21
|
+
export {};
|