@buildautomaton/cli 0.1.83 → 0.1.85

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/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 FLY_DEFAULT_HOST_SKU = defineHostSku({
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
 
@@ -32849,6 +32858,11 @@ var INSTALLABLE_BRIDGE_AGENTS = [
32849
32858
  { value: "opencode", label: "OpenCode agent", tokenLabel: "Provider API key", tokenEnvVar: "OPENCODE_API_KEY" }
32850
32859
  ];
32851
32860
 
32861
+ // ../types/src/agent-subscriptions.ts
32862
+ var AGENT_SUBSCRIPTION_TYPES = INSTALLABLE_BRIDGE_AGENTS.map(
32863
+ (a) => a.value
32864
+ );
32865
+
32852
32866
  // src/agents/acp/safe-fs-path.ts
32853
32867
  import * as path2 from "node:path";
32854
32868
  function resolveSafePathUnderCwd(cwd, filePath) {
@@ -35181,7 +35195,7 @@ function createPendingAuthOnMessage(params) {
35181
35195
  }
35182
35196
 
35183
35197
  // src/cli-version.ts
35184
- var CLI_VERSION = "0.1.83".length > 0 ? "0.1.83" : "0.0.0-dev";
35198
+ var CLI_VERSION = "0.1.85".length > 0 ? "0.1.85" : "0.0.0-dev";
35185
35199
 
35186
35200
  // src/auth/pending/pending-auth-on-open.ts
35187
35201
  function createPendingAuthOnOpen(params) {
@@ -36835,13 +36849,40 @@ function createCursorAcpHandle(options) {
36835
36849
  // src/agents/acp/clients/cursor/cursor-acp-init.ts
36836
36850
  import * as readline from "node:readline";
36837
36851
 
36852
+ // src/agents/acp/clients/cursor/cursor-incoming-cursor-task.ts
36853
+ function buildCursorTaskToolCallUpdate(params) {
36854
+ const toolCallId = params.toolCallId ?? params.tool_call_id;
36855
+ if (typeof toolCallId !== "string" || !toolCallId.trim()) return null;
36856
+ const description = typeof params.description === "string" ? params.description.trim() : "";
36857
+ const prompt = typeof params.prompt === "string" ? params.prompt : void 0;
36858
+ const subagentType = params.subagentType ?? params.subagent_type;
36859
+ const model = typeof params.model === "string" ? params.model : void 0;
36860
+ const agentId = typeof params.agentId === "string" ? params.agentId : typeof params.agent_id === "string" ? params.agent_id : void 0;
36861
+ const durationMs = typeof params.durationMs === "number" ? params.durationMs : typeof params.duration_ms === "number" ? params.duration_ms : void 0;
36862
+ return {
36863
+ sessionUpdate: "tool_call_update",
36864
+ toolCallId,
36865
+ ...description ? { title: description } : {},
36866
+ cursorTask: {
36867
+ ...description ? { description } : {},
36868
+ ...prompt != null ? { prompt } : {},
36869
+ ...subagentType != null ? { subagentType } : {},
36870
+ ...model != null ? { model } : {},
36871
+ ...agentId != null ? { agentId } : {},
36872
+ ...durationMs != null ? { durationMs } : {}
36873
+ }
36874
+ };
36875
+ }
36876
+ function handleCursorIncomingCursorTask(id, msg, deps) {
36877
+ const params = msg.params ?? {};
36878
+ deps.respond(id, {});
36879
+ const update = buildCursorTaskToolCallUpdate(params);
36880
+ if (update) deps.onSessionUpdate?.(update);
36881
+ }
36882
+
36838
36883
  // src/agents/acp/clients/cursor/cursor-incoming-cursor-methods.ts
36839
36884
  var CURSOR_BRIDGE_METHODS = /* @__PURE__ */ new Set(["cursor/create_plan", "cursor/ask_question"]);
36840
- var CURSOR_NOOP_METHODS = /* @__PURE__ */ new Set([
36841
- "cursor/update_todos",
36842
- "cursor/task",
36843
- "cursor/generate_image"
36844
- ]);
36885
+ var CURSOR_NOOP_METHODS = /* @__PURE__ */ new Set(["cursor/update_todos", "cursor/generate_image"]);
36845
36886
  function handleCursorIncomingCursorMethods(method, id, msg, deps) {
36846
36887
  if (CURSOR_BRIDGE_METHODS.has(method)) {
36847
36888
  const params = msg.params ?? {};
@@ -36853,6 +36894,10 @@ function handleCursorIncomingCursorMethods(method, id, msg, deps) {
36853
36894
  });
36854
36895
  return true;
36855
36896
  }
36897
+ if (method === "cursor/task") {
36898
+ handleCursorIncomingCursorTask(id, msg, deps);
36899
+ return true;
36900
+ }
36856
36901
  if (CURSOR_NOOP_METHODS.has(method)) {
36857
36902
  deps.respond(id, {});
36858
36903
  return true;
@@ -37012,6 +37057,7 @@ function createCursorAcpIncomingLineHandler(deps) {
37012
37057
  respond: deps.respond,
37013
37058
  respondJsonRpcError: deps.respondJsonRpcError,
37014
37059
  onRequest: deps.onRequest,
37060
+ onSessionUpdate: deps.onSessionUpdate,
37015
37061
  pendingRequests: deps.pendingRequests
37016
37062
  };
37017
37063
  return {
@@ -47782,12 +47828,6 @@ async function pushAheadOfUpstreamForPaths(paths) {
47782
47828
  }
47783
47829
 
47784
47830
  // src/worktrees/manager/resolve-commit-targets.ts
47785
- function bridgeRootBinding(bridgeRoot) {
47786
- return {
47787
- sessionParentPath: bridgeRoot,
47788
- repoCheckoutPaths: [bridgeRoot]
47789
- };
47790
- }
47791
47831
  async function resolveCommitTargetsAsync(sessionId, cache2, discover) {
47792
47832
  const sid = sessionId.trim();
47793
47833
  const paths = cache2.getRepoCheckoutPathsRef(sid);
@@ -47797,9 +47837,7 @@ async function resolveCommitTargetsAsync(sessionId, cache2, discover) {
47797
47837
  cache2.remember(sid, disc);
47798
47838
  return disc.repoCheckoutPaths;
47799
47839
  }
47800
- const bridgeRoot = getBridgeRoot();
47801
- cache2.remember(sid, bridgeRootBinding(bridgeRoot));
47802
- return [bridgeRoot];
47840
+ return [getBridgeRoot()];
47803
47841
  }
47804
47842
 
47805
47843
  // src/worktrees/manager/git/get-session-working-tree-status.ts
@@ -49006,33 +49044,42 @@ async function removeSessionWorktreeCheckouts(cache2, sessionId, worktreesRootPa
49006
49044
  await removeSessionWorktrees(paths, worktreesRootPath, log2);
49007
49045
  }
49008
49046
 
49047
+ // src/worktrees/manager/git/rename-session-worktree-branch.ts
49048
+ init_normalize_resolved_path();
49049
+
49009
49050
  // src/git/branches/rename-branch.ts
49010
49051
  async function gitRenameCurrentBranch(repoDir, newName) {
49011
49052
  const g = cliSimpleGit(repoDir);
49012
49053
  await g.raw(["branch", "-m", newName]);
49013
49054
  }
49014
49055
 
49056
+ // src/worktrees/sanitize-git-branch-name.ts
49057
+ function sanitizeGitBranchName(newBranch) {
49058
+ return newBranch.replace(/[^a-zA-Z0-9/_-]+/g, "-").slice(0, 80) || "session-branch";
49059
+ }
49060
+
49015
49061
  // src/worktrees/rename-session-worktree-branches.ts
49016
49062
  async function renameSessionWorktreeBranches(paths, newBranch, log2) {
49017
- const safe = newBranch.replace(/[^a-zA-Z0-9/_-]+/g, "-").slice(0, 80) || "session-branch";
49063
+ const safe = sanitizeGitBranchName(newBranch);
49018
49064
  await forEachWithGitYield(paths, async (wt) => {
49019
49065
  if (!await isGitRepoDirectory(wt)) return;
49020
- try {
49021
- await gitRenameCurrentBranch(wt, safe);
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
- }
49066
+ await gitRenameCurrentBranch(wt, safe);
49067
+ log2(`[worktrees] Renamed branch in ${wt} \u2192 ${safe}`);
49028
49068
  });
49069
+ return safe;
49029
49070
  }
49030
49071
 
49031
49072
  // src/worktrees/manager/git/rename-session-worktree-branch.ts
49032
49073
  async function renameSessionWorktreeBranch(cache2, sessionId, newBranch, log2) {
49033
49074
  const paths = cache2.getRepoCheckoutPathsRef(sessionId);
49034
- if (!paths?.length) return;
49035
- await renameSessionWorktreeBranches(paths, newBranch, log2);
49075
+ if (!paths?.length) return null;
49076
+ const bridgeRoot = normalizeResolvedPath(getBridgeRoot());
49077
+ const worktreePaths = paths.filter((p) => normalizeResolvedPath(p) !== bridgeRoot);
49078
+ if (!worktreePaths.length) {
49079
+ log2(`[worktrees] Skipping branch rename for ${sessionId}: no session worktree paths`);
49080
+ return null;
49081
+ }
49082
+ return renameSessionWorktreeBranches(worktreePaths, newBranch, log2);
49036
49083
  }
49037
49084
 
49038
49085
  // src/worktrees/discovery/discover-session-worktree-on-disk.ts
@@ -49832,7 +49879,20 @@ function createSessionWorktreeGitApi(ctx) {
49832
49879
  await removeSessionWorktreeCheckouts(ctx.cache, sessionId, ctx.worktreesRootPath, ctx.log);
49833
49880
  },
49834
49881
  async commitSession(params) {
49835
- return commitSessionWorktree(ctx.cache, params);
49882
+ let branch = params.branch;
49883
+ if (params.renameBranch) {
49884
+ const renamed = await renameSessionWorktreeBranch(
49885
+ ctx.cache,
49886
+ params.sessionId,
49887
+ params.branch,
49888
+ ctx.log
49889
+ );
49890
+ if (renamed == null) {
49891
+ return { ok: false, error: "Branch rename is only supported for session worktrees" };
49892
+ }
49893
+ branch = renamed;
49894
+ }
49895
+ return commitSessionWorktree(ctx.cache, { ...params, branch });
49836
49896
  },
49837
49897
  async getSessionWorkingTreeStatus(sessionId) {
49838
49898
  return getSessionWorkingTreeStatus(ctx.cache, sessionId, (sid) => paths.discoverAsync(sid));
@@ -53140,6 +53200,7 @@ async function handleSessionGitCommitAction(deps, sessionId, msg, reply) {
53140
53200
  const branch = typeof msg.branch === "string" ? msg.branch : "";
53141
53201
  const message = typeof msg.message === "string" ? msg.message : "";
53142
53202
  const pushAfterCommit = msg.pushAfterCommit === true;
53203
+ const renameBranch = msg.renameBranch === true;
53143
53204
  if (!branch.trim() || !message.trim()) {
53144
53205
  reply({ ok: false, error: "branch and message are required for commit" });
53145
53206
  return;
@@ -53148,7 +53209,8 @@ async function handleSessionGitCommitAction(deps, sessionId, msg, reply) {
53148
53209
  sessionId,
53149
53210
  branch: branch.trim(),
53150
53211
  message: message.trim(),
53151
- push: pushAfterCommit
53212
+ push: pushAfterCommit,
53213
+ renameBranch
53152
53214
  });
53153
53215
  if (!commitRes.ok) {
53154
53216
  reply({ ok: false, error: commitRes.error ?? "Commit failed" });