Sign In

@uipath/solution-tool

Package Overview
Dependencies
Maintainers
24
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uipath/solution-tool - npm Package Compare versions

Comparing version
1.199.0-preview.108
to
1.200.0-preview.109
+99
dist/browser-strategy-brs3w53e.js
import {
getGlobalThis
} from "./packager-tool-9qecd4wb.js";
import {
AUTH_CANCELLED_ERROR_CODE
} from "./packager-tool-1ps2qeqg.js";
import"./packager-tool-0v6na3yp.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=B13A3005E9EE6C6564756E2164756E21
import {
catchError,
getFileSystem,
startServer
} from "./packager-tool-q90kqh83.js";
import"./packager-tool-1ps2qeqg.js";
import"./packager-tool-0v6na3yp.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=E5B2BD2B3B179D3D64756E2164756E21
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);
export { __toESM, __commonJS, __require };
//# debugId=C61B9583F8C9819B64756E2164756E21
// ../../node_modules/fflate/esm/index.mjs
import { createRequire } from "module";
var require2 = createRequire("/");
var _a;
var Worker;
var isMarkedAsUntransferable;
try {
_a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
} catch (e) {}
var u8 = Uint8Array;
var u16 = Uint16Array;
var i32 = Int32Array;
var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
var freb = function(eb, start) {
var b = new u16(31);
for (var i = 0;i < 31; ++i) {
b[i] = start += 1 << eb[i - 1];
}
var r = new i32(b[30]);
for (var i = 1;i < 30; ++i) {
for (var j = b[i];j < b[i + 1]; ++j) {
r[j] = j - b[i] << 5 | i;
}
}
return { b, r };
};
var _a = freb(fleb, 2);
var fl = _a.b;
var revfl = _a.r;
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0);
var fd = _b.b;
var revfd = _b.r;
var rev = new u16(32768);
for (i = 0;i < 32768; ++i) {
x = (i & 43690) >> 1 | (i & 21845) << 1;
x = (x & 52428) >> 2 | (x & 13107) << 2;
x = (x & 61680) >> 4 | (x & 3855) << 4;
rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
}
var x;
var i;
var hMap = function(cd, mb, r) {
var s = cd.length;
var i2 = 0;
var l = new u16(mb);
for (;i2 < s; ++i2) {
if (cd[i2])
++l[cd[i2] - 1];
}
var le = new u16(mb);
for (i2 = 1;i2 < mb; ++i2) {
le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
}
var co;
if (r) {
co = new u16(1 << mb);
var rvb = 15 - mb;
for (i2 = 0;i2 < s; ++i2) {
if (cd[i2]) {
var sv = i2 << 4 | cd[i2];
var r_1 = mb - cd[i2];
var v = le[cd[i2] - 1]++ << r_1;
for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
co[rev[v] >> rvb] = sv;
}
}
}
} else {
co = new u16(s);
for (i2 = 0;i2 < s; ++i2) {
if (cd[i2]) {
co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
}
}
}
return co;
};
var flt = new u8(288);
for (i = 0;i < 144; ++i)
flt[i] = 8;
var i;
for (i = 144;i < 256; ++i)
flt[i] = 9;
var i;
for (i = 256;i < 280; ++i)
flt[i] = 7;
var i;
for (i = 280;i < 288; ++i)
flt[i] = 8;
var i;
var fdt = new u8(32);
for (i = 0;i < 32; ++i)
fdt[i] = 5;
var i;
var flm = /* @__PURE__ */ hMap(flt, 9, 0);
var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
var max = function(a) {
var m = a[0];
for (var i2 = 1;i2 < a.length; ++i2) {
if (a[i2] > m)
m = a[i2];
}
return m;
};
var bits = function(d, p, m) {
var o = p / 8 | 0;
return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
};
var bits16 = function(d, p) {
var o = p / 8 | 0;
return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
};
var shft = function(p) {
return (p + 7) / 8 | 0;
};
var slc = function(v, s, e) {
if (s == null || s < 0)
s = 0;
if (e == null || e > v.length)
e = v.length;
return new u8(v.subarray(s, e));
};
var ec = [
"unexpected EOF",
"invalid block type",
"invalid length/literal",
"invalid distance",
"stream finished",
"no stream handler",
,
"no callback",
"invalid UTF-8 data",
"extra field too long",
"date not in range 1980-2099",
"filename too long",
"stream finishing",
"invalid zip data"
];
var err = function(ind, msg, nt) {
var e = new Error(msg || ec[ind]);
e.code = ind;
if (Error.captureStackTrace)
Error.captureStackTrace(e, err);
if (!nt)
throw e;
return e;
};
var inflt = function(dat, st, buf, dict) {
var sl = dat.length, dl = dict ? dict.length : 0;
if (!sl || st.f && !st.l)
return buf || new u8(0);
var noBuf = !buf;
var resize = noBuf || st.i != 2;
var noSt = st.i;
if (noBuf)
buf = new u8(sl * 3);
var cbuf = function(l2) {
var bl = buf.length;
if (l2 > bl) {
var nbuf = new u8(Math.max(bl * 2, l2));
nbuf.set(buf);
buf = nbuf;
}
};
var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
var tbts = sl * 8;
do {
if (!lm) {
final = bits(dat, pos, 1);
var type = bits(dat, pos + 1, 3);
pos += 3;
if (!type) {
var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
if (t > sl) {
if (noSt)
err(0);
break;
}
if (resize)
cbuf(bt + l);
buf.set(dat.subarray(s, t), bt);
st.b = bt += l, st.p = pos = t * 8, st.f = final;
continue;
} else if (type == 1)
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
else if (type == 2) {
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
var tl = hLit + bits(dat, pos + 5, 31) + 1;
pos += 14;
var ldt = new u8(tl);
var clt = new u8(19);
for (var i2 = 0;i2 < hcLen; ++i2) {
clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
}
pos += hcLen * 3;
var clb = max(clt), clbmsk = (1 << clb) - 1;
var clm = hMap(clt, clb, 1);
for (var i2 = 0;i2 < tl; ) {
var r = clm[bits(dat, pos, clbmsk)];
pos += r & 15;
var s = r >> 4;
if (s < 16) {
ldt[i2++] = s;
} else {
var c = 0, n = 0;
if (s == 16)
n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i2 - 1];
else if (s == 17)
n = 3 + bits(dat, pos, 7), pos += 3;
else if (s == 18)
n = 11 + bits(dat, pos, 127), pos += 7;
while (n--)
ldt[i2++] = c;
}
}
var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
lbt = max(lt);
dbt = max(dt);
lm = hMap(lt, lbt, 1);
dm = hMap(dt, dbt, 1);
} else
err(1);
if (pos > tbts) {
if (noSt)
err(0);
break;
}
}
if (resize)
cbuf(bt + 131072);
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
var lpos = pos;
for (;; lpos = pos) {
var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
pos += c & 15;
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (!c)
err(2);
if (sym < 256)
buf[bt++] = sym;
else if (sym == 256) {
lpos = pos, lm = null;
break;
} else {
var add = sym - 254;
if (sym > 264) {
var i2 = sym - 257, b = fleb[i2];
add = bits(dat, pos, (1 << b) - 1) + fl[i2];
pos += b;
}
var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
if (!d)
err(3);
pos += d & 15;
var dt = fd[dsym];
if (dsym > 3) {
var b = fdeb[dsym];
dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
}
if (pos > tbts) {
if (noSt)
err(0);
break;
}
if (resize)
cbuf(bt + 131072);
var end = bt + add;
if (bt < dt) {
var shift = dl - dt, dend = Math.min(dt, end);
if (shift + bt < 0)
err(3);
for (;bt < dend; ++bt)
buf[bt] = dict[shift + bt];
}
for (;bt < end; ++bt)
buf[bt] = buf[bt - dt];
}
}
st.l = lm, st.p = lpos, st.b = bt, st.f = final;
if (lm)
final = 1, st.m = lbt, st.d = dm, st.n = dbt;
} while (!final);
return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
};
var wbits = function(d, p, v) {
v <<= p & 7;
var o = p / 8 | 0;
d[o] |= v;
d[o + 1] |= v >> 8;
};
var wbits16 = function(d, p, v) {
v <<= p & 7;
var o = p / 8 | 0;
d[o] |= v;
d[o + 1] |= v >> 8;
d[o + 2] |= v >> 16;
};
var hTree = function(d, mb) {
var t = [];
for (var i2 = 0;i2 < d.length; ++i2) {
if (d[i2])
t.push({ s: i2, f: d[i2] });
}
var s = t.length;
var t2 = t.slice();
if (!s)
return { t: et, l: 0 };
if (s == 1) {
var v = new u8(t[0].s + 1);
v[t[0].s] = 1;
return { t: v, l: 1 };
}
t.sort(function(a, b) {
return a.f - b.f;
});
t.push({ s: -1, f: 25001 });
var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
t[0] = { s: -1, f: l.f + r.f, l, r };
while (i1 != s - 1) {
l = t[t[i0].f < t[i22].f ? i0++ : i22++];
r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
t[i1++] = { s: -1, f: l.f + r.f, l, r };
}
var maxSym = t2[0].s;
for (var i2 = 1;i2 < s; ++i2) {
if (t2[i2].s > maxSym)
maxSym = t2[i2].s;
}
var tr = new u16(maxSym + 1);
var mbt = ln(t[i1 - 1], tr, 0);
if (mbt > mb) {
var i2 = 0, dt = 0;
var lft = mbt - mb, cst = 1 << lft;
t2.sort(function(a, b) {
return tr[b.s] - tr[a.s] || a.f - b.f;
});
for (;i2 < s; ++i2) {
var i2_1 = t2[i2].s;
if (tr[i2_1] > mb) {
dt += cst - (1 << mbt - tr[i2_1]);
tr[i2_1] = mb;
} else
break;
}
dt >>= lft;
while (dt > 0) {
var i2_2 = t2[i2].s;
if (tr[i2_2] < mb)
dt -= 1 << mb - tr[i2_2]++ - 1;
else
++i2;
}
for (;i2 >= 0 && dt; --i2) {
var i2_3 = t2[i2].s;
if (tr[i2_3] == mb) {
--tr[i2_3];
++dt;
}
}
mbt = mb;
}
return { t: new u8(tr), l: mbt };
};
var ln = function(n, l, d) {
return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
};
var lc = function(c) {
var s = c.length;
while (s && !c[--s])
;
var cl = new u16(++s);
var cli = 0, cln = c[0], cls = 1;
var w = function(v) {
cl[cli++] = v;
};
for (var i2 = 1;i2 <= s; ++i2) {
if (c[i2] == cln && i2 != s)
++cls;
else {
if (!cln && cls > 2) {
for (;cls > 138; cls -= 138)
w(32754);
if (cls > 2) {
w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
cls = 0;
}
} else if (cls > 3) {
w(cln), --cls;
for (;cls > 6; cls -= 6)
w(8304);
if (cls > 2)
w(cls - 3 << 5 | 8208), cls = 0;
}
while (cls--)
w(cln);
cls = 1;
cln = c[i2];
}
}
return { c: cl.subarray(0, cli), n: s };
};
var clen = function(cf, cl) {
var l = 0;
for (var i2 = 0;i2 < cl.length; ++i2)
l += cf[i2] * cl[i2];
return l;
};
var wfblk = function(out, pos, dat) {
var s = dat.length;
var o = shft(pos + 2);
out[o] = s & 255;
out[o + 1] = s >> 8;
out[o + 2] = out[o] ^ 255;
out[o + 3] = out[o + 1] ^ 255;
for (var i2 = 0;i2 < s; ++i2)
out[o + i2 + 4] = dat[i2];
return (o + 4 + s) * 8;
};
var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
wbits(out, p++, final);
++lf[256];
var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
var lcfreq = new u16(19);
for (var i2 = 0;i2 < lclt.length; ++i2)
++lcfreq[lclt[i2] & 31];
for (var i2 = 0;i2 < lcdt.length; ++i2)
++lcfreq[lcdt[i2] & 31];
var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
var nlcc = 19;
for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
;
var flen = bl + 5 << 3;
var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
if (bs >= 0 && flen <= ftlen && flen <= dtlen)
return wfblk(out, p, dat.subarray(bs, bs + bl));
var lm, ll, dm, dl;
wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
if (dtlen < ftlen) {
lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
var llm = hMap(lct, mlcb, 0);
wbits(out, p, nlc - 257);
wbits(out, p + 5, ndc - 1);
wbits(out, p + 10, nlcc - 4);
p += 14;
for (var i2 = 0;i2 < nlcc; ++i2)
wbits(out, p + 3 * i2, lct[clim[i2]]);
p += 3 * nlcc;
var lcts = [lclt, lcdt];
for (var it = 0;it < 2; ++it) {
var clct = lcts[it];
for (var i2 = 0;i2 < clct.length; ++i2) {
var len = clct[i2] & 31;
wbits(out, p, llm[len]), p += lct[len];
if (len > 15)
wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
}
}
} else {
lm = flm, ll = flt, dm = fdm, dl = fdt;
}
for (var i2 = 0;i2 < li; ++i2) {
var sym = syms[i2];
if (sym > 255) {
var len = sym >> 18 & 31;
wbits16(out, p, lm[len + 257]), p += ll[len + 257];
if (len > 7)
wbits(out, p, sym >> 23 & 31), p += fleb[len];
var dst = sym & 31;
wbits16(out, p, dm[dst]), p += dl[dst];
if (dst > 3)
wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
} else {
wbits16(out, p, lm[sym]), p += ll[sym];
}
}
wbits16(out, p, lm[256]);
return p + ll[256];
};
var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
var et = /* @__PURE__ */ new u8(0);
var dflt = function(dat, lvl, plvl, pre, post, st) {
var s = st.z || dat.length;
var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
var w = o.subarray(pre, o.length - post);
var lst = st.l;
var pos = (st.r || 0) & 7;
if (lvl) {
if (pos)
w[0] = st.r >> 3;
var opt = deo[lvl - 1];
var n = opt >> 13, c = opt & 8191;
var msk_1 = (1 << plvl) - 1;
var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
var hsh = function(i3) {
return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
};
var syms = new i32(25000);
var lf = new u16(288), df = new u16(32);
var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
for (;i2 + 2 < s; ++i2) {
var hv = hsh(i2);
var imod = i2 & 32767, pimod = head[hv];
prev[imod] = pimod;
head[hv] = imod;
if (wi <= i2) {
var rem = s - i2;
if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
li = lc_1 = eb = 0, bs = i2;
for (var j = 0;j < 286; ++j)
lf[j] = 0;
for (var j = 0;j < 30; ++j)
df[j] = 0;
}
var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
if (rem > 2 && hv == hsh(i2 - dif)) {
var maxn = Math.min(n, rem) - 1;
var maxd = Math.min(32767, i2);
var ml = Math.min(258, rem);
while (dif <= maxd && --ch_1 && imod != pimod) {
if (dat[i2 + l] == dat[i2 + l - dif]) {
var nl = 0;
for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
;
if (nl > l) {
l = nl, d = dif;
if (nl > maxn)
break;
var mmd = Math.min(dif, nl - 2);
var md = 0;
for (var j = 0;j < mmd; ++j) {
var ti = i2 - dif + j & 32767;
var pti = prev[ti];
var cd = ti - pti & 32767;
if (cd > md)
md = cd, pimod = ti;
}
}
}
imod = pimod, pimod = prev[imod];
dif += imod - pimod & 32767;
}
}
if (d) {
syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
var lin = revfl[l] & 31, din = revfd[d] & 31;
eb += fleb[lin] + fdeb[din];
++lf[257 + lin];
++df[din];
wi = i2 + l;
++lc_1;
} else {
syms[li++] = dat[i2];
++lf[dat[i2]];
}
}
}
for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
syms[li++] = dat[i2];
++lf[dat[i2]];
}
pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
if (!lst) {
st.r = pos & 7 | w[pos / 8 | 0] << 3;
pos -= 7;
st.h = head, st.p = prev, st.i = i2, st.w = wi;
}
} else {
for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
var e = i2 + 65535;
if (e >= s) {
w[pos / 8 | 0] = lst;
e = s;
}
pos = wfblk(w, pos + 1, dat.subarray(i2, e));
}
st.i = s;
}
return slc(o, 0, pre + shft(pos) + post);
};
var crct = /* @__PURE__ */ function() {
var t = new Int32Array(256);
for (var i2 = 0;i2 < 256; ++i2) {
var c = i2, k = 9;
while (--k)
c = (c & 1 && -306674912) ^ c >>> 1;
t[i2] = c;
}
return t;
}();
var crc = function() {
var c = -1;
return {
p: function(d) {
var cr = c;
for (var i2 = 0;i2 < d.length; ++i2)
cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
c = cr;
},
d: function() {
return ~c;
}
};
};
var dopt = function(dat, opt, pre, post, st) {
if (!st) {
st = { l: 1 };
if (opt.dictionary) {
var dict = opt.dictionary.subarray(-32768);
var newDat = new u8(dict.length + dat.length);
newDat.set(dict);
newDat.set(dat, dict.length);
dat = newDat;
st.w = dict.length;
}
}
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
};
var mrg = function(a, b) {
var o = {};
for (var k in a)
o[k] = a[k];
for (var k in b)
o[k] = b[k];
return o;
};
var b2 = function(d, b) {
return d[b] | d[b + 1] << 8;
};
var b4 = function(d, b) {
return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;
};
var b8 = function(d, b) {
return b4(d, b) + b4(d, b + 4) * 4294967296;
};
var wbytes = function(d, b, v) {
for (;v; ++b)
d[b] = v, v >>>= 8;
};
function deflateSync(data, opts) {
return dopt(data, opts || {}, 0, 0);
}
function inflateSync(data, opts) {
return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
}
var fltn = function(d, p, t, o) {
for (var k in d) {
var val = d[k], n = p + k, op = o;
if (Array.isArray(val))
op = mrg(o, val[1]), val = val[0];
if (ArrayBuffer.isView(val))
t[n] = [val, op];
else {
t[n += "/"] = [new u8(0), op];
fltn(val, n, t, o);
}
}
};
var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
var tds = 0;
try {
td.decode(et, { stream: true });
tds = 1;
} catch (e) {}
var dutf8 = function(d) {
for (var r = "", i2 = 0;; ) {
var c = d[i2++];
var eb = (c > 127) + (c > 223) + (c > 239);
if (i2 + eb > d.length)
return { s: r, r: slc(d, i2 - 1) };
if (!eb)
r += String.fromCharCode(c);
else if (eb == 3) {
c = ((c & 15) << 18 | (d[i2++] & 63) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);
} else if (eb & 1)
r += String.fromCharCode((c & 31) << 6 | d[i2++] & 63);
else
r += String.fromCharCode((c & 15) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63);
}
};
function strToU8(str, latin1) {
if (latin1) {
var ar_1 = new u8(str.length);
for (var i2 = 0;i2 < str.length; ++i2)
ar_1[i2] = str.charCodeAt(i2);
return ar_1;
}
if (te)
return te.encode(str);
var l = str.length;
var ar = new u8(str.length + (str.length >> 1));
var ai = 0;
var w = function(v) {
ar[ai++] = v;
};
for (var i2 = 0;i2 < l; ++i2) {
if (ai + 5 > ar.length) {
var n = new u8(ai + 8 + (l - i2 << 1));
n.set(ar);
ar = n;
}
var c = str.charCodeAt(i2);
if (c < 128 || latin1)
w(c);
else if (c < 2048)
w(192 | c >> 6), w(128 | c & 63);
else if (c > 55295 && c < 57344)
c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i2) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
else
w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
}
return slc(ar, 0, ai);
}
function strFromU8(dat, latin1) {
if (latin1) {
var r = "";
for (var i2 = 0;i2 < dat.length; i2 += 16384)
r += String.fromCharCode.apply(null, dat.subarray(i2, i2 + 16384));
return r;
} else if (td) {
return td.decode(dat);
} else {
var _a2 = dutf8(dat), s = _a2.s, r = _a2.r;
if (r.length)
err(8);
return s;
}
}
var slzh = function(d, b) {
return b + 30 + b2(d, b + 26) + b2(d, b + 28);
};
var zh = function(d, b, z) {
var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;
var _a2 = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a2[0], su = _a2[1], off = _a2[2];
return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off];
};
var z64hs = function(d, b, l, z, sc, su, off) {
var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
var nf = nsc + nsu + noff;
if (z && nf) {
for (;b + 4 < e; b += 4 + b2(d, b + 2)) {
if (b2(d, b) == 1) {
return [
nsc ? b8(d, b + 4 + 8 * nsu) : sc,
nsu ? b8(d, b + 4) : su,
noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off,
1
];
}
}
if (z < 2)
err(13);
}
return [sc, su, off, 0];
};
var exfl = function(ex) {
var le = 0;
if (ex) {
for (var k in ex) {
var l = ex[k].length;
if (l > 65535)
err(9);
le += l + 4;
}
}
return le;
};
var wzh = function(d, b, f, fn, u, c, ce, co) {
var fl2 = fn.length, ex = f.extra, col = co && co.length;
var exl = exfl(ex);
wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
if (ce != null)
d[b++] = 20, d[b++] = f.os;
d[b] = 20, b += 2;
d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
if (y < 0 || y > 119)
err(10);
wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
if (c != -1) {
wbytes(d, b, f.crc);
wbytes(d, b + 4, c < 0 ? -c - 2 : c);
wbytes(d, b + 8, f.size);
}
wbytes(d, b + 12, fl2);
wbytes(d, b + 14, exl), b += 16;
if (ce != null) {
wbytes(d, b, col);
wbytes(d, b + 6, f.attrs);
wbytes(d, b + 10, ce), b += 14;
}
d.set(fn, b);
b += fl2;
if (exl) {
for (var k in ex) {
var exf = ex[k], l = exf.length;
wbytes(d, b, +k);
wbytes(d, b + 2, l);
d.set(exf, b + 4), b += 4 + l;
}
}
if (col)
d.set(co, b), b += col;
return b;
};
var wzf = function(o, b, c, d, e) {
wbytes(o, b, 101010256);
wbytes(o, b + 8, c);
wbytes(o, b + 10, c);
wbytes(o, b + 12, d);
wbytes(o, b + 16, e);
};
function zipSync(data, opts) {
if (!opts)
opts = {};
var r = {};
var files = [];
fltn(data, "", r, opts);
var o = 0;
var tot = 0;
for (var fn in r) {
var _a2 = r[fn], file = _a2[0], p = _a2[1];
var compression = p.level == 0 ? 0 : 8;
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
if (s > 65535)
err(11);
var d = compression ? deflateSync(file, p) : file, l = d.length;
var c = crc();
c.p(file);
files.push(mrg(p, {
size: file.length,
crc: c.d(),
c: d,
f,
m,
u: s != fn.length || m && com.length != ms,
o,
compression
}));
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
}
var out = new u8(tot + 22), oe = o, cdl = tot - o;
for (var i2 = 0;i2 < files.length; ++i2) {
var f = files[i2];
wzh(out, f.o, f, f.f, f.u, f.c.length);
var badd = 30 + f.f.length + exfl(f.extra);
out.set(f.c, f.o + badd);
wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
}
wzf(out, o, files.length, cdl, oe);
return out;
}
function unzipSync(data, opts) {
var files = {};
var e = data.length - 22;
for (;b4(data, e) != 101010256; --e) {
if (!e || data.length - e > 65558)
err(13);
}
var c = b2(data, e + 8);
if (!c)
return {};
var o = b4(data, e + 16);
var z = b4(data, e - 20) == 117853008;
if (z) {
var ze = b4(data, e - 12);
z = b4(data, ze) == 101075792;
if (z) {
c = b4(data, ze + 32);
o = b4(data, ze + 48);
}
}
var fltr = opts && opts.filter;
for (var i2 = 0;i2 < c; ++i2) {
var _a2 = zh(data, o, z), c_2 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off);
o = no;
if (!fltr || fltr({
name: fn,
size: sc,
originalSize: su,
compression: c_2
})) {
if (!c_2)
files[fn] = slc(data, b, b + sc);
else if (c_2 == 8)
files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
else
err(14, "unknown compression type " + c_2);
}
}
return files;
}
export { strToU8, strFromU8, zipSync, unzipSync };
//# debugId=4FB81DC4940FE35C64756E2164756E21
// ../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 { UIPATH_HOME_DIR, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS, AUTH_CANCELLED_ERROR_CODE };
//# debugId=6DCB1840782D2B3E64756E2164756E21

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

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

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

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

