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.
- package/README.md +5 -5
- package/bin/validate-agent-army.js +0 -1
- package/dist/framework-mcp/src/index.js +11 -1
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +0 -10
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.js +0 -2
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/utils/compliance.d.ts +1 -1
- package/dist/framework-mcp/src/utils/compliance.js +68 -19
- package/dist/framework-mcp/src/utils/compliance.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.d.ts +1 -1
- package/dist/src/cli/adapters/scaffold.js +8 -8
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +25 -40
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/contract.d.ts +3 -1
- package/dist/src/cli/commands/contract.js +8 -2
- package/dist/src/cli/commands/contract.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-ops.js +0 -2
- package/dist/src/cli/commands/init/scaffold-ops.js.map +1 -1
- package/dist/src/cli/commands/init.js +4 -3
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.js +10 -3
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/index.js +14 -19
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/utils/compliance.d.ts +5 -1
- package/dist/src/cli/utils/compliance.js +90 -42
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/ui.js +11 -11
- package/dist/src/cli/utils/ui.js.map +1 -1
- package/dist/src/modules/adapters/definitions.js +114 -113
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/registry.d.ts +12 -0
- package/dist/src/modules/adapters/registry.js +19 -0
- package/dist/src/modules/adapters/registry.js.map +1 -0
- package/dist/src/modules/adapters/shared.js +5 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +6 -6
- package/dist/src/modules/agents/definitions.js +49 -25
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +1 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/architect.js +1 -1
- package/dist/src/modules/agents/registry/architect.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +1 -1
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +1 -1
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +1 -1
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/explorer.js +1 -1
- package/dist/src/modules/agents/registry/explorer.js.map +1 -1
- package/dist/src/modules/agents/registry/frontend.js +1 -1
- package/dist/src/modules/agents/registry/frontend.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js +1 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +1 -2
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/mobile.js +1 -1
- package/dist/src/modules/agents/registry/mobile.js.map +1 -1
- package/dist/src/modules/agents/registry/quality.js +1 -1
- package/dist/src/modules/agents/registry/quality.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +1 -1
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/shared/fs.js +4 -3
- package/dist/src/shared/fs.js.map +1 -1
- package/dist/tests/agents-definitions.test.js +2 -1
- package/dist/tests/agents-definitions.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.d.ts +1 -0
- package/dist/tests/integration/hermes_locking.test.js +62 -0
- package/dist/tests/integration/hermes_locking.test.js.map +1 -0
- package/dist/tests/orchestrate.test.js +9 -6
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/framework-mcp/dist/index.js +11 -1
- package/framework-mcp/dist/tools/definitions.js +0 -10
- package/framework-mcp/dist/tools/index.js +0 -2
- package/framework-mcp/dist/utils/compliance.js +68 -19
- package/framework-mcp/node_modules/.package-lock.json +1179 -0
- package/framework-mcp/package-lock.json +1191 -0
- package/framework-mcp/package.json +2 -2
- package/framework-mcp/src/index.ts +13 -1
- package/framework-mcp/src/tools/definitions.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -2
- package/framework-mcp/src/utils/compliance.ts +82 -24
- package/package.json +3 -4
- package/src/cli/adapters/scaffold.ts +9 -8
- package/src/cli/commands/check.ts +26 -48
- package/src/cli/commands/contract.ts +5 -2
- package/src/cli/commands/init/scaffold-ops.ts +0 -3
- package/src/cli/commands/init.ts +5 -3
- package/src/cli/commands/orchestrate.ts +12 -3
- package/src/cli/commands/status.ts +3 -2
- package/src/cli/index.ts +14 -20
- package/src/cli/utils/compliance.ts +101 -47
- package/src/cli/utils/ui.ts +11 -11
- package/src/modules/adapters/definitions.ts +82 -57
- package/src/modules/adapters/registry.ts +27 -0
- package/src/modules/adapters/shared.ts +5 -4
- package/src/modules/agents/definitions.ts +53 -24
- package/src/modules/agents/registry/analyst.ts +1 -1
- package/src/modules/agents/registry/architect.ts +1 -1
- package/src/modules/agents/registry/backend.ts +1 -1
- package/src/modules/agents/registry/database.ts +1 -1
- package/src/modules/agents/registry/devops.ts +1 -1
- package/src/modules/agents/registry/explorer.ts +1 -1
- package/src/modules/agents/registry/frontend.ts +1 -1
- package/src/modules/agents/registry/git.ts +1 -1
- package/src/modules/agents/registry/manager.ts +1 -2
- package/src/modules/agents/registry/mobile.ts +1 -1
- package/src/modules/agents/registry/quality.ts +1 -1
- package/src/modules/agents/registry/security.ts +1 -1
- package/src/shared/fs.ts +4 -3
- package/templates/standards/frontend-standards.md +7 -2
- package/templates/standards/governance-standards.md +27 -1
- package/templates/standards/logging-and-secrets.md +1 -1
- package/templates/standards/observability-standards.md +1 -1
- package/templates/standards/quality-standards.md +2 -1
- package/bin/enderun-dashboard.js +0 -25
- package/framework-mcp/src/tools/dashboard/start_dashboard.ts +0 -33
- package/src/cli/commands/dashboard/data-service.ts +0 -167
- package/src/cli/commands/dashboard/html-template.ts +0 -696
- package/src/cli/commands/dashboard/server.ts +0 -43
- 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
|
-
//
|
|
7
|
-
if (
|
|
8
|
-
|
|
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
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
}
|