@algosuite/vo-mcp 0.2.0-beta.50 → 0.2.0-beta.52
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/dist/cli.js +432 -175
- package/dist/cli.js.map +4 -4
- package/dist/index.js +406 -149
- package/dist/index.js.map +4 -4
- package/dist/runner-cli.js +112 -6
- package/dist/runner-cli.js.map +4 -4
- package/dist/runner-supervisor.js +45 -3
- package/dist/runner-supervisor.js.map +3 -3
- package/package.json +1 -1
package/dist/runner-cli.js
CHANGED
|
@@ -3335,6 +3335,34 @@ var init_installation_token = __esm({
|
|
|
3335
3335
|
}
|
|
3336
3336
|
});
|
|
3337
3337
|
|
|
3338
|
+
// ../../scripts/virtual-office/code-runner/control-plane-promote.mjs
|
|
3339
|
+
async function promoteDraftPrRequest(req, prNumber, automationContext, onUnauthorized = () => {
|
|
3340
|
+
}) {
|
|
3341
|
+
const res = await req("POST", "/api/v1/admin/pr/promote-draft", { prNumber, automationContext }, { timeoutMs: 6e4 });
|
|
3342
|
+
if (res.status === 401) {
|
|
3343
|
+
onUnauthorized();
|
|
3344
|
+
throw new Error("promote-draft unauthorized (401)");
|
|
3345
|
+
}
|
|
3346
|
+
const json = await res.json().catch(() => ({}));
|
|
3347
|
+
if (res.ok && json?.ok === true) {
|
|
3348
|
+
return {
|
|
3349
|
+
status: json.promoted === true ? json.auto_merge_disarmed === true ? "promoted (auto-merge disarmed)" : "promoted" : json.already_ready === true ? "already_ready" : "unchanged",
|
|
3350
|
+
headSha: typeof json.head_sha === "string" ? json.head_sha : null,
|
|
3351
|
+
reason: typeof json.blocked_reason === "string" ? json.blocked_reason : null
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
const code = typeof json?.error === "string" ? json.error : null;
|
|
3355
|
+
const err = new Error(`promote-draft failed: HTTP ${res.status}${code ? ` (${code})` : ""}${json?.reason ? ` \u2014 ${json.reason}` : ""}`);
|
|
3356
|
+
err.status = res.status;
|
|
3357
|
+
err.code = code;
|
|
3358
|
+
throw err;
|
|
3359
|
+
}
|
|
3360
|
+
var init_control_plane_promote = __esm({
|
|
3361
|
+
"../../scripts/virtual-office/code-runner/control-plane-promote.mjs"() {
|
|
3362
|
+
"use strict";
|
|
3363
|
+
}
|
|
3364
|
+
});
|
|
3365
|
+
|
|
3338
3366
|
// ../../scripts/virtual-office/code-runner/control-plane-task-list.mjs
|
|
3339
3367
|
async function listAllPrOpenedTasks(request) {
|
|
3340
3368
|
const tasks = [];
|
|
@@ -3397,7 +3425,9 @@ async function resumeCodeTaskRequest(req, taskId, { automaticRateLimit = false,
|
|
|
3397
3425
|
throw err;
|
|
3398
3426
|
}
|
|
3399
3427
|
const json = await res.json();
|
|
3400
|
-
|
|
3428
|
+
const task = json && json.task ? json.task : null;
|
|
3429
|
+
if (task && typeof json.deduplicated === "boolean") Object.defineProperty(task, "deduplicated", { value: json.deduplicated, enumerable: false });
|
|
3430
|
+
return task;
|
|
3401
3431
|
}
|
|
3402
3432
|
var init_control_plane_resume = __esm({
|
|
3403
3433
|
"../../scripts/virtual-office/code-runner/control-plane-resume.mjs"() {
|
|
@@ -3712,9 +3742,22 @@ function createControlPlaneClient({
|
|
|
3712
3742
|
cachedFirebaseToken = null;
|
|
3713
3743
|
throw new Error("enqueue unauthorized (401)");
|
|
3714
3744
|
}
|
|
3715
|
-
if (!res.ok)
|
|
3745
|
+
if (!res.ok) {
|
|
3746
|
+
let code = null;
|
|
3747
|
+
try {
|
|
3748
|
+
const errBody = await res.json();
|
|
3749
|
+
code = typeof errBody?.error === "string" ? errBody.error : null;
|
|
3750
|
+
} catch {
|
|
3751
|
+
}
|
|
3752
|
+
const err = new Error(`enqueue failed: HTTP ${res.status}${code ? ` (${code})` : ""}`);
|
|
3753
|
+
err.status = res.status;
|
|
3754
|
+
err.code = code;
|
|
3755
|
+
throw err;
|
|
3756
|
+
}
|
|
3716
3757
|
const json = await res.json();
|
|
3717
|
-
|
|
3758
|
+
const task = json && json.task ? json.task : null;
|
|
3759
|
+
if (task && typeof json.deduplicated === "boolean") Object.defineProperty(task, "deduplicated", { value: json.deduplicated, enumerable: false });
|
|
3760
|
+
return task;
|
|
3718
3761
|
},
|
|
3719
3762
|
/**
|
|
3720
3763
|
* Resume a failed/cancelled/max-turn partial code-task. The PR watcher uses
|
|
@@ -3730,6 +3773,10 @@ function createControlPlaneClient({
|
|
|
3730
3773
|
* The server inspects the current diff, applies deterministic blockers, runs
|
|
3731
3774
|
* consensus, records a receipt, and direct-merges only the inspected SHA.
|
|
3732
3775
|
*/
|
|
3776
|
+
/** F35: promote a PARTIAL draft to READY via the plane (admin-only; server re-checks; never merges). */
|
|
3777
|
+
promoteDraftPr: (prNumber, automationContext) => promoteDraftPrRequest(req, prNumber, automationContext, () => {
|
|
3778
|
+
cachedFirebaseToken = null;
|
|
3779
|
+
}),
|
|
3733
3780
|
async mergeVerifiedPr(prNumber, automationContext) {
|
|
3734
3781
|
return mergeVerifiedPrRequest(
|
|
3735
3782
|
req,
|
|
@@ -3937,6 +3984,7 @@ var init_control_plane_client = __esm({
|
|
|
3937
3984
|
"../../scripts/virtual-office/code-runner/control-plane-client.mjs"() {
|
|
3938
3985
|
"use strict";
|
|
3939
3986
|
init_installation_token();
|
|
3987
|
+
init_control_plane_promote();
|
|
3940
3988
|
init_control_plane_task_list();
|
|
3941
3989
|
init_control_plane_resume();
|
|
3942
3990
|
init_control_plane_autonomous_admission();
|
|
@@ -8082,6 +8130,22 @@ var init_publish_async = __esm({
|
|
|
8082
8130
|
}
|
|
8083
8131
|
});
|
|
8084
8132
|
|
|
8133
|
+
// ../../scripts/virtual-office/code-runner/headless-execution-contract.mjs
|
|
8134
|
+
var HEADLESS_EXECUTION_CONTRACT;
|
|
8135
|
+
var init_headless_execution_contract = __esm({
|
|
8136
|
+
"../../scripts/virtual-office/code-runner/headless-execution-contract.mjs"() {
|
|
8137
|
+
"use strict";
|
|
8138
|
+
HEADLESS_EXECUTION_CONTRACT = [
|
|
8139
|
+
"Command execution in this headless session: ONLY commands that start with `pnpm` are pre-authorized",
|
|
8140
|
+
"(e.g. `pnpm exec vitest run <file>`, `pnpm run roadmap:board`, `pnpm exec node scripts/<x>.mjs`,",
|
|
8141
|
+
"`pnpm exec tsc --noEmit -p <dir>`); any other Bash command (`node \u2026`, `npx \u2026`, `git \u2026`, `gh \u2026`) is",
|
|
8142
|
+
"auto-denied \u2014 that is expected, not a broken environment. Wrap what you need as `pnpm exec <cmd>`.",
|
|
8143
|
+
"Roadmap-board drift (`check-roadmap-board-coverage` red): run `pnpm run roadmap:board` and keep the",
|
|
8144
|
+
"regenerated `public/roadmap-progress.json` + `cloud-run/vo-control-plane/data/roadmap-progress.json`."
|
|
8145
|
+
].join("\n");
|
|
8146
|
+
}
|
|
8147
|
+
});
|
|
8148
|
+
|
|
8085
8149
|
// ../../scripts/virtual-office/code-runner/skill-catalog.mjs
|
|
8086
8150
|
import { readdirSync as readdirSync3, readFileSync as readFileSync8, statSync as statSync4 } from "node:fs";
|
|
8087
8151
|
import { dirname as dirname7, join as join10 } from "node:path";
|
|
@@ -8186,6 +8250,7 @@ function buildDispatchOnboarding({ repo = "Algosuite-ai/Nexus" } = {}) {
|
|
|
8186
8250
|
" - Finishing IS shipping here. The moment you finish, the HQ runner commits your changes, pushes a branch, and opens the PR FOR you \u2014 that is its job, not yours. You are not being asked to stop short of shipping; you are being asked to hand off the last mile.",
|
|
8187
8251
|
" - Leave your changes as UNCOMMITTED edits in this worktree. That is the hand-off mechanism, not a lesser outcome.",
|
|
8188
8252
|
" - Do NOT run git (no commit, no branch, no checkout) and do NOT run `gh` / open a PR yourself. You are sandboxed to file edits; git/gh commands will be denied, and committing your work moves it where the runner cannot see it (your change would be silently discarded).",
|
|
8253
|
+
` - ${HEADLESS_EXECUTION_CONTRACT.split("\n").join("\n ")}`,
|
|
8189
8254
|
' - When the task is done, hand off: your final message should summarize what you changed; the runner detects your edited files and creates the PR. Do not treat "hand off" as "leave it unfinished" \u2014 finish the work completely first.',
|
|
8190
8255
|
" - If a git or `gh` command is DENIED, that is EXPECTED and CORRECT \u2014 it means the runner will handle publishing. Do NOT retry it, do NOT try a different git/gh invocation, and do NOT wait for an approval that will not come. STOP immediately with your edits uncommitted. (Agents that retried a denied `gh pr create` burned ~25 minutes of usage and their finished fix was lost.)",
|
|
8191
8256
|
" - Do NOT create scratch files \u2014 no drafted PR body, no notes/TODO/plan files, nothing under tmp/ or named pr-body*/pr-description*. The runner writes the PR body itself; the worktree should contain ONLY the real file changes the task requires. (Stray scratch files have leaked into PRs.)",
|
|
@@ -8223,6 +8288,7 @@ var MANDATORY_READS, NON_NEGOTIABLES;
|
|
|
8223
8288
|
var init_dispatch_onboarding = __esm({
|
|
8224
8289
|
"../../scripts/virtual-office/code-runner/dispatch-onboarding.mjs"() {
|
|
8225
8290
|
"use strict";
|
|
8291
|
+
init_headless_execution_contract();
|
|
8226
8292
|
init_skill_catalog();
|
|
8227
8293
|
MANDATORY_READS = [
|
|
8228
8294
|
"CLAUDE.md (repo root \u2014 Claude-specific rules; Claude Code sessions have it AUTO-LOADED \u2014 do NOT Read it again there, that re-spends ~18K tokens; Codex/Cursor/other agents must READ it)",
|
|
@@ -10171,6 +10237,20 @@ var init_account_usage2 = __esm({
|
|
|
10171
10237
|
}
|
|
10172
10238
|
});
|
|
10173
10239
|
|
|
10240
|
+
// ../../scripts/virtual-office/code-runner/agent-unfixable-checks.mjs
|
|
10241
|
+
function hasAgentFixableFailure(failedChecks) {
|
|
10242
|
+
const failed2 = Array.isArray(failedChecks) ? failedChecks : [];
|
|
10243
|
+
if (failed2.length === 0) return true;
|
|
10244
|
+
return !failed2.every((name) => AGENT_UNFIXABLE_CHECKS.has(name));
|
|
10245
|
+
}
|
|
10246
|
+
var AGENT_UNFIXABLE_CHECKS;
|
|
10247
|
+
var init_agent_unfixable_checks = __esm({
|
|
10248
|
+
"../../scripts/virtual-office/code-runner/agent-unfixable-checks.mjs"() {
|
|
10249
|
+
"use strict";
|
|
10250
|
+
AGENT_UNFIXABLE_CHECKS = /* @__PURE__ */ new Set(["merge-gate", "overlap-check"]);
|
|
10251
|
+
}
|
|
10252
|
+
});
|
|
10253
|
+
|
|
10174
10254
|
// ../../scripts/virtual-office/code-runner/ci-repair-evidence.mjs
|
|
10175
10255
|
function extractWorkflowRunIds(links = []) {
|
|
10176
10256
|
const ids = [];
|
|
@@ -10423,6 +10503,9 @@ var init_watcher_coordination = __esm({
|
|
|
10423
10503
|
"continuation_spend_unmeasured",
|
|
10424
10504
|
"continuation_lineage_incomplete",
|
|
10425
10505
|
"continuation_lineage_invalid",
|
|
10506
|
+
// F45 (2026-08-17): the plane refuses to resume an ANCESTOR once a newer attempt exists — for a
|
|
10507
|
+
// caller holding this task id no retry can succeed; resume the newest attempt instead.
|
|
10508
|
+
"continuation_latest_attempt_required",
|
|
10426
10509
|
"cancelled_not_automatically_resumable",
|
|
10427
10510
|
"not_resumable"
|
|
10428
10511
|
]);
|
|
@@ -10625,6 +10708,8 @@ function buildCiFixPrompt({ prNumber, repo, branch, headSha, failedChecks, prPat
|
|
|
10625
10708
|
"in your summary). Your work ships: finish the fix completely, leave UNCOMMITTED edits,",
|
|
10626
10709
|
"and the runner opens the PR for you. A denied git/gh is EXPECTED; do NOT retry it.",
|
|
10627
10710
|
"",
|
|
10711
|
+
HEADLESS_EXECUTION_CONTRACT,
|
|
10712
|
+
"",
|
|
10628
10713
|
"## Bounded source PR patch excerpt",
|
|
10629
10714
|
"```diff",
|
|
10630
10715
|
prPatch || "[No excerpt available; the complete exact source is still materialized in the worktree.]",
|
|
@@ -10640,6 +10725,7 @@ var init_ci_fix_prompt = __esm({
|
|
|
10640
10725
|
"../../scripts/virtual-office/code-runner/ci-fix-prompt.mjs"() {
|
|
10641
10726
|
"use strict";
|
|
10642
10727
|
init_superseded_pr_source();
|
|
10728
|
+
init_headless_execution_contract();
|
|
10643
10729
|
}
|
|
10644
10730
|
});
|
|
10645
10731
|
|
|
@@ -10676,7 +10762,9 @@ async function readCommitCiViaRest(repo, sha, { run, env: env2 }) {
|
|
|
10676
10762
|
name: String(r?.name || ""),
|
|
10677
10763
|
status: String(r?.status || ""),
|
|
10678
10764
|
conclusion: r?.conclusion == null ? null : String(r.conclusion),
|
|
10679
|
-
...r?.details_url ? { detailsUrl: String(r.details_url) } : {}
|
|
10765
|
+
...r?.details_url ? { detailsUrl: String(r.details_url) } : {},
|
|
10766
|
+
...r?.started_at ? { startedAt: String(r.started_at) } : {},
|
|
10767
|
+
...r?.completed_at ? { completedAt: String(r.completed_at) } : {}
|
|
10680
10768
|
});
|
|
10681
10769
|
}
|
|
10682
10770
|
if (runs.length === 0) break;
|
|
@@ -10746,6 +10834,11 @@ var init_pr_watcher_github = __esm({
|
|
|
10746
10834
|
|
|
10747
10835
|
// ../../scripts/virtual-office/code-runner/enqueue-autonomous-code-task.mjs
|
|
10748
10836
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
10837
|
+
function isDefiniteRefusal(err) {
|
|
10838
|
+
const status = Number(err?.status);
|
|
10839
|
+
if (Number.isFinite(status) && status >= 400 && status < 500) return true;
|
|
10840
|
+
return status === 503 && typeof err?.code === "string" && UNAVAILABLE_WITH_CODE.has(err.code);
|
|
10841
|
+
}
|
|
10749
10842
|
async function enqueueAutonomousCodeTask(client, task, log2 = () => {
|
|
10750
10843
|
}) {
|
|
10751
10844
|
const requestedBudgetUsd = task?.max_budget_usd;
|
|
@@ -10768,11 +10861,23 @@ async function enqueueAutonomousCodeTask(client, task, log2 = () => {
|
|
|
10768
10861
|
if (admission?.allowed !== true) {
|
|
10769
10862
|
throw new Error(`autonomous dispatch blocked: ${admission?.reason || "admission denied"}`);
|
|
10770
10863
|
}
|
|
10771
|
-
|
|
10864
|
+
try {
|
|
10865
|
+
return await client.enqueueCodeTask({ ...task, autonomous_reservation_id: reservationId });
|
|
10866
|
+
} catch (err) {
|
|
10867
|
+
if (isDefiniteRefusal(err)) {
|
|
10868
|
+
try {
|
|
10869
|
+
await client.releaseAutonomousDispatchBudget(reservationId);
|
|
10870
|
+
} catch {
|
|
10871
|
+
}
|
|
10872
|
+
}
|
|
10873
|
+
throw err;
|
|
10874
|
+
}
|
|
10772
10875
|
}
|
|
10876
|
+
var UNAVAILABLE_WITH_CODE;
|
|
10773
10877
|
var init_enqueue_autonomous_code_task = __esm({
|
|
10774
10878
|
"../../scripts/virtual-office/code-runner/enqueue-autonomous-code-task.mjs"() {
|
|
10775
10879
|
"use strict";
|
|
10880
|
+
UNAVAILABLE_WITH_CODE = /* @__PURE__ */ new Set(["repair_state_unavailable", "inspection_unavailable", "verify_unavailable"]);
|
|
10776
10881
|
}
|
|
10777
10882
|
});
|
|
10778
10883
|
|
|
@@ -10821,7 +10926,7 @@ function decideWatchAction(pr, fixAttempts, maxFixAttempts, entry = {}, maxResum
|
|
|
10821
10926
|
if (pr.ci === "pending") return "wait";
|
|
10822
10927
|
return (entry.resumeAttempts || 0) < maxResumeAttempts ? "resume" : "wait";
|
|
10823
10928
|
}
|
|
10824
|
-
if (pr.ci === "failing" && entry.allowFixDispatch !== false && (fixAttempts || 0) < maxFixAttempts) return "fix";
|
|
10929
|
+
if (pr.ci === "failing" && hasAgentFixableFailure(pr.failedChecks) && entry.allowFixDispatch !== false && (fixAttempts || 0) < maxFixAttempts) return "fix";
|
|
10825
10930
|
if (autoMergeEnabled && pr.ci === "passing" && pr.mergeState === "CLEAN" && !pr.isDraft && !entry.mergeTerminal && !mergeEnqueueActive(entry, nowMs) && (entry.mergeAttempts || 0) < 3) return "merge";
|
|
10826
10931
|
return "wait";
|
|
10827
10932
|
}
|
|
@@ -11111,6 +11216,7 @@ var DEFAULT_STATE_FILE, FAIL_CONCLUSIONS;
|
|
|
11111
11216
|
var init_pr_watcher = __esm({
|
|
11112
11217
|
"../../scripts/virtual-office/code-runner/pr-watcher.mjs"() {
|
|
11113
11218
|
"use strict";
|
|
11219
|
+
init_agent_unfixable_checks();
|
|
11114
11220
|
init_ci_repair_evidence();
|
|
11115
11221
|
init_pr_watcher_failure_confirmation();
|
|
11116
11222
|
init_superseded_pr_source();
|