import {
catchError
} from "./packager-tool-y4wacqkp.js";
import {
getFileSystem
} from "./packager-tool-q90kqh83.js";
// src/services/solution-init-service.ts
var AGENTS_FILENAME = "AGENTS.md";
var CLAUDE_FILENAME = "CLAUDE.md";
class SolutionInitError extends Error {
stage;
constructor(stage, cause) {
super(cause instanceof Error ? cause.message : String(cause), {
cause
});
this.stage = stage;
this.name = "SolutionInitError";
}
}
async function solutionInitAsync(solutionName, options = {}) {
const fs = getFileSystem();
const base = fs.path.basename(solutionName);
const hasExtension = base.lastIndexOf(".") > 0;
const nameWithoutExt = hasExtension ? base.slice(0, base.lastIndexOf(".")) : base;
const fileName = hasExtension ? base : `${base}.uipx`;
const parentDir = fs.path.resolve(options.cwd ?? ".", fs.path.dirname(solutionName), nameWithoutExt);
const [mkdirError] = await catchError(fs.mkdir(parentDir));
if (mkdirError) {
throw new SolutionInitError("directory", mkdirError);
}
let agentsPath;
let claudePath;
if (options.briefingContent !== undefined) {
agentsPath = fs.path.join(parentDir, AGENTS_FILENAME);
claudePath = fs.path.join(parentDir, CLAUDE_FILENAME);
const [agentsError] = await catchError(fs.writeFile(agentsPath, options.briefingContent));
if (agentsError) {
throw new SolutionInitError("briefing", agentsError);
}
const [claudeError] = await catchError(fs.writeFile(claudePath, options.briefingContent));
if (claudeError) {
throw new SolutionInitError("briefing", claudeError);
}
}
const filePath = fs.path.join(parentDir, fileName);
const solution = {
DocVersion: "1.0.0",
StudioMinVersion: "2025.10.0",
SolutionId: crypto.randomUUID(),
Projects: []
};
const [manifestError] = await catchError(fs.writeFile(filePath, `${JSON.stringify(solution, null, 2)}
`));
if (manifestError) {
throw new SolutionInitError("manifest", manifestError);
}
return {
solutionFile: filePath,
solutionDir: parentDir,
solutionName: nameWithoutExt,
agentsPath,
claudePath
};
}
export { SolutionInitError, solutionInitAsync };
//# debugId=533229F41EC9DD9664756E2164756E21
import {
AUTH_CANCELLED_ERROR_CODE,
DEFAULT_AUTH_TIMEOUT_MS
} from "./packager-tool-1ps2qeqg.js";
import {
__require
} from "./packager-tool-0v6na3yp.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=14B5757F539D1DD064756E2164756E21
import {
Configuration,
Configuration1 as Configuration2,
PackagesApi,
PipelinesApi,
resolveFeedScope
} from "./packager-tool-gkwmyc48.js";
import {
PollOutcome,
catchError,
extractErrorDetails,
getSolutionAuthContext,
logger,
mapPollFailure,
pollUntil
} from "./packager-tool-y4wacqkp.js";
import {
getFileSystem
} from "./packager-tool-q90kqh83.js";
import {
strFromU8,
strToU8,
unzipSync,
zipSync
} from "./packager-tool-129wn232.js";
// src/services/package-metadata-rewrite.ts
import { randomUUID } from "node:crypto";
var SOLUTION_METADATA_ENTRY = "solutionMetadata.json";
function isRecord(value) {
return typeof value === "object" && value !== null && !Array.isArray(value);
}
var requireValue = (value, flag) => {
const trimmed = value.trim();
if (!trimmed) {
throw new Error(`${flag} cannot be empty.`);
}
return trimmed;
};
function rewritePackageMetadata(archive, overrides) {
const entries = unzipSync(archive);
const metadataBytes = entries[SOLUTION_METADATA_ENTRY];
if (!metadataBytes) {
throw new Error(`Package archive has no ${SOLUTION_METADATA_ENTRY} at its root, so its name and version cannot be rewritten. Only a .zip produced by 'uip solution pack' carries that file.`);
}
let parsed;
try {
parsed = JSON.parse(strFromU8(metadataBytes));
} catch (err) {
throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
}
if (!isRecord(parsed) || !isRecord(parsed.spec)) {
throw new Error(`${SOLUTION_METADATA_ENTRY} in the package archive has no 'spec' object, so its name and version cannot be rewritten.`);
}
const spec = parsed.spec;
const packageName = overrides.packageName === undefined ? String(spec.packageName ?? "") : requireValue(overrides.packageName, "--package-name");
const packageVersion = overrides.packageVersion === undefined ? String(spec.packageVersion ?? "") : requireValue(overrides.packageVersion, "--package-version");
const packageVersionKey = randomUUID();
const rewritten = {
...parsed,
spec: { ...spec, packageName, packageVersion, packageVersionKey }
};
const zipInput = {};
for (const [entryName, entryBytes] of Object.entries(entries)) {
const level = entryName.toLowerCase().endsWith(".nupkg") ? 0 : 6;
zipInput[entryName] = [entryBytes, { level }];
}
zipInput[SOLUTION_METADATA_ENTRY] = [
strToU8(JSON.stringify(rewritten)),
{ level: 6 }
];
return {
archive: zipSync(zipInput),
packageName,
packageVersion,
packageVersionKey
};
}
// src/services/publish-service.ts
var TERMINAL_STATES = new Set([
"Ready",
"Active",
"Failed"
]);
var VERSION_CONFLICT_PATTERNS = [
/\balready exists\b/i,
/\bduplicate\b.*\bversion\b/i,
/\bversion\b.*\bduplicate\b/i,
/\bpackage[-\s]?version\b.*\bexists\b/i,
/\bversion[-\s]?exists\b/i,
/\bversion\b.*\balready exists\b/i
];
var isVersionConflictError = (message, details) => {
const errorText = `${message} ${details ?? ""}`;
return VERSION_CONFLICT_PATTERNS.some((pattern) => pattern.test(errorText));
};
async function publishSolutionAsync(packagePath, options = {}) {
const [authError, auth] = await catchError(getSolutionAuthContext({
tenant: options.tenant,
loginValidity: options.loginValidity,
envFilePath: options.envFilePath
}));
if (authError) {
return {
ok: false,
reason: "auth_failed",
message: authError.message
};
}
const fs = getFileSystem();
const resolvedPath = fs.path.resolve(packagePath);
if (!await fs.exists(resolvedPath)) {
return {
ok: false,
reason: "file_not_found",
message: `File not found: ${resolvedPath}`
};
}
if (!resolvedPath.endsWith(".zip")) {
const stats = await fs.stat(resolvedPath);
const isSolutionSource = stats?.isDirectory() === true || resolvedPath.endsWith(".uis") || resolvedPath.endsWith(".uipx");
if (isSolutionSource) {
return {
ok: false,
reason: "not_packed",
message: `'${packagePath}' is a solution source, not a packed package. 'publish' uploads the .zip produced by 'solution pack'.`,
details: resolvedPath
};
}
return {
ok: false,
reason: "not_a_zip",
message: `Invalid file type. Expected a .zip file, got: ${resolvedPath}`
};
}
const [fileBufferError, readBuffer] = await catchError(fs.readFile(resolvedPath));
if (fileBufferError) {
const { message } = await extractErrorDetails(fileBufferError);
return {
ok: false,
reason: "file_read_failed",
message,
details: resolvedPath
};
}
if (!readBuffer) {
return {
ok: false,
reason: "file_read_failed",
message: `File is empty or unreadable: ${resolvedPath}`,
details: resolvedPath
};
}
let fileBuffer = readBuffer;
if (options.packageName !== undefined || options.packageVersion !== undefined) {
const [rewriteError, rewritten] = await catchError(Promise.resolve().then(() => rewritePackageMetadata(new Uint8Array(fileBuffer), {
packageName: options.packageName,
packageVersion: options.packageVersion
})));
if (rewriteError || !rewritten) {
return {
ok: false,
reason: "metadata_rewrite_failed",
message: rewriteError?.message ?? "Could not rewrite the package name/version.",
details: resolvedPath
};
}
logger.info(`Publishing ${resolvedPath} as ${rewritten.packageName} ${rewritten.packageVersion} (package version key ${rewritten.packageVersionKey}); the file on disk is unchanged.`);
fileBuffer = rewritten.archive;
}
const [scopeError, scope] = await catchError(resolveFeedScope({
personalWorkspace: options.personalWorkspace,
feed: options.feed,
tenant: options.tenant,
loginValidity: options.loginValidity,
envFilePath: options.envFilePath
}));
if (scopeError) {
return {
ok: false,
reason: options.feed !== undefined ? "feed_resolution_failed" : "personal_workspace_resolution_failed",
message: scopeError.message
};
}
if (scope.kind !== "tenant") {
return publishToFeed(auth, fileBuffer, scope, options);
}
const configuration = new Configuration({
basePath: auth.basePath,
accessToken: auth.accessToken
});
const api = new PipelinesApi(configuration);
const [uploadError, uploadResult] = await catchError(api.pipelinesPackageUpload({ body: fileBuffer }));
if (uploadError) {
return mapUploadError(uploadError);
}
let packageVersionInfo = uploadResult;
if (options.wait) {
const pollResult = await pollUntil({
fn: () => api.pipelinesGetPackageVersion({
packageName: uploadResult.packageName,
packageVersion: uploadResult.packageVersion
}),
until: (result) => TERMINAL_STATES.has(result.state),
getStatus: (result) => result.state,
label: `publish ${uploadResult.packageName}:${uploadResult.packageVersion}`,
logPrefix: "publish",
timeoutMs: (options.timeout ?? 360) * 1000,
intervalMs: options.pollInterval ?? 5000,
signal: options.signal
});
if (pollResult.outcome !== PollOutcome.Completed) {
const { reason, message } = mapPollFailure(pollResult, "Package publish");
return { ok: false, reason, message };
}
if (!pollResult.data) {
return {
ok: false,
reason: "poll_failed",
message: "Package publish did not return a final state."
};
}
packageVersionInfo = pollResult.data;
if (packageVersionInfo.state === "Failed") {
return {
ok: false,
reason: "publish_failed",
message: `Package publish failed with state: ${packageVersionInfo.state}`
};
}
}
return {
ok: true,
packageVersionKey: packageVersionInfo.key,
packageName: packageVersionInfo.packageName,
packageVersion: packageVersionInfo.packageVersion,
state: packageVersionInfo.state,
feedKind: "tenant"
};
}
async function publishToFeed(auth, fileBuffer, scope, options) {
const config = new Configuration2({
basePath: auth.basePath,
accessToken: auth.accessToken
});
const api = new PackagesApi(config);
const [uploadError, packageVersionKey] = await catchError(api.packagesUpload({
body: fileBuffer,
locationKey: scope.folderKey
}));
if (uploadError) {
return mapUploadError(uploadError);
}
const [getError, initialInfo] = await catchError(api.packagesGetVersion({ packageVersionKey }));
if (getError) {
logger.warn(`Package uploaded (key ${packageVersionKey}) but its metadata was not yet retrievable; PackageName/PackageVersion/State will be absent from output: ${getError.message}`);
}
let packageVersionInfo = getError ? undefined : initialInfo;
if (options.wait) {
const pollResult = await pollUntil({
fn: () => api.packagesGetVersion({ packageVersionKey }),
until: (result) => TERMINAL_STATES.has(result.state),
getStatus: (result) => result.state,
label: `publish ${packageVersionInfo ? `${packageVersionInfo.packageName}:${packageVersionInfo.packageVersion}` : packageVersionKey}`,
logPrefix: "publish",
timeoutMs: (options.timeout ?? 360) * 1000,
intervalMs: options.pollInterval ?? 5000,
signal: options.signal
});
if (pollResult.outcome !== PollOutcome.Completed) {
const { reason, message } = mapPollFailure(pollResult, "Package publish");
return { ok: false, reason, message };
}
if (!pollResult.data) {
return {
ok: false,
reason: "poll_failed",
message: "Package publish did not return a final state."
};
}
packageVersionInfo = pollResult.data;
if (packageVersionInfo.state === "Failed") {
return {
ok: false,
reason: "publish_failed",
message: `Package publish failed with state: ${packageVersionInfo.state}`
};
}
}
return {
ok: true,
packageVersionKey: packageVersionInfo?.key ?? packageVersionKey,
packageName: packageVersionInfo?.packageName,
packageVersion: packageVersionInfo?.packageVersion,
state: packageVersionInfo?.state,
feedKind: scope.kind
};
}
async function mapUploadError(uploadError) {
const { message, details, context, retry } = await extractErrorDetails(uploadError);
const fetchCause = uploadError instanceof Error && uploadError.name === "FetchError" && uploadError.cause instanceof Error ? uploadError.cause : null;
const surfacedMessage = fetchCause ? `Failed to upload package: ${fetchCause.message}` : message;
const httpStatus = context?.httpStatus;
let reason = "upload_failed";
if (isVersionConflictError(message, details)) {
reason = "upload_version_conflict";
} else if (fetchCause || httpStatus !== undefined && httpStatus >= 500) {
reason = "upload_network";
} else if (httpStatus === 400 || httpStatus === 422) {
reason = "upload_rejected";
}
return {
ok: false,
reason,
message: surfacedMessage,
details,
errorCode: context?.errorCode,
retry,
context
};
}
export { publishSolutionAsync };
//# debugId=696E04915672C64A64756E2164756E21

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

