agent-enderun 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.enderun/ARCHITECTURE.md +1 -0
- package/.enderun/BRAIN_DASHBOARD.md +1 -1
- package/.enderun/ENDERUN.md +2 -2
- package/.enderun/SECURITY.md +1 -0
- package/.enderun/STATUS.md +4 -4
- package/.enderun/agents/agent_army_schema.json +71 -77
- package/.enderun/agents/analyst.json +32 -0
- package/.enderun/agents/backend.json +32 -0
- package/.enderun/agents/database.json +32 -0
- package/.enderun/agents/devops.json +32 -0
- package/.enderun/agents/explorer.json +32 -0
- package/.enderun/agents/frontend.json +32 -0
- package/.enderun/agents/git.json +32 -0
- package/.enderun/agents/manager.json +32 -0
- package/.enderun/agents/mobile.json +32 -0
- package/.enderun/agents/native.json +32 -0
- package/.enderun/agents/quality.json +32 -0
- package/.enderun/agents/schema/agent-lifecycle-schema.json +35 -80
- package/.enderun/agents/security.json +32 -0
- package/.enderun/cli-commands.json +7 -5
- package/.enderun/config.json +1 -1
- package/.enderun/knowledge/ARCHITECTURE.md +1 -0
- package/.enderun/knowledge/SECURITY.md +1 -0
- package/.enderun/knowledge/SHIM_TEMPLATE.md +1 -1
- package/.enderun/logs/manager.json +1 -0
- package/.enderun/memory/PROJECT_MEMORY.md +6 -0
- package/.enderun/observability/README.md +1 -1
- package/README.md +32 -31
- package/agent.md +1 -1
- package/bin/hermes-sandbox.js +0 -4
- package/bin/init-check.js +0 -1
- package/bin/validate-agent-army.js +34 -92
- package/dist/apps/backend/src/types/index.d.ts +9 -0
- package/dist/apps/backend/src/types/index.js +5 -0
- package/dist/apps/backend/src/types/index.js.map +1 -0
- package/dist/apps/web/src/main.d.ts +1 -0
- package/dist/apps/web/src/main.js +9 -0
- package/dist/apps/web/src/main.js.map +1 -0
- package/dist/apps/web/vite.config.d.ts +2 -0
- package/dist/apps/web/vite.config.js +6 -0
- package/dist/apps/web/vite.config.js.map +1 -0
- package/dist/framework-mcp/src/index.d.ts +1 -0
- package/dist/framework-mcp/src/index.js +71 -0
- package/dist/framework-mcp/src/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/definitions.d.ts +2 -0
- package/dist/framework-mcp/src/tools/definitions.js +111 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +19 -0
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js +8 -0
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +32 -0
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +2 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.js +10 -0
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/get_status.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/get_status.js +6 -0
- package/dist/framework-mcp/src/tools/framework/get_status.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.js +6 -0
- package/dist/framework-mcp/src/tools/framework/orchestrate.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js +6 -0
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.d.ts +2 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js +9 -0
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -0
- package/dist/framework-mcp/src/tools/index.d.ts +5 -0
- package/dist/framework-mcp/src/tools/index.js +26 -0
- package/dist/framework-mcp/src/tools/index.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.d.ts +2 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.js +23 -0
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +2 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.js +24 -0
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +47 -0
- package/dist/framework-mcp/src/tools/types.js +2 -0
- package/dist/framework-mcp/src/tools/types.js.map +1 -0
- package/dist/framework-mcp/src/utils/cli.d.ts +5 -0
- package/dist/framework-mcp/src/utils/cli.js +21 -0
- package/dist/framework-mcp/src/utils/cli.js.map +1 -0
- package/dist/framework-mcp/src/utils/security.d.ts +12 -0
- package/dist/framework-mcp/src/utils/security.js +54 -0
- package/dist/framework-mcp/src/utils/security.js.map +1 -0
- package/dist/src/cli/adapters.d.ts +32 -0
- package/dist/src/cli/adapters.js +264 -0
- package/dist/src/cli/adapters.js.map +1 -0
- package/dist/src/cli/commands/app.d.ts +4 -0
- package/dist/src/cli/commands/app.js +32 -0
- package/dist/src/cli/commands/app.js.map +1 -0
- package/dist/src/cli/commands/check.d.ts +6 -0
- package/dist/src/cli/commands/check.js +110 -0
- package/dist/src/cli/commands/check.js.map +1 -0
- package/dist/src/cli/commands/compliance.d.ts +1 -0
- package/dist/src/cli/commands/compliance.js +51 -0
- package/dist/src/cli/commands/compliance.js.map +1 -0
- package/dist/src/cli/commands/contract.d.ts +8 -0
- package/dist/src/cli/commands/contract.js +73 -0
- package/dist/src/cli/commands/contract.js.map +1 -0
- package/dist/src/cli/commands/explorer.d.ts +2 -0
- package/dist/src/cli/commands/explorer.js +43 -0
- package/dist/src/cli/commands/explorer.js.map +1 -0
- package/dist/src/cli/commands/git.d.ts +2 -0
- package/dist/src/cli/commands/git.js +41 -0
- package/dist/src/cli/commands/git.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +1 -0
- package/dist/src/cli/commands/init.js +338 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/knowledge.d.ts +2 -0
- package/dist/src/cli/commands/knowledge.js +43 -0
- package/dist/src/cli/commands/knowledge.js.map +1 -0
- package/dist/src/cli/commands/lint.d.ts +4 -0
- package/dist/src/cli/commands/lint.js +24 -0
- package/dist/src/cli/commands/lint.js.map +1 -0
- package/dist/src/cli/commands/log.d.ts +9 -0
- package/dist/src/cli/commands/log.js +33 -0
- package/dist/src/cli/commands/log.js.map +1 -0
- package/dist/src/cli/commands/memory.d.ts +1 -0
- package/dist/src/cli/commands/memory.js +72 -0
- package/dist/src/cli/commands/memory.js.map +1 -0
- package/dist/src/cli/commands/orchestrate.d.ts +1 -0
- package/dist/src/cli/commands/orchestrate.js +111 -0
- package/dist/src/cli/commands/orchestrate.js.map +1 -0
- package/dist/src/cli/commands/script.d.ts +1 -0
- package/dist/src/cli/commands/script.js +20 -0
- package/dist/src/cli/commands/script.js.map +1 -0
- package/dist/src/cli/commands/security.d.ts +1 -0
- package/dist/src/cli/commands/security.js +37 -0
- package/dist/src/cli/commands/security.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +4 -0
- package/dist/src/cli/commands/status.js +56 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/trace.d.ts +4 -0
- package/dist/src/cli/commands/trace.js +42 -0
- package/dist/src/cli/commands/trace.js.map +1 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/index.js +117 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/utils/app.d.ts +33 -0
- package/dist/src/cli/utils/app.js +710 -0
- package/dist/src/cli/utils/app.js.map +1 -0
- package/dist/src/cli/utils/claude.d.ts +8 -0
- package/dist/src/cli/utils/claude.js +56 -0
- package/dist/src/cli/utils/claude.js.map +1 -0
- package/dist/src/cli/utils/fs.d.ts +11 -0
- package/dist/src/cli/utils/fs.js +144 -0
- package/dist/src/cli/utils/fs.js.map +1 -0
- package/dist/src/cli/utils/memory.d.ts +14 -0
- package/dist/src/cli/utils/memory.js +173 -0
- package/dist/src/cli/utils/memory.js.map +1 -0
- package/dist/src/cli/utils/pkg.d.ts +24 -0
- package/dist/src/cli/utils/pkg.js +254 -0
- package/dist/src/cli/utils/pkg.js.map +1 -0
- package/dist/src/cli/utils/string.d.ts +6 -0
- package/dist/src/cli/utils/string.js +44 -0
- package/dist/src/cli/utils/string.js.map +1 -0
- package/dist/src/cli/utils/time.d.ts +2 -0
- package/dist/src/cli/utils/time.js +28 -0
- package/dist/src/cli/utils/time.js.map +1 -0
- package/dist/tests/adapter.test.d.ts +1 -0
- package/dist/tests/adapter.test.js +80 -0
- package/dist/tests/adapter.test.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/index.d.ts +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/index.js +71 -0
- package/dist/tests/framework-init-test/framework-mcp/src/index.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/definitions.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/definitions.js +111 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/definitions.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/patch_file.js +19 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/patch_file.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/read_file.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/read_file.js +8 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/read_file.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/replace_text.js +32 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/replace_text.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/write_file.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/write_file.js +10 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/file_system/write_file.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/get_status.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/get_status.js +6 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/get_status.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/orchestrate.js +6 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/orchestrate.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_contract_hash.js +6 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_memory.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_memory.js +9 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/framework/update_memory.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/index.d.ts +5 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/index.js +26 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/index.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/log_action.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/log_action.js +23 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/log_action.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/send_message.d.ts +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/send_message.js +24 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/messaging/send_message.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/types.d.ts +47 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/types.js +2 -0
- package/dist/tests/framework-init-test/framework-mcp/src/tools/types.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/cli.d.ts +5 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/cli.js +21 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/cli.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/security.d.ts +12 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/security.js +54 -0
- package/dist/tests/framework-init-test/framework-mcp/src/utils/security.js.map +1 -0
- package/dist/tests/framework-init-test/framework-mcp/tests/tools/file_system/replace_text.test.d.ts +1 -0
- package/dist/tests/framework-init-test/framework-mcp/tests/tools/file_system/replace_text.test.js +69 -0
- package/dist/tests/framework-init-test/framework-mcp/tests/tools/file_system/replace_text.test.js.map +1 -0
- package/dist/tests/framework-init-test/panda.config.d.ts +4 -0
- package/dist/tests/framework-init-test/panda.config.js +95 -0
- package/dist/tests/framework-init-test/panda.config.js.map +1 -0
- package/dist/tests/framework-init-test/vitest.config.d.ts +2 -0
- package/dist/tests/framework-init-test/vitest.config.js +19 -0
- package/dist/tests/framework-init-test/vitest.config.js.map +1 -0
- package/dist/tests/gemini.test.d.ts +1 -0
- package/dist/tests/gemini.test.js +38 -0
- package/dist/tests/gemini.test.js.map +1 -0
- package/dist/tests/initial.test.d.ts +1 -0
- package/dist/tests/initial.test.js +7 -0
- package/dist/tests/initial.test.js.map +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +19 -0
- package/dist/vitest.config.js.map +1 -0
- package/eslint.config.js +1 -1
- package/framework-mcp/dist/index.js +2 -2
- package/framework-mcp/dist/src/index.js +70 -0
- package/framework-mcp/dist/src/tools/definitions.js +110 -0
- package/framework-mcp/dist/src/tools/file_system/patch_file.js +18 -0
- package/framework-mcp/dist/src/tools/file_system/read_file.js +7 -0
- package/framework-mcp/dist/src/tools/file_system/replace_text.js +31 -0
- package/framework-mcp/dist/src/tools/file_system/write_file.js +9 -0
- package/framework-mcp/dist/src/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/src/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/src/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/src/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/src/tools/index.js +25 -0
- package/framework-mcp/dist/src/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/src/tools/messaging/send_message.js +23 -0
- package/framework-mcp/dist/src/tools/types.js +1 -0
- package/framework-mcp/dist/src/utils/cli.js +20 -0
- package/framework-mcp/dist/src/utils/security.js +53 -0
- package/framework-mcp/dist/tests/tools/file_system/replace_text.test.js +68 -0
- package/framework-mcp/dist/tools/definitions.js +1 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +18 -1
- package/framework-mcp/dist/tools/framework/get_status.js +2 -2
- package/framework-mcp/dist/tools/framework/orchestrate.js +2 -2
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +2 -2
- package/framework-mcp/dist/tools/framework/update_memory.js +1 -1
- package/framework-mcp/dist/tools/messaging/send_message.js +4 -2
- package/framework-mcp/dist/utils/cli.js +2 -2
- package/framework-mcp/dist/utils/security.js +23 -5
- package/framework-mcp/package.json +3 -3
- package/framework-mcp/src/index.ts +2 -2
- package/framework-mcp/src/tools/definitions.ts +1 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +21 -1
- package/framework-mcp/src/tools/framework/get_status.ts +3 -3
- package/framework-mcp/src/tools/framework/orchestrate.ts +3 -3
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +3 -3
- package/framework-mcp/src/tools/framework/update_memory.ts +1 -1
- package/framework-mcp/src/tools/messaging/send_message.ts +5 -2
- package/framework-mcp/src/tools/types.ts +3 -0
- package/framework-mcp/src/utils/cli.ts +2 -2
- package/framework-mcp/src/utils/security.ts +23 -5
- package/framework-mcp/tests/tools/file_system/replace_text.test.js +68 -0
- package/framework-mcp/tests/tools/file_system/replace_text.test.ts +77 -0
- package/framework-mcp/tsconfig.json +1 -2
- package/mcp.json +4 -4
- package/package.json +4 -3
- package/src/cli/adapters.ts +16 -9
- package/src/cli/commands/contract.ts +2 -2
- package/src/cli/commands/init.ts +211 -432
- package/src/cli/commands/memory.ts +5 -0
- package/src/cli/index.ts +7 -0
- package/src/cli/utils/app.ts +19 -16
- package/src/cli/utils/claude.ts +2 -1
- package/src/cli/utils/fs.ts +2 -1
- package/src/cli/utils/memory.ts +2 -2
- package/src/cli/utils/pkg.ts +32 -0
- package/.enderun/agents/analyst.md +0 -32
- package/.enderun/agents/backend.md +0 -49
- package/.enderun/agents/database.md +0 -41
- package/.enderun/agents/devops.md +0 -41
- package/.enderun/agents/explorer.md +0 -40
- package/.enderun/agents/frontend.md +0 -48
- package/.enderun/agents/git.md +0 -41
- package/.enderun/agents/manager.md +0 -43
- package/.enderun/agents/mobile.md +0 -42
- package/.enderun/agents/native.md +0 -41
- package/.enderun/agents/quality.md +0 -40
- package/.enderun/agents/security.md +0 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../apps/backend/src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
const rootElement = document.getElementById("root");
|
|
4
|
+
if (rootElement) {
|
|
5
|
+
ReactDOM.createRoot(rootElement).render(<React.StrictMode>
|
|
6
|
+
<h1>Agent Enderun Web Active</h1>
|
|
7
|
+
</React.StrictMode>);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../apps/web/src/main.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AAExC,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACpD,IAAI,WAAW,EAAE,CAAC;IACd,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CACnC,CAAC,KAAK,CAAC,UAAU,CACb;YAAA,CAAC,EAAE,CAAC,wBAAwB,EAAE,EAAE,CACpC;QAAA,EAAE,KAAK,CAAC,UAAU,CAAC,CACtB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.config.js","sourceRoot":"","sources":["../../../apps/web/vite.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAEzC,eAAe,YAAY,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC;CACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { TOOLS, toolHandlers } from "./tools/index.js";
|
|
5
|
+
// ─── Server Setup ─────────────────────────────────────────────────
|
|
6
|
+
const server = new Server({
|
|
7
|
+
name: "@agent-enderun/mcp",
|
|
8
|
+
version: "1.0.9",
|
|
9
|
+
}, {
|
|
10
|
+
capabilities: {
|
|
11
|
+
tools: {},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
15
|
+
return { tools: TOOLS };
|
|
16
|
+
});
|
|
17
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
18
|
+
const typedRequest = request;
|
|
19
|
+
const { name, arguments: args } = typedRequest.params;
|
|
20
|
+
const projectRoot = process.env.ENDERUN_PROJECT_ROOT || process.cwd();
|
|
21
|
+
try {
|
|
22
|
+
const handler = toolHandlers[name];
|
|
23
|
+
if (!handler) {
|
|
24
|
+
return {
|
|
25
|
+
isError: true,
|
|
26
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return handler(projectRoot, args || {});
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
33
|
+
return {
|
|
34
|
+
isError: true,
|
|
35
|
+
content: [{ type: "text", text: message }],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
// ─── Graceful Startup & Shutdown ──────────────────────────────────
|
|
40
|
+
async function run() {
|
|
41
|
+
const transport = new StdioServerTransport();
|
|
42
|
+
// Prevent unhandled errors from crashing the MCP stream
|
|
43
|
+
process.on("uncaughtException", (error) => {
|
|
44
|
+
process.stderr.write(`[agent-enderun-mcp] Uncaught exception: ${error.message}
|
|
45
|
+
`);
|
|
46
|
+
});
|
|
47
|
+
process.on("unhandledRejection", (reason) => {
|
|
48
|
+
const message = reason instanceof Error ? reason.message : String(reason);
|
|
49
|
+
process.stderr.write(`[agent-enderun-mcp] Unhandled rejection: ${message}
|
|
50
|
+
`);
|
|
51
|
+
});
|
|
52
|
+
// Graceful shutdown on SIGINT/SIGTERM
|
|
53
|
+
const shutdown = async () => {
|
|
54
|
+
try {
|
|
55
|
+
await server.close();
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Already closed or failed — safe to ignore
|
|
59
|
+
}
|
|
60
|
+
process.exit(0);
|
|
61
|
+
};
|
|
62
|
+
process.on("SIGINT", shutdown);
|
|
63
|
+
process.on("SIGTERM", shutdown);
|
|
64
|
+
await server.connect(transport);
|
|
65
|
+
}
|
|
66
|
+
run().catch((error) => {
|
|
67
|
+
process.stderr.write(`[agent-enderun-mcp] Fatal startup error: ${error.message}
|
|
68
|
+
`);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../framework-mcp/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACH,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGvD,qEAAqE;AAErE,MAAM,MAAM,GAAG,IAAI,MAAM,CACrB;IACI,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;CACnB,EACD;IACI,YAAY,EAAE;QACV,KAAK,EAAE,EAAE;KACZ;CACJ,CACJ,CAAC;AAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACxD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9D,MAAM,YAAY,GAAG,OAA0B,CAAC;IAChD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,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1E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,OAAO;CAC/E,CAAC,CAAC;IACC,CAAC,CAAC,CAAC;IAEH,sCAAsC;IACtC,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;QACxB,IAAI,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACL,4CAA4C;QAChD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAEhC,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;IACzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,KAAK,CAAC,OAAO;CACjF,CAAC,CAAC;IACC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export const TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
name: "read_file",
|
|
4
|
+
description: "Read the content of a file within the project.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
path: { type: "string", description: "Path to the file relative to project root" },
|
|
9
|
+
},
|
|
10
|
+
required: ["path"],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "write_file",
|
|
15
|
+
description: "Write content to a file. Creates directories if missing.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
path: { type: "string", description: "Path to the file relative to project root" },
|
|
20
|
+
content: { type: "string", description: "Complete content of the file" },
|
|
21
|
+
},
|
|
22
|
+
required: ["path", "content"],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "replace_text",
|
|
27
|
+
description: "Surgically replace a string in a file with another string.",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
path: { type: "string", description: "Path to the file" },
|
|
32
|
+
oldText: { type: "string", description: "The exact text to find" },
|
|
33
|
+
newText: { type: "string", description: "The text to replace it with" },
|
|
34
|
+
},
|
|
35
|
+
required: ["path", "oldText", "newText"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "patch_file",
|
|
40
|
+
description: "Safely update a file by replacing a specific line range with new content.",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: "object",
|
|
43
|
+
properties: {
|
|
44
|
+
path: { type: "string", description: "Path to the file" },
|
|
45
|
+
startLine: { type: "number", description: "Starting line number (1-indexed)" },
|
|
46
|
+
endLine: { type: "number", description: "Ending line number (inclusive)" },
|
|
47
|
+
newContent: { type: "string", description: "The new lines to insert" },
|
|
48
|
+
},
|
|
49
|
+
required: ["path", "startLine", "endLine", "newContent"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "get_framework_status",
|
|
54
|
+
description: "Get the current project phase, active traces, and agent states.",
|
|
55
|
+
inputSchema: { type: "object", properties: {} },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "update_project_memory",
|
|
59
|
+
description: "Update a specific section in PROJECT_MEMORY.md.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object",
|
|
62
|
+
properties: {
|
|
63
|
+
section: { type: "string", description: "Section name (e.g., HISTORY, ACTIVE TASKS)" },
|
|
64
|
+
content: { type: "string", description: "Markdown content to append or set" },
|
|
65
|
+
},
|
|
66
|
+
required: ["section", "content"],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "orchestrate_loop",
|
|
71
|
+
description: "Process the pending Hermes messages and trigger dynamic state transitions.",
|
|
72
|
+
inputSchema: { type: "object", properties: {} },
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "send_agent_message",
|
|
76
|
+
description: "Send a Hermes protocol message to another agent.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
from: { type: "string", description: "Sender agent (e.g., @manager, @backend). Defaults to @mcp if omitted." },
|
|
81
|
+
to: { type: "string", description: "Target agent (e.g., @backend, @qa)" },
|
|
82
|
+
category: { type: "string", enum: ["ACTION", "DELEGATION", "INFO", "ALERT"] },
|
|
83
|
+
content: { type: "string", description: "Message content" },
|
|
84
|
+
traceId: { type: "string", description: "Active Trace ID" },
|
|
85
|
+
},
|
|
86
|
+
required: ["to", "category", "content", "traceId"],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "log_agent_action",
|
|
91
|
+
description: "Log an agent action to the framework logs.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
agent: { type: "string", description: "The agent name (e.g., @manager, @backend)" },
|
|
96
|
+
action: { type: "string", description: "Action type or name" },
|
|
97
|
+
traceId: { type: "string", description: "The active Trace ID" },
|
|
98
|
+
status: { type: "string", enum: ["SUCCESS", "FAILURE"], description: "The status of the action" },
|
|
99
|
+
summary: { type: "string", description: "Brief description of the action taken" },
|
|
100
|
+
findings: { type: "string", description: "Optional comma-separated findings or details" }
|
|
101
|
+
},
|
|
102
|
+
required: ["agent", "action", "traceId", "status", "summary"]
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "update_contract_hash",
|
|
107
|
+
description: "Re-generate and synchronize the backend contract SHA-256 hash.",
|
|
108
|
+
inputSchema: { type: "object", properties: {} }
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../framework-mcp/src/tools/definitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAqB;IACnC;QACI,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,gDAAgD;QAC7D,WAAW,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;aACrF;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;SACrB;KACJ;IACD;QACI,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,0DAA0D;QACvE,WAAW,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAAE;gBAClF,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;aAC3E;YACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;SAChC;KACJ;IACD;QACI,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,4DAA4D;QACzE,WAAW,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;gBACzD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;gBAClE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;aAC1E;YACD,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;SAC3C;KACJ;IACD;QACI,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,2EAA2E;Q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EAAE,sBAAsB;QAC5B,WAAW,EAAE,gEAAgE;QAC7E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;KAClD;CACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { safePath } from "../../utils/security.js";
|
|
3
|
+
export function handlePatchFile(projectRoot, args) {
|
|
4
|
+
const filePath = safePath(projectRoot, args.path);
|
|
5
|
+
const lines = fs.readFileSync(filePath, "utf8").split("\n");
|
|
6
|
+
const start = args.startLine - 1;
|
|
7
|
+
const end = args.endLine;
|
|
8
|
+
const newContent = args.newContent.split("\n");
|
|
9
|
+
if (start < 0 || start > lines.length) {
|
|
10
|
+
throw new Error(`Invalid start line: ${start + 1}. File has ${lines.length} lines.`);
|
|
11
|
+
}
|
|
12
|
+
if (end < start + 1 || end > lines.length) {
|
|
13
|
+
throw new Error(`Invalid end line: ${end}. Must be between ${start + 1} and ${lines.length}.`);
|
|
14
|
+
}
|
|
15
|
+
lines.splice(start, end - start, ...newContent);
|
|
16
|
+
fs.writeFileSync(filePath, lines.join("\n"));
|
|
17
|
+
return { content: [{ type: "text", text: `✅ File patched successfully: ${args.path}` }] };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=patch_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch_file.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/file_system/patch_file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,IAAc;IAC/D,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,IAAc,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAI,IAAI,CAAC,SAAoB,GAAG,CAAC,CAAC;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAiB,CAAC;IACnC,MAAM,UAAU,GAAI,IAAI,CAAC,UAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE3D,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,uBAAuB,KAAK,GAAG,CAAC,cAAc,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,GAAG,GAAG,KAAK,GAAG,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,qBAAqB,KAAK,GAAG,CAAC,QAAQ,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACnG,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC,CAAC;IAChD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gCAAgC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { safePath } from "../../utils/security.js";
|
|
3
|
+
export function handleReadFile(projectRoot, args) {
|
|
4
|
+
const filePath = safePath(projectRoot, args.path);
|
|
5
|
+
const content = fs.readFileSync(filePath, "utf8");
|
|
6
|
+
return { content: [{ type: "text", text: content }] };
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=read_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read_file.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/file_system/read_file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,MAAM,UAAU,cAAc,CAAC,WAAmB,EAAE,IAAc;IAC9D,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,IAAc,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { safePath } from "../../utils/security.js";
|
|
3
|
+
export function handleReplaceText(projectRoot, args) {
|
|
4
|
+
const filePath = safePath(projectRoot, args.path);
|
|
5
|
+
let content = fs.readFileSync(filePath, "utf8");
|
|
6
|
+
const oldText = args.oldText;
|
|
7
|
+
const newText = args.newText;
|
|
8
|
+
const allowMultiple = args.allowMultiple || false; // Default to false
|
|
9
|
+
if (!content.includes(oldText)) {
|
|
10
|
+
throw new Error(`Text not found in file: ${oldText.slice(0, 100)}...`);
|
|
11
|
+
}
|
|
12
|
+
// Surgical precision guard: reject ambiguous replacements unless allowMultiple is true.
|
|
13
|
+
if (!allowMultiple) {
|
|
14
|
+
const firstIndex = content.indexOf(oldText);
|
|
15
|
+
const lastIndex = content.lastIndexOf(oldText);
|
|
16
|
+
if (firstIndex !== lastIndex) {
|
|
17
|
+
const count = (content.match(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length;
|
|
18
|
+
throw new Error(`Ambiguous replacement: "${oldText.slice(0, 80)}..." found ${count} times in ${args.path}. ` +
|
|
19
|
+
"Provide a longer, unique context string or set 'allow_multiple' to true.");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Perform replacement(s)
|
|
23
|
+
if (allowMultiple) {
|
|
24
|
+
content = content.replace(new RegExp(oldText.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), newText);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
content = content.replace(oldText, newText);
|
|
28
|
+
}
|
|
29
|
+
fs.writeFileSync(filePath, content);
|
|
30
|
+
return { content: [{ type: "text", text: `✅ Surgical edit successful in ${args.path}` }] };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=replace_text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace_text.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/file_system/replace_text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,MAAM,UAAU,iBAAiB,CAAC,WAAmB,EAAE,IAAc;IACjE,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,IAAc,CAAC,CAAC;IAC5D,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAC;IACvC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC,mBAAmB;IAEtE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,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
4
|
+
export function handleWriteFile(projectRoot, args) {
|
|
5
|
+
const filePath = safePath(projectRoot, args.path);
|
|
6
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
7
|
+
fs.writeFileSync(filePath, args.content);
|
|
8
|
+
return { content: [{ type: "text", text: `✅ File written: ${args.path}` }] };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=write_file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write_file.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/file_system/write_file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,IAAc;IAC/D,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,IAAc,CAAC,CAAC;IAC5D,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAiB,CAAC,CAAC;IACnD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleGetFrameworkStatus(projectRoot, args) {
|
|
3
|
+
const output = safeExec("npx", ["agent-enderun", "status"], projectRoot, args.timeout);
|
|
4
|
+
return { content: [{ type: "text", text: output }] };
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=get_status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_status.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/framework/get_status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,UAAU,wBAAwB,CAAC,WAAmB,EAAE,IAAc;IACxE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleOrchestrateLoop(projectRoot, args) {
|
|
3
|
+
const output = safeExec("npx", ["agent-enderun", "orchestrate"], projectRoot, args.timeout);
|
|
4
|
+
return { content: [{ type: "text", text: output }] };
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=orchestrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrate.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/framework/orchestrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,UAAU,qBAAqB,CAAC,WAAmB,EAAE,IAAc;IACrE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,eAAe,EAAE,aAAa,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleUpdateContractHash(projectRoot, args) {
|
|
3
|
+
const output = safeExec("npx", ["agent-enderun", "update-contract"], projectRoot, args.timeout);
|
|
4
|
+
return { content: [{ type: "text", text: output }] };
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=update_contract_hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_contract_hash.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/framework/update_contract_hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,UAAU,wBAAwB,CAAC,WAAmB,EAAE,IAAc;IACxE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { safeExec } from "../../utils/cli.js";
|
|
2
|
+
export function handleUpdateProjectMemory(projectRoot, args) {
|
|
3
|
+
const section = args.section;
|
|
4
|
+
const content = args.content;
|
|
5
|
+
// Using execFileSync with array args prevents command injection
|
|
6
|
+
safeExec("npx", ["agent-enderun", "update_project_memory", section, content], projectRoot, args.timeout);
|
|
7
|
+
return { content: [{ type: "text", text: `✅ Section ${section} updated.` }] };
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=update_memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_memory.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/framework/update_memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,IAAc;IACzE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAiB,CAAC;IACvC,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,CAAC,eAAe,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACzG,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,OAAO,WAAW,EAAE,CAAC,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TOOLS } from "./definitions.js";
|
|
2
|
+
import { handleReadFile } from "./file_system/read_file.js";
|
|
3
|
+
import { handleWriteFile } from "./file_system/write_file.js";
|
|
4
|
+
import { handleReplaceText } from "./file_system/replace_text.js";
|
|
5
|
+
import { handlePatchFile } from "./file_system/patch_file.js";
|
|
6
|
+
import { handleGetFrameworkStatus } from "./framework/get_status.js";
|
|
7
|
+
import { handleUpdateProjectMemory } from "./framework/update_memory.js";
|
|
8
|
+
import { handleOrchestrateLoop } from "./framework/orchestrate.js";
|
|
9
|
+
import { handleUpdateContractHash } from "./framework/update_contract_hash.js";
|
|
10
|
+
import { handleSendAgentMessage } from "./messaging/send_message.js";
|
|
11
|
+
import { handleLogAgentAction } from "./messaging/log_action.js";
|
|
12
|
+
// Map of tool names to their handler functions
|
|
13
|
+
export const toolHandlers = {
|
|
14
|
+
read_file: handleReadFile,
|
|
15
|
+
write_file: handleWriteFile,
|
|
16
|
+
replace_text: handleReplaceText,
|
|
17
|
+
patch_file: handlePatchFile,
|
|
18
|
+
get_framework_status: handleGetFrameworkStatus,
|
|
19
|
+
update_project_memory: handleUpdateProjectMemory,
|
|
20
|
+
orchestrate_loop: handleOrchestrateLoop,
|
|
21
|
+
send_agent_message: handleSendAgentMessage,
|
|
22
|
+
log_agent_action: handleLogAgentAction,
|
|
23
|
+
update_contract_hash: handleUpdateContractHash,
|
|
24
|
+
};
|
|
25
|
+
export { TOOLS };
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../framework-mcp/src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAgC;IACrD,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,iBAAiB;IAC/B,UAAU,EAAE,eAAe;IAC3B,oBAAoB,EAAE,wBAAwB;IAC9C,qBAAqB,EAAE,yBAAyB;IAChD,gBAAgB,EAAE,qBAAqB;IACvC,kBAAkB,EAAE,sBAAsB;IAC1C,gBAAgB,EAAE,oBAAoB;IACtC,oBAAoB,EAAE,wBAAwB;CACjD,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
export function handleLogAgentAction(projectRoot, args) {
|
|
5
|
+
const { agent, action, traceId, status, summary } = args;
|
|
6
|
+
const findings = args.findings ? args.findings.split(",").map(f => f.trim()) : [];
|
|
7
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
8
|
+
const agentName = agent.replace("@", "");
|
|
9
|
+
const logPath = path.join(projectRoot, frameworkDir, "logs", `${agentName}.json`);
|
|
10
|
+
const logEntry = {
|
|
11
|
+
timestamp: new Date().toISOString(),
|
|
12
|
+
agent,
|
|
13
|
+
action,
|
|
14
|
+
requestId: traceId,
|
|
15
|
+
status,
|
|
16
|
+
summary,
|
|
17
|
+
findings
|
|
18
|
+
};
|
|
19
|
+
fs.mkdirSync(path.dirname(logPath), { recursive: true });
|
|
20
|
+
fs.appendFileSync(logPath, JSON.stringify(logEntry) + "\n");
|
|
21
|
+
return { content: [{ type: "text", text: `✅ Action logged for ${agent} to ${path.join(frameworkDir, "logs", `${agentName}.json`)}` }] };
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=log_action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log_action.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/messaging/log_action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,UAAU,oBAAoB,CAAC,WAAmB,EAAE,IAAc;IACpE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAuF,CAAC;IAC5I,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAElF,MAAM,YAAY,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,SAAS,GAAI,KAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,OAAO,CAAC,CAAC;IAElF,MAAM,QAAQ,GAAG;QACb,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,KAAK;QACL,MAAM;QACN,SAAS,EAAE,OAAO;QAClB,MAAM;QACN,OAAO;QACP,QAAQ;KACX,CAAC;IAEF,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;IAE5D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,OAAO,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AAC5I,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
export function handleSendAgentMessage(projectRoot, args) {
|
|
5
|
+
const { to, category, content, traceId } = args;
|
|
6
|
+
// `from` is optional — falls back to "@mcp" for backward compatibility
|
|
7
|
+
const from = args.from || "@mcp";
|
|
8
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
9
|
+
const agentName = to.replace("@", "");
|
|
10
|
+
const messagePath = path.join(projectRoot, frameworkDir, "messages", `${agentName}.json`);
|
|
11
|
+
const message = {
|
|
12
|
+
timestamp: new Date().toISOString(),
|
|
13
|
+
from,
|
|
14
|
+
to,
|
|
15
|
+
category,
|
|
16
|
+
traceId,
|
|
17
|
+
content,
|
|
18
|
+
status: "PENDING"
|
|
19
|
+
};
|
|
20
|
+
fs.mkdirSync(path.dirname(messagePath), { recursive: true });
|
|
21
|
+
fs.appendFileSync(messagePath, JSON.stringify(message) + "\n");
|
|
22
|
+
return { content: [{ type: "text", text: `✅ Message sent to ${to} (from: ${from})` }] };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=send_message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send_message.js","sourceRoot":"","sources":["../../../../../framework-mcp/src/tools/messaging/send_message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,MAAM,UAAU,sBAAsB,CAAC,WAAmB,EAAE,IAAc;IACtE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAA2E,CAAC;IACvH,uEAAuE;IACvE,MAAM,IAAI,GAAI,IAAI,CAAC,IAAe,IAAI,MAAM,CAAC;IAE7C,MAAM,YAAY,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,SAAS,OAAO,CAAC,CAAC;IAE1F,MAAM,OAAO,GAAG;QACZ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,IAAI;QACJ,EAAE;QACF,QAAQ;QACR,OAAO;QACP,OAAO;QACP,MAAM,EAAE,SAAS;KACpB,CAAC;IAEF,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,EAAE,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAE/D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,WAAW,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface ToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: Record<string, {
|
|
7
|
+
type: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
enum?: string[];
|
|
10
|
+
}>;
|
|
11
|
+
required?: string[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface CallToolRequest {
|
|
15
|
+
params: {
|
|
16
|
+
name: string;
|
|
17
|
+
arguments?: ToolArgs;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface ToolArgs {
|
|
21
|
+
path?: string;
|
|
22
|
+
content?: string;
|
|
23
|
+
oldText?: string;
|
|
24
|
+
newText?: string;
|
|
25
|
+
startLine?: number;
|
|
26
|
+
endLine?: number;
|
|
27
|
+
newContent?: string;
|
|
28
|
+
section?: string;
|
|
29
|
+
to?: string;
|
|
30
|
+
category?: "ACTION" | "DELEGATION" | "INFO" | "ALERT";
|
|
31
|
+
traceId?: string;
|
|
32
|
+
agent?: string;
|
|
33
|
+
action?: string;
|
|
34
|
+
status?: "SUCCESS" | "FAILURE";
|
|
35
|
+
summary?: string;
|
|
36
|
+
findings?: string;
|
|
37
|
+
allowMultiple?: boolean;
|
|
38
|
+
timeout?: number;
|
|
39
|
+
from?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolResult {
|
|
42
|
+
isError?: boolean;
|
|
43
|
+
content: Array<{
|
|
44
|
+
type: "text";
|
|
45
|
+
text: string;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../framework-mcp/src/tools/types.ts"],"names":[],"mappings":""}
|