agent-enderun 1.10.1 → 1.10.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 +2 -1
- package/dist/framework-mcp/src/constants.d.ts +47 -0
- package/dist/framework-mcp/src/constants.js +65 -0
- package/dist/framework-mcp/src/constants.js.map +1 -0
- package/dist/framework-mcp/src/index.js +26 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +3 -9
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +2 -8
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.d.ts +2 -2
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +30 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +12 -4
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +6 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/read_file.js +43 -26
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +7 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/write_file.js +27 -15
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/get_status.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/get_status.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/orchestrate.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.d.ts +1 -2
- package/dist/framework-mcp/src/tools/index.js +33 -25
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/send_message.js +14 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +2 -2
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.d.ts +5 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js +29 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_map.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/grep_search.js +45 -28
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/list_dir.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.d.ts +2 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js +47 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +95 -28
- package/dist/framework-mcp/src/utils/metrics.d.ts +20 -0
- package/dist/framework-mcp/src/utils/metrics.js +24 -6
- package/dist/framework-mcp/src/utils/metrics.js.map +1 -1
- package/dist/framework-mcp/src/utils/security.d.ts +1 -3
- package/dist/framework-mcp/src/utils/security.js +21 -18
- package/dist/framework-mcp/src/utils/security.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +19 -14
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +36 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +43 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -0
- package/dist/src/cli/adapters/core.d.ts +1 -1
- package/dist/src/cli/adapters/core.js +5 -0
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/paths.d.ts +15 -0
- package/dist/src/cli/adapters/paths.js +101 -0
- package/dist/src/cli/adapters/paths.js.map +1 -0
- package/dist/src/cli/adapters/scaffold.js +2 -1
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +15 -36
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/dashboard/data-service.d.ts +8 -0
- package/dist/src/cli/commands/dashboard/data-service.js +37 -0
- package/dist/src/cli/commands/dashboard/data-service.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +6 -1
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +2 -5
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +5 -0
- package/dist/src/cli/commands/orchestrate.js +148 -128
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +1 -1
- package/dist/src/cli/utils/memory.js +28 -8
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/modules/adapters/definitions.js +3 -3
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/agents/definitions.js +2 -1
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/architect.js +1 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +3 -3
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +3 -3
- 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/quality.js +1 -0
- package/dist/src/modules/agents/registry/quality.js.map +1 -1
- package/dist/src/shared/constants.d.ts +113 -0
- package/dist/src/shared/constants.js +178 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/tests/adapters/paths.test.d.ts +1 -0
- package/dist/tests/adapters/paths.test.js +63 -0
- package/dist/tests/adapters/paths.test.js.map +1 -0
- package/dist/tests/approve.test.js +2 -1
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/cli/init/unified_init.test.d.ts +1 -0
- package/dist/tests/cli/init/unified_init.test.js +47 -0
- package/dist/tests/cli/init/unified_init.test.js.map +1 -0
- package/dist/tests/fs-utils.test.js +1 -1
- package/dist/tests/fs-utils.test.js.map +1 -1
- package/dist/tests/memory-utils.test.js +1 -1
- package/dist/tests/memory-utils.test.js.map +1 -1
- package/dist/tests/shared/constants.test.d.ts +1 -0
- package/dist/tests/shared/constants.test.js +17 -0
- package/dist/tests/shared/constants.test.js.map +1 -0
- package/dist/tests/trace.test.js +2 -2
- package/dist/tests/trace.test.js.map +1 -1
- package/package.json +7 -6
- package/src/cli/adapters/core.ts +7 -0
- package/src/cli/adapters/paths.ts +134 -0
- package/src/cli/adapters/scaffold.ts +2 -1
- package/src/cli/commands/check.ts +16 -38
- package/src/cli/commands/dashboard/data-service.ts +48 -0
- package/src/cli/commands/init/scaffold-standards.ts +6 -1
- package/src/cli/commands/init.ts +1 -4
- package/src/cli/commands/orchestrate.ts +151 -127
- package/src/cli/utils/fs.ts +1 -1
- package/src/cli/utils/memory.ts +32 -7
- package/src/modules/adapters/definitions.ts +4 -3
- package/src/modules/agents/definitions.ts +2 -1
- package/src/modules/agents/registry/architect.ts +1 -0
- package/src/modules/agents/registry/backend.ts +3 -3
- package/src/modules/agents/registry/database.ts +3 -3
- package/src/modules/agents/registry/devops.ts +1 -1
- package/src/modules/agents/registry/quality.ts +1 -0
- package/src/shared/constants.ts +212 -0
- package/bin/validate-agent-army.js +0 -152
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Enderun — Single Source of Truth for framework constants.
|
|
3
|
+
* Import from here instead of hardcoding paths, phases, or directory names.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// ─── Framework identity ───────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
export const FRAMEWORK = {
|
|
9
|
+
NAME: "Agent Enderun",
|
|
10
|
+
CORE_DIR: ".enderun",
|
|
11
|
+
UNIFIED_HUB_DIR: ".agents",
|
|
12
|
+
CONSTITUTION_FILE: "ENDERUN.md",
|
|
13
|
+
DEFAULT_TRACE_ID: "T-000",
|
|
14
|
+
DEFAULT_PHASE: "PHASE_0",
|
|
15
|
+
DEFAULT_MANAGER_STATE: "ACTIVE",
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export const PROJECT_PHASES = [
|
|
19
|
+
"PHASE_0",
|
|
20
|
+
"PHASE_1",
|
|
21
|
+
"PHASE_2",
|
|
22
|
+
"PHASE_3",
|
|
23
|
+
"PHASE_4",
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
// ─── Adapter platform directories (native / legacy) ───────────────────────────
|
|
27
|
+
|
|
28
|
+
export const ADAPTER_DIRS = {
|
|
29
|
+
GEMINI: ".gemini",
|
|
30
|
+
CLAUDE: ".claude",
|
|
31
|
+
GROK: ".grok",
|
|
32
|
+
CURSOR: ".cursor",
|
|
33
|
+
CODEX: ".agents",
|
|
34
|
+
ANTIGRAVITY: ".antigravity",
|
|
35
|
+
LEGACY_AGENT: ".agent",
|
|
36
|
+
} as const;
|
|
37
|
+
|
|
38
|
+
/** Priority order for framework directory resolution (CLI + MCP). */
|
|
39
|
+
export const FRAMEWORK_DIR_CANDIDATES = [
|
|
40
|
+
FRAMEWORK.CORE_DIR,
|
|
41
|
+
ADAPTER_DIRS.CODEX,
|
|
42
|
+
ADAPTER_DIRS.CLAUDE,
|
|
43
|
+
ADAPTER_DIRS.GEMINI,
|
|
44
|
+
ADAPTER_DIRS.GROK,
|
|
45
|
+
ADAPTER_DIRS.CURSOR,
|
|
46
|
+
ADAPTER_DIRS.ANTIGRAVITY,
|
|
47
|
+
] as const;
|
|
48
|
+
|
|
49
|
+
/** Slug under `.agents/{slug}/` for each adapter in unified mode. */
|
|
50
|
+
export const UNIFIED_ADAPTER_SLUG = {
|
|
51
|
+
gemini: "gemini",
|
|
52
|
+
claude: "claude",
|
|
53
|
+
grok: "grok",
|
|
54
|
+
cursor: "cursor",
|
|
55
|
+
codex: "codex",
|
|
56
|
+
"antigravity-cli": "antigravity",
|
|
57
|
+
} as const;
|
|
58
|
+
|
|
59
|
+
export type UnifiedAdapterSlug = keyof typeof UNIFIED_ADAPTER_SLUG;
|
|
60
|
+
|
|
61
|
+
// ─── Native agent instruction paths (legacy tool compatibility) ───────────────
|
|
62
|
+
|
|
63
|
+
export const NATIVE_AGENT_PATHS = {
|
|
64
|
+
gemini: pathJoin(ADAPTER_DIRS.GEMINI, "agents"),
|
|
65
|
+
claude: pathJoin(ADAPTER_DIRS.CLAUDE, "agents"),
|
|
66
|
+
grok: pathJoin(ADAPTER_DIRS.GROK, "agents"),
|
|
67
|
+
cursor: pathJoin(ADAPTER_DIRS.CURSOR, "rules"),
|
|
68
|
+
codex: pathJoin(ADAPTER_DIRS.CODEX, "instructions"),
|
|
69
|
+
"antigravity-cli": pathJoin(ADAPTER_DIRS.ANTIGRAVITY, "agents"),
|
|
70
|
+
} as const;
|
|
71
|
+
|
|
72
|
+
/** Legacy layout bases used by `check` and discovery (non-unified installs). */
|
|
73
|
+
export const LEGACY_AGENT_LAYOUT_BASES = [
|
|
74
|
+
NATIVE_AGENT_PATHS.gemini,
|
|
75
|
+
NATIVE_AGENT_PATHS.claude,
|
|
76
|
+
NATIVE_AGENT_PATHS.cursor,
|
|
77
|
+
NATIVE_AGENT_PATHS.grok,
|
|
78
|
+
NATIVE_AGENT_PATHS.codex,
|
|
79
|
+
NATIVE_AGENT_PATHS["antigravity-cli"],
|
|
80
|
+
] as const;
|
|
81
|
+
|
|
82
|
+
// ─── Framework internal subdirectories (under `.enderun/`) ──────────────────
|
|
83
|
+
|
|
84
|
+
export const FRAMEWORK_SUBDIRS = {
|
|
85
|
+
AGENTS: "agents",
|
|
86
|
+
SKILLS: "skills",
|
|
87
|
+
KNOWLEDGE: "knowledge",
|
|
88
|
+
PROMPTS: "prompts",
|
|
89
|
+
MEMORY: "memory",
|
|
90
|
+
ROUTER: "router",
|
|
91
|
+
REGISTRY: "registry",
|
|
92
|
+
OBSERVABILITY: "observability",
|
|
93
|
+
RULES: "rules",
|
|
94
|
+
MESSAGES: "messages",
|
|
95
|
+
LOGS: "logs",
|
|
96
|
+
MEMORY_GRAPH: "memory-graph",
|
|
97
|
+
} as const;
|
|
98
|
+
|
|
99
|
+
export const CORE_SCAFFOLD_SUBDIRS = [
|
|
100
|
+
FRAMEWORK_SUBDIRS.KNOWLEDGE,
|
|
101
|
+
FRAMEWORK_SUBDIRS.PROMPTS,
|
|
102
|
+
FRAMEWORK_SUBDIRS.MEMORY,
|
|
103
|
+
FRAMEWORK_SUBDIRS.ROUTER,
|
|
104
|
+
FRAMEWORK_SUBDIRS.REGISTRY,
|
|
105
|
+
FRAMEWORK_SUBDIRS.OBSERVABILITY,
|
|
106
|
+
FRAMEWORK_SUBDIRS.RULES,
|
|
107
|
+
] as const;
|
|
108
|
+
|
|
109
|
+
export const RUNTIME_SUBDIRS = [
|
|
110
|
+
FRAMEWORK_SUBDIRS.MESSAGES,
|
|
111
|
+
FRAMEWORK_SUBDIRS.LOGS,
|
|
112
|
+
FRAMEWORK_SUBDIRS.MEMORY_GRAPH,
|
|
113
|
+
] as const;
|
|
114
|
+
|
|
115
|
+
export const MEMORY_SUBDIRS = {
|
|
116
|
+
TASKS: "tasks",
|
|
117
|
+
HISTORY: "history",
|
|
118
|
+
} as const;
|
|
119
|
+
|
|
120
|
+
export const MEMORY_FILES = {
|
|
121
|
+
STATE: "state.json",
|
|
122
|
+
STATUS: "status.json",
|
|
123
|
+
PROJECT_MEMORY: "PROJECT_MEMORY.md",
|
|
124
|
+
SHARED_FACTS: "shared-facts.json",
|
|
125
|
+
} as const;
|
|
126
|
+
|
|
127
|
+
// ─── Monorepo default paths ───────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
export const DEFAULT_MONOREPO_PATHS = {
|
|
130
|
+
backend: "apps/backend",
|
|
131
|
+
frontend: "apps/web",
|
|
132
|
+
mobile: "apps/mobile",
|
|
133
|
+
docs: "docs",
|
|
134
|
+
tests: "tests",
|
|
135
|
+
} as const;
|
|
136
|
+
|
|
137
|
+
/** Cursor rule globs per agent role (monorepo layout). */
|
|
138
|
+
export const CURSOR_AGENT_GLOBS: Record<string, string> = {
|
|
139
|
+
backend: `${DEFAULT_MONOREPO_PATHS.backend}/**/*`,
|
|
140
|
+
frontend: `${DEFAULT_MONOREPO_PATHS.frontend}/**/*`,
|
|
141
|
+
database: `${DEFAULT_MONOREPO_PATHS.backend}/src/database/**/*`,
|
|
142
|
+
mobile: `${DEFAULT_MONOREPO_PATHS.mobile}/**/*`,
|
|
143
|
+
native: "apps/native/**/*",
|
|
144
|
+
quality: "*",
|
|
145
|
+
security: "*",
|
|
146
|
+
devops: "*",
|
|
147
|
+
explorer: "*",
|
|
148
|
+
git: "*",
|
|
149
|
+
analyst: "*",
|
|
150
|
+
manager: "*",
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// ─── MCP & environment ──────────────────────────────────────────────────────
|
|
154
|
+
|
|
155
|
+
export const MCP = {
|
|
156
|
+
SERVER_NAME: "agent-enderun",
|
|
157
|
+
ROOT_CONFIG_FILE: "mcp.json",
|
|
158
|
+
PROJECT_ROOT_ENV: "ENDERUN_PROJECT_ROOT",
|
|
159
|
+
TEST_DIR_ENV: "ENDERUN_TEST_DIR",
|
|
160
|
+
} as const;
|
|
161
|
+
|
|
162
|
+
export const ROOT_CONFIG_FILES = {
|
|
163
|
+
MCP: MCP.ROOT_CONFIG_FILE,
|
|
164
|
+
DOT_MCP: ".mcp.json",
|
|
165
|
+
ENV_EXAMPLE: ".env.example",
|
|
166
|
+
VSCODE_MCP: ".vscode/mcp.json",
|
|
167
|
+
} as const;
|
|
168
|
+
|
|
169
|
+
// ─── Shim template placeholders ───────────────────────────────────────────────
|
|
170
|
+
|
|
171
|
+
export const TEMPLATE_PLACEHOLDERS = {
|
|
172
|
+
FRAMEWORK_DIR: "{{FRAMEWORK_DIR}}",
|
|
173
|
+
ADAPTER: "{{ADAPTER}}",
|
|
174
|
+
BACKEND_DIR: "{{BACKEND_DIR}}",
|
|
175
|
+
FRONTEND_DIR: "{{FRONTEND_DIR}}",
|
|
176
|
+
DOCS_DIR: "{{DOCS_DIR}}",
|
|
177
|
+
TESTS_DIR: "{{TESTS_DIR}}",
|
|
178
|
+
} as const;
|
|
179
|
+
|
|
180
|
+
// ─── File extensions ─────────────────────────────────────────────────────────
|
|
181
|
+
|
|
182
|
+
export const AGENT_FILE_EXT = {
|
|
183
|
+
MARKDOWN: ".md",
|
|
184
|
+
CURSOR_RULE: ".mdc",
|
|
185
|
+
} as const;
|
|
186
|
+
|
|
187
|
+
// ─── Path helpers ─────────────────────────────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
export function pathJoin(...segments: string[]): string {
|
|
190
|
+
return segments.filter(Boolean).join("/");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function corePath(...segments: string[]): string {
|
|
194
|
+
return pathJoin(FRAMEWORK.CORE_DIR, ...segments);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function unifiedHubPath(...segments: string[]): string {
|
|
198
|
+
return pathJoin(FRAMEWORK.UNIFIED_HUB_DIR, ...segments);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function unifiedAdapterPath(slug: string, ...segments: string[]): string {
|
|
202
|
+
return unifiedHubPath(slug, ...segments);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function knowledgePath(filename: string): string {
|
|
206
|
+
return corePath(FRAMEWORK_SUBDIRS.KNOWLEDGE, filename);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Backward-compatible aliases */
|
|
210
|
+
export const CORE_FRAMEWORK_DIR = FRAMEWORK.CORE_DIR;
|
|
211
|
+
export const UNIFIED_HUB_DIR = FRAMEWORK.UNIFIED_HUB_DIR;
|
|
212
|
+
export const SKILLS_HUB_PATH = pathJoin(UNIFIED_HUB_DIR, FRAMEWORK_SUBDIRS.SKILLS);
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "fs";
|
|
4
|
-
import path from "path";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* AL-compatible agent folder names across all adapters (after init).
|
|
8
|
-
*/
|
|
9
|
-
const AGENT_FOLDER_NAMES = ["agents", "skills", "plugins"];
|
|
10
|
-
const FRAMEWORK_CANDIDATES = [
|
|
11
|
-
".enderun",
|
|
12
|
-
".cursor",
|
|
13
|
-
".claude",
|
|
14
|
-
".github",
|
|
15
|
-
".grok",
|
|
16
|
-
".windsurf",
|
|
17
|
-
".antigravity",
|
|
18
|
-
".agent",
|
|
19
|
-
".gemini/antigravity-cli",
|
|
20
|
-
".gemini",
|
|
21
|
-
".agents",
|
|
22
|
-
"antigravity-cli"
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
function detectFrameworkDir() {
|
|
26
|
-
const projectRoot = process.cwd();
|
|
27
|
-
for (const dir of FRAMEWORK_CANDIDATES) {
|
|
28
|
-
const dirPath = path.resolve(projectRoot, dir);
|
|
29
|
-
if (!fs.existsSync(dirPath)) continue;
|
|
30
|
-
|
|
31
|
-
for (const folderName of AGENT_FOLDER_NAMES) {
|
|
32
|
-
const agentsPath = path.join(dirPath, folderName);
|
|
33
|
-
if (fs.existsSync(agentsPath)) {
|
|
34
|
-
return { frameworkDir: dir, agentsDir: agentsPath };
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Helper to parse YAML-like Frontmatter from Markdown.
|
|
43
|
-
*/
|
|
44
|
-
function parseFrontmatter(content) {
|
|
45
|
-
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
46
|
-
const fm = {};
|
|
47
|
-
if (match) {
|
|
48
|
-
match[1].split("\n").forEach(line => {
|
|
49
|
-
const [key, ...val] = line.split(":");
|
|
50
|
-
if (key && val.length) {
|
|
51
|
-
let value = val.join(":").trim();
|
|
52
|
-
if (value.startsWith("[") && value.endsWith("]")) {
|
|
53
|
-
value = value.slice(1, -1).split(",").map(s => s.trim().replace(/"/g, ""));
|
|
54
|
-
} else if (value.startsWith("\"") && value.endsWith("\"")) {
|
|
55
|
-
value = value.slice(1, -1);
|
|
56
|
-
}
|
|
57
|
-
fm[key.trim()] = value;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Also parse from HTML comments in the body as fallback to bypass strict frontmatter checks
|
|
63
|
-
const commentMatches = content.matchAll(/<!--\s*(\w+)\s*:\s*(.*?)\s*-->/g);
|
|
64
|
-
for (const m of commentMatches) {
|
|
65
|
-
let value = m[2].trim();
|
|
66
|
-
if (value.startsWith("[") && value.endsWith("]")) {
|
|
67
|
-
value = value.slice(1, -1).split(",").map(s => s.trim().replace(/"/g, "").replace(/'/g, ""));
|
|
68
|
-
} else if (value.startsWith("\"") && value.endsWith("\"")) {
|
|
69
|
-
value = value.slice(1, -1);
|
|
70
|
-
}
|
|
71
|
-
fm[m[1]] = value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return Object.keys(fm).length > 0 ? fm : null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const detected = detectFrameworkDir();
|
|
79
|
-
if (!detected) {
|
|
80
|
-
process.stderr.write("ℹ️ No framework agents/ dir found for AL validation. Skipping.");
|
|
81
|
-
process.exit(0);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const { agentsDir } = detected;
|
|
85
|
-
|
|
86
|
-
try {
|
|
87
|
-
const files = [];
|
|
88
|
-
const walk = (dir) => {
|
|
89
|
-
if (!fs.existsSync(dir)) return;
|
|
90
|
-
const list = fs.readdirSync(dir);
|
|
91
|
-
for (const item of list) {
|
|
92
|
-
const fullPath = path.join(dir, item);
|
|
93
|
-
if (fs.statSync(fullPath).isDirectory()) {
|
|
94
|
-
walk(fullPath);
|
|
95
|
-
} else if (item.endsWith(".json") || item.endsWith(".md")) {
|
|
96
|
-
files.push({ name: item, path: fullPath });
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
walk(agentsDir);
|
|
101
|
-
|
|
102
|
-
let totalFailed = 0;
|
|
103
|
-
|
|
104
|
-
process.stderr.write(`🛡️ STARTING AGENT ARMY AL VALIDATION (${detected.frameworkDir})...`);
|
|
105
|
-
process.stderr.write("--------------------------------------------------");
|
|
106
|
-
process.stderr.write("| Agent ID | Format | Status | Category |");
|
|
107
|
-
process.stderr.write("--------------------------------------------------");
|
|
108
|
-
|
|
109
|
-
for (const file of files) {
|
|
110
|
-
const fileName = file.name;
|
|
111
|
-
const filePath = file.path;
|
|
112
|
-
if (fileName === "agent_army_schema.json" || fileName === "schema") continue;
|
|
113
|
-
|
|
114
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
115
|
-
const isMd = fileName.endsWith(".md");
|
|
116
|
-
|
|
117
|
-
let agent;
|
|
118
|
-
try {
|
|
119
|
-
agent = isMd ? parseFrontmatter(content) : JSON.parse(content);
|
|
120
|
-
if (!agent && isMd) throw new Error("Missing Frontmatter");
|
|
121
|
-
} catch (e) {
|
|
122
|
-
process.stderr.write(`| ${fileName.padEnd(9)} | ${isMd ? "MD " : "JSON"} | ❌ INVALID | ${String(e.message).slice(0, 14)} |`);
|
|
123
|
-
totalFailed++;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Validate AL compliance fields
|
|
128
|
-
const missing = [];
|
|
129
|
-
if (!agent.name) missing.push("name");
|
|
130
|
-
if (agent.capability === undefined) missing.push("capability");
|
|
131
|
-
if (!agent.tags) missing.push("tags");
|
|
132
|
-
|
|
133
|
-
if (missing.length > 0) {
|
|
134
|
-
process.stderr.write(`| ${fileName.padEnd(9)} | ${isMd ? "MD " : "JSON"} | ❌ FAILED | ${missing.join(",").slice(0, 14)} |`);
|
|
135
|
-
totalFailed++;
|
|
136
|
-
} else {
|
|
137
|
-
const cat = Array.isArray(agent.tags) ? agent.tags[0] : "core";
|
|
138
|
-
process.stderr.write(`| ${agent.name.padEnd(9)} | ${isMd ? "MD " : "JSON"} | ✅ PASSED | ${cat.padEnd(14)} |`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
process.stderr.write("--------------------------------------------------");
|
|
143
|
-
if (totalFailed > 0) {
|
|
144
|
-
process.stderr.write(`❌ Validation failed! Detected ${totalFailed} invalid agent configurations.\n`);
|
|
145
|
-
process.exit(1);
|
|
146
|
-
} else {
|
|
147
|
-
process.stderr.write("🎉 SUCCESS: All core agents are AL-Compliant!");
|
|
148
|
-
}
|
|
149
|
-
} catch (e) {
|
|
150
|
-
process.stderr.write(`❌ Critical error during validation: ${e}\n`);
|
|
151
|
-
process.exit(1);
|
|
152
|
-
}
|