opencara 0.23.9 → 0.23.10

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 +18 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4686,6 +4686,17 @@ function agentConfigToDescriptor(config, agentId, index, agentOwner, userOrgs) {
4686
4686
  var DEFAULT_RECHECK_INTERVAL = 50;
4687
4687
 
4688
4688
  // src/commands/agent.ts
4689
+ function resolveCommandTemplate(agentConfig, globalCommand) {
4690
+ if (agentConfig?.command) return agentConfig.command;
4691
+ if (globalCommand) return globalCommand;
4692
+ if (agentConfig?.tool) {
4693
+ const registryTool = DEFAULT_REGISTRY.tools.find((t) => t.name === agentConfig.tool);
4694
+ if (registryTool) {
4695
+ return registryTool.commandTemplate.replaceAll("${MODEL}", agentConfig.model ?? "");
4696
+ }
4697
+ }
4698
+ return void 0;
4699
+ }
4689
4700
  var DEFAULT_POLL_INTERVAL_MS = 1e4;
4690
4701
  var MAX_CONSECUTIVE_AUTH_ERRORS = 3;
4691
4702
  var MAX_POLL_BACKOFF_MS = 3e5;
@@ -5739,7 +5750,7 @@ function sleep2(ms, signal) {
5739
5750
  async function startAgent(agentId, platformUrl, agentInfo, reviewDeps, consumptionDeps, options) {
5740
5751
  const client = new ApiClient(platformUrl, {
5741
5752
  authToken: options?.authToken,
5742
- cliVersion: "0.23.9",
5753
+ cliVersion: "0.23.10",
5743
5754
  versionOverride: options?.versionOverride,
5744
5755
  onTokenRefresh: options?.onTokenRefresh
5745
5756
  });
@@ -6035,7 +6046,7 @@ async function startBatchAgents(config, agents, pollIntervalMs, oauthToken, opti
6035
6046
  const { versionOverride, verbose, instancesOverride, agentOwner, userOrgs } = options;
6036
6047
  const client = new ApiClient(config.platformUrl, {
6037
6048
  authToken: oauthToken,
6038
- cliVersion: "0.23.9",
6049
+ cliVersion: "0.23.10",
6039
6050
  versionOverride,
6040
6051
  onTokenRefresh: () => getValidToken(config.platformUrl, { configPath: config.authFile })
6041
6052
  });
@@ -6063,7 +6074,7 @@ async function startBatchAgents(config, agents, pollIntervalMs, oauthToken, opti
6063
6074
  let skipped = 0;
6064
6075
  for (let i = 0; i < agents.length; i++) {
6065
6076
  const agentConfig = agents[i];
6066
- const commandTemplate = agentConfig.command ?? config.agentCommand ?? void 0;
6077
+ const commandTemplate = resolveCommandTemplate(agentConfig, config.agentCommand);
6067
6078
  const label = agentConfig.name ?? `agent[${i}]`;
6068
6079
  if (!commandTemplate) {
6069
6080
  logError(`[${label}] No command configured. Skipping.`);
@@ -6210,10 +6221,8 @@ async function startAgentRouter() {
6210
6221
  let agentConfig;
6211
6222
  if (config.agents && config.agents.length > 0) {
6212
6223
  agentConfig = config.agents.find((a) => a.router) ?? config.agents[0];
6213
- commandTemplate = agentConfig.command ?? config.agentCommand ?? void 0;
6214
- } else {
6215
- commandTemplate = config.agentCommand ?? void 0;
6216
6224
  }
6225
+ commandTemplate = resolveCommandTemplate(agentConfig, config.agentCommand);
6217
6226
  const router = new RouterRelay();
6218
6227
  router.start();
6219
6228
  const logger = createLogger(agentConfig?.name ?? "agent[0]");
@@ -6289,10 +6298,8 @@ function startAgentByIndex(config, agentIndex, pollIntervalMs, oauthToken, versi
6289
6298
  let agentConfig;
6290
6299
  if (config.agents && config.agents.length > agentIndex) {
6291
6300
  agentConfig = config.agents[agentIndex];
6292
- commandTemplate = agentConfig.command ?? config.agentCommand ?? void 0;
6293
- } else {
6294
- commandTemplate = config.agentCommand ?? void 0;
6295
6301
  }
6302
+ commandTemplate = resolveCommandTemplate(agentConfig, config.agentCommand);
6296
6303
  const label = agentConfig?.name ?? `agent[${agentIndex}]`;
6297
6304
  if (!commandTemplate) {
6298
6305
  console.error(`[${label}] No command configured. Skipping.`);
@@ -6386,7 +6393,7 @@ agentCommand.command("start").description("Start agents in polling mode").option
6386
6393
  }
6387
6394
  config = loadConfig();
6388
6395
  }
6389
- console.log(formatVersionBanner("0.23.9", "84eda5a"));
6396
+ console.log(formatVersionBanner("0.23.10", "3fd8827"));
6390
6397
  if (config.agents && config.agents.length > 0) {
6391
6398
  const toolEntries = config.agents.map((a) => ({
6392
6399
  tool: a.tool,
@@ -7209,7 +7216,7 @@ var statusCommand = new Command4("status").description("Show agent config, conne
7209
7216
  });
7210
7217
 
7211
7218
  // src/index.ts
7212
- var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.23.9"} (${"84eda5a"})`);
7219
+ var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version(`${"0.23.10"} (${"3fd8827"})`);
7213
7220
  program.addCommand(agentCommand);
7214
7221
  program.addCommand(authCommand());
7215
7222
  program.addCommand(dedupCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencara",
3
- "version": "0.23.9",
3
+ "version": "0.23.10",
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",