@miraland-labs/conduit-bridge 0.16.133 → 0.16.135
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/config.js +5 -39
- package/dist/driver.js +0 -15
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -29,22 +29,6 @@ const runtimePath = join(directory, "runtime.json");
|
|
|
29
29
|
const lockPath = join(directory, "config.lock");
|
|
30
30
|
const pendingPath = join(directory, "pending-connect.json");
|
|
31
31
|
const installationPath = join(directory, "installation.json");
|
|
32
|
-
/**
|
|
33
|
-
* Prefer runtime.json; when absent, adopt legacy activeAttempts/sessions still on config.json
|
|
34
|
-
* so one Bridge upgrade does not strand in-flight claims.
|
|
35
|
-
*/
|
|
36
|
-
export function adoptLegacyRuntimeClaims(input) {
|
|
37
|
-
if (input.runtime) {
|
|
38
|
-
return {
|
|
39
|
-
activeAttempts: input.runtime.activeAttempts ?? {},
|
|
40
|
-
sessions: input.runtime.sessions,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
activeAttempts: input.legacyAttempts,
|
|
45
|
-
sessions: input.legacySessions,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
32
|
export async function loadConfig() {
|
|
49
33
|
const config = await loadConfigIfPresent();
|
|
50
34
|
if (!config)
|
|
@@ -71,13 +55,9 @@ export async function loadConfigIfPresent() {
|
|
|
71
55
|
}
|
|
72
56
|
}
|
|
73
57
|
const runtime = await loadRuntime();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
legacySessions: config.sessions && typeof config.sessions === "object" ? config.sessions : undefined,
|
|
78
|
-
});
|
|
79
|
-
config.activeAttempts = adopted.activeAttempts;
|
|
80
|
-
config.sessions = adopted.sessions;
|
|
58
|
+
// Claims live only in runtime.json; a fresh install has none.
|
|
59
|
+
config.activeAttempts = runtime?.activeAttempts ?? {};
|
|
60
|
+
config.sessions = runtime?.sessions;
|
|
81
61
|
for (const active of Object.values(config.activeAttempts))
|
|
82
62
|
active.phase ??= "agent_running";
|
|
83
63
|
if (config.fuelSource !== "local" && config.fuelSource !== "conduit")
|
|
@@ -264,24 +244,10 @@ export async function saveConfig(config, options = {}) {
|
|
|
264
244
|
diskPrefs = JSON.parse(await readFile(path, "utf8"));
|
|
265
245
|
}
|
|
266
246
|
catch { /* no prior config */ }
|
|
267
|
-
// One-time migrate: if runtime.json is missing, preserve legacy activeAttempts from config.json.
|
|
268
|
-
const existingRuntime = await loadRuntime();
|
|
269
|
-
if (!existingRuntime && diskPrefs) {
|
|
270
|
-
const legacyAttempts = diskPrefs.activeAttempts && typeof diskPrefs.activeAttempts === "object"
|
|
271
|
-
? diskPrefs.activeAttempts
|
|
272
|
-
: {};
|
|
273
|
-
const legacySessions = diskPrefs.sessions && typeof diskPrefs.sessions === "object"
|
|
274
|
-
? diskPrefs.sessions
|
|
275
|
-
: undefined;
|
|
276
|
-
if (Object.keys(legacyAttempts).length || legacySessions) {
|
|
277
|
-
await writeJsonAtomic(runtimePath, { activeAttempts: legacyAttempts, sessions: legacySessions });
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
247
|
const prefs = { ...snapshot, drivers: mergeCurrentDriverQuota(diskPrefs, snapshot.drivers) };
|
|
281
248
|
delete prefs.activeAttempts;
|
|
282
249
|
delete prefs.sessions;
|
|
283
|
-
|
|
284
|
-
await writeJsonAtomic(path, prefsForDisk);
|
|
250
|
+
await writeJsonAtomic(path, prefs);
|
|
285
251
|
if (!options.prefsOnly) {
|
|
286
252
|
const disk = await loadRuntime();
|
|
287
253
|
await writeJsonAtomic(runtimePath, mergeRuntimeState(disk, {
|
|
@@ -342,7 +308,7 @@ async function updateDriverLane(driverId, update) {
|
|
|
342
308
|
if (!lane || typeof lane !== "object")
|
|
343
309
|
return;
|
|
344
310
|
update(lane);
|
|
345
|
-
await writeJsonAtomic(path,
|
|
311
|
+
await writeJsonAtomic(path, prefs);
|
|
346
312
|
});
|
|
347
313
|
};
|
|
348
314
|
const next = saveChain.then(run, run);
|
package/dist/driver.js
CHANGED
|
@@ -787,15 +787,6 @@ export function claudeCodeFuelEnv(fuelSource, model) {
|
|
|
787
787
|
return undefined;
|
|
788
788
|
return { ANTHROPIC_MODEL: model, ANTHROPIC_SMALL_FAST_MODEL: model, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1" };
|
|
789
789
|
}
|
|
790
|
-
/** Map Conduit grants → Codex sandbox (privileged grants never widen the sandbox). */
|
|
791
|
-
export function codexSandboxForGrants(grants) {
|
|
792
|
-
if (grants.includes("repo_write") || grants.includes("branch_create") || grants.includes("pr_create") || grants.includes("test_run")) {
|
|
793
|
-
return "workspace-write";
|
|
794
|
-
}
|
|
795
|
-
if (grants.includes("repo_read"))
|
|
796
|
-
return "read-only";
|
|
797
|
-
return null;
|
|
798
|
-
}
|
|
799
790
|
/**
|
|
800
791
|
* Codex exec arguments. The sandbox is the enforcement boundary: network stays
|
|
801
792
|
* off inside workspace-write unless the class/capabilities require it.
|
|
@@ -2075,12 +2066,6 @@ export function hasGrokLogin(env = process.env) {
|
|
|
2075
2066
|
// `~/.grok` exists after install; auth.json is the `grok login` / cached_token file.
|
|
2076
2067
|
return Boolean(home && existsSync(join(home, ".grok", "auth.json")));
|
|
2077
2068
|
}
|
|
2078
|
-
/** True when local fuel can use a host vendor login for at least one supported agent. */
|
|
2079
|
-
export function hasLocalVendorLogin(env = process.env) {
|
|
2080
|
-
return hasClaudeLogin(env) || hasOpenAiLogin(env) || hasCursorLogin(env)
|
|
2081
|
-
|| hasOpenCodeLogin(env) || hasKiroLogin(env) || hasAntigravityLogin(env)
|
|
2082
|
-
|| hasGrokLogin(env);
|
|
2083
|
-
}
|
|
2084
2069
|
/** Exported for tests — builds the stripped process env with optional Conduit fuel. */
|
|
2085
2070
|
export function agentProcessEnv(fuel, fuelSource = "conduit", extraEnv) {
|
|
2086
2071
|
return boundedEnvironment(fuel, fuelSource, extraEnv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraland-labs/conduit-bridge",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.135",
|
|
4
4
|
"description": "Conduit Bridge CLI \u2014 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": {
|