donobu 5.25.2 → 5.25.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.
@@ -200,7 +200,12 @@ class FlowsPersistenceSqlite {
200
200
  // Generate a unique filename.
201
201
  const fileId = `${epochMillis}.${hash}.${imageType}`;
202
202
  const binaryId = `${flowId}-${fileId}`;
203
- const stmt = this.db.prepare('INSERT INTO binary_files (id, flow_id, file_id, mime_type, content) VALUES (?, ?, ?, ?, ?)');
203
+ // `fileId` embeds a content hash, so a (flow_id, file_id) collision
204
+ // implies the same bytes are already persisted. `INSERT OR IGNORE`
205
+ // makes the save idempotent — important when two screenshots taken in
206
+ // the same millisecond happen to be byte-identical (e.g. a clean and
207
+ // "annotated" screenshot where annotation was a no-op).
208
+ const stmt = this.db.prepare('INSERT OR IGNORE INTO binary_files (id, flow_id, file_id, mime_type, content) VALUES (?, ?, ?, ?, ?)');
204
209
  stmt.run(binaryId, flowId, fileId, mimeType, bytes);
205
210
  return fileId;
206
211
  }
@@ -200,7 +200,12 @@ class FlowsPersistenceSqlite {
200
200
  // Generate a unique filename.
201
201
  const fileId = `${epochMillis}.${hash}.${imageType}`;
202
202
  const binaryId = `${flowId}-${fileId}`;
203
- const stmt = this.db.prepare('INSERT INTO binary_files (id, flow_id, file_id, mime_type, content) VALUES (?, ?, ?, ?, ?)');
203
+ // `fileId` embeds a content hash, so a (flow_id, file_id) collision
204
+ // implies the same bytes are already persisted. `INSERT OR IGNORE`
205
+ // makes the save idempotent — important when two screenshots taken in
206
+ // the same millisecond happen to be byte-identical (e.g. a clean and
207
+ // "annotated" screenshot where annotation was a no-op).
208
+ const stmt = this.db.prepare('INSERT OR IGNORE INTO binary_files (id, flow_id, file_id, mime_type, content) VALUES (?, ?, ?, ?, ?)');
204
209
  stmt.run(binaryId, flowId, fileId, mimeType, bytes);
205
210
  return fileId;
206
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donobu",
3
- "version": "5.25.2",
3
+ "version": "5.25.3",
4
4
  "description": "Create browser automations with an LLM agent and replay them as Playwright scripts.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/esm/main.js",