// ../packager/packager-core/src/services/tools-factory-repository.ts
class ToolsFactoryRepository {
projectFactoryMap = new Map;
solutionFactory = null;
registerProjectToolFactory(factory) {
for (const type of factory.supportedTypes) {
const existing = this.projectFactoryMap.get(type);
if (existing) {
if (existing.constructor?.name !== factory.constructor?.name) {
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
}
continue;
}
this.projectFactoryMap.set(type, factory);
}
}
registerSolutionToolFactory(factory) {
this.solutionFactory = factory;
}
getSolutionToolFactory() {
if (!this.solutionFactory) {
throw new Error("No solution tool factory is registered");
}
return this.solutionFactory;
}
canHandleProject(projectType) {
return this.projectFactoryMap.has(projectType);
}
getProjectToolFactory(projectType) {
const factory = this.projectFactoryMap.get(projectType);
if (!factory) {
throw new Error(`No tool factory found for project type '${projectType}'`);
}
return factory;
}
reset() {
this.projectFactoryMap.clear();
this.solutionFactory = null;
}
}
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
var _global = globalThis;
if (!_global[REGISTRY_KEY]) {
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
}
var toolsFactoryRepository = _global[REGISTRY_KEY];
// ../packager/packager-core/src/models/tool-result.ts
class ToolResult {
errorCode;
message;
packages;
details;
instructions;
constructor(errorCode, message, packages = [], instructions) {
this.errorCode = errorCode;
this.message = message;
this.packages = packages;
this.instructions = instructions;
}
get isSuccess() {
return this.errorCode === "SUCCESS" /* Success */;
}
static success() {
return new ToolResult("SUCCESS" /* Success */);
}
static error(errorCode, message, instructions) {
return new ToolResult(errorCode, message, [], instructions);
}
}
// ../packager/packager-core/src/i18n/types.ts
function isPluralForm(value) {
return typeof value === "object" && value !== null && "other" in value;
}
function selectPluralForm(forms, count) {
if (count === 0 && forms.zero !== undefined) {
return forms.zero;
}
if (count === 1 && forms.one !== undefined) {
return forms.one;
}
if (count === 2 && forms.two !== undefined) {
return forms.two;
}
if (forms.few !== undefined) {
const mod10 = count % 10;
const mod100 = count % 100;
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
return forms.few;
}
}
if (forms.many !== undefined) {
const mod10 = count % 10;
const mod100 = count % 100;
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
return forms.many;
}
}
return forms.other;
}
// ../packager/packager-core/src/i18n/i18n-manager.ts
class I18nManager {
static translations = {};
static currentLocale = "en";
static fallbackLocale = "en";
static registerTranslations(locale, catalog) {
if (!I18nManager.translations[locale]) {
I18nManager.translations[locale] = {};
}
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
}
static setLocale(locale) {
const normalized = I18nManager.normalizeLocale(locale);
if (I18nManager.translations[normalized]) {
I18nManager.currentLocale = normalized;
return normalized;
}
const baseLocale = normalized.split("-")[0];
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
I18nManager.currentLocale = baseLocale;
return baseLocale;
}
return I18nManager.currentLocale;
}
static getLocale() {
return I18nManager.currentLocale;
}
static setFallbackLocale(locale) {
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
}
static t(key, params, locale) {
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
let value = I18nManager.getTranslationValue(key, targetLocale);
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
}
if (value === undefined) {
return key;
}
if (isPluralForm(value) && params && "count" in params) {
const count = typeof params.count === "number" ? params.count : Number(params.count);
value = selectPluralForm(value, count);
} else if (isPluralForm(value)) {
value = value.other;
}
if (typeof value !== "string") {
return key;
}
return params ? I18nManager.interpolate(value, params) : value;
}
static has(key, locale) {
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
const value = I18nManager.getTranslationValue(key, targetLocale);
if (value !== undefined) {
return true;
}
if (targetLocale !== I18nManager.fallbackLocale) {
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
}
return false;
}
static getAvailableLocales() {
return Object.keys(I18nManager.translations);
}
static clearTranslations() {
I18nManager.translations = {};
I18nManager.currentLocale = "en";
}
static getTranslationValue(key, locale) {
const catalog = I18nManager.translations[locale];
if (!catalog) {
return;
}
const keys = key.split(".");
let value = catalog;
for (const k of keys) {
if (value && typeof value === "object" && k in value) {
value = value[k];
} else {
return;
}
}
return value;
}
static interpolate(template, params) {
return template.replace(/\{(\w+)\}/g, (_, key) => {
const value = params[key];
return value !== undefined ? String(value) : `{${key}}`;
});
}
static normalizeLocale(locale) {
const normalized = locale.toLowerCase().replace(/_/g, "-");
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
if (specialLocales.includes(normalized)) {
return normalized;
}
return normalized.split("-")[0];
}
static deepMerge(target, source) {
const result = { ...target };
for (const key of Object.keys(source)) {
const sourceValue = source[key];
const targetValue = result[key];
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
} else {
result[key] = sourceValue;
}
}
return result;
}
}
// ../packager/packager-core/src/i18n/locales/de.ts
var de = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/en.ts
var en = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/es.ts
var es = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/es-MX.ts
var es_MX = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/fr.ts
var fr = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/ja.ts
var ja = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/ko.ts
var ko = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/pt.ts
var pt = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/pt-BR.ts
var pt_BR = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/ro.ts
var ro = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/ru.ts
var ru = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/tr.ts
var tr = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/zh-CN.ts
var zh_CN = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/zh-TW.ts
var zh_TW = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/locales/zu.ts
var zu = {
toolCore: {
errors: {
internal: "Internal error: {message}",
fileNotFound: "File not found: {path}",
fileReadFailed: "Failed to read file: {path}",
fileWriteFailed: "Failed to write file: {path}",
directoryNotFound: "Directory not found: {path}",
invalidPath: "{path} is not a valid path",
operationCanceled: "Operation was canceled",
invalidParameter: "Invalid parameter: {parameter}"
},
progress: {
copying: "Copying files...",
building: "Building project...",
packaging: "Creating package...",
validating: "Validating...",
analyzing: "Analyzing...",
restoring: "Restoring dependencies..."
},
validation: {
requiredField: "{field} is required",
invalidValue: "Invalid value for {field}",
pathNotFound: "Path not found: {path}",
fileRequired: "File is required: {path}",
directoryRequired: "Directory is required: {path}"
},
warnings: {
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
},
info: {
operationComplete: "Operation completed successfully",
filesProcessed: {
zero: "No files processed",
one: "{count} file processed",
other: "{count} files processed"
}
}
}
};
// ../packager/packager-core/src/i18n/translation-service.ts
class TranslationService {
static instance;
currentLocale = "en";
constructor() {}
static getInstance() {
if (!TranslationService.instance) {
TranslationService.instance = new TranslationService;
}
return TranslationService.instance;
}
setLocale(locale) {
this.currentLocale = I18nManager.setLocale(locale);
}
getLocale() {
return this.currentLocale;
}
t(key, params) {
return I18nManager.t(key, params, this.currentLocale);
}
tLocale(key, locale, params) {
return I18nManager.t(key, params, locale);
}
has(key) {
return I18nManager.has(key, this.currentLocale);
}
getAvailableLocales() {
return I18nManager.getAvailableLocales();
}
}
var translate = TranslationService.getInstance();
// ../packager/packager-core/src/i18n/index.ts
I18nManager.registerTranslations("en", en);
I18nManager.registerTranslations("de", de);
I18nManager.registerTranslations("es", es);
I18nManager.registerTranslations("es-mx", es_MX);
I18nManager.registerTranslations("fr", fr);
I18nManager.registerTranslations("ja", ja);
I18nManager.registerTranslations("ko", ko);
I18nManager.registerTranslations("pt", pt);
I18nManager.registerTranslations("pt-br", pt_BR);
I18nManager.registerTranslations("ro", ro);
I18nManager.registerTranslations("ru", ru);
I18nManager.registerTranslations("tr", tr);
I18nManager.registerTranslations("zh-cn", zh_CN);
I18nManager.registerTranslations("zh-tw", zh_TW);
I18nManager.registerTranslations("zu", zu);
I18nManager.setLocale("en");
export { ToolResult, toolsFactoryRepository };
//# debugId=A70248815AC3C8A364756E2164756E21

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

