agent-enderun 1.11.2 → 1.11.4

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.
Files changed (126) hide show
  1. package/README.md +5 -5
  2. package/bin/validate-agent-army.js +0 -1
  3. package/dist/framework-mcp/src/index.js +11 -1
  4. package/dist/framework-mcp/src/index.js.map +1 -1
  5. package/dist/framework-mcp/src/tools/definitions.js +0 -10
  6. package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
  7. package/dist/framework-mcp/src/tools/index.js +0 -2
  8. package/dist/framework-mcp/src/tools/index.js.map +1 -1
  9. package/dist/framework-mcp/src/utils/compliance.d.ts +1 -1
  10. package/dist/framework-mcp/src/utils/compliance.js +68 -19
  11. package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
  12. package/dist/src/cli/adapters/scaffold.d.ts +1 -1
  13. package/dist/src/cli/adapters/scaffold.js +8 -8
  14. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  15. package/dist/src/cli/commands/check.js +25 -40
  16. package/dist/src/cli/commands/check.js.map +1 -1
  17. package/dist/src/cli/commands/contract.d.ts +3 -1
  18. package/dist/src/cli/commands/contract.js +8 -2
  19. package/dist/src/cli/commands/contract.js.map +1 -1
  20. package/dist/src/cli/commands/init/scaffold-ops.js +0 -2
  21. package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
  22. package/dist/src/cli/commands/init.js +4 -3
  23. package/dist/src/cli/commands/init.js.map +1 -1
  24. package/dist/src/cli/commands/orchestrate.js +10 -3
  25. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  26. package/dist/src/cli/commands/status.js.map +1 -1
  27. package/dist/src/cli/index.js +14 -19
  28. package/dist/src/cli/index.js.map +1 -1
  29. package/dist/src/cli/utils/compliance.d.ts +5 -1
  30. package/dist/src/cli/utils/compliance.js +90 -42
  31. package/dist/src/cli/utils/compliance.js.map +1 -1
  32. package/dist/src/cli/utils/ui.js +11 -11
  33. package/dist/src/cli/utils/ui.js.map +1 -1
  34. package/dist/src/modules/adapters/definitions.js +114 -113
  35. package/dist/src/modules/adapters/definitions.js.map +1 -1
  36. package/dist/src/modules/adapters/registry.d.ts +12 -0
  37. package/dist/src/modules/adapters/registry.js +19 -0
  38. package/dist/src/modules/adapters/registry.js.map +1 -0
  39. package/dist/src/modules/adapters/shared.js +5 -4
  40. package/dist/src/modules/adapters/shared.js.map +1 -1
  41. package/dist/src/modules/agents/definitions.d.ts +6 -6
  42. package/dist/src/modules/agents/definitions.js +49 -25
  43. package/dist/src/modules/agents/definitions.js.map +1 -1
  44. package/dist/src/modules/agents/registry/analyst.js +1 -1
  45. package/dist/src/modules/agents/registry/analyst.js.map +1 -1
  46. package/dist/src/modules/agents/registry/architect.js +1 -1
  47. package/dist/src/modules/agents/registry/architect.js.map +1 -1
  48. package/dist/src/modules/agents/registry/backend.js +1 -1
  49. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  50. package/dist/src/modules/agents/registry/database.js +1 -1
  51. package/dist/src/modules/agents/registry/database.js.map +1 -1
  52. package/dist/src/modules/agents/registry/devops.js +1 -1
  53. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  54. package/dist/src/modules/agents/registry/explorer.js +1 -1
  55. package/dist/src/modules/agents/registry/explorer.js.map +1 -1
  56. package/dist/src/modules/agents/registry/frontend.js +1 -1
  57. package/dist/src/modules/agents/registry/frontend.js.map +1 -1
  58. package/dist/src/modules/agents/registry/git.js +1 -1
  59. package/dist/src/modules/agents/registry/git.js.map +1 -1
  60. package/dist/src/modules/agents/registry/manager.js +1 -2
  61. package/dist/src/modules/agents/registry/manager.js.map +1 -1
  62. package/dist/src/modules/agents/registry/mobile.js +1 -1
  63. package/dist/src/modules/agents/registry/mobile.js.map +1 -1
  64. package/dist/src/modules/agents/registry/quality.js +1 -1
  65. package/dist/src/modules/agents/registry/quality.js.map +1 -1
  66. package/dist/src/modules/agents/registry/security.js +1 -1
  67. package/dist/src/modules/agents/registry/security.js.map +1 -1
  68. package/dist/src/shared/fs.js +4 -3
  69. package/dist/src/shared/fs.js.map +1 -1
  70. package/dist/tests/agents-definitions.test.js +2 -1
  71. package/dist/tests/agents-definitions.test.js.map +1 -1
  72. package/dist/tests/integration/hermes_locking.test.d.ts +1 -0
  73. package/dist/tests/integration/hermes_locking.test.js +62 -0
  74. package/dist/tests/integration/hermes_locking.test.js.map +1 -0
  75. package/dist/tests/orchestrate.test.js +9 -6
  76. package/dist/tests/orchestrate.test.js.map +1 -1
  77. package/framework-mcp/dist/index.js +11 -1
  78. package/framework-mcp/dist/tools/definitions.js +0 -10
  79. package/framework-mcp/dist/tools/index.js +0 -2
  80. package/framework-mcp/dist/utils/compliance.js +68 -19
  81. package/framework-mcp/node_modules/.package-lock.json +1179 -0
  82. package/framework-mcp/package-lock.json +1191 -0
  83. package/framework-mcp/package.json +2 -2
  84. package/framework-mcp/src/index.ts +13 -1
  85. package/framework-mcp/src/tools/definitions.ts +0 -10
  86. package/framework-mcp/src/tools/index.ts +0 -2
  87. package/framework-mcp/src/utils/compliance.ts +82 -24
  88. package/package.json +3 -4
  89. package/src/cli/adapters/scaffold.ts +9 -8
  90. package/src/cli/commands/check.ts +26 -48
  91. package/src/cli/commands/contract.ts +5 -2
  92. package/src/cli/commands/init/scaffold-ops.ts +0 -3
  93. package/src/cli/commands/init.ts +5 -3
  94. package/src/cli/commands/orchestrate.ts +12 -3
  95. package/src/cli/commands/status.ts +3 -2
  96. package/src/cli/index.ts +14 -20
  97. package/src/cli/utils/compliance.ts +101 -47
  98. package/src/cli/utils/ui.ts +11 -11
  99. package/src/modules/adapters/definitions.ts +82 -57
  100. package/src/modules/adapters/registry.ts +27 -0
  101. package/src/modules/adapters/shared.ts +5 -4
  102. package/src/modules/agents/definitions.ts +53 -24
  103. package/src/modules/agents/registry/analyst.ts +1 -1
  104. package/src/modules/agents/registry/architect.ts +1 -1
  105. package/src/modules/agents/registry/backend.ts +1 -1
  106. package/src/modules/agents/registry/database.ts +1 -1
  107. package/src/modules/agents/registry/devops.ts +1 -1
  108. package/src/modules/agents/registry/explorer.ts +1 -1
  109. package/src/modules/agents/registry/frontend.ts +1 -1
  110. package/src/modules/agents/registry/git.ts +1 -1
  111. package/src/modules/agents/registry/manager.ts +1 -2
  112. package/src/modules/agents/registry/mobile.ts +1 -1
  113. package/src/modules/agents/registry/quality.ts +1 -1
  114. package/src/modules/agents/registry/security.ts +1 -1
  115. package/src/shared/fs.ts +4 -3
  116. package/templates/standards/frontend-standards.md +7 -2
  117. package/templates/standards/governance-standards.md +27 -1
  118. package/templates/standards/logging-and-secrets.md +1 -1
  119. package/templates/standards/observability-standards.md +1 -1
  120. package/templates/standards/quality-standards.md +2 -1
  121. package/bin/enderun-dashboard.js +0 -25
  122. package/framework-mcp/src/tools/dashboard/start_dashboard.ts +0 -33
  123. package/src/cli/commands/dashboard/data-service.ts +0 -167
  124. package/src/cli/commands/dashboard/html-template.ts +0 -696
  125. package/src/cli/commands/dashboard/server.ts +0 -43
  126. package/src/cli/commands/dashboard.ts +0 -11
