opencrowd 0.15.1 → 0.15.2

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.
@@ -87832,7 +87832,7 @@ This artifact was created by the real worker using a scripted model. No USDC was
87832
87832
  }
87833
87833
  };
87834
87834
  }
87835
- var RuntimePause, MachineWorker;
87835
+ var MAX_WORKER_STATE_CHARS, RuntimePause, MachineWorker;
87836
87836
  var init_worker = __esm({
87837
87837
  "../../packages/agent-runtime/dist/worker.js"() {
87838
87838
  "use strict";
@@ -87843,6 +87843,7 @@ var init_worker = __esm({
87843
87843
  init_dist6();
87844
87844
  init_hosted_economy();
87845
87845
  init_knowledge();
87846
+ MAX_WORKER_STATE_CHARS = 2 * 1024 * 1024;
87846
87847
  RuntimePause = class extends Error {
87847
87848
  outcome;
87848
87849
  operationId;
@@ -87871,10 +87872,15 @@ var init_worker = __esm({
87871
87872
  await containedPath(this.paths.home, "metadata/worker.json");
87872
87873
  await mkdir11(this.paths.metadata, { recursive: true });
87873
87874
  try {
87874
- this.state = JSON.parse(await readFile13(this.statePath, "utf8"));
87875
+ const raw = await readFile13(this.statePath, "utf8");
87876
+ this.state = JSON.parse(raw);
87875
87877
  if (this.state.version !== 1 || !Number.isSafeInteger(this.state.seq) || !this.state.commands || !this.state.runs) {
87876
87878
  throw new Error("worker checkpoint version or shape is invalid");
87877
87879
  }
87880
+ if (raw.length > MAX_WORKER_STATE_CHARS) {
87881
+ this.state = capStrings(this.state, MAX_EXTERNAL_STRING_CHARS);
87882
+ await atomicWrite(this.statePath, JSON.stringify(this.state));
87883
+ }
87878
87884
  } catch (error53) {
87879
87885
  if (error53.code !== "ENOENT")
87880
87886
  throw error53;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencrowd",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "A CLI agent with its own wallet — discovers x402 services, pays in USDC, and completes tasks under a local budget",
5
5
  "type": "module",
6
6
  "license": "MIT",