/**
* Register the factories solution-tool owns: the ResourceBuilder *solution*
* factory (essential to every pack; no CLI verb can own it) plus the project
* factories for the types no CLI tool owns — Connector and AppV2. Project
* wrapper tools (flow, agent, case, maestro, api-workflow, function) ship
* their own `packager-tool` entry point and are loaded on demand.
*
* Explicit, not a module-load side effect: `ensurePackagerTools` calls this at
* the start of every pack / restore / cleanup, which is the only code that
* needs the registry. That also means nothing registers twice when a run
* loads more than one tool bundle.
*
* Still a dedicated module (not `tool.ts`) so the browser bundle can exclude
* it via `browser.json` -> excludedImports. These factories pull in Node-only
* packaging deps (`@uipath/resource-builder-tool` has no browser export).
*
* The ResourceBuilder solution tool is owned by the consumer (here, the CLI),
* so `@uipath/solution-packager` doesn't pin its
* `@uipath/resource-builder-tool` version.
*/
export declare function registerPackagerFactories(): void;
/** Which feed a publish/deploy/query is scoped to. */
export type FeedKind = "tenant" | "personal" | "folder";
export interface FeedScope {
kind: FeedKind;
/**
* Folder key used as the `X-UIPATH-FolderKey` header (queries/deploy) and
* the upload `locationKey`. Undefined for the tenant feed (no header — the
* default that keeps folders-with-own-feed visible in tenant queries).
*/
folderKey?: string;
/** Feed name when known — for messages and telemetry. */
name?: string;
}
/**
* Build the `initOverride` that scopes a solution-sdk search call to a feed via
* the `X-UIPATH-FolderKey` header, or `undefined` for the tenant feed (no
* header — the default that keeps folders-with-own-feed visible in tenant
* queries). Merges with the SDK's computed headers so Authorization survives.
*/
export declare function feedScopeInitOverride(scope: FeedScope): ((context: {
init: RequestInit;
}) => {
headers: HeadersInit;
}) | undefined;
export interface ResolveFeedScopeOptions {
/** Target the caller's own Personal Workspace feed. */
personalWorkspace?: boolean;
/** Target a feed by its name or folder key (from `solution feeds list`). */
feed?: string;
tenant?: string;
loginValidity?: number;
envFilePath?: string;
}
/**
* Turn the CLI feed flags into a validated {@link FeedScope} — the single
* choke point every feed-aware command uses.
*
* - neither flag → tenant feed (no key).
* - `personalWorkspace` → the caller's own PW (resolved via Orchestrator).
* - `feed` → matched (by folder key or name) against the available publish
* locations ({@link listSelectablePublishLocations}, which already drops
* explored/not-owned PWs). An unknown or non-selectable feed is rejected —
* we never send a raw, unvalidated key to an upload/deploy/query.
*/
export declare function resolveFeedScope(options: ResolveFeedScopeOptions): Promise<FeedScope>;
import type { PackCommandOptions } from "../models";
/**
* What to do about a rejected governance option. Pairs with the message
* {@link validateGovernanceOptions} returns, which names the offending flag —
* so this stays actionable without repeating it.
*/
export declare const GOVERNANCE_OPTION_INSTRUCTIONS: string;
/**
* Check the governance options, returning an error message or `null` when they
* are usable.
*
* Neither flag has a meaningful empty value — no file lives at `""` and no
* AutomationOps policy is published for product `""` — so a blank one is a
* mistake worth reporting rather than a request to analyze with the default
* rules. Callers detect presence with `!== undefined` so an empty string is
* never silently downgraded to "no governance flag"; this is what turns that
* value into an error instead.
*
* Returns the message rather than throwing because the two callers report
* failures differently: the command builds an `OutputFormatter.error` envelope,
* while `executeAsync` returns a `ToolResult` and never throws for an expected
* failure. Owning the wording here keeps the two paths from drifting apart.
*/
export declare function validateGovernanceOptions(options: Pick<PackCommandOptions, "governanceFilePath" | "automationOpsProfile">): string | null;
/** Root entry of a packed solution `.zip` that carries the solution package identity. */
export declare const SOLUTION_METADATA_ENTRY = "solutionMetadata.json";
export interface PackageMetadataOverrides {
/** New solution package name. Omit to keep the archive's name. */
packageName?: string;
/** New solution package version. Omit to keep the archive's version. */
packageVersion?: string;
}
export interface PackageMetadataRewriteResult {
/** The re-zipped archive, ready to upload. */
archive: Uint8Array;
/** Package name after the rewrite. */
packageName: string;
/** Package version after the rewrite. */
packageVersion: string;
/** Freshly minted `spec.packageVersionKey` — see the note in `rewritePackageMetadata`. */
packageVersionKey: string;
}
/**
* Re-stamp the solution package identity of an already-packed `.zip` and return
* the rewritten archive. Backs `solution publish --package-name/--package-version`,
* which exists because the solution feed rejects duplicate `name+version` pairs
* and a caller who only has the `.zip` (a build artifact, a fixture, a package
* downloaded with `packages download`) cannot re-pack it.
*
* Only `solutionMetadata.json` carries the solution-level name and version. The
* project packages bundled under `files/` keep their own identities — they are
* addressed by `resources.json` / `configurations/**` through their own
* `<project>.<type>.<project>:<version>` keys, which are independent of the
* solution package's name and version. So this rewrite deliberately touches one
* entry and copies everything else through byte-for-byte.
*
* `spec.packageVersionKey` is always regenerated. The feed honors the key from
* the archive verbatim, so carrying the source package's key over would file the
* re-stamped package under the same version record as the original — two
* differently-named packages sharing one `PackageVersionKey`. A fresh uuid is
* also what `solution pack` produces for every pack.
*
* @throws when the archive is not readable as a zip, has no root
* `solutionMetadata.json`, or that entry is not the expected JSON shape.
*/
export declare function rewritePackageMetadata(archive: Uint8Array, overrides: PackageMetadataOverrides): PackageMetadataRewriteResult;
import { type PublishLocationV2 } from "@uipath/solution-sdk";
export interface PublishLocationsAuthOptions {
/** Minimum minutes before token expiration to trigger a refresh. */
loginValidity?: number;
/**
* The deprecated `--tenant` override, when the calling command accepts it.
* Studio Web calls can't switch tenants — the tenant rides as a GUID
* header taken from the stored auth — so a value that differs from the
* logged-in tenant is rejected loudly instead of silently resolving
* feeds for the wrong tenant.
*/
tenant?: string;
/** Pin auth to this exact `.uipath/.auth` path. */
envFilePath?: string;
}
/**
* True when a publish location is a valid target for the current user.
*
* Allow-list, failing closed. Tenant and folder feeds are selectable; a
* personal workspace only when it is the caller's own — an *explored*
* (someone else's) PW must never be a publish, deploy, or query target.
* This is the cross-tenant / cross-user isolation boundary, so anything
* unrecognized (`type === "Unknown"`) is also rejected: it could be an
* explored PW under a type label we don't know yet.
*/
export declare function isSelectableFeed(location: PublishLocationV2): boolean;
/**
* List the feeds (publish locations) the current user can publish/deploy to.
* Explored (not-owned) personal workspaces are removed.
*/
export declare function listSelectablePublishLocations(options?: PublishLocationsAuthOptions): Promise<PublishLocationV2[]>;
/**
* Fails the pack early when any AppV2 CodedAction project in the solution is
* missing its `action-schema.json`. Without the schema the packed resource
* spec ships an empty `actionSchema`, and downstream flows that reference the
* action (e.g. a BPMN user task picker) render no inputs / outputs / outcomes.
*
* Only checks CodedAction (`webAppManifest.config.isActionApp === true`).
* Regular Coded apps have no action schema by design.
*/
export declare function validateAppV2ActionSchemas(solutionDir: string): Promise<void>;
+11
-6

