clawcompany 0.50.0 → 0.50.1

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 +43 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2149,7 +2149,7 @@ import { join } from "path";
2149
2149
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
2150
2150
  function banner() {
2151
2151
  console.log("");
2152
- console.log(" \u{1F99E} ClawCompany v0.50.0");
2152
+ console.log(" \u{1F99E} ClawCompany v0.50.1");
2153
2153
  console.log(" Build for OPC. Every human being is a chairman.");
2154
2154
  console.log("");
2155
2155
  }
@@ -3686,6 +3686,7 @@ Respond ONLY with JSON:
3686
3686
  }
3687
3687
  console.log(` \u{1F4E6} Batch ${batch}: ${ready.map((ws) => ws.id).join(", ")}
3688
3688
  `);
3689
+ const MAX_RETRIES = 2;
3689
3690
  const batchResults = await Promise.all(ready.map(async (ws) => {
3690
3691
  const depOutputs = {};
3691
3692
  for (const depId of ws.dependencies ?? []) {
@@ -3698,44 +3699,51 @@ Respond ONLY with JSON:
3698
3699
  console.log(` \u26A1 ${ws.id}: ${ws.title}`);
3699
3700
  console.log(` \u2192 ${roleName} (${modelName})`);
3700
3701
  const startTime = Date.now();
3701
- try {
3702
- const output = await this.executeWorkStream(ws, depOutputs);
3703
- const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
3704
- totalCost += output.cost;
3705
- console.log(` \u2705 Done (${elapsed}s, $${output.cost.toFixed(4)})
3702
+ for (let attempt = 1; attempt <= MAX_RETRIES + 1; attempt++) {
3703
+ try {
3704
+ const output = await this.executeWorkStream(ws, depOutputs);
3705
+ const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
3706
+ totalCost += output.cost;
3707
+ console.log(` \u2705 Done (${elapsed}s, $${output.cost.toFixed(4)})${attempt > 1 ? ` [retry ${attempt - 1}]` : ""}
3706
3708
  `);
3707
- return {
3708
- id: ws.id,
3709
- result: {
3710
- workStreamId: ws.id,
3711
- title: ws.title,
3712
- assignedTo: ws.assignTo,
3713
- output: output.content,
3714
- cost: output.cost,
3715
- tokensIn: output.tokensIn,
3716
- tokensOut: output.tokensOut,
3717
- model: output.model,
3718
- status: "completed"
3709
+ return {
3710
+ id: ws.id,
3711
+ result: {
3712
+ workStreamId: ws.id,
3713
+ title: ws.title,
3714
+ assignedTo: ws.assignTo,
3715
+ output: output.content,
3716
+ cost: output.cost,
3717
+ tokensIn: output.tokensIn,
3718
+ tokensOut: output.tokensOut,
3719
+ model: output.model,
3720
+ status: "completed"
3721
+ }
3722
+ };
3723
+ } catch (err) {
3724
+ if (attempt <= MAX_RETRIES) {
3725
+ console.log(` \u{1F504} ${ws.id}: Retry ${attempt}/${MAX_RETRIES} \u2014 ${err.message}`);
3726
+ continue;
3719
3727
  }
3720
- };
3721
- } catch (err) {
3722
- console.log(` \u274C Failed: ${err.message}
3728
+ console.log(` \u274C Failed after ${MAX_RETRIES} retries: ${err.message}
3723
3729
  `);
3724
- return {
3725
- id: ws.id,
3726
- result: {
3727
- workStreamId: ws.id,
3728
- title: ws.title,
3729
- assignedTo: ws.assignTo,
3730
- output: `Error: ${err.message}`,
3731
- cost: 0,
3732
- tokensIn: 0,
3733
- tokensOut: 0,
3734
- model: "none",
3735
- status: "failed"
3736
- }
3737
- };
3730
+ return {
3731
+ id: ws.id,
3732
+ result: {
3733
+ workStreamId: ws.id,
3734
+ title: ws.title,
3735
+ assignedTo: ws.assignTo,
3736
+ output: `Error: ${err.message}`,
3737
+ cost: 0,
3738
+ tokensIn: 0,
3739
+ tokensOut: 0,
3740
+ model: "none",
3741
+ status: "failed"
3742
+ }
3743
+ };
3744
+ }
3738
3745
  }
3746
+ throw new Error(`Unexpected: ${ws.id} exited retry loop`);
3739
3747
  }));
3740
3748
  for (const { id, result } of batchResults) {
3741
3749
  results.set(id, result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawcompany",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
4
4
  "description": "Build for OPC. Every human being is a chairman. AI company infrastructure — one key, 9 roles, 4 models.",
5
5
  "type": "module",
6
6
  "bin": { "clawcompany": "dist/index.js" },