opencara 0.18.1 → 0.18.3

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 +22 -8
  2. package/package.json +5 -2
package/dist/index.js CHANGED
@@ -814,22 +814,32 @@ To authenticate, visit: ${initData.verification_uri}`);
814
814
  if (Date.now() >= deadline) {
815
815
  break;
816
816
  }
817
- const tokenRes = await fetchFn(`${platformUrl}/api/auth/device/token`, {
818
- method: "POST",
819
- headers: { "Content-Type": "application/json" },
820
- body: JSON.stringify({ device_code: initData.device_code })
821
- });
817
+ let tokenRes;
818
+ try {
819
+ tokenRes = await fetchFn(`${platformUrl}/api/auth/device/token`, {
820
+ method: "POST",
821
+ headers: { "Content-Type": "application/json" },
822
+ body: JSON.stringify({ device_code: initData.device_code })
823
+ });
824
+ } catch (err) {
825
+ const code = err?.cause?.code ?? "UNKNOWN";
826
+ log(` [poll] network error: ${code}`);
827
+ continue;
828
+ }
822
829
  if (!tokenRes.ok) {
830
+ let errText = "";
823
831
  try {
824
- await tokenRes.text();
832
+ errText = await tokenRes.text();
825
833
  } catch {
826
834
  }
835
+ log(` [poll] server returned ${tokenRes.status}: ${errText.slice(0, 120)}`);
827
836
  continue;
828
837
  }
829
838
  let body;
830
839
  try {
831
840
  body = await tokenRes.json();
832
841
  } catch {
842
+ log(" [poll] malformed JSON response");
833
843
  continue;
834
844
  }
835
845
  if (body.error) {
@@ -842,6 +852,10 @@ To authenticate, visit: ${initData.verification_uri}`);
842
852
  }
843
853
  if (errorStr === "slow_down") {
844
854
  interval += 5e3;
855
+ log(" [poll] slow_down \u2014 increasing interval");
856
+ }
857
+ if (errorStr !== "authorization_pending") {
858
+ log(` [poll] GitHub error: ${errorStr}`);
845
859
  }
846
860
  continue;
847
861
  }
@@ -3578,7 +3592,7 @@ function sleep2(ms, signal) {
3578
3592
  async function startAgent(agentId, platformUrl, agentInfo, reviewDeps, consumptionDeps, options) {
3579
3593
  const client = new ApiClient(platformUrl, {
3580
3594
  authToken: options?.authToken,
3581
- cliVersion: "0.18.1",
3595
+ cliVersion: "0.18.3",
3582
3596
  versionOverride: options?.versionOverride,
3583
3597
  onTokenRefresh: options?.onTokenRefresh
3584
3598
  });
@@ -4558,7 +4572,7 @@ var statusCommand = new Command4("status").description("Show agent config, conne
4558
4572
  });
4559
4573
 
4560
4574
  // src/index.ts
4561
- var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version("0.18.1");
4575
+ var program = new Command5().name("opencara").description("OpenCara \u2014 distributed AI code review agent").version("0.18.3");
4562
4576
  program.addCommand(agentCommand);
4563
4577
  program.addCommand(authCommand());
4564
4578
  program.addCommand(dedupCommand());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencara",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
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",
@@ -30,10 +30,13 @@
30
30
  "node": ">=20"
31
31
  },
32
32
  "bin": {
33
- "opencara": "dist/index.js"
33
+ "opencara": "dist/index.js",
34
+ "opencara-codex-agent": "bin/opencara-codex-agent",
35
+ "opencara-gemini-agent": "bin/opencara-gemini-agent"
34
36
  },
35
37
  "files": [
36
38
  "dist",
39
+ "bin",
37
40
  "README.md"
38
41
  ],
39
42
  "scripts": {