@miraland-labs/conduit-bridge 0.16.4 → 0.16.5
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/attempt-worktree.js +27 -0
- package/dist/ensure-land-commit.js +8 -1
- package/dist/execution.js +5 -1
- package/dist/land-contract.js +6 -1
- package/package.json +1 -1
package/dist/attempt-worktree.js
CHANGED
|
@@ -53,8 +53,35 @@ export async function createAttemptWorktree(input) {
|
|
|
53
53
|
// "commit on the current branch" accurate. -b fails if the branch exists, which is the desired
|
|
54
54
|
// guard — createAttemptWorktree only ever runs for a fresh attempt id (resume reuses its worktree).
|
|
55
55
|
["-C", input.sourceWorkspace, "worktree", "add", "-b", attemptBranchName(input.attemptId), path, input.startCommit], { timeout: 60_000, maxBuffer: 2_000_000 });
|
|
56
|
+
await ensureWorktreeGitIdentity(path, input.sourceWorkspace);
|
|
56
57
|
return path;
|
|
57
58
|
}
|
|
59
|
+
/** Attempt worktrees are separate checkouts; agents cannot always run git config. Inherit identity from source or set Bridge defaults. */
|
|
60
|
+
export async function ensureWorktreeGitIdentity(worktree, sourceWorkspace) {
|
|
61
|
+
const git = async (...args) => execFileAsync("git", ["-C", worktree, ...args], {
|
|
62
|
+
timeout: 30_000,
|
|
63
|
+
maxBuffer: 1_000_000,
|
|
64
|
+
});
|
|
65
|
+
const readConfig = async (repo, key) => {
|
|
66
|
+
try {
|
|
67
|
+
const { stdout } = await execFileAsync("git", ["-C", repo, "config", "--get", key], {
|
|
68
|
+
timeout: 30_000,
|
|
69
|
+
maxBuffer: 1_000_000,
|
|
70
|
+
});
|
|
71
|
+
return stdout.trim();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return "";
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
for (const key of ["user.email", "user.name"]) {
|
|
78
|
+
if (await readConfig(worktree, key))
|
|
79
|
+
continue;
|
|
80
|
+
const inherited = await readConfig(sourceWorkspace, key);
|
|
81
|
+
const fallback = key === "user.email" ? "conduit-bridge@miraland.io" : "Conduit Bridge";
|
|
82
|
+
await git("config", key, inherited || fallback);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
58
85
|
export async function removeAttemptWorktree(sourceWorkspace, worktreePath) {
|
|
59
86
|
// Settled repair releases are returned on every assignment poll until the local tree is gone.
|
|
60
87
|
// Make that at-least-once signal cheap and idempotent instead of invoking Git on a missing path.
|
|
@@ -36,6 +36,8 @@ async function uncommittedPaths(workspace) {
|
|
|
36
36
|
}
|
|
37
37
|
return paths;
|
|
38
38
|
}
|
|
39
|
+
const LAND_COMMIT_EMAIL = "conduit-bridge@miraland.io";
|
|
40
|
+
const LAND_COMMIT_NAME = "Conduit Bridge";
|
|
39
41
|
async function commitScopedPaths(workspace, paths) {
|
|
40
42
|
if (!paths.length)
|
|
41
43
|
throw new Error("Cannot land an empty path set");
|
|
@@ -43,7 +45,12 @@ async function commitScopedPaths(workspace, paths) {
|
|
|
43
45
|
timeout: 120_000,
|
|
44
46
|
maxBuffer: 8_000_000,
|
|
45
47
|
});
|
|
46
|
-
await execFileAsync("git", [
|
|
48
|
+
await execFileAsync("git", [
|
|
49
|
+
"-C", workspace,
|
|
50
|
+
"-c", `user.email=${LAND_COMMIT_EMAIL}`,
|
|
51
|
+
"-c", `user.name=${LAND_COMMIT_NAME}`,
|
|
52
|
+
"commit", "-m", "Conduit: land scoped agent changes",
|
|
53
|
+
], { timeout: 120_000, maxBuffer: 8_000_000 });
|
|
47
54
|
}
|
|
48
55
|
/**
|
|
49
56
|
* When the land contract applies, ensure the attempt branch has at least one commit after base.
|
package/dist/execution.js
CHANGED
|
@@ -1662,7 +1662,11 @@ function pathMatchesScope(path, scope) {
|
|
|
1662
1662
|
const prefix = normalized.slice(0, -3);
|
|
1663
1663
|
return path === prefix || path.startsWith(`${prefix}/`);
|
|
1664
1664
|
}
|
|
1665
|
-
|
|
1665
|
+
if (path === normalized)
|
|
1666
|
+
return true;
|
|
1667
|
+
if (!normalized.includes("*") && path.startsWith(`${normalized}/`))
|
|
1668
|
+
return true;
|
|
1669
|
+
return false;
|
|
1666
1670
|
}
|
|
1667
1671
|
function retainDiagnosticWorktree(response) {
|
|
1668
1672
|
// Lease expiry is reconciled by the CP into another diagnostic attempt. The old terminal cannot
|
package/dist/land-contract.js
CHANGED
|
@@ -38,7 +38,12 @@ export function pathMatchesScope(path, scope) {
|
|
|
38
38
|
const prefix = normalized.slice(0, -3);
|
|
39
39
|
return path === prefix || path.startsWith(`${prefix}/`);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
if (path === normalized)
|
|
42
|
+
return true;
|
|
43
|
+
// Directory scopes without /** still cover nested files (oracle-file-delivery/src/fetcher.rs).
|
|
44
|
+
if (!normalized.includes("*") && path.startsWith(`${normalized}/`))
|
|
45
|
+
return true;
|
|
46
|
+
return false;
|
|
42
47
|
}
|
|
43
48
|
export function filterPathsInScope(paths, changeScope) {
|
|
44
49
|
if (!changeScope.length)
|
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.5",
|
|
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": {
|