@sagentlab/navarch-runtime 0.1.107 → 0.1.112
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 +97 -59
- package/dist/adapters/antigravity-mcp.cjs +221 -0
- package/dist/adapters/antigravity.cjs +348 -0
- package/dist/adapters/gemini.cjs +7 -322
- package/dist/adapters/index.cjs +6 -1
- package/dist/agent-auth.cjs +2 -0
- package/dist/config.cjs +18 -3
- package/dist/conversation/capability.cjs +1 -1
- package/dist/conversation/loop.cjs +2 -2
- package/dist/conversation/turn-runner.cjs +3 -1
- package/dist/conversation/workspace.cjs +26 -4
- package/dist/exit-conditions.cjs +1 -1
- package/dist/session.cjs +30 -19
- package/package.json +2 -2
package/dist/session.cjs
CHANGED
|
@@ -50,7 +50,7 @@ function resolveSessionExecution(config, claimed) {
|
|
|
50
50
|
model: runtime === "codex" ? "gpt-6-astra"
|
|
51
51
|
: runtime === "pi-local" ? "qwen3.8-flash-next-iq2_xs"
|
|
52
52
|
: runtime === "gemini" ? "auto"
|
|
53
|
-
: runtime === "opencode" || runtime === "acp" || runtime === "qoder" ? "default"
|
|
53
|
+
: runtime === "antigravity" || runtime === "opencode" || runtime === "acp" || runtime === "qoder" ? "default"
|
|
54
54
|
: "claude-opus-5-5",
|
|
55
55
|
reasoning_effort: "medium",
|
|
56
56
|
};
|
|
@@ -65,7 +65,7 @@ function resolveSessionExecution(config, claimed) {
|
|
|
65
65
|
* 2. fetch secrets from the broker at session start (managed GitHub git
|
|
66
66
|
* credentials are subsequently refreshed by a lease-scoped helper)
|
|
67
67
|
* 3. optionally stand up a Docker sandbox when explicitly configured
|
|
68
|
-
* 4. run the adapter selected by the claim (Claude Code, Codex,
|
|
68
|
+
* 4. run the adapter selected by the claim (Claude Code, Codex, Antigravity, or OpenCode;
|
|
69
69
|
* adapters/index.cts#selectAdapter), heartbeating the
|
|
70
70
|
* lease throughout
|
|
71
71
|
* 5. redact + upload the transcript, map the exit condition, complete the
|
|
@@ -150,6 +150,8 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
150
150
|
// GitWorktree.cleanup removes that session-marked entry before teardown.
|
|
151
151
|
// Docker env injection remains tmpfs-backed (sandbox.cts injectEnv).
|
|
152
152
|
const registry = new redact_cjs_1.SecretRegistry();
|
|
153
|
+
// Lease MCP and managed Git refresh can expose this value in CLI errors.
|
|
154
|
+
registry.register(api.getToken());
|
|
153
155
|
let secrets = {};
|
|
154
156
|
let managedGithubCredential = false;
|
|
155
157
|
const secretNames = bundle.secret_manifest.map((s) => s.name);
|
|
@@ -356,23 +358,25 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
356
358
|
machineToken: api.getToken() ?? "",
|
|
357
359
|
leaseId,
|
|
358
360
|
};
|
|
359
|
-
const mcpConfig = runtime === "opencode"
|
|
361
|
+
const mcpConfig = (runtime === "opencode" || runtime === "antigravity")
|
|
360
362
|
? (0, mcp_config_cjs_1.buildEnvReferencedNavarchMcpConfig)(mcpOptions)
|
|
361
363
|
: { config: (0, mcp_config_cjs_1.buildNavarchMcpConfig)(mcpOptions), env: {} };
|
|
362
364
|
Object.assign(sessionEnv, mcpConfig.env);
|
|
363
365
|
await node_fs_1.promises.writeFile(node_path_1.default.join(workDir, MCP_CONFIG_FILENAME), JSON.stringify(mcpConfig.config, null, 2), "utf8");
|
|
364
366
|
mcpConfigPath = node_path_1.default.join(workDir, MCP_CONFIG_FILENAME);
|
|
365
367
|
}
|
|
368
|
+
if (runtime === "antigravity") {
|
|
369
|
+
promptText += "\n\nNavarch creates a temporary .agents/mcp_config.json solely for this turn. Do not edit, stage, commit or remove that file. It is removed by the runtime before delivery; staging it fails the session.\n";
|
|
370
|
+
}
|
|
366
371
|
// Worktree boundary guard (worktree-guard.cts): several sessions share this
|
|
367
372
|
// machine. Host-mode Claude gets a generated PreToolUse hook; host-mode
|
|
368
373
|
// Codex gets an OS-enforced native permission profile over the same roots;
|
|
369
|
-
//
|
|
374
|
+
// Antigravity and OpenCode fail closed on the
|
|
370
375
|
// guarded host path because its CLI cannot express the full boundary.
|
|
371
376
|
// Docker mode already has a container boundary. NAVARCH_WORKTREE_GUARD=off
|
|
372
377
|
// opts out for any agent.
|
|
373
378
|
let claudeSettingsPath = null;
|
|
374
379
|
let codexGuardArgs;
|
|
375
|
-
let geminiGuardMounts;
|
|
376
380
|
if (config.sandboxMode === "host" && config.worktreeGuard) {
|
|
377
381
|
if (runtime === "claude-code") {
|
|
378
382
|
if (config.claudeExtraArgs.includes("--settings")) {
|
|
@@ -396,15 +400,6 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
396
400
|
Object.assign(sessionEnv, { TMPDIR: tmpDir, TMP: tmpDir, TEMP: tmpDir });
|
|
397
401
|
}
|
|
398
402
|
}
|
|
399
|
-
else if (runtime === "gemini") {
|
|
400
|
-
geminiGuardMounts = (0, worktree_guard_cjs_1.geminiSandboxMounts)({
|
|
401
|
-
workDir,
|
|
402
|
-
worktreePath: gitWorktree.worktreePath,
|
|
403
|
-
repositoryPath: gitWorktree.repositoryPath,
|
|
404
|
-
workspaceRoot: config.workspaceRoot,
|
|
405
|
-
extraRoots: config.guardExtraRoots,
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
403
|
}
|
|
409
404
|
// Kept outside the try so the crash path can report the telemetry this
|
|
410
405
|
// session actually produced instead of zeroing it.
|
|
@@ -452,14 +447,22 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
452
447
|
if (!config.mcpConfigPath && config.sandboxMode === "host"
|
|
453
448
|
&& ["build", "verify", "qa"].includes(task.task_type)
|
|
454
449
|
&& task.required_capabilities?.includes("browser-use")
|
|
455
|
-
&& ["codex", "claude-code", "
|
|
450
|
+
&& ["codex", "claude-code", "antigravity", "opencode", "acp"].includes(runtime)) {
|
|
456
451
|
browserEvidence = await (0, browser_evidence_cjs_1.startBrowserEvidence)({
|
|
457
452
|
apiBase: api.getBaseUrl(), machineToken: api.getToken() ?? "", leaseId,
|
|
458
453
|
isActive: () => !leaseLost && !sessionClosing && !deps.shutdownSignal?.aborted,
|
|
459
454
|
});
|
|
460
455
|
registry.register(browserEvidence.token);
|
|
461
456
|
const mcp = JSON.parse(await node_fs_1.promises.readFile(mcpConfigPath, "utf8"));
|
|
462
|
-
|
|
457
|
+
const browserConfig = structuredClone(browserEvidence.config);
|
|
458
|
+
if (runtime === "antigravity") {
|
|
459
|
+
for (const [index, [header, value]] of Object.entries(browserConfig.headers).entries()) {
|
|
460
|
+
const name = `NAVARCH_AGY_MCP_BROWSER_${index}`;
|
|
461
|
+
sessionEnv[name] = value;
|
|
462
|
+
browserConfig.headers[header] = `{env:${name}}`;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
mcp.mcpServers.navarch_browser = browserConfig;
|
|
463
466
|
await node_fs_1.promises.writeFile(mcpConfigPath, JSON.stringify(mcp), { mode: 0o600 });
|
|
464
467
|
promptText += "\n\nNavarch supplies capture_visual_evidence through navarch_browser. Use it first for desktop/mobile screenshots of the verified preview URL and source commit. It runs outside the coding-agent sandbox, uploads images as task artifacts, and the runtime attaches them to the delivery PR before completion. Inspect the returned images before accepting the UI. Do not use GitHub's upload UI or add capture tools to the target repository. If the base commit has no runnable UI, report before evidence as not applicable with the base SHA and reason; still capture the current head. For interactive walkthroughs of a service you start on this machine, use navarch_browser's local_browser_open, local_browser_click, local_browser_fill, local_browser_press, local_browser_snapshot, and local_browser_screenshot with http://localhost:<port> or http://127.0.0.1:<port>. That browser also runs outside the sandbox and reaches only this machine's loopback services; prefer it over launching Chromium yourself, which Codex's macOS sandbox kills at startup.\n";
|
|
465
468
|
}
|
|
@@ -499,7 +502,9 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
499
502
|
for (const denial of sandbox.describe().denials) {
|
|
500
503
|
log.warn(`sandbox policy denial [${denial.policy}/${denial.code}]: ${denial.detail}`);
|
|
501
504
|
}
|
|
502
|
-
await sandbox.injectEnv(
|
|
505
|
+
await sandbox.injectEnv(runtime === "antigravity"
|
|
506
|
+
? Object.fromEntries(Object.entries(sessionEnv).filter(([name]) => !name.startsWith("NAVARCH_OPENCODE_MCP_") && !name.startsWith("NAVARCH_AGY_MCP_")))
|
|
507
|
+
: sessionEnv);
|
|
503
508
|
}
|
|
504
509
|
// The control plane returns the agent type selected for this worker.
|
|
505
510
|
// Any agent type may run any task; capabilities remain the task-level gate.
|
|
@@ -527,6 +532,7 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
527
532
|
let completionRemediationRetries = 0;
|
|
528
533
|
let deliveryCorrectionRetries = 0;
|
|
529
534
|
let deliveredPullRequest = false;
|
|
535
|
+
let antigravityResume;
|
|
530
536
|
while (true) {
|
|
531
537
|
// Guidance can arrive while the worktree/sandbox is being prepared.
|
|
532
538
|
// It is already included in deliveredGuidance, so clear the pending
|
|
@@ -565,7 +571,8 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
565
571
|
env: sessionEnv,
|
|
566
572
|
settingsPath: claudeSettingsPath,
|
|
567
573
|
codexGuardArgs,
|
|
568
|
-
|
|
574
|
+
antigravityHostGuard: runtime === "antigravity" && config.sandboxMode === "host" && config.worktreeGuard,
|
|
575
|
+
antigravityResume,
|
|
569
576
|
opencodeHostGuard: runtime === "opencode" && config.sandboxMode === "host" && config.worktreeGuard,
|
|
570
577
|
// ACP requires an absolute session cwd. Docker mounts the worktree at
|
|
571
578
|
// this same absolute path, while the other Docker adapters ignore cwd.
|
|
@@ -588,6 +595,7 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
588
595
|
execution.model = turnResult.model;
|
|
589
596
|
executionReport = { ...executionReport, model: turnResult.model };
|
|
590
597
|
}
|
|
598
|
+
antigravityResume = turnResult.antigravityResume;
|
|
591
599
|
attempts.push(turnResult);
|
|
592
600
|
liveStdout = "";
|
|
593
601
|
liveTranscript.markDirty();
|
|
@@ -877,7 +885,8 @@ async function runClaimedSession(deps, claimed, sessionId, lifecycle) {
|
|
|
877
885
|
failure_summary: failureSummary,
|
|
878
886
|
failed_before_start: !adapterStarted,
|
|
879
887
|
evidence_urls: lastCompletion?.evidence_urls ?? [],
|
|
880
|
-
|
|
888
|
+
// Once the adapter has started, absent accounting is unknown, not free.
|
|
889
|
+
cost: lastCompletion?.cost ?? (adapterStarted ? {} : { tokens_in: 0, tokens_out: 0, cost_usd: 0 }),
|
|
881
890
|
...(crashTranscriptUrl ? { transcript_url: crashTranscriptUrl } : {}),
|
|
882
891
|
exit_status: "crashed",
|
|
883
892
|
agent_type: runtime,
|
|
@@ -928,6 +937,8 @@ function adapterCommand(config, runtime) {
|
|
|
928
937
|
return { bin: config.codexBin, extraArgs: config.codexExtraArgs };
|
|
929
938
|
case "gemini":
|
|
930
939
|
return { bin: config.geminiBin, extraArgs: config.geminiExtraArgs };
|
|
940
|
+
case "antigravity":
|
|
941
|
+
return { bin: config.antigravityBin, extraArgs: config.antigravityExtraArgs };
|
|
931
942
|
case "opencode":
|
|
932
943
|
return { bin: config.opencodeBin, extraArgs: config.opencodeExtraArgs };
|
|
933
944
|
case "acp":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sagentlab/navarch-runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.112",
|
|
4
4
|
"description": "Navarch machine-side session manager: claims delivery tasks and runs them through local coding agents.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"ai-agent",
|
|
16
16
|
"claude-code",
|
|
17
17
|
"codex",
|
|
18
|
-
"
|
|
18
|
+
"antigravity-cli",
|
|
19
19
|
"opencode",
|
|
20
20
|
"agent-client-protocol",
|
|
21
21
|
"deepseek-harness",
|