@miraland-labs/conduit-bridge 0.16.205 → 0.16.207

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.
Files changed (2) hide show
  1. package/dist/driver.js +25 -3
  2. package/package.json +1 -1
package/dist/driver.js CHANGED
@@ -728,6 +728,25 @@ export function claudeCodeFuelEnv(fuelSource, model) {
728
728
  return undefined;
729
729
  return { ANTHROPIC_MODEL: model, ANTHROPIC_SMALL_FAST_MODEL: model, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1" };
730
730
  }
731
+ export function codexSandboxFacts(projection) {
732
+ return [
733
+ "SANDBOX FACTS",
734
+ `Sandbox mode: ${projection.sandbox}.`,
735
+ projection.networkAccess
736
+ ? "Network is on."
737
+ : "Network is off, including loopback listen.",
738
+ projection.sandbox === "workspace-write"
739
+ ? "Writes are allowed only in the workspace and TMPDIR. HOME and the rest of the filesystem are read-only."
740
+ : "No writes are allowed. The filesystem is read-only.",
741
+ "Child processes inherit these limits.",
742
+ "A registered gate that fails only with EPERM, EROFS, or a refused listen does not test the change.",
743
+ "Record that run as evidence with the refused calls.",
744
+ "Mark each criterion that run would settle as unknown with unverified_reason needs_environment.",
745
+ "Set unverified_detail to name the refusal.",
746
+ "Do not state in outcome, verification, or limitations that the gate failed.",
747
+ "Bridge runs every registered gate outside this sandbox after the turn. Its result is the witness.",
748
+ ].join("\n");
749
+ }
731
750
  /**
732
751
  * Codex exec arguments. The sandbox is the enforcement boundary: network stays
733
752
  * off inside workspace-write unless the class/capabilities require it.
@@ -848,7 +867,7 @@ export const codexDriver = {
848
867
  diagnosis: input.workRole === "diagnose",
849
868
  });
850
869
  // Prompt via stdin avoids ARG_MAX limits on large assignment contracts.
851
- const { code, stdout, stderr } = await execute(driverExecutable(codexDriver.name, input.executable), codexExecArgs({ ...input, networkAccess: projected.networkAccess }, projected.sandbox), input.workspace, agentTurnTimeoutMs(input), fuelSource === "conduit" ? input.fuel : undefined, fuelSource, input.prompt, input.signal);
870
+ const { code, stdout, stderr } = await execute(driverExecutable(codexDriver.name, input.executable), codexExecArgs({ ...input, networkAccess: projected.networkAccess }, projected.sandbox), input.workspace, agentTurnTimeoutMs(input), fuelSource === "conduit" ? input.fuel : undefined, fuelSource, `${input.prompt}\n\n${codexSandboxFacts(projected)}`, input.signal);
852
871
  const parsed = parseCodexJsonl(stdout);
853
872
  const resultText = parsed.resultText ?? (stdout || null);
854
873
  if (code !== 0) {
@@ -1389,11 +1408,14 @@ export function parseAntigravityModelList(stdout) {
1389
1408
  export function parseAntigravityOutput(stdout) {
1390
1409
  try {
1391
1410
  const parsed = JSON.parse(stdout.trim());
1411
+ const earlyEnd = typeof parsed.finished_reason === "string"
1412
+ && ["print_timeout", "interrupted", "error"].includes(parsed.finished_reason);
1392
1413
  return {
1393
1414
  resultText: typeof parsed.response === "string" ? parsed.response : null,
1394
1415
  sessionId: typeof parsed.conversation_id === "string" ? parsed.conversation_id : null,
1395
- status: typeof parsed.status === "string" ? parsed.status : null,
1396
- error: typeof parsed.error === "string" && parsed.error.trim() ? parsed.error : null,
1416
+ status: earlyEnd ? "ERROR" : typeof parsed.status === "string" ? parsed.status : null,
1417
+ error: typeof parsed.error === "string" && parsed.error.trim() ? parsed.error
1418
+ : earlyEnd ? `agy ended early: ${parsed.finished_reason}` : null,
1397
1419
  };
1398
1420
  }
1399
1421
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miraland-labs/conduit-bridge",
3
- "version": "0.16.205",
3
+ "version": "0.16.207",
4
4
  "description": "Conduit Bridge CLI — join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
5
5
  "type": "module",
6
6
  "bin": {