@voybio/ace-swarm 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -29
- package/assets/agent-state/EVIDENCE_LOG.md +1 -1
- package/assets/agent-state/STATUS.md +2 -2
- package/assets/scripts/ace-hook-dispatch.mjs +1 -1
- package/dist/ace-autonomy.js +38 -1
- package/dist/ace-context.js +8 -0
- package/dist/ace-server-instructions.js +55 -19
- package/dist/ace-state-resolver.d.ts +18 -0
- package/dist/ace-state-resolver.js +106 -0
- package/dist/cli.js +74 -7
- package/dist/handoff-registry.js +11 -7
- package/dist/helpers.js +75 -9
- package/dist/job-scheduler.js +94 -44
- package/dist/run-ledger.js +3 -4
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/status-events.js +12 -14
- package/dist/store/ace-packed-store.d.ts +65 -26
- package/dist/store/ace-packed-store.js +448 -261
- package/dist/store/bootstrap-store.d.ts +1 -1
- package/dist/store/bootstrap-store.js +24 -13
- package/dist/store/catalog-builder.js +3 -3
- package/dist/store/importer.d.ts +2 -2
- package/dist/store/importer.js +2 -2
- package/dist/store/materializers/context-snapshot-materializer.d.ts +10 -0
- package/dist/store/materializers/context-snapshot-materializer.js +51 -0
- package/dist/store/materializers/hook-context-materializer.d.ts +1 -1
- package/dist/store/materializers/hook-context-materializer.js +1 -1
- package/dist/store/materializers/host-file-materializer.d.ts +6 -0
- package/dist/store/materializers/host-file-materializer.js +14 -1
- package/dist/store/materializers/projection-manager.d.ts +14 -0
- package/dist/store/materializers/projection-manager.js +73 -0
- package/dist/store/materializers/scheduler-projection-materializer.d.ts +16 -0
- package/dist/store/materializers/scheduler-projection-materializer.js +48 -0
- package/dist/store/repositories/context-snapshot-repository.d.ts +46 -0
- package/dist/store/repositories/context-snapshot-repository.js +105 -0
- package/dist/store/repositories/local-model-runtime-repository.d.ts +98 -0
- package/dist/store/repositories/local-model-runtime-repository.js +165 -0
- package/dist/store/repositories/scheduler-repository.d.ts +21 -39
- package/dist/store/repositories/scheduler-repository.js +123 -93
- package/dist/store/repositories/todo-repository.d.ts +4 -0
- package/dist/store/repositories/todo-repository.js +50 -0
- package/dist/store/skills-install.d.ts +1 -1
- package/dist/store/skills-install.js +3 -3
- package/dist/store/state-reader.d.ts +8 -1
- package/dist/store/state-reader.js +19 -13
- package/dist/store/store-artifacts.js +105 -41
- package/dist/store/store-authority-audit.d.ts +30 -0
- package/dist/store/store-authority-audit.js +448 -0
- package/dist/store/store-snapshot.js +3 -3
- package/dist/store/types.d.ts +6 -2
- package/dist/store/types.js +5 -2
- package/dist/todo-state.js +179 -11
- package/dist/tools-files.js +2 -1
- package/dist/tools-framework.js +62 -2
- package/dist/tools-memory.js +69 -34
- package/dist/tools-todo.js +1 -1
- package/dist/tui/agent-worker.d.ts +1 -1
- package/dist/tui/agent-worker.js +5 -3
- package/dist/tui/chat.d.ts +19 -0
- package/dist/tui/chat.js +275 -9
- package/dist/tui/commands.d.ts +2 -0
- package/dist/tui/commands.js +62 -0
- package/dist/tui/dashboard.d.ts +6 -1
- package/dist/tui/dashboard.js +44 -3
- package/dist/tui/index.d.ts +5 -0
- package/dist/tui/index.js +154 -0
- package/dist/tui/input.js +5 -0
- package/dist/tui/layout.d.ts +24 -0
- package/dist/tui/layout.js +76 -2
- package/dist/tui/local-model-contract.d.ts +50 -0
- package/dist/tui/local-model-contract.js +272 -0
- package/dist/vericify-bridge.js +3 -4
- package/dist/vericify-context.js +18 -6
- package/package.json +4 -6
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { readStoreBlobSync, readStoreJsonSync } from "../store/store-snapshot.js";
|
|
2
|
+
import { resolveAceStateLayout, readAceLogicalFile } from "../ace-state-resolver.js";
|
|
3
|
+
function oneLine(input) {
|
|
4
|
+
return input.replace(/\s+/g, " ").trim();
|
|
5
|
+
}
|
|
6
|
+
function clip(input, max = 220) {
|
|
7
|
+
if (input.length <= max)
|
|
8
|
+
return input;
|
|
9
|
+
return `${input.slice(0, Math.max(0, max - 1)).trimEnd()}…`;
|
|
10
|
+
}
|
|
11
|
+
function extractObjective(taskRaw) {
|
|
12
|
+
if (!taskRaw)
|
|
13
|
+
return undefined;
|
|
14
|
+
const objectiveMatch = taskRaw.match(/## Objective\s+([\s\S]*?)(?:\n## |\n# |$)/);
|
|
15
|
+
if (objectiveMatch?.[1]) {
|
|
16
|
+
return clip(oneLine(objectiveMatch[1]));
|
|
17
|
+
}
|
|
18
|
+
const bodyLine = taskRaw
|
|
19
|
+
.split(/\r?\n/)
|
|
20
|
+
.map((line) => line.trim())
|
|
21
|
+
.find((line) => line.length > 0 && !line.startsWith("#"));
|
|
22
|
+
return bodyLine ? clip(oneLine(bodyLine)) : undefined;
|
|
23
|
+
}
|
|
24
|
+
function extractStatusField(statusRaw, label) {
|
|
25
|
+
if (!statusRaw)
|
|
26
|
+
return undefined;
|
|
27
|
+
const pattern = new RegExp(`^- ${label}:\\s*(.+)$`, "im");
|
|
28
|
+
const match = statusRaw.match(pattern);
|
|
29
|
+
return match?.[1] ? clip(oneLine(match[1])) : undefined;
|
|
30
|
+
}
|
|
31
|
+
function determineRole(task, preferredRole) {
|
|
32
|
+
const lowered = task.toLowerCase();
|
|
33
|
+
if (preferredRole && preferredRole !== "orchestrator") {
|
|
34
|
+
return preferredRole;
|
|
35
|
+
}
|
|
36
|
+
if (/\b(doc|docs|readme|changelog|guide)\b/.test(lowered))
|
|
37
|
+
return "docs";
|
|
38
|
+
if (/\b(test|qa|verify|regression|assert|review)\b/.test(lowered))
|
|
39
|
+
return "qa";
|
|
40
|
+
if (/\b(ui|design|layout|ux|css|frontend)\b/.test(lowered))
|
|
41
|
+
return "ui";
|
|
42
|
+
if (/\b(research|investigate|compare|audit|analyze|analysis)\b/.test(lowered))
|
|
43
|
+
return "research";
|
|
44
|
+
if (/\b(spec|schema|contract|interface)\b/.test(lowered))
|
|
45
|
+
return "spec";
|
|
46
|
+
if (/\b(build|implement|fix|patch|code|refactor|wire|edit)\b/.test(lowered))
|
|
47
|
+
return "coders";
|
|
48
|
+
return "orchestrator";
|
|
49
|
+
}
|
|
50
|
+
export function shouldSynthesizeShortPlan(task) {
|
|
51
|
+
const lowered = task.toLowerCase();
|
|
52
|
+
const signals = [
|
|
53
|
+
/\b(compare|investigate|analyze)\b.*\b(implement|fix|change|edit)\b/,
|
|
54
|
+
/\b(implement|fix|change|edit)\b.*\b(test|verify|review|qa)\b/,
|
|
55
|
+
/\b(multi-step|multiple|several)\b/,
|
|
56
|
+
/\b(and|then)\b/,
|
|
57
|
+
/\bcompare\b/,
|
|
58
|
+
/\bmodify\b.*\bverify\b/,
|
|
59
|
+
];
|
|
60
|
+
return signals.some((pattern) => pattern.test(lowered));
|
|
61
|
+
}
|
|
62
|
+
function buildRecallSummary(workspaceRoot) {
|
|
63
|
+
const taskRaw = readAceLogicalFile(workspaceRoot, "agent-state/TASK.md");
|
|
64
|
+
const statusRaw = readAceLogicalFile(workspaceRoot, "agent-state/STATUS.md");
|
|
65
|
+
const objective = extractObjective(taskRaw);
|
|
66
|
+
const phase = extractStatusField(statusRaw, "Current phase");
|
|
67
|
+
const blockers = extractStatusField(statusRaw, "Blockers");
|
|
68
|
+
const parts = [
|
|
69
|
+
objective ? `task=${objective}` : undefined,
|
|
70
|
+
phase ? `phase=${phase}` : undefined,
|
|
71
|
+
blockers ? `blockers=${blockers}` : undefined,
|
|
72
|
+
].filter((value) => Boolean(value));
|
|
73
|
+
return parts.length > 0 ? parts.join(" | ") : undefined;
|
|
74
|
+
}
|
|
75
|
+
function hasContent(workspaceRoot, relativePath) {
|
|
76
|
+
const content = readAceLogicalFile(workspaceRoot, relativePath);
|
|
77
|
+
return typeof content === "string" && content.trim().length > 0;
|
|
78
|
+
}
|
|
79
|
+
export function buildAcePreflightPacket(input) {
|
|
80
|
+
const resolution = resolveAceStateLayout(input.workspaceRoot);
|
|
81
|
+
const blockers = [...resolution.missingCriticalArtifacts];
|
|
82
|
+
const warnings = [];
|
|
83
|
+
const qualityGatesPresent = hasContent(input.workspaceRoot, "agent-state/QUALITY_GATES.md");
|
|
84
|
+
const handoffPresent = hasContent(input.workspaceRoot, "agent-state/HANDOFF.json");
|
|
85
|
+
const evidencePresent = hasContent(input.workspaceRoot, "agent-state/EVIDENCE_LOG.md");
|
|
86
|
+
const statusRaw = readAceLogicalFile(input.workspaceRoot, "agent-state/STATUS.md");
|
|
87
|
+
const blockerStatus = extractStatusField(statusRaw, "Blockers");
|
|
88
|
+
const blockedByStatus = blockerStatus && !/\bnone\b/i.test(blockerStatus);
|
|
89
|
+
if (!qualityGatesPresent)
|
|
90
|
+
warnings.push("Missing agent-state/QUALITY_GATES.md");
|
|
91
|
+
if (!handoffPresent)
|
|
92
|
+
warnings.push("Missing agent-state/HANDOFF.json");
|
|
93
|
+
if (!evidencePresent)
|
|
94
|
+
warnings.push("Missing agent-state/EVIDENCE_LOG.md");
|
|
95
|
+
if (blockedByStatus && blockerStatus)
|
|
96
|
+
warnings.push(`Status blockers: ${blockerStatus}`);
|
|
97
|
+
const taskContractHealth = blockers.length > 0 ? "blocked" : warnings.length > 0 ? "thin" : "healthy";
|
|
98
|
+
const quartetHealth = blockers.length > 0
|
|
99
|
+
? "incomplete"
|
|
100
|
+
: blockedByStatus
|
|
101
|
+
? "contradictory"
|
|
102
|
+
: warnings.length > 0
|
|
103
|
+
? "thin"
|
|
104
|
+
: "healthy";
|
|
105
|
+
const preflightState = blockers.length > 0 ? "blocked" : warnings.length > 0 || blockedByStatus ? "attention_required" : "ready";
|
|
106
|
+
const recommendedRole = determineRole(input.task, input.preferredRole);
|
|
107
|
+
const synthesize = shouldSynthesizeShortPlan(input.task);
|
|
108
|
+
const recommendedNextAction = preflightState === "blocked"
|
|
109
|
+
? "validate_framework"
|
|
110
|
+
: synthesize
|
|
111
|
+
? "run_orchestrator"
|
|
112
|
+
: quartetHealth !== "healthy"
|
|
113
|
+
? "recall_context"
|
|
114
|
+
: recommendedRole === "orchestrator"
|
|
115
|
+
? "route_task"
|
|
116
|
+
: "recall_context";
|
|
117
|
+
return {
|
|
118
|
+
session_id: input.sessionId,
|
|
119
|
+
workspace_root: input.workspaceRoot,
|
|
120
|
+
state_resolution: resolution,
|
|
121
|
+
preflight_state: preflightState,
|
|
122
|
+
bridge_status: preflightState === "blocked" ? "blocked" : "running",
|
|
123
|
+
quartet_health: quartetHealth,
|
|
124
|
+
task_contract_health: taskContractHealth,
|
|
125
|
+
recommended_role: recommendedRole,
|
|
126
|
+
recommended_next_action: recommendedNextAction,
|
|
127
|
+
blockers,
|
|
128
|
+
warnings,
|
|
129
|
+
recall_summary: buildRecallSummary(input.workspaceRoot),
|
|
130
|
+
should_synthesize_plan: synthesize,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export function nextActivationLedger(sessionId, current, recommendedAction) {
|
|
134
|
+
return {
|
|
135
|
+
session_id: sessionId,
|
|
136
|
+
created_at: current?.created_at ?? Date.now(),
|
|
137
|
+
updated_at: Date.now(),
|
|
138
|
+
prompt_count: (current?.prompt_count ?? 0) + 1,
|
|
139
|
+
shown_nudges: [...(current?.shown_nudges ?? [])],
|
|
140
|
+
accepted_nudges: [...(current?.accepted_nudges ?? [])],
|
|
141
|
+
activated_tools: [...(current?.activated_tools ?? [])],
|
|
142
|
+
activated_roles: [...(current?.activated_roles ?? [])],
|
|
143
|
+
last_recommended_action: recommendedAction ?? current?.last_recommended_action,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export function buildStartupNudge(preflight, ledger) {
|
|
147
|
+
const action = preflight.recommended_next_action;
|
|
148
|
+
if (!action)
|
|
149
|
+
return undefined;
|
|
150
|
+
const nudgeId = `next:${action}`;
|
|
151
|
+
if (ledger.activated_tools.includes(action) || ledger.accepted_nudges.includes(nudgeId)) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const text = action === "validate_framework"
|
|
155
|
+
? "ACE state is incomplete. Run validate_framework before free-form execution."
|
|
156
|
+
: action === "run_orchestrator"
|
|
157
|
+
? "This looks multi-step. Prefer run_orchestrator over a single free-form reply."
|
|
158
|
+
: action === "route_task"
|
|
159
|
+
? "Role selection is still ambiguous. Route the task before deeper work."
|
|
160
|
+
: "Load ACE context first with recall_context before deeper work.";
|
|
161
|
+
return { id: nudgeId, text, recommended_action: action };
|
|
162
|
+
}
|
|
163
|
+
function compactTrapPack() {
|
|
164
|
+
return [
|
|
165
|
+
"Stop if you are about to claim tested, verified, or passed without evidence.",
|
|
166
|
+
"If ACE state is thin or contradictory, use recall_context or validate_framework before improvising.",
|
|
167
|
+
"For obviously multi-step work, prefer run_orchestrator over a single free-form answer.",
|
|
168
|
+
"Do not declare completion while approval, retry, or blocker state remains active.",
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
export function buildBridgeTaskInput(conversation, preflight) {
|
|
172
|
+
const lines = [
|
|
173
|
+
"## Recent Conversation",
|
|
174
|
+
conversation,
|
|
175
|
+
"",
|
|
176
|
+
"## ACE Preflight",
|
|
177
|
+
`- preflight_state: ${preflight.preflight_state}`,
|
|
178
|
+
`- quartet_health: ${preflight.quartet_health}`,
|
|
179
|
+
`- task_contract_health: ${preflight.task_contract_health}`,
|
|
180
|
+
preflight.recall_summary ? `- recall_summary: ${preflight.recall_summary}` : undefined,
|
|
181
|
+
preflight.recommended_role ? `- recommended_role: ${preflight.recommended_role}` : undefined,
|
|
182
|
+
preflight.recommended_next_action
|
|
183
|
+
? `- recommended_next_action: ${preflight.recommended_next_action}`
|
|
184
|
+
: undefined,
|
|
185
|
+
preflight.blockers.length > 0 ? `- blockers: ${preflight.blockers.join("; ")}` : undefined,
|
|
186
|
+
preflight.warnings.length > 0 ? `- warnings: ${preflight.warnings.join("; ")}` : undefined,
|
|
187
|
+
"",
|
|
188
|
+
"## Compact Guardrails",
|
|
189
|
+
...compactTrapPack().map((entry) => `- ${entry}`),
|
|
190
|
+
].filter((value) => Boolean(value));
|
|
191
|
+
if (preflight.should_synthesize_plan) {
|
|
192
|
+
lines.push("", "## Required Short Plan Skeleton", "1. recall and orient", "2. route or confirm responsible role", "3. execute the main change", "4. run gate, QA, or verification follow-up");
|
|
193
|
+
}
|
|
194
|
+
return lines.join("\n");
|
|
195
|
+
}
|
|
196
|
+
export function mapBridgeResultToRuntimeStatus(input) {
|
|
197
|
+
const lowered = input.summary.toLowerCase();
|
|
198
|
+
let bridgeStatus = input.current.bridge_status;
|
|
199
|
+
if (/\bapproval\b/.test(lowered)) {
|
|
200
|
+
bridgeStatus = "approval_pending";
|
|
201
|
+
}
|
|
202
|
+
else if (/\bretry/i.test(input.summary)) {
|
|
203
|
+
bridgeStatus = "retrying";
|
|
204
|
+
}
|
|
205
|
+
else if (/\bneed\b.*\binput\b/.test(lowered)) {
|
|
206
|
+
bridgeStatus = "needs_input";
|
|
207
|
+
}
|
|
208
|
+
else if (bridgeStatus === "running") {
|
|
209
|
+
bridgeStatus = "done";
|
|
210
|
+
}
|
|
211
|
+
if (bridgeStatus === "done" && input.current.approval_state === "pending") {
|
|
212
|
+
bridgeStatus = "approval_pending";
|
|
213
|
+
}
|
|
214
|
+
const approvalState = bridgeStatus === "approval_pending" ? "pending" : input.current.approval_state;
|
|
215
|
+
const activeTool = bridgeStatus === "approval_pending" || bridgeStatus === "done"
|
|
216
|
+
? undefined
|
|
217
|
+
: input.toolNames.at(-1);
|
|
218
|
+
return {
|
|
219
|
+
...input.current,
|
|
220
|
+
bridge_status: bridgeStatus,
|
|
221
|
+
approval_state: approvalState,
|
|
222
|
+
active_tool: activeTool,
|
|
223
|
+
updated_at: Date.now(),
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
export function buildContinuityRecord(input) {
|
|
227
|
+
return {
|
|
228
|
+
session_id: input.preflight.session_id,
|
|
229
|
+
workspace_root: input.preflight.workspace_root,
|
|
230
|
+
state_resolution_mode: input.preflight.state_resolution.physicalMode,
|
|
231
|
+
last_role: input.role,
|
|
232
|
+
last_preflight_state: input.preflight.preflight_state,
|
|
233
|
+
last_bridge_status: input.bridgeStatus,
|
|
234
|
+
active_tool: input.activeTool,
|
|
235
|
+
blockers: [...input.preflight.blockers],
|
|
236
|
+
recent_decisions: uniqueDecisionList([
|
|
237
|
+
input.preflight.recommended_role ? `role=${input.preflight.recommended_role}` : undefined,
|
|
238
|
+
input.preflight.recommended_next_action
|
|
239
|
+
? `next=${input.preflight.recommended_next_action}`
|
|
240
|
+
: undefined,
|
|
241
|
+
]),
|
|
242
|
+
recommended_next_action: input.preflight.recommended_next_action,
|
|
243
|
+
evidence_refs: Array.from(new Set(input.evidenceRefs ?? [])),
|
|
244
|
+
created_at: Date.now(),
|
|
245
|
+
updated_at: Date.now(),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function uniqueDecisionList(values) {
|
|
249
|
+
return Array.from(new Set(values.filter((value) => Boolean(value))));
|
|
250
|
+
}
|
|
251
|
+
export function containsVerificationLanguage(text) {
|
|
252
|
+
return /\b(verified|verify|validated|tested|pass(?:ed)?|confirmed|proven)\b/i.test(text);
|
|
253
|
+
}
|
|
254
|
+
export function hasEvidenceLikeTool(toolNames) {
|
|
255
|
+
return toolNames.some((tool) => ["run_tests", "execute_gates", "git_diff", "safe_edit_file", "read_workspace_file"].includes(tool));
|
|
256
|
+
}
|
|
257
|
+
export function applyEvidenceGuardrail(summary, toolNames) {
|
|
258
|
+
if (!containsVerificationLanguage(summary))
|
|
259
|
+
return summary;
|
|
260
|
+
if (hasEvidenceLikeTool(toolNames))
|
|
261
|
+
return summary;
|
|
262
|
+
return `Unverified summary: ${summary}`;
|
|
263
|
+
}
|
|
264
|
+
export function readRuntimeWorkflowHint(workspaceRoot) {
|
|
265
|
+
return readStoreBlobSync(workspaceRoot, "knowledge/runtime/ACE_WORKFLOW.md")
|
|
266
|
+
?? readAceLogicalFile(workspaceRoot, "agent-state/ACE_WORKFLOW.md")
|
|
267
|
+
?? undefined;
|
|
268
|
+
}
|
|
269
|
+
export function readStatusHint(workspaceRoot) {
|
|
270
|
+
return readStoreJsonSync(workspaceRoot, "state/runtime/llm_profile")?.provider;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=local-model-contract.js.map
|
package/dist/vericify-bridge.js
CHANGED
|
@@ -5,7 +5,7 @@ import { resolveWorkspaceArtifactPath as resolveWorkspaceArtifactPathHelper, res
|
|
|
5
5
|
import { validateVericifyBridgeSnapshotPayload, validateVericifyProcessPostLogPayload, } from "./schemas.js";
|
|
6
6
|
import { getRuntimeProfilePath, readRuntimeProfile } from "./runtime-profile.js";
|
|
7
7
|
import { openStore } from "./store/ace-packed-store.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ProjectionManager } from "./store/materializers/projection-manager.js";
|
|
9
9
|
import { VericifyRepository } from "./store/repositories/vericify-repository.js";
|
|
10
10
|
import { getWorkspaceStorePath, storeExistsSync } from "./store/store-snapshot.js";
|
|
11
11
|
import { isOperationalArtifactPath, operationalArtifactVirtualPath } from "./store/store-artifacts.js";
|
|
@@ -383,9 +383,8 @@ export async function appendVericifyProcessPost(input) {
|
|
|
383
383
|
},
|
|
384
384
|
});
|
|
385
385
|
await store.commit();
|
|
386
|
-
const
|
|
387
|
-
await
|
|
388
|
-
await store.commit();
|
|
386
|
+
const projections = new ProjectionManager(store, root);
|
|
387
|
+
await projections.projectAfterCommit(["vericify_posts"]);
|
|
389
388
|
}
|
|
390
389
|
finally {
|
|
391
390
|
await store.close();
|
package/dist/vericify-context.js
CHANGED
|
@@ -8,10 +8,19 @@ const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
8
8
|
function tryResolveVericifyApi(searchFrom) {
|
|
9
9
|
if (!searchFrom)
|
|
10
10
|
return undefined;
|
|
11
|
+
const directCandidates = [
|
|
12
|
+
resolve(searchFrom, "src", "api.js"),
|
|
13
|
+
resolve(searchFrom, "vericify", "src", "api.js"),
|
|
14
|
+
resolve(searchFrom, "..", "vericify", "src", "api.js"),
|
|
15
|
+
];
|
|
16
|
+
for (const candidate of directCandidates) {
|
|
17
|
+
if (existsSync(candidate)) {
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
const packageRoot = resolve(searchFrom, "node_modules", "vericify");
|
|
12
|
-
if (!existsSync(packageRoot))
|
|
22
|
+
if (!existsSync(packageRoot))
|
|
13
23
|
return undefined;
|
|
14
|
-
}
|
|
15
24
|
try {
|
|
16
25
|
const resolvedPath = requireFromModule.resolve("vericify/api", { paths: [searchFrom] });
|
|
17
26
|
return resolvedPath.startsWith(packageRoot) ? resolvedPath : undefined;
|
|
@@ -34,14 +43,15 @@ function resolveVericifyApiPath(workspaceRoot) {
|
|
|
34
43
|
return match;
|
|
35
44
|
throw new Error([
|
|
36
45
|
"Unable to locate Vericify API.",
|
|
37
|
-
"Install `vericify` locally
|
|
46
|
+
"Install `vericify` locally, keep a sibling checkout beside `ace-swarm`,",
|
|
38
47
|
"or set VERICIFY_API_PATH to an installed `vericify/api` entry file.",
|
|
39
48
|
].join(" "));
|
|
40
49
|
}
|
|
41
50
|
async function loadVericifyApi(workspaceRoot) {
|
|
42
51
|
const apiPath = resolveVericifyApiPath(workspaceRoot);
|
|
43
52
|
const loaded = await import(pathToFileURL(apiPath).href);
|
|
44
|
-
if (typeof loaded.
|
|
53
|
+
if (typeof loaded.loadWorkspaceState !== "function" ||
|
|
54
|
+
typeof loaded.buildCompactPacket !== "function" ||
|
|
45
55
|
typeof loaded.buildCompactDelta !== "function" ||
|
|
46
56
|
typeof loaded.projectWorkspaceState !== "function") {
|
|
47
57
|
throw new Error(`Vericify API at ${apiPath} is missing compact context exports.`);
|
|
@@ -53,7 +63,8 @@ export async function getVericifyContextPacket(input) {
|
|
|
53
63
|
? resolve(input.workspaceRoot)
|
|
54
64
|
: resolveWorkspaceRoot();
|
|
55
65
|
const api = await loadVericifyApi(workspaceRoot);
|
|
56
|
-
const
|
|
66
|
+
const workspaceState = api.loadWorkspaceState(workspaceRoot);
|
|
67
|
+
const projected = api.projectWorkspaceState(workspaceState);
|
|
57
68
|
return api.buildCompactPacket(projected, {
|
|
58
69
|
runId: input?.runId ?? "workspace:current",
|
|
59
70
|
});
|
|
@@ -63,7 +74,8 @@ export async function getVericifyDelta(input) {
|
|
|
63
74
|
? resolve(input.workspaceRoot)
|
|
64
75
|
: resolveWorkspaceRoot();
|
|
65
76
|
const api = await loadVericifyApi(workspaceRoot);
|
|
66
|
-
const
|
|
77
|
+
const workspaceState = api.loadWorkspaceState(workspaceRoot);
|
|
78
|
+
const projected = api.projectWorkspaceState(workspaceState);
|
|
67
79
|
return api.buildCompactDelta(projected, {
|
|
68
80
|
runId: input.runId ?? "workspace:current",
|
|
69
81
|
since: input.since,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voybio/ace-swarm",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "ACE Framework MCP server and CLI —
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "ACE Framework MCP server and CLI — single-file ACEPACK state, local-model serving, agent orchestration, and host compliance enforcement.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"keywords": [
|
|
47
47
|
"mcp",
|
|
48
48
|
"mcp-server",
|
|
49
|
+
"harness",
|
|
49
50
|
"ace",
|
|
50
51
|
"ace-swarm",
|
|
51
52
|
"agents",
|
|
@@ -57,8 +58,7 @@
|
|
|
57
58
|
"codex",
|
|
58
59
|
"ollama",
|
|
59
60
|
"llama.cpp",
|
|
60
|
-
"
|
|
61
|
-
"zarrita",
|
|
61
|
+
"acepack",
|
|
62
62
|
"local-models"
|
|
63
63
|
],
|
|
64
64
|
"author": "",
|
|
@@ -68,8 +68,6 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
71
|
-
"@zarrita/core": "^0.0.3",
|
|
72
|
-
"@zarrita/storage": "^0.1.4",
|
|
73
71
|
"vericify": "*",
|
|
74
72
|
"zod": "^4.3.6"
|
|
75
73
|
},
|