New:Socket for Asana Is Now Available.Learn more
Get Started

@uipath/codedagent-tool

Package Overview
Dependencies
Maintainers
24
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uipath/codedagent-tool - npm Package Compare versions

Comparing version
1.199.0-preview.108
to
1.200.0-preview.109
+98
dist/browser-strategy-fdkppa2b.js
import {
getGlobalThis
} from "./tool-9qecd4wb.js";
import {
AUTH_CANCELLED_ERROR_CODE
} from "./tool-vc9mne6b.js";
// ../auth/src/strategies/browser-strategy.ts
class BrowserAuthStrategy {
async execute(url, _redirectUri, expectedState, opts) {
const global = getGlobalThis();
if (!global?.window) {
throw new Error("Browser environment required for authentication");
}
const screenWidth = global.window.screen?.width ?? 1024;
const screenHeight = global.window.screen?.height ?? 768;
const width = 600;
const height = 700;
const left = screenWidth / 2 - width / 2;
const top = screenHeight / 2 - height / 2;
if (!global.window.open) {
throw new Error("window.open is not available");
}
const popupResult = global.window.open(url, "uip_auth", `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes,status=yes`);
const popup = popupResult;
if (!popup) {
throw new Error(`Authentication popup was blocked by your browser.
` + `To continue:
` + `1. Look for a popup blocker icon in your address bar
` + `2. Allow popups for this site
` + `3. Try logging in again
` + "If using an ad blocker, you may need to temporarily disable it.");
}
return new Promise((resolve, reject) => {
let timer;
const messageHandler = (event) => {
if (event.data?.type === "UIP_AUTH_CODE" && event.data.code) {
if (event.data.state !== expectedState) {
cleanup();
reject(new Error("OAuth state mismatch — the callback state does not match the expected value. " + "This may indicate a CSRF attack. Please try signing in again."));
popup.close();
return;
}
cleanup();
resolve(event.data.code);
popup.close();
} else if (event.data?.type === "UIP_AUTH_ERROR") {
cleanup();
const errorMsg = event.data.error || "Authentication failed";
reject(new Error(`Authentication failed: ${errorMsg}
` + "Please check your credentials and try again. " + "If the problem persists, verify your UiPath account is active."));
popup.close();
}
};
const cleanup = () => {
global.window?.removeEventListener?.("message", messageHandler);
opts?.signal?.removeEventListener("abort", onAbort);
if (timer)
clearInterval(timer);
};
const onAbort = () => {
cleanup();
const err = new Error(`Authentication was cancelled.
` + "The sign-in was cancelled before completing the login process. " + "Please try again and complete the authentication flow.");
err.code = AUTH_CANCELLED_ERROR_CODE;
reject(err);
popup.close();
};
if (opts?.signal) {
if (opts.signal.aborted) {
onAbort();
return;
}
opts.signal.addEventListener("abort", onAbort, { once: true });
}
if (global.window?.addEventListener) {
global.window.addEventListener("message", messageHandler);
}
timer = setInterval(() => {
if (popup.closed) {
cleanup();
reject(new Error(`Authentication was cancelled.
` + "The authentication popup was closed before completing the login process. " + "Please try again and complete the authentication flow."));
}
}, 1000);
});
}
}
export {
BrowserAuthStrategy
};
//# debugId=BA0050A0C5279A4F64756E2164756E21
import {
catchError,
getFileSystem,
startServer
} from "./tool-nvhfxv67.js";
import"./tool-vc9mne6b.js";
// ../auth/src/strategies/node-strategy.ts
class NodeAuthStrategy {
async execute(url, redirectUri, expectedState, opts) {
const fs = getFileSystem();
const callbackUrl = await startServer({
redirectUri,
timeoutMs: opts?.timeoutMs,
signal: opts?.signal,
onListening: async () => {
let safeUrl = "";
for (const ch of url) {
const c = ch.charCodeAt(0);
if (c > 31 && (c < 128 || c > 159))
safeUrl += ch;
}
if (opts?.noBrowser) {
if (!opts.onAuthUrl) {
throw new Error("Headless login (noBrowser) requires an onAuthUrl handler " + "to surface the authorize URL, but none was provided.");
}
opts.onAuthUrl(safeUrl);
return;
}
const [openError] = await catchError(fs.utils.open(url));
if (!openError)
return;
const isSpawnError = "code" in openError && openError.code === "ENOENT";
if (isSpawnError) {
throw new Error("Could not open a browser. No supported browser launcher was found. " + `On a headless or minimal system, use non-interactive login instead:
` + ` uip login --client-id <id> --client-secret <secret> -t <tenant>
` + "Or install a browser opener for your OS (e.g. xdg-utils on Linux).", { cause: openError });
}
throw new Error("Could not open the browser automatically. " + `Visit this URL to authenticate:
${safeUrl}
`, { cause: openError });
}
});
const returnedState = callbackUrl.searchParams.get("state");
if (returnedState !== expectedState) {
throw new Error("OAuth state mismatch — the callback state does not match the expected value. " + "This may indicate a CSRF attack. Please try signing in again.");
}
const code = callbackUrl.searchParams.get("code");
if (!code) {
throw new Error("No authorization code received");
}
return code;
}
}
export {
NodeAuthStrategy
};
//# debugId=A474411E22F056AC64756E2164756E21

Sorry, the diff of this file is too big to display

// ../auth/src/utils/platform.ts
function isBrowser() {
return typeof globalThis !== "undefined" && "window" in globalThis && "document" in globalThis;
}
function getGlobalThis() {
if (typeof globalThis !== "undefined") {
return globalThis;
}
return;
}
export { isBrowser, getGlobalThis };
//# debugId=718223FBC10121D064756E2164756E21

Sorry, the diff of this file is too big to display

