@browserbasehq/stagehand 3.0.6-alpha-c201b15bfc2aca3cb101274cee821b01ba4202de → 3.0.6-alpha-34e7e5b292f5e6af6efc0da60118663310c5f718

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 +19 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -179,7 +179,7 @@ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")])
179
179
  var STAGEHAND_VERSION;
180
180
  var init_version = __esm({
181
181
  "lib/version.ts"() {
182
- STAGEHAND_VERSION = "3.0.6-alpha-c201b15bfc2aca3cb101274cee821b01ba4202de";
182
+ STAGEHAND_VERSION = "3.0.6-alpha-34e7e5b292f5e6af6efc0da60118663310c5f718";
183
183
  }
184
184
  });
185
185
 
@@ -28309,7 +28309,7 @@ var AgentCache = class {
28309
28309
  options: context.options,
28310
28310
  configSignature: context.configSignature,
28311
28311
  steps: cloneForCache(steps),
28312
- result: cloneForCache(result),
28312
+ result: this.pruneAgentResult(result),
28313
28313
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
28314
28314
  };
28315
28315
  const { error, path: path8 } = yield this.storage.writeJson(
@@ -28338,6 +28338,23 @@ var AgentCache = class {
28338
28338
  });
28339
28339
  });
28340
28340
  }
28341
+ /**
28342
+ * Clone the agent result and prune bulky fields (e.g. screenshot base64 blobs)
28343
+ * before persisting it to disk. This keeps cache entries compact without
28344
+ * mutating the live AgentResult returned to callers.
28345
+ */
28346
+ pruneAgentResult(result) {
28347
+ const cloned = cloneForCache(result);
28348
+ if (!Array.isArray(cloned.actions)) {
28349
+ return cloned;
28350
+ }
28351
+ for (const action of cloned.actions) {
28352
+ if ((action == null ? void 0 : action.type) === "screenshot") {
28353
+ delete action.base64;
28354
+ }
28355
+ }
28356
+ return cloned;
28357
+ }
28341
28358
  beginRecording() {
28342
28359
  this.recording = [];
28343
28360
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserbasehq/stagehand",
3
- "version": "3.0.6-alpha-c201b15bfc2aca3cb101274cee821b01ba4202de",
3
+ "version": "3.0.6-alpha-34e7e5b292f5e6af6efc0da60118663310c5f718",
4
4
  "description": "An AI web browsing framework focused on simplicity and extensibility.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",