@josstei/maestro 1.6.4-rc.1
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/.agents/plugins/marketplace.json +20 -0
- package/CHANGELOG.md +485 -0
- package/EXAMPLES.md +255 -0
- package/GEMINI.md +231 -0
- package/LICENSE +201 -0
- package/QWEN.md +241 -0
- package/README.md +220 -0
- package/agents/accessibility_specialist.md +20 -0
- package/agents/analytics_engineer.md +22 -0
- package/agents/api_designer.md +19 -0
- package/agents/architect.md +19 -0
- package/agents/cloud_architect.md +19 -0
- package/agents/cobol_engineer.md +22 -0
- package/agents/code_reviewer.md +17 -0
- package/agents/coder.md +22 -0
- package/agents/compliance_reviewer.md +19 -0
- package/agents/content_strategist.md +19 -0
- package/agents/copywriter.md +19 -0
- package/agents/data_engineer.md +22 -0
- package/agents/database_administrator.md +21 -0
- package/agents/db2_dba.md +21 -0
- package/agents/debugger.md +19 -0
- package/agents/design_system_engineer.md +22 -0
- package/agents/devops_engineer.md +23 -0
- package/agents/hlasm_assembler_specialist.md +22 -0
- package/agents/i18n_specialist.md +21 -0
- package/agents/ibm_i_specialist.md +22 -0
- package/agents/integration_engineer.md +23 -0
- package/agents/ml_engineer.md +23 -0
- package/agents/mlops_engineer.md +23 -0
- package/agents/mobile_engineer.md +23 -0
- package/agents/observability_engineer.md +23 -0
- package/agents/performance_engineer.md +21 -0
- package/agents/platform_engineer.md +24 -0
- package/agents/product_manager.md +20 -0
- package/agents/prompt_engineer.md +22 -0
- package/agents/refactor.md +22 -0
- package/agents/release_manager.md +22 -0
- package/agents/security_engineer.md +21 -0
- package/agents/seo_specialist.md +21 -0
- package/agents/site_reliability_engineer.md +21 -0
- package/agents/solutions_architect.md +19 -0
- package/agents/technical_writer.md +21 -0
- package/agents/tester.md +23 -0
- package/agents/ux_designer.md +20 -0
- package/agents/zos_sysprog.md +21 -0
- package/bin/maestro-mcp-server.js +10 -0
- package/claude/.claude-plugin/plugin.json +21 -0
- package/claude/.mcp.json +11 -0
- package/claude/README.md +191 -0
- package/claude/agents/accessibility-specialist.md +36 -0
- package/claude/agents/analytics-engineer.md +38 -0
- package/claude/agents/api-designer.md +33 -0
- package/claude/agents/architect.md +33 -0
- package/claude/agents/cloud-architect.md +33 -0
- package/claude/agents/cobol-engineer.md +38 -0
- package/claude/agents/code-reviewer.md +31 -0
- package/claude/agents/coder.md +38 -0
- package/claude/agents/compliance-reviewer.md +33 -0
- package/claude/agents/content-strategist.md +33 -0
- package/claude/agents/copywriter.md +33 -0
- package/claude/agents/data-engineer.md +37 -0
- package/claude/agents/database-administrator.md +37 -0
- package/claude/agents/db2-dba.md +37 -0
- package/claude/agents/debugger.md +32 -0
- package/claude/agents/design-system-engineer.md +38 -0
- package/claude/agents/devops-engineer.md +39 -0
- package/claude/agents/hlasm-assembler-specialist.md +38 -0
- package/claude/agents/i18n-specialist.md +37 -0
- package/claude/agents/ibm-i-specialist.md +38 -0
- package/claude/agents/integration-engineer.md +39 -0
- package/claude/agents/ml-engineer.md +39 -0
- package/claude/agents/mlops-engineer.md +39 -0
- package/claude/agents/mobile-engineer.md +39 -0
- package/claude/agents/observability-engineer.md +39 -0
- package/claude/agents/performance-engineer.md +34 -0
- package/claude/agents/platform-engineer.md +40 -0
- package/claude/agents/product-manager.md +34 -0
- package/claude/agents/prompt-engineer.md +38 -0
- package/claude/agents/refactor.md +38 -0
- package/claude/agents/release-manager.md +38 -0
- package/claude/agents/security-engineer.md +37 -0
- package/claude/agents/seo-specialist.md +37 -0
- package/claude/agents/site-reliability-engineer.md +37 -0
- package/claude/agents/solutions-architect.md +33 -0
- package/claude/agents/technical-writer.md +37 -0
- package/claude/agents/tester.md +39 -0
- package/claude/agents/ux-designer.md +34 -0
- package/claude/agents/zos-sysprog.md +37 -0
- package/claude/hooks/claude-hooks.json +48 -0
- package/claude/mcp/maestro-server.js +9 -0
- package/claude/mcp-config.example.json +9 -0
- package/claude/scripts/adapters/claude-adapter.js +7 -0
- package/claude/scripts/hook-runner.js +8 -0
- package/claude/scripts/policy-enforcer.js +294 -0
- package/claude/skills/a11y-audit/SKILL.md +26 -0
- package/claude/skills/archive/SKILL.md +24 -0
- package/claude/skills/code-review/SKILL.md +7 -0
- package/claude/skills/compliance-check/SKILL.md +26 -0
- package/claude/skills/debug-workflow/SKILL.md +27 -0
- package/claude/skills/delegation/SKILL.md +7 -0
- package/claude/skills/design-dialogue/SKILL.md +7 -0
- package/claude/skills/execute/SKILL.md +38 -0
- package/claude/skills/execution/SKILL.md +7 -0
- package/claude/skills/implementation-planning/SKILL.md +7 -0
- package/claude/skills/orchestrate/SKILL.md +38 -0
- package/claude/skills/perf-check/SKILL.md +26 -0
- package/claude/skills/resume-session/SKILL.md +38 -0
- package/claude/skills/review-code/SKILL.md +27 -0
- package/claude/skills/security-audit/SKILL.md +28 -0
- package/claude/skills/seo-audit/SKILL.md +26 -0
- package/claude/skills/session-management/SKILL.md +7 -0
- package/claude/skills/status/SKILL.md +22 -0
- package/claude/skills/validation/SKILL.md +7 -0
- package/claude/src/agents/accessibility-specialist.md +163 -0
- package/claude/src/agents/analytics-engineer.md +182 -0
- package/claude/src/agents/api-designer.md +124 -0
- package/claude/src/agents/architect.md +120 -0
- package/claude/src/agents/cloud-architect.md +134 -0
- package/claude/src/agents/cobol-engineer.md +127 -0
- package/claude/src/agents/code-reviewer.md +123 -0
- package/claude/src/agents/coder.md +132 -0
- package/claude/src/agents/compliance-reviewer.md +219 -0
- package/claude/src/agents/content-strategist.md +111 -0
- package/claude/src/agents/copywriter.md +113 -0
- package/claude/src/agents/data-engineer.md +130 -0
- package/claude/src/agents/database-administrator.md +126 -0
- package/claude/src/agents/db2-dba.md +124 -0
- package/claude/src/agents/debugger.md +133 -0
- package/claude/src/agents/design-system-engineer.md +258 -0
- package/claude/src/agents/devops-engineer.md +138 -0
- package/claude/src/agents/hlasm-assembler-specialist.md +134 -0
- package/claude/src/agents/i18n-specialist.md +241 -0
- package/claude/src/agents/ibm-i-specialist.md +132 -0
- package/claude/src/agents/integration-engineer.md +133 -0
- package/claude/src/agents/ml-engineer.md +115 -0
- package/claude/src/agents/mlops-engineer.md +116 -0
- package/claude/src/agents/mobile-engineer.md +115 -0
- package/claude/src/agents/observability-engineer.md +133 -0
- package/claude/src/agents/performance-engineer.md +139 -0
- package/claude/src/agents/platform-engineer.md +129 -0
- package/claude/src/agents/product-manager.md +170 -0
- package/claude/src/agents/prompt-engineer.md +129 -0
- package/claude/src/agents/refactor.md +138 -0
- package/claude/src/agents/release-manager.md +132 -0
- package/claude/src/agents/security-engineer.md +143 -0
- package/claude/src/agents/seo-specialist.md +129 -0
- package/claude/src/agents/site-reliability-engineer.md +131 -0
- package/claude/src/agents/solutions-architect.md +137 -0
- package/claude/src/agents/technical-writer.md +129 -0
- package/claude/src/agents/tester.md +135 -0
- package/claude/src/agents/ux-designer.md +168 -0
- package/claude/src/agents/zos-sysprog.md +134 -0
- package/claude/src/config/setting-resolver.js +32 -0
- package/claude/src/core/agent-registry.js +67 -0
- package/claude/src/core/canonical-source.js +39 -0
- package/claude/src/core/env-file-parser.js +82 -0
- package/claude/src/core/feature-blocks.js +34 -0
- package/claude/src/core/logger.js +12 -0
- package/claude/src/core/markdown-state.js +36 -0
- package/claude/src/core/policy-rules.js +32 -0
- package/claude/src/core/project-root-resolver.js +184 -0
- package/claude/src/core/stdin-reader.js +77 -0
- package/claude/src/core/version.js +50 -0
- package/claude/src/entry-points/core-command-registry.js +37 -0
- package/claude/src/entry-points/preamble-builders.js +54 -0
- package/claude/src/entry-points/registry.js +199 -0
- package/claude/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/claude/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/claude/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/claude/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/claude/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/claude/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/claude/src/generated/agent-registry.json +630 -0
- package/claude/src/generated/hook-registry.json +18 -0
- package/claude/src/generated/resource-registry.json +16 -0
- package/claude/src/hooks/logic/after-agent-logic.js +54 -0
- package/claude/src/hooks/logic/before-agent-logic.js +57 -0
- package/claude/src/hooks/logic/hook-state.js +127 -0
- package/claude/src/hooks/logic/session-end-logic.js +17 -0
- package/claude/src/hooks/logic/session-start-logic.js +25 -0
- package/claude/src/lib/discovery/index.js +172 -0
- package/claude/src/lib/errors/index.js +104 -0
- package/claude/src/lib/framework-detection.js +50 -0
- package/claude/src/lib/frontmatter/index.js +262 -0
- package/claude/src/lib/io/index.js +96 -0
- package/claude/src/lib/naming/index.js +94 -0
- package/claude/src/lib/validation/index.js +124 -0
- package/claude/src/lib/yaml-emit.js +38 -0
- package/claude/src/mcp/content/provider.js +68 -0
- package/claude/src/mcp/content/runtime-content.js +188 -0
- package/claude/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/claude/src/mcp/contracts/downstream-context.js +106 -0
- package/claude/src/mcp/contracts/plan-schema.js +148 -0
- package/claude/src/mcp/contracts/workspace-marker.js +61 -0
- package/claude/src/mcp/core/create-server.js +76 -0
- package/claude/src/mcp/core/line-reader.js +35 -0
- package/claude/src/mcp/core/project-root-cache.js +120 -0
- package/claude/src/mcp/core/protocol-dispatcher.js +274 -0
- package/claude/src/mcp/core/recovery-hints.js +43 -0
- package/claude/src/mcp/core/tool-outcome.js +77 -0
- package/claude/src/mcp/core/tool-registry.js +82 -0
- package/claude/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/claude/src/mcp/handlers/blocker-parser.js +34 -0
- package/claude/src/mcp/handlers/design-gate.js +393 -0
- package/claude/src/mcp/handlers/get-agent.js +54 -0
- package/claude/src/mcp/handlers/get-runtime-context.js +49 -0
- package/claude/src/mcp/handlers/get-skill-content.js +51 -0
- package/claude/src/mcp/handlers/initialize-workspace.js +45 -0
- package/claude/src/mcp/handlers/reconciliation.js +224 -0
- package/claude/src/mcp/handlers/resolve-settings.js +39 -0
- package/claude/src/mcp/handlers/session-state-core.js +108 -0
- package/claude/src/mcp/handlers/session-state-tools.js +562 -0
- package/claude/src/mcp/handlers/validate-plan.js +76 -0
- package/claude/src/mcp/maestro-server.js +122 -0
- package/claude/src/mcp/runtime/runtime-config-map.js +70 -0
- package/claude/src/mcp/tool-packs/content/index.js +80 -0
- package/claude/src/mcp/tool-packs/contracts.js +30 -0
- package/claude/src/mcp/tool-packs/index.js +15 -0
- package/claude/src/mcp/tool-packs/session/index.js +243 -0
- package/claude/src/mcp/tool-packs/workspace/index.js +98 -0
- package/claude/src/mcp/utils/extension-root.js +31 -0
- package/claude/src/mcp/validation/agent-checker.js +81 -0
- package/claude/src/mcp/validation/dag-checker.js +214 -0
- package/claude/src/mcp/validation/file-overlap-checker.js +63 -0
- package/claude/src/mcp/validation/schema-checker.js +108 -0
- package/claude/src/platforms/claude/runtime-config.js +60 -0
- package/claude/src/platforms/shared/adapters/claude-adapter.js +36 -0
- package/claude/src/platforms/shared/adapters/conventions.js +29 -0
- package/claude/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/claude/src/platforms/shared/adapters/factory.js +40 -0
- package/claude/src/platforms/shared/agent-names.js +10 -0
- package/claude/src/platforms/shared/hook-runner.js +52 -0
- package/claude/src/references/architecture.md +139 -0
- package/claude/src/references/orchestration-steps.md +193 -0
- package/claude/src/skills/shared/code-review/SKILL.md +145 -0
- package/claude/src/skills/shared/delegation/SKILL.md +370 -0
- package/claude/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/claude/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/claude/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/claude/src/skills/shared/execution/SKILL.md +258 -0
- package/claude/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/claude/src/skills/shared/session-management/SKILL.md +314 -0
- package/claude/src/skills/shared/validation/SKILL.md +204 -0
- package/claude/src/state/session-state.js +113 -0
- package/claude/src/templates/design-document.md +95 -0
- package/claude/src/templates/implementation-plan.md +86 -0
- package/claude/src/templates/session-state.md +68 -0
- package/claude/src/version.json +3 -0
- package/commands/maestro/a11y-audit.toml +22 -0
- package/commands/maestro/archive.toml +23 -0
- package/commands/maestro/compliance-check.toml +22 -0
- package/commands/maestro/debug.toml +23 -0
- package/commands/maestro/execute.toml +30 -0
- package/commands/maestro/orchestrate.toml +30 -0
- package/commands/maestro/perf-check.toml +22 -0
- package/commands/maestro/resume.toml +38 -0
- package/commands/maestro/review.toml +23 -0
- package/commands/maestro/security-audit.toml +24 -0
- package/commands/maestro/seo-audit.toml +22 -0
- package/commands/maestro/status.toml +21 -0
- package/docs/architecture.md +310 -0
- package/docs/cicd.md +647 -0
- package/docs/flow.md +255 -0
- package/docs/maestro-cheatsheet.md +199 -0
- package/docs/overview.md +141 -0
- package/docs/runtime-claude.md +190 -0
- package/docs/runtime-codex.md +197 -0
- package/docs/runtime-gemini.md +170 -0
- package/docs/runtime-qwen.md +147 -0
- package/docs/usage.md +312 -0
- package/gemini-extension.json +55 -0
- package/hooks/adapters/gemini-adapter.js +2 -0
- package/hooks/adapters/qwen-adapter.js +2 -0
- package/hooks/hook-runner.js +3 -0
- package/hooks/hooks.json +56 -0
- package/mcp/maestro-server.js +4 -0
- package/package.json +93 -0
- package/plugins/maestro/.app.json +3 -0
- package/plugins/maestro/.codex-plugin/plugin.json +41 -0
- package/plugins/maestro/.mcp.json +16 -0
- package/plugins/maestro/README.md +57 -0
- package/plugins/maestro/references/runtime-guide.md +125 -0
- package/plugins/maestro/skills/a11y-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/archive/SKILL.md +16 -0
- package/plugins/maestro/skills/code-review/SKILL.md +6 -0
- package/plugins/maestro/skills/compliance-check/SKILL.md +16 -0
- package/plugins/maestro/skills/debug-workflow/SKILL.md +16 -0
- package/plugins/maestro/skills/delegation/SKILL.md +6 -0
- package/plugins/maestro/skills/design-dialogue/SKILL.md +6 -0
- package/plugins/maestro/skills/execute/SKILL.md +16 -0
- package/plugins/maestro/skills/execution/SKILL.md +6 -0
- package/plugins/maestro/skills/implementation-planning/SKILL.md +6 -0
- package/plugins/maestro/skills/orchestrate/SKILL.md +16 -0
- package/plugins/maestro/skills/perf-check/SKILL.md +16 -0
- package/plugins/maestro/skills/resume-session/SKILL.md +16 -0
- package/plugins/maestro/skills/review-code/SKILL.md +16 -0
- package/plugins/maestro/skills/security-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/seo-audit/SKILL.md +16 -0
- package/plugins/maestro/skills/session-management/SKILL.md +6 -0
- package/plugins/maestro/skills/status/SKILL.md +14 -0
- package/plugins/maestro/skills/validation/SKILL.md +6 -0
- package/plugins/maestro/src/agents/accessibility-specialist.md +163 -0
- package/plugins/maestro/src/agents/analytics-engineer.md +182 -0
- package/plugins/maestro/src/agents/api-designer.md +124 -0
- package/plugins/maestro/src/agents/architect.md +120 -0
- package/plugins/maestro/src/agents/cloud-architect.md +134 -0
- package/plugins/maestro/src/agents/cobol-engineer.md +127 -0
- package/plugins/maestro/src/agents/code-reviewer.md +123 -0
- package/plugins/maestro/src/agents/coder.md +132 -0
- package/plugins/maestro/src/agents/compliance-reviewer.md +219 -0
- package/plugins/maestro/src/agents/content-strategist.md +111 -0
- package/plugins/maestro/src/agents/copywriter.md +113 -0
- package/plugins/maestro/src/agents/data-engineer.md +130 -0
- package/plugins/maestro/src/agents/database-administrator.md +126 -0
- package/plugins/maestro/src/agents/db2-dba.md +124 -0
- package/plugins/maestro/src/agents/debugger.md +133 -0
- package/plugins/maestro/src/agents/design-system-engineer.md +258 -0
- package/plugins/maestro/src/agents/devops-engineer.md +138 -0
- package/plugins/maestro/src/agents/hlasm-assembler-specialist.md +134 -0
- package/plugins/maestro/src/agents/i18n-specialist.md +241 -0
- package/plugins/maestro/src/agents/ibm-i-specialist.md +132 -0
- package/plugins/maestro/src/agents/integration-engineer.md +133 -0
- package/plugins/maestro/src/agents/ml-engineer.md +115 -0
- package/plugins/maestro/src/agents/mlops-engineer.md +116 -0
- package/plugins/maestro/src/agents/mobile-engineer.md +115 -0
- package/plugins/maestro/src/agents/observability-engineer.md +133 -0
- package/plugins/maestro/src/agents/performance-engineer.md +139 -0
- package/plugins/maestro/src/agents/platform-engineer.md +129 -0
- package/plugins/maestro/src/agents/product-manager.md +170 -0
- package/plugins/maestro/src/agents/prompt-engineer.md +129 -0
- package/plugins/maestro/src/agents/refactor.md +138 -0
- package/plugins/maestro/src/agents/release-manager.md +132 -0
- package/plugins/maestro/src/agents/security-engineer.md +143 -0
- package/plugins/maestro/src/agents/seo-specialist.md +129 -0
- package/plugins/maestro/src/agents/site-reliability-engineer.md +131 -0
- package/plugins/maestro/src/agents/solutions-architect.md +137 -0
- package/plugins/maestro/src/agents/technical-writer.md +129 -0
- package/plugins/maestro/src/agents/tester.md +135 -0
- package/plugins/maestro/src/agents/ux-designer.md +168 -0
- package/plugins/maestro/src/agents/zos-sysprog.md +134 -0
- package/plugins/maestro/src/config/setting-resolver.js +32 -0
- package/plugins/maestro/src/core/agent-registry.js +67 -0
- package/plugins/maestro/src/core/canonical-source.js +39 -0
- package/plugins/maestro/src/core/env-file-parser.js +82 -0
- package/plugins/maestro/src/core/feature-blocks.js +34 -0
- package/plugins/maestro/src/core/logger.js +12 -0
- package/plugins/maestro/src/core/markdown-state.js +36 -0
- package/plugins/maestro/src/core/policy-rules.js +32 -0
- package/plugins/maestro/src/core/project-root-resolver.js +184 -0
- package/plugins/maestro/src/core/stdin-reader.js +77 -0
- package/plugins/maestro/src/core/version.js +50 -0
- package/plugins/maestro/src/entry-points/core-command-registry.js +37 -0
- package/plugins/maestro/src/entry-points/preamble-builders.js +54 -0
- package/plugins/maestro/src/entry-points/registry.js +199 -0
- package/plugins/maestro/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/plugins/maestro/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/plugins/maestro/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/plugins/maestro/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/plugins/maestro/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/plugins/maestro/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/plugins/maestro/src/generated/agent-registry.json +630 -0
- package/plugins/maestro/src/generated/hook-registry.json +18 -0
- package/plugins/maestro/src/generated/resource-registry.json +16 -0
- package/plugins/maestro/src/hooks/logic/after-agent-logic.js +54 -0
- package/plugins/maestro/src/hooks/logic/before-agent-logic.js +57 -0
- package/plugins/maestro/src/hooks/logic/hook-state.js +127 -0
- package/plugins/maestro/src/hooks/logic/session-end-logic.js +17 -0
- package/plugins/maestro/src/hooks/logic/session-start-logic.js +25 -0
- package/plugins/maestro/src/lib/discovery/index.js +172 -0
- package/plugins/maestro/src/lib/errors/index.js +104 -0
- package/plugins/maestro/src/lib/framework-detection.js +50 -0
- package/plugins/maestro/src/lib/frontmatter/index.js +262 -0
- package/plugins/maestro/src/lib/io/index.js +96 -0
- package/plugins/maestro/src/lib/naming/index.js +94 -0
- package/plugins/maestro/src/lib/validation/index.js +124 -0
- package/plugins/maestro/src/lib/yaml-emit.js +38 -0
- package/plugins/maestro/src/mcp/content/provider.js +68 -0
- package/plugins/maestro/src/mcp/content/runtime-content.js +188 -0
- package/plugins/maestro/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/plugins/maestro/src/mcp/contracts/downstream-context.js +106 -0
- package/plugins/maestro/src/mcp/contracts/plan-schema.js +148 -0
- package/plugins/maestro/src/mcp/contracts/workspace-marker.js +61 -0
- package/plugins/maestro/src/mcp/core/create-server.js +76 -0
- package/plugins/maestro/src/mcp/core/line-reader.js +35 -0
- package/plugins/maestro/src/mcp/core/project-root-cache.js +120 -0
- package/plugins/maestro/src/mcp/core/protocol-dispatcher.js +274 -0
- package/plugins/maestro/src/mcp/core/recovery-hints.js +43 -0
- package/plugins/maestro/src/mcp/core/tool-outcome.js +77 -0
- package/plugins/maestro/src/mcp/core/tool-registry.js +82 -0
- package/plugins/maestro/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/plugins/maestro/src/mcp/handlers/blocker-parser.js +34 -0
- package/plugins/maestro/src/mcp/handlers/design-gate.js +393 -0
- package/plugins/maestro/src/mcp/handlers/get-agent.js +54 -0
- package/plugins/maestro/src/mcp/handlers/get-runtime-context.js +49 -0
- package/plugins/maestro/src/mcp/handlers/get-skill-content.js +51 -0
- package/plugins/maestro/src/mcp/handlers/initialize-workspace.js +45 -0
- package/plugins/maestro/src/mcp/handlers/reconciliation.js +224 -0
- package/plugins/maestro/src/mcp/handlers/resolve-settings.js +39 -0
- package/plugins/maestro/src/mcp/handlers/session-state-core.js +108 -0
- package/plugins/maestro/src/mcp/handlers/session-state-tools.js +562 -0
- package/plugins/maestro/src/mcp/handlers/validate-plan.js +76 -0
- package/plugins/maestro/src/mcp/maestro-server.js +122 -0
- package/plugins/maestro/src/mcp/runtime/runtime-config-map.js +70 -0
- package/plugins/maestro/src/mcp/tool-packs/content/index.js +80 -0
- package/plugins/maestro/src/mcp/tool-packs/contracts.js +30 -0
- package/plugins/maestro/src/mcp/tool-packs/index.js +15 -0
- package/plugins/maestro/src/mcp/tool-packs/session/index.js +243 -0
- package/plugins/maestro/src/mcp/tool-packs/workspace/index.js +98 -0
- package/plugins/maestro/src/mcp/utils/extension-root.js +31 -0
- package/plugins/maestro/src/mcp/validation/agent-checker.js +81 -0
- package/plugins/maestro/src/mcp/validation/dag-checker.js +214 -0
- package/plugins/maestro/src/mcp/validation/file-overlap-checker.js +63 -0
- package/plugins/maestro/src/mcp/validation/schema-checker.js +108 -0
- package/plugins/maestro/src/platforms/codex/runtime-config.js +58 -0
- package/plugins/maestro/src/platforms/shared/adapters/conventions.js +29 -0
- package/plugins/maestro/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/plugins/maestro/src/platforms/shared/adapters/factory.js +40 -0
- package/plugins/maestro/src/platforms/shared/agent-names.js +10 -0
- package/plugins/maestro/src/platforms/shared/hook-runner.js +52 -0
- package/plugins/maestro/src/references/architecture.md +139 -0
- package/plugins/maestro/src/references/orchestration-steps.md +193 -0
- package/plugins/maestro/src/skills/shared/code-review/SKILL.md +145 -0
- package/plugins/maestro/src/skills/shared/delegation/SKILL.md +370 -0
- package/plugins/maestro/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/plugins/maestro/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/plugins/maestro/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/plugins/maestro/src/skills/shared/execution/SKILL.md +258 -0
- package/plugins/maestro/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/plugins/maestro/src/skills/shared/session-management/SKILL.md +314 -0
- package/plugins/maestro/src/skills/shared/validation/SKILL.md +204 -0
- package/plugins/maestro/src/state/session-state.js +113 -0
- package/plugins/maestro/src/templates/design-document.md +95 -0
- package/plugins/maestro/src/templates/implementation-plan.md +86 -0
- package/plugins/maestro/src/templates/session-state.md +68 -0
- package/plugins/maestro/src/version.json +3 -0
- package/policies/maestro.toml +44 -0
- package/qwen/agents/accessibility_specialist.md +18 -0
- package/qwen/agents/analytics_engineer.md +20 -0
- package/qwen/agents/api_designer.md +17 -0
- package/qwen/agents/architect.md +17 -0
- package/qwen/agents/cloud_architect.md +17 -0
- package/qwen/agents/cobol_engineer.md +20 -0
- package/qwen/agents/code_reviewer.md +15 -0
- package/qwen/agents/coder.md +20 -0
- package/qwen/agents/compliance_reviewer.md +17 -0
- package/qwen/agents/content_strategist.md +17 -0
- package/qwen/agents/copywriter.md +17 -0
- package/qwen/agents/data_engineer.md +20 -0
- package/qwen/agents/database_administrator.md +19 -0
- package/qwen/agents/db2_dba.md +19 -0
- package/qwen/agents/debugger.md +17 -0
- package/qwen/agents/design_system_engineer.md +20 -0
- package/qwen/agents/devops_engineer.md +21 -0
- package/qwen/agents/hlasm_assembler_specialist.md +20 -0
- package/qwen/agents/i18n_specialist.md +19 -0
- package/qwen/agents/ibm_i_specialist.md +20 -0
- package/qwen/agents/integration_engineer.md +21 -0
- package/qwen/agents/ml_engineer.md +21 -0
- package/qwen/agents/mlops_engineer.md +21 -0
- package/qwen/agents/mobile_engineer.md +21 -0
- package/qwen/agents/observability_engineer.md +21 -0
- package/qwen/agents/performance_engineer.md +19 -0
- package/qwen/agents/platform_engineer.md +22 -0
- package/qwen/agents/product_manager.md +18 -0
- package/qwen/agents/prompt_engineer.md +20 -0
- package/qwen/agents/refactor.md +20 -0
- package/qwen/agents/release_manager.md +20 -0
- package/qwen/agents/security_engineer.md +19 -0
- package/qwen/agents/seo_specialist.md +19 -0
- package/qwen/agents/site_reliability_engineer.md +19 -0
- package/qwen/agents/solutions_architect.md +17 -0
- package/qwen/agents/technical_writer.md +19 -0
- package/qwen/agents/tester.md +21 -0
- package/qwen/agents/ux_designer.md +18 -0
- package/qwen/agents/zos_sysprog.md +19 -0
- package/qwen/hooks.json +56 -0
- package/qwen-extension.json +55 -0
- package/scripts/check-layer-boundaries.js +74 -0
- package/scripts/generate.js +155 -0
- package/scripts/install-codex-plugin.js +167 -0
- package/scripts/install-git-hooks.js +43 -0
- package/scripts/npm-publish-idempotent.js +150 -0
- package/scripts/package-release-artifacts.js +156 -0
- package/scripts/release-artifact-manifest.js +378 -0
- package/scripts/release-version-metadata.js +129 -0
- package/scripts/update-versions.js +33 -0
- package/scripts/verify-npm-pack.js +85 -0
- package/scripts/verify-release-artifacts.js +95 -0
- package/src/agents/accessibility-specialist.md +163 -0
- package/src/agents/analytics-engineer.md +182 -0
- package/src/agents/api-designer.md +124 -0
- package/src/agents/architect.md +120 -0
- package/src/agents/cloud-architect.md +134 -0
- package/src/agents/cobol-engineer.md +127 -0
- package/src/agents/code-reviewer.md +123 -0
- package/src/agents/coder.md +132 -0
- package/src/agents/compliance-reviewer.md +219 -0
- package/src/agents/content-strategist.md +111 -0
- package/src/agents/copywriter.md +113 -0
- package/src/agents/data-engineer.md +130 -0
- package/src/agents/database-administrator.md +126 -0
- package/src/agents/db2-dba.md +124 -0
- package/src/agents/debugger.md +133 -0
- package/src/agents/design-system-engineer.md +258 -0
- package/src/agents/devops-engineer.md +138 -0
- package/src/agents/hlasm-assembler-specialist.md +134 -0
- package/src/agents/i18n-specialist.md +241 -0
- package/src/agents/ibm-i-specialist.md +132 -0
- package/src/agents/integration-engineer.md +133 -0
- package/src/agents/ml-engineer.md +115 -0
- package/src/agents/mlops-engineer.md +116 -0
- package/src/agents/mobile-engineer.md +115 -0
- package/src/agents/observability-engineer.md +133 -0
- package/src/agents/performance-engineer.md +139 -0
- package/src/agents/platform-engineer.md +129 -0
- package/src/agents/product-manager.md +170 -0
- package/src/agents/prompt-engineer.md +129 -0
- package/src/agents/refactor.md +138 -0
- package/src/agents/release-manager.md +132 -0
- package/src/agents/security-engineer.md +143 -0
- package/src/agents/seo-specialist.md +129 -0
- package/src/agents/site-reliability-engineer.md +131 -0
- package/src/agents/solutions-architect.md +137 -0
- package/src/agents/technical-writer.md +129 -0
- package/src/agents/tester.md +135 -0
- package/src/agents/ux-designer.md +168 -0
- package/src/agents/zos-sysprog.md +134 -0
- package/src/config/setting-resolver.js +32 -0
- package/src/core/agent-registry.js +67 -0
- package/src/core/canonical-source.js +39 -0
- package/src/core/env-file-parser.js +82 -0
- package/src/core/feature-blocks.js +34 -0
- package/src/core/logger.js +12 -0
- package/src/core/markdown-state.js +36 -0
- package/src/core/policy-rules.js +32 -0
- package/src/core/project-root-resolver.js +184 -0
- package/src/core/stdin-reader.js +77 -0
- package/src/core/version.js +50 -0
- package/src/entry-points/core-command-registry.js +37 -0
- package/src/entry-points/preamble-builders.js +54 -0
- package/src/entry-points/registry.js +199 -0
- package/src/entry-points/templates/claude-core-command.md.tmpl +38 -0
- package/src/entry-points/templates/claude-skill.md.tmpl +18 -0
- package/src/entry-points/templates/codex-core-command.md.tmpl +16 -0
- package/src/entry-points/templates/codex-skill.md.tmpl +11 -0
- package/src/entry-points/templates/gemini-command.toml.tmpl +17 -0
- package/src/entry-points/templates/gemini-core-command.toml.tmpl +30 -0
- package/src/generated/agent-registry.json +630 -0
- package/src/generated/hook-registry.json +18 -0
- package/src/generated/resource-registry.json +16 -0
- package/src/generator/entry-point-expander.js +182 -0
- package/src/generator/file-writer.js +167 -0
- package/src/generator/generation-session.js +62 -0
- package/src/generator/manifest-curator.js +31 -0
- package/src/generator/manifest-expander.js +256 -0
- package/src/generator/payload-builder.js +217 -0
- package/src/generator/registry-scanner.js +130 -0
- package/src/generator/stale-pruner.js +101 -0
- package/src/hooks/logic/after-agent-logic.js +54 -0
- package/src/hooks/logic/before-agent-logic.js +57 -0
- package/src/hooks/logic/hook-state.js +127 -0
- package/src/hooks/logic/session-end-logic.js +17 -0
- package/src/hooks/logic/session-start-logic.js +25 -0
- package/src/lib/discovery/index.js +172 -0
- package/src/lib/errors/index.js +104 -0
- package/src/lib/framework-detection.js +50 -0
- package/src/lib/frontmatter/index.js +262 -0
- package/src/lib/io/index.js +96 -0
- package/src/lib/naming/index.js +94 -0
- package/src/lib/validation/index.js +124 -0
- package/src/lib/yaml-emit.js +38 -0
- package/src/manifest.js +11 -0
- package/src/mcp/content/provider.js +68 -0
- package/src/mcp/content/runtime-content.js +188 -0
- package/src/mcp/contracts/cache-path-rejector.js +39 -0
- package/src/mcp/contracts/downstream-context.js +106 -0
- package/src/mcp/contracts/plan-schema.js +148 -0
- package/src/mcp/contracts/workspace-marker.js +61 -0
- package/src/mcp/core/create-server.js +76 -0
- package/src/mcp/core/line-reader.js +35 -0
- package/src/mcp/core/project-root-cache.js +120 -0
- package/src/mcp/core/protocol-dispatcher.js +274 -0
- package/src/mcp/core/recovery-hints.js +43 -0
- package/src/mcp/core/tool-outcome.js +77 -0
- package/src/mcp/core/tool-registry.js +82 -0
- package/src/mcp/handlers/assess-task-complexity.js +108 -0
- package/src/mcp/handlers/blocker-parser.js +34 -0
- package/src/mcp/handlers/design-gate.js +393 -0
- package/src/mcp/handlers/get-agent.js +54 -0
- package/src/mcp/handlers/get-runtime-context.js +49 -0
- package/src/mcp/handlers/get-skill-content.js +51 -0
- package/src/mcp/handlers/initialize-workspace.js +45 -0
- package/src/mcp/handlers/reconciliation.js +224 -0
- package/src/mcp/handlers/resolve-settings.js +39 -0
- package/src/mcp/handlers/session-state-core.js +108 -0
- package/src/mcp/handlers/session-state-tools.js +562 -0
- package/src/mcp/handlers/validate-plan.js +76 -0
- package/src/mcp/maestro-server.js +122 -0
- package/src/mcp/runtime/runtime-config-map.js +70 -0
- package/src/mcp/tool-packs/content/index.js +80 -0
- package/src/mcp/tool-packs/contracts.js +30 -0
- package/src/mcp/tool-packs/index.js +15 -0
- package/src/mcp/tool-packs/session/index.js +243 -0
- package/src/mcp/tool-packs/workspace/index.js +98 -0
- package/src/mcp/utils/extension-root.js +31 -0
- package/src/mcp/validation/agent-checker.js +81 -0
- package/src/mcp/validation/dag-checker.js +214 -0
- package/src/mcp/validation/file-overlap-checker.js +63 -0
- package/src/mcp/validation/schema-checker.js +108 -0
- package/src/platforms/claude/metadata.js +96 -0
- package/src/platforms/claude/runtime-config.js +60 -0
- package/src/platforms/codex/metadata.js +107 -0
- package/src/platforms/codex/runtime-config.js +58 -0
- package/src/platforms/gemini/metadata.js +27 -0
- package/src/platforms/gemini/runtime-config.js +62 -0
- package/src/platforms/metadata-shared.js +131 -0
- package/src/platforms/metadata.js +29 -0
- package/src/platforms/qwen/metadata.js +27 -0
- package/src/platforms/qwen/runtime-config.js +62 -0
- package/src/platforms/shared/adapters/claude-adapter.js +36 -0
- package/src/platforms/shared/adapters/conventions.js +29 -0
- package/src/platforms/shared/adapters/exit-codes.js +6 -0
- package/src/platforms/shared/adapters/factory.js +40 -0
- package/src/platforms/shared/adapters/gemini-adapter.js +34 -0
- package/src/platforms/shared/adapters/qwen-adapter.js +93 -0
- package/src/platforms/shared/agent-names.js +10 -0
- package/src/platforms/shared/hook-runner.js +52 -0
- package/src/references/architecture.md +139 -0
- package/src/references/orchestration-steps.md +193 -0
- package/src/scripts/ensure-workspace.js +14 -0
- package/src/scripts/read-active-session.js +26 -0
- package/src/scripts/read-setting.js +18 -0
- package/src/scripts/read-state.js +17 -0
- package/src/scripts/write-state.js +22 -0
- package/src/skills/shared/code-review/SKILL.md +145 -0
- package/src/skills/shared/delegation/SKILL.md +370 -0
- package/src/skills/shared/delegation/protocols/agent-base-protocol.md +145 -0
- package/src/skills/shared/delegation/protocols/filesystem-safety-protocol.md +31 -0
- package/src/skills/shared/design-dialogue/SKILL.md +284 -0
- package/src/skills/shared/execution/SKILL.md +258 -0
- package/src/skills/shared/implementation-planning/SKILL.md +303 -0
- package/src/skills/shared/session-management/SKILL.md +314 -0
- package/src/skills/shared/validation/SKILL.md +204 -0
- package/src/state/session-state.js +113 -0
- package/src/templates/design-document.md +95 -0
- package/src/templates/implementation-plan.md +86 -0
- package/src/templates/session-state.md +68 -0
- package/src/transforms/agent-stub.js +29 -0
- package/src/transforms/extract-examples.js +63 -0
- package/src/transforms/index.js +35 -0
- package/src/transforms/parse-frontmatter.js +23 -0
- package/src/transforms/rebuild-frontmatter.js +147 -0
- package/src/transforms/skill-discovery-stub.js +27 -0
- package/src/transforms/skill-metadata.js +14 -0
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const { assertSessionId } = require('../../lib/validation');
|
|
7
|
+
const { ValidationError } = require('../../lib/errors');
|
|
8
|
+
const { resolveStateDirPath } = require('../../state/session-state');
|
|
9
|
+
const { atomicWriteSync } = require('../../lib/io');
|
|
10
|
+
|
|
11
|
+
const GATE_FILENAME = '.design-gate.json';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the filesystem path for the gate file for a given session.
|
|
15
|
+
* @param {string} projectRoot
|
|
16
|
+
* @param {string} sessionId
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
function gatePath(projectRoot, sessionId) {
|
|
20
|
+
const stateDir = resolveStateDirPath(projectRoot);
|
|
21
|
+
return path.join(stateDir, 'state', `${sessionId}${GATE_FILENAME}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Canonical location where approved design documents live. Runtimes (including
|
|
26
|
+
* Plan Mode) may write design docs to arbitrary temporary locations; this
|
|
27
|
+
* function is the single source of truth for the post-approval location so the
|
|
28
|
+
* archive flow can reliably find and move the document.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} projectRoot
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
function plansDirPath(projectRoot) {
|
|
34
|
+
return path.join(resolveStateDirPath(projectRoot), 'plans');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Copy a design document to `<state_dir>/plans/<basename>` when it isn't
|
|
39
|
+
* already there. Idempotent: returns the in-plans path regardless of whether a
|
|
40
|
+
* copy was needed. Preserves the source file so runtime-managed tmp locations
|
|
41
|
+
* (Plan Mode) remain intact.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} projectRoot
|
|
44
|
+
* @param {string} sourcePath - absolute path to the approved design document
|
|
45
|
+
* @returns {string} absolute path to the canonical location inside plans/
|
|
46
|
+
*/
|
|
47
|
+
function ensureDesignDocumentInPlans(projectRoot, sourcePath) {
|
|
48
|
+
const plansDir = plansDirPath(projectRoot);
|
|
49
|
+
const resolvedPlansDir = path.resolve(plansDir) + path.sep;
|
|
50
|
+
const resolvedSource = path.resolve(sourcePath);
|
|
51
|
+
|
|
52
|
+
if (resolvedSource.startsWith(resolvedPlansDir)) {
|
|
53
|
+
return resolvedSource;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
fs.mkdirSync(plansDir, { recursive: true });
|
|
57
|
+
const destination = path.join(plansDir, path.basename(resolvedSource));
|
|
58
|
+
fs.copyFileSync(resolvedSource, destination);
|
|
59
|
+
return destination;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Validate that a caller-provided filename is safe to join into the plans
|
|
64
|
+
* directory. Rejects anything that could escape the directory or collide with a
|
|
65
|
+
* nested path.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} filename
|
|
68
|
+
* @param {string} paramName - name of the parameter for error messages (e.g. "design_document_filename")
|
|
69
|
+
* @throws {ValidationError}
|
|
70
|
+
*/
|
|
71
|
+
function assertPlansFilename(filename, paramName) {
|
|
72
|
+
if (typeof filename !== 'string' || filename.length === 0) {
|
|
73
|
+
throw new ValidationError(`${paramName} is required`);
|
|
74
|
+
}
|
|
75
|
+
if (filename.includes('\0')) {
|
|
76
|
+
throw new ValidationError(`${paramName} contains null bytes`, {
|
|
77
|
+
details: { value: filename },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (filename !== path.basename(filename) || filename === '..' || filename === '.') {
|
|
81
|
+
throw new ValidationError(
|
|
82
|
+
`${paramName} must be a pure basename (no path separators, no '.' or '..')`,
|
|
83
|
+
{ details: { value: filename } }
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Write caller-supplied document content to `<state_dir>/plans/<filename>`
|
|
90
|
+
* atomically and return the canonical absolute path. The content-based
|
|
91
|
+
* counterpart to `ensureDesignDocumentInPlans` — callers that cannot guarantee
|
|
92
|
+
* filesystem visibility across runtime boundaries (e.g. Gemini Plan Mode writes
|
|
93
|
+
* to `~/.gemini/tmp/...`) use this to bypass path-resolution ambiguity
|
|
94
|
+
* entirely.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} projectRoot
|
|
97
|
+
* @param {string} filename - basename-only, validated via assertPlansFilename
|
|
98
|
+
* @param {string} content - UTF-8 document content
|
|
99
|
+
* @param {string} filenameParam - parameter name for validation errors
|
|
100
|
+
* @returns {string} absolute canonical path inside plans/
|
|
101
|
+
*/
|
|
102
|
+
function writePlansDocumentContent(projectRoot, filename, content, filenameParam) {
|
|
103
|
+
assertPlansFilename(filename, filenameParam);
|
|
104
|
+
if (typeof content !== 'string' || content.length === 0) {
|
|
105
|
+
throw new ValidationError(
|
|
106
|
+
`${filenameParam.replace(/_filename$/, '_content')} must be a non-empty string`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const destination = path.join(plansDirPath(projectRoot), filename);
|
|
110
|
+
atomicWriteSync(destination, content);
|
|
111
|
+
return destination;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @param {string} projectRoot
|
|
116
|
+
* @param {string} sessionId
|
|
117
|
+
* @returns {{ session_id: string, entered_at: string | null, approved_at: string | null, design_document_path: string | null } | null}
|
|
118
|
+
*/
|
|
119
|
+
function readGate(projectRoot, sessionId) {
|
|
120
|
+
const filePath = gatePath(projectRoot, sessionId);
|
|
121
|
+
if (!fs.existsSync(filePath)) return null;
|
|
122
|
+
try {
|
|
123
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param {string} projectRoot
|
|
131
|
+
* @param {string} sessionId
|
|
132
|
+
* @param {object} data
|
|
133
|
+
*/
|
|
134
|
+
function writeGate(projectRoot, sessionId, data) {
|
|
135
|
+
const filePath = gatePath(projectRoot, sessionId);
|
|
136
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
137
|
+
atomicWriteSync(filePath, JSON.stringify(data, null, 2));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @param {{ session_id: string }} params
|
|
142
|
+
* @param {string} projectRoot
|
|
143
|
+
*/
|
|
144
|
+
function handleEnterDesignGate(params, projectRoot) {
|
|
145
|
+
assertSessionId(params.session_id);
|
|
146
|
+
const existing = readGate(projectRoot, params.session_id);
|
|
147
|
+
if (existing && existing.entered_at) {
|
|
148
|
+
return { success: true, entered_at: existing.entered_at, already_entered: true };
|
|
149
|
+
}
|
|
150
|
+
const gate = {
|
|
151
|
+
session_id: params.session_id,
|
|
152
|
+
entered_at: new Date().toISOString(),
|
|
153
|
+
approved_at: null,
|
|
154
|
+
design_document_path: null,
|
|
155
|
+
};
|
|
156
|
+
writeGate(projectRoot, params.session_id, gate);
|
|
157
|
+
return { success: true, entered_at: gate.entered_at, already_entered: false };
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Resolve the caller's approved-design input to a canonical absolute path.
|
|
162
|
+
* Accepts exactly one of (design_document_path) or (design_document_content +
|
|
163
|
+
* design_document_filename). The content variant materializes the file
|
|
164
|
+
* immediately inside `<state_dir>/plans/`, eliminating the path-resolution
|
|
165
|
+
* ambiguity that arises when callers write through a runtime surface whose
|
|
166
|
+
* filesystem root differs from the MCP server's workspace (e.g. Gemini Plan
|
|
167
|
+
* Mode writes to `~/.gemini/tmp/<uuid>/...`).
|
|
168
|
+
*
|
|
169
|
+
* @param {object} params
|
|
170
|
+
* @param {string} [params.design_document_path]
|
|
171
|
+
* @param {string} [params.design_document_content]
|
|
172
|
+
* @param {string} [params.design_document_filename]
|
|
173
|
+
* @param {string} projectRoot
|
|
174
|
+
* @returns {string} canonical absolute path of the approved design document
|
|
175
|
+
* @throws {ValidationError} when neither or both input variants are supplied
|
|
176
|
+
*/
|
|
177
|
+
function resolveApprovedDesignDocument(params, projectRoot) {
|
|
178
|
+
const hasPath =
|
|
179
|
+
typeof params.design_document_path === 'string' &&
|
|
180
|
+
params.design_document_path.length > 0;
|
|
181
|
+
const hasContent =
|
|
182
|
+
typeof params.design_document_content === 'string' &&
|
|
183
|
+
params.design_document_content.length > 0;
|
|
184
|
+
const hasFilename =
|
|
185
|
+
typeof params.design_document_filename === 'string' &&
|
|
186
|
+
params.design_document_filename.length > 0;
|
|
187
|
+
const contentVariantProvided = hasContent || hasFilename;
|
|
188
|
+
|
|
189
|
+
if (hasPath && contentVariantProvided) {
|
|
190
|
+
throw new ValidationError(
|
|
191
|
+
'design_document_path is mutually exclusive with design_document_content/design_document_filename'
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (contentVariantProvided) {
|
|
196
|
+
if (!hasContent) {
|
|
197
|
+
throw new ValidationError('design_document_content is required');
|
|
198
|
+
}
|
|
199
|
+
if (!hasFilename) {
|
|
200
|
+
throw new ValidationError('design_document_filename is required');
|
|
201
|
+
}
|
|
202
|
+
return writePlansDocumentContent(
|
|
203
|
+
projectRoot,
|
|
204
|
+
params.design_document_filename,
|
|
205
|
+
params.design_document_content,
|
|
206
|
+
'design_document_filename'
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (!hasPath) {
|
|
211
|
+
throw new ValidationError(
|
|
212
|
+
'record_design_approval requires either design_document_path or both design_document_content and design_document_filename'
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return path.isAbsolute(params.design_document_path)
|
|
217
|
+
? params.design_document_path
|
|
218
|
+
: path.join(projectRoot, params.design_document_path);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @param {{ session_id: string, design_document_path?: string, design_document_content?: string, design_document_filename?: string }} params
|
|
223
|
+
* @param {string} projectRoot
|
|
224
|
+
*/
|
|
225
|
+
function handleRecordDesignApproval(params, projectRoot) {
|
|
226
|
+
assertSessionId(params.session_id);
|
|
227
|
+
const absDesignPath = resolveApprovedDesignDocument(params, projectRoot);
|
|
228
|
+
|
|
229
|
+
const gate = readGate(projectRoot, params.session_id) || {
|
|
230
|
+
session_id: params.session_id,
|
|
231
|
+
entered_at: new Date().toISOString(),
|
|
232
|
+
approved_at: null,
|
|
233
|
+
design_document_path: null,
|
|
234
|
+
};
|
|
235
|
+
gate.approved_at = new Date().toISOString();
|
|
236
|
+
gate.design_document_path = absDesignPath;
|
|
237
|
+
writeGate(projectRoot, params.session_id, gate);
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
success: true,
|
|
241
|
+
entered_at: gate.entered_at,
|
|
242
|
+
approved_at: gate.approved_at,
|
|
243
|
+
design_document_path: absDesignPath,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @param {{ session_id: string }} params
|
|
249
|
+
* @param {string} projectRoot
|
|
250
|
+
*/
|
|
251
|
+
function handleGetDesignGateStatus(params, projectRoot) {
|
|
252
|
+
assertSessionId(params.session_id);
|
|
253
|
+
const gate = readGate(projectRoot, params.session_id);
|
|
254
|
+
if (!gate) {
|
|
255
|
+
return {
|
|
256
|
+
session_id: params.session_id,
|
|
257
|
+
entered_at: null,
|
|
258
|
+
approved_at: null,
|
|
259
|
+
design_document_path: null,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
return gate;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Returns true when a session has entered the design gate but not yet received approval.
|
|
267
|
+
* Used by create_session (Task 12) to block session creation until the gate is cleared.
|
|
268
|
+
* @param {string} projectRoot
|
|
269
|
+
* @param {string} sessionId
|
|
270
|
+
* @returns {boolean}
|
|
271
|
+
*/
|
|
272
|
+
function isDesignGateBlockingCreate(projectRoot, sessionId) {
|
|
273
|
+
const gate = readGate(projectRoot, sessionId);
|
|
274
|
+
if (!gate) return false;
|
|
275
|
+
return !!(gate.entered_at && !gate.approved_at);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Returns true when a gate artifact exists on disk for the given session_id,
|
|
280
|
+
* regardless of whether it is approved. Used by the orphan-gate guard in
|
|
281
|
+
* create_session to distinguish "orchestrator never entered this session's
|
|
282
|
+
* gate" from "orchestrator is in the normal approve-then-create flow".
|
|
283
|
+
* @param {string} projectRoot
|
|
284
|
+
* @param {string} sessionId
|
|
285
|
+
* @returns {boolean}
|
|
286
|
+
*/
|
|
287
|
+
function hasDesignGate(projectRoot, sessionId) {
|
|
288
|
+
return readGate(projectRoot, sessionId) !== null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Read the design document path persisted on the gate after approval. Used by
|
|
293
|
+
* create_session to auto-populate `state.design_document` when the orchestrator
|
|
294
|
+
* does not pass it explicitly — avoids losing the document during archival.
|
|
295
|
+
* @param {string} projectRoot
|
|
296
|
+
* @param {string} sessionId
|
|
297
|
+
* @returns {string | null}
|
|
298
|
+
*/
|
|
299
|
+
function getApprovedDesignDocumentPath(projectRoot, sessionId) {
|
|
300
|
+
const gate = readGate(projectRoot, sessionId);
|
|
301
|
+
if (!gate || !gate.approved_at) return null;
|
|
302
|
+
return gate.design_document_path || null;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Enumerate every approved design gate currently persisted in the workspace.
|
|
307
|
+
* Reads the `state/` directory once and parses each `<session_id>.design-gate.json`
|
|
308
|
+
* artifact. Corrupt or unapproved gate files are skipped silently. Used by
|
|
309
|
+
* create_session to detect session_id drift across the enter_design_gate →
|
|
310
|
+
* record_design_approval → create_session sequence.
|
|
311
|
+
*
|
|
312
|
+
* @param {string} projectRoot
|
|
313
|
+
* @returns {Array<{session_id: string, approved_at: string, design_document_path: string | null}>}
|
|
314
|
+
*/
|
|
315
|
+
function listApprovedGates(projectRoot) {
|
|
316
|
+
const stateDir = path.join(resolveStateDirPath(projectRoot), 'state');
|
|
317
|
+
if (!fs.existsSync(stateDir)) return [];
|
|
318
|
+
let entries;
|
|
319
|
+
try {
|
|
320
|
+
entries = fs.readdirSync(stateDir);
|
|
321
|
+
} catch {
|
|
322
|
+
return [];
|
|
323
|
+
}
|
|
324
|
+
const gates = [];
|
|
325
|
+
for (const entry of entries) {
|
|
326
|
+
if (!entry.endsWith(GATE_FILENAME)) continue;
|
|
327
|
+
const sessionId = entry.slice(0, -GATE_FILENAME.length);
|
|
328
|
+
if (sessionId.length === 0) continue;
|
|
329
|
+
const filePath = path.join(stateDir, entry);
|
|
330
|
+
try {
|
|
331
|
+
const gate = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
332
|
+
if (gate && typeof gate.approved_at === 'string' && gate.approved_at.length > 0) {
|
|
333
|
+
gates.push({
|
|
334
|
+
session_id: sessionId,
|
|
335
|
+
approved_at: gate.approved_at,
|
|
336
|
+
design_document_path: gate.design_document_path || null,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
} catch {
|
|
340
|
+
// unreadable or corrupt gate — skip; detection is best-effort.
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return gates;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Find approved design gates whose session_id does not match the caller's.
|
|
348
|
+
* The orchestrator must use a single session_id from enter_design_gate through
|
|
349
|
+
* archive_session; a mismatched approved gate signals either (a) an in-flight
|
|
350
|
+
* workflow the caller forgot to continue with the original id or (b) an
|
|
351
|
+
* abandoned prior run. create_session uses this to fail fast rather than
|
|
352
|
+
* silently discard the approved design document.
|
|
353
|
+
*
|
|
354
|
+
* @param {string} projectRoot
|
|
355
|
+
* @param {string} currentSessionId
|
|
356
|
+
* @returns {Array<{session_id: string, approved_at: string, design_document_path: string | null}>}
|
|
357
|
+
*/
|
|
358
|
+
function findOrphanedApprovedGates(projectRoot, currentSessionId) {
|
|
359
|
+
return listApprovedGates(projectRoot).filter(
|
|
360
|
+
(gate) => gate.session_id !== currentSessionId
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Remove the design-gate artifact for a session. Called by archive_session so
|
|
366
|
+
* the gate doesn't linger in state/ after the session is archived — otherwise
|
|
367
|
+
* a future session reusing the same id would inherit a stale "already approved"
|
|
368
|
+
* gate from the prior run.
|
|
369
|
+
* @param {string} projectRoot
|
|
370
|
+
* @param {string} sessionId
|
|
371
|
+
* @returns {string | null} path of the removed gate file, or null if no gate existed
|
|
372
|
+
*/
|
|
373
|
+
function removeDesignGate(projectRoot, sessionId) {
|
|
374
|
+
const filePath = gatePath(projectRoot, sessionId);
|
|
375
|
+
if (!fs.existsSync(filePath)) return null;
|
|
376
|
+
fs.unlinkSync(filePath);
|
|
377
|
+
return filePath;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
module.exports = {
|
|
381
|
+
handleEnterDesignGate,
|
|
382
|
+
handleRecordDesignApproval,
|
|
383
|
+
handleGetDesignGateStatus,
|
|
384
|
+
isDesignGateBlockingCreate,
|
|
385
|
+
hasDesignGate,
|
|
386
|
+
getApprovedDesignDocumentPath,
|
|
387
|
+
listApprovedGates,
|
|
388
|
+
findOrphanedApprovedGates,
|
|
389
|
+
ensureDesignDocumentInPlans,
|
|
390
|
+
writePlansDocumentContent,
|
|
391
|
+
plansDirPath,
|
|
392
|
+
removeDesignGate,
|
|
393
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { DEFAULT_RUNTIME_CONFIG } = require('./get-skill-content');
|
|
4
|
+
const { AGENT_ALLOWLIST } = require('../content/runtime-content');
|
|
5
|
+
const { createContentProvider } = require('../content/provider');
|
|
6
|
+
const { ValidationError } = require('../../lib/errors');
|
|
7
|
+
const { toSnakeCase, toKebabCase } = require('../../lib/naming');
|
|
8
|
+
|
|
9
|
+
function createHandler(runtimeConfig = DEFAULT_RUNTIME_CONFIG, canonicalSrcRoot) {
|
|
10
|
+
return function handleGetAgent(params) {
|
|
11
|
+
const requestedAgents = params.agents;
|
|
12
|
+
if (!Array.isArray(requestedAgents) || requestedAgents.length === 0) {
|
|
13
|
+
throw new ValidationError('agents must be a non-empty array of agent identifiers');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const provider = createContentProvider(runtimeConfig, canonicalSrcRoot);
|
|
17
|
+
const agents = {};
|
|
18
|
+
const errors = {};
|
|
19
|
+
|
|
20
|
+
for (const rawName of requestedAgents) {
|
|
21
|
+
const inputName = String(rawName || '').trim();
|
|
22
|
+
const canonicalName = toKebabCase(inputName);
|
|
23
|
+
|
|
24
|
+
if (!AGENT_ALLOWLIST.includes(canonicalName)) {
|
|
25
|
+
errors[inputName || '(empty)'] =
|
|
26
|
+
`Unknown agent identifier: "${inputName}". Known identifiers: ${AGENT_ALLOWLIST.join(', ')}`;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const result = provider.readAgent(canonicalName);
|
|
31
|
+
if (result.error) {
|
|
32
|
+
errors[inputName] = result.error;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const toolName =
|
|
37
|
+
runtimeConfig.agentNaming === 'snake_case'
|
|
38
|
+
? toSnakeCase(canonicalName)
|
|
39
|
+
: canonicalName;
|
|
40
|
+
|
|
41
|
+
agents[inputName] = { ...result.agent, tool_name: toolName };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return { agents, errors };
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const handleGetAgent = createHandler();
|
|
49
|
+
|
|
50
|
+
module.exports = {
|
|
51
|
+
AGENT_ALLOWLIST,
|
|
52
|
+
createHandler,
|
|
53
|
+
handleGetAgent,
|
|
54
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { KNOWN_AGENTS, AGENT_CAPABILITIES } = require('../../core/agent-registry');
|
|
4
|
+
const { normalizeRuntimeConfig } = require('../runtime/runtime-config-map');
|
|
5
|
+
const { toKebabCase } = require('../../lib/naming');
|
|
6
|
+
|
|
7
|
+
const MCP_PREFIXES = {
|
|
8
|
+
gemini: 'mcp_maestro_',
|
|
9
|
+
claude: 'mcp__plugin_maestro_maestro__',
|
|
10
|
+
codex: 'mcp__maestro_maestro__',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const PLAN_MODE_NATIVE = { claude: true, gemini: true, codex: false, qwen: false };
|
|
14
|
+
|
|
15
|
+
function createHandler(runtimeConfig, getWorkspaceSuggestion = () => null) {
|
|
16
|
+
const resolvedRuntimeConfig = normalizeRuntimeConfig(runtimeConfig);
|
|
17
|
+
const agentNames = KNOWN_AGENTS.map((name) =>
|
|
18
|
+
resolvedRuntimeConfig.agentNaming === 'kebab-case'
|
|
19
|
+
? toKebabCase(name)
|
|
20
|
+
: name
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const prefix = resolvedRuntimeConfig.name === 'claude' ? 'maestro:' : '';
|
|
24
|
+
const delegation = resolvedRuntimeConfig.delegation || { pattern: '', constraints: {} };
|
|
25
|
+
|
|
26
|
+
return function handleGetRuntimeContext(_params) {
|
|
27
|
+
return {
|
|
28
|
+
runtime: resolvedRuntimeConfig.name,
|
|
29
|
+
tools: resolvedRuntimeConfig.tools || {},
|
|
30
|
+
agent_dispatch: {
|
|
31
|
+
pattern: delegation.pattern || '',
|
|
32
|
+
naming: resolvedRuntimeConfig.agentNaming || 'kebab-case',
|
|
33
|
+
prefix,
|
|
34
|
+
},
|
|
35
|
+
delegation: {
|
|
36
|
+
pattern: delegation.pattern || '',
|
|
37
|
+
constraints: delegation.constraints || {},
|
|
38
|
+
},
|
|
39
|
+
mcp_prefix: MCP_PREFIXES[resolvedRuntimeConfig.name] || '',
|
|
40
|
+
paths: resolvedRuntimeConfig.paths || {},
|
|
41
|
+
agents: agentNames,
|
|
42
|
+
agent_capabilities: AGENT_CAPABILITIES,
|
|
43
|
+
plan_mode_native: PLAN_MODE_NATIVE[resolvedRuntimeConfig.name] || false,
|
|
44
|
+
workspace_suggestion: getWorkspaceSuggestion() || null,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = { createHandler };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { getDefaultRuntimeConfig } = require('../runtime/runtime-config-map');
|
|
4
|
+
const {
|
|
5
|
+
RESOURCE_ALLOWLIST,
|
|
6
|
+
applyRuntimeTransforms,
|
|
7
|
+
} = require('../content/runtime-content');
|
|
8
|
+
const { createContentProvider } = require('../content/provider');
|
|
9
|
+
const { ValidationError } = require('../../lib/errors');
|
|
10
|
+
|
|
11
|
+
const DEFAULT_RUNTIME_CONFIG = getDefaultRuntimeConfig();
|
|
12
|
+
|
|
13
|
+
function createHandler(runtimeConfig = DEFAULT_RUNTIME_CONFIG, canonicalSrcRoot) {
|
|
14
|
+
return function handleGetSkillContent(params) {
|
|
15
|
+
const resources = params.resources;
|
|
16
|
+
if (!Array.isArray(resources) || resources.length === 0) {
|
|
17
|
+
throw new ValidationError('resources must be a non-empty array of resource identifiers');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const provider = createContentProvider(runtimeConfig, canonicalSrcRoot);
|
|
21
|
+
const contents = {};
|
|
22
|
+
const errors = {};
|
|
23
|
+
|
|
24
|
+
for (const id of resources) {
|
|
25
|
+
if (!RESOURCE_ALLOWLIST[id]) {
|
|
26
|
+
errors[id] = `Unknown resource identifier: "${id}". Known identifiers: ${Object.keys(RESOURCE_ALLOWLIST).join(', ')}`;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const result = provider.readResource(id);
|
|
31
|
+
if (result.error) {
|
|
32
|
+
errors[id] = result.error;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
contents[id] = result.content;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { contents, errors };
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const handleGetSkillContent = createHandler();
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
RESOURCE_ALLOWLIST,
|
|
47
|
+
DEFAULT_RUNTIME_CONFIG,
|
|
48
|
+
applyRuntimeTransforms,
|
|
49
|
+
createHandler,
|
|
50
|
+
handleGetSkillContent,
|
|
51
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const { ensureWorkspace, resolveStateDirPath } = require('../../state/session-state');
|
|
7
|
+
const { resolveSetting } = require('../../config/setting-resolver');
|
|
8
|
+
const {
|
|
9
|
+
requireExplicitWorkspaceRoot,
|
|
10
|
+
} = require('../../core/project-root-resolver');
|
|
11
|
+
const { writeWorkspaceMarker } = require('../contracts/workspace-marker');
|
|
12
|
+
|
|
13
|
+
async function handleInitializeWorkspace(params = {}, cachedProjectRoot) {
|
|
14
|
+
const workspacePath =
|
|
15
|
+
params.workspace_path || cachedProjectRoot || null;
|
|
16
|
+
|
|
17
|
+
const resolvedWorkspace = requireExplicitWorkspaceRoot({
|
|
18
|
+
workspacePath,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const stateDir =
|
|
22
|
+
params.state_dir ||
|
|
23
|
+
resolveSetting('MAESTRO_STATE_DIR', resolvedWorkspace) ||
|
|
24
|
+
'docs/maestro';
|
|
25
|
+
const fullStatePath = resolveStateDirPath(resolvedWorkspace, stateDir);
|
|
26
|
+
const alreadyExisted = fs.existsSync(path.join(fullStatePath, 'state'));
|
|
27
|
+
|
|
28
|
+
ensureWorkspace(stateDir, resolvedWorkspace);
|
|
29
|
+
writeWorkspaceMarker(fullStatePath, resolvedWorkspace);
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
workspace_path: resolvedWorkspace,
|
|
34
|
+
state_dir: stateDir,
|
|
35
|
+
created_directories: [
|
|
36
|
+
'state/',
|
|
37
|
+
'state/archive/',
|
|
38
|
+
'plans/',
|
|
39
|
+
'plans/archive/',
|
|
40
|
+
].map((dir) => path.join(stateDir, dir)),
|
|
41
|
+
already_existed: alreadyExisted,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = { handleInitializeWorkspace };
|