@@ -6,10 +6,15 @@ /**

* Also re-exports `addProjectArtifactsToSolutionAsync` so `*-tool init` paths
* (flow, maestro, agent, case) can generate the `resources/solution_folder/process/<kind>/`
* artifact-resource entries that `uip solution project add` produces. Without
* this step, init succeeds but `solution pack` would later miss the artifact
* resources, forcing a `solution project remove` + `add` recovery cycle.
* (flow, maestro, agent, case, codedapp) can generate the
* `resources/solution_folder/process/<kind>/` artifact-resource entries that
* `uip solution project add` produces. Without this step, init succeeds but
* `solution pack` would later miss the artifact resources, forcing a
* `solution project remove` + `add` recovery cycle.
*
* Runtime contract: the tools load this entry through `ensureToolModule`
* (`@uipath/common`) instead of bundling it — renaming this entry or its
* exports breaks them with no compile error.
*/
export type { AddProjectArtifactsOptions, ProjectArtifactsResult, } from "./services/project-artifacts-service";
export { addProjectArtifactsToSolutionAsync } from "./services/project-artifacts-service";
export type { AddProjectArtifactsOptions, ProjectArtifactsResult, } from "@uipath/solution-sdk/resources";
export { addProjectArtifactsToSolutionAsync } from "@uipath/solution-sdk/resources";
export type { SolutionInitOptions, SolutionInitResult, SolutionInitStage, } from "./services/solution-init-service";
export { SolutionInitError, solutionInitAsync, } from "./services/solution-init-service";

@@ -40,2 +40,22 @@ import type { PackageMetadataFields } from "@uipath/common";

signingTimestampServer?: string;
/**
* Skip the workflow analyzer for every project in the solution. The
* WorkflowCompiler still compiles and validates; only the analyzer rules
* are not run.
*/
skipAnalyze?: boolean;
/**
* Path to a local governance policy file to analyze against. Selects the
* packager's `Studio` rules-config source. Mutually exclusive with
* `automationOpsProfile`.
*/
governanceFilePath?: string;
/**
* Product whose governance policy is downloaded from AutomationOps for the
* signed-in tenant (e.g. `StudioWeb`, `Development`, `Business`). Setting
* it selects the packager's `AutomationOps` rules-config source. Mutually
* exclusive with `governanceFilePath`; with neither set the analyzer uses
* the rules shipped with the WorkflowCompiler.
*/
automationOpsProfile?: string;
}

@@ -5,4 +5,8 @@ /**

* `ResourceRefreshResult`. Mirrors `./init` / `./pack` / `./publish` / `./deploy`.
*
* Runtime contract: flow-tool's debug path loads this entry through
* `ensureToolModule` (`@uipath/common`) instead of bundling it — renaming this
* entry or its exports breaks it with no compile error.
*/
export type { ResourceRefreshFailure, ResourceRefreshFailureReason, ResourceRefreshOptions, ResourceRefreshResult, ResourceRefreshSuccess, } from "./services/resource-refresh-service";
export { resourceRefreshAsync } from "./services/resource-refresh-service";
export type { ResourceRefreshFailure, ResourceRefreshFailureReason, ResourceRefreshOptions, ResourceRefreshResult, ResourceRefreshSuccess, } from "@uipath/solution-sdk/resources";
export { resourceRefreshAsync } from "@uipath/solution-sdk/resources";
import { type PollUntilResult } from "@uipath/common";
import type { DeploymentStatus } from "@uipath/pipelines-sdk";
import type { DeploymentSearchItemDto2 } from "@uipath/solution-sdk";
import type { SolutionAuthContext } from "./auth-helper";
import type { DeploymentSearchItemDto2, SolutionAuthContext } from "@uipath/solution-sdk";
export type ActivationOptions = {

@@ -6,0 +5,0 @@ timeoutSeconds: number;

@@ -28,3 +28,3 @@ /**

}
export type ListDeploymentsFailureReason = "auth_failed" | "folder_resolution_failed" | "list_request_failed";
export type ListDeploymentsFailureReason = "auth_failed" | "folder_resolution_failed" | "feed_resolution_failed" | "list_request_failed";
/** Local mirror of solution-sdk's `OrderByDirection`; declared here so the `.d.ts` stays off the SDK type. */

@@ -41,2 +41,6 @@ export type SortDirection = "Ascending" | "Descending";

folderKey?: string;
/** Scope the list to the caller's own Personal Workspace feed. */
personalWorkspace?: boolean;
/** Scope the list to a feed by name or folder key. Mutually exclusive with `personalWorkspace`. */
feed?: string;
/** Max deployments to fetch. Default `DEFAULT_PAGE_SIZE`. */

@@ -43,0 +47,0 @@ limit?: number;

@@ -0,5 +1,12 @@

import { type FeedScope } from "./feed-resolver";
/** Discriminator for {@link DeployFailure}; library callers can ignore the tag and read `.message`/`.instructions`. */
export type DeployFailureReason = "auth_failed" | "folder_resolution_failed" | "config_file_not_found" | "config_file_read_failed" | "config_file_parse_failed" | "install_request_failed"
/** Personal Workspace deploy via AS auto-deploy failed (publish first, then retry). */
/** Personal Workspace deploy via AS auto-install failed (publish first, then retry). */
| "personal_workspace_deploy_failed"
/** A --feed value couldn't be resolved to a selectable feed. */
| "feed_resolution_failed"
/** Folder-feed deploy via AS auto-install failed (publish to the feed first, then retry). */
| "feed_deploy_failed"
/** The requested deploy location isn't the feed folder or one of its descendants. */
| "location_outside_feed"
/**

@@ -48,2 +55,4 @@ * Redeploy blocked: a deployment for this solution already exists (HTTP 400

personalWorkspace?: boolean;
/** Deploy a package from a specific feed (name or folder key). Mutually exclusive with `personalWorkspace`. */
feed?: string;
/** Path to a JSON / YAML configuration file. */

@@ -66,9 +75,9 @@ configFile?: string;

* Tenant path: `"DeploymentSucceeded"` after polling reaches terminal.
* PW path: `"DeploymentStarted"` — the AS auto-deploy endpoint returns
* at request acceptance, before terminal state is observable.
* Feed/PW path: `"DeploymentStarted"` — the AS auto-install endpoint
* returns at request acceptance, before terminal state is observable.
*/
status: string;
/** Tenant only — populated from Pipelines install result. PW returns no key. */
/** Tenant only — populated from Pipelines install result. Feed/PW returns no key. */
deploymentKey?: string | null;
/** Tenant only — Pipelines deployment id. Undefined for PW (no Pipelines call). */
/** Tenant only — Pipelines deployment id. Undefined for feed/PW (no Pipelines call). */
pipelineDeploymentId?: string;

@@ -79,12 +88,22 @@ /** Allows `null` so `"InstanceId": null` reaches JSON output when the SDK reports null. */

folderPath: string;
/** "SuccessfulActivate" | "Skipped" | "NoInstance" — short canonical token. PW path emits `"Auto"`. */
/**
* Set only when the deployment did NOT land in the folder the caller asked
* for. Orchestrator collision-renames a taken solution-root name rather
* than reusing the folder, so `--folder-name MySolution` can silently
* become `MySolution 1` (UV-15346). Carries the requested name so the
* caller can see both.
*/
requestedFolderName?: string;
/** "SuccessfulActivate" | "Skipped" | "NoInstance" — short canonical token. Feed/PW path emits `"Auto"` (server-side activation) or `"Skipped"`. */
activationStatus: string;
/** PW only — server-assigned auto-name (`AutoDeploy-<solution>`). */
/** Feed/PW only — the caller-chosen deployment name (`--name`). */
deploymentName?: string;
/** PW only — package name as deployed. */
/** Feed/PW only — package name as deployed. */
packageName?: string;
/** PW only — package version as deployed. */
/** Feed/PW only — package version as deployed. */
packageVersion?: string;
/** PW only — future-tense human guidance ("Check status with..."). */
/** Feed/PW only — future-tense human guidance ("Check status with..."). */
nextSteps?: string;
/** Which feed the deploy targeted — drives telemetry `target`. Defaults to tenant. */
feedKind?: FeedScope["kind"];
}

