@buildautomaton/cli 0.1.83 → 0.1.84
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 +49 -24
- package/dist/cli.js.map +3 -3
- package/dist/index.js +49 -24
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32828,7 +32828,7 @@ var FLY_LEGACY_HOST_SKU = defineHostSku({
|
|
|
32828
32828
|
storage: { storageGb: 1 },
|
|
32829
32829
|
monthlyPriceCents: 750
|
|
32830
32830
|
});
|
|
32831
|
-
var
|
|
32831
|
+
var FLY_LEGACY_1G_HOST_SKU = defineHostSku({
|
|
32832
32832
|
id: "fly-shared-1x1024-1gb",
|
|
32833
32833
|
provider: "fly",
|
|
32834
32834
|
compute: { cpus: 1, cpuKind: "shared" },
|
|
@@ -32836,8 +32836,17 @@ var FLY_DEFAULT_HOST_SKU = defineHostSku({
|
|
|
32836
32836
|
storage: { storageGb: 1 },
|
|
32837
32837
|
monthlyPriceCents: 1e3
|
|
32838
32838
|
});
|
|
32839
|
+
var FLY_DEFAULT_HOST_SKU = defineHostSku({
|
|
32840
|
+
id: "fly-shared-2x2048-1gb",
|
|
32841
|
+
provider: "fly",
|
|
32842
|
+
compute: { cpus: 2, cpuKind: "shared" },
|
|
32843
|
+
memory: { memoryMb: 2048 },
|
|
32844
|
+
storage: { storageGb: 1 },
|
|
32845
|
+
monthlyPriceCents: 2e3
|
|
32846
|
+
});
|
|
32839
32847
|
var HOST_SKUS_BY_ID = {
|
|
32840
32848
|
[FLY_LEGACY_HOST_SKU.id]: FLY_LEGACY_HOST_SKU,
|
|
32849
|
+
[FLY_LEGACY_1G_HOST_SKU.id]: FLY_LEGACY_1G_HOST_SKU,
|
|
32841
32850
|
[FLY_DEFAULT_HOST_SKU.id]: FLY_DEFAULT_HOST_SKU
|
|
32842
32851
|
};
|
|
32843
32852
|
|
|
@@ -35181,7 +35190,7 @@ function createPendingAuthOnMessage(params) {
|
|
|
35181
35190
|
}
|
|
35182
35191
|
|
|
35183
35192
|
// src/cli-version.ts
|
|
35184
|
-
var CLI_VERSION = "0.1.
|
|
35193
|
+
var CLI_VERSION = "0.1.84".length > 0 ? "0.1.84" : "0.0.0-dev";
|
|
35185
35194
|
|
|
35186
35195
|
// src/auth/pending/pending-auth-on-open.ts
|
|
35187
35196
|
function createPendingAuthOnOpen(params) {
|
|
@@ -47782,12 +47791,6 @@ async function pushAheadOfUpstreamForPaths(paths) {
|
|
|
47782
47791
|
}
|
|
47783
47792
|
|
|
47784
47793
|
// src/worktrees/manager/resolve-commit-targets.ts
|
|
47785
|
-
function bridgeRootBinding(bridgeRoot) {
|
|
47786
|
-
return {
|
|
47787
|
-
sessionParentPath: bridgeRoot,
|
|
47788
|
-
repoCheckoutPaths: [bridgeRoot]
|
|
47789
|
-
};
|
|
47790
|
-
}
|
|
47791
47794
|
async function resolveCommitTargetsAsync(sessionId, cache2, discover) {
|
|
47792
47795
|
const sid = sessionId.trim();
|
|
47793
47796
|
const paths = cache2.getRepoCheckoutPathsRef(sid);
|
|
@@ -47797,9 +47800,7 @@ async function resolveCommitTargetsAsync(sessionId, cache2, discover) {
|
|
|
47797
47800
|
cache2.remember(sid, disc);
|
|
47798
47801
|
return disc.repoCheckoutPaths;
|
|
47799
47802
|
}
|
|
47800
|
-
|
|
47801
|
-
cache2.remember(sid, bridgeRootBinding(bridgeRoot));
|
|
47802
|
-
return [bridgeRoot];
|
|
47803
|
+
return [getBridgeRoot()];
|
|
47803
47804
|
}
|
|
47804
47805
|
|
|
47805
47806
|
// src/worktrees/manager/git/get-session-working-tree-status.ts
|
|
@@ -49006,33 +49007,42 @@ async function removeSessionWorktreeCheckouts(cache2, sessionId, worktreesRootPa
|
|
|
49006
49007
|
await removeSessionWorktrees(paths, worktreesRootPath, log2);
|
|
49007
49008
|
}
|
|
49008
49009
|
|
|
49010
|
+
// src/worktrees/manager/git/rename-session-worktree-branch.ts
|
|
49011
|
+
init_normalize_resolved_path();
|
|
49012
|
+
|
|
49009
49013
|
// src/git/branches/rename-branch.ts
|
|
49010
49014
|
async function gitRenameCurrentBranch(repoDir, newName) {
|
|
49011
49015
|
const g = cliSimpleGit(repoDir);
|
|
49012
49016
|
await g.raw(["branch", "-m", newName]);
|
|
49013
49017
|
}
|
|
49014
49018
|
|
|
49019
|
+
// src/worktrees/sanitize-git-branch-name.ts
|
|
49020
|
+
function sanitizeGitBranchName(newBranch) {
|
|
49021
|
+
return newBranch.replace(/[^a-zA-Z0-9/_-]+/g, "-").slice(0, 80) || "session-branch";
|
|
49022
|
+
}
|
|
49023
|
+
|
|
49015
49024
|
// src/worktrees/rename-session-worktree-branches.ts
|
|
49016
49025
|
async function renameSessionWorktreeBranches(paths, newBranch, log2) {
|
|
49017
|
-
const safe = newBranch
|
|
49026
|
+
const safe = sanitizeGitBranchName(newBranch);
|
|
49018
49027
|
await forEachWithGitYield(paths, async (wt) => {
|
|
49019
49028
|
if (!await isGitRepoDirectory(wt)) return;
|
|
49020
|
-
|
|
49021
|
-
|
|
49022
|
-
log2(`[worktrees] Renamed branch in ${wt} \u2192 ${safe}`);
|
|
49023
|
-
} catch (e) {
|
|
49024
|
-
log2(
|
|
49025
|
-
`[worktrees] Branch rename failed in ${wt}: ${e instanceof Error ? e.message : String(e)}`
|
|
49026
|
-
);
|
|
49027
|
-
}
|
|
49029
|
+
await gitRenameCurrentBranch(wt, safe);
|
|
49030
|
+
log2(`[worktrees] Renamed branch in ${wt} \u2192 ${safe}`);
|
|
49028
49031
|
});
|
|
49032
|
+
return safe;
|
|
49029
49033
|
}
|
|
49030
49034
|
|
|
49031
49035
|
// src/worktrees/manager/git/rename-session-worktree-branch.ts
|
|
49032
49036
|
async function renameSessionWorktreeBranch(cache2, sessionId, newBranch, log2) {
|
|
49033
49037
|
const paths = cache2.getRepoCheckoutPathsRef(sessionId);
|
|
49034
|
-
if (!paths?.length) return;
|
|
49035
|
-
|
|
49038
|
+
if (!paths?.length) return null;
|
|
49039
|
+
const bridgeRoot = normalizeResolvedPath(getBridgeRoot());
|
|
49040
|
+
const worktreePaths = paths.filter((p) => normalizeResolvedPath(p) !== bridgeRoot);
|
|
49041
|
+
if (!worktreePaths.length) {
|
|
49042
|
+
log2(`[worktrees] Skipping branch rename for ${sessionId}: no session worktree paths`);
|
|
49043
|
+
return null;
|
|
49044
|
+
}
|
|
49045
|
+
return renameSessionWorktreeBranches(worktreePaths, newBranch, log2);
|
|
49036
49046
|
}
|
|
49037
49047
|
|
|
49038
49048
|
// src/worktrees/discovery/discover-session-worktree-on-disk.ts
|
|
@@ -49832,7 +49842,20 @@ function createSessionWorktreeGitApi(ctx) {
|
|
|
49832
49842
|
await removeSessionWorktreeCheckouts(ctx.cache, sessionId, ctx.worktreesRootPath, ctx.log);
|
|
49833
49843
|
},
|
|
49834
49844
|
async commitSession(params) {
|
|
49835
|
-
|
|
49845
|
+
let branch = params.branch;
|
|
49846
|
+
if (params.renameBranch) {
|
|
49847
|
+
const renamed = await renameSessionWorktreeBranch(
|
|
49848
|
+
ctx.cache,
|
|
49849
|
+
params.sessionId,
|
|
49850
|
+
params.branch,
|
|
49851
|
+
ctx.log
|
|
49852
|
+
);
|
|
49853
|
+
if (renamed == null) {
|
|
49854
|
+
return { ok: false, error: "Branch rename is only supported for session worktrees" };
|
|
49855
|
+
}
|
|
49856
|
+
branch = renamed;
|
|
49857
|
+
}
|
|
49858
|
+
return commitSessionWorktree(ctx.cache, { ...params, branch });
|
|
49836
49859
|
},
|
|
49837
49860
|
async getSessionWorkingTreeStatus(sessionId) {
|
|
49838
49861
|
return getSessionWorkingTreeStatus(ctx.cache, sessionId, (sid) => paths.discoverAsync(sid));
|
|
@@ -53140,6 +53163,7 @@ async function handleSessionGitCommitAction(deps, sessionId, msg, reply) {
|
|
|
53140
53163
|
const branch = typeof msg.branch === "string" ? msg.branch : "";
|
|
53141
53164
|
const message = typeof msg.message === "string" ? msg.message : "";
|
|
53142
53165
|
const pushAfterCommit = msg.pushAfterCommit === true;
|
|
53166
|
+
const renameBranch = msg.renameBranch === true;
|
|
53143
53167
|
if (!branch.trim() || !message.trim()) {
|
|
53144
53168
|
reply({ ok: false, error: "branch and message are required for commit" });
|
|
53145
53169
|
return;
|
|
@@ -53148,7 +53172,8 @@ async function handleSessionGitCommitAction(deps, sessionId, msg, reply) {
|
|
|
53148
53172
|
sessionId,
|
|
53149
53173
|
branch: branch.trim(),
|
|
53150
53174
|
message: message.trim(),
|
|
53151
|
-
push: pushAfterCommit
|
|
53175
|
+
push: pushAfterCommit,
|
|
53176
|
+
renameBranch
|
|
53152
53177
|
});
|
|
53153
53178
|
if (!commitRes.ok) {
|
|
53154
53179
|
reply({ ok: false, error: commitRes.error ?? "Commit failed" });
|