@bluefly/openstandardagents 0.1.9
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/.buildkit/agent-first-policy.sh +65 -0
- package/.buildkit/branching-workflow.json +41 -0
- package/.buildkit/hooks.yaml +23 -0
- package/.buildkit/install-buildkit-setup.cjs +483 -0
- package/.cursor/plans/ossa-comprehensive-enhancement-issue-audit-plan.plan.md +735 -0
- package/.cursor/plans/ossa-enterprise-transformation-plan-0ccaf09b.plan.md +373 -0
- package/.cursor/plans/ossa-milestone-organization-and-v0-2-4-release-6dafa4ec.plan.md +214 -0
- package/.cursor/rules/problems.json +483 -0
- package/.cursor/settings.json +29 -0
- package/.cursor/worktrees.json +95 -0
- package/.env.example +41 -0
- package/.env.local +31 -0
- package/.github/ISSUE_TEMPLATE/README.md +33 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +61 -0
- package/.github/ISSUE_TEMPLATE/config.yml +12 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +75 -0
- package/.github/wiki_templates/home.md +39 -0
- package/.gitignore.bak +489 -0
- package/.gitlab-ci-trigger +1 -0
- package/.husky/pre-commit +31 -0
- package/.lintstagedrc.json +16 -0
- package/.redocly.yaml +63 -0
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +3 -0
- package/AUDIT_FIXES.md +139 -0
- package/AUDIT_REPORT.md +308 -0
- package/BUILDKIT_INTEGRATION.md +146 -0
- package/Dockerfile +35 -0
- package/README.md +559 -0
- package/dist/adk/adapters/index.d.ts +64 -0
- package/dist/adk/adapters/index.d.ts.map +1 -0
- package/dist/adk/adapters/index.js +257 -0
- package/dist/adk/adapters/index.js.map +1 -0
- package/dist/adk/agents/custom-agent.d.ts +55 -0
- package/dist/adk/agents/custom-agent.d.ts.map +1 -0
- package/dist/adk/agents/custom-agent.js +167 -0
- package/dist/adk/agents/custom-agent.js.map +1 -0
- package/dist/adk/agents/index.d.ts +64 -0
- package/dist/adk/agents/index.d.ts.map +1 -0
- package/dist/adk/agents/index.js +125 -0
- package/dist/adk/agents/index.js.map +1 -0
- package/dist/adk/agents/llm-agent.d.ts +27 -0
- package/dist/adk/agents/llm-agent.d.ts.map +1 -0
- package/dist/adk/agents/llm-agent.js +63 -0
- package/dist/adk/agents/llm-agent.js.map +1 -0
- package/dist/adk/agents/workflow-agent.d.ts +42 -0
- package/dist/adk/agents/workflow-agent.d.ts.map +1 -0
- package/dist/adk/agents/workflow-agent.js +144 -0
- package/dist/adk/agents/workflow-agent.js.map +1 -0
- package/dist/adk/index.d.ts +10 -0
- package/dist/adk/index.d.ts.map +1 -0
- package/dist/adk/index.js +10 -0
- package/dist/adk/index.js.map +1 -0
- package/dist/adk/orchestration/index.d.ts +63 -0
- package/dist/adk/orchestration/index.d.ts.map +1 -0
- package/dist/adk/orchestration/index.js +264 -0
- package/dist/adk/orchestration/index.js.map +1 -0
- package/dist/adk/state/index.d.ts +73 -0
- package/dist/adk/state/index.d.ts.map +1 -0
- package/dist/adk/state/index.js +177 -0
- package/dist/adk/state/index.js.map +1 -0
- package/dist/adk/tools/index.d.ts +65 -0
- package/dist/adk/tools/index.d.ts.map +1 -0
- package/dist/adk/tools/index.js +252 -0
- package/dist/adk/tools/index.js.map +1 -0
- package/dist/cli/agent-deployment.d.ts +34 -0
- package/dist/cli/agent-deployment.d.ts.map +1 -0
- package/dist/cli/agent-deployment.js +396 -0
- package/dist/cli/agent-deployment.js.map +1 -0
- package/dist/cli/commands/discover.command.d.ts +7 -0
- package/dist/cli/commands/discover.command.d.ts.map +1 -0
- package/dist/cli/commands/discover.command.js +80 -0
- package/dist/cli/commands/discover.command.js.map +1 -0
- package/dist/cli/commands/export.command.d.ts +7 -0
- package/dist/cli/commands/export.command.d.ts.map +1 -0
- package/dist/cli/commands/export.command.js +56 -0
- package/dist/cli/commands/export.command.js.map +1 -0
- package/dist/cli/commands/generate.command.d.ts +7 -0
- package/dist/cli/commands/generate.command.d.ts.map +1 -0
- package/dist/cli/commands/generate.command.js +66 -0
- package/dist/cli/commands/generate.command.js.map +1 -0
- package/dist/cli/commands/gitlab-agent.command.d.ts +8 -0
- package/dist/cli/commands/gitlab-agent.command.d.ts.map +1 -0
- package/dist/cli/commands/gitlab-agent.command.js +201 -0
- package/dist/cli/commands/gitlab-agent.command.js.map +1 -0
- package/dist/cli/commands/import.command.d.ts +7 -0
- package/dist/cli/commands/import.command.d.ts.map +1 -0
- package/dist/cli/commands/import.command.js +36 -0
- package/dist/cli/commands/import.command.js.map +1 -0
- package/dist/cli/commands/init.command.d.ts +7 -0
- package/dist/cli/commands/init.command.d.ts.map +1 -0
- package/dist/cli/commands/init.command.js +146 -0
- package/dist/cli/commands/init.command.js.map +1 -0
- package/dist/cli/commands/migrate.command.d.ts +7 -0
- package/dist/cli/commands/migrate.command.d.ts.map +1 -0
- package/dist/cli/commands/migrate.command.js +110 -0
- package/dist/cli/commands/migrate.command.js.map +1 -0
- package/dist/cli/commands/ossa.d.ts +9 -0
- package/dist/cli/commands/ossa.d.ts.map +1 -0
- package/dist/cli/commands/ossa.js +234 -0
- package/dist/cli/commands/ossa.js.map +1 -0
- package/dist/cli/commands/run.command.d.ts +7 -0
- package/dist/cli/commands/run.command.d.ts.map +1 -0
- package/dist/cli/commands/run.command.js +114 -0
- package/dist/cli/commands/run.command.js.map +1 -0
- package/dist/cli/commands/schema.command.d.ts +7 -0
- package/dist/cli/commands/schema.command.d.ts.map +1 -0
- package/dist/cli/commands/schema.command.js +72 -0
- package/dist/cli/commands/schema.command.js.map +1 -0
- package/dist/cli/commands/validate.command.d.ts +7 -0
- package/dist/cli/commands/validate.command.d.ts.map +1 -0
- package/dist/cli/commands/validate.command.js +125 -0
- package/dist/cli/commands/validate.command.js.map +1 -0
- package/dist/cli/commands/worktree.d.ts +7 -0
- package/dist/cli/commands/worktree.d.ts.map +1 -0
- package/dist/cli/commands/worktree.js +509 -0
- package/dist/cli/commands/worktree.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/ossa-cli.d.ts +52 -0
- package/dist/cli/ossa-cli.d.ts.map +1 -0
- package/dist/cli/ossa-cli.js +1061 -0
- package/dist/cli/ossa-cli.js.map +1 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +37 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/mcp-server-implementation.d.ts +39 -0
- package/dist/core/mcp-server-implementation.d.ts.map +1 -0
- package/dist/core/mcp-server-implementation.js +1262 -0
- package/dist/core/mcp-server-implementation.js.map +1 -0
- package/dist/core/orchestrator/index.d.ts +156 -0
- package/dist/core/orchestrator/index.d.ts.map +1 -0
- package/dist/core/orchestrator/index.js +446 -0
- package/dist/core/orchestrator/index.js.map +1 -0
- package/dist/core/orchestrator/ossa-orchestrator.d.ts +106 -0
- package/dist/core/orchestrator/ossa-orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator/ossa-orchestrator.js +396 -0
- package/dist/core/orchestrator/ossa-orchestrator.js.map +1 -0
- package/dist/di-container.d.ts +18 -0
- package/dist/di-container.d.ts.map +1 -0
- package/dist/di-container.js +46 -0
- package/dist/di-container.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/protocols/acap.d.ts +61 -0
- package/dist/protocols/acap.d.ts.map +1 -0
- package/dist/protocols/acap.js +92 -0
- package/dist/protocols/acap.js.map +1 -0
- package/dist/protocols/index.d.ts +8 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +8 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/rasp.d.ts +58 -0
- package/dist/protocols/rasp.d.ts.map +1 -0
- package/dist/protocols/rasp.js +212 -0
- package/dist/protocols/rasp.js.map +1 -0
- package/dist/repositories/manifest.repository.d.ts +26 -0
- package/dist/repositories/manifest.repository.d.ts.map +1 -0
- package/dist/repositories/manifest.repository.js +90 -0
- package/dist/repositories/manifest.repository.js.map +1 -0
- package/dist/repositories/schema.repository.d.ts +30 -0
- package/dist/repositories/schema.repository.d.ts.map +1 -0
- package/dist/repositories/schema.repository.js +144 -0
- package/dist/repositories/schema.repository.js.map +1 -0
- package/dist/server/simple-app.d.ts +18 -0
- package/dist/server/simple-app.d.ts.map +1 -0
- package/dist/server/simple-app.js +155 -0
- package/dist/server/simple-app.js.map +1 -0
- package/dist/server/types/agent.d.ts +498 -0
- package/dist/server/types/agent.d.ts.map +1 -0
- package/dist/server/types/agent.js +37 -0
- package/dist/server/types/agent.js.map +1 -0
- package/dist/server/types/server.d.ts +370 -0
- package/dist/server/types/server.d.ts.map +1 -0
- package/dist/server/types/server.js +68 -0
- package/dist/server/types/server.js.map +1 -0
- package/dist/services/discovery.service.d.ts +78 -0
- package/dist/services/discovery.service.d.ts.map +1 -0
- package/dist/services/discovery.service.js +212 -0
- package/dist/services/discovery.service.js.map +1 -0
- package/dist/services/generation.service.d.ts +54 -0
- package/dist/services/generation.service.d.ts.map +1 -0
- package/dist/services/generation.service.js +298 -0
- package/dist/services/generation.service.js.map +1 -0
- package/dist/services/gitlab-agent.service.d.ts +94 -0
- package/dist/services/gitlab-agent.service.d.ts.map +1 -0
- package/dist/services/gitlab-agent.service.js +158 -0
- package/dist/services/gitlab-agent.service.js.map +1 -0
- package/dist/services/migration.service.d.ts +30 -0
- package/dist/services/migration.service.d.ts.map +1 -0
- package/dist/services/migration.service.js +231 -0
- package/dist/services/migration.service.js.map +1 -0
- package/dist/services/orchestration/worktree-orchestrator.d.ts +146 -0
- package/dist/services/orchestration/worktree-orchestrator.d.ts.map +1 -0
- package/dist/services/orchestration/worktree-orchestrator.js +591 -0
- package/dist/services/orchestration/worktree-orchestrator.js.map +1 -0
- package/dist/services/runtime/openai.adapter.d.ts +94 -0
- package/dist/services/runtime/openai.adapter.d.ts.map +1 -0
- package/dist/services/runtime/openai.adapter.js +209 -0
- package/dist/services/runtime/openai.adapter.js.map +1 -0
- package/dist/services/validation.service.d.ts +45 -0
- package/dist/services/validation.service.d.ts.map +1 -0
- package/dist/services/validation.service.js +362 -0
- package/dist/services/validation.service.js.map +1 -0
- package/dist/services/validators/anthropic.validator.d.ts +9 -0
- package/dist/services/validators/anthropic.validator.d.ts.map +1 -0
- package/dist/services/validators/anthropic.validator.js +105 -0
- package/dist/services/validators/anthropic.validator.js.map +1 -0
- package/dist/services/validators/autogen.validator.d.ts +9 -0
- package/dist/services/validators/autogen.validator.d.ts.map +1 -0
- package/dist/services/validators/autogen.validator.js +111 -0
- package/dist/services/validators/autogen.validator.js.map +1 -0
- package/dist/services/validators/crewai.validator.d.ts +9 -0
- package/dist/services/validators/crewai.validator.d.ts.map +1 -0
- package/dist/services/validators/crewai.validator.js +117 -0
- package/dist/services/validators/crewai.validator.js.map +1 -0
- package/dist/services/validators/cursor.validator.d.ts +9 -0
- package/dist/services/validators/cursor.validator.d.ts.map +1 -0
- package/dist/services/validators/cursor.validator.js +88 -0
- package/dist/services/validators/cursor.validator.js.map +1 -0
- package/dist/services/validators/index.d.ts +15 -0
- package/dist/services/validators/index.d.ts.map +1 -0
- package/dist/services/validators/index.js +15 -0
- package/dist/services/validators/index.js.map +1 -0
- package/dist/services/validators/langchain.validator.d.ts +9 -0
- package/dist/services/validators/langchain.validator.d.ts.map +1 -0
- package/dist/services/validators/langchain.validator.js +103 -0
- package/dist/services/validators/langchain.validator.js.map +1 -0
- package/dist/services/validators/langflow.validator.d.ts +9 -0
- package/dist/services/validators/langflow.validator.d.ts.map +1 -0
- package/dist/services/validators/langflow.validator.js +92 -0
- package/dist/services/validators/langflow.validator.js.map +1 -0
- package/dist/services/validators/langgraph.validator.d.ts +9 -0
- package/dist/services/validators/langgraph.validator.d.ts.map +1 -0
- package/dist/services/validators/langgraph.validator.js +123 -0
- package/dist/services/validators/langgraph.validator.js.map +1 -0
- package/dist/services/validators/llamaindex.validator.d.ts +9 -0
- package/dist/services/validators/llamaindex.validator.d.ts.map +1 -0
- package/dist/services/validators/llamaindex.validator.js +121 -0
- package/dist/services/validators/llamaindex.validator.js.map +1 -0
- package/dist/services/validators/openai.validator.d.ts +9 -0
- package/dist/services/validators/openai.validator.d.ts.map +1 -0
- package/dist/services/validators/openai.validator.js +126 -0
- package/dist/services/validators/openai.validator.js.map +1 -0
- package/dist/services/validators/vercel-ai.validator.d.ts +9 -0
- package/dist/services/validators/vercel-ai.validator.d.ts.map +1 -0
- package/dist/services/validators/vercel-ai.validator.js +99 -0
- package/dist/services/validators/vercel-ai.validator.js.map +1 -0
- package/dist/services/worktree/branching-strategy.d.ts +17 -0
- package/dist/services/worktree/branching-strategy.d.ts.map +1 -0
- package/dist/services/worktree/branching-strategy.js +66 -0
- package/dist/services/worktree/branching-strategy.js.map +1 -0
- package/dist/services/worktree/git-worktree-manager.d.ts +32 -0
- package/dist/services/worktree/git-worktree-manager.d.ts.map +1 -0
- package/dist/services/worktree/git-worktree-manager.js +61 -0
- package/dist/services/worktree/git-worktree-manager.js.map +1 -0
- package/dist/spec/v0.1.9/agent-autonomous-extensions.json +234 -0
- package/dist/spec/v0.1.9/ecosystem-compliance.json +235 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json +695 -0
- package/dist/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/dist/spec/v0.1.9/reasoning-compliance.json +654 -0
- package/dist/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/dist/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/dist/spec/v0.2.2/kagent-enhancements.json +395 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.schema.json +906 -0
- package/dist/spec/v0.2.2/ossa-0.2.2.yaml +448 -0
- package/dist/spec/v0.2.2/ossa-reasoning-compliance-1.0.schema.json +424 -0
- package/dist/spec/v0.2.3/README.md +154 -0
- package/dist/spec/v0.2.3/migrations/v0.2.2-to-v0.2.3.md +343 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.schema.json +1397 -0
- package/dist/spec/v0.2.3/ossa-0.2.3.yaml +448 -0
- package/dist/spec/v0.2.4-dev/README.md +61 -0
- package/dist/spec/v0.2.4-dev/RELEASE-PROCESS.md +130 -0
- package/dist/spec/v0.2.4-dev/migrations/v0.2.3-to-v0.2.4.md +599 -0
- package/dist/spec/v0.2.4-dev/openapi/CHANGELOG-0.2.4.md +177 -0
- package/dist/spec/v0.2.4-dev/openapi/README-0.2.4.md +51 -0
- package/dist/spec/v0.2.4-dev/openapi/VERIFICATION-0.2.4.md +147 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.schema.json +1717 -0
- package/dist/spec/v0.2.4-dev/ossa-0.2.4-dev.yaml +581 -0
- package/dist/spec/v0.2.5-dev/migrations/v0.2.4-to-v0.2.5.md +317 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.schema.json +1732 -0
- package/dist/spec/v0.2.5-dev/ossa-0.2.5-dev.yaml +409 -0
- package/dist/specification/validator.d.ts +82 -0
- package/dist/specification/validator.d.ts.map +1 -0
- package/dist/specification/validator.js +562 -0
- package/dist/specification/validator.js.map +1 -0
- package/dist/types/acdl-api.d.ts +335 -0
- package/dist/types/acdl-api.d.ts.map +1 -0
- package/dist/types/acdl-api.js +6 -0
- package/dist/types/acdl-api.js.map +1 -0
- package/dist/types/agents/index.d.ts +53 -0
- package/dist/types/agents/index.d.ts.map +1 -0
- package/dist/types/agents/index.js +5 -0
- package/dist/types/agents/index.js.map +1 -0
- package/dist/types/api.d.ts +225 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/architecture/index.d.ts +530 -0
- package/dist/types/architecture/index.d.ts.map +1 -0
- package/dist/types/architecture/index.js +258 -0
- package/dist/types/architecture/index.js.map +1 -0
- package/dist/types/index.d.ts +279 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +68 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/openapi-extensions.d.ts +164 -0
- package/dist/types/openapi-extensions.d.ts.map +1 -0
- package/dist/types/openapi-extensions.js +6 -0
- package/dist/types/openapi-extensions.js.map +1 -0
- package/dist/types/policies/index.d.ts +35 -0
- package/dist/types/policies/index.d.ts.map +1 -0
- package/dist/types/policies/index.js +5 -0
- package/dist/types/policies/index.js.map +1 -0
- package/dist/types/workflows/index.d.ts +40 -0
- package/dist/types/workflows/index.d.ts.map +1 -0
- package/dist/types/workflows/index.js +5 -0
- package/dist/types/workflows/index.js.map +1 -0
- package/dist/utils/version-resolver.d.ts +28 -0
- package/dist/utils/version-resolver.d.ts.map +1 -0
- package/dist/utils/version-resolver.js +110 -0
- package/dist/utils/version-resolver.js.map +1 -0
- package/docker-compose.yml +160 -0
- package/junit.xml +1 -0
- package/package.json +105 -0
- package/public/api-docs.html +206 -0
- package/public/assets/favicon.svg +8 -0
- package/public/assets/script.js +279 -0
- package/public/assets/style.css +632 -0
- package/public/index.html +307 -0
- package/public/redocly-config.yaml +80 -0
- package/public/src/api/acdl-specification.yml +531 -0
- package/public/src/api/clean-architecture.openapi.yml +1435 -0
- package/public/src/api/context7-mcp.openapi.yml +313 -0
- package/public/src/api/magic-mcp.openapi.yml +647 -0
- package/public/src/api/mcp-infrastructure.openapi.yml +904 -0
- package/public/src/api/orchestration.openapi.yml +444 -0
- package/public/src/api/ossa-complete.openapi.yml +2250 -0
- package/public/src/api/project-discovery.openapi.yml +1293 -0
- package/public/src/api/rebuild-audit.openapi.yml +800 -0
- package/public/src/api/specification.openapi.yml +498 -0
- package/public/src/api/voice-agent-specification.yml +640 -0
- package/public/src/api/web-eval-mcp.openapi.yml +426 -0
- package/pyrightconfig.json +13 -0
- package/redocly.yaml +56 -0
- package/spec/v0.1.9/ossa-v0.1.9.schema.json.backup +695 -0
- package/spec/v0.2.0/ossa-0.2.0.schema.json +0 -0
- package/spec/v0.2.1/ossa-0.2.1.schema.json +555 -0
- package/spec/v0.2.4/ossa-0.2.4.schema.json +1717 -0
- package/spec/v0.2.4/ossa-0.2.4.yaml +581 -0
- package/specs/README.md +31 -0
- package/specs/acdl-specification.yml +531 -0
- package/specs/clean-architecture.openapi.yml +1435 -0
- package/specs/context7-mcp.openapi.yml +313 -0
- package/specs/magic-mcp.openapi.yml +647 -0
- package/specs/mcp-infrastructure.openapi.yml +904 -0
- package/specs/orchestration.openapi.yml +444 -0
- package/specs/ossa-complete.openapi.yml +2250 -0
- package/specs/project-discovery.openapi.yml +1293 -0
- package/specs/rebuild-audit.openapi.yml +800 -0
- package/specs/specification.openapi.yml +498 -0
- package/specs/test-api.openapi.yml +20 -0
- package/specs/voice-agent-specification.yml +640 -0
- package/specs/web-eval-mcp.openapi.yml +426 -0
- package/src/adk/adapters/index.ts +310 -0
- package/src/adk/agents/custom-agent.ts +206 -0
- package/src/adk/agents/index.ts +158 -0
- package/src/adk/agents/llm-agent.ts +76 -0
- package/src/adk/agents/workflow-agent.ts +191 -0
- package/src/adk/index.ts +10 -0
- package/src/adk/orchestration/index.ts +352 -0
- package/src/adk/state/index.ts +217 -0
- package/src/adk/tools/index.ts +291 -0
- package/src/api/acdl-specification.yml +531 -0
- package/src/api/agent-manifest.schema.json +859 -0
- package/src/api/agent-worktree-schema.json +320 -0
- package/src/api/clean-architecture.openapi.yml +1435 -0
- package/src/api/context7-mcp.openapi.yml +313 -0
- package/src/api/magic-mcp.openapi.yml +647 -0
- package/src/api/mcp-infrastructure.openapi.yml +904 -0
- package/src/api/openapi.redoc.config.json +6 -0
- package/src/api/orchestration.openapi.yml +444 -0
- package/src/api/ossa-complete.openapi.yml +2250 -0
- package/src/api/project-discovery.openapi.yml +1293 -0
- package/src/api/rebuild-audit.openapi.yml +800 -0
- package/src/api/specification.openapi.yml +498 -0
- package/src/api/test-api.openapi.yml +20 -0
- package/src/api/voice-agent-specification.yml +640 -0
- package/src/api/web-eval-mcp.openapi.yml +426 -0
- package/src/api/workflow.schema.json +524 -0
- package/src/cli/agent-deployment.ts +452 -0
- package/src/cli/commands/ossa.ts +272 -0
- package/src/cli/commands/worktree.ts +603 -0
- package/src/cli/ossa-cli.ts +1176 -0
- package/src/core/index.ts +42 -0
- package/src/core/mcp-server-implementation.ts +1409 -0
- package/src/core/orchestrator/index.ts +611 -0
- package/src/core/orchestrator/ossa-orchestrator.ts +504 -0
- package/src/mcp/simple-server.ts +322 -0
- package/src/protocols/acap.ts +146 -0
- package/src/protocols/index.ts +8 -0
- package/src/protocols/rasp.ts +263 -0
- package/src/server/app.ts +472 -0
- package/src/server/middleware/agentAccess.ts +10 -0
- package/src/server/middleware/asyncHandler.ts +10 -0
- package/src/server/middleware/auth.ts +10 -0
- package/src/server/middleware/errorHandler.ts +9 -0
- package/src/server/middleware/logging.ts +10 -0
- package/src/server/middleware/metrics.ts +10 -0
- package/src/server/middleware/validation.ts +10 -0
- package/src/server/routes/agents.ts +632 -0
- package/src/server/routes/monitoring.ts +13 -0
- package/src/server/routes/orchestration.ts +13 -0
- package/src/server/routes/specifications.ts +13 -0
- package/src/server/services/AgentService.ts +46 -0
- package/src/server/services/ExecutionService.ts +51 -0
- package/src/server/services/SpecificationService.ts +22 -0
- package/src/server/services/WebhookService.ts +24 -0
- package/src/server/simple-app.ts +174 -0
- package/src/server/types/agent.ts +612 -0
- package/src/server/types/server.ts +465 -0
- package/src/services/orchestration/worktree-orchestrator.ts +779 -0
- package/src/services/worktree/branching-strategy.ts +76 -0
- package/src/services/worktree/git-worktree-manager.ts +86 -0
- package/website/.next/BUILD_ID +1 -0
- package/website/.next/app-build-manifest.json +151 -0
- package/website/.next/app-path-routes-manifest.json +19 -0
- package/website/.next/build-manifest.json +33 -0
- package/website/.next/cache/.previewinfo +1 -0
- package/website/.next/cache/.rscinfo +1 -0
- package/website/.next/cache/.tsbuildinfo +1 -0
- package/website/.next/cache/fetch-cache/920aec34c288eefa97c5efba3baf95a846a0beb0c48a5064980a2c24b83e941c +1 -0
- package/website/.next/cache/fetch-cache/c2ad7a72b43463a0daaa85ca926a8af38defd17ecb64f1fdd2dd4fe2293e8b26 +1 -0
- package/website/.next/cache/fetch-cache/d10eb963d5980c8a50ee9ed24472339ee6da054ead33e00676e61e8b8e62cc83 +1 -0
- package/website/.next/cache/fetch-cache/f243d84640477f3205b74a85013018acd63b692144675630a74d1af8a3e9eab5 +1 -0
- package/website/.next/cache/webpack/client-production/0.pack +0 -0
- package/website/.next/cache/webpack/client-production/1.pack +0 -0
- package/website/.next/cache/webpack/client-production/10.pack +0 -0
- package/website/.next/cache/webpack/client-production/11.pack +0 -0
- package/website/.next/cache/webpack/client-production/12.pack +0 -0
- package/website/.next/cache/webpack/client-production/13.pack +0 -0
- package/website/.next/cache/webpack/client-production/14.pack +0 -0
- package/website/.next/cache/webpack/client-production/15.pack +0 -0
- package/website/.next/cache/webpack/client-production/16.pack +0 -0
- package/website/.next/cache/webpack/client-production/17.pack +0 -0
- package/website/.next/cache/webpack/client-production/18.pack +0 -0
- package/website/.next/cache/webpack/client-production/2.pack +0 -0
- package/website/.next/cache/webpack/client-production/3.pack +0 -0
- package/website/.next/cache/webpack/client-production/4.pack +0 -0
- package/website/.next/cache/webpack/client-production/5.pack +0 -0
- package/website/.next/cache/webpack/client-production/6.pack +0 -0
- package/website/.next/cache/webpack/client-production/7.pack +0 -0
- package/website/.next/cache/webpack/client-production/8.pack +0 -0
- package/website/.next/cache/webpack/client-production/9.pack +0 -0
- package/website/.next/cache/webpack/client-production/index.pack +0 -0
- package/website/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/website/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/website/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/website/.next/cache/webpack/server-production/0.pack +0 -0
- package/website/.next/cache/webpack/server-production/1.pack +0 -0
- package/website/.next/cache/webpack/server-production/10.pack +0 -0
- package/website/.next/cache/webpack/server-production/11.pack +0 -0
- package/website/.next/cache/webpack/server-production/12.pack +0 -0
- package/website/.next/cache/webpack/server-production/2.pack +0 -0
- package/website/.next/cache/webpack/server-production/3.pack +0 -0
- package/website/.next/cache/webpack/server-production/4.pack +0 -0
- package/website/.next/cache/webpack/server-production/5.pack +0 -0
- package/website/.next/cache/webpack/server-production/6.pack +0 -0
- package/website/.next/cache/webpack/server-production/7.pack +0 -0
- package/website/.next/cache/webpack/server-production/8.pack +0 -0
- package/website/.next/cache/webpack/server-production/9.pack +0 -0
- package/website/.next/cache/webpack/server-production/index.pack +0 -0
- package/website/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/website/.next/diagnostics/build-diagnostics.json +6 -0
- package/website/.next/diagnostics/framework.json +1 -0
- package/website/.next/export-detail.json +5 -0
- package/website/.next/export-marker.json +6 -0
- package/website/.next/images-manifest.json +57 -0
- package/website/.next/next-minimal-server.js.nft.json +1 -0
- package/website/.next/next-server.js.nft.json +1 -0
- package/website/.next/package.json +1 -0
- package/website/.next/prerender-manifest.json +2143 -0
- package/website/.next/react-loadable-manifest.json +1898 -0
- package/website/.next/required-server-files.json +320 -0
- package/website/.next/routes-manifest.json +161 -0
- package/website/.next/server/app/_not-found/page.js +2 -0
- package/website/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/website/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/_not-found.html +1 -0
- package/website/.next/server/app/_not-found.meta +8 -0
- package/website/.next/server/app/_not-found.rsc +23 -0
- package/website/.next/server/app/about/page.js +2 -0
- package/website/.next/server/app/about/page.js.nft.json +1 -0
- package/website/.next/server/app/about/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/about.html +1 -0
- package/website/.next/server/app/about.meta +7 -0
- package/website/.next/server/app/about.rsc +40 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.html +217 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.meta +7 -0
- package/website/.next/server/app/blog/OpenAPI-AI-Agents-Standard.rsc +308 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.html +180 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.meta +7 -0
- package/website/.next/server/app/blog/Why-Formal-Standards-Matter-Now.rsc +232 -0
- package/website/.next/server/app/blog/[slug]/page.js +2 -0
- package/website/.next/server/app/blog/[slug]/page.js.nft.json +1 -0
- package/website/.next/server/app/blog/[slug]/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.html +263 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.meta +7 -0
- package/website/.next/server/app/blog/introducing-ossa-framework.rsc +351 -0
- package/website/.next/server/app/blog/ossa-production-results.html +198 -0
- package/website/.next/server/app/blog/ossa-production-results.meta +7 -0
- package/website/.next/server/app/blog/ossa-production-results.rsc +302 -0
- package/website/.next/server/app/blog/page.js +2 -0
- package/website/.next/server/app/blog/page.js.nft.json +1 -0
- package/website/.next/server/app/blog/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/blog/welcome-to-ossa.html +22 -0
- package/website/.next/server/app/blog/welcome-to-ossa.meta +7 -0
- package/website/.next/server/app/blog/welcome-to-ossa.rsc +31 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.html +63 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.meta +7 -0
- package/website/.next/server/app/blog/why-ai-agents-need-open-standard.rsc +121 -0
- package/website/.next/server/app/blog.html +1 -0
- package/website/.next/server/app/blog.meta +7 -0
- package/website/.next/server/app/blog.rsc +35 -0
- package/website/.next/server/app/design-guide/page.js +12 -0
- package/website/.next/server/app/design-guide/page.js.nft.json +1 -0
- package/website/.next/server/app/design-guide/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/design-guide.html +11 -0
- package/website/.next/server/app/design-guide.meta +7 -0
- package/website/.next/server/app/design-guide.rsc +41 -0
- package/website/.next/server/app/docs.html +1 -0
- package/website/.next/server/app/docs.meta +7 -0
- package/website/.next/server/app/docs.rsc +42 -0
- package/website/.next/server/app/ecosystem/page.js +2 -0
- package/website/.next/server/app/ecosystem/page.js.nft.json +1 -0
- package/website/.next/server/app/ecosystem/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/ecosystem.html +1 -0
- package/website/.next/server/app/ecosystem.meta +7 -0
- package/website/.next/server/app/ecosystem.rsc +40 -0
- package/website/.next/server/app/examples.html +1 -0
- package/website/.next/server/app/examples.meta +7 -0
- package/website/.next/server/app/examples.rsc +14559 -0
- package/website/.next/server/app/index.html +3 -0
- package/website/.next/server/app/index.meta +7 -0
- package/website/.next/server/app/index.rsc +40 -0
- package/website/.next/server/app/license/page.js +2 -0
- package/website/.next/server/app/license/page.js.nft.json +1 -0
- package/website/.next/server/app/license/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/license.html +191 -0
- package/website/.next/server/app/license.meta +7 -0
- package/website/.next/server/app/license.rsc +222 -0
- package/website/.next/server/app/page.js +4 -0
- package/website/.next/server/app/page.js.nft.json +1 -0
- package/website/.next/server/app/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/playground/page.js +111 -0
- package/website/.next/server/app/playground/page.js.nft.json +1 -0
- package/website/.next/server/app/playground/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/playground.html +1 -0
- package/website/.next/server/app/playground.meta +7 -0
- package/website/.next/server/app/playground.rsc +30 -0
- package/website/.next/server/app/robots.txt/route.js +1 -0
- package/website/.next/server/app/robots.txt/route.js.nft.json +1 -0
- package/website/.next/server/app/robots.txt/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/robots.txt.body +6 -0
- package/website/.next/server/app/robots.txt.meta +1 -0
- package/website/.next/server/app/rss.xml/route.js +18 -0
- package/website/.next/server/app/rss.xml/route.js.nft.json +1 -0
- package/website/.next/server/app/rss.xml/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/rss.xml.body +11 -0
- package/website/.next/server/app/rss.xml.meta +1 -0
- package/website/.next/server/app/schema/page.js +76 -0
- package/website/.next/server/app/schema/page.js.nft.json +1 -0
- package/website/.next/server/app/schema/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/schema.html +1 -0
- package/website/.next/server/app/schema.meta +7 -0
- package/website/.next/server/app/schema.rsc +26 -0
- package/website/.next/server/app/sitemap.xml/route.js +1 -0
- package/website/.next/server/app/sitemap.xml/route.js.nft.json +1 -0
- package/website/.next/server/app/sitemap.xml/route_client-reference-manifest.js +1 -0
- package/website/.next/server/app/sitemap.xml.body +39 -0
- package/website/.next/server/app/sitemap.xml.meta +1 -0
- package/website/.next/server/app/specification/page.js +10 -0
- package/website/.next/server/app/specification/page.js.nft.json +1 -0
- package/website/.next/server/app/specification/page_client-reference-manifest.js +1 -0
- package/website/.next/server/app/specification.html +9 -0
- package/website/.next/server/app/specification.meta +7 -0
- package/website/.next/server/app/specification.rsc +32 -0
- package/website/.next/server/app-paths-manifest.json +19 -0
- package/website/.next/server/chunks/18.js +1 -0
- package/website/.next/server/chunks/227.js +9 -0
- package/website/.next/server/chunks/339.js +25 -0
- package/website/.next/server/chunks/49.js +1 -0
- package/website/.next/server/chunks/51.js +1 -0
- package/website/.next/server/chunks/57.js +1 -0
- package/website/.next/server/chunks/579.js +16 -0
- package/website/.next/server/chunks/611.js +6 -0
- package/website/.next/server/chunks/873.js +22 -0
- package/website/.next/server/chunks/900.js +1 -0
- package/website/.next/server/chunks/97.js +1 -0
- package/website/.next/server/functions-config-manifest.json +4 -0
- package/website/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/website/.next/server/middleware-build-manifest.js +1 -0
- package/website/.next/server/middleware-manifest.json +6 -0
- package/website/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/website/.next/server/next-font-manifest.js +1 -0
- package/website/.next/server/next-font-manifest.json +1 -0
- package/website/.next/server/pages/404.html +1 -0
- package/website/.next/server/pages/500.html +1 -0
- package/website/.next/server/pages/_app.js +1 -0
- package/website/.next/server/pages/_app.js.nft.json +1 -0
- package/website/.next/server/pages/_document.js +1 -0
- package/website/.next/server/pages/_document.js.nft.json +1 -0
- package/website/.next/server/pages/_error.js +19 -0
- package/website/.next/server/pages/_error.js.nft.json +1 -0
- package/website/.next/server/pages-manifest.json +6 -0
- package/website/.next/server/server-reference-manifest.js +1 -0
- package/website/.next/server/server-reference-manifest.json +1 -0
- package/website/.next/server/webpack-runtime.js +1 -0
- package/website/.next/static/IDhDQiozPwOaA3PpMqvTE/_buildManifest.js +1 -0
- package/website/.next/static/IDhDQiozPwOaA3PpMqvTE/_ssgManifest.js +1 -0
- package/website/.next/static/chunks/119.05f66060d7798fc9.js +25 -0
- package/website/.next/static/chunks/255-bf407b21685f2318.js +1 -0
- package/website/.next/static/chunks/451-235273497e501ae9.js +1 -0
- package/website/.next/static/chunks/4bd1b696-409494caf8c83275.js +1 -0
- package/website/.next/static/chunks/619-f072ac750404f9da.js +1 -0
- package/website/.next/static/chunks/651-5cd3c87d43b7eb46.js +1 -0
- package/website/.next/static/chunks/778.278ac2aadb2a1105.js +1 -0
- package/website/.next/static/chunks/890-ab915e0570e1961b.js +1 -0
- package/website/.next/static/chunks/app/_not-found/page-ccdaf9d90b537c5d.js +1 -0
- package/website/.next/static/chunks/app/about/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/blog/[slug]/page-8fd43000c4969233.js +1 -0
- package/website/.next/static/chunks/app/blog/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/design-guide/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/ecosystem/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/layout-ccacbd90656baa78.js +1 -0
- package/website/.next/static/chunks/app/license/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/app/page-31241dc7465f9590.js +1 -0
- package/website/.next/static/chunks/app/playground/page-c2af00885374900f.js +1 -0
- package/website/.next/static/chunks/app/robots.txt/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/rss.xml/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/schema/page-f7c224b281771083.js +1 -0
- package/website/.next/static/chunks/app/sitemap.xml/route-032c05054032342f.js +1 -0
- package/website/.next/static/chunks/app/specification/page-bd4cb2219b41f933.js +1 -0
- package/website/.next/static/chunks/framework-1ce91eb6f9ecda85.js +1 -0
- package/website/.next/static/chunks/main-3099e141650ec47a.js +1 -0
- package/website/.next/static/chunks/main-app-a2fc6ac9305e3090.js +1 -0
- package/website/.next/static/chunks/pages/_app-5addca2b3b969fde.js +1 -0
- package/website/.next/static/chunks/pages/_error-022e4ac7bbb9914f.js +1 -0
- package/website/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/website/.next/static/chunks/webpack-6ecb09e5c6e34cb4.js +1 -0
- package/website/.next/static/css/23135390005d4468.css +3 -0
- package/website/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/website/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/website/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/website/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/website/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/website/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/website/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/website/.next/trace +3 -0
- package/website/.next/types/app/about/page.ts +84 -0
- package/website/.next/types/app/blog/[slug]/page.ts +84 -0
- package/website/.next/types/app/blog/page.ts +84 -0
- package/website/.next/types/app/design-guide/page.ts +84 -0
- package/website/.next/types/app/ecosystem/page.ts +84 -0
- package/website/.next/types/app/license/page.ts +84 -0
- package/website/.next/types/app/page.ts +84 -0
- package/website/.next/types/app/playground/page.ts +84 -0
- package/website/.next/types/app/rss.xml/route.ts +347 -0
- package/website/.next/types/app/schema/page.ts +84 -0
- package/website/.next/types/app/specification/page.ts +84 -0
- package/website/.next/types/cache-life.d.ts +141 -0
- package/website/.next/types/package.json +1 -0
- package/website/.next/types/routes.d.ts +85 -0
- package/website/.next/types/validator.ts +187 -0
- package/website/.wiki-export/Agent-Folder-Structure.md +215 -0
- package/website/.wiki-export/CI-STATUS.md +66 -0
- package/website/.wiki-export/COMPLETE-IMPLEMENTATION-CHECKLIST.md +74 -0
- package/website/.wiki-export/DRUPAL-MODULE-INTEGRATION.md +103 -0
- package/website/.wiki-export/FINAL-STATUS.md +63 -0
- package/website/.wiki-export/Getting-Started.md +87 -0
- package/website/.wiki-export/INSTRUCTIONS.md +46 -0
- package/website/.wiki-export/INTEGRATION-ANALYSIS.md +216 -0
- package/website/.wiki-export/MANIFEST.json +62 -0
- package/website/.wiki-export/OSSA-COMPLIANT-BADGE.md +247 -0
- package/website/.wiki-export/Openapi-Extensions.md +930 -0
- package/website/.wiki-export/README.md +31 -0
- package/website/.wiki-export/RELEASE-READINESS.md +95 -0
- package/website/.wiki-export/VERSIONING.md +284 -0
- package/website/lib/versions.json +77 -0
- package/website/next-env.d.ts +6 -0
- package/website/out/app-build-manifest.json +3 -0
- package/website/out/build-manifest.json +17 -0
- package/website/out/cache/.rscinfo +1 -0
- package/website/out/cache/next-devtools-config.json +1 -0
- package/website/out/cache/webpack/client-development/0.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/1.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/2.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/3.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/index.pack.gz +0 -0
- package/website/out/cache/webpack/client-development/index.pack.gz.old +0 -0
- package/website/out/cache/webpack/client-development-fallback/0.pack.gz +0 -0
- package/website/out/cache/webpack/client-development-fallback/index.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/0.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/1.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/2.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/3.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/index.pack.gz +0 -0
- package/website/out/cache/webpack/server-development/index.pack.gz.old +0 -0
- package/website/out/package.json +1 -0
- package/website/out/prerender-manifest.json +11 -0
- package/website/out/react-loadable-manifest.json +1 -0
- package/website/out/routes-manifest.json +1 -0
- package/website/out/server/app-paths-manifest.json +1 -0
- package/website/out/server/interception-route-rewrite-manifest.js +1 -0
- package/website/out/server/middleware-build-manifest.js +19 -0
- package/website/out/server/middleware-manifest.json +6 -0
- package/website/out/server/middleware-react-loadable-manifest.js +1 -0
- package/website/out/server/next-font-manifest.js +1 -0
- package/website/out/server/next-font-manifest.json +1 -0
- package/website/out/server/pages-manifest.json +1 -0
- package/website/out/server/server-reference-manifest.js +1 -0
- package/website/out/server/server-reference-manifest.json +5 -0
- package/website/out/static/chunks/polyfills.js +1 -0
- package/website/out/static/development/_buildManifest.js +1 -0
- package/website/out/static/development/_ssgManifest.js +1 -0
- package/website/out/trace +2 -0
- package/website/out/types/cache-life.d.ts +141 -0
- package/website/out/types/package.json +1 -0
- package/website/out/types/routes.d.ts +85 -0
- package/website/out/types/validator.ts +187 -0
- package/website/public/examples.json +476 -0
- package/website/public/schemas/openapi-extensions.schema.json +486 -0
- package/website/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSSA Worktree Orchestration Service
|
|
3
|
+
* Coordinates git worktrees across multiple agents with intelligent flow management
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
|
+
import GitWorktreeManager from '../worktree/git-worktree-manager.js';
|
|
8
|
+
import BranchingStrategyManager from '../worktree/branching-strategy.js';
|
|
9
|
+
import { execSync } from 'child_process';
|
|
10
|
+
import { writeFileSync, readFileSync, existsSync } from 'fs';
|
|
11
|
+
import { join } from 'path';
|
|
12
|
+
|
|
13
|
+
export interface OrchestrationConfig {
|
|
14
|
+
maxConcurrentAgents: number;
|
|
15
|
+
coordinationStrategy: 'centralized' | 'decentralized' | 'hybrid';
|
|
16
|
+
flowAdaptationEnabled: boolean;
|
|
17
|
+
autoIntegrationEnabled: boolean;
|
|
18
|
+
conflictPreventionEnabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AgentWorkloadDistribution {
|
|
22
|
+
phase: number;
|
|
23
|
+
agentCount: number;
|
|
24
|
+
estimatedHours: number;
|
|
25
|
+
priority: string;
|
|
26
|
+
dependencies: string[];
|
|
27
|
+
parallelizable: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CoordinationMetrics {
|
|
31
|
+
totalAgents: number;
|
|
32
|
+
activeWorktrees: number;
|
|
33
|
+
integrationsPending: number;
|
|
34
|
+
conflictsDetected: number;
|
|
35
|
+
averageCompletionTime: number;
|
|
36
|
+
throughput: number;
|
|
37
|
+
utilizationRate: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class WorktreeOrchestrator extends EventEmitter {
|
|
41
|
+
private readonly worktreeManager: GitWorktreeManager;
|
|
42
|
+
private readonly branchingStrategy: BranchingStrategyManager;
|
|
43
|
+
private readonly config: OrchestrationConfig;
|
|
44
|
+
private readonly metricsHistory: CoordinationMetrics[] = [];
|
|
45
|
+
|
|
46
|
+
constructor(config: Partial<OrchestrationConfig> = {}) {
|
|
47
|
+
super();
|
|
48
|
+
|
|
49
|
+
this.config = {
|
|
50
|
+
maxConcurrentAgents: 25,
|
|
51
|
+
coordinationStrategy: 'hybrid',
|
|
52
|
+
flowAdaptationEnabled: true,
|
|
53
|
+
autoIntegrationEnabled: false,
|
|
54
|
+
conflictPreventionEnabled: true,
|
|
55
|
+
...config
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
this.worktreeManager = new GitWorktreeManager();
|
|
59
|
+
this.branchingStrategy = new BranchingStrategyManager();
|
|
60
|
+
|
|
61
|
+
this.setupEventHandlers();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private setupEventHandlers(): void {
|
|
65
|
+
// Worktree event monitoring
|
|
66
|
+
this.worktreeManager.on('worktree:created', this.handleWorktreeCreated.bind(this));
|
|
67
|
+
this.worktreeManager.on('worktree:synced', this.handleWorktreeSynced.bind(this));
|
|
68
|
+
this.worktreeManager.on('integration:merged', this.handleIntegrationMerged.bind(this));
|
|
69
|
+
this.worktreeManager.on('worktree:error', this.handleWorktreeError.bind(this));
|
|
70
|
+
|
|
71
|
+
// Periodic metrics collection
|
|
72
|
+
setInterval(() => this.collectMetrics(), 5 * 60 * 1000); // Every 5 minutes
|
|
73
|
+
|
|
74
|
+
// Flow adaptation check
|
|
75
|
+
if (this.config.flowAdaptationEnabled) {
|
|
76
|
+
setInterval(() => this.checkFlowAdaptation(), 15 * 60 * 1000); // Every 15 minutes
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Deploy multiple agents with intelligent worktree distribution
|
|
82
|
+
*/
|
|
83
|
+
async deployAgentSwarm(agents: Array<{
|
|
84
|
+
name: string;
|
|
85
|
+
specialization: string;
|
|
86
|
+
phase: number;
|
|
87
|
+
priority: string;
|
|
88
|
+
dependencies?: string[];
|
|
89
|
+
}>): Promise<{
|
|
90
|
+
deployed: string[];
|
|
91
|
+
failed: string[];
|
|
92
|
+
estimatedCompletion: Date;
|
|
93
|
+
}> {
|
|
94
|
+
|
|
95
|
+
console.log(`🚀 Deploying agent swarm: ${agents.length} agents`);
|
|
96
|
+
this.emit('swarm:deployment-started', { agentCount: agents.length });
|
|
97
|
+
|
|
98
|
+
// Analyze workload and optimize distribution
|
|
99
|
+
const workloadDistribution = this.analyzeWorkloadDistribution(agents);
|
|
100
|
+
const optimizedFlow = this.optimizeDeploymentFlow(workloadDistribution);
|
|
101
|
+
|
|
102
|
+
console.log(`📊 Workload analysis: ${workloadDistribution.length} phases, ${optimizedFlow} flow recommended`);
|
|
103
|
+
|
|
104
|
+
const deployed: string[] = [];
|
|
105
|
+
const failed: string[] = [];
|
|
106
|
+
const deploymentPromises: Promise<void>[] = [];
|
|
107
|
+
|
|
108
|
+
// Group agents by deployment strategy
|
|
109
|
+
const deploymentGroups = this.groupAgentsForDeployment(agents, optimizedFlow);
|
|
110
|
+
|
|
111
|
+
for (const group of deploymentGroups) {
|
|
112
|
+
if (deploymentPromises.length >= this.config.maxConcurrentAgents) {
|
|
113
|
+
// Wait for some deployments to complete before starting more
|
|
114
|
+
await Promise.race(deploymentPromises);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const deploymentPromise = this.deployAgentGroup(group)
|
|
118
|
+
.then(results => {
|
|
119
|
+
deployed.push(...results.deployed);
|
|
120
|
+
failed.push(...results.failed);
|
|
121
|
+
})
|
|
122
|
+
.catch(error => {
|
|
123
|
+
console.error(`Group deployment failed:`, error);
|
|
124
|
+
failed.push(...group.map(a => a.name));
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
deploymentPromises.push(deploymentPromise);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Wait for all deployments to complete
|
|
131
|
+
await Promise.allSettled(deploymentPromises);
|
|
132
|
+
|
|
133
|
+
const estimatedCompletion = this.estimateCompletionTime(deployed);
|
|
134
|
+
|
|
135
|
+
this.emit('swarm:deployment-completed', {
|
|
136
|
+
deployed: deployed.length,
|
|
137
|
+
failed: failed.length,
|
|
138
|
+
estimatedCompletion
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
return { deployed, failed, estimatedCompletion };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Deploy a group of agents with coordinated worktrees
|
|
146
|
+
*/
|
|
147
|
+
private async deployAgentGroup(agents: Array<{
|
|
148
|
+
name: string;
|
|
149
|
+
specialization: string;
|
|
150
|
+
phase: number;
|
|
151
|
+
priority: string;
|
|
152
|
+
dependencies?: string[];
|
|
153
|
+
}>): Promise<{deployed: string[], failed: string[]}> {
|
|
154
|
+
|
|
155
|
+
const deployed: string[] = [];
|
|
156
|
+
const failed: string[] = [];
|
|
157
|
+
|
|
158
|
+
// Sort agents by priority and dependencies
|
|
159
|
+
const sortedAgents = this.sortAgentsByDependencies(agents);
|
|
160
|
+
|
|
161
|
+
for (const agent of sortedAgents) {
|
|
162
|
+
try {
|
|
163
|
+
// Check if dependencies are met
|
|
164
|
+
if (agent.dependencies && !this.areDependenciesMet(agent.dependencies, deployed)) {
|
|
165
|
+
console.log(`⏸️ Waiting for dependencies for ${agent.name}: ${agent.dependencies.join(', ')}`);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Create worktree configuration
|
|
170
|
+
const branchRecommendations = this.branchingStrategy.getBranchNamingRecommendations(
|
|
171
|
+
agent.name,
|
|
172
|
+
agent.specialization,
|
|
173
|
+
agent.phase,
|
|
174
|
+
agent.priority
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const worktreeConfig = {
|
|
178
|
+
agentName: agent.name,
|
|
179
|
+
baseBranch: 'v0.1.9-dev',
|
|
180
|
+
featureBranch: branchRecommendations.primary,
|
|
181
|
+
workingDirectory: '',
|
|
182
|
+
gitRepository: process.cwd(),
|
|
183
|
+
ossaVersion: '0.1.9',
|
|
184
|
+
priority: agent.priority as any,
|
|
185
|
+
phase: agent.phase,
|
|
186
|
+
dependencies: agent.dependencies || []
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
// Deploy agent worktree
|
|
190
|
+
const worktreePath = await this.worktreeManager.createAgentWorktree(worktreeConfig);
|
|
191
|
+
|
|
192
|
+
// Setup agent-specific coordination
|
|
193
|
+
await this.setupAgentCoordination(agent.name, sortedAgents);
|
|
194
|
+
|
|
195
|
+
deployed.push(agent.name);
|
|
196
|
+
|
|
197
|
+
this.emit('agent:deployed', {
|
|
198
|
+
name: agent.name,
|
|
199
|
+
path: worktreePath,
|
|
200
|
+
branch: branchRecommendations.primary
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
} catch (error) {
|
|
204
|
+
console.error(`Failed to deploy agent ${agent.name}:`, (error as Error).message);
|
|
205
|
+
failed.push(agent.name);
|
|
206
|
+
|
|
207
|
+
this.emit('agent:deployment-failed', {
|
|
208
|
+
name: agent.name,
|
|
209
|
+
error: (error as Error).message
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return { deployed, failed };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Setup coordination configuration for an agent
|
|
219
|
+
*/
|
|
220
|
+
private async setupAgentCoordination(
|
|
221
|
+
agentName: string,
|
|
222
|
+
allAgents: Array<{ name: string; dependencies?: string[] }>
|
|
223
|
+
): Promise<void> {
|
|
224
|
+
|
|
225
|
+
const config = this.worktreeManager.loadWorktreeConfig(agentName);
|
|
226
|
+
if (!config) return;
|
|
227
|
+
|
|
228
|
+
// Determine peer agents (same phase, no dependencies)
|
|
229
|
+
const agent = allAgents.find(a => a.name === agentName);
|
|
230
|
+
const peerAgents = allAgents
|
|
231
|
+
.filter(a => a.name !== agentName && !a.dependencies?.includes(agentName))
|
|
232
|
+
.map(a => a.name);
|
|
233
|
+
|
|
234
|
+
// Determine dependent agents
|
|
235
|
+
const dependentAgents = allAgents
|
|
236
|
+
.filter(a => a.dependencies?.includes(agentName))
|
|
237
|
+
.map(a => a.name);
|
|
238
|
+
|
|
239
|
+
// Create coordination configuration
|
|
240
|
+
const coordinationConfig = {
|
|
241
|
+
coordinatorAgent: 'master-orchestration-coordinator',
|
|
242
|
+
peerAgents,
|
|
243
|
+
dependentAgents,
|
|
244
|
+
integrationBranch: `integration/v0.1.9-phase-${config.phase}-${Date.now()}`,
|
|
245
|
+
syncSchedule: config.priority === 'critical' ? 'immediate' : 'hourly',
|
|
246
|
+
conflictResolutionPriority: this.calculateConflictPriority(config.priority, config.phase)
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// Save coordination configuration
|
|
250
|
+
const coordinationPath = join(config.workingDirectory, '.agents-workspace/config/coordination.json');
|
|
251
|
+
writeFileSync(coordinationPath, JSON.stringify(coordinationConfig, null, 2));
|
|
252
|
+
|
|
253
|
+
this.emit('coordination:configured', { agent: agentName, coordination: coordinationConfig });
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Analyze workload distribution for optimal deployment
|
|
258
|
+
*/
|
|
259
|
+
private analyzeWorkloadDistribution(agents: Array<{
|
|
260
|
+
name: string;
|
|
261
|
+
specialization: string;
|
|
262
|
+
phase: number;
|
|
263
|
+
priority: string;
|
|
264
|
+
dependencies?: string[];
|
|
265
|
+
}>): AgentWorkloadDistribution[] {
|
|
266
|
+
|
|
267
|
+
const phases = new Map<number, typeof agents>();
|
|
268
|
+
|
|
269
|
+
// Group agents by phase
|
|
270
|
+
agents.forEach(agent => {
|
|
271
|
+
if (!phases.has(agent.phase)) {
|
|
272
|
+
phases.set(agent.phase, []);
|
|
273
|
+
}
|
|
274
|
+
phases.get(agent.phase)!.push(agent);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// Calculate workload distribution
|
|
278
|
+
return Array.from(phases.entries()).map(([phase, phaseAgents]) => {
|
|
279
|
+
const criticalCount = phaseAgents.filter(a => a.priority === 'critical').length;
|
|
280
|
+
const highCount = phaseAgents.filter(a => a.priority === 'high').length;
|
|
281
|
+
|
|
282
|
+
// Estimate based on priority and complexity
|
|
283
|
+
const estimatedHours = this.estimatePhaseHours(phase, phaseAgents);
|
|
284
|
+
|
|
285
|
+
// Check if phase work can be parallelized
|
|
286
|
+
const totalDependencies = phaseAgents.reduce((acc, agent) => acc + (agent.dependencies?.length || 0), 0);
|
|
287
|
+
const parallelizable = totalDependencies < phaseAgents.length * 0.3; // Less than 30% have dependencies
|
|
288
|
+
|
|
289
|
+
return {
|
|
290
|
+
phase,
|
|
291
|
+
agentCount: phaseAgents.length,
|
|
292
|
+
estimatedHours,
|
|
293
|
+
priority: criticalCount > 0 ? 'critical' : highCount > 0 ? 'high' : 'medium',
|
|
294
|
+
dependencies: Array.from(new Set(phaseAgents.flatMap(a => a.dependencies || []))),
|
|
295
|
+
parallelizable
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Optimize deployment flow based on workload analysis
|
|
302
|
+
*/
|
|
303
|
+
private optimizeDeploymentFlow(workload: AgentWorkloadDistribution[]): string {
|
|
304
|
+
const totalAgents = workload.reduce((sum, phase) => sum + phase.agentCount, 0);
|
|
305
|
+
const hasCritical = workload.some(phase => phase.priority === 'critical');
|
|
306
|
+
const highlyParallelizable = workload.every(phase => phase.parallelizable);
|
|
307
|
+
const complexPhases = workload.filter(phase => phase.agentCount > 10);
|
|
308
|
+
|
|
309
|
+
if (hasCritical && totalAgents < 20) {
|
|
310
|
+
return 'sequential';
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (highlyParallelizable && totalAgents > 30) {
|
|
314
|
+
return 'parallel';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (complexPhases.length > 2) {
|
|
318
|
+
return 'cascade';
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return 'adaptive';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Group agents for optimal deployment coordination
|
|
326
|
+
*/
|
|
327
|
+
private groupAgentsForDeployment(
|
|
328
|
+
agents: Array<{ name: string; specialization: string; phase: number; priority: string; dependencies?: string[]; }>,
|
|
329
|
+
flow: string
|
|
330
|
+
): Array<typeof agents> {
|
|
331
|
+
|
|
332
|
+
switch (flow) {
|
|
333
|
+
case 'sequential':
|
|
334
|
+
// Deploy one agent at a time, respecting dependencies
|
|
335
|
+
return agents.map(agent => [agent]);
|
|
336
|
+
|
|
337
|
+
case 'parallel':
|
|
338
|
+
// Group by phase, deploy phases in parallel
|
|
339
|
+
const phaseGroups = new Map<number, typeof agents>();
|
|
340
|
+
agents.forEach(agent => {
|
|
341
|
+
if (!phaseGroups.has(agent.phase)) {
|
|
342
|
+
phaseGroups.set(agent.phase, []);
|
|
343
|
+
}
|
|
344
|
+
phaseGroups.get(agent.phase)!.push(agent);
|
|
345
|
+
});
|
|
346
|
+
return Array.from(phaseGroups.values());
|
|
347
|
+
|
|
348
|
+
case 'cascade':
|
|
349
|
+
// Group by specialization, cascade through phases
|
|
350
|
+
const specializationGroups = new Map<string, typeof agents>();
|
|
351
|
+
agents.forEach(agent => {
|
|
352
|
+
if (!specializationGroups.has(agent.specialization)) {
|
|
353
|
+
specializationGroups.set(agent.specialization, []);
|
|
354
|
+
}
|
|
355
|
+
specializationGroups.get(agent.specialization)!.push(agent);
|
|
356
|
+
});
|
|
357
|
+
return Array.from(specializationGroups.values());
|
|
358
|
+
|
|
359
|
+
case 'adaptive':
|
|
360
|
+
default:
|
|
361
|
+
// Adaptive grouping based on dependencies and priority
|
|
362
|
+
return this.createAdaptiveGroups(agents);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Create adaptive deployment groups based on dependencies and priority
|
|
368
|
+
*/
|
|
369
|
+
private createAdaptiveGroups(agents: Array<{
|
|
370
|
+
name: string;
|
|
371
|
+
specialization: string;
|
|
372
|
+
phase: number;
|
|
373
|
+
priority: string;
|
|
374
|
+
dependencies?: string[];
|
|
375
|
+
}>): Array<typeof agents> {
|
|
376
|
+
|
|
377
|
+
const groups: Array<typeof agents> = [];
|
|
378
|
+
const processed = new Set<string>();
|
|
379
|
+
|
|
380
|
+
// First pass: critical priority agents with no dependencies
|
|
381
|
+
const criticalNoDeps = agents.filter(a =>
|
|
382
|
+
a.priority === 'critical' && (!a.dependencies || a.dependencies.length === 0)
|
|
383
|
+
);
|
|
384
|
+
if (criticalNoDeps.length > 0) {
|
|
385
|
+
groups.push(criticalNoDeps);
|
|
386
|
+
criticalNoDeps.forEach(a => processed.add(a.name));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Second pass: group agents by phase and specialization
|
|
390
|
+
const remaining = agents.filter(a => !processed.has(a.name));
|
|
391
|
+
const phaseSpecGroups = new Map<string, typeof agents>();
|
|
392
|
+
|
|
393
|
+
remaining.forEach(agent => {
|
|
394
|
+
const key = `phase-${agent.phase}-${agent.specialization}`;
|
|
395
|
+
if (!phaseSpecGroups.has(key)) {
|
|
396
|
+
phaseSpecGroups.set(key, []);
|
|
397
|
+
}
|
|
398
|
+
phaseSpecGroups.get(key)!.push(agent);
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// Add remaining groups, sorted by priority
|
|
402
|
+
const sortedGroups = Array.from(phaseSpecGroups.values())
|
|
403
|
+
.sort((a, b) => {
|
|
404
|
+
const priorityWeight = { critical: 4, high: 3, medium: 2, low: 1 };
|
|
405
|
+
const aWeight = Math.max(...a.map(agent => priorityWeight[agent.priority as keyof typeof priorityWeight]));
|
|
406
|
+
const bWeight = Math.max(...b.map(agent => priorityWeight[agent.priority as keyof typeof priorityWeight]));
|
|
407
|
+
return bWeight - aWeight;
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
groups.push(...sortedGroups);
|
|
411
|
+
|
|
412
|
+
return groups;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Handle worktree creation events
|
|
417
|
+
*/
|
|
418
|
+
private handleWorktreeCreated(event: { agent: string; branch: string; path: string }): void {
|
|
419
|
+
console.log(`✅ Worktree created for ${event.agent}: ${event.branch}`);
|
|
420
|
+
this.emit('orchestration:agent-ready', event);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Handle worktree synchronization events
|
|
425
|
+
*/
|
|
426
|
+
private handleWorktreeSynced(event: { agent: string; branch: string }): void {
|
|
427
|
+
console.log(`🔄 Worktree synced for ${event.agent}: ${event.branch}`);
|
|
428
|
+
this.checkAutoIntegration(event.agent);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Handle integration merge events
|
|
433
|
+
*/
|
|
434
|
+
private handleIntegrationMerged(event: { agent: string; branch: string; integrationBranch: string }): void {
|
|
435
|
+
console.log(`🔀 Integration merged: ${event.agent} → ${event.integrationBranch}`);
|
|
436
|
+
this.emit('orchestration:integration-completed', event);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Handle worktree error events
|
|
441
|
+
*/
|
|
442
|
+
private handleWorktreeError(event: { agent: string; error: string }): void {
|
|
443
|
+
console.error(`❌ Worktree error for ${event.agent}: ${event.error}`);
|
|
444
|
+
this.emit('orchestration:agent-error', event);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Check if auto-integration should be triggered
|
|
449
|
+
*/
|
|
450
|
+
private checkAutoIntegration(agentName: string): void {
|
|
451
|
+
if (!this.config.autoIntegrationEnabled) return;
|
|
452
|
+
|
|
453
|
+
const config = this.worktreeManager.loadWorktreeConfig(agentName);
|
|
454
|
+
if (!config) return;
|
|
455
|
+
|
|
456
|
+
const branchAwareness = this.worktreeManager.getBranchAwareness(agentName);
|
|
457
|
+
if (!branchAwareness?.canAutoMerge) return;
|
|
458
|
+
|
|
459
|
+
// Check if all peer agents are ready for integration
|
|
460
|
+
const coordinationPath = join(config.workingDirectory, '.agents-workspace/config/coordination.json');
|
|
461
|
+
if (!existsSync(coordinationPath)) return;
|
|
462
|
+
|
|
463
|
+
const coordination = JSON.parse(readFileSync(coordinationPath, 'utf-8'));
|
|
464
|
+
const peerAgents = coordination.peerAgents || [];
|
|
465
|
+
|
|
466
|
+
const readyPeers = peerAgents.filter((peer: string) => {
|
|
467
|
+
const peerConfig = this.worktreeManager.loadWorktreeConfig(peer);
|
|
468
|
+
return peerConfig && this.isAgentReady(peer);
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
if (readyPeers.length === peerAgents.length) {
|
|
472
|
+
// All peers ready, trigger integration
|
|
473
|
+
this.triggerIntegration([agentName, ...peerAgents]);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Trigger integration for a group of agents
|
|
479
|
+
*/
|
|
480
|
+
private async triggerIntegration(agentNames: string[]): Promise<void> {
|
|
481
|
+
try {
|
|
482
|
+
const integrationBranch = await this.worktreeManager.coordinateIntegration(agentNames);
|
|
483
|
+
console.log(`🔀 Auto-integration triggered: ${agentNames.join(', ')} → ${integrationBranch}`);
|
|
484
|
+
|
|
485
|
+
this.emit('orchestration:auto-integration', {
|
|
486
|
+
agents: agentNames,
|
|
487
|
+
integrationBranch
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
} catch (error) {
|
|
491
|
+
console.error('Auto-integration failed:', (error as Error).message);
|
|
492
|
+
this.emit('orchestration:integration-failed', {
|
|
493
|
+
agents: agentNames,
|
|
494
|
+
error: (error as Error).message
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Check if agent is ready for integration
|
|
501
|
+
*/
|
|
502
|
+
private isAgentReady(agentName: string): boolean {
|
|
503
|
+
const config = this.worktreeManager.loadWorktreeConfig(agentName);
|
|
504
|
+
if (!config) return false;
|
|
505
|
+
|
|
506
|
+
try {
|
|
507
|
+
// Check if there are uncommitted changes
|
|
508
|
+
const status = execSync('git status --porcelain', {
|
|
509
|
+
cwd: config.workingDirectory,
|
|
510
|
+
encoding: 'utf-8'
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
// Agent is ready if there are no uncommitted changes
|
|
514
|
+
return status.trim().length === 0;
|
|
515
|
+
|
|
516
|
+
} catch (error) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Collect coordination metrics
|
|
523
|
+
*/
|
|
524
|
+
private collectMetrics(): void {
|
|
525
|
+
const activeWorktrees = this.worktreeManager.listActiveWorktrees();
|
|
526
|
+
|
|
527
|
+
const metrics: CoordinationMetrics = {
|
|
528
|
+
totalAgents: activeWorktrees.length,
|
|
529
|
+
activeWorktrees: activeWorktrees.length,
|
|
530
|
+
integrationsPending: this.calculateIntegrationsPending(activeWorktrees),
|
|
531
|
+
conflictsDetected: this.detectConflicts(activeWorktrees),
|
|
532
|
+
averageCompletionTime: this.calculateAverageCompletionTime(),
|
|
533
|
+
throughput: this.calculateThroughput(),
|
|
534
|
+
utilizationRate: this.calculateUtilizationRate(activeWorktrees)
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
this.metricsHistory.push(metrics);
|
|
538
|
+
|
|
539
|
+
// Keep only last 24 hours of metrics (288 5-minute intervals)
|
|
540
|
+
if (this.metricsHistory.length > 288) {
|
|
541
|
+
this.metricsHistory.shift();
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
this.emit('orchestration:metrics', metrics);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Calculate number of pending integrations from git state
|
|
549
|
+
*/
|
|
550
|
+
private calculateIntegrationsPending(activeWorktrees: Array<any>): number {
|
|
551
|
+
let pendingCount = 0;
|
|
552
|
+
|
|
553
|
+
for (const worktree of activeWorktrees) {
|
|
554
|
+
try {
|
|
555
|
+
// Check if worktree has commits ready for integration
|
|
556
|
+
const agentConfig = this.worktreeManager.loadWorktreeConfig(worktree.agentName);
|
|
557
|
+
if (agentConfig) {
|
|
558
|
+
const branchAwareness = this.worktreeManager.getBranchAwareness(worktree.agentName);
|
|
559
|
+
|
|
560
|
+
// Count branches with commits ahead of their base
|
|
561
|
+
if (branchAwareness.commitsAhead > 0 && !branchAwareness.hasConflicts) {
|
|
562
|
+
pendingCount++;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
} catch (error) {
|
|
566
|
+
// Skip if unable to check git state
|
|
567
|
+
console.warn(`Unable to check integration status for ${worktree.agentName}:`, (error as Error).message);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return pendingCount;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Detect conflicts across active worktrees
|
|
576
|
+
*/
|
|
577
|
+
private detectConflicts(activeWorktrees: Array<any>): number {
|
|
578
|
+
let conflictCount = 0;
|
|
579
|
+
|
|
580
|
+
for (const worktree of activeWorktrees) {
|
|
581
|
+
try {
|
|
582
|
+
const branchAwareness = this.worktreeManager.getBranchAwareness(worktree.agentName);
|
|
583
|
+
if (branchAwareness.hasConflicts) {
|
|
584
|
+
conflictCount++;
|
|
585
|
+
}
|
|
586
|
+
} catch (error) {
|
|
587
|
+
// Skip if unable to check git state
|
|
588
|
+
console.warn(`Unable to check conflict status for ${worktree.agentName}:`, (error as Error).message);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return conflictCount;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Calculate average completion time from historical data
|
|
597
|
+
*/
|
|
598
|
+
private calculateAverageCompletionTime(): number {
|
|
599
|
+
if (this.metricsHistory.length < 2) {
|
|
600
|
+
return 0;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// Calculate based on agent completion rates over time
|
|
604
|
+
const recentMetrics = this.metricsHistory.slice(-12); // Last hour (12 * 5-minute intervals)
|
|
605
|
+
let totalCompletionTime = 0;
|
|
606
|
+
let completions = 0;
|
|
607
|
+
|
|
608
|
+
for (let i = 1; i < recentMetrics.length; i++) {
|
|
609
|
+
const previous = recentMetrics[i - 1];
|
|
610
|
+
const current = recentMetrics[i];
|
|
611
|
+
|
|
612
|
+
// If active agents decreased, some completed
|
|
613
|
+
if (previous.activeWorktrees > current.activeWorktrees) {
|
|
614
|
+
const completedAgents = previous.activeWorktrees - current.activeWorktrees;
|
|
615
|
+
totalCompletionTime += 5; // 5 minutes per interval
|
|
616
|
+
completions += completedAgents;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
return completions > 0 ? totalCompletionTime / completions : 0;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Calculate throughput (commits per hour)
|
|
625
|
+
*/
|
|
626
|
+
private calculateThroughput(): number {
|
|
627
|
+
if (this.metricsHistory.length < 12) {
|
|
628
|
+
return 0;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// Count integrations completed in the last hour
|
|
632
|
+
const recentMetrics = this.metricsHistory.slice(-12); // Last hour
|
|
633
|
+
let totalIntegrations = 0;
|
|
634
|
+
|
|
635
|
+
for (let i = 1; i < recentMetrics.length; i++) {
|
|
636
|
+
const previous = recentMetrics[i - 1];
|
|
637
|
+
const current = recentMetrics[i];
|
|
638
|
+
|
|
639
|
+
// If pending integrations decreased, they were completed
|
|
640
|
+
if (previous.integrationsPending > current.integrationsPending) {
|
|
641
|
+
totalIntegrations += previous.integrationsPending - current.integrationsPending;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// Convert to commits per hour (12 intervals = 1 hour)
|
|
646
|
+
return totalIntegrations;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Calculate utilization rate from agent activity
|
|
651
|
+
*/
|
|
652
|
+
private calculateUtilizationRate(activeWorktrees: Array<any>): number {
|
|
653
|
+
if (activeWorktrees.length === 0) {
|
|
654
|
+
return 0;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
let activeAgents = 0;
|
|
658
|
+
|
|
659
|
+
for (const worktree of activeWorktrees) {
|
|
660
|
+
try {
|
|
661
|
+
const branchAwareness = this.worktreeManager.getBranchAwareness(worktree.agentName);
|
|
662
|
+
|
|
663
|
+
// Consider agent active if it has recent commits or pending changes
|
|
664
|
+
if (branchAwareness.commitsAhead > 0 || branchAwareness.hasUncommittedChanges) {
|
|
665
|
+
activeAgents++;
|
|
666
|
+
}
|
|
667
|
+
} catch (error) {
|
|
668
|
+
// Skip if unable to check activity
|
|
669
|
+
console.warn(`Unable to check activity for ${worktree.agentName}:`, (error as Error).message);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
// Return percentage of active agents
|
|
674
|
+
return Math.round((activeAgents / Math.max(activeWorktrees.length, this.config.maxConcurrentAgents)) * 100);
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Check if flow adaptation is needed
|
|
679
|
+
*/
|
|
680
|
+
private checkFlowAdaptation(): void {
|
|
681
|
+
if (this.metricsHistory.length < 3) return; // Need some history
|
|
682
|
+
|
|
683
|
+
const recent = this.metricsHistory.slice(-3);
|
|
684
|
+
const avgConflicts = recent.reduce((sum, m) => sum + m.conflictsDetected, 0) / recent.length;
|
|
685
|
+
const avgUtilization = recent.reduce((sum, m) => sum + m.utilizationRate, 0) / recent.length;
|
|
686
|
+
|
|
687
|
+
// Simple adaptation logic - can be made more sophisticated
|
|
688
|
+
if (avgConflicts > 0.1) {
|
|
689
|
+
this.emit('orchestration:adaptation-needed', {
|
|
690
|
+
reason: 'High conflict rate',
|
|
691
|
+
recommendation: 'Switch to sequential flow',
|
|
692
|
+
metrics: { conflicts: avgConflicts, utilization: avgUtilization }
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// Utility methods
|
|
698
|
+
private sortAgentsByDependencies<T extends { name: string; dependencies?: string[] }>(agents: Array<T>): Array<T> {
|
|
699
|
+
const sorted: typeof agents = [];
|
|
700
|
+
const remaining = [...agents];
|
|
701
|
+
|
|
702
|
+
while (remaining.length > 0) {
|
|
703
|
+
const nextBatch = remaining.filter(agent =>
|
|
704
|
+
!agent.dependencies ||
|
|
705
|
+
agent.dependencies.every(dep => sorted.some(s => s.name === dep))
|
|
706
|
+
);
|
|
707
|
+
|
|
708
|
+
if (nextBatch.length === 0) {
|
|
709
|
+
// Circular dependency detected, add remaining agents
|
|
710
|
+
sorted.push(...remaining);
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
sorted.push(...nextBatch);
|
|
715
|
+
nextBatch.forEach(agent => {
|
|
716
|
+
const index = remaining.indexOf(agent);
|
|
717
|
+
remaining.splice(index, 1);
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
return sorted;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
private areDependenciesMet(dependencies: string[], deployed: string[]): boolean {
|
|
725
|
+
return dependencies.every(dep => deployed.includes(dep));
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
private calculateConflictPriority(priority: string, phase: number): number {
|
|
729
|
+
const priorityWeight = { critical: 4, high: 3, medium: 2, low: 1 };
|
|
730
|
+
return (priorityWeight[priority as keyof typeof priorityWeight] || 1) * phase;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
private estimatePhaseHours(phase: number, agents: Array<{ specialization: string; priority: string }>): number {
|
|
734
|
+
// Rough estimation based on phase complexity and agent specializations
|
|
735
|
+
const baseHours = { 1: 40, 2: 60, 3: 30, 4: 20 }[phase] || 40;
|
|
736
|
+
const specializationMultiplier = agents.reduce((sum, agent) => {
|
|
737
|
+
const multipliers = {
|
|
738
|
+
'cli-infrastructure': 1.0,
|
|
739
|
+
'industrial-protocols': 1.5,
|
|
740
|
+
'production-analytics': 1.2,
|
|
741
|
+
'multi-modal': 1.8,
|
|
742
|
+
'security-framework': 1.3,
|
|
743
|
+
'knowledge-management': 1.1,
|
|
744
|
+
'quality-assurance': 0.8,
|
|
745
|
+
'coordination': 0.9
|
|
746
|
+
};
|
|
747
|
+
return sum + (multipliers[agent.specialization as keyof typeof multipliers] || 1.0);
|
|
748
|
+
}, 0) / agents.length;
|
|
749
|
+
|
|
750
|
+
return Math.round(baseHours * specializationMultiplier);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
private estimateCompletionTime(deployedAgents: string[]): Date {
|
|
754
|
+
// Simple estimation - can be made more sophisticated
|
|
755
|
+
const baseHoursPerAgent = 8;
|
|
756
|
+
const totalHours = deployedAgents.length * baseHoursPerAgent;
|
|
757
|
+
const parallelizationFactor = Math.min(this.config.maxConcurrentAgents / deployedAgents.length, 1);
|
|
758
|
+
const adjustedHours = totalHours * parallelizationFactor;
|
|
759
|
+
|
|
760
|
+
return new Date(Date.now() + adjustedHours * 60 * 60 * 1000);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Get current orchestration status
|
|
765
|
+
*/
|
|
766
|
+
getOrchestrationStatus(): {
|
|
767
|
+
config: OrchestrationConfig;
|
|
768
|
+
metrics: CoordinationMetrics | null;
|
|
769
|
+
activeAgents: string[];
|
|
770
|
+
} {
|
|
771
|
+
return {
|
|
772
|
+
config: this.config,
|
|
773
|
+
metrics: this.metricsHistory[this.metricsHistory.length - 1] || null,
|
|
774
|
+
activeAgents: this.worktreeManager.listActiveWorktrees().map(w => w.agent)
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export default WorktreeOrchestrator;
|