agent-enderun 1.11.3 → 1.11.5
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 +84 -277
- 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/control_plane/locking.js +17 -3
- package/dist/framework-mcp/src/tools/control_plane/locking.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/tools/memory/get_insights.js +4 -4
- package/dist/framework-mcp/src/tools/memory/get_insights.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js +10 -5
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.js +2 -3
- package/dist/framework-mcp/src/tools/search/grep_search.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/framework-mcp/tests/tools/messaging/send_message.test.js +7 -7
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.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-core.d.ts +1 -0
- package/dist/src/cli/commands/init/scaffold-core.js +14 -1
- package/dist/src/cli/commands/init/scaffold-core.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.d.ts +1 -0
- package/dist/src/cli/commands/init.js +16 -7
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.js +31 -3
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.js +1 -2
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/index.js +18 -21
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/shims.js +39 -26
- package/dist/src/cli/shims.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 +130 -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/adapters/types.d.ts +1 -1
- package/dist/src/modules/adapters/types.js +1 -1
- package/dist/src/modules/adapters/types.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +6 -6
- package/dist/src/modules/agents/definitions.js +35 -18
- 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/constants.d.ts +5 -2
- package/dist/src/shared/constants.js +5 -0
- package/dist/src/shared/constants.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/approve.test.js +3 -1
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/integration/agent_flow.test.js +2 -0
- package/dist/tests/integration/agent_flow.test.js.map +1 -1
- package/dist/tests/integration/hermes_locking.test.d.ts +1 -0
- package/dist/tests/integration/hermes_locking.test.js +64 -0
- package/dist/tests/integration/hermes_locking.test.js.map +1 -0
- package/dist/tests/memory-utils.test.js +2 -0
- package/dist/tests/memory-utils.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +11 -6
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/dist/tests/status.test.js +2 -0
- package/dist/tests/status.test.js.map +1 -1
- package/framework-mcp/dist/index.js +11 -1
- package/framework-mcp/dist/tools/control_plane/locking.js +17 -3
- package/framework-mcp/dist/tools/definitions.js +0 -10
- package/framework-mcp/dist/tools/index.js +0 -2
- package/framework-mcp/dist/tools/memory/get_insights.js +4 -4
- package/framework-mcp/dist/tools/messaging/send_message.js +10 -5
- package/framework-mcp/dist/tools/search/grep_search.js +2 -3
- 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/control_plane/locking.ts +18 -4
- package/framework-mcp/src/tools/definitions.ts +0 -10
- package/framework-mcp/src/tools/index.ts +0 -2
- package/framework-mcp/src/tools/memory/get_insights.ts +4 -4
- package/framework-mcp/src/tools/messaging/send_message.ts +11 -5
- package/framework-mcp/src/tools/search/grep_search.ts +2 -3
- package/framework-mcp/src/utils/compliance.ts +83 -25
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +7 -7
- package/package.json +5 -5
- 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-core.ts +18 -2
- package/src/cli/commands/init/scaffold-ops.ts +0 -3
- package/src/cli/commands/init.ts +19 -8
- package/src/cli/commands/orchestrate.ts +36 -3
- package/src/cli/commands/plan.ts +1 -2
- package/src/cli/commands/status.ts +0 -1
- package/src/cli/index.ts +18 -22
- package/src/cli/shims.ts +39 -26
- package/src/cli/utils/compliance.ts +101 -47
- package/src/cli/utils/ui.ts +11 -11
- package/src/modules/adapters/definitions.ts +102 -57
- package/src/modules/adapters/registry.ts +27 -0
- package/src/modules/adapters/shared.ts +5 -4
- package/src/modules/adapters/types.ts +1 -1
- package/src/modules/agents/definitions.ts +35 -17
- 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/constants.ts +5 -0
- 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/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
package/dist/src/cli/shims.js
CHANGED
|
@@ -1,54 +1,67 @@
|
|
|
1
1
|
export const SHIM_TEMPLATES = {
|
|
2
|
-
gemini: `# 🎖️ Agent Enderun — GEMINI Strategy
|
|
2
|
+
gemini: `# 🎖️ Agent Enderun — GEMINI Strategy (Command Intelligence)
|
|
3
3
|
|
|
4
|
-
You are the **Gemini Commander**
|
|
4
|
+
You are the **Gemini Commander**. You represent the project's **Strategic Decision Center**. Your intelligence is derived from project history, architectural memory, and governance compliance.
|
|
5
5
|
|
|
6
6
|
## 🏛️ Directives
|
|
7
|
-
- **Constitutional Supremacy:** Read \`{{FRAMEWORK_DIR}}/ENDERUN.md\` first.
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
7
|
+
- **Constitutional Supremacy:** Read \`{{FRAMEWORK_DIR}}/ENDERUN.md\` first. You are the final arbiter of these rules.
|
|
8
|
+
- **Strategic Memory Sync:** Always read \`{{FRAMEWORK_DIR}}/memory/PROJECT_MEMORY.md\` and \`PROJECT_MEMORY.md\` at the start.
|
|
9
|
+
- **Orchestration Audit:** Before delegating, verify that the task matches the current Phase and Trace ID context.
|
|
10
|
+
- **Enterprise Reasoning:** Focus on long-term maintainability, security, and scalability in every strategic decision.
|
|
10
11
|
`,
|
|
11
|
-
"antigravity-cli": `# 🎖️ Agent Enderun — ANTIGRAVITY
|
|
12
|
+
"antigravity-cli": `# 🎖️ Agent Enderun — ANTIGRAVITY Strategy (Internal Discipline)
|
|
12
13
|
|
|
13
|
-
You are the **Antigravity Specialist**
|
|
14
|
+
You are the **Antigravity Specialist**. You represent the **Military Academy** of the framework, preserving internal standards and coding discipline.
|
|
14
15
|
|
|
15
16
|
## 🏛️ Directives
|
|
16
17
|
- **Constitutional Supremacy:** Read \`{{FRAMEWORK_DIR}}/ENDERUN.md\` first.
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
18
|
+
- **Standard Enforcement:** You are responsible for ensuring that all code adheres to the 26+ corporate standards in \`{{FRAMEWORK_DIR}}/knowledge/\`.
|
|
19
|
+
- **Sandbox Discipline:** Maintain isolated and high-discipline development environments.
|
|
19
20
|
`,
|
|
20
|
-
claude: `# 🎖️ Agent Enderun — CLAUDE Strategy
|
|
21
|
+
claude: `# 🎖️ Agent Enderun — CLAUDE Strategy (Operational Surgery)
|
|
21
22
|
|
|
22
|
-
You are the **Claude Field Engineer** (Surgical
|
|
23
|
+
You are the **Claude Field Engineer**. You represent the **Operational Cerrahi (Surgical)** wing of the army. Your mission is precision execution with minimal footprint.
|
|
23
24
|
|
|
24
25
|
## 🏛️ Directives
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
26
|
+
- **Surgical Precision (MANDATORY):** NEVER rewrite an entire file. Use \`replace_text\` or \`patch_file\` tools exclusively.
|
|
27
|
+
- **Token Economy:** Minimize API usage by targetting only the exact lines of code needed.
|
|
28
|
+
- **Traceability:** Ensure every change is linked to an active Trace ID and logged traceable under \`{{FRAMEWORK_DIR}}/logs/\`.
|
|
29
|
+
- **Phase Discipline:** Do not attempt Phase 2 tasks if Phase 1 contracts are not sealed.
|
|
28
30
|
`,
|
|
29
|
-
grok: `# 🎖️ Agent Enderun — GROK Strategy
|
|
31
|
+
grok: `# 🎖️ Agent Enderun — GROK Strategy (Scouting Wing)
|
|
30
32
|
|
|
31
|
-
You are the **Grok Explorer** (
|
|
33
|
+
You are the **Grok Explorer**. You represent the **Otonom Keşif Kanadı (Autonomous Scouting Wing)**. Your mission is experimental discovery and boundary testing.
|
|
32
34
|
|
|
33
35
|
## 🏛️ Directives
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
+
- **Architecture Discovery:** Use \`get_project_map\` and \`get_project_gaps\` to map unexplored territory before any specialist acts.
|
|
37
|
+
- **Boundary Testing:** Identify architectural weaknesses or security gaps before they become critical.
|
|
38
|
+
- **Experimental Protocol:** Test futuristic agent behaviors and report findings to the **Commander**.
|
|
36
39
|
`,
|
|
37
|
-
cursor: `# 🎖️ Agent Enderun — CURSOR Strategy
|
|
40
|
+
cursor: `# 🎖️ Agent Enderun — CURSOR Strategy (Implementer)
|
|
38
41
|
|
|
39
|
-
You are the **Cursor Implementer** (
|
|
42
|
+
You are the **Cursor Implementer**. You are the **Kod İşçisi (Code Worker)** integrated directly into the IDE.
|
|
40
43
|
|
|
41
44
|
## 🏛️ Directives
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
45
|
+
- **IDE Synergy:** Leverage Cursor's native context and Enderun's governance to write high-quality, compliant code.
|
|
46
|
+
- **Atomic Implementation:** Focus on implementing the specific task delegated by the @manager.
|
|
44
47
|
`,
|
|
45
|
-
codex: `# 🎖️ Agent Enderun — COPILOT Strategy
|
|
48
|
+
codex: `# 🎖️ Agent Enderun — COPILOT Strategy (Assistant)
|
|
46
49
|
|
|
47
|
-
You are the **Copilot
|
|
50
|
+
You are the **Copilot Assistant**. You represent the **Yardımcı Geliştirici (Assistant Developer)**.
|
|
48
51
|
|
|
49
52
|
## 🏛️ Directives
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
53
|
+
- **Predictive Support:** Provide code completions and suggestions that strictly adhere to the project's \`{{FRAMEWORK_DIR}}/ENDERUN.md\` rules.
|
|
54
|
+
- **Rapid Prototyping:** Support the army by generating boilerplate that follows established enterprise patterns.
|
|
55
|
+
`,
|
|
56
|
+
local: `# 🎖️ Agent Enderun — LOCAL LLM Strategy (Private Intelligence)
|
|
57
|
+
|
|
58
|
+
You are the **Local Private Intelligence**. You represent the project's **Private & Secure Command Wing**. Your intelligence is derived entirely from local models (Ollama, vLLM, etc.) and project-specific knowledge.
|
|
59
|
+
|
|
60
|
+
## 🏛️ Directives
|
|
61
|
+
- **Constitutional Supremacy:** Read \`{{FRAMEWORK_DIR}}/ENDERUN.md\` first. You are the final arbiter of these rules.
|
|
62
|
+
- **Zero Cloud Policy:** Ensure all operations remain local and secure.
|
|
63
|
+
- **Trace ID Discipline:** Every local inference and code generation MUST follow the active Trace ID.
|
|
64
|
+
- **Technical Integrity:** Adhere strictly to the 100% type-safety and surgical edit rules of the Enderun Order.
|
|
52
65
|
`
|
|
53
66
|
};
|
|
54
67
|
//# sourceMappingURL=shims.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shims.js","sourceRoot":"","sources":["../../../src/cli/shims.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAA2B;IAClD,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"shims.js","sourceRoot":"","sources":["../../../src/cli/shims.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAA2B;IAClD,MAAM,EAAE;;;;;;;;;CASX;IACG,iBAAiB,EAAE;;;;;;;;CAQtB;IACG,MAAM,EAAE;;;;;;;;;CASX;IACG,IAAI,EAAE;;;;;;;;CAQT;IACG,MAAM,EAAE;;;;;;;CAOX;IACG,KAAK,EAAE;;;;;;;CAOV;IACG,KAAK,EAAE;;;;;;;;;CASV;CACA,CAAC"}
|
|
@@ -3,5 +3,9 @@ interface ComplianceIssue {
|
|
|
3
3
|
line: number;
|
|
4
4
|
rule: string;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Enterprise Compliance Scanner (AST-Based)
|
|
8
|
+
* Scans the project source code for governance and discipline violations.
|
|
9
|
+
*/
|
|
10
|
+
export declare function scanProjectCompliance(targetDir?: string): ComplianceIssue[];
|
|
7
11
|
export {};
|
|
@@ -1,65 +1,113 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
/**
|
|
5
|
+
* Enterprise Compliance Scanner (AST-Based)
|
|
6
|
+
* Scans the project source code for governance and discipline violations.
|
|
7
|
+
*/
|
|
8
|
+
export function scanProjectCompliance(targetDir = "src") {
|
|
4
9
|
const issues = [];
|
|
5
|
-
if (!fs.existsSync(
|
|
10
|
+
if (!fs.existsSync(targetDir))
|
|
6
11
|
return [];
|
|
7
|
-
const files = getAllFiles(
|
|
12
|
+
const files = getAllFiles(targetDir);
|
|
8
13
|
for (const file of files) {
|
|
9
|
-
// Absolute skip for
|
|
14
|
+
// Absolute skip for critical framework and utility files to avoid self-flagging
|
|
10
15
|
if (file.includes("compliance") ||
|
|
11
16
|
file.includes("definitions") ||
|
|
12
|
-
file.includes("agents/registry") ||
|
|
13
|
-
file.includes("scaffold-ops.ts") ||
|
|
17
|
+
file.includes("agents/registry") ||
|
|
18
|
+
file.includes("scaffold-ops.ts") ||
|
|
14
19
|
file.includes("logger") ||
|
|
15
20
|
file.includes("errors") ||
|
|
16
21
|
file.includes("shared/fs"))
|
|
17
22
|
continue;
|
|
18
23
|
const content = fs.readFileSync(file, "utf8");
|
|
24
|
+
// --- 1. AST-Based Analysis (For Language Rules) ---
|
|
25
|
+
const sourceFile = ts.createSourceFile(file, content, ts.ScriptTarget.Latest, true);
|
|
26
|
+
const visit = (node) => {
|
|
27
|
+
// Rule: No console.log allowed (excluding UI and warn/error helpers)
|
|
28
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
29
|
+
const expression = node.expression;
|
|
30
|
+
const name = node.name.text;
|
|
31
|
+
if (ts.isIdentifier(expression) && expression.text === "console" && name === "log") {
|
|
32
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
33
|
+
issues.push({ file, line: line + 1, rule: "No console.log allowed (Use logger instead)" });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Rule: No 'any' type usage
|
|
37
|
+
if (ts.isTypeReferenceNode(node)) {
|
|
38
|
+
if (ts.isIdentifier(node.typeName) && node.typeName.text === "any") {
|
|
39
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
40
|
+
issues.push({ file, line: line + 1, rule: "Usage of 'any' type is forbidden" });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (node.kind === ts.SyntaxKind.AnyKeyword) {
|
|
44
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
45
|
+
issues.push({ file, line: line + 1, rule: "Usage of 'any' keyword is forbidden" });
|
|
46
|
+
}
|
|
47
|
+
// Rule: Zero UI Library Policy
|
|
48
|
+
if (ts.isImportDeclaration(node)) {
|
|
49
|
+
const moduleSpecifier = node.moduleSpecifier;
|
|
50
|
+
if (ts.isStringLiteral(moduleSpecifier)) {
|
|
51
|
+
const forbiddenLibs = ["@chakra-ui", "mui", "@shadcn", "antd", "bootstrap"];
|
|
52
|
+
const lib = forbiddenLibs.find(l => moduleSpecifier.text.includes(l));
|
|
53
|
+
if (lib) {
|
|
54
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
55
|
+
issues.push({ file, line: line + 1, rule: `Forbidden UI library '${lib}' usage detected` });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Rule: Raw fs mutation check (Use atomic utilities)
|
|
60
|
+
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)) {
|
|
61
|
+
const prop = node.expression;
|
|
62
|
+
if (ts.isIdentifier(prop.expression) && prop.expression.text === "fs") {
|
|
63
|
+
if (["writeFileSync", "appendFileSync"].includes(prop.name.text)) {
|
|
64
|
+
// Skip if it's explicitly allowed (e.g. lock files)
|
|
65
|
+
const args = node.arguments;
|
|
66
|
+
let isLockFile = false;
|
|
67
|
+
if (args.length > 0) {
|
|
68
|
+
const firstArgText = args[0].getText(sourceFile).toLowerCase();
|
|
69
|
+
if (firstArgText.includes("lock")) {
|
|
70
|
+
isLockFile = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!isLockFile) {
|
|
74
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
75
|
+
issues.push({ file, line: line + 1, rule: "Use atomic utilities (writeTextFile) instead of raw fs mutations" });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
ts.forEachChild(node, visit);
|
|
81
|
+
};
|
|
82
|
+
visit(sourceFile);
|
|
83
|
+
// --- 2. Pattern-Based Analysis (For Secrets & PII & Debt) ---
|
|
19
84
|
const lines = content.split("\n");
|
|
85
|
+
const piiKeywords = [
|
|
86
|
+
{ regex: /API_KEY\s*[:=]\s*['"][^'"]+['"]/i, msg: "Hardcoded API Key" },
|
|
87
|
+
{ regex: /SECRET\s*[:=]\s*['"][^'"]+['"]/i, msg: "Hardcoded Secret" },
|
|
88
|
+
{ regex: /PASSWORD\s*[:=]\s*['"][^'"]+['"]/i, msg: "Hardcoded Password" },
|
|
89
|
+
{ regex: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/, msg: "PII Detected: Email Address" },
|
|
90
|
+
{ regex: /\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/, msg: "PII Detected: Credit Card Pattern" }
|
|
91
|
+
];
|
|
20
92
|
lines.forEach((line, index) => {
|
|
21
93
|
const lineNum = index + 1;
|
|
22
94
|
const trimmedLine = line.trim();
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// 1. Console.log check - only if it's actual code
|
|
35
|
-
if (line.includes("console.log") && !isUIMessage) {
|
|
36
|
-
issues.push({ file, line: lineNum, rule: "No console.log allowed" });
|
|
37
|
-
}
|
|
38
|
-
// 2. Secret check (Regex for simple API keys/assignments) - skip UI messages and templates
|
|
39
|
-
if (/(API_KEY|SECRET|PASSWORD)\s*[:=]/i.test(line) &&
|
|
40
|
-
!file.includes(".env") &&
|
|
41
|
-
!isUIMessage &&
|
|
42
|
-
!trimmedLine.includes(".env.example") && // Skip template lines
|
|
43
|
-
!trimmedLine.includes("your_secret_key_here") && // Skip common placeholders
|
|
44
|
-
!trimmedLine.includes("pattern:")) {
|
|
45
|
-
issues.push({ file, line: lineNum, rule: "Potential hardcoded secret assignment detected" });
|
|
95
|
+
if (trimmedLine.startsWith("//") || trimmedLine.startsWith("*"))
|
|
96
|
+
return;
|
|
97
|
+
// PII & Secret Guard
|
|
98
|
+
for (const { regex, msg } of piiKeywords) {
|
|
99
|
+
if (regex.test(line)) {
|
|
100
|
+
// Allow emails in specific files
|
|
101
|
+
if (msg.includes("Email") && (file.endsWith("README.md") || file.endsWith("package.json") || file.includes("CONTRIBUTING"))) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
issues.push({ file, line: lineNum, rule: `Corporate Compliance Breach: ${msg}` });
|
|
105
|
+
}
|
|
46
106
|
}
|
|
47
|
-
//
|
|
48
|
-
if (/\bany\b/.test(line) && !isTypeDefinition && !trimmedLine.includes("\":")) {
|
|
49
|
-
issues.push({ file, line: lineNum, rule: "Usage of 'any' type is forbidden" });
|
|
50
|
-
}
|
|
51
|
-
// 4. Technical Debt Detection (TODO/FIXME)
|
|
107
|
+
// Technical Debt (TODO/FIXME)
|
|
52
108
|
if (/\b(TODO|FIXME)\b/i.test(line)) {
|
|
53
109
|
issues.push({ file, line: lineNum, rule: "Unresolved Technical Debt (TODO/FIXME) found" });
|
|
54
110
|
}
|
|
55
|
-
// 5. Raw fs write check (Atomic safety enforcement)
|
|
56
|
-
if ((line.includes("fs.writeFileSync") || line.includes("fs.appendFileSync")) &&
|
|
57
|
-
!file.includes("src/shared/fs.ts") && // Ignore the utility itself
|
|
58
|
-
!line.includes(".lock") && // Allow lock files
|
|
59
|
-
!line.includes("lockPath") && // Allow lock path variables
|
|
60
|
-
!file.includes("bin/")) { // Ignore standalone binary scripts
|
|
61
|
-
issues.push({ file, line: lineNum, rule: "Use internal atomic utilities (writeTextFile) instead of raw fs" });
|
|
62
|
-
}
|
|
63
111
|
});
|
|
64
112
|
}
|
|
65
113
|
return issues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance.js","sourceRoot":"","sources":["../../../../src/cli/utils/compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"compliance.js","sourceRoot":"","sources":["../../../../src/cli/utils/compliance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,YAAY,CAAC;AAQ5B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB,KAAK;IAC3D,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAC;IAEzC,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,gFAAgF;QAChF,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC3B,IAAI,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S;oBACb,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gCAAgC,GAAG,EAAE,EAAE,CAAC,CAAC;gBACtF,CAAC;YACL,CAAC;YAED,8BAA8B;YAC9B,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,8CAA8C,EAAE,CAAC,CAAC;YAC/F,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAS,WAAW,CAAC,OAAe,EAAE,eAAyB,EAAE;IAC7D,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAEtC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1C,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACtC,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACvD,CAAC;aAAM,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACxB,CAAC"}
|
package/dist/src/cli/utils/ui.js
CHANGED
|
@@ -8,8 +8,8 @@ export const UI = {
|
|
|
8
8
|
* Renders a strategic intent block similar to Gemini CLI's topic updates.
|
|
9
9
|
*/
|
|
10
10
|
intent: (title, intent) => {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
process.stdout.write(`\n${chalk.bold.cyan(title)}:\n`);
|
|
12
|
+
process.stdout.write(`${chalk.italic.gray(` ${intent}`)}\n\n`);
|
|
13
13
|
},
|
|
14
14
|
/**
|
|
15
15
|
* Renders a professional agent execution box.
|
|
@@ -17,43 +17,43 @@ export const UI = {
|
|
|
17
17
|
agentBox: (agentName, action, details) => {
|
|
18
18
|
const width = process.stdout.columns || 80;
|
|
19
19
|
const line = "─".repeat(Math.max(0, width - 2));
|
|
20
|
-
|
|
20
|
+
process.stdout.write(chalk.gray(`╭${line}╮`) + "\n");
|
|
21
21
|
const padding = Math.max(0, width - agentName.length - 27);
|
|
22
|
-
|
|
22
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.bold.yellow("≡")} ${chalk.white(`Running Agent: ${chalk.bold.green(agentName)}...`)} ${chalk.gray("(ctrl+o to expand)".padStart(padding))} ${chalk.gray("│")}\n`);
|
|
23
23
|
if (action) {
|
|
24
24
|
const paddingAction = Math.max(0, width - action.length - 6);
|
|
25
|
-
|
|
25
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.blue("!")} ${chalk.cyan(action)} ${" ".repeat(paddingAction)} ${chalk.gray("│")}\n`);
|
|
26
26
|
}
|
|
27
27
|
if (details) {
|
|
28
28
|
const paddingDetails = Math.max(0, width - details.length - 7);
|
|
29
|
-
|
|
29
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.gray(details.slice(0, width - 10))} ${" ".repeat(paddingDetails)} ${chalk.gray("│")}\n`);
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
process.stdout.write(chalk.gray(`╰${line}╯`) + "\n");
|
|
32
32
|
},
|
|
33
33
|
/**
|
|
34
34
|
* Renders a success status message.
|
|
35
35
|
*/
|
|
36
36
|
success: (msg) => {
|
|
37
|
-
|
|
37
|
+
process.stdout.write(`${chalk.bold.green("✅")} ${msg}\n`);
|
|
38
38
|
},
|
|
39
39
|
/**
|
|
40
40
|
* Renders an error status message.
|
|
41
41
|
*/
|
|
42
42
|
error: (msg) => {
|
|
43
|
-
|
|
43
|
+
process.stderr.write(`${chalk.bold.red("❌")} ${chalk.red(msg)}\n`);
|
|
44
44
|
},
|
|
45
45
|
/**
|
|
46
46
|
* Renders a warning status message.
|
|
47
47
|
*/
|
|
48
48
|
warning: (msg) => {
|
|
49
|
-
|
|
49
|
+
process.stdout.write(`${chalk.bold.yellow("⚠️")} ${chalk.yellow(msg)}\n`);
|
|
50
50
|
},
|
|
51
51
|
/**
|
|
52
52
|
* Renders an info/divider line.
|
|
53
53
|
*/
|
|
54
54
|
divider: () => {
|
|
55
55
|
const width = process.stdout.columns || 80;
|
|
56
|
-
|
|
56
|
+
process.stdout.write(chalk.gray("─".repeat(width)) + "\n");
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=ui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../../src/cli/utils/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AAEH,MAAM,CAAC,MAAM,EAAE,GAAG;IACd;;OAEG;IACH,MAAM,EAAE,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE;QACtC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../../src/cli/utils/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AAEH,MAAM,CAAC,MAAM,EAAE,GAAG;IACd;;OAEG;IACH,MAAM,EAAE,CAAC,KAAa,EAAE,MAAc,EAAE,EAAE;QACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC,MAAM,C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KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACH,OAAO,EAAE,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC/D,CAAC;CACJ,CAAC"}
|
|
@@ -2,123 +2,140 @@ import path from "path";
|
|
|
2
2
|
import { addMcpServerToClaude, findClaudeConfigPath } from "../../cli/utils/claude.js";
|
|
3
3
|
import { writeJsonFile } from "../../shared/fs.js";
|
|
4
4
|
import { registerGlobalAntigravityPlugins } from "./shared.js";
|
|
5
|
+
import { registry } from "./registry.js";
|
|
6
|
+
import { UI } from "../../cli/utils/ui.js";
|
|
7
|
+
// ─── Register Core Adapters ──────────────────────────────────────────────────
|
|
8
|
+
// ♊ Gemini
|
|
9
|
+
registry.register({
|
|
10
|
+
id: "gemini",
|
|
11
|
+
frameworkDir: ".gemini",
|
|
12
|
+
shimFile: "GEMINI.md",
|
|
13
|
+
shimTemplate: "src/cli/shims/gemini.md",
|
|
14
|
+
role: "commander",
|
|
15
|
+
templateDir: ".enderun",
|
|
16
|
+
nestedDirs: ["agents", "rules"],
|
|
17
|
+
agentsDir: ".gemini/agents",
|
|
18
|
+
agentsExt: ".md"
|
|
19
|
+
}, (projectRoot, mcpBlock) => {
|
|
20
|
+
const frameworkDir = ".gemini";
|
|
21
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
22
|
+
UI.success(`Gemini MCP registered → ${frameworkDir}/mcp.json`);
|
|
23
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
24
|
+
});
|
|
25
|
+
// 🚀 Claude
|
|
26
|
+
registry.register({
|
|
27
|
+
id: "claude",
|
|
28
|
+
frameworkDir: ".claude",
|
|
29
|
+
shimFile: "CLAUDE.md",
|
|
30
|
+
shimTemplate: "src/cli/shims/claude.md",
|
|
31
|
+
role: "architect",
|
|
32
|
+
templateDir: ".enderun",
|
|
33
|
+
nestedDirs: ["agents", "rules"],
|
|
34
|
+
agentsDir: ".claude/agents",
|
|
35
|
+
agentsExt: ".md"
|
|
36
|
+
}, (projectRoot, mcpBlock) => {
|
|
37
|
+
const configPath = findClaudeConfigPath();
|
|
38
|
+
if (configPath) {
|
|
39
|
+
const block = mcpBlock;
|
|
40
|
+
const mcpEntry = block.mcpServers["agent-enderun"];
|
|
41
|
+
const ok = addMcpServerToClaude(configPath, "agent-enderun", mcpEntry);
|
|
42
|
+
if (ok)
|
|
43
|
+
UI.success(`Claude MCP registered → ${configPath}`);
|
|
44
|
+
}
|
|
45
|
+
const frameworkDir = ".claude";
|
|
46
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
47
|
+
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
48
|
+
UI.success("Claude Code Project MCP → .mcp.json");
|
|
49
|
+
});
|
|
50
|
+
// 🤖 Grok
|
|
51
|
+
registry.register({
|
|
52
|
+
id: "grok",
|
|
53
|
+
frameworkDir: ".grok",
|
|
54
|
+
shimFile: "GROK.md",
|
|
55
|
+
shimTemplate: "src/cli/shims/grok.md",
|
|
56
|
+
role: "researcher",
|
|
57
|
+
templateDir: ".enderun",
|
|
58
|
+
nestedDirs: ["agents", "rules"],
|
|
59
|
+
agentsDir: ".grok/agents",
|
|
60
|
+
agentsExt: ".md"
|
|
61
|
+
}, (projectRoot, mcpBlock) => {
|
|
62
|
+
const frameworkDir = ".grok";
|
|
63
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
64
|
+
UI.success(`Grok MCP → ${frameworkDir}/mcp_config.json`);
|
|
65
|
+
});
|
|
66
|
+
// ✍️ Cursor
|
|
67
|
+
registry.register({
|
|
68
|
+
id: "cursor",
|
|
69
|
+
frameworkDir: ".cursor",
|
|
70
|
+
shimFile: "CURSOR.md",
|
|
71
|
+
shimTemplate: "src/cli/shims/cursor.mdc",
|
|
72
|
+
role: "implementer",
|
|
73
|
+
templateDir: ".enderun",
|
|
74
|
+
nestedDirs: ["rules"],
|
|
75
|
+
agentsDir: ".cursor/rules",
|
|
76
|
+
agentsExt: ".mdc"
|
|
77
|
+
}, (projectRoot, mcpBlock) => {
|
|
78
|
+
const frameworkDir = ".cursor";
|
|
79
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
80
|
+
UI.success(`Cursor IDE Project MCP → ${frameworkDir}/mcp.json`);
|
|
81
|
+
});
|
|
82
|
+
// 💡 Codex (Copilot)
|
|
83
|
+
registry.register({
|
|
84
|
+
id: "codex",
|
|
85
|
+
frameworkDir: ".agents",
|
|
86
|
+
shimFile: "copilot-instructions.md",
|
|
87
|
+
shimTemplate: "src/cli/shims/codex.md",
|
|
88
|
+
role: "implementer",
|
|
89
|
+
templateDir: ".enderun",
|
|
90
|
+
nestedDirs: ["skills", "rules", "instructions"],
|
|
91
|
+
agentsDir: ".agents/instructions",
|
|
92
|
+
agentsExt: ".md"
|
|
93
|
+
}, (projectRoot, mcpBlock) => {
|
|
94
|
+
const frameworkDir = ".agents";
|
|
95
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
96
|
+
writeJsonFile(path.join(projectRoot, ".vscode/mcp.json"), mcpBlock);
|
|
97
|
+
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
98
|
+
UI.success("GitHub Copilot Project MCP → .vscode/mcp.json & .mcp.json");
|
|
99
|
+
});
|
|
100
|
+
// 🏠 Local LLM (Ollama / Private AI)
|
|
101
|
+
registry.register({
|
|
102
|
+
id: "local",
|
|
103
|
+
frameworkDir: ".enderun",
|
|
104
|
+
shimFile: "LOCAL_AI.md",
|
|
105
|
+
shimTemplate: "src/cli/shims/local.md",
|
|
106
|
+
role: "commander",
|
|
107
|
+
templateDir: ".enderun",
|
|
108
|
+
nestedDirs: ["agents", "rules"],
|
|
109
|
+
agentsDir: ".enderun/agents",
|
|
110
|
+
agentsExt: ".md"
|
|
111
|
+
}, (projectRoot, mcpBlock) => {
|
|
112
|
+
const frameworkDir = ".enderun";
|
|
113
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
114
|
+
UI.success(`Local LLM MCP (Ollama/Private AI) registered → ${frameworkDir}/mcp_config.json`);
|
|
115
|
+
});
|
|
116
|
+
// 🛸 Antigravity
|
|
117
|
+
registry.register({
|
|
118
|
+
id: "antigravity-cli",
|
|
119
|
+
frameworkDir: ".antigravity",
|
|
120
|
+
shimFile: "AGENTS.md",
|
|
121
|
+
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
122
|
+
role: "general",
|
|
123
|
+
templateDir: ".enderun",
|
|
124
|
+
nestedDirs: ["agents", "plugins", "rules"],
|
|
125
|
+
agentsDir: ".antigravity/agents",
|
|
126
|
+
agentsExt: ".md"
|
|
127
|
+
}, (projectRoot, mcpBlock) => {
|
|
128
|
+
const frameworkDir = ".antigravity";
|
|
129
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
130
|
+
UI.success(`Antigravity CLI MCP → ${frameworkDir}/mcp_config.json`);
|
|
131
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
132
|
+
});
|
|
5
133
|
/**
|
|
6
134
|
* Mapped Adapter Configurations
|
|
7
135
|
*/
|
|
8
|
-
export const ADAPTER_CONFIGS =
|
|
9
|
-
gemini: {
|
|
10
|
-
id: "gemini",
|
|
11
|
-
frameworkDir: ".gemini",
|
|
12
|
-
shimFile: "GEMINI.md",
|
|
13
|
-
shimTemplate: "src/cli/shims/gemini.md",
|
|
14
|
-
role: "commander",
|
|
15
|
-
templateDir: ".enderun",
|
|
16
|
-
nestedDirs: ["agents", "rules"],
|
|
17
|
-
agentsDir: ".gemini/agents", // Use unified path
|
|
18
|
-
agentsExt: ".md"
|
|
19
|
-
},
|
|
20
|
-
claude: {
|
|
21
|
-
id: "claude",
|
|
22
|
-
frameworkDir: ".claude",
|
|
23
|
-
shimFile: "CLAUDE.md",
|
|
24
|
-
shimTemplate: "src/cli/shims/claude.md",
|
|
25
|
-
role: "architect",
|
|
26
|
-
templateDir: ".enderun",
|
|
27
|
-
nestedDirs: ["agents", "rules"],
|
|
28
|
-
agentsDir: ".claude/agents",
|
|
29
|
-
agentsExt: ".md"
|
|
30
|
-
},
|
|
31
|
-
grok: {
|
|
32
|
-
id: "grok",
|
|
33
|
-
frameworkDir: ".grok",
|
|
34
|
-
shimFile: "GROK.md",
|
|
35
|
-
shimTemplate: "src/cli/shims/grok.md",
|
|
36
|
-
role: "researcher",
|
|
37
|
-
templateDir: ".enderun",
|
|
38
|
-
nestedDirs: ["agents", "rules"],
|
|
39
|
-
agentsDir: ".grok/agents",
|
|
40
|
-
agentsExt: ".md"
|
|
41
|
-
},
|
|
42
|
-
cursor: {
|
|
43
|
-
id: "cursor",
|
|
44
|
-
frameworkDir: ".cursor",
|
|
45
|
-
shimFile: "CURSOR.md",
|
|
46
|
-
shimTemplate: "src/cli/shims/cursor.mdc",
|
|
47
|
-
role: "implementer",
|
|
48
|
-
templateDir: ".enderun",
|
|
49
|
-
nestedDirs: ["rules"],
|
|
50
|
-
agentsDir: ".cursor/rules",
|
|
51
|
-
agentsExt: ".mdc"
|
|
52
|
-
},
|
|
53
|
-
codex: {
|
|
54
|
-
id: "codex",
|
|
55
|
-
frameworkDir: ".agents",
|
|
56
|
-
shimFile: "copilot-instructions.md",
|
|
57
|
-
shimTemplate: "src/cli/shims/codex.md",
|
|
58
|
-
role: "implementer",
|
|
59
|
-
templateDir: ".enderun",
|
|
60
|
-
nestedDirs: ["skills", "rules", "instructions"],
|
|
61
|
-
agentsDir: ".agents/instructions",
|
|
62
|
-
agentsExt: ".md"
|
|
63
|
-
},
|
|
64
|
-
"antigravity-cli": {
|
|
65
|
-
id: "antigravity-cli",
|
|
66
|
-
frameworkDir: ".antigravity",
|
|
67
|
-
shimFile: "AGENTS.md",
|
|
68
|
-
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
69
|
-
role: "general",
|
|
70
|
-
templateDir: ".enderun",
|
|
71
|
-
nestedDirs: ["agents", "plugins", "rules"],
|
|
72
|
-
agentsDir: ".antigravity/agents",
|
|
73
|
-
agentsExt: ".md"
|
|
74
|
-
}
|
|
75
|
-
};
|
|
136
|
+
export const ADAPTER_CONFIGS = registry.getConfigs();
|
|
76
137
|
/**
|
|
77
138
|
* Post-Initialization Handlers for specific adapters
|
|
78
139
|
*/
|
|
79
|
-
export const POST_INIT_HANDLERS =
|
|
80
|
-
gemini: (projectRoot, mcpBlock) => {
|
|
81
|
-
const frameworkDir = ADAPTER_CONFIGS.gemini.frameworkDir;
|
|
82
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
83
|
-
console.warn(`✅ Gemini MCP registered → ${frameworkDir}/mcp.json`);
|
|
84
|
-
registerGlobalAntigravityPlugins(mcpBlock);
|
|
85
|
-
},
|
|
86
|
-
claude: (projectRoot, mcpBlock) => {
|
|
87
|
-
const configPath = findClaudeConfigPath();
|
|
88
|
-
if (configPath) {
|
|
89
|
-
const block = mcpBlock;
|
|
90
|
-
const mcpEntry = block.mcpServers["agent-enderun"];
|
|
91
|
-
const ok = addMcpServerToClaude(configPath, "agent-enderun", mcpEntry);
|
|
92
|
-
if (ok)
|
|
93
|
-
console.warn(`✅ Claude MCP registered → ${configPath}`);
|
|
94
|
-
}
|
|
95
|
-
const frameworkDir = ADAPTER_CONFIGS.claude.frameworkDir;
|
|
96
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
97
|
-
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
98
|
-
console.warn("✅ Claude Code Project MCP → .mcp.json");
|
|
99
|
-
},
|
|
100
|
-
grok: (projectRoot, mcpBlock) => {
|
|
101
|
-
const frameworkDir = ADAPTER_CONFIGS.grok.frameworkDir;
|
|
102
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
103
|
-
console.warn(`✅ Grok MCP → ${frameworkDir}/mcp_config.json`);
|
|
104
|
-
},
|
|
105
|
-
cursor: (projectRoot, mcpBlock) => {
|
|
106
|
-
const frameworkDir = ADAPTER_CONFIGS.cursor.frameworkDir;
|
|
107
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp.json"), mcpBlock);
|
|
108
|
-
console.warn(`✅ Cursor IDE Project MCP → ${frameworkDir}/mcp.json`);
|
|
109
|
-
},
|
|
110
|
-
codex: (projectRoot, mcpBlock) => {
|
|
111
|
-
const frameworkDir = ADAPTER_CONFIGS.codex.frameworkDir;
|
|
112
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
113
|
-
writeJsonFile(path.join(projectRoot, ".vscode/mcp.json"), mcpBlock);
|
|
114
|
-
writeJsonFile(path.join(projectRoot, ".mcp.json"), mcpBlock);
|
|
115
|
-
console.warn("✅ GitHub Copilot Project MCP → .vscode/mcp.json & .mcp.json");
|
|
116
|
-
},
|
|
117
|
-
"antigravity-cli": (projectRoot, mcpBlock) => {
|
|
118
|
-
const frameworkDir = ADAPTER_CONFIGS["antigravity-cli"].frameworkDir;
|
|
119
|
-
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
120
|
-
console.warn(`✅ Antigravity CLI MCP → ${frameworkDir}/mcp_config.json`);
|
|
121
|
-
registerGlobalAntigravityPlugins(mcpBlock);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
140
|
+
export const POST_INIT_HANDLERS = registry.getHandlers();
|
|
124
141
|
//# sourceMappingURL=definitions.js.map
|