agent-enderun 1.10.4 â 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -45
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +1 -1
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -1
- package/dist/src/cli/adapters/core.d.ts +1 -1
- package/dist/src/cli/adapters/core.js +0 -1
- 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/scaffold.d.ts +1 -1
- package/dist/src/cli/adapters/scaffold.js +13 -7
- package/dist/src/cli/adapters/scaffold.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.js +31 -4
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +9 -7
- package/dist/src/cli/commands/orchestrate.js +40 -4
- 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/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 +1 -1
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +7 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +1 -1
- package/dist/src/modules/agents/definitions.js +129 -69
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +5 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +5 -4
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +2 -1
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +2 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/explorer.js +1 -0
- package/dist/src/modules/agents/registry/explorer.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js +3 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +8 -2
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/native.js +5 -1
- package/dist/src/modules/agents/registry/native.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 +1 -1
- package/dist/src/shared/constants.js +10 -9
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/tests/approve.test.js +4 -9
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/integration/agent_flow.test.js +2 -2
- package/dist/tests/integration/agent_flow.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +2 -7
- package/dist/tests/orchestrate.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 +5 -3
- package/src/cli/adapters/core.ts +2 -3
- package/src/cli/adapters/index.ts +1 -0
- package/src/cli/adapters/scaffold.ts +20 -7
- package/src/cli/commands/init/scaffold-core.ts +45 -6
- package/src/cli/commands/init.ts +31 -2
- package/src/cli/commands/orchestrate.ts +41 -4
- 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/pkg.ts +42 -13
- package/src/modules/adapters/definitions.ts +1 -1
- package/src/modules/adapters/shared.ts +7 -4
- package/src/modules/agents/definitions.ts +140 -73
- package/src/modules/agents/registry/analyst.ts +5 -1
- package/src/modules/agents/registry/backend.ts +5 -4
- package/src/modules/agents/registry/database.ts +2 -1
- package/src/modules/agents/registry/devops.ts +2 -0
- package/src/modules/agents/registry/explorer.ts +1 -0
- package/src/modules/agents/registry/git.ts +3 -1
- package/src/modules/agents/registry/manager.ts +8 -2
- package/src/modules/agents/registry/native.ts +5 -1
- package/src/modules/agents/registry/security.ts +1 -0
- package/src/shared/constants.ts +14 -13
- 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/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
|
@@ -17,6 +17,7 @@ export const database = {
|
|
|
17
17
|
"list_dir",
|
|
18
18
|
"grep_search",
|
|
19
19
|
"read_project_memory",
|
|
20
|
+
"send_agent_message",
|
|
20
21
|
],
|
|
21
22
|
instructions: {
|
|
22
23
|
identity: "Database Architect and Migration Integrity Owner",
|
|
@@ -32,7 +33,7 @@ export const database = {
|
|
|
32
33
|
"DETERMINISTIC MIGRATIONS: Every migration must be reversible and produce identical results across environments.",
|
|
33
34
|
"PERFORMANCE FIRST: Design indexes proactively â never retroactively after a performance incident.",
|
|
34
35
|
],
|
|
35
|
-
knowledgeFiles: ["
|
|
36
|
+
knowledgeFiles: ["kysely-standards.md", "typeorm-standards.md", "quality-standards.md"],
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
//# sourceMappingURL=database.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/database.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACb,mEAAmE;QACnE,2DAA2D;IACzD,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,UAAU;QACV,aAAa;QACb,qBAAqB;
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/database.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACb,mEAAmE;QACnE,2DAA2D;IACzD,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,UAAU;QACV,aAAa;QACb,qBAAqB;QACrB,oBAAoB;KACvB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,kDAAkD;QAC5D,OAAO,EACX,iEAAiE;YACjE,kDAAkD;QAC9C,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,8FAA8F;YAC9F,mFAAmF;YACnF,iHAAiH;YACjH,mGAAmG;SACtG;QACD,cAAc,EAAE,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC;KAC1F;CACJ,CAAC"}
|
|
@@ -12,11 +12,13 @@ export const devops = {
|
|
|
12
12
|
tools: [
|
|
13
13
|
"run_shell_command",
|
|
14
14
|
"read_file",
|
|
15
|
+
"write_file",
|
|
15
16
|
"list_dir",
|
|
16
17
|
"get_system_health",
|
|
17
18
|
"check_active_ports",
|
|
18
19
|
"read_project_memory",
|
|
19
20
|
"send_agent_message",
|
|
21
|
+
"log_agent_action",
|
|
20
22
|
],
|
|
21
23
|
instructions: {
|
|
22
24
|
identity: "Infrastructure Engineer and Environment Integrity Guardian",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devops.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/devops.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAoB;IACnC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,QAAQ;IACd,WAAW,EACb,oDAAoD;QACpD,oEAAoE;IAClE,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,mBAAmB;QACnB,WAAW;QACX,UAAU;QACV,mBAAmB;QACnB,oBAAoB;QACpB,qBAAqB;QACrB,oBAAoB;
|
|
1
|
+
{"version":3,"file":"devops.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/devops.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAoB;IACnC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,QAAQ;IACd,WAAW,EACb,oDAAoD;QACpD,oEAAoE;IAClE,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,mBAAmB;QACnB,oBAAoB;QACpB,qBAAqB;QACrB,oBAAoB;QACpB,kBAAkB;KACrB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,4DAA4D;QACtE,OAAO,EACX,sEAAsE;YACtE,4CAA4C;QACxC,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,mHAAmH;YACnH,8GAA8G;YAC9G,2GAA2G;YAC3G,wFAAwF;SAC3F;QACD,cAAc,EAAE,CAAC,yBAAyB,CAAC;KAC9C;CACJ,CAAC"}
|
|
@@ -31,6 +31,7 @@ export const explorer = {
|
|
|
31
31
|
"DEPENDENCY MAP: Map all file dependencies and surface them to @manager in a structured report.",
|
|
32
32
|
"RECON FIRST: No specialist should act on an unexplored codebase â flag absence of ADP as a phase blocker.",
|
|
33
33
|
],
|
|
34
|
+
knowledgeFiles: ["architecture-standards.md"],
|
|
34
35
|
},
|
|
35
36
|
};
|
|
36
37
|
//# sourceMappingURL=explorer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/explorer.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACb,uDAAuD;QACvD,mDAAmD;IACjD,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,UAAU;QACV,aAAa;QACb,iBAAiB;QACjB,qBAAqB;QACrB,qBAAqB;KACxB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,yDAAyD;QACnE,OAAO,EACX,oEAAoE;YACpE,4CAA4C;QACxC,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,oGAAoG;YACpG,gIAAgI;YAChI,gGAAgG;YAChG,2GAA2G;SAC9G;
|
|
1
|
+
{"version":3,"file":"explorer.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/explorer.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACb,uDAAuD;QACvD,mDAAmD;IACjD,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,UAAU;QACV,aAAa;QACb,iBAAiB;QACjB,qBAAqB;QACrB,qBAAqB;KACxB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,yDAAyD;QACnE,OAAO,EACX,oEAAoE;YACpE,4CAA4C;QACxC,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,oGAAoG;YACpG,gIAAgI;YAChI,gGAAgG;YAChG,2GAA2G;SAC9G;QACD,cAAc,EAAE,CAAC,2BAA2B,CAAC;KAChD;CACJ,CAAC"}
|
|
@@ -6,11 +6,12 @@ export const git = {
|
|
|
6
6
|
description: "Git flow, Branching, and Atomic Commit master. " +
|
|
7
7
|
"Manages the scrolls of history.",
|
|
8
8
|
capability: 9,
|
|
9
|
-
tier: "
|
|
9
|
+
tier: "recon",
|
|
10
10
|
tags: ["core", "logistics"],
|
|
11
11
|
stateMachine: STATE_MACHINE,
|
|
12
12
|
tools: [
|
|
13
13
|
"run_shell_command",
|
|
14
|
+
"read_file",
|
|
14
15
|
"list_dir",
|
|
15
16
|
"grep_search",
|
|
16
17
|
"read_project_memory",
|
|
@@ -30,6 +31,7 @@ export const git = {
|
|
|
30
31
|
"NO FORCE PUSH: Force-pushing to any shared branch is unconditionally forbidden.",
|
|
31
32
|
"GIT FLOW: Strictly follow git-flow branching conventions â feature, hotfix, release naming enforced.",
|
|
32
33
|
],
|
|
34
|
+
knowledgeFiles: ["logging-and-secrets.md"],
|
|
33
35
|
},
|
|
34
36
|
};
|
|
35
37
|
//# sourceMappingURL=git.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/git.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,GAAG,GAAoB;IAChC,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,kBAAkB;IAC/B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACb,iDAAiD;QACjD,iCAAiC;IAC/B,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/git.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,GAAG,GAAoB;IAChC,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,kBAAkB;IAC/B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACb,iDAAiD;QACjD,iCAAiC;IAC/B,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;IAC3B,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,mBAAmB;QACnB,WAAW;QACX,UAAU;QACV,aAAa;QACb,qBAAqB;QACrB,oBAAoB;KACvB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,6DAA6D;QACvE,OAAO,EACX,kEAAkE;YAClE,yCAAyC;QACrC,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,uGAAuG;YACvG,2GAA2G;YAC3G,iFAAiF;YACjF,sGAAsG;SACzG;QACD,cAAc,EAAE,CAAC,wBAAwB,CAAC;KAC7C;CACJ,CAAC"}
|
|
@@ -15,6 +15,9 @@ export const manager = {
|
|
|
15
15
|
"read_project_memory",
|
|
16
16
|
"get_memory_insights",
|
|
17
17
|
"update_project_memory",
|
|
18
|
+
"acquire_lock",
|
|
19
|
+
"release_lock",
|
|
20
|
+
"log_agent_action",
|
|
18
21
|
"get_project_gaps",
|
|
19
22
|
"get_project_map",
|
|
20
23
|
"audit_dependencies",
|
|
@@ -35,15 +38,18 @@ export const manager = {
|
|
|
35
38
|
"4. Execute: Delegate sub-tasks to appropriate specialists and verify compliance at each step.",
|
|
36
39
|
rules: [
|
|
37
40
|
"ABSOLUTE COMPLIANCE: Freeze project and block task on any Nizam violation " +
|
|
38
|
-
"(e.g. 'any' type, 'console.log',
|
|
39
|
-
"
|
|
41
|
+
"(e.g. 'any' type, 'console.log', PII leakage, or raw ID usage). No further action until breach is purged.",
|
|
42
|
+
"PII AUDIT: Proactively scan all specialist logs and memories for PII (Emails, Names). Purge immediately if detected.",
|
|
43
|
+
"PHASE WALL: Gate every phase transition â reject if even one TODO, lint error, or unbranded ID exists in scope.",
|
|
40
44
|
"ORCHESTRATION AUDIT: Audit every specialist message for constitutional compliance before delegating next sub-task.",
|
|
41
45
|
"STRATEGIC RECIPES: Direct specialists to '.enderun/prompts/' for all refactor, bug-fix, or feature tasks.",
|
|
42
46
|
"SURGICAL PRECISION: Reject any full-file overwrite proposal unless the file is under 50 lines.",
|
|
43
47
|
"GAP ANALYSIS: Run 'get_project_gaps' after each phase â unfinished logic is a breach of discipline.",
|
|
44
48
|
"SYSTEM OBSERVABILITY: Periodically invoke 'get_system_health' and 'check_active_ports' to verify environment stability.",
|
|
45
49
|
"MEMORY INTEGRITY: Synchronize 'PROJECT_MEMORY.md' after every single turn. Memory drift is treason.",
|
|
50
|
+
"LOCKING PROTOCOL: Always acquire a lock via 'acquire_lock' on 'memory' resource before writing to PROJECT_MEMORY.md. Release immediately after write.",
|
|
46
51
|
],
|
|
52
|
+
knowledgeFiles: ["governance-standards.md"],
|
|
47
53
|
},
|
|
48
54
|
};
|
|
49
55
|
//# sourceMappingURL=manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/manager.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAoB;IACpC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,yCAAyC;IAC/C,WAAW,EACb,kEAAkE;QAClE,uEAAuE;IACrE,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC;IAC7C,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,kBAAkB;QAClB,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,uBAAuB;QACvB,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QACpB,UAAU;QACV,aAAa;QACb,sBAAsB;QACtB,mBAAmB;QACnB,oBAAoB;QACpB,iBAAiB;KACpB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,yDAAyD;QACnE,OAAO,EACX,kEAAkE;YAClE,4CAA4C;QACxC,cAAc,EAAE,yFAAyF;YACzF,mFAAmF;YACnF,0EAA0E;YAC1E,+FAA+F;QAC/G,KAAK,EAAE;YACH,4EAA4E;gBAClF,
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/manager.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAoB;IACpC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,wBAAwB;IACrC,IAAI,EAAE,yCAAyC;IAC/C,WAAW,EACb,kEAAkE;QAClE,uEAAuE;IACrE,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC;IAC7C,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,kBAAkB;QAClB,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,uBAAuB;QACvB,cAAc;QACd,cAAc;QACd,kBAAkB;QAClB,kBAAkB;QAClB,iBAAiB;QACjB,oBAAoB;QACpB,UAAU;QACV,aAAa;QACb,sBAAsB;QACtB,mBAAmB;QACnB,oBAAoB;QACpB,iBAAiB;KACpB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,yDAAyD;QACnE,OAAO,EACX,kEAAkE;YAClE,4CAA4C;QACxC,cAAc,EAAE,yFAAyF;YACzF,mFAAmF;YACnF,0EAA0E;YAC1E,+FAA+F;QAC/G,KAAK,EAAE;YACH,4EAA4E;gBAClF,2GAA2G;YACrG,sHAAsH;YACtH,iHAAiH;YACjH,oHAAoH;YACpH,2GAA2G;YAC3G,gGAAgG;YAChG,qGAAqG;YACrG,yHAAyH;YACzH,qGAAqG;YACrG,uJAAuJ;SAC1J;QACD,cAAc,EAAE,CAAC,yBAAyB,CAAC;KAC9C;CACJ,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const native = {
|
|
|
6
6
|
description: "Desktop apps and system-level logic specialist. " +
|
|
7
7
|
"Handles OS deep layers with paramount security.",
|
|
8
8
|
capability: 9,
|
|
9
|
-
tier: "
|
|
9
|
+
tier: "recon",
|
|
10
10
|
tags: ["core", "native"],
|
|
11
11
|
stateMachine: STATE_MACHINE,
|
|
12
12
|
tools: [
|
|
@@ -17,6 +17,8 @@ export const native = {
|
|
|
17
17
|
"grep_search",
|
|
18
18
|
"read_project_memory",
|
|
19
19
|
"run_shell_command",
|
|
20
|
+
"send_agent_message",
|
|
21
|
+
"log_agent_action",
|
|
20
22
|
],
|
|
21
23
|
instructions: {
|
|
22
24
|
identity: "Native Integration Engineer and OS-Layer Security Enforcer",
|
|
@@ -30,7 +32,9 @@ export const native = {
|
|
|
30
32
|
"SECURITY PARAMOUNT: Handle all OS-layer operations with rigorous input validation.",
|
|
31
33
|
"PLATFORM ISOLATION: Strictly separate platform-specific code from shared business logic.",
|
|
32
34
|
"SYSTEM CALL AUDITING: Validate all native module inputs and log elevated-privilege operations.",
|
|
35
|
+
"ESCALATION PROTOCOL: Any destructive or elevated-privilege operation requires prior @manager approval via send_agent_message.",
|
|
33
36
|
],
|
|
37
|
+
knowledgeFiles: ["security-standards.md", "logging-and-secrets.md"],
|
|
34
38
|
},
|
|
35
39
|
};
|
|
36
40
|
//# sourceMappingURL=native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/native.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAoB;IACnC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACb,kDAAkD;QAClD,iDAAiD;IAC/C,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/native.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAoB;IACnC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACb,kDAAkD;QAClD,iDAAiD;IAC/C,UAAU,EAAE,CAAC;IACb,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IACxB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,YAAY;QACZ,cAAc;QACd,UAAU;QACV,aAAa;QACb,qBAAqB;QACrB,mBAAmB;QACnB,oBAAoB;QACpB,kBAAkB;KACrB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,4DAA4D;QACtE,OAAO,EACX,kEAAkE;YAClE,4CAA4C;QACxC,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,oFAAoF;YACpF,0FAA0F;YAC1F,gGAAgG;YAChG,+HAA+H;SAClI;QACD,cAAc,EAAE,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;KACtE;CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/security.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACb,uDAAuD;QACvD,uEAAuE;IACrE,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;IAC1B,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,cAAc;QACd,aAAa;QACb,qBAAqB;QACrB,qBAAqB;QACrB,kBAAkB;KACrB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,2CAA2C;QACrD,OAAO,EACX,kEAAkE;YAClE,gCAAgC;QAC5B,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,sGAAsG;YACtG,sGAAsG;YACtG,6EAA6E;YAC7E,0FAA0F;SAC7F;QACD,cAAc,EAAE,CAAC,uBAAuB,CAAC;KAC5C;CACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../../../../src/modules/agents/registry/security.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,uCAAgD,CAAC;AAEvE,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACrC,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,qBAAqB;IAClC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACb,uDAAuD;QACvD,uEAAuE;IACrE,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;IAC1B,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE;QACH,WAAW;QACX,cAAc;QACd,aAAa;QACb,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,kBAAkB;KACrB;IACD,YAAY,EAAE;QACV,QAAQ,EAAE,2CAA2C;QACrD,OAAO,EACX,kEAAkE;YAClE,gCAAgC;QAC5B,cAAc,EAAE,0EAA0E;YAC1E,2FAA2F;YAC3F,0EAA0E;YAC1E,kGAAkG;QAClH,KAAK,EAAE;YACH,sGAAsG;YACtG,sGAAsG;YACtG,6EAA6E;YAC7E,0FAA0F;SAC7F;QACD,cAAc,EAAE,CAAC,uBAAuB,CAAC;KAC5C;CACJ,CAAC"}
|
|
@@ -76,7 +76,7 @@ export declare const DEFAULT_MONOREPO_PATHS: {
|
|
|
76
76
|
readonly docs: "docs";
|
|
77
77
|
readonly tests: "tests";
|
|
78
78
|
};
|
|
79
|
-
/** Cursor rule globs per agent role (monorepo layout). */
|
|
79
|
+
/** Cursor rule globs per agent role (enterprise monorepo layout). */
|
|
80
80
|
export declare const CURSOR_AGENT_GLOBS: Record<string, string>;
|
|
81
81
|
export declare const MCP: {
|
|
82
82
|
readonly SERVER_NAME: "agent-enderun";
|
|
@@ -113,20 +113,21 @@ export const DEFAULT_MONOREPO_PATHS = {
|
|
|
113
113
|
docs: "docs",
|
|
114
114
|
tests: "tests",
|
|
115
115
|
};
|
|
116
|
-
/** Cursor rule globs per agent role (monorepo layout). */
|
|
116
|
+
/** Cursor rule globs per agent role (enterprise monorepo layout). */
|
|
117
117
|
export const CURSOR_AGENT_GLOBS = {
|
|
118
|
+
manager: "**/*",
|
|
119
|
+
security: "**/*",
|
|
120
|
+
architect: "**/*",
|
|
118
121
|
backend: `${DEFAULT_MONOREPO_PATHS.backend}/**/*`,
|
|
119
122
|
frontend: `${DEFAULT_MONOREPO_PATHS.frontend}/**/*`,
|
|
120
|
-
database: `${DEFAULT_MONOREPO_PATHS.backend}/src/database/**/*`,
|
|
121
123
|
mobile: `${DEFAULT_MONOREPO_PATHS.mobile}/**/*`,
|
|
122
124
|
native: "apps/native/**/*",
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
manager: "*",
|
|
125
|
+
database: `${DEFAULT_MONOREPO_PATHS.backend}/src/database/**/*`,
|
|
126
|
+
devops: "{.github,docker,infra,scripts,*.yml,*.yaml,Dockerfile*}",
|
|
127
|
+
quality: "**/*",
|
|
128
|
+
analyst: "{docs,specs,contracts}/**/*",
|
|
129
|
+
explorer: "**/*",
|
|
130
|
+
git: "**/*",
|
|
130
131
|
};
|
|
131
132
|
// âââ MCP & environment ââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
132
133
|
export const MCP = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/shared/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iFAAiF;AAEjF,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,SAAS;IAC1B,iBAAiB,EAAE,YAAY;IAC/B,gBAAgB,EAAE,OAAO;IACzB,aAAa,EAAE,SAAS;IACxB,qBAAqB,EAAE,QAAQ;CACzB,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;CACH,CAAC;AAEX,iFAAiF;AAEjF,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,cAAc;IAC3B,YAAY,EAAE,QAAQ;CAChB,CAAC;AAEX,qEAAqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,SAAS,CAAC,QAAQ;IAClB,YAAY,CAAC,KAAK;IAClB,YAAY,CAAC,MAAM;IACnB,YAAY,CAAC,MAAM;IACnB,YAAY,CAAC,IAAI;IACjB,YAAY,CAAC,MAAM;IACnB,YAAY,CAAC,WAAW;CAClB,CAAC;AAEX,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,iBAAiB,EAAE,aAAa;CAC1B,CAAC;AAIX,iFAAiF;AAEjF,MAAM,CAAC,MAAM,k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,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAG,QAAkB;IAC1C,OAAO,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAG,QAAkB;IAChD,OAAO,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,GAAG,QAAkB;IAClE,OAAO,cAAc,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC1C,OAAO,QAAQ,CAAC,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAC3D,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC,QAAQ,CAAC;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -22,16 +22,11 @@ describe("Approve Command", () => {
|
|
|
22
22
|
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
23
23
|
vi.restoreAllMocks();
|
|
24
24
|
});
|
|
25
|
-
it("should exit with error if messages directory does not exist", () => {
|
|
25
|
+
it("should exit with error if messages directory does not exist", async () => {
|
|
26
26
|
const uiErrorSpy = vi.spyOn(UI, "error");
|
|
27
|
-
|
|
28
|
-
throw new Error(`process.exit: ${code}`);
|
|
29
|
-
});
|
|
30
|
-
expect(() => approveCommand("trace-123")).toThrow(ValidationError);
|
|
31
|
-
expect(uiErrorSpy).toHaveBeenCalledWith("No messages directory found.");
|
|
32
|
-
exitSpy.mockRestore();
|
|
27
|
+
await expect(approveCommand("trace-123")).rejects.toThrow(ValidationError);
|
|
33
28
|
});
|
|
34
|
-
it("should successfully approve pending ACTION/ALERT message", () => {
|
|
29
|
+
it("should successfully approve pending ACTION/ALERT message", async () => {
|
|
35
30
|
fs.mkdirSync(messagesDir, { recursive: true });
|
|
36
31
|
const message = {
|
|
37
32
|
timestamp: new Date().toISOString(),
|
|
@@ -45,7 +40,7 @@ describe("Approve Command", () => {
|
|
|
45
40
|
const msgFilePath = path.join(messagesDir, "msg.json");
|
|
46
41
|
fs.writeFileSync(msgFilePath, JSON.stringify(message) + "\n");
|
|
47
42
|
const uiSuccessSpy = vi.spyOn(UI, "success");
|
|
48
|
-
approveCommand("trace-123");
|
|
43
|
+
await approveCommand("trace-123");
|
|
49
44
|
const fileContent = fs.readFileSync(msgFilePath, "utf8");
|
|
50
45
|
const parsed = JSON.parse(fileContent.trim());
|
|
51
46
|
expect(parsed.status).toBe("APPROVED");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve.test.js","sourceRoot":"","sources":["../../tests/approve.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,IAAI,OAAe,CAAC;IACpB,IAAI,WAAmB,CAAC;IAExB,UAAU,CAAC,GAAG,EAAE;QACZ,OAAO,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
|
|
|
42
42
|
content: JSON.stringify(taskPayload),
|
|
43
43
|
traceId: traceId
|
|
44
44
|
});
|
|
45
|
-
// 2. Orchestrator processes the task
|
|
46
|
-
await orchestrateCommand();
|
|
45
|
+
// 2. Orchestrator processes the task (single iteration for test determinism)
|
|
46
|
+
await orchestrateCommand({ maxIterations: 1 });
|
|
47
47
|
// 3. Verify Backend status changed to EXECUTING
|
|
48
48
|
const status = memoryUtils.readStatus();
|
|
49
49
|
expect(status["@backend"].state).toBe("EXECUTING");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent_flow.test.js","sourceRoot":"","sources":["../../../tests/integration/agent_flow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAExF,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACpC,IAAI,OAAe,CAAC;IACpB,IAAI,SAAiB,CAAC;IACtB,IAAI,WAAmB,CAAC;IAExB,UAAU,CAAC,GAAG,EAAE;QACZ,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,2BAA2B,CAAC,CAAC,CAAC;QAC9E,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAE7C,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,iBAAiB,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EXECUTING", task: "Building dashboard", lastUpdated: pastTime }
|
|
55
55
|
});
|
|
56
|
-
// Run orchestration loop
|
|
57
|
-
|
|
58
|
-
// updating the implementation to check status.json.
|
|
59
|
-
// For now, let's fix the test logic to align with what the code *should* do.
|
|
60
|
-
await orchestrateCommand();
|
|
56
|
+
// Run a single orchestration iteration (avoids infinite loop in tests)
|
|
57
|
+
await orchestrateCommand({ maxIterations: 1 });
|
|
61
58
|
const statuses = memoryUtils.readStatus();
|
|
62
|
-
// Since we didn't update orchestrate.ts to read status.json,
|
|
63
|
-
// the code won't see it yet. I need to fix orchestrate.ts.
|
|
64
59
|
expect(statuses["@frontend"].state).toBe("BLOCKED");
|
|
65
60
|
});
|
|
66
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrate.test.js","sourceRoot":"","sources":["../../tests/orchestrate.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE1G,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACrD,IAAI,OAAe,CAAC;IACpB,IAAI,SAAiB,CAAC;IACtB,IAAI,WAAmB,CAAC;IAExB,UAAU,CAAC,GAAG,EAAE;QACZ,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,2BAA2B,CAAC,CAAC,CAAC;QAC9E,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE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path from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Agent Enderun â Single Source of Truth for framework constants.
|
|
4
|
+
* Import from here instead of hardcoding paths, phases, or directory names.
|
|
5
|
+
*/
|
|
6
|
+
// âââ Framework identity âââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
7
|
+
export const FRAMEWORK = {
|
|
8
|
+
NAME: "Agent Enderun",
|
|
9
|
+
CORE_DIR: ".enderun",
|
|
10
|
+
// This is the hub for unified adapter layouts (e.g. .agents/gemini, .agents/claude)
|
|
11
|
+
UNIFIED_HUB_DIR: ".agents",
|
|
12
|
+
// This is the default directory to scaffold new apps into
|
|
13
|
+
APPS_DIR: "apps",
|
|
14
|
+
// This is where all skills are stored
|
|
15
|
+
SKILLS_DIR: "skills",
|
|
16
|
+
};
|
|
17
|
+
export const FRAMEWORK_SUBDIRS = {
|
|
18
|
+
AGENTS: "agents",
|
|
19
|
+
SKILLS: "skills",
|
|
20
|
+
KNOWLEDGE: "knowledge",
|
|
21
|
+
MESSAGES: "messages",
|
|
22
|
+
MEMORY: "memory",
|
|
23
|
+
MEMORY_GRAPH: "memory-graph",
|
|
24
|
+
LOGS: "logs",
|
|
25
|
+
CONFIG: "config",
|
|
26
|
+
};
|
|
27
|
+
export const ROOT_CONFIG_FILES = {
|
|
28
|
+
MCP: "mcp.json",
|
|
29
|
+
NATIVE_MODULES: "native-modules.json",
|
|
30
|
+
TSCONFIG: "tsconfig.json",
|
|
31
|
+
ESLINT: "eslint.config.js",
|
|
32
|
+
};
|
|
33
|
+
export const MCP = {
|
|
34
|
+
// Environment variable used by MCP to identify project root
|
|
35
|
+
PROJECT_ROOT_ENV: "ENDERUN_PROJECT_ROOT",
|
|
36
|
+
// Environment variable for test mode
|
|
37
|
+
TEST_DIR_ENV: "ENDERUN_TEST_DIR",
|
|
38
|
+
};
|
|
39
|
+
export const MEMORY_FILES = {
|
|
40
|
+
STATE: "state.json",
|
|
41
|
+
SHARED_FACTS: "shared_facts.json",
|
|
42
|
+
};
|
|
43
|
+
export const NATIVE_AGENT_PATHS = {
|
|
44
|
+
gemini: ".gemini/agents",
|
|
45
|
+
claude: ".claude/agents",
|
|
46
|
+
cursor: ".cursor/rules",
|
|
47
|
+
codex: ".agents/instructions",
|
|
48
|
+
grok: ".grok",
|
|
49
|
+
"antigravity-cli": ".antigravity/agents",
|
|
50
|
+
};
|
|
51
|
+
// âââ Backward-compatible aliases ââââââââââââââââââââââââââââââââââââââââââ
|
|
52
|
+
export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
|
|
53
|
+
export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
|
|
54
|
+
export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
|
|
55
|
+
// âââ Path Helpers âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
56
|
+
function pathJoin(...args) {
|
|
57
|
+
return path.join(...args);
|
|
58
|
+
}
|
|
59
|
+
function corePath(subdir, filename) {
|
|
60
|
+
return pathJoin(FRAMEWORK.CORE_DIR, subdir, filename);
|
|
61
|
+
}
|
|
62
|
+
export function knowledgePath(filename) {
|
|
63
|
+
return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
|
|
64
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
import { TOOLS, toolHandlers } from "./tools/index.js";
|
|
8
|
+
// âââ Server Setup âââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
9
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
// Robustly find package.json by walking up from __dirname
|
|
11
|
+
function findPackageJson(startDir) {
|
|
12
|
+
let currentDir = startDir;
|
|
13
|
+
while (currentDir !== path.parse(currentDir).root) {
|
|
14
|
+
const pkgPath = path.join(currentDir, "package.json");
|
|
15
|
+
if (fs.existsSync(pkgPath))
|
|
16
|
+
return pkgPath;
|
|
17
|
+
currentDir = path.dirname(currentDir);
|
|
18
|
+
}
|
|
19
|
+
throw new Error("Could not find package.json for @agent-enderun/mcp");
|
|
20
|
+
}
|
|
21
|
+
const pkgPath = findPackageJson(__dirname);
|
|
22
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
23
|
+
const serverVersion = pkg.version;
|
|
24
|
+
const server = new Server({
|
|
25
|
+
name: "@agent-enderun/mcp",
|
|
26
|
+
version: serverVersion,
|
|
27
|
+
}, {
|
|
28
|
+
capabilities: {
|
|
29
|
+
tools: {},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
// Basic Schema Validator for Required Fields
|
|
33
|
+
function validateArgs(toolName, args) {
|
|
34
|
+
const definition = TOOLS.find(t => t.name === toolName);
|
|
35
|
+
if (!definition)
|
|
36
|
+
return `Unknown tool: ${toolName}`;
|
|
37
|
+
const required = definition.inputSchema.required || [];
|
|
38
|
+
for (const field of required) {
|
|
39
|
+
if (args[field] === undefined || args[field] === null || args[field] === "") {
|
|
40
|
+
return `Missing required argument: '${field}' for tool '${toolName}'`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
46
|
+
return { tools: TOOLS };
|
|
47
|
+
});
|
|
48
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
49
|
+
const req = request;
|
|
50
|
+
const { name, arguments: args } = req.params;
|
|
51
|
+
const projectRoot = process.env.ENDERUN_PROJECT_ROOT || process.cwd();
|
|
52
|
+
try {
|
|
53
|
+
const handler = toolHandlers[name];
|
|
54
|
+
if (!handler) {
|
|
55
|
+
return {
|
|
56
|
+
isError: true,
|
|
57
|
+
content: [{ type: "text", text: `â Unknown tool: ${name}` }],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// đĄī¸ Runtime Validation
|
|
61
|
+
const validationError = validateArgs(name, args || {});
|
|
62
|
+
if (validationError) {
|
|
63
|
+
return {
|
|
64
|
+
isError: true,
|
|
65
|
+
content: [{ type: "text", text: `â Validation Error: ${validationError}` }],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return await handler(projectRoot, args || {});
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
const message = error instanceof Error ? error.message : "Unknown error occurred";
|
|
72
|
+
return {
|
|
73
|
+
isError: true,
|
|
74
|
+
content: [{ type: "text", text: `â Execution failed: ${message}` }],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
// âââ Graceful Startup & Shutdown ââââââââââââââââââââââââââââââââââ
|
|
79
|
+
async function run() {
|
|
80
|
+
const transport = new StdioServerTransport();
|
|
81
|
+
// Prevent unhandled errors from crashing the MCP stream
|
|
82
|
+
process.on("uncaughtException", (error) => {
|
|
83
|
+
process.stderr.write(`[agent-enderun-mcp] Uncaught exception: ${error.message}
|
|
84
|
+
`);
|
|
85
|
+
});
|
|
86
|
+
process.on("unhandledRejection", (reason) => {
|
|
87
|
+
const message = reason instanceof Error ? reason.message : String(reason);
|
|
88
|
+
process.stderr.write(`[agent-enderun-mcp] Unhandled rejection: ${message}
|
|
89
|
+
`);
|
|
90
|
+
});
|
|
91
|
+
// Graceful shutdown on SIGINT/SIGTERM
|
|
92
|
+
const shutdown = async () => {
|
|
93
|
+
try {
|
|
94
|
+
await server.close();
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// Already closed or failed â safe to ignore
|
|
98
|
+
}
|
|
99
|
+
process.exit(0);
|
|
100
|
+
};
|
|
101
|
+
process.on("SIGINT", shutdown);
|
|
102
|
+
process.on("SIGTERM", shutdown);
|
|
103
|
+
await server.connect(transport);
|
|
104
|
+
}
|
|
105
|
+
run().catch((error) => {
|
|
106
|
+
process.stderr.write(`[agent-enderun-mcp] Fatal startup error: ${error.message}
|
|
107
|
+
`);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { resolveFrameworkDir } from "../../utils/security.js";
|
|
4
|
+
/**
|
|
5
|
+
* Handles acquiring a stateful lock on a resource.
|
|
6
|
+
*/
|
|
7
|
+
export async function handleAcquireLock(projectRoot, args) {
|
|
8
|
+
const { resource, agent, ttl = 60 } = args;
|
|
9
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
10
|
+
const lockDir = path.join(projectRoot, frameworkDir, "locks");
|
|
11
|
+
const lockPath = path.join(lockDir, `${resource}.lock`);
|
|
12
|
+
try {
|
|
13
|
+
if (!fs.existsSync(lockDir))
|
|
14
|
+
fs.mkdirSync(lockDir, { recursive: true });
|
|
15
|
+
if (fs.existsSync(lockPath)) {
|
|
16
|
+
const stat = fs.statSync(lockPath);
|
|
17
|
+
const now = new Date().getTime();
|
|
18
|
+
const age = (now - stat.mtimeMs) / 1000;
|
|
19
|
+
if (age < ttl) {
|
|
20
|
+
return {
|
|
21
|
+
isError: true,
|
|
22
|
+
content: [{ type: "text", text: `Resource '${resource}' is currently locked by another agent.` }]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Lock expired, safe to override
|
|
26
|
+
fs.unlinkSync(lockPath);
|
|
27
|
+
}
|
|
28
|
+
fs.writeFileSync(lockPath, JSON.stringify({ agent, timestamp: new Date().toISOString() }));
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: `â
Lock acquired for resource '${resource}' by ${agent}.` }]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return {
|
|
35
|
+
isError: true,
|
|
36
|
+
content: [{ type: "text", text: `Failed to acquire lock: ${String(e)}` }]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handles releasing a lock.
|
|
42
|
+
*/
|
|
43
|
+
export async function handleReleaseLock(projectRoot, args) {
|
|
44
|
+
const { resource, agent } = args;
|
|
45
|
+
const frameworkDir = resolveFrameworkDir(projectRoot);
|
|
46
|
+
const lockPath = path.join(projectRoot, frameworkDir, "locks", `${resource}.lock`);
|
|
47
|
+
try {
|
|
48
|
+
if (!fs.existsSync(lockPath)) {
|
|
49
|
+
return { content: [{ type: "text", text: `âšī¸ No lock found for resource '${resource}'.` }] };
|
|
50
|
+
}
|
|
51
|
+
const lockData = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
52
|
+
if (lockData.agent !== agent) {
|
|
53
|
+
return {
|
|
54
|
+
isError: true,
|
|
55
|
+
content: [{ type: "text", text: `â Denied: You do not own the lock for '${resource}'. Owned by ${lockData.agent}.` }]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
fs.unlinkSync(lockPath);
|
|
59
|
+
return { content: [{ type: "text", text: `â
Lock released for resource '${resource}' by ${agent}.` }] };
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
return { isError: true, content: [{ type: "text", text: `Failed to release lock: ${String(e)}` }] };
|
|
63
|
+
}
|
|
64
|
+
}
|