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
|
@@ -2,123 +2,124 @@ 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
|
+
// 🛸 Antigravity
|
|
101
|
+
registry.register({
|
|
102
|
+
id: "antigravity-cli",
|
|
103
|
+
frameworkDir: ".antigravity",
|
|
104
|
+
shimFile: "AGENTS.md",
|
|
105
|
+
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
106
|
+
role: "general",
|
|
107
|
+
templateDir: ".enderun",
|
|
108
|
+
nestedDirs: ["agents", "plugins", "rules"],
|
|
109
|
+
agentsDir: ".antigravity/agents",
|
|
110
|
+
agentsExt: ".md"
|
|
111
|
+
}, (projectRoot, mcpBlock) => {
|
|
112
|
+
const frameworkDir = ".antigravity";
|
|
113
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
114
|
+
UI.success(`Antigravity CLI MCP → ${frameworkDir}/mcp_config.json`);
|
|
115
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
116
|
+
});
|
|
5
117
|
/**
|
|
6
118
|
* Mapped Adapter Configurations
|
|
7
119
|
*/
|
|
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
|
-
};
|
|
120
|
+
export const ADAPTER_CONFIGS = registry.getConfigs();
|
|
76
121
|
/**
|
|
77
122
|
* Post-Initialization Handlers for specific adapters
|
|
78
123
|
*/
|
|
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
|
-
};
|
|
124
|
+
export const POST_INIT_HANDLERS = registry.getHandlers();
|
|
124
125
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../src/modules/adapters/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../../../src/modules/adapters/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,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AQ,CACb;IACI,EAAE,EAAE,iBAAiB;IACrB,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,WAAW;IACrB,YAAY,EAAE,kCAAkC;IAChD,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,UAAU;IACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;IAC1C,SAAS,EAAE,qBAAqB;IAChC,SAAS,EAAE,KAAK;CACnB,EACD,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE;IACtB,MAAM,YAAY,GAAG,cAAc,CAAC;IACpC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACjF,EAAE,CAAC,OAAO,CAAC,yBAAyB,YAAY,kBAAkB,CAAC,CAAC;IACpE,gCAAgC,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC,CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqC,QAAQ,CAAC,UAAU,EAAE,CAAC;AAEvF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwE,QAAQ,CAAC,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdapterId, AdapterConfig } from "./types.js";
|
|
2
|
+
type PostInitHandler = (projectRoot: string, mcpBlock: unknown) => void;
|
|
3
|
+
declare class AdapterRegistry {
|
|
4
|
+
private configs;
|
|
5
|
+
private handlers;
|
|
6
|
+
register(config: AdapterConfig, handler: PostInitHandler): void;
|
|
7
|
+
getConfigs(): Record<string, AdapterConfig>;
|
|
8
|
+
getHandlers(): Record<string, PostInitHandler>;
|
|
9
|
+
getIds(): AdapterId[];
|
|
10
|
+
}
|
|
11
|
+
export declare const registry: AdapterRegistry;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class AdapterRegistry {
|
|
2
|
+
configs = new Map();
|
|
3
|
+
handlers = new Map();
|
|
4
|
+
register(config, handler) {
|
|
5
|
+
this.configs.set(config.id, config);
|
|
6
|
+
this.handlers.set(config.id, handler);
|
|
7
|
+
}
|
|
8
|
+
getConfigs() {
|
|
9
|
+
return Object.fromEntries(this.configs);
|
|
10
|
+
}
|
|
11
|
+
getHandlers() {
|
|
12
|
+
return Object.fromEntries(this.handlers);
|
|
13
|
+
}
|
|
14
|
+
getIds() {
|
|
15
|
+
return Array.from(this.configs.keys());
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export const registry = new AdapterRegistry();
|
|
19
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/modules/adapters/registry.ts"],"names":[],"mappings":"AAIA,MAAM,eAAe;IACT,OAAO,GAA+B,IAAI,GAAG,EAAE,CAAC;IAChD,QAAQ,GAAiC,IAAI,GAAG,EAAE,CAAC;IAE3D,QAAQ,CAAC,MAAqB,EAAE,OAAwB;QACpD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU;QACN,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,WAAW;QACP,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM;QACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAgB,CAAC;IAC1D,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { writeJsonFile, writeTextFile } from "../../shared/fs.js";
|
|
|
6
6
|
import { ALL_AGENTS, toAntigravityJson } from "../agents/definitions.js";
|
|
7
7
|
import { CORE_SKILLS } from "../skills/definitions.js";
|
|
8
8
|
import { getPackageRoot } from "../../cli/utils/pkg.js";
|
|
9
|
+
import { logger } from "../../shared/logger.js";
|
|
9
10
|
export function registerGlobalAntigravityPlugins(mcpBlock) {
|
|
10
11
|
// Allow overriding via env var for different OS/Gemini CLI versions
|
|
11
12
|
const defaultGlobalDir = path.join(os.homedir(), ".gemini/antigravity-cli");
|
|
@@ -18,7 +19,7 @@ export function registerGlobalAntigravityPlugins(mcpBlock) {
|
|
|
18
19
|
fs.mkdirSync(globalDir, { recursive: true });
|
|
19
20
|
writeJsonFile(path.join(globalDir, "mcp.json"), mcpBlock);
|
|
20
21
|
writeJsonFile(path.join(globalDir, "mcp_config.json"), mcpBlock);
|
|
21
|
-
|
|
22
|
+
logger.info(`Antigravity MCP registered → ${globalDir}/`);
|
|
22
23
|
// Global Plugin configuration under plugins/agent-enderun/
|
|
23
24
|
const globalPluginDir = path.join(globalDir, "plugins/agent-enderun");
|
|
24
25
|
fs.mkdirSync(globalPluginDir, { recursive: true });
|
|
@@ -87,17 +88,17 @@ ${ag.instructions.rules.map(r => `- ${r}`).join("\n")}
|
|
|
87
88
|
}
|
|
88
89
|
// Scaffold optional empty hooks.json
|
|
89
90
|
writeJsonFile(path.join(globalPluginDir, "hooks.json"), {});
|
|
90
|
-
|
|
91
|
+
logger.info(`Antigravity Plugin registered → ${globalPluginDir}/`);
|
|
91
92
|
try {
|
|
92
93
|
execSync(`agy plugin install "${globalPluginDir}"`, { stdio: "ignore" });
|
|
93
|
-
|
|
94
|
+
logger.info("Antigravity Plugin installed in CLI.");
|
|
94
95
|
}
|
|
95
96
|
catch {
|
|
96
97
|
// Ignore if agy is not in PATH or fails
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
catch (e) {
|
|
100
|
-
|
|
101
|
+
logger.warn(`Failed to register plugin/MCP in ${globalDir}`, e);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/modules/adapters/shared.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/modules/adapters/shared.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,MAAM,UAAU,gCAAgC,CAAC,QAAiB;IAC9D,oEAAoE;IACpE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,yBAAyB,CAAC,CAAC;I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AAa,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC;YACrE,CAAC;YAED,qCAAqC;YACrC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;YAE5D,MAAM,CAAC,IAAI,CAAC,mCAAmC,eAAe,GAAG,CAAC,CAAC;YAEnE,IAAI,CAAC;gBACD,QAAQ,CAAC,uBAAuB,eAAe,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACzE,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACxD,CAAC;YAAC,MAAM,CAAC;gBACL,wCAAwC;YAC5C,CAAC;QAEL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,IAAI,CAAC,oCAAoC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { AgentDefinition } from "./types.js";
|
|
2
2
|
export declare const ALL_AGENTS: AgentDefinition[];
|
|
3
|
-
export declare function toClaudeCodeMd(ag: AgentDefinition, baseKnowledgeDir?: string): string;
|
|
4
|
-
export declare function toGeminiCliMd(ag: AgentDefinition, baseKnowledgeDir?: string): string;
|
|
5
|
-
export declare function toAntigravityJson(ag: AgentDefinition, baseKnowledgeDir?: string): string;
|
|
3
|
+
export declare function toClaudeCodeMd(ag: AgentDefinition, baseKnowledgeDir?: string, paths?: Record<string, string>): string;
|
|
4
|
+
export declare function toGeminiCliMd(ag: AgentDefinition, baseKnowledgeDir?: string, paths?: Record<string, string>): string;
|
|
5
|
+
export declare function toAntigravityJson(ag: AgentDefinition, baseKnowledgeDir?: string, paths?: Record<string, string>): string;
|
|
6
6
|
/** Alias for Antigravity JSON export used by CLI */
|
|
7
7
|
export declare const buildAgentJson: typeof toAntigravityJson;
|
|
8
|
-
export declare function toCodexMd(ag: AgentDefinition, baseKnowledgeDir?: string): string;
|
|
9
|
-
export declare function toCursorMdc(ag: AgentDefinition, baseKnowledgeDir?: string): string;
|
|
8
|
+
export declare function toCodexMd(ag: AgentDefinition, baseKnowledgeDir?: string, paths?: Record<string, string>): string;
|
|
9
|
+
export declare function toCursorMdc(ag: AgentDefinition, baseKnowledgeDir?: string, paths?: Record<string, string>): string;
|
|
10
10
|
export type ExportTarget = "claude-code" | "gemini-cli" | "antigravity" | "codex-cli" | "cursor";
|
|
11
11
|
export interface ExportedFile {
|
|
12
12
|
path: string;
|
|
13
13
|
content: string;
|
|
14
14
|
}
|
|
15
|
-
export declare function exportAllAgents(target: ExportTarget): ExportedFile[];
|
|
15
|
+
export declare function exportAllAgents(target: ExportTarget, paths?: Record<string, string>): ExportedFile[];
|
|
@@ -76,7 +76,6 @@ const CLAUDE_TOOL_MAP = {
|
|
|
76
76
|
get_framework_status: "Bash",
|
|
77
77
|
get_system_health: "Bash",
|
|
78
78
|
check_active_ports: "Bash",
|
|
79
|
-
start_dashboard: "Bash",
|
|
80
79
|
update_contract_hash: "Write",
|
|
81
80
|
acquire_lock: "Write",
|
|
82
81
|
release_lock: "Write",
|
|
@@ -114,7 +113,6 @@ const GEMINI_TOOL_MAP = {
|
|
|
114
113
|
get_framework_status: "run_shell_command",
|
|
115
114
|
get_system_health: "run_shell_command",
|
|
116
115
|
check_active_ports: "run_shell_command",
|
|
117
|
-
start_dashboard: "run_shell_command",
|
|
118
116
|
update_contract_hash: "write_file",
|
|
119
117
|
acquire_lock: "write_file",
|
|
120
118
|
release_lock: "write_file",
|
|
@@ -156,7 +154,7 @@ function resolveModel(cap, platform) {
|
|
|
156
154
|
* frontmatter validators may misinterpret HTML comments in the document body
|
|
157
155
|
* as unrecognized YAML keys and reject the agent file entirely.
|
|
158
156
|
*/
|
|
159
|
-
function buildSystemPrompt(ag, baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards"), stripMetaComments = false) {
|
|
157
|
+
function buildSystemPrompt(ag, baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards"), stripMetaComments = false, paths = { backend: "apps/backend", frontend: "apps/web", mobile: "apps/mobile", docs: "docs" }) {
|
|
160
158
|
const metaHeader = stripMetaComments ? [] : [
|
|
161
159
|
`<!-- name: ${ag.name} -->`,
|
|
162
160
|
`<!-- capability: ${ag.capability} -->`,
|
|
@@ -177,6 +175,13 @@ function buildSystemPrompt(ag, baseKnowledgeDir = path.join(getPackageRoot(), "t
|
|
|
177
175
|
`**Primary Role:** ${ag.role}`,
|
|
178
176
|
`**Authority Tier:** ${ag.tier} (Capability: ${ag.capability}/10)`,
|
|
179
177
|
"",
|
|
178
|
+
"## Project Structure",
|
|
179
|
+
`This project uses the following directory structure:`,
|
|
180
|
+
`- **Backend:** \`${paths.backend}\``,
|
|
181
|
+
`- **Frontend:** \`${paths.frontend}\``,
|
|
182
|
+
`- **Mobile:** \`${paths.mobile}\``,
|
|
183
|
+
`- **Documentation:** \`${paths.docs}\``,
|
|
184
|
+
"",
|
|
180
185
|
"## Chain of Thought Protocol",
|
|
181
186
|
"> Follow these steps in strict order for every task:",
|
|
182
187
|
"",
|
|
@@ -195,6 +200,7 @@ function buildSystemPrompt(ag, baseKnowledgeDir = path.join(getPackageRoot(), "t
|
|
|
195
200
|
"- Never perform irreversible operations (schema drops, bulk deletes) without @manager approval.",
|
|
196
201
|
"- Prefer surgical edits (`replace_text`, `patch_file`) over full file rewrites.",
|
|
197
202
|
"- Escalate ambiguity to @manager instead of guessing.",
|
|
203
|
+
`- Ensure all development happens exclusively inside \`${paths.backend}\`, \`${paths.frontend}\`, or \`${paths.mobile}\`.`,
|
|
198
204
|
];
|
|
199
205
|
if (ag.instructions.knowledgeFiles?.length) {
|
|
200
206
|
lines.push("", "## Governance Standards (Required Reading)");
|
|
@@ -216,7 +222,7 @@ function buildSystemPrompt(ag, baseKnowledgeDir = path.join(getPackageRoot(), "t
|
|
|
216
222
|
// Valid fields: name, description, model, tools, color
|
|
217
223
|
// Ref: https://docs.anthropic.com/en/docs/claude-code/sub-agents
|
|
218
224
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
219
|
-
export function toClaudeCodeMd(ag, baseKnowledgeDir) {
|
|
225
|
+
export function toClaudeCodeMd(ag, baseKnowledgeDir, paths) {
|
|
220
226
|
const tools = [...new Set(ag.tools.map((t) => CLAUDE_TOOL_MAP[t] ?? t))];
|
|
221
227
|
const model = resolveModel(ag.capability, "claude-code");
|
|
222
228
|
const color = ag.tier === "supreme" ? "purple"
|
|
@@ -233,18 +239,16 @@ export function toClaudeCodeMd(ag, baseKnowledgeDir) {
|
|
|
233
239
|
`color: ${color}`,
|
|
234
240
|
"---",
|
|
235
241
|
].join("\n");
|
|
236
|
-
return `${frontmatter}\n\n${buildSystemPrompt(ag, baseKnowledgeDir)}`;
|
|
242
|
+
return `${frontmatter}\n\n${buildSystemPrompt(ag, baseKnowledgeDir, false, paths)}`;
|
|
237
243
|
}
|
|
238
244
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
239
245
|
// GEMINI CLI → .gemini/agents/{name}.md
|
|
240
246
|
// Valid fields: name, description, model, tools (YAML list)
|
|
241
247
|
// Ref: https://ai.google.dev/gemini-api/docs/agents
|
|
242
248
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
243
|
-
export function toGeminiCliMd(ag, baseKnowledgeDir) {
|
|
249
|
+
export function toGeminiCliMd(ag, baseKnowledgeDir, paths) {
|
|
244
250
|
const tools = [...new Set(ag.tools.map((t) => GEMINI_TOOL_MAP[t] ?? t))];
|
|
245
251
|
const model = resolveModel(ag.capability, "gemini-cli");
|
|
246
|
-
// Only officially supported frontmatter fields — no capability, no tags, no color.
|
|
247
|
-
// Gemini CLI's strict Zod validator rejects any unrecognized keys.
|
|
248
252
|
const frontmatter = [
|
|
249
253
|
"---",
|
|
250
254
|
`name: ${ag.name}`,
|
|
@@ -255,15 +259,20 @@ export function toGeminiCliMd(ag, baseKnowledgeDir) {
|
|
|
255
259
|
...tools.map(t => ` - ${t}`),
|
|
256
260
|
"---",
|
|
257
261
|
].join("\n");
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
262
|
+
const body = buildSystemPrompt(ag, baseKnowledgeDir, true, paths);
|
|
263
|
+
const metaFooter = [
|
|
264
|
+
"",
|
|
265
|
+
`<!-- name: ${ag.name} -->`,
|
|
266
|
+
`<!-- capability: ${ag.capability} -->`,
|
|
267
|
+
`<!-- tags: ${JSON.stringify(ag.tags)} -->`,
|
|
268
|
+
].join("\n");
|
|
269
|
+
return `${frontmatter}\n\n${body}${metaFooter}`;
|
|
261
270
|
}
|
|
262
271
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
263
272
|
// ANTIGRAVITY CLI → .agents/{name}/agent.json
|
|
264
273
|
// Spec: Antigravity customAgentSpec JSON schema
|
|
265
274
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
266
|
-
export function toAntigravityJson(ag, baseKnowledgeDir) {
|
|
275
|
+
export function toAntigravityJson(ag, baseKnowledgeDir, paths) {
|
|
267
276
|
const knowledgeBase = baseKnowledgeDir ?? path.join(getPackageRoot(), "templates/standards");
|
|
268
277
|
// Embed actual file contents so the agent can read governance docs
|
|
269
278
|
const knowledgeSections = (ag.instructions.knowledgeFiles ?? []).map((f) => {
|
|
@@ -285,6 +294,16 @@ export function toAntigravityJson(ag, baseKnowledgeDir) {
|
|
|
285
294
|
title: "Identity & Mission",
|
|
286
295
|
content: `${ag.instructions.identity}\n\n**Mission:** ${ag.instructions.mission}`,
|
|
287
296
|
},
|
|
297
|
+
{
|
|
298
|
+
title: "Project Structure",
|
|
299
|
+
content: [
|
|
300
|
+
"This project uses the following directory structure:",
|
|
301
|
+
`- Backend: ${paths?.backend || "apps/backend"}`,
|
|
302
|
+
`- Frontend: ${paths?.frontend || "apps/web"}`,
|
|
303
|
+
`- Mobile: ${paths?.mobile || "apps/mobile"}`,
|
|
304
|
+
`- Documentation: ${paths?.docs || "docs"}`,
|
|
305
|
+
].join("\n"),
|
|
306
|
+
},
|
|
288
307
|
{
|
|
289
308
|
title: "Chain of Thought Protocol",
|
|
290
309
|
content: ag.instructions.chainOfThought,
|
|
@@ -301,6 +320,7 @@ export function toAntigravityJson(ag, baseKnowledgeDir) {
|
|
|
301
320
|
"- Read PROJECT_MEMORY.md at session start.",
|
|
302
321
|
"- Prefer surgical edits over full file rewrites.",
|
|
303
322
|
"- Escalate high-risk operations to @manager.",
|
|
323
|
+
`- Ensure development happens inside ${paths?.backend || "apps/backend"}, ${paths?.frontend || "apps/web"}, or ${paths?.mobile || "apps/mobile"}.`,
|
|
304
324
|
].join("\n"),
|
|
305
325
|
},
|
|
306
326
|
...knowledgeSections,
|
|
@@ -317,7 +337,7 @@ export const buildAgentJson = toAntigravityJson;
|
|
|
317
337
|
// CODEX CLI (OpenAI) → .agents/{name}.md
|
|
318
338
|
// Valid fields: agent-type, display-name, when-to-use, model, allowed-tools
|
|
319
339
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
320
|
-
export function toCodexMd(ag, baseKnowledgeDir) {
|
|
340
|
+
export function toCodexMd(ag, baseKnowledgeDir, paths) {
|
|
321
341
|
const model = resolveModel(ag.capability, "codex-cli");
|
|
322
342
|
const tools = [...new Set(ag.tools.map((t) => {
|
|
323
343
|
if (["read_file", "view_file", "list_dir", "grep_search", "get_memory_insights", "read_project_memory", "get_project_map", "get_project_gaps", "get_framework_status"].includes(t))
|
|
@@ -326,7 +346,6 @@ export function toCodexMd(ag, baseKnowledgeDir) {
|
|
|
326
346
|
return "write";
|
|
327
347
|
return "shell";
|
|
328
348
|
}))];
|
|
329
|
-
// Only officially supported Codex CLI frontmatter fields — no tier, no capability
|
|
330
349
|
const frontmatter = [
|
|
331
350
|
"---",
|
|
332
351
|
`agent-type: "${ag.name}"`,
|
|
@@ -337,16 +356,21 @@ export function toCodexMd(ag, baseKnowledgeDir) {
|
|
|
337
356
|
`allowed-tools: [${tools.map(t => `"${t}"`).join(", ")}]`,
|
|
338
357
|
"---",
|
|
339
358
|
].join("\n");
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
359
|
+
const body = buildSystemPrompt(ag, baseKnowledgeDir, true, paths);
|
|
360
|
+
const metaFooter = [
|
|
361
|
+
"",
|
|
362
|
+
`<!-- name: ${ag.name} -->`,
|
|
363
|
+
`<!-- capability: ${ag.capability} -->`,
|
|
364
|
+
`<!-- tags: ${JSON.stringify(ag.tags)} -->`,
|
|
365
|
+
].join("\n");
|
|
366
|
+
return `${frontmatter}\n\n${body}${metaFooter}`;
|
|
343
367
|
}
|
|
344
368
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
345
369
|
// CURSOR IDE → .cursor/rules/{name}.mdc
|
|
346
370
|
// Valid fields: description, globs, alwaysApply
|
|
347
371
|
// Ref: https://docs.cursor.com/context/rules
|
|
348
372
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
349
|
-
export function toCursorMdc(ag, baseKnowledgeDir) {
|
|
373
|
+
export function toCursorMdc(ag, baseKnowledgeDir, paths) {
|
|
350
374
|
const glob = CURSOR_AGENT_GLOBS[ag.name] || "**/*";
|
|
351
375
|
// Only officially supported Cursor MDC frontmatter fields
|
|
352
376
|
const frontmatter = [
|
|
@@ -356,21 +380,21 @@ export function toCursorMdc(ag, baseKnowledgeDir) {
|
|
|
356
380
|
"alwaysApply: false",
|
|
357
381
|
"---",
|
|
358
382
|
].join("\n");
|
|
359
|
-
return `${frontmatter}\n\n${buildSystemPrompt(ag, baseKnowledgeDir)}`;
|
|
383
|
+
return `${frontmatter}\n\n${buildSystemPrompt(ag, baseKnowledgeDir, false, paths)}`;
|
|
360
384
|
}
|
|
361
|
-
export function exportAllAgents(target) {
|
|
385
|
+
export function exportAllAgents(target, paths) {
|
|
362
386
|
return ALL_AGENTS.map(ag => {
|
|
363
387
|
switch (target) {
|
|
364
388
|
case "claude-code":
|
|
365
|
-
return { path: `.claude/agents/${ag.name}.md`, content: toClaudeCodeMd(ag) };
|
|
389
|
+
return { path: `.claude/agents/${ag.name}.md`, content: toClaudeCodeMd(ag, undefined, paths) };
|
|
366
390
|
case "gemini-cli":
|
|
367
|
-
return { path: `.gemini/agents/${ag.name}.md`, content: toGeminiCliMd(ag) };
|
|
391
|
+
return { path: `.gemini/agents/${ag.name}.md`, content: toGeminiCliMd(ag, undefined, paths) };
|
|
368
392
|
case "antigravity":
|
|
369
|
-
return { path: `.agents/${ag.name}/agent.json`, content: toAntigravityJson(ag) };
|
|
393
|
+
return { path: `.agents/${ag.name}/agent.json`, content: toAntigravityJson(ag, undefined, paths) };
|
|
370
394
|
case "codex-cli":
|
|
371
|
-
return { path: `.agents/${ag.name}.md`, content: toCodexMd(ag) };
|
|
395
|
+
return { path: `.agents/${ag.name}.md`, content: toCodexMd(ag, undefined, paths) };
|
|
372
396
|
case "cursor":
|
|
373
|
-
return { path: `.cursor/rules/${ag.name}.mdc`, content: toCursorMdc(ag) };
|
|
397
|
+
return { path: `.cursor/rules/${ag.name}.mdc`, content: toCursorMdc(ag, undefined, paths) };
|
|
374
398
|
}
|
|
375
399
|
});
|
|
376
400
|
}
|