@voybio/ace-swarm 2.4.4 → 2.4.6
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 +69 -0
- package/README.md +72 -532
- package/assets/eval-battery/battery.json +85 -0
- package/assets/eval-battery/fixtures/edit-target.js +3 -0
- package/assets/scripts/render-mcp-configs.sh +12 -0
- package/dist/ace-context.d.ts +18 -0
- package/dist/ace-context.js +161 -16
- package/dist/ace-server-instructions.js +36 -9
- package/dist/bridge-trace.d.ts +17 -0
- package/dist/bridge-trace.js +23 -0
- package/dist/cli.d.ts +9 -1
- package/dist/cli.js +619 -10
- package/dist/discovery-runtime-wrappers.d.ts +16 -1
- package/dist/discovery-runtime-wrappers.js +65 -9
- package/dist/eval-harness.d.ts +110 -0
- package/dist/eval-harness.js +254 -0
- package/dist/experience-reflector.d.ts +13 -0
- package/dist/experience-reflector.js +62 -0
- package/dist/goal-engine.d.ts +155 -0
- package/dist/goal-engine.js +795 -0
- package/dist/helpers/store-resolution.js +40 -39
- package/dist/hermes/session-manager.d.ts +10 -0
- package/dist/hermes/session-manager.js +130 -27
- package/dist/job-scheduler.d.ts +58 -0
- package/dist/job-scheduler.js +202 -2
- package/dist/job-worker.d.ts +87 -0
- package/dist/job-worker.js +182 -0
- package/dist/local-model-policy.d.ts +8 -2
- package/dist/local-model-policy.js +31 -17
- package/dist/local-model-runtime.d.ts +6 -0
- package/dist/local-model-runtime.js +130 -2
- package/dist/measured-classing.d.ts +66 -0
- package/dist/measured-classing.js +165 -0
- package/dist/model-bridge.d.ts +45 -0
- package/dist/model-bridge.js +502 -44
- package/dist/orchestrator-supervisor.js +1 -1
- package/dist/plan-proposal.d.ts +7 -0
- package/dist/plan-proposal.js +74 -4
- package/dist/playbook-adaptation.d.ts +37 -0
- package/dist/playbook-adaptation.js +159 -0
- package/dist/playbook-curator.d.ts +16 -0
- package/dist/playbook-curator.js +106 -0
- package/dist/playbook-llm-reflector.d.ts +26 -0
- package/dist/playbook-llm-reflector.js +157 -0
- package/dist/public-surface.d.ts +2 -0
- package/dist/public-surface.js +26 -14
- package/dist/safe-edit.d.ts +20 -0
- package/dist/safe-edit.js +355 -78
- package/dist/server.d.ts +11 -2
- package/dist/server.js +55 -5
- package/dist/shared.d.ts +12 -0
- package/dist/shared.js +13 -1
- package/dist/source-mutation-coordinator.d.ts +54 -0
- package/dist/source-mutation-coordinator.js +259 -0
- package/dist/status-events.d.ts +4 -1
- package/dist/status-events.js +41 -6
- package/dist/store/ace-packed-store.d.ts +28 -9
- package/dist/store/ace-packed-store.js +324 -57
- package/dist/store/bgzf.d.ts +4 -0
- package/dist/store/bgzf.js +94 -0
- package/dist/store/bootstrap-store.d.ts +4 -1
- package/dist/store/bootstrap-store.js +57 -3
- package/dist/store/cache-workspace.d.ts +8 -0
- package/dist/store/cache-workspace.js +67 -1
- package/dist/store/crc32.d.ts +2 -0
- package/dist/store/crc32.js +16 -0
- package/dist/store/fsck.d.ts +16 -0
- package/dist/store/fsck.js +240 -0
- package/dist/store/materializers/context-snapshot-materializer.d.ts +1 -0
- package/dist/store/materializers/context-snapshot-materializer.js +4 -1
- package/dist/store/materializers/projection-manager.d.ts +7 -0
- package/dist/store/materializers/projection-manager.js +37 -0
- package/dist/store/materializers/scheduler-projection-materializer.js +10 -3
- package/dist/store/repositories/goal-repository.d.ts +112 -0
- package/dist/store/repositories/goal-repository.js +157 -0
- package/dist/store/repositories/playbook-repository.d.ts +107 -0
- package/dist/store/repositories/playbook-repository.js +314 -0
- package/dist/store/store-artifacts.js +44 -2
- package/dist/store/store-authority-audit.js +1 -0
- package/dist/store/store-cli.d.ts +30 -0
- package/dist/store/store-cli.js +242 -0
- package/dist/store/store-snapshot.d.ts +12 -0
- package/dist/store/store-snapshot.js +74 -11
- package/dist/store/types.d.ts +1 -0
- package/dist/store/write-coordinator.d.ts +7 -0
- package/dist/store/write-coordinator.js +11 -0
- package/dist/todo-state.d.ts +21 -0
- package/dist/todo-state.js +150 -53
- package/dist/tools-agent.js +86 -22
- package/dist/tools-discovery.js +5 -3
- package/dist/tools-files.js +39 -18
- package/dist/tools-framework.js +31 -3
- package/dist/tools-goal.d.ts +11 -0
- package/dist/tools-goal.js +108 -0
- package/dist/tools-handoff.js +7 -11
- package/dist/tools-lifecycle.js +2 -0
- package/dist/tools-scheduler.js +44 -1
- package/dist/tools-skills.js +3 -2
- package/dist/tools-todo.js +64 -3
- package/dist/tools.js +2 -0
- package/dist/tui/chat.js +4 -0
- package/dist/tui/index.js +4 -1
- package/dist/tui/ollama.d.ts +2 -0
- package/dist/tui/openai-compatible.d.ts +14 -0
- package/dist/tui/openai-compatible.js +15 -2
- package/dist/tui/provider-discovery.d.ts +1 -0
- package/dist/tui/provider-discovery.js +2 -2
- package/docs/cli-reference.md +125 -0
- package/docs/development.md +46 -0
- package/docs/evaluation-safety.md +27 -0
- package/docs/experience-playbook.md +35 -0
- package/docs/hermes.md +129 -0
- package/docs/library-api.md +31 -0
- package/docs/mcp-tool-reference.md +290 -0
- package/docs/provider-security.md +85 -0
- package/docs/state-model.md +113 -0
- package/docs/troubleshooting.md +95 -0
- package/docs/tui-operator-guide.md +75 -0
- package/package.json +3 -1
- package/scripts/dev/run_hermes_crispr_live.mjs +212 -0
package/dist/public-surface.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { existsSync,
|
|
1
|
+
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import { dirname, extname, join, resolve } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { PACKAGE_ROOT, resolveWorkspaceRoot } from "./helpers.js";
|
|
4
|
+
import { PACKAGE_ROOT, resolveWorkspaceRoot, safeWrite } from "./helpers.js";
|
|
5
5
|
import { EVENT_TYPE } from "./shared.js";
|
|
6
6
|
export const PUBLIC_SURFACE_REPORT_REL_PATH = "agent-state/PUBLIC_SURFACE_REPORT.md";
|
|
7
7
|
const SCHEMA_REQUIREMENTS = {
|
|
@@ -116,13 +116,6 @@ function workspaceRoot() {
|
|
|
116
116
|
function reportPath(relPath = PUBLIC_SURFACE_REPORT_REL_PATH) {
|
|
117
117
|
return resolve(workspaceRoot(), relPath);
|
|
118
118
|
}
|
|
119
|
-
function safeWriteReport(filePath, content) {
|
|
120
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
121
|
-
const tmpPath = `${filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
122
|
-
writeFileSync(tmpPath, content, "utf-8");
|
|
123
|
-
renameSync(tmpPath, filePath);
|
|
124
|
-
return filePath;
|
|
125
|
-
}
|
|
126
119
|
async function collectSurfaceEntries() {
|
|
127
120
|
const entries = [];
|
|
128
121
|
const [{ registerTools }, { registerResources }, { registerPrompts }] = await Promise.all([
|
|
@@ -162,7 +155,7 @@ async function collectSurfaceEntries() {
|
|
|
162
155
|
registerPrompts(stub);
|
|
163
156
|
return entries.sort((left, right) => left.id.localeCompare(right.id));
|
|
164
157
|
}
|
|
165
|
-
function
|
|
158
|
+
function walkRuntimeSourceFiles(root) {
|
|
166
159
|
const files = [];
|
|
167
160
|
const visit = (dirPath) => {
|
|
168
161
|
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
@@ -176,8 +169,9 @@ function walkTypescriptFiles(root) {
|
|
|
176
169
|
visit(absolutePath);
|
|
177
170
|
continue;
|
|
178
171
|
}
|
|
179
|
-
if (extname(entry.name)
|
|
172
|
+
if ([".ts", ".js"].includes(extname(entry.name)) && !entry.name.endsWith(".d.ts")) {
|
|
180
173
|
files.push(absolutePath);
|
|
174
|
+
}
|
|
181
175
|
}
|
|
182
176
|
};
|
|
183
177
|
visit(root);
|
|
@@ -185,7 +179,7 @@ function walkTypescriptFiles(root) {
|
|
|
185
179
|
}
|
|
186
180
|
function collectEmittedEventTypes() {
|
|
187
181
|
const srcRoot = dirname(fileURLToPath(import.meta.url));
|
|
188
|
-
const files =
|
|
182
|
+
const files = walkRuntimeSourceFiles(srcRoot);
|
|
189
183
|
const discovered = new Set();
|
|
190
184
|
const patterns = [
|
|
191
185
|
/event_type:\s*"([A-Z][A-Z0-9_]+)"/g,
|
|
@@ -272,10 +266,24 @@ export function auditPublicSurface(options) {
|
|
|
272
266
|
const packageAbs = resolve(PACKAGE_ROOT, "assets", relPath);
|
|
273
267
|
if (!existsSync(abs) && !existsSync(packageAbs)) {
|
|
274
268
|
failures.push(`schema file missing for ${surfaceId}: ${relPath}`);
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
const schemaPath = existsSync(abs) ? abs : packageAbs;
|
|
272
|
+
try {
|
|
273
|
+
const schema = JSON.parse(readFileSync(schemaPath, "utf-8"));
|
|
274
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
|
|
275
|
+
failures.push(`schema file is not a JSON object for ${surfaceId}: ${relPath}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
failures.push(`schema file is invalid JSON for ${surfaceId}: ${relPath} (${error instanceof Error ? error.message : String(error)})`);
|
|
275
280
|
}
|
|
276
281
|
}
|
|
277
282
|
}
|
|
278
283
|
const eventRegistry = new Set(Object.values(EVENT_TYPE));
|
|
284
|
+
if (emittedEvents.length === 0) {
|
|
285
|
+
failures.push("no emitted event types discovered in the production runtime sources");
|
|
286
|
+
}
|
|
279
287
|
for (const eventType of emittedEvents) {
|
|
280
288
|
if (!eventRegistry.has(eventType)) {
|
|
281
289
|
failures.push(`event type emitted without shared registry entry: ${eventType}`);
|
|
@@ -292,7 +300,8 @@ export function auditPublicSurface(options) {
|
|
|
292
300
|
emitted_events: emittedEvents.length,
|
|
293
301
|
schema_bound_surfaces: Object.keys(SCHEMA_REQUIREMENTS).length,
|
|
294
302
|
};
|
|
295
|
-
const
|
|
303
|
+
const artifactRelPath = options?.artifact_path || PUBLIC_SURFACE_REPORT_REL_PATH;
|
|
304
|
+
const report_path = reportPath(artifactRelPath);
|
|
296
305
|
const result = {
|
|
297
306
|
ok: failures.length === 0,
|
|
298
307
|
summary,
|
|
@@ -301,8 +310,9 @@ export function auditPublicSurface(options) {
|
|
|
301
310
|
surfaces,
|
|
302
311
|
emitted_events: emittedEvents,
|
|
303
312
|
};
|
|
313
|
+
let written_path;
|
|
304
314
|
if (options?.write_artifact !== false) {
|
|
305
|
-
|
|
315
|
+
written_path = safeWrite(artifactRelPath, renderReport(result));
|
|
306
316
|
}
|
|
307
317
|
else if (!existsSync(report_path)) {
|
|
308
318
|
warnings.push(`public surface report missing: ${report_path}`);
|
|
@@ -310,6 +320,8 @@ export function auditPublicSurface(options) {
|
|
|
310
320
|
return {
|
|
311
321
|
...result,
|
|
312
322
|
report_path,
|
|
323
|
+
artifact_path: artifactRelPath,
|
|
324
|
+
written_path,
|
|
313
325
|
};
|
|
314
326
|
});
|
|
315
327
|
}
|
package/dist/safe-edit.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface SafeEditInput {
|
|
|
7
7
|
path: string;
|
|
8
8
|
/** New file content. */
|
|
9
9
|
content: string;
|
|
10
|
+
/** Optional full sha256:<hex> source precondition checked immediately before promotion. */
|
|
11
|
+
expected_base_hash?: string;
|
|
10
12
|
/** Shell command to validate the change (e.g., "npx tsc --noEmit"). */
|
|
11
13
|
validation_command?: string;
|
|
12
14
|
/** Shell command to run tests (e.g., "npm test"). */
|
|
@@ -26,6 +28,11 @@ export interface SafeEditResult {
|
|
|
26
28
|
test_passed?: boolean;
|
|
27
29
|
test_output?: string;
|
|
28
30
|
error?: string;
|
|
31
|
+
reason_code?: string;
|
|
32
|
+
expected_hash?: string;
|
|
33
|
+
observed_hash?: string;
|
|
34
|
+
lease_lock_path?: string;
|
|
35
|
+
lease_waited_ms?: number;
|
|
29
36
|
restored?: boolean;
|
|
30
37
|
}
|
|
31
38
|
export interface TestSuiteResult {
|
|
@@ -43,6 +50,18 @@ export interface DiffResult {
|
|
|
43
50
|
removed: number;
|
|
44
51
|
diff_summary: string;
|
|
45
52
|
}
|
|
53
|
+
export interface GcStagingInput {
|
|
54
|
+
max_age_hours?: number;
|
|
55
|
+
max_entries?: number;
|
|
56
|
+
}
|
|
57
|
+
export interface GcStagingResult {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
staging_path: string;
|
|
60
|
+
removed_entries: number;
|
|
61
|
+
kept_entries: number;
|
|
62
|
+
errors: string[];
|
|
63
|
+
}
|
|
64
|
+
export declare function gcStaging(input?: GcStagingInput): GcStagingResult;
|
|
46
65
|
export declare function safeEditFile(input: SafeEditInput): SafeEditResult;
|
|
47
66
|
export declare function runTestSuite(command?: string): TestSuiteResult;
|
|
48
67
|
export declare function diffContents(original: string, updated: string): DiffResult;
|
|
@@ -52,6 +71,7 @@ export declare function diffFiles(pathA: string, pathB: string): DiffResult & {
|
|
|
52
71
|
export interface ApplyPatchInput {
|
|
53
72
|
path: string;
|
|
54
73
|
patch: string;
|
|
74
|
+
expected_base_hash?: string;
|
|
55
75
|
validation_command?: string;
|
|
56
76
|
test_command?: string;
|
|
57
77
|
}
|