@voybio/ace-swarm 0.2.5 → 2.4.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/CHANGELOG.md +19 -1
- package/README.md +21 -13
- package/assets/.agents/ACE/agent-qa/instructions.md +11 -0
- package/assets/agent-state/EVIDENCE_LOG.md +1 -1
- package/assets/agent-state/MODULES/roles/capability-framework.json +41 -0
- package/assets/agent-state/MODULES/roles/capability-git.json +33 -0
- package/assets/agent-state/MODULES/roles/capability-safety.json +37 -0
- package/assets/agent-state/MODULES/schemas/ACE_RUNTIME_PROFILE.schema.json +21 -0
- package/assets/agent-state/MODULES/schemas/RUNTIME_EXECUTOR_SESSION_REGISTRY.schema.json +43 -0
- package/assets/agent-state/MODULES/schemas/RUNTIME_TOOL_SPEC_REGISTRY.schema.json +43 -0
- package/assets/agent-state/MODULES/schemas/WORKSPACE_SESSION_REGISTRY.schema.json +11 -0
- package/assets/agent-state/STATUS.md +2 -2
- package/assets/agent-state/runtime-tool-specs.json +70 -2
- package/assets/instructions/ACE_Coder.instructions.md +13 -0
- package/assets/instructions/ACE_UI.instructions.md +11 -0
- package/assets/scripts/ace-hook-dispatch.mjs +70 -6
- package/assets/scripts/render-mcp-configs.sh +19 -5
- package/dist/ace-context.js +91 -11
- package/dist/ace-internal-tools.d.ts +3 -1
- package/dist/ace-internal-tools.js +10 -2
- package/dist/ace-server-instructions.js +3 -3
- package/dist/ace-state-resolver.js +5 -3
- package/dist/agent-runtime/role-adapters.d.ts +18 -1
- package/dist/agent-runtime/role-adapters.js +49 -5
- package/dist/astgrep-index.d.ts +57 -1
- package/dist/astgrep-index.js +140 -4
- package/dist/cli.js +232 -35
- package/dist/discovery-runtime-wrappers.d.ts +108 -0
- package/dist/discovery-runtime-wrappers.js +615 -0
- package/dist/handoff-registry.js +5 -5
- package/dist/helpers/artifacts.d.ts +19 -0
- package/dist/helpers/artifacts.js +152 -0
- package/dist/helpers/bootstrap.d.ts +24 -0
- package/dist/helpers/bootstrap.js +894 -0
- package/dist/helpers/constants.d.ts +53 -0
- package/dist/helpers/constants.js +295 -0
- package/dist/helpers/drift.d.ts +13 -0
- package/dist/helpers/drift.js +45 -0
- package/dist/helpers/path-utils.d.ts +24 -0
- package/dist/helpers/path-utils.js +123 -0
- package/dist/helpers/store-resolution.d.ts +19 -0
- package/dist/helpers/store-resolution.js +305 -0
- package/dist/helpers/workspace-root.d.ts +3 -0
- package/dist/helpers/workspace-root.js +80 -0
- package/dist/helpers.d.ts +8 -125
- package/dist/helpers.js +8 -1768
- package/dist/job-scheduler.js +33 -7
- package/dist/json-sanitizer.d.ts +16 -0
- package/dist/json-sanitizer.js +26 -0
- package/dist/local-model-policy.d.ts +27 -0
- package/dist/local-model-policy.js +84 -0
- package/dist/local-model-runtime.d.ts +6 -0
- package/dist/local-model-runtime.js +33 -21
- package/dist/model-bridge.d.ts +13 -1
- package/dist/model-bridge.js +410 -23
- package/dist/orchestrator-supervisor.d.ts +56 -0
- package/dist/orchestrator-supervisor.js +179 -1
- package/dist/plan-proposal.d.ts +115 -0
- package/dist/plan-proposal.js +1073 -0
- package/dist/run-ledger.js +3 -3
- package/dist/runtime-command.d.ts +8 -0
- package/dist/runtime-command.js +38 -6
- package/dist/runtime-executor.d.ts +20 -1
- package/dist/runtime-executor.js +737 -172
- package/dist/runtime-profile.d.ts +32 -0
- package/dist/runtime-profile.js +89 -13
- package/dist/runtime-tool-specs.d.ts +39 -0
- package/dist/runtime-tool-specs.js +144 -28
- package/dist/safe-edit.d.ts +7 -0
- package/dist/safe-edit.js +163 -37
- package/dist/schemas.js +48 -1
- package/dist/server.js +51 -0
- package/dist/shared.d.ts +3 -2
- package/dist/shared.js +2 -0
- package/dist/status-events.js +9 -6
- package/dist/store/ace-packed-store.d.ts +3 -2
- package/dist/store/ace-packed-store.js +188 -110
- package/dist/store/bootstrap-store.d.ts +2 -1
- package/dist/store/bootstrap-store.js +102 -83
- package/dist/store/cache-workspace.js +11 -5
- package/dist/store/materializers/context-snapshot-materializer.js +6 -2
- package/dist/store/materializers/hook-context-materializer.d.ts +6 -9
- package/dist/store/materializers/hook-context-materializer.js +11 -21
- package/dist/store/materializers/host-file-materializer.js +6 -0
- package/dist/store/materializers/projection-manager.d.ts +0 -1
- package/dist/store/materializers/projection-manager.js +5 -13
- package/dist/store/materializers/scheduler-projection-materializer.js +1 -1
- package/dist/store/materializers/vericify-projector.d.ts +7 -7
- package/dist/store/materializers/vericify-projector.js +11 -11
- package/dist/store/repositories/local-model-runtime-repository.d.ts +120 -3
- package/dist/store/repositories/local-model-runtime-repository.js +242 -6
- package/dist/store/repositories/vericify-repository.d.ts +1 -1
- package/dist/store/skills-install.d.ts +4 -0
- package/dist/store/skills-install.js +21 -12
- package/dist/store/state-reader.d.ts +2 -0
- package/dist/store/state-reader.js +20 -0
- package/dist/store/store-artifacts.d.ts +7 -0
- package/dist/store/store-artifacts.js +27 -1
- package/dist/store/store-authority-audit.d.ts +18 -1
- package/dist/store/store-authority-audit.js +115 -5
- package/dist/store/store-snapshot.d.ts +3 -0
- package/dist/store/store-snapshot.js +22 -2
- package/dist/store/workspace-store-paths.d.ts +39 -0
- package/dist/store/workspace-store-paths.js +94 -0
- package/dist/store/write-coordinator.d.ts +65 -0
- package/dist/store/write-coordinator.js +386 -0
- package/dist/todo-state.js +5 -5
- package/dist/tools-agent.d.ts +20 -0
- package/dist/tools-agent.js +789 -25
- package/dist/tools-discovery.js +136 -1
- package/dist/tools-files.d.ts +7 -0
- package/dist/tools-files.js +1002 -11
- package/dist/tools-framework.js +105 -66
- package/dist/tools-handoff.js +2 -2
- package/dist/tools-lifecycle.js +4 -4
- package/dist/tools-memory.js +6 -6
- package/dist/tools-todo.js +2 -2
- package/dist/tracker-adapters.d.ts +1 -1
- package/dist/tracker-adapters.js +13 -18
- package/dist/tracker-sync.js +5 -3
- package/dist/tui/agent-runner.js +3 -1
- package/dist/tui/chat.js +103 -7
- package/dist/tui/dashboard.d.ts +1 -0
- package/dist/tui/dashboard.js +43 -0
- package/dist/tui/index.js +10 -1
- package/dist/tui/layout.d.ts +20 -0
- package/dist/tui/layout.js +31 -1
- package/dist/tui/local-model-contract.d.ts +6 -2
- package/dist/tui/local-model-contract.js +16 -3
- package/dist/tui/ollama.d.ts +8 -1
- package/dist/tui/ollama.js +53 -12
- package/dist/tui/openai-compatible.d.ts +13 -0
- package/dist/tui/openai-compatible.js +305 -5
- package/dist/tui/provider-discovery.d.ts +1 -0
- package/dist/tui/provider-discovery.js +35 -11
- package/dist/vericify-bridge.d.ts +6 -1
- package/dist/vericify-bridge.js +27 -3
- package/dist/workspace-manager.d.ts +30 -3
- package/dist/workspace-manager.js +257 -27
- package/package.json +1 -2
- package/dist/internal-tool-runtime.d.ts +0 -21
- package/dist/internal-tool-runtime.js +0 -136
- package/dist/store/workspace-snapshot.d.ts +0 -26
- package/dist/store/workspace-snapshot.js +0 -107
|
@@ -0,0 +1,894 @@
|
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
4
|
+
import { buildHostInstructionText } from "../ace-server-instructions.js";
|
|
5
|
+
import { buildProviderDoctorCommands, buildOpenAiCompatibleBaseUrl, defaultModelForProvider, normalizeLocalBaseUrl, normalizeProvider, } from "../tui/provider-discovery.js";
|
|
6
|
+
import { ALL_LLM_PROVIDERS, ALL_MCP_CLIENTS, ACE_BUNDLE_ROOT_REL, ACE_CLAUDE_ROOT_REL, ACE_CURSOR_ROOT_REL, ACE_GITHUB_ROOT_REL, ACE_HOST_AGENTS_REL, ACE_HOST_CLAUDE_REL, ACE_HOST_CURSOR_RULES_REL, ACE_LLM_ROOT_REL, ACE_ROOT_REL, ACE_SCRIPTS_ROOT_REL, ACE_TASKS_ROOT_REL, ACE_VSCODE_ROOT_REL, COMPOSABLE_AGENTS, DEFAULTS_AGENT_STATE_ROOT, DEFAULTS_GITHUB_ROOT, DEFAULTS_ROOT, DEFAULTS_SCRIPTS_ROOT, DEFAULTS_SKILLS_ROOT, DEFAULT_TASK_FILES, DEFAULTS_TASKS_ROOT, SWARM_AGENTS, } from "./constants.js";
|
|
7
|
+
import { acePath, wsPath } from "./path-utils.js";
|
|
8
|
+
import { resolveWorkspaceRoot } from "./workspace-root.js";
|
|
9
|
+
function ensureDir(dirPath, result) {
|
|
10
|
+
if (existsSync(dirPath))
|
|
11
|
+
return;
|
|
12
|
+
mkdirSync(dirPath, { recursive: true });
|
|
13
|
+
result.created.push(dirPath);
|
|
14
|
+
}
|
|
15
|
+
function copyTree(srcRoot, destRoot, result, force = false) {
|
|
16
|
+
if (!existsSync(srcRoot))
|
|
17
|
+
return;
|
|
18
|
+
const entries = readdirSync(srcRoot, { withFileTypes: true });
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
const src = resolve(srcRoot, entry.name);
|
|
21
|
+
const dest = resolve(destRoot, entry.name);
|
|
22
|
+
if (entry.isDirectory()) {
|
|
23
|
+
ensureDir(dest, result);
|
|
24
|
+
copyTree(src, dest, result, force);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (!existsSync(dest)) {
|
|
28
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
29
|
+
copyFileSync(src, dest);
|
|
30
|
+
result.created.push(dest);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (force) {
|
|
34
|
+
copyFileSync(src, dest);
|
|
35
|
+
result.updated.push(dest);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
result.skipped.push(dest);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function writeIfMissingOrForced(path, content, result, force = false) {
|
|
43
|
+
if (!existsSync(path)) {
|
|
44
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
45
|
+
writeFileSync(path, content, "utf-8");
|
|
46
|
+
result.created.push(path);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (force) {
|
|
50
|
+
writeFileSync(path, content, "utf-8");
|
|
51
|
+
result.updated.push(path);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
result.skipped.push(path);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function quotePosixShell(value) {
|
|
58
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
59
|
+
}
|
|
60
|
+
function quoteCmdExe(value) {
|
|
61
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
62
|
+
}
|
|
63
|
+
function getNodeBinDir() {
|
|
64
|
+
const execPath = process.execPath?.trim();
|
|
65
|
+
if (!execPath)
|
|
66
|
+
return undefined;
|
|
67
|
+
const binDir = dirname(execPath);
|
|
68
|
+
return existsSync(join(binDir, "node")) ? binDir : undefined;
|
|
69
|
+
}
|
|
70
|
+
function getLocalCliEntry() {
|
|
71
|
+
return resolve(DEFAULTS_ROOT, "..", "dist", "cli.js");
|
|
72
|
+
}
|
|
73
|
+
function buildPosixProfileFallback(shellPath) {
|
|
74
|
+
const shellName = basename(shellPath);
|
|
75
|
+
if (shellName === "zsh") {
|
|
76
|
+
return [
|
|
77
|
+
'[ -s "$HOME/.zprofile" ] && . "$HOME/.zprofile"',
|
|
78
|
+
'[ -s "$HOME/.zshrc" ] && . "$HOME/.zshrc"',
|
|
79
|
+
].join("; ");
|
|
80
|
+
}
|
|
81
|
+
if (shellName === "bash") {
|
|
82
|
+
return [
|
|
83
|
+
'[ -s "$HOME/.bash_profile" ] && . "$HOME/.bash_profile"',
|
|
84
|
+
'[ -s "$HOME/.profile" ] && . "$HOME/.profile"',
|
|
85
|
+
'[ -s "$HOME/.bashrc" ] && . "$HOME/.bashrc"',
|
|
86
|
+
].join("; ");
|
|
87
|
+
}
|
|
88
|
+
return [
|
|
89
|
+
'[ -s "$HOME/.profile" ] && . "$HOME/.profile"',
|
|
90
|
+
'[ -s "$HOME/.zprofile" ] && . "$HOME/.zprofile"',
|
|
91
|
+
'[ -s "$HOME/.zshrc" ] && . "$HOME/.zshrc"',
|
|
92
|
+
].join("; ");
|
|
93
|
+
}
|
|
94
|
+
function buildPosixMcpLaunchCommand(workspaceRoot, shellPath) {
|
|
95
|
+
const quotedWorkspaceRoot = quotePosixShell(workspaceRoot);
|
|
96
|
+
const quotedCliEntry = quotePosixShell(getLocalCliEntry());
|
|
97
|
+
const launchSteps = [];
|
|
98
|
+
const nodeBinDir = getNodeBinDir();
|
|
99
|
+
if (nodeBinDir) {
|
|
100
|
+
launchSteps.push(`export PATH=${quotePosixShell(nodeBinDir)}:"$PATH"`);
|
|
101
|
+
}
|
|
102
|
+
launchSteps.push(`if ! command -v node >/dev/null 2>&1; then ${buildPosixProfileFallback(shellPath)}; fi`);
|
|
103
|
+
launchSteps.push(`cd ${quotedWorkspaceRoot}`);
|
|
104
|
+
launchSteps.push(`ACE_WORKSPACE_ROOT=${quotedWorkspaceRoot} node ${quotedCliEntry} mcp`);
|
|
105
|
+
return launchSteps.join(" && ");
|
|
106
|
+
}
|
|
107
|
+
function buildWindowsMcpLaunchCommand(workspaceRoot) {
|
|
108
|
+
const cliEntry = getLocalCliEntry().replace(/"/g, '""');
|
|
109
|
+
return [
|
|
110
|
+
`cd /d ${quoteCmdExe(workspaceRoot)}`,
|
|
111
|
+
`set "ACE_WORKSPACE_ROOT=${workspaceRoot.replace(/"/g, '""')}"`,
|
|
112
|
+
`node ${quoteCmdExe(cliEntry)} mcp`,
|
|
113
|
+
].join(" && ");
|
|
114
|
+
}
|
|
115
|
+
function getMcpCommandSpec(workspaceRoot = resolveWorkspaceRoot()) {
|
|
116
|
+
if (process.platform !== "win32") {
|
|
117
|
+
const shell = process.env.SHELL || "/bin/zsh";
|
|
118
|
+
return {
|
|
119
|
+
command: shell,
|
|
120
|
+
args: ["-lc", buildPosixMcpLaunchCommand(workspaceRoot, shell)],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
command: "cmd.exe",
|
|
125
|
+
args: ["/d", "/s", "/c", buildWindowsMcpLaunchCommand(workspaceRoot)],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const ACE_HOOK_EVENTS = [
|
|
129
|
+
"SessionStart",
|
|
130
|
+
"UserPromptSubmit",
|
|
131
|
+
"PreToolUse",
|
|
132
|
+
"PostToolUse",
|
|
133
|
+
"PreCompact",
|
|
134
|
+
"SubagentStart",
|
|
135
|
+
"SubagentStop",
|
|
136
|
+
"Stop",
|
|
137
|
+
];
|
|
138
|
+
const ACE_HOOK_DISPATCH_REL = `${ACE_SCRIPTS_ROOT_REL}/ace-hook-dispatch.mjs`;
|
|
139
|
+
const ACE_HOOK_DISPATCH_COMMAND = `node ./${ACE_HOOK_DISPATCH_REL}`;
|
|
140
|
+
function buildCopilotHookSettings() {
|
|
141
|
+
const hook = {
|
|
142
|
+
type: "command",
|
|
143
|
+
command: ACE_HOOK_DISPATCH_COMMAND,
|
|
144
|
+
windows: "node .\\\\.agents\\\\ACE\\\\scripts\\\\ace\\\\ace-hook-dispatch.mjs",
|
|
145
|
+
timeout: 10,
|
|
146
|
+
};
|
|
147
|
+
const hooks = Object.fromEntries(ACE_HOOK_EVENTS.map((event) => [event, [hook]]));
|
|
148
|
+
return JSON.stringify({ hooks }, null, 2);
|
|
149
|
+
}
|
|
150
|
+
function buildClaudeHookSettings() {
|
|
151
|
+
const hook = {
|
|
152
|
+
type: "command",
|
|
153
|
+
command: ACE_HOOK_DISPATCH_COMMAND,
|
|
154
|
+
};
|
|
155
|
+
return JSON.stringify({
|
|
156
|
+
hooks: {
|
|
157
|
+
SessionStart: [{ matcher: "", hooks: [hook] }],
|
|
158
|
+
UserPromptSubmit: [{ matcher: "", hooks: [hook] }],
|
|
159
|
+
PreToolUse: [{ matcher: "", hooks: [hook] }],
|
|
160
|
+
PostToolUse: [{ matcher: "", hooks: [hook] }],
|
|
161
|
+
PreCompact: [{ matcher: "", hooks: [hook] }],
|
|
162
|
+
SubagentStart: [{ matcher: "", hooks: [hook] }],
|
|
163
|
+
SubagentStop: [{ matcher: "", hooks: [hook] }],
|
|
164
|
+
Stop: [{ matcher: "", hooks: [hook] }],
|
|
165
|
+
},
|
|
166
|
+
}, null, 2);
|
|
167
|
+
}
|
|
168
|
+
function buildCursorHookSettings() {
|
|
169
|
+
return buildCopilotHookSettings();
|
|
170
|
+
}
|
|
171
|
+
function buildVsCodeHookSettings() {
|
|
172
|
+
return buildCopilotHookSettings();
|
|
173
|
+
}
|
|
174
|
+
function buildGeminiHookSettings() {
|
|
175
|
+
return buildCopilotHookSettings();
|
|
176
|
+
}
|
|
177
|
+
function buildAntigravityHookSettings() {
|
|
178
|
+
return buildCopilotHookSettings();
|
|
179
|
+
}
|
|
180
|
+
function buildCodexHookSettings() {
|
|
181
|
+
return [
|
|
182
|
+
"# ACE lifecycle hook scaffold for Codex-compatible runtimes.",
|
|
183
|
+
"# Merge or source these entries in the host hook config that supports SessionStart/SubagentStart hooks.",
|
|
184
|
+
"",
|
|
185
|
+
...ACE_HOOK_EVENTS.flatMap((event) => [
|
|
186
|
+
"[[hooks]]",
|
|
187
|
+
`event = "${event}"`,
|
|
188
|
+
`command = "${ACE_HOOK_DISPATCH_COMMAND}"`,
|
|
189
|
+
"",
|
|
190
|
+
]),
|
|
191
|
+
].join("\n");
|
|
192
|
+
}
|
|
193
|
+
function buildWorkspaceStateSeedFiles(projectName, generatedAt) {
|
|
194
|
+
const swarmHandoffTemplate = readFileSync(DEFAULT_TASK_FILES.handoff_template, "utf-8");
|
|
195
|
+
return [
|
|
196
|
+
{
|
|
197
|
+
path: wsPath("global-state", "GLOBAL_RISKS.md"),
|
|
198
|
+
content: [
|
|
199
|
+
"# GLOBAL_RISKS",
|
|
200
|
+
"",
|
|
201
|
+
`Generated: ${generatedAt}`,
|
|
202
|
+
"",
|
|
203
|
+
"## Systemic Risks",
|
|
204
|
+
"- None logged yet. Record cross-swarm blockers, runway constraints, and release risks here.",
|
|
205
|
+
"",
|
|
206
|
+
"## Update Rule",
|
|
207
|
+
"- Keep local implementation risks in the owning swarm folder or `agent-state/RISKS.md`.",
|
|
208
|
+
].join("\n"),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
path: wsPath("global-state", "DECISION_LOG.md"),
|
|
212
|
+
content: [
|
|
213
|
+
"# DECISION_LOG",
|
|
214
|
+
"",
|
|
215
|
+
`Generated: ${generatedAt}`,
|
|
216
|
+
"",
|
|
217
|
+
"Append-only record for orchestrator-level tradeoffs that affect multiple swarms.",
|
|
218
|
+
"",
|
|
219
|
+
"## Entry Template",
|
|
220
|
+
`- ${generatedAt} — Decision: <what changed>`,
|
|
221
|
+
" - Reason: <why>",
|
|
222
|
+
" - Impact: <which swarm/state folders are affected>",
|
|
223
|
+
].join("\n"),
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
path: wsPath("global-state", "ENGINEERING_SNAPSHOT.md"),
|
|
227
|
+
content: [
|
|
228
|
+
"# ENGINEERING_SNAPSHOT.md",
|
|
229
|
+
"",
|
|
230
|
+
`Generated: ${generatedAt}`,
|
|
231
|
+
"",
|
|
232
|
+
"## Profile",
|
|
233
|
+
"- Status: pending initial orchestrator discovery scan",
|
|
234
|
+
"- Project: " + projectName,
|
|
235
|
+
`- Durable location: \`${ACE_ROOT_REL}/global-state/ENGINEERING_SNAPSHOT.md\``,
|
|
236
|
+
"",
|
|
237
|
+
"## Quality Signals",
|
|
238
|
+
"- Tests: pending scan",
|
|
239
|
+
"- Public surface: pending scan",
|
|
240
|
+
"- Delivery risk: pending scan",
|
|
241
|
+
"",
|
|
242
|
+
"## Routing Recommendation",
|
|
243
|
+
"- Run the orchestrator discovery pass before first coder handoff.",
|
|
244
|
+
].join("\n"),
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
path: wsPath("global-state", "SWARM_HANDOFF.json"),
|
|
248
|
+
content: swarmHandoffTemplate,
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
path: wsPath("venture-state", "STATUS.md"),
|
|
252
|
+
content: [
|
|
253
|
+
"# VENTURE STATUS",
|
|
254
|
+
"",
|
|
255
|
+
"- Mode: bootstrap",
|
|
256
|
+
"- Focus: clarify thesis and MVP",
|
|
257
|
+
"- Current phase: discovery",
|
|
258
|
+
"- Next handoff: ACE-VOS -> ACE-Orchestrator",
|
|
259
|
+
`- Last update: ${generatedAt}`,
|
|
260
|
+
].join("\n"),
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
path: wsPath("venture-state", "TEAL_CONFIG.md"),
|
|
264
|
+
content: [
|
|
265
|
+
"# TEAL_CONFIG",
|
|
266
|
+
"",
|
|
267
|
+
"## Venture Pipeline",
|
|
268
|
+
"- discovery -> thesis -> blueprint -> MVP spec -> handoff",
|
|
269
|
+
"",
|
|
270
|
+
"## Durable Outputs",
|
|
271
|
+
`- \`${ACE_ROOT_REL}/venture-state/THESIS.md\``,
|
|
272
|
+
`- \`${ACE_ROOT_REL}/venture-state/BLUEPRINT.md\``,
|
|
273
|
+
`- \`${ACE_ROOT_REL}/venture-state/GROWTH_LOOPS.md\``,
|
|
274
|
+
`- \`${ACE_ROOT_REL}/venture-state/RISKS.md\``,
|
|
275
|
+
`- \`${ACE_ROOT_REL}/venture-state/PROTOTYPE/MVP_SPEC.md\``,
|
|
276
|
+
].join("\n"),
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
path: wsPath("venture-state", "THESIS.md"),
|
|
280
|
+
content: [
|
|
281
|
+
"# THESIS",
|
|
282
|
+
"",
|
|
283
|
+
"## Problem",
|
|
284
|
+
"- TBD",
|
|
285
|
+
"",
|
|
286
|
+
"## Users",
|
|
287
|
+
"- TBD",
|
|
288
|
+
"",
|
|
289
|
+
"## Why Now",
|
|
290
|
+
"- TBD",
|
|
291
|
+
"",
|
|
292
|
+
"## Wedge",
|
|
293
|
+
"- TBD",
|
|
294
|
+
].join("\n"),
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
path: wsPath("venture-state", "INTERROGATION.log"),
|
|
298
|
+
content: [
|
|
299
|
+
"# INTERROGATION LOG",
|
|
300
|
+
"",
|
|
301
|
+
`- ${generatedAt} bootstrap: venture interrogation started.`,
|
|
302
|
+
].join("\n"),
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
path: wsPath("venture-state", "BLUEPRINT.md"),
|
|
306
|
+
content: [
|
|
307
|
+
"# BLUEPRINT",
|
|
308
|
+
"",
|
|
309
|
+
"## System Outline",
|
|
310
|
+
"- TBD",
|
|
311
|
+
"",
|
|
312
|
+
"## Critical Flows",
|
|
313
|
+
"- TBD",
|
|
314
|
+
].join("\n"),
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
path: wsPath("venture-state", "GROWTH_LOOPS.md"),
|
|
318
|
+
content: [
|
|
319
|
+
"# GROWTH_LOOPS",
|
|
320
|
+
"",
|
|
321
|
+
"## Acquisition",
|
|
322
|
+
"- TBD",
|
|
323
|
+
"",
|
|
324
|
+
"## Retention",
|
|
325
|
+
"- TBD",
|
|
326
|
+
"",
|
|
327
|
+
"## Monetization",
|
|
328
|
+
"- TBD",
|
|
329
|
+
].join("\n"),
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
path: wsPath("venture-state", "RISKS.md"),
|
|
333
|
+
content: [
|
|
334
|
+
"# VENTURE RISKS",
|
|
335
|
+
"",
|
|
336
|
+
"## Active Risks",
|
|
337
|
+
"- None logged yet.",
|
|
338
|
+
].join("\n"),
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
path: wsPath("venture-state", "PROTOTYPE", "MVP_SPEC.md"),
|
|
342
|
+
content: [
|
|
343
|
+
"# MVP_SPEC",
|
|
344
|
+
"",
|
|
345
|
+
"## Objective",
|
|
346
|
+
"- TBD",
|
|
347
|
+
"",
|
|
348
|
+
"## Must-Have Behaviors",
|
|
349
|
+
"- TBD",
|
|
350
|
+
"",
|
|
351
|
+
"## Proof Requirement",
|
|
352
|
+
"- Define the smallest working slice that demonstrates value.",
|
|
353
|
+
].join("\n"),
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
path: wsPath("venture-state", "PROTOTYPE", "src", "README.md"),
|
|
357
|
+
content: [
|
|
358
|
+
"# Venture Prototype Source",
|
|
359
|
+
"",
|
|
360
|
+
`Use this directory when the venture swarm needs a lightweight proof-of-concept separate from \`${ACE_ROOT_REL}/engineering-state/src/\`.`,
|
|
361
|
+
].join("\n"),
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
path: wsPath("brand-state", "BRAND_VOICE.md"),
|
|
365
|
+
content: [
|
|
366
|
+
"# BRAND_VOICE",
|
|
367
|
+
"",
|
|
368
|
+
"## Positioning",
|
|
369
|
+
"- TBD",
|
|
370
|
+
"",
|
|
371
|
+
"## Tone",
|
|
372
|
+
"- Clear",
|
|
373
|
+
"- Specific",
|
|
374
|
+
"- Trust-building",
|
|
375
|
+
"",
|
|
376
|
+
"## Messaging Guardrails",
|
|
377
|
+
"- Avoid generic claims.",
|
|
378
|
+
"- Tie every headline to a concrete user outcome.",
|
|
379
|
+
].join("\n"),
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
path: wsPath("brand-state", "AUDIT_LOG.md"),
|
|
383
|
+
content: [
|
|
384
|
+
"# AUDIT_LOG",
|
|
385
|
+
"",
|
|
386
|
+
`- ${generatedAt} bootstrap: brand audit log initialized.`,
|
|
387
|
+
].join("\n"),
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
path: wsPath("brand-state", "COPY_DECK.md"),
|
|
391
|
+
content: [
|
|
392
|
+
"# COPY_DECK",
|
|
393
|
+
"",
|
|
394
|
+
"## Primary Headline",
|
|
395
|
+
"- TBD",
|
|
396
|
+
"",
|
|
397
|
+
"## Supporting Copy",
|
|
398
|
+
"- TBD",
|
|
399
|
+
"",
|
|
400
|
+
"## CTA",
|
|
401
|
+
"- TBD",
|
|
402
|
+
].join("\n"),
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
path: wsPath("brand-state", "ASSETS", "strings.json"),
|
|
406
|
+
content: JSON.stringify({
|
|
407
|
+
app_name: projectName,
|
|
408
|
+
headline: "",
|
|
409
|
+
subheadline: "",
|
|
410
|
+
primary_cta: "",
|
|
411
|
+
}, null, 2),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
path: wsPath("engineering-state", "BUILD_STATUS.md"),
|
|
415
|
+
content: [
|
|
416
|
+
"# BUILD_STATUS",
|
|
417
|
+
"",
|
|
418
|
+
"- Status: not started",
|
|
419
|
+
"- Active owner: ACE-Coders",
|
|
420
|
+
"- Blockers: none recorded",
|
|
421
|
+
`- Last update: ${generatedAt}`,
|
|
422
|
+
].join("\n"),
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
path: wsPath("engineering-state", "SPEC_CONTRACT.json"),
|
|
426
|
+
content: JSON.stringify({
|
|
427
|
+
version: "0.1.0",
|
|
428
|
+
project: projectName,
|
|
429
|
+
status: "draft",
|
|
430
|
+
requirements: [],
|
|
431
|
+
acceptance_tests: [],
|
|
432
|
+
deliverables: [],
|
|
433
|
+
}, null, 2),
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
path: wsPath("engineering-state", "ARCHITECTURE.md"),
|
|
437
|
+
content: [
|
|
438
|
+
"# ARCHITECTURE",
|
|
439
|
+
"",
|
|
440
|
+
"## Stack",
|
|
441
|
+
"- TBD",
|
|
442
|
+
"",
|
|
443
|
+
"## Interfaces",
|
|
444
|
+
"- TBD",
|
|
445
|
+
"",
|
|
446
|
+
"## Constraints",
|
|
447
|
+
"- TBD",
|
|
448
|
+
].join("\n"),
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
path: wsPath("engineering-state", "TEST_LOG.md"),
|
|
452
|
+
content: [
|
|
453
|
+
"# TEST_LOG",
|
|
454
|
+
"",
|
|
455
|
+
`- ${generatedAt} bootstrap: no tests executed yet.`,
|
|
456
|
+
].join("\n"),
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
path: wsPath("engineering-state", "src", "README.md"),
|
|
460
|
+
content: [
|
|
461
|
+
"# Engineering Source",
|
|
462
|
+
"",
|
|
463
|
+
`Place the main implementation here. Keep test evidence in \`${ACE_ROOT_REL}/engineering-state/TEST_LOG.md\`.`,
|
|
464
|
+
].join("\n"),
|
|
465
|
+
},
|
|
466
|
+
];
|
|
467
|
+
}
|
|
468
|
+
export function getMcpClientBundlePath(client) {
|
|
469
|
+
if (client === "codex")
|
|
470
|
+
return wsPath(".mcp-config", "codex.config.toml");
|
|
471
|
+
if (client === "vscode")
|
|
472
|
+
return wsPath(".mcp-config", "vscode.mcp.json");
|
|
473
|
+
if (client === "copilot")
|
|
474
|
+
return wsPath(".mcp.json");
|
|
475
|
+
if (client === "claude")
|
|
476
|
+
return wsPath(".mcp-config", "claude_desktop_config.json");
|
|
477
|
+
if (client === "cursor")
|
|
478
|
+
return wsPath(".mcp-config", "cursor.mcp.json");
|
|
479
|
+
return wsPath(".mcp-config", "antigravity.mcp.json");
|
|
480
|
+
}
|
|
481
|
+
export function getMcpClientInstallHint(client) {
|
|
482
|
+
if (client === "codex") {
|
|
483
|
+
const codexHome = resolve(process.env.CODEX_HOME ?? resolve(homedir(), ".codex"));
|
|
484
|
+
return `${resolve(codexHome, "config.toml")} (append output from \`ace mcp-config --client codex\`)`;
|
|
485
|
+
}
|
|
486
|
+
if (client === "vscode") {
|
|
487
|
+
return `${wsPath(".vscode", "mcp.json")} (workspace) or merge output from \`ace mcp-config --client vscode\``;
|
|
488
|
+
}
|
|
489
|
+
if (client === "copilot") {
|
|
490
|
+
return `${wsPath(".mcp.json")} (workspace root, compatible with GitHub Copilot CLI)`;
|
|
491
|
+
}
|
|
492
|
+
if (client === "claude") {
|
|
493
|
+
return [
|
|
494
|
+
`${resolve(homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json")} (macOS, merge output from \`ace mcp-config --client claude\`)`,
|
|
495
|
+
`${resolve(homedir(), ".config", "Claude", "claude_desktop_config.json")} (Linux, merge output from \`ace mcp-config --client claude\`)`,
|
|
496
|
+
].join(" | ");
|
|
497
|
+
}
|
|
498
|
+
if (client === "cursor") {
|
|
499
|
+
return `${resolve(homedir(), ".cursor", "mcp.json")} (merge output from \`ace mcp-config --client cursor\`)`;
|
|
500
|
+
}
|
|
501
|
+
return "Use Antigravity MCP UI import with output from `ace mcp-config --client antigravity`";
|
|
502
|
+
}
|
|
503
|
+
export function getMcpServerConfigSnippet(client = "vscode") {
|
|
504
|
+
const stdio = getMcpCommandSpec(resolveWorkspaceRoot());
|
|
505
|
+
const mcpServers = {
|
|
506
|
+
"ace-swarm": {
|
|
507
|
+
...stdio,
|
|
508
|
+
},
|
|
509
|
+
};
|
|
510
|
+
if (client === "codex") {
|
|
511
|
+
return [
|
|
512
|
+
`# ACE instructions are scaffolded into ${ACE_HOST_AGENTS_REL} during bootstrap.`,
|
|
513
|
+
`[mcp_servers.ace-swarm]`,
|
|
514
|
+
`command = "${stdio.command}"`,
|
|
515
|
+
`args = ["${stdio.args.join('", "')}"]`,
|
|
516
|
+
"",
|
|
517
|
+
].join("\n");
|
|
518
|
+
}
|
|
519
|
+
if (client === "vscode") {
|
|
520
|
+
return JSON.stringify({
|
|
521
|
+
servers: {
|
|
522
|
+
"ace-swarm": {
|
|
523
|
+
type: "stdio",
|
|
524
|
+
...stdio,
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
}, null, 2);
|
|
528
|
+
}
|
|
529
|
+
if (client === "copilot") {
|
|
530
|
+
return JSON.stringify({ mcpServers }, null, 2);
|
|
531
|
+
}
|
|
532
|
+
return JSON.stringify({ mcpServers }, null, 2);
|
|
533
|
+
}
|
|
534
|
+
export function getAllMcpServerConfigSnippets() {
|
|
535
|
+
return {
|
|
536
|
+
codex: getMcpServerConfigSnippet("codex"),
|
|
537
|
+
vscode: getMcpServerConfigSnippet("vscode"),
|
|
538
|
+
copilot: getMcpServerConfigSnippet("copilot"),
|
|
539
|
+
claude: getMcpServerConfigSnippet("claude"),
|
|
540
|
+
cursor: getMcpServerConfigSnippet("cursor"),
|
|
541
|
+
antigravity: getMcpServerConfigSnippet("antigravity"),
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
export function bootstrapAceWorkspace(options = {}) {
|
|
545
|
+
const force = options.force ?? false;
|
|
546
|
+
const projectName = options.projectName?.trim() || "ACE Project";
|
|
547
|
+
const includeMcpConfig = options.includeMcpConfig ?? true;
|
|
548
|
+
const includeClientConfigBundle = options.includeClientConfigBundle ?? true;
|
|
549
|
+
const normalizedProvider = normalizeProvider(options.llmProvider);
|
|
550
|
+
const llmProvider = normalizedProvider;
|
|
551
|
+
const llmModel = options.llmModel?.trim() ||
|
|
552
|
+
options.ollamaModel?.trim() ||
|
|
553
|
+
(llmProvider === "ollama" ? defaultModelForProvider(llmProvider) : undefined);
|
|
554
|
+
const llmBaseUrl = normalizeLocalBaseUrl(options.llmBaseUrl ?? options.ollamaBaseUrl);
|
|
555
|
+
if (llmProvider && !ALL_LLM_PROVIDERS.includes(llmProvider)) {
|
|
556
|
+
throw new Error(`Unsupported llmProvider: ${llmProvider}`);
|
|
557
|
+
}
|
|
558
|
+
const result = { created: [], updated: [], skipped: [] };
|
|
559
|
+
const generatedAt = new Date().toISOString();
|
|
560
|
+
const workspaceRoot = resolveWorkspaceRoot();
|
|
561
|
+
const dirSeeds = [
|
|
562
|
+
acePath(),
|
|
563
|
+
wsPath("global-state"),
|
|
564
|
+
wsPath("venture-state"),
|
|
565
|
+
wsPath("brand-state"),
|
|
566
|
+
wsPath("brand-state", "ASSETS"),
|
|
567
|
+
wsPath("engineering-state"),
|
|
568
|
+
wsPath("engineering-state", "src"),
|
|
569
|
+
wsPath("agent-state"),
|
|
570
|
+
wsPath("agent-state", "MODULES"),
|
|
571
|
+
wsPath("agent-state", "MODULES", "roles"),
|
|
572
|
+
wsPath("agent-state", "MODULES", "gates"),
|
|
573
|
+
acePath("tasks"),
|
|
574
|
+
acePath(".github"),
|
|
575
|
+
acePath(".github", "hooks"),
|
|
576
|
+
acePath(".claude"),
|
|
577
|
+
acePath(".cursor"),
|
|
578
|
+
acePath(".vscode"),
|
|
579
|
+
acePath(".mcp-config"),
|
|
580
|
+
acePath("scripts"),
|
|
581
|
+
acePath("scripts", "ace"),
|
|
582
|
+
acePath("skills"),
|
|
583
|
+
];
|
|
584
|
+
if (llmProvider) {
|
|
585
|
+
dirSeeds.push(acePath(".ace"));
|
|
586
|
+
}
|
|
587
|
+
for (const dir of dirSeeds)
|
|
588
|
+
ensureDir(dir, result);
|
|
589
|
+
const skipStoreManaged = options.skipStoreManaged ?? false;
|
|
590
|
+
if (!skipStoreManaged) {
|
|
591
|
+
copyTree(DEFAULTS_TASKS_ROOT, acePath("tasks"), result, force);
|
|
592
|
+
copyTree(DEFAULTS_AGENT_STATE_ROOT, wsPath("agent-state"), result, force);
|
|
593
|
+
copyTree(resolve(DEFAULTS_ROOT, ".agents", "ACE"), acePath(), result, force);
|
|
594
|
+
copyTree(DEFAULTS_SKILLS_ROOT, acePath("skills"), result, force);
|
|
595
|
+
}
|
|
596
|
+
copyTree(DEFAULTS_GITHUB_ROOT, acePath(".github"), result, force);
|
|
597
|
+
copyTree(DEFAULTS_SCRIPTS_ROOT, acePath("scripts", "ace"), result, force);
|
|
598
|
+
const masterPlanPath = wsPath("global-state", "MASTER_PLAN.md");
|
|
599
|
+
writeIfMissingOrForced(masterPlanPath, [
|
|
600
|
+
`# ${projectName} — Master Plan`,
|
|
601
|
+
"",
|
|
602
|
+
`Created: ${generatedAt}`,
|
|
603
|
+
"",
|
|
604
|
+
"## Status",
|
|
605
|
+
"",
|
|
606
|
+
"- Phase: Bootstrap",
|
|
607
|
+
"- Next: Route first handoff",
|
|
608
|
+
"",
|
|
609
|
+
"## Roadmap",
|
|
610
|
+
"",
|
|
611
|
+
"1. [ ] Validate venture thesis (ACE-VOS)",
|
|
612
|
+
"2. [ ] Define UX copy/flow package (ACE-UI)",
|
|
613
|
+
"3. [ ] Ship tested implementation (ACE-Coders)",
|
|
614
|
+
"",
|
|
615
|
+
"## Active Swarm",
|
|
616
|
+
"",
|
|
617
|
+
"| Agent | Status | Last Update |",
|
|
618
|
+
"|---|---|---|",
|
|
619
|
+
"| ACE-Orchestrator | active | bootstrap |",
|
|
620
|
+
"| ACE-VOS | idle | — |",
|
|
621
|
+
"| ACE-UI | idle | — |",
|
|
622
|
+
"| ACE-Coders | idle | — |",
|
|
623
|
+
].join("\n"), result, force);
|
|
624
|
+
for (const file of buildWorkspaceStateSeedFiles(projectName, generatedAt)) {
|
|
625
|
+
writeIfMissingOrForced(file.path, file.content, result, force);
|
|
626
|
+
}
|
|
627
|
+
const registryPath = wsPath("global-state", "SWARM_REGISTRY.json");
|
|
628
|
+
const swarmSubagents = [...COMPOSABLE_AGENTS];
|
|
629
|
+
const parentSwarms = [...SWARM_AGENTS].map((role) => `ace-${role}`);
|
|
630
|
+
writeIfMissingOrForced(registryPath, JSON.stringify({
|
|
631
|
+
swarms: {
|
|
632
|
+
"ace-orchestrator": {
|
|
633
|
+
group: "swarm",
|
|
634
|
+
state_dir: `./${ACE_ROOT_REL}/global-state/`,
|
|
635
|
+
status: "active",
|
|
636
|
+
instructions: ".agents/ACE/orchestrator/instructions.md",
|
|
637
|
+
subagents: swarmSubagents,
|
|
638
|
+
},
|
|
639
|
+
"ace-vos": {
|
|
640
|
+
group: "swarm",
|
|
641
|
+
state_dir: `./${ACE_ROOT_REL}/venture-state/`,
|
|
642
|
+
status: "idle",
|
|
643
|
+
instructions: ".agents/ACE/VOS/instructions.md",
|
|
644
|
+
subagents: swarmSubagents,
|
|
645
|
+
},
|
|
646
|
+
"ace-ui": {
|
|
647
|
+
group: "swarm",
|
|
648
|
+
state_dir: `./${ACE_ROOT_REL}/brand-state/`,
|
|
649
|
+
status: "idle",
|
|
650
|
+
instructions: ".agents/ACE/UI/instructions.md",
|
|
651
|
+
subagents: swarmSubagents,
|
|
652
|
+
},
|
|
653
|
+
"ace-coders": {
|
|
654
|
+
group: "swarm",
|
|
655
|
+
state_dir: `./${ACE_ROOT_REL}/engineering-state/`,
|
|
656
|
+
status: "idle",
|
|
657
|
+
instructions: ".agents/ACE/ACE_coders/INSTRUCTIONS.md",
|
|
658
|
+
subagents: swarmSubagents,
|
|
659
|
+
},
|
|
660
|
+
"agent-astgrep": {
|
|
661
|
+
group: "composable",
|
|
662
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
663
|
+
status: "idle",
|
|
664
|
+
instructions: ".agents/ACE/agent-astgrep/instructions.md",
|
|
665
|
+
parent_swarms: parentSwarms,
|
|
666
|
+
},
|
|
667
|
+
"agent-skeptic": {
|
|
668
|
+
group: "composable",
|
|
669
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
670
|
+
status: "idle",
|
|
671
|
+
instructions: ".agents/ACE/agent-skeptic/instructions.md",
|
|
672
|
+
parent_swarms: parentSwarms,
|
|
673
|
+
},
|
|
674
|
+
"agent-ops": {
|
|
675
|
+
group: "composable",
|
|
676
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
677
|
+
status: "idle",
|
|
678
|
+
instructions: ".agents/ACE/agent-ops/instructions.md",
|
|
679
|
+
parent_swarms: parentSwarms,
|
|
680
|
+
},
|
|
681
|
+
"agent-research": {
|
|
682
|
+
group: "composable",
|
|
683
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
684
|
+
status: "idle",
|
|
685
|
+
instructions: ".agents/ACE/agent-research/instructions.md",
|
|
686
|
+
parent_swarms: parentSwarms,
|
|
687
|
+
},
|
|
688
|
+
"agent-spec": {
|
|
689
|
+
group: "composable",
|
|
690
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
691
|
+
status: "idle",
|
|
692
|
+
instructions: ".agents/ACE/agent-spec/instructions.md",
|
|
693
|
+
parent_swarms: parentSwarms,
|
|
694
|
+
},
|
|
695
|
+
"agent-builder": {
|
|
696
|
+
group: "composable",
|
|
697
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
698
|
+
status: "idle",
|
|
699
|
+
instructions: ".agents/ACE/agent-builder/instructions.md",
|
|
700
|
+
parent_swarms: parentSwarms,
|
|
701
|
+
},
|
|
702
|
+
"agent-qa": {
|
|
703
|
+
group: "composable",
|
|
704
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
705
|
+
status: "idle",
|
|
706
|
+
instructions: ".agents/ACE/agent-qa/instructions.md",
|
|
707
|
+
parent_swarms: parentSwarms,
|
|
708
|
+
},
|
|
709
|
+
"agent-docs": {
|
|
710
|
+
group: "composable",
|
|
711
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
712
|
+
status: "idle",
|
|
713
|
+
instructions: ".agents/ACE/agent-docs/instructions.md",
|
|
714
|
+
parent_swarms: parentSwarms,
|
|
715
|
+
},
|
|
716
|
+
"agent-memory": {
|
|
717
|
+
group: "composable",
|
|
718
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
719
|
+
status: "idle",
|
|
720
|
+
instructions: ".agents/ACE/agent-memory/instructions.md",
|
|
721
|
+
parent_swarms: parentSwarms,
|
|
722
|
+
},
|
|
723
|
+
"agent-security": {
|
|
724
|
+
group: "composable",
|
|
725
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
726
|
+
status: "idle",
|
|
727
|
+
instructions: ".agents/ACE/agent-security/instructions.md",
|
|
728
|
+
parent_swarms: parentSwarms,
|
|
729
|
+
},
|
|
730
|
+
"agent-observability": {
|
|
731
|
+
group: "composable",
|
|
732
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
733
|
+
status: "idle",
|
|
734
|
+
instructions: ".agents/ACE/agent-observability/instructions.md",
|
|
735
|
+
parent_swarms: parentSwarms,
|
|
736
|
+
},
|
|
737
|
+
"agent-eval": {
|
|
738
|
+
group: "composable",
|
|
739
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
740
|
+
status: "idle",
|
|
741
|
+
instructions: ".agents/ACE/agent-eval/instructions.md",
|
|
742
|
+
parent_swarms: parentSwarms,
|
|
743
|
+
},
|
|
744
|
+
"agent-release": {
|
|
745
|
+
group: "composable",
|
|
746
|
+
state_dir: `./${ACE_ROOT_REL}/agent-state/`,
|
|
747
|
+
status: "idle",
|
|
748
|
+
instructions: ".agents/ACE/agent-release/instructions.md",
|
|
749
|
+
parent_swarms: parentSwarms,
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
}, null, 2), result, true);
|
|
753
|
+
writeIfMissingOrForced(wsPath("agent-state", "run-ledger.json"), JSON.stringify({ version: 1, updated_at: new Date().toISOString(), entries: [] }, null, 2), result, force);
|
|
754
|
+
writeIfMissingOrForced(wsPath("agent-state", "handoff-registry.json"), JSON.stringify({ version: 1, updated_at: new Date().toISOString(), handoffs: {} }, null, 2), result, force);
|
|
755
|
+
writeIfMissingOrForced(wsPath("agent-state", "index.json"), JSON.stringify({
|
|
756
|
+
version: 1,
|
|
757
|
+
root: ".",
|
|
758
|
+
generated_at: "",
|
|
759
|
+
discovery: {
|
|
760
|
+
mode: "ast_grep_commands",
|
|
761
|
+
command_pack: "agent-state/AST_GREP_COMMANDS.md",
|
|
762
|
+
subagent: "astgrep",
|
|
763
|
+
skill: "astgrep-index",
|
|
764
|
+
fingerprint_store: "agent-state/index-fingerprints.json",
|
|
765
|
+
},
|
|
766
|
+
options: {
|
|
767
|
+
depth: 6,
|
|
768
|
+
max_files: 10000,
|
|
769
|
+
include_hidden: false,
|
|
770
|
+
exclude: [
|
|
771
|
+
".git",
|
|
772
|
+
"node_modules",
|
|
773
|
+
"dist",
|
|
774
|
+
"target",
|
|
775
|
+
".venv",
|
|
776
|
+
"__pycache__",
|
|
777
|
+
".DS_Store",
|
|
778
|
+
],
|
|
779
|
+
file_entry_cap: 0,
|
|
780
|
+
},
|
|
781
|
+
file_count: 0,
|
|
782
|
+
stored_file_count: 0,
|
|
783
|
+
directories: {},
|
|
784
|
+
extensions: {},
|
|
785
|
+
files: {},
|
|
786
|
+
}, null, 2), result, force);
|
|
787
|
+
writeIfMissingOrForced(wsPath("agent-state", "index-fingerprints.json"), JSON.stringify({ version: 1, root: ".", generated_at: "", file_count: 0, fingerprints: {} }, null, 2), result, force);
|
|
788
|
+
writeIfMissingOrForced(wsPath("agent-state", "todo-state.json"), JSON.stringify({
|
|
789
|
+
version: 1,
|
|
790
|
+
updated_at: new Date().toISOString(),
|
|
791
|
+
source_todo_path: `${ACE_TASKS_ROOT_REL}/todo.md`,
|
|
792
|
+
order: [],
|
|
793
|
+
nodes: {},
|
|
794
|
+
}, null, 2), result, force);
|
|
795
|
+
writeIfMissingOrForced(wsPath("agent-state", "job-queue.json"), JSON.stringify({ version: 1, updated_at: new Date().toISOString(), jobs: [] }, null, 2), result, force);
|
|
796
|
+
writeIfMissingOrForced(wsPath("agent-state", "job-locks.json"), JSON.stringify({ version: 1, updated_at: new Date().toISOString(), locks: [] }, null, 2), result, force);
|
|
797
|
+
writeIfMissingOrForced(wsPath("agent-state", "scheduler-lease.json"), JSON.stringify({
|
|
798
|
+
version: 1,
|
|
799
|
+
lease_id: "LEASE-UNASSIGNED",
|
|
800
|
+
owner: "unassigned",
|
|
801
|
+
acquired_at: new Date().toISOString(),
|
|
802
|
+
heartbeat_at: new Date().toISOString(),
|
|
803
|
+
expires_at: new Date().toISOString(),
|
|
804
|
+
}, null, 2), result, force);
|
|
805
|
+
if (includeMcpConfig) {
|
|
806
|
+
writeIfMissingOrForced(acePath(".vscode", "mcp.json"), getMcpServerConfigSnippet("vscode"), result, force);
|
|
807
|
+
}
|
|
808
|
+
if (includeClientConfigBundle) {
|
|
809
|
+
const snippets = getAllMcpServerConfigSnippets();
|
|
810
|
+
for (const client of ALL_MCP_CLIENTS) {
|
|
811
|
+
writeIfMissingOrForced(getMcpClientBundlePath(client), snippets[client], result, force);
|
|
812
|
+
}
|
|
813
|
+
writeIfMissingOrForced(acePath("CLAUDE.md"), buildHostInstructionText("claude", workspaceRoot), result, force);
|
|
814
|
+
writeIfMissingOrForced(acePath(".github", "copilot-instructions.md"), buildHostInstructionText("copilot", workspaceRoot), result, force);
|
|
815
|
+
writeIfMissingOrForced(acePath(".cursorrules"), buildHostInstructionText("cursor", workspaceRoot), result, force);
|
|
816
|
+
writeIfMissingOrForced(acePath("AGENTS.md"), buildHostInstructionText("codex", workspaceRoot), result, force);
|
|
817
|
+
writeIfMissingOrForced(acePath(".claude", "settings.json"), buildClaudeHookSettings(), result, force);
|
|
818
|
+
writeIfMissingOrForced(acePath(".github", "hooks", "ace-copilot.json"), buildCopilotHookSettings(), result, force);
|
|
819
|
+
writeIfMissingOrForced(acePath(".vscode", "ace-hooks.json"), buildVsCodeHookSettings(), result, force);
|
|
820
|
+
writeIfMissingOrForced(acePath(".cursor", "hooks.json"), buildCursorHookSettings(), result, force);
|
|
821
|
+
writeIfMissingOrForced(wsPath(".mcp-config", "codex.hooks.toml"), buildCodexHookSettings(), result, force);
|
|
822
|
+
writeIfMissingOrForced(wsPath(".mcp-config", "gemini.hooks.json"), buildGeminiHookSettings(), result, force);
|
|
823
|
+
writeIfMissingOrForced(wsPath(".mcp-config", "antigravity.hooks.json"), buildAntigravityHookSettings(), result, force);
|
|
824
|
+
writeIfMissingOrForced(wsPath(".mcp-config", "README.md"), [
|
|
825
|
+
"# ACE MCP Client Config Bundle",
|
|
826
|
+
"",
|
|
827
|
+
"Generated by `ace init` so this workspace is turnkey across MCP clients.",
|
|
828
|
+
"",
|
|
829
|
+
"## Files",
|
|
830
|
+
"- `codex.config.toml`",
|
|
831
|
+
"- `vscode.mcp.json`",
|
|
832
|
+
"- `claude_desktop_config.json`",
|
|
833
|
+
"- `cursor.mcp.json`",
|
|
834
|
+
"- `antigravity.mcp.json`",
|
|
835
|
+
"",
|
|
836
|
+
"## Instruction + Hook Files",
|
|
837
|
+
`- \`${ACE_HOST_CLAUDE_REL}\``,
|
|
838
|
+
`- \`${ACE_GITHUB_ROOT_REL}/copilot-instructions.md\``,
|
|
839
|
+
`- \`${ACE_HOST_CURSOR_RULES_REL}\``,
|
|
840
|
+
`- \`${ACE_HOST_AGENTS_REL}\``,
|
|
841
|
+
`- \`${ACE_CLAUDE_ROOT_REL}/settings.json\``,
|
|
842
|
+
`- \`${ACE_VSCODE_ROOT_REL}/ace-hooks.json\``,
|
|
843
|
+
`- \`${ACE_CURSOR_ROOT_REL}/hooks.json\``,
|
|
844
|
+
`- \`${ACE_BUNDLE_ROOT_REL}/codex.hooks.toml\``,
|
|
845
|
+
`- \`${ACE_BUNDLE_ROOT_REL}/gemini.hooks.json\``,
|
|
846
|
+
`- \`${ACE_BUNDLE_ROOT_REL}/antigravity.hooks.json\``,
|
|
847
|
+
"",
|
|
848
|
+
"## Install Hints",
|
|
849
|
+
...ALL_MCP_CLIENTS.map((client) => `- ${client}: ${getMcpClientInstallHint(client)}`),
|
|
850
|
+
...(llmProvider
|
|
851
|
+
? [
|
|
852
|
+
"",
|
|
853
|
+
"## LLM Runtime Profile",
|
|
854
|
+
`- \`${ACE_LLM_ROOT_REL}/llm-profile.json\` (generated for ${llmProvider})`,
|
|
855
|
+
`- \`${ACE_LLM_ROOT_REL}/doctor-checks.md\` (commands to verify provider runtime)`,
|
|
856
|
+
llmBaseUrl
|
|
857
|
+
? `- Run \`ace doctor --llm ${llmProvider} --model ${llmModel} --base-url ${llmBaseUrl}\``
|
|
858
|
+
: llmProvider === "ollama" || llmProvider === "llama.cpp"
|
|
859
|
+
? `- Run \`ace doctor --llm ${llmProvider} --model ${llmModel} --scan\` to discover a local endpoint`
|
|
860
|
+
: `- Run \`ace doctor --llm ${llmProvider} --model ${llmModel}\` after exporting the provider credentials`,
|
|
861
|
+
]
|
|
862
|
+
: []),
|
|
863
|
+
].join("\n"), result, force);
|
|
864
|
+
}
|
|
865
|
+
if (llmProvider) {
|
|
866
|
+
const profilePayload = {
|
|
867
|
+
provider: llmProvider,
|
|
868
|
+
model: llmModel,
|
|
869
|
+
generated_at: new Date().toISOString(),
|
|
870
|
+
};
|
|
871
|
+
if (llmBaseUrl) {
|
|
872
|
+
profilePayload.base_url = llmBaseUrl;
|
|
873
|
+
if (llmProvider === "ollama") {
|
|
874
|
+
profilePayload.api_compat_base_url = buildOpenAiCompatibleBaseUrl(llmBaseUrl);
|
|
875
|
+
profilePayload.default_api_key = "ollama";
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
writeIfMissingOrForced(wsPath(".ace", "llm-profile.json"), JSON.stringify(profilePayload, null, 2), result, force);
|
|
879
|
+
const doctorCommands = buildProviderDoctorCommands(llmProvider, llmModel, llmBaseUrl);
|
|
880
|
+
writeIfMissingOrForced(wsPath(".ace", "doctor-checks.md"), [
|
|
881
|
+
`# ACE + ${llmProvider} Runtime Checks`,
|
|
882
|
+
"",
|
|
883
|
+
"Run these commands to verify ACE runtime readiness:",
|
|
884
|
+
"",
|
|
885
|
+
"```bash",
|
|
886
|
+
...doctorCommands,
|
|
887
|
+
"```",
|
|
888
|
+
"",
|
|
889
|
+
`MCP is still configured separately via \`${ACE_VSCODE_ROOT_REL}/mcp.json\` or \`${ACE_BUNDLE_ROOT_REL}/*\`.`,
|
|
890
|
+
].join("\n"), result, force);
|
|
891
|
+
}
|
|
892
|
+
return result;
|
|
893
|
+
}
|
|
894
|
+
//# sourceMappingURL=bootstrap.js.map
|