@@ -1,29 +1,78 @@
1
+ import ts from "typescript";
1
2
  /**
2
3
  * Enterprise Compliance Guardrail
3
- * Checks content against corporate standards before allowing file mutations.
4
+ * Checks content against corporate standards using AST analysis before allowing file mutations.
4
5
  */
5
6
  export function verifyCorporateCompliance(content, filePath) {
6
- // 1. Zero Console Policy
7
- if (content.includes("console.log(") || content.includes("console.warn(") || content.includes("console.error(")) {
8
- if (!filePath.includes("logger.ts") && !filePath.includes("check.ts") && !filePath.includes("cli.ts")) {
9
- throw new Error("❌ Corporate Compliance Breach: 'console.log/warn/error' usage is forbidden. " +
10
- "Use the 'logger' system from '@/shared/logger' instead.");
11
- }
7
+ // Skip compliance checks for non-source files or specific ignored files
8
+ if (filePath.endsWith(".json") || filePath.endsWith(".md") || filePath.endsWith(".env.example")) {
9
+ return;
12
10
  }
13
- // 2. No Explicit Any Policy
14
- const anyRegex = /[:<]\s*any\b|\bas\s+any\b/g;
15
- if (anyRegex.test(content)) {
16
- if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
17
- throw new Error("❌ Corporate Compliance Breach: 'any' type is forbidden. " +
18
- "Use 'unknown', 'generics', or proper interfaces for type safety.");
11
+ const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
12
+ const errors = [];
13
+ /**
14
+ * Recursive AST Visitor
15
+ */
16
+ function visit(node) {
17
+ // 1. Zero Console Policy
18
+ if (ts.isPropertyAccessExpression(node)) {
19
+ const expression = node.expression;
20
+ const name = node.name.text;
21
+ if (ts.isIdentifier(expression) && expression.text === "console") {
22
+ if (["log", "warn", "error"].includes(name)) {
23
+ // Check if file is exempt
24
+ if (!filePath.includes("logger.ts") && !filePath.includes("check.ts") && !filePath.includes("cli.ts")) {
25
+ errors.push(`❌ Corporate Compliance Breach: 'console.${name}' usage is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
26
+ }
27
+ }
28
+ }
29
+ }
30
+ // 2. No Explicit Any Policy
31
+ if (ts.isTypeReferenceNode(node)) {
32
+ if (ts.isIdentifier(node.typeName) && node.typeName.text === "any") {
33
+ if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
34
+ errors.push(`❌ Corporate Compliance Breach: 'any' type is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
35
+ }
36
+ }
37
+ }
38
+ // 3. Zero UI Library Policy (No @chakra-ui, mui, @shadcn)
39
+ if (ts.isImportDeclaration(node)) {
40
+ const moduleSpecifier = node.moduleSpecifier;
41
+ if (ts.isStringLiteral(moduleSpecifier)) {
42
+ const forbiddenLibs = ["@chakra-ui", "mui", "@shadcn", "antd", "bootstrap"];
43
+ const lib = forbiddenLibs.find(l => moduleSpecifier.text.includes(l));
44
+ if (lib) {
45
+ errors.push(`❌ Corporate Compliance Breach: External UI library '${lib}' usage is FORBIDDEN at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}. Build atomic components manually instead.`);
46
+ }
47
+ }
19
48
  }
49
+ // Handle 'any' as a keyword type (e.g., parameter: any)
50
+ if (node.kind === ts.SyntaxKind.AnyKeyword) {
51
+ if (!filePath.includes("definitions.ts") && !filePath.includes("types.ts")) {
52
+ errors.push(`❌ Corporate Compliance Breach: 'any' keyword is forbidden at line ${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}.`);
53
+ }
54
+ }
55
+ ts.forEachChild(node, visit);
20
56
  }
21
- // 3. Hardcoded Secrets Guard (Simple heuristic)
22
- const secretKeywords = [/API_KEY\s*=\s*['"][^'"]+['"]/i, /SECRET\s*=\s*['"][^'"]+['"]/i, /PASSWORD\s*=\s*['"][^'"]+['"]/i];
23
- for (const regex of secretKeywords) {
24
- if (regex.test(content) && !filePath.endsWith(".env.example")) {
25
- throw new Error(" Corporate Compliance Breach: Hardcoded secrets detected. " +
26
- "All sensitive data must be managed via '.env' files.");
57
+ visit(sourceFile);
58
+ // 3. Hardcoded Secrets & PII Guard
59
+ const piiKeywords = [
60
+ { regex: /API_KEY\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded API Key" },
61
+ { regex: /SECRET\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded Secret" },
62
+ { regex: /PASSWORD\s*=\s*['"][^'"]+['"]/i, msg: "Hardcoded Password" },
63
+ { regex: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/, msg: "PII Detected: Email Address" },
64
+ { regex: /\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/, msg: "PII Detected: Credit Card Pattern" }
65
+ ];
66
+ for (const { regex, msg } of piiKeywords) {
67
+ if (regex.test(content)) {
68
+ // Allow emails in specific files like README or package.json
69
+ if (msg.includes("Email") && (filePath.endsWith("README.md") || filePath.endsWith("package.json") || filePath.includes("CONTRIBUTING"))) {
70
+ continue;
71
+ }
72
+ errors.push(`❌ Corporate Compliance Breach: ${msg} detected.`);
27
73
  }
28
74
  }
75
+ if (errors.length > 0) {
76
+ throw new Error(errors.join("\n"));
77
+ }
29
78
  }