@mks2508/better-logger 5.0.1 → 5.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.
- package/dist/Logger.d.ts +976 -0
- package/dist/Logger.d.ts.map +1 -0
- package/dist/ScopedLogger.d.ts +74 -0
- package/dist/ScopedLogger.d.ts.map +1 -0
- package/dist/chunks/Logger-CKqzXDh3.js +2 -0
- package/dist/chunks/Logger-CKqzXDh3.js.map +1 -0
- package/dist/chunks/Logger-D_vuKP4l.js +4511 -0
- package/dist/chunks/Logger-D_vuKP4l.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js +33 -0
- package/dist/chunks/RemoteLogHandler-CjWpWZGl.js.map +1 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js +2 -0
- package/dist/chunks/RemoteLogHandler-ymkQ97xl.js.map +1 -0
- package/dist/chunks/cli-module-B-njrTWb.js +2 -0
- package/dist/chunks/cli-module-B-njrTWb.js.map +1 -0
- package/dist/chunks/cli-module-Cx7qotPY.js +390 -0
- package/dist/chunks/cli-module-Cx7qotPY.js.map +1 -0
- package/dist/chunks/color-converter-CCSQRztd.js +2 -0
- package/dist/chunks/color-converter-CCSQRztd.js.map +1 -0
- package/dist/chunks/color-converter-_Xdmsy7E.js +462 -0
- package/dist/chunks/color-converter-_Xdmsy7E.js.map +1 -0
- package/dist/chunks/environment-C1xxvc8l.js +1127 -0
- package/dist/chunks/environment-C1xxvc8l.js.map +1 -0
- package/dist/chunks/environment-Cprkw3g9.js +4 -0
- package/dist/chunks/environment-Cprkw3g9.js.map +1 -0
- package/dist/chunks/formatting-DMJxYq9o.js +380 -0
- package/dist/chunks/formatting-DMJxYq9o.js.map +1 -0
- package/dist/chunks/formatting-DpKxCsXq.js +2 -0
- package/dist/chunks/formatting-DpKxCsXq.js.map +1 -0
- package/dist/cli/CommandProcessor.d.ts +100 -0
- package/dist/cli/CommandProcessor.d.ts.map +1 -0
- package/dist/cli/commands/ConfigCommand.d.ts +14 -0
- package/dist/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/dist/cli/commands/ExportCommand.d.ts +48 -0
- package/dist/cli/commands/ExportCommand.d.ts.map +1 -0
- package/dist/cli/commands/HistoryCommand.d.ts +47 -0
- package/dist/cli/commands/HistoryCommand.d.ts.map +1 -0
- package/dist/cli/commands/StatusCommand.d.ts +30 -0
- package/dist/cli/commands/StatusCommand.d.ts.map +1 -0
- package/dist/cli/commands/ThemeCommand.d.ts +30 -0
- package/dist/cli/commands/ThemeCommand.d.ts.map +1 -0
- package/dist/cli/help.d.ts +12 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/{src/cli-module.ts → dist/cli-module.d.ts} +2 -8
- package/dist/cli-module.d.ts.map +1 -0
- package/dist/cli-primitives/box.d.ts +11 -0
- package/dist/cli-primitives/box.d.ts.map +1 -0
- package/dist/cli-primitives/cli-table.d.ts +11 -0
- package/dist/cli-primitives/cli-table.d.ts.map +1 -0
- package/dist/cli-primitives/divider.d.ts +11 -0
- package/dist/cli-primitives/divider.d.ts.map +1 -0
- package/dist/cli-primitives/header.d.ts +12 -0
- package/dist/cli-primitives/header.d.ts.map +1 -0
- package/{src/cli-primitives/index.ts → dist/cli-primitives/index.d.ts} +1 -1
- package/dist/cli-primitives/index.d.ts.map +1 -0
- package/dist/cli-primitives/server-fallback.d.ts +25 -0
- package/dist/cli-primitives/server-fallback.d.ts.map +1 -0
- package/dist/cli-primitives/spinner.d.ts +47 -0
- package/dist/cli-primitives/spinner.d.ts.map +1 -0
- package/dist/cli-primitives/step.d.ts +11 -0
- package/dist/cli-primitives/step.d.ts.map +1 -0
- package/dist/cli.cjs +2 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +12 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +235 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/core.cjs +2 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.ts +127 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +291 -0
- package/dist/core.js.map +1 -0
- package/dist/example.d.ts +18 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/exports-module.d.ts +196 -0
- package/dist/exports-module.d.ts.map +1 -0
- package/dist/exports.cjs +2 -0
- package/dist/exports.cjs.map +1 -0
- package/dist/exports.js +238 -0
- package/dist/exports.js.map +1 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts +8 -0
- package/dist/handlers/AnalyticsLogHandler.d.ts.map +1 -0
- package/dist/handlers/ExportLogHandler.d.ts +100 -0
- package/dist/handlers/ExportLogHandler.d.ts.map +1 -0
- package/dist/handlers/FileLogHandler.d.ts +33 -0
- package/dist/handlers/FileLogHandler.d.ts.map +1 -0
- package/dist/handlers/RemoteLogHandler.d.ts +11 -0
- package/dist/handlers/RemoteLogHandler.d.ts.map +1 -0
- package/{src/handlers/index.ts → dist/handlers/index.d.ts} +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/hooks/HookManager.d.ts +21 -0
- package/dist/hooks/HookManager.d.ts.map +1 -0
- package/{src/hooks/index.ts → dist/hooks/index.d.ts} +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +161 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +627 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/serializers/SerializerRegistry.d.ts +16 -0
- package/dist/serializers/SerializerRegistry.d.ts.map +1 -0
- package/{src/serializers/index.ts → dist/serializers/index.d.ts} +1 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/styling/LogStyleBuilder.d.ts +146 -0
- package/dist/styling/LogStyleBuilder.d.ts.map +1 -0
- package/dist/styling/SemanticStyles.d.ts +178 -0
- package/dist/styling/SemanticStyles.d.ts.map +1 -0
- package/dist/styling/SmartPresets.d.ts +22 -0
- package/dist/styling/SmartPresets.d.ts.map +1 -0
- package/dist/styling/StyleBuilder.d.ts +140 -0
- package/dist/styling/StyleBuilder.d.ts.map +1 -0
- package/dist/styling/StyleCache.d.ts +42 -0
- package/dist/styling/StyleCache.d.ts.map +1 -0
- package/dist/styling/banners.d.ts +42 -0
- package/dist/styling/banners.d.ts.map +1 -0
- package/dist/styling/index.d.ts +10 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/themes.d.ts +7 -0
- package/dist/styling/themes.d.ts.map +1 -0
- package/dist/styling-module.d.ts +178 -0
- package/dist/styling-module.d.ts.map +1 -0
- package/dist/styling.cjs +2 -0
- package/dist/styling.cjs.map +1 -0
- package/dist/styling.js +146 -0
- package/dist/styling.js.map +1 -0
- package/dist/terminal/color-converter.d.ts +73 -0
- package/dist/terminal/color-converter.d.ts.map +1 -0
- package/dist/terminal/formatter.d.ts +20 -0
- package/dist/terminal/formatter.d.ts.map +1 -0
- package/dist/terminal/terminal-renderer.d.ts +77 -0
- package/dist/terminal/terminal-renderer.d.ts.map +1 -0
- package/dist/transports/ConsoleTransport.d.ts +9 -0
- package/dist/transports/ConsoleTransport.d.ts.map +1 -0
- package/dist/transports/FileTransport.d.ts +15 -0
- package/dist/transports/FileTransport.d.ts.map +1 -0
- package/dist/transports/HttpTransport.d.ts +16 -0
- package/dist/transports/HttpTransport.d.ts.map +1 -0
- package/dist/transports/TransportManager.d.ts +14 -0
- package/dist/transports/TransportManager.d.ts.map +1 -0
- package/{src/transports/index.ts → dist/transports/index.d.ts} +1 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/{src/types/core.ts → dist/types/core.d.ts} +25 -62
- package/dist/types/core.d.ts.map +1 -0
- package/{src/types/handlers.ts → dist/types/handlers.d.ts} +5 -15
- package/dist/types/handlers.d.ts.map +1 -0
- package/{src/types/hooks.ts → dist/types/hooks.d.ts} +3 -12
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/{src/types/serializers.ts → dist/types/serializers.d.ts} +1 -6
- package/dist/types/serializers.d.ts.map +1 -0
- package/{src/types/transports.ts → dist/types/transports.d.ts} +2 -7
- package/dist/types/transports.d.ts.map +1 -0
- package/dist/utils/adapter.d.ts +48 -0
- package/dist/utils/adapter.d.ts.map +1 -0
- package/dist/utils/ansi-colors.d.ts +156 -0
- package/dist/utils/ansi-colors.d.ts.map +1 -0
- package/dist/utils/environment-detector.d.ts +45 -0
- package/dist/utils/environment-detector.d.ts.map +1 -0
- package/dist/utils/environment.d.ts +47 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +58 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/opentui-detection.d.ts +34 -0
- package/dist/utils/opentui-detection.d.ts.map +1 -0
- package/dist/utils/output.d.ts +46 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/stackTrace.d.ts +6 -0
- package/dist/utils/stackTrace.d.ts.map +1 -0
- package/dist/utils/timestamps.d.ts +20 -0
- package/dist/utils/timestamps.d.ts.map +1 -0
- package/{src/writers/BufferWriter.ts → dist/writers/BufferWriter.d.ts} +16 -77
- package/dist/writers/BufferWriter.d.ts.map +1 -0
- package/{src/writers/index.ts → dist/writers/index.d.ts} +1 -1
- package/dist/writers/index.d.ts.map +1 -0
- package/package.json +5 -1
- package/.claude/settings.local.json +0 -48
- package/.github/workflows/ci-quality.yml +0 -357
- package/.github/workflows/docs-demo.yml +0 -119
- package/.github/workflows/releases-core.yml +0 -512
- package/.github/workflows/releases-full.yml +0 -582
- package/.github/workflows-backup/ci.yml +0 -221
- package/.github/workflows-backup/nightly.yml +0 -196
- package/.github/workflows-backup/release-optimized.yml +0 -373
- package/.github/workflows-backup/release.yml +0 -269
- package/.release-notes-0.2.0.md +0 -129
- package/.yamllint +0 -28
- package/CHANGELOG.json +0 -1120
- package/CHANGELOG.md +0 -209
- package/CLAUDE.md +0 -217
- package/demo.html +0 -847
- package/docs/API.md +0 -918
- package/docs/CORE.md +0 -264
- package/docs/DEVELOPMENT.md +0 -731
- package/docs/EXPORTS.md +0 -467
- package/docs/PACKAGES.md +0 -244
- package/docs/STYLING.md +0 -405
- package/docs/_config.yml +0 -36
- package/docs/index.md +0 -179
- package/examples/README.md +0 -208
- package/examples/basic-logging.js +0 -75
- package/examples/data-export.js +0 -234
- package/examples/package.json +0 -16
- package/examples/performance-timing.js +0 -170
- package/examples/simplified-api.js +0 -124
- package/examples/styling-themes.js +0 -207
- package/index.html +0 -358
- package/packages/core/package.json +0 -57
- package/packages/exports/package.json +0 -41
- package/packages/nodejs-opentui/README.md +0 -232
- package/packages/nodejs-opentui/package.json +0 -72
- package/packages/nodejs-opentui/src/LogRenderer.ts +0 -171
- package/packages/nodejs-opentui/src/OpenTUILogHandler.ts +0 -178
- package/packages/nodejs-opentui/src/components/LogBadge.tsx +0 -131
- package/packages/nodejs-opentui/src/index.ts +0 -133
- package/packages/nodejs-opentui/src/types.ts +0 -158
- package/packages/nodejs-opentui/tsconfig.json +0 -20
- package/packages/styling/package.json +0 -41
- package/playground/demo-all.ts +0 -95
- package/playground/demo-box.ts +0 -85
- package/playground/demo-levels.ts +0 -56
- package/playground/demo-real-world.ts +0 -98
- package/playground/demo-spinner.ts +0 -77
- package/playground/demo-steps.ts +0 -72
- package/playground/demo-table.ts +0 -83
- package/project-utils/README.md +0 -172
- package/project-utils/auto-release-gemini.ts +0 -1193
- package/project-utils/auto-release-ui.ts +0 -1329
- package/project-utils/commit-generator.ts +0 -1385
- package/project-utils/commit-ui.ts +0 -264
- package/project-utils/git-utils.ts +0 -199
- package/project-utils/github-release-manager.ts +0 -466
- package/project-utils/project-config.ts +0 -260
- package/project-utils/prompt-templates.js +0 -345
- package/project-utils/prompt-templates.ts +0 -422
- package/project-utils/version-manager.ts +0 -1078
- package/src/Logger.ts +0 -1858
- package/src/ScopedLogger.ts +0 -256
- package/src/cli/CommandProcessor.ts +0 -248
- package/src/cli/commands/ConfigCommand.ts +0 -93
- package/src/cli/commands/ExportCommand.ts +0 -276
- package/src/cli/commands/HistoryCommand.ts +0 -117
- package/src/cli/commands/StatusCommand.ts +0 -112
- package/src/cli/commands/ThemeCommand.ts +0 -88
- package/src/cli/help.ts +0 -127
- package/src/cli/index.ts +0 -71
- package/src/cli-primitives/box.ts +0 -86
- package/src/cli-primitives/cli-table.ts +0 -62
- package/src/cli-primitives/divider.ts +0 -17
- package/src/cli-primitives/header.ts +0 -18
- package/src/cli-primitives/server-fallback.ts +0 -54
- package/src/cli-primitives/spinner.ts +0 -133
- package/src/cli-primitives/step.ts +0 -22
- package/src/constants.ts +0 -313
- package/src/core.ts +0 -397
- package/src/example.ts +0 -210
- package/src/exports-module.ts +0 -311
- package/src/handlers/AnalyticsLogHandler.ts +0 -22
- package/src/handlers/ExportLogHandler.ts +0 -610
- package/src/handlers/FileLogHandler.ts +0 -169
- package/src/handlers/RemoteLogHandler.ts +0 -42
- package/src/hooks/HookManager.ts +0 -177
- package/src/index.ts +0 -395
- package/src/main.ts +0 -196
- package/src/serializers/SerializerRegistry.ts +0 -173
- package/src/style.css +0 -96
- package/src/styling/LogStyleBuilder.ts +0 -355
- package/src/styling/SemanticStyles.ts +0 -380
- package/src/styling/SmartPresets.ts +0 -288
- package/src/styling/StyleBuilder.ts +0 -319
- package/src/styling/StyleCache.ts +0 -131
- package/src/styling/banners.ts +0 -168
- package/src/styling/index.ts +0 -27
- package/src/styling/themes.ts +0 -235
- package/src/styling-module.ts +0 -244
- package/src/terminal/color-converter.ts +0 -315
- package/src/terminal/formatter.ts +0 -242
- package/src/terminal/terminal-renderer.ts +0 -342
- package/src/transports/ConsoleTransport.ts +0 -28
- package/src/transports/FileTransport.ts +0 -53
- package/src/transports/HttpTransport.ts +0 -56
- package/src/transports/TransportManager.ts +0 -130
- package/src/types/index.ts +0 -83
- package/src/typescript.svg +0 -1
- package/src/utils/adapter.ts +0 -291
- package/src/utils/ansi-colors.ts +0 -333
- package/src/utils/environment-detector.ts +0 -170
- package/src/utils/environment.ts +0 -94
- package/src/utils/formatting.ts +0 -332
- package/src/utils/index.ts +0 -33
- package/src/utils/opentui-detection.ts +0 -138
- package/src/utils/output.ts +0 -227
- package/src/utils/stackTrace.ts +0 -144
- package/src/utils/timestamps.ts +0 -80
- package/src/vite-env.d.ts +0 -1
- package/test-core-browser.html +0 -237
- package/test-core-node.js +0 -63
- package/tests/test-conflict-resolution.ts +0 -391
- package/tests/validate-workflows.sh +0 -131
- package/tests/yaml-autofix.sh +0 -146
- package/tsconfig.json +0 -50
- package/vite.config.ts +0 -256
- /package/{public → dist}/vite.svg +0 -0
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plantillas de prompts estandarizadas para Gemini CLI
|
|
3
|
-
* @description Asegura respuestas consistentes y parseables en todos los scripts
|
|
4
|
-
* @author TPV EL Haido
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface GeminiPromptConfig {
|
|
8
|
-
/** Contexto base del proyecto */
|
|
9
|
-
projectContext: {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
version: string;
|
|
13
|
-
techStack: string[];
|
|
14
|
-
targetPlatform: string;
|
|
15
|
-
};
|
|
16
|
-
/** Tipo de análisis requerido */
|
|
17
|
-
analysisType: 'commit' | 'workflow' | 'release';
|
|
18
|
-
/** Contexto adicional específico */
|
|
19
|
-
specificContext?: string;
|
|
20
|
-
/** Datos estructurados para el análisis */
|
|
21
|
-
data?: any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface StandardResponseFormat {
|
|
25
|
-
/** Análisis o resumen principal */
|
|
26
|
-
analysis: string;
|
|
27
|
-
/** Recomendaciones o acciones */
|
|
28
|
-
recommendations: string;
|
|
29
|
-
/** Datos estructurados (commits, comandos, etc.) */
|
|
30
|
-
structured_data: any[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Configuración base del proyecto Better Logger
|
|
35
|
-
*/
|
|
36
|
-
export const BETTER_LOGGER_PROJECT_CONFIG = {
|
|
37
|
-
name: 'Better Logger',
|
|
38
|
-
description: 'State-of-the-art console logger with advanced CSS styling, SVG support, animations, and CLI interface',
|
|
39
|
-
version: '0.0.3-alpha.0',
|
|
40
|
-
techStack: ['TypeScript', 'Vite', 'Browser', 'CSS-in-JS', 'SVG'] as const,
|
|
41
|
-
targetPlatform: 'Browser (Chrome, Firefox, Safari, Edge)',
|
|
42
|
-
} as const;
|
|
43
|
-
|
|
44
|
-
// Alias para compatibilidad
|
|
45
|
-
export const TPV_PROJECT_CONFIG = BETTER_LOGGER_PROJECT_CONFIG;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Prefijo estándar para todos los prompts de Gemini
|
|
49
|
-
*/
|
|
50
|
-
const STANDARD_PROMPT_PREFIX = `# Sistema de Análisis Inteligente - Better Logger
|
|
51
|
-
|
|
52
|
-
Eres un asistente especializado en análisis de código y automatización para el proyecto Better Logger. Tu función es proporcionar respuestas estructuradas, precisas y consistentes que puedan ser parseadas automáticamente.
|
|
53
|
-
|
|
54
|
-
## REGLAS CRÍTICAS DE FORMATO
|
|
55
|
-
|
|
56
|
-
1. **FORMATO DE RESPUESTA OBLIGATORIO**: Todas tus respuestas deben seguir exactamente el formato especificado más abajo.
|
|
57
|
-
2. **CONSISTENCIA**: Mantén la misma estructura sin importar la complejidad del análisis.
|
|
58
|
-
3. **PARSEABLE**: El formato debe ser fácil de procesar automáticamente con expresiones regulares.
|
|
59
|
-
4. **BLOQUES MARKDOWN**: Usa \`\`\`markdown para bloques de código cuando se especifique.
|
|
60
|
-
5. **SECCIONES TÉCNICAS**: Siempre incluye las secciones <technical> y <changelog> cuando sea aplicable.
|
|
61
|
-
|
|
62
|
-
## Contexto del Proyecto
|
|
63
|
-
**Nombre**: ${BETTER_LOGGER_PROJECT_CONFIG.name}
|
|
64
|
-
**Descripción**: ${BETTER_LOGGER_PROJECT_CONFIG.description}
|
|
65
|
-
**Versión Actual**: ${BETTER_LOGGER_PROJECT_CONFIG.version}
|
|
66
|
-
**Stack Tecnológico**: ${BETTER_LOGGER_PROJECT_CONFIG.techStack.join(', ')}
|
|
67
|
-
**Plataforma Objetivo**: ${BETTER_LOGGER_PROJECT_CONFIG.targetPlatform}
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Sufijo estándar con instrucciones de formato
|
|
74
|
-
*/
|
|
75
|
-
const STANDARD_PROMPT_SUFFIX = `
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## INSTRUCCIONES FINALES
|
|
80
|
-
|
|
81
|
-
1. **Lee cuidadosamente** toda la información proporcionada
|
|
82
|
-
2. **Analiza el contexto** y los datos específicos
|
|
83
|
-
3. **Genera una respuesta** siguiendo EXACTAMENTE el formato especificado
|
|
84
|
-
4. **Mantén consistencia** en la estructura y sintaxis
|
|
85
|
-
5. **No desvíes** del formato requerido bajo ninguna circunstancia
|
|
86
|
-
|
|
87
|
-
**IMPORTANTE**: La respuesta debe ser parseada automáticamente. Cualquier desviación del formato especificado causará errores en el sistema.`;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Genera prompt para análisis de commits
|
|
91
|
-
*/
|
|
92
|
-
export function createCommitPrompt(config: GeminiPromptConfig): string {
|
|
93
|
-
const { data, specificContext } = config;
|
|
94
|
-
|
|
95
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
96
|
-
|
|
97
|
-
# ANÁLISIS DE COMMITS
|
|
98
|
-
|
|
99
|
-
## Datos del Análisis
|
|
100
|
-
${JSON.stringify(data, null, 2)}
|
|
101
|
-
|
|
102
|
-
## Contexto Adicional
|
|
103
|
-
${specificContext || 'Ninguno proporcionado'}
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
108
|
-
|
|
109
|
-
Tu respuesta debe seguir EXACTAMENTE esta estructura:
|
|
110
|
-
|
|
111
|
-
### **ANÁLISIS PRINCIPAL**
|
|
112
|
-
|
|
113
|
-
[Descripción general de los cambios detectados]
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
### **Propuesta de Commit #1**
|
|
118
|
-
|
|
119
|
-
\`\`\`markdown
|
|
120
|
-
[prefijo](área - descripción breve)
|
|
121
|
-
|
|
122
|
-
[Descripción completa en castellano de QUÉ se logró y POR QUÉ]
|
|
123
|
-
|
|
124
|
-
<technical>
|
|
125
|
-
[Detalles técnicos específicos: archivos modificados, funciones añadidas, refactorizaciones, etc.]
|
|
126
|
-
</technical>
|
|
127
|
-
|
|
128
|
-
<changelog>
|
|
129
|
-
## [Tipo] [Emoji]
|
|
130
|
-
[Entrada para changelog de la app, optimizada para mostrar al usuario]
|
|
131
|
-
</changelog>
|
|
132
|
-
\`\`\`
|
|
133
|
-
|
|
134
|
-
### **Propuesta de Commit #2** (solo si es necesario)
|
|
135
|
-
|
|
136
|
-
[Repetir formato anterior]
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
**DECISIÓN**: [Explicación breve de por qué uno o múltiples commits]
|
|
141
|
-
|
|
142
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Genera prompt para asistente de workflow
|
|
147
|
-
*/
|
|
148
|
-
export function createWorkflowPrompt(config: GeminiPromptConfig): string {
|
|
149
|
-
const { data, specificContext } = config;
|
|
150
|
-
|
|
151
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
152
|
-
|
|
153
|
-
# ASISTENTE DE WORKFLOW
|
|
154
|
-
|
|
155
|
-
## Solicitud del Usuario
|
|
156
|
-
"${specificContext}"
|
|
157
|
-
|
|
158
|
-
## Contexto del Proyecto Actual
|
|
159
|
-
${JSON.stringify(data, null, 2)}
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
164
|
-
|
|
165
|
-
\`\`\`markdown
|
|
166
|
-
🎯 **ANÁLISIS**: [Descripción del tipo de trabajo detectado]
|
|
167
|
-
📊 **IMPACTO**: [Áreas afectadas y alcance del cambio]
|
|
168
|
-
🚀 **RECOMENDACIÓN**: [Tipo de versión y estrategia recomendada]
|
|
169
|
-
|
|
170
|
-
## 🖥️ COMANDOS PARA macOS
|
|
171
|
-
\`\`\`bash
|
|
172
|
-
# [Descripción del primer comando]
|
|
173
|
-
[comando exacto con parámetros]
|
|
174
|
-
|
|
175
|
-
# [Descripción del segundo comando]
|
|
176
|
-
[segundo comando exacto]
|
|
177
|
-
\`\`\`
|
|
178
|
-
|
|
179
|
-
## 🐧 COMANDOS PARA LINUX ARM (después de macOS)
|
|
180
|
-
\`\`\`bash
|
|
181
|
-
# SSH y preparación
|
|
182
|
-
ssh user@raspberry-pi
|
|
183
|
-
git pull origin master && bun install
|
|
184
|
-
|
|
185
|
-
# [Descripción del build ARM]
|
|
186
|
-
[comandos específicos de ARM]
|
|
187
|
-
\`\`\`
|
|
188
|
-
|
|
189
|
-
## ✅ VERIFICACIONES AUTOMÁTICAS
|
|
190
|
-
- [Lista de verificaciones que se ejecutarán]
|
|
191
|
-
\`\`\`
|
|
192
|
-
|
|
193
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Genera prompt para releases automáticas
|
|
198
|
-
*/
|
|
199
|
-
export function createReleasePrompt(config: GeminiPromptConfig): string {
|
|
200
|
-
const { data, specificContext } = config;
|
|
201
|
-
|
|
202
|
-
return `${STANDARD_PROMPT_PREFIX}
|
|
203
|
-
|
|
204
|
-
# ANÁLISIS DE RELEASE
|
|
205
|
-
|
|
206
|
-
## Información de la Release
|
|
207
|
-
${JSON.stringify(data, null, 2)}
|
|
208
|
-
|
|
209
|
-
## Contexto Específico
|
|
210
|
-
${specificContext || 'Release automática'}
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## FORMATO DE RESPUESTA REQUERIDO
|
|
215
|
-
|
|
216
|
-
\`\`\`markdown
|
|
217
|
-
# 📦 ANÁLISIS DE RELEASE
|
|
218
|
-
|
|
219
|
-
## 🎯 RESUMEN
|
|
220
|
-
[Descripción de los cambios principales incluidos en esta release]
|
|
221
|
-
|
|
222
|
-
## 📋 CHANGELOG GENERADO
|
|
223
|
-
|
|
224
|
-
### ✨ Features
|
|
225
|
-
[Lista de nuevas funcionalidades]
|
|
226
|
-
|
|
227
|
-
### 🐛 Fixes
|
|
228
|
-
[Lista de correcciones de bugs]
|
|
229
|
-
|
|
230
|
-
### 🚀 Improvements
|
|
231
|
-
[Lista de mejoras]
|
|
232
|
-
|
|
233
|
-
### 🔧 Technical
|
|
234
|
-
[Cambios técnicos internos]
|
|
235
|
-
|
|
236
|
-
## 🏷️ INFORMACIÓN DE VERSIÓN
|
|
237
|
-
- **Versión**: [versión calculada]
|
|
238
|
-
- **Prefijo**: [alpha/beta/rc/stable]
|
|
239
|
-
- **Canal OTA**: [dev/beta/stable]
|
|
240
|
-
- **Tipo de cambio**: [major/minor/patch]
|
|
241
|
-
|
|
242
|
-
## 📝 NOTAS DE RELEASE
|
|
243
|
-
[Texto descriptivo para usuarios finales]
|
|
244
|
-
\`\`\`
|
|
245
|
-
|
|
246
|
-
${STANDARD_PROMPT_SUFFIX}`;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Parser genérico para respuestas de Gemini
|
|
251
|
-
*/
|
|
252
|
-
export class GeminiResponseParser {
|
|
253
|
-
/**
|
|
254
|
-
* Extrae múltiples propuestas de commit del formato estándar
|
|
255
|
-
*/
|
|
256
|
-
static parseCommitProposals(response: string): Array<{
|
|
257
|
-
title: string;
|
|
258
|
-
description: string;
|
|
259
|
-
technical: string;
|
|
260
|
-
changelog: string;
|
|
261
|
-
}> {
|
|
262
|
-
const proposals: Array<{
|
|
263
|
-
title: string;
|
|
264
|
-
description: string;
|
|
265
|
-
technical: string;
|
|
266
|
-
changelog: string;
|
|
267
|
-
}> = [];
|
|
268
|
-
|
|
269
|
-
// Buscar todas las propuestas con el formato: ### **Propuesta de Commit #N**
|
|
270
|
-
const proposalPattern = /###\s*\*\*Propuesta de Commit #\d+\*\*/g;
|
|
271
|
-
const proposalMatches = Array.from(response.matchAll(proposalPattern));
|
|
272
|
-
|
|
273
|
-
if (proposalMatches.length === 0) {
|
|
274
|
-
// Formato de un solo commit sin numeración
|
|
275
|
-
const codeBlock = this.extractCodeBlock(response);
|
|
276
|
-
if (codeBlock) {
|
|
277
|
-
const parsed = this.parseCommitContent(codeBlock);
|
|
278
|
-
if (parsed) proposals.push(parsed);
|
|
279
|
-
}
|
|
280
|
-
} else {
|
|
281
|
-
// Múltiples propuestas numeradas
|
|
282
|
-
for (let i = 0; i < proposalMatches.length; i++) {
|
|
283
|
-
const startIndex = proposalMatches[i].index!;
|
|
284
|
-
const endIndex = proposalMatches[i + 1]?.index || response.length;
|
|
285
|
-
const proposalSection = response.substring(startIndex, endIndex);
|
|
286
|
-
|
|
287
|
-
const codeBlock = this.extractCodeBlock(proposalSection);
|
|
288
|
-
if (codeBlock) {
|
|
289
|
-
const parsed = this.parseCommitContent(codeBlock);
|
|
290
|
-
if (parsed) proposals.push(parsed);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return proposals;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Extrae bloque de código markdown
|
|
300
|
-
*/
|
|
301
|
-
private static extractCodeBlock(text: string): string | null {
|
|
302
|
-
const patterns = [
|
|
303
|
-
/```markdown\s*\n([\s\S]*?)\n```/, // ```markdown
|
|
304
|
-
/```\s*\n([\s\S]*?)\n```/, // ``` genérico
|
|
305
|
-
/```([\s\S]*?)```/ // sin saltos
|
|
306
|
-
];
|
|
307
|
-
|
|
308
|
-
for (const pattern of patterns) {
|
|
309
|
-
const match = text.match(pattern);
|
|
310
|
-
if (match) return match[1].trim();
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
return null;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Parsea el contenido de un commit individual
|
|
318
|
-
*/
|
|
319
|
-
private static parseCommitContent(content: string): {
|
|
320
|
-
title: string;
|
|
321
|
-
description: string;
|
|
322
|
-
technical: string;
|
|
323
|
-
changelog: string;
|
|
324
|
-
} | null {
|
|
325
|
-
const lines = content.split('\n');
|
|
326
|
-
|
|
327
|
-
// Título (primera línea no vacía)
|
|
328
|
-
let title = '';
|
|
329
|
-
let titleIndex = 0;
|
|
330
|
-
for (let i = 0; i < lines.length; i++) {
|
|
331
|
-
if (lines[i].trim()) {
|
|
332
|
-
title = lines[i].trim();
|
|
333
|
-
titleIndex = i;
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (!title) return null;
|
|
339
|
-
|
|
340
|
-
// Extraer secciones
|
|
341
|
-
let description = '';
|
|
342
|
-
let technical = '';
|
|
343
|
-
let changelog = '';
|
|
344
|
-
let currentSection = 'description';
|
|
345
|
-
|
|
346
|
-
for (let i = titleIndex + 1; i < lines.length; i++) {
|
|
347
|
-
const line = lines[i];
|
|
348
|
-
|
|
349
|
-
if (line.includes('<technical>')) {
|
|
350
|
-
currentSection = 'technical';
|
|
351
|
-
continue;
|
|
352
|
-
} else if (line.includes('</technical>')) {
|
|
353
|
-
currentSection = 'none';
|
|
354
|
-
continue;
|
|
355
|
-
} else if (line.includes('<changelog>')) {
|
|
356
|
-
currentSection = 'changelog';
|
|
357
|
-
continue;
|
|
358
|
-
} else if (line.includes('</changelog>')) {
|
|
359
|
-
currentSection = 'none';
|
|
360
|
-
continue;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (currentSection === 'description' && line.trim()) {
|
|
364
|
-
description += line + '\n';
|
|
365
|
-
} else if (currentSection === 'technical') {
|
|
366
|
-
technical += line + '\n';
|
|
367
|
-
} else if (currentSection === 'changelog') {
|
|
368
|
-
changelog += line + '\n';
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
return {
|
|
373
|
-
title,
|
|
374
|
-
description: description.trim(),
|
|
375
|
-
technical: technical.trim(),
|
|
376
|
-
changelog: changelog.trim()
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Parsea respuesta de workflow en formato estándar
|
|
382
|
-
*/
|
|
383
|
-
static parseWorkflowResponse(response: string): {
|
|
384
|
-
analysis: string;
|
|
385
|
-
impact: string;
|
|
386
|
-
recommendation: string;
|
|
387
|
-
macosCommands: string[];
|
|
388
|
-
linuxCommands: string[];
|
|
389
|
-
verifications: string[];
|
|
390
|
-
} {
|
|
391
|
-
const analysisMatch = response.match(/🎯\s*\*\*ANÁLISIS\*\*:\s*(.+)/);
|
|
392
|
-
const impactMatch = response.match(/📊\s*\*\*IMPACTO\*\*:\s*(.+)/);
|
|
393
|
-
const recommendationMatch = response.match(/🚀\s*\*\*RECOMENDACIÓN\*\*:\s*(.+)/);
|
|
394
|
-
|
|
395
|
-
// Extraer comandos macOS
|
|
396
|
-
const macosSection = response.match(/##\s*🖥️\s*COMANDOS PARA macOS\s*```bash\s*([\s\S]*?)\s*```/);
|
|
397
|
-
const macosCommands = macosSection ? macosSection[1].split('\n').filter(line =>
|
|
398
|
-
line.trim() && !line.startsWith('#')
|
|
399
|
-
) : [];
|
|
400
|
-
|
|
401
|
-
// Extraer comandos Linux ARM
|
|
402
|
-
const linuxSection = response.match(/##\s*🐧\s*COMANDOS PARA LINUX ARM[\s\S]*?```bash\s*([\s\S]*?)\s*```/);
|
|
403
|
-
const linuxCommands = linuxSection ? linuxSection[1].split('\n').filter(line =>
|
|
404
|
-
line.trim() && !line.startsWith('#')
|
|
405
|
-
) : [];
|
|
406
|
-
|
|
407
|
-
// Extraer verificaciones
|
|
408
|
-
const verificationsSection = response.match(/##\s*✅\s*VERIFICACIONES AUTOMÁTICAS\s*([\s\S]*?)```/);
|
|
409
|
-
const verifications = verificationsSection ? verificationsSection[1].split('\n').filter(line =>
|
|
410
|
-
line.trim().startsWith('-')
|
|
411
|
-
).map(line => line.replace(/^-\s*/, '')) : [];
|
|
412
|
-
|
|
413
|
-
return {
|
|
414
|
-
analysis: analysisMatch?.[1] || 'No disponible',
|
|
415
|
-
impact: impactMatch?.[1] || 'No disponible',
|
|
416
|
-
recommendation: recommendationMatch?.[1] || 'No disponible',
|
|
417
|
-
macosCommands,
|
|
418
|
-
linuxCommands,
|
|
419
|
-
verifications
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
}
|