griddo-sdk 2.0.13 → 2.1.0-rc.0
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/CHANGELOG.md +149 -0
- package/CLAUDE.md +153 -0
- package/DEVELOPER_GUIDE.md +85 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/commands/alerts.d.ts +3 -0
- package/dist/cli/commands/alerts.d.ts.map +1 -0
- package/dist/cli/commands/api.d.ts +3 -0
- package/dist/cli/commands/api.d.ts.map +1 -0
- package/dist/cli/commands/data.d.ts +3 -0
- package/dist/cli/commands/data.d.ts.map +1 -0
- package/dist/cli/commands/images.d.ts +3 -0
- package/dist/cli/commands/images.d.ts.map +1 -0
- package/dist/cli/commands/languages.d.ts +3 -0
- package/dist/cli/commands/languages.d.ts.map +1 -0
- package/dist/cli/commands/live-status.d.ts +3 -0
- package/dist/cli/commands/live-status.d.ts.map +1 -0
- package/dist/cli/commands/pages.d.ts +3 -0
- package/dist/cli/commands/pages.d.ts.map +1 -0
- package/dist/cli/commands/site.d.ts +3 -0
- package/dist/cli/commands/site.d.ts.map +1 -0
- package/dist/cli/input.d.ts +3 -0
- package/dist/cli/input.d.ts.map +1 -0
- package/dist/cli/output.d.ts +5 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/program.d.ts +3 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/sdk-factory.d.ts +6 -0
- package/dist/cli/sdk-factory.d.ts.map +1 -0
- package/dist/cli.js +155 -0
- package/dist/config/Environment.d.ts.map +1 -1
- package/dist/config/version.d.ts +1 -1
- package/dist/config/version.d.ts.map +1 -1
- package/dist/exception/SiteException.d.ts +63 -0
- package/dist/exception/SiteException.d.ts.map +1 -0
- package/dist/facades/ImageFacade.d.ts +3 -3
- package/dist/facades/PageFacade.d.ts +49 -3
- package/dist/facades/PageFacade.d.ts.map +1 -1
- package/dist/facades/SiteFacade.d.ts +62 -0
- package/dist/facades/SiteFacade.d.ts.map +1 -0
- package/dist/factories/ServiceFactory.d.ts +13 -0
- package/dist/factories/ServiceFactory.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -40
- package/dist/interfaces/ImageManager.d.ts +5 -6
- package/dist/interfaces/ImageManager.d.ts.map +1 -1
- package/dist/interfaces/SiteManager.d.ts +12 -0
- package/dist/interfaces/SiteManager.d.ts.map +1 -0
- package/dist/sdk.d.ts +209 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/services/SiteService.d.ts +63 -0
- package/dist/services/SiteService.d.ts.map +1 -0
- package/dist/services/index.d.ts +13 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/logging/LoggerFactory.d.ts +19 -0
- package/dist/services/logging/LoggerFactory.d.ts.map +1 -0
- package/dist/services/logging/PinoLogger.d.ts +20 -0
- package/dist/services/logging/PinoLogger.d.ts.map +1 -0
- package/dist/services/logging/StdoutLogger.d.ts +3 -0
- package/dist/services/logging/StdoutLogger.d.ts.map +1 -1
- package/dist/services/logging/index.d.ts +5 -0
- package/dist/services/logging/index.d.ts.map +1 -0
- package/docs-sdk/docusaurus.config.ts +160 -0
- package/docs-sdk/package.json +51 -0
- package/docs-sdk/sidebars-api.ts +85 -0
- package/docs-sdk/sidebars.ts +59 -0
- package/docs-sdk/static/.nojekyll +0 -0
- package/docs-sdk/static/img/docusaurus-social-card.jpg +0 -0
- package/docs-sdk/static/img/docusaurus.png +0 -0
- package/docs-sdk/static/img/favicon.ico +0 -0
- package/docs-sdk/static/img/logo.svg +1 -0
- package/docs-sdk/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/docs-sdk/static/img/undraw_docusaurus_react.svg +170 -0
- package/docs-sdk/static/img/undraw_docusaurus_tree.svg +40 -0
- package/package.json +88 -80
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Logging System
|
|
13
|
+
- **Sistema de logging flexible basado en el patrón Adapter** para permitir múltiples implementaciones de logger
|
|
14
|
+
- **PinoLogger**: Nueva implementación por defecto usando Pino (logger JSON de alto rendimiento, ~5x más rápido que console)
|
|
15
|
+
- **LoggerFactory**: Factory para crear instancias de Logger según configuración
|
|
16
|
+
- **Tipos LoggerConfig y LoggerType**: Configuración avanzada del sistema de logging
|
|
17
|
+
- **Inyección de loggers personalizados**: Posibilidad de inyectar cualquier logger que cumpla la interfaz `Logger`
|
|
18
|
+
- **Tipos exportados**: `Logger`, `LoggerConfig`, `LoggerType` disponibles para consumidores del SDK
|
|
19
|
+
- Niveles de soporte: `info`, `error`, `debug` con opción `verbose` para activar logs detallados
|
|
20
|
+
- Pretty print automático en desarrollo usando `pino-pretty`
|
|
21
|
+
- **Test Coverage**: 100% coverage para PinoLogger y LoggerFactory (19 tests nuevos)
|
|
22
|
+
- **Test Coverage**: 144 tests pasan exitosamente (sin breaking changes)
|
|
23
|
+
|
|
24
|
+
#### Site Management
|
|
25
|
+
- **`getSocials` method** in `SiteService` and `SiteFacade` for retrieving social network URLs
|
|
26
|
+
- New TypeScript types added to `src/sdk.ts`:
|
|
27
|
+
- `SocialName` type: Union type for supported social networks (instagram, linkedIn, facebook, twitter, youTube, flickr, tiktok, snapchat, newsletter)
|
|
28
|
+
- `SocialsResponse` type: Record mapping each social network name to its corresponding URL
|
|
29
|
+
- API endpoint: `GET /site/{id}/socials`
|
|
30
|
+
- Implemented in `SiteService.getSocials(id: string | number)`
|
|
31
|
+
- Facade available via `SiteFacade.getSocials(id: string | number)`
|
|
32
|
+
- Spanish log messages for success and error cases
|
|
33
|
+
- **Test Coverage:** 100% coverage for both SiteService and SiteFacade
|
|
34
|
+
- **Example:** `examples/site/get_socials.ts` demonstrates usage
|
|
35
|
+
- **Types exported:** `SocialName` and `SocialsResponse` available for consumer use
|
|
36
|
+
|
|
37
|
+
- **`getSitemap` method** in `SiteService` and `SiteFacade` for retrieving sitemaps
|
|
38
|
+
- New TypeScript types added to `src/sdk.ts`:
|
|
39
|
+
- `SitemapUrl` interface: Contains `path`, `domain`, and `home` properties
|
|
40
|
+
- `SitemapItem` interface: Contains `loc`, `lastmod`, and `priority` properties
|
|
41
|
+
- `SitemapItems` type: Record mapping URLs to sitemap items
|
|
42
|
+
- `SitemapResponse` interface: Complete sitemap response structure with URLs and items
|
|
43
|
+
- API endpoint: `GET /site/{id}/sitemap`
|
|
44
|
+
- Implemented in `SiteService.getSitemap(id: string | number)`
|
|
45
|
+
- Facade available via `SiteFacade.getSitemap(id: string | number)`
|
|
46
|
+
- Spanish log messages for success and error cases
|
|
47
|
+
- **Test Coverage:**
|
|
48
|
+
- SiteService: 100% coverage (5 tests passing)
|
|
49
|
+
- SiteFacade: 82.05% coverage (7 tests passing)
|
|
50
|
+
- Tests include success scenarios and error handling
|
|
51
|
+
- **Example:** `examples/site/get_sitemap.ts` demonstrates usage
|
|
52
|
+
|
|
53
|
+
#### Build Management
|
|
54
|
+
- **`buildStart` method** in `SiteService` and `SiteFacade` for initiating build processes
|
|
55
|
+
- API endpoint for build initialization
|
|
56
|
+
- Test coverage and mock updates included
|
|
57
|
+
|
|
58
|
+
- **`buildEnd` method** in `SiteService` and `SiteFacade` for finalizing builds
|
|
59
|
+
- Complete build lifecycle management
|
|
60
|
+
- Comprehensive test suite and examples
|
|
61
|
+
- Mock updates for testing scenarios
|
|
62
|
+
|
|
63
|
+
#### Error Handling
|
|
64
|
+
- **`SiteException` class** for site-specific error handling
|
|
65
|
+
- Custom error types extending `BaseException`
|
|
66
|
+
- Structured error codes with severity levels
|
|
67
|
+
- Integration with `ErrorHandlingService`
|
|
68
|
+
|
|
69
|
+
#### Architecture
|
|
70
|
+
- **SiteService integration** into SDK architecture
|
|
71
|
+
- `SiteFacade` added to main SDK entry point
|
|
72
|
+
- Lazy-loading pattern for site management functionality
|
|
73
|
+
- ServiceFactory integration for SiteService instances
|
|
74
|
+
- Dependency injection pattern throughout
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
|
|
78
|
+
#### Logging
|
|
79
|
+
- **StdoutLogger marcado como @deprecated** en favor de PinoLogger
|
|
80
|
+
- Se mantiene por backwards compatibility pero se recomienda usar PinoLogger
|
|
81
|
+
- Aviso en JSDoc sobre preferir PinoLogger o inyectar logger personalizado
|
|
82
|
+
|
|
83
|
+
#### Configuration
|
|
84
|
+
- **Client header defaults** refactor in PageFacade
|
|
85
|
+
- Enhanced page update methods with improved header management
|
|
86
|
+
- Better separation of concerns between services
|
|
87
|
+
|
|
88
|
+
#### Documentation
|
|
89
|
+
- **Enhanced documentation** para sistema de logging en docs_dev y Docusaurus
|
|
90
|
+
- **Updated Configuración.md** con sección de Sistema de Logging integrada
|
|
91
|
+
- **Sistema de Logging.md** creado en docs_dev con ejemplos de uso
|
|
92
|
+
- **Enhanced documentation** for image management methods
|
|
93
|
+
- **Improved documentation** for page processing methods across services and facades
|
|
94
|
+
- Updated JSDoc comments for better API clarity
|
|
95
|
+
|
|
96
|
+
### Technical Details
|
|
97
|
+
|
|
98
|
+
#### Files Modified for getSocials Feature:
|
|
99
|
+
1. **src/sdk.ts** - Type definitions (SocialName, SocialsResponse)
|
|
100
|
+
2. **src/index.ts** - Exported new types
|
|
101
|
+
3. **src/interfaces/SiteManager.ts** - Method signature: `getSocials(id: string | number): Promise<SocialsResponse>`
|
|
102
|
+
4. **src/services/SiteService.ts** - GET endpoint implementation: `/site/{id}/socials`
|
|
103
|
+
5. **src/facades/SiteFacade.ts** - Facade with Spanish logging
|
|
104
|
+
6. **__tests__/services/SiteService.test.ts** - Test suite
|
|
105
|
+
7. **__tests__/facades/SiteFacade.test.ts** - Success and error tests
|
|
106
|
+
8. **__tests__/mocks/site.ts** - Socials response mock data
|
|
107
|
+
9. **examples/site/get_socials.ts** - Usage example
|
|
108
|
+
|
|
109
|
+
#### Files Modified for getSitemap Feature:
|
|
110
|
+
1. **src/sdk.ts** - Type definitions (SitemapUrl, SitemapItem, SitemapItems, SitemapResponse)
|
|
111
|
+
2. **src/index.ts** - Exported new types
|
|
112
|
+
3. **src/interfaces/SiteManager.ts** - Method signature: `getSitemap(id: string | number): Promise<SitemapResponse>`
|
|
113
|
+
4. **src/services/SiteService.ts** - GET endpoint implementation: `/site/{id}/sitemap`
|
|
114
|
+
5. **src/facades/SiteFacade.ts** - Facade with Spanish logging
|
|
115
|
+
6. **__tests__/services/SiteService.test.ts** - Test suite
|
|
116
|
+
7. **__tests__/facades/SiteFacade.test.ts** - Success and error tests
|
|
117
|
+
8. **__tests__/mocks/site.ts** - Sitemap response mock data
|
|
118
|
+
9. **examples/site/get_sitemap.ts** - Usage example
|
|
119
|
+
|
|
120
|
+
## [2.0.8] - 2025-01-XX
|
|
121
|
+
|
|
122
|
+
### Changed
|
|
123
|
+
- Made `clientName` and `clientVersion` optional in SDK configuration
|
|
124
|
+
|
|
125
|
+
## [2.0.7] - 2025-01-XX
|
|
126
|
+
|
|
127
|
+
### Changed
|
|
128
|
+
- Made `clientName` and `clientVersion` optional in SDK configuration
|
|
129
|
+
|
|
130
|
+
## [2.0.6] - 2025-01-XX
|
|
131
|
+
|
|
132
|
+
### Changed
|
|
133
|
+
- Made `clientName` and `clientVersion` optional in SDK configuration
|
|
134
|
+
|
|
135
|
+
## [2.0.4] - 2025-01-XX
|
|
136
|
+
|
|
137
|
+
### Changed
|
|
138
|
+
- Initial release candidate version
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Version Classification
|
|
143
|
+
|
|
144
|
+
- **Added**: New features
|
|
145
|
+
- **Changed**: Changes in existing functionality
|
|
146
|
+
- **Deprecated**: Soon-to-be removed features
|
|
147
|
+
- **Removed**: Removed features
|
|
148
|
+
- **Fixed**: Bug fixes
|
|
149
|
+
- **Security**: Security vulnerability fixes
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Griddo SDK is a TypeScript library for integrating with the Griddo API. It provides a modular architecture using facades, services, and factories to interact with pages, alerts, languages, images, structured data, and site management.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
### Build
|
|
12
|
+
```bash
|
|
13
|
+
npm run build # Full build (esbuild + types + aliases)
|
|
14
|
+
npm run build:tsc # Build with esbuild and TypeScript declarations
|
|
15
|
+
npm run build:doc # Generate TypeDoc documentation
|
|
16
|
+
npm run build:doc:md # Generate documentation as markdown
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Testing
|
|
20
|
+
```bash
|
|
21
|
+
npm test # Run all tests with vitest
|
|
22
|
+
npm run test:ui # Run tests with UI
|
|
23
|
+
npm run test:coverage # Run tests with coverage report
|
|
24
|
+
npm run test:sync # Run tests synchronously (no file parallelism)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Development
|
|
28
|
+
```bash
|
|
29
|
+
npm run lint # Lint source files
|
|
30
|
+
npm run lint:fix # Fix linting issues automatically
|
|
31
|
+
npm run prettier # Format code with Prettier
|
|
32
|
+
npm run dev:connection # Compile example connection file
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Running Examples
|
|
36
|
+
```bash
|
|
37
|
+
npm run run:example site/build_end # Run a specific example (use tsx under the hood)
|
|
38
|
+
# Usage: npm run run:example <filename> [testName]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Release
|
|
42
|
+
```bash
|
|
43
|
+
npm run release # Create a new release using release-it
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Architecture
|
|
47
|
+
|
|
48
|
+
### Layer Structure
|
|
49
|
+
|
|
50
|
+
The SDK follows a layered architecture with clear separation of concerns:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
SDK (entry point)
|
|
54
|
+
↓
|
|
55
|
+
Facades (simplified user interface)
|
|
56
|
+
↓
|
|
57
|
+
Services (business logic)
|
|
58
|
+
↓
|
|
59
|
+
ApiService (HTTP communication)
|
|
60
|
+
↓
|
|
61
|
+
HttpClient (fetch/node-fetch/undici)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Key Patterns
|
|
65
|
+
|
|
66
|
+
1. **Factory Pattern** (`ServiceFactory`, `HttpClientFactory`): Centralizes instance creation with singleton services
|
|
67
|
+
2. **Facade Pattern** (`PageFacade`, `AlertFacade`, etc.): Simplifies service interfaces
|
|
68
|
+
3. **Dependency Injection**: All services receive dependencies via constructor
|
|
69
|
+
4. **Decorator Pattern**: HttpClient decorators add timeout, retry, logging, error handling
|
|
70
|
+
|
|
71
|
+
### Core Components
|
|
72
|
+
|
|
73
|
+
- **SDK** (`src/index.ts`): Main entry point, lazy-loads facades on first access
|
|
74
|
+
- **ServiceFactory** (`src/factories/ServiceFactory.ts`): Creates and manages service instances
|
|
75
|
+
- **HttpClientFactory** (`src/factories/HttpClientFactory.ts`): Creates HTTP clients with decorators
|
|
76
|
+
- **Services** (`src/services/`): Business logic layer (ApiService, PageService, etc.)
|
|
77
|
+
- **Facades** (`src/facades/`): User-facing interfaces for services
|
|
78
|
+
- **Exceptions** (`src/exception/`): Custom error classes extending `BaseException`
|
|
79
|
+
|
|
80
|
+
### Path Aliases
|
|
81
|
+
|
|
82
|
+
The project uses path aliases defined in `tsconfig.json`:
|
|
83
|
+
- `@griddo-sdk` → `src/sdk`
|
|
84
|
+
- `@clients/*` → `src/clients/*`
|
|
85
|
+
- `@config/*` → `src/config/*`
|
|
86
|
+
- `@exceptions/*` → `src/exception/*`
|
|
87
|
+
- `@facades/*` → `src/facades/*`
|
|
88
|
+
- `@factories/*` → `src/factories/*`
|
|
89
|
+
- `@interfaces/*` → `src/interfaces/*`
|
|
90
|
+
- `@services/*` → `src/services/*`
|
|
91
|
+
- `@utils/*` → `src/utils/*`
|
|
92
|
+
- `@adapters/*` → `src/adapters/*`
|
|
93
|
+
|
|
94
|
+
## TypeScript Configuration
|
|
95
|
+
|
|
96
|
+
- Target: ES2020
|
|
97
|
+
- Module: ESNext
|
|
98
|
+
- Strict mode enabled
|
|
99
|
+
- Path aliases used for imports (see above)
|
|
100
|
+
|
|
101
|
+
## Error Handling
|
|
102
|
+
|
|
103
|
+
All custom exceptions extend `BaseException`. When adding new exceptions:
|
|
104
|
+
|
|
105
|
+
1. Create in `src/exception/`
|
|
106
|
+
2. Extend `BaseException`
|
|
107
|
+
3. Define error codes with severity levels
|
|
108
|
+
4. Use `ErrorHandlingService` for logging
|
|
109
|
+
|
|
110
|
+
See `docs_dev/errors.md` for the complete error reference.
|
|
111
|
+
|
|
112
|
+
## Testing
|
|
113
|
+
|
|
114
|
+
- Tests located in `__tests__/`
|
|
115
|
+
- Uses vitest with node environment
|
|
116
|
+
- Coverage excludes: interfaces, types, test files, examples
|
|
117
|
+
- Run specific test file: `vitest path/to/test.test.ts`
|
|
118
|
+
|
|
119
|
+
## Concurrency
|
|
120
|
+
|
|
121
|
+
The SDK uses `ConcurrencyLimiter` interface (implemented by `PLimitConcurrencyLimiter`) for controlling concurrent API requests. Default concurrency is 10, configurable via `ApiEnvironment.concurrency`.
|
|
122
|
+
|
|
123
|
+
## HTTP Client Configuration
|
|
124
|
+
|
|
125
|
+
Three HTTP clients available via `HttpClients` enum:
|
|
126
|
+
- `FETCH` (default): Native fetch
|
|
127
|
+
- `NODE_FETCH`: node-fetch package
|
|
128
|
+
- `UNDICI`: Undici package
|
|
129
|
+
|
|
130
|
+
Clients can be decorated with:
|
|
131
|
+
- Timeout (`timeoutMs`)
|
|
132
|
+
- Retry (`retries`, `retryDelay`)
|
|
133
|
+
- HTTP logging (`httpLog`)
|
|
134
|
+
- Error handling
|
|
135
|
+
|
|
136
|
+
## Documentation Files
|
|
137
|
+
|
|
138
|
+
- `docs_dev/README.md`: Main development documentation
|
|
139
|
+
- `docs_dev/design_patterns.md`: Applied design patterns
|
|
140
|
+
- `docs_dev/errors.md`: Error handling reference
|
|
141
|
+
- `docs_dev/guia_estilo_typescript.md`: TypeScript style guide
|
|
142
|
+
- `docs_dev/maintenance_doc.md`: Maintenance guide
|
|
143
|
+
- `RELEASE_MANAGEMENT.md`: Release process using release-it
|
|
144
|
+
|
|
145
|
+
## When Working on This Codebase
|
|
146
|
+
|
|
147
|
+
1. **Use path aliases** instead of relative imports
|
|
148
|
+
2. **Follow the facade pattern**: Users interact with facades, not services directly
|
|
149
|
+
3. **Add exceptions** to `src/exception/` for new error scenarios
|
|
150
|
+
4. **Create tests** in `__tests__/` mirroring the `src/` structure
|
|
151
|
+
5. **Run linting** before committing: `npm run lint:fix && npm run prettier`
|
|
152
|
+
6. **Build** before committing to ensure types are correct
|
|
153
|
+
- @CLAUDE.md
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Guía del Desarrollador IA - Griddo SDK
|
|
2
|
+
|
|
3
|
+
Esta guía explica cómo orquestar los agentes y comandos para trabajar de forma autónoma en el SDK de Griddo. Sigue estos
|
|
4
|
+
flujos para garantizar la calidad y consistencia del proyecto.
|
|
5
|
+
|
|
6
|
+
## Roles y Agentes
|
|
7
|
+
|
|
8
|
+
- **`planning-agent`**: Arquitecto. Crea planes en `.claude/plans/`.
|
|
9
|
+
- **`backend-developer`**: Programador. Implementa lógica y tipos.
|
|
10
|
+
- **`testing-agent`**: Especialista en Vitest. Crea tests TDD (AAA).
|
|
11
|
+
- **`code-reviewer`**: Revisor. Valida calidad y seguridad.
|
|
12
|
+
- **`debugger-agent`**: Investigador. Encuentra causas raíz de fallos.
|
|
13
|
+
- **`technical-writer`**: Documentador. JSDoc, README y guías.
|
|
14
|
+
- **`release-agent`**: Gestor de versiones. CHANGELOG y SemVer.
|
|
15
|
+
|
|
16
|
+
## Flujos de Trabajo Principales
|
|
17
|
+
|
|
18
|
+
### 1. Implementar una Nueva Funcionalidad (Feature)
|
|
19
|
+
|
|
20
|
+
Usa este flujo para añadir nuevos endpoints, servicios o fachadas.
|
|
21
|
+
|
|
22
|
+
1. `plan-manage start {feature-name}`: Inicializa el plan.
|
|
23
|
+
2. **ESPERAR APROBACIÓN**: El usuario debe validar el plan generado antes de continuar.
|
|
24
|
+
3. `new-feature {descripción}`: Sigue el ciclo TDD completo tras la aprobación.
|
|
25
|
+
4. El comando ejecutará automáticamente:
|
|
26
|
+
- `testing-agent` (Fase Roja).
|
|
27
|
+
- `backend-developer` (Fase Verde).
|
|
28
|
+
- `pre-flight` (Gatekeeper).
|
|
29
|
+
- `release-agent` (CHANGELOG).
|
|
30
|
+
|
|
31
|
+
### 2. Corregir un Error (Bug Fix)
|
|
32
|
+
|
|
33
|
+
Usa este flujo cuando algo no funciona como se espera.
|
|
34
|
+
|
|
35
|
+
1. `bug-fix {descripción}`: Inicia la investigación.
|
|
36
|
+
2. El comando orquestará:
|
|
37
|
+
- `debugger-agent` (Análisis).
|
|
38
|
+
- `testing-agent` (Reproducción).
|
|
39
|
+
- `backend-developer` (Corrección).
|
|
40
|
+
- `pre-flight` (Validación).
|
|
41
|
+
|
|
42
|
+
### 3. Refactorizar Código
|
|
43
|
+
|
|
44
|
+
Usa este flujo para mejorar el código existente sin cambiar su funcionalidad.
|
|
45
|
+
|
|
46
|
+
1. `refactor {objetivo}`: Analiza el impacto.
|
|
47
|
+
2. Sigue el flujo de validación continua con los tests existentes.
|
|
48
|
+
3. Ejecuta `pre-flight` al finalizar para asegurar la integridad.
|
|
49
|
+
|
|
50
|
+
## Comandos Especiales
|
|
51
|
+
|
|
52
|
+
### `pre-flight` (El Gatekeeper)
|
|
53
|
+
|
|
54
|
+
**OBLIGATORIO** antes de finalizar cualquier tarea.
|
|
55
|
+
|
|
56
|
+
- Ejecuta el build de producción.
|
|
57
|
+
- Analiza Breaking Changes.
|
|
58
|
+
- Verifica exportaciones globales.
|
|
59
|
+
|
|
60
|
+
### `plan-manage` (Persistencia)
|
|
61
|
+
|
|
62
|
+
- `start`: Nueva tarea (crea el plan en la raíz).
|
|
63
|
+
- `resume`: Carga contexto de una sesión previa (mueve el plan a `active/` tras aprobación).
|
|
64
|
+
- `status`: Muestra progreso y bloqueos.
|
|
65
|
+
- `finish`: Finaliza la tarea y mueve los archivos a `completed/`.
|
|
66
|
+
|
|
67
|
+
## Reglas de Oro para la IA
|
|
68
|
+
|
|
69
|
+
1. **Auto-Corrección (Self-Healing)**: Si un test falla o el revisor encuentra un problema, corrígelo automáticamente
|
|
70
|
+
usando el `backend-developer` antes de informar al usuario.
|
|
71
|
+
2. **Path Aliases**: Usa siempre `@services`, `@facades`, etc. Nunca imports relativos.
|
|
72
|
+
3. **TDD**: Nunca escribas código de producción sin un test que valide su comportamiento (o falle antes).
|
|
73
|
+
4. **Git**: Realiza commits granulares y haz `push` a la rama correspondiente. Sugiere siempre un Pull Request.
|
|
74
|
+
5. **CHANGELOG**: El usuario debe saber qué ha cambiado a nivel de negocio. Usa el `release-agent`.
|
|
75
|
+
|
|
76
|
+
## Estructura de Archivos del Sistema IA
|
|
77
|
+
|
|
78
|
+
- `.claude/agents/`: Definición de roles.
|
|
79
|
+
- `.claude/commands/`: Guías de ejecución de tareas.
|
|
80
|
+
- `.claude/plans/`: Planes detallados por funcionalidad.
|
|
81
|
+
- `active/`: Planes aprobados y en desarrollo.
|
|
82
|
+
- `completed/`: Planes finalizados y archivados.
|
|
83
|
+
- `.claude/sessions/`: Contexto persistente de cada tarea.
|
|
84
|
+
- `active/`: Sesiones en curso.
|
|
85
|
+
- `completed/`: Historial de sesiones finalizadas.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAwD5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkCzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAiH1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA8I5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/languages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkD/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/live-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAsDhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAgH3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/site.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA8F1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/cli/input.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAYnD;AAED,wBAAgB,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAGzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CACzB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvB,IAAI,CAGN;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAgBhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,aAAa,IAAI,OAAO,CAqBvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-factory.d.ts","sourceRoot":"","sources":["../../src/cli/sdk-factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAyB/B,wBAAgB,SAAS,CAAC,UAAU,EAAE;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,GAAG,CAqCN"}
|