@voybio/ace-swarm 0.2.4 → 2.4.0
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 +11 -1
- package/README.md +20 -13
- package/assets/.agents/skills/eval-harness/SKILL.md +14 -0
- package/assets/.agents/skills/handoff-lint/SKILL.md +14 -0
- package/assets/.agents/skills/incident-commander/SKILL.md +14 -0
- package/assets/.agents/skills/memory-curator/SKILL.md +14 -0
- package/assets/.agents/skills/release-sentry/SKILL.md +14 -0
- package/assets/.agents/skills/risk-quant/SKILL.md +14 -0
- package/assets/.agents/skills/schema-forge/SKILL.md +14 -0
- package/assets/.agents/skills/state-auditor/SKILL.md +14 -0
- package/assets/agent-state/EVIDENCE_LOG.md +1 -1
- package/assets/agent-state/MODULES/gates/gate-correctness.json +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/WORKSPACE_SESSION_REGISTRY.schema.json +11 -0
- package/assets/agent-state/STATUS.md +2 -2
- package/assets/scripts/ace-hook-dispatch.mjs +70 -6
- package/assets/scripts/render-mcp-configs.sh +19 -5
- package/dist/ace-context.js +22 -1
- package/dist/ace-server-instructions.js +3 -3
- package/dist/ace-state-resolver.js +5 -3
- package/dist/astgrep-index.d.ts +9 -1
- package/dist/astgrep-index.js +14 -3
- package/dist/cli.js +52 -20
- 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 +288 -0
- package/dist/helpers/drift.d.ts +13 -0
- package/dist/helpers/drift.js +45 -0
- package/dist/helpers/path-utils.d.ts +17 -0
- package/dist/helpers/path-utils.js +104 -0
- package/dist/helpers/store-resolution.d.ts +19 -0
- package/dist/helpers/store-resolution.js +301 -0
- package/dist/helpers/workspace-root.d.ts +3 -0
- package/dist/helpers/workspace-root.js +80 -0
- package/dist/helpers.d.ts +8 -123
- package/dist/helpers.js +8 -1747
- package/dist/job-scheduler.js +3 -3
- package/dist/local-model-runtime.js +12 -1
- package/dist/model-bridge.d.ts +7 -0
- package/dist/model-bridge.js +75 -5
- package/dist/orchestrator-supervisor.d.ts +14 -0
- package/dist/orchestrator-supervisor.js +72 -1
- 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 +14 -0
- package/dist/runtime-executor.js +669 -171
- package/dist/runtime-profile.d.ts +32 -0
- package/dist/runtime-profile.js +89 -13
- package/dist/runtime-tool-specs.d.ts +21 -0
- package/dist/runtime-tool-specs.js +78 -3
- package/dist/safe-edit.d.ts +7 -0
- package/dist/safe-edit.js +163 -37
- package/dist/schemas.js +19 -0
- package/dist/shared.d.ts +2 -2
- 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 +1 -1
- package/dist/store/bootstrap-store.js +94 -81
- package/dist/store/cache-workspace.d.ts +22 -0
- package/dist/store/cache-workspace.js +149 -0
- package/dist/store/materializers/context-snapshot-materializer.js +6 -7
- 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/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.js +319 -34
- package/dist/tools-discovery.js +1 -1
- package/dist/tools-files.d.ts +7 -0
- package/dist/tools-files.js +299 -10
- package/dist/tools-framework.js +107 -27
- 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/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/vericify-bridge.d.ts +5 -0
- 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
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { createAceServer } from "./server.js";
|
|
4
|
-
function isPlainObject(value) {
|
|
5
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
6
|
-
}
|
|
7
|
-
function isZodSchema(value) {
|
|
8
|
-
return Boolean(value) && typeof value === "object" && "safeParseAsync" in value;
|
|
9
|
-
}
|
|
10
|
-
function buildZodObject(shape) {
|
|
11
|
-
if (!isPlainObject(shape))
|
|
12
|
-
return undefined;
|
|
13
|
-
const values = Object.values(shape);
|
|
14
|
-
if (!values.every((value) => isZodSchema(value)))
|
|
15
|
-
return undefined;
|
|
16
|
-
return z.object(shape);
|
|
17
|
-
}
|
|
18
|
-
function describeSchema(schema) {
|
|
19
|
-
if (isPlainObject(schema)) {
|
|
20
|
-
const properties = Object.fromEntries(Object.entries(schema).map(([key, value]) => [
|
|
21
|
-
key,
|
|
22
|
-
{
|
|
23
|
-
description: isZodSchema(value)
|
|
24
|
-
? value.description ?? value._def?.typeName ?? "input"
|
|
25
|
-
: "input",
|
|
26
|
-
},
|
|
27
|
-
]));
|
|
28
|
-
return { type: "object", properties };
|
|
29
|
-
}
|
|
30
|
-
if (isZodSchema(schema)) {
|
|
31
|
-
return {
|
|
32
|
-
type: schema._def?.typeName ?? "schema",
|
|
33
|
-
description: schema.description ?? "tool input",
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
function summarizeResult(name, result) {
|
|
39
|
-
const textBlocks = Array.isArray(result.content)
|
|
40
|
-
? result.content
|
|
41
|
-
.filter((entry) => {
|
|
42
|
-
return isPlainObject(entry) && entry.type === "text" && typeof entry.text === "string";
|
|
43
|
-
})
|
|
44
|
-
.map((entry) => entry.text.trim())
|
|
45
|
-
.filter(Boolean)
|
|
46
|
-
: [];
|
|
47
|
-
const summary = textBlocks[0] ?? `${name} completed`;
|
|
48
|
-
return summary.length <= 240 ? summary : `${summary.slice(0, 239).trimEnd()}…`;
|
|
49
|
-
}
|
|
50
|
-
let cachedTools;
|
|
51
|
-
function getRegisteredTools() {
|
|
52
|
-
if (cachedTools)
|
|
53
|
-
return cachedTools;
|
|
54
|
-
const server = createAceServer({ toolGovernance: false });
|
|
55
|
-
const registry = server
|
|
56
|
-
._registeredTools;
|
|
57
|
-
cachedTools = new Map(Object.entries(registry ?? {}).filter(([, tool]) => tool.enabled !== false));
|
|
58
|
-
return cachedTools;
|
|
59
|
-
}
|
|
60
|
-
export function listInternalTools(toolScope) {
|
|
61
|
-
const allowed = toolScope ? new Set(toolScope) : undefined;
|
|
62
|
-
return [...getRegisteredTools().entries()]
|
|
63
|
-
.filter(([name]) => !allowed || allowed.has(name))
|
|
64
|
-
.map(([name, tool]) => ({
|
|
65
|
-
name,
|
|
66
|
-
description: tool.description ?? tool.title ?? "ACE MCP tool",
|
|
67
|
-
inputSchema: describeSchema(tool.inputSchema),
|
|
68
|
-
outputSchema: describeSchema(tool.outputSchema),
|
|
69
|
-
}))
|
|
70
|
-
.sort((left, right) => left.name.localeCompare(right.name));
|
|
71
|
-
}
|
|
72
|
-
export async function executeInternalTool(name, args = {}, context = {}) {
|
|
73
|
-
const tool = getRegisteredTools().get(name);
|
|
74
|
-
if (!tool) {
|
|
75
|
-
return {
|
|
76
|
-
ok: false,
|
|
77
|
-
name,
|
|
78
|
-
summary: `Unknown tool: ${name}`,
|
|
79
|
-
error: `Unknown tool: ${name}`,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
let validatedArgs = args;
|
|
83
|
-
try {
|
|
84
|
-
if (tool.inputSchema) {
|
|
85
|
-
const schema = isZodSchema(tool.inputSchema) ? tool.inputSchema : buildZodObject(tool.inputSchema);
|
|
86
|
-
if (schema) {
|
|
87
|
-
const parsed = await schema.safeParseAsync(args);
|
|
88
|
-
if (!parsed.success) {
|
|
89
|
-
const message = parsed.error.issues.map((issue) => issue.message).join("; ");
|
|
90
|
-
return {
|
|
91
|
-
ok: false,
|
|
92
|
-
name,
|
|
93
|
-
summary: `Input validation failed for ${name}`,
|
|
94
|
-
error: message,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
if (isPlainObject(parsed.data)) {
|
|
98
|
-
validatedArgs = parsed.data;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const extra = {
|
|
103
|
-
signal: new AbortController().signal,
|
|
104
|
-
sessionId: context.sessionId ?? `internal-${randomUUID()}`,
|
|
105
|
-
requestId: `internal-${randomUUID()}`,
|
|
106
|
-
sendNotification: async () => undefined,
|
|
107
|
-
sendRequest: async () => {
|
|
108
|
-
throw new Error("Internal tool runtime does not support nested MCP requests.");
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
const raw = tool.inputSchema
|
|
112
|
-
? await tool.handler(validatedArgs, extra)
|
|
113
|
-
: await tool.handler(extra);
|
|
114
|
-
const result = raw;
|
|
115
|
-
return {
|
|
116
|
-
ok: !Boolean(result?.isError),
|
|
117
|
-
name,
|
|
118
|
-
summary: summarizeResult(name, result),
|
|
119
|
-
result,
|
|
120
|
-
error: result.isError ? summarizeResult(name, result) : undefined,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
125
|
-
return {
|
|
126
|
-
ok: false,
|
|
127
|
-
name,
|
|
128
|
-
summary: `${name} failed`,
|
|
129
|
-
error: message,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
export function resetInternalToolRuntime() {
|
|
134
|
-
cachedTools = undefined;
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=internal-tool-runtime.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface WorkspaceSnapshotFileRecord {
|
|
2
|
-
path: string;
|
|
3
|
-
size: number;
|
|
4
|
-
mtime_ms: number;
|
|
5
|
-
encoding: "utf8" | "base64";
|
|
6
|
-
key: string;
|
|
7
|
-
virtual_path: string;
|
|
8
|
-
}
|
|
9
|
-
export interface WorkspaceSnapshotResult {
|
|
10
|
-
version: 1;
|
|
11
|
-
captured_at: string;
|
|
12
|
-
session_id: string;
|
|
13
|
-
source_workspace_path: string;
|
|
14
|
-
virtual_root: string;
|
|
15
|
-
manifest_key: string;
|
|
16
|
-
manifest_path: string;
|
|
17
|
-
file_count: number;
|
|
18
|
-
files: WorkspaceSnapshotFileRecord[];
|
|
19
|
-
skipped_paths: Array<{
|
|
20
|
-
path: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
|
24
|
-
export declare function workspaceSnapshotVirtualRoot(workspaceRoot: string, sessionId: string): string;
|
|
25
|
-
export declare function persistWorkspaceSnapshot(workspaceRoot: string, sessionId: string, sourceWorkspacePath: string): Promise<WorkspaceSnapshotResult>;
|
|
26
|
-
//# sourceMappingURL=workspace-snapshot.d.ts.map
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
-
import { relative, resolve, sep } from "node:path";
|
|
3
|
-
import { openStore } from "./ace-packed-store.js";
|
|
4
|
-
import { getWorkspaceStorePath, toVirtualStorePath } from "./store-snapshot.js";
|
|
5
|
-
import { withStoreWriteQueue } from "./write-queue.js";
|
|
6
|
-
function normalizeRelPath(path) {
|
|
7
|
-
return path.split(sep).join("/");
|
|
8
|
-
}
|
|
9
|
-
function workspaceSnapshotPrefix(sessionId) {
|
|
10
|
-
return `state/runtime/executor/sessions/${sessionId}/workspace`;
|
|
11
|
-
}
|
|
12
|
-
function workspaceSnapshotFileKey(sessionId, relPath) {
|
|
13
|
-
return `${workspaceSnapshotPrefix(sessionId)}/files/${normalizeRelPath(relPath)}`;
|
|
14
|
-
}
|
|
15
|
-
function workspaceSnapshotManifestKey(sessionId) {
|
|
16
|
-
return `${workspaceSnapshotPrefix(sessionId)}/manifest.json`;
|
|
17
|
-
}
|
|
18
|
-
function encodeBuffer(content) {
|
|
19
|
-
const utf8 = content.toString("utf8");
|
|
20
|
-
if (Buffer.from(utf8, "utf8").equals(content)) {
|
|
21
|
-
return { encoding: "utf8", body: utf8 };
|
|
22
|
-
}
|
|
23
|
-
return { encoding: "base64", body: content.toString("base64") };
|
|
24
|
-
}
|
|
25
|
-
function collectWorkspaceFiles(rootPath, currentPath, output, skipped) {
|
|
26
|
-
const entries = readdirSync(currentPath, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
27
|
-
for (const entry of entries) {
|
|
28
|
-
const absPath = resolve(currentPath, entry.name);
|
|
29
|
-
const relPath = normalizeRelPath(relative(rootPath, absPath));
|
|
30
|
-
if (entry.isSymbolicLink()) {
|
|
31
|
-
skipped.push({ path: relPath, reason: "symlink" });
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (entry.isDirectory()) {
|
|
35
|
-
collectWorkspaceFiles(rootPath, absPath, output, skipped);
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
if (entry.isFile()) {
|
|
39
|
-
output.push({ absPath, relPath });
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
skipped.push({ path: relPath, reason: "unsupported_entry_type" });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export function workspaceSnapshotVirtualRoot(workspaceRoot, sessionId) {
|
|
46
|
-
return toVirtualStorePath(getWorkspaceStorePath(workspaceRoot), workspaceSnapshotPrefix(sessionId));
|
|
47
|
-
}
|
|
48
|
-
export async function persistWorkspaceSnapshot(workspaceRoot, sessionId, sourceWorkspacePath) {
|
|
49
|
-
const files = [];
|
|
50
|
-
const skipped = [];
|
|
51
|
-
collectWorkspaceFiles(sourceWorkspacePath, sourceWorkspacePath, files, skipped);
|
|
52
|
-
const storePath = getWorkspaceStorePath(workspaceRoot);
|
|
53
|
-
const manifestKey = workspaceSnapshotManifestKey(sessionId);
|
|
54
|
-
const virtualRoot = workspaceSnapshotVirtualRoot(workspaceRoot, sessionId);
|
|
55
|
-
const capturedAt = new Date().toISOString();
|
|
56
|
-
const manifestFiles = [];
|
|
57
|
-
await withStoreWriteQueue(storePath, async () => {
|
|
58
|
-
const store = await openStore(storePath);
|
|
59
|
-
try {
|
|
60
|
-
for (const file of files) {
|
|
61
|
-
const content = readFileSync(file.absPath);
|
|
62
|
-
const stats = statSync(file.absPath);
|
|
63
|
-
const encoded = encodeBuffer(content);
|
|
64
|
-
const key = workspaceSnapshotFileKey(sessionId, file.relPath);
|
|
65
|
-
await store.setBlob(key, encoded.body);
|
|
66
|
-
manifestFiles.push({
|
|
67
|
-
path: file.relPath,
|
|
68
|
-
size: stats.size,
|
|
69
|
-
mtime_ms: stats.mtimeMs,
|
|
70
|
-
encoding: encoded.encoding,
|
|
71
|
-
key,
|
|
72
|
-
virtual_path: toVirtualStorePath(storePath, key),
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const manifest = {
|
|
76
|
-
version: 1,
|
|
77
|
-
captured_at: capturedAt,
|
|
78
|
-
session_id: sessionId,
|
|
79
|
-
source_workspace_path: sourceWorkspacePath,
|
|
80
|
-
virtual_root: virtualRoot,
|
|
81
|
-
manifest_key: manifestKey,
|
|
82
|
-
manifest_path: toVirtualStorePath(storePath, manifestKey),
|
|
83
|
-
file_count: manifestFiles.length,
|
|
84
|
-
files: manifestFiles,
|
|
85
|
-
skipped_paths: skipped,
|
|
86
|
-
};
|
|
87
|
-
await store.setJSON(manifestKey, manifest);
|
|
88
|
-
await store.commit();
|
|
89
|
-
}
|
|
90
|
-
finally {
|
|
91
|
-
await store.close();
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
return {
|
|
95
|
-
version: 1,
|
|
96
|
-
captured_at: capturedAt,
|
|
97
|
-
session_id: sessionId,
|
|
98
|
-
source_workspace_path: sourceWorkspacePath,
|
|
99
|
-
virtual_root: virtualRoot,
|
|
100
|
-
manifest_key: manifestKey,
|
|
101
|
-
manifest_path: toVirtualStorePath(storePath, manifestKey),
|
|
102
|
-
file_count: manifestFiles.length,
|
|
103
|
-
files: manifestFiles,
|
|
104
|
-
skipped_paths: skipped,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=workspace-snapshot.js.map
|