sinapse-ai 5.0.8 → 6.0.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/.claude/CLAUDE.md +1 -1
- package/.claude/rules/agent-authority.md +10 -10
- package/.claude/rules/agent-memory-imports.md +4 -4
- package/.claude/rules/coderabbit-integration.md +4 -4
- package/.claude/rules/ids-principles.md +5 -5
- package/.claude/rules/story-lifecycle.md +15 -15
- package/.claude/rules/workflow-execution.md +11 -11
- package/.sinapse-ai/constitution.md +3 -3
- package/.sinapse-ai/core/code-intel/helpers/dev-helper.js +1 -1
- package/.sinapse-ai/core/code-intel/helpers/qa-helper.js +1 -1
- package/.sinapse-ai/core/code-intel/helpers/story-helper.js +7 -7
- package/.sinapse-ai/core/config/config-loader.js +1 -1
- package/.sinapse-ai/core/docs/session-update-pattern.md +1 -1
- package/.sinapse-ai/core/ids/framework-governor.js +4 -4
- package/.sinapse-ai/core/ids/index.js +1 -1
- package/.sinapse-ai/core/memory/gotchas-memory.js +1 -1
- package/.sinapse-ai/core/orchestration/agent-invoker.js +1 -1
- package/.sinapse-ai/core/orchestration/bob-surface-criteria.yaml +2 -2
- package/.sinapse-ai/core/orchestration/executor-assignment.js +1 -1
- package/.sinapse-ai/core/orchestration/executors/epic-6-executor.js +1 -1
- package/.sinapse-ai/core/orchestration/executors/epic-executor.js +1 -1
- package/.sinapse-ai/core/orchestration/greenfield-handler.js +4 -4
- package/.sinapse-ai/core/orchestration/master-orchestrator.js +1 -1
- package/.sinapse-ai/core/orchestration/skill-dispatcher.js +3 -3
- package/.sinapse-ai/core/orchestration/workflow-executor.js +1 -1
- package/.sinapse-ai/core/quality-gates/layer2-pr-automation.js +3 -3
- package/.sinapse-ai/core/quality-gates/layer3-human-review.js +1 -1
- package/.sinapse-ai/core/quality-gates/quality-gate-config.yaml +1 -1
- package/.sinapse-ai/core/session/context-loader.js +1 -1
- package/.sinapse-ai/data/agent-config-requirements.yaml +3 -3
- package/.sinapse-ai/data/entity-registry.yaml +2126 -2570
- package/.sinapse-ai/data/registry-update-log.jsonl +316 -0
- package/.sinapse-ai/data/sinapse-kb.md +13 -13
- package/.sinapse-ai/data/tech-presets/csharp.md +2 -2
- package/.sinapse-ai/data/tech-presets/go.md +2 -2
- package/.sinapse-ai/data/tech-presets/java.md +2 -2
- package/.sinapse-ai/data/tech-presets/nextjs-react.md +1 -1
- package/.sinapse-ai/data/tech-presets/php.md +2 -2
- package/.sinapse-ai/data/tech-presets/rust.md +2 -2
- package/.sinapse-ai/data/technical-preferences.md +1 -1
- package/.sinapse-ai/data/workflow-chains.yaml +15 -15
- package/.sinapse-ai/development/README.md +1 -1
- package/.sinapse-ai/development/agent-teams/team-qa-focused.yaml +7 -7
- package/.sinapse-ai/development/agents/analyst.md +6 -6
- package/.sinapse-ai/development/agents/architect.md +4 -4
- package/.sinapse-ai/development/agents/data-engineer.md +2 -2
- package/.sinapse-ai/development/agents/{dev.md → developer.md} +7 -7
- package/.sinapse-ai/development/agents/devops.md +4 -4
- package/.sinapse-ai/development/agents/{po → product-lead}/MEMORY.md +3 -3
- package/.sinapse-ai/development/agents/{po.md → product-lead.md} +25 -25
- package/.sinapse-ai/development/agents/{pm → project-lead}/MEMORY.md +2 -2
- package/.sinapse-ai/development/agents/{pm.md → project-lead.md} +15 -15
- package/.sinapse-ai/development/agents/{qa.md → quality-gate.md} +8 -8
- package/.sinapse-ai/development/agents/{sinapse-master.md → sinapse-orqx.md} +12 -12
- package/.sinapse-ai/development/agents/{sm.md → sprint-lead.md} +18 -18
- package/.sinapse-ai/development/agents/squad-creator.md +4 -4
- package/.sinapse-ai/development/agents/ux-design-expert.md +2 -2
- package/.sinapse-ai/development/checklists/brownfield-compatibility-checklist.md +1 -1
- package/.sinapse-ai/development/checklists/memory-audit-checklist.md +1 -1
- package/.sinapse-ai/development/scripts/agent-config-loader.js +1 -1
- package/.sinapse-ai/development/scripts/apply-inline-greeting-all-agents.js +1 -1
- package/.sinapse-ai/development/scripts/audit-agent-config.js +2 -2
- package/.sinapse-ai/development/scripts/batch-update-agents-session-context.js +1 -1
- package/.sinapse-ai/development/scripts/dev-context-loader.js +1 -1
- package/.sinapse-ai/development/scripts/populate-entity-registry.js +2 -2
- package/.sinapse-ai/development/scripts/test-greeting-system.js +4 -4
- package/.sinapse-ai/development/scripts/unified-activation-pipeline.js +2 -2
- package/.sinapse-ai/development/scripts/verify-workflow-gaps.js +9 -9
- package/.sinapse-ai/development/tasks/analyze-cross-artifact.md +1 -1
- package/.sinapse-ai/development/tasks/analyze-project-structure.md +4 -4
- package/.sinapse-ai/development/tasks/apply-qa-fixes.md +1 -1
- package/.sinapse-ai/development/tasks/architect-analyze-impact.md +1 -1
- package/.sinapse-ai/development/tasks/brownfield-create-epic.md +10 -10
- package/.sinapse-ai/development/tasks/brownfield-create-story.md +1 -1
- package/.sinapse-ai/development/tasks/build-autonomous.md +1 -1
- package/.sinapse-ai/development/tasks/cleanup-utilities.md +6 -6
- package/.sinapse-ai/development/tasks/create-agent.md +1 -1
- package/.sinapse-ai/development/tasks/create-brownfield-story.md +4 -4
- package/.sinapse-ai/development/tasks/create-next-story.md +12 -12
- package/.sinapse-ai/development/tasks/create-service.md +2 -2
- package/.sinapse-ai/development/tasks/create-suite.md +1 -1
- package/.sinapse-ai/development/tasks/dev-backlog-debt.md +3 -3
- package/.sinapse-ai/development/tasks/dev-develop-story.md +5 -5
- package/.sinapse-ai/development/tasks/environment-bootstrap.md +2 -2
- package/.sinapse-ai/development/tasks/execute-checklist.md +1 -1
- package/.sinapse-ai/development/tasks/execute-epic-plan.md +11 -11
- package/.sinapse-ai/development/tasks/extract-patterns.md +2 -2
- package/.sinapse-ai/development/tasks/facilitate-brainstorming-session.md +2 -2
- package/.sinapse-ai/development/tasks/github-devops-github-pr-automation.md +1 -1
- package/.sinapse-ai/development/tasks/github-devops-pre-push-quality-gate.md +1 -1
- package/.sinapse-ai/development/tasks/ids-governor.md +3 -3
- package/.sinapse-ai/development/tasks/next.md +2 -2
- package/.sinapse-ai/development/tasks/orchestrate-resume.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate-status.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate-stop.md +1 -1
- package/.sinapse-ai/development/tasks/orchestrate.md +1 -1
- package/.sinapse-ai/development/tasks/patterns.md +2 -2
- package/.sinapse-ai/development/tasks/plan-create-context.md +2 -2
- package/.sinapse-ai/development/tasks/plan-execute-subtask.md +3 -3
- package/.sinapse-ai/development/tasks/po-close-story.md +3 -3
- package/.sinapse-ai/development/tasks/project-status.md +2 -2
- package/.sinapse-ai/development/tasks/qa-after-creation.md +2 -2
- package/.sinapse-ai/development/tasks/qa-backlog-add-followup.md +3 -3
- package/.sinapse-ai/development/tasks/qa-create-fix-request.md +8 -8
- package/.sinapse-ai/development/tasks/qa-evidence-requirements.md +1 -1
- package/.sinapse-ai/development/tasks/qa-false-positive-detection.md +1 -1
- package/.sinapse-ai/development/tasks/qa-fix-issues.md +10 -10
- package/.sinapse-ai/development/tasks/qa-gate.md +3 -3
- package/.sinapse-ai/development/tasks/qa-review-build.md +3 -3
- package/.sinapse-ai/development/tasks/qa-review-story.md +2 -2
- package/.sinapse-ai/development/tasks/qa-run-tests.md +1 -1
- package/.sinapse-ai/development/tasks/run-workflow-engine.md +1 -1
- package/.sinapse-ai/development/tasks/run-workflow.md +1 -1
- package/.sinapse-ai/development/tasks/security-scan.md +2 -2
- package/.sinapse-ai/development/tasks/setup-llm-routing.md +1 -1
- package/.sinapse-ai/development/tasks/spec-critique.md +4 -4
- package/.sinapse-ai/development/tasks/spec-gather-requirements.md +4 -4
- package/.sinapse-ai/development/tasks/spec-write-spec.md +2 -2
- package/.sinapse-ai/development/tasks/story-checkpoint.md +3 -3
- package/.sinapse-ai/development/tasks/sync-registry-intel.md +1 -1
- package/.sinapse-ai/development/tasks/validate-agents.md +1 -1
- package/.sinapse-ai/development/tasks/validate-next-story.md +10 -10
- package/.sinapse-ai/development/tasks/validate-workflow.md +1 -1
- package/.sinapse-ai/development/tasks/verify-subtask.md +2 -2
- package/.sinapse-ai/development/templates/code-intel-integration-pattern.md +3 -3
- package/.sinapse-ai/development/templates/subagent-step-prompt.md +2 -2
- package/.sinapse-ai/development/workflows/README.md +2 -2
- package/.sinapse-ai/development/workflows/auto-worktree.yaml +5 -5
- package/.sinapse-ai/development/workflows/brownfield-discovery.yaml +11 -11
- package/.sinapse-ai/development/workflows/brownfield-fullstack.yaml +6 -6
- package/.sinapse-ai/development/workflows/brownfield-service.yaml +5 -5
- package/.sinapse-ai/development/workflows/brownfield-ui.yaml +5 -5
- package/.sinapse-ai/development/workflows/development-cycle.yaml +10 -10
- package/.sinapse-ai/development/workflows/epic-orchestration.yaml +6 -6
- package/.sinapse-ai/development/workflows/greenfield-fullstack.yaml +7 -7
- package/.sinapse-ai/development/workflows/greenfield-service.yaml +5 -5
- package/.sinapse-ai/development/workflows/greenfield-ui.yaml +5 -5
- package/.sinapse-ai/development/workflows/qa-loop.yaml +1 -1
- package/.sinapse-ai/development/workflows/spec-pipeline.yaml +2 -2
- package/.sinapse-ai/development/workflows/story-development-cycle.yaml +1 -1
- package/.sinapse-ai/docs/standards/AGENT-PERSONALIZATION-STANDARD-V1.md +2 -2
- package/.sinapse-ai/docs/standards/OPEN-SOURCE-VS-SERVICE-DIFFERENCES.md +1 -1
- package/.sinapse-ai/docs/standards/QUALITY-GATES-SPECIFICATION.md +1 -1
- package/.sinapse-ai/docs/standards/SINAPSE-LIVRO-DE-OURO-V2.1-COMPLETE.md +6 -6
- package/.sinapse-ai/docs/standards/STANDARDS-INDEX.md +2 -2
- package/.sinapse-ai/docs/standards/STORY-TEMPLATE-V2-SPECIFICATION.md +6 -6
- package/.sinapse-ai/infrastructure/scripts/config-loader.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/gotchas-documenter.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/ide-sync/README.md +3 -3
- package/.sinapse-ai/infrastructure/scripts/ide-sync/gemini-commands.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/ide-sync/index.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/ide-sync/redirect-generator.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/migrate-agent.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/performance-tracker.js +2 -2
- package/.sinapse-ai/infrastructure/scripts/qa-report-generator.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/recovery-tracker.js +1 -1
- package/.sinapse-ai/infrastructure/scripts/rollback-manager.js +1 -1
- package/.sinapse-ai/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +1 -1
- package/.sinapse-ai/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +1 -1
- package/.sinapse-ai/infrastructure/templates/sinapse-sync.yaml.template +1 -1
- package/.sinapse-ai/install-manifest.yaml +344 -344
- package/.sinapse-ai/monitor/hooks/lib/enrich.py +1 -1
- package/.sinapse-ai/product/checklists/self-critique-checklist.md +1 -1
- package/.sinapse-ai/product/checklists/story-draft-checklist.md +3 -3
- package/.sinapse-ai/product/templates/command-rationalization-matrix.md +3 -3
- package/.sinapse-ai/product/templates/design-story-tmpl.yaml +4 -4
- package/.sinapse-ai/product/templates/ide-rules/antigravity-rules.md +1 -1
- package/.sinapse-ai/product/templates/ide-rules/claude-rules.md +2 -2
- package/.sinapse-ai/product/templates/ide-rules/codex-rules.md +6 -6
- package/.sinapse-ai/product/templates/ide-rules/cursor-rules.md +1 -1
- package/.sinapse-ai/product/templates/personalized-agent-template.md +1 -1
- package/.sinapse-ai/product/templates/personalized-task-template.md +1 -1
- package/.sinapse-ai/product/templates/personalized-template-file.yaml +1 -1
- package/.sinapse-ai/product/templates/personalized-workflow-template.yaml +3 -3
- package/.sinapse-ai/product/templates/story-tmpl.yaml +8 -8
- package/.sinapse-ai/schemas/README.md +15 -15
- package/.sinapse-ai/scripts/diagnostics/health-dashboard/package-lock.json +2 -2
- package/.sinapse-ai/user-guide.md +4 -4
- package/.sinapse-ai/working-in-the-brownfield.md +3 -3
- package/LICENSE +4 -4
- package/README.en.md +6 -6
- package/README.md +8 -8
- package/bin/cli.js +9 -9
- package/bin/sinapse.js +17 -0
- package/docs/00-shared-activation-pipeline.md +16 -16
- package/docs/FEATURE_PROCESS.md +1 -1
- package/docs/ORQX-PLAN.md +264 -0
- package/docs/core-architecture.md +2 -2
- package/docs/en/sinapse-agent-flows/README.md +2 -2
- package/docs/en/sinapse-agent-flows/dev-system.md +2 -2
- package/docs/en/sinapse-agent-flows/pm-system.md +2 -2
- package/docs/en/sinapse-agent-flows/qa-system.md +2 -2
- package/docs/en/sinapse-agent-flows/{sinapse-master-system.md → sinapse-orqx-system.md} +5 -5
- package/docs/en/sinapse-agent-flows/sm-system.md +2 -2
- package/docs/framework/entity-layer-classification.md +2 -2
- package/docs/framework/source-tree.md +17 -17
- package/docs/getting-started.md +13 -13
- package/docs/guides/IDS-CONCEITOS-EXPLICADOS.md +17 -17
- package/docs/guides/MEMORY-INTEGRATION.md +3 -3
- package/docs/guides/MEMORY-INTELLIGENCE-SYSTEM.md +4 -4
- package/docs/guides/ade-guide.md +25 -25
- package/docs/guides/agent-selection-guide.md +36 -36
- package/docs/guides/agents/ANALYST-SYSTEM.md +5 -5
- package/docs/guides/agents/ARCHITECT-SYSTEM.md +9 -9
- package/docs/guides/agents/DATA-ENGINEER-SYSTEM.md +8 -8
- package/docs/guides/agents/DEV-SYSTEM.md +27 -27
- package/docs/guides/agents/DEVOPS-SYSTEM.md +5 -5
- package/docs/guides/agents/PM-SYSTEM.md +24 -24
- package/docs/guides/agents/QA-SYSTEM.md +24 -24
- package/docs/guides/agents/SINAPSE-MASTER-SYSTEM.md +26 -26
- package/docs/guides/agents/SM-SYSTEM.md +31 -31
- package/docs/guides/agents/SQUAD-CREATOR-SYSTEM.md +2 -2
- package/docs/guides/agents/UX-DESIGN-EXPERT-SYSTEM.md +10 -10
- package/docs/guides/agents/traces/00-shared-activation-pipeline.md +16 -16
- package/docs/guides/agents/traces/00-shared-activation-pipeline.v1-act8.md +16 -16
- package/docs/guides/agents/traces/README.md +20 -20
- package/docs/guides/agents/traces/analyst-execution-trace.md +6 -6
- package/docs/guides/agents/traces/architect-execution-trace.md +3 -3
- package/docs/guides/agents/traces/data-engineer-execution-trace.md +4 -4
- package/docs/guides/agents/traces/dev-execution-trace.md +12 -12
- package/docs/guides/agents/traces/devops-execution-trace.md +6 -6
- package/docs/guides/agents/traces/pm-execution-trace.md +14 -14
- package/docs/guides/agents/traces/po-execution-trace.md +17 -17
- package/docs/guides/agents/traces/qa-execution-trace.md +15 -15
- package/docs/guides/agents/traces/{sinapse-master-execution-trace.md → sinapse-orqx-execution-trace.md} +22 -22
- package/docs/guides/agents/traces/sm-execution-trace.md +15 -15
- package/docs/guides/agents/traces/squad-creation-execution-trace.md +9 -9
- package/docs/guides/agents/traces/ux-design-expert-execution-trace.md +4 -4
- package/docs/guides/api-reference.md +27 -27
- package/docs/guides/coderabbit/README.md +9 -9
- package/docs/guides/contextual-greeting-system-guide.md +5 -5
- package/docs/guides/development-setup.md +1 -1
- package/docs/guides/project-status-feature.md +2 -2
- package/docs/guides/quality-dashboard.md +2 -2
- package/docs/guides/quality-gates.md +6 -6
- package/docs/guides/template-engine-v2.md +2 -2
- package/docs/guides/user-guide.md +13 -13
- package/docs/guides/workflows/AUTO-WORKTREE-WORKFLOW.md +3 -3
- package/docs/guides/workflows/BROWNFIELD-DISCOVERY-WORKFLOW.md +6 -6
- package/docs/guides/workflows/BROWNFIELD-FULLSTACK-WORKFLOW.md +30 -30
- package/docs/guides/workflows/BROWNFIELD-SERVICE-WORKFLOW.md +38 -38
- package/docs/guides/workflows/BROWNFIELD-UI-WORKFLOW.md +25 -25
- package/docs/guides/workflows/GREENFIELD-FULLSTACK-WORKFLOW.md +37 -37
- package/docs/guides/workflows/GREENFIELD-SERVICE-WORKFLOW.md +5 -5
- package/docs/guides/workflows/GREENFIELD-UI-WORKFLOW.md +19 -19
- package/docs/guides/workflows/QA-LOOP-WORKFLOW.md +13 -13
- package/docs/guides/workflows/SINAPSE-COMPLETE-CROSS-REFERENCE-ANALYSIS.md +19 -19
- package/docs/guides/workflows/SPEC-PIPELINE-WORKFLOW.md +25 -25
- package/docs/guides/workflows/STORY-DEVELOPMENT-CYCLE-WORKFLOW.md +28 -28
- package/docs/guides/workflows/WORKFLOW-TASK-AGENT-ANALYSIS.md +94 -94
- package/docs/guides/workflows/xref-phase2-templates.md +29 -29
- package/docs/guides/workflows/xref-phase3-scripts.md +33 -33
- package/docs/guides/workflows/xref-phase4-infra.md +2 -2
- package/docs/guides/workflows/xref-phase6-supporting.md +1 -1
- package/docs/guides/workflows-guide.md +2 -2
- package/docs/installation/faq.md +1 -1
- package/docs/installation/troubleshooting.md +2 -2
- package/docs/installation/v4-quick-start.md +2 -2
- package/docs/prd-cli-graph-dashboard.md +1 -1
- package/docs/pt/DOCUMENTATION-ROADMAP.md +1 -1
- package/docs/pt/FEATURE_PROCESS.md +1 -1
- package/docs/pt/README.md +2 -2
- package/docs/pt/agents/archetype-rationale.md +4 -4
- package/docs/pt/agents/persona-definitions.md +9 -9
- package/docs/pt/architecture/ADE-ARCHITECT-HANDOFF.md +15 -15
- package/docs/pt/architecture/ADE-EPIC1-HANDOFF.md +2 -2
- package/docs/pt/architecture/ADE-EPIC2-HANDOFF.md +2 -2
- package/docs/pt/architecture/ADE-EPIC3-HANDOFF.md +8 -8
- package/docs/pt/architecture/ade-architecture.md +4 -4
- package/docs/pt/architecture/adr/adr-hcs-health-check-system.md +3 -3
- package/docs/pt/architecture/agent-config-audit.md +4 -4
- package/docs/pt/architecture/agent-responsibility-matrix.md +20 -20
- package/docs/pt/architecture/agent-tool-integration-guide.md +8 -8
- package/docs/pt/architecture/contribution-workflow-research.md +1 -1
- package/docs/pt/architecture/dashboard-architecture.md +1 -1
- package/docs/pt/architecture/hcs-check-specifications.md +1 -1
- package/docs/pt/architecture/hcs-execution-modes.md +1 -1
- package/docs/pt/architecture/hcs-self-healing-spec.md +1 -1
- package/docs/pt/architecture/high-level-architecture.md +1 -1
- package/docs/pt/architecture/module-system.md +1 -1
- package/docs/pt/architecture/source-tree.md +1 -1
- package/docs/pt/architecture/squad-improvement-recommended-approach.md +2 -2
- package/docs/pt/architecture/utility-integration-guide.md +2 -2
- package/docs/pt/contributing.md +1 -1
- package/docs/pt/core-architecture.md +2 -2
- package/docs/pt/framework/source-tree.md +1 -1
- package/docs/pt/guides/ade-guide.md +25 -25
- package/docs/pt/guides/agent-selection-guide.md +36 -36
- package/docs/pt/guides/api-reference.md +25 -25
- package/docs/pt/guides/contextual-greeting-system-guide.md +5 -5
- package/docs/pt/guides/development-setup.md +1 -1
- package/docs/pt/guides/project-status-feature.md +2 -2
- package/docs/pt/guides/quality-dashboard.md +2 -2
- package/docs/pt/guides/quality-gates.md +6 -6
- package/docs/pt/guides/template-engine-v2.md +2 -2
- package/docs/pt/guides/user-guide.md +8 -8
- package/docs/pt/guides/workflows-guide.md +2 -2
- package/docs/pt/installation/faq.md +1 -1
- package/docs/pt/installation/troubleshooting.md +2 -2
- package/docs/pt/installation/v4-quick-start.md +2 -2
- package/docs/pt/platforms/antigravity.md +9 -9
- package/docs/pt/platforms/cursor.md +15 -15
- package/docs/pt/platforms/gemini-cli.md +3 -3
- package/docs/pt/roadmap.md +1 -1
- package/docs/pt/sinapse-nomenclature-specification.md +15 -15
- package/docs/pt/specifications/docs-agent-technical-specification.md +11 -11
- package/docs/roadmap.md +1 -1
- package/docs/sinapse-agent-flows/README.md +2 -2
- package/docs/sinapse-agent-flows/analyst-system.md +5 -5
- package/docs/sinapse-agent-flows/architect-system.md +9 -9
- package/docs/sinapse-agent-flows/data-engineer-system.md +8 -8
- package/docs/sinapse-agent-flows/dev-system.md +27 -27
- package/docs/sinapse-agent-flows/devops-system.md +5 -5
- package/docs/sinapse-agent-flows/pm-system.md +24 -24
- package/docs/sinapse-agent-flows/qa-system.md +24 -24
- package/docs/sinapse-agent-flows/{sinapse-master-system.md → sinapse-orqx-system.md} +26 -26
- package/docs/sinapse-agent-flows/sm-system.md +31 -31
- package/docs/sinapse-agent-flows/squad-creator-system.md +2 -2
- package/docs/sinapse-agent-flows/ux-design-expert-system.md +10 -10
- package/docs/sinapse-workflows/auto-worktree-workflow.md +3 -3
- package/docs/sinapse-workflows/brownfield-discovery-workflow.md +6 -6
- package/docs/sinapse-workflows/brownfield-fullstack-workflow.md +30 -30
- package/docs/sinapse-workflows/brownfield-service-workflow.md +38 -38
- package/docs/sinapse-workflows/brownfield-ui-workflow.md +25 -25
- package/docs/sinapse-workflows/greenfield-fullstack-workflow.md +37 -37
- package/docs/sinapse-workflows/greenfield-service-workflow.md +5 -5
- package/docs/sinapse-workflows/greenfield-ui-workflow.md +19 -19
- package/docs/sinapse-workflows/qa-loop-workflow.md +13 -13
- package/docs/sinapse-workflows/spec-pipeline-workflow.md +25 -25
- package/docs/sinapse-workflows/story-development-cycle-workflow.md +28 -28
- package/package.json +1 -1
- package/packages/gemini-sinapse-extension/README.md +1 -1
- package/packages/gemini-sinapse-extension/commands/lib/agent-launcher.js +1 -1
- package/packages/gemini-sinapse-extension/commands/{sinapse-master.js → sinapse-orqx.js} +1 -1
- package/packages/gemini-sinapse-extension/extension.json +3 -3
- package/packages/gemini-sinapse-extension/gemini-extension.json +3 -3
- package/packages/installer/src/config/configure-environment.js +2 -2
- package/packages/installer/src/updater/index.js +105 -0
- package/packages/installer/src/wizard/feedback.js +38 -30
- package/packages/installer/src/wizard/i18n.js +25 -182
- package/packages/installer/src/wizard/ide-config-generator.js +1 -1
- package/packages/installer/src/wizard/index.js +253 -69
- package/packages/installer/src/wizard/questions.js +35 -7
- package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +1 -1
- package/packages/sinapse-install/README.md +1 -1
- package/packages/sinapse-install/src/installer.js +1 -1
- package/scripts/package-synapse.js +1 -1
- package/sinapse/agents/{sinapse-master.md → sinapse-orqx.md} +16 -16
- package/sinapse/knowledge-base/cross-squad-patterns.md +1 -1
- package/sinapse/knowledge-base/routing-catalog.md +1 -1
- package/sinapse/squad.yaml +1 -1
- package/sinapse/tasks/compose-multi-squad-plan.md +2 -2
- package/sinapse/tasks/coordinate-cross-squad.md +2 -2
- package/sinapse/tasks/diagnose-and-route.md +2 -2
- package/sinapse/tasks/onboard-user.md +2 -2
- package/sinapse/tasks/resolve-conflict.md +2 -2
- package/sinapse/tasks/squad-status-report.md +2 -2
- package/sinapse/tasks/strategic-brief.md +3 -3
- package/squads/squad-animations/agents/animations-orqx.md +2 -2
- package/squads/squad-brand/agents/brand-creative-engineer.md +1 -1
- package/squads/squad-brand/agents/brand-motion-vfx.md +1 -1
- package/squads/squad-brand/agents/brand-orqx.md +2 -2
- package/squads/squad-brand/agents/brand-sonic-designer.md +1 -1
- package/squads/squad-brand/agents/brand-system-architect.md +1 -1
- package/squads/squad-claude/agents/claude-orqx.md +2 -2
- package/squads/squad-cloning/agents/cloning-orqx.md +3 -3
- package/squads/squad-commercial/agents/commercial-orqx.md +1 -1
- package/squads/squad-commercial/agents/cs-business-auditor.md +1 -1
- package/squads/squad-commercial/agents/cs-client-success.md +1 -1
- package/squads/squad-commercial/agents/cs-crm-specialist.md +1 -1
- package/squads/squad-commercial/agents/cs-funnel-architect.md +1 -1
- package/squads/squad-commercial/agents/cs-lead-generation-strategist.md +1 -1
- package/squads/squad-commercial/agents/cs-offer-designer.md +1 -1
- package/squads/squad-commercial/agents/cs-revops-analyst.md +1 -1
- package/squads/squad-commercial/agents/cs-sales-closer.md +1 -1
- package/squads/squad-commercial/agents/cs-sales-enablement.md +1 -1
- package/squads/squad-commercial/knowledge-base/ai-as-competitive-infrastructure.md +1 -1
- package/squads/squad-content/agents/content-orqx.md +2 -2
- package/squads/squad-content/knowledge-base/ai-leverage-content-framework.md +1 -1
- package/squads/squad-copy/agents/copy-strategist.md +3 -3
- package/squads/squad-copy/knowledge-base/consequence-headline-patterns.md +1 -1
- package/squads/squad-council/agents/council-orqx.md +1 -1
- package/squads/squad-courses/agents/courses-orqx.md +1 -1
- package/squads/squad-cybersecurity/agents/cyber-orqx.md +2 -2
- package/squads/squad-design/agents/design-orqx.md +2 -2
- package/squads/squad-finance/agents/finance-orqx.md +2 -2
- package/squads/squad-growth/agents/growth-orqx.md +2 -2
- package/squads/squad-paidmedia/agents/paidmedia-orqx.md +2 -2
- package/squads/squad-product/agents/product-orqx.md +2 -2
- package/squads/squad-research/agents/research-orqx.md +2 -2
- package/squads/squad-research/tasks/create-executive-briefing.md +1 -1
- package/squads/squad-research/tasks/create-insight-deck.md +1 -1
- package/squads/squad-research/tasks/forecast-industry-trends.md +1 -1
- package/squads/squad-research/tasks/generate-actionable-recommendations.md +2 -2
- package/squads/squad-research/tasks/run-scenario-planning.md +2 -2
- package/squads/squad-research/tasks/synthesize-research-report.md +2 -2
- package/squads/squad-research/tasks/track-emerging-technologies.md +1 -1
- package/squads/squad-storytelling/agents/storytelling-orqx.md +2 -2
- package/docs/es/CHANGELOG.md +0 -117
- package/docs/es/DOCUMENTATION-ROADMAP.md +0 -216
- package/docs/es/ENVIRONMENT.md +0 -140
- package/docs/es/FEATURE_PROCESS.md +0 -99
- package/docs/es/GUIDING-PRINCIPLES.md +0 -101
- package/docs/es/README.md +0 -134
- package/docs/es/agent-reference-guide.md +0 -570
- package/docs/es/agents/archetype-rationale.md +0 -566
- package/docs/es/agents/persona-definitions.md +0 -501
- package/docs/es/api/squads-api.md +0 -753
- package/docs/es/architecture/ADE-AGENT-CHANGES.md +0 -469
- package/docs/es/architecture/ADE-ARCHITECT-HANDOFF.md +0 -338
- package/docs/es/architecture/ADE-EPIC1-HANDOFF.md +0 -85
- package/docs/es/architecture/ADE-EPIC2-HANDOFF.md +0 -106
- package/docs/es/architecture/ADE-EPIC3-HANDOFF.md +0 -327
- package/docs/es/architecture/ARCHITECTURE-INDEX.md +0 -188
- package/docs/es/architecture/ade-architecture.md +0 -586
- package/docs/es/architecture/adr/ADR-COLLAB-1-current-state-audit.md +0 -259
- package/docs/es/architecture/adr/ADR-COLLAB-2-proposed-configuration.md +0 -518
- package/docs/es/architecture/adr/adr-hcs-health-check-system.md +0 -489
- package/docs/es/architecture/adr/adr-isolated-vm-decision.md +0 -70
- package/docs/es/architecture/agent-config-audit.md +0 -222
- package/docs/es/architecture/agent-responsibility-matrix.md +0 -444
- package/docs/es/architecture/agent-tool-integration-guide.md +0 -334
- package/docs/es/architecture/ci-cd.md +0 -151
- package/docs/es/architecture/coding-standards.md +0 -896
- package/docs/es/architecture/contribution-workflow-research.md +0 -376
- package/docs/es/architecture/dashboard-architecture.md +0 -926
- package/docs/es/architecture/dashboard-realtime.md +0 -1253
- package/docs/es/architecture/hcs-check-specifications.md +0 -897
- package/docs/es/architecture/hcs-execution-modes.md +0 -519
- package/docs/es/architecture/hcs-self-healing-spec.md +0 -695
- package/docs/es/architecture/high-level-architecture.md +0 -357
- package/docs/es/architecture/introduction.md +0 -21
- package/docs/es/architecture/mcp-api-keys-management.md +0 -246
- package/docs/es/architecture/mcp-system-diagrams.md +0 -113
- package/docs/es/architecture/module-system.md +0 -382
- package/docs/es/architecture/multi-repo-strategy.md +0 -390
- package/docs/es/architecture/source-tree.md +0 -708
- package/docs/es/architecture/squad-improvement-analysis.md +0 -204
- package/docs/es/architecture/squad-improvement-recommended-approach.md +0 -390
- package/docs/es/architecture/tech-stack.md +0 -806
- package/docs/es/architecture/utility-integration-guide.md +0 -358
- package/docs/es/community/README-community-snippet-core.md +0 -57
- package/docs/es/community/README-community-snippet-mcp.md +0 -49
- package/docs/es/community/README-community-snippet-squads.md +0 -40
- package/docs/es/community.md +0 -227
- package/docs/es/core-architecture.md +0 -229
- package/docs/es/docker-mcp-setup.md +0 -426
- package/docs/es/framework/README.md +0 -99
- package/docs/es/framework/coding-standards.md +0 -892
- package/docs/es/framework/source-tree.md +0 -725
- package/docs/es/framework/tech-stack.md +0 -802
- package/docs/es/getting-started.md +0 -572
- package/docs/es/git-workflow-guide.md +0 -995
- package/docs/es/guides/README.md +0 -133
- package/docs/es/guides/ade-guide.md +0 -452
- package/docs/es/guides/agent-selection-guide.md +0 -295
- package/docs/es/guides/api-reference.md +0 -899
- package/docs/es/guides/build-recovery-guide.md +0 -270
- package/docs/es/guides/contextual-greeting-system-guide.md +0 -387
- package/docs/es/guides/contributing-squads.md +0 -256
- package/docs/es/guides/development-setup.md +0 -1111
- package/docs/es/guides/ide-sync-guide.md +0 -194
- package/docs/es/guides/installation-troubleshooting.md +0 -327
- package/docs/es/guides/llm-routing.md +0 -312
- package/docs/es/guides/mcp/desktop-commander.md +0 -368
- package/docs/es/guides/mcp/docker-gateway-tutorial.md +0 -336
- package/docs/es/guides/mcp-global-setup.md +0 -663
- package/docs/es/guides/permission-modes.md +0 -313
- package/docs/es/guides/project-status-feature.md +0 -473
- package/docs/es/guides/quality-dashboard.md +0 -367
- package/docs/es/guides/quality-gates.md +0 -614
- package/docs/es/guides/security-hardening.md +0 -1359
- package/docs/es/guides/service-discovery.md +0 -524
- package/docs/es/guides/squad-examples/README.md +0 -64
- package/docs/es/guides/squad-migration.md +0 -356
- package/docs/es/guides/squads-guide.md +0 -836
- package/docs/es/guides/squads-overview.md +0 -332
- package/docs/es/guides/template-engine-v2.md +0 -484
- package/docs/es/guides/testing-guide.md +0 -1215
- package/docs/es/guides/user-guide.md +0 -452
- package/docs/es/guides/workflows-guide.md +0 -400
- package/docs/es/how-to-contribute-with-pull-requests.md +0 -160
- package/docs/es/ide-integration.md +0 -425
- package/docs/es/installation/README.md +0 -108
- package/docs/es/installation/faq.md +0 -616
- package/docs/es/installation/linux.md +0 -311
- package/docs/es/installation/macos.md +0 -189
- package/docs/es/installation/troubleshooting.md +0 -735
- package/docs/es/installation/v4-quick-start.md +0 -269
- package/docs/es/installation/windows.md +0 -342
- package/docs/es/meta-agent-commands.md +0 -990
- package/docs/es/migration-guide.md +0 -310
- package/docs/es/npx-install.md +0 -193
- package/docs/es/performance-tuning-guide.md +0 -707
- package/docs/es/platforms/README.md +0 -283
- package/docs/es/platforms/antigravity.md +0 -510
- package/docs/es/platforms/claude-code.md +0 -650
- package/docs/es/platforms/cursor.md +0 -635
- package/docs/es/platforms/gemini-cli.md +0 -483
- package/docs/es/platforms/github-copilot.md +0 -480
- package/docs/es/roadmap.md +0 -119
- package/docs/es/security-best-practices.md +0 -613
- package/docs/es/security.md +0 -124
- package/docs/es/sinapse-agent-flows/README.md +0 -190
- package/docs/es/sinapse-agent-flows/analyst-system.md +0 -36
- package/docs/es/sinapse-agent-flows/architect-system.md +0 -36
- package/docs/es/sinapse-agent-flows/data-engineer-system.md +0 -36
- package/docs/es/sinapse-agent-flows/dev-system.md +0 -36
- package/docs/es/sinapse-agent-flows/devops-system.md +0 -36
- package/docs/es/sinapse-agent-flows/pm-system.md +0 -36
- package/docs/es/sinapse-agent-flows/qa-system.md +0 -36
- package/docs/es/sinapse-agent-flows/sinapse-master-system.md +0 -36
- package/docs/es/sinapse-agent-flows/sm-system.md +0 -36
- package/docs/es/sinapse-agent-flows/squad-creator-system.md +0 -36
- package/docs/es/sinapse-agent-flows/ux-design-expert-system.md +0 -36
- package/docs/es/sinapse-nomenclature-specification.md +0 -673
- package/docs/es/sinapse-workflows/README.md +0 -247
- package/docs/es/sinapse-workflows/auto-worktree-workflow.md +0 -39
- package/docs/es/sinapse-workflows/brownfield-discovery-workflow.md +0 -41
- package/docs/es/sinapse-workflows/brownfield-fullstack-workflow.md +0 -42
- package/docs/es/sinapse-workflows/brownfield-service-workflow.md +0 -43
- package/docs/es/sinapse-workflows/brownfield-ui-workflow.md +0 -42
- package/docs/es/sinapse-workflows/design-system-build-quality-workflow.md +0 -40
- package/docs/es/sinapse-workflows/greenfield-fullstack-workflow.md +0 -44
- package/docs/es/sinapse-workflows/greenfield-service-workflow.md +0 -43
- package/docs/es/sinapse-workflows/greenfield-ui-workflow.md +0 -43
- package/docs/es/sinapse-workflows/qa-loop-workflow.md +0 -39
- package/docs/es/sinapse-workflows/spec-pipeline-workflow.md +0 -40
- package/docs/es/sinapse-workflows/story-development-cycle-workflow.md +0 -42
- package/docs/es/specifications/docs-agent-technical-specification.md +0 -2161
- package/docs/es/troubleshooting.md +0 -887
- package/docs/es/uninstallation.md +0 -556
- package/docs/es/versioning-and-releases.md +0 -146
- package/docs/zh/CHANGELOG.md +0 -191
- package/docs/zh/ENVIRONMENT.md +0 -136
- package/docs/zh/FEATURE_PROCESS.md +0 -92
- package/docs/zh/GLOSSARY.md +0 -179
- package/docs/zh/GUIDING-PRINCIPLES.md +0 -97
- package/docs/zh/README.md +0 -133
- package/docs/zh/TRANSLATION-PLAN.md +0 -508
- package/docs/zh/agent-reference-guide.md +0 -566
- package/docs/zh/agents/archetype-rationale.md +0 -631
- package/docs/zh/agents/persona-definitions.md +0 -560
- package/docs/zh/api/squads-api.md +0 -753
- package/docs/zh/architecture/ADE-ARCHITECT-HANDOFF.md +0 -338
- package/docs/zh/architecture/ADE-EPIC1-HANDOFF.md +0 -85
- package/docs/zh/architecture/ADE-EPIC2-HANDOFF.md +0 -106
- package/docs/zh/architecture/ADE-EPIC3-HANDOFF.md +0 -327
- package/docs/zh/architecture/ARCHITECTURE-INDEX.md +0 -190
- package/docs/zh/architecture/SINAPSE-VISUAL-OVERVIEW.md +0 -595
- package/docs/zh/architecture/ade-architecture.md +0 -474
- package/docs/zh/architecture/adr/ADR-COLLAB-1-current-state-audit.md +0 -259
- package/docs/zh/architecture/adr/ADR-COLLAB-2-proposed-configuration.md +0 -518
- package/docs/zh/architecture/adr/adr-hcs-health-check-system.md +0 -489
- package/docs/zh/architecture/adr/adr-isolated-vm-decision.md +0 -70
- package/docs/zh/architecture/agent-config-audit.md +0 -220
- package/docs/zh/architecture/agent-responsibility-matrix.md +0 -444
- package/docs/zh/architecture/agent-tool-integration-guide.md +0 -336
- package/docs/zh/architecture/ci-cd.md +0 -151
- package/docs/zh/architecture/coding-standards.md +0 -898
- package/docs/zh/architecture/command-authority-matrix.md +0 -18
- package/docs/zh/architecture/contribution-workflow-research.md +0 -376
- package/docs/zh/architecture/dashboard-architecture.md +0 -569
- package/docs/zh/architecture/dashboard-realtime.md +0 -415
- package/docs/zh/architecture/hcs-check-specifications.md +0 -102
- package/docs/zh/architecture/hcs-execution-modes.md +0 -114
- package/docs/zh/architecture/hcs-self-healing-spec.md +0 -148
- package/docs/zh/architecture/high-level-architecture.md +0 -355
- package/docs/zh/architecture/introduction.md +0 -21
- package/docs/zh/architecture/mcp-api-keys-management.md +0 -248
- package/docs/zh/architecture/mcp-system-diagrams.md +0 -113
- package/docs/zh/architecture/module-system.md +0 -382
- package/docs/zh/architecture/multi-repo-strategy.md +0 -237
- package/docs/zh/architecture/source-tree.md +0 -710
- package/docs/zh/architecture/squad-improvement-analysis.md +0 -204
- package/docs/zh/architecture/squad-improvement-recommended-approach.md +0 -390
- package/docs/zh/architecture/tech-stack.md +0 -808
- package/docs/zh/architecture/utility-integration-guide.md +0 -358
- package/docs/zh/code-of-conduct.md +0 -113
- package/docs/zh/community/README-community-snippet-core.md +0 -57
- package/docs/zh/community/README-community-snippet-mcp.md +0 -49
- package/docs/zh/community/README-community-snippet-squads.md +0 -40
- package/docs/zh/community.md +0 -227
- package/docs/zh/contributing.md +0 -581
- package/docs/zh/core-architecture.md +0 -229
- package/docs/zh/docker-mcp-setup.md +0 -226
- package/docs/zh/framework/README.md +0 -97
- package/docs/zh/framework/coding-standards.md +0 -886
- package/docs/zh/framework/source-tree.md +0 -888
- package/docs/zh/framework/tech-stack.md +0 -796
- package/docs/zh/getting-started.md +0 -317
- package/docs/zh/git-workflow-guide.md +0 -988
- package/docs/zh/guides/MEMORY-INTEGRATION.md +0 -497
- package/docs/zh/guides/MEMORY-INTELLIGENCE-SYSTEM.md +0 -1083
- package/docs/zh/guides/MEMORY-SYSTEM.md +0 -1003
- package/docs/zh/guides/README.md +0 -127
- package/docs/zh/guides/ade-guide.md +0 -446
- package/docs/zh/guides/agent-selection-guide.md +0 -289
- package/docs/zh/guides/api-reference.md +0 -427
- package/docs/zh/guides/build-recovery-guide.md +0 -266
- package/docs/zh/guides/contextual-greeting-system-guide.md +0 -381
- package/docs/zh/guides/contributing-squads.md +0 -250
- package/docs/zh/guides/development-setup.md +0 -384
- package/docs/zh/guides/ide-sync-guide.md +0 -193
- package/docs/zh/guides/installation-troubleshooting.md +0 -321
- package/docs/zh/guides/llm-routing.md +0 -306
- package/docs/zh/guides/mcp/desktop-commander.md +0 -368
- package/docs/zh/guides/mcp/docker-gateway-tutorial.md +0 -336
- package/docs/zh/guides/mcp-global-setup.md +0 -696
- package/docs/zh/guides/permission-modes.md +0 -307
- package/docs/zh/guides/project-status-feature.md +0 -467
- package/docs/zh/guides/quality-dashboard.md +0 -361
- package/docs/zh/guides/quality-gates.md +0 -462
- package/docs/zh/guides/security-hardening.md +0 -1055
- package/docs/zh/guides/service-discovery.md +0 -518
- package/docs/zh/guides/squad-examples/README.md +0 -63
- package/docs/zh/guides/squad-migration.md +0 -336
- package/docs/zh/guides/template-engine-v2.md +0 -478
- package/docs/zh/guides/workflows-guide.md +0 -408
- package/docs/zh/how-to-contribute-with-pull-requests.md +0 -158
- package/docs/zh/installation/README.md +0 -106
- package/docs/zh/installation/faq.md +0 -611
- package/docs/zh/installation/linux.md +0 -447
- package/docs/zh/installation/macos.md +0 -187
- package/docs/zh/installation/troubleshooting.md +0 -729
- package/docs/zh/installation/windows.md +0 -475
- package/docs/zh/meta-agent-commands.md +0 -990
- package/docs/zh/security-best-practices.md +0 -610
- package/docs/zh/security.md +0 -124
- package/docs/zh/sinapse-agent-flows/README.md +0 -196
- package/docs/zh/sinapse-agent-flows/analyst-system.md +0 -679
- package/docs/zh/sinapse-agent-flows/architect-system.md +0 -246
- package/docs/zh/sinapse-agent-flows/data-engineer-system.md +0 -418
- package/docs/zh/sinapse-agent-flows/dev-system.md +0 -209
- package/docs/zh/sinapse-agent-flows/devops-system.md +0 -643
- package/docs/zh/sinapse-agent-flows/pm-system.md +0 -733
- package/docs/zh/sinapse-agent-flows/qa-system.md +0 -268
- package/docs/zh/sinapse-agent-flows/sinapse-master-system.md +0 -81
- package/docs/zh/sinapse-agent-flows/sm-system.md +0 -501
- package/docs/zh/sinapse-agent-flows/squad-creator-system.md +0 -704
- package/docs/zh/sinapse-agent-flows/ux-design-expert-system.md +0 -160
- package/docs/zh/sinapse-workflows/README.md +0 -247
- package/docs/zh/sinapse-workflows/auto-worktree-workflow.md +0 -793
- package/docs/zh/sinapse-workflows/brownfield-discovery-workflow.md +0 -915
- package/docs/zh/sinapse-workflows/brownfield-fullstack-workflow.md +0 -764
- package/docs/zh/sinapse-workflows/brownfield-service-workflow.md +0 -812
- package/docs/zh/sinapse-workflows/brownfield-ui-workflow.md +0 -891
- package/docs/zh/sinapse-workflows/design-system-build-quality-workflow.md +0 -845
- package/docs/zh/sinapse-workflows/greenfield-fullstack-workflow.md +0 -796
- package/docs/zh/sinapse-workflows/greenfield-service-workflow.md +0 -786
- package/docs/zh/sinapse-workflows/greenfield-ui-workflow.md +0 -922
- package/docs/zh/sinapse-workflows/qa-loop-workflow.md +0 -1111
- package/docs/zh/sinapse-workflows/spec-pipeline-workflow.md +0 -1031
- package/docs/zh/sinapse-workflows/story-development-cycle-workflow.md +0 -843
- package/docs/zh/troubleshooting.md +0 -883
- package/docs/zh/uninstallation.md +0 -348
- package/docs/zh/versioning-and-releases.md +0 -140
- /package/.sinapse-ai/development/agents/{dev → developer}/MEMORY.md +0 -0
- /package/.sinapse-ai/development/agents/{qa → quality-gate}/MEMORY.md +0 -0
- /package/.sinapse-ai/development/agents/{sm → sprint-lead}/MEMORY.md +0 -0
|
@@ -1,1253 +0,0 @@
|
|
|
1
|
-
# 🔴 SINAPSE Dashboard - Arquitectura de Observabilidad en Tiempo Real
|
|
2
|
-
|
|
3
|
-
> **ES** | [EN](../architecture/dashboard-realtime.md) | [PT](../pt/architecture/dashboard-realtime.md)
|
|
4
|
-
>
|
|
5
|
-
> **Versión:** 1.0.0
|
|
6
|
-
> **Fecha:** 2026-01-29
|
|
7
|
-
> **Estado:** Propuesta
|
|
8
|
-
> **Autor:** @architect (Aria)
|
|
9
|
-
> **Relacionado:** [dashboard-architecture.md](./dashboard-architecture.md)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 📋 Índice
|
|
14
|
-
|
|
15
|
-
1. [Descripción General](#descripción-general)
|
|
16
|
-
2. [Problema Actual](#problema-actual)
|
|
17
|
-
3. [Arquitectura Propuesta](#arquitectura-propuesta)
|
|
18
|
-
4. [Event Emitter (CLI)](#event-emitter-cli)
|
|
19
|
-
5. [Esquema de Eventos](#esquema-de-eventos)
|
|
20
|
-
6. [Endpoint SSE Mejorado](#endpoint-sse-mejorado)
|
|
21
|
-
7. [Almacén de Eventos](#almacén-de-eventos)
|
|
22
|
-
8. [Nuevos Componentes UI](#nuevos-componentes-ui)
|
|
23
|
-
9. [Flujo de Datos Completo](#flujo-de-datos-completo)
|
|
24
|
-
10. [Implementación por Fases](#implementación-por-fases)
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Descripción General
|
|
29
|
-
|
|
30
|
-
Este documento describe la arquitectura para **observabilidad en tiempo real** del SINAPSE Dashboard, permitiendo que los usuarios monitoreen comandos ejecutados en la CLI con máximo detalle visual.
|
|
31
|
-
|
|
32
|
-
### Caso de Uso Principal
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
Usuario ejecuta comandos en CLI → Dashboard muestra TODO en tiempo real
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Principios
|
|
39
|
-
|
|
40
|
-
1. **Cero Configuración** - Funciona automáticamente cuando la CLI y el Dashboard están activos
|
|
41
|
-
2. **Basado en Archivos** - Comunicación a través del sistema de archivos (no requiere servidor adicional)
|
|
42
|
-
3. **Eventos Append-Only** - Log de eventos inmutable para debugging
|
|
43
|
-
4. **Degradación Elegante** - El Dashboard funciona incluso sin eventos (fallback a polling)
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Problema Actual
|
|
48
|
-
|
|
49
|
-
### Qué muestra el Dashboard HOY
|
|
50
|
-
|
|
51
|
-
| Evento en CLI | Dashboard Actual | Nota |
|
|
52
|
-
| ----------------- | ------------------------- | --------------- |
|
|
53
|
-
| `@agent` activa | ✅ StatusBar muestra | Funciona |
|
|
54
|
-
| `*exit` agent | ✅ Agent va a standby | Funciona |
|
|
55
|
-
| Story status cambia | ⚠️ Kanban actualiza | Sin notificación |
|
|
56
|
-
|
|
57
|
-
### Qué NO muestra el Dashboard
|
|
58
|
-
|
|
59
|
-
| Evento en CLI | Dashboard Actual |
|
|
60
|
-
| ---------------------------- | --------------- |
|
|
61
|
-
| Comando `*xxx` ejecutando | ❌ Nada |
|
|
62
|
-
| Claude "pensando" | ❌ Nada |
|
|
63
|
-
| Tool calls (Read/Write/Bash) | ❌ Nada |
|
|
64
|
-
| Progreso de la tarea | ❌ Nada |
|
|
65
|
-
| Output de Claude | ❌ Nada |
|
|
66
|
-
| git commit/push | ❌ Nada |
|
|
67
|
-
| Errores | ❌ Nada |
|
|
68
|
-
| Tarea completa | ❌ Nada |
|
|
69
|
-
|
|
70
|
-
### Brecha Visual
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
74
|
-
│ FLUJO: CLI → Dashboard Tiempo Real │
|
|
75
|
-
├─────────────────────────────────────────────────────────────────────────┤
|
|
76
|
-
│ │
|
|
77
|
-
│ USTED EN CLI DASHBOARD │
|
|
78
|
-
│ ──────────── ───────── │
|
|
79
|
-
│ │
|
|
80
|
-
│ @architect ─────────────────────────────▶ ✅ Agent activo aparece │
|
|
81
|
-
│ (activa agente) (StatusBar + AgentMonitor) │
|
|
82
|
-
│ │
|
|
83
|
-
│ *create-architecture ───────────────────▶ ❌ NO MUESTRA comando │
|
|
84
|
-
│ (ejecuta tarea) ejecutando │
|
|
85
|
-
│ │
|
|
86
|
-
│ [Claude pensando...] ───────────────────▶ ❌ NO MUESTRA progreso │
|
|
87
|
-
│ en tiempo real │
|
|
88
|
-
│ │
|
|
89
|
-
│ [Creando archivo X] ────────────────────▶ ❌ NO MUESTRA archivos │
|
|
90
|
-
│ [Editando archivo Y] siendo creados/editados │
|
|
91
|
-
│ │
|
|
92
|
-
│ [Story actualizada] ─────────────────────▶ ⚠️ PARCIAL - status cambia │
|
|
93
|
-
│ pero sin detalles │
|
|
94
|
-
│ │
|
|
95
|
-
│ [git commit] ───────────────────────────▶ ❌ NO MUESTRA commits │
|
|
96
|
-
│ en tiempo real │
|
|
97
|
-
│ │
|
|
98
|
-
│ *exit ──────────────────────────────────▶ ✅ Agent va a standby │
|
|
99
|
-
│ │
|
|
100
|
-
└─────────────────────────────────────────────────────────────────────────┘
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Arquitectura Propuesta
|
|
106
|
-
|
|
107
|
-
### Diagrama General
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
111
|
-
│ CLI / SINAPSE AGENTS │
|
|
112
|
-
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
113
|
-
│ │ Claude Code Session │ │
|
|
114
|
-
│ │ @architect → *create-architecture → [thinking...] → [file ops] │ │
|
|
115
|
-
│ └────────────────────────────────┬────────────────────────────────┘ │
|
|
116
|
-
│ │ │
|
|
117
|
-
│ │ EMIT EVENTS │
|
|
118
|
-
│ ▼ │
|
|
119
|
-
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
120
|
-
│ │ .sinapse/dashboard/events.jsonl (append-only) │ │
|
|
121
|
-
│ │ {"type":"agent:activated","agent":"architect","ts":"..."} │ │
|
|
122
|
-
│ │ {"type":"command:start","cmd":"*create-architecture","ts":"..."}│ │
|
|
123
|
-
│ │ {"type":"llm:thinking","duration":0,"ts":"..."} │ │
|
|
124
|
-
│ │ {"type":"tool:call","tool":"Read","file":"src/index.ts","ts":""}│ │
|
|
125
|
-
│ │ {"type":"file:write","path":"docs/arch.md","lines":50,"ts":""} │ │
|
|
126
|
-
│ │ {"type":"command:complete","cmd":"*create","success":true,"ts":""}│ │
|
|
127
|
-
│ └────────────────────────────────┬────────────────────────────────┘ │
|
|
128
|
-
│ │ │
|
|
129
|
-
└───────────────────────────────────┼──────────────────────────────────────┘
|
|
130
|
-
│
|
|
131
|
-
│ SSE Stream
|
|
132
|
-
▼
|
|
133
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
134
|
-
│ DASHBOARD │
|
|
135
|
-
│ │
|
|
136
|
-
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
137
|
-
│ │ /api/events (SSE mejorado) │ │
|
|
138
|
-
│ │ - Watch events.jsonl para cambios │ │
|
|
139
|
-
│ │ - Stream nuevos eventos a clientes conectados │ │
|
|
140
|
-
│ │ - Mantener últimos N eventos en memoria │ │
|
|
141
|
-
│ └────────────────────────────────┬──────────────────────────────────┘ │
|
|
142
|
-
│ │ │
|
|
143
|
-
│ ▼ │
|
|
144
|
-
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
145
|
-
│ │ events-store (NUEVO) │ │
|
|
146
|
-
│ │ - currentCommand: { name, startedAt, status } │ │
|
|
147
|
-
│ │ - llmStatus: 'idle' | 'thinking' | 'responding' │ │
|
|
148
|
-
│ │ - recentFiles: { path, action, timestamp }[] │ │
|
|
149
|
-
│ │ - recentEvents: Event[] (circular buffer) │ │
|
|
150
|
-
│ │ - errors: Error[] │ │
|
|
151
|
-
│ └────────────────────────────────┬──────────────────────────────────┘ │
|
|
152
|
-
│ │ │
|
|
153
|
-
│ ▼ │
|
|
154
|
-
│ ┌─────────────────────────────────────────────────────────────────┐ │
|
|
155
|
-
│ │ COMPONENTES UI │ │
|
|
156
|
-
│ │ │ │
|
|
157
|
-
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │
|
|
158
|
-
│ │ │ CommandPanel │ │ ActivityFeed │ │ FileChangesPanel│ │ │
|
|
159
|
-
│ │ │ ───────────── │ │ ──────────── │ │ ─────────────── │ │ │
|
|
160
|
-
│ │ │ *create-arch │ │ 02:45 Pensando │ │ ✏️ docs/arch.md │ │ │
|
|
161
|
-
│ │ │ ████████░░ 80% │ │ 02:44 Read x.ts │ │ ✏️ src/index.ts │ │ │
|
|
162
|
-
│ │ │ 2m 34s elapsed │ │ 02:43 Agent on │ │ 📁 +3 files │ │ │
|
|
163
|
-
│ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ │ │
|
|
164
|
-
│ │ │ │
|
|
165
|
-
│ │ ┌───────────────────────────────────────────────────────────┐ │ │
|
|
166
|
-
│ │ │ TerminalStream (mejorado) │ │ │
|
|
167
|
-
│ │ │ Output en tiempo real de Claude con colores ANSI │ │ │
|
|
168
|
-
│ │ │ [02:45:12] Analyzing project structure... │ │ │
|
|
169
|
-
│ │ │ [02:45:15] Creating architecture document... │ │ │
|
|
170
|
-
│ │ │ [02:45:20] ✓ docs/architecture/system-arch.md created │ │ │
|
|
171
|
-
│ │ └───────────────────────────────────────────────────────────┘ │ │
|
|
172
|
-
│ └──────────────────────────────────────────────────────────────────┘ │
|
|
173
|
-
│ │
|
|
174
|
-
└──────────────────────────────────────────────────────────────────────────┘
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Event Emitter (CLI)
|
|
180
|
-
|
|
181
|
-
### Ubicación
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
.sinapse-ai/core/events/dashboard-emitter.ts
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Interfaz
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
// .sinapse-ai/core/events/types.ts
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Eventos de alto nivel solamente (Decisión #2)
|
|
194
|
-
* Enfocado en monitoreo, no debugging
|
|
195
|
-
*/
|
|
196
|
-
export type DashboardEventType =
|
|
197
|
-
// Ciclo de vida del agente
|
|
198
|
-
| 'agent:activated'
|
|
199
|
-
| 'agent:deactivated'
|
|
200
|
-
|
|
201
|
-
// Ejecución de comandos
|
|
202
|
-
| 'command:start'
|
|
203
|
-
| 'command:complete'
|
|
204
|
-
| 'command:error'
|
|
205
|
-
|
|
206
|
-
// Actualizaciones de story
|
|
207
|
-
| 'story:status-change'
|
|
208
|
-
|
|
209
|
-
// Sesión
|
|
210
|
-
| 'session:start'
|
|
211
|
-
| 'session:end';
|
|
212
|
-
|
|
213
|
-
export interface DashboardEvent {
|
|
214
|
-
id: string; // UUID v4
|
|
215
|
-
type: DashboardEventType;
|
|
216
|
-
timestamp: string; // ISO 8601
|
|
217
|
-
agentId?: string; // Agente activo cuando ocurrió el evento
|
|
218
|
-
sessionId?: string; // Identificador de sesión
|
|
219
|
-
data: Record<string, unknown>; // Payload específico del evento
|
|
220
|
-
}
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Implementación
|
|
224
|
-
|
|
225
|
-
```typescript
|
|
226
|
-
// .sinapse-ai/core/events/dashboard-emitter.ts
|
|
227
|
-
|
|
228
|
-
import { appendFileSync, existsSync, mkdirSync } from 'fs';
|
|
229
|
-
import { join } from 'path';
|
|
230
|
-
import { randomUUID } from 'crypto';
|
|
231
|
-
import type { DashboardEvent, DashboardEventType } from './types';
|
|
232
|
-
|
|
233
|
-
const EVENTS_DIR = '.sinapse/dashboard';
|
|
234
|
-
const EVENTS_FILE = 'events.jsonl';
|
|
235
|
-
const MAX_FILE_SIZE = 10 * 1024 * 1024; // rotación de 10MB
|
|
236
|
-
|
|
237
|
-
class DashboardEmitter {
|
|
238
|
-
private projectRoot: string;
|
|
239
|
-
private sessionId: string;
|
|
240
|
-
private activeAgentId: string | null = null;
|
|
241
|
-
private enabled: boolean = true;
|
|
242
|
-
|
|
243
|
-
constructor(projectRoot: string) {
|
|
244
|
-
this.projectRoot = projectRoot;
|
|
245
|
-
this.sessionId = randomUUID();
|
|
246
|
-
this.ensureDirectory();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
private ensureDirectory(): void {
|
|
250
|
-
const dir = join(this.projectRoot, EVENTS_DIR);
|
|
251
|
-
if (!existsSync(dir)) {
|
|
252
|
-
mkdirSync(dir, { recursive: true });
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
private getEventsPath(): string {
|
|
257
|
-
return join(this.projectRoot, EVENTS_DIR, EVENTS_FILE);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
emit(type: DashboardEventType, data: Record<string, unknown> = {}): void {
|
|
261
|
-
if (!this.enabled) return;
|
|
262
|
-
|
|
263
|
-
const event: DashboardEvent = {
|
|
264
|
-
id: randomUUID(),
|
|
265
|
-
type,
|
|
266
|
-
timestamp: new Date().toISOString(),
|
|
267
|
-
agentId: this.activeAgentId ?? undefined,
|
|
268
|
-
sessionId: this.sessionId,
|
|
269
|
-
data,
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
try {
|
|
273
|
-
const line = JSON.stringify(event) + '\n';
|
|
274
|
-
appendFileSync(this.getEventsPath(), line, 'utf-8');
|
|
275
|
-
} catch (error) {
|
|
276
|
-
// Falla silenciosa - dashboard es opcional
|
|
277
|
-
console.debug('[DashboardEmitter] Failed to emit event:', error);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Métodos de conveniencia de alto nivel (Decisión #2)
|
|
282
|
-
|
|
283
|
-
agentActivated(agentId: string, agentName: string): void {
|
|
284
|
-
this.activeAgentId = agentId;
|
|
285
|
-
this.emit('agent:activated', { agentId, agentName });
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
agentDeactivated(): void {
|
|
289
|
-
const agentId = this.activeAgentId;
|
|
290
|
-
this.activeAgentId = null;
|
|
291
|
-
this.emit('agent:deactivated', { agentId });
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
commandStart(command: string): void {
|
|
295
|
-
this.emit('command:start', { command });
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
commandComplete(command: string, success: boolean): void {
|
|
299
|
-
this.emit('command:complete', { command, success });
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
commandError(command: string, error: string): void {
|
|
303
|
-
this.emit('command:error', { command, error });
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
storyStatusChange(storyId: string, oldStatus: string, newStatus: string): void {
|
|
307
|
-
this.emit('story:status-change', { storyId, oldStatus, newStatus });
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
sessionStart(): void {
|
|
311
|
-
this.emit('session:start', { sessionId: this.sessionId });
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
sessionEnd(): void {
|
|
315
|
-
this.emit('session:end', { sessionId: this.sessionId });
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
// Métodos de control
|
|
319
|
-
disable(): void {
|
|
320
|
-
this.enabled = false;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
enable(): void {
|
|
324
|
-
this.enabled = true;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Exportación singleton
|
|
329
|
-
let emitter: DashboardEmitter | null = null;
|
|
330
|
-
|
|
331
|
-
export function getDashboardEmitter(projectRoot?: string): DashboardEmitter {
|
|
332
|
-
if (!emitter && projectRoot) {
|
|
333
|
-
emitter = new DashboardEmitter(projectRoot);
|
|
334
|
-
}
|
|
335
|
-
if (!emitter) {
|
|
336
|
-
throw new Error('DashboardEmitter not initialized. Call with projectRoot first.');
|
|
337
|
-
}
|
|
338
|
-
return emitter;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export function initDashboardEmitter(projectRoot: string): DashboardEmitter {
|
|
342
|
-
emitter = new DashboardEmitter(projectRoot);
|
|
343
|
-
return emitter;
|
|
344
|
-
}
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### Integración con Hooks de Claude Code
|
|
348
|
-
|
|
349
|
-
```typescript
|
|
350
|
-
// .sinapse-ai/integrations/claude-code/hooks.ts
|
|
351
|
-
|
|
352
|
-
import { getDashboardEmitter } from '../core/events/dashboard-emitter';
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Hooks de alto nivel solamente (Decisión #2)
|
|
356
|
-
* Eventos de ciclo de vida de agente y comando
|
|
357
|
-
*/
|
|
358
|
-
|
|
359
|
-
// Hook: Agente activado (e.g., @architect)
|
|
360
|
-
export function onAgentActivated(agentId: string, agentName: string): void {
|
|
361
|
-
const emitter = getDashboardEmitter();
|
|
362
|
-
emitter.agentActivated(agentId, agentName);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Hook: Agente desactivado (e.g., *exit)
|
|
366
|
-
export function onAgentDeactivated(): void {
|
|
367
|
-
const emitter = getDashboardEmitter();
|
|
368
|
-
emitter.agentDeactivated();
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Hook: Comando iniciado (e.g., *create-architecture)
|
|
372
|
-
export function onCommandStart(command: string): void {
|
|
373
|
-
const emitter = getDashboardEmitter();
|
|
374
|
-
emitter.commandStart(command);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// Hook: Comando completado
|
|
378
|
-
export function onCommandComplete(command: string, success: boolean): void {
|
|
379
|
-
const emitter = getDashboardEmitter();
|
|
380
|
-
emitter.commandComplete(command, success);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// Hook: Error en comando
|
|
384
|
-
export function onCommandError(command: string, error: string): void {
|
|
385
|
-
const emitter = getDashboardEmitter();
|
|
386
|
-
emitter.commandError(command, error);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// Hook: Cambio de estado de story
|
|
390
|
-
export function onStoryStatusChange(storyId: string, oldStatus: string, newStatus: string): void {
|
|
391
|
-
const emitter = getDashboardEmitter();
|
|
392
|
-
emitter.storyStatusChange(storyId, oldStatus, newStatus);
|
|
393
|
-
}
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
## Esquema de Eventos
|
|
399
|
-
|
|
400
|
-
### Ubicación de Archivo
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
.sinapse/dashboard/events.jsonl
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### Formato
|
|
407
|
-
|
|
408
|
-
JSON Lines (JSONL) - un objeto JSON por línea, append-only.
|
|
409
|
-
|
|
410
|
-
### Payloads de Eventos por Tipo (Sólo Alto Nivel)
|
|
411
|
-
|
|
412
|
-
#### Eventos de Agente
|
|
413
|
-
|
|
414
|
-
```jsonl
|
|
415
|
-
{"id":"uuid","type":"agent:activated","timestamp":"2026-01-29T14:30:00.000Z","sessionId":"uuid","data":{"agentId":"architect","agentName":"Aria"}}
|
|
416
|
-
{"id":"uuid","type":"agent:deactivated","timestamp":"2026-01-29T15:45:00.000Z","agentId":"architect","sessionId":"uuid","data":{"agentId":"architect"}}
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
#### Eventos de Comando
|
|
420
|
-
|
|
421
|
-
```jsonl
|
|
422
|
-
{"id":"uuid","type":"command:start","timestamp":"...","agentId":"architect","data":{"command":"*create-architecture"}}
|
|
423
|
-
{"id":"uuid","type":"command:complete","timestamp":"...","agentId":"architect","data":{"command":"*create-architecture","success":true}}
|
|
424
|
-
{"id":"uuid","type":"command:error","timestamp":"...","agentId":"architect","data":{"command":"*create-architecture","error":"Failed to read config file"}}
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
#### Eventos de Story
|
|
428
|
-
|
|
429
|
-
```jsonl
|
|
430
|
-
{
|
|
431
|
-
"id": "uuid",
|
|
432
|
-
"type": "story:status-change",
|
|
433
|
-
"timestamp": "...",
|
|
434
|
-
"agentId": "architect",
|
|
435
|
-
"data": {
|
|
436
|
-
"storyId": "SINAPSE-123",
|
|
437
|
-
"oldStatus": "in-progress",
|
|
438
|
-
"newStatus": "review"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
#### Eventos de Sesión
|
|
444
|
-
|
|
445
|
-
```jsonl
|
|
446
|
-
{"id":"uuid","type":"session:start","timestamp":"...","data":{"sessionId":"uuid"}}
|
|
447
|
-
{"id":"uuid","type":"session:end","timestamp":"...","data":{"sessionId":"uuid"}}
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
### Rotación de Archivos
|
|
451
|
-
|
|
452
|
-
Cuando `events.jsonl` excede 10MB:
|
|
453
|
-
|
|
454
|
-
1. Renombrar a `events.{timestamp}.jsonl`
|
|
455
|
-
2. Crear nuevo `events.jsonl`
|
|
456
|
-
3. Mantener últimos 5 archivos rotados
|
|
457
|
-
|
|
458
|
-
---
|
|
459
|
-
|
|
460
|
-
## Endpoint SSE Mejorado
|
|
461
|
-
|
|
462
|
-
### Actual vs Mejorado
|
|
463
|
-
|
|
464
|
-
| Aspecto | `/api/events` Actual | Mejorado |
|
|
465
|
-
| -------------- | --------------------- | ------------------------------ |
|
|
466
|
-
| Fuente | `status.json` solamente | `status.json` + `events.jsonl` |
|
|
467
|
-
| Activador de actualización | Intervalo de polling | File watch + polling |
|
|
468
|
-
| Tipos de eventos | `status:update` solamente | Todos los tipos de eventos |
|
|
469
|
-
| Historial | Ninguno | Últimos N eventos |
|
|
470
|
-
|
|
471
|
-
### Implementación
|
|
472
|
-
|
|
473
|
-
```typescript
|
|
474
|
-
// apps/dashboard/src/app/api/events/route.ts (mejorado)
|
|
475
|
-
|
|
476
|
-
import { NextRequest } from 'next/server';
|
|
477
|
-
import { watch, existsSync, readFileSync, statSync } from 'fs';
|
|
478
|
-
import { join } from 'path';
|
|
479
|
-
import { Readable } from 'stream';
|
|
480
|
-
|
|
481
|
-
const SINAPSE_DIR = process.env.SINAPSE_PROJECT_ROOT || process.cwd();
|
|
482
|
-
const STATUS_FILE = join(SINAPSE_DIR, '.sinapse/dashboard/status.json');
|
|
483
|
-
const EVENTS_FILE = join(SINAPSE_DIR, '.sinapse/dashboard/events.jsonl');
|
|
484
|
-
|
|
485
|
-
interface SSEEvent {
|
|
486
|
-
type: string;
|
|
487
|
-
data: unknown;
|
|
488
|
-
timestamp: string;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
export async function GET(request: NextRequest): Promise<Response> {
|
|
492
|
-
const encoder = new TextEncoder();
|
|
493
|
-
let lastEventPosition = 0;
|
|
494
|
-
let isConnected = true;
|
|
495
|
-
|
|
496
|
-
// Rastrear últimos tamaños conocidos de archivo para detección de cambios
|
|
497
|
-
let lastStatusMtime = 0;
|
|
498
|
-
let lastEventsSize = 0;
|
|
499
|
-
|
|
500
|
-
const stream = new ReadableStream({
|
|
501
|
-
start(controller) {
|
|
502
|
-
// Enviar evento de conexión inicial
|
|
503
|
-
sendEvent(controller, {
|
|
504
|
-
type: 'connection:status',
|
|
505
|
-
data: { connected: true },
|
|
506
|
-
timestamp: new Date().toISOString(),
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
// Enviar estado actual
|
|
510
|
-
sendCurrentStatus(controller);
|
|
511
|
-
|
|
512
|
-
// Enviar eventos recientes (últimos 50)
|
|
513
|
-
sendRecentEvents(controller, 50);
|
|
514
|
-
|
|
515
|
-
// Configurar observadores de archivo
|
|
516
|
-
const watchers: ReturnType<typeof watch>[] = [];
|
|
517
|
-
|
|
518
|
-
// Observar status.json
|
|
519
|
-
if (existsSync(STATUS_FILE)) {
|
|
520
|
-
const statusWatcher = watch(STATUS_FILE, (eventType) => {
|
|
521
|
-
if (eventType === 'change' && isConnected) {
|
|
522
|
-
const stat = statSync(STATUS_FILE);
|
|
523
|
-
if (stat.mtimeMs > lastStatusMtime) {
|
|
524
|
-
lastStatusMtime = stat.mtimeMs;
|
|
525
|
-
sendCurrentStatus(controller);
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
});
|
|
529
|
-
watchers.push(statusWatcher);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
// Observar events.jsonl
|
|
533
|
-
if (existsSync(EVENTS_FILE)) {
|
|
534
|
-
const eventsWatcher = watch(EVENTS_FILE, (eventType) => {
|
|
535
|
-
if (eventType === 'change' && isConnected) {
|
|
536
|
-
const stat = statSync(EVENTS_FILE);
|
|
537
|
-
if (stat.size > lastEventsSize) {
|
|
538
|
-
sendNewEvents(controller, lastEventsSize);
|
|
539
|
-
lastEventsSize = stat.size;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
watchers.push(eventsWatcher);
|
|
544
|
-
lastEventsSize = statSync(EVENTS_FILE).size;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
// Heartbeat cada 30s
|
|
548
|
-
const heartbeatInterval = setInterval(() => {
|
|
549
|
-
if (isConnected) {
|
|
550
|
-
sendEvent(controller, {
|
|
551
|
-
type: 'heartbeat',
|
|
552
|
-
data: { alive: true },
|
|
553
|
-
timestamp: new Date().toISOString(),
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
}, 30000);
|
|
557
|
-
|
|
558
|
-
// Limpiar al cerrar
|
|
559
|
-
request.signal.addEventListener('abort', () => {
|
|
560
|
-
isConnected = false;
|
|
561
|
-
clearInterval(heartbeatInterval);
|
|
562
|
-
watchers.forEach((w) => w.close());
|
|
563
|
-
controller.close();
|
|
564
|
-
});
|
|
565
|
-
},
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
function sendEvent(controller: ReadableStreamDefaultController, event: SSEEvent): void {
|
|
569
|
-
const data = `data: ${JSON.stringify(event)}\n\n`;
|
|
570
|
-
controller.enqueue(encoder.encode(data));
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
function sendCurrentStatus(controller: ReadableStreamDefaultController): void {
|
|
574
|
-
try {
|
|
575
|
-
if (existsSync(STATUS_FILE)) {
|
|
576
|
-
const content = readFileSync(STATUS_FILE, 'utf-8');
|
|
577
|
-
const status = JSON.parse(content);
|
|
578
|
-
sendEvent(controller, {
|
|
579
|
-
type: 'status:update',
|
|
580
|
-
data: status,
|
|
581
|
-
timestamp: new Date().toISOString(),
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
} catch (error) {
|
|
585
|
-
sendEvent(controller, {
|
|
586
|
-
type: 'error',
|
|
587
|
-
data: { message: 'Failed to read status' },
|
|
588
|
-
timestamp: new Date().toISOString(),
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
function sendRecentEvents(controller: ReadableStreamDefaultController, count: number): void {
|
|
594
|
-
try {
|
|
595
|
-
if (existsSync(EVENTS_FILE)) {
|
|
596
|
-
const content = readFileSync(EVENTS_FILE, 'utf-8');
|
|
597
|
-
const lines = content.trim().split('\n').filter(Boolean);
|
|
598
|
-
const recentLines = lines.slice(-count);
|
|
599
|
-
|
|
600
|
-
const events = recentLines
|
|
601
|
-
.map((line) => {
|
|
602
|
-
try {
|
|
603
|
-
return JSON.parse(line);
|
|
604
|
-
} catch {
|
|
605
|
-
return null;
|
|
606
|
-
}
|
|
607
|
-
})
|
|
608
|
-
.filter(Boolean);
|
|
609
|
-
|
|
610
|
-
sendEvent(controller, {
|
|
611
|
-
type: 'events:history',
|
|
612
|
-
data: { events },
|
|
613
|
-
timestamp: new Date().toISOString(),
|
|
614
|
-
});
|
|
615
|
-
|
|
616
|
-
lastEventPosition = content.length;
|
|
617
|
-
}
|
|
618
|
-
} catch (error) {
|
|
619
|
-
// Falla silenciosa
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
function sendNewEvents(controller: ReadableStreamDefaultController, fromPosition: number): void {
|
|
624
|
-
try {
|
|
625
|
-
if (existsSync(EVENTS_FILE)) {
|
|
626
|
-
const content = readFileSync(EVENTS_FILE, 'utf-8');
|
|
627
|
-
const newContent = content.slice(fromPosition);
|
|
628
|
-
const lines = newContent.trim().split('\n').filter(Boolean);
|
|
629
|
-
|
|
630
|
-
for (const line of lines) {
|
|
631
|
-
try {
|
|
632
|
-
const event = JSON.parse(line);
|
|
633
|
-
sendEvent(controller, {
|
|
634
|
-
type: 'event:new',
|
|
635
|
-
data: event,
|
|
636
|
-
timestamp: new Date().toISOString(),
|
|
637
|
-
});
|
|
638
|
-
} catch {
|
|
639
|
-
// Saltar líneas malformadas
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
} catch (error) {
|
|
644
|
-
// Falla silenciosa
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
return new Response(stream, {
|
|
649
|
-
headers: {
|
|
650
|
-
'Content-Type': 'text/event-stream',
|
|
651
|
-
'Cache-Control': 'no-cache',
|
|
652
|
-
Connection: 'keep-alive',
|
|
653
|
-
},
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
---
|
|
659
|
-
|
|
660
|
-
## Almacén de Eventos
|
|
661
|
-
|
|
662
|
-
### Ubicación
|
|
663
|
-
|
|
664
|
-
```
|
|
665
|
-
apps/dashboard/src/stores/events-store.ts
|
|
666
|
-
```
|
|
667
|
-
|
|
668
|
-
### Interfaz
|
|
669
|
-
|
|
670
|
-
```typescript
|
|
671
|
-
// apps/dashboard/src/stores/events-store.ts
|
|
672
|
-
|
|
673
|
-
import { create } from 'zustand';
|
|
674
|
-
import type { DashboardEvent } from '@/types';
|
|
675
|
-
|
|
676
|
-
// Retención configurable (Decisión #3)
|
|
677
|
-
const DEFAULT_MAX_EVENTS = 100;
|
|
678
|
-
|
|
679
|
-
export interface CurrentCommand {
|
|
680
|
-
name: string;
|
|
681
|
-
startedAt: string;
|
|
682
|
-
status: 'running' | 'complete' | 'error';
|
|
683
|
-
errorMessage?: string;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
export interface EventRetentionSettings {
|
|
687
|
-
mode: 'session' | 'hours' | 'persistent';
|
|
688
|
-
hoursToKeep?: number;
|
|
689
|
-
maxEvents?: number;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
interface EventsState {
|
|
693
|
-
// Conexión
|
|
694
|
-
isConnected: boolean;
|
|
695
|
-
lastUpdate: string | null;
|
|
696
|
-
|
|
697
|
-
// Sesión
|
|
698
|
-
sessionId: string | null;
|
|
699
|
-
sessionStartedAt: string | null;
|
|
700
|
-
|
|
701
|
-
// Comando actual (solo alto nivel)
|
|
702
|
-
currentCommand: CurrentCommand | null;
|
|
703
|
-
|
|
704
|
-
// Eventos recientes (solo alto nivel)
|
|
705
|
-
recentEvents: DashboardEvent[];
|
|
706
|
-
|
|
707
|
-
// Configuración de retención
|
|
708
|
-
retentionSettings: EventRetentionSettings;
|
|
709
|
-
|
|
710
|
-
// Acciones
|
|
711
|
-
setConnected: (connected: boolean) => void;
|
|
712
|
-
processEvent: (event: DashboardEvent) => void;
|
|
713
|
-
processHistoryEvents: (events: DashboardEvent[]) => void;
|
|
714
|
-
setRetentionSettings: (settings: EventRetentionSettings) => void;
|
|
715
|
-
clearEvents: () => void;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
export const useEventsStore = create<EventsState>((set, get) => ({
|
|
719
|
-
// Estado inicial
|
|
720
|
-
isConnected: false,
|
|
721
|
-
lastUpdate: null,
|
|
722
|
-
sessionId: null,
|
|
723
|
-
sessionStartedAt: null,
|
|
724
|
-
currentCommand: null,
|
|
725
|
-
recentEvents: [],
|
|
726
|
-
retentionSettings: {
|
|
727
|
-
mode: 'session',
|
|
728
|
-
hoursToKeep: 24,
|
|
729
|
-
maxEvents: DEFAULT_MAX_EVENTS,
|
|
730
|
-
},
|
|
731
|
-
|
|
732
|
-
// Acciones
|
|
733
|
-
setConnected: (connected) => set({ isConnected: connected }),
|
|
734
|
-
|
|
735
|
-
processEvent: (event) => {
|
|
736
|
-
const state = get();
|
|
737
|
-
const maxEvents = state.retentionSettings.maxEvents || DEFAULT_MAX_EVENTS;
|
|
738
|
-
|
|
739
|
-
// Agregar a eventos recientes (circular buffer)
|
|
740
|
-
const newEvents = [...state.recentEvents, event].slice(-maxEvents);
|
|
741
|
-
|
|
742
|
-
// Procesar por tipo de evento (solo alto nivel)
|
|
743
|
-
let updates: Partial<EventsState> = {
|
|
744
|
-
recentEvents: newEvents,
|
|
745
|
-
lastUpdate: event.timestamp,
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
switch (event.type) {
|
|
749
|
-
// Eventos de sesión
|
|
750
|
-
case 'session:start':
|
|
751
|
-
updates.sessionId = event.data.sessionId as string;
|
|
752
|
-
updates.sessionStartedAt = event.timestamp;
|
|
753
|
-
break;
|
|
754
|
-
|
|
755
|
-
case 'session:end':
|
|
756
|
-
updates.sessionId = null;
|
|
757
|
-
updates.sessionStartedAt = null;
|
|
758
|
-
updates.currentCommand = null;
|
|
759
|
-
break;
|
|
760
|
-
|
|
761
|
-
// Eventos de comando
|
|
762
|
-
case 'command:start':
|
|
763
|
-
updates.currentCommand = {
|
|
764
|
-
name: event.data.command as string,
|
|
765
|
-
startedAt: event.timestamp,
|
|
766
|
-
status: 'running',
|
|
767
|
-
};
|
|
768
|
-
break;
|
|
769
|
-
|
|
770
|
-
case 'command:complete':
|
|
771
|
-
if (state.currentCommand) {
|
|
772
|
-
updates.currentCommand = {
|
|
773
|
-
...state.currentCommand,
|
|
774
|
-
status: 'complete',
|
|
775
|
-
};
|
|
776
|
-
// Limpiar después de 3 segundos
|
|
777
|
-
setTimeout(() => {
|
|
778
|
-
set({ currentCommand: null });
|
|
779
|
-
}, 3000);
|
|
780
|
-
}
|
|
781
|
-
break;
|
|
782
|
-
|
|
783
|
-
case 'command:error':
|
|
784
|
-
if (state.currentCommand) {
|
|
785
|
-
updates.currentCommand = {
|
|
786
|
-
...state.currentCommand,
|
|
787
|
-
status: 'error',
|
|
788
|
-
errorMessage: event.data.error as string,
|
|
789
|
-
};
|
|
790
|
-
}
|
|
791
|
-
break;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
set(updates);
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
processHistoryEvents: (events) => {
|
|
798
|
-
events.forEach((event) => {
|
|
799
|
-
get().processEvent(event);
|
|
800
|
-
});
|
|
801
|
-
},
|
|
802
|
-
|
|
803
|
-
setRetentionSettings: (settings) => {
|
|
804
|
-
set({ retentionSettings: settings });
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
clearEvents: () => {
|
|
808
|
-
set({
|
|
809
|
-
recentEvents: [],
|
|
810
|
-
currentCommand: null,
|
|
811
|
-
});
|
|
812
|
-
},
|
|
813
|
-
}));
|
|
814
|
-
|
|
815
|
-
// Selectores
|
|
816
|
-
export const selectCurrentCommand = (state: EventsState) => state.currentCommand;
|
|
817
|
-
export const selectRecentEvents = (state: EventsState) => state.recentEvents;
|
|
818
|
-
export const selectSessionInfo = (state: EventsState) => ({
|
|
819
|
-
sessionId: state.sessionId,
|
|
820
|
-
startedAt: state.sessionStartedAt,
|
|
821
|
-
});
|
|
822
|
-
```
|
|
823
|
-
|
|
824
|
-
---
|
|
825
|
-
|
|
826
|
-
## Nuevos Componentes UI
|
|
827
|
-
|
|
828
|
-
### Componentes Necesarios (Sólo Alto Nivel)
|
|
829
|
-
|
|
830
|
-
| Componente | Responsabilidad | Prioridad |
|
|
831
|
-
| ------------------- | ----------------------------- | ---------- |
|
|
832
|
-
| `CommandPanel` | Muestra comando actual y estado | P0 |
|
|
833
|
-
| `ActivityFeed` | Timeline de eventos recientes | P0 |
|
|
834
|
-
| `SessionIndicator` | Estado de la sesión activa | P1 |
|
|
835
|
-
| `RetentionSettings` | Config de retención de eventos | P2 |
|
|
836
|
-
|
|
837
|
-
### CommandPanel
|
|
838
|
-
|
|
839
|
-
```typescript
|
|
840
|
-
// apps/dashboard/src/components/realtime/CommandPanel.tsx
|
|
841
|
-
|
|
842
|
-
'use client';
|
|
843
|
-
|
|
844
|
-
import { useEventsStore, selectCurrentCommand } from '@/stores/events-store';
|
|
845
|
-
import { useEffect, useState } from 'react';
|
|
846
|
-
import { cn } from '@/lib/utils';
|
|
847
|
-
import { Loader2, CheckCircle, XCircle, Terminal } from 'lucide-react';
|
|
848
|
-
|
|
849
|
-
export function CommandPanel() {
|
|
850
|
-
const currentCommand = useEventsStore(selectCurrentCommand);
|
|
851
|
-
const [elapsed, setElapsed] = useState(0);
|
|
852
|
-
|
|
853
|
-
useEffect(() => {
|
|
854
|
-
if (!currentCommand || currentCommand.status !== 'running') {
|
|
855
|
-
setElapsed(0);
|
|
856
|
-
return;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
const startTime = new Date(currentCommand.startedAt).getTime();
|
|
860
|
-
const interval = setInterval(() => {
|
|
861
|
-
setElapsed(Math.floor((Date.now() - startTime) / 1000));
|
|
862
|
-
}, 1000);
|
|
863
|
-
|
|
864
|
-
return () => clearInterval(interval);
|
|
865
|
-
}, [currentCommand]);
|
|
866
|
-
|
|
867
|
-
if (!currentCommand) {
|
|
868
|
-
return (
|
|
869
|
-
<div className="p-3 rounded-lg bg-surface border border-subtle">
|
|
870
|
-
<div className="flex items-center gap-2 text-muted text-sm">
|
|
871
|
-
<Terminal className="w-4 h-4" />
|
|
872
|
-
<span>Aguardando comando...</span>
|
|
873
|
-
</div>
|
|
874
|
-
</div>
|
|
875
|
-
);
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
const formatElapsed = (seconds: number) => {
|
|
879
|
-
const mins = Math.floor(seconds / 60);
|
|
880
|
-
const secs = seconds % 60;
|
|
881
|
-
return mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
const statusConfig = {
|
|
885
|
-
running: {
|
|
886
|
-
icon: <Loader2 className="w-4 h-4 animate-spin text-blue-400" />,
|
|
887
|
-
bg: 'border-blue-500/30 bg-blue-500/5',
|
|
888
|
-
},
|
|
889
|
-
complete: {
|
|
890
|
-
icon: <CheckCircle className="w-4 h-4 text-green-400" />,
|
|
891
|
-
bg: 'border-green-500/30 bg-green-500/5',
|
|
892
|
-
},
|
|
893
|
-
error: {
|
|
894
|
-
icon: <XCircle className="w-4 h-4 text-red-400" />,
|
|
895
|
-
bg: 'border-red-500/30 bg-red-500/5',
|
|
896
|
-
},
|
|
897
|
-
};
|
|
898
|
-
|
|
899
|
-
const config = statusConfig[currentCommand.status];
|
|
900
|
-
|
|
901
|
-
return (
|
|
902
|
-
<div className={cn('p-3 rounded-lg border transition-luxury', config.bg)}>
|
|
903
|
-
<div className="flex items-center justify-between">
|
|
904
|
-
<div className="flex items-center gap-2">
|
|
905
|
-
{config.icon}
|
|
906
|
-
<span className="font-mono text-sm">{currentCommand.name}</span>
|
|
907
|
-
</div>
|
|
908
|
-
{currentCommand.status === 'running' && (
|
|
909
|
-
<span className="text-xs text-muted">{formatElapsed(elapsed)}</span>
|
|
910
|
-
)}
|
|
911
|
-
</div>
|
|
912
|
-
|
|
913
|
-
{currentCommand.status === 'error' && currentCommand.errorMessage && (
|
|
914
|
-
<div className="mt-2 p-2 rounded bg-red-500/10 text-red-400 text-xs">
|
|
915
|
-
{currentCommand.errorMessage}
|
|
916
|
-
</div>
|
|
917
|
-
)}
|
|
918
|
-
</div>
|
|
919
|
-
);
|
|
920
|
-
}
|
|
921
|
-
```
|
|
922
|
-
|
|
923
|
-
### ActivityFeed
|
|
924
|
-
|
|
925
|
-
```typescript
|
|
926
|
-
// apps/dashboard/src/components/realtime/ActivityFeed.tsx
|
|
927
|
-
|
|
928
|
-
'use client';
|
|
929
|
-
|
|
930
|
-
import { useEventsStore, selectRecentEvents } from '@/stores/events-store';
|
|
931
|
-
import { cn } from '@/lib/utils';
|
|
932
|
-
import { User, Terminal, AlertCircle, Play, Square, Kanban } from 'lucide-react';
|
|
933
|
-
import { formatDistanceToNow } from 'date-fns';
|
|
934
|
-
import { es } from 'date-fns/locale';
|
|
935
|
-
|
|
936
|
-
// Solo eventos de alto nivel (Decisión #2)
|
|
937
|
-
const EVENT_CONFIG: Record<
|
|
938
|
-
string,
|
|
939
|
-
{ icon: React.ElementType; color: string; label: string }
|
|
940
|
-
> = {
|
|
941
|
-
'agent:activated': { icon: User, color: 'text-purple-400', label: 'Agent activado' },
|
|
942
|
-
'agent:deactivated': { icon: User, color: 'text-gray-400', label: 'Agent desactivado' },
|
|
943
|
-
'command:start': { icon: Terminal, color: 'text-blue-400', label: 'Comando' },
|
|
944
|
-
'command:complete': { icon: Terminal, color: 'text-green-400', label: 'Comando OK' },
|
|
945
|
-
'command:error': { icon: AlertCircle, color: 'text-red-400', label: 'Error' },
|
|
946
|
-
'story:status-change': { icon: Kanban, color: 'text-orange-400', label: 'Story' },
|
|
947
|
-
'session:start': { icon: Play, color: 'text-green-400', label: 'Sesión iniciada' },
|
|
948
|
-
'session:end': { icon: Square, color: 'text-gray-400', label: 'Sesión encerrada' },
|
|
949
|
-
};
|
|
950
|
-
|
|
951
|
-
interface ActivityFeedProps {
|
|
952
|
-
maxItems?: number;
|
|
953
|
-
className?: string;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
export function ActivityFeed({ maxItems = 15, className }: ActivityFeedProps) {
|
|
957
|
-
const recentEvents = useEventsStore(selectRecentEvents);
|
|
958
|
-
const displayEvents = recentEvents.slice(-maxItems).reverse();
|
|
959
|
-
|
|
960
|
-
if (displayEvents.length === 0) {
|
|
961
|
-
return (
|
|
962
|
-
<div className={cn('p-4 text-center text-muted text-sm', className)}>
|
|
963
|
-
Ninguna actividad reciente
|
|
964
|
-
</div>
|
|
965
|
-
);
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
return (
|
|
969
|
-
<div className={cn('space-y-1', className)}>
|
|
970
|
-
{displayEvents.map((event) => {
|
|
971
|
-
const config = EVENT_CONFIG[event.type] || {
|
|
972
|
-
icon: Terminal,
|
|
973
|
-
color: 'text-gray-400',
|
|
974
|
-
label: event.type,
|
|
975
|
-
};
|
|
976
|
-
const Icon = config.icon;
|
|
977
|
-
|
|
978
|
-
const getEventDetail = () => {
|
|
979
|
-
switch (event.type) {
|
|
980
|
-
case 'agent:activated':
|
|
981
|
-
return event.data.agentName as string;
|
|
982
|
-
case 'command:start':
|
|
983
|
-
case 'command:complete':
|
|
984
|
-
case 'command:error':
|
|
985
|
-
return event.data.command as string;
|
|
986
|
-
case 'story:status-change':
|
|
987
|
-
return `${event.data.storyId}: ${event.data.oldStatus} → ${event.data.newStatus}`;
|
|
988
|
-
default:
|
|
989
|
-
return null;
|
|
990
|
-
}
|
|
991
|
-
};
|
|
992
|
-
|
|
993
|
-
const detail = getEventDetail();
|
|
994
|
-
const timeAgo = formatDistanceToNow(new Date(event.timestamp), {
|
|
995
|
-
addSuffix: true,
|
|
996
|
-
locale: es,
|
|
997
|
-
});
|
|
998
|
-
|
|
999
|
-
return (
|
|
1000
|
-
<div
|
|
1001
|
-
key={event.id}
|
|
1002
|
-
className="flex items-center gap-2 px-2 py-1.5 rounded hover:bg-surface-hover transition-colors text-xs"
|
|
1003
|
-
>
|
|
1004
|
-
<Icon className={cn('w-3.5 h-3.5 flex-shrink-0', config.color)} />
|
|
1005
|
-
<span className="text-secondary truncate flex-1">
|
|
1006
|
-
{config.label}
|
|
1007
|
-
{detail && (
|
|
1008
|
-
<span className="text-muted ml-1 font-mono">{detail}</span>
|
|
1009
|
-
)}
|
|
1010
|
-
</span>
|
|
1011
|
-
<span className="text-muted text-[10px] flex-shrink-0">{timeAgo}</span>
|
|
1012
|
-
</div>
|
|
1013
|
-
);
|
|
1014
|
-
})}
|
|
1015
|
-
</div>
|
|
1016
|
-
);
|
|
1017
|
-
}
|
|
1018
|
-
```
|
|
1019
|
-
|
|
1020
|
-
### SessionIndicator
|
|
1021
|
-
|
|
1022
|
-
```typescript
|
|
1023
|
-
// apps/dashboard/src/components/realtime/SessionIndicator.tsx
|
|
1024
|
-
|
|
1025
|
-
'use client';
|
|
1026
|
-
|
|
1027
|
-
import { useEventsStore, selectSessionInfo } from '@/stores/events-store';
|
|
1028
|
-
import { formatDistanceToNow } from 'date-fns';
|
|
1029
|
-
import { es } from 'date-fns/locale';
|
|
1030
|
-
import { Activity, Clock } from 'lucide-react';
|
|
1031
|
-
|
|
1032
|
-
export function SessionIndicator() {
|
|
1033
|
-
const { sessionId, startedAt } = useEventsStore(selectSessionInfo);
|
|
1034
|
-
|
|
1035
|
-
if (!sessionId) {
|
|
1036
|
-
return (
|
|
1037
|
-
<div className="flex items-center gap-2 text-muted text-xs">
|
|
1038
|
-
<Activity className="w-3.5 h-3.5" />
|
|
1039
|
-
<span>Sin sesión activa</span>
|
|
1040
|
-
</div>
|
|
1041
|
-
);
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
const duration = startedAt
|
|
1045
|
-
? formatDistanceToNow(new Date(startedAt), { locale: es })
|
|
1046
|
-
: '';
|
|
1047
|
-
|
|
1048
|
-
return (
|
|
1049
|
-
<div className="flex items-center gap-3 text-xs">
|
|
1050
|
-
<div className="flex items-center gap-1.5 text-green-400">
|
|
1051
|
-
<Activity className="w-3.5 h-3.5" />
|
|
1052
|
-
<span>Sesión activa</span>
|
|
1053
|
-
</div>
|
|
1054
|
-
{duration && (
|
|
1055
|
-
<div className="flex items-center gap-1 text-muted">
|
|
1056
|
-
<Clock className="w-3 h-3" />
|
|
1057
|
-
<span>{duration}</span>
|
|
1058
|
-
</div>
|
|
1059
|
-
)}
|
|
1060
|
-
</div>
|
|
1061
|
-
);
|
|
1062
|
-
}
|
|
1063
|
-
```
|
|
1064
|
-
|
|
1065
|
-
---
|
|
1066
|
-
|
|
1067
|
-
## Flujo de Datos Completo (Alto Nivel)
|
|
1068
|
-
|
|
1069
|
-
```
|
|
1070
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1071
|
-
│ FLUJO DE DATOS COMPLETO (SOLO ALTO NIVEL) │
|
|
1072
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
1073
|
-
|
|
1074
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1075
|
-
│ 1. ACCIÓN DEL USUARIO EN CLI │
|
|
1076
|
-
│ │
|
|
1077
|
-
│ $ claude │
|
|
1078
|
-
│ > @architect ← agent:activated │
|
|
1079
|
-
│ 🏛️ Aria (Visionaria) lista │
|
|
1080
|
-
│ > *create-architecture ← command:start │
|
|
1081
|
-
│ [Claude working...] │
|
|
1082
|
-
│ ✓ Architecture created ← command:complete │
|
|
1083
|
-
│ > *exit ← agent:deactivated │
|
|
1084
|
-
│ │
|
|
1085
|
-
└─────────────────────┬───────────────────────────────────────────────────────┘
|
|
1086
|
-
│
|
|
1087
|
-
│ Hooks de Claude Code (Decisión #1)
|
|
1088
|
-
▼
|
|
1089
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1090
|
-
│ 2. EVENTOS ESCRITOS EN EL SISTEMA DE ARCHIVOS │
|
|
1091
|
-
│ │
|
|
1092
|
-
│ .sinapse/dashboard/events.jsonl (SOLO ALTO NIVEL) │
|
|
1093
|
-
│ ───────────────────────────────────────────────── │
|
|
1094
|
-
│ {"type":"session:start","data":{"sessionId":"uuid"},"ts":"..."} │
|
|
1095
|
-
│ {"type":"agent:activated","data":{"agentId":"architect"},"ts":"..."} │
|
|
1096
|
-
│ {"type":"command:start","data":{"command":"*create-architecture"},"ts":""}│
|
|
1097
|
-
│ {"type":"command:complete","data":{"success":true},"ts":"..."} │
|
|
1098
|
-
│ {"type":"agent:deactivated","data":{"agentId":"architect"},"ts":"..."} │
|
|
1099
|
-
│ │
|
|
1100
|
-
└─────────────────────┬───────────────────────────────────────────────────────┘
|
|
1101
|
-
│
|
|
1102
|
-
│ Observador de archivo
|
|
1103
|
-
▼
|
|
1104
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1105
|
-
│ 3. ENDPOINT SSE TRANSMITE EVENTOS │
|
|
1106
|
-
│ │
|
|
1107
|
-
│ /api/events (Server-Sent Events) │
|
|
1108
|
-
│ ──────────────────────────────── │
|
|
1109
|
-
│ │
|
|
1110
|
-
│ Salida SSE (solo eventos de alto nivel): │
|
|
1111
|
-
│ data: {"type":"event:new","data":{"type":"agent:activated",...}} │
|
|
1112
|
-
│ data: {"type":"event:new","data":{"type":"command:start",...}} │
|
|
1113
|
-
│ data: {"type":"event:new","data":{"type":"command:complete",...}} │
|
|
1114
|
-
│ │
|
|
1115
|
-
└─────────────────────┬───────────────────────────────────────────────────────┘
|
|
1116
|
-
│
|
|
1117
|
-
│ EventSource
|
|
1118
|
-
▼
|
|
1119
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1120
|
-
│ 4. ALMACENES ACTUALIZAN ESTADO │
|
|
1121
|
-
│ │
|
|
1122
|
-
│ events-store (simplificado) │
|
|
1123
|
-
│ ───────────────────────────────────── │
|
|
1124
|
-
│ { │
|
|
1125
|
-
│ sessionId: "uuid", │
|
|
1126
|
-
│ currentCommand: { name: '*create-architecture', status: 'complete' }, │
|
|
1127
|
-
│ recentEvents: [agent:activated, command:start, command:complete, ...] │
|
|
1128
|
-
│ } │
|
|
1129
|
-
│ │
|
|
1130
|
-
└─────────────────────┬───────────────────────────────────────────────────────┘
|
|
1131
|
-
│
|
|
1132
|
-
│ Re-renderizado de React
|
|
1133
|
-
▼
|
|
1134
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
1135
|
-
│ 5. COMPONENTES UI SE ACTUALIZAN │
|
|
1136
|
-
│ │
|
|
1137
|
-
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
1138
|
-
│ │ Dashboard UI │ │
|
|
1139
|
-
│ │ │ │
|
|
1140
|
-
│ │ ┌─────────────────────────────┐ ┌─────────────────────────────┐ │ │
|
|
1141
|
-
│ │ │ CommandPanel │ │ ActivityFeed │ │ │
|
|
1142
|
-
│ │ │ ───────────────────────── │ │ ───────────────────────── │ │ │
|
|
1143
|
-
│ │ │ │ │ │ │ │
|
|
1144
|
-
│ │ │ ✓ *create-architecture │ │ 14:32 Comando OK │ │ │
|
|
1145
|
-
│ │ │ Completado │ │ 14:30 Comando iniciado │ │ │
|
|
1146
|
-
│ │ │ │ │ 14:29 Agent activado Aria │ │ │
|
|
1147
|
-
│ │ │ │ │ 14:28 Sesión iniciada │ │ │
|
|
1148
|
-
│ │ └─────────────────────────────┘ └─────────────────────────────┘ │ │
|
|
1149
|
-
│ │ │ │
|
|
1150
|
-
│ │ ┌─────────────────────────────────────────────────────────────┐ │ │
|
|
1151
|
-
│ │ │ StatusBar │ │ │
|
|
1152
|
-
│ │ │ ● Conectado │ Sesión activa (5 min) │ @architect (Aria) │ │ │
|
|
1153
|
-
│ │ └─────────────────────────────────────────────────────────────┘ │ │
|
|
1154
|
-
│ │ │ │
|
|
1155
|
-
│ └───────────────────────────────────────────────────────────────────────┘ │
|
|
1156
|
-
│ │
|
|
1157
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
1158
|
-
```
|
|
1159
|
-
|
|
1160
|
-
---
|
|
1161
|
-
|
|
1162
|
-
## Implementación por Fases (Simplificada)
|
|
1163
|
-
|
|
1164
|
-
### Fase 1: Fundación (P0)
|
|
1165
|
-
|
|
1166
|
-
| Elemento | Descripción | Esfuerzo |
|
|
1167
|
-
| ----------------------------- | ------------------------------ | ------- |
|
|
1168
|
-
| Integración de Hooks de Claude Code | Conectar a hooks nativos | 2h |
|
|
1169
|
-
| events.jsonl | Formato de alto nivel | 1h |
|
|
1170
|
-
| SSE Mejorado | Watch events.jsonl | 2h |
|
|
1171
|
-
| events-store | Almacén simplificado | 1h |
|
|
1172
|
-
|
|
1173
|
-
**Entregable:** Los eventos de alto nivel fluyen de la CLI al Dashboard
|
|
1174
|
-
|
|
1175
|
-
### Fase 2: UI Core (P1)
|
|
1176
|
-
|
|
1177
|
-
| Elemento | Descripción | Esfuerzo |
|
|
1178
|
-
| --------------------- | ------------------------------ | ------- |
|
|
1179
|
-
| CommandPanel | Comando actual + estado | 1h |
|
|
1180
|
-
| ActivityFeed | Timeline simplificada | 1h |
|
|
1181
|
-
| SessionIndicator | Estado de la sesión | 30min |
|
|
1182
|
-
| StatusBar integration | Integrar nuevos indicadores | 1h |
|
|
1183
|
-
|
|
1184
|
-
**Entregable:** El Dashboard muestra actividad de alto nivel en tiempo real
|
|
1185
|
-
|
|
1186
|
-
### Fase 3: Configuración (P2)
|
|
1187
|
-
|
|
1188
|
-
| Elemento | Descripción | Esfuerzo |
|
|
1189
|
-
| ---------------------- | -------------------------------------- | ------- |
|
|
1190
|
-
| RetentionSettings UI | Toggle session/hours/persistent | 1h |
|
|
1191
|
-
| Settings integration | Persistencia de preferencias | 1h |
|
|
1192
|
-
| localStorage/IndexedDB | Implementar modos de retención | 2h |
|
|
1193
|
-
|
|
1194
|
-
**Entregable:** Retención de eventos configurable por el usuario
|
|
1195
|
-
|
|
1196
|
-
---
|
|
1197
|
-
|
|
1198
|
-
## Decisiones Tomadas
|
|
1199
|
-
|
|
1200
|
-
### 1. Fuente de Eventos ✅
|
|
1201
|
-
|
|
1202
|
-
**Decisión:** Hooks de Claude Code
|
|
1203
|
-
|
|
1204
|
-
| Aspecto | Detalle |
|
|
1205
|
-
| ------------- | ------------------------------------------ |
|
|
1206
|
-
| Implementación | Usar hooks nativos de Claude Code |
|
|
1207
|
-
| Ventaja | Automático, completo, sin wrapper adicional |
|
|
1208
|
-
| Dependencia | API de hooks de Claude Code |
|
|
1209
|
-
|
|
1210
|
-
### 2. Nivel de Detalle ✅
|
|
1211
|
-
|
|
1212
|
-
**Decisión:** Solo alto nivel
|
|
1213
|
-
|
|
1214
|
-
| Eventos Incluidos | Eventos Excluidos |
|
|
1215
|
-
| ------------------------------ | ----------------------------- |
|
|
1216
|
-
| `agent:activated/deactivated` | `tool:call` (Read/Write/Bash) |
|
|
1217
|
-
| `command:start/complete/error` | `file:read/write/create` |
|
|
1218
|
-
| `session:start/end` | `llm:thinking/responding` |
|
|
1219
|
-
| `story:status-change` | Output streaming |
|
|
1220
|
-
|
|
1221
|
-
**Justificación:** Enfoque en monitoreo, no debug. Menor volumen de datos, mejor rendimiento.
|
|
1222
|
-
|
|
1223
|
-
### 3. Retención de Eventos ✅
|
|
1224
|
-
|
|
1225
|
-
**Decisión:** Configurable por el usuario
|
|
1226
|
-
|
|
1227
|
-
```typescript
|
|
1228
|
-
// settings-store.ts
|
|
1229
|
-
interface EventRetentionSettings {
|
|
1230
|
-
mode: 'session' | 'hours' | 'persistent';
|
|
1231
|
-
hoursToKeep?: number; // cuando mode = 'hours'
|
|
1232
|
-
maxEvents?: number; // límite máximo en cualquier modo
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
// Valores por defecto
|
|
1236
|
-
const DEFAULT_RETENTION: EventRetentionSettings = {
|
|
1237
|
-
mode: 'session',
|
|
1238
|
-
hoursToKeep: 24,
|
|
1239
|
-
maxEvents: 1000,
|
|
1240
|
-
};
|
|
1241
|
-
```
|
|
1242
|
-
|
|
1243
|
-
| Modo | Comportamiento | Almacenamiento |
|
|
1244
|
-
| ------------ | ------------------------- | -------------- |
|
|
1245
|
-
| `session` | Limpia al cerrar dashboard | Memoria |
|
|
1246
|
-
| `hours` | Mantiene últimas N horas | localStorage |
|
|
1247
|
-
| `persistent` | Mantiene hasta límite | IndexedDB |
|
|
1248
|
-
|
|
1249
|
-
**UI:** Toggle en Settings → Events → Retention
|
|
1250
|
-
|
|
1251
|
-
---
|
|
1252
|
-
|
|
1253
|
-
_Documentación generada por @architect (Aria) - SINAPSE Core v2.0_
|