import {
AUTH_CANCELLED_ERROR_CODE,
DEFAULT_AUTH_TIMEOUT_MS,
__require
} from "./tool-vc9mne6b.js";
// ../filesystem/src/node.ts
import { randomUUID } from "node:crypto";
import { existsSync } from "node:fs";
import * as fs6 from "node:fs/promises";
import * as os2 from "node:os";
import * as path2 from "node:path";
// ../../node_modules/open/index.js
import process8 from "node:process";
import path from "node:path";
import { fileURLToPath } from "node:url";
import childProcess3 from "node:child_process";
import fs5, { constants as fsConstants2 } from "node:fs/promises";
// ../../node_modules/wsl-utils/index.js
import { promisify as promisify2 } from "node:util";
import childProcess2 from "node:child_process";
import fs4, { constants as fsConstants } from "node:fs/promises";
// ../../node_modules/wsl-utils/node_modules/is-wsl/index.js
import process2 from "node:process";
import os from "node:os";
import fs3 from "node:fs";
// ../../node_modules/is-inside-container/index.js
import fs2 from "node:fs";
// ../../node_modules/is-inside-container/node_modules/is-docker/index.js
import fs from "node:fs";
var isDockerCached;
function hasDockerEnv() {
try {
fs.statSync("/.dockerenv");
return true;
} catch {
return false;
}
}
function hasDockerCGroup() {
try {
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
} catch {
return false;
}
}
function isDocker() {
if (isDockerCached === undefined) {
isDockerCached = hasDockerEnv() || hasDockerCGroup();
}
return isDockerCached;
}
// ../../node_modules/is-inside-container/index.js
var cachedResult;
var hasContainerEnv = () => {
try {
fs2.statSync("/run/.containerenv");
return true;
} catch {
return false;
}
};
function isInsideContainer() {
if (cachedResult === undefined) {
cachedResult = hasContainerEnv() || isDocker();
}
return cachedResult;
}
// ../../node_modules/wsl-utils/node_modules/is-wsl/index.js
var isWsl = () => {
if (process2.platform !== "linux") {
return false;
}
if (os.release().toLowerCase().includes("microsoft")) {
if (isInsideContainer()) {
return false;
}
return true;
}
try {
if (fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
return !isInsideContainer();
}
} catch {}
if (fs3.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs3.existsSync("/run/WSL")) {
return !isInsideContainer();
}
return false;
};
var is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
// ../../node_modules/powershell-utils/index.js
import process3 from "node:process";
import { Buffer } from "node:buffer";
import { promisify } from "node:util";
import childProcess from "node:child_process";
var execFile = promisify(childProcess.execFile);
var powerShellPath = () => `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
var executePowerShell = async (command, options = {}) => {
const {
powerShellPath: psPath,
...execFileOptions
} = options;
const encodedCommand = executePowerShell.encodeCommand(command);
return execFile(psPath ?? powerShellPath(), [
...executePowerShell.argumentsPrefix,
encodedCommand
], {
encoding: "utf8",
...execFileOptions
});
};
executePowerShell.argumentsPrefix = [
"-NoProfile",
"-NonInteractive",
"-ExecutionPolicy",
"Bypass",
"-EncodedCommand"
];
executePowerShell.encodeCommand = (command) => Buffer.from(command, "utf16le").toString("base64");
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
// ../../node_modules/wsl-utils/utilities.js
function parseMountPointFromConfig(content) {
for (const line of content.split(`
`)) {
if (/^\s*#/.test(line)) {
continue;
}
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
if (!match) {
continue;
}
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
}
}
// ../../node_modules/wsl-utils/index.js
var execFile2 = promisify2(childProcess2.execFile);
var wslDrivesMountPoint = (() => {
const defaultMountPoint = "/mnt/";
let mountPoint;
return async function() {
if (mountPoint) {
return mountPoint;
}
const configFilePath = "/etc/wsl.conf";
let isConfigFileExists = false;
try {
await fs4.access(configFilePath, fsConstants.F_OK);
isConfigFileExists = true;
} catch {}
if (!isConfigFileExists) {
return defaultMountPoint;
}
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
const parsedMountPoint = parseMountPointFromConfig(configContent);
if (parsedMountPoint === undefined) {
return defaultMountPoint;
}
mountPoint = parsedMountPoint;
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
return mountPoint;
};
})();
var powerShellPathFromWsl = async () => {
const mountPoint = await wslDrivesMountPoint();
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
};
var powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
var canAccessPowerShellPromise;
var canAccessPowerShell = async () => {
canAccessPowerShellPromise ??= (async () => {
try {
const psPath = await powerShellPath2();
await fs4.access(psPath, fsConstants.X_OK);
return true;
} catch {
return false;
}
})();
return canAccessPowerShellPromise;
};
var wslDefaultBrowser = async () => {
const psPath = await powerShellPath2();
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
const { stdout } = await executePowerShell(command, { powerShellPath: psPath });
return stdout.trim();
};
var convertWslPathToWindows = async (path) => {
if (/^[a-z]+:\/\//i.test(path)) {
return path;
}
try {
const { stdout } = await execFile2("wslpath", ["-aw", path], { encoding: "utf8" });
return stdout.trim();
} catch {
return path;
}
};
// ../../node_modules/open/node_modules/define-lazy-prop/index.js
function defineLazyProperty(object, propertyName, valueGetter) {
const define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
Object.defineProperty(object, propertyName, {
configurable: true,
enumerable: true,
get() {
const result = valueGetter();
define(result);
return result;
},
set(value) {
define(value);
}
});
return object;
}
// ../../node_modules/default-browser/index.js
import { promisify as promisify6 } from "node:util";
import process6 from "node:process";
import { execFile as execFile6 } from "node:child_process";
// ../../node_modules/default-browser-id/index.js
import { promisify as promisify3 } from "node:util";
import process4 from "node:process";
import { execFile as execFile3 } from "node:child_process";
var execFileAsync = promisify3(execFile3);
async function defaultBrowserId() {
if (process4.platform !== "darwin") {
throw new Error("macOS only");
}
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
const browserId = match?.groups.id ?? "com.apple.Safari";
if (browserId === "com.apple.safari") {
return "com.apple.Safari";
}
return browserId;
}
// ../../node_modules/run-applescript/index.js
import process5 from "node:process";
import { promisify as promisify4 } from "node:util";
import { execFile as execFile4, execFileSync } from "node:child_process";
var execFileAsync2 = promisify4(execFile4);
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
if (process5.platform !== "darwin") {
throw new Error("macOS only");
}
const outputArguments = humanReadableOutput ? [] : ["-ss"];
const execOptions = {};
if (signal) {
execOptions.signal = signal;
}
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
return stdout.trim();
}
// ../../node_modules/bundle-name/index.js
async function bundleName(bundleId) {
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
}
// ../../node_modules/default-browser/windows.js
import { promisify as promisify5 } from "node:util";
import { execFile as execFile5 } from "node:child_process";
var execFileAsync3 = promisify5(execFile5);
var windowsBrowserProgIds = {
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
};
var _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
class UnknownBrowserError extends Error {
}
async function defaultBrowser(_execFileAsync = execFileAsync3) {
const { stdout } = await _execFileAsync("reg", [
"QUERY",
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
"/v",
"ProgId"
]);
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
if (!match) {
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
}
const { id } = match.groups;
const dotIndex = id.lastIndexOf(".");
const hyphenIndex = id.lastIndexOf("-");
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
}
// ../../node_modules/default-browser/index.js
var execFileAsync4 = promisify6(execFile6);
var titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
async function defaultBrowser2() {
if (process6.platform === "darwin") {
const id = await defaultBrowserId();
const name = await bundleName(id);
return { name, id };
}
if (process6.platform === "linux") {
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
const id = stdout.trim();
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
return { name, id };
}
if (process6.platform === "win32") {
return defaultBrowser();
}
throw new Error("Only macOS, Linux, and Windows are supported");
}
// ../../node_modules/is-in-ssh/index.js
import process7 from "node:process";
var isInSsh = Boolean(process7.env.SSH_CONNECTION || process7.env.SSH_CLIENT || process7.env.SSH_TTY);
var is_in_ssh_default = isInSsh;
// ../../node_modules/open/index.js
var fallbackAttemptSymbol = Symbol("fallbackAttempt");
var __dirname2 = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
var localXdgOpenPath = path.join(__dirname2, "xdg-open");
var { platform, arch } = process8;
var tryEachApp = async (apps, opener) => {
if (apps.length === 0) {
return;
}
const errors = [];
for (const app of apps) {
try {
return await opener(app);
} catch (error) {
errors.push(error);
}
}
throw new AggregateError(errors, "Failed to open in all supported apps");
};
var baseOpen = async (options) => {
options = {
wait: false,
background: false,
newInstance: false,
allowNonzeroExitCode: false,
...options
};
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
delete options[fallbackAttemptSymbol];
if (Array.isArray(options.app)) {
return tryEachApp(options.app, (singleApp) => baseOpen({
...options,
app: singleApp,
[fallbackAttemptSymbol]: true
}));
}
let { name: app, arguments: appArguments = [] } = options.app ?? {};
appArguments = [...appArguments];
if (Array.isArray(app)) {
return tryEachApp(app, (appName) => baseOpen({
...options,
app: {
name: appName,
arguments: appArguments
},
[fallbackAttemptSymbol]: true
}));
}
if (app === "browser" || app === "browserPrivate") {
const ids = {
"com.google.chrome": "chrome",
"google-chrome.desktop": "chrome",
"com.brave.browser": "brave",
"org.mozilla.firefox": "firefox",
"firefox.desktop": "firefox",
"com.microsoft.msedge": "edge",
"com.microsoft.edge": "edge",
"com.microsoft.edgemac": "edge",
"microsoft-edge.desktop": "edge",
"com.apple.safari": "safari"
};
const flags = {
chrome: "--incognito",
brave: "--incognito",
firefox: "--private-window",
edge: "--inPrivate"
};
let browser;
if (is_wsl_default) {
const progId = await wslDefaultBrowser();
const browserInfo = _windowsBrowserProgIdMap.get(progId);
browser = browserInfo ?? {};
} else {
browser = await defaultBrowser2();
}
if (browser.id in ids) {
const browserName = ids[browser.id.toLowerCase()];
if (app === "browserPrivate") {
if (browserName === "safari") {
throw new Error("Safari doesn't support opening in private mode via command line");
}
appArguments.push(flags[browserName]);
}
return baseOpen({
...options,
app: {
name: apps[browserName],
arguments: appArguments
}
});
}
throw new Error(`${browser.name} is not supported as a default browser`);
}
let command;
const cliArguments = [];
const childProcessOptions = {};
let shouldUseWindowsInWsl = false;
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
shouldUseWindowsInWsl = await canAccessPowerShell();
}
if (platform === "darwin") {
command = "open";
if (options.wait) {
cliArguments.push("--wait-apps");
}
if (options.background) {
cliArguments.push("--background");
}
if (options.newInstance) {
cliArguments.push("--new");
}
if (app) {
cliArguments.push("-a", app);
}
} else if (platform === "win32" || shouldUseWindowsInWsl) {
command = await powerShellPath2();
cliArguments.push(...executePowerShell.argumentsPrefix);
if (!is_wsl_default) {
childProcessOptions.windowsVerbatimArguments = true;
}
if (is_wsl_default && options.target) {
options.target = await convertWslPathToWindows(options.target);
}
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
if (options.wait) {
encodedArguments.push("-Wait");
}
if (app) {
encodedArguments.push(executePowerShell.escapeArgument(app));
if (options.target) {
appArguments.push(options.target);
}
} else if (options.target) {
encodedArguments.push(executePowerShell.escapeArgument(options.target));
}
if (appArguments.length > 0) {
appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
encodedArguments.push("-ArgumentList", appArguments.join(","));
}
options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
if (!options.wait) {
childProcessOptions.stdio = "ignore";
}
} else {
if (app) {
command = app;
} else {
const isBundled = !__dirname2 || __dirname2 === "/";
let exeLocalXdgOpen = false;
try {
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
exeLocalXdgOpen = true;
} catch {}
const useSystemXdgOpen = process8.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
}
if (appArguments.length > 0) {
cliArguments.push(...appArguments);
}
if (!options.wait) {
childProcessOptions.stdio = "ignore";
childProcessOptions.detached = true;
}
}
if (platform === "darwin" && appArguments.length > 0) {
cliArguments.push("--args", ...appArguments);
}
if (options.target) {
cliArguments.push(options.target);
}
const subprocess = childProcess3.spawn(command, cliArguments, childProcessOptions);
if (options.wait) {
return new Promise((resolve, reject) => {
subprocess.once("error", reject);
subprocess.once("close", (exitCode) => {
if (!options.allowNonzeroExitCode && exitCode !== 0) {
reject(new Error(`Exited with code ${exitCode}`));
return;
}
resolve(subprocess);
});
});
}
if (isFallbackAttempt) {
return new Promise((resolve, reject) => {
subprocess.once("error", reject);
subprocess.once("spawn", () => {
subprocess.once("close", (exitCode) => {
subprocess.off("error", reject);
if (exitCode !== 0) {
reject(new Error(`Exited with code ${exitCode}`));
return;
}
subprocess.unref();
resolve(subprocess);
});
});
});
}
subprocess.unref();
return new Promise((resolve, reject) => {
subprocess.once("error", reject);
subprocess.once("spawn", () => {
subprocess.off("error", reject);
resolve(subprocess);
});
});
};
var open = (target, options) => {
if (typeof target !== "string") {
throw new TypeError("Expected a `target`");
}
return baseOpen({
...options,
target
});
};
function detectArchBinary(binary) {
if (typeof binary === "string" || Array.isArray(binary)) {
return binary;
}
const { [arch]: archBinary } = binary;
if (!archBinary) {
throw new Error(`${arch} is not supported`);
}
return archBinary;
}
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
if (wsl && is_wsl_default) {
return detectArchBinary(wsl);
}
if (!platformBinary) {
throw new Error(`${platform} is not supported`);
}
return detectArchBinary(platformBinary);
}
var apps = {
browser: "browser",
browserPrivate: "browserPrivate"
};
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
darwin: "google chrome",
win32: "chrome",
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
}, {
wsl: {
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
}
}));
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
darwin: "brave browser",
win32: "brave",
linux: ["brave-browser", "brave"]
}, {
wsl: {
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
}
}));
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
darwin: "firefox",
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
linux: "firefox"
}, {
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
}));
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
darwin: "microsoft edge",
win32: "msedge",
linux: ["microsoft-edge", "microsoft-edge-dev"]
}, {
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
}));
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
darwin: "Safari"
}));
var open_default = open;
// ../filesystem/src/node.ts
var LOCK_HEARTBEAT_MS = 5000;
var LOCK_STALE_MS = 15000;
var LOCK_MAX_WAIT_MS = 20000;
var LOCK_MAX_HOLD_MS = 60000;
var LOCK_RETRY_MIN_MS = 100;
var LOCK_RETRY_JITTER_MS = 200;
class NodeFileSystem {
path = {
join: path2.join,
resolve: path2.resolve,
relative: path2.relative,
dirname: path2.dirname,
isAbsolute: path2.isAbsolute,
basename: path2.basename
};
env = {
cwd: process.cwd,
homedir: os2.homedir,
tmpdir: os2.tmpdir,
getenv: (key) => process.env[key]
};
utils = {
open: async (url) => {
await open_default(url);
}
};
async readFile(path3, options) {
try {
if (options) {
return await fs6.readFile(path3, "utf-8");
}
return await fs6.readFile(path3);
} catch (error) {
if (this.isEnoent(error))
return null;
throw error;
}
}
async writeFile(filePath, data) {
const dir = path2.dirname(filePath);
if (dir) {
await fs6.mkdir(dir, { recursive: true });
}
await fs6.writeFile(filePath, data);
}
async appendFile(filePath, data) {
const dir = path2.dirname(filePath);
if (dir) {
await fs6.mkdir(dir, { recursive: true });
}
await fs6.appendFile(filePath, data);
}
async readdir(dirPath) {
try {
return await fs6.readdir(dirPath);
} catch (error) {
if (this.isEnoent(error))
return [];
throw error;
}
}
async stat(filePath) {
try {
const stats = await fs6.stat(filePath);
return {
isFile: () => stats.isFile(),
isDirectory: () => stats.isDirectory(),
size: stats.size,
mtimeMs: stats.mtimeMs
};
} catch (error) {
if (this.isEnoent(error))
return null;
throw error;
}
}
async exists(filePath) {
return existsSync(filePath);
}
async mkdir(dirPath) {
await fs6.mkdir(dirPath, { recursive: true });
}
async acquireLock(lockPath) {
const canonicalPath = await this.canonicalizeLockTarget(lockPath);
const lockFile = `${canonicalPath}.lock`;
const ownerId = randomUUID();
const start = Date.now();
while (true) {
try {
await fs6.writeFile(lockFile, ownerId, { flag: "wx" });
return this.createLockRelease(lockFile, ownerId);
} catch (error) {
if (!this.hasErrnoCode(error, "EEXIST")) {
throw error;
}
const stats = await fs6.stat(lockFile).catch(() => null);
if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
const reclaimed = await fs6.rm(lockFile, { force: true }).then(() => true).catch(() => false);
if (reclaimed)
continue;
}
if (Date.now() - start > LOCK_MAX_WAIT_MS) {
throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
}
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
}
}
}
async canonicalizeLockTarget(lockPath) {
const absolute = path2.resolve(lockPath);
const fullReal = await fs6.realpath(absolute).catch(() => null);
if (fullReal)
return fullReal;
const parent = path2.dirname(absolute);
const base = path2.basename(absolute);
const canonicalParent = await fs6.realpath(parent).catch(() => parent);
return path2.join(canonicalParent, base);
}
createLockRelease(lockFile, ownerId) {
const heartbeatStart = Date.now();
let heartbeatTimer;
let stopped = false;
const stopHeartbeat = () => {
stopped = true;
if (heartbeatTimer)
clearTimeout(heartbeatTimer);
};
const scheduleNextHeartbeat = () => {
if (stopped)
return;
if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
stopped = true;
return;
}
heartbeatTimer = setTimeout(() => {
runHeartbeat();
}, LOCK_HEARTBEAT_MS);
heartbeatTimer.unref?.();
};
const runHeartbeat = async () => {
if (stopped)
return;
const current = await fs6.readFile(lockFile, "utf-8").catch(() => null);
if (stopped)
return;
if (current !== ownerId) {
stopped = true;
return;
}
const now = Date.now() / 1000;
await fs6.utimes(lockFile, now, now).catch(() => {});
scheduleNextHeartbeat();
};
scheduleNextHeartbeat();
let released = false;
return async () => {
if (released)
return;
released = true;
stopHeartbeat();
const current = await fs6.readFile(lockFile, "utf-8").catch(() => null);
if (current === ownerId) {
await fs6.rm(lockFile, { force: true });
}
};
}
async rm(filePath) {
await fs6.rm(filePath, { recursive: true, force: true });
}
async rename(oldPath, newPath) {
await fs6.rename(oldPath, newPath);
}
async realpath(filePath) {
try {
return await fs6.realpath(filePath);
} catch (error) {
if (this.isEnoent(error))
return filePath;
throw error;
}
}
async getTempDir() {
return await fs6.mkdtemp(path2.join(os2.tmpdir(), "uipath-fs-"));
}
async copyDirectory(sourcePath, destPath) {
const sourceStats = await this.stat(sourcePath);
if (!sourceStats) {
throw new Error(`Source directory does not exist: ${sourcePath}`);
}
if (!sourceStats.isDirectory()) {
throw new Error(`Source path is not a directory: ${sourcePath}`);
}
await this.mkdir(destPath);
const entries = await this.readdir(sourcePath);
for (const entry of entries) {
const srcEntry = path2.join(sourcePath, entry);
const destEntry = path2.join(destPath, entry);
const entryStats = await this.stat(srcEntry);
if (!entryStats)
continue;
if (entryStats.isDirectory()) {
await this.copyDirectory(srcEntry, destEntry);
} else if (entryStats.isFile()) {
const content = await this.readFile(srcEntry);
if (content !== null) {
await this.writeFile(destEntry, content);
}
}
}
}
isEnoent(error) {
return this.hasErrnoCode(error, "ENOENT");
}
hasErrnoCode(error, code) {
return typeof error === "object" && error !== null && "code" in error && error.code === code;
}
}
// ../filesystem/src/index.ts
var fsInstance = new NodeFileSystem;
var getFileSystem = () => fsInstance;
// ../auth/src/catch-error.ts
function isPromiseLike(value) {
return value !== null && typeof value === "object" && typeof value.then === "function";
}
function catchError(fnOrPromise) {
if (isPromiseLike(fnOrPromise)) {
return settlePromiseLike(fnOrPromise);
}
try {
const result = fnOrPromise();
if (isPromiseLike(result)) {
return settlePromiseLike(result);
}
return [undefined, result];
} catch (error) {
return [
error instanceof Error ? error : new Error(String(error)),
undefined
];
}
}
function settlePromiseLike(thenable) {
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
error instanceof Error ? error : new Error(String(error)),
undefined
]);
}
// ../auth/src/getBaseHtml.ts
var escapeHtml = (value) => value.replace(/[&<>"']/g, (char) => {
switch (char) {
case "&":
return "&amp;";
case "<":
return "&lt;";
case ">":
return "&gt;";
case '"':
return "&quot;";
case "'":
return "&#39;";
default:
return char;
}
});
var getBaseHtml = ({ title, message, type }) => {
const icon = type === "success" ? "✓" : "✕";
const iconClass = type === "success" ? "icon-success" : "icon-error";
const safeTitle = escapeHtml(title);
const safeMessage = escapeHtml(message);
return `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${safeTitle} - UiPath CLI</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400&family=Poppins:wght@600&display=swap" rel="stylesheet">
<style>
:root {
--bg-page: #F6F6F6;
--bg-card: #FFFFFF;
--border-card: #D9D9D9;
--text-heading: #182126;
--text-body: #616161;
--text-footer: #9D9D9D;
--color-success: #16a34a;
--color-success-bg: #f0fdf4;
--color-error: #A32200;
--color-error-bg: #fef2f2;
--color-accent: #FA4616;
}
@media (prefers-color-scheme: dark) {
:root {
--bg-page: #182126;
--bg-card: #2D373C;
--border-card: #3C464B;
--text-heading: #F6F6F6;
--text-body: #B9B9B9;
--text-footer: #9D9D9D;
--color-success: #4ade80;
--color-success-bg: #052e16;
--color-error: #FA7678;
--color-error-bg: #450a0a;
--color-accent: #FA4616;
}
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: var(--bg-page);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 480px;
width: 100%;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border-card);
border-top: 3px solid var(--color-accent);
border-radius: 12px;
padding: 40px 32px;
text-align: center;
}
.logo {
display: flex;
justify-content: center;
margin-bottom: 24px;
}
.logo svg {
width: 160px;
height: auto;
}
.logo-dark { display: none; }
.logo-light { display: block; }
@media (prefers-color-scheme: dark) {
.logo-dark { display: block; }
.logo-light { display: none; }
}
.icon {
width: 56px;
height: 56px;
border-radius: 50%;
font-size: 28px;
display: inline-flex;
align-items: center;
justify-content: center;
margin-bottom: 16px;
font-weight: 600;
}
.icon-success {
background: var(--color-success-bg);
color: var(--color-success);
}
.icon-error {
background: var(--color-error-bg);
color: var(--color-error);
}
h1 {
font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
color: var(--text-heading);
font-size: 24px;
font-weight: 600;
margin-bottom: 8px;
}
p {
color: var(--text-body);
font-size: 14px;
line-height: 1.5;
}
.footer {
margin-top: 24px;
padding-top: 24px;
border-top: 1px solid var(--border-card);
color: var(--text-footer);
font-size: 13px;
}
</style>
</head>
<body>
<div class="container">
<div class="card">
<div class="logo">
<div class="logo-light">
<svg aria-hidden="true" width="400" height="116" viewBox="0 0 400 116" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.6439 33.1429H60.885C56.2918 33.1429 53.4387 35.9377 53.4387 40.4355V76.6177C53.4387 93.7722 48.1098 100.769 35.0451 100.769C21.9804 100.769 16.6514 93.7405 16.6514 76.5097V40.4355C16.6514 35.9377 13.7982 33.1429 9.20575 33.1429H7.44592C2.85326 33.1429 0 35.9377 0 40.4355V76.6177C0 102.75 11.7912 116 35.0451 116C58.2991 116 70.0897 102.75 70.0897 76.6177V40.4355C70.0897 35.9377 67.2364 33.1429 62.6439 33.1429Z" fill="black"/><path d="M91.1326 55.0988H89.6751C84.9685 55.0988 82.0451 58.0021 82.0451 62.6744V108.425C82.0451 113.097 84.9685 116 89.6751 116H91.1326C95.8386 116 98.762 113.097 98.762 108.425V62.6744C98.762 58.0021 95.8386 55.0988 91.1326 55.0988Z" fill="#FA4616"/><path d="M111.322 26.7778C100.684 25.0967 92.2902 16.8376 90.5818 6.37143C90.5496 6.17388 90.2894 6.17388 90.2572 6.37143C88.5488 16.8376 80.1548 25.0967 69.5175 26.7778C69.3167 26.8094 69.3167 27.0656 69.5175 27.0973C80.1548 28.7781 88.5488 37.0375 90.2572 47.5037C90.2894 47.7012 90.5496 47.7012 90.5818 47.5037C92.2902 37.0375 100.684 28.7781 111.322 27.0973C111.522 27.0656 111.522 26.8095 111.322 26.7778ZM100.87 27.0174C95.5518 27.8578 91.3548 31.9875 90.5007 37.2206C90.4845 37.3194 90.3544 37.3194 90.3383 37.2206C89.4841 31.9875 85.2871 27.8578 79.9685 27.0174C79.868 27.0016 79.868 26.8735 79.9685 26.8577C85.2871 26.0171 89.4841 21.8876 90.3383 16.6545C90.3544 16.5557 90.4845 16.5557 90.5007 16.6545C91.3548 21.8876 95.5518 26.0171 100.87 26.8577C100.971 26.8735 100.971 27.0016 100.87 27.0174Z" fill="#FA4616"/><path d="M117.694 10.4371C112.376 11.2774 108.179 15.4071 107.325 20.6402C107.308 20.739 107.178 20.739 107.162 20.6402C106.308 15.4071 102.111 11.2774 96.7923 10.4371C96.6919 10.4212 96.6919 10.2931 96.7923 10.2773C102.111 9.43674 106.308 5.3072 107.162 0.0740898C107.178 -0.0246966 107.308 -0.0246966 107.325 0.0740898C108.179 5.3072 112.376 9.43672 117.694 10.2773C117.795 10.2931 117.795 10.4212 117.694 10.4371Z" fill="#FA4616"/><path d="M135.312 33.1429H119.087C114.445 33.1429 111.561 35.9675 111.561 40.5133V108.63C111.561 113.175 114.445 116 119.087 116H120.865C125.507 116 128.391 113.175 128.391 108.63V92.5058H135.423C163.58 92.5058 175.066 83.9066 175.066 62.8243C175.066 41.742 163.548 33.1429 135.312 33.1429ZM158.014 62.6068C158.014 73.4525 152.762 77.1123 137.201 77.1123H128.391V48.2095H137.201C152.762 48.2095 158.014 51.8421 158.014 62.6068Z" fill="black"/><path d="M237.564 48.4739H236.23C231.589 48.4739 228.705 51.2986 228.705 55.8444V55.8538C223.938 50.4474 216.554 47.2772 208.114 47.2772C199.516 47.2772 191.74 50.3711 186.22 55.9903C180.207 62.1094 177.029 70.9412 177.029 81.5299C177.029 92.1647 180.226 101.047 186.274 107.217C191.825 112.881 199.621 116 208.225 116C216.505 116 223.944 112.79 228.711 107.462C228.711 107.468 228.711 108.998 228.712 109.004C228.866 113.33 231.717 116 236.23 116H237.564C242.206 116 245.089 113.176 245.089 108.631V55.8444C245.089 51.2986 242.206 48.4739 237.564 48.4739ZM229.038 81.5299C229.038 93.9678 222.256 101.695 211.337 101.695C200.281 101.695 193.414 93.9678 193.414 81.5299C193.414 69.1579 200.196 61.473 211.115 61.473C222.003 61.473 229.038 69.3462 229.038 81.5299Z" fill="black"/><path d="M334.448 47.3426C325.733 47.3426 319.516 50.7418 315.624 55.0257V40.518C315.624 35.9693 312.738 33.1429 308.094 33.1429H306.759C302.115 33.1429 299.229 35.9693 299.229 40.518V108.625C299.229 113.174 302.115 116 306.759 116H308.094C312.738 116 315.624 113.174 315.624 108.625V81.2897C315.624 63.7895 324.146 61.7658 330.556 61.7658C341.32 61.7658 345.711 67.0126 345.711 79.8747V108.625C345.711 113.174 348.596 116 353.241 116H354.576C359.22 116 362.105 113.174 362.105 108.625V78.8939C362.105 57.6628 353.059 47.3426 334.448 47.3426Z" fill="black"/><path d="M294.515 107.664C294.284 105.472 292.945 102.34 286.565 102.34C279.021 102.34 275.431 100.037 275.431 86.9529V61.7659H286.675C291.313 61.7659 294.194 59.19 294.194 55.0447C294.194 50.9661 291.313 48.4318 286.675 48.4318H275.444V40.518C275.444 35.9693 272.541 33.1429 267.869 33.1429H266.526C261.854 33.1429 258.951 35.9693 258.951 40.518V48.4318H256.366C252.276 48.4318 249.736 50.9661 249.736 55.0447C249.736 59.19 252.617 61.7659 257.254 61.7659H258.951V88.369C258.951 107.737 266.645 116 284.677 116C284.707 116 284.736 115.999 284.765 115.998C285.813 115.997 286.937 115.981 288.081 115.881C290.354 115.67 292.073 114.886 293.191 113.546C294.305 112.213 294.75 109.871 294.515 107.664Z" fill="black"/><path d="M367.331 47.6328V36.4082H364.1C362.823 36.4082 362.105 35.8367 362.105 34.7755C362.105 33.7143 362.823 33.1428 364.1 33.1428H373.952C375.228 33.1428 375.946 33.7143 375.946 34.7755C375.946 35.8367 375.228 36.4082 373.952 36.4082H370.801V47.6328C370.801 48.939 370.203 49.6733 369.086 49.6733C367.969 49.6733 367.331 48.939 367.331 47.6328ZM377.822 49.7139C376.745 49.7139 376.174 48.8937 376.465 47.4695L379.018 34.9388C379.258 33.7553 379.976 33.1428 381.172 33.1428H381.771C382.887 33.1428 383.637 33.6775 384.044 34.7341L388.192 45.5096L392.38 34.7341C392.795 33.6652 393.577 33.1428 394.694 33.1428H395.252C396.449 33.1428 397.167 33.7553 397.406 34.9388L399.919 47.4695C400.206 48.8979 399.72 49.7143 398.643 49.7143C397.486 49.7143 396.772 49.1022 396.529 47.9183L394.415 37.6736L390.426 48.1226C390.007 49.2164 389.309 49.7139 388.232 49.7139C387.115 49.7139 386.417 49.2164 385.998 48.1226L382.01 37.6736L379.935 47.9183C379.696 49.1022 378.978 49.7139 377.822 49.7139Z" fill="black"/></svg>
</div>
<div class="logo-dark">
<svg aria-hidden="true" width="400" height="116" viewBox="0 0 400 116" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.6439 33.1428H60.885C56.2918 33.1428 53.4387 35.9376 53.4387 40.4354V76.6177C53.4387 93.7722 48.1098 100.769 35.0451 100.769C21.9804 100.769 16.6514 93.7404 16.6514 76.5096V40.4354C16.6514 35.9377 13.7982 33.1428 9.20575 33.1428H7.44592C2.85326 33.1428 0 35.9377 0 40.4354V76.6177C0 102.75 11.7912 116 35.0451 116C58.2991 116 70.0897 102.75 70.0897 76.6177V40.4354C70.0897 35.9377 67.2364 33.1428 62.6439 33.1428Z" fill="white"/><path d="M91.1326 55.0989H89.6751C84.9685 55.0989 82.0451 58.0021 82.0451 62.6744V108.425C82.0451 113.097 84.9685 116 89.6751 116H91.1326C95.8386 116 98.762 113.097 98.762 108.425V62.6744C98.762 58.0021 95.8386 55.0989 91.1326 55.0989Z" fill="white"/><path d="M111.322 26.7778C100.684 25.0967 92.2902 16.8376 90.5818 6.37143C90.5496 6.17388 90.2894 6.17388 90.2572 6.37143C88.5488 16.8376 80.1548 25.0967 69.5175 26.7778C69.3167 26.8094 69.3167 27.0656 69.5175 27.0973C80.1548 28.7781 88.5488 37.0375 90.2572 47.5037C90.2894 47.7012 90.5496 47.7012 90.5818 47.5037C92.2902 37.0375 100.684 28.7781 111.322 27.0973C111.522 27.0656 111.522 26.8095 111.322 26.7778ZM100.87 27.0174C95.5518 27.8578 91.3548 31.9875 90.5007 37.2206C90.4845 37.3194 90.3544 37.3194 90.3383 37.2206C89.4841 31.9875 85.2871 27.8578 79.9685 27.0174C79.868 27.0016 79.868 26.8735 79.9685 26.8577C85.2871 26.0171 89.4841 21.8876 90.3383 16.6545C90.3544 16.5557 90.4845 16.5557 90.5007 16.6545C91.3548 21.8876 95.5518 26.0171 100.87 26.8577C100.971 26.8735 100.971 27.0016 100.87 27.0174Z" fill="white"/><path d="M117.694 10.4371C112.376 11.2774 108.179 15.4071 107.325 20.6402C107.308 20.739 107.178 20.739 107.162 20.6402C106.308 15.4071 102.111 11.2774 96.7923 10.4371C96.6919 10.4212 96.6919 10.2931 96.7923 10.2773C102.111 9.43674 106.308 5.3072 107.162 0.0740898C107.178 -0.0246966 107.308 -0.0246966 107.325 0.0740898C108.179 5.3072 112.376 9.43672 117.694 10.2773C117.795 10.2931 117.795 10.4212 117.694 10.4371Z" fill="white"/><path d="M135.312 33.1428H119.087C114.445 33.1428 111.561 35.9674 111.561 40.5133V108.63C111.561 113.175 114.445 116 119.087 116H120.865C125.507 116 128.391 113.175 128.391 108.63V92.5057H135.423C163.58 92.5057 175.066 83.9066 175.066 62.8243C175.066 41.7419 163.548 33.1428 135.312 33.1428ZM158.014 62.6067C158.014 73.4525 152.762 77.1123 137.201 77.1123H128.391V48.2095H137.201C152.762 48.2095 158.014 51.842 158.014 62.6067Z" fill="white"/><path d="M237.564 48.4739H236.23C231.589 48.4739 228.705 51.2986 228.705 55.8444V55.8538C223.938 50.4474 216.554 47.2772 208.114 47.2772C199.516 47.2772 191.74 50.3711 186.22 55.9903C180.207 62.1094 177.029 70.9412 177.029 81.5299C177.029 92.1647 180.226 101.047 186.274 107.217C191.825 112.881 199.621 116 208.225 116C216.505 116 223.944 112.79 228.711 107.462C228.711 107.468 228.711 108.998 228.712 109.004C228.866 113.33 231.717 116 236.23 116H237.564C242.206 116 245.089 113.176 245.089 108.631V55.8444C245.089 51.2986 242.206 48.4739 237.564 48.4739ZM229.038 81.5299C229.038 93.9678 222.256 101.695 211.337 101.695C200.281 101.695 193.414 93.9678 193.414 81.5299C193.414 69.1579 200.196 61.473 211.115 61.473C222.003 61.473 229.038 69.3462 229.038 81.5299Z" fill="white"/><path d="M334.448 47.3425C325.733 47.3425 319.516 50.7417 315.624 55.0256V40.5179C315.624 35.9693 312.738 33.1428 308.094 33.1428H306.759C302.115 33.1428 299.229 35.9693 299.229 40.5179V108.625C299.229 113.174 302.115 116 306.759 116H308.094C312.738 116 315.624 113.174 315.624 108.625V81.2897C315.624 63.7894 324.146 61.7657 330.556 61.7657C341.32 61.7657 345.711 67.0125 345.711 79.8746V108.625C345.711 113.174 348.596 116 353.241 116H354.576C359.22 116 362.105 113.174 362.105 108.625V78.8938C362.105 57.6627 353.059 47.3425 334.448 47.3425Z" fill="white"/><path d="M294.515 107.664C294.284 105.472 292.945 102.34 286.565 102.34C279.021 102.34 275.431 100.037 275.431 86.9529V61.7658H286.675C291.313 61.7658 294.194 59.19 294.194 55.0446C294.194 50.966 291.313 48.4317 286.675 48.4317H275.444V40.5179C275.444 35.9693 272.541 33.1428 267.869 33.1428H266.526C261.854 33.1428 258.951 35.9693 258.951 40.5179V48.4317H256.366C252.276 48.4317 249.736 50.966 249.736 55.0446C249.736 59.19 252.617 61.7658 257.254 61.7658H258.951V88.3689C258.951 107.737 266.645 116 284.677 116C284.707 116 284.736 115.999 284.765 115.998C285.813 115.997 286.937 115.981 288.081 115.881C290.354 115.67 292.073 114.885 293.191 113.546C294.305 112.213 294.75 109.87 294.515 107.664Z" fill="white"/><path d="M367.331 47.6328V36.4082H364.1C362.823 36.4082 362.105 35.8367 362.105 34.7755C362.105 33.7143 362.823 33.1428 364.1 33.1428H373.952C375.228 33.1428 375.946 33.7143 375.946 34.7755C375.946 35.8367 375.228 36.4082 373.952 36.4082H370.801V47.6328C370.801 48.939 370.203 49.6733 369.086 49.6733C367.969 49.6733 367.331 48.939 367.331 47.6328ZM377.822 49.7139C376.745 49.7139 376.174 48.8937 376.465 47.4695L379.018 34.9388C379.258 33.7553 379.976 33.1428 381.172 33.1428H381.771C382.887 33.1428 383.637 33.6775 384.044 34.7341L388.192 45.5096L392.38 34.7341C392.795 33.6652 393.577 33.1428 394.694 33.1428H395.252C396.449 33.1428 397.167 33.7553 397.406 34.9388L399.919 47.4695C400.206 48.8979 399.72 49.7143 398.643 49.7143C397.486 49.7143 396.772 49.1022 396.529 47.9183L394.415 37.6736L390.426 48.1226C390.007 49.2164 389.309 49.7139 388.232 49.7139C387.115 49.7139 386.417 49.2164 385.998 48.1226L382.01 37.6736L379.935 47.9183C379.696 49.1022 378.978 49.7139 377.822 49.7139Z" fill="white"/></svg>
</div>
</div>
<div class="icon ${iconClass}">${icon}</div>
<h1>${safeTitle}</h1>
<p>${safeMessage}</p>
<div class="footer">You can close this window</div>
</div>
</div>
</body>
</html>`;
};
// ../auth/src/server.ts
var AUTH_TIMEOUT_ERROR_CODE = "EAUTHTIMEOUT";
var startServer = async ({
redirectUri,
timeoutMs = DEFAULT_AUTH_TIMEOUT_MS,
onListening,
signal
}) => {
let http;
try {
http = await import("node:http");
} catch {
throw new Error("Local server authentication is not supported in this environment.");
}
return new Promise((resolve2, reject) => {
const server = http.createServer((req, res) => {
if (!req.url) {
res.writeHead(400, {
"Content-Type": "text/html; charset=utf-8",
Connection: "close"
});
res.end(getBaseHtml({
title: "Let's try that again",
message: "We got an unexpected request. Head back to your terminal and try signing in again.",
type: "error"
}));
server.close();
reject(new Error("No URL received"));
return;
}
const url = new URL(req.url, redirectUri);
const error = url.searchParams.get("error");
if (error) {
res.writeHead(400, {
"Content-Type": "text/html; charset=utf-8",
Connection: "close"
});
res.end(getBaseHtml({
title: "Let's try that again",
message: `The sign-in didn't go through: ${error}. Head back to your terminal and take another shot.`,
type: "error"
}));
server.close();
reject(new Error(`OAuth error: ${error}`));
return;
}
const code = url.searchParams.get("code");
if (code) {
res.writeHead(200, {
"Content-Type": "text/html; charset=utf-8",
Connection: "close"
});
res.end(getBaseHtml({
title: "Ready to automate!",
message: "You're in. Head back to your terminal and let's get to work.",
type: "success"
}));
server.close();
resolve2(url);
return;
}
res.writeHead(400, {
"Content-Type": "text/html; charset=utf-8",
Connection: "close"
});
res.end(getBaseHtml({
title: "We hit a snag",
message: "No authorization came back from the server. Head back to your terminal and try once more.",
type: "error"
}));
server.close();
reject(new Error("No authorization code received"));
return;
});
let timeoutHandle;
const onAbort = () => {
clearTimeout(timeoutHandle);
server.close();
const err = new Error("Authentication cancelled");
err.code = AUTH_CANCELLED_ERROR_CODE;
reject(err);
};
if (signal) {
if (signal.aborted) {
onAbort();
return;
}
signal.addEventListener("abort", onAbort, { once: true });
}
timeoutHandle = setTimeout(() => {
server.close();
signal?.removeEventListener("abort", onAbort);
const err = new Error("Authentication timeout");
err.code = AUTH_TIMEOUT_ERROR_CODE;
reject(err);
}, timeoutMs);
const bindHost = redirectUri.hostname === "localhost" ? "127.0.0.1" : redirectUri.hostname;
server.on("error", (err) => {
clearTimeout(timeoutHandle);
signal?.removeEventListener("abort", onAbort);
reject(err);
});
server.listen(Number(redirectUri.port), bindHost, () => {
if (onListening) {
Promise.resolve(onListening()).catch((err) => {
server.close();
clearTimeout(timeoutHandle);
reject(err);
});
}
});
server.on("close", () => {
clearTimeout(timeoutHandle);
signal?.removeEventListener("abort", onAbort);
});
});
};
export { getFileSystem, catchError, startServer };
//# debugId=D9E7CD3D9546B69464756E2164756E21
import { createRequire } from "node:module";
var __create = Object.create;
var __getProtoOf = Object.getPrototypeOf;
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
function __accessProp(key) {
return this[key];
}
var __toESMCache_node;
var __toESMCache_esm;
var __toESM = (mod, isNodeMode, target) => {
var canCache = mod != null && typeof mod === "object";
if (canCache) {
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
var cached = cache.get(mod);
if (cached)
return cached;
}
target = mod != null ? __create(__getProtoOf(mod)) : {};
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
for (let key of __getOwnPropNames(mod))
if (!__hasOwnProp.call(to, key))
__defProp(to, key, {
get: __accessProp.bind(mod, key),
enumerable: true
});
if (canCache)
cache.set(mod, to);
return to;
};
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __require = /* @__PURE__ */ createRequire(import.meta.url);
// ../auth/src/constants.ts
var UIPATH_HOME_DIR = ".uipath";
var AUTH_FILENAME = ".auth";
var DEFAULT_BASE_URL = "https://cloud.uipath.com";
var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
var AUTH_CANCELLED_ERROR_CODE = "EAUTHCANCELLED";
export { __toESM, __commonJS, __require, UIPATH_HOME_DIR, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_CANCELLED_ERROR_CODE };
//# debugId=711BC5A1B69D7CEF64756E2164756E21
+2
-2
{
"name": "@uipath/codedagent-tool",
"license": "MIT",
"version": "1.199.0-preview.108",
"version": "1.200.0-preview.109",
"description": "Build, run, deploy, and manage AI Agents.",

@@ -35,3 +35,3 @@ "keywords": [

},
"gitHead": "171f68daab68809916e8df10ea198c259f688ede"
"gitHead": "fcc01cdae81bbd0c25d3d4fc287537a9d19d99f4"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display