agent-enderun 1.10.4 → 1.11.1
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 +34 -45
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +1 -1
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -1
- package/dist/src/cli/adapters/core.d.ts +1 -1
- package/dist/src/cli/adapters/core.js +0 -1
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/index.d.ts +1 -0
- package/dist/src/cli/adapters/index.js +1 -0
- package/dist/src/cli/adapters/index.js.map +1 -1
- package/dist/src/cli/adapters/scaffold.d.ts +1 -1
- package/dist/src/cli/adapters/scaffold.js +13 -7
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +5 -2
- package/dist/src/cli/commands/init/scaffold-core.js +28 -6
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init.js +31 -4
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +9 -7
- package/dist/src/cli/commands/orchestrate.js +40 -4
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +3 -1
- package/dist/src/cli/commands/plan.js +79 -22
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/index.js +11 -15
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +0 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/config-schema.d.ts +7 -7
- package/dist/src/cli/utils/pkg.d.ts +19 -0
- package/dist/src/cli/utils/pkg.js +29 -5
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/modules/adapters/definitions.js +1 -1
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/adapters/shared.js +7 -4
- package/dist/src/modules/adapters/shared.js.map +1 -1
- package/dist/src/modules/agents/definitions.d.ts +1 -1
- package/dist/src/modules/agents/definitions.js +129 -69
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +5 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +5 -4
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +2 -1
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +2 -0
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/explorer.js +1 -0
- package/dist/src/modules/agents/registry/explorer.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js +3 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +8 -2
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/native.js +5 -1
- package/dist/src/modules/agents/registry/native.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +1 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/shared/constants.d.ts +1 -1
- package/dist/src/shared/constants.js +10 -9
- package/dist/src/shared/constants.js.map +1 -1
- package/dist/tests/approve.test.js +4 -9
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/integration/agent_flow.test.js +2 -2
- package/dist/tests/integration/agent_flow.test.js.map +1 -1
- package/dist/tests/orchestrate.test.js +2 -7
- package/dist/tests/orchestrate.test.js.map +1 -1
- package/framework-mcp/dist/constants.js +64 -0
- package/framework-mcp/dist/index.js +109 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +64 -0
- package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
- package/framework-mcp/dist/tools/dashboard/start_dashboard.js +29 -0
- package/framework-mcp/dist/tools/definitions.js +300 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +59 -0
- package/framework-mcp/dist/tools/file_system/patch_file.js +25 -0
- package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +43 -0
- package/framework-mcp/dist/tools/file_system/write_file.js +38 -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 +25 -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 +87 -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 +28 -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 +76 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/tools/shell/run_command.js +46 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/dist/utils/cli.js +20 -0
- package/framework-mcp/dist/utils/compliance.js +29 -0
- package/framework-mcp/dist/utils/fs.js +44 -0
- package/framework-mcp/dist/utils/metrics.js +56 -0
- package/framework-mcp/dist/utils/security.js +60 -0
- package/framework-mcp/package.json +19 -0
- package/framework-mcp/src/constants.ts +78 -0
- package/framework-mcp/src/declarations.d.ts +17 -0
- package/framework-mcp/src/index.ts +132 -0
- package/framework-mcp/src/tools/control_plane/locking.ts +71 -0
- package/framework-mcp/src/tools/control_plane/registry.ts +38 -0
- package/framework-mcp/src/tools/dashboard/start_dashboard.ts +33 -0
- package/framework-mcp/src/tools/definitions.ts +302 -0
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +79 -0
- package/framework-mcp/src/tools/file_system/patch_file.ts +33 -0
- package/framework-mcp/src/tools/file_system/read_file.ts +58 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +52 -0
- package/framework-mcp/src/tools/file_system/write_file.ts +45 -0
- package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
- package/framework-mcp/src/tools/framework/get_status.ts +7 -0
- package/framework-mcp/src/tools/framework/orchestrate.ts +7 -0
- package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +7 -0
- package/framework-mcp/src/tools/framework/update_memory.ts +10 -0
- package/framework-mcp/src/tools/index.ts +66 -0
- package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
- package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
- package/framework-mcp/src/tools/messaging/log_action.ts +28 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +89 -0
- package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
- package/framework-mcp/src/tools/observability/get_health.ts +24 -0
- package/framework-mcp/src/tools/quality/check_lint.ts +33 -0
- package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
- package/framework-mcp/src/tools/search/get_map.ts +48 -0
- package/framework-mcp/src/tools/search/grep_search.ts +76 -0
- package/framework-mcp/src/tools/search/list_dir.ts +34 -0
- package/framework-mcp/src/tools/shell/run_command.ts +56 -0
- package/framework-mcp/src/tools/types.ts +89 -0
- package/framework-mcp/src/utils/cli.ts +20 -0
- package/framework-mcp/src/utils/compliance.ts +37 -0
- package/framework-mcp/src/utils/fs.ts +45 -0
- package/framework-mcp/src/utils/metrics.ts +73 -0
- package/framework-mcp/src/utils/security.ts +66 -0
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +212 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +46 -0
- package/framework-mcp/tests/tools/shell/run_command.test.ts +55 -0
- package/framework-mcp/tsconfig.json +14 -0
- package/package.json +5 -3
- package/src/cli/adapters/core.ts +2 -3
- package/src/cli/adapters/index.ts +1 -0
- package/src/cli/adapters/scaffold.ts +20 -7
- package/src/cli/commands/init/scaffold-core.ts +45 -6
- package/src/cli/commands/init.ts +31 -2
- package/src/cli/commands/orchestrate.ts +41 -4
- package/src/cli/commands/plan.ts +89 -23
- package/src/cli/index.ts +14 -19
- package/src/cli/utils/compliance.ts +8 -9
- package/src/cli/utils/pkg.ts +42 -13
- package/src/modules/adapters/definitions.ts +1 -1
- package/src/modules/adapters/shared.ts +7 -4
- package/src/modules/agents/definitions.ts +140 -73
- package/src/modules/agents/registry/analyst.ts +5 -1
- package/src/modules/agents/registry/backend.ts +5 -4
- package/src/modules/agents/registry/database.ts +2 -1
- package/src/modules/agents/registry/devops.ts +2 -0
- package/src/modules/agents/registry/explorer.ts +1 -0
- package/src/modules/agents/registry/git.ts +3 -1
- package/src/modules/agents/registry/manager.ts +8 -2
- package/src/modules/agents/registry/native.ts +5 -1
- package/src/modules/agents/registry/security.ts +1 -0
- package/src/shared/constants.ts +14 -13
- package/templates/prompts/bug-fix-recipe.md +20 -0
- package/templates/prompts/contract-design-recipe.md +21 -0
- package/templates/prompts/db-management-recipe.md +25 -0
- package/templates/prompts/deployment-recipe.md +23 -0
- package/templates/prompts/new-feature-recipe.md +19 -0
- package/templates/prompts/performance-optimization-recipe.md +23 -0
- package/templates/prompts/pull-request-template.md +21 -0
- package/templates/prompts/refactoring-recipe.md +21 -0
- package/templates/prompts/security-audit-recipe.md +20 -0
- package/templates/standards/architecture-standards.md +23 -0
- package/templates/standards/auth-standards.md +125 -0
- package/templates/standards/crud-governance.md +21 -0
- package/templates/standards/deployment-standards.md +21 -0
- package/templates/standards/frontend-standards.md +37 -0
- package/templates/standards/github-actions-standards.md +43 -0
- package/templates/standards/i18n-standards.md +17 -0
- package/templates/standards/kysely-standards.md +47 -0
- package/templates/standards/llm-governance.md +15 -0
- package/templates/standards/logging-and-secrets.md +34 -0
- package/templates/standards/mobile-standards.md +23 -0
- package/templates/standards/observability-standards.md +15 -0
- package/templates/standards/performance-standards.md +15 -0
- package/templates/standards/pino-standards.md +46 -0
- package/templates/standards/playwright-standards.md +54 -0
- package/templates/standards/quality-standards.md +31 -0
- package/templates/standards/react-query-standards.md +72 -0
- package/templates/standards/react-router-standards.md +62 -0
- package/templates/standards/security-audit-standards.md +16 -0
- package/templates/standards/security-standards.md +21 -0
- package/templates/standards/swagger-standards.md +50 -0
- package/templates/standards/tailwind-standards.md +20 -0
- package/templates/standards/testing-standards.md +31 -0
- package/templates/standards/typeorm-standards.md +49 -0
- package/templates/standards/vitest-standards.md +110 -0
- package/src/cli/commands/app.ts +0 -56
- package/src/cli/utils/app-backend.ts +0 -257
- package/src/cli/utils/app-docs.ts +0 -83
- package/src/cli/utils/app-frontend.ts +0 -263
- package/src/cli/utils/app-inferrer.ts +0 -63
- package/src/cli/utils/app-mobile.ts +0 -113
- package/src/cli/utils/app-types.ts +0 -248
- package/src/cli/utils/app.ts +0 -6
package/src/cli/index.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
import {
|
|
4
|
-
import { getMemoryPath, readActiveTraceId } from "./utils/memory.js";
|
|
5
|
-
import { planCommand } from "./commands/plan.js";
|
|
6
|
-
import { initCommand } from "./commands/init.js";
|
|
3
|
+
import { approveCommand } from "./commands/approve.js";
|
|
7
4
|
import { checkCommand } from "./commands/check.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { updateApiContractCommand, verifyApiContractCommand } from "./commands/contract.js";
|
|
6
|
+
import { initCommand } from "./commands/init.js";
|
|
10
7
|
import { updateProjectMemoryCommand } from "./commands/memory.js";
|
|
11
|
-
import { createAppCommand } from "./commands/app.js";
|
|
12
|
-
import { verifyApiContractCommand, updateApiContractCommand } from "./commands/contract.js";
|
|
13
8
|
import { orchestrateCommand, sendMessage } from "./commands/orchestrate.js";
|
|
14
|
-
import {
|
|
9
|
+
import { planCommand } from "./commands/plan.js";
|
|
10
|
+
import { statusCommand } from "./commands/status.js";
|
|
11
|
+
import { traceNewCommand } from "./commands/trace.js";
|
|
12
|
+
import { getMemoryPath, readActiveTraceId } from "./utils/memory.js";
|
|
13
|
+
import { getPackageVersion, getValidatorPath } from "./utils/pkg.js";
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Main CLI entry point.
|
|
@@ -21,8 +20,8 @@ async function main() {
|
|
|
21
20
|
const command = args[0];
|
|
22
21
|
|
|
23
22
|
const KNOWN_COMMANDS = [
|
|
24
|
-
"init", "check", "status", "trace:new", "update_project_memory",
|
|
25
|
-
"
|
|
23
|
+
"init", "check", "status", "trace:new", "update_project_memory",
|
|
24
|
+
"plan", "orchestrate", "loop", "verify-contract", "update-contract",
|
|
26
25
|
"validate", "validate-army", "check:al", "version", "-v", "--version", "help", "-h", "--help",
|
|
27
26
|
"git:commit", "git:sync", "check:compliance", "explorer:graph", "explorer:audit",
|
|
28
27
|
"knowledge:update", "knowledge:search", "log:action", "run-script", "security:audit", "check:lint", "approve"
|
|
@@ -77,6 +76,7 @@ async function main() {
|
|
|
77
76
|
case "plan":
|
|
78
77
|
await planCommand();
|
|
79
78
|
break;
|
|
79
|
+
|
|
80
80
|
case "status":
|
|
81
81
|
await statusCommand();
|
|
82
82
|
break;
|
|
@@ -100,10 +100,6 @@ async function main() {
|
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
case "create-app":
|
|
104
|
-
await createAppCommand(args.slice(1));
|
|
105
|
-
break;
|
|
106
|
-
|
|
107
103
|
case "dashboard": {
|
|
108
104
|
const { dashboardCommand } = await import("./commands/dashboard.js");
|
|
109
105
|
await dashboardCommand(args.slice(1));
|
|
@@ -128,7 +124,7 @@ async function main() {
|
|
|
128
124
|
case "verify-contract":
|
|
129
125
|
await verifyApiContractCommand();
|
|
130
126
|
break;
|
|
131
|
-
|
|
127
|
+
|
|
132
128
|
case "update-contract":
|
|
133
129
|
await updateApiContractCommand();
|
|
134
130
|
break;
|
|
@@ -287,7 +283,7 @@ Commands:
|
|
|
287
283
|
check Perform an enterprise-grade system health check
|
|
288
284
|
status Show active phase, trace ID, and agent statuses
|
|
289
285
|
trace:new <desc> Start a new task chain with a unique Trace ID
|
|
290
|
-
|
|
286
|
+
plan Read all docs/ files and create planning tasks
|
|
291
287
|
orchestrate Start the dynamic Hermes agent orchestration loop
|
|
292
288
|
verify-contract Validate type alignment between backend and frontend
|
|
293
289
|
update-contract Generate and synchronize a new contract hash
|
|
@@ -314,8 +310,8 @@ Example:
|
|
|
314
310
|
`);
|
|
315
311
|
}
|
|
316
312
|
|
|
317
|
-
import { logger } from "../shared/logger.js";
|
|
318
313
|
import { EnderunBaseError } from "../shared/errors.js";
|
|
314
|
+
import { logger } from "../shared/logger.js";
|
|
319
315
|
|
|
320
316
|
main().catch((err) => {
|
|
321
317
|
if (err instanceof EnderunBaseError) {
|
|
@@ -330,4 +326,3 @@ main().catch((err) => {
|
|
|
330
326
|
logger.fatal("Fatal exception during CLI execution", err);
|
|
331
327
|
process.exit(1);
|
|
332
328
|
});
|
|
333
|
-
|
|
@@ -14,12 +14,11 @@ export function scanProjectCompliance(): ComplianceIssue[] {
|
|
|
14
14
|
|
|
15
15
|
for (const file of files) {
|
|
16
16
|
// Absolute skip for the scanner itself to avoid recursion/self-flagging
|
|
17
|
-
if (file.includes("compliance") ||
|
|
17
|
+
if (file.includes("compliance") ||
|
|
18
18
|
file.includes("definitions") ||
|
|
19
19
|
file.includes("agents/registry") || // Skip agent definitions
|
|
20
|
-
file.includes("app-backend.ts") || // Template generator
|
|
21
20
|
file.includes("scaffold-ops.ts") || // Template generator
|
|
22
|
-
file.includes("logger") ||
|
|
21
|
+
file.includes("logger") ||
|
|
23
22
|
file.includes("errors") ||
|
|
24
23
|
file.includes("shared/fs")) continue;
|
|
25
24
|
|
|
@@ -31,8 +30,8 @@ export function scanProjectCompliance(): ComplianceIssue[] {
|
|
|
31
30
|
const trimmedLine = line.trim();
|
|
32
31
|
|
|
33
32
|
// Skip comments and common doc string patterns
|
|
34
|
-
if (trimmedLine.startsWith("//") ||
|
|
35
|
-
trimmedLine.startsWith("*") ||
|
|
33
|
+
if (trimmedLine.startsWith("//") ||
|
|
34
|
+
trimmedLine.startsWith("*") ||
|
|
36
35
|
trimmedLine.startsWith("-") ||
|
|
37
36
|
trimmedLine.includes("\": \"") || // Ignore JSON-like values
|
|
38
37
|
trimmedLine.includes("default: ") || // Ignore default template values
|
|
@@ -48,9 +47,9 @@ export function scanProjectCompliance(): ComplianceIssue[] {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
// 2. Secret check (Regex for simple API keys/assignments) - skip UI messages and templates
|
|
51
|
-
if (/(API_KEY|SECRET|PASSWORD)\s*[:=]/i.test(line) &&
|
|
52
|
-
!file.includes(".env") &&
|
|
53
|
-
!isUIMessage &&
|
|
50
|
+
if (/(API_KEY|SECRET|PASSWORD)\s*[:=]/i.test(line) &&
|
|
51
|
+
!file.includes(".env") &&
|
|
52
|
+
!isUIMessage &&
|
|
54
53
|
!trimmedLine.includes(".env.example") && // Skip template lines
|
|
55
54
|
!trimmedLine.includes("your_secret_key_here") && // Skip common placeholders
|
|
56
55
|
!trimmedLine.includes("pattern:")) {
|
|
@@ -68,7 +67,7 @@ export function scanProjectCompliance(): ComplianceIssue[] {
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
// 5. Raw fs write check (Atomic safety enforcement)
|
|
71
|
-
if ((line.includes("fs.writeFileSync") || line.includes("fs.appendFileSync")) &&
|
|
70
|
+
if ((line.includes("fs.writeFileSync") || line.includes("fs.appendFileSync")) &&
|
|
72
71
|
!file.includes("src/shared/fs.ts") && // Ignore the utility itself
|
|
73
72
|
!line.includes(".lock") && // Allow lock files
|
|
74
73
|
!line.includes("lockPath") && // Allow lock path variables
|
package/src/cli/utils/pkg.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import {
|
|
3
|
+
import { writeJsonFile, writeTextFile } from "./fs.js";
|
|
4
4
|
|
|
5
5
|
export function getPackageVersion() {
|
|
6
6
|
const root = getPackageRoot();
|
|
@@ -21,7 +21,7 @@ export function getPackageManager() {
|
|
|
21
21
|
// Check for lockfiles in target directory
|
|
22
22
|
if (fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml")) || fs.existsSync(path.join(process.cwd(), "pnpm-workspace.yaml"))) return "pnpm";
|
|
23
23
|
if (fs.existsSync(path.join(process.cwd(), "yarn.lock"))) return "yarn";
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
return "npm";
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -74,28 +74,57 @@ export function getDependencyVersions() {
|
|
|
74
74
|
const dependencies = pkg.dependencies || {};
|
|
75
75
|
|
|
76
76
|
return {
|
|
77
|
-
// Backend
|
|
77
|
+
// ── Backend Core ──────────────────────────────────────────
|
|
78
78
|
"fastify": dependencies["fastify"] || "^5.0.0",
|
|
79
79
|
"@fastify/cors": dependencies["@fastify/cors"] || "^11.0.0",
|
|
80
|
+
"@fastify/swagger": dependencies["@fastify/swagger"] || "^9.0.0",
|
|
81
|
+
"@fastify/swagger-ui": dependencies["@fastify/swagger-ui"] || "^5.0.0",
|
|
82
|
+
"@fastify/rate-limit": dependencies["@fastify/rate-limit"] || "^10.0.0",
|
|
83
|
+
"@fastify/static": dependencies["@fastify/static"] || "^8.0.0",
|
|
80
84
|
"zod": dependencies["zod"] || "^3.24.2",
|
|
81
85
|
|
|
86
|
+
// ── Database / ORM ────────────────────────────────────────
|
|
87
|
+
"kysely": dependencies["kysely"] || "^0.27.0",
|
|
88
|
+
"typeorm": dependencies["typeorm"] || "^0.3.0",
|
|
89
|
+
"reflect-metadata": dependencies["reflect-metadata"] || "^0.2.0",
|
|
90
|
+
"pg": dependencies["pg"] || "^8.13.0",
|
|
91
|
+
"better-sqlite3": dependencies["better-sqlite3"] || "^11.0.0",
|
|
92
|
+
|
|
93
|
+
// ── Authentication ────────────────────────────────────────
|
|
94
|
+
"bcrypt": dependencies["bcrypt"] || "^5.1.0",
|
|
95
|
+
"@types/bcrypt": devDependencies["@types/bcrypt"] || "^5.0.0",
|
|
96
|
+
"jsonwebtoken": dependencies["jsonwebtoken"] || "^9.0.0",
|
|
97
|
+
"@types/jsonwebtoken": devDependencies["@types/jsonwebtoken"] || "^9.0.0",
|
|
98
|
+
|
|
99
|
+
// ── Logging ───────────────────────────────────────────────
|
|
100
|
+
"pino": dependencies["pino"] || "^9.0.0",
|
|
101
|
+
"pino-pretty": devDependencies["pino-pretty"] || "^12.0.0",
|
|
102
|
+
|
|
103
|
+
// ── Validation ────────────────────────────────────────────
|
|
104
|
+
"@fastify/type-provider-typebox": dependencies["@fastify/type-provider-typebox"] || "^5.0.0",
|
|
105
|
+
|
|
82
106
|
// Backend devDependencies
|
|
83
107
|
"@types/node": devDependencies["@types/node"] || "^22.13.4",
|
|
84
108
|
"tsx": devDependencies["tsx"] || "^4.19.4",
|
|
85
109
|
"typescript": devDependencies["typescript"] || "^5.9.3",
|
|
86
|
-
"vitest-backend": devDependencies["vitest"] || "^3.0.5",
|
|
110
|
+
"vitest-backend": devDependencies["vitest"] || "^3.0.5",
|
|
87
111
|
|
|
88
|
-
// Frontend
|
|
112
|
+
// ── Frontend Core ─────────────────────────────────────────
|
|
89
113
|
"@vitejs/plugin-react": dependencies["@vitejs/plugin-react"] || "^5.0.0",
|
|
90
114
|
"vite": dependencies["vite"] || "^7.0.0",
|
|
91
115
|
"react": dependencies["react"] || "^19.0.0",
|
|
92
116
|
"react-dom": dependencies["react-dom"] || "^19.0.0",
|
|
93
117
|
"lucide-react": dependencies["lucide-react"] || "^0.468.0",
|
|
94
|
-
|
|
118
|
+
"react-router-dom": dependencies["react-router-dom"] || "^7.0.0",
|
|
119
|
+
"@tanstack/react-query": dependencies["@tanstack/react-query"] || "^5.0.0",
|
|
120
|
+
|
|
95
121
|
// Frontend devDependencies
|
|
96
122
|
"@types/react": devDependencies["@types/react"] || "^19.0.0",
|
|
97
123
|
"@types/react-dom": devDependencies["@types/react-dom"] || "^19.0.0",
|
|
98
|
-
"vitest-frontend": devDependencies["vitest"] || "^3.0.5",
|
|
124
|
+
"vitest-frontend": devDependencies["vitest"] || "^3.0.5",
|
|
125
|
+
|
|
126
|
+
// ── Testing ───────────────────────────────────────────────
|
|
127
|
+
"@playwright/test": devDependencies["@playwright/test"] || "^1.50.0",
|
|
99
128
|
};
|
|
100
129
|
}
|
|
101
130
|
|
|
@@ -113,7 +142,7 @@ interface PackageJson {
|
|
|
113
142
|
}
|
|
114
143
|
|
|
115
144
|
export function mergePackageJson(targetPath: string, sourcePath: string): void {
|
|
116
|
-
let targetPkg: PackageJson = {};
|
|
145
|
+
let targetPkg: PackageJson = {};
|
|
117
146
|
if (fs.existsSync(targetPath)) {
|
|
118
147
|
try {
|
|
119
148
|
targetPkg = JSON.parse(fs.readFileSync(targetPath, "utf8"));
|
|
@@ -123,7 +152,7 @@ export function mergePackageJson(targetPath: string, sourcePath: string): void {
|
|
|
123
152
|
}
|
|
124
153
|
|
|
125
154
|
const sourcePkg: PackageJson = JSON.parse(fs.readFileSync(sourcePath, "utf8"));
|
|
126
|
-
|
|
155
|
+
|
|
127
156
|
type PackageMap = Record<string, string>;
|
|
128
157
|
const sanitizeDeps = (deps: PackageMap | Record<string, unknown> | undefined): Record<string, string> | undefined => {
|
|
129
158
|
if (!deps) return deps as undefined;
|
|
@@ -159,7 +188,7 @@ export function mergePackageJson(targetPath: string, sourcePath: string): void {
|
|
|
159
188
|
// Merge scripts
|
|
160
189
|
const pkgMgr = getPackageManager();
|
|
161
190
|
const runCmd = pkgMgr === "yarn" ? "yarn" : (pkgMgr === "pnpm" ? "pnpm" : "npm run");
|
|
162
|
-
|
|
191
|
+
|
|
163
192
|
targetPkg.scripts = {
|
|
164
193
|
...targetPkg.scripts,
|
|
165
194
|
"enderun:status": "agent-enderun status",
|
|
@@ -242,12 +271,12 @@ export function sanitizeJson(obj: unknown, targetScope = ""): unknown {
|
|
|
242
271
|
if (typeof value === "string" && value.startsWith("agent-enderun-")) {
|
|
243
272
|
finalValue = value.replace("agent-enderun-", `${scopeName}-`);
|
|
244
273
|
}
|
|
245
|
-
|
|
274
|
+
|
|
246
275
|
// Handle agent-enderun -> target (ONLY for the package name)
|
|
247
276
|
if (key === "name" && value === "agent-enderun") {
|
|
248
277
|
finalValue = scopeName;
|
|
249
278
|
}
|
|
250
|
-
|
|
279
|
+
|
|
251
280
|
// Preserve agent-enderun in dependencies and bin
|
|
252
281
|
// (No action needed as finalKey/finalValue default to original)
|
|
253
282
|
|
|
@@ -265,7 +294,7 @@ export function sanitizeJson(obj: unknown, targetScope = ""): unknown {
|
|
|
265
294
|
|
|
266
295
|
export function deepCleanProtocols(dir: string, targetScope = ""): void {
|
|
267
296
|
if (!fs.existsSync(dir)) return;
|
|
268
|
-
|
|
297
|
+
|
|
269
298
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
270
299
|
for (const entry of entries) {
|
|
271
300
|
const fullPath = path.join(dir, entry.name);
|
|
@@ -38,7 +38,7 @@ export const ADAPTER_CONFIGS: Record<AdapterId, AdapterConfig> = {
|
|
|
38
38
|
shimTemplate: "src/cli/shims/grok.md",
|
|
39
39
|
role: "researcher",
|
|
40
40
|
templateDir: ".enderun",
|
|
41
|
-
nestedDirs: ["rules"],
|
|
41
|
+
nestedDirs: ["agents", "rules"],
|
|
42
42
|
agentsDir: ".grok/agents",
|
|
43
43
|
agentsExt: ".md"
|
|
44
44
|
},
|
|
@@ -4,11 +4,14 @@ import os from "os";
|
|
|
4
4
|
import { writeJsonFile, writeTextFile } from "../../shared/fs.js";
|
|
5
5
|
import { ALL_AGENTS, toAntigravityJson } from "../agents/definitions.js";
|
|
6
6
|
import { CORE_SKILLS } from "../skills/definitions.js";
|
|
7
|
+
import { getPackageRoot } from "../../cli/utils/pkg.js";
|
|
7
8
|
|
|
8
9
|
export function registerGlobalAntigravityPlugins(mcpBlock: unknown): void {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
];
|
|
10
|
+
// Allow overriding via env var for different OS/Gemini CLI versions
|
|
11
|
+
const defaultGlobalDir = path.join(os.homedir(), ".gemini/antigravity-cli");
|
|
12
|
+
const customDir = process.env["ANTIGRAVITY_GLOBAL_DIR"];
|
|
13
|
+
const targets = [customDir ?? defaultGlobalDir];
|
|
14
|
+
const baseKnowledgeDir = path.join(getPackageRoot(), "templates/standards");
|
|
12
15
|
|
|
13
16
|
for (const globalDir of targets) {
|
|
14
17
|
try {
|
|
@@ -37,7 +40,7 @@ export function registerGlobalAntigravityPlugins(mcpBlock: unknown): void {
|
|
|
37
40
|
const agentsBaseDir = path.join(globalPluginDir, "agents");
|
|
38
41
|
fs.mkdirSync(agentsBaseDir, { recursive: true });
|
|
39
42
|
for (const ag of ALL_AGENTS) {
|
|
40
|
-
const agentJson = toAntigravityJson(ag);
|
|
43
|
+
const agentJson = toAntigravityJson(ag, baseKnowledgeDir);
|
|
41
44
|
|
|
42
45
|
// 1. Nested format (agents/{agent_name}/agent.json)
|
|
43
46
|
const nestedAgentDir = path.join(agentsBaseDir, ag.name);
|