@@ -91,0 +110,0 @@ export interface DeployFailure {

import type { PipelineDeploymentResult, PipelineDeploymentStatus } from "@uipath/pipelines-sdk";
import type { DeploymentOperationStatus, DeploymentSearchItemDto2, InitOverrideFunction } from "@uipath/solution-sdk";
import type { SolutionAuthContext } from "./auth-helper";
import type { DeploymentOperationStatus, DeploymentSearchItemDto2, InitOverrideFunction, SolutionAuthContext } from "@uipath/solution-sdk";
/**

@@ -9,3 +8,3 @@ * Look up a deployment by name in the persistent search/list service.

*
* Throws on transport / server errors. Use {@link findDeploymentForError}
* Throws on transport / server errors. Use {@link findDeploymentBestEffort}
* when you want a best-effort lookup that swallows failures.

@@ -23,6 +22,8 @@ */

/**
* Best-effort lookup for use in error-handling paths — returns undefined on
* any failure instead of propagating, so it never masks the original error.
* Best-effort deployment lookup: returns undefined on any failure instead of
* propagating, so callers can read the record opportunistically — without
* masking a prior error (error paths) or blocking an otherwise-successful
* result (success paths, e.g. reading back the resolved install folder).
*/
export declare function findDeploymentForError(auth: SolutionAuthContext, deploymentName: string): Promise<DeploymentSearchItemDto2 | undefined>;
export declare function findDeploymentBestEffort(auth: SolutionAuthContext, deploymentName: string): Promise<DeploymentSearchItemDto2 | undefined>;
/**

@@ -88,1 +89,40 @@ * Append a hint to error instructions when the deployment in question is

export declare function deploymentToTerminalPipelineResult(deployment: DeploymentSearchItemDto2): PipelineDeploymentResult | undefined;
/**
* Orchestrator collision-renames the requested solution root folder when the
* name is already taken — deploying with `--folder-name MySolution` while a
* `MySolution` folder exists lands the deployment in `MySolution 1`. The
* Pipelines status DTO doesn't carry the resolved folder, so `deploy run`
* reads it back from the search record (the same source `deploy list` reports)
* to surface where the deployment actually landed rather than echoing the
* requested name (UV-15393).
*
* `installedRootFolderName` cannot be trusted for that: the search record
* echoes the *requested* name back, not the folder the deployment landed in.
* Verified on alpha — a deployment living in `<name> 3` reported
* `installedRootFolderName: "<name>"` alongside
* `installedRootFolderKey: <key of "<name> 3">`. Reading the name alone is
* what made a collision-renamed deployment look like it went where the caller
* asked (UV-15346).
*
* So the key wins: when `installedRootFolderKey` is present and
* `resolveFolderByKey` can resolve it, that is the answer. The name is only a
* fallback for records that carry no key.
*
* Best-effort throughout: when the record is missing, carries neither a key
* nor a name, or the key lookup fails, fall back to the requested folder so a
* miss never corrupts otherwise-correct output. `requestedMatched` reports
* whether the deployment really landed on the requested name, so callers can
* say so when it did not.
*/
export declare function resolveInstalledFolder(deployment: DeploymentSearchItemDto2 | undefined, requested: {
folderName: string;
folderPath: string;
parentFolderPath?: string;
}, resolveFolderByKey?: (folderKey: string) => Promise<{
name?: string;
path?: string;
} | undefined>): Promise<{
folderName: string;
folderPath: string;
requestedMatched: boolean;
}>;

@@ -25,1 +25,24 @@ /**

}): Promise<string | undefined>;
/**
* Resolve a folder to its full identity — key plus canonical FQN — from
* --parent-folder-path or --parent-folder-key.
*
* Unlike {@link resolveParentFolder}, which passes a --parent-folder-path
* through verbatim (the tenant Pipelines install takes an FQN and validates
* server-side), this always hits the Folders API: feed deploys need the
* location folder's *key* for the auto-install request's
* `installationFolderKey` — the server creates the solution folder under that
* key, so sending the wrong one silently installs in the wrong place.
*
* Returns `undefined` when neither option was provided.
*/
export declare function resolveFolderInfo(options: {
folderPath?: string;
folderKey?: string;
tenant?: string;
loginValidity?: number;
envFilePath?: string;
}): Promise<{
key: string;
path: string;
} | undefined>;
import type { IFileSystem } from "@uipath/filesystem";
/**
* Reads project types from the .uipx, checks toolsFactoryRepository for
* unhandled types, and installs the corresponding CLI tools.
* Puts every factory this pack needs in `toolsFactoryRepository`: registers
* the ones solution-tool owns, then reads project types from the .uipx and
* loads the owning CLI tool (installing it if missing) for each type nothing
* handles yet.
*
* This is the only place that registers — no tool registers at module load —
* so a run that loads several tool bundles never registers the same factory
* twice.
*/
export declare function ensurePackagerTools(solutionDir: string, fs: IFileSystem): Promise<void>;

@@ -21,3 +21,3 @@ import type { SortDirection } from "./deploy-list-service";

}
export type ListPackagesFailureReason = "auth_failed" | "list_request_failed";
export type ListPackagesFailureReason = "auth_failed" | "feed_resolution_failed" | "list_request_failed";
export interface ListPackagesOptions {

@@ -38,2 +38,6 @@ /** Override the active tenant for auth. The CLI's deprecated `--tenant` flag flows through here. */

name?: string;
/** Scope the list to the caller's own Personal Workspace feed. */
personalWorkspace?: boolean;
/** Scope the list to a feed by name or folder key. Mutually exclusive with `personalWorkspace`. */
feed?: string;
/** Minimum minutes before token expiration to trigger a refresh. Default 10. */

@@ -40,0 +44,0 @@ loginValidity?: number;

@@ -1,3 +0,3 @@

import type { SolutionAuthContext } from "./auth-helper";
export interface PersonalWorkspaceDeployResult {
import type { SolutionAuthContext } from "@uipath/solution-sdk/auth";
export interface FeedDeployResult {
deploymentName: string;

@@ -8,22 +8,43 @@ packageName: string;

}
export interface FeedDeployParams {
packageName: string;
packageVersion: string;
/** Caller-chosen deployment name (`deploy run --name`). */
deploymentName: string;
/** Name of the new Orchestrator folder created for the deployment (`--folder-name`). */
solutionRootFolderName: string;
/** Leave the deployment inactive instead of activating right after install. */
skipActivate?: boolean;
}
export interface FeedDeployTarget {
/** Folder key of the feed the package lives in — scopes the package lookup
* and the deploy via the `X-UIPATH-FolderKey` header. */
feedFolderKey: string;
/** Folder key of the location the deployment installs into (the feed
* folder itself or a validated descendant). The server creates the
* solution root folder *under this key* — passing the feed key for a
* descendant location silently installs in the feed root. */
locationFolderKey: string;
/** FQN of that same location — recorded as the deployment's path, so it
* must agree with `locationFolderKey`. */
locationFQN: string;
}
/**
* Deploy a Personal-Workspace-feed solution package via the Automation
* Solutions auto-deploy endpoint.
* Deploy a feed-scoped solution package via the Automation Solutions
* v2 auto-install endpoint.
*
* The tenant `deploy run` path (Pipelines `deploy-from-package`) resolves the
* package from the tenant feed and cannot see a PW-feed package. This path
* uses the feed-aware `POST /api/deployments/deploy` endpoint instead:
* - the PW folder key scopes both the package lookup and the deploy (header
* `X-UIPATH-FolderKey`);
* - `overwrites: []` lets the server apply the package's default resource
* configuration (no caller-side overwrite computation);
* - the endpoint auto-names the deployment `AutoDeploy-<solution>` and
* auto-activates — matching Studio Web's PW autoDeploy behavior.
* package from the tenant feed and cannot see a package published to a folder
* or Personal Workspace feed. This path uses the feed-aware
* `POST /api/v2/deployments/auto-install` endpoint instead (the same call
* Studio Web makes for a deploy-only flow):
* - `target.feedFolderKey` scopes the package lookup and the deploy;
* - `target.locationFolderKey` / `target.locationFQN` say where the solution
* root folder is created (the feed folder or a descendant, already
* validated by the caller);
* - `deploymentName` / `solutionRootFolderName` are honored — unlike the
* older `POST /api/deployments/deploy`, which auto-named the deployment
* `AutoDeploy-<solution>`;
* - the server activates right after install unless `skipActivate` is set.
*/
export declare function deployToPersonalWorkspace(auth: SolutionAuthContext, params: {
packageName: string;
packageVersion: string;
}, options?: {
tenant?: string;
loginValidity?: number;
}): Promise<PersonalWorkspaceDeployResult>;
export declare function deployToFeed(auth: SolutionAuthContext, target: FeedDeployTarget, params: FeedDeployParams): Promise<FeedDeployResult>;

@@ -0,3 +1,5 @@

import { type ErrorContext, type RetryHint } from "@uipath/common";
import { type FeedScope } from "./feed-resolver";
/** Discriminator for {@link PublishFailure}; library callers can ignore the tag and read `.message` / `.ok`. */
export type PublishFailureReason = "auth_failed" | "file_not_found" | "not_a_zip" | "not_packed" | "file_read_failed" | "personal_workspace_resolution_failed" | "upload_failed" | "upload_version_conflict" | "upload_network" | "poll_timeout" | "poll_failed" | "poll_aborted" | "publish_failed";
export type PublishFailureReason = "auth_failed" | "file_not_found" | "not_a_zip" | "not_packed" | "file_read_failed" | "metadata_rewrite_failed" | "personal_workspace_resolution_failed" | "feed_resolution_failed" | "upload_failed" | "upload_rejected" | "upload_version_conflict" | "upload_network" | "poll_timeout" | "poll_failed" | "poll_aborted" | "publish_failed";
export interface PublishOptions {

@@ -10,2 +12,12 @@ /** Override the active tenant for auth resolution. The CLI's deprecated `--tenant` flag flows through here. */

personalWorkspace?: boolean;
/** Upload into a feed by its name or folder key, instead of the tenant feed. Mutually exclusive with `personalWorkspace`. */
feed?: string;
/**
* Publish the archive under this package name instead of the one it was
* packed with. Rewrites `solutionMetadata.json` in memory before upload;
* the `.zip` on disk is left untouched.
*/
packageName?: string;
/** Publish the archive under this package version. Same rewrite as `packageName`. */
packageVersion?: string;
/** Wait until the published package reaches a terminal state. Default `false`. */

@@ -37,2 +49,4 @@ wait?: boolean;

state?: string;
/** Which feed the package landed in — drives telemetry `target`. */
feedKind: FeedScope["kind"];
}

@@ -46,2 +60,14 @@ export interface PublishFailure {

details?: string;
/**
* The service's machine-readable error code, verbatim (e.g. the Solution
* Feed's `"1205"` for a package with no entry points). Populated for
* `upload_rejected`; surfaced so users and agents can act on codes the CLI
* has never seen — the CLI deliberately does not map codes to meanings,
* that table belongs to the service (SOL-7550).
*/
errorCode?: string;
/** Stable retry guidance from the shared classifier (upload failures only). */
retry?: RetryHint;
/** Machine-readable context (httpStatus, service errorCode, requestId) for the envelope's `Context`. */
context?: ErrorContext;
}

@@ -48,0 +74,0 @@ export type PublishResult = PublishSuccess | PublishFailure;

@@ -68,3 +68,3 @@ # UiPath Solution Workspace

| `AppV2` | Coded App — web application | `uip codedapp init <path>` | `uipath-coded-apps` |
| `Function` | UiPath Function (JS / TS / Python) | `uip functions new [name]` | none |
| `Function` | UiPath Function (JS / TS / Python) | `uip function new [name]` | none |
| `Api` | API Workflow project | `uip api-workflow init <name>` | none |

@@ -143,2 +143,16 @@ | `Connector` | Integration Service connector | no CLI scaffolding — use `uip is connectors` to list / get / export existing connectors | none |

## Workflow Analyzer and Governance
`solution pack` runs the workflow analyzer over every RPA project. Two things control it:
```bash
uip solution pack . ./out --skip-analyze # don't run the analyzer at all
uip solution pack . ./out --governance-file-path ./policy.json # analyze against a local policy file
uip solution pack . ./out --automation-ops-profile StudioWeb # analyze against the tenant policy
```
`--skip-analyze` turns off only the analyzer rules — the compiler still restores, compiles, and validates, so a broken project still fails the pack.
The analyzer rule configuration comes from whichever governance flag you use. `--governance-file-path` reads a local policy file. `--automation-ops-profile` downloads the policy published in AutomationOps for the signed-in tenant; its value is the product to fetch (`StudioWeb`, `Development`, `Business`, …). With neither flag the analyzer uses the rules shipped with the WorkflowCompiler. The two are mutually exclusive. If the tenant policy can't be fetched — no session, or nothing published — the pack falls back to the shipped rules instead of failing.
## Studio Web (Browser Editing)

@@ -229,3 +243,3 @@

1. **Never redirect or drop stderr.** Errors and confirmations go to stderr — `2>/dev/null` will silently hide failures and produce false retries.
2. **Use `--output-filter <jmespath>`** to extract specific fields rather than piping JSON through external tools. The expression is applied to the `Data` array — start with `[]`, not with `Data[]`. Example: `uip solution packages list --output-filter "[].name"`.
2. **Use `--output-filter <jmespath>`** to extract specific fields rather than piping JSON through external tools. The expression is applied to the `Data` array — start with `[]`, not with `Data[]`. On list commands with a default `--limit`, an explicit `--limit` is required with `--output-filter` (the filter only sees the records fetched). Example: `uip solution packages list --limit 100 --output-filter "[].name"`.

@@ -261,3 +275,3 @@ Standard success shape: `{ "Result": "Success", "Code": "<CommandCode>", "Data": ... }`.

| `uip codedapp` | Coded Apps lifecycle |
| `uip functions` | UiPath Functions |
| `uip function` | UiPath Functions |
| `uip tm` | Test Manager (test projects, sets, executions) |

@@ -264,0 +278,0 @@ | `uip is` | Integration Service (connectors, connections) |

{
"name": "@uipath/solution-tool",
"license": "MIT",
"version": "1.199.0-preview.108",
"version": "1.200.0-preview.109",
"description": "Create, pack, publish, and deploy UiPath Automation Solutions.",

@@ -21,2 +21,3 @@ "repository": {

".": "./dist/tool.js",
"./packager-tool": "./dist/packager-tool.js",
"./init": {

@@ -50,3 +51,3 @@ "types": "./dist/init.d.ts",

"private": false,
"gitHead": "171f68daab68809916e8df10ea198c259f688ede"
"gitHead": "fcc01cdae81bbd0c25d3d4fc287537a9d19d99f4"
}
import type { ExtendedPackageVersionState } from "@uipath/pipelines-sdk";
export declare const LOGIN_INSTRUCTIONS = "Run `uip login` to authenticate.";
export declare const PACKAGE_READY_STATES: ReadonlySet<ExtendedPackageVersionState>;
export declare function getPackageStateInstructions(state: ExtendedPackageVersionState): "Wait until package processing completes, then run the command again." | "Check the solution package contents and publish it again.";
import type { Command } from "commander";
export declare const registerProjectAddCommand: (project: Command) => void;
import type { Command } from "commander";
export declare const registerProjectImportCommand: (project: Command) => void;
import type { Command } from "commander";
export declare const registerProjectListCommand: (project: Command) => void;
import type { Command } from "commander";
export declare const registerProjectPublishCommand: (project: Command) => void;
import type { Command } from "commander";
export declare const registerProjectRemoveCommand: (project: Command) => void;
import { type Command } from "commander";
export declare const registerProjectResyncCommand: (project: Command) => void;
export interface ProjectFileContent {
Name?: string;
ProjectType?: string;
designOptions?: {
outputType?: string;
};
functions?: Record<string, string>;
}
export interface SolutionProject {
Type: string;
ProjectRelativePath: string;
Id: string;
}
export interface SolutionFileContent {
Projects?: SolutionProject[];
}
export interface ProjectFileInfo {
filePath: string;
fileName: string;
useProjectJson: boolean;
}
export interface ParsedProjectFile {
content: ProjectFileContent;
projectType: string;
}
export interface ParsedSolutionFile {
solution: SolutionFileContent;
rawContent: string;
}
/**
* Finds the project manifest inside a directory, in priority order:
* project.uiproj, project.json, then uipath.json (code-first JS/TS Functions).
*/
export declare function findProjectFile(projectDir: string): Promise<[Error, null] | [null, ProjectFileInfo]>;
/**
* Reads and parses a project manifest, extracting the project type.
*/
export declare function readProjectFile(filePath: string, useProjectJson: boolean): Promise<[Error, null] | [null, ParsedProjectFile]>;
/**
* Reads and parses a solution .uipx file.
* Returns both the parsed object and the raw content (for rollback).
*/
export declare function readSolutionFile(filePath: string): Promise<[Error, null] | [null, ParsedSolutionFile]>;
/**
* Resolves the solution file path — either from an explicit option or by searching upward.
*/
export declare function resolveSolutionFilePath(solutionFileOption: string | undefined, searchStartDir: string): Promise<[Error, null] | [null, string]>;
/**
* Writes the solution object back to disk as formatted JSON.
*/
export declare function writeSolutionFile(filePath: string, solution: SolutionFileContent): Promise<Error | null>;
/**
* Restores the exact solution file content captured before a write.
*/
export declare function restoreSolutionFile(filePath: string, rawContent: string): Promise<Error | null>;
/**
* Creates a project in the solution builder (resource builder services).
* Handles service init, builder creation, createProjectAsync, and dispose.
*/
export declare function createProjectInSolutionBuilder(solutionDir: string, projectId: string, projectName: string, projectType: string): Promise<Error | null>;
import type { Command } from "commander";
export declare function findSolutionFile(startDir: string): Promise<string>;
export declare const registerProjectCommand: (program: Command) => void;
import type { IFileStorageProvider, IFileStorageProviderFactory, ISolutionContext } from "@uipath/resource-builder-sdk";
/**
* Factory for creating FileSystemFileStorageProvider instances.
*/
export declare class FileSystemFileStorageProviderFactory implements IFileStorageProviderFactory {
getProviderAsync(context: ISolutionContext, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
getProviderByPathAsync(basePath: string, _cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
getCurrentUserProfileProviderAsync(context: ISolutionContext, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
getUserProfileProviderAsync(context: ISolutionContext, userId: string, _cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
getCurrentUserProfileProviderByPathAsync(basePath: string, cancellationToken?: AbortSignal): Promise<IFileStorageProvider>;
}
import { type IResourceBuilderServices } from "@uipath/resource-builder-sdk";
/**
* Creates a configured ResourceBuilderServices instance for CLI usage.
* Uses SolutionAccessProvider which maps SDK service scopes to full
* tenant-scoped gateway URLs, enabling server-side SDK operations
* (updateConfigurationAsync, addOrUpdateResourceToSolutionAsync, etc.).
*
* `EntryPointSpecEnhancer` is registered so artefact resources (resources
* with a `projectKey`) reflect the latest `entry-points.json` from disk at
* read time, instead of the snapshot captured at `solution projects add`.
*/
export declare function createResourceBuilderServices(): Promise<IResourceBuilderServices>;
import type { AuthenticationInfo, IAccessProvider } from "@uipath/resource-builder-sdk";
/**
* IAccessProvider that maps SDK service scopes to full tenant-scoped URLs.
* Unlike CliAccessProvider (which returns bare baseUrl), this builds the correct
* gateway paths that the resource-builder-sdk expects for server-side operations.
*/
export declare class SolutionAccessProvider implements IAccessProvider {
private loginStatus;
private userKey;
private getStatus;
getResourceUrlAsync(scope: string, _cancellationToken?: AbortSignal): Promise<string | null>;
getResourceUrlWithAuthAsync(scope: string, _authInfo: AuthenticationInfo, _cancellationToken?: AbortSignal): Promise<string | null>;
getAccessTokenAsync(_scopes: string[], _force?: boolean, _cancellationToken?: AbortSignal): Promise<string | null>;
getUserKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
getTenantKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
getAccountKeyAsync(_cancellationToken?: AbortSignal): Promise<string | null>;
isGatewayIntegrationEnabled(): boolean;
}
export interface SolutionAuthContext {
accessToken: string;
basePath: string;
organizationId: string;
tenantName: string;
}
export declare function getSolutionAuthContext(options: {
tenant?: string;
loginValidity?: number;
/** Pin auth to this exact `.uipath/.auth` path (forwarded to
* `getAuthContext`) instead of resolving from `process.cwd()`. */
envFilePath?: string;
}): Promise<SolutionAuthContext>;
import { type IFileSystem } from "@uipath/filesystem";
import type { IArtifactResourceSpecEnhancer, ISolutionContext, ResourceDefinition, ResourcePropertyMetadata } from "@uipath/resource-builder-sdk";
/**
* Reads the project's `entry-points.json` at GET time and projects the primary
* entry points onto the resource spec, so consumers see the current on-disk
* state — not the snapshot captured at `solution projects add`.
*
* Mirrors the shape Studio Web returns from its process configuration
* endpoint: `entryPoints` always carries the raw `entry-points.json` text;
* `entryPointName` / `entryPointUniqueId` are populated only when the project
* has exactly one entry, and are explicit `null` for multi-entry or empty
* projects.
*
* Read-only by design: never mutates the on-disk resource JSON. Spec
* degradation (missing/malformed file) is swallowed so `resource get` stays
* functional.
*/
export declare class EntryPointSpecEnhancer implements IArtifactResourceSpecEnhancer {
private readonly fs;
constructor(fs?: IFileSystem);
enhanceSpecAsync(context: ISolutionContext, resource: ResourceDefinition, _propertiesMetadata: Map<string, ResourcePropertyMetadata>, spec: Map<string, unknown>, _cancellationToken?: AbortSignal): Promise<void>;
private applyEntryPointAsync;
private findSolutionFileAsync;
}
/**
* Applies `EntryPointSpecEnhancer` against a plain-object spec returned by the
* SDK's `getConfigurationAsync` path. Used by `resource get` until the SDK
* invokes `enhanceSpecAsync` itself from `GetMappedResourceConfigurationRequestHandler`;
* once that lands this becomes a redundant no-op for the same on-disk state.
*/
export declare function applyEntryPointEnhancementAsync(context: ISolutionContext, resource: ResourceDefinition, spec: Record<string, unknown>): Promise<Record<string, unknown>>;
import type { ResourceDefinition } from "@uipath/resource-builder-sdk";
/**
* Pure, dependency-free matching primitives for local solution resources.
* A leaf module on purpose: `sync-resources-from-bindings` and
* `resource-mutations` both re-export from here (so existing callers keep
* their import paths), while `commands/resource-add.ts` imports it directly —
* which lets its spec run the REAL matcher without mocking this module.
*/
/**
* Normalize a folder path for comparisons. `.` and `solution_folder` both
* encode "no folder" (tenant/root scope) — collapsing them to undefined lets
* us compare a binding's folder against an existing resource's folder
* consistently regardless of which placeholder either side carries.
*/
export declare function normalizeFolderPath(path: string | undefined): string | undefined;
/**
* Find a solution resource matching (kind, name | name_<N>, normalized
* folder). Kind + name are compared case-insensitively; the suffix variants
* match because SDK's `addResourceWithUniqueName` may have suffixed an
* earlier add/import of the same name. With a solution-relative `folderPath`
* (`.` / `solution_folder` / undefined) only root-scope resources match.
*
* Single source of truth for "does an in-solution resource already cover
* this (kind, name, folder)?" — used by the refresh import guard (UV-15289),
* the virtual idempotency check, and `resources add --source local`.
*/
export declare function findMatchingLocalResource(resources: ResourceDefinition[], kind: string, name: string, folderPath: string | undefined): ResourceDefinition | undefined;
export interface AddProjectArtifactsOptions {
/** Absolute path to the solution directory (containing the `.uipx`). */
solutionDir: string;
/** Stable project key — must match the `Id` in `.uipx` `Projects[]`. */
projectId: string;
/** Display name for the project; typically the project folder name. */
projectName: string;
/**
* Project type as written to `project.uiproj` (e.g. `Flow`,
* `ProcessOrchestration`, `Agent`, `CaseManagement`). Normalized internally
* via `normalizeProjectType` so callers can pass the raw value.
*/
projectType: string;
}
export interface ProjectArtifactsResult {
/** True when artifact resources were generated. */
Created: boolean;
/** Error message when `Created` is `false`. */
Error?: string;
}
/**
* Generate `resources/solution_folder/process/<kind>/` artifact-resource
* entries for a project that has just been registered in the parent
* solution's `.uipx`. Mirrors the second half of `uip solution project add`
* (after the manifest write), so `*-tool init` paths can produce the same
* complete on-disk state without requiring a follow-up
* `solution project remove` + `add` cycle.
*
* Returns a result envelope instead of throwing: the project files have
* already been created by the init caller, so a failure here is recoverable
* with `solution project remove` + `add`. Callers surface the result in
* their success envelope as `Data.ProjectArtifacts`.
*/
export declare function addProjectArtifactsToSolutionAsync(options: AddProjectArtifactsOptions): Promise<ProjectArtifactsResult>;
/** Discriminator for {@link ResourceRefreshFailure}; library callers can ignore the tag and read `.message` / `.ok`. */
export type ResourceRefreshFailureReason = "solution_not_found" | "not_a_solution" | "auth_failed" | "sync_failed";
export interface ResourceRefreshOptions {
/** Minimum minutes before token expiration to trigger a refresh. Default `10` (matches the CLI's `--login-validity`). */
loginValidity?: number;
/** Pin auth to this exact `.uipath/.auth` path. */
envFilePath?: string;
}
export interface ResourceRefreshSuccess {
ok: true;
/** Resources newly created (virtualized) in the solution this run. */
created: number;
/** Resources imported from Orchestrator into the solution this run. */
imported: number;
/** Bindings whose cloud key was already in the solution (no-op this run). */
skipped: number;
/** Non-fatal advisories (e.g. unresolved connections, link-before-deploy hints). */
warnings: string[];
}
export interface ResourceRefreshFailure {
ok: false;
reason: ResourceRefreshFailureReason;
/** Human-readable summary suitable for top-level surfacing. */
message: string;
}
export type ResourceRefreshResult = ResourceRefreshSuccess | ResourceRefreshFailure;
/**
* Programmatic core of `uip solution resources refresh`: re-scans every project's
* `bindings_v2.json` and syncs resource declarations into the solution, importing
* from Orchestrator when a match exists and virtualizing the rest. Returns a tagged
* {@link ResourceRefreshResult}; re-throws only on unexpected errors. Mirrors
* `./pack` / `./publish` / `./deploy`.
*/
export declare function resourceRefreshAsync(solutionPath?: string, options?: ResourceRefreshOptions): Promise<ResourceRefreshResult>;
/**
* Throw if `dir` doesn't directly contain a `.uipx` manifest. Stricter than
* `findSolutionFile` (which walks up to find one) — write commands should not
* silently mutate the wrong folder when run from an arbitrary cwd.
*
* Lives in `services/` (not `commands/project.ts`) so callers can mock the
* check without pulling in the full project-commands module.
*/
export declare function assertSolutionManifest(dir: string): Promise<void>;
import { type IResourceBuilderServices, type ISolutionBuilder, type ResourceDefinition } from "@uipath/resource-builder-sdk";
interface RequiredPropertyDefault {
property: string;
/** Empty placeholder value matching the property's declared type. */
placeholder: unknown;
}
interface ResolvedKindMetadata {
/** Subtype to pass to createVirtualResourceAsync (e.g. "StringAsset"). */
type?: string;
/** SDK's `supportsInLineCreation` — whether a virtual stub can be created. */
virtualizable: boolean;
/**
* Required spec properties that have no default in SDK metadata. Deploy
* validation rejects virtualized resources missing these (e.g. Asset.value).
* We fill them in-memory after `createVirtualResourceAsync` with a
* type-appropriate placeholder.
*/
requiredDefaults: RequiredPropertyDefault[];
}
export { findMatchingLocalResource, normalizeFolderPath, } from "./local-resource-matcher";
interface SyncResult {
created: number;
imported: number;
skipped: number;
warnings: string[];
}
/**
* Reads bindings_v2.json from project paths and creates/imports matching
* resources in the solution using the resource-builder-sdk.
*
* @param solutionDir - Path to the solution directory
* @param projectPaths - Specific project paths to scan (if omitted, scans all projects in .uipx)
*/
export declare function syncResourcesFromBindings(solutionDir: string, projectPaths?: string[]): Promise<SyncResult>;
/**
* Mirror of SDK's private `addResourceWithUniqueName`
* (resource-builder-sdk index.js:673): if any other resource of the same
* kind already carries `name` (or a `name_<N>` suffix variant), return
* `name_<N+1>`. Otherwise return `name` unchanged. Excludes `excludeKey`
* so the resource we just created doesn't collide with itself.
*/
export declare function uniqueNameForResource(name: string, kind: string, excludeKey: string, solution: {
resources: Array<{
key: string;
kind?: string;
name?: string;
}>;
}): string;
export interface RcsMatch {
key: string;
name: string;
/** Subtype as RCS reports it (e.g. `Text` for Asset). `undefined` for
* kinds without a subtype (Queue). Callers may need to forward this to
* `addOrUpdateResourceToSolutionAsync`, which rejects type-less imports
* for kinds that SDK metadata indexes by (kind, type). */
type?: string;
folder?: {
fullyQualifiedName: string;
folderKey: string;
path?: string;
};
}
/**
* Find a resource in RCS by key (UUID). RCS's `SearchFolderEntities` endpoint
* has no key-based filter — only `name`/`entityTypes`/`entitySubTypes`. We
* paginate all resources of this kind and filter locally by key, exiting
* early on the match. Used for connections, whose binding carries the UUID
* directly via `bindingKey`.
*/
export declare function findResourceByKeyInRcs(builder: ISolutionBuilder, kind: string, expectedKey: string, folderPath?: string, propagateErrors?: boolean): Promise<RcsMatch | undefined>;
/**
* Page through RCS for a given (kind, name) and collect every match. Returns
* an empty array on lookup error (logged as a warning). Callers decide what
* to do with 0/1/many matches.
*/
export declare function searchRcsResources(builder: ISolutionBuilder, kind: string, name: string): Promise<RcsMatch[]>;
export declare function findResourceInRcs(builder: ISolutionBuilder, kind: string, name: string, folderPath?: string): Promise<RcsMatch | undefined>;
/**
* Resolve a resource kind's metadata via the SDK (`kind`, optional `type`) so
* callers outside the bindings sync can fill required spec defaults the same
* way `createVirtualForBinding` does. Returns undefined if the kind isn't
* indexed by SDK metadata.
*/
export declare function resolveResourceKindMetadata(services: IResourceBuilderServices, kind: string, type?: string): Promise<ResolvedKindMetadata | undefined>;
export interface CreateLocalResourceParams {
builder: ISolutionBuilder;
services: IResourceBuilderServices;
kind: string;
type?: string;
name: string;
folderPath?: string;
}
export interface CreateLocalResourceResult {
resource: ResourceDefinition;
/** Final name on the resource — may differ from input if SDK conflict suffix kicked in. */
finalName: string;
}
/**
* Create a virtual (local-only) resource via the SDK and rename it to `name`,
* mirroring the rename + spec-default flow `createVirtualForBinding` runs
* during refresh. Returns the freshly created `SolutionResource` after the
* mutation, or undefined if the SDK failed to allocate a key.
*
* Callers must:
* - Persist the change (e.g. `builder.disposeAsync()` or
* `context.saveAsync()`); this helper only mutates in-memory state.
* - Have already done an idempotency check — this helper *always* creates,
* and SDK's `addResourceWithUniqueName` will suffix the name on conflict.
*/
export declare function createLocalResource(params: CreateLocalResourceParams): Promise<CreateLocalResourceResult | undefined>;
export interface UipxProject {
/** Project type as written in `.uipx` (e.g. "Agent", "Process"). */
type: string;
/** Design-time UUID used as `projectKey` in reconcile. */
id: string;
/** Path to the project directory (parent of `project.uiproj`). */
path: string;
/** Project name read from `project.uiproj` (`Name` field). */
name: string;
}
/**
* Read solution's `.uipx` and each project's `project.uiproj` to assemble the
* data needed for `reconcileProjectsAsync`. Without this, sync would only see
* resource bindings (Queue/Asset/etc.) and miss the project artefacts
* (process/<type>, package, app/<subType>, appVersion) the SDK generates from
* project templates.
*/
export declare function readUipxProjects(solutionDir: string): Promise<UipxProject[]>;
/**
* Sync resources from bindings with logging. Non-fatal — logs warnings
* on failure and continues. Used by pack and upload before packaging.
*/
export declare function syncAndLog(solutionDir: string): Promise<void>;
export declare const parsePositiveInt: (optionName: string) => ((raw: string) => number);
import { type PollUntilResult } from "@uipath/common";
/**
* Handle a non-completed pollUntil result — emit error output and set exit code.
*
* Shared by deploy-run, deploy-activate, and deploy-uninstall to avoid
* duplicating the outcome→message→exitCode mapping in each command.
*
* @returns `true` if the result was non-completed (error was emitted),
* `false` if completed with data (caller should continue).
*/
export declare function handlePollFailure<T>(pollResult: PollUntilResult<T>, noun: string, instructions: string): boolean;

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

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

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

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