opencara 0.22.5 → 0.22.7

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/index.js +12 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3929,7 +3929,7 @@ function commitAndPush(worktreePath, issueNumber, issueTitle) {
3929
3929
  gitExec2([...credArgs, "push", "-u", "origin", "HEAD"], worktreePath);
3930
3930
  return filesChanged;
3931
3931
  }
3932
- function createPR(worktreePath, issueNumber, issueTitle, summary) {
3932
+ function createPR(worktreePath, issueNumber, issueTitle, summary, branchName) {
3933
3933
  const title = `Implement #${issueNumber}: ${issueTitle}`;
3934
3934
  const body = [
3935
3935
  `Part of #${issueNumber}`,
@@ -3940,7 +3940,11 @@ function createPR(worktreePath, issueNumber, issueTitle, summary) {
3940
3940
  "---",
3941
3941
  "*Automated by OpenCara implement agent*"
3942
3942
  ].join("\n");
3943
- const output = ghExec(["pr", "create", "--title", title, "--body", body], worktreePath);
3943
+ const args = ["pr", "create", "--title", title, "--body", body];
3944
+ if (branchName) {
3945
+ args.push("--head", branchName);
3946
+ }
3947
+ const output = ghExec(args, worktreePath);
3944
3948
  const prUrl = output.trim().split("\n").pop()?.trim() ?? "";
3945
3949
  const prNumberMatch = prUrl.match(/\/pull\/(\d+)/);
3946
3950
  if (!prNumberMatch) {
@@ -3949,12 +3953,6 @@ function createPR(worktreePath, issueNumber, issueTitle, summary) {
3949
3953
  const prNumber = parseInt(prNumberMatch[1], 10);
3950
3954
  return { prNumber, prUrl };
3951
3955
  }
3952
- function ensurePromptViaArg(commandTemplate) {
3953
- if (commandTemplate.includes("${PROMPT}")) return commandTemplate;
3954
- const binaryName = commandTemplate.trim().split(/\s+/)[0];
3955
- if (binaryName !== "claude") return commandTemplate;
3956
- return commandTemplate + " -p '${PROMPT}'";
3957
- }
3958
3956
  async function executeImplement(task, worktreePath, deps, timeoutSeconds, signal, runTool = executeTool) {
3959
3957
  const timeoutMs = timeoutSeconds * 1e3;
3960
3958
  if (timeoutMs <= TIMEOUT_SAFETY_MARGIN_MS6) {
@@ -3962,9 +3960,8 @@ async function executeImplement(task, worktreePath, deps, timeoutSeconds, signal
3962
3960
  }
3963
3961
  const effectiveTimeout = timeoutMs - TIMEOUT_SAFETY_MARGIN_MS6;
3964
3962
  const prompt2 = buildImplementPrompt(task);
3965
- const effectiveCommand = ensurePromptViaArg(deps.commandTemplate);
3966
3963
  const result = await runTool(
3967
- effectiveCommand,
3964
+ deps.commandTemplate,
3968
3965
  prompt2,
3969
3966
  effectiveTimeout,
3970
3967
  signal,
@@ -4018,7 +4015,7 @@ async function executeImplementTask(client, agentId, task, deps, timeoutSeconds,
4018
4015
  const filesChanged = gitOps.commitAndPush(worktreePath, issueNumber, issueTitle);
4019
4016
  logger.log(` Pushed ${filesChanged} file(s) to ${branchName}`);
4020
4017
  logger.log(" Creating pull request...");
4021
- const pr = gitOps.createPR(worktreePath, issueNumber, issueTitle, aiResult.output.summary);
4018
+ const pr = gitOps.createPR(worktreePath, issueNumber, issueTitle, aiResult.output.summary, branchName);
4022
4019
  logger.log(` PR #${pr.prNumber} created: ${pr.prUrl}`);
4023
4020
  const report = {
4024
4021
  branch: branchName,
@@ -5534,7 +5531,7 @@ function sleep2(ms, signal) {
5534
5531
  async function startAgent(agentId, platformUrl, agentInfo, reviewDeps, consumptionDeps, options) {
5535
5532
  const client = new ApiClient(platformUrl, {
5536
5533
  authToken: options?.authToken,
5537
- cliVersion: "0.22.5",
5534
+ cliVersion: "0.22.7",
5538
5535
  versionOverride: options?.versionOverride,
5539
5536
  onTokenRefresh: options?.onTokenRefresh
5540
5537
  });
@@ -5820,7 +5817,7 @@ async function startBatchAgents(config, agents, pollIntervalMs, oauthToken, opti
5820
5817
  const { versionOverride, verbose, instancesOverride, agentOwner, userOrgs } = options;
5821
5818
  const client = new ApiClient(config.platformUrl, {
5822
5819
  authToken: oauthToken,
5823
- cliVersion: "0.22.5",
5820
+ cliVersion: "0.22.7",
5824
5821
  versionOverride,
5825
5822
  onTokenRefresh: () => getValidToken(config.platformUrl, { configPath: config.authFile })
5826
5823
  });
@@ -6163,7 +6160,7 @@ agentCommand.command("start").description("Start agents in polling mode").option
6163
6160
  }
6164
6161
  config = loadConfig();
6165
6162
  }
6166
- console.log(formatVersionBanner("0.22.5", "dd7af5e"));
6163
+ console.log(formatVersionBanner("0.22.7", "6ac9177"));
6167
6164
  if (config.agents && config.agents.length > 0) {
6168
6165
  const toolEntries = config.agents.map((a) => ({
6169
6166
  tool: a.tool,
@@ -6986,7 +6983,7 @@ var statusCommand = new Command4("status").description("Show agent config, conne
6986
6983
  });
6987
6984
 
6988
6985
  // src/index.ts
6989
- var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.22.5"} (${"dd7af5e"})`);
6986
+ var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.22.7"} (${"6ac9177"})`);
6990
6987
  program.addCommand(agentCommand);
6991
6988
  program.addCommand(authCommand());
6992
6989
  program.addCommand(dedupCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencara",
3
- "version": "0.22.5",
3
+ "version": "0.22.7",
4
4
  "description": "Distributed AI code review agent — poll, review, and submit PR reviews using your own AI tools",
5
5
  "type": "module",
6
6
  "license": "MIT",