INNER CODE UNIT · TypeScript

pathParts

agentscope-ai/agentscope-runtime · src/agentscope_runtime/sandbox/box/mobile/box/index.ts:17

    const pathParts = fullPath.split("/").filter((p) => p);
    if (pathParts.length >= 2) {
      wsPath = `/${pathParts[0]}/${pathParts[1]}`;
    } else {
      wsPath = `/${pathParts.join("/")}`;
    }
  } else {
    console.log(
      "Path does not start with '/desktop/'. Applying generic path logic.",
    );
    wsPath = fullPath;
    const lastSlashIndex = wsPath.lastIndexOf("/");
    if (lastSlashIndex > 0) {
      wsPath = wsPath.substring(0, lastSlashIndex);
    }
  }

  const params = new URLSearchParams();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…