atabey 0.0.7 → 0.0.8
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 +1 -1
- package/dist/src/cli/adapters/core.js +12 -19
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/shared/constants.d.ts +1 -0
- package/dist/src/shared/constants.js +1 -0
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/tests/adapter.test.js +3 -2
- package/dist/tests/adapter.test.js.map +1 -1
- package/framework-mcp/dist/constants.js +64 -0
- package/framework-mcp/dist/framework-mcp/src/constants.js +64 -0
- package/framework-mcp/dist/framework-mcp/src/index.js +144 -0
- package/framework-mcp/dist/framework-mcp/src/resources/index.js +58 -0
- package/framework-mcp/dist/framework-mcp/src/tools/control_plane/locking.js +82 -0
- package/framework-mcp/dist/framework-mcp/src/tools/control_plane/registry.js +35 -0
- package/framework-mcp/dist/framework-mcp/src/tools/definitions.js +322 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +64 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/patch_file.js +34 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/replace_text.js +50 -0
- package/framework-mcp/dist/framework-mcp/src/tools/file_system/write_file.js +43 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/run_tests.js +27 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/framework-mcp/src/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/framework-mcp/src/tools/index.js +62 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/framework-mcp/src/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/framework-mcp/src/tools/messaging/send_message.js +94 -0
- package/framework-mcp/dist/framework-mcp/src/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/framework-mcp/src/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/framework-mcp/src/tools/quality/check_lint.js +30 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/grep_search.js +75 -0
- package/framework-mcp/dist/framework-mcp/src/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/framework-mcp/src/tools/shell/run_command.js +56 -0
- package/framework-mcp/dist/framework-mcp/src/tools/types.js +1 -0
- package/framework-mcp/dist/framework-mcp/src/utils/cli.js +59 -0
- package/framework-mcp/dist/framework-mcp/src/utils/compliance.js +231 -0
- package/framework-mcp/dist/framework-mcp/src/utils/fs.js +44 -0
- package/framework-mcp/dist/framework-mcp/src/utils/metrics.js +56 -0
- package/framework-mcp/dist/framework-mcp/src/utils/permissions.js +71 -0
- package/framework-mcp/dist/framework-mcp/src/utils/security.js +60 -0
- package/framework-mcp/dist/index.js +144 -0
- package/framework-mcp/dist/resources/index.js +58 -0
- package/framework-mcp/dist/src/cli/adapters/core.js +71 -0
- package/framework-mcp/dist/src/cli/adapters/index.js +5 -0
- package/framework-mcp/dist/src/cli/adapters/paths.js +101 -0
- package/framework-mcp/dist/src/cli/adapters/scaffold.js +71 -0
- package/framework-mcp/dist/src/cli/adapters/utils.js +75 -0
- package/framework-mcp/dist/src/cli/commands/approve.js +63 -0
- package/framework-mcp/dist/src/cli/commands/check.js +181 -0
- package/framework-mcp/dist/src/cli/commands/compliance.js +50 -0
- package/framework-mcp/dist/src/cli/commands/contract.js +50 -0
- package/framework-mcp/dist/src/cli/commands/dashboard.js +123 -0
- package/framework-mcp/dist/src/cli/commands/explorer.js +42 -0
- package/framework-mcp/dist/src/cli/commands/git.js +40 -0
- package/framework-mcp/dist/src/cli/commands/init/create-agent.js +58 -0
- package/framework-mcp/dist/src/cli/commands/init/scaffold-core.js +112 -0
- package/framework-mcp/dist/src/cli/commands/init/scaffold-docs.js +34 -0
- package/framework-mcp/dist/src/cli/commands/init/scaffold-ops.js +80 -0
- package/framework-mcp/dist/src/cli/commands/init/scaffold-standards.js +67 -0
- package/framework-mcp/dist/src/cli/commands/init.js +167 -0
- package/framework-mcp/dist/src/cli/commands/knowledge.js +42 -0
- package/framework-mcp/dist/src/cli/commands/lint.js +22 -0
- package/framework-mcp/dist/src/cli/commands/log.js +10 -0
- package/framework-mcp/dist/src/cli/commands/memory.js +4 -0
- package/framework-mcp/dist/src/cli/commands/orchestrate.js +159 -0
- package/framework-mcp/dist/src/cli/commands/plan.js +117 -0
- package/framework-mcp/dist/src/cli/commands/script.js +19 -0
- package/framework-mcp/dist/src/cli/commands/security.js +36 -0
- package/framework-mcp/dist/src/cli/commands/status.js +97 -0
- package/framework-mcp/dist/src/cli/commands/trace.js +109 -0
- package/framework-mcp/dist/src/cli/index.js +338 -0
- package/framework-mcp/dist/src/cli/shims.js +66 -0
- package/framework-mcp/dist/src/cli/utils/claude.js +56 -0
- package/framework-mcp/dist/src/cli/utils/compliance.js +173 -0
- package/framework-mcp/dist/src/cli/utils/config-schema.js +42 -0
- package/framework-mcp/dist/src/cli/utils/fs.js +137 -0
- package/framework-mcp/dist/src/cli/utils/i18n.js +30 -0
- package/framework-mcp/dist/src/cli/utils/memory.js +276 -0
- package/framework-mcp/dist/src/cli/utils/pkg.js +282 -0
- package/framework-mcp/dist/src/cli/utils/schemas.js +19 -0
- package/framework-mcp/dist/src/cli/utils/string.js +49 -0
- package/framework-mcp/dist/src/cli/utils/time.js +27 -0
- package/framework-mcp/dist/src/cli/utils/ui.js +58 -0
- package/framework-mcp/dist/src/contracts/index.js +1 -0
- package/framework-mcp/dist/src/contracts/tasks.js +20 -0
- package/framework-mcp/dist/src/dashboard/vite.config.js +15 -0
- package/framework-mcp/dist/src/modules/adapters/definitions.js +140 -0
- package/framework-mcp/dist/src/modules/adapters/registry.js +18 -0
- package/framework-mcp/dist/src/modules/adapters/shared.js +104 -0
- package/framework-mcp/dist/src/modules/adapters/types.js +1 -0
- package/framework-mcp/dist/src/modules/agents/definitions.js +457 -0
- package/framework-mcp/dist/src/modules/agents/registry/analyst.js +39 -0
- package/framework-mcp/dist/src/modules/agents/registry/architect.js +42 -0
- package/framework-mcp/dist/src/modules/agents/registry/backend.js +49 -0
- package/framework-mcp/dist/src/modules/agents/registry/database.js +45 -0
- package/framework-mcp/dist/src/modules/agents/registry/devops.js +45 -0
- package/framework-mcp/dist/src/modules/agents/registry/explorer.js +36 -0
- package/framework-mcp/dist/src/modules/agents/registry/frontend.js +51 -0
- package/framework-mcp/dist/src/modules/agents/registry/git.js +36 -0
- package/framework-mcp/dist/src/modules/agents/registry/manager.js +53 -0
- package/framework-mcp/dist/src/modules/agents/registry/mobile.js +39 -0
- package/framework-mcp/dist/src/modules/agents/registry/native.js +39 -0
- package/framework-mcp/dist/src/modules/agents/registry/quality.js +41 -0
- package/framework-mcp/dist/src/modules/agents/registry/security.js +43 -0
- package/framework-mcp/dist/src/modules/agents/types.js +1 -0
- package/framework-mcp/dist/src/modules/engines/evaluation-engine.js +102 -0
- package/framework-mcp/dist/src/modules/engines/health-engine.js +49 -0
- package/framework-mcp/dist/src/modules/engines/planning-engine.js +78 -0
- package/framework-mcp/dist/src/modules/engines/risk-engine.js +105 -0
- package/framework-mcp/dist/src/modules/engines/routing-engine.js +73 -0
- package/framework-mcp/dist/src/modules/engines/types.js +1 -0
- package/framework-mcp/dist/src/modules/skills/definitions.js +70 -0
- package/framework-mcp/dist/src/shared/constants.js +187 -0
- package/framework-mcp/dist/src/shared/errors.js +68 -0
- package/framework-mcp/dist/src/shared/fs.js +51 -0
- package/framework-mcp/dist/src/shared/logger.js +116 -0
- package/framework-mcp/dist/src/shared/storage.js +207 -0
- package/framework-mcp/dist/src/shared/types.js +12 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +82 -0
- package/framework-mcp/dist/tools/control_plane/registry.js +35 -0
- package/framework-mcp/dist/tools/definitions.js +322 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +64 -0
- package/framework-mcp/dist/tools/file_system/patch_file.js +34 -0
- package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +50 -0
- package/framework-mcp/dist/tools/file_system/write_file.js +43 -0
- package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/tools/framework/run_tests.js +27 -0
- package/framework-mcp/dist/tools/framework/submit_plan.js +13 -0
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/tools/index.js +62 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +94 -0
- package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/tools/quality/check_lint.js +30 -0
- package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/tools/search/grep_search.js +75 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/tools/shell/run_command.js +56 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/dist/utils/cli.js +59 -0
- package/framework-mcp/dist/utils/compliance.js +231 -0
- package/framework-mcp/dist/utils/fs.js +44 -0
- package/framework-mcp/dist/utils/metrics.js +56 -0
- package/framework-mcp/dist/utils/permissions.js +71 -0
- package/framework-mcp/dist/utils/security.js +60 -0
- package/framework-mcp/package.json +35 -0
- package/mcp.json +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { writeJsonFile, writeTextFile } from "./fs.js";
|
|
4
|
+
export function getPackageVersion() {
|
|
5
|
+
const root = getPackageRoot();
|
|
6
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
7
|
+
return pkg.version;
|
|
8
|
+
}
|
|
9
|
+
export function getPackageManager() {
|
|
10
|
+
const override = process.env.AGENT_ATABEY_PACKAGE_MANAGER || process.env.AGENT_ATABEY_PM || process.env.AI_ATABEY_PACKAGE_MANAGER || process.env.AI_ATABEY_PM;
|
|
11
|
+
if (override)
|
|
12
|
+
return override.toLowerCase();
|
|
13
|
+
const userAgent = process.env.npm_config_user_agent || "";
|
|
14
|
+
const npmExecPath = process.env.npm_execpath || "";
|
|
15
|
+
if (userAgent.includes("pnpm") || npmExecPath.includes("pnpm"))
|
|
16
|
+
return "pnpm";
|
|
17
|
+
if (userAgent.includes("yarn") || npmExecPath.includes("yarn"))
|
|
18
|
+
return "yarn";
|
|
19
|
+
// Check for lockfiles in target directory
|
|
20
|
+
if (fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml")) || fs.existsSync(path.join(process.cwd(), "pnpm-workspace.yaml")))
|
|
21
|
+
return "pnpm";
|
|
22
|
+
if (fs.existsSync(path.join(process.cwd(), "yarn.lock")))
|
|
23
|
+
return "yarn";
|
|
24
|
+
return "npm";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Robustly locates the atabey package root from the currently executing module (src via tsx or bin).
|
|
28
|
+
* Walks up from import.meta.url until it finds package.json with name === "atabey".
|
|
29
|
+
* This ensures getValidatorPath() and getPackageVersion() work correctly both in source tree
|
|
30
|
+
* AND when the package is consumed from node_modules after `npm install atabey` (global or local).
|
|
31
|
+
* Critical for AL validation (validate-agent-army) and cross-adapter inits to work from npm.
|
|
32
|
+
*/
|
|
33
|
+
function findAgentAtabeyPackageRoot() {
|
|
34
|
+
let current = path.dirname(new URL(import.meta.url).pathname);
|
|
35
|
+
const root = path.parse(current).root;
|
|
36
|
+
while (current !== root) {
|
|
37
|
+
if (path.basename(current) === "dist") {
|
|
38
|
+
current = path.dirname(current);
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const pkgPath = path.join(current, "package.json");
|
|
42
|
+
if (fs.existsSync(pkgPath)) {
|
|
43
|
+
try {
|
|
44
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
45
|
+
if (pkg.name === "atabey") {
|
|
46
|
+
return current;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// ignore parse errors on intermediate package.jsons (e.g. user's project), continue
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
current = path.dirname(current);
|
|
54
|
+
}
|
|
55
|
+
// Fallback maintains prior behavior for unusual layouts
|
|
56
|
+
const __filenameLocal = new URL(import.meta.url).pathname;
|
|
57
|
+
const __dirnameLocal = path.dirname(__filenameLocal);
|
|
58
|
+
return path.join(__dirnameLocal, "../../..");
|
|
59
|
+
}
|
|
60
|
+
export function getPackageRoot() {
|
|
61
|
+
return findAgentAtabeyPackageRoot();
|
|
62
|
+
}
|
|
63
|
+
export function getValidatorPath() {
|
|
64
|
+
return path.join(getPackageRoot(), "bin", "validate-agent-army.js");
|
|
65
|
+
}
|
|
66
|
+
export function getDependencyVersions() {
|
|
67
|
+
const root = getPackageRoot();
|
|
68
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
|
|
69
|
+
const devDependencies = pkg.devDependencies || {};
|
|
70
|
+
const dependencies = pkg.dependencies || {};
|
|
71
|
+
return {
|
|
72
|
+
// ── Backend Core ──────────────────────────────────────────
|
|
73
|
+
"fastify": dependencies["fastify"] || "^5.0.0",
|
|
74
|
+
"@fastify/cors": dependencies["@fastify/cors"] || "^11.0.0",
|
|
75
|
+
"@fastify/swagger": dependencies["@fastify/swagger"] || "^9.0.0",
|
|
76
|
+
"@fastify/swagger-ui": dependencies["@fastify/swagger-ui"] || "^5.0.0",
|
|
77
|
+
"@fastify/rate-limit": dependencies["@fastify/rate-limit"] || "^10.0.0",
|
|
78
|
+
"@fastify/static": dependencies["@fastify/static"] || "^8.0.0",
|
|
79
|
+
"zod": dependencies["zod"] || "^3.24.2",
|
|
80
|
+
// ── Database / ORM ────────────────────────────────────────
|
|
81
|
+
"kysely": dependencies["kysely"] || "^0.27.0",
|
|
82
|
+
"typeorm": dependencies["typeorm"] || "^0.3.0",
|
|
83
|
+
"reflect-metadata": dependencies["reflect-metadata"] || "^0.2.0",
|
|
84
|
+
"pg": dependencies["pg"] || "^8.13.0",
|
|
85
|
+
"better-sqlite3": dependencies["better-sqlite3"] || "^11.0.0",
|
|
86
|
+
// ── Authentication ────────────────────────────────────────
|
|
87
|
+
"bcrypt": dependencies["bcrypt"] || "^5.1.0",
|
|
88
|
+
"@types/bcrypt": devDependencies["@types/bcrypt"] || "^5.0.0",
|
|
89
|
+
"jsonwebtoken": dependencies["jsonwebtoken"] || "^9.0.0",
|
|
90
|
+
"@types/jsonwebtoken": devDependencies["@types/jsonwebtoken"] || "^9.0.0",
|
|
91
|
+
// ── Logging ───────────────────────────────────────────────
|
|
92
|
+
"pino": dependencies["pino"] || "^9.0.0",
|
|
93
|
+
"pino-pretty": devDependencies["pino-pretty"] || "^12.0.0",
|
|
94
|
+
// ── Validation ────────────────────────────────────────────
|
|
95
|
+
"@fastify/type-provider-typebox": dependencies["@fastify/type-provider-typebox"] || "^5.0.0",
|
|
96
|
+
// Backend devDependencies
|
|
97
|
+
"@types/node": devDependencies["@types/node"] || "^22.13.4",
|
|
98
|
+
"tsx": devDependencies["tsx"] || "^4.19.4",
|
|
99
|
+
"typescript": devDependencies["typescript"] || "^5.9.3",
|
|
100
|
+
"vitest-backend": devDependencies["vitest"] || "^3.0.5",
|
|
101
|
+
// ── Frontend Core ─────────────────────────────────────────
|
|
102
|
+
"@vitejs/plugin-react": dependencies["@vitejs/plugin-react"] || "^5.0.0",
|
|
103
|
+
"vite": dependencies["vite"] || "^7.0.0",
|
|
104
|
+
"react": dependencies["react"] || "^19.0.0",
|
|
105
|
+
"react-dom": dependencies["react-dom"] || "^19.0.0",
|
|
106
|
+
"lucide-react": dependencies["lucide-react"] || "^0.468.0",
|
|
107
|
+
"react-router-dom": dependencies["react-router-dom"] || "^7.0.0",
|
|
108
|
+
"@tanstack/react-query": dependencies["@tanstack/react-query"] || "^5.0.0",
|
|
109
|
+
// Frontend devDependencies
|
|
110
|
+
"@types/react": devDependencies["@types/react"] || "^19.0.0",
|
|
111
|
+
"@types/react-dom": devDependencies["@types/react-dom"] || "^19.0.0",
|
|
112
|
+
"vitest-frontend": devDependencies["vitest"] || "^3.0.5",
|
|
113
|
+
// ── Testing ───────────────────────────────────────────────
|
|
114
|
+
"@playwright/test": devDependencies["@playwright/test"] || "^1.50.0",
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function mergePackageJson(targetPath, sourcePath) {
|
|
118
|
+
let targetPkg = {};
|
|
119
|
+
if (fs.existsSync(targetPath)) {
|
|
120
|
+
try {
|
|
121
|
+
targetPkg = JSON.parse(fs.readFileSync(targetPath, "utf8"));
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
console.warn("[WARN] Could not parse existing package.json, creating a new one.");
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const sourcePkg = JSON.parse(fs.readFileSync(sourcePath, "utf8"));
|
|
128
|
+
const sanitizeDeps = (deps) => {
|
|
129
|
+
if (!deps)
|
|
130
|
+
return deps;
|
|
131
|
+
const cleaned = {};
|
|
132
|
+
for (const [name, version] of Object.entries(deps)) {
|
|
133
|
+
cleaned[name] = (typeof version === "string" && version.startsWith("workspace:")) ? "*" : String(version || "");
|
|
134
|
+
}
|
|
135
|
+
return cleaned;
|
|
136
|
+
};
|
|
137
|
+
const actualTargetScope = targetPkg.name && targetPkg.name.startsWith("@")
|
|
138
|
+
? targetPkg.name.split("/")[0]
|
|
139
|
+
: (targetPkg.name ? `@${targetPkg.name}` : "");
|
|
140
|
+
// Cleanup potential leftovers from previous bugged runs where atabey was renamed to target name
|
|
141
|
+
if (actualTargetScope) {
|
|
142
|
+
const scopeName = actualTargetScope.startsWith("@") ? actualTargetScope.slice(1) : actualTargetScope;
|
|
143
|
+
const cleanup = (obj) => {
|
|
144
|
+
if (!obj)
|
|
145
|
+
return;
|
|
146
|
+
delete obj[scopeName];
|
|
147
|
+
delete obj[actualTargetScope];
|
|
148
|
+
delete obj["atabey"]; // Will be re-added correctly
|
|
149
|
+
};
|
|
150
|
+
cleanup(targetPkg.devDependencies);
|
|
151
|
+
cleanup(targetPkg.dependencies);
|
|
152
|
+
}
|
|
153
|
+
targetPkg.dependencies = sanitizeDeps({
|
|
154
|
+
...targetPkg.dependencies,
|
|
155
|
+
...sourcePkg.dependencies
|
|
156
|
+
});
|
|
157
|
+
// Merge scripts
|
|
158
|
+
const pkgMgr = getPackageManager();
|
|
159
|
+
const runCmd = pkgMgr === "yarn" ? "yarn" : (pkgMgr === "pnpm" ? "pnpm" : "npm run");
|
|
160
|
+
targetPkg.scripts = {
|
|
161
|
+
...targetPkg.scripts,
|
|
162
|
+
"atabey:status": "atabey status",
|
|
163
|
+
"atabey:trace": "atabey trace:new",
|
|
164
|
+
"atabey:verify": "atabey verify-contract",
|
|
165
|
+
"atabey:check": "atabey check",
|
|
166
|
+
"atabey:test": "vitest run",
|
|
167
|
+
"atabey:test:watch": "vitest",
|
|
168
|
+
"atabey:build": `${runCmd} build --prefix framework-mcp`,
|
|
169
|
+
};
|
|
170
|
+
const sourceDevDeps = sourcePkg.devDependencies || {};
|
|
171
|
+
targetPkg.devDependencies = sanitizeDeps({
|
|
172
|
+
...targetPkg.devDependencies,
|
|
173
|
+
"atabey": `^${sourcePkg.version}`,
|
|
174
|
+
...(sourceDevDeps["@modelcontextprotocol/sdk"] ? { "@modelcontextprotocol/sdk": sourceDevDeps["@modelcontextprotocol/sdk"] } : {}),
|
|
175
|
+
...(sourceDevDeps["zod"] ? { "zod": sourceDevDeps["zod"] } : {}),
|
|
176
|
+
...(sourceDevDeps["ts-morph"] ? { "ts-morph": sourceDevDeps["ts-morph"] } : {}),
|
|
177
|
+
...(sourceDevDeps["typescript"] ? { "typescript": sourceDevDeps["typescript"] } : {}),
|
|
178
|
+
...(sourceDevDeps["@types/node"] ? { "@types/node": sourceDevDeps["@types/node"] } : {}),
|
|
179
|
+
...(sourceDevDeps["tsx"] ? { "tsx": sourceDevDeps["tsx"] } : {}),
|
|
180
|
+
...(sourceDevDeps["vitest"] ? { "vitest": sourceDevDeps["vitest"] } : {}),
|
|
181
|
+
"@pandacss/dev": sourceDevDeps["@pandacss/dev"] || "^1.11.1"
|
|
182
|
+
});
|
|
183
|
+
if (targetPkg.peerDependencies) {
|
|
184
|
+
targetPkg.peerDependencies = sanitizeDeps(targetPkg.peerDependencies);
|
|
185
|
+
}
|
|
186
|
+
if (targetPkg.optionalDependencies) {
|
|
187
|
+
targetPkg.optionalDependencies = sanitizeDeps(targetPkg.optionalDependencies);
|
|
188
|
+
}
|
|
189
|
+
// Ensure basic fields
|
|
190
|
+
if (!targetPkg.name)
|
|
191
|
+
targetPkg.name = path.basename(process.cwd());
|
|
192
|
+
if (!targetPkg.version)
|
|
193
|
+
targetPkg.version = "0.1.0";
|
|
194
|
+
if (!targetPkg.type)
|
|
195
|
+
targetPkg.type = "module";
|
|
196
|
+
if (!targetPkg.workspaces)
|
|
197
|
+
targetPkg.workspaces = ["framework-mcp"];
|
|
198
|
+
// Add metadata
|
|
199
|
+
targetPkg.atabey = {
|
|
200
|
+
version: sourcePkg.version || "0.0.0",
|
|
201
|
+
initializedAt: new Date().toISOString(),
|
|
202
|
+
};
|
|
203
|
+
writeJsonFile(targetPath, targetPkg);
|
|
204
|
+
console.warn("[OK] package.json updated with Atabey scripts and dependencies.");
|
|
205
|
+
}
|
|
206
|
+
export function sanitizeJson(obj, targetScope = "") {
|
|
207
|
+
if (typeof obj !== "object" || obj === null)
|
|
208
|
+
return obj;
|
|
209
|
+
if (Array.isArray(obj))
|
|
210
|
+
return obj.map(item => sanitizeJson(item, targetScope));
|
|
211
|
+
const cleaned = {};
|
|
212
|
+
const record = obj;
|
|
213
|
+
for (const [key, value] of Object.entries(record)) {
|
|
214
|
+
let finalKey = key;
|
|
215
|
+
let finalValue = value;
|
|
216
|
+
// Remove UnoCSS related keys or values
|
|
217
|
+
if (typeof key === "string" && key.includes("unocss"))
|
|
218
|
+
continue;
|
|
219
|
+
if (typeof value === "string" && value.includes("unocss")) {
|
|
220
|
+
continue; // Skip this script/field
|
|
221
|
+
}
|
|
222
|
+
// Replace scope if needed
|
|
223
|
+
if (targetScope) {
|
|
224
|
+
const scopeName = targetScope.startsWith("@") ? targetScope.slice(1) : targetScope;
|
|
225
|
+
// Handle scoped: @atabey/foo -> @target/foo
|
|
226
|
+
if (typeof key === "string" && key.startsWith("@atabey/")) {
|
|
227
|
+
finalKey = key.replace("@atabey/", `${targetScope}/`);
|
|
228
|
+
}
|
|
229
|
+
if (typeof value === "string" && value.startsWith("@atabey/")) {
|
|
230
|
+
finalValue = value.replace("@atabey/", `${targetScope}/`);
|
|
231
|
+
}
|
|
232
|
+
// Handle unscoped: atabey-foo -> target-foo
|
|
233
|
+
if (typeof key === "string" && key.startsWith("atabey-")) {
|
|
234
|
+
finalKey = key.replace("atabey-", `${scopeName}-`);
|
|
235
|
+
}
|
|
236
|
+
if (typeof value === "string" && value.startsWith("atabey-")) {
|
|
237
|
+
finalValue = value.replace("atabey-", `${scopeName}-`);
|
|
238
|
+
}
|
|
239
|
+
// Handle atabey -> target (ONLY for the package name)
|
|
240
|
+
if (key === "name" && value === "atabey") {
|
|
241
|
+
finalValue = scopeName;
|
|
242
|
+
}
|
|
243
|
+
// Preserve atabey in dependencies and bin
|
|
244
|
+
// (No action needed as finalKey/finalValue default to original)
|
|
245
|
+
if (typeof value === "string" && value.startsWith("workspace:")) {
|
|
246
|
+
finalValue = "*";
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else if (typeof value === "string" && value.startsWith("workspace:")) {
|
|
250
|
+
finalValue = "*";
|
|
251
|
+
}
|
|
252
|
+
cleaned[finalKey] = (typeof finalValue === "object" && finalValue !== null) ? sanitizeJson(finalValue, targetScope) : finalValue;
|
|
253
|
+
}
|
|
254
|
+
return cleaned;
|
|
255
|
+
}
|
|
256
|
+
export function deepCleanProtocols(dir, targetScope = "") {
|
|
257
|
+
if (!fs.existsSync(dir))
|
|
258
|
+
return;
|
|
259
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
260
|
+
for (const entry of entries) {
|
|
261
|
+
const fullPath = path.join(dir, entry.name);
|
|
262
|
+
if (entry.isDirectory()) {
|
|
263
|
+
if (entry.name === "node_modules" || entry.name === ".git")
|
|
264
|
+
continue;
|
|
265
|
+
deepCleanProtocols(fullPath, targetScope);
|
|
266
|
+
}
|
|
267
|
+
else if (entry.name === "package.json") {
|
|
268
|
+
try {
|
|
269
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
270
|
+
const json = JSON.parse(content);
|
|
271
|
+
const cleaned = JSON.stringify(sanitizeJson(json, targetScope), null, 2);
|
|
272
|
+
writeTextFile(fullPath, cleaned);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
// ignore malformed json
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else if (entry.name === "package-lock.json") {
|
|
279
|
+
fs.unlinkSync(fullPath);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const StateSchema = z.object({
|
|
3
|
+
phase: z.string(),
|
|
4
|
+
traceId: z.string(),
|
|
5
|
+
managerState: z.enum(["ACTIVE", "IDLE", "PAUSED"]),
|
|
6
|
+
});
|
|
7
|
+
export const AgentStatusSchema = z.record(z.object({
|
|
8
|
+
state: z.enum(["READY", "EXECUTING", "BLOCKED", "TIMEOUT", "WAITING", "IDLE"]),
|
|
9
|
+
task: z.string(),
|
|
10
|
+
lastUpdated: z.string().optional(),
|
|
11
|
+
}));
|
|
12
|
+
export const TaskSchema = z.object({
|
|
13
|
+
traceId: z.string(),
|
|
14
|
+
description: z.string(),
|
|
15
|
+
agent: z.string(),
|
|
16
|
+
priority: z.enum(["P1", "P2", "P3", "HIGH", "NORMAL", "LOW"]),
|
|
17
|
+
status: z.enum(["PENDING", "IN_PROGRESS", "APPROVED", "COMPLETED"]),
|
|
18
|
+
createdAt: z.string(),
|
|
19
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function insertTaskRow(memoryContent, row) {
|
|
2
|
+
const sectionHeader = "## ACTIVE TASKS";
|
|
3
|
+
const tableDivider = "| :--- | :--- | :--- | :--- | :--- |";
|
|
4
|
+
const sectionIndex = memoryContent.indexOf(sectionHeader);
|
|
5
|
+
if (sectionIndex === -1)
|
|
6
|
+
return null;
|
|
7
|
+
const dividerIndex = memoryContent.indexOf(tableDivider, sectionIndex);
|
|
8
|
+
if (dividerIndex === -1)
|
|
9
|
+
return null;
|
|
10
|
+
const dividerLineEnd = memoryContent.indexOf("\n", dividerIndex);
|
|
11
|
+
if (dividerLineEnd === -1)
|
|
12
|
+
return null;
|
|
13
|
+
return (memoryContent.slice(0, dividerLineEnd + 1) +
|
|
14
|
+
`${row}\n` +
|
|
15
|
+
memoryContent.slice(dividerLineEnd + 1));
|
|
16
|
+
}
|
|
17
|
+
export function sanitizeInput(input) {
|
|
18
|
+
return String(input)
|
|
19
|
+
.replace(/\\/g, "\\\\")
|
|
20
|
+
.replace(/"/g, "\\\"")
|
|
21
|
+
.replace(/[\r\n]+/g, " ")
|
|
22
|
+
.replace(/<script\b[^>]*>([\s\S]*?)<\/script>/gim, "")
|
|
23
|
+
.replace(/--/g, "-")
|
|
24
|
+
.trim();
|
|
25
|
+
}
|
|
26
|
+
export function sanitizeTableCell(value) {
|
|
27
|
+
return sanitizeInput(String(value)).replace(/\|/g, "\\|");
|
|
28
|
+
}
|
|
29
|
+
export function normalizeAgentName(agent) {
|
|
30
|
+
return String(agent || "manager").replace(/^@+/, "").trim() || "manager";
|
|
31
|
+
}
|
|
32
|
+
export function normalizePriority(priority) {
|
|
33
|
+
const normalized = String(priority || "P2").toUpperCase().trim();
|
|
34
|
+
return /^P[0-3]$/.test(normalized) ? normalized : "P2";
|
|
35
|
+
}
|
|
36
|
+
export function slugifyName(value) {
|
|
37
|
+
const slug = String(value || "atabey-app")
|
|
38
|
+
.toLowerCase()
|
|
39
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
40
|
+
.replace(/^-+|-+$/g, "");
|
|
41
|
+
return slug || "atabey-app";
|
|
42
|
+
}
|
|
43
|
+
export function titleCase(value) {
|
|
44
|
+
return String(value || "Atabey App")
|
|
45
|
+
.replace(/[-_]+/g, " ")
|
|
46
|
+
.replace(/\s+/g, " ")
|
|
47
|
+
.trim()
|
|
48
|
+
.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
49
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function generateULID(seedTime = Date.now(), seed) {
|
|
2
|
+
const ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
3
|
+
const ENCODING_LEN = ENCODING.length;
|
|
4
|
+
let time = seedTime;
|
|
5
|
+
const timeChars = new Array(10);
|
|
6
|
+
for (let i = 9; i >= 0; i--) {
|
|
7
|
+
timeChars[i] = ENCODING.charAt(time % ENCODING_LEN);
|
|
8
|
+
time = Math.floor(time / ENCODING_LEN);
|
|
9
|
+
}
|
|
10
|
+
const randomChars = new Array(16);
|
|
11
|
+
if (seed) {
|
|
12
|
+
let pseudoRandom = seed;
|
|
13
|
+
for (let i = 0; i < 16; i++) {
|
|
14
|
+
pseudoRandom = (pseudoRandom * 16807) % 2147483647;
|
|
15
|
+
randomChars[i] = ENCODING.charAt(pseudoRandom % ENCODING_LEN);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
for (let i = 0; i < 16; i++) {
|
|
20
|
+
randomChars[i] = ENCODING.charAt(Math.floor(Math.random() * ENCODING_LEN));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return timeChars.join("") + randomChars.join("");
|
|
24
|
+
}
|
|
25
|
+
export function sleep(ms) {
|
|
26
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
27
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
/**
|
|
3
|
+
* Professional UI Utilities for Agent Atabey CLI.
|
|
4
|
+
* Standardizes headers, status boxes, and strategic intent reporting.
|
|
5
|
+
*/
|
|
6
|
+
export const UI = {
|
|
7
|
+
/**
|
|
8
|
+
* Renders a strategic intent block similar to Gemini CLI's topic updates.
|
|
9
|
+
*/
|
|
10
|
+
intent: (title, intent) => {
|
|
11
|
+
process.stdout.write(`\n${chalk.bold.cyan(title)}:\n`);
|
|
12
|
+
process.stdout.write(`${chalk.italic.gray(` ${intent}`)}\n\n`);
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* Renders a professional agent execution box.
|
|
16
|
+
*/
|
|
17
|
+
agentBox: (agentName, action, details) => {
|
|
18
|
+
const width = process.stdout.columns || 80;
|
|
19
|
+
const line = "─".repeat(Math.max(0, width - 2));
|
|
20
|
+
process.stdout.write(chalk.gray(`╭${line}╮`) + "\n");
|
|
21
|
+
const padding = Math.max(0, width - agentName.length - 27);
|
|
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
|
+
if (action) {
|
|
24
|
+
const paddingAction = Math.max(0, width - action.length - 6);
|
|
25
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.blue("!")} ${chalk.cyan(action)} ${" ".repeat(paddingAction)} ${chalk.gray("│")}\n`);
|
|
26
|
+
}
|
|
27
|
+
if (details) {
|
|
28
|
+
const paddingDetails = Math.max(0, width - details.length - 7);
|
|
29
|
+
process.stdout.write(`${chalk.gray("│")} ${chalk.gray(details.slice(0, width - 10))} ${" ".repeat(paddingDetails)} ${chalk.gray("│")}\n`);
|
|
30
|
+
}
|
|
31
|
+
process.stdout.write(chalk.gray(`╰${line}╯`) + "\n");
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Renders a success status message.
|
|
35
|
+
*/
|
|
36
|
+
success: (msg) => {
|
|
37
|
+
process.stdout.write(`${chalk.bold.green("[OK]")} ${msg}\n`);
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Renders an error status message.
|
|
41
|
+
*/
|
|
42
|
+
error: (msg) => {
|
|
43
|
+
process.stderr.write(`${chalk.bold.red("[ERROR]")} ${chalk.red(msg)}\n`);
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Renders a warning status message.
|
|
47
|
+
*/
|
|
48
|
+
warning: (msg) => {
|
|
49
|
+
process.stdout.write(`${chalk.bold.yellow("[WARN]")} ${chalk.yellow(msg)}\n`);
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Renders an info/divider line.
|
|
53
|
+
*/
|
|
54
|
+
divider: () => {
|
|
55
|
+
const width = process.stdout.columns || 80;
|
|
56
|
+
process.stdout.write(chalk.gray("─".repeat(width)) + "\n");
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tasks.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Standard request contract sent to an agent.
|
|
4
|
+
*/
|
|
5
|
+
export const TaskRequestSchema = z.object({
|
|
6
|
+
traceId: z.string(),
|
|
7
|
+
task: z.string(),
|
|
8
|
+
priority: z.enum(["P1", "P2", "P3", "HIGH", "NORMAL", "LOW"]),
|
|
9
|
+
agent: z.string(),
|
|
10
|
+
context: z.record(z.unknown()).optional(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Standard response contract sent back by an agent.
|
|
14
|
+
*/
|
|
15
|
+
export const TaskResponseSchema = z.object({
|
|
16
|
+
traceId: z.string(),
|
|
17
|
+
status: z.enum(["SUCCESS", "FAILED", "RETRY", "WAITING_FOR_APPROVAL"]),
|
|
18
|
+
message: z.string().optional(),
|
|
19
|
+
errorCode: z.string().optional(),
|
|
20
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
plugins: [react()],
|
|
5
|
+
build: {
|
|
6
|
+
outDir: "../../dist/ui",
|
|
7
|
+
emptyOutDir: true,
|
|
8
|
+
},
|
|
9
|
+
server: {
|
|
10
|
+
port: 3000,
|
|
11
|
+
proxy: {
|
|
12
|
+
"/api": "http://localhost:4200"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { addMcpServerToClaude, findClaudeConfigPath } from "../../cli/utils/claude.js";
|
|
3
|
+
import { writeJsonFile } from "../../shared/fs.js";
|
|
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] 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: ".atabey",
|
|
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
|
+
// [START] 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: ".atabey",
|
|
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["atabey"];
|
|
41
|
+
const ok = addMcpServerToClaude(configPath, "atabey", 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
|
+
// [AI] 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: ".atabey",
|
|
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] 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: ".atabey",
|
|
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
|
+
// [TIP] 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: ".atabey",
|
|
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] Local LLM (Ollama / Private AI)
|
|
101
|
+
registry.register({
|
|
102
|
+
id: "local",
|
|
103
|
+
frameworkDir: ".atabey",
|
|
104
|
+
shimFile: "LOCAL_AI.md",
|
|
105
|
+
shimTemplate: "src/cli/shims/local.md",
|
|
106
|
+
role: "commander",
|
|
107
|
+
templateDir: ".atabey",
|
|
108
|
+
nestedDirs: ["agents", "rules"],
|
|
109
|
+
agentsDir: ".atabey/agents",
|
|
110
|
+
agentsExt: ".md"
|
|
111
|
+
}, (projectRoot, mcpBlock) => {
|
|
112
|
+
const frameworkDir = ".atabey";
|
|
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] Antigravity
|
|
117
|
+
registry.register({
|
|
118
|
+
id: "antigravity-cli",
|
|
119
|
+
frameworkDir: ".agents",
|
|
120
|
+
shimFile: "AGENTS.md",
|
|
121
|
+
shimTemplate: "src/cli/shims/antigravity-cli.md",
|
|
122
|
+
role: "general",
|
|
123
|
+
templateDir: ".atabey",
|
|
124
|
+
nestedDirs: ["agents", "plugins", "rules"],
|
|
125
|
+
agentsDir: ".agents/agents",
|
|
126
|
+
agentsExt: ".md"
|
|
127
|
+
}, (projectRoot, mcpBlock) => {
|
|
128
|
+
const frameworkDir = ".agents";
|
|
129
|
+
writeJsonFile(path.join(projectRoot, frameworkDir, "mcp_config.json"), mcpBlock);
|
|
130
|
+
UI.success(`Antigravity CLI MCP → ${frameworkDir}/mcp_config.json`);
|
|
131
|
+
registerGlobalAntigravityPlugins(mcpBlock);
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Mapped Adapter Configurations
|
|
135
|
+
*/
|
|
136
|
+
export const ADAPTER_CONFIGS = registry.getConfigs();
|
|
137
|
+
/**
|
|
138
|
+
* Post-Initialization Handlers for specific adapters
|
|
139
|
+
*/
|
|
140
|
+
export const POST_INIT_HANDLERS = registry.getHandlers();
|
|
@@ -0,0 +1,18 @@
|
|
|
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();
|