replicas-computer 0.3.30 → 0.3.31

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 +6 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1130,6 +1130,10 @@ async function computerRecordStopCommand() {
1130
1130
  }
1131
1131
 
1132
1132
  // src/lib/chrome-session.ts
1133
+ function filterChromePages(pages, filter) {
1134
+ const has = (value, needle) => (value ?? "").toLowerCase().includes(needle.toLowerCase());
1135
+ return pages.filter((page) => (!filter.targetId || page.id === filter.targetId) && (!filter.title || has(page.title, filter.title)) && (!filter.url || has(page.url, filter.url)));
1136
+ }
1133
1137
  async function openChromeSession(webSocketDebuggerUrl) {
1134
1138
  const socket = new WebSocket(webSocketDebuggerUrl);
1135
1139
  const pending = /* @__PURE__ */ new Map();
@@ -1233,18 +1237,7 @@ async function getChromePages() {
1233
1237
  }
1234
1238
  async function selectChromePage(options = {}) {
1235
1239
  const pages = await getChromePages();
1236
- let matches = pages;
1237
- if (options.targetId) {
1238
- matches = matches.filter((page2) => page2.id === options.targetId);
1239
- }
1240
- if (options.title) {
1241
- const needle = options.title.toLowerCase();
1242
- matches = matches.filter((page2) => (page2.title ?? "").toLowerCase().includes(needle));
1243
- }
1244
- if (options.url) {
1245
- const needle = options.url.toLowerCase();
1246
- matches = matches.filter((page2) => (page2.url ?? "").toLowerCase().includes(needle));
1247
- }
1240
+ const matches = filterChromePages(pages, options);
1248
1241
  const index = options.page ? parseCoord(options.page, "--page") : 0;
1249
1242
  if (index < 0) fail("--page must be >= 0");
1250
1243
  const page = matches[index];
@@ -3323,7 +3316,7 @@ async function computerStatusCommand() {
3323
3316
  }
3324
3317
 
3325
3318
  // src/version.ts
3326
- var COMPUTER_USE_VERSION = "0.3.30";
3319
+ var COMPUTER_USE_VERSION = "0.3.31";
3327
3320
  var COMPUTER_USE_PROTOCOL_VERSION = 1;
3328
3321
 
3329
3322
  // src/program.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-computer",
3
- "version": "0.3.30",
3
+ "version": "0.3.31",
4
4
  "description": "Replicas workspace computer-use runtime",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",