@uipath/codedapp-tool 1.203.0-preview.203 → 1.204.0-preview.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./packager-tool-qyctya2j.js";
3
+ } from "./packager-tool-0v3s8r01.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __require,
@@ -2116,6 +2116,1817 @@ var {
2116
2116
  Help
2117
2117
  } = import__.default;
2118
2118
 
2119
+ // ../packager/packager-core/src/services/tools-factory-repository.ts
2120
+ class ToolsFactoryRepository {
2121
+ projectFactoryMap = new Map;
2122
+ solutionFactory = null;
2123
+ registerProjectToolFactory(factory) {
2124
+ for (const type of factory.supportedTypes) {
2125
+ const existing = this.projectFactoryMap.get(type);
2126
+ if (existing) {
2127
+ if (existing.constructor?.name !== factory.constructor?.name) {
2128
+ console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
2129
+ }
2130
+ continue;
2131
+ }
2132
+ this.projectFactoryMap.set(type, factory);
2133
+ }
2134
+ }
2135
+ registerSolutionToolFactory(factory) {
2136
+ this.solutionFactory = factory;
2137
+ }
2138
+ getSolutionToolFactory() {
2139
+ if (!this.solutionFactory) {
2140
+ throw new Error("No solution tool factory is registered");
2141
+ }
2142
+ return this.solutionFactory;
2143
+ }
2144
+ canHandleProject(projectType) {
2145
+ return this.projectFactoryMap.has(projectType);
2146
+ }
2147
+ getProjectToolFactory(projectType) {
2148
+ const factory = this.projectFactoryMap.get(projectType);
2149
+ if (!factory) {
2150
+ throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
2151
+ }
2152
+ return factory;
2153
+ }
2154
+ reset() {
2155
+ this.projectFactoryMap.clear();
2156
+ this.solutionFactory = null;
2157
+ }
2158
+ }
2159
+ var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
2160
+ var _global = globalThis;
2161
+ if (!_global[REGISTRY_KEY]) {
2162
+ _global[REGISTRY_KEY] = new ToolsFactoryRepository;
2163
+ }
2164
+ var toolsFactoryRepository = _global[REGISTRY_KEY];
2165
+
2166
+ // ../packager/packager-core/src/filesystem/path.ts
2167
+ class Path {
2168
+ static normalize(path) {
2169
+ return path.replace(/\\/g, "/").replace(/\/+/g, "/");
2170
+ }
2171
+ static join(...segments) {
2172
+ return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
2173
+ }
2174
+ static dirname(path) {
2175
+ const normalized = Path.normalize(path).replace(/\/$/, "");
2176
+ if (normalized === "")
2177
+ return ".";
2178
+ const lastSlash = normalized.lastIndexOf("/");
2179
+ if (lastSlash === -1)
2180
+ return ".";
2181
+ if (lastSlash === 0)
2182
+ return "/";
2183
+ return normalized.substring(0, lastSlash);
2184
+ }
2185
+ static basename(path) {
2186
+ const normalized = Path.normalize(path).replace(/\/$/, "");
2187
+ if (normalized === "")
2188
+ return "";
2189
+ const lastSlash = normalized.lastIndexOf("/");
2190
+ return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
2191
+ }
2192
+ static extname(path) {
2193
+ const base = Path.basename(path);
2194
+ const lastDot = base.lastIndexOf(".");
2195
+ if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
2196
+ return "";
2197
+ }
2198
+ return base.substring(lastDot);
2199
+ }
2200
+ static async walkDirectory(fs, rootPath, currentRelativePath = "") {
2201
+ const entries = [];
2202
+ const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
2203
+ const items = await fs.readdir(absolutePath);
2204
+ for (const item of items) {
2205
+ const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
2206
+ const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
2207
+ const stat = await fs.stat(itemAbsolutePath);
2208
+ if (stat?.isDirectory()) {
2209
+ const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
2210
+ entries.push(...subEntries);
2211
+ } else if (stat?.isFile()) {
2212
+ entries.push({
2213
+ relativePath: Path.normalize(itemRelativePath),
2214
+ absolutePath: Path.normalize(itemAbsolutePath)
2215
+ });
2216
+ }
2217
+ }
2218
+ return entries;
2219
+ }
2220
+ }
2221
+
2222
+ // ../packager/packager-core/src/models/nuget-constants.ts
2223
+ var NugetConstants = {
2224
+ OutputFolderName: "bundle",
2225
+ ContentFolderName: "content",
2226
+ OperateFileName: "operate.json",
2227
+ EntryPointsFileName: "entry-points.json",
2228
+ PackageDescriptorFileName: "package-descriptor.json",
2229
+ BindingsV2FileName: "bindings_v2.json",
2230
+ BindingsFileId: "bindings.json"
2231
+ };
2232
+ // ../../node_modules/fflate/esm/index.mjs
2233
+ import { createRequire } from "module";
2234
+ var require2 = createRequire("/");
2235
+ var _a;
2236
+ var Worker;
2237
+ var isMarkedAsUntransferable;
2238
+ try {
2239
+ _a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
2240
+ } catch (e) {}
2241
+ var u8 = Uint8Array;
2242
+ var u16 = Uint16Array;
2243
+ var i32 = Int32Array;
2244
+ 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]);
2245
+ 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]);
2246
+ var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
2247
+ var freb = function(eb, start) {
2248
+ var b = new u16(31);
2249
+ for (var i = 0;i < 31; ++i) {
2250
+ b[i] = start += 1 << eb[i - 1];
2251
+ }
2252
+ var r = new i32(b[30]);
2253
+ for (var i = 1;i < 30; ++i) {
2254
+ for (var j = b[i];j < b[i + 1]; ++j) {
2255
+ r[j] = j - b[i] << 5 | i;
2256
+ }
2257
+ }
2258
+ return { b, r };
2259
+ };
2260
+ var _a = freb(fleb, 2);
2261
+ var fl = _a.b;
2262
+ var revfl = _a.r;
2263
+ fl[28] = 258, revfl[258] = 28;
2264
+ var _b = freb(fdeb, 0);
2265
+ var fd = _b.b;
2266
+ var revfd = _b.r;
2267
+ var rev = new u16(32768);
2268
+ for (i = 0;i < 32768; ++i) {
2269
+ x = (i & 43690) >> 1 | (i & 21845) << 1;
2270
+ x = (x & 52428) >> 2 | (x & 13107) << 2;
2271
+ x = (x & 61680) >> 4 | (x & 3855) << 4;
2272
+ rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
2273
+ }
2274
+ var x;
2275
+ var i;
2276
+ var hMap = function(cd, mb, r) {
2277
+ var s = cd.length;
2278
+ var i2 = 0;
2279
+ var l = new u16(mb);
2280
+ for (;i2 < s; ++i2) {
2281
+ if (cd[i2])
2282
+ ++l[cd[i2] - 1];
2283
+ }
2284
+ var le = new u16(mb);
2285
+ for (i2 = 1;i2 < mb; ++i2) {
2286
+ le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
2287
+ }
2288
+ var co;
2289
+ if (r) {
2290
+ co = new u16(1 << mb);
2291
+ var rvb = 15 - mb;
2292
+ for (i2 = 0;i2 < s; ++i2) {
2293
+ if (cd[i2]) {
2294
+ var sv = i2 << 4 | cd[i2];
2295
+ var r_1 = mb - cd[i2];
2296
+ var v = le[cd[i2] - 1]++ << r_1;
2297
+ for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
2298
+ co[rev[v] >> rvb] = sv;
2299
+ }
2300
+ }
2301
+ }
2302
+ } else {
2303
+ co = new u16(s);
2304
+ for (i2 = 0;i2 < s; ++i2) {
2305
+ if (cd[i2]) {
2306
+ co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
2307
+ }
2308
+ }
2309
+ }
2310
+ return co;
2311
+ };
2312
+ var flt = new u8(288);
2313
+ for (i = 0;i < 144; ++i)
2314
+ flt[i] = 8;
2315
+ var i;
2316
+ for (i = 144;i < 256; ++i)
2317
+ flt[i] = 9;
2318
+ var i;
2319
+ for (i = 256;i < 280; ++i)
2320
+ flt[i] = 7;
2321
+ var i;
2322
+ for (i = 280;i < 288; ++i)
2323
+ flt[i] = 8;
2324
+ var i;
2325
+ var fdt = new u8(32);
2326
+ for (i = 0;i < 32; ++i)
2327
+ fdt[i] = 5;
2328
+ var i;
2329
+ var flm = /* @__PURE__ */ hMap(flt, 9, 0);
2330
+ var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
2331
+ var shft = function(p) {
2332
+ return (p + 7) / 8 | 0;
2333
+ };
2334
+ var slc = function(v, s, e) {
2335
+ if (s == null || s < 0)
2336
+ s = 0;
2337
+ if (e == null || e > v.length)
2338
+ e = v.length;
2339
+ return new u8(v.subarray(s, e));
2340
+ };
2341
+ var ec = [
2342
+ "unexpected EOF",
2343
+ "invalid block type",
2344
+ "invalid length/literal",
2345
+ "invalid distance",
2346
+ "stream finished",
2347
+ "no stream handler",
2348
+ ,
2349
+ "no callback",
2350
+ "invalid UTF-8 data",
2351
+ "extra field too long",
2352
+ "date not in range 1980-2099",
2353
+ "filename too long",
2354
+ "stream finishing",
2355
+ "invalid zip data"
2356
+ ];
2357
+ var err = function(ind, msg, nt) {
2358
+ var e = new Error(msg || ec[ind]);
2359
+ e.code = ind;
2360
+ if (Error.captureStackTrace)
2361
+ Error.captureStackTrace(e, err);
2362
+ if (!nt)
2363
+ throw e;
2364
+ return e;
2365
+ };
2366
+ var wbits = function(d, p, v) {
2367
+ v <<= p & 7;
2368
+ var o = p / 8 | 0;
2369
+ d[o] |= v;
2370
+ d[o + 1] |= v >> 8;
2371
+ };
2372
+ var wbits16 = function(d, p, v) {
2373
+ v <<= p & 7;
2374
+ var o = p / 8 | 0;
2375
+ d[o] |= v;
2376
+ d[o + 1] |= v >> 8;
2377
+ d[o + 2] |= v >> 16;
2378
+ };
2379
+ var hTree = function(d, mb) {
2380
+ var t = [];
2381
+ for (var i2 = 0;i2 < d.length; ++i2) {
2382
+ if (d[i2])
2383
+ t.push({ s: i2, f: d[i2] });
2384
+ }
2385
+ var s = t.length;
2386
+ var t2 = t.slice();
2387
+ if (!s)
2388
+ return { t: et, l: 0 };
2389
+ if (s == 1) {
2390
+ var v = new u8(t[0].s + 1);
2391
+ v[t[0].s] = 1;
2392
+ return { t: v, l: 1 };
2393
+ }
2394
+ t.sort(function(a, b) {
2395
+ return a.f - b.f;
2396
+ });
2397
+ t.push({ s: -1, f: 25001 });
2398
+ var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
2399
+ t[0] = { s: -1, f: l.f + r.f, l, r };
2400
+ while (i1 != s - 1) {
2401
+ l = t[t[i0].f < t[i22].f ? i0++ : i22++];
2402
+ r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
2403
+ t[i1++] = { s: -1, f: l.f + r.f, l, r };
2404
+ }
2405
+ var maxSym = t2[0].s;
2406
+ for (var i2 = 1;i2 < s; ++i2) {
2407
+ if (t2[i2].s > maxSym)
2408
+ maxSym = t2[i2].s;
2409
+ }
2410
+ var tr = new u16(maxSym + 1);
2411
+ var mbt = ln(t[i1 - 1], tr, 0);
2412
+ if (mbt > mb) {
2413
+ var i2 = 0, dt = 0;
2414
+ var lft = mbt - mb, cst = 1 << lft;
2415
+ t2.sort(function(a, b) {
2416
+ return tr[b.s] - tr[a.s] || a.f - b.f;
2417
+ });
2418
+ for (;i2 < s; ++i2) {
2419
+ var i2_1 = t2[i2].s;
2420
+ if (tr[i2_1] > mb) {
2421
+ dt += cst - (1 << mbt - tr[i2_1]);
2422
+ tr[i2_1] = mb;
2423
+ } else
2424
+ break;
2425
+ }
2426
+ dt >>= lft;
2427
+ while (dt > 0) {
2428
+ var i2_2 = t2[i2].s;
2429
+ if (tr[i2_2] < mb)
2430
+ dt -= 1 << mb - tr[i2_2]++ - 1;
2431
+ else
2432
+ ++i2;
2433
+ }
2434
+ for (;i2 >= 0 && dt; --i2) {
2435
+ var i2_3 = t2[i2].s;
2436
+ if (tr[i2_3] == mb) {
2437
+ --tr[i2_3];
2438
+ ++dt;
2439
+ }
2440
+ }
2441
+ mbt = mb;
2442
+ }
2443
+ return { t: new u8(tr), l: mbt };
2444
+ };
2445
+ var ln = function(n, l, d) {
2446
+ return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
2447
+ };
2448
+ var lc = function(c) {
2449
+ var s = c.length;
2450
+ while (s && !c[--s])
2451
+ ;
2452
+ var cl = new u16(++s);
2453
+ var cli = 0, cln = c[0], cls = 1;
2454
+ var w = function(v) {
2455
+ cl[cli++] = v;
2456
+ };
2457
+ for (var i2 = 1;i2 <= s; ++i2) {
2458
+ if (c[i2] == cln && i2 != s)
2459
+ ++cls;
2460
+ else {
2461
+ if (!cln && cls > 2) {
2462
+ for (;cls > 138; cls -= 138)
2463
+ w(32754);
2464
+ if (cls > 2) {
2465
+ w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
2466
+ cls = 0;
2467
+ }
2468
+ } else if (cls > 3) {
2469
+ w(cln), --cls;
2470
+ for (;cls > 6; cls -= 6)
2471
+ w(8304);
2472
+ if (cls > 2)
2473
+ w(cls - 3 << 5 | 8208), cls = 0;
2474
+ }
2475
+ while (cls--)
2476
+ w(cln);
2477
+ cls = 1;
2478
+ cln = c[i2];
2479
+ }
2480
+ }
2481
+ return { c: cl.subarray(0, cli), n: s };
2482
+ };
2483
+ var clen = function(cf, cl) {
2484
+ var l = 0;
2485
+ for (var i2 = 0;i2 < cl.length; ++i2)
2486
+ l += cf[i2] * cl[i2];
2487
+ return l;
2488
+ };
2489
+ var wfblk = function(out, pos, dat) {
2490
+ var s = dat.length;
2491
+ var o = shft(pos + 2);
2492
+ out[o] = s & 255;
2493
+ out[o + 1] = s >> 8;
2494
+ out[o + 2] = out[o] ^ 255;
2495
+ out[o + 3] = out[o + 1] ^ 255;
2496
+ for (var i2 = 0;i2 < s; ++i2)
2497
+ out[o + i2 + 4] = dat[i2];
2498
+ return (o + 4 + s) * 8;
2499
+ };
2500
+ var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
2501
+ wbits(out, p++, final);
2502
+ ++lf[256];
2503
+ var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
2504
+ var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
2505
+ var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
2506
+ var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
2507
+ var lcfreq = new u16(19);
2508
+ for (var i2 = 0;i2 < lclt.length; ++i2)
2509
+ ++lcfreq[lclt[i2] & 31];
2510
+ for (var i2 = 0;i2 < lcdt.length; ++i2)
2511
+ ++lcfreq[lcdt[i2] & 31];
2512
+ var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
2513
+ var nlcc = 19;
2514
+ for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
2515
+ ;
2516
+ var flen = bl + 5 << 3;
2517
+ var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
2518
+ var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
2519
+ if (bs >= 0 && flen <= ftlen && flen <= dtlen)
2520
+ return wfblk(out, p, dat.subarray(bs, bs + bl));
2521
+ var lm, ll, dm, dl;
2522
+ wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
2523
+ if (dtlen < ftlen) {
2524
+ lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
2525
+ var llm = hMap(lct, mlcb, 0);
2526
+ wbits(out, p, nlc - 257);
2527
+ wbits(out, p + 5, ndc - 1);
2528
+ wbits(out, p + 10, nlcc - 4);
2529
+ p += 14;
2530
+ for (var i2 = 0;i2 < nlcc; ++i2)
2531
+ wbits(out, p + 3 * i2, lct[clim[i2]]);
2532
+ p += 3 * nlcc;
2533
+ var lcts = [lclt, lcdt];
2534
+ for (var it = 0;it < 2; ++it) {
2535
+ var clct = lcts[it];
2536
+ for (var i2 = 0;i2 < clct.length; ++i2) {
2537
+ var len = clct[i2] & 31;
2538
+ wbits(out, p, llm[len]), p += lct[len];
2539
+ if (len > 15)
2540
+ wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
2541
+ }
2542
+ }
2543
+ } else {
2544
+ lm = flm, ll = flt, dm = fdm, dl = fdt;
2545
+ }
2546
+ for (var i2 = 0;i2 < li; ++i2) {
2547
+ var sym = syms[i2];
2548
+ if (sym > 255) {
2549
+ var len = sym >> 18 & 31;
2550
+ wbits16(out, p, lm[len + 257]), p += ll[len + 257];
2551
+ if (len > 7)
2552
+ wbits(out, p, sym >> 23 & 31), p += fleb[len];
2553
+ var dst = sym & 31;
2554
+ wbits16(out, p, dm[dst]), p += dl[dst];
2555
+ if (dst > 3)
2556
+ wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
2557
+ } else {
2558
+ wbits16(out, p, lm[sym]), p += ll[sym];
2559
+ }
2560
+ }
2561
+ wbits16(out, p, lm[256]);
2562
+ return p + ll[256];
2563
+ };
2564
+ var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
2565
+ var et = /* @__PURE__ */ new u8(0);
2566
+ var dflt = function(dat, lvl, plvl, pre, post, st) {
2567
+ var s = st.z || dat.length;
2568
+ var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
2569
+ var w = o.subarray(pre, o.length - post);
2570
+ var lst = st.l;
2571
+ var pos = (st.r || 0) & 7;
2572
+ if (lvl) {
2573
+ if (pos)
2574
+ w[0] = st.r >> 3;
2575
+ var opt = deo[lvl - 1];
2576
+ var n = opt >> 13, c = opt & 8191;
2577
+ var msk_1 = (1 << plvl) - 1;
2578
+ var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
2579
+ var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
2580
+ var hsh = function(i3) {
2581
+ return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
2582
+ };
2583
+ var syms = new i32(25000);
2584
+ var lf = new u16(288), df = new u16(32);
2585
+ var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
2586
+ for (;i2 + 2 < s; ++i2) {
2587
+ var hv = hsh(i2);
2588
+ var imod = i2 & 32767, pimod = head[hv];
2589
+ prev[imod] = pimod;
2590
+ head[hv] = imod;
2591
+ if (wi <= i2) {
2592
+ var rem = s - i2;
2593
+ if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
2594
+ pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
2595
+ li = lc_1 = eb = 0, bs = i2;
2596
+ for (var j = 0;j < 286; ++j)
2597
+ lf[j] = 0;
2598
+ for (var j = 0;j < 30; ++j)
2599
+ df[j] = 0;
2600
+ }
2601
+ var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
2602
+ if (rem > 2 && hv == hsh(i2 - dif)) {
2603
+ var maxn = Math.min(n, rem) - 1;
2604
+ var maxd = Math.min(32767, i2);
2605
+ var ml = Math.min(258, rem);
2606
+ while (dif <= maxd && --ch_1 && imod != pimod) {
2607
+ if (dat[i2 + l] == dat[i2 + l - dif]) {
2608
+ var nl = 0;
2609
+ for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
2610
+ ;
2611
+ if (nl > l) {
2612
+ l = nl, d = dif;
2613
+ if (nl > maxn)
2614
+ break;
2615
+ var mmd = Math.min(dif, nl - 2);
2616
+ var md = 0;
2617
+ for (var j = 0;j < mmd; ++j) {
2618
+ var ti = i2 - dif + j & 32767;
2619
+ var pti = prev[ti];
2620
+ var cd = ti - pti & 32767;
2621
+ if (cd > md)
2622
+ md = cd, pimod = ti;
2623
+ }
2624
+ }
2625
+ }
2626
+ imod = pimod, pimod = prev[imod];
2627
+ dif += imod - pimod & 32767;
2628
+ }
2629
+ }
2630
+ if (d) {
2631
+ syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
2632
+ var lin = revfl[l] & 31, din = revfd[d] & 31;
2633
+ eb += fleb[lin] + fdeb[din];
2634
+ ++lf[257 + lin];
2635
+ ++df[din];
2636
+ wi = i2 + l;
2637
+ ++lc_1;
2638
+ } else {
2639
+ syms[li++] = dat[i2];
2640
+ ++lf[dat[i2]];
2641
+ }
2642
+ }
2643
+ }
2644
+ for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
2645
+ syms[li++] = dat[i2];
2646
+ ++lf[dat[i2]];
2647
+ }
2648
+ pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
2649
+ if (!lst) {
2650
+ st.r = pos & 7 | w[pos / 8 | 0] << 3;
2651
+ pos -= 7;
2652
+ st.h = head, st.p = prev, st.i = i2, st.w = wi;
2653
+ }
2654
+ } else {
2655
+ for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
2656
+ var e = i2 + 65535;
2657
+ if (e >= s) {
2658
+ w[pos / 8 | 0] = lst;
2659
+ e = s;
2660
+ }
2661
+ pos = wfblk(w, pos + 1, dat.subarray(i2, e));
2662
+ }
2663
+ st.i = s;
2664
+ }
2665
+ return slc(o, 0, pre + shft(pos) + post);
2666
+ };
2667
+ var crct = /* @__PURE__ */ function() {
2668
+ var t = new Int32Array(256);
2669
+ for (var i2 = 0;i2 < 256; ++i2) {
2670
+ var c = i2, k = 9;
2671
+ while (--k)
2672
+ c = (c & 1 && -306674912) ^ c >>> 1;
2673
+ t[i2] = c;
2674
+ }
2675
+ return t;
2676
+ }();
2677
+ var crc = function() {
2678
+ var c = -1;
2679
+ return {
2680
+ p: function(d) {
2681
+ var cr = c;
2682
+ for (var i2 = 0;i2 < d.length; ++i2)
2683
+ cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
2684
+ c = cr;
2685
+ },
2686
+ d: function() {
2687
+ return ~c;
2688
+ }
2689
+ };
2690
+ };
2691
+ var dopt = function(dat, opt, pre, post, st) {
2692
+ if (!st) {
2693
+ st = { l: 1 };
2694
+ if (opt.dictionary) {
2695
+ var dict = opt.dictionary.subarray(-32768);
2696
+ var newDat = new u8(dict.length + dat.length);
2697
+ newDat.set(dict);
2698
+ newDat.set(dat, dict.length);
2699
+ dat = newDat;
2700
+ st.w = dict.length;
2701
+ }
2702
+ }
2703
+ 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);
2704
+ };
2705
+ var mrg = function(a, b) {
2706
+ var o = {};
2707
+ for (var k in a)
2708
+ o[k] = a[k];
2709
+ for (var k in b)
2710
+ o[k] = b[k];
2711
+ return o;
2712
+ };
2713
+ var wbytes = function(d, b, v) {
2714
+ for (;v; ++b)
2715
+ d[b] = v, v >>>= 8;
2716
+ };
2717
+ function deflateSync(data, opts) {
2718
+ return dopt(data, opts || {}, 0, 0);
2719
+ }
2720
+ var fltn = function(d, p, t, o) {
2721
+ for (var k in d) {
2722
+ var val = d[k], n = p + k, op = o;
2723
+ if (Array.isArray(val))
2724
+ op = mrg(o, val[1]), val = val[0];
2725
+ if (ArrayBuffer.isView(val))
2726
+ t[n] = [val, op];
2727
+ else {
2728
+ t[n += "/"] = [new u8(0), op];
2729
+ fltn(val, n, t, o);
2730
+ }
2731
+ }
2732
+ };
2733
+ var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
2734
+ var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
2735
+ var tds = 0;
2736
+ try {
2737
+ td.decode(et, { stream: true });
2738
+ tds = 1;
2739
+ } catch (e) {}
2740
+ function strToU8(str, latin1) {
2741
+ if (latin1) {
2742
+ var ar_1 = new u8(str.length);
2743
+ for (var i2 = 0;i2 < str.length; ++i2)
2744
+ ar_1[i2] = str.charCodeAt(i2);
2745
+ return ar_1;
2746
+ }
2747
+ if (te)
2748
+ return te.encode(str);
2749
+ var l = str.length;
2750
+ var ar = new u8(str.length + (str.length >> 1));
2751
+ var ai = 0;
2752
+ var w = function(v) {
2753
+ ar[ai++] = v;
2754
+ };
2755
+ for (var i2 = 0;i2 < l; ++i2) {
2756
+ if (ai + 5 > ar.length) {
2757
+ var n = new u8(ai + 8 + (l - i2 << 1));
2758
+ n.set(ar);
2759
+ ar = n;
2760
+ }
2761
+ var c = str.charCodeAt(i2);
2762
+ if (c < 128 || latin1)
2763
+ w(c);
2764
+ else if (c < 2048)
2765
+ w(192 | c >> 6), w(128 | c & 63);
2766
+ else if (c > 55295 && c < 57344)
2767
+ 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);
2768
+ else
2769
+ w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
2770
+ }
2771
+ return slc(ar, 0, ai);
2772
+ }
2773
+ var exfl = function(ex) {
2774
+ var le = 0;
2775
+ if (ex) {
2776
+ for (var k in ex) {
2777
+ var l = ex[k].length;
2778
+ if (l > 65535)
2779
+ err(9);
2780
+ le += l + 4;
2781
+ }
2782
+ }
2783
+ return le;
2784
+ };
2785
+ var wzh = function(d, b, f, fn, u, c, ce, co) {
2786
+ var fl2 = fn.length, ex = f.extra, col = co && co.length;
2787
+ var exl = exfl(ex);
2788
+ wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
2789
+ if (ce != null)
2790
+ d[b++] = 20, d[b++] = f.os;
2791
+ d[b] = 20, b += 2;
2792
+ d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
2793
+ d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
2794
+ var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
2795
+ if (y < 0 || y > 119)
2796
+ err(10);
2797
+ wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
2798
+ if (c != -1) {
2799
+ wbytes(d, b, f.crc);
2800
+ wbytes(d, b + 4, c < 0 ? -c - 2 : c);
2801
+ wbytes(d, b + 8, f.size);
2802
+ }
2803
+ wbytes(d, b + 12, fl2);
2804
+ wbytes(d, b + 14, exl), b += 16;
2805
+ if (ce != null) {
2806
+ wbytes(d, b, col);
2807
+ wbytes(d, b + 6, f.attrs);
2808
+ wbytes(d, b + 10, ce), b += 14;
2809
+ }
2810
+ d.set(fn, b);
2811
+ b += fl2;
2812
+ if (exl) {
2813
+ for (var k in ex) {
2814
+ var exf = ex[k], l = exf.length;
2815
+ wbytes(d, b, +k);
2816
+ wbytes(d, b + 2, l);
2817
+ d.set(exf, b + 4), b += 4 + l;
2818
+ }
2819
+ }
2820
+ if (col)
2821
+ d.set(co, b), b += col;
2822
+ return b;
2823
+ };
2824
+ var wzf = function(o, b, c, d, e) {
2825
+ wbytes(o, b, 101010256);
2826
+ wbytes(o, b + 8, c);
2827
+ wbytes(o, b + 10, c);
2828
+ wbytes(o, b + 12, d);
2829
+ wbytes(o, b + 16, e);
2830
+ };
2831
+ function zipSync(data, opts) {
2832
+ if (!opts)
2833
+ opts = {};
2834
+ var r = {};
2835
+ var files = [];
2836
+ fltn(data, "", r, opts);
2837
+ var o = 0;
2838
+ var tot = 0;
2839
+ for (var fn in r) {
2840
+ var _a2 = r[fn], file = _a2[0], p = _a2[1];
2841
+ var compression = p.level == 0 ? 0 : 8;
2842
+ var f = strToU8(fn), s = f.length;
2843
+ var com = p.comment, m = com && strToU8(com), ms = m && m.length;
2844
+ var exl = exfl(p.extra);
2845
+ if (s > 65535)
2846
+ err(11);
2847
+ var d = compression ? deflateSync(file, p) : file, l = d.length;
2848
+ var c = crc();
2849
+ c.p(file);
2850
+ files.push(mrg(p, {
2851
+ size: file.length,
2852
+ crc: c.d(),
2853
+ c: d,
2854
+ f,
2855
+ m,
2856
+ u: s != fn.length || m && com.length != ms,
2857
+ o,
2858
+ compression
2859
+ }));
2860
+ o += 30 + s + exl + l;
2861
+ tot += 76 + 2 * (s + exl) + (ms || 0) + l;
2862
+ }
2863
+ var out = new u8(tot + 22), oe = o, cdl = tot - o;
2864
+ for (var i2 = 0;i2 < files.length; ++i2) {
2865
+ var f = files[i2];
2866
+ wzh(out, f.o, f, f.f, f.u, f.c.length);
2867
+ var badd = 30 + f.f.length + exfl(f.extra);
2868
+ out.set(f.c, f.o + badd);
2869
+ wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
2870
+ }
2871
+ wzf(out, o, files.length, cdl, oe);
2872
+ return out;
2873
+ }
2874
+
2875
+ // ../packager/packager-core/src/services/nuget-packager.ts
2876
+ function escapeXml(str) {
2877
+ if (str === null || str === undefined) {
2878
+ return "";
2879
+ }
2880
+ return String(str).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
2881
+ }
2882
+ function optionalElement(name, value) {
2883
+ if (value === undefined || value === "")
2884
+ return "";
2885
+ return ` <${name}>${escapeXml(value)}</${name}>
2886
+ `;
2887
+ }
2888
+ function generateDependenciesXml(dependencies) {
2889
+ if (!dependencies || dependencies.length === 0)
2890
+ return "";
2891
+ const deps = dependencies.map((d) => ` <dependency id="${escapeXml(d.id)}" version="${escapeXml(d.version)}" />`).join(`
2892
+ `);
2893
+ return ` <dependencies>
2894
+ ${deps}
2895
+ </dependencies>
2896
+ `;
2897
+ }
2898
+ function generateRepositoryXml(packageInfo) {
2899
+ if (!packageInfo.repositoryType || !packageInfo.repositoryUrl)
2900
+ return "";
2901
+ let repoXml = ` <repository type="${escapeXml(packageInfo.repositoryType)}" url="${escapeXml(packageInfo.repositoryUrl)}"`;
2902
+ if (packageInfo.repositoryBranch) {
2903
+ repoXml += ` branch="${escapeXml(packageInfo.repositoryBranch)}"`;
2904
+ }
2905
+ if (packageInfo.repositoryCommit) {
2906
+ repoXml += ` commit="${escapeXml(packageInfo.repositoryCommit)}"`;
2907
+ }
2908
+ repoXml += ` />
2909
+ `;
2910
+ return repoXml;
2911
+ }
2912
+ function generateNuspecXml(packageInfo) {
2913
+ const author = packageInfo.author?.trim() || "UiPath";
2914
+ const description = packageInfo.description?.trim() || "Created by UiPath";
2915
+ const title = packageInfo.title?.trim() || packageInfo.id;
2916
+ const requireLicenseAcceptance = packageInfo.requireLicenseAcceptance === true ? "true" : "false";
2917
+ const releaseNotes = packageInfo.releaseNotes ?? "";
2918
+ const xml = `\uFEFF<?xml version="1.0" encoding="utf-8"?>
2919
+ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
2920
+ <metadata>
2921
+ <id>${escapeXml(packageInfo.id)}</id>
2922
+ <version>${escapeXml(packageInfo.version)}</version>
2923
+ <title>${escapeXml(title)}</title>
2924
+ <authors>${escapeXml(author)}</authors>
2925
+ <requireLicenseAcceptance>${requireLicenseAcceptance}</requireLicenseAcceptance>
2926
+ <description>${escapeXml(description)}</description>
2927
+ <releaseNotes>${escapeXml(releaseNotes)}</releaseNotes>
2928
+ ${optionalElement("tags", packageInfo.tags)}${optionalElement("iconUrl", packageInfo.iconUrl)}${optionalElement("projectUrl", packageInfo.projectUrl)}${optionalElement("licenseUrl", packageInfo.licenseUrl)}${optionalElement("copyright", packageInfo.copyright)}${generateRepositoryXml(packageInfo)}${generateDependenciesXml(packageInfo.dependencies)} </metadata>
2929
+ </package>
2930
+ `;
2931
+ return xml;
2932
+ }
2933
+ function generatePsmdcpXml(packageInfo) {
2934
+ const author = packageInfo.author?.trim() || "UiPath";
2935
+ const description = packageInfo.description?.trim() || "Created by UiPath";
2936
+ return `<?xml version="1.0" encoding="utf-8"?>
2937
+ <coreProperties xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.openxmlformats.org/package/2006/metadata/core-properties">
2938
+ <dc:creator>${escapeXml(author)}</dc:creator>
2939
+ <dc:description>${escapeXml(description)}</dc:description>
2940
+ <dc:identifier>${escapeXml(packageInfo.id)}</dc:identifier>
2941
+ <version>${escapeXml(packageInfo.version)}</version>
2942
+ <keywords></keywords>
2943
+ <lastModifiedBy>NuGet.Packaging, Version=6.12.1.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35;.NET 5.0</lastModifiedBy>
2944
+ </coreProperties>`;
2945
+ }
2946
+
2947
+ class NugetPackager {
2948
+ fileSystem;
2949
+ constructor(fileSystem) {
2950
+ this.fileSystem = fileSystem;
2951
+ }
2952
+ async packAsync(rootPath, packageInfo, outputPath) {
2953
+ const normalizedOutputPath = Path.normalize(outputPath);
2954
+ const nuspecXml = generateNuspecXml(packageInfo);
2955
+ const nuspecFileName = `${packageInfo.id}.nuspec`;
2956
+ const fileEntries = await Path.walkDirectory(this.fileSystem, rootPath);
2957
+ const zipContents = {};
2958
+ const encoder = new TextEncoder;
2959
+ const psmdcpId = Array.from({ length: 4 }, () => Math.floor(Math.random() * 4294967296).toString(16).padStart(8, "0")).join("");
2960
+ const psmdcpFileName = `${psmdcpId}.psmdcp`;
2961
+ const psmdcpPath = `package/services/metadata/core-properties/${psmdcpFileName}`;
2962
+ const contentTypesXml = `<?xml version="1.0" encoding="utf-8"?>
2963
+ <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
2964
+ <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
2965
+ <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
2966
+ <Default Extension="uiproj" ContentType="application/octet" />
2967
+ <Default Extension="json" ContentType="application/octet" />
2968
+ <Default Extension="nuspec" ContentType="application/octet" />
2969
+ </Types>`;
2970
+ zipContents["[Content_Types].xml"] = encoder.encode(contentTypesXml);
2971
+ const manifestRelId = `R${Date.now().toString(16).toUpperCase()}`;
2972
+ const corePropsRelId = `R${(Date.now() + 1).toString(16).toUpperCase()}`;
2973
+ const relsXml = `<?xml version="1.0" encoding="utf-8"?>
2974
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
2975
+ <Relationship Type="http://schemas.microsoft.com/packaging/2010/07/manifest" Target="/${nuspecFileName}" Id="${manifestRelId}" />
2976
+ <Relationship Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="/${psmdcpPath}" Id="${corePropsRelId}" />
2977
+ </Relationships>`;
2978
+ zipContents["_rels/.rels"] = encoder.encode(relsXml);
2979
+ zipContents[psmdcpPath] = encoder.encode(generatePsmdcpXml(packageInfo));
2980
+ zipContents[nuspecFileName] = encoder.encode(nuspecXml);
2981
+ for (const entry of fileEntries) {
2982
+ const content = await this.fileSystem.readFile(entry.absolutePath);
2983
+ if (content !== null) {
2984
+ zipContents[entry.relativePath] = content;
2985
+ }
2986
+ }
2987
+ const zippedData = zipSync(zipContents);
2988
+ await this.fileSystem.writeFile(normalizedOutputPath, zippedData);
2989
+ return {
2990
+ outputPath: normalizedOutputPath
2991
+ };
2992
+ }
2993
+ }
2994
+ // ../packager/packager-core/src/models/tool-result.ts
2995
+ class ToolResult {
2996
+ errorCode;
2997
+ message;
2998
+ packages;
2999
+ details;
3000
+ instructions;
3001
+ constructor(errorCode, message, packages = [], instructions) {
3002
+ this.errorCode = errorCode;
3003
+ this.message = message;
3004
+ this.packages = packages;
3005
+ this.instructions = instructions;
3006
+ }
3007
+ get isSuccess() {
3008
+ return this.errorCode === "SUCCESS" /* Success */;
3009
+ }
3010
+ static success() {
3011
+ return new ToolResult("SUCCESS" /* Success */);
3012
+ }
3013
+ static error(errorCode, message, instructions) {
3014
+ return new ToolResult(errorCode, message, [], instructions);
3015
+ }
3016
+ }
3017
+
3018
+ // ../packager/packager-core/src/services/project-tool.ts
3019
+ class ProjectTool {
3020
+ fileSystem;
3021
+ logger;
3022
+ static ProjectFileName = "project.uiproj";
3023
+ constructor(fileSystem, logger) {
3024
+ this.fileSystem = fileSystem;
3025
+ this.logger = logger;
3026
+ }
3027
+ async restoreAsync(_options, _cancellationToken) {
3028
+ this.logger.info("Restore operation is a noop");
3029
+ return ToolResult.success();
3030
+ }
3031
+ async validateAsync(_options, _cancellationToken) {
3032
+ this.logger.info("Validate operation is a noop");
3033
+ return ToolResult.success();
3034
+ }
3035
+ async buildAsync(_options, _cancellationToken) {
3036
+ this.logger.info("Build operation is a noop");
3037
+ return ToolResult.success();
3038
+ }
3039
+ async packAsync(_options, _cancellationToken) {
3040
+ this.logger.info("Pack operation is a noop");
3041
+ return ToolResult.success();
3042
+ }
3043
+ async cleanupAsync(_options, _cancellationToken) {
3044
+ this.logger.info("Cleanup operation is a noop");
3045
+ return ToolResult.success();
3046
+ }
3047
+ async getUiProjectAsync(projectPath) {
3048
+ const filePath = Path.join(projectPath, ProjectTool.ProjectFileName);
3049
+ if (!await this.fileSystem.exists(filePath)) {
3050
+ return;
3051
+ }
3052
+ const raw = await this.fileSystem.readFile(filePath);
3053
+ if (!raw) {
3054
+ return;
3055
+ }
3056
+ const json = typeof raw === "string" ? raw : new TextDecoder("utf-8").decode(raw);
3057
+ return JSON.parse(json);
3058
+ }
3059
+ async dispose() {}
3060
+ }
3061
+ // ../packager/packager-core/src/filesystem/temporary-storage-service.ts
3062
+ class TemporaryStorageService {
3063
+ fileSystem;
3064
+ _tempFolderPath = null;
3065
+ constructor(fileSystem) {
3066
+ this.fileSystem = fileSystem;
3067
+ }
3068
+ async getTempFolderPath() {
3069
+ if (!this._tempFolderPath) {
3070
+ const systemTempDir = await this.fileSystem.getTempDir();
3071
+ const uniqueFolderName = this.generateUniqueFolderName();
3072
+ this._tempFolderPath = Path.join(systemTempDir, uniqueFolderName);
3073
+ await this.fileSystem.mkdir(this._tempFolderPath);
3074
+ }
3075
+ return this._tempFolderPath;
3076
+ }
3077
+ generateUniqueFolderName() {
3078
+ const timestamp = Date.now();
3079
+ const random = Math.random().toString(36).substring(2, 10);
3080
+ return `tool-temp-${timestamp}-${random}`;
3081
+ }
3082
+ async getTempSubfolderPathAsync(subfolder) {
3083
+ const tempFolderPath = await this.getTempFolderPath();
3084
+ const inputPath = Path.join(tempFolderPath, subfolder);
3085
+ await this.fileSystem.mkdir(inputPath);
3086
+ return inputPath;
3087
+ }
3088
+ async cleanup() {
3089
+ try {
3090
+ if (!this._tempFolderPath) {
3091
+ return;
3092
+ }
3093
+ try {
3094
+ const stats = await this.fileSystem.stat(this._tempFolderPath);
3095
+ if (!stats) {
3096
+ return;
3097
+ }
3098
+ } catch {
3099
+ return;
3100
+ }
3101
+ const _pathToCleanup = this._tempFolderPath;
3102
+ await this.fileSystem.rm(this._tempFolderPath);
3103
+ this._tempFolderPath = null;
3104
+ } catch {}
3105
+ }
3106
+ }
3107
+ // ../packager/packager-core/src/i18n/types.ts
3108
+ function isPluralForm(value) {
3109
+ return typeof value === "object" && value !== null && "other" in value;
3110
+ }
3111
+ function selectPluralForm(forms, count) {
3112
+ if (count === 0 && forms.zero !== undefined) {
3113
+ return forms.zero;
3114
+ }
3115
+ if (count === 1 && forms.one !== undefined) {
3116
+ return forms.one;
3117
+ }
3118
+ if (count === 2 && forms.two !== undefined) {
3119
+ return forms.two;
3120
+ }
3121
+ if (forms.few !== undefined) {
3122
+ const mod10 = count % 10;
3123
+ const mod100 = count % 100;
3124
+ if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
3125
+ return forms.few;
3126
+ }
3127
+ }
3128
+ if (forms.many !== undefined) {
3129
+ const mod10 = count % 10;
3130
+ const mod100 = count % 100;
3131
+ if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
3132
+ return forms.many;
3133
+ }
3134
+ }
3135
+ return forms.other;
3136
+ }
3137
+
3138
+ // ../packager/packager-core/src/i18n/i18n-manager.ts
3139
+ class I18nManager {
3140
+ static translations = {};
3141
+ static currentLocale = "en";
3142
+ static fallbackLocale = "en";
3143
+ static registerTranslations(locale, catalog) {
3144
+ if (!I18nManager.translations[locale]) {
3145
+ I18nManager.translations[locale] = {};
3146
+ }
3147
+ I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
3148
+ }
3149
+ static setLocale(locale) {
3150
+ const normalized = I18nManager.normalizeLocale(locale);
3151
+ if (I18nManager.translations[normalized]) {
3152
+ I18nManager.currentLocale = normalized;
3153
+ return normalized;
3154
+ }
3155
+ const baseLocale = normalized.split("-")[0];
3156
+ if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
3157
+ I18nManager.currentLocale = baseLocale;
3158
+ return baseLocale;
3159
+ }
3160
+ return I18nManager.currentLocale;
3161
+ }
3162
+ static getLocale() {
3163
+ return I18nManager.currentLocale;
3164
+ }
3165
+ static setFallbackLocale(locale) {
3166
+ I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
3167
+ }
3168
+ static t(key, params, locale) {
3169
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
3170
+ let value = I18nManager.getTranslationValue(key, targetLocale);
3171
+ if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
3172
+ value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
3173
+ }
3174
+ if (value === undefined) {
3175
+ return key;
3176
+ }
3177
+ if (isPluralForm(value) && params && "count" in params) {
3178
+ const count = typeof params.count === "number" ? params.count : Number(params.count);
3179
+ value = selectPluralForm(value, count);
3180
+ } else if (isPluralForm(value)) {
3181
+ value = value.other;
3182
+ }
3183
+ if (typeof value !== "string") {
3184
+ return key;
3185
+ }
3186
+ return params ? I18nManager.interpolate(value, params) : value;
3187
+ }
3188
+ static has(key, locale) {
3189
+ const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
3190
+ const value = I18nManager.getTranslationValue(key, targetLocale);
3191
+ if (value !== undefined) {
3192
+ return true;
3193
+ }
3194
+ if (targetLocale !== I18nManager.fallbackLocale) {
3195
+ return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
3196
+ }
3197
+ return false;
3198
+ }
3199
+ static getAvailableLocales() {
3200
+ return Object.keys(I18nManager.translations);
3201
+ }
3202
+ static clearTranslations() {
3203
+ I18nManager.translations = {};
3204
+ I18nManager.currentLocale = "en";
3205
+ }
3206
+ static getTranslationValue(key, locale) {
3207
+ const catalog = I18nManager.translations[locale];
3208
+ if (!catalog) {
3209
+ return;
3210
+ }
3211
+ const keys = key.split(".");
3212
+ let value = catalog;
3213
+ for (const k of keys) {
3214
+ if (value && typeof value === "object" && k in value) {
3215
+ value = value[k];
3216
+ } else {
3217
+ return;
3218
+ }
3219
+ }
3220
+ return value;
3221
+ }
3222
+ static interpolate(template, params) {
3223
+ return template.replace(/\{(\w+)\}/g, (_, key) => {
3224
+ const value = params[key];
3225
+ return value !== undefined ? String(value) : `{${key}}`;
3226
+ });
3227
+ }
3228
+ static normalizeLocale(locale) {
3229
+ const normalized = locale.toLowerCase().replace(/_/g, "-");
3230
+ const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
3231
+ if (specialLocales.includes(normalized)) {
3232
+ return normalized;
3233
+ }
3234
+ return normalized.split("-")[0];
3235
+ }
3236
+ static deepMerge(target, source) {
3237
+ const result = { ...target };
3238
+ for (const key of Object.keys(source)) {
3239
+ const sourceValue = source[key];
3240
+ const targetValue = result[key];
3241
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
3242
+ result[key] = I18nManager.deepMerge(targetValue, sourceValue);
3243
+ } else {
3244
+ result[key] = sourceValue;
3245
+ }
3246
+ }
3247
+ return result;
3248
+ }
3249
+ }
3250
+
3251
+ // ../packager/packager-core/src/i18n/locales/de.ts
3252
+ var de = {
3253
+ toolCore: {
3254
+ errors: {
3255
+ internal: "Internal error: {message}",
3256
+ fileNotFound: "File not found: {path}",
3257
+ fileReadFailed: "Failed to read file: {path}",
3258
+ fileWriteFailed: "Failed to write file: {path}",
3259
+ directoryNotFound: "Directory not found: {path}",
3260
+ invalidPath: "{path} is not a valid path",
3261
+ operationCanceled: "Operation was canceled",
3262
+ invalidParameter: "Invalid parameter: {parameter}"
3263
+ },
3264
+ progress: {
3265
+ copying: "Copying files...",
3266
+ building: "Building project...",
3267
+ packaging: "Creating package...",
3268
+ validating: "Validating...",
3269
+ analyzing: "Analyzing...",
3270
+ restoring: "Restoring dependencies..."
3271
+ },
3272
+ validation: {
3273
+ requiredField: "{field} is required",
3274
+ invalidValue: "Invalid value for {field}",
3275
+ pathNotFound: "Path not found: {path}",
3276
+ fileRequired: "File is required: {path}",
3277
+ directoryRequired: "Directory is required: {path}"
3278
+ },
3279
+ warnings: {
3280
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3281
+ },
3282
+ info: {
3283
+ operationComplete: "Operation completed successfully",
3284
+ filesProcessed: {
3285
+ zero: "No files processed",
3286
+ one: "{count} file processed",
3287
+ other: "{count} files processed"
3288
+ }
3289
+ }
3290
+ }
3291
+ };
3292
+
3293
+ // ../packager/packager-core/src/i18n/locales/en.ts
3294
+ var en = {
3295
+ toolCore: {
3296
+ errors: {
3297
+ internal: "Internal error: {message}",
3298
+ fileNotFound: "File not found: {path}",
3299
+ fileReadFailed: "Failed to read file: {path}",
3300
+ fileWriteFailed: "Failed to write file: {path}",
3301
+ directoryNotFound: "Directory not found: {path}",
3302
+ invalidPath: "{path} is not a valid path",
3303
+ operationCanceled: "Operation was canceled",
3304
+ invalidParameter: "Invalid parameter: {parameter}"
3305
+ },
3306
+ progress: {
3307
+ copying: "Copying files...",
3308
+ building: "Building project...",
3309
+ packaging: "Creating package...",
3310
+ validating: "Validating...",
3311
+ analyzing: "Analyzing...",
3312
+ restoring: "Restoring dependencies..."
3313
+ },
3314
+ validation: {
3315
+ requiredField: "{field} is required",
3316
+ invalidValue: "Invalid value for {field}",
3317
+ pathNotFound: "Path not found: {path}",
3318
+ fileRequired: "File is required: {path}",
3319
+ directoryRequired: "Directory is required: {path}"
3320
+ },
3321
+ warnings: {
3322
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3323
+ },
3324
+ info: {
3325
+ operationComplete: "Operation completed successfully",
3326
+ filesProcessed: {
3327
+ zero: "No files processed",
3328
+ one: "{count} file processed",
3329
+ other: "{count} files processed"
3330
+ }
3331
+ }
3332
+ }
3333
+ };
3334
+
3335
+ // ../packager/packager-core/src/i18n/locales/es.ts
3336
+ var es = {
3337
+ toolCore: {
3338
+ errors: {
3339
+ internal: "Internal error: {message}",
3340
+ fileNotFound: "File not found: {path}",
3341
+ fileReadFailed: "Failed to read file: {path}",
3342
+ fileWriteFailed: "Failed to write file: {path}",
3343
+ directoryNotFound: "Directory not found: {path}",
3344
+ invalidPath: "{path} is not a valid path",
3345
+ operationCanceled: "Operation was canceled",
3346
+ invalidParameter: "Invalid parameter: {parameter}"
3347
+ },
3348
+ progress: {
3349
+ copying: "Copying files...",
3350
+ building: "Building project...",
3351
+ packaging: "Creating package...",
3352
+ validating: "Validating...",
3353
+ analyzing: "Analyzing...",
3354
+ restoring: "Restoring dependencies..."
3355
+ },
3356
+ validation: {
3357
+ requiredField: "{field} is required",
3358
+ invalidValue: "Invalid value for {field}",
3359
+ pathNotFound: "Path not found: {path}",
3360
+ fileRequired: "File is required: {path}",
3361
+ directoryRequired: "Directory is required: {path}"
3362
+ },
3363
+ warnings: {
3364
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3365
+ },
3366
+ info: {
3367
+ operationComplete: "Operation completed successfully",
3368
+ filesProcessed: {
3369
+ zero: "No files processed",
3370
+ one: "{count} file processed",
3371
+ other: "{count} files processed"
3372
+ }
3373
+ }
3374
+ }
3375
+ };
3376
+
3377
+ // ../packager/packager-core/src/i18n/locales/es-MX.ts
3378
+ var es_MX = {
3379
+ toolCore: {
3380
+ errors: {
3381
+ internal: "Internal error: {message}",
3382
+ fileNotFound: "File not found: {path}",
3383
+ fileReadFailed: "Failed to read file: {path}",
3384
+ fileWriteFailed: "Failed to write file: {path}",
3385
+ directoryNotFound: "Directory not found: {path}",
3386
+ invalidPath: "{path} is not a valid path",
3387
+ operationCanceled: "Operation was canceled",
3388
+ invalidParameter: "Invalid parameter: {parameter}"
3389
+ },
3390
+ progress: {
3391
+ copying: "Copying files...",
3392
+ building: "Building project...",
3393
+ packaging: "Creating package...",
3394
+ validating: "Validating...",
3395
+ analyzing: "Analyzing...",
3396
+ restoring: "Restoring dependencies..."
3397
+ },
3398
+ validation: {
3399
+ requiredField: "{field} is required",
3400
+ invalidValue: "Invalid value for {field}",
3401
+ pathNotFound: "Path not found: {path}",
3402
+ fileRequired: "File is required: {path}",
3403
+ directoryRequired: "Directory is required: {path}"
3404
+ },
3405
+ warnings: {
3406
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3407
+ },
3408
+ info: {
3409
+ operationComplete: "Operation completed successfully",
3410
+ filesProcessed: {
3411
+ zero: "No files processed",
3412
+ one: "{count} file processed",
3413
+ other: "{count} files processed"
3414
+ }
3415
+ }
3416
+ }
3417
+ };
3418
+
3419
+ // ../packager/packager-core/src/i18n/locales/fr.ts
3420
+ var fr = {
3421
+ toolCore: {
3422
+ errors: {
3423
+ internal: "Internal error: {message}",
3424
+ fileNotFound: "File not found: {path}",
3425
+ fileReadFailed: "Failed to read file: {path}",
3426
+ fileWriteFailed: "Failed to write file: {path}",
3427
+ directoryNotFound: "Directory not found: {path}",
3428
+ invalidPath: "{path} is not a valid path",
3429
+ operationCanceled: "Operation was canceled",
3430
+ invalidParameter: "Invalid parameter: {parameter}"
3431
+ },
3432
+ progress: {
3433
+ copying: "Copying files...",
3434
+ building: "Building project...",
3435
+ packaging: "Creating package...",
3436
+ validating: "Validating...",
3437
+ analyzing: "Analyzing...",
3438
+ restoring: "Restoring dependencies..."
3439
+ },
3440
+ validation: {
3441
+ requiredField: "{field} is required",
3442
+ invalidValue: "Invalid value for {field}",
3443
+ pathNotFound: "Path not found: {path}",
3444
+ fileRequired: "File is required: {path}",
3445
+ directoryRequired: "Directory is required: {path}"
3446
+ },
3447
+ warnings: {
3448
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3449
+ },
3450
+ info: {
3451
+ operationComplete: "Operation completed successfully",
3452
+ filesProcessed: {
3453
+ zero: "No files processed",
3454
+ one: "{count} file processed",
3455
+ other: "{count} files processed"
3456
+ }
3457
+ }
3458
+ }
3459
+ };
3460
+
3461
+ // ../packager/packager-core/src/i18n/locales/ja.ts
3462
+ var ja = {
3463
+ toolCore: {
3464
+ errors: {
3465
+ internal: "Internal error: {message}",
3466
+ fileNotFound: "File not found: {path}",
3467
+ fileReadFailed: "Failed to read file: {path}",
3468
+ fileWriteFailed: "Failed to write file: {path}",
3469
+ directoryNotFound: "Directory not found: {path}",
3470
+ invalidPath: "{path} is not a valid path",
3471
+ operationCanceled: "Operation was canceled",
3472
+ invalidParameter: "Invalid parameter: {parameter}"
3473
+ },
3474
+ progress: {
3475
+ copying: "Copying files...",
3476
+ building: "Building project...",
3477
+ packaging: "Creating package...",
3478
+ validating: "Validating...",
3479
+ analyzing: "Analyzing...",
3480
+ restoring: "Restoring dependencies..."
3481
+ },
3482
+ validation: {
3483
+ requiredField: "{field} is required",
3484
+ invalidValue: "Invalid value for {field}",
3485
+ pathNotFound: "Path not found: {path}",
3486
+ fileRequired: "File is required: {path}",
3487
+ directoryRequired: "Directory is required: {path}"
3488
+ },
3489
+ warnings: {
3490
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3491
+ },
3492
+ info: {
3493
+ operationComplete: "Operation completed successfully",
3494
+ filesProcessed: {
3495
+ zero: "No files processed",
3496
+ one: "{count} file processed",
3497
+ other: "{count} files processed"
3498
+ }
3499
+ }
3500
+ }
3501
+ };
3502
+
3503
+ // ../packager/packager-core/src/i18n/locales/ko.ts
3504
+ var ko = {
3505
+ toolCore: {
3506
+ errors: {
3507
+ internal: "Internal error: {message}",
3508
+ fileNotFound: "File not found: {path}",
3509
+ fileReadFailed: "Failed to read file: {path}",
3510
+ fileWriteFailed: "Failed to write file: {path}",
3511
+ directoryNotFound: "Directory not found: {path}",
3512
+ invalidPath: "{path} is not a valid path",
3513
+ operationCanceled: "Operation was canceled",
3514
+ invalidParameter: "Invalid parameter: {parameter}"
3515
+ },
3516
+ progress: {
3517
+ copying: "Copying files...",
3518
+ building: "Building project...",
3519
+ packaging: "Creating package...",
3520
+ validating: "Validating...",
3521
+ analyzing: "Analyzing...",
3522
+ restoring: "Restoring dependencies..."
3523
+ },
3524
+ validation: {
3525
+ requiredField: "{field} is required",
3526
+ invalidValue: "Invalid value for {field}",
3527
+ pathNotFound: "Path not found: {path}",
3528
+ fileRequired: "File is required: {path}",
3529
+ directoryRequired: "Directory is required: {path}"
3530
+ },
3531
+ warnings: {
3532
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3533
+ },
3534
+ info: {
3535
+ operationComplete: "Operation completed successfully",
3536
+ filesProcessed: {
3537
+ zero: "No files processed",
3538
+ one: "{count} file processed",
3539
+ other: "{count} files processed"
3540
+ }
3541
+ }
3542
+ }
3543
+ };
3544
+
3545
+ // ../packager/packager-core/src/i18n/locales/pt.ts
3546
+ var pt = {
3547
+ toolCore: {
3548
+ errors: {
3549
+ internal: "Internal error: {message}",
3550
+ fileNotFound: "File not found: {path}",
3551
+ fileReadFailed: "Failed to read file: {path}",
3552
+ fileWriteFailed: "Failed to write file: {path}",
3553
+ directoryNotFound: "Directory not found: {path}",
3554
+ invalidPath: "{path} is not a valid path",
3555
+ operationCanceled: "Operation was canceled",
3556
+ invalidParameter: "Invalid parameter: {parameter}"
3557
+ },
3558
+ progress: {
3559
+ copying: "Copying files...",
3560
+ building: "Building project...",
3561
+ packaging: "Creating package...",
3562
+ validating: "Validating...",
3563
+ analyzing: "Analyzing...",
3564
+ restoring: "Restoring dependencies..."
3565
+ },
3566
+ validation: {
3567
+ requiredField: "{field} is required",
3568
+ invalidValue: "Invalid value for {field}",
3569
+ pathNotFound: "Path not found: {path}",
3570
+ fileRequired: "File is required: {path}",
3571
+ directoryRequired: "Directory is required: {path}"
3572
+ },
3573
+ warnings: {
3574
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3575
+ },
3576
+ info: {
3577
+ operationComplete: "Operation completed successfully",
3578
+ filesProcessed: {
3579
+ zero: "No files processed",
3580
+ one: "{count} file processed",
3581
+ other: "{count} files processed"
3582
+ }
3583
+ }
3584
+ }
3585
+ };
3586
+
3587
+ // ../packager/packager-core/src/i18n/locales/pt-BR.ts
3588
+ var pt_BR = {
3589
+ toolCore: {
3590
+ errors: {
3591
+ internal: "Internal error: {message}",
3592
+ fileNotFound: "File not found: {path}",
3593
+ fileReadFailed: "Failed to read file: {path}",
3594
+ fileWriteFailed: "Failed to write file: {path}",
3595
+ directoryNotFound: "Directory not found: {path}",
3596
+ invalidPath: "{path} is not a valid path",
3597
+ operationCanceled: "Operation was canceled",
3598
+ invalidParameter: "Invalid parameter: {parameter}"
3599
+ },
3600
+ progress: {
3601
+ copying: "Copying files...",
3602
+ building: "Building project...",
3603
+ packaging: "Creating package...",
3604
+ validating: "Validating...",
3605
+ analyzing: "Analyzing...",
3606
+ restoring: "Restoring dependencies..."
3607
+ },
3608
+ validation: {
3609
+ requiredField: "{field} is required",
3610
+ invalidValue: "Invalid value for {field}",
3611
+ pathNotFound: "Path not found: {path}",
3612
+ fileRequired: "File is required: {path}",
3613
+ directoryRequired: "Directory is required: {path}"
3614
+ },
3615
+ warnings: {
3616
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3617
+ },
3618
+ info: {
3619
+ operationComplete: "Operation completed successfully",
3620
+ filesProcessed: {
3621
+ zero: "No files processed",
3622
+ one: "{count} file processed",
3623
+ other: "{count} files processed"
3624
+ }
3625
+ }
3626
+ }
3627
+ };
3628
+
3629
+ // ../packager/packager-core/src/i18n/locales/ro.ts
3630
+ var ro = {
3631
+ toolCore: {
3632
+ errors: {
3633
+ internal: "Internal error: {message}",
3634
+ fileNotFound: "File not found: {path}",
3635
+ fileReadFailed: "Failed to read file: {path}",
3636
+ fileWriteFailed: "Failed to write file: {path}",
3637
+ directoryNotFound: "Directory not found: {path}",
3638
+ invalidPath: "{path} is not a valid path",
3639
+ operationCanceled: "Operation was canceled",
3640
+ invalidParameter: "Invalid parameter: {parameter}"
3641
+ },
3642
+ progress: {
3643
+ copying: "Copying files...",
3644
+ building: "Building project...",
3645
+ packaging: "Creating package...",
3646
+ validating: "Validating...",
3647
+ analyzing: "Analyzing...",
3648
+ restoring: "Restoring dependencies..."
3649
+ },
3650
+ validation: {
3651
+ requiredField: "{field} is required",
3652
+ invalidValue: "Invalid value for {field}",
3653
+ pathNotFound: "Path not found: {path}",
3654
+ fileRequired: "File is required: {path}",
3655
+ directoryRequired: "Directory is required: {path}"
3656
+ },
3657
+ warnings: {
3658
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3659
+ },
3660
+ info: {
3661
+ operationComplete: "Operation completed successfully",
3662
+ filesProcessed: {
3663
+ zero: "No files processed",
3664
+ one: "{count} file processed",
3665
+ other: "{count} files processed"
3666
+ }
3667
+ }
3668
+ }
3669
+ };
3670
+
3671
+ // ../packager/packager-core/src/i18n/locales/ru.ts
3672
+ var ru = {
3673
+ toolCore: {
3674
+ errors: {
3675
+ internal: "Internal error: {message}",
3676
+ fileNotFound: "File not found: {path}",
3677
+ fileReadFailed: "Failed to read file: {path}",
3678
+ fileWriteFailed: "Failed to write file: {path}",
3679
+ directoryNotFound: "Directory not found: {path}",
3680
+ invalidPath: "{path} is not a valid path",
3681
+ operationCanceled: "Operation was canceled",
3682
+ invalidParameter: "Invalid parameter: {parameter}"
3683
+ },
3684
+ progress: {
3685
+ copying: "Copying files...",
3686
+ building: "Building project...",
3687
+ packaging: "Creating package...",
3688
+ validating: "Validating...",
3689
+ analyzing: "Analyzing...",
3690
+ restoring: "Restoring dependencies..."
3691
+ },
3692
+ validation: {
3693
+ requiredField: "{field} is required",
3694
+ invalidValue: "Invalid value for {field}",
3695
+ pathNotFound: "Path not found: {path}",
3696
+ fileRequired: "File is required: {path}",
3697
+ directoryRequired: "Directory is required: {path}"
3698
+ },
3699
+ warnings: {
3700
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3701
+ },
3702
+ info: {
3703
+ operationComplete: "Operation completed successfully",
3704
+ filesProcessed: {
3705
+ zero: "No files processed",
3706
+ one: "{count} file processed",
3707
+ other: "{count} files processed"
3708
+ }
3709
+ }
3710
+ }
3711
+ };
3712
+
3713
+ // ../packager/packager-core/src/i18n/locales/tr.ts
3714
+ var tr = {
3715
+ toolCore: {
3716
+ errors: {
3717
+ internal: "Internal error: {message}",
3718
+ fileNotFound: "File not found: {path}",
3719
+ fileReadFailed: "Failed to read file: {path}",
3720
+ fileWriteFailed: "Failed to write file: {path}",
3721
+ directoryNotFound: "Directory not found: {path}",
3722
+ invalidPath: "{path} is not a valid path",
3723
+ operationCanceled: "Operation was canceled",
3724
+ invalidParameter: "Invalid parameter: {parameter}"
3725
+ },
3726
+ progress: {
3727
+ copying: "Copying files...",
3728
+ building: "Building project...",
3729
+ packaging: "Creating package...",
3730
+ validating: "Validating...",
3731
+ analyzing: "Analyzing...",
3732
+ restoring: "Restoring dependencies..."
3733
+ },
3734
+ validation: {
3735
+ requiredField: "{field} is required",
3736
+ invalidValue: "Invalid value for {field}",
3737
+ pathNotFound: "Path not found: {path}",
3738
+ fileRequired: "File is required: {path}",
3739
+ directoryRequired: "Directory is required: {path}"
3740
+ },
3741
+ warnings: {
3742
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3743
+ },
3744
+ info: {
3745
+ operationComplete: "Operation completed successfully",
3746
+ filesProcessed: {
3747
+ zero: "No files processed",
3748
+ one: "{count} file processed",
3749
+ other: "{count} files processed"
3750
+ }
3751
+ }
3752
+ }
3753
+ };
3754
+
3755
+ // ../packager/packager-core/src/i18n/locales/zh-CN.ts
3756
+ var zh_CN = {
3757
+ toolCore: {
3758
+ errors: {
3759
+ internal: "Internal error: {message}",
3760
+ fileNotFound: "File not found: {path}",
3761
+ fileReadFailed: "Failed to read file: {path}",
3762
+ fileWriteFailed: "Failed to write file: {path}",
3763
+ directoryNotFound: "Directory not found: {path}",
3764
+ invalidPath: "{path} is not a valid path",
3765
+ operationCanceled: "Operation was canceled",
3766
+ invalidParameter: "Invalid parameter: {parameter}"
3767
+ },
3768
+ progress: {
3769
+ copying: "Copying files...",
3770
+ building: "Building project...",
3771
+ packaging: "Creating package...",
3772
+ validating: "Validating...",
3773
+ analyzing: "Analyzing...",
3774
+ restoring: "Restoring dependencies..."
3775
+ },
3776
+ validation: {
3777
+ requiredField: "{field} is required",
3778
+ invalidValue: "Invalid value for {field}",
3779
+ pathNotFound: "Path not found: {path}",
3780
+ fileRequired: "File is required: {path}",
3781
+ directoryRequired: "Directory is required: {path}"
3782
+ },
3783
+ warnings: {
3784
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3785
+ },
3786
+ info: {
3787
+ operationComplete: "Operation completed successfully",
3788
+ filesProcessed: {
3789
+ zero: "No files processed",
3790
+ one: "{count} file processed",
3791
+ other: "{count} files processed"
3792
+ }
3793
+ }
3794
+ }
3795
+ };
3796
+
3797
+ // ../packager/packager-core/src/i18n/locales/zh-TW.ts
3798
+ var zh_TW = {
3799
+ toolCore: {
3800
+ errors: {
3801
+ internal: "Internal error: {message}",
3802
+ fileNotFound: "File not found: {path}",
3803
+ fileReadFailed: "Failed to read file: {path}",
3804
+ fileWriteFailed: "Failed to write file: {path}",
3805
+ directoryNotFound: "Directory not found: {path}",
3806
+ invalidPath: "{path} is not a valid path",
3807
+ operationCanceled: "Operation was canceled",
3808
+ invalidParameter: "Invalid parameter: {parameter}"
3809
+ },
3810
+ progress: {
3811
+ copying: "Copying files...",
3812
+ building: "Building project...",
3813
+ packaging: "Creating package...",
3814
+ validating: "Validating...",
3815
+ analyzing: "Analyzing...",
3816
+ restoring: "Restoring dependencies..."
3817
+ },
3818
+ validation: {
3819
+ requiredField: "{field} is required",
3820
+ invalidValue: "Invalid value for {field}",
3821
+ pathNotFound: "Path not found: {path}",
3822
+ fileRequired: "File is required: {path}",
3823
+ directoryRequired: "Directory is required: {path}"
3824
+ },
3825
+ warnings: {
3826
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3827
+ },
3828
+ info: {
3829
+ operationComplete: "Operation completed successfully",
3830
+ filesProcessed: {
3831
+ zero: "No files processed",
3832
+ one: "{count} file processed",
3833
+ other: "{count} files processed"
3834
+ }
3835
+ }
3836
+ }
3837
+ };
3838
+
3839
+ // ../packager/packager-core/src/i18n/locales/zu.ts
3840
+ var zu = {
3841
+ toolCore: {
3842
+ errors: {
3843
+ internal: "Internal error: {message}",
3844
+ fileNotFound: "File not found: {path}",
3845
+ fileReadFailed: "Failed to read file: {path}",
3846
+ fileWriteFailed: "Failed to write file: {path}",
3847
+ directoryNotFound: "Directory not found: {path}",
3848
+ invalidPath: "{path} is not a valid path",
3849
+ operationCanceled: "Operation was canceled",
3850
+ invalidParameter: "Invalid parameter: {parameter}"
3851
+ },
3852
+ progress: {
3853
+ copying: "Copying files...",
3854
+ building: "Building project...",
3855
+ packaging: "Creating package...",
3856
+ validating: "Validating...",
3857
+ analyzing: "Analyzing...",
3858
+ restoring: "Restoring dependencies..."
3859
+ },
3860
+ validation: {
3861
+ requiredField: "{field} is required",
3862
+ invalidValue: "Invalid value for {field}",
3863
+ pathNotFound: "Path not found: {path}",
3864
+ fileRequired: "File is required: {path}",
3865
+ directoryRequired: "Directory is required: {path}"
3866
+ },
3867
+ warnings: {
3868
+ factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
3869
+ },
3870
+ info: {
3871
+ operationComplete: "Operation completed successfully",
3872
+ filesProcessed: {
3873
+ zero: "No files processed",
3874
+ one: "{count} file processed",
3875
+ other: "{count} files processed"
3876
+ }
3877
+ }
3878
+ }
3879
+ };
3880
+
3881
+ // ../packager/packager-core/src/i18n/translation-service.ts
3882
+ class TranslationService {
3883
+ static instance;
3884
+ currentLocale = "en";
3885
+ constructor() {}
3886
+ static getInstance() {
3887
+ if (!TranslationService.instance) {
3888
+ TranslationService.instance = new TranslationService;
3889
+ }
3890
+ return TranslationService.instance;
3891
+ }
3892
+ setLocale(locale) {
3893
+ this.currentLocale = I18nManager.setLocale(locale);
3894
+ }
3895
+ getLocale() {
3896
+ return this.currentLocale;
3897
+ }
3898
+ t(key, params) {
3899
+ return I18nManager.t(key, params, this.currentLocale);
3900
+ }
3901
+ tLocale(key, locale, params) {
3902
+ return I18nManager.t(key, params, locale);
3903
+ }
3904
+ has(key) {
3905
+ return I18nManager.has(key, this.currentLocale);
3906
+ }
3907
+ getAvailableLocales() {
3908
+ return I18nManager.getAvailableLocales();
3909
+ }
3910
+ }
3911
+ var translate = TranslationService.getInstance();
3912
+
3913
+ // ../packager/packager-core/src/i18n/index.ts
3914
+ I18nManager.registerTranslations("en", en);
3915
+ I18nManager.registerTranslations("de", de);
3916
+ I18nManager.registerTranslations("es", es);
3917
+ I18nManager.registerTranslations("es-mx", es_MX);
3918
+ I18nManager.registerTranslations("fr", fr);
3919
+ I18nManager.registerTranslations("ja", ja);
3920
+ I18nManager.registerTranslations("ko", ko);
3921
+ I18nManager.registerTranslations("pt", pt);
3922
+ I18nManager.registerTranslations("pt-br", pt_BR);
3923
+ I18nManager.registerTranslations("ro", ro);
3924
+ I18nManager.registerTranslations("ru", ru);
3925
+ I18nManager.registerTranslations("tr", tr);
3926
+ I18nManager.registerTranslations("zh-cn", zh_CN);
3927
+ I18nManager.registerTranslations("zh-tw", zh_TW);
3928
+ I18nManager.registerTranslations("zu", zu);
3929
+ I18nManager.setLocale("en");
2119
3930
  // ../common/src/telemetry/pseudonymize.ts
