agent-enderun 1.10.2 โ 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -44
- package/dist/framework-mcp/src/constants.d.ts +47 -0
- package/dist/framework-mcp/src/constants.js +65 -0
- package/dist/framework-mcp/src/constants.js.map +1 -0
- package/dist/framework-mcp/src/index.js +26 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +3 -9
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +2 -8
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.d.ts +2 -2
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +30 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +12 -4
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +6 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/read_file.js +43 -26
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +7 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/write_file.js +27 -15
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/get_status.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/get_status.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/orchestrate.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.d.ts +1 -2
- package/dist/framework-mcp/src/tools/index.js +33 -25
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/send_message.js +14 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +2 -2
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.d.ts +5 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js +29 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_map.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/grep_search.js +45 -28
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/list_dir.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.d.ts +2 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js +47 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +95 -28
- package/dist/framework-mcp/src/utils/metrics.d.ts +20 -0
- package/dist/framework-mcp/src/utils/metrics.js +24 -6
- package/dist/framework-mcp/src/utils/metrics.js.map +1 -1
- package/dist/framework-mcp/src/utils/security.d.ts +1 -3
- package/dist/framework-mcp/src/utils/security.js +21 -18
- package/dist/framework-mcp/src/utils/security.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +19 -14
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +36 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +43 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -0
- package/dist/src/cli/adapters/core.d.ts +1 -1
- package/dist/src/cli/adapters/core.js +4 -0
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/index.d.ts +1 -0
- package/dist/src/cli/adapters/index.js +1 -0
- package/dist/src/cli/adapters/index.js.map +1 -1
- package/dist/src/cli/adapters/paths.d.ts +15 -0
- package/dist/src/cli/adapters/paths.js +101 -0
- package/dist/src/cli/adapters/paths.js.map +1 -0
- package/dist/src/cli/adapters/scaffold.d.ts +1 -1
- package/dist/src/cli/adapters/scaffold.js +10 -7
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +15 -36
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/dashboard/data-service.d.ts +8 -0
- package/dist/src/cli/commands/dashboard/data-service.js +37 -0
- package/dist/src/cli/commands/dashboard/data-service.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +5 -2
- package/dist/src/cli/commands/init/scaffold-core.js +28 -6
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +6 -1
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +30 -6
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +11 -6
- package/dist/src/cli/commands/orchestrate.js +148 -128
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +3 -1
- package/dist/src/cli/commands/plan.js +79 -22
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/index.js +11 -15
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +0 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/config-schema.d.ts +7 -7
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +1 -1
- package/dist/src/cli/utils/memory.js +28 -8
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.d.ts +19 -0
- package/dist/src/cli/utils/pkg.js +29 -5
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/modules/adapters/definitions.js +3 -3
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/agents/definitions.js +2 -1
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +1 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/architect.js +1 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +7 -6
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +4 -3
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +1 -1
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js +1 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +3 -2
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/native.js +1 -1
- package/dist/src/modules/agents/registry/native.js.map +1 -1
- package/dist/src/modules/agents/registry/quality.js +1 -0
- package/dist/src/modules/agents/registry/quality.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +1 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/shared/constants.d.ts +113 -0
- package/dist/src/shared/constants.js +178 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/tests/adapters/paths.test.d.ts +1 -0
- package/dist/tests/adapters/paths.test.js +63 -0
- package/dist/tests/adapters/paths.test.js.map +1 -0
- package/dist/tests/approve.test.js +5 -9
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/cli/init/unified_init.test.d.ts +1 -0
- package/dist/tests/cli/init/unified_init.test.js +47 -0
- package/dist/tests/cli/init/unified_init.test.js.map +1 -0
- package/dist/tests/fs-utils.test.js +1 -1
- package/dist/tests/fs-utils.test.js.map +1 -1
- package/dist/tests/memory-utils.test.js +1 -1
- package/dist/tests/memory-utils.test.js.map +1 -1
- package/dist/tests/shared/constants.test.d.ts +1 -0
- package/dist/tests/shared/constants.test.js +17 -0
- package/dist/tests/shared/constants.test.js.map +1 -0
- package/dist/tests/trace.test.js +2 -2
- package/dist/tests/trace.test.js.map +1 -1
- package/framework-mcp/dist/constants.js +64 -0
- package/framework-mcp/dist/index.js +109 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +64 -0
- package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
- package/framework-mcp/dist/tools/dashboard/start_dashboard.js +29 -0
- package/framework-mcp/dist/tools/definitions.js +300 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +59 -0
- package/framework-mcp/dist/tools/file_system/patch_file.js +25 -0
- package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +43 -0
- package/framework-mcp/dist/tools/file_system/write_file.js +38 -0
- package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/tools/framework/run_tests.js +25 -0
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/tools/index.js +62 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +87 -0
- package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/tools/quality/check_lint.js +28 -0
- package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/tools/search/grep_search.js +76 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/tools/shell/run_command.js +46 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/dist/utils/cli.js +20 -0
- package/framework-mcp/dist/utils/compliance.js +29 -0
- package/framework-mcp/dist/utils/fs.js +44 -0
- package/framework-mcp/dist/utils/metrics.js +56 -0
- package/framework-mcp/dist/utils/security.js +60 -0
- package/framework-mcp/package.json +19 -0
- package/framework-mcp/src/constants.ts +78 -0
- package/framework-mcp/src/declarations.d.ts +17 -0
- package/framework-mcp/src/index.ts +132 -0
- package/framework-mcp/src/tools/control_plane/locking.ts +71 -0
- package/framework-mcp/src/tools/control_plane/registry.ts +38 -0
- package/framework-mcp/src/tools/dashboard/start_dashboard.ts +33 -0
- package/framework-mcp/src/tools/definitions.ts +302 -0
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +79 -0
- package/framework-mcp/src/tools/file_system/patch_file.ts +33 -0
- package/framework-mcp/src/tools/file_system/read_file.ts +58 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +52 -0
- package/framework-mcp/src/tools/file_system/write_file.ts +45 -0
- package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
- package/framework-mcp/src/tools/framework/get_status.ts +7 -0
- package/framework-mcp/src/tools/framework/orchestrate.ts +7 -0
- package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +7 -0
- package/framework-mcp/src/tools/framework/update_memory.ts +10 -0
- package/framework-mcp/src/tools/index.ts +66 -0
- package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
- package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
- package/framework-mcp/src/tools/messaging/log_action.ts +28 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +89 -0
- package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
- package/framework-mcp/src/tools/observability/get_health.ts +24 -0
- package/framework-mcp/src/tools/quality/check_lint.ts +33 -0
- package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
- package/framework-mcp/src/tools/search/get_map.ts +48 -0
- package/framework-mcp/src/tools/search/grep_search.ts +76 -0
- package/framework-mcp/src/tools/search/list_dir.ts +34 -0
- package/framework-mcp/src/tools/shell/run_command.ts +56 -0
- package/framework-mcp/src/tools/types.ts +89 -0
- package/framework-mcp/src/utils/cli.ts +20 -0
- package/framework-mcp/src/utils/compliance.ts +37 -0
- package/framework-mcp/src/utils/fs.ts +45 -0
- package/framework-mcp/src/utils/metrics.ts +73 -0
- package/framework-mcp/src/utils/security.ts +66 -0
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +212 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +46 -0
- package/framework-mcp/tests/tools/shell/run_command.test.ts +55 -0
- package/framework-mcp/tsconfig.json +14 -0
- package/package.json +9 -7
- package/src/cli/adapters/core.ts +7 -1
- package/src/cli/adapters/index.ts +1 -0
- package/src/cli/adapters/paths.ts +134 -0
- package/src/cli/adapters/scaffold.ts +17 -7
- package/src/cli/commands/check.ts +16 -38
- package/src/cli/commands/dashboard/data-service.ts +48 -0
- package/src/cli/commands/init/scaffold-core.ts +45 -6
- package/src/cli/commands/init/scaffold-standards.ts +6 -1
- package/src/cli/commands/init.ts +32 -6
- package/src/cli/commands/orchestrate.ts +151 -127
- package/src/cli/commands/plan.ts +89 -23
- package/src/cli/index.ts +14 -19
- package/src/cli/utils/compliance.ts +8 -9
- package/src/cli/utils/fs.ts +1 -1
- package/src/cli/utils/memory.ts +32 -7
- package/src/cli/utils/pkg.ts +42 -13
- package/src/modules/adapters/definitions.ts +4 -3
- package/src/modules/agents/definitions.ts +2 -1
- package/src/modules/agents/registry/analyst.ts +1 -1
- package/src/modules/agents/registry/architect.ts +1 -0
- package/src/modules/agents/registry/backend.ts +7 -6
- package/src/modules/agents/registry/database.ts +4 -3
- package/src/modules/agents/registry/devops.ts +1 -1
- package/src/modules/agents/registry/git.ts +1 -1
- package/src/modules/agents/registry/manager.ts +3 -2
- package/src/modules/agents/registry/native.ts +1 -1
- package/src/modules/agents/registry/quality.ts +1 -0
- package/src/modules/agents/registry/security.ts +1 -0
- package/src/shared/constants.ts +212 -0
- package/templates/prompts/bug-fix-recipe.md +20 -0
- package/templates/prompts/contract-design-recipe.md +21 -0
- package/templates/prompts/db-management-recipe.md +25 -0
- package/templates/prompts/deployment-recipe.md +23 -0
- package/templates/prompts/new-feature-recipe.md +19 -0
- package/templates/prompts/performance-optimization-recipe.md +23 -0
- package/templates/prompts/pull-request-template.md +21 -0
- package/templates/prompts/refactoring-recipe.md +21 -0
- package/templates/prompts/security-audit-recipe.md +20 -0
- package/templates/standards/architecture-standards.md +23 -0
- package/templates/standards/auth-standards.md +125 -0
- package/templates/standards/crud-governance.md +21 -0
- package/templates/standards/deployment-standards.md +21 -0
- package/templates/standards/frontend-standards.md +37 -0
- package/templates/standards/github-actions-standards.md +43 -0
- package/templates/standards/i18n-standards.md +17 -0
- package/templates/standards/kysely-standards.md +47 -0
- package/templates/standards/llm-governance.md +15 -0
- package/templates/standards/logging-and-secrets.md +34 -0
- package/templates/standards/mobile-standards.md +23 -0
- package/templates/standards/observability-standards.md +15 -0
- package/templates/standards/performance-standards.md +15 -0
- package/templates/standards/pino-standards.md +46 -0
- package/templates/standards/playwright-standards.md +54 -0
- package/templates/standards/quality-standards.md +31 -0
- package/templates/standards/react-query-standards.md +72 -0
- package/templates/standards/react-router-standards.md +62 -0
- package/templates/standards/security-audit-standards.md +16 -0
- package/templates/standards/security-standards.md +21 -0
- package/templates/standards/swagger-standards.md +50 -0
- package/templates/standards/tailwind-standards.md +20 -0
- package/templates/standards/testing-standards.md +31 -0
- package/templates/standards/typeorm-standards.md +49 -0
- package/templates/standards/vitest-standards.md +110 -0
- package/bin/validate-agent-army.js +0 -148
- package/src/cli/commands/app.ts +0 -56
- package/src/cli/utils/app-backend.ts +0 -257
- package/src/cli/utils/app-docs.ts +0 -83
- package/src/cli/utils/app-frontend.ts +0 -263
- package/src/cli/utils/app-inferrer.ts +0 -63
- package/src/cli/utils/app-mobile.ts +0 -113
- package/src/cli/utils/app-types.ts +0 -248
- package/src/cli/utils/app.ts +0 -6
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import { handleCheckLint } from "../../../src/tools/quality/check_lint.js";
|
|
3
|
+
import { exec } from "child_process";
|
|
4
|
+
|
|
5
|
+
vi.mock("child_process");
|
|
6
|
+
|
|
7
|
+
describe("handleCheckLint", () => {
|
|
8
|
+
const projectRoot = "/fake/project";
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.clearAllMocks();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should execute the lint command and return output on success", async () => {
|
|
15
|
+
const args = {};
|
|
16
|
+
|
|
17
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
+
callback(null, "All good!", "");
|
|
20
|
+
return {} as any;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const result = await handleCheckLint(projectRoot, args);
|
|
24
|
+
|
|
25
|
+
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
26
|
+
expect(result.isError).toBeUndefined();
|
|
27
|
+
expect(result.content[0].text).toContain("All good!");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should execute the lint command and return output on failure (lint issues found)", async () => {
|
|
31
|
+
const args = {};
|
|
32
|
+
const lintErrorOutput = "Error: 2 problems (2 errors, 0 warnings)";
|
|
33
|
+
|
|
34
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
35
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
36
|
+
callback({ code: 1, message: "Lint errors found" }, lintErrorOutput, "");
|
|
37
|
+
return {} as any;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const result = await handleCheckLint(projectRoot, args);
|
|
41
|
+
|
|
42
|
+
expect(exec).toHaveBeenCalledWith("npm run lint", { cwd: projectRoot, timeout: 60000 }, expect.any(Function));
|
|
43
|
+
expect(result.isError).toBe(true); // Implementation returns isError: true on failure
|
|
44
|
+
expect(result.content[0].text).toContain(lintErrorOutput);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import { handleRunCommand } from "../../../src/tools/shell/run_command.js";
|
|
3
|
+
import { exec } from "child_process";
|
|
4
|
+
|
|
5
|
+
vi.mock("child_process");
|
|
6
|
+
|
|
7
|
+
describe("handleRunCommand", () => {
|
|
8
|
+
const projectRoot = "/fake/project";
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.clearAllMocks();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("should execute an allowed command", async () => {
|
|
15
|
+
const args = { command: "git status" };
|
|
16
|
+
|
|
17
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
18
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
19
|
+
callback(null, "On branch main", "");
|
|
20
|
+
return {} as any;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
24
|
+
|
|
25
|
+
expect(exec).toHaveBeenCalledWith("git status", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
26
|
+
expect(result.isError).toBeUndefined();
|
|
27
|
+
expect(result.content[0].text).toContain("On branch main");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("should reject a disallowed command", async () => {
|
|
31
|
+
const args = { command: "rm -rf /" };
|
|
32
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
33
|
+
|
|
34
|
+
expect(exec).not.toHaveBeenCalled();
|
|
35
|
+
expect(result.isError).toBe(true);
|
|
36
|
+
expect(result.content[0].text).toContain("Command not allowed");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("should handle command failure", async () => {
|
|
40
|
+
const args = { command: "npm run build" };
|
|
41
|
+
|
|
42
|
+
vi.mocked(exec).mockImplementation((_cmd, _opts, callback) => {
|
|
43
|
+
// @ts-expect-error: Mock implementation callback type is complex
|
|
44
|
+
callback({ code: 1, message: "Build failed" }, "", "Error details");
|
|
45
|
+
return {} as any;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const result = await handleRunCommand(projectRoot, args);
|
|
49
|
+
|
|
50
|
+
expect(exec).toHaveBeenCalledWith("npm run build", { cwd: projectRoot, timeout: 30000 }, expect.any(Function));
|
|
51
|
+
expect(result.isError).toBe(true);
|
|
52
|
+
expect(result.content[0].text).toContain("Command failed with exit code 1");
|
|
53
|
+
expect(result.content[0].text).toContain("Error details");
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts"]
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-enderun",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "The Supreme AI Governance & Autonomous Orchestration Framework for Enterprise Development. Acts as a Corporate AI Management Assistant.",
|
|
5
5
|
"author": "Yusuf BEKAR",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
"bin",
|
|
34
34
|
"dist",
|
|
35
35
|
"src",
|
|
36
|
+
"templates",
|
|
37
|
+
"framework-mcp",
|
|
36
38
|
"README.md",
|
|
37
39
|
"LICENSE"
|
|
38
40
|
],
|
|
@@ -58,20 +60,20 @@
|
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@eslint/js": "^10.0.1",
|
|
61
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
63
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
62
64
|
"@pandacss/dev": "^1.11.1",
|
|
63
65
|
"@types/node": "^25.9.1",
|
|
64
66
|
"eslint": "^10.4.0",
|
|
65
67
|
"globals": "^17.6.0",
|
|
66
68
|
"tsx": "^4.22.3",
|
|
67
|
-
"typescript": "^
|
|
68
|
-
"typescript-eslint": "^8.
|
|
69
|
-
"vitest": "^
|
|
69
|
+
"typescript": "^5.0.0",
|
|
70
|
+
"typescript-eslint": "^8.0.0",
|
|
71
|
+
"vitest": "^3.0.0"
|
|
70
72
|
},
|
|
71
73
|
"enderun": {
|
|
72
|
-
"version": "1.
|
|
74
|
+
"version": "1.11.0",
|
|
73
75
|
"initializedAt": "2026-06-04T18:51:28.970Z",
|
|
74
|
-
"frameworkDir": ".
|
|
76
|
+
"frameworkDir": ".enderun"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
79
|
"chalk": "^5.6.2",
|
package/src/cli/adapters/core.ts
CHANGED
|
@@ -3,8 +3,8 @@ import path from "path";
|
|
|
3
3
|
import { writeJsonFile } from "../utils/fs.js";
|
|
4
4
|
import { getPackageRoot } from "../utils/pkg.js";
|
|
5
5
|
|
|
6
|
-
import type { AdapterConfig, AdapterId } from "../../modules/adapters/types.js";
|
|
7
6
|
import { ADAPTER_CONFIGS, POST_INIT_HANDLERS } from "../../modules/adapters/definitions.js";
|
|
7
|
+
import type { AdapterConfig, AdapterId } from "../../modules/adapters/types.js";
|
|
8
8
|
|
|
9
9
|
export const ADAPTERS: Record<AdapterId, AdapterConfig> = ADAPTER_CONFIGS;
|
|
10
10
|
|
|
@@ -21,11 +21,17 @@ export const FRAMEWORK_DIR_CANDIDATES = [
|
|
|
21
21
|
".gemini/antigravity-cli",
|
|
22
22
|
".gemini",
|
|
23
23
|
".agents",
|
|
24
|
+
"antigravity-cli"
|
|
24
25
|
] as const;
|
|
25
26
|
|
|
26
27
|
export function buildMcpServerEntry(projectRoot: string) {
|
|
27
28
|
const packageRoot = getPackageRoot();
|
|
28
29
|
const mcpServerPath = path.join(packageRoot, "framework-mcp/dist/index.js");
|
|
30
|
+
|
|
31
|
+
if (!fs.existsSync(mcpServerPath)) {
|
|
32
|
+
console.warn(`โ ๏ธ MCP Server not found at ${mcpServerPath}. Did you run 'npm run build'?`);
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
const relativePath = path.relative(projectRoot, mcpServerPath) || mcpServerPath;
|
|
30
36
|
|
|
31
37
|
return {
|
|
@@ -2,3 +2,4 @@ export { ADAPTER_IDS, type AdapterConfig, type AdapterId, type AdapterRole } fro
|
|
|
2
2
|
export { ADAPTERS, FRAMEWORK_DIR_CANDIDATES, runAdapterPostInit, buildMcpServerEntry } from "./core.js";
|
|
3
3
|
export { resolveAdapter, isAdapterShimFile, remapFrameworkContent } from "./utils.js";
|
|
4
4
|
export { scaffoldAgents } from "./scaffold.js";
|
|
5
|
+
export { resolveAgentsDir, mirrorUnifiedAgentsToNative } from "./paths.js";
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import type { AdapterId } from "../../modules/adapters/types.js";
|
|
4
|
+
import { ADAPTER_IDS } from "../../modules/adapters/types.js";
|
|
5
|
+
import {
|
|
6
|
+
LEGACY_AGENT_LAYOUT_BASES,
|
|
7
|
+
UNIFIED_ADAPTER_SLUG,
|
|
8
|
+
UNIFIED_HUB_DIR,
|
|
9
|
+
pathJoin,
|
|
10
|
+
unifiedAdapterPath,
|
|
11
|
+
} from "../../shared/constants.js";
|
|
12
|
+
import { ADAPTERS } from "./core.js";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
CORE_FRAMEWORK_DIR,
|
|
16
|
+
UNIFIED_HUB_DIR,
|
|
17
|
+
UNIFIED_ADAPTER_SLUG,
|
|
18
|
+
} from "../../shared/constants.js";
|
|
19
|
+
|
|
20
|
+
export interface AgentsDestination {
|
|
21
|
+
agentsDir: string;
|
|
22
|
+
agentsExt: string;
|
|
23
|
+
nestedAntigravity: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function unifiedAdapterRoot(aiToolDir: string, adapterId: AdapterId): string {
|
|
27
|
+
return pathJoin(aiToolDir, UNIFIED_ADAPTER_SLUG[adapterId]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function resolveAgentsDir(
|
|
31
|
+
adapterId: AdapterId,
|
|
32
|
+
isUnified: boolean,
|
|
33
|
+
aiToolDir: string = UNIFIED_HUB_DIR,
|
|
34
|
+
): AgentsDestination {
|
|
35
|
+
const adapter = ADAPTERS[adapterId];
|
|
36
|
+
|
|
37
|
+
if (!isUnified) {
|
|
38
|
+
return {
|
|
39
|
+
agentsDir: adapter.agentsDir ?? pathJoin(adapter.frameworkDir, "agents"),
|
|
40
|
+
agentsExt: adapter.agentsExt ?? ".md",
|
|
41
|
+
nestedAntigravity: adapterId === "antigravity-cli",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const base = unifiedAdapterRoot(aiToolDir, adapterId);
|
|
46
|
+
|
|
47
|
+
switch (adapterId) {
|
|
48
|
+
case "cursor":
|
|
49
|
+
return { agentsDir: pathJoin(base, "rules"), agentsExt: ".mdc", nestedAntigravity: false };
|
|
50
|
+
case "codex":
|
|
51
|
+
return { agentsDir: pathJoin(base, "instructions"), agentsExt: ".md", nestedAntigravity: false };
|
|
52
|
+
case "antigravity-cli":
|
|
53
|
+
return { agentsDir: pathJoin(base, "agents"), agentsExt: ".md", nestedAntigravity: true };
|
|
54
|
+
default:
|
|
55
|
+
return { agentsDir: pathJoin(base, "agents"), agentsExt: ".md", nestedAntigravity: false };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getUnifiedAgentLayoutBases(aiToolDir: string = UNIFIED_HUB_DIR): string[] {
|
|
60
|
+
return ADAPTER_IDS.map((id) => resolveAgentsDir(id, true, aiToolDir).agentsDir);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const AGENT_INSTRUCTION_CANDIDATES: Array<(name: string) => string[]> = [
|
|
64
|
+
(n) => ADAPTER_IDS.flatMap((id) => {
|
|
65
|
+
const { agentsDir, nestedAntigravity, agentsExt } = resolveAgentsDir(id, true);
|
|
66
|
+
if (nestedAntigravity) {
|
|
67
|
+
return [pathJoin(agentsDir, n, "agent.json"), pathJoin(agentsDir, n, "agent.md")];
|
|
68
|
+
}
|
|
69
|
+
return [pathJoin(agentsDir, `${n}${agentsExt}`)];
|
|
70
|
+
}),
|
|
71
|
+
(n) => LEGACY_AGENT_LAYOUT_BASES.flatMap((base) => {
|
|
72
|
+
if (base.includes("antigravity")) {
|
|
73
|
+
return [pathJoin(base, n, "agent.json"), pathJoin(base, n, "agent.md")];
|
|
74
|
+
}
|
|
75
|
+
const ext = base.includes("rules") ? ".mdc" : ".md";
|
|
76
|
+
return [pathJoin(base, `${n}${ext}`)];
|
|
77
|
+
}),
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export function findAgentInstruction(projectRoot: string, agentName: string): string | null {
|
|
81
|
+
for (const buildPaths of AGENT_INSTRUCTION_CANDIDATES) {
|
|
82
|
+
for (const rel of buildPaths(agentName)) {
|
|
83
|
+
const full = path.join(projectRoot, rel);
|
|
84
|
+
if (fs.existsSync(full)) return rel;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function detectActiveAgentLayouts(projectRoot: string): string[] {
|
|
91
|
+
const unified = getUnifiedAgentLayoutBases()
|
|
92
|
+
.filter((b) => fs.existsSync(path.join(projectRoot, b)));
|
|
93
|
+
|
|
94
|
+
const legacy = LEGACY_AGENT_LAYOUT_BASES
|
|
95
|
+
.filter((b) => fs.existsSync(path.join(projectRoot, b)));
|
|
96
|
+
|
|
97
|
+
return [...new Set([...unified, ...legacy])];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function copyDirectoryRecursive(src: string, dest: string): void {
|
|
101
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
102
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
103
|
+
const srcPath = path.join(src, entry.name);
|
|
104
|
+
const destPath = path.join(dest, entry.name);
|
|
105
|
+
if (entry.isDirectory()) {
|
|
106
|
+
copyDirectoryRecursive(srcPath, destPath);
|
|
107
|
+
} else {
|
|
108
|
+
fs.copyFileSync(srcPath, destPath);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function mirrorUnifiedAgentsToNative(projectRoot: string, adapterId: AdapterId): void {
|
|
114
|
+
const { agentsDir: unifiedDir } = resolveAgentsDir(adapterId, true);
|
|
115
|
+
const nativeRel = ADAPTERS[adapterId].agentsDir;
|
|
116
|
+
if (!nativeRel) return;
|
|
117
|
+
|
|
118
|
+
const src = path.join(projectRoot, unifiedDir);
|
|
119
|
+
const dest = path.join(projectRoot, nativeRel);
|
|
120
|
+
if (!fs.existsSync(src) || path.resolve(src) === path.resolve(dest)) return;
|
|
121
|
+
|
|
122
|
+
if (fs.existsSync(dest)) {
|
|
123
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
124
|
+
}
|
|
125
|
+
copyDirectoryRecursive(src, dest);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Cursor global rule destinations (native + unified hub). */
|
|
129
|
+
export function getCursorGlobalRulePaths(projectRoot: string): string[] {
|
|
130
|
+
return [
|
|
131
|
+
path.join(projectRoot, ADAPTERS.cursor.frameworkDir, "rules", "global.mdc"),
|
|
132
|
+
path.join(projectRoot, unifiedAdapterPath(UNIFIED_ADAPTER_SLUG.cursor, "rules", "global.mdc")),
|
|
133
|
+
];
|
|
134
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { writeTextFile } from "../utils/fs.js";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import fs from "fs";
|
|
4
|
+
import { getPackageRoot } from "../utils/pkg.js";
|
|
4
5
|
import {
|
|
5
6
|
ALL_AGENTS,
|
|
6
7
|
toClaudeCodeMd,
|
|
@@ -13,14 +14,24 @@ import {
|
|
|
13
14
|
import type { AdapterId } from "../../modules/adapters/types.js";
|
|
14
15
|
import { ADAPTERS } from "./core.js";
|
|
15
16
|
|
|
16
|
-
export function scaffoldAgents(
|
|
17
|
+
export function scaffoldAgents(
|
|
18
|
+
projectRoot: string,
|
|
19
|
+
adapterId: AdapterId,
|
|
20
|
+
dryRun: boolean,
|
|
21
|
+
agentsToScaffold?: string[],
|
|
22
|
+
explicitDestDir?: string,
|
|
23
|
+
explicitExt?: string
|
|
24
|
+
): void {
|
|
17
25
|
const adapter = ADAPTERS[adapterId];
|
|
18
|
-
if (!adapter
|
|
26
|
+
if (!adapter) return;
|
|
19
27
|
|
|
20
28
|
const allowedAgents = agentsToScaffold ? new Set(agentsToScaffold) : undefined;
|
|
21
|
-
const destAgentsDir = path.join(projectRoot, adapter.agentsDir);
|
|
29
|
+
const destAgentsDir = explicitDestDir ? path.join(projectRoot, explicitDestDir) : (adapter.agentsDir ? path.join(projectRoot, adapter.agentsDir) : null);
|
|
30
|
+
const extension = explicitExt || adapter.agentsExt || ".md";
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
if (!destAgentsDir) return;
|
|
33
|
+
|
|
34
|
+
const baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards");
|
|
24
35
|
|
|
25
36
|
try {
|
|
26
37
|
if (!dryRun) fs.mkdirSync(destAgentsDir, { recursive: true });
|
|
@@ -29,7 +40,7 @@ export function scaffoldAgents(projectRoot: string, adapterId: AdapterId, dryRun
|
|
|
29
40
|
if (allowedAgents && !allowedAgents.has(agent.name)) continue;
|
|
30
41
|
|
|
31
42
|
let content = "";
|
|
32
|
-
let fileName = `${agent.name}${
|
|
43
|
+
let fileName = `${agent.name}${extension}`;
|
|
33
44
|
let secondaryContent: string | null = null;
|
|
34
45
|
let secondaryFileName: string | null = null;
|
|
35
46
|
|
|
@@ -71,8 +82,7 @@ export function scaffoldAgents(projectRoot: string, adapterId: AdapterId, dryRun
|
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
}
|
|
74
|
-
console.warn(`โ
Generated ${allowedAgents ? allowedAgents.size : ALL_AGENTS.length} Agent/Rule definitions under ${path.relative(projectRoot, destAgentsDir)}/`);
|
|
75
85
|
} catch (e) {
|
|
76
|
-
console.warn(`โ ๏ธ Failed to scaffold agents: ${e}`);
|
|
86
|
+
console.warn(`โ ๏ธ Failed to scaffold agents for ${adapterId}: ${e}`);
|
|
77
87
|
}
|
|
78
88
|
}
|
|
@@ -2,12 +2,13 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
|
|
5
|
-
import { getFrameworkDir, getMemoryPath, getConfiguredPaths } from "../utils/memory.js";
|
|
5
|
+
import { getFrameworkDir, getMemoryPath, getConfiguredPaths, isFrameworkDevelopmentRepo } from "../utils/memory.js";
|
|
6
6
|
import { getPackageVersion, getValidatorPath } from "../utils/pkg.js";
|
|
7
7
|
import { UI } from "../utils/ui.js";
|
|
8
8
|
import { logger } from "../../shared/logger.js";
|
|
9
9
|
import { scanProjectCompliance } from "../utils/compliance.js";
|
|
10
10
|
import { ALL_AGENTS } from "../../modules/agents/definitions.js";
|
|
11
|
+
import { detectActiveAgentLayouts, findAgentInstruction } from "../adapters/paths.js";
|
|
11
12
|
|
|
12
13
|
export async function checkCommand() {
|
|
13
14
|
UI.intent("Agent Enderun Health Check", `Checking system health and discipline rules (v${getPackageVersion()})...`);
|
|
@@ -32,18 +33,7 @@ export async function checkCommand() {
|
|
|
32
33
|
issues++;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
const localPkgPath = path.join(process.cwd(), "package.json");
|
|
38
|
-
if (fs.existsSync(localPkgPath)) {
|
|
39
|
-
const localPkg = JSON.parse(fs.readFileSync(localPkgPath, "utf8"));
|
|
40
|
-
if (localPkg.name === "agent-enderun") {
|
|
41
|
-
isFrameworkDevelopment = true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
} catch (err) {
|
|
45
|
-
logger.debug("Failed to read package.json in checkCommand", err);
|
|
46
|
-
}
|
|
36
|
+
const isFrameworkDevelopment = isFrameworkDevelopmentRepo();
|
|
47
37
|
|
|
48
38
|
const checks = [
|
|
49
39
|
{ name: "Constitution (ENDERUN.md)", path: constitutionPath },
|
|
@@ -99,35 +89,23 @@ export async function checkCommand() {
|
|
|
99
89
|
|
|
100
90
|
// Agent Documentation Check (Live Integrity)
|
|
101
91
|
console.warn("\n๐ Checking Agent Integrity (Instructions)...");
|
|
102
|
-
|
|
103
|
-
// We check both the main framework dir and common subdirs
|
|
104
|
-
const possibleAgentDirs = [
|
|
105
|
-
path.join(process.cwd(), ".agents"),
|
|
106
|
-
path.join(process.cwd(), ".gemini/agents"),
|
|
107
|
-
path.join(process.cwd(), ".claude/agents"),
|
|
108
|
-
path.join(process.cwd(), ".cursor/rules"),
|
|
109
|
-
path.join(process.cwd(), ".grok"),
|
|
110
|
-
path.join(process.cwd(), ".antigravity/agents"),
|
|
111
|
-
];
|
|
112
92
|
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (fs.existsSync(mdPath) || fs.existsSync(mdcPath)) {
|
|
123
|
-
UI.success(`Instructions for @${agentName} found in ${path.relative(process.cwd(), activeAgentDir)}`);
|
|
93
|
+
const projectRoot = process.cwd();
|
|
94
|
+
const activeLayouts = detectActiveAgentLayouts(projectRoot);
|
|
95
|
+
|
|
96
|
+
if (activeLayouts.length > 0) {
|
|
97
|
+
UI.success(`Active agent layout(s): ${activeLayouts.join(", ")}`);
|
|
98
|
+
ALL_AGENTS.forEach((agent) => {
|
|
99
|
+
const found = findAgentInstruction(projectRoot, agent.name);
|
|
100
|
+
if (found) {
|
|
101
|
+
UI.success(`Instructions for @${agent.name} found at ${found}`);
|
|
124
102
|
} else {
|
|
125
|
-
UI.error(`Instructions for @${
|
|
103
|
+
UI.error(`Instructions for @${agent.name} MISSING! Run 'agent-enderun init' to scaffold.`);
|
|
126
104
|
issues++;
|
|
127
105
|
}
|
|
128
106
|
});
|
|
129
107
|
} else {
|
|
130
|
-
UI.warning("No active agent instruction directory detected
|
|
108
|
+
UI.warning("No active agent instruction directory detected. Run 'agent-enderun init [adapter]' first.");
|
|
131
109
|
issues++;
|
|
132
110
|
}
|
|
133
111
|
|
|
@@ -149,12 +127,12 @@ export async function checkCommand() {
|
|
|
149
127
|
}
|
|
150
128
|
|
|
151
129
|
try {
|
|
130
|
+
UI.intent("Type Check", "Running 'npx tsc --noEmit' (this may take a few seconds)...");
|
|
152
131
|
execSync("npx tsc --noEmit", { stdio: "pipe" });
|
|
153
132
|
UI.success("TypeScript type check PASSED.");
|
|
154
133
|
} catch (err) {
|
|
155
|
-
UI.
|
|
134
|
+
UI.warning("TypeScript type check FAILED or 'tsc' not found. This is a non-blocking warning for lightweight checks.");
|
|
156
135
|
logger.debug("npx tsc --noEmit check failed", err);
|
|
157
|
-
issues++;
|
|
158
136
|
}
|
|
159
137
|
|
|
160
138
|
interface MetricEntry {
|
|
@@ -74,6 +74,54 @@ export function parseProjectMemory() {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
interface ProjectStructureEntry {
|
|
78
|
+
name: string;
|
|
79
|
+
path: string;
|
|
80
|
+
type: "directory" | "file";
|
|
81
|
+
children?: ProjectStructureEntry[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function getProjectStructure(): ProjectStructureEntry[] {
|
|
85
|
+
const projectRoot = process.cwd();
|
|
86
|
+
|
|
87
|
+
function walk(dir: string, depth = 0): ProjectStructureEntry[] {
|
|
88
|
+
if (depth > 3) return []; // Limit depth for performance
|
|
89
|
+
|
|
90
|
+
const entries: ProjectStructureEntry[] = [];
|
|
91
|
+
let files: fs.Dirent[];
|
|
92
|
+
|
|
93
|
+
try {
|
|
94
|
+
files = fs.readdirSync(dir, { withFileTypes: true });
|
|
95
|
+
} catch (_e) {
|
|
96
|
+
// Silently ignore directories that cannot be read
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
for (const file of files) {
|
|
101
|
+
if (file.name.startsWith(".") || file.name === "node_modules" || file.name === "dist") continue;
|
|
102
|
+
|
|
103
|
+
const fullPath = path.join(dir, file.name);
|
|
104
|
+
const entry: ProjectStructureEntry = {
|
|
105
|
+
name: file.name,
|
|
106
|
+
path: path.relative(projectRoot, fullPath),
|
|
107
|
+
type: file.isDirectory() ? "directory" : "file"
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
if (file.isDirectory()) {
|
|
111
|
+
entry.children = walk(fullPath, depth + 1);
|
|
112
|
+
}
|
|
113
|
+
entries.push(entry);
|
|
114
|
+
}
|
|
115
|
+
return entries;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
return walk(projectRoot);
|
|
120
|
+
} catch {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
77
125
|
export function readManagerLogs() {
|
|
78
126
|
const frameworkDir = getFrameworkDir();
|
|
79
127
|
if (!frameworkDir) return [];
|
|
@@ -3,7 +3,8 @@ import path from "path";
|
|
|
3
3
|
import {
|
|
4
4
|
remapFrameworkContent,
|
|
5
5
|
type AdapterConfig,
|
|
6
|
-
type AdapterId
|
|
6
|
+
type AdapterId,
|
|
7
|
+
ADAPTERS
|
|
7
8
|
} from "../../adapters/index.js";
|
|
8
9
|
import { SHIM_TEMPLATES } from "../../shims.js";
|
|
9
10
|
import { writeJsonFile, writeTextFile } from "../../utils/fs.js";
|
|
@@ -38,7 +39,14 @@ export function scaffoldConstitution(targetDir: string, frameworkDir: string, ad
|
|
|
38
39
|
console.warn(`โ
Constitution file created inside: ${frameworkDir}/ENDERUN.md${readSuccess ? "" : " (default template)"}`);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
export function scaffoldFrameworkConfigs(
|
|
42
|
+
export function scaffoldFrameworkConfigs(
|
|
43
|
+
targetDir: string,
|
|
44
|
+
fDir: string,
|
|
45
|
+
adapter: AdapterConfig,
|
|
46
|
+
dryRun: boolean,
|
|
47
|
+
selectedPalette: string,
|
|
48
|
+
options?: { unified?: boolean; adapters?: string[] }
|
|
49
|
+
) {
|
|
42
50
|
if (dryRun) return;
|
|
43
51
|
const frameworkDir = path.join(targetDir, fDir);
|
|
44
52
|
const palette = COLOR_PALETTES[selectedPalette as keyof typeof COLOR_PALETTES] || COLOR_PALETTES["Modern Blue"];
|
|
@@ -46,12 +54,28 @@ export function scaffoldFrameworkConfigs(targetDir: string, fDir: string, adapte
|
|
|
46
54
|
const config = {
|
|
47
55
|
name: FRAMEWORK_NAME,
|
|
48
56
|
version: getPackageVersion(),
|
|
57
|
+
unified: options?.unified || false,
|
|
58
|
+
adapters: options?.adapters || [adapter.id],
|
|
49
59
|
theme: {
|
|
50
60
|
palette: selectedPalette,
|
|
51
61
|
colors: palette
|
|
52
62
|
}
|
|
53
63
|
};
|
|
54
64
|
writeJsonFile(path.join(frameworkDir, "config.json"), config, dryRun);
|
|
65
|
+
|
|
66
|
+
// Scaffold shared-facts.json in memory-graph
|
|
67
|
+
const graphDir = path.join(frameworkDir, "memory-graph");
|
|
68
|
+
if (!fs.existsSync(graphDir)) fs.mkdirSync(graphDir, { recursive: true });
|
|
69
|
+
const sharedFactsPath = path.join(graphDir, "shared-facts.json");
|
|
70
|
+
if (!fs.existsSync(sharedFactsPath)) {
|
|
71
|
+
writeJsonFile(sharedFactsPath, {
|
|
72
|
+
project: FRAMEWORK_NAME,
|
|
73
|
+
initializedAt: new Date().toISOString(),
|
|
74
|
+
stack: [],
|
|
75
|
+
policies: []
|
|
76
|
+
}, dryRun);
|
|
77
|
+
}
|
|
78
|
+
|
|
55
79
|
let statusContent = "# ๐๏ธ Status\n\n| Agent | State | Active Task | Last Updated | Notes | Extra | Backup |\n|---|---|---|---|---|---|---|\n";
|
|
56
80
|
for (const ag of ALL_AGENTS) {
|
|
57
81
|
statusContent += "| @" + ag.name + " | READY | Idle | - | - | - | - |\n";
|
|
@@ -59,13 +83,28 @@ export function scaffoldFrameworkConfigs(targetDir: string, fDir: string, adapte
|
|
|
59
83
|
writeTextFile(path.join(frameworkDir, "STATUS.md"), statusContent);
|
|
60
84
|
}
|
|
61
85
|
|
|
62
|
-
export function scaffoldShims(
|
|
86
|
+
export function scaffoldShims(
|
|
87
|
+
projectRoot: string,
|
|
88
|
+
coreDir: string,
|
|
89
|
+
adapterId: AdapterId,
|
|
90
|
+
adapter: AdapterConfig,
|
|
91
|
+
dryRun: boolean,
|
|
92
|
+
unified: boolean = false
|
|
93
|
+
) {
|
|
63
94
|
for (const [name, content] of Object.entries(SHIM_TEMPLATES)) {
|
|
64
|
-
|
|
95
|
+
const isSelectedAdapter = name.toLowerCase() === adapterId.split("-")[0] || name === adapterId;
|
|
96
|
+
|
|
97
|
+
if (unified || isSelectedAdapter) {
|
|
65
98
|
const shimContent = remapFrameworkContent(content, coreDir, adapterId);
|
|
66
|
-
const
|
|
99
|
+
const shimAdapter = ADAPTERS[name as AdapterId] || adapter;
|
|
100
|
+
const shimFileName = (unified && !isSelectedAdapter) ? (shimAdapter.shimFile || `${name.toUpperCase()}.md`) : (adapter.shimFile || `${name.toUpperCase()}.md`);
|
|
101
|
+
|
|
67
102
|
if (!dryRun) writeTextFile(path.join(projectRoot, shimFileName), shimContent);
|
|
68
|
-
|
|
103
|
+
if (isSelectedAdapter) {
|
|
104
|
+
console.warn(`โ
Platform shim created: ${shimFileName}`);
|
|
105
|
+
} else if (unified) {
|
|
106
|
+
console.warn(`โ
Unified platform shim added: ${shimFileName}`);
|
|
107
|
+
}
|
|
69
108
|
}
|
|
70
109
|
}
|
|
71
110
|
}
|
|
@@ -43,7 +43,12 @@ This document outlines the strict ESLint coding standards for Agent Enderun proj
|
|
|
43
43
|
{ file: "quality-standards.md", template: "templates/standards/quality-standards.md", default: "# โ๏ธ Corporate Code Quality Standards" },
|
|
44
44
|
{ file: "logging-and-secrets.md", template: "templates/standards/logging-and-secrets.md", default: "# ๐ชต Corporate Logging Standards" },
|
|
45
45
|
{ file: "testing-standards.md", template: "templates/standards/testing-standards.md", default: "# ๐งช Corporate Testing Standards" },
|
|
46
|
-
{ file: "i18n-standards.md", template: "templates/standards/i18n-standards.md", default: "# ๐ Corporate i18n Standards" }
|
|
46
|
+
{ file: "i18n-standards.md", template: "templates/standards/i18n-standards.md", default: "# ๐ Corporate i18n Standards" },
|
|
47
|
+
{ file: "llm-governance.md", template: "templates/standards/llm-governance.md", default: "# ๐ค LLM Governance Standards" },
|
|
48
|
+
{ file: "observability-standards.md", template: "templates/standards/observability-standards.md", default: "# ๐ Corporate Observability Standards" },
|
|
49
|
+
{ file: "deployment-standards.md", template: "templates/standards/deployment-standards.md", default: "# ๐ Corporate Deployment Standards" },
|
|
50
|
+
{ file: "performance-standards.md", template: "templates/standards/performance-standards.md", default: "# โก Corporate Performance Standards" },
|
|
51
|
+
{ file: "security-audit-standards.md", template: "templates/standards/security-audit-standards.md", default: "# ๐ Corporate Security Audit Standards" }
|
|
47
52
|
];
|
|
48
53
|
|
|
49
54
|
for (const std of standards) {
|