agent-enderun 1.1.3 ā 1.1.5
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/.github/workflows/ci.yml +40 -0
- package/ENDERUN.md +36 -38
- package/README.md +16 -8
- package/bin/validate-agent-army.js +27 -12
- package/dist/framework-mcp/src/index.js +7 -1
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +1 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +3 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.js +7 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +3 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +41 -11
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/types.d.ts +1 -0
- package/{framework-mcp/dist ā dist/framework-mcp}/tests/tools/file_system/file_system_tools.test.js +40 -0
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +115 -0
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -0
- package/dist/init-adapters/antigravity-cli/.agents/config.json +1 -1
- package/dist/init-adapters/antigravity-cli/.agents/knowledge/agents-manifest.md +79 -0
- package/dist/init-adapters/antigravity-cli/.agents/knowledge/approval-flows.md +61 -0
- package/dist/init-adapters/antigravity-cli/.agents/knowledge/enterprise-architecture.md +69 -0
- package/dist/init-adapters/antigravity-cli/.agents/knowledge/eslint-standards.md +10 -0
- package/dist/init-adapters/antigravity-cli/.agents/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/antigravity-cli/.agents/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/antigravity-cli/.agents/observability/audit_log.md +5 -0
- package/dist/init-adapters/antigravity-cli/.agents/observability/telemetry.md +6 -0
- package/dist/init-adapters/antigravity-cli/.agents/registry/agent_registry.md +18 -0
- package/dist/init-adapters/antigravity-cli/.agents/router/routing_rules.md +8 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/analyst.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/architect.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/backend.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/database.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/devops.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/explorer.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/frontend.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/git.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/manager.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/mobile.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/native.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/quality.md +16 -0
- package/dist/init-adapters/antigravity-cli/.agents/rules/security.md +16 -0
- package/dist/init-adapters/antigravity-cli/AGENTS.md +7 -0
- package/dist/init-adapters/antigravity-cli/ENDERUN.md +36 -38
- package/dist/init-adapters/antigravity-cli/docs/README.md +6 -0
- package/dist/init-adapters/antigravity-cli/docs/getting-started.md +4 -0
- package/dist/init-adapters/claude/.claude/agents/analyst.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/architect.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/backend.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/database.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/devops.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/explorer.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/frontend.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/git.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/manager.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/mobile.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/native.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/quality.md +4 -2
- package/dist/init-adapters/claude/.claude/agents/security.md +4 -2
- package/dist/init-adapters/claude/.claude/config.json +1 -1
- package/dist/init-adapters/claude/.claude/knowledge/agents-manifest.md +79 -0
- package/dist/init-adapters/claude/.claude/knowledge/approval-flows.md +61 -0
- package/dist/init-adapters/claude/.claude/knowledge/component-patterns.md +91 -0
- package/dist/init-adapters/claude/.claude/knowledge/data-fetching-patterns.md +13 -0
- package/dist/init-adapters/claude/.claude/knowledge/design-system.md +31 -0
- package/dist/init-adapters/claude/.claude/knowledge/enterprise-architecture.md +69 -0
- package/dist/init-adapters/claude/.claude/knowledge/error-handling.md +74 -0
- package/dist/init-adapters/claude/.claude/knowledge/eslint-standards.md +10 -0
- package/dist/init-adapters/claude/.claude/knowledge/logging.md +7 -0
- package/dist/init-adapters/claude/.claude/knowledge/tech-stack.md +9 -0
- package/dist/init-adapters/claude/.claude/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/claude/.claude/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/claude/.claude/observability/audit_log.md +5 -0
- package/dist/init-adapters/claude/.claude/observability/telemetry.md +6 -0
- package/dist/init-adapters/claude/.claude/registry/agent_registry.md +18 -0
- package/dist/init-adapters/claude/.claude/router/routing_rules.md +8 -0
- package/dist/init-adapters/claude/.claude/rules/analyst.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/architect.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/backend.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/database.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/devops.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/explorer.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/frontend.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/git.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/manager.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/mobile.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/native.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/quality.md +16 -0
- package/dist/init-adapters/claude/.claude/rules/security.md +16 -0
- package/dist/init-adapters/claude/CLAUDE.md +7 -0
- package/dist/init-adapters/claude/ENDERUN.md +36 -38
- package/dist/init-adapters/claude/docs/README.md +6 -0
- package/dist/init-adapters/claude/docs/getting-started.md +4 -0
- package/dist/init-adapters/codex/.github/agents/analyst.md +4 -2
- package/dist/init-adapters/codex/.github/agents/architect.md +4 -2
- package/dist/init-adapters/codex/.github/agents/backend.md +4 -2
- package/dist/init-adapters/codex/.github/agents/database.md +4 -2
- package/dist/init-adapters/codex/.github/agents/devops.md +4 -2
- package/dist/init-adapters/codex/.github/agents/explorer.md +4 -2
- package/dist/init-adapters/codex/.github/agents/frontend.md +4 -2
- package/dist/init-adapters/codex/.github/agents/git.md +4 -2
- package/dist/init-adapters/codex/.github/agents/manager.md +4 -2
- package/dist/init-adapters/codex/.github/agents/mobile.md +4 -2
- package/dist/init-adapters/codex/.github/agents/native.md +4 -2
- package/dist/init-adapters/codex/.github/agents/quality.md +4 -2
- package/dist/init-adapters/codex/.github/agents/security.md +4 -2
- package/dist/init-adapters/codex/.github/config.json +1 -1
- package/dist/init-adapters/codex/.github/instructions/agents-manifest.md +79 -0
- package/dist/init-adapters/codex/.github/instructions/analyst.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/approval-flows.md +61 -0
- package/dist/init-adapters/codex/.github/instructions/architect.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/backend.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/component-patterns.md +91 -0
- package/dist/init-adapters/codex/.github/instructions/data-fetching-patterns.md +13 -0
- package/dist/init-adapters/codex/.github/instructions/database.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/design-system.md +31 -0
- package/dist/init-adapters/codex/.github/instructions/devops.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/enterprise-architecture.md +69 -0
- package/dist/init-adapters/codex/.github/instructions/error-handling.md +74 -0
- package/dist/init-adapters/codex/.github/instructions/eslint-standards.md +10 -0
- package/dist/init-adapters/codex/.github/instructions/explorer.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/frontend.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/git.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/logging.md +7 -0
- package/dist/init-adapters/codex/.github/instructions/manager.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/mobile.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/native.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/quality.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/security.md +16 -0
- package/dist/init-adapters/codex/.github/instructions/tech-stack.md +9 -0
- package/dist/init-adapters/codex/.github/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/codex/.github/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/codex/.github/observability/audit_log.md +5 -0
- package/dist/init-adapters/codex/.github/observability/telemetry.md +6 -0
- package/dist/init-adapters/codex/.github/registry/agent_registry.md +18 -0
- package/dist/init-adapters/codex/.github/router/routing_rules.md +8 -0
- package/dist/init-adapters/codex/ENDERUN.md +36 -38
- package/dist/init-adapters/codex/copilot-instructions.md +7 -1
- package/dist/init-adapters/codex/docs/README.md +6 -0
- package/dist/init-adapters/codex/docs/getting-started.md +4 -0
- package/dist/init-adapters/cursor/.cursor/agents/analyst.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/architect.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/backend.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/database.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/devops.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/explorer.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/frontend.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/git.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/manager.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/mobile.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/native.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/quality.md +4 -2
- package/dist/init-adapters/cursor/.cursor/agents/security.md +4 -2
- package/dist/init-adapters/cursor/.cursor/config.json +1 -1
- package/dist/init-adapters/cursor/.cursor/knowledge/agents-manifest.md +79 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/approval-flows.md +61 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/component-patterns.md +91 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/data-fetching-patterns.md +13 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/design-system.md +31 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/enterprise-architecture.md +69 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/error-handling.md +74 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/eslint-standards.md +10 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/logging.md +7 -0
- package/dist/init-adapters/cursor/.cursor/knowledge/tech-stack.md +9 -0
- package/dist/init-adapters/cursor/.cursor/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/cursor/.cursor/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/cursor/.cursor/observability/audit_log.md +5 -0
- package/dist/init-adapters/cursor/.cursor/observability/telemetry.md +6 -0
- package/dist/init-adapters/cursor/.cursor/registry/agent_registry.md +18 -0
- package/dist/init-adapters/cursor/.cursor/router/routing_rules.md +8 -0
- package/dist/init-adapters/cursor/.cursor/rules/analyst.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/architect.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/backend.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/database.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/devops.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/explorer.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/frontend.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/git.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/manager.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/mobile.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/native.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/quality.mdc +22 -0
- package/dist/init-adapters/cursor/.cursor/rules/security.mdc +22 -0
- package/dist/init-adapters/cursor/CURSOR.md +6 -0
- package/dist/init-adapters/cursor/ENDERUN.md +36 -38
- package/dist/init-adapters/cursor/docs/README.md +6 -0
- package/dist/init-adapters/cursor/docs/getting-started.md +4 -0
- package/dist/init-adapters/gemini/.gemini/agents/analyst.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/architect.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/backend.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/database.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/devops.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/explorer.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/frontend.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/git.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/manager.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/mobile.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/native.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/quality.md +4 -2
- package/dist/init-adapters/gemini/.gemini/agents/security.md +4 -2
- package/dist/init-adapters/gemini/.gemini/config.json +1 -1
- package/dist/init-adapters/gemini/.gemini/knowledge/agents-manifest.md +79 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/approval-flows.md +61 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/component-patterns.md +91 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/data-fetching-patterns.md +13 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/design-system.md +31 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/enterprise-architecture.md +69 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/error-handling.md +74 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/eslint-standards.md +10 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/logging.md +7 -0
- package/dist/init-adapters/gemini/.gemini/knowledge/tech-stack.md +9 -0
- package/dist/init-adapters/gemini/.gemini/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/gemini/.gemini/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/gemini/.gemini/observability/audit_log.md +5 -0
- package/dist/init-adapters/gemini/.gemini/observability/telemetry.md +6 -0
- package/dist/init-adapters/gemini/.gemini/registry/agent_registry.md +18 -0
- package/dist/init-adapters/gemini/.gemini/router/routing_rules.md +8 -0
- package/dist/init-adapters/gemini/.gemini/rules/analyst.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/architect.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/backend.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/database.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/devops.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/explorer.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/frontend.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/git.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/manager.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/mobile.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/native.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/quality.md +16 -0
- package/dist/init-adapters/gemini/.gemini/rules/security.md +16 -0
- package/dist/init-adapters/gemini/ENDERUN.md +15 -17
- package/dist/init-adapters/gemini/GEMINI.md +7 -0
- package/dist/init-adapters/gemini/docs/README.md +6 -0
- package/dist/init-adapters/gemini/docs/getting-started.md +4 -0
- package/dist/init-adapters/grok/.grok/agents/analyst.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/architect.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/backend.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/database.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/devops.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/explorer.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/frontend.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/git.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/manager.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/mobile.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/native.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/quality.md +4 -2
- package/dist/init-adapters/grok/.grok/agents/security.md +4 -2
- package/dist/init-adapters/grok/.grok/config.json +1 -1
- package/dist/init-adapters/grok/.grok/knowledge/agents-manifest.md +79 -0
- package/dist/init-adapters/grok/.grok/knowledge/approval-flows.md +61 -0
- package/dist/init-adapters/grok/.grok/knowledge/component-patterns.md +91 -0
- package/dist/init-adapters/grok/.grok/knowledge/data-fetching-patterns.md +13 -0
- package/dist/init-adapters/grok/.grok/knowledge/design-system.md +31 -0
- package/dist/init-adapters/grok/.grok/knowledge/enterprise-architecture.md +69 -0
- package/dist/init-adapters/grok/.grok/knowledge/error-handling.md +74 -0
- package/dist/init-adapters/grok/.grok/knowledge/eslint-standards.md +10 -0
- package/dist/init-adapters/grok/.grok/knowledge/logging.md +7 -0
- package/dist/init-adapters/grok/.grok/knowledge/tech-stack.md +9 -0
- package/dist/init-adapters/grok/.grok/memory/DECISIONS.md +10 -0
- package/dist/init-adapters/grok/.grok/memory/PROJECT_MEMORY.md +1 -1
- package/dist/init-adapters/grok/.grok/observability/audit_log.md +5 -0
- package/dist/init-adapters/grok/.grok/observability/telemetry.md +6 -0
- package/dist/init-adapters/grok/.grok/registry/agent_registry.md +18 -0
- package/dist/init-adapters/grok/.grok/router/routing_rules.md +8 -0
- package/dist/init-adapters/grok/.grok/rules/analyst.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/architect.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/backend.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/database.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/devops.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/explorer.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/frontend.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/git.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/manager.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/mobile.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/native.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/quality.md +16 -0
- package/dist/init-adapters/grok/.grok/rules/security.md +16 -0
- package/dist/init-adapters/grok/ENDERUN.md +36 -38
- package/dist/init-adapters/grok/GROK.md +6 -0
- package/dist/init-adapters/grok/docs/README.md +6 -0
- package/dist/init-adapters/grok/docs/getting-started.md +4 -0
- package/dist/src/cli/adapters.js +11 -10
- package/dist/src/cli/adapters.js.map +1 -1
- package/dist/src/cli/commands/approve.d.ts +1 -0
- package/dist/src/cli/commands/approve.js +64 -0
- package/dist/src/cli/commands/approve.js.map +1 -0
- package/dist/src/cli/commands/check.js +87 -5
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/contract.js +3 -25
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/init.js +167 -10
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/knowledge.js +2 -3
- package/dist/src/cli/commands/knowledge.js.map +1 -1
- package/dist/src/cli/commands/log.js +1 -2
- package/dist/src/cli/commands/log.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +43 -9
- package/dist/src/cli/commands/orchestrate.js +161 -16
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/status.js +35 -0
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/index.js +18 -4
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.d.ts +1 -0
- package/dist/src/cli/shims.js +54 -0
- package/dist/src/cli/shims.js.map +1 -0
- package/dist/src/cli/utils/app.js +118 -33
- package/dist/src/cli/utils/app.js.map +1 -1
- package/dist/src/cli/utils/fs.d.ts +1 -0
- package/dist/src/cli/utils/fs.js +15 -0
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/memory.js +11 -1
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/modules/agents/definitions.js +12 -12
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/skills/definitions.d.ts +19 -2
- package/dist/src/modules/skills/definitions.js +53 -14
- package/dist/src/modules/skills/definitions.js.map +1 -1
- package/dist/src/shared/config.d.ts +41 -0
- package/dist/src/shared/config.js +61 -0
- package/dist/src/shared/config.js.map +1 -0
- package/dist/src/shared/container.d.ts +25 -0
- package/dist/src/shared/container.js +56 -0
- package/dist/src/shared/container.js.map +1 -0
- package/dist/src/shared/errors.d.ts +44 -0
- package/dist/src/shared/errors.js +66 -0
- package/dist/src/shared/errors.js.map +1 -0
- package/dist/src/shared/logger.d.ts +28 -0
- package/dist/src/shared/logger.js +117 -0
- package/dist/src/shared/logger.js.map +1 -0
- package/dist/tests/mock-project/apps/web/panda.config.d.ts +4 -0
- package/dist/tests/mock-project/apps/web/panda.config.js +3 -0
- package/dist/tests/mock-project/apps/web/panda.config.js.map +1 -0
- package/dist/tests/shared.test.d.ts +1 -0
- package/dist/tests/shared.test.js +80 -0
- package/dist/tests/shared.test.js.map +1 -0
- package/eslint.config.js +2 -1
- package/framework-mcp/dist/{src/index.js ā index.js} +7 -1
- package/framework-mcp/dist/{src/tools ā tools}/definitions.js +1 -0
- package/framework-mcp/dist/{src/tools ā tools}/file_system/patch_file.js +3 -0
- package/framework-mcp/dist/{src/tools ā tools}/file_system/read_file.js +7 -0
- package/framework-mcp/dist/{src/tools ā tools}/file_system/replace_text.js +3 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +74 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/package.json +1 -1
- package/framework-mcp/src/index.ts +8 -1
- package/framework-mcp/src/tools/definitions.ts +1 -0
- package/framework-mcp/src/tools/file_system/patch_file.ts +6 -0
- package/framework-mcp/src/tools/file_system/read_file.ts +7 -1
- package/framework-mcp/src/tools/file_system/replace_text.ts +6 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +39 -12
- package/framework-mcp/src/tools/types.ts +1 -0
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +42 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
- package/framework-mcp/tsconfig.json +2 -1
- package/package.json +9 -6
- package/src/cli/adapters.ts +13 -11
- package/src/cli/commands/approve.ts +65 -0
- package/src/cli/commands/check.ts +98 -5
- package/src/cli/commands/contract.ts +3 -29
- package/src/cli/commands/init.ts +187 -10
- package/src/cli/commands/knowledge.ts +2 -4
- package/src/cli/commands/log.ts +1 -3
- package/src/cli/commands/orchestrate.ts +164 -29
- package/src/cli/commands/status.ts +33 -0
- package/src/cli/index.ts +180 -163
- package/src/cli/shims.ts +53 -0
- package/src/cli/utils/app.ts +124 -33
- package/src/cli/utils/fs.ts +17 -0
- package/src/cli/utils/memory.ts +11 -1
- package/src/modules/agents/definitions.ts +12 -12
- package/src/modules/skills/definitions.ts +53 -14
- package/src/schema/agent-lifecycle-schema.json +59 -0
- package/src/shared/config.ts +73 -0
- package/src/shared/container.ts +67 -0
- package/src/shared/errors.ts +72 -0
- package/src/shared/logger.ts +139 -0
- package/templates/architecture/agents-manifest.md +79 -0
- package/templates/architecture/enterprise-architecture.md +69 -0
- package/templates/architecture/standards/crud-governance.md +46 -0
- package/templates/architecture/standards/data-fetching-patterns.md +13 -0
- package/templates/architecture/standards/design-system.md +31 -0
- package/templates/architecture/standards/documentation-ownership.md +21 -0
- package/templates/architecture/standards/logging.md +7 -0
- package/templates/architecture/standards/mobile-standards.md +48 -0
- package/templates/architecture/standards/tech-stack.md +9 -0
- package/templates/backend/error-handling.md +74 -0
- package/templates/frontend/component-patterns.md +91 -0
- package/tsconfig.json +1 -0
- package/docs/getting-started.md +0 -22
- package/framework-mcp/dist/src/tools/messaging/send_message.js +0 -44
- /package/{framework-mcp/dist/src/tools/types.js ā dist/framework-mcp/tests/tools/file_system/file_system_tools.test.d.ts} +0 -0
- /package/{docs/frontend ā dist/init-adapters/antigravity-cli/.agents/knowledge}/component-patterns.md +0 -0
- /package/{docs/architecture/standards ā dist/init-adapters/antigravity-cli/.agents/knowledge}/data-fetching-patterns.md +0 -0
- /package/{docs/architecture/standards ā dist/init-adapters/antigravity-cli/.agents/knowledge}/design-system.md +0 -0
- /package/{docs/backend ā dist/init-adapters/antigravity-cli/.agents/knowledge}/error-handling.md +0 -0
- /package/{docs/architecture/standards ā dist/init-adapters/antigravity-cli/.agents/knowledge}/logging.md +0 -0
- /package/{docs/architecture/standards ā dist/init-adapters/antigravity-cli/.agents/knowledge}/tech-stack.md +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/control_plane/locking.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/control_plane/registry.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/file_system/write_file.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/framework/get_status.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/framework/orchestrate.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/framework/update_contract_hash.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/framework/update_memory.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/index.js +0 -0
- /package/framework-mcp/dist/{src/tools ā tools}/messaging/log_action.js +0 -0
- /package/framework-mcp/dist/{src/utils ā utils}/cli.js +0 -0
- /package/framework-mcp/dist/{src/utils ā utils}/metrics.js +0 -0
- /package/framework-mcp/dist/{src/utils ā utils}/security.js +0 -0
- /package/{docs ā templates}/architecture/approval-flows.md +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { handleSendAgentMessage } from "../../../src/tools/messaging/send_message.js";
|
|
5
|
+
import { ToolArgs } from "../../../src/tools/types.js";
|
|
6
|
+
|
|
7
|
+
const TEST_DIR = path.resolve(__dirname, "../../_temp_messaging_tests");
|
|
8
|
+
const MESSAGES_DIR = path.join(TEST_DIR, ".gemini/messages");
|
|
9
|
+
const LOCK_FILE = path.join(MESSAGES_DIR, ".lock");
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
fs.mkdirSync(TEST_DIR, { recursive: true });
|
|
13
|
+
// Write a dummy package.json to test directory to lock frameworkDir as .gemini
|
|
14
|
+
const dummyPkg = {
|
|
15
|
+
name: "test-pkg",
|
|
16
|
+
enderun: {
|
|
17
|
+
frameworkDir: ".gemini"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
fs.writeFileSync(path.join(TEST_DIR, "package.json"), JSON.stringify(dummyPkg, null, 2), "utf8");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
fs.rmSync(TEST_DIR, { recursive: true, force: true });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe("Hermes Lock Protocol & Message sending", () => {
|
|
28
|
+
it("should successfully send message when lock is not present", async () => {
|
|
29
|
+
const args: ToolArgs = {
|
|
30
|
+
to: "@backend",
|
|
31
|
+
from: "@manager",
|
|
32
|
+
category: "ACTION",
|
|
33
|
+
content: "Build database models",
|
|
34
|
+
traceId: "T-123",
|
|
35
|
+
priority: "HIGH"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
39
|
+
expect(result.content[0].text).toContain("ā
Message sent to @backend");
|
|
40
|
+
|
|
41
|
+
// Verify the message file contains the sent message
|
|
42
|
+
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
43
|
+
expect(fs.existsSync(messageFilePath)).toBe(true);
|
|
44
|
+
|
|
45
|
+
const content = fs.readFileSync(messageFilePath, "utf8");
|
|
46
|
+
const msg = JSON.parse(content.trim());
|
|
47
|
+
expect(msg.from).toBe("@manager");
|
|
48
|
+
expect(msg.to).toBe("@backend");
|
|
49
|
+
expect(msg.category).toBe("ACTION");
|
|
50
|
+
expect(msg.content).toBe("Build database models");
|
|
51
|
+
expect(msg.traceId).toBe("T-123");
|
|
52
|
+
expect(msg.priority).toBe("HIGH");
|
|
53
|
+
expect(msg.status).toBe("PENDING");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should retry and fail to send message if lock is kept busy", async () => {
|
|
57
|
+
// Prepare a busy lock file
|
|
58
|
+
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
59
|
+
fs.writeFileSync(LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
60
|
+
|
|
61
|
+
const args: ToolArgs = {
|
|
62
|
+
to: "@backend",
|
|
63
|
+
from: "@manager",
|
|
64
|
+
category: "ACTION",
|
|
65
|
+
content: "Build database models",
|
|
66
|
+
traceId: "T-123"
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const startTime = Date.now();
|
|
70
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
71
|
+
const duration = Date.now() - startTime;
|
|
72
|
+
|
|
73
|
+
expect(result.isError).toBe(true);
|
|
74
|
+
expect(result.content[0].text).toContain("ā Could not send message to @backend: Hermes lock is busy.");
|
|
75
|
+
// Retries takes 3 attempts with 500ms delay -> duration should be at least ~1000ms
|
|
76
|
+
expect(duration).toBeGreaterThanOrEqual(1000);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("should bypass and acquire lock if existing lock is stale (older than 5s)", async () => {
|
|
80
|
+
fs.mkdirSync(MESSAGES_DIR, { recursive: true });
|
|
81
|
+
// Set lock file mtime to 10 seconds ago
|
|
82
|
+
fs.writeFileSync(LOCK_FILE, "Locked by @test at " + new Date().toISOString(), "utf8");
|
|
83
|
+
const tenSecondsAgo = new Date(Date.now() - 10000);
|
|
84
|
+
fs.utimesSync(LOCK_FILE, tenSecondsAgo, tenSecondsAgo);
|
|
85
|
+
|
|
86
|
+
const args: ToolArgs = {
|
|
87
|
+
to: "@backend",
|
|
88
|
+
from: "@manager",
|
|
89
|
+
category: "ACTION",
|
|
90
|
+
content: "Build database models",
|
|
91
|
+
traceId: "T-123"
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const result = await handleSendAgentMessage(TEST_DIR, args);
|
|
95
|
+
expect(result.content[0].text).toContain("ā
Message sent to @backend");
|
|
96
|
+
expect(fs.existsSync(LOCK_FILE)).toBe(false); // Lock should have been unlinked in finally
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("should safely resolve concurrent messages and execute them in sequence", async () => {
|
|
100
|
+
const send1Promise = handleSendAgentMessage(TEST_DIR, {
|
|
101
|
+
to: "@backend",
|
|
102
|
+
from: "@manager",
|
|
103
|
+
category: "ACTION",
|
|
104
|
+
content: "Job 1",
|
|
105
|
+
traceId: "T-123"
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Delay starting the second call slightly to make sure lock is acquired by Job 1 first
|
|
109
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
110
|
+
|
|
111
|
+
const send2Promise = handleSendAgentMessage(TEST_DIR, {
|
|
112
|
+
to: "@backend",
|
|
113
|
+
from: "@frontend",
|
|
114
|
+
category: "INFO",
|
|
115
|
+
content: "Job 2",
|
|
116
|
+
traceId: "T-123"
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const [res1, res2] = await Promise.all([send1Promise, send2Promise]);
|
|
120
|
+
|
|
121
|
+
expect(res1.isError).toBeFalsy();
|
|
122
|
+
expect(res2.isError).toBeFalsy();
|
|
123
|
+
expect(res1.content[0].text).toContain("ā
Message sent to @backend");
|
|
124
|
+
expect(res2.content[0].text).toContain("ā
Message sent to @backend");
|
|
125
|
+
|
|
126
|
+
// Verify both messages exist in order in the message log file
|
|
127
|
+
const messageFilePath = path.join(MESSAGES_DIR, "backend.json");
|
|
128
|
+
const lines = fs.readFileSync(messageFilePath, "utf8").trim().split("\n");
|
|
129
|
+
expect(lines.length).toBe(2);
|
|
130
|
+
|
|
131
|
+
const msg1 = JSON.parse(lines[0]);
|
|
132
|
+
const msg2 = JSON.parse(lines[1]);
|
|
133
|
+
expect(msg1.content).toBe("Job 1");
|
|
134
|
+
expect(msg2.content).toBe("Job 2");
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
"target": "ES2022",
|
|
4
4
|
"module": "NodeNext",
|
|
5
5
|
"moduleResolution": "NodeNext",
|
|
6
|
+
"rootDir": "src",
|
|
6
7
|
"outDir": "./dist",
|
|
7
8
|
"strict": true,
|
|
8
9
|
"skipLibCheck": true,
|
|
9
10
|
"esModuleInterop": true,
|
|
10
11
|
"types": ["node"]
|
|
11
12
|
},
|
|
12
|
-
"include": ["src/**/*.ts"
|
|
13
|
+
"include": ["src/**/*.ts"]
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "The Supreme AI Governance & Orchestration Framework for Enterprise Development",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"GROK.md",
|
|
47
47
|
"agent.md",
|
|
48
48
|
"docs",
|
|
49
|
+
"templates",
|
|
49
50
|
".cursor",
|
|
50
51
|
".github"
|
|
51
52
|
],
|
|
@@ -80,14 +81,16 @@
|
|
|
80
81
|
"tsx": "^4.22.3",
|
|
81
82
|
"typescript": "^6.0.3",
|
|
82
83
|
"typescript-eslint": "^8.60.0",
|
|
83
|
-
"vitest": "^4.1.7"
|
|
84
|
-
"zod": "^3.24.2"
|
|
84
|
+
"vitest": "^4.1.7"
|
|
85
85
|
},
|
|
86
86
|
"enderun": {
|
|
87
|
-
"version": "1.1.
|
|
88
|
-
"initializedAt": "2026-06-04T18:51:28.970Z"
|
|
87
|
+
"version": "1.1.5",
|
|
88
|
+
"initializedAt": "2026-06-04T18:51:28.970Z",
|
|
89
|
+
"frameworkDir": ".gemini"
|
|
89
90
|
},
|
|
91
|
+
|
|
90
92
|
"dependencies": {
|
|
91
|
-
"chalk": "^5.6.2"
|
|
93
|
+
"chalk": "^5.6.2",
|
|
94
|
+
"zod": "^3.24.2"
|
|
92
95
|
}
|
|
93
96
|
}
|
package/src/cli/adapters.ts
CHANGED
|
@@ -2,6 +2,7 @@ import path from "path";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import { writeJsonFile } from "./utils/fs.js";
|
|
4
4
|
import { getPackageRoot } from "./utils/pkg.js";
|
|
5
|
+
import { ALL_AGENTS } from "../modules/agents/definitions.js";
|
|
5
6
|
|
|
6
7
|
import type { AdapterId, AdapterConfig } from "./adapters/types.js";
|
|
7
8
|
export { ADAPTER_IDS, type AdapterId, type AdapterRole, type AdapterConfig } from "./adapters/types.js";
|
|
@@ -48,10 +49,16 @@ export const FRAMEWORK_DIR_CANDIDATES = [
|
|
|
48
49
|
const SHIM_FILES = (Object.keys(ADAPTERS) as AdapterId[]).map((id) => ADAPTERS[id].shimFile);
|
|
49
50
|
|
|
50
51
|
export function resolveAdapter(input?: string): AdapterConfig {
|
|
51
|
-
|
|
52
|
+
let normalized = (input || "gemini").toLowerCase();
|
|
53
|
+
if (normalized === "antigravity") {
|
|
54
|
+
normalized = "antigravity-cli";
|
|
55
|
+
} else if (normalized === "copilot" || normalized === "github") {
|
|
56
|
+
normalized = "codex";
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
let config: AdapterConfig;
|
|
53
60
|
if (normalized in ADAPTERS) {
|
|
54
|
-
config = { ...ADAPTERS[normalized] };
|
|
61
|
+
config = { ...ADAPTERS[normalized as AdapterId] };
|
|
55
62
|
} else {
|
|
56
63
|
console.warn(`ā ļø Unknown adapter "${input}". Falling back to gemini.`);
|
|
57
64
|
config = { ...ADAPTERS.gemini };
|
|
@@ -163,9 +170,6 @@ export function buildMcpServerEntry(projectRoot: string) {
|
|
|
163
170
|
}
|
|
164
171
|
|
|
165
172
|
export function generateAdapterAgentRules(projectRoot: string, frameworkDir: string, adapterId: AdapterId): void {
|
|
166
|
-
const agentsDir = path.join(projectRoot, frameworkDir, "agents");
|
|
167
|
-
if (!fs.existsSync(agentsDir)) return;
|
|
168
|
-
|
|
169
173
|
const adapter = ADAPTERS[adapterId];
|
|
170
174
|
if (!adapter || !adapter.rulesDir || !adapter.rulesExt) return;
|
|
171
175
|
|
|
@@ -174,7 +178,6 @@ export function generateAdapterAgentRules(projectRoot: string, frameworkDir: str
|
|
|
174
178
|
|
|
175
179
|
try {
|
|
176
180
|
fs.mkdirSync(destRulesDir, { recursive: true });
|
|
177
|
-
const files = fs.readdirSync(agentsDir).filter((f) => f.endsWith(".json") && f !== "agent_army_schema.json");
|
|
178
181
|
|
|
179
182
|
const GLOB_MAP: Record<string, string> = {
|
|
180
183
|
backend: "apps/backend/**/*",
|
|
@@ -191,13 +194,11 @@ export function generateAdapterAgentRules(projectRoot: string, frameworkDir: str
|
|
|
191
194
|
manager: "*",
|
|
192
195
|
};
|
|
193
196
|
|
|
194
|
-
for (const
|
|
195
|
-
const filePath = path.join(agentsDir, file);
|
|
196
|
-
const agent = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
197
|
+
for (const agent of ALL_AGENTS) {
|
|
197
198
|
const name = agent.name;
|
|
198
199
|
const displayName = agent.displayName || name;
|
|
199
200
|
const description = agent.description || "";
|
|
200
|
-
const systemPrompt = agent.
|
|
201
|
+
const systemPrompt = agent.instructions || "";
|
|
201
202
|
const glob = GLOB_MAP[name] || "*";
|
|
202
203
|
const ruleDestPath = path.join(destRulesDir, `${name}${fileExt}`);
|
|
203
204
|
|
|
@@ -248,12 +249,13 @@ ${systemPrompt}
|
|
|
248
249
|
|
|
249
250
|
fs.writeFileSync(ruleDestPath, mdcContent);
|
|
250
251
|
}
|
|
251
|
-
console.warn(`ā
Generated
|
|
252
|
+
console.warn(`ā
Generated 13 Agent Rules under ${path.relative(projectRoot, destRulesDir)}/`);
|
|
252
253
|
} catch (e) {
|
|
253
254
|
console.warn(`ā ļø Failed to generate Agent rules: ${e}`);
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
|
|
258
|
+
|
|
257
259
|
export function runAdapterPostInit(adapter: AdapterConfig, projectRoot: string): void {
|
|
258
260
|
const mcpEntry = buildMcpServerEntry(projectRoot);
|
|
259
261
|
const mcpBlock = { mcpServers: { "agent-enderun": mcpEntry } };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { getFrameworkDir } from "../utils/memory.js";
|
|
4
|
+
import { UI } from "../utils/ui.js";
|
|
5
|
+
|
|
6
|
+
import { HermesMessageSchema } from "./orchestrate.js";
|
|
7
|
+
|
|
8
|
+
export function approveCommand(traceId: string) {
|
|
9
|
+
const frameworkDir = getFrameworkDir();
|
|
10
|
+
const messagesDir = path.join(frameworkDir, "messages");
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(messagesDir)) {
|
|
13
|
+
UI.error("No messages directory found.");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const files = fs.readdirSync(messagesDir).filter((f) => f.endsWith(".json"));
|
|
18
|
+
let found = false;
|
|
19
|
+
|
|
20
|
+
for (const file of files) {
|
|
21
|
+
const filePath = path.join(messagesDir, file);
|
|
22
|
+
try {
|
|
23
|
+
const content = fs.readFileSync(filePath, "utf8").trim();
|
|
24
|
+
if (!content) continue;
|
|
25
|
+
const lines = content.split("\n");
|
|
26
|
+
let updated = false;
|
|
27
|
+
const newLines = lines.map((line) => {
|
|
28
|
+
if (!line.trim()) return line;
|
|
29
|
+
try {
|
|
30
|
+
const parsed = JSON.parse(line);
|
|
31
|
+
const msg = HermesMessageSchema.parse(parsed);
|
|
32
|
+
if (msg.traceId === traceId && msg.status === "PENDING" && (msg.category === "ALERT" || msg.category === "ACTION")) {
|
|
33
|
+
msg.status = "APPROVED";
|
|
34
|
+
updated = true;
|
|
35
|
+
found = true;
|
|
36
|
+
UI.success(`Approved message from ${msg.from} to ${msg.to} (Action: ${msg.action || "None"})`);
|
|
37
|
+
}
|
|
38
|
+
return JSON.stringify(msg);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
UI.error(`Skipping invalid Hermes message during approval: ${(e as Error).message}`);
|
|
41
|
+
return line;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (updated) {
|
|
46
|
+
fs.writeFileSync(filePath, newLines.join("\n") + "\n", "utf8");
|
|
47
|
+
}
|
|
48
|
+
} catch (e) {
|
|
49
|
+
UI.error(`Error reading or updating message file ${file}: ${(e as Error).message}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (found) {
|
|
54
|
+
// Log user approval to audit log
|
|
55
|
+
const auditPath = path.join(frameworkDir, "observability/audit_log.md");
|
|
56
|
+
if (fs.existsSync(auditPath)) {
|
|
57
|
+
const logEntry = "\n- **[" + new Date().toISOString() + "]** USER -> @manager | APPROVED | Trace: " + traceId;
|
|
58
|
+
fs.appendFileSync(auditPath, logEntry);
|
|
59
|
+
}
|
|
60
|
+
UI.success("Successfully approved Trace: " + traceId);
|
|
61
|
+
} else {
|
|
62
|
+
UI.error("No pending approval request found for Trace ID: " + traceId);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -2,7 +2,7 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
|
|
5
|
-
import { getFrameworkDir, getMemoryPath } from "../utils/memory.js";
|
|
5
|
+
import { getFrameworkDir, getMemoryPath, getConfiguredPaths } from "../utils/memory.js";
|
|
6
6
|
import { getPackageVersion, getValidatorPath } from "../utils/pkg.js";
|
|
7
7
|
import { UI } from "../utils/ui.js";
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ export function checkCommand() {
|
|
|
14
14
|
|
|
15
15
|
const frameworkDir = getFrameworkDir();
|
|
16
16
|
const memoryPath = getMemoryPath();
|
|
17
|
+
const pathsMap = getConfiguredPaths();
|
|
17
18
|
|
|
18
19
|
UI.success(`Using framework dir: ${frameworkDir}`);
|
|
19
20
|
|
|
@@ -21,6 +22,27 @@ export function checkCommand() {
|
|
|
21
22
|
if (frameworkDir === ".github") knowledgeDir = "instructions";
|
|
22
23
|
|
|
23
24
|
const constitutionPath = fs.existsSync(path.join(process.cwd(), "ENDERUN.md")) ? "ENDERUN.md" : path.join(frameworkDir, "ENDERUN.md");
|
|
25
|
+
|
|
26
|
+
const rootPandaPath = path.join(process.cwd(), "panda.config.ts");
|
|
27
|
+
const appPandaPath = path.join(pathsMap.frontend, "panda.config.ts");
|
|
28
|
+
|
|
29
|
+
if (fs.existsSync(rootPandaPath)) {
|
|
30
|
+
UI.error(`Panda CSS config must NOT be at the root directory! Move it to '${pathsMap.frontend}/panda.config.ts'.`);
|
|
31
|
+
issues++;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let isFrameworkDevelopment = false;
|
|
35
|
+
try {
|
|
36
|
+
const localPkgPath = path.join(process.cwd(), "package.json");
|
|
37
|
+
if (fs.existsSync(localPkgPath)) {
|
|
38
|
+
const localPkg = JSON.parse(fs.readFileSync(localPkgPath, "utf8"));
|
|
39
|
+
if (localPkg.name === "agent-enderun") {
|
|
40
|
+
isFrameworkDevelopment = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
// ignore
|
|
45
|
+
}
|
|
24
46
|
|
|
25
47
|
const checks = [
|
|
26
48
|
{ name: "Constitution (ENDERUN.md)", path: constitutionPath },
|
|
@@ -29,10 +51,10 @@ export function checkCommand() {
|
|
|
29
51
|
{ name: "Framework Config (config.json)", path: path.join(frameworkDir, "config.json") },
|
|
30
52
|
{ name: "Agent Status (STATUS.md)", path: path.join(frameworkDir, "STATUS.md") },
|
|
31
53
|
{ name: "MCP Config (mcp.json)", path: "mcp.json" },
|
|
32
|
-
{ name: "ESLint Config (eslint.config.js)", path: "eslint.config.js" },
|
|
54
|
+
{ name: "ESLint Config (eslint.config.js)", path: "eslint.config.js", optional: !isFrameworkDevelopment },
|
|
33
55
|
{ name: "ESLint Standards", path: path.join(frameworkDir, `${knowledgeDir}/eslint-standards.md`) },
|
|
34
|
-
{ name: "MCP Server", path: "framework-mcp/package.json" },
|
|
35
|
-
{ name: "Panda CSS Config", path:
|
|
56
|
+
...(isFrameworkDevelopment ? [{ name: "MCP Server", path: "framework-mcp/package.json" }] : []),
|
|
57
|
+
{ name: "Panda CSS Config", path: appPandaPath, optional: true },
|
|
36
58
|
{ name: "Brain Dashboard", path: path.join(frameworkDir, "BRAIN_DASHBOARD.md") },
|
|
37
59
|
];
|
|
38
60
|
|
|
@@ -73,6 +95,11 @@ export function checkCommand() {
|
|
|
73
95
|
UI.success("No forbidden 'console.log' detected.");
|
|
74
96
|
}
|
|
75
97
|
|
|
98
|
+
const rootTestFiles = checkRootTestFiles();
|
|
99
|
+
if (rootTestFiles.length > 0) {
|
|
100
|
+
UI.warning(`Test files found in the root directory: ${rootTestFiles.join(", ")}. It is recommended to place all test files under the 'tests/' folder or application-specific directories.`);
|
|
101
|
+
}
|
|
102
|
+
|
|
76
103
|
try {
|
|
77
104
|
execSync("npx tsc --noEmit", { stdio: "pipe" });
|
|
78
105
|
UI.success("TypeScript type check PASSED.");
|
|
@@ -81,6 +108,51 @@ export function checkCommand() {
|
|
|
81
108
|
issues++;
|
|
82
109
|
}
|
|
83
110
|
|
|
111
|
+
interface MetricEntry {
|
|
112
|
+
timestamp: string;
|
|
113
|
+
agent: string;
|
|
114
|
+
action: string;
|
|
115
|
+
estimatedTokens: number;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const metricsPath = path.join(frameworkDir, "observability/metrics.json");
|
|
119
|
+
if (fs.existsSync(metricsPath)) {
|
|
120
|
+
try {
|
|
121
|
+
const raw = fs.readFileSync(metricsPath, "utf8");
|
|
122
|
+
const metrics: MetricEntry[] = JSON.parse(raw);
|
|
123
|
+
if (Array.isArray(metrics) && metrics.length > 0) {
|
|
124
|
+
console.warn("\nš Token Consumption Report:");
|
|
125
|
+
let totalTokens = 0;
|
|
126
|
+
const breakdown: Record<string, { count: number; tokens: number }> = {};
|
|
127
|
+
|
|
128
|
+
for (const entry of metrics) {
|
|
129
|
+
const tokens = typeof entry.estimatedTokens === "number" ? entry.estimatedTokens : 0;
|
|
130
|
+
totalTokens += tokens;
|
|
131
|
+
|
|
132
|
+
const actionName = (entry.action || "unknown").split(":")[0].trim();
|
|
133
|
+
if (!breakdown[actionName]) {
|
|
134
|
+
breakdown[actionName] = { count: 0, tokens: 0 };
|
|
135
|
+
}
|
|
136
|
+
breakdown[actionName].count += 1;
|
|
137
|
+
breakdown[actionName].tokens += tokens;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
console.warn(` - Total Operations: ${metrics.length}`);
|
|
141
|
+
console.warn(` - Total Estimated Tokens: ${totalTokens}`);
|
|
142
|
+
console.warn("\n Breakdown by Action:");
|
|
143
|
+
for (const [action, data] of Object.entries(breakdown)) {
|
|
144
|
+
console.warn(` - ${action}: ${data.count} ops (${data.tokens} tokens)`);
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
console.warn("\nš Token Consumption Report: No token usage logged yet.");
|
|
148
|
+
}
|
|
149
|
+
} catch {
|
|
150
|
+
console.warn("\nš Token Consumption Report: Could not read or parse metrics file.");
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
console.warn("\nš Token Consumption Report: No token usage logged yet.");
|
|
154
|
+
}
|
|
155
|
+
|
|
84
156
|
if (issues === 0) {
|
|
85
157
|
UI.success("\nš All systems green! Enderun Core is ready.");
|
|
86
158
|
} else {
|
|
@@ -101,12 +173,33 @@ function checkConsoleLogs(): string[] {
|
|
|
101
173
|
else if (file.endsWith(".ts") && !file.includes(".test.")) {
|
|
102
174
|
const content = fs.readFileSync(fullPath, "utf8");
|
|
103
175
|
const target = "console." + "log(";
|
|
104
|
-
if (content.includes(target) && !fullPath.includes("check.ts")) {
|
|
176
|
+
if (content.includes(target) && !fullPath.includes("check.ts") && !fullPath.includes("logger.ts")) {
|
|
105
177
|
issues.push(fullPath);
|
|
106
178
|
}
|
|
179
|
+
|
|
107
180
|
}
|
|
108
181
|
}
|
|
109
182
|
};
|
|
110
183
|
walk(srcDir);
|
|
111
184
|
return issues;
|
|
112
185
|
}
|
|
186
|
+
|
|
187
|
+
function checkRootTestFiles(): string[] {
|
|
188
|
+
const rootDir = process.cwd();
|
|
189
|
+
if (!fs.existsSync(rootDir)) return [];
|
|
190
|
+
const files = fs.readdirSync(rootDir);
|
|
191
|
+
const testFiles: string[] = [];
|
|
192
|
+
for (const file of files) {
|
|
193
|
+
const fullPath = path.join(rootDir, file);
|
|
194
|
+
try {
|
|
195
|
+
if (fs.statSync(fullPath).isFile()) {
|
|
196
|
+
if (file.includes(".test.") || file.includes(".spec.")) {
|
|
197
|
+
testFiles.push(file);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
} catch {
|
|
201
|
+
// Ignore stat errors for broken symlinks or permission issues
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return testFiles;
|
|
205
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
import crypto from "crypto";
|
|
4
3
|
import { getConfiguredPaths } from "../utils/memory.js";
|
|
4
|
+
import { computeTypesHash } from "../utils/fs.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Verify type safety between backend and frontend contracts.
|
|
@@ -17,20 +17,7 @@ export function verifyApiContractCommand() {
|
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const fullPath = path.join(d, e.name);
|
|
22
|
-
return e.isDirectory() ? walk(fullPath) : (e.name.endsWith(".ts") ? [fullPath] : []);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const hash = crypto.createHash("sha256");
|
|
26
|
-
for (const filePath of walk(sharedDir).sort()) {
|
|
27
|
-
hash.update(path.relative(projectRoot, filePath));
|
|
28
|
-
hash.update("\0");
|
|
29
|
-
hash.update(fs.readFileSync(filePath));
|
|
30
|
-
hash.update("\0");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const currentHash = hash.digest("hex");
|
|
20
|
+
const currentHash = computeTypesHash(projectRoot, sharedDir);
|
|
34
21
|
const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
|
|
35
22
|
|
|
36
23
|
if (contract.contract_hash === currentHash) {
|
|
@@ -58,20 +45,7 @@ export function updateApiContractCommand() {
|
|
|
58
45
|
process.exit(1);
|
|
59
46
|
}
|
|
60
47
|
|
|
61
|
-
const
|
|
62
|
-
const fullPath = path.join(d, e.name);
|
|
63
|
-
return e.isDirectory() ? walk(fullPath) : (e.name.endsWith(".ts") ? [fullPath] : []);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const hash = crypto.createHash("sha256");
|
|
67
|
-
for (const filePath of walk(sharedDir).sort()) {
|
|
68
|
-
hash.update(path.relative(projectRoot, filePath));
|
|
69
|
-
hash.update("\0");
|
|
70
|
-
hash.update(fs.readFileSync(filePath));
|
|
71
|
-
hash.update("\0");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const currentHash = hash.digest("hex");
|
|
48
|
+
const currentHash = computeTypesHash(projectRoot, sharedDir);
|
|
75
49
|
|
|
76
50
|
const contractData = {
|
|
77
51
|
contract_hash: currentHash,
|