2120
3931
  var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2121
3932
  var PSEUDONYM_HEX_LENGTH = 32;
@@ -2211,15 +4022,15 @@ function sha256Hex(input) {
2211
4022
  const state = SHA256_INITIAL_STATE.slice();
2212
4023
  const schedule = new Uint32Array(64);
2213
4024
  for (let offset = 0;offset < paddedLength; offset += 64) {
2214
- for (let i = 0;i < 16; i++) {
2215
- schedule[i] = view.getUint32(offset + i * 4);
4025
+ for (let i2 = 0;i2 < 16; i2++) {
4026
+ schedule[i2] = view.getUint32(offset + i2 * 4);
2216
4027
  }
2217
- for (let i = 16;i < 64; i++) {
2218
- const x = schedule[i - 15];
2219
- const y = schedule[i - 2];
2220
- const s0 = (rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3) >>> 0;
4028
+ for (let i2 = 16;i2 < 64; i2++) {
4029
+ const x2 = schedule[i2 - 15];
4030
+ const y = schedule[i2 - 2];
4031
+ const s0 = (rotr(x2, 7) ^ rotr(x2, 18) ^ x2 >>> 3) >>> 0;
2221
4032
  const s1 = (rotr(y, 17) ^ rotr(y, 19) ^ y >>> 10) >>> 0;
2222
- schedule[i] = schedule[i - 16] + s0 + schedule[i - 7] + s1 >>> 0;
4033
+ schedule[i2] = schedule[i2 - 16] + s0 + schedule[i2 - 7] + s1 >>> 0;
2223
4034
  }
2224
4035
  let a = state[0];
2225
4036
  let b = state[1];
@@ -2229,10 +4040,10 @@ function sha256Hex(input) {
2229
4040
  let f = state[5];
2230
4041
  let g = state[6];
2231
4042
  let h = state[7];
2232
- for (let i = 0;i < 64; i++) {
4043
+ for (let i2 = 0;i2 < 64; i2++) {
2233
4044
  const s1 = (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) >>> 0;
2234
4045
  const ch = (e & f ^ ~e & g) >>> 0;
2235
- const temp1 = h + s1 + ch + SHA256_K[i] + schedule[i] >>> 0;
4046
+ const temp1 = h + s1 + ch + SHA256_K[i2] + schedule[i2] >>> 0;
2236
4047
  const s0 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) >>> 0;
2237
4048
  const maj = (a & b ^ a & c ^ b & c) >>> 0;
2238
4049
  const temp2 = s0 + maj >>> 0;
@@ -2558,13 +4369,13 @@ function nameTokens(name) {
2558
4369
  }
2559
4370
  function isSensitiveName(name) {
2560
4371
  const tokens = nameTokens(name);
2561
- for (let i = 0;i < tokens.length; i++) {
2562
- const token = tokens[i];
4372
+ for (let i2 = 0;i2 < tokens.length; i2++) {
4373
+ const token = tokens[i2];
2563
4374
  if (SENSITIVE_NAME_TOKENS.has(token)) {
2564
4375
  return true;
2565
4376
  }
2566
4377
  if (token === "key" || token === "keys") {
2567
- const prev = tokens[i - 1];
4378
+ const prev = tokens[i2 - 1];
2568
4379
  if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
2569
4380
  return true;
2570
4381
  }
@@ -2644,18 +4455,69 @@ function catchError(fnOrPromise) {
2644
4455
  if (isPromiseLike(result)) {
2645
4456
  return settlePromiseLike(result);
2646
4457
  }
2647
- return [undefined, result];
2648
- } catch (error) {
2649
- return [toError(error), undefined];
4458
+ return [undefined, result];
4459
+ } catch (error) {
4460
+ return [toError(error), undefined];
4461
+ }
4462
+ }
4463
+ function settlePromiseLike(thenable) {
4464
+ return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
4465
+ }
4466
+
4467
+ // ../common/src/error-graph.ts
4468
+ function* walkErrorGraph(error) {
4469
+ const queue = [error];
4470
+ const seen = new Set;
4471
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
4472
+ const current = queue.shift();
4473
+ if (current === null || typeof current !== "object")
4474
+ continue;
4475
+ if (seen.has(current))
4476
+ continue;
4477
+ seen.add(current);
4478
+ const cur = current;
4479
+ yield cur;
4480
+ if (cur.cause !== undefined)
4481
+ queue.push(cur.cause);
4482
+ if (Array.isArray(cur.errors))
4483
+ queue.push(...cur.errors);
4484
+ }
4485
+ return;
4486
+ }
4487
+ function parseHttpStatusFromMessage(message) {
4488
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
4489
+ if (!match)
4490
+ return;
4491
+ const status = Number(match[1]);
4492
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
4493
+ }
4494
+ function findHttpStatusInGraph(error) {
4495
+ for (const node of walkErrorGraph(error)) {
4496
+ const response = node.response;
4497
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
4498
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
4499
+ return explicit;
4500
+ }
4501
+ if (typeof node.message === "string") {
4502
+ const parsed = parseHttpStatusFromMessage(node.message);
4503
+ if (parsed !== undefined && parsed >= 400) {
4504
+ return parsed;
4505
+ }
4506
+ }
2650
4507
  }
2651
- }
2652
- function settlePromiseLike(thenable) {
2653
- return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
4508
+ return;
2654
4509
  }
2655
4510
 
4511
+ // ../common/src/local-permission-codes.ts
4512
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
4513
+ "EACCES",
4514
+ "EPERM",
4515
+ "EROFS"
4516
+ ]);
4517
+
2656
4518
  // ../common/src/error-handler.ts
2657
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
2658
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
4519
+ var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
4520
+ var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
2659
4521
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
2660
4522
  var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
2661
4523
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -2682,14 +4544,14 @@ var TLS_ERROR_CODES = new Set([
2682
4544
  ]);
2683
4545
  var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
2684
4546
  var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
2685
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
2686
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
4547
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
2687
4548
  function localPermissionInstructions(code, path) {
2688
4549
  const target = path !== undefined ? `'${path}'` : "a local file or resource";
2689
4550
  if (code === "EROFS") {
2690
4551
  return `The filesystem containing ${target} is read-only (EROFS), so the ` + "CLI could not write to it. This is a local environment problem, " + "not a UiPath service error — retrying will not help. Use a " + "writable location, or give this environment write access to the " + "path.";
2691
4552
  }
2692
- const remedy = process.platform === "win32" ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
4553
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
4554
+ const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
2693
4555
  return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
2694
4556
  }
2695
4557
  function describeConnectivityError(error) {
@@ -2743,48 +4605,6 @@ function localPermissionPath(path, message) {
2743
4605
  return path;
2744
4606
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
2745
4607
  }
2746
- function* walkErrorGraph(error) {
2747
- const queue = [error];
2748
- const seen = new Set;
2749
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2750
- const current = queue.shift();
2751
- if (current === null || typeof current !== "object")
2752
- continue;
2753
- if (seen.has(current))
2754
- continue;
2755
- seen.add(current);
2756
- const cur = current;
2757
- yield cur;
2758
- if (cur.cause !== undefined)
2759
- queue.push(cur.cause);
2760
- if (Array.isArray(cur.errors))
2761
- queue.push(...cur.errors);
2762
- }
2763
- return;
2764
- }
2765
- function parseHttpStatusFromMessage(message) {
2766
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
2767
- if (!match)
2768
- return;
2769
- const status = Number(match[1]);
2770
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
2771
- }
2772
- function findHttpStatusInGraph(error) {
2773
- for (const node of walkErrorGraph(error)) {
2774
- const response = node.response;
2775
- const explicit = typeof node.status === "number" ? node.status : response?.status;
2776
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
2777
- return explicit;
2778
- }
2779
- if (typeof node.message === "string") {
2780
- const parsed = parseHttpStatusFromMessage(node.message);
2781
- if (parsed !== undefined && parsed >= 400) {
2782
- return parsed;
2783
- }
2784
- }
2785
- }
2786
- return;
2787
- }
2788
4608
  function isHtmlDocument(body) {
2789
4609
  return /^\s*(<!doctype html|<html\b)/i.test(body);
2790
4610
  }
@@ -2853,10 +4673,10 @@ function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredS
2853
4673
  return inferredStatus !== undefined ? rawMessage : `HTTP ${status}: ${rawMessage}`;
2854
4674
  }
2855
4675
  async function extractErrorDetails(error, options) {
2856
- const err = error !== null && error !== undefined && typeof error === "object" ? error : {};
2857
- const response = err.response;
2858
- const rawMessage = typeof err.message === "string" ? err.message : "Unknown error";
2859
- const explicitStatus = err.status ?? response?.status;
4676
+ const err2 = error !== null && error !== undefined && typeof error === "object" ? error : {};
4677
+ const response = err2.response;
4678
+ const rawMessage = typeof err2.message === "string" ? err2.message : "Unknown error";
4679
+ const explicitStatus = err2.status ?? response?.status;
2860
4680
  const inferredStatus = explicitStatus === undefined ? parseHttpStatusFromMessage(rawMessage) : undefined;
2861
4681
  const status = explicitStatus ?? inferredStatus;
2862
4682
  const isSuccessfulResponse = status !== undefined && status >= 200 && status < 300;
@@ -2969,8 +4789,8 @@ async function extractErrorDetails(error, options) {
2969
4789
  } else {
2970
4790
  details = rawBody;
2971
4791
  }
2972
- } else if (typeof err.message === "string") {
2973
- details = err.message;
4792
+ } else if (typeof err2.message === "string") {
4793
+ details = err2.message;
2974
4794
  } else {
2975
4795
  details = describeThrownValue(error);
2976
4796
  }
@@ -3266,6 +5086,153 @@ function getLogFilePath() {
3266
5086
  return logger.getLogFilePath();
3267
5087
  }
3268
5088
 
5089
+ // ../common/src/telemetry/telemetry-dimensions.ts
5090
+ var BaseDimensions = {
5091
+ ApplicationName: "ApplicationName",
5092
+ ProductVersion: "ProductVersion",
5093
+ InstallationId: "InstallationId",
5094
+ CloudUserId: "CloudUserId",
5095
+ CloudTenantId: "CloudTenantId",
5096
+ CloudOrganizationId: "CloudOrganizationId",
5097
+ IsInternalUser: "IsInternalUser",
5098
+ Environment: "Environment",
5099
+ BaseUrl: "BaseUrl",
5100
+ Region: "Region",
5101
+ Agent: "Agent",
5102
+ AgentVersion: "AgentVersion",
5103
+ AgentModel: "AgentModel",
5104
+ ToolName: "ToolName",
5105
+ ToolVersion: "ToolVersion",
5106
+ ExecutionContext: "ExecutionContext",
5107
+ CiProvider: "CiProvider",
5108
+ SessionIdSource: "SessionIdSource",
5109
+ SessionId: "SessionId"
5110
+ };
5111
+ var CommandDimensions = {
5112
+ IsCommand: "IsCommand",
5113
+ IsReexec: "IsReexec",
5114
+ CommandName: "CommandName",
5115
+ ExitCode: "ExitCode",
5116
+ TerminalOutcome: "TerminalOutcome",
5117
+ ErrorClass: "ErrorClass",
5118
+ TerminalSignal: "TerminalSignal",
5119
+ ErrorMessage: "ErrorMessage",
5120
+ SkillName: "SkillName",
5121
+ ProductArea: "ProductArea",
5122
+ Mode: "Mode"
5123
+ };
5124
+ var ShipDimensions = {
5125
+ ShipKind: "ShipKind",
5126
+ Target: "Target",
5127
+ ProjectType: "ProjectType",
5128
+ ProjectTypes: "ProjectTypes",
5129
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
5130
+ PackageName: "PackageName",
5131
+ PackageVersion: "PackageVersion",
5132
+ PackageVersionKey: "PackageVersionKey",
5133
+ DeploymentKey: "DeploymentKey",
5134
+ SolutionId: "SolutionId",
5135
+ FolderKey: "FolderKey",
5136
+ FeedId: "FeedId"
5137
+ };
5138
+ var ErrorDimensions = {
5139
+ Result: "Result",
5140
+ ErrorCode: "ErrorCode",
5141
+ Retry: "Retry",
5142
+ ErrorMessage: "ErrorMessage"
5143
+ };
5144
+ var AuthDimensions = {
5145
+ AuthenticationMethod: "AuthenticationMethod",
5146
+ Success: "Success",
5147
+ Reason: "Reason"
5148
+ };
5149
+ var SkillsDimensions = {
5150
+ SchemaVersion: "SchemaVersion",
5151
+ AgentType: "AgentType",
5152
+ SkillsVersion: "SkillsVersion",
5153
+ UipSubcommand: "UipSubcommand",
5154
+ FileExtension: "FileExtension",
5155
+ SubagentModel: "SubagentModel",
5156
+ SubagentType: "SubagentType",
5157
+ PermissionMode: "PermissionMode",
5158
+ EffortLevel: "EffortLevel",
5159
+ SessionSource: "SessionSource",
5160
+ Outcome: "Outcome",
5161
+ DurationMs: "DurationMs",
5162
+ Source: "Source"
5163
+ };
5164
+ var PackagerDimensions = {
5165
+ ProjectId: "ProjectId",
5166
+ ProjectType: "ProjectType",
5167
+ SolutionId: "SolutionId"
5168
+ };
5169
+ var ScopeDimensions = {
5170
+ FolderId: "FolderId"
5171
+ };
5172
+ var ID_DIMENSIONS = new Set([
5173
+ BaseDimensions.CloudUserId,
5174
+ BaseDimensions.CloudTenantId,
5175
+ BaseDimensions.CloudOrganizationId,
5176
+ BaseDimensions.InstallationId,
5177
+ ShipDimensions.ArtifactCorrelationKey,
5178
+ ShipDimensions.PackageVersionKey,
5179
+ ShipDimensions.DeploymentKey,
5180
+ ShipDimensions.SolutionId,
5181
+ ShipDimensions.FolderKey,
5182
+ ShipDimensions.FeedId,
5183
+ PackagerDimensions.ProjectId
5184
+ ]);
5185
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
5186
+ var RESERVED_DIMENSION_NAMES = new Set([
5187
+ ...Object.values(BaseDimensions),
5188
+ ...Object.values(CommandDimensions),
5189
+ ...Object.values(ShipDimensions),
5190
+ ...Object.values(ErrorDimensions),
5191
+ ...Object.values(AuthDimensions),
5192
+ ...Object.values(SkillsDimensions),
5193
+ ...Object.values(PackagerDimensions),
5194
+ ...Object.values(ScopeDimensions)
5195
+ ]);
5196
+ var CURATED_DIMENSIONS = new Set([
5197
+ BaseDimensions.ApplicationName,
5198
+ BaseDimensions.ProductVersion,
5199
+ BaseDimensions.InstallationId,
5200
+ BaseDimensions.CloudUserId,
5201
+ BaseDimensions.CloudTenantId,
5202
+ BaseDimensions.CloudOrganizationId,
5203
+ BaseDimensions.IsInternalUser,
5204
+ BaseDimensions.Environment,
5205
+ BaseDimensions.BaseUrl,
5206
+ BaseDimensions.Region,
5207
+ BaseDimensions.Agent,
5208
+ BaseDimensions.AgentVersion,
5209
+ BaseDimensions.ToolVersion,
5210
+ BaseDimensions.ExecutionContext,
5211
+ BaseDimensions.CiProvider,
5212
+ BaseDimensions.SessionIdSource,
5213
+ BaseDimensions.SessionId,
5214
+ ...Object.values(CommandDimensions),
5215
+ ...Object.values(ShipDimensions)
5216
+ ]);
5217
+ function lowercaseIdDimensionValues(properties) {
5218
+ let changed = false;
5219
+ const result = {
5220
+ ...properties
5221
+ };
5222
+ for (const key of Object.keys(result)) {
5223
+ const value = result[key];
5224
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
5225
+ continue;
5226
+ }
5227
+ const lowered = value.toLowerCase();
5228
+ if (lowered !== value) {
5229
+ result[key] = lowered;
5230
+ changed = true;
5231
+ }
5232
+ }
5233
+ return changed ? result : properties;
5234
+ }
5235
+
3269
5236
  // ../common/src/exit-code.ts
3270
5237
  function setExitCode(code) {
3271
5238
  process.exitCode = code;
@@ -3313,6 +5280,9 @@ var AUTH_ERROR_CODES = new Set([
3313
5280
  "authentication_required",
3314
5281
  "permission_denied"
3315
5282
  ]);
5283
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
5284
+ "local_permission_denied"
5285
+ ]);
3316
5286
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
3317
5287
  var NETWORK_HTTP_ERROR_CODES = new Set([
3318
5288
  "network_error",
@@ -3453,6 +5423,9 @@ function classifyFromErrorCode(errorCode) {
3453
5423
  if (AUTH_ERROR_CODES.has(errorCode)) {
3454
5424
  return "auth";
3455
5425
  }
5426
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
5427
+ return "local_permission";
5428
+ }
3456
5429
  if (VALIDATION_ERROR_CODES.has(errorCode)) {
3457
5430
  return "validation";
3458
5431
  }
@@ -3464,6 +5437,15 @@ function classifyFromErrorCode(errorCode) {
3464
5437
  }
3465
5438
  return;
3466
5439
  }
5440
+ function hasLocalPermissionCode(error) {
5441
+ for (const node of walkErrorGraph(error)) {
5442
+ const code = node.code;
5443
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
5444
+ return true;
5445
+ }
5446
+ }
5447
+ return false;
5448
+ }
3467
5449
  function classifyFromError(error) {
3468
5450
  const code = findCodeInCauseChain(error);
3469
5451
  if (code) {
@@ -3480,6 +5462,9 @@ function classifyFromError(error) {
3480
5462
  return "missing_dependency";
3481
5463
  }
3482
5464
  }
5465
+ if (hasLocalPermissionCode(error)) {
5466
+ return "local_permission";
5467
+ }
3483
5468
  const message = stringField(error, "message");
3484
5469
  if (message?.includes("fetch failed") === true) {
3485
5470
  return "network_http";
@@ -3495,7 +5480,7 @@ function classifyError2(input) {
3495
5480
  if (recorded?.errorClass) {
3496
5481
  return recorded.errorClass;
3497
5482
  }
3498
- const status = recorded?.context?.httpStatus;
5483
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
3499
5484
  if (status !== undefined) {
3500
5485
  return classifyHttpStatus(status);
3501
5486
  }
@@ -3518,17 +5503,18 @@ function buildCommandTerminalTelemetryProperties(input) {
3518
5503
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
3519
5504
  const terminalSignal = terminalSignalFor(input, outcome);
3520
5505
  return {
3521
- exit_code: input.exitCode,
3522
- terminal_outcome: outcome,
3523
- ...errorClass ? { error_class: errorClass } : {},
3524
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
5506
+ [CommandDimensions.ExitCode]: input.exitCode,
5507
+ [CommandDimensions.TerminalOutcome]: outcome,
5508
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
5509
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
3525
5510
  };
3526
5511
  }
3527
5512
 
3528
5513
  // ../common/src/telemetry/telemetry-events.ts
3529
5514
  var CommonTelemetryEvents = {
3530
- Error: "uip.error",
3531
- ShipSucceeded: "uip.ship.succeeded"
5515
+ Start: "Application.Start",
5516
+ Error: "Application.Error",
5517
+ ShipSucceeded: "Cli.ShipSucceeded"
3532
5518
  };
3533
5519
 
3534
5520
  // ../common/src/registry.ts
@@ -3736,8 +5722,8 @@ function detectExecutionContext(options = {}) {
3736
5722
  function getExecutionContextTelemetryProperties() {
3737
5723
  const detected = detectExecutionContext();
3738
5724
  return {
3739
- execution_context: detected.executionContext,
3740
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
5725
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
5726
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
3741
5727
  };
3742
5728
  }
3743
5729
  // ../common/src/telemetry/node-context-storage.ts
@@ -3780,7 +5766,7 @@ function getInboundTraceContext() {
3780
5766
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
3781
5767
  var SESSION_ID_MAX_LENGTH = 64;
3782
5768
  var RANDOM_SESSION_ID_LENGTH = 32;
3783
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
5769
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
3784
5770
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
3785
5771
  var INHERITED_SESSION_SOURCES = [
3786
5772
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -3832,6 +5818,9 @@ function resolveTelemetrySession() {
3832
5818
  telemetrySessionSlot.set(resolved);
3833
5819
  return resolved;
3834
5820
  }
5821
+ function getTelemetrySessionId() {
5822
+ return resolveTelemetrySession().id;
5823
+ }
3835
5824
  function getTelemetrySessionSource() {
3836
5825
  return resolveTelemetrySession().source;
3837
5826
  }
@@ -3911,8 +5900,11 @@ class TelemetryService {
3911
5900
  return result;
3912
5901
  } catch (error) {
3913
5902
  const durationMs = clock.elapsedMs();
3914
- const err = error instanceof Error ? error : new Error(String(error));
3915
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
5903
+ const err2 = error instanceof Error ? error : new Error(String(error));
5904
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
5905
+ ...properties,
5906
+ [CommandDimensions.ErrorMessage]: err2.message
5907
+ }, context));
3916
5908
  throw error;
3917
5909
  }
3918
5910
  }
@@ -3981,9 +5973,12 @@ class TelemetryService {
3981
5973
  return result;
3982
5974
  } catch (error) {
3983
5975
  const durationMs = clock.elapsedMs();
3984
- const err = error instanceof Error ? error : new Error(String(error));
5976
+ const err2 = error instanceof Error ? error : new Error(String(error));
3985
5977
  await this.telemetryProvider.trackDependency({
3986
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
5978
+ ...this.spanFor(name, durationMs, false, {
5979
+ ...properties,
5980
+ [CommandDimensions.ErrorMessage]: err2.message
5981
+ }, childContext),
3987
5982
  type
3988
5983
  });
3989
5984
  throw error;
@@ -4018,9 +6013,10 @@ class TelemetryService {
4018
6013
  ...globalProperties,
4019
6014
  ...this.defaultProperties,
4020
6015
  ...redactProperties(properties ?? {}),
4021
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
6016
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
6017
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
4022
6018
  };
4023
- return enriched;
6019
+ return lowercaseIdDimensionValues(enriched);
4024
6020
  }
4025
6021
  generateId() {
4026
6022
  const bytes = new Uint8Array(8);
@@ -4399,11 +6395,11 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
4399
6395
  return;
4400
6396
  const keys = Object.keys(data[0]).filter((key) => !isPlumbingKey(key));
4401
6397
  const maxWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
4402
- const header = keys.map((key, i) => key.padEnd(maxWidths[i])).join(" | ");
6398
+ const header = keys.map((key, i2) => key.padEnd(maxWidths[i2])).join(" | ");
4403
6399
  logFn(header);
4404
- logFn(keys.map((_, i) => "-".repeat(maxWidths[i])).join("-|-"));
6400
+ logFn(keys.map((_, i2) => "-".repeat(maxWidths[i2])).join("-|-"));
4405
6401
  data.forEach((item) => {
4406
- const row = keys.map((key, i) => cellToString(item[key]).padEnd(maxWidths[i])).join(" | ");
6402
+ const row = keys.map((key, i2) => cellToString(item[key]).padEnd(maxWidths[i2])).join(" | ");
4407
6403
  logFn(styleLine(row, tableRowStyle?.(item)));
4408
6404
  });
4409
6405
  if (externalLogValue) {
@@ -4470,21 +6466,21 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
4470
6466
  const minWidths = keys.map((key) => Math.max(key.length, MIN_COL_WIDTH));
4471
6467
  let bestCol = -1;
4472
6468
  let bestCost = Infinity;
4473
- for (let i = 0;i < keys.length; i++) {
4474
- const maxShrink = naturalWidths[i] - minWidths[i];
6469
+ for (let i2 = 0;i2 < keys.length; i2++) {
6470
+ const maxShrink = naturalWidths[i2] - minWidths[i2];
4475
6471
  if (maxShrink < overflow)
4476
6472
  continue;
4477
- const newWidth = naturalWidths[i] - overflow;
6473
+ const newWidth = naturalWidths[i2] - overflow;
4478
6474
  let extraRows = 0;
4479
6475
  for (const item of data) {
4480
- const cellLen = cellToString(item[keys[i]]).length;
6476
+ const cellLen = cellToString(item[keys[i2]]).length;
4481
6477
  if (cellLen > newWidth) {
4482
6478
  extraRows += Math.ceil(cellLen / newWidth) - 1;
4483
6479
  }
4484
6480
  }
4485
6481
  if (extraRows < bestCost) {
4486
6482
  bestCost = extraRows;
4487
- bestCol = i;
6483
+ bestCol = i2;
4488
6484
  }
4489
6485
  }
4490
6486
  const finalWidths = [...naturalWidths];
@@ -4492,9 +6488,9 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
4492
6488
  finalWidths[bestCol] = naturalWidths[bestCol] - overflow;
4493
6489
  } else {
4494
6490
  let remaining = overflow;
4495
- const colsByShrinkPotential = keys.map((_, i) => ({
4496
- index: i,
4497
- potential: naturalWidths[i] - minWidths[i]
6491
+ const colsByShrinkPotential = keys.map((_, i2) => ({
6492
+ index: i2,
6493
+ potential: naturalWidths[i2] - minWidths[i2]
4498
6494
  })).filter((c) => c.potential > 0).sort((a, b) => b.potential - a.potential);
4499
6495
  for (const col of colsByShrinkPotential) {
4500
6496
  if (remaining <= 0)
@@ -4504,17 +6500,17 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
4504
6500
  remaining -= shrink;
4505
6501
  }
4506
6502
  }
4507
- const header = keys.map((key, i) => key.padEnd(finalWidths[i])).join(" | ");
6503
+ const header = keys.map((key, i2) => key.padEnd(finalWidths[i2])).join(" | ");
4508
6504
  logFn(header);
4509
- logFn(keys.map((_, i) => "-".repeat(finalWidths[i])).join("-|-"));
6505
+ logFn(keys.map((_, i2) => "-".repeat(finalWidths[i2])).join("-|-"));
4510
6506
  data.forEach((item) => {
4511
6507
  const style = tableRowStyle?.(item);
4512
- const cellLines = keys.map((key, i) => wrapText(cellToString(item[key]), finalWidths[i]));
6508
+ const cellLines = keys.map((key, i2) => wrapText(cellToString(item[key]), finalWidths[i2]));
4513
6509
  const lineCount = Math.max(...cellLines.map((l) => l.length));
4514
6510
  for (let line = 0;line < lineCount; line++) {
4515
- const row = keys.map((_, i) => {
4516
- const val = line < cellLines[i].length ? cellLines[i][line] : "";
4517
- return val.padEnd(finalWidths[i]);
6511
+ const row = keys.map((_, i2) => {
6512
+ const val = line < cellLines[i2].length ? cellLines[i2][line] : "";
6513
+ return val.padEnd(finalWidths[i2]);
4518
6514
  }).join(" | ");
4519
6515
  logFn(styleLine(row, style));
4520
6516
  }
@@ -4795,17 +6791,200 @@ class ConfigurationError extends Error {
4795
6791
  function isConfigurationError(error) {
4796
6792
  return typeof error === "object" && error !== null && "__brand" in error && error.__brand === "ConfigurationError";
4797
6793
  }
4798
- function applyFilter(data, filter) {
6794
+ function countRecords(data) {
6795
+ if (Array.isArray(data))
6796
+ return data.length;
6797
+ return data == null ? 0 : 1;
6798
+ }
6799
+ function availableFields(data) {
6800
+ const records = Array.isArray(data) ? data : [data];
6801
+ const keys = new Set;
6802
+ for (const record of records) {
6803
+ if (record && typeof record === "object" && !Array.isArray(record)) {
6804
+ for (const key of Object.keys(record))
6805
+ keys.add(key);
6806
+ }
6807
+ }
6808
+ return [...keys];
6809
+ }
6810
+ function decodeQuotedIdentifier(whole, inner) {
6811
+ const [error, decoded] = catchError(() => JSON.parse(whole));
6812
+ if (!error && typeof decoded === "string")
6813
+ return decoded;
6814
+ return inner.replace(/\\(.)/g, "$1");
6815
+ }
6816
+ function referencedFields(filter) {
6817
+ const top = new Set;
6818
+ const nested = new Set;
6819
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
6820
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
6821
+ const quoted = [];
6822
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
6823
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
6824
+ if (!isAlias) {
6825
+ quoted.push({
6826
+ name: decodeQuotedIdentifier(whole, name),
6827
+ index,
6828
+ tail: isPathTail(withoutValueLiterals, index)
6829
+ });
6830
+ }
6831
+ return `"${" ".repeat(whole.length - 2)}"`;
6832
+ });
6833
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
6834
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
6835
+ const place = (name, index, tail) => {
6836
+ if (tail || index >= rootEnd)
6837
+ nested.add(name);
6838
+ else
6839
+ top.add(name);
6840
+ };
6841
+ for (const entry of quoted)
6842
+ place(entry.name, entry.index, entry.tail);
6843
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
6844
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
6845
+ for (const match of identifiers) {
6846
+ const [, name, trailing] = match;
6847
+ if (trailing || reserved.has(name))
6848
+ continue;
6849
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
6850
+ }
6851
+ return {
6852
+ top: [...top],
6853
+ nested: [...nested].filter((name) => !top.has(name)),
6854
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
6855
+ };
6856
+ }
6857
+ function appearsBelowTopLevel(data, name) {
6858
+ let budget = 2000;
6859
+ const visit = (value, depth) => {
6860
+ if (budget-- <= 0 || depth > 4)
6861
+ return false;
6862
+ if (value === null || typeof value !== "object")
6863
+ return false;
6864
+ if (Array.isArray(value))
6865
+ return value.some((entry) => visit(entry, depth));
6866
+ const record = value;
6867
+ if (depth > 0 && Object.hasOwn(record, name))
6868
+ return true;
6869
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
6870
+ };
6871
+ return visit(data, 0);
6872
+ }
6873
+ function alwaysNullKeys(records) {
6874
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
6875
+ if (objects.length === 0 || objects.length !== records.length)
6876
+ return [];
6877
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
6878
+ if (keys.length === 0)
6879
+ return [];
6880
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
6881
+ return nullKeys.length === keys.length ? nullKeys : [];
6882
+ }
6883
+ function carriesOnlyNulls(value) {
6884
+ if (value === null)
6885
+ return true;
6886
+ if (Array.isArray(value)) {
6887
+ return value.length > 0 && value.every(carriesOnlyNulls);
6888
+ }
6889
+ if (typeof value === "object" && value !== undefined) {
6890
+ const values = Object.values(value);
6891
+ return values.length > 0 && values.every(carriesOnlyNulls);
6892
+ }
6893
+ return false;
6894
+ }
6895
+ function nameList(names, cap2 = 12) {
6896
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
6897
+ const rest = names.length - shown.length;
6898
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
6899
+ }
6900
+ function buildFilterWarning(filter, data, outcome) {
6901
+ const present = availableFields(data);
6902
+ const refs = referencedFields(filter);
6903
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
6904
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
6905
+ const count = countRecords(data);
6906
+ const scope = `${count} record(s)`;
6907
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
6908
+ const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
6909
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
6910
+ let detail;
6911
+ let lede;
6912
+ if (outcome.kind === "null-elements") {
6913
+ lede = "returned only null values";
6914
+ const projected = `all ${outcome.count} of the elements it projected are null`;
6915
+ if (unknown.length > 0) {
6916
+ detail = `${projected}, because ${isNotAField(unknown)}`;
6917
+ } else if (unchecked.length > 0) {
6918
+ detail = withSoundness(projected);
6919
+ } else {
6920
+ detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
6921
+ }
6922
+ } else if (outcome.kind === "null-rows") {
6923
+ lede = "returned only null values";
6924
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
6925
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
6926
+ } else if (outcome.kind === "null-values") {
6927
+ lede = "returned only null values";
6928
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
6929
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
6930
+ if (sameSet) {
6931
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
6932
+ } else if (unknown.length > 0) {
6933
+ detail = `${projected}, because ${isNotAField(unknown)}`;
6934
+ } else {
6935
+ detail = withSoundness(`${projected} on all ${scope}`);
6936
+ }
6937
+ } else {
6938
+ lede = "returned nothing";
6939
+ if (unknown.length > 0) {
6940
+ detail = isNotAField(unknown);
6941
+ } else {
6942
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
6943
+ detail = withSoundness(`${selection} — it read ${scope}`);
6944
+ }
6945
+ }
6946
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
6947
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
6948
+ }
6949
+ function appendWarning(existing, note) {
6950
+ return existing ? `${existing} ${note}` : note;
6951
+ }
6952
+ function applyFilter(data, filter, onWarning) {
4799
6953
  const codec = requireJmespath();
4800
6954
  let result;
4801
6955
  try {
4802
6956
  result = codec.search(data, filter);
4803
- } catch (err) {
4804
- throw new FilterEvaluationError(filter, err);
6957
+ } catch (err2) {
6958
+ throw new FilterEvaluationError(filter, err2);
4805
6959
  }
4806
- if (result == null)
6960
+ const inputCount = countRecords(data);
6961
+ const warn = (outcome) => {
6962
+ if (inputCount === 0)
6963
+ return;
6964
+ const note = buildFilterWarning(filter, data, outcome);
6965
+ getOutputSink().writeErr(`[WARN] ${note}
6966
+ `);
6967
+ onWarning?.(note);
6968
+ };
6969
+ const warnIfAllNull = (records) => {
6970
+ const keys = alwaysNullKeys(records);
6971
+ if (keys.length > 0)
6972
+ warn({ kind: "null-values", keys });
6973
+ };
6974
+ if (result == null) {
6975
+ warn({ kind: "empty" });
4807
6976
  return [];
6977
+ }
4808
6978
  if (Array.isArray(result)) {
6979
+ if (result.length === 0) {
6980
+ warn({ kind: "empty" });
6981
+ } else if (result.every((entry) => entry === null)) {
6982
+ warn({ kind: "null-elements", count: result.length });
6983
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
6984
+ warn({ kind: "null-rows", count: result.length });
6985
+ } else {
6986
+ warnIfAllNull(result);
6987
+ }
4809
6988
  if (result.length > 0 && typeof result[0] !== "object") {
4810
6989
  const fieldMatch = filter.match(/\.(\w+)$/);
4811
6990
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -4813,10 +6992,30 @@ function applyFilter(data, filter) {
4813
6992
  }
4814
6993
  return result;
4815
6994
  }
4816
- if (typeof result === "object")
6995
+ if (typeof result === "object") {
6996
+ warnIfAllNull([result]);
4817
6997
  return result;
6998
+ }
4818
6999
  return { Value: result };
4819
7000
  }
7001
+ function filterFailureData(envelope) {
7002
+ const filter = getOutputFilter();
7003
+ const data = envelope.Data;
7004
+ if (!filter || data == null)
7005
+ return;
7006
+ let note;
7007
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
7008
+ note = n;
7009
+ }));
7010
+ if (filterError) {
7011
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
7012
+ return;
7013
+ }
7014
+ envelope.Data = filtered;
7015
+ if (note) {
7016
+ envelope.Warning = appendWarning(envelope.Warning, note);
7017
+ }
7018
+ }
4820
7019
  function defaultErrorCodeForResult(result) {
4821
7020
  switch (result) {
4822
7021
  case RESULTS.AuthenticationError:
@@ -4860,7 +7059,7 @@ function defaultErrorCodeForHttpStatus(status) {
4860
7059
  return "server_error";
4861
7060
  return;
4862
7061
  }
4863
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
7062
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
4864
7063
  function defaultErrorCodeForFailure(data) {
4865
7064
  if (data.Result === RESULTS.Failure) {
4866
7065
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
@@ -4899,8 +7098,14 @@ var OutputFormatter;
4899
7098
  }
4900
7099
  const filter = getOutputFilter();
4901
7100
  if (filter) {
4902
- const filtered = applyFilter(data.Data, filter);
7101
+ let note;
7102
+ const filtered = applyFilter(data.Data, filter, (n) => {
7103
+ note = n;
7104
+ });
4903
7105
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
7106
+ if (note) {
7107
+ data.Warning = appendWarning(data.Warning, note);
7108
+ }
4904
7109
  }
4905
7110
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
4906
7111
  }
@@ -4928,12 +7133,13 @@ var OutputFormatter;
4928
7133
  delete envelope.TelemetryErrorClass;
4929
7134
  delete envelope.TelemetryTerminalOutcome;
4930
7135
  delete envelope.TelemetryTerminalSignal;
7136
+ filterFailureData(envelope);
4931
7137
  if (!suppressTelemetry) {
4932
7138
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
4933
- result: data.Result,
4934
- errorCode: data.ErrorCode,
4935
- retry: data.Retry,
4936
- message: data.Message
7139
+ [ErrorDimensions.Result]: data.Result,
7140
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
7141
+ [ErrorDimensions.Retry]: data.Retry,
7142
+ [ErrorDimensions.ErrorMessage]: data.Message
4937
7143
  });
4938
7144
  }
4939
7145
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -4976,13 +7182,20 @@ var OutputFormatter;
4976
7182
  OutputFormatter.log = log;
4977
7183
  function formatToString(data) {
4978
7184
  const filter = getOutputFilter();
7185
+ const envelope = data;
4979
7186
  if ("Data" in data && data.Data != null) {
4980
7187
  data.Data = normalizeDataKeys(data.Data);
4981
7188
  if (filter) {
4982
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
7189
+ let note;
7190
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
7191
+ note = n;
7192
+ }));
7193
+ if (note) {
7194
+ envelope.Warning = appendWarning(envelope.Warning, note);
7195
+ }
4983
7196
  }
4984
7197
  }
4985
- const output = normalizeOutputKeys(data);
7198
+ const output = normalizeOutputKeys(envelope);
4986
7199
  const lines = [];
4987
7200
  const sink = getOutputSink();
4988
7201
  printOutput(output, getOutputFormat(), (msg) => {
@@ -4999,7 +7212,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
4999
7212
  var MAX_SKILL_NAME_LENGTH = 80;
5000
7213
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
5001
7214
  function productMode(productArea, mode) {
5002
- return { product_area: productArea, mode };
7215
+ return { ProductArea: productArea, Mode: mode };
5003
7216
  }
5004
7217
  function attributionRecord(groups) {
5005
7218
  const record = {};
@@ -5057,6 +7270,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
5057
7270
  ["rpa", "build", ["uip.rpa-legacy"]],
5058
7271
  ["conversational", "operate", ["uip.conversational"]],
5059
7272
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
7273
+ ["coding-agents", "build", ["uip.coder"]],
5060
7274
  ["agenthub", "build", ["uip.agenthub"]],
5061
7275
  ["coded-apps", "build", ["uip.codedapp"]],
5062
7276
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -5142,32 +7356,64 @@ function normalizeSkillName(value) {
5142
7356
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
5143
7357
  const skillName = normalizeSkillName(skillSource);
5144
7358
  return {
5145
- ...skillName ? { skill_name: skillName } : {},
7359
+ ...skillName ? { SkillName: skillName } : {},
5146
7360
  ...getCommandProductModeAttribution(commandPath)
5147
7361
  };
5148
7362
  }
7363
+ var AGENT_SESSION_ENV = {
7364
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
7365
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
7366
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
7367
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
7368
+ };
7369
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
7370
+ function sanitizeTelemetryToken(value) {
7371
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
7372
+ }
7373
+ function buildAgentSessionTelemetry(env) {
7374
+ const dimensions = {};
7375
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
7376
+ const value = env[variable]?.trim();
7377
+ if (value) {
7378
+ dimensions[key] = sanitizeTelemetryToken(value);
7379
+ }
7380
+ }
7381
+ return dimensions;
7382
+ }
5149
7383
 
5150
7384
  // ../common/src/telemetry/command-name.ts
5151
- var TELEMETRY_COMMAND_ROOT = "uip";
7385
+ var TELEMETRY_NAME_ROOT = "Cli";
7386
+ var CLI_COMMAND_ROOT = "uip";
7387
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
5152
7388
  function commandTelemetryName(parts) {
7389
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
7390
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
7391
+ }
7392
+ function commandInvocationPath(parts) {
7393
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
7394
+ }
7395
+ function vetCommandTokens(parts) {
5153
7396
  const tokens = [];
5154
7397
  for (const part of parts) {
5155
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
7398
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
5156
7399
  if (pieces.every(isCommandToken)) {
5157
7400
  tokens.push(...pieces);
5158
7401
  continue;
5159
7402
  }
5160
7403
  tokens.push(UNKNOWN_TOKEN);
5161
7404
  }
5162
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
7405
+ return tokens;
7406
+ }
7407
+ function pascalizeToken(token) {
7408
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
5163
7409
  }
5164
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
7410
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
5165
7411
  var MAX_COMMAND_TOKEN_LENGTH = 32;
5166
7412
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
5167
7413
  function isCommandToken(token) {
5168
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
7414
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
5169
7415
  }
5170
- var UNKNOWN_TOKEN = "<unknown>";
7416
+ var UNKNOWN_TOKEN = "unknown";
5171
7417
 
5172
7418
  // ../common/src/telemetry/invocation-request.ts
5173
7419
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -5244,10 +7490,10 @@ function isDefaultedPositional(cmd, index) {
5244
7490
  function forEachSuppliedArgument(cmd, visit) {
5245
7491
  const registered = cmd.registeredArguments ?? [];
5246
7492
  const processed = cmd.processedArgs ?? [];
5247
- for (let i = 0;i < registered.length; i++) {
5248
- const name = registered[i].name();
5249
- if (name && processed[i] !== undefined) {
5250
- visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
7493
+ for (let i2 = 0;i2 < registered.length; i2++) {
7494
+ const name = registered[i2].name();
7495
+ if (name && processed[i2] !== undefined) {
7496
+ visit(name, processed[i2], registered[i2].argChoices, isDefaultedPositional(cmd, i2));
5251
7497
  }
5252
7498
  }
5253
7499
  const choicesByAttribute = new Map;
@@ -5272,7 +7518,7 @@ function withheldArgumentValues(cmd) {
5272
7518
  });
5273
7519
  return values;
5274
7520
  }
5275
- function deriveCommandPath(cmd) {
7521
+ function deriveCommandParts(cmd) {
5276
7522
  const parts = [];
5277
7523
  let current = cmd;
5278
7524
  while (current) {
@@ -5285,14 +7531,13 @@ function deriveCommandPath(cmd) {
5285
7531
  if (parts.length > 1) {
5286
7532
  parts.shift();
5287
7533
  }
5288
- return commandTelemetryName(parts);
7534
+ return parts;
5289
7535
  }
5290
7536
  function isErrorContext(value) {
5291
7537
  return value !== null && typeof value === "object";
5292
7538
  }
5293
7539
  function commandHelpHint(commandPath) {
5294
- const command = commandPath.replace(/\./g, " ");
5295
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
7540
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
5296
7541
  }
5297
7542
  function isPromptCancellation(error) {
5298
7543
  return error instanceof Error && error.name === "ExitPromptError";
@@ -5317,7 +7562,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5317
7562
  yaml: getOutputFormat() === "yaml",
5318
7563
  filter: getOutputFilter() !== undefined
5319
7564
  });
5320
- const telemetryName = deriveCommandPath(command);
7565
+ const commandParts = deriveCommandParts(command);
7566
+ const telemetryName = commandTelemetryName(commandParts);
7567
+ const commandPath = commandInvocationPath(commandParts);
5321
7568
  const props = typeof properties === "function" ? properties(...args) : properties;
5322
7569
  markCommandStart();
5323
7570
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -5352,7 +7599,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5352
7599
  Result: finalResult,
5353
7600
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
5354
7601
  Message: errorMessage,
5355
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
7602
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
5356
7603
  ...customRetry ? { Retry: customRetry } : {},
5357
7604
  ...customContext ? { Context: customContext } : {}
5358
7605
  });
@@ -5369,8 +7616,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5369
7616
  recordedFailure,
5370
7617
  pollSignal: context.pollSignal
5371
7618
  });
5372
- if (terminalTelemetry.error_class === "internal" && error) {
5373
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
7619
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
7620
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
5374
7621
  }
5375
7622
  const commandParams = extractCommandParams(command);
5376
7623
  if (props) {
@@ -5381,10 +7628,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5381
7628
  const baseProperties = redactProperties({
5382
7629
  ...commandParams,
5383
7630
  ...props,
5384
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
5385
- command: "true",
7631
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
7632
+ ...buildAgentSessionTelemetry(process.env),
7633
+ [CommandDimensions.CommandName]: commandPath,
7634
+ [CommandDimensions.IsCommand]: "true",
5386
7635
  ...terminalTelemetry,
5387
- ...errorMessage ? { errorMessage } : {}
7636
+ ...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
5388
7637
  });
5389
7638
  emitInvocationRequest(telemetryName, success, baseProperties);
5390
7639
  } finally {
@@ -5448,21 +7697,21 @@ function getShippedKeys() {
5448
7697
  }
5449
7698
  function dedupeKey(payload) {
5450
7699
  return [
5451
- payload.command_name,
5452
- payload.ship_kind,
5453
- payload.target,
5454
- payload.project_type,
5455
- payload.artifact_correlation_key ?? payload.package_version_key ?? payload.deployment_key ?? payload.solution_id ?? payload.package_name ?? ""
7700
+ payload.CommandName,
7701
+ payload.ShipKind,
7702
+ payload.Target,
7703
+ payload.ProjectType,
7704
+ payload.ArtifactCorrelationKey ?? payload.PackageVersionKey ?? payload.DeploymentKey ?? payload.SolutionId ?? payload.PackageName ?? ""
5456
7705
  ].join("|");
5457
7706
  }
5458
7707
  function withPseudonymizedIdentifiers(payload) {
5459
7708
  return {
5460
7709
  ...payload,
5461
- ...payload.package_name === undefined ? {} : {
5462
- package_name: `package#${pseudonymize(payload.package_name)}`
7710
+ ...payload.PackageName === undefined ? {} : {
7711
+ PackageName: `package#${pseudonymize(payload.PackageName)}`
5463
7712
  },
5464
- ...payload.artifact_correlation_key === undefined ? {} : {
5465
- artifact_correlation_key: `artifact#${pseudonymize(payload.artifact_correlation_key)}`
7713
+ ...payload.ArtifactCorrelationKey === undefined ? {} : {
7714
+ ArtifactCorrelationKey: `artifact#${pseudonymize(payload.ArtifactCorrelationKey)}`
5466
7715
  }
5467
7716
  };
5468
7717
  }
@@ -5735,6 +7984,40 @@ function canPrompt() {
5735
7984
  const capabilities = getOutputSink().capabilities;
5736
7985
  return capabilities.isInteractive && capabilities.canReadInput;
5737
7986
  }
7987
+ // ../common/src/mime-types.ts
7988
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
7989
+ pdf: "application/pdf",
7990
+ png: "image/png",
7991
+ jpg: "image/jpeg",
7992
+ jpeg: "image/jpeg",
7993
+ gif: "image/gif",
7994
+ webp: "image/webp",
7995
+ bmp: "image/bmp",
7996
+ tif: "image/tiff",
7997
+ tiff: "image/tiff",
7998
+ svg: "image/svg+xml",
7999
+ txt: "text/plain",
8000
+ log: "text/plain",
8001
+ md: "text/markdown",
8002
+ csv: "text/csv",
8003
+ tsv: "text/tab-separated-values",
8004
+ json: "application/json",
8005
+ xml: "application/xml",
8006
+ html: "text/html",
8007
+ htm: "text/html",
8008
+ yaml: "application/yaml",
8009
+ yml: "application/yaml",
8010
+ doc: "application/msword",
8011
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
8012
+ xls: "application/vnd.ms-excel",
8013
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
8014
+ ppt: "application/vnd.ms-powerpoint",
8015
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
8016
+ zip: "application/zip",
8017
+ mp3: "audio/mpeg",
8018
+ wav: "audio/wav",
8019
+ mp4: "video/mp4"
8020
+ });
5738
8021
  // ../common/src/polling/types.ts
5739
8022
  var PollOutcome = {
5740
8023
  Completed: "completed",
@@ -5780,6 +8063,7 @@ var ScreenLogger;
5780
8063
  })(ScreenLogger ||= {});
5781
8064
  // ../common/src/sdk-user-agent.ts
5782
8065
  var USER_AGENT_HEADER = "User-Agent";
8066
+ var AGENT_PROPERTY = BaseDimensions.Agent;
5783
8067
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
5784
8068
  function userAgentPatchKey(userAgent) {
5785
8069
  return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
@@ -5862,338 +8146,6 @@ function unsupportedSolutionProjectType(projectType) {
5862
8146
  }
5863
8147
  // ../common/src/tool-provider.ts
5864
8148
  var factorySlot = singleton("PackagerFactoryProvider");
5865
- // ../solution-sdk/src/solution-file.ts
5866
- var STUDIO_WEB_PROJECT_TYPE_OVERRIDES = {
5867
- ProcessOrchestration: "processOrchestration"
5868
- };
5869
- function normalizeProjectType(projectType) {
5870
- return STUDIO_WEB_PROJECT_TYPE_OVERRIDES[projectType] ?? projectType;
5871
- }
5872
- function toPortableRelativePath(relativePath) {
5873
- return relativePath.replace(/\\/g, "/");
5874
- }
5875
- function isRecord2(value) {
5876
- return typeof value === "object" && value !== null && !Array.isArray(value);
5877
- }
5878
- async function tryRegisterProjectInParentSolution(fs, projectDir, options) {
5879
- if (options?.skipRegistration) {
5880
- return {
5881
- Status: "OptedOut",
5882
- Message: "Solution auto-registration skipped (--skip-solution-registration).",
5883
- Instructions: buildOptedOutInstructions(fs.path.resolve(projectDir))
5884
- };
5885
- }
5886
- const [registrationError, registration] = await catchError(registerProjectInParentSolution(fs, projectDir));
5887
- if (registrationError) {
5888
- return {
5889
- Status: "Failed",
5890
- Message: "Project registration failed.",
5891
- Instructions: buildRegistrationFailureInstructions(projectDir, registrationError.message)
5892
- };
5893
- }
5894
- return registration;
5895
- }
5896
- async function registerProjectInParentSolution(fs, projectDir) {
5897
- const resolvedProjectDir = fs.path.resolve(projectDir);
5898
- const discovery = await findNearestParentUipxFile(fs, resolvedProjectDir);
5899
- if (discovery.status === "notFound") {
5900
- return {
5901
- Status: "NotInSolution",
5902
- Message: "Project created in standalone mode; no parent .uipx solution found.",
5903
- Instructions: buildStandaloneInstructions(resolvedProjectDir)
5904
- };
5905
- }
5906
- if (discovery.status === "skipped") {
5907
- return discovery.registration;
5908
- }
5909
- const solutionFile = discovery.solutionFile;
5910
- const solutionDir = fs.path.dirname(solutionFile);
5911
- const relativeProjectDir = fs.path.relative(solutionDir, resolvedProjectDir);
5912
- if (relativeProjectDir === "" || relativeProjectDir.startsWith("..") || fs.path.isAbsolute(relativeProjectDir)) {
5913
- return {
5914
- Status: "Skipped",
5915
- Message: "Project registration skipped.",
5916
- Solution: solutionFile,
5917
- Instructions: `Project must reside within the solution folder.
5918
- Solution: ${solutionDir}
5919
- Project: ${resolvedProjectDir}`
5920
- };
5921
- }
5922
- const [projectFileError, projectFile] = await findProjectFile(fs, resolvedProjectDir);
5923
- if (projectFileError) {
5924
- return {
5925
- Status: "Failed",
5926
- Message: "Project registration failed.",
5927
- Solution: solutionFile,
5928
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectFileError.message)
5929
- };
5930
- }
5931
- const [projectManifestError, projectManifest] = await readProjectManifest(fs, projectFile.filePath, projectFile.useProjectJson);
5932
- if (projectManifestError) {
5933
- return {
5934
- Status: "Failed",
5935
- Message: "Project registration failed.",
5936
- Solution: solutionFile,
5937
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, projectManifestError.message)
5938
- };
5939
- }
5940
- const unsupportedReason = unsupportedSolutionProjectType(projectManifest.projectType);
5941
- if (unsupportedReason) {
5942
- return {
5943
- Status: "Skipped",
5944
- Message: "Project registration skipped.",
5945
- Solution: solutionFile,
5946
- Instructions: unsupportedReason
5947
- };
5948
- }
5949
- const projectRelativePath = toPortableRelativePath(fs.path.join(relativeProjectDir, projectFile.fileName));
5950
- const [solutionError, solution] = await readSolutionManifest(fs, solutionFile);
5951
- if (solutionError) {
5952
- return {
5953
- Status: "Failed",
5954
- Message: "Project registration failed.",
5955
- Solution: solutionFile,
5956
- Project: projectRelativePath,
5957
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, solutionError.message)
5958
- };
5959
- }
5960
- const existingProject = solution.projects.find((project) => toPortableRelativePath(project.ProjectRelativePath) === projectRelativePath);
5961
- if (existingProject) {
5962
- return {
5963
- Status: "AlreadyRegistered",
5964
- Message: "Project already registered in solution.",
5965
- Solution: solutionFile,
5966
- Project: projectRelativePath,
5967
- ProjectId: typeof existingProject.Id === "string" ? existingProject.Id : undefined,
5968
- Instructions: buildRegistrationSuccessInstructions(solutionDir)
5969
- };
5970
- }
5971
- const projectId = crypto.randomUUID();
5972
- solution.projects.push({
5973
- Type: normalizeProjectType(projectManifest.projectType),
5974
- ProjectRelativePath: projectRelativePath,
5975
- Id: projectId
5976
- });
5977
- solution.content.Projects = solution.projects;
5978
- const [writeError] = await catchError(fs.writeFile(solutionFile, `${JSON.stringify(solution.content, null, 2)}
5979
- `));
5980
- if (writeError) {
5981
- return {
5982
- Status: "Failed",
5983
- Message: "Project registration failed.",
5984
- Solution: solutionFile,
5985
- Project: projectRelativePath,
5986
- Instructions: buildRegistrationFailureInstructions(resolvedProjectDir, writeError.message)
5987
- };
5988
- }
5989
- return {
5990
- Status: "Registered",
5991
- Message: "Project registered in parent solution.",
5992
- Solution: solutionFile,
5993
- Project: projectRelativePath,
5994
- ProjectId: projectId,
5995
- Instructions: buildRegistrationSuccessInstructions(solutionDir)
5996
- };
5997
- }
5998
- async function findNearestParentUipxFile(fs, projectDir) {
5999
- let currentDir = fs.path.dirname(fs.path.resolve(projectDir));
6000
- while (true) {
6001
- const [readDirError, entries] = await catchError(fs.readdir(currentDir));
6002
- if (readDirError) {
6003
- return {
6004
- status: "skipped",
6005
- registration: {
6006
- Status: "Failed",
6007
- Message: "Project registration failed.",
6008
- Instructions: buildRegistrationFailureInstructions(projectDir, `Could not inspect parent directory for a solution: ${currentDir}
6009
- ${readDirError.message}`)
6010
- }
6011
- };
6012
- }
6013
- const solutionFiles = entries.filter((entry) => entry.endsWith(".uipx"));
6014
- if (solutionFiles.length > 1) {
6015
- return {
6016
- status: "skipped",
6017
- registration: {
6018
- Status: "Skipped",
6019
- Message: "Project registration skipped.",
6020
- Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution projects add "${projectDir}" <solution.uipx>' to choose one.`
6021
- }
6022
- };
6023
- }
6024
- if (solutionFiles.length === 1) {
6025
- return {
6026
- status: "found",
6027
- solutionFile: fs.path.join(currentDir, solutionFiles[0])
6028
- };
6029
- }
6030
- const parentDir = fs.path.dirname(currentDir);
6031
- if (parentDir === currentDir) {
6032
- return { status: "notFound" };
6033
- }
6034
- currentDir = parentDir;
6035
- }
6036
- }
6037
- async function findProjectFile(fs, projectDir) {
6038
- const uiprojPath = fs.path.join(projectDir, "project.uiproj");
6039
- if (await fs.exists(uiprojPath)) {
6040
- return [
6041
- null,
6042
- {
6043
- filePath: uiprojPath,
6044
- fileName: "project.uiproj",
6045
- useProjectJson: false
6046
- }
6047
- ];
6048
- }
6049
- const jsonProjectPath = fs.path.join(projectDir, "project.json");
6050
- if (await fs.exists(jsonProjectPath)) {
6051
- return [
6052
- null,
6053
- {
6054
- filePath: jsonProjectPath,
6055
- fileName: "project.json",
6056
- useProjectJson: true
6057
- }
6058
- ];
6059
- }
6060
- return [
6061
- new Error(`No project file found in ${projectDir}. Expected project.uiproj or project.json.`),
6062
- null
6063
- ];
6064
- }
6065
- async function readProjectManifest(fs, filePath, useProjectJson) {
6066
- const [readError, rawContent] = await catchError(fs.readFile(filePath, "utf-8"));
6067
- if (readError || !rawContent) {
6068
- return [readError ?? new Error(`Unable to read ${filePath}.`), null];
6069
- }
6070
- const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
6071
- if (parseError) {
6072
- return [
6073
- new Error(`Invalid JSON in project file: ${parseError.message}`),
6074
- null
6075
- ];
6076
- }
6077
- if (!isRecord2(parsed)) {
6078
- return [new Error(`Invalid project file: ${filePath}`), null];
6079
- }
6080
- const designOptions = parsed.designOptions;
6081
- const outputType = useProjectJson && isRecord2(designOptions) ? readString(designOptions.outputType) : undefined;
6082
- const projectType = outputType ?? readString(parsed.ProjectType);
6083
- if (!projectType) {
6084
- return [new Error(`ProjectType not found in ${filePath}`), null];
6085
- }
6086
- return [
6087
- null,
6088
- {
6089
- projectType
6090
- }
6091
- ];
6092
- }
6093
- async function readSolutionManifest(fs, solutionFile) {
6094
- const [readError, rawContent] = await catchError(fs.readFile(solutionFile, "utf-8"));
6095
- if (readError || !rawContent) {
6096
- return [
6097
- readError ?? new Error(`Unable to read solution file: ${solutionFile}`),
6098
- null
6099
- ];
6100
- }
6101
- const [parseError, parsed] = catchError(() => JSON.parse(rawContent));
6102
- if (parseError) {
6103
- return [
6104
- new Error(`Invalid JSON in solution file: ${parseError.message}`),
6105
- null
6106
- ];
6107
- }
6108
- if (!isRecord2(parsed)) {
6109
- return [
6110
- new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
6111
- null
6112
- ];
6113
- }
6114
- if (!Array.isArray(parsed.Projects)) {
6115
- return [
6116
- new Error(`Invalid solution file: ${solutionFile} must contain a Projects array.`),
6117
- null
6118
- ];
6119
- }
6120
- const projects = [];
6121
- for (const [index, project] of parsed.Projects.entries()) {
6122
- if (!isRecord2(project)) {
6123
- return [
6124
- new Error(`Invalid solution file: Projects[${index}] must be an object.`),
6125
- null
6126
- ];
6127
- }
6128
- const projectRelativePath = readString(project.ProjectRelativePath);
6129
- if (!projectRelativePath) {
6130
- return [
6131
- new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution projects add' to repair the manifest.`),
6132
- null
6133
- ];
6134
- }
6135
- projects.push({
6136
- ...project,
6137
- Type: readString(project.Type) ?? "",
6138
- ProjectRelativePath: projectRelativePath,
6139
- Id: readString(project.Id) ?? ""
6140
- });
6141
- }
6142
- return [null, { content: parsed, projects }];
6143
- }
6144
- function readString(value) {
6145
- return typeof value === "string" && value.length > 0 ? value : undefined;
6146
- }
6147
- function buildRegistrationSuccessInstructions(solutionDir) {
6148
- return [
6149
- "The project is listed in the parent solution manifest.",
6150
- "Packing or uploading the solution will sync solution resources automatically.",
6151
- `To sync resources before packaging, run 'uip solution resources refresh --solution-folder "${solutionDir}"'.`
6152
- ].join(`
6153
- `);
6154
- }
6155
- function buildRegistrationFailureInstructions(projectDir, details) {
6156
- return [
6157
- "Automatic solution registration could not complete.",
6158
- `Run 'uip solution projects add "${projectDir}" <solution.uipx>' after checking the project and solution files.`,
6159
- `Details: ${details}`
6160
- ].join(`
6161
- `);
6162
- }
6163
- function buildStandaloneInstructions(projectDir) {
6164
- return [
6165
- "No parent solution was found by walking ancestor directories.",
6166
- "Studio Web upload, `flow debug`, and packaging require an enclosing solution.",
6167
- `To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution projects add "${projectDir}" <SolutionName>.uipx'.`
6168
- ].join(`
6169
- `);
6170
- }
6171
- function buildOptedOutInstructions(projectDir) {
6172
- return [
6173
- "Automatic solution registration was skipped because --skip-solution-registration was passed.",
6174
- `To register this project later, run 'uip solution projects add "${projectDir}" <SolutionName>.uipx' from within the solution.`
6175
- ].join(`
6176
- `);
6177
- }
6178
- async function findSolutionFileUpward(fs, startDir) {
6179
- let dir = startDir;
6180
- while (true) {
6181
- const entries = await fs.readdir(dir);
6182
- const files = entries.filter((f) => f.endsWith(".uipx"));
6183
- if (files.length === 1) {
6184
- return fs.path.join(dir, files[0]);
6185
- }
6186
- if (files.length > 1) {
6187
- throw new Error(`Multiple .uipx files found in ${dir}. Please specify which solution file to use.`);
6188
- }
6189
- const parent = fs.path.dirname(dir);
6190
- if (parent === dir) {
6191
- throw new Error(`No .uipx solution file found (searched from ${startDir} to filesystem root)`);
6192
- }
6193
- dir = parent;
6194
- }
6195
- }
6196
-
6197
- export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, RESULTS, EXIT_CODES, ConfigurationError, isConfigurationError, OutputFormatter, InvalidArgumentError, Command, Option, processContext, requireConfirmation, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, toPortableRelativePath, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward };
8149
+ export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, CommandDimensions, ShipDimensions, telemetry, RESULTS, EXIT_CODES, ConfigurationError, isConfigurationError, OutputFormatter, InvalidArgumentError, Command, Option, processContext, requireConfirmation, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, trackShipSucceeded, Path, TemporaryStorageService, NugetConstants, ToolResult, NugetPackager, ProjectTool, toolsFactoryRepository };
6198
8150
 
6199
- //# debugId=401ACF1EEAAA614364756E2164756E21
8151
+ //# debugId=94862DA77CABA01964756E2164756E21