@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
package/dist/run-ledger.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isReadError } from "./shared.js";
|
|
|
4
4
|
import { openStore } from "./store/ace-packed-store.js";
|
|
5
5
|
import { ProjectionManager } from "./store/materializers/projection-manager.js";
|
|
6
6
|
import { LedgerRepository } from "./store/repositories/ledger-repository.js";
|
|
7
|
-
import {
|
|
7
|
+
import { withStoreWriteCoordinator } from "./store/write-coordinator.js";
|
|
8
8
|
import { getWorkspaceStorePath, listStoreKeysSync, readStoreJsonSync, storeExistsSync, } from "./store/store-snapshot.js";
|
|
9
9
|
import { operationalArtifactVirtualPath } from "./store/store-artifacts.js";
|
|
10
10
|
/** Maximum entries kept in run-ledger.json before rotation. */
|
|
@@ -216,7 +216,7 @@ export async function appendRunLedgerEntrySafe(input) {
|
|
|
216
216
|
return withFileLock(RUN_LEDGER_REL, () => appendRunLedgerEntry(input));
|
|
217
217
|
}
|
|
218
218
|
return withFileLock(RUN_LEDGER_REL, async () => {
|
|
219
|
-
return
|
|
219
|
+
return withStoreWriteCoordinator(storePath, async () => {
|
|
220
220
|
const store = await openStore(storePath);
|
|
221
221
|
try {
|
|
222
222
|
const ledger = new LedgerRepository(store);
|
|
@@ -244,7 +244,7 @@ export async function appendRunLedgerEntrySafe(input) {
|
|
|
244
244
|
finally {
|
|
245
245
|
await store.close();
|
|
246
246
|
}
|
|
247
|
-
});
|
|
247
|
+
}, { operation_label: "appendRunLedgerEntrySafe" });
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
export function getRunLedgerPath() {
|
|
@@ -5,14 +5,22 @@ export interface ShellCommandResult {
|
|
|
5
5
|
stdout: string;
|
|
6
6
|
stderr: string;
|
|
7
7
|
timed_out: boolean;
|
|
8
|
+
timeout_reason?: "turn_budget" | "stall";
|
|
8
9
|
duration_ms: number;
|
|
10
|
+
last_progress_at: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ShellCommandProgressEvent {
|
|
13
|
+
source: "spawn" | "stdout" | "stderr";
|
|
14
|
+
at: number;
|
|
9
15
|
}
|
|
10
16
|
export interface RunShellCommandOptions {
|
|
11
17
|
cwd: string;
|
|
12
18
|
env?: NodeJS.ProcessEnv;
|
|
13
19
|
timeout_ms: number;
|
|
20
|
+
stall_timeout_ms?: number;
|
|
14
21
|
max_output_bytes?: number;
|
|
15
22
|
on_spawn?: (child: ChildProcess) => void;
|
|
23
|
+
on_progress?: (event: ShellCommandProgressEvent) => void;
|
|
16
24
|
}
|
|
17
25
|
export declare function runShellCommand(command: string, options: RunShellCommandOptions): Promise<ShellCommandResult>;
|
|
18
26
|
//# sourceMappingURL=runtime-command.d.ts.map
|
package/dist/runtime-command.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
+
const STALL_TIMEOUT_SCHEDULER_GRACE_MS = 50;
|
|
2
3
|
function appendChunk(buffer, chunk, maxBytes) {
|
|
3
4
|
const next = buffer + chunk;
|
|
4
5
|
if (Buffer.byteLength(next, "utf8") <= maxBytes) {
|
|
@@ -14,7 +15,10 @@ export async function runShellCommand(command, options) {
|
|
|
14
15
|
let stdout = "";
|
|
15
16
|
let stderr = "";
|
|
16
17
|
let timedOut = false;
|
|
18
|
+
let timeoutReason;
|
|
17
19
|
let finished = false;
|
|
20
|
+
let lastProgressAt = startedAt;
|
|
21
|
+
let stallTimer;
|
|
18
22
|
let forcedKillTimer;
|
|
19
23
|
let child;
|
|
20
24
|
try {
|
|
@@ -29,32 +33,58 @@ export async function runShellCommand(command, options) {
|
|
|
29
33
|
return;
|
|
30
34
|
}
|
|
31
35
|
options.on_spawn?.(child);
|
|
36
|
+
const requestTimeout = (reason) => {
|
|
37
|
+
if (finished || timedOut)
|
|
38
|
+
return;
|
|
39
|
+
timedOut = true;
|
|
40
|
+
timeoutReason = reason;
|
|
41
|
+
child.kill("SIGTERM");
|
|
42
|
+
forcedKillTimer = setTimeout(() => {
|
|
43
|
+
if (!finished)
|
|
44
|
+
child.kill("SIGKILL");
|
|
45
|
+
}, 500);
|
|
46
|
+
};
|
|
47
|
+
const resetStallTimer = () => {
|
|
48
|
+
if (stallTimer)
|
|
49
|
+
clearTimeout(stallTimer);
|
|
50
|
+
const stallTimeoutMs = options.stall_timeout_ms;
|
|
51
|
+
if (!stallTimeoutMs || stallTimeoutMs <= 0)
|
|
52
|
+
return;
|
|
53
|
+
stallTimer = setTimeout(() => requestTimeout("stall"), stallTimeoutMs + STALL_TIMEOUT_SCHEDULER_GRACE_MS);
|
|
54
|
+
};
|
|
55
|
+
const recordProgress = (source) => {
|
|
56
|
+
lastProgressAt = Date.now();
|
|
57
|
+
options.on_progress?.({ source, at: lastProgressAt });
|
|
58
|
+
resetStallTimer();
|
|
59
|
+
};
|
|
32
60
|
const finish = (result) => {
|
|
33
61
|
if (finished)
|
|
34
62
|
return;
|
|
35
63
|
finished = true;
|
|
64
|
+
if (stallTimer)
|
|
65
|
+
clearTimeout(stallTimer);
|
|
36
66
|
if (forcedKillTimer)
|
|
37
67
|
clearTimeout(forcedKillTimer);
|
|
38
68
|
resolve(result);
|
|
39
69
|
};
|
|
40
70
|
const timeout = setTimeout(() => {
|
|
41
|
-
|
|
42
|
-
child.kill("SIGTERM");
|
|
43
|
-
forcedKillTimer = setTimeout(() => {
|
|
44
|
-
if (!finished)
|
|
45
|
-
child.kill("SIGKILL");
|
|
46
|
-
}, 500);
|
|
71
|
+
requestTimeout("turn_budget");
|
|
47
72
|
}, options.timeout_ms);
|
|
73
|
+
recordProgress("spawn");
|
|
48
74
|
child.stdout?.setEncoding("utf8");
|
|
49
75
|
child.stdout?.on("data", (chunk) => {
|
|
50
76
|
stdout = appendChunk(stdout, String(chunk), maxOutputBytes);
|
|
77
|
+
recordProgress("stdout");
|
|
51
78
|
});
|
|
52
79
|
child.stderr?.setEncoding("utf8");
|
|
53
80
|
child.stderr?.on("data", (chunk) => {
|
|
54
81
|
stderr = appendChunk(stderr, String(chunk), maxOutputBytes);
|
|
82
|
+
recordProgress("stderr");
|
|
55
83
|
});
|
|
56
84
|
child.on("error", (error) => {
|
|
57
85
|
clearTimeout(timeout);
|
|
86
|
+
if (stallTimer)
|
|
87
|
+
clearTimeout(stallTimer);
|
|
58
88
|
if (forcedKillTimer)
|
|
59
89
|
clearTimeout(forcedKillTimer);
|
|
60
90
|
if (!finished)
|
|
@@ -68,7 +98,9 @@ export async function runShellCommand(command, options) {
|
|
|
68
98
|
stdout,
|
|
69
99
|
stderr,
|
|
70
100
|
timed_out: timedOut,
|
|
101
|
+
timeout_reason: timeoutReason,
|
|
71
102
|
duration_ms: Date.now() - startedAt,
|
|
103
|
+
last_progress_at: lastProgressAt,
|
|
72
104
|
});
|
|
73
105
|
});
|
|
74
106
|
});
|
|
@@ -5,6 +5,13 @@ export declare const RUNTIME_EXECUTOR_SESSION_SCHEMA_REL_PATH = "agent-state/MOD
|
|
|
5
5
|
export declare const RUNTIME_EXECUTOR_SESSION_SCHEMA_NAME = "runtime-executor-session-registry@1.0.0";
|
|
6
6
|
export type UnattendedSessionStatus = "starting" | "running" | "completed" | "failed" | "blocked" | "stopped";
|
|
7
7
|
export type UnattendedTurnStatus = "completed" | "failed" | "blocked" | "stopped";
|
|
8
|
+
export type TurnOutcome = "no_op_success" | "meaningful_completion" | "escalation_blocker";
|
|
9
|
+
export interface TurnOutputPolicy {
|
|
10
|
+
emit_to: ("tui" | "tracker" | "handoff" | "vericify")[];
|
|
11
|
+
silent_unless_blocked: boolean;
|
|
12
|
+
require_approval_before_emit: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const DEFAULT_TURN_OUTPUT_POLICY: TurnOutputPolicy;
|
|
8
15
|
export interface UnattendedToolCallRecord {
|
|
9
16
|
tool_name: string;
|
|
10
17
|
ok: boolean;
|
|
@@ -32,6 +39,8 @@ export interface UnattendedTurnRecord {
|
|
|
32
39
|
stdout: string;
|
|
33
40
|
stderr: string;
|
|
34
41
|
tool_calls: UnattendedToolCallRecord[];
|
|
42
|
+
turn_outcome?: TurnOutcome;
|
|
43
|
+
outcome_reason?: string;
|
|
35
44
|
}
|
|
36
45
|
export interface UnattendedSessionRecord {
|
|
37
46
|
session_id: string;
|
|
@@ -55,7 +64,10 @@ export interface UnattendedSessionRecord {
|
|
|
55
64
|
last_error?: string;
|
|
56
65
|
cleanup_error?: string;
|
|
57
66
|
workspace_cleanup_status: "pending" | "removed" | "archived" | "failed";
|
|
67
|
+
output_policy?: TurnOutputPolicy;
|
|
58
68
|
turns: UnattendedTurnRecord[];
|
|
69
|
+
/** Set after propose_plan + validate_plan succeed in the before_run preflight. */
|
|
70
|
+
validated_plan_id?: string;
|
|
59
71
|
}
|
|
60
72
|
export interface UnattendedSessionRegistry {
|
|
61
73
|
version: 1;
|
|
@@ -64,6 +76,7 @@ export interface UnattendedSessionRegistry {
|
|
|
64
76
|
}
|
|
65
77
|
export interface StartUnattendedSessionInput {
|
|
66
78
|
session_id?: string;
|
|
79
|
+
workspace_root?: string;
|
|
67
80
|
task: string;
|
|
68
81
|
context?: Record<string, unknown>;
|
|
69
82
|
workspace_name?: string;
|
|
@@ -73,6 +86,9 @@ export interface StartUnattendedSessionInput {
|
|
|
73
86
|
max_turns?: number;
|
|
74
87
|
turn_timeout_ms?: number;
|
|
75
88
|
auto_cleanup?: boolean;
|
|
89
|
+
emit_to?: TurnOutputPolicy["emit_to"];
|
|
90
|
+
silent_unless_blocked?: boolean;
|
|
91
|
+
require_approval_before_emit?: boolean;
|
|
76
92
|
}
|
|
77
93
|
export interface StartUnattendedSessionResult {
|
|
78
94
|
ok: boolean;
|
|
@@ -94,11 +110,14 @@ export interface WaitForUnattendedSessionResult {
|
|
|
94
110
|
session?: UnattendedSessionRecord;
|
|
95
111
|
error?: string;
|
|
96
112
|
}
|
|
113
|
+
export interface WaitForUnattendedSessionOptions {
|
|
114
|
+
flush_sidecars?: boolean;
|
|
115
|
+
}
|
|
97
116
|
export declare function validateRuntimeExecutorSessionRegistryContent(raw: string): ValidationResult;
|
|
98
117
|
export declare function listUnattendedSessions(): UnattendedSessionRegistry;
|
|
99
118
|
export declare function getUnattendedSession(sessionId: string): UnattendedSessionRecord | undefined;
|
|
100
119
|
export declare function getRuntimeExecutorSessionRegistryPath(): string;
|
|
101
120
|
export declare function startUnattendedSession(input: StartUnattendedSessionInput): Promise<StartUnattendedSessionResult>;
|
|
102
|
-
export declare function waitForUnattendedSession(sessionId: string,
|
|
121
|
+
export declare function waitForUnattendedSession(sessionId: string, timeoutMsOrOptions?: number | WaitForUnattendedSessionOptions, options?: WaitForUnattendedSessionOptions): Promise<WaitForUnattendedSessionResult>;
|
|
103
122
|
export declare function stopUnattendedSession(sessionId: string): Promise<StopUnattendedSessionResult>;
|
|
104
123
|
//# sourceMappingURL=runtime-executor.d.ts.map
|