@cortask/core 0.2.25 → 0.2.26

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.
package/dist/index.js CHANGED
@@ -3009,9 +3009,6 @@ function resolveCmd() {
3009
3009
  }
3010
3010
  var CMD = resolveCmd();
3011
3011
  var instance = null;
3012
- function resetBrowserInstance() {
3013
- instance = null;
3014
- }
3015
3012
  function getAgentBrowserHome() {
3016
3013
  if (process.env.AGENT_BROWSER_HOME) return process.env.AGENT_BROWSER_HOME;
3017
3014
  const dir = join(homedir(), ".agent-browser");
@@ -3207,7 +3204,7 @@ function createBrowserTool(artifactStore) {
3207
3204
  await closeBrowser();
3208
3205
  return { toolCallId: "", content: "Browser closed." };
3209
3206
  }
3210
- const executeAction = async () => {
3207
+ try {
3211
3208
  const browser = await ensureBrowser();
3212
3209
  switch (action) {
3213
3210
  case "navigate": {
@@ -3397,28 +3394,10 @@ ${result.content}`,
3397
3394
  isError: true
3398
3395
  };
3399
3396
  }
3400
- };
3401
- try {
3402
- return await executeAction();
3403
3397
  } catch (err) {
3404
- const msg = err instanceof Error ? err.message : String(err);
3405
- if (msg.includes("has been closed") || msg.includes("Target page")) {
3406
- await closeBrowser().catch(() => {
3407
- });
3408
- resetBrowserInstance();
3409
- try {
3410
- return await executeAction();
3411
- } catch (retryErr) {
3412
- return {
3413
- toolCallId: "",
3414
- content: `Browser error (after retry): ${retryErr instanceof Error ? retryErr.message : String(retryErr)}`,
3415
- isError: true
3416
- };
3417
- }
3418
- }
3419
3398
  return {
3420
3399
  toolCallId: "",
3421
- content: `Browser error: ${msg}`,
3400
+ content: `Browser error: ${err instanceof Error ? err.message : String(err)}`,
3422
3401
  isError: true
3423
3402
  };
3424
3403
  }