@uipath/codedapp-tool 1.201.0-preview.133 → 1.202.0-preview.134

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,14 +1,14 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./tool-4pvh3k50.js";
3
+ } from "./packager-tool-qyctya2j.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __require,
7
7
  __toESM
8
- } from "./tool-wckvcay0.js";
8
+ } from "./packager-tool-1yh8g550.js";
9
9
 
10
10
  // ../../node_modules/commander/lib/error.js
11
- var require_error = __commonJS((exports) => {
11
+ var require_error = __commonJS(function(exports) {
12
12
  class CommanderError extends Error {
13
13
  constructor(exitCode, code, message) {
14
14
  super(message);
@@ -32,7 +32,7 @@ var require_error = __commonJS((exports) => {
32
32
  });
33
33
 
34
34
  // ../../node_modules/commander/lib/argument.js
35
- var require_argument = __commonJS((exports) => {
35
+ var require_argument = __commonJS(function(exports) {
36
36
  var { InvalidArgumentError } = require_error();
37
37
 
38
38
  class Argument {
@@ -112,7 +112,7 @@ var require_argument = __commonJS((exports) => {
112
112
  });
113
113
 
114
114
  // ../../node_modules/commander/lib/help.js
115
- var require_help = __commonJS((exports) => {
115
+ var require_help = __commonJS(function(exports) {
116
116
  var { humanReadableArgName } = require_argument();
117
117
 
118
118
  class Help {
@@ -469,7 +469,7 @@ ${itemIndentStr}`);
469
469
  });
470
470
 
471
471
  // ../../node_modules/commander/lib/option.js
472
- var require_option = __commonJS((exports) => {
472
+ var require_option = __commonJS(function(exports) {
473
473
  var { InvalidArgumentError } = require_error();
474
474
 
475
475
  class Option {
@@ -653,7 +653,7 @@ var require_option = __commonJS((exports) => {
653
653
  });
654
654
 
655
655
  // ../../node_modules/commander/lib/suggestSimilar.js
656
- var require_suggestSimilar = __commonJS((exports) => {
656
+ var require_suggestSimilar = __commonJS(function(exports) {
657
657
  var maxDistance = 3;
658
658
  function editDistance(a, b) {
659
659
  if (Math.abs(a.length - b.length) > maxDistance)
@@ -726,7 +726,7 @@ var require_suggestSimilar = __commonJS((exports) => {
726
726
  });
727
727
 
728
728
  // ../../node_modules/commander/lib/command.js
729
- var require_command = __commonJS((exports) => {
729
+ var require_command = __commonJS(function(exports) {
730
730
  var EventEmitter = __require("node:events").EventEmitter;
731
731
  var childProcess = __require("node:child_process");
732
732
  var path = __require("node:path");
@@ -2081,7 +2081,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2081
2081
  });
2082
2082
 
2083
2083
  // ../../node_modules/commander/index.js
2084
- var require_commander = __commonJS((exports) => {
2084
+ var require_commander = __commonJS(function(exports) {
2085
2085
  var { Argument } = require_argument();
2086
2086
  var { Command } = require_command();
2087
2087
  var { CommanderError, InvalidArgumentError } = require_error();
@@ -2116,7 +2116,519 @@ var {
2116
2116
  Help
2117
2117
  } = import__.default;
2118
2118
 
2119
+ // ../common/src/telemetry/pseudonymize.ts
2120
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2121
+ var PSEUDONYM_HEX_LENGTH = 32;
2122
+ var SHA256_K = new Uint32Array([
2123
+ 1116352408,
2124
+ 1899447441,
2125
+ 3049323471,
2126
+ 3921009573,
2127
+ 961987163,
2128
+ 1508970993,
2129
+ 2453635748,
2130
+ 2870763221,
2131
+ 3624381080,
2132
+ 310598401,
2133
+ 607225278,
2134
+ 1426881987,
2135
+ 1925078388,
2136
+ 2162078206,
2137
+ 2614888103,
2138
+ 3248222580,
2139
+ 3835390401,
2140
+ 4022224774,
2141
+ 264347078,
2142
+ 604807628,
2143
+ 770255983,
2144
+ 1249150122,
2145
+ 1555081692,
2146
+ 1996064986,
2147
+ 2554220882,
2148
+ 2821834349,
2149
+ 2952996808,
2150
+ 3210313671,
2151
+ 3336571891,
2152
+ 3584528711,
2153
+ 113926993,
2154
+ 338241895,
2155
+ 666307205,
2156
+ 773529912,
2157
+ 1294757372,
2158
+ 1396182291,
2159
+ 1695183700,
2160
+ 1986661051,
2161
+ 2177026350,
2162
+ 2456956037,
2163
+ 2730485921,
2164
+ 2820302411,
2165
+ 3259730800,
2166
+ 3345764771,
2167
+ 3516065817,
2168
+ 3600352804,
2169
+ 4094571909,
2170
+ 275423344,
2171
+ 430227734,
2172
+ 506948616,
2173
+ 659060556,
2174
+ 883997877,
2175
+ 958139571,
2176
+ 1322822218,
2177
+ 1537002063,
2178
+ 1747873779,
2179
+ 1955562222,
2180
+ 2024104815,
2181
+ 2227730452,
2182
+ 2361852424,
2183
+ 2428436474,
2184
+ 2756734187,
2185
+ 3204031479,
2186
+ 3329325298
2187
+ ]);
2188
+ var SHA256_INITIAL_STATE = new Uint32Array([
2189
+ 1779033703,
2190
+ 3144134277,
2191
+ 1013904242,
2192
+ 2773480762,
2193
+ 1359893119,
2194
+ 2600822924,
2195
+ 528734635,
2196
+ 1541459225
2197
+ ]);
2198
+ function rotr(value, bits) {
2199
+ return (value >>> bits | value << 32 - bits) >>> 0;
2200
+ }
2201
+ function sha256Hex(input) {
2202
+ const bytes = new TextEncoder().encode(input);
2203
+ const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2204
+ const buffer = new Uint8Array(paddedLength);
2205
+ buffer.set(bytes);
2206
+ buffer[bytes.length] = 128;
2207
+ const view = new DataView(buffer.buffer);
2208
+ const bitLength = bytes.length * 8;
2209
+ view.setUint32(paddedLength - 8, Math.floor(bitLength / 4294967296));
2210
+ view.setUint32(paddedLength - 4, bitLength >>> 0);
2211
+ const state = SHA256_INITIAL_STATE.slice();
2212
+ const schedule = new Uint32Array(64);
2213
+ for (let offset = 0;offset < paddedLength; offset += 64) {
2214
+ for (let i = 0;i < 16; i++) {
2215
+ schedule[i] = view.getUint32(offset + i * 4);
2216
+ }
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;
2221
+ const s1 = (rotr(y, 17) ^ rotr(y, 19) ^ y >>> 10) >>> 0;
2222
+ schedule[i] = schedule[i - 16] + s0 + schedule[i - 7] + s1 >>> 0;
2223
+ }
2224
+ let a = state[0];
2225
+ let b = state[1];
2226
+ let c = state[2];
2227
+ let d = state[3];
2228
+ let e = state[4];
2229
+ let f = state[5];
2230
+ let g = state[6];
2231
+ let h = state[7];
2232
+ for (let i = 0;i < 64; i++) {
2233
+ const s1 = (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) >>> 0;
2234
+ const ch = (e & f ^ ~e & g) >>> 0;
2235
+ const temp1 = h + s1 + ch + SHA256_K[i] + schedule[i] >>> 0;
2236
+ const s0 = (rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) >>> 0;
2237
+ const maj = (a & b ^ a & c ^ b & c) >>> 0;
2238
+ const temp2 = s0 + maj >>> 0;
2239
+ h = g;
2240
+ g = f;
2241
+ f = e;
2242
+ e = d + temp1 >>> 0;
2243
+ d = c;
2244
+ c = b;
2245
+ b = a;
2246
+ a = temp1 + temp2 >>> 0;
2247
+ }
2248
+ state[0] = state[0] + a >>> 0;
2249
+ state[1] = state[1] + b >>> 0;
2250
+ state[2] = state[2] + c >>> 0;
2251
+ state[3] = state[3] + d >>> 0;
2252
+ state[4] = state[4] + e >>> 0;
2253
+ state[5] = state[5] + f >>> 0;
2254
+ state[6] = state[6] + g >>> 0;
2255
+ state[7] = state[7] + h >>> 0;
2256
+ }
2257
+ let hex = "";
2258
+ for (const word of state) {
2259
+ hex += word.toString(16).padStart(8, "0");
2260
+ }
2261
+ return hex;
2262
+ }
2263
+ function resolveSha256Hex() {
2264
+ try {
2265
+ const nodeCrypto = __require("node:crypto");
2266
+ const createHash = nodeCrypto?.createHash;
2267
+ if (typeof createHash !== "function") {
2268
+ return sha256Hex;
2269
+ }
2270
+ const native = (input) => createHash("sha256").update(input, "utf8").digest("hex");
2271
+ return native("abc") === sha256Hex("abc") ? native : sha256Hex;
2272
+ } catch {
2273
+ return sha256Hex;
2274
+ }
2275
+ }
2276
+ var cachedSha256Hex;
2277
+ function digest(input) {
2278
+ cachedSha256Hex ??= resolveSha256Hex();
2279
+ return cachedSha256Hex(input);
2280
+ }
2281
+ function pseudonymize(input) {
2282
+ return digest(`${PSEUDONYM_DOMAIN}${input}`).slice(0, PSEUDONYM_HEX_LENGTH);
2283
+ }
2284
+
2285
+ // ../common/src/singleton.ts
2286
+ var PREFIX = "@uipath/common/";
2287
+ var _g = globalThis;
2288
+ function singleton(ctorOrName) {
2289
+ const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
2290
+ const key = Symbol.for(PREFIX + name);
2291
+ return {
2292
+ get(fallback) {
2293
+ return _g[key] ?? fallback;
2294
+ },
2295
+ set(value) {
2296
+ _g[key] = value;
2297
+ },
2298
+ clear() {
2299
+ delete _g[key];
2300
+ },
2301
+ getOrInit(factory, guard) {
2302
+ const existing = _g[key];
2303
+ if (existing != null && typeof existing === "object") {
2304
+ if (!guard || guard(existing)) {
2305
+ return existing;
2306
+ }
2307
+ }
2308
+ const instance = factory();
2309
+ _g[key] = instance;
2310
+ return instance;
2311
+ }
2312
+ };
2313
+ }
2314
+
2315
+ // ../common/src/telemetry/supplied-values.ts
2316
+ var suppliedValuesSlot = singleton("TelemetrySuppliedArgumentValues");
2317
+ function activeEntries() {
2318
+ const existing = suppliedValuesSlot.get();
2319
+ return Array.isArray(existing) ? existing : [];
2320
+ }
2321
+ var MIN_SCRUBBABLE_LENGTH = 4;
2322
+ function recordSuppliedArgumentValues(values) {
2323
+ const flat = [];
2324
+ const push = (value) => {
2325
+ if (Array.isArray(value)) {
2326
+ for (const item of value) {
2327
+ push(item);
2328
+ }
2329
+ return;
2330
+ }
2331
+ if (typeof value === "string" && value.length >= MIN_SCRUBBABLE_LENGTH) {
2332
+ flat.push(value);
2333
+ }
2334
+ };
2335
+ push(values);
2336
+ const entry = { values: flat };
2337
+ suppliedValuesSlot.set([...activeEntries(), entry]);
2338
+ return entry;
2339
+ }
2340
+ function releaseSuppliedArgumentValues(entry) {
2341
+ suppliedValuesSlot.set(activeEntries().filter((held) => held !== entry));
2342
+ }
2343
+ function getSuppliedArgumentValues() {
2344
+ const all = new Set;
2345
+ for (const entry of activeEntries()) {
2346
+ for (const value of entry.values) {
2347
+ all.add(value);
2348
+ }
2349
+ }
2350
+ return [...all].sort((a, b) => b.length - a.length);
2351
+ }
2352
+
2353
+ // ../common/src/telemetry/pii-redactor.ts
2354
+ var REDACTED = "[REDACTED]";
2355
+ var MAX_VALUE_LENGTH = 280;
2356
+ var MAX_STACK_LENGTH = 4096;
2357
+ var MAX_SCAN_LENGTH = MAX_STACK_LENGTH;
2358
+ function truncate(value, maxLength) {
2359
+ return value.length > maxLength ? `${value.slice(0, maxLength)}…` : value;
2360
+ }
2361
+ var SENSITIVE_NAME_TOKENS = new Set([
2362
+ "token",
2363
+ "tokens",
2364
+ "secret",
2365
+ "secrets",
2366
+ "password",
2367
+ "passwords",
2368
+ "pwd",
2369
+ "credential",
2370
+ "credentials",
2371
+ "auth",
2372
+ "authentication",
2373
+ "authorization",
2374
+ "authority",
2375
+ "cert",
2376
+ "certificate",
2377
+ "certificates"
2378
+ ]);
2379
+ var SENSITIVE_KEY_PREFIXES = new Set([
2380
+ "api",
2381
+ "access",
2382
+ "client",
2383
+ "private",
2384
+ "public",
2385
+ "signing",
2386
+ "encryption",
2387
+ "session",
2388
+ "master",
2389
+ "shared",
2390
+ "root",
2391
+ "ssh",
2392
+ "rsa",
2393
+ "aes",
2394
+ "hmac",
2395
+ "oauth"
2396
+ ]);
2397
+ var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
2398
+ var EMAIL_PATTERN = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
2399
+ var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
2400
+ var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
2401
+ var PADDED_BASE64_PATTERN = /[A-Za-z0-9+/]{16,}={1,2}(?![A-Za-z0-9+/=])/g;
2402
+ var BASE64_WITH_PLUS_PATTERN = /[A-Za-z0-9+/]{40,}/g;
2403
+ var USER_HOME_PATTERN = /(?<![A-Za-z0-9._-])([/\\])(Users|home|Profiles)([/\\])([^/\\]+)/gi;
2404
+ var UNC_PATH_PATTERN = /(^|[\s"'<>|=,;([{])(\\\\[^\s"'<>|]+)/g;
2405
+ var HOST_PORT_PATTERN = /(?<![/@.\w-])(?!\d+\.\d+\.\d+\.\d+:)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+:\d{1,5}\b/g;
2406
+ var SOURCE_FILE_EXTENSIONS = new Set([
2407
+ "ts",
2408
+ "tsx",
2409
+ "js",
2410
+ "jsx",
2411
+ "mjs",
2412
+ "cjs",
2413
+ "cts",
2414
+ "mts",
2415
+ "py",
2416
+ "cs",
2417
+ "java",
2418
+ "go",
2419
+ "rs",
2420
+ "rb",
2421
+ "php",
2422
+ "sh",
2423
+ "ps1",
2424
+ "json",
2425
+ "jsonc",
2426
+ "yaml",
2427
+ "yml",
2428
+ "xml",
2429
+ "xaml",
2430
+ "md",
2431
+ "txt",
2432
+ "log",
2433
+ "css",
2434
+ "html",
2435
+ "htm",
2436
+ "csproj",
2437
+ "nuspec",
2438
+ "sql"
2439
+ ]);
2440
+ var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
2441
+ var QUOTED_LITERAL_MAX_SPAN = 200;
2442
+ var QUOTED_LITERAL_PATTERN = new RegExp([
2443
+ `(?<![A-Za-z0-9])'(?:[^\\
2444
+ ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?'(?![A-Za-z0-9])`,
2445
+ `(?<![A-Za-z0-9])"(?:[^\\
2446
+ ]|\\.){2,${QUOTED_LITERAL_MAX_SPAN}}?"(?![A-Za-z0-9])`
2447
+ ].join("|"), "g");
2448
+ var JSON_BODY_PATTERN = /[{[][^{}[\]]*[:,][^{}[\]]*[\]}]/g;
2449
+ var COLLAPSED_BODY = "{…}";
2450
+ var COLLAPSED_BODY_MARKER = "\x01body\x01";
2451
+ var MAX_BODY_NESTING = 8;
2452
+ function collapseJsonBodies(text) {
2453
+ let out = text;
2454
+ for (let pass = 0;pass < MAX_BODY_NESTING; pass++) {
2455
+ const next = out.replace(JSON_BODY_PATTERN, COLLAPSED_BODY_MARKER);
2456
+ if (next === out) {
2457
+ break;
2458
+ }
2459
+ out = next;
2460
+ }
2461
+ return out.split(COLLAPSED_BODY_MARKER).join(COLLAPSED_BODY);
2462
+ }
2463
+ var TRAILING_PROSE_PUNCT = /[.,;:!?)\]}>'"]+$/;
2464
+ function peelTrailingPunctuation(match) {
2465
+ const trailing = match.match(TRAILING_PROSE_PUNCT)?.[0] ?? "";
2466
+ return trailing ? [match.slice(0, -trailing.length), trailing] : [match, ""];
2467
+ }
2468
+ function redactUrl(raw) {
2469
+ try {
2470
+ const url = new URL(raw);
2471
+ return `${url.protocol}//${url.host}`;
2472
+ } catch {
2473
+ return `url#${pseudonymize(raw)}`;
2474
+ }
2475
+ }
2476
+ function redactValueDetectors(value, maxLength = MAX_VALUE_LENGTH) {
2477
+ let out = truncate(value, MAX_SCAN_LENGTH);
2478
+ out = out.replace(JWT_PATTERN, () => REDACTED);
2479
+ out = out.replace(URL_PATTERN, (match) => {
2480
+ const [core, trailing] = peelTrailingPunctuation(match);
2481
+ return `${redactUrl(core)}${trailing}`;
2482
+ });
2483
+ out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
2484
+ out = out.replace(UNC_PATH_PATTERN, (_match, before, path) => {
2485
+ const [core, trailing] = peelTrailingPunctuation(path);
2486
+ return `${before}unc#${pseudonymize(core)}${trailing}`;
2487
+ });
2488
+ out = out.replace(EMAIL_PATTERN, (match) => `email#${pseudonymize(match)}`);
2489
+ out = out.replace(UUID_PATTERN, (match) => `uuid#${pseudonymize(match)}`);
2490
+ out = out.replace(HOST_PORT_PATTERN, (match) => {
2491
+ const split = match.lastIndexOf(":");
2492
+ const host = match.slice(0, split);
2493
+ const extension = host.slice(host.lastIndexOf(".") + 1).toLowerCase();
2494
+ if (SOURCE_FILE_EXTENSIONS.has(extension)) {
2495
+ return match;
2496
+ }
2497
+ return `host#${pseudonymize(host)}:${match.slice(split + 1)}`;
2498
+ });
2499
+ out = out.replace(PADDED_BASE64_PATTERN, () => REDACTED);
2500
+ out = out.replace(BASE64_WITH_PLUS_PATTERN, (match) => match.includes("+") ? REDACTED : match);
2501
+ out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
2502
+ return truncate(out, maxLength);
2503
+ }
2504
+ function redactSpanName(name) {
2505
+ return redactValueDetectors(truncate(name, MAX_SCAN_LENGTH).replace(QUOTED_LITERAL_PATTERN, (match) => `${match[0]}<redacted>${match[0]}`));
2506
+ }
2507
+ var HTTP_DEPENDENCY_NAME = /^([A-Z]+) (\/.*)$/s;
2508
+ function redactHttpDependencyName(name) {
2509
+ const parts = HTTP_DEPENDENCY_NAME.exec(name);
2510
+ if (!parts) {
2511
+ return redactMessage(name);
2512
+ }
2513
+ return `${parts[1]} ${redactMessage(parts[2])}`;
2514
+ }
2515
+ function redactMessage(value) {
2516
+ let out = collapseJsonBodies(truncate(value, MAX_SCAN_LENGTH)).replace(QUOTED_LITERAL_PATTERN, (match) => `${match[0]}<redacted>${match[0]}`);
2517
+ for (const supplied of getSuppliedArgumentValues()) {
2518
+ out = out.split(supplied).join(REDACTED);
2519
+ }
2520
+ return redactValueDetectors(out);
2521
+ }
2522
+ var MESSAGE_NAMES = new Set([
2523
+ "message",
2524
+ "errormessage",
2525
+ "errmessage",
2526
+ "error_message",
2527
+ "msg",
2528
+ "detail",
2529
+ "details",
2530
+ "reason",
2531
+ "instructions",
2532
+ "warning"
2533
+ ]);
2534
+ function isFreeFormValue(name, value) {
2535
+ return MESSAGE_NAMES.has(name.toLowerCase()) || /['"{[]/.test(value);
2536
+ }
2537
+ function redactError(error) {
2538
+ const safe = new Error(redactMessage(error.message ?? ""));
2539
+ safe.name = error.name;
2540
+ safe.stack = typeof error.stack === "string" ? redactStack(error.stack) : undefined;
2541
+ return safe;
2542
+ }
2543
+ function redactStack(stack) {
2544
+ const bounded = truncate(stack, MAX_STACK_LENGTH);
2545
+ const firstBreak = bounded.indexOf(`
2546
+ `);
2547
+ if (firstBreak === -1) {
2548
+ return redactMessage(bounded);
2549
+ }
2550
+ return `${redactMessage(bounded.slice(0, firstBreak))}
2551
+ ${redactValueDetectors(bounded.slice(firstBreak + 1), MAX_STACK_LENGTH)}`;
2552
+ }
2553
+ function nameTokens(name) {
2554
+ return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
2555
+ }
2556
+ function isSensitiveName(name) {
2557
+ const tokens = nameTokens(name);
2558
+ for (let i = 0;i < tokens.length; i++) {
2559
+ const token = tokens[i];
2560
+ if (SENSITIVE_NAME_TOKENS.has(token)) {
2561
+ return true;
2562
+ }
2563
+ if (token === "key" || token === "keys") {
2564
+ const prev = tokens[i - 1];
2565
+ if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
2566
+ return true;
2567
+ }
2568
+ }
2569
+ }
2570
+ return false;
2571
+ }
2572
+ function redactProperty(name, value) {
2573
+ if (value === undefined || value === null) {
2574
+ return;
2575
+ }
2576
+ if (isSensitiveName(name)) {
2577
+ return REDACTED;
2578
+ }
2579
+ if (typeof value === "boolean" || typeof value === "number") {
2580
+ return value;
2581
+ }
2582
+ if (typeof value !== "string") {
2583
+ return "[OBJECT]";
2584
+ }
2585
+ return isFreeFormValue(name, value) ? redactMessage(value) : redactValueDetectors(value);
2586
+ }
2587
+ function redactProperties(properties) {
2588
+ const out = {};
2589
+ for (const [name, value] of Object.entries(properties)) {
2590
+ const redacted = redactProperty(name, value);
2591
+ if (redacted !== undefined) {
2592
+ out[name] = redacted;
2593
+ }
2594
+ }
2595
+ return out;
2596
+ }
2597
+
2119
2598
  // ../common/src/catch-error.ts
2599
+ var MAX_SERIALIZED_LENGTH = 500;
2600
+ var TRUNCATION_SUFFIX = "…(truncated)";
2601
+ var REDACTED2 = "[REDACTED]";
2602
+ function cap(text) {
2603
+ return text.length > MAX_SERIALIZED_LENGTH ? `${text.slice(0, MAX_SERIALIZED_LENGTH)}${TRUNCATION_SUFFIX}` : text;
2604
+ }
2605
+ function omitSensitive(key, value) {
2606
+ return key.length > 0 && isSensitiveName(key) ? REDACTED2 : value;
2607
+ }
2608
+ function describeThrownValue(value) {
2609
+ if (typeof value !== "object" || value === null) {
2610
+ return String(value);
2611
+ }
2612
+ let message;
2613
+ try {
2614
+ message = value.message;
2615
+ } catch {
2616
+ message = undefined;
2617
+ }
2618
+ if (typeof message === "string" && message.length > 0) {
2619
+ return cap(message);
2620
+ }
2621
+ try {
2622
+ const json = JSON.stringify(value, omitSensitive);
2623
+ if (json !== undefined) {
2624
+ return cap(json);
2625
+ }
2626
+ } catch {}
2627
+ return String(value);
2628
+ }
2629
+ function toError(error) {
2630
+ return error instanceof Error ? error : new Error(describeThrownValue(error), { cause: error });
2631
+ }
2120
2632
  function isPromiseLike(value) {
2121
2633
  return value !== null && typeof value === "object" && typeof value.then === "function";
2122
2634
  }
@@ -2131,17 +2643,11 @@ function catchError(fnOrPromise) {
2131
2643
  }
2132
2644
  return [undefined, result];
2133
2645
  } catch (error) {
2134
- return [
2135
- error instanceof Error ? error : new Error(String(error)),
2136
- undefined
2137
- ];
2646
+ return [toError(error), undefined];
2138
2647
  }
2139
2648
  }
2140
2649
  function settlePromiseLike(thenable) {
2141
- return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [
2142
- error instanceof Error ? error : new Error(String(error)),
2143
- undefined
2144
- ]);
2650
+ return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
2145
2651
  }
2146
2652
 
2147
2653
  // ../common/src/error-handler.ts
@@ -2446,7 +2952,7 @@ async function extractErrorDetails(error, options) {
2446
2952
  } else if (typeof err.message === "string") {
2447
2953
  details = err.message;
2448
2954
  } else {
2449
- details = String(error);
2955
+ details = describeThrownValue(error);
2450
2956
  }
2451
2957
  const context = {};
2452
2958
  if (status) {
@@ -2523,36 +3029,6 @@ async function extractErrorMessage(error, options) {
2523
3029
  return message;
2524
3030
  }
2525
3031
 
2526
- // ../common/src/singleton.ts
2527
- var PREFIX = "@uipath/common/";
2528
- var _g = globalThis;
2529
- function singleton(ctorOrName) {
2530
- const name = typeof ctorOrName === "string" ? ctorOrName : ctorOrName.name;
2531
- const key = Symbol.for(PREFIX + name);
2532
- return {
2533
- get(fallback) {
2534
- return _g[key] ?? fallback;
2535
- },
2536
- set(value) {
2537
- _g[key] = value;
2538
- },
2539
- clear() {
2540
- delete _g[key];
2541
- },
2542
- getOrInit(factory, guard) {
2543
- const existing = _g[key];
2544
- if (existing != null && typeof existing === "object") {
2545
- if (!guard || guard(existing)) {
2546
- return existing;
2547
- }
2548
- }
2549
- const instance = factory();
2550
- _g[key] = instance;
2551
- return instance;
2552
- }
2553
- };
2554
- }
2555
-
2556
3032
  // ../common/src/output-context.ts
2557
3033
  function createStorage() {
2558
3034
  const [error, mod] = catchError(() => __require("node:async_hooks"));
@@ -2664,45 +3140,40 @@ class SimpleLogger {
2664
3140
  this.pendingInit
2665
3141
  ]).then(() => getFileSystem().appendFile(path, `${timestamp} ${formatted}`).catch(() => {}));
2666
3142
  }
2667
- debug(message, ...args) {
2668
- if (this.level > 0 /* DEBUG */)
2669
- return;
2670
- const formatted = this.format(`[DEBUG] ${message}`, args);
3143
+ write(formatted) {
2671
3144
  if (this.isFileLoggingActive()) {
2672
3145
  this.writeToFile(formatted);
2673
3146
  } else {
2674
3147
  getOutputSink().writeErr(formatted);
2675
3148
  }
2676
3149
  }
3150
+ debug(message, ...args) {
3151
+ if (this.level > 0 /* DEBUG */)
3152
+ return;
3153
+ const formatted = this.format(`[DEBUG] ${message}`, args);
3154
+ this.write(formatted);
3155
+ }
2677
3156
  info(message, ...args) {
2678
3157
  if (this.level > 1 /* INFO */)
2679
3158
  return;
2680
3159
  const formatted = this.format(message, args);
2681
- if (this.isFileLoggingActive()) {
2682
- this.writeToFile(formatted);
2683
- } else {
2684
- getOutputSink().writeErr(formatted);
2685
- }
3160
+ this.write(formatted);
2686
3161
  }
2687
3162
  warn(message, ...args) {
2688
3163
  if (this.level > 2 /* WARN */)
2689
3164
  return;
2690
3165
  const formatted = this.format(`[WARN] ${message}`, args);
2691
- if (this.isFileLoggingActive()) {
2692
- this.writeToFile(formatted);
2693
- } else {
2694
- getOutputSink().writeErr(formatted);
2695
- }
3166
+ this.write(formatted);
2696
3167
  }
2697
3168
  error(message, ...args) {
2698
3169
  if (this.level > 3 /* ERROR */)
2699
3170
  return;
2700
3171
  const formatted = this.format(`[ERROR] ${message}`, args);
2701
- if (this.isFileLoggingActive()) {
2702
- this.writeToFile(formatted);
2703
- } else {
2704
- getOutputSink().writeErr(formatted);
2705
- }
3172
+ this.write(formatted);
3173
+ }
3174
+ report(message) {
3175
+ const formatted = this.format(message, []);
3176
+ this.write(formatted);
2706
3177
  }
2707
3178
  getLevel() {
2708
3179
  return this.level;
@@ -2775,18 +3246,23 @@ function getLogFilePath() {
2775
3246
  return logger.getLogFilePath();
2776
3247
  }
2777
3248
 
3249
+ // ../common/src/exit-code.ts
3250
+ function setExitCode(code) {
3251
+ process.exitCode = code;
3252
+ }
3253
+
2778
3254
  // ../common/src/output-codecs.ts
2779
3255
  var yamlSlot = singleton("YamlCodec");
2780
3256
  var jmespathSlot = singleton("JmespathCodec");
2781
3257
  async function loadOutputCodecsAsync(needed) {
2782
3258
  const loads = [];
2783
3259
  if (needed.yaml && yamlSlot.get() === undefined) {
2784
- loads.push(import("./js-yaml-cggj6w7q.js").then((mod) => {
3260
+ loads.push(import("./js-yaml-87tvr6f6.js").then((mod) => {
2785
3261
  yamlSlot.set(mod);
2786
3262
  }));
2787
3263
  }
2788
3264
  if (needed.filter && jmespathSlot.get() === undefined) {
2789
- loads.push(import("./index-9f8q2ege.js").then((mod) => {
3265
+ loads.push(import("./index-p3vk57z7.js").then((mod) => {
2790
3266
  jmespathSlot.set(mod);
2791
3267
  }));
2792
3268
  }
@@ -3064,27 +3540,41 @@ class LoggerTelemetryProvider {
3064
3540
  ...this.analyticsUniqueId ? { analyticsUniqueId: this.analyticsUniqueId } : {}
3065
3541
  };
3066
3542
  }
3067
- async trackEvent(eventName, properties) {
3068
- logger.debug(formatMessage("Event", eventName, this.enrich(properties)));
3543
+ async trackEvent({ name, properties }) {
3544
+ logger.debug(formatMessage("Event", name, this.enrich(properties)));
3069
3545
  }
3070
- async trackException(error, properties) {
3546
+ async trackException({
3547
+ error,
3548
+ properties
3549
+ }) {
3071
3550
  logger.error(formatMessage("Exception", error.message, this.enrich({
3072
3551
  ...properties,
3073
3552
  stack: error.stack
3074
3553
  })));
3075
3554
  }
3076
- async trackRequest(name, duration, success, properties) {
3555
+ async trackRequest({
3556
+ name,
3557
+ durationMs,
3558
+ success,
3559
+ properties
3560
+ }) {
3077
3561
  logger.debug(formatMessage("Request", name, this.enrich({
3078
3562
  ...properties,
3079
- duration: `${duration}ms`,
3563
+ duration: `${durationMs}ms`,
3080
3564
  success
3081
3565
  })));
3082
3566
  }
3083
- async trackDependency(name, type, duration, success, properties) {
3567
+ async trackDependency({
3568
+ name,
3569
+ type,
3570
+ durationMs,
3571
+ success,
3572
+ properties
3573
+ }) {
3084
3574
  logger.debug(formatMessage("Dependency", name, this.enrich({
3085
3575
  ...properties,
3086
3576
  type,
3087
- duration: `${duration}ms`,
3577
+ duration: `${durationMs}ms`,
3088
3578
  success
3089
3579
  })));
3090
3580
  }
@@ -3340,144 +3830,16 @@ function getGlobalTelemetryProperties() {
3340
3830
  return telemetryPropsSlot.get();
3341
3831
  }
3342
3832
 
3343
- // ../common/src/telemetry/pii-redactor.ts
3344
- var REDACTED = "[REDACTED]";
3345
- var MAX_VALUE_LENGTH = 200;
3346
- var SENSITIVE_NAME_TOKENS = new Set([
3347
- "token",
3348
- "tokens",
3349
- "secret",
3350
- "secrets",
3351
- "password",
3352
- "passwords",
3353
- "pwd",
3354
- "credential",
3355
- "credentials",
3356
- "auth",
3357
- "authentication",
3358
- "authorization",
3359
- "authority",
3360
- "cert",
3361
- "certificate",
3362
- "certificates"
3363
- ]);
3364
- var SENSITIVE_KEY_PREFIXES = new Set([
3365
- "api",
3366
- "access",
3367
- "client",
3368
- "private",
3369
- "public",
3370
- "signing",
3371
- "encryption",
3372
- "session",
3373
- "master",
3374
- "shared",
3375
- "root",
3376
- "ssh",
3377
- "rsa",
3378
- "aes",
3379
- "hmac",
3380
- "oauth"
3381
- ]);
3382
- var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
3383
- var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
3384
- var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
3385
- var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
3386
- var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
3387
- var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
3388
- var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
3389
- function shortHash(input) {
3390
- let hash = 2166136261;
3391
- for (let i = 0;i < input.length; i++) {
3392
- hash ^= input.charCodeAt(i);
3393
- hash = Math.imul(hash, 16777619);
3394
- }
3395
- return (hash >>> 0).toString(16).padStart(8, "0");
3396
- }
3397
- function redactUrl(raw) {
3398
- try {
3399
- const url = new URL(raw);
3400
- return `${url.protocol}//${url.host}`;
3401
- } catch {
3402
- return `url#${shortHash(raw)}`;
3403
- }
3404
- }
3405
- function redactValueDetectors(value) {
3406
- let out = value;
3407
- out = out.replace(JWT_PATTERN, () => REDACTED);
3408
- out = out.replace(URL_PATTERN, (match) => {
3409
- const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
3410
- const core = trailing ? match.slice(0, -trailing.length) : match;
3411
- return `${redactUrl(core)}${trailing}`;
3412
- });
3413
- out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
3414
- out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
3415
- out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
3416
- out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
3417
- if (out.length > MAX_VALUE_LENGTH) {
3418
- out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
3419
- }
3420
- return out;
3421
- }
3422
- function redactValue(value) {
3423
- return redactValueDetectors(value);
3424
- }
3425
- function redactError(error) {
3426
- const safe = new Error(redactValueDetectors(error.message ?? ""));
3427
- safe.name = error.name;
3428
- safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
3429
- return safe;
3430
- }
3431
- function nameTokens(name) {
3432
- return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
3433
- }
3434
- function isSensitiveName(name) {
3435
- const tokens = nameTokens(name);
3436
- for (let i = 0;i < tokens.length; i++) {
3437
- const token = tokens[i];
3438
- if (SENSITIVE_NAME_TOKENS.has(token)) {
3439
- return true;
3440
- }
3441
- if (token === "key" || token === "keys") {
3442
- const prev = tokens[i - 1];
3443
- if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
3444
- return true;
3445
- }
3446
- }
3447
- }
3448
- return false;
3449
- }
3450
- function redactProperty(name, value) {
3451
- if (value === undefined || value === null) {
3452
- return;
3453
- }
3454
- if (isSensitiveName(name)) {
3455
- return REDACTED;
3456
- }
3457
- if (typeof value === "boolean" || typeof value === "number") {
3458
- return value;
3459
- }
3460
- if (typeof value !== "string") {
3461
- return "[OBJECT]";
3462
- }
3463
- return redactValueDetectors(value);
3464
- }
3465
- function redactProperties(properties) {
3466
- const out = {};
3467
- for (const [name, value] of Object.entries(properties)) {
3468
- const redacted = redactProperty(name, value);
3469
- if (redacted !== undefined) {
3470
- out[name] = redacted;
3471
- }
3472
- }
3473
- return out;
3833
+ // ../common/src/telemetry/span-clock.ts
3834
+ function startSpanClock() {
3835
+ const started = performance.now();
3836
+ return {
3837
+ startedAt: new Date(performance.timeOrigin + started),
3838
+ elapsedMs: () => performance.now() - started
3839
+ };
3474
3840
  }
3475
3841
 
3476
3842
  // ../common/src/telemetry/telemetry-service.ts
3477
- var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
3478
- var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
3479
- var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
3480
-
3481
3843
  class TelemetryService {
3482
3844
  telemetryProvider;
3483
3845
  contextStorage;
@@ -3497,36 +3859,39 @@ class TelemetryService {
3497
3859
  this.defaultProperties = properties === undefined ? undefined : { ...this.defaultProperties, ...properties };
3498
3860
  }
3499
3861
  trackEvent(name, properties) {
3500
- const context = this.getCurrentContext();
3501
- const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
3502
- this.telemetryProvider.trackEvent(name, enrichedProperties);
3862
+ this.telemetryProvider.trackEvent({
3863
+ name: redactSpanName(name),
3864
+ properties: this.enrichProperties(properties),
3865
+ ...this.leafCorrelation()
3866
+ });
3503
3867
  }
3504
- trackException(error, properties) {
3505
- const context = this.getCurrentContext();
3506
- const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
3507
- this.telemetryProvider.trackException(redactError(error), enrichedProperties);
3868
+ trackException(error, properties, context) {
3869
+ this.telemetryProvider.trackException({
3870
+ error: redactError(error),
3871
+ properties: this.enrichProperties(properties),
3872
+ ...this.leafCorrelation(context)
3873
+ });
3508
3874
  }
3509
3875
  async trackRequest(name, fn, properties) {
3510
- const parentContext = this.getCurrentContext();
3876
+ const parentContext = this.getActiveContext();
3511
3877
  const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
3512
3878
  const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
3879
+ const clock = startSpanClock();
3513
3880
  const context = {
3514
3881
  operationId,
3515
3882
  ...parentId !== undefined ? { parentId } : {},
3516
- id: this.generateId()
3883
+ id: this.generateId(),
3884
+ startedAt: clock.startedAt
3517
3885
  };
3518
- const startTime = performance.now();
3519
3886
  try {
3520
3887
  const result = await this.contextStorage.run(context, fn);
3521
- const durationMs = performance.now() - startTime;
3522
- const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
3523
- await this.telemetryProvider.trackRequest(name, durationMs, true, enrichedProperties);
3888
+ const durationMs = clock.elapsedMs();
3889
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, true, properties, context));
3524
3890
  return result;
3525
3891
  } catch (error) {
3526
- const durationMs = performance.now() - startTime;
3892
+ const durationMs = clock.elapsedMs();
3527
3893
  const err = error instanceof Error ? error : new Error(String(error));
3528
- const enrichedProperties = this.enrichPropertiesWithContext({ ...properties, errorMessage: err.message }, context);
3529
- await this.telemetryProvider.trackRequest(name, durationMs, false, enrichedProperties);
3894
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
3530
3895
  throw error;
3531
3896
  }
3532
3897
  }
@@ -3535,8 +3900,7 @@ class TelemetryService {
3535
3900
  operationId: this.operationId ?? getTelemetryOperationId(),
3536
3901
  id: this.generateId()
3537
3902
  };
3538
- const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
3539
- this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
3903
+ this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, success, properties, requestContext));
3540
3904
  }
3541
3905
  createRequestContext() {
3542
3906
  const operationId = this.operationId ?? getTelemetryOperationId();
@@ -3544,7 +3908,8 @@ class TelemetryService {
3544
3908
  return {
3545
3909
  operationId,
3546
3910
  ...parentId !== undefined ? { parentId } : {},
3547
- id: this.generateId()
3911
+ id: this.generateId(),
3912
+ startedAt: startSpanClock().startedAt
3548
3913
  };
3549
3914
  }
3550
3915
  inboundParentIdFor(operationId) {
@@ -3555,58 +3920,84 @@ class TelemetryService {
3555
3920
  return this.contextStorage.run(context, fn);
3556
3921
  }
3557
3922
  createDependencyContext() {
3558
- const parentContext = this.getCurrentContext();
3923
+ const parentContext = this.getActiveContext();
3559
3924
  if (!parentContext) {
3560
3925
  return;
3561
3926
  }
3562
3927
  return {
3563
3928
  operationId: parentContext.operationId,
3564
3929
  parentId: parentContext.id,
3565
- id: this.generateId()
3930
+ id: this.generateId(),
3931
+ startedAt: startSpanClock().startedAt
3566
3932
  };
3567
3933
  }
3568
3934
  trackDependencyResult(name, type, durationMs, success, properties, context, resultCode) {
3569
- const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
3570
- this.telemetryProvider.trackDependency(redactValue(name), type, durationMs, success, enrichedProperties, resultCode);
3935
+ this.telemetryProvider.trackDependency({
3936
+ ...this.spanFor(redactHttpDependencyName(name), durationMs, success, properties, context),
3937
+ type,
3938
+ ...resultCode !== undefined ? { resultCode } : {}
3939
+ });
3571
3940
  }
3572
3941
  async trackDependencyOperation(name, type, fn, properties) {
3573
- const parentContext = this.getCurrentContext();
3942
+ const clock = startSpanClock();
3943
+ const parentContext = this.getActiveContext();
3574
3944
  const childContext = parentContext !== undefined ? {
3575
3945
  operationId: parentContext.operationId,
3576
3946
  parentId: parentContext.id,
3577
- id: this.generateId()
3578
- } : this.createRequestContext();
3579
- const startTime = performance.now();
3947
+ id: this.generateId(),
3948
+ startedAt: clock.startedAt
3949
+ } : {
3950
+ ...this.createRequestContext(),
3951
+ startedAt: clock.startedAt
3952
+ };
3580
3953
  try {
3581
3954
  const result = await this.contextStorage.run(childContext, fn);
3582
- const durationMs = performance.now() - startTime;
3583
- const enrichedProperties = this.enrichPropertiesWithContext(properties, childContext);
3584
- await this.telemetryProvider.trackDependency(name, type, durationMs, true, enrichedProperties);
3955
+ const durationMs = clock.elapsedMs();
3956
+ await this.telemetryProvider.trackDependency({
3957
+ ...this.spanFor(name, durationMs, true, properties, childContext),
3958
+ type
3959
+ });
3585
3960
  return result;
3586
3961
  } catch (error) {
3587
- const durationMs = performance.now() - startTime;
3962
+ const durationMs = clock.elapsedMs();
3588
3963
  const err = error instanceof Error ? error : new Error(String(error));
3589
- const enrichedProperties = this.enrichPropertiesWithContext({ ...properties, errorMessage: err.message }, childContext);
3590
- await this.telemetryProvider.trackDependency(name, type, durationMs, false, enrichedProperties);
3964
+ await this.telemetryProvider.trackDependency({
3965
+ ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
3966
+ type
3967
+ });
3591
3968
  throw error;
3592
3969
  }
3593
3970
  }
3594
- getCurrentContext() {
3971
+ getActiveContext() {
3595
3972
  return this.contextStorage.getContext();
3596
3973
  }
3597
- enrichPropertiesWithContext(properties, context) {
3974
+ leafCorrelation(explicit) {
3975
+ const context = explicit ?? this.getActiveContext();
3976
+ return {
3977
+ operationId: context?.operationId ?? this.operationId ?? getTelemetryOperationId(),
3978
+ ...context !== undefined ? { parentId: context.id } : {}
3979
+ };
3980
+ }
3981
+ spanFor(name, durationMs, success, properties, context) {
3982
+ return {
3983
+ name: redactSpanName(name),
3984
+ durationMs,
3985
+ success,
3986
+ properties: this.enrichProperties(properties),
3987
+ operationId: context.operationId,
3988
+ ...context.parentId !== undefined ? { parentId: context.parentId } : {},
3989
+ id: context.id,
3990
+ ...context.startedAt !== undefined ? { startedAt: context.startedAt } : {}
3991
+ };
3992
+ }
3993
+ enrichProperties(properties) {
3598
3994
  const globalProperties = getGlobalTelemetryProperties();
3599
3995
  const enriched = {
3600
3996
  ...getExecutionContextTelemetryProperties(),
3601
3997
  ...globalProperties,
3602
3998
  ...this.defaultProperties,
3603
3999
  ...redactProperties(properties ?? {}),
3604
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
3605
- ...context ? {
3606
- [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
3607
- ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
3608
- [TELEMETRY_SPAN_ID_PROPERTY]: context.id
3609
- } : {}
4000
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
3610
4001
  };
3611
4002
  return enriched;
3612
4003
  }
@@ -3623,6 +4014,90 @@ class TelemetryService {
3623
4014
  return hex;
3624
4015
  }
3625
4016
  }
4017
+ // ../common/src/timings.ts
4018
+ var TIMINGS_ENV_VAR = "UIP_TIMINGS";
4019
+ function createStorage2() {
4020
+ const [error, mod] = catchError(() => __require("node:async_hooks"));
4021
+ if (error || typeof mod?.AsyncLocalStorage !== "function") {
4022
+ return {
4023
+ getStore: () => {
4024
+ return;
4025
+ },
4026
+ run: (_store, fn) => fn()
4027
+ };
4028
+ }
4029
+ return new mod.AsyncLocalStorage;
4030
+ }
4031
+ var storageSlot = singleton("TimingStorage");
4032
+ var stateSlot = singleton("Timings");
4033
+ var rootStartedSlot = singleton("TimingsRootStarted");
4034
+ var longLivedHostSlot = singleton("TimingsLongLivedHost");
4035
+ var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
4036
+ function newState(baseline) {
4037
+ return { baseline, httpMs: 0, httpCalls: 0 };
4038
+ }
4039
+ function getState() {
4040
+ const scoped = storage.getStore();
4041
+ if (scoped) {
4042
+ return scoped;
4043
+ }
4044
+ const pinned = livePinnedState();
4045
+ if (pinned !== undefined) {
4046
+ return pinned;
4047
+ }
4048
+ return newState(processStartIsInvocationStart() ? 0 : performance.now());
4049
+ }
4050
+ function livePinnedState() {
4051
+ const pinned = stateSlot.get();
4052
+ return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
4053
+ }
4054
+ function processStartIsInvocationStart() {
4055
+ return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
4056
+ }
4057
+ function timingsEnabled() {
4058
+ if (typeof process === "undefined") {
4059
+ return false;
4060
+ }
4061
+ const value = process.env?.[TIMINGS_ENV_VAR];
4062
+ if (value === undefined) {
4063
+ return false;
4064
+ }
4065
+ const normalized = value.trim().toLowerCase();
4066
+ return normalized === "1" || normalized === "true";
4067
+ }
4068
+ function recordExitCode(exitCode) {
4069
+ if (!timingsEnabled()) {
4070
+ return;
4071
+ }
4072
+ getState().exitCode = exitCode;
4073
+ }
4074
+ function invocationStartedAt() {
4075
+ return new Date(performance.timeOrigin + getState().baseline);
4076
+ }
4077
+ function invocationElapsedMs() {
4078
+ return performance.now() - getState().baseline;
4079
+ }
4080
+ function markCommandStart() {
4081
+ if (!timingsEnabled()) {
4082
+ return;
4083
+ }
4084
+ getState().commandStart = performance.now();
4085
+ }
4086
+ function recordCommandDuration(durationMs) {
4087
+ if (!timingsEnabled()) {
4088
+ return;
4089
+ }
4090
+ getState().commandMs = durationMs;
4091
+ }
4092
+ function recordHttpCall(durationMs) {
4093
+ if (!timingsEnabled()) {
4094
+ return;
4095
+ }
4096
+ const state = getState();
4097
+ state.httpMs += durationMs;
4098
+ state.httpCalls += 1;
4099
+ }
4100
+
3626
4101
  // ../common/src/telemetry/tracked-fetch.ts
3627
4102
  var W3C_TRACE_FLAGS_SAMPLED = "01";
3628
4103
  function makeTrackedFetch(realFetch) {
@@ -3638,17 +4113,22 @@ function makeTrackedFetch(realFetch) {
3638
4113
  headers.set("traceparent", `00-${context.operationId}-${context.id}-${W3C_TRACE_FLAGS_SAMPLED}`);
3639
4114
  }
3640
4115
  const name = `${method} ${url.pathname}`;
3641
- const startTime = performance.now();
4116
+ const clock = startSpanClock();
4117
+ context.startedAt = clock.startedAt;
3642
4118
  try {
3643
4119
  const response = await realFetch(input, { ...init, headers });
3644
- telemetry.trackDependencyResult(name, "HTTP", performance.now() - startTime, response.ok, {
4120
+ const durationMs = clock.elapsedMs();
4121
+ recordHttpCall(durationMs);
4122
+ telemetry.trackDependencyResult(name, "HTTP", durationMs, response.ok, {
3645
4123
  "server.address": url.host,
3646
4124
  "http.request.method": method,
3647
4125
  "http.response.status_code": response.status
3648
4126
  }, context, String(response.status));
3649
4127
  return response;
3650
4128
  } catch (error) {
3651
- telemetry.trackDependencyResult(name, "HTTP", performance.now() - startTime, false, {
4129
+ const durationMs = clock.elapsedMs();
4130
+ recordHttpCall(durationMs);
4131
+ telemetry.trackDependencyResult(name, "HTTP", durationMs, false, {
3652
4132
  "server.address": url.host,
3653
4133
  "http.request.method": method,
3654
4134
  errorMessage: error instanceof Error ? error.message : String(error)
@@ -3709,6 +4189,9 @@ function getGlobalTelemetryInstance() {
3709
4189
  }
3710
4190
  return;
3711
4191
  }
4192
+ function setGlobalTelemetryInstance(instance) {
4193
+ telemetryInstanceSlot.set(instance);
4194
+ }
3712
4195
  var _localTelemetryInstance;
3713
4196
  function getTelemetryInstance() {
3714
4197
  const global = getGlobalTelemetryInstance();
@@ -3716,6 +4199,7 @@ function getTelemetryInstance() {
3716
4199
  return global;
3717
4200
  if (!_localTelemetryInstance) {
3718
4201
  _localTelemetryInstance = new TelemetryService(new LoggerTelemetryProvider, new NodeContextStorage);
4202
+ setGlobalTelemetryInstance(_localTelemetryInstance);
3719
4203
  }
3720
4204
  return _localTelemetryInstance;
3721
4205
  }
@@ -3728,6 +4212,14 @@ var telemetry = new Proxy({}, {
3728
4212
  });
3729
4213
 
3730
4214
  // ../common/src/formatter.ts
4215
+ var ANSI_STYLES = {
4216
+ red: "\x1B[31m",
4217
+ dim: "\x1B[2m"
4218
+ };
4219
+ var ANSI_RESET = "\x1B[0m";
4220
+ function styleLine(line, style) {
4221
+ return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
4222
+ }
3731
4223
  var CLI_ERROR_CODES = [
3732
4224
  "invalid_argument",
3733
4225
  "authentication_required",
@@ -3766,22 +4258,6 @@ var EXIT_CODES = {
3766
4258
  ValidationError: 3,
3767
4259
  TimeoutError: 4
3768
4260
  };
3769
- class SuccessOutput {
3770
- Result = RESULTS.Success;
3771
- Code;
3772
- Data;
3773
- Pagination;
3774
- Instructions;
3775
- Log;
3776
- constructor(code, data) {
3777
- this.Code = code;
3778
- this.Data = data;
3779
- const logPath = getLogFilePath();
3780
- if (logPath) {
3781
- this.Log = logPath;
3782
- }
3783
- }
3784
- }
3785
4261
  function escapeNonAscii(jsonText) {
3786
4262
  return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
3787
4263
  const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
@@ -3846,19 +4322,45 @@ function toPascalCaseKey(key) {
3846
4322
  const lowerCamelKey = toLowerCamelCaseKey(key);
3847
4323
  return lowerCamelKey ? lowerCamelKey.charAt(0).toUpperCase() + lowerCamelKey.slice(1) : lowerCamelKey;
3848
4324
  }
3849
- function toPascalCaseData(value) {
4325
+ function collectVerbatimRefs(value, into) {
4326
+ if (typeof value !== "object" || value === null)
4327
+ return;
4328
+ if (into.has(value))
4329
+ return;
4330
+ into.add(value);
4331
+ for (const nested of Array.isArray(value) ? value : Object.values(value)) {
4332
+ collectVerbatimRefs(nested, into);
4333
+ }
4334
+ }
4335
+ function toPascalCaseData(value, verbatimKeys, subtrees) {
4336
+ if (subtrees?.mode === "skip" && typeof value === "object" && value !== null && subtrees.refs.has(value)) {
4337
+ return value;
4338
+ }
3850
4339
  if (Array.isArray(value))
3851
- return value.map(toPascalCaseData);
4340
+ return value.map((entry) => toPascalCaseData(entry, verbatimKeys, subtrees));
3852
4341
  if (!isPlainRecord(value))
3853
4342
  return value;
3854
4343
  const result = {};
3855
4344
  for (const [key, nestedValue] of Object.entries(value)) {
3856
- result[toPascalCaseKey(key)] = toPascalCaseData(nestedValue);
4345
+ const pascalKey = toPascalCaseKey(key);
4346
+ if (verbatimKeys?.has(pascalKey)) {
4347
+ result[pascalKey] = nestedValue;
4348
+ if (subtrees?.mode === "collect") {
4349
+ collectVerbatimRefs(nestedValue, subtrees.refs);
4350
+ }
4351
+ continue;
4352
+ }
4353
+ result[pascalKey] = toPascalCaseData(nestedValue, verbatimKeys, subtrees);
3857
4354
  }
3858
4355
  return result;
3859
4356
  }
3860
- function normalizeDataKeys(data) {
3861
- return toPascalCaseData(data);
4357
+ function normalizeDataKeys(data, verbatimKeys, subtrees) {
4358
+ return toPascalCaseData(data, verbatimKeys, subtrees);
4359
+ }
4360
+ function toVerbatimKeySet(preserve) {
4361
+ if (!Array.isArray(preserve))
4362
+ return;
4363
+ return new Set(preserve.map(toPascalCaseKey));
3862
4364
  }
3863
4365
  function normalizeOutputKeys(data) {
3864
4366
  const result = {};
@@ -3868,7 +4370,7 @@ function normalizeOutputKeys(data) {
3868
4370
  }
3869
4371
  return result;
3870
4372
  }
3871
- function printOutput(data, format = "json", logFn, asciiSafe = false) {
4373
+ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowStyle) {
3872
4374
  if (!data) {
3873
4375
  logFn("Empty response object. No data to display.");
3874
4376
  return;
@@ -3903,7 +4405,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false) {
3903
4405
  if (hasData && !(rows !== null && rows.length === 0)) {
3904
4406
  const logValue = data.Log;
3905
4407
  if (rows !== null) {
3906
- printResizableTable(rows, logFn, logValue);
4408
+ printResizableTable(rows, logFn, logValue, undefined, tableRowStyle);
3907
4409
  } else {
3908
4410
  printVerticalTable(data.Data, logFn, logValue);
3909
4411
  }
@@ -3914,10 +4416,11 @@ function printOutput(data, format = "json", logFn, asciiSafe = false) {
3914
4416
  }
3915
4417
  }
3916
4418
  }
3917
- function logOutput(data, format = "json") {
4419
+ function logOutput(data, format = "json", tableRowStyle) {
3918
4420
  const sink = getOutputSink();
4421
+ const styleFn = sink.capabilities.isInteractive && sink.capabilities.supportsColor ? tableRowStyle : undefined;
3919
4422
  printOutput(data, format, (msg) => sink.writeOut(`${msg}
3920
- `), needsAsciiSafeJson(sink));
4423
+ `), needsAsciiSafeJson(sink), styleFn);
3921
4424
  }
3922
4425
  function cellToString(val) {
3923
4426
  return val != null && typeof val === "object" ? JSON.stringify(val) : String(val ?? "");
@@ -3931,7 +4434,7 @@ function wrapText(text, width) {
3931
4434
  }
3932
4435
  return lines;
3933
4436
  }
3934
- function printTable(data, logFn, externalLogValue) {
4437
+ function printTable(data, logFn, externalLogValue, tableRowStyle) {
3935
4438
  if (data.length === 0)
3936
4439
  return;
3937
4440
  const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
@@ -3941,7 +4444,7 @@ function printTable(data, logFn, externalLogValue) {
3941
4444
  logFn(keys.map((_, i) => "-".repeat(maxWidths[i])).join("-|-"));
3942
4445
  data.forEach((item) => {
3943
4446
  const row = keys.map((key, i) => cellToString(item[key]).padEnd(maxWidths[i])).join(" | ");
3944
- logFn(row);
4447
+ logFn(styleLine(row, tableRowStyle?.(item)));
3945
4448
  });
3946
4449
  if (externalLogValue) {
3947
4450
  logFn("");
@@ -3984,14 +4487,14 @@ function printVerticalTable(data, logFn = console.log, externalLogValue) {
3984
4487
  logFn(`Log: ${externalLogValue}`);
3985
4488
  }
3986
4489
  }
3987
- function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth) {
4490
+ function printResizableTable(data, logFn = console.log, externalLogValue, availableWidth, tableRowStyle) {
3988
4491
  if (data.length === 0)
3989
4492
  return;
3990
4493
  const keys = Object.keys(data[0]).filter((key) => !["code", "log"].includes(key.toLowerCase()));
3991
4494
  if (keys.length === 0)
3992
4495
  return;
3993
4496
  if (!process.stdout.isTTY) {
3994
- printTable(data, logFn, externalLogValue);
4497
+ printTable(data, logFn, externalLogValue, tableRowStyle);
3995
4498
  return;
3996
4499
  }
3997
4500
  const naturalWidths = keys.map((key) => Math.max(key.length, ...data.map((item) => cellToString(item[key]).length)));
@@ -3999,7 +4502,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
3999
4502
  const totalWidth = naturalWidths.reduce((a, b) => a + b, 0) + separatorTotal;
4000
4503
  const termWidth = availableWidth ?? (process.stdout.columns || 120);
4001
4504
  if (totalWidth <= termWidth) {
4002
- printTable(data, logFn, externalLogValue);
4505
+ printTable(data, logFn, externalLogValue, tableRowStyle);
4003
4506
  return;
4004
4507
  }
4005
4508
  const overflow = totalWidth - termWidth;
@@ -4045,6 +4548,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
4045
4548
  logFn(header);
4046
4549
  logFn(keys.map((_, i) => "-".repeat(finalWidths[i])).join("-|-"));
4047
4550
  data.forEach((item) => {
4551
+ const style = tableRowStyle?.(item);
4048
4552
  const cellLines = keys.map((key, i) => wrapText(cellToString(item[key]), finalWidths[i]));
4049
4553
  const lineCount = Math.max(...cellLines.map((l) => l.length));
4050
4554
  for (let line = 0;line < lineCount; line++) {
@@ -4052,7 +4556,7 @@ function printResizableTable(data, logFn = console.log, externalLogValue, availa
4052
4556
  const val = line < cellLines[i].length ? cellLines[i][line] : "";
4053
4557
  return val.padEnd(finalWidths[i]);
4054
4558
  }).join(" | ");
4055
- logFn(row);
4559
+ logFn(styleLine(row, style));
4056
4560
  }
4057
4561
  });
4058
4562
  if (externalLogValue) {
@@ -4196,30 +4700,36 @@ var OutputFormatter;
4196
4700
  ((OutputFormatter) => {
4197
4701
  function success(data, options) {
4198
4702
  data.Log ??= getLogFilePath() || undefined;
4199
- const normalize = !options?.preserveDataKeys;
4703
+ const normalize = options?.preserveDataKeys !== true;
4704
+ const verbatim = toVerbatimKeySet(options?.preserveDataKeys);
4705
+ const subtrees = verbatim && {
4706
+ refs: new Set,
4707
+ mode: "collect"
4708
+ };
4200
4709
  if (normalize) {
4201
- data.Data = normalizeDataKeys(data.Data);
4710
+ data.Data = normalizeDataKeys(data.Data, verbatim, subtrees);
4202
4711
  }
4203
4712
  const filter = getOutputFilter();
4204
4713
  if (filter) {
4205
4714
  const filtered = applyFilter(data.Data, filter);
4206
- data.Data = normalize ? normalizeDataKeys(filtered) : filtered;
4715
+ data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
4207
4716
  }
4208
- logOutput(normalizeOutputKeys(data), getOutputFormat());
4717
+ logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
4209
4718
  }
4210
4719
  OutputFormatter.success = success;
4211
4720
  function error(data) {
4212
4721
  data.Log ??= getLogFilePath() || undefined;
4213
4722
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
4214
4723
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
4215
- process.exitCode = EXIT_CODES[data.Result] ?? 1;
4724
+ const exitCode = EXIT_CODES[data.Result] ?? 1;
4725
+ setExitCode(exitCode);
4216
4726
  recordCommandFailureTelemetry({
4217
4727
  result: data.Result,
4218
4728
  errorCode: data.ErrorCode,
4219
4729
  retry: data.Retry,
4220
4730
  message: data.Message,
4221
4731
  context: data.Context,
4222
- exitCode: process.exitCode,
4732
+ exitCode,
4223
4733
  errorClass: data.TelemetryErrorClass,
4224
4734
  terminalOutcome: data.TelemetryTerminalOutcome,
4225
4735
  terminalSignal: data.TelemetryTerminalSignal
@@ -4449,6 +4959,57 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
4449
4959
  };
4450
4960
  }
4451
4961
 
4962
+ // ../common/src/telemetry/command-name.ts
4963
+ var TELEMETRY_COMMAND_ROOT = "uip";
4964
+ function commandTelemetryName(parts) {
4965
+ const tokens = [];
4966
+ for (const part of parts) {
4967
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
4968
+ if (pieces.every(isCommandToken)) {
4969
+ tokens.push(...pieces);
4970
+ continue;
4971
+ }
4972
+ tokens.push(UNKNOWN_TOKEN);
4973
+ }
4974
+ return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
4975
+ }
4976
+ var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
4977
+ var MAX_COMMAND_TOKEN_LENGTH = 32;
4978
+ var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
4979
+ function isCommandToken(token) {
4980
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
4981
+ }
4982
+ var UNKNOWN_TOKEN = "<unknown>";
4983
+
4984
+ // ../common/src/telemetry/invocation-request.ts
4985
+ var requestContextSlot = singleton("TelemetryInvocationRequestContext");
4986
+ function activeContext() {
4987
+ return telemetry.getActiveContext?.();
4988
+ }
4989
+ function runWithInvocationRequest(fn) {
4990
+ const context = telemetry.createRequestContext();
4991
+ context.startedAt = invocationStartedAt();
4992
+ requestContextSlot.set(context);
4993
+ return telemetry.runWithContext(context, fn);
4994
+ }
4995
+ function ensureInvocationRequestScope(fn) {
4996
+ if (activeContext() !== undefined) {
4997
+ return fn();
4998
+ }
4999
+ const kept = requestContextSlot.get();
5000
+ return kept === undefined ? runWithInvocationRequest(fn) : telemetry.runWithContext(kept, fn);
5001
+ }
5002
+ function getInvocationRequestContext() {
5003
+ return activeContext() ?? requestContextSlot.get();
5004
+ }
5005
+ function emitInvocationRequest(name, success, properties) {
5006
+ const context = getInvocationRequestContext();
5007
+ telemetry.trackRequestResult(name, invocationElapsedMs(), success, properties, context);
5008
+ if (context !== undefined && requestContextSlot.get() === context) {
5009
+ requestContextSlot.clear();
5010
+ }
5011
+ }
5012
+
4452
5013
  // ../common/src/trackedAction.ts
4453
5014
  var pollSignalSlot = singleton("PollSignal");
4454
5015
  var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
@@ -4456,28 +5017,74 @@ var retryHintValues = new Set(RETRY_HINTS);
4456
5017
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
4457
5018
  var processContext = {
4458
5019
  exit: (code) => {
4459
- process.exitCode = code;
5020
+ recordExitCode(code);
5021
+ setExitCode(code);
4460
5022
  },
4461
5023
  get pollSignal() {
4462
5024
  return pollSignalSlot.get();
4463
5025
  }
4464
5026
  };
5027
+ var TELEMETRY_ARG_VALUE_WITHHELD = "<provided>";
5028
+ var TELEMETRY_ARG_VALUE_DEFAULTED = "<default>";
5029
+ function recordableArgValue(value, choices) {
5030
+ if (typeof value === "boolean" || typeof value === "number") {
5031
+ return value;
5032
+ }
5033
+ if (choices && choices.length > 0) {
5034
+ if (typeof value === "string" && choices.includes(value)) {
5035
+ return value;
5036
+ }
5037
+ if (Array.isArray(value) && value.length > 0 && value.every((entry) => typeof entry === "string" && choices.includes(entry))) {
5038
+ return value.join(",");
5039
+ }
5040
+ }
5041
+ return TELEMETRY_ARG_VALUE_WITHHELD;
5042
+ }
4465
5043
  function extractCommandParams(cmd) {
4466
5044
  const params = {};
4467
- const add = (name, value) => {
4468
- if (name && value !== undefined) {
4469
- params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
4470
- }
4471
- };
5045
+ forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
5046
+ const recordable = recordableArgValue(value, choices);
5047
+ params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
5048
+ });
5049
+ return params;
5050
+ }
5051
+ function isDefaultedOption(cmd, name) {
5052
+ const source = cmd.getOptionValueSource?.(name);
5053
+ return source === "default" || source === "implied";
5054
+ }
5055
+ function isDefaultedPositional(cmd, index) {
5056
+ return index >= (cmd.args?.length ?? 0);
5057
+ }
5058
+ function forEachSuppliedArgument(cmd, visit) {
4472
5059
  const registered = cmd.registeredArguments ?? [];
4473
5060
  const processed = cmd.processedArgs ?? [];
4474
5061
  for (let i = 0;i < registered.length; i++) {
4475
- add(registered[i].name(), processed[i]);
5062
+ const name = registered[i].name();
5063
+ if (name && processed[i] !== undefined) {
5064
+ visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
5065
+ }
5066
+ }
5067
+ const choicesByAttribute = new Map;
5068
+ for (const option of cmd.options) {
5069
+ choicesByAttribute.set(option.attributeName(), option.argChoices);
4476
5070
  }
4477
5071
  for (const [key, value] of Object.entries(cmd.opts())) {
4478
- add(key, value);
5072
+ if (key && value !== undefined) {
5073
+ visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
5074
+ }
4479
5075
  }
4480
- return params;
5076
+ }
5077
+ function withheldArgumentValues(cmd) {
5078
+ const values = [];
5079
+ forEachSuppliedArgument(cmd, (_name, value, choices, defaulted) => {
5080
+ if (defaulted) {
5081
+ return;
5082
+ }
5083
+ if (recordableArgValue(value, choices) === TELEMETRY_ARG_VALUE_WITHHELD) {
5084
+ values.push(value);
5085
+ }
5086
+ });
5087
+ return values;
4481
5088
  }
4482
5089
  function deriveCommandPath(cmd) {
4483
5090
  const parts = [];
@@ -4492,7 +5099,7 @@ function deriveCommandPath(cmd) {
4492
5099
  if (parts.length > 1) {
4493
5100
  parts.shift();
4494
5101
  }
4495
- return ["uip", ...parts.filter((p) => p !== "uip")].join(".");
5102
+ return commandTelemetryName(parts);
4496
5103
  }
4497
5104
  function isCliErrorCode(value) {
4498
5105
  return typeof value === "string" && cliErrorCodeValues.has(value);
@@ -4532,68 +5139,77 @@ Command.prototype.trackedAction = function(context, fn, properties) {
4532
5139
  });
4533
5140
  const telemetryName = deriveCommandPath(command);
4534
5141
  const props = typeof properties === "function" ? properties(...args) : properties;
4535
- const requestContext = telemetry.createRequestContext();
4536
- const startTime = performance.now();
4537
- let errorMessage;
4538
- let fallbackExitCode = EXIT_CODES.Success;
4539
- clearRecordedCommandFailureTelemetry();
4540
- const [error] = await catchError(telemetry.runWithContext(requestContext, () => {
4541
- const violation = implicitLimitViolation(command);
4542
- if (violation) {
4543
- return Promise.reject(violation);
5142
+ markCommandStart();
5143
+ const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
5144
+ try {
5145
+ const startTime = performance.now();
5146
+ let errorMessage;
5147
+ let fallbackExitCode = EXIT_CODES.Success;
5148
+ clearRecordedCommandFailureTelemetry();
5149
+ const [error] = await catchError(ensureInvocationRequestScope(() => {
5150
+ const violation = implicitLimitViolation(command);
5151
+ if (violation) {
5152
+ return Promise.reject(violation);
5153
+ }
5154
+ return fn(...args);
5155
+ }));
5156
+ if (error) {
5157
+ errorMessage = error instanceof Error ? error.message : String(error);
5158
+ logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
5159
+ const typed = error;
5160
+ const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
5161
+ const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
5162
+ const finalResult = customResult ?? RESULTS.Failure;
5163
+ const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
5164
+ const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
5165
+ const typedRetry = typed.retry ?? typed.Retry;
5166
+ const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
5167
+ const typedContext = typed.context ?? typed.Context;
5168
+ const customContext = isErrorContext(typedContext) ? typedContext : undefined;
5169
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
5170
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
5171
+ OutputFormatter.error({
5172
+ Result: finalResult,
5173
+ ...customErrorCode ? { ErrorCode: customErrorCode } : {},
5174
+ Message: errorMessage,
5175
+ Instructions: customInstructions ?? commandHelpHint(telemetryName),
5176
+ ...customRetry ? { Retry: customRetry } : {},
5177
+ ...customContext ? { Context: customContext } : {}
5178
+ });
5179
+ context.exit(fallbackExitCode);
4544
5180
  }
4545
- return fn(...args);
4546
- }));
4547
- if (error) {
4548
- errorMessage = error instanceof Error ? error.message : String(error);
4549
- logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
4550
- const typed = error;
4551
- const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
4552
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
4553
- const finalResult = customResult ?? RESULTS.Failure;
4554
- const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
4555
- const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
4556
- const typedRetry = typed.retry ?? typed.Retry;
4557
- const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
4558
- const typedContext = typed.context ?? typed.Context;
4559
- const customContext = isErrorContext(typedContext) ? typedContext : undefined;
4560
- const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
4561
- fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
4562
- OutputFormatter.error({
4563
- Result: finalResult,
4564
- ...customErrorCode ? { ErrorCode: customErrorCode } : {},
4565
- Message: errorMessage,
4566
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
4567
- ...customRetry ? { Retry: customRetry } : {},
4568
- ...customContext ? { Context: customContext } : {}
5181
+ const durationMs = performance.now() - startTime;
5182
+ recordCommandDuration(durationMs);
5183
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
5184
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
5185
+ const success = !error && exitCode === 0;
5186
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
5187
+ error,
5188
+ exitCode,
5189
+ recordedFailure,
5190
+ pollSignal: context.pollSignal
4569
5191
  });
4570
- context.exit(fallbackExitCode);
4571
- }
4572
- const durationMs = performance.now() - startTime;
4573
- const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
4574
- const recordedFailure = takeRecordedCommandFailureTelemetry();
4575
- const success = !error && exitCode === 0;
4576
- const terminalTelemetry = buildCommandTerminalTelemetryProperties({
4577
- error,
4578
- exitCode,
4579
- recordedFailure,
4580
- pollSignal: context.pollSignal
4581
- });
4582
- const commandParams = extractCommandParams(command);
4583
- if (props) {
4584
- for (const key of Object.keys(props)) {
4585
- delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
5192
+ if (terminalTelemetry.error_class === "internal" && error) {
5193
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
4586
5194
  }
5195
+ const commandParams = extractCommandParams(command);
5196
+ if (props) {
5197
+ for (const key of Object.keys(props)) {
5198
+ delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
5199
+ }
5200
+ }
5201
+ const baseProperties = redactProperties({
5202
+ ...commandParams,
5203
+ ...props,
5204
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
5205
+ command: "true",
5206
+ ...terminalTelemetry,
5207
+ ...errorMessage ? { errorMessage } : {}
5208
+ });
5209
+ emitInvocationRequest(telemetryName, success, baseProperties);
5210
+ } finally {
5211
+ releaseSuppliedArgumentValues(supplied);
4587
5212
  }
4588
- const baseProperties = redactProperties({
4589
- ...commandParams,
4590
- ...props,
4591
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
4592
- command: "true",
4593
- ...terminalTelemetry,
4594
- ...errorMessage ? { errorMessage } : {}
4595
- });
4596
- telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
4597
5213
  });
4598
5214
  };
4599
5215
 
@@ -4645,6 +5261,17 @@ function dedupeKey(payload) {
4645
5261
  payload.artifact_correlation_key ?? payload.package_version_key ?? payload.deployment_key ?? payload.solution_id ?? payload.package_name ?? ""
4646
5262
  ].join("|");
4647
5263
  }
5264
+ function withPseudonymizedIdentifiers(payload) {
5265
+ return {
5266
+ ...payload,
5267
+ ...payload.package_name === undefined ? {} : {
5268
+ package_name: `package#${pseudonymize(payload.package_name)}`
5269
+ },
5270
+ ...payload.artifact_correlation_key === undefined ? {} : {
5271
+ artifact_correlation_key: `artifact#${pseudonymize(payload.artifact_correlation_key)}`
5272
+ }
5273
+ };
5274
+ }
4648
5275
  function trackShipSucceeded(payload) {
4649
5276
  const keys = getShippedKeys();
4650
5277
  const key = dedupeKey(payload);
@@ -4652,7 +5279,7 @@ function trackShipSucceeded(payload) {
4652
5279
  return false;
4653
5280
  }
4654
5281
  keys.add(key);
4655
- telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties({ ...payload }));
5282
+ telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties(withPseudonymizedIdentifiers(payload)));
4656
5283
  return true;
4657
5284
  }
4658
5285
  // ../common/src/command-examples.ts
@@ -4679,6 +5306,204 @@ var guardInstalledSlot = singleton("ConsoleGuardInstalled");
4679
5306
  var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
4680
5307
  // ../common/src/constants.ts
4681
5308
  var DEFAULT_AUTH_TIMEOUT_MS = 5 * 60 * 1000;
5309
+ // ../common/src/entity-name-rules.ts
5310
+ var RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
5311
+ var RESERVED_FIELD_NAMES_LOWER = new Set([
5312
+ "id",
5313
+ "createdby",
5314
+ "createtime",
5315
+ "updatedby",
5316
+ "updatetime",
5317
+ "recordowner",
5318
+ "version"
5319
+ ]);
5320
+ var RESERVED_KEYWORDS_LOWER = new Set([
5321
+ "abstract",
5322
+ "as",
5323
+ "base",
5324
+ "bool",
5325
+ "break",
5326
+ "byte",
5327
+ "case",
5328
+ "catch",
5329
+ "char",
5330
+ "checked",
5331
+ "class",
5332
+ "const",
5333
+ "continue",
5334
+ "decimal",
5335
+ "default",
5336
+ "delegate",
5337
+ "do",
5338
+ "double",
5339
+ "else",
5340
+ "enum",
5341
+ "event",
5342
+ "explicit",
5343
+ "extern",
5344
+ "false",
5345
+ "finally",
5346
+ "fixed",
5347
+ "float",
5348
+ "for",
5349
+ "foreach",
5350
+ "goto",
5351
+ "if",
5352
+ "implicit",
5353
+ "in",
5354
+ "int",
5355
+ "interface",
5356
+ "internal",
5357
+ "is",
5358
+ "lock",
5359
+ "long",
5360
+ "namespace",
5361
+ "new",
5362
+ "null",
5363
+ "object",
5364
+ "operator",
5365
+ "out",
5366
+ "override",
5367
+ "params",
5368
+ "private",
5369
+ "protected",
5370
+ "public",
5371
+ "readonly",
5372
+ "ref",
5373
+ "return",
5374
+ "sbyte",
5375
+ "sealed",
5376
+ "short",
5377
+ "sizeof",
5378
+ "stackalloc",
5379
+ "static",
5380
+ "string",
5381
+ "struct",
5382
+ "switch",
5383
+ "this",
5384
+ "throw",
5385
+ "true",
5386
+ "try",
5387
+ "typeof",
5388
+ "uint",
5389
+ "ulong",
5390
+ "unchecked",
5391
+ "unsafe",
5392
+ "ushort",
5393
+ "using",
5394
+ "virtual",
5395
+ "void",
5396
+ "volatile",
5397
+ "while",
5398
+ "addhandler",
5399
+ "addressof",
5400
+ "alias",
5401
+ "and",
5402
+ "andalso",
5403
+ "boolean",
5404
+ "byref",
5405
+ "byval",
5406
+ "call",
5407
+ "cbool",
5408
+ "cbyte",
5409
+ "cchar",
5410
+ "cdate",
5411
+ "cdbl",
5412
+ "cdec",
5413
+ "cint",
5414
+ "clng",
5415
+ "cobj",
5416
+ "csbyte",
5417
+ "cshort",
5418
+ "csng",
5419
+ "cstr",
5420
+ "ctype",
5421
+ "cuint",
5422
+ "culng",
5423
+ "cushort",
5424
+ "date",
5425
+ "declare",
5426
+ "dim",
5427
+ "directcast",
5428
+ "each",
5429
+ "elseif",
5430
+ "end",
5431
+ "endif",
5432
+ "erase",
5433
+ "error",
5434
+ "exit",
5435
+ "friend",
5436
+ "function",
5437
+ "get",
5438
+ "gettype",
5439
+ "getxmlnamespace",
5440
+ "global",
5441
+ "gosub",
5442
+ "goto",
5443
+ "handles",
5444
+ "implements",
5445
+ "imports",
5446
+ "inherits",
5447
+ "integer",
5448
+ "isnot",
5449
+ "let",
5450
+ "lib",
5451
+ "like",
5452
+ "loop",
5453
+ "me",
5454
+ "mod",
5455
+ "module",
5456
+ "mustinherit",
5457
+ "mustoverride",
5458
+ "mybase",
5459
+ "myclass",
5460
+ "narrowing",
5461
+ "next",
5462
+ "not",
5463
+ "nothing",
5464
+ "notinheritable",
5465
+ "notoverridable",
5466
+ "of",
5467
+ "on",
5468
+ "option",
5469
+ "optional",
5470
+ "or",
5471
+ "orelse",
5472
+ "overloads",
5473
+ "overridable",
5474
+ "overrides",
5475
+ "paramarray",
5476
+ "partial",
5477
+ "property",
5478
+ "raiseevent",
5479
+ "redim",
5480
+ "rem",
5481
+ "removehandler",
5482
+ "resume",
5483
+ "select",
5484
+ "set",
5485
+ "shadows",
5486
+ "shared",
5487
+ "single",
5488
+ "step",
5489
+ "stop",
5490
+ "structure",
5491
+ "sub",
5492
+ "synclock",
5493
+ "then",
5494
+ "to",
5495
+ "trycast",
5496
+ "uinteger",
5497
+ "ushort",
5498
+ "variant",
5499
+ "wend",
5500
+ "when",
5501
+ "widening",
5502
+ "with",
5503
+ "withevents",
5504
+ "writeonly",
5505
+ "xor"
5506
+ ]);
4682
5507
  // ../common/src/guid.ts
4683
5508
  var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4684
5509
  function isGuid(value) {
@@ -5174,1517 +5999,7 @@ async function findSolutionFileUpward(fs, startDir) {
5174
5999
  dir = parent;
5175
6000
  }
5176
6001
  }
5177
- // ../../node_modules/fflate/esm/index.mjs
5178
- import { createRequire } from "module";
5179
- var require2 = createRequire("/");
5180
- var _a;
5181
- var Worker;
5182
- var isMarkedAsUntransferable;
5183
- try {
5184
- _a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
5185
- } catch (e) {}
5186
- var u8 = Uint8Array;
5187
- var u16 = Uint16Array;
5188
- var i32 = Int32Array;
5189
- 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]);
5190
- 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]);
5191
- var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
5192
- var freb = function(eb, start) {
5193
- var b = new u16(31);
5194
- for (var i = 0;i < 31; ++i) {
5195
- b[i] = start += 1 << eb[i - 1];
5196
- }
5197
- var r = new i32(b[30]);
5198
- for (var i = 1;i < 30; ++i) {
5199
- for (var j = b[i];j < b[i + 1]; ++j) {
5200
- r[j] = j - b[i] << 5 | i;
5201
- }
5202
- }
5203
- return { b, r };
5204
- };
5205
- var _a = freb(fleb, 2);
5206
- var fl = _a.b;
5207
- var revfl = _a.r;
5208
- fl[28] = 258, revfl[258] = 28;
5209
- var _b = freb(fdeb, 0);
5210
- var fd = _b.b;
5211
- var revfd = _b.r;
5212
- var rev = new u16(32768);
5213
- for (i = 0;i < 32768; ++i) {
5214
- x = (i & 43690) >> 1 | (i & 21845) << 1;
5215
- x = (x & 52428) >> 2 | (x & 13107) << 2;
5216
- x = (x & 61680) >> 4 | (x & 3855) << 4;
5217
- rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
5218
- }
5219
- var x;
5220
- var i;
5221
- var hMap = function(cd, mb, r) {
5222
- var s = cd.length;
5223
- var i2 = 0;
5224
- var l = new u16(mb);
5225
- for (;i2 < s; ++i2) {
5226
- if (cd[i2])
5227
- ++l[cd[i2] - 1];
5228
- }
5229
- var le = new u16(mb);
5230
- for (i2 = 1;i2 < mb; ++i2) {
5231
- le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
5232
- }
5233
- var co;
5234
- if (r) {
5235
- co = new u16(1 << mb);
5236
- var rvb = 15 - mb;
5237
- for (i2 = 0;i2 < s; ++i2) {
5238
- if (cd[i2]) {
5239
- var sv = i2 << 4 | cd[i2];
5240
- var r_1 = mb - cd[i2];
5241
- var v = le[cd[i2] - 1]++ << r_1;
5242
- for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
5243
- co[rev[v] >> rvb] = sv;
5244
- }
5245
- }
5246
- }
5247
- } else {
5248
- co = new u16(s);
5249
- for (i2 = 0;i2 < s; ++i2) {
5250
- if (cd[i2]) {
5251
- co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
5252
- }
5253
- }
5254
- }
5255
- return co;
5256
- };
5257
- var flt = new u8(288);
5258
- for (i = 0;i < 144; ++i)
5259
- flt[i] = 8;
5260
- var i;
5261
- for (i = 144;i < 256; ++i)
5262
- flt[i] = 9;
5263
- var i;
5264
- for (i = 256;i < 280; ++i)
5265
- flt[i] = 7;
5266
- var i;
5267
- for (i = 280;i < 288; ++i)
5268
- flt[i] = 8;
5269
- var i;
5270
- var fdt = new u8(32);
5271
- for (i = 0;i < 32; ++i)
5272
- fdt[i] = 5;
5273
- var i;
5274
- var flm = /* @__PURE__ */ hMap(flt, 9, 0);
5275
- var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
5276
- var shft = function(p) {
5277
- return (p + 7) / 8 | 0;
5278
- };
5279
- var slc = function(v, s, e) {
5280
- if (s == null || s < 0)
5281
- s = 0;
5282
- if (e == null || e > v.length)
5283
- e = v.length;
5284
- return new u8(v.subarray(s, e));
5285
- };
5286
- var ec = [
5287
- "unexpected EOF",
5288
- "invalid block type",
5289
- "invalid length/literal",
5290
- "invalid distance",
5291
- "stream finished",
5292
- "no stream handler",
5293
- ,
5294
- "no callback",
5295
- "invalid UTF-8 data",
5296
- "extra field too long",
5297
- "date not in range 1980-2099",
5298
- "filename too long",
5299
- "stream finishing",
5300
- "invalid zip data"
5301
- ];
5302
- var err = function(ind, msg, nt) {
5303
- var e = new Error(msg || ec[ind]);
5304
- e.code = ind;
5305
- if (Error.captureStackTrace)
5306
- Error.captureStackTrace(e, err);
5307
- if (!nt)
5308
- throw e;
5309
- return e;
5310
- };
5311
- var wbits = function(d, p, v) {
5312
- v <<= p & 7;
5313
- var o = p / 8 | 0;
5314
- d[o] |= v;
5315
- d[o + 1] |= v >> 8;
5316
- };
5317
- var wbits16 = function(d, p, v) {
5318
- v <<= p & 7;
5319
- var o = p / 8 | 0;
5320
- d[o] |= v;
5321
- d[o + 1] |= v >> 8;
5322
- d[o + 2] |= v >> 16;
5323
- };
5324
- var hTree = function(d, mb) {
5325
- var t = [];
5326
- for (var i2 = 0;i2 < d.length; ++i2) {
5327
- if (d[i2])
5328
- t.push({ s: i2, f: d[i2] });
5329
- }
5330
- var s = t.length;
5331
- var t2 = t.slice();
5332
- if (!s)
5333
- return { t: et, l: 0 };
5334
- if (s == 1) {
5335
- var v = new u8(t[0].s + 1);
5336
- v[t[0].s] = 1;
5337
- return { t: v, l: 1 };
5338
- }
5339
- t.sort(function(a, b) {
5340
- return a.f - b.f;
5341
- });
5342
- t.push({ s: -1, f: 25001 });
5343
- var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
5344
- t[0] = { s: -1, f: l.f + r.f, l, r };
5345
- while (i1 != s - 1) {
5346
- l = t[t[i0].f < t[i22].f ? i0++ : i22++];
5347
- r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
5348
- t[i1++] = { s: -1, f: l.f + r.f, l, r };
5349
- }
5350
- var maxSym = t2[0].s;
5351
- for (var i2 = 1;i2 < s; ++i2) {
5352
- if (t2[i2].s > maxSym)
5353
- maxSym = t2[i2].s;
5354
- }
5355
- var tr = new u16(maxSym + 1);
5356
- var mbt = ln(t[i1 - 1], tr, 0);
5357
- if (mbt > mb) {
5358
- var i2 = 0, dt = 0;
5359
- var lft = mbt - mb, cst = 1 << lft;
5360
- t2.sort(function(a, b) {
5361
- return tr[b.s] - tr[a.s] || a.f - b.f;
5362
- });
5363
- for (;i2 < s; ++i2) {
5364
- var i2_1 = t2[i2].s;
5365
- if (tr[i2_1] > mb) {
5366
- dt += cst - (1 << mbt - tr[i2_1]);
5367
- tr[i2_1] = mb;
5368
- } else
5369
- break;
5370
- }
5371
- dt >>= lft;
5372
- while (dt > 0) {
5373
- var i2_2 = t2[i2].s;
5374
- if (tr[i2_2] < mb)
5375
- dt -= 1 << mb - tr[i2_2]++ - 1;
5376
- else
5377
- ++i2;
5378
- }
5379
- for (;i2 >= 0 && dt; --i2) {
5380
- var i2_3 = t2[i2].s;
5381
- if (tr[i2_3] == mb) {
5382
- --tr[i2_3];
5383
- ++dt;
5384
- }
5385
- }
5386
- mbt = mb;
5387
- }
5388
- return { t: new u8(tr), l: mbt };
5389
- };
5390
- var ln = function(n, l, d) {
5391
- return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
5392
- };
5393
- var lc = function(c) {
5394
- var s = c.length;
5395
- while (s && !c[--s])
5396
- ;
5397
- var cl = new u16(++s);
5398
- var cli = 0, cln = c[0], cls = 1;
5399
- var w = function(v) {
5400
- cl[cli++] = v;
5401
- };
5402
- for (var i2 = 1;i2 <= s; ++i2) {
5403
- if (c[i2] == cln && i2 != s)
5404
- ++cls;
5405
- else {
5406
- if (!cln && cls > 2) {
5407
- for (;cls > 138; cls -= 138)
5408
- w(32754);
5409
- if (cls > 2) {
5410
- w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
5411
- cls = 0;
5412
- }
5413
- } else if (cls > 3) {
5414
- w(cln), --cls;
5415
- for (;cls > 6; cls -= 6)
5416
- w(8304);
5417
- if (cls > 2)
5418
- w(cls - 3 << 5 | 8208), cls = 0;
5419
- }
5420
- while (cls--)
5421
- w(cln);
5422
- cls = 1;
5423
- cln = c[i2];
5424
- }
5425
- }
5426
- return { c: cl.subarray(0, cli), n: s };
5427
- };
5428
- var clen = function(cf, cl) {
5429
- var l = 0;
5430
- for (var i2 = 0;i2 < cl.length; ++i2)
5431
- l += cf[i2] * cl[i2];
5432
- return l;
5433
- };
5434
- var wfblk = function(out, pos, dat) {
5435
- var s = dat.length;
5436
- var o = shft(pos + 2);
5437
- out[o] = s & 255;
5438
- out[o + 1] = s >> 8;
5439
- out[o + 2] = out[o] ^ 255;
5440
- out[o + 3] = out[o + 1] ^ 255;
5441
- for (var i2 = 0;i2 < s; ++i2)
5442
- out[o + i2 + 4] = dat[i2];
5443
- return (o + 4 + s) * 8;
5444
- };
5445
- var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
5446
- wbits(out, p++, final);
5447
- ++lf[256];
5448
- var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
5449
- var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
5450
- var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
5451
- var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
5452
- var lcfreq = new u16(19);
5453
- for (var i2 = 0;i2 < lclt.length; ++i2)
5454
- ++lcfreq[lclt[i2] & 31];
5455
- for (var i2 = 0;i2 < lcdt.length; ++i2)
5456
- ++lcfreq[lcdt[i2] & 31];
5457
- var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
5458
- var nlcc = 19;
5459
- for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
5460
- ;
5461
- var flen = bl + 5 << 3;
5462
- var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
5463
- var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
5464
- if (bs >= 0 && flen <= ftlen && flen <= dtlen)
5465
- return wfblk(out, p, dat.subarray(bs, bs + bl));
5466
- var lm, ll, dm, dl;
5467
- wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
5468
- if (dtlen < ftlen) {
5469
- lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
5470
- var llm = hMap(lct, mlcb, 0);
5471
- wbits(out, p, nlc - 257);
5472
- wbits(out, p + 5, ndc - 1);
5473
- wbits(out, p + 10, nlcc - 4);
5474
- p += 14;
5475
- for (var i2 = 0;i2 < nlcc; ++i2)
5476
- wbits(out, p + 3 * i2, lct[clim[i2]]);
5477
- p += 3 * nlcc;
5478
- var lcts = [lclt, lcdt];
5479
- for (var it = 0;it < 2; ++it) {
5480
- var clct = lcts[it];
5481
- for (var i2 = 0;i2 < clct.length; ++i2) {
5482
- var len = clct[i2] & 31;
5483
- wbits(out, p, llm[len]), p += lct[len];
5484
- if (len > 15)
5485
- wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
5486
- }
5487
- }
5488
- } else {
5489
- lm = flm, ll = flt, dm = fdm, dl = fdt;
5490
- }
5491
- for (var i2 = 0;i2 < li; ++i2) {
5492
- var sym = syms[i2];
5493
- if (sym > 255) {
5494
- var len = sym >> 18 & 31;
5495
- wbits16(out, p, lm[len + 257]), p += ll[len + 257];
5496
- if (len > 7)
5497
- wbits(out, p, sym >> 23 & 31), p += fleb[len];
5498
- var dst = sym & 31;
5499
- wbits16(out, p, dm[dst]), p += dl[dst];
5500
- if (dst > 3)
5501
- wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
5502
- } else {
5503
- wbits16(out, p, lm[sym]), p += ll[sym];
5504
- }
5505
- }
5506
- wbits16(out, p, lm[256]);
5507
- return p + ll[256];
5508
- };
5509
- var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
5510
- var et = /* @__PURE__ */ new u8(0);
5511
- var dflt = function(dat, lvl, plvl, pre, post, st) {
5512
- var s = st.z || dat.length;
5513
- var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
5514
- var w = o.subarray(pre, o.length - post);
5515
- var lst = st.l;
5516
- var pos = (st.r || 0) & 7;
5517
- if (lvl) {
5518
- if (pos)
5519
- w[0] = st.r >> 3;
5520
- var opt = deo[lvl - 1];
5521
- var n = opt >> 13, c = opt & 8191;
5522
- var msk_1 = (1 << plvl) - 1;
5523
- var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
5524
- var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
5525
- var hsh = function(i3) {
5526
- return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
5527
- };
5528
- var syms = new i32(25000);
5529
- var lf = new u16(288), df = new u16(32);
5530
- var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
5531
- for (;i2 + 2 < s; ++i2) {
5532
- var hv = hsh(i2);
5533
- var imod = i2 & 32767, pimod = head[hv];
5534
- prev[imod] = pimod;
5535
- head[hv] = imod;
5536
- if (wi <= i2) {
5537
- var rem = s - i2;
5538
- if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
5539
- pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
5540
- li = lc_1 = eb = 0, bs = i2;
5541
- for (var j = 0;j < 286; ++j)
5542
- lf[j] = 0;
5543
- for (var j = 0;j < 30; ++j)
5544
- df[j] = 0;
5545
- }
5546
- var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
5547
- if (rem > 2 && hv == hsh(i2 - dif)) {
5548
- var maxn = Math.min(n, rem) - 1;
5549
- var maxd = Math.min(32767, i2);
5550
- var ml = Math.min(258, rem);
5551
- while (dif <= maxd && --ch_1 && imod != pimod) {
5552
- if (dat[i2 + l] == dat[i2 + l - dif]) {
5553
- var nl = 0;
5554
- for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
5555
- ;
5556
- if (nl > l) {
5557
- l = nl, d = dif;
5558
- if (nl > maxn)
5559
- break;
5560
- var mmd = Math.min(dif, nl - 2);
5561
- var md = 0;
5562
- for (var j = 0;j < mmd; ++j) {
5563
- var ti = i2 - dif + j & 32767;
5564
- var pti = prev[ti];
5565
- var cd = ti - pti & 32767;
5566
- if (cd > md)
5567
- md = cd, pimod = ti;
5568
- }
5569
- }
5570
- }
5571
- imod = pimod, pimod = prev[imod];
5572
- dif += imod - pimod & 32767;
5573
- }
5574
- }
5575
- if (d) {
5576
- syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
5577
- var lin = revfl[l] & 31, din = revfd[d] & 31;
5578
- eb += fleb[lin] + fdeb[din];
5579
- ++lf[257 + lin];
5580
- ++df[din];
5581
- wi = i2 + l;
5582
- ++lc_1;
5583
- } else {
5584
- syms[li++] = dat[i2];
5585
- ++lf[dat[i2]];
5586
- }
5587
- }
5588
- }
5589
- for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
5590
- syms[li++] = dat[i2];
5591
- ++lf[dat[i2]];
5592
- }
5593
- pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
5594
- if (!lst) {
5595
- st.r = pos & 7 | w[pos / 8 | 0] << 3;
5596
- pos -= 7;
5597
- st.h = head, st.p = prev, st.i = i2, st.w = wi;
5598
- }
5599
- } else {
5600
- for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
5601
- var e = i2 + 65535;
5602
- if (e >= s) {
5603
- w[pos / 8 | 0] = lst;
5604
- e = s;
5605
- }
5606
- pos = wfblk(w, pos + 1, dat.subarray(i2, e));
5607
- }
5608
- st.i = s;
5609
- }
5610
- return slc(o, 0, pre + shft(pos) + post);
5611
- };
5612
- var crct = /* @__PURE__ */ function() {
5613
- var t = new Int32Array(256);
5614
- for (var i2 = 0;i2 < 256; ++i2) {
5615
- var c = i2, k = 9;
5616
- while (--k)
5617
- c = (c & 1 && -306674912) ^ c >>> 1;
5618
- t[i2] = c;
5619
- }
5620
- return t;
5621
- }();
5622
- var crc = function() {
5623
- var c = -1;
5624
- return {
5625
- p: function(d) {
5626
- var cr = c;
5627
- for (var i2 = 0;i2 < d.length; ++i2)
5628
- cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
5629
- c = cr;
5630
- },
5631
- d: function() {
5632
- return ~c;
5633
- }
5634
- };
5635
- };
5636
- var dopt = function(dat, opt, pre, post, st) {
5637
- if (!st) {
5638
- st = { l: 1 };
5639
- if (opt.dictionary) {
5640
- var dict = opt.dictionary.subarray(-32768);
5641
- var newDat = new u8(dict.length + dat.length);
5642
- newDat.set(dict);
5643
- newDat.set(dat, dict.length);
5644
- dat = newDat;
5645
- st.w = dict.length;
5646
- }
5647
- }
5648
- 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);
5649
- };
5650
- var mrg = function(a, b) {
5651
- var o = {};
5652
- for (var k in a)
5653
- o[k] = a[k];
5654
- for (var k in b)
5655
- o[k] = b[k];
5656
- return o;
5657
- };
5658
- var wbytes = function(d, b, v) {
5659
- for (;v; ++b)
5660
- d[b] = v, v >>>= 8;
5661
- };
5662
- function deflateSync(data, opts) {
5663
- return dopt(data, opts || {}, 0, 0);
5664
- }
5665
- var fltn = function(d, p, t, o) {
5666
- for (var k in d) {
5667
- var val = d[k], n = p + k, op = o;
5668
- if (Array.isArray(val))
5669
- op = mrg(o, val[1]), val = val[0];
5670
- if (ArrayBuffer.isView(val))
5671
- t[n] = [val, op];
5672
- else {
5673
- t[n += "/"] = [new u8(0), op];
5674
- fltn(val, n, t, o);
5675
- }
5676
- }
5677
- };
5678
- var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
5679
- var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
5680
- var tds = 0;
5681
- try {
5682
- td.decode(et, { stream: true });
5683
- tds = 1;
5684
- } catch (e) {}
5685
- function strToU8(str, latin1) {
5686
- if (latin1) {
5687
- var ar_1 = new u8(str.length);
5688
- for (var i2 = 0;i2 < str.length; ++i2)
5689
- ar_1[i2] = str.charCodeAt(i2);
5690
- return ar_1;
5691
- }
5692
- if (te)
5693
- return te.encode(str);
5694
- var l = str.length;
5695
- var ar = new u8(str.length + (str.length >> 1));
5696
- var ai = 0;
5697
- var w = function(v) {
5698
- ar[ai++] = v;
5699
- };
5700
- for (var i2 = 0;i2 < l; ++i2) {
5701
- if (ai + 5 > ar.length) {
5702
- var n = new u8(ai + 8 + (l - i2 << 1));
5703
- n.set(ar);
5704
- ar = n;
5705
- }
5706
- var c = str.charCodeAt(i2);
5707
- if (c < 128 || latin1)
5708
- w(c);
5709
- else if (c < 2048)
5710
- w(192 | c >> 6), w(128 | c & 63);
5711
- else if (c > 55295 && c < 57344)
5712
- 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);
5713
- else
5714
- w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
5715
- }
5716
- return slc(ar, 0, ai);
5717
- }
5718
- var exfl = function(ex) {
5719
- var le = 0;
5720
- if (ex) {
5721
- for (var k in ex) {
5722
- var l = ex[k].length;
5723
- if (l > 65535)
5724
- err(9);
5725
- le += l + 4;
5726
- }
5727
- }
5728
- return le;
5729
- };
5730
- var wzh = function(d, b, f, fn, u, c, ce, co) {
5731
- var fl2 = fn.length, ex = f.extra, col = co && co.length;
5732
- var exl = exfl(ex);
5733
- wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
5734
- if (ce != null)
5735
- d[b++] = 20, d[b++] = f.os;
5736
- d[b] = 20, b += 2;
5737
- d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
5738
- d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
5739
- var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
5740
- if (y < 0 || y > 119)
5741
- err(10);
5742
- wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
5743
- if (c != -1) {
5744
- wbytes(d, b, f.crc);
5745
- wbytes(d, b + 4, c < 0 ? -c - 2 : c);
5746
- wbytes(d, b + 8, f.size);
5747
- }
5748
- wbytes(d, b + 12, fl2);
5749
- wbytes(d, b + 14, exl), b += 16;
5750
- if (ce != null) {
5751
- wbytes(d, b, col);
5752
- wbytes(d, b + 6, f.attrs);
5753
- wbytes(d, b + 10, ce), b += 14;
5754
- }
5755
- d.set(fn, b);
5756
- b += fl2;
5757
- if (exl) {
5758
- for (var k in ex) {
5759
- var exf = ex[k], l = exf.length;
5760
- wbytes(d, b, +k);
5761
- wbytes(d, b + 2, l);
5762
- d.set(exf, b + 4), b += 4 + l;
5763
- }
5764
- }
5765
- if (col)
5766
- d.set(co, b), b += col;
5767
- return b;
5768
- };
5769
- var wzf = function(o, b, c, d, e) {
5770
- wbytes(o, b, 101010256);
5771
- wbytes(o, b + 8, c);
5772
- wbytes(o, b + 10, c);
5773
- wbytes(o, b + 12, d);
5774
- wbytes(o, b + 16, e);
5775
- };
5776
- function zipSync(data, opts) {
5777
- if (!opts)
5778
- opts = {};
5779
- var r = {};
5780
- var files = [];
5781
- fltn(data, "", r, opts);
5782
- var o = 0;
5783
- var tot = 0;
5784
- for (var fn in r) {
5785
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
5786
- var compression = p.level == 0 ? 0 : 8;
5787
- var f = strToU8(fn), s = f.length;
5788
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
5789
- var exl = exfl(p.extra);
5790
- if (s > 65535)
5791
- err(11);
5792
- var d = compression ? deflateSync(file, p) : file, l = d.length;
5793
- var c = crc();
5794
- c.p(file);
5795
- files.push(mrg(p, {
5796
- size: file.length,
5797
- crc: c.d(),
5798
- c: d,
5799
- f,
5800
- m,
5801
- u: s != fn.length || m && com.length != ms,
5802
- o,
5803
- compression
5804
- }));
5805
- o += 30 + s + exl + l;
5806
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
5807
- }
5808
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
5809
- for (var i2 = 0;i2 < files.length; ++i2) {
5810
- var f = files[i2];
5811
- wzh(out, f.o, f, f.f, f.u, f.c.length);
5812
- var badd = 30 + f.f.length + exfl(f.extra);
5813
- out.set(f.c, f.o + badd);
5814
- wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
5815
- }
5816
- wzf(out, o, files.length, cdl, oe);
5817
- return out;
5818
- }
5819
- // ../packager/packager-core/src/i18n/types.ts
5820
- function isPluralForm(value) {
5821
- return typeof value === "object" && value !== null && "other" in value;
5822
- }
5823
- function selectPluralForm(forms, count) {
5824
- if (count === 0 && forms.zero !== undefined) {
5825
- return forms.zero;
5826
- }
5827
- if (count === 1 && forms.one !== undefined) {
5828
- return forms.one;
5829
- }
5830
- if (count === 2 && forms.two !== undefined) {
5831
- return forms.two;
5832
- }
5833
- if (forms.few !== undefined) {
5834
- const mod10 = count % 10;
5835
- const mod100 = count % 100;
5836
- if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
5837
- return forms.few;
5838
- }
5839
- }
5840
- if (forms.many !== undefined) {
5841
- const mod10 = count % 10;
5842
- const mod100 = count % 100;
5843
- if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
5844
- return forms.many;
5845
- }
5846
- }
5847
- return forms.other;
5848
- }
5849
-
5850
- // ../packager/packager-core/src/i18n/i18n-manager.ts
5851
- class I18nManager {
5852
- static translations = {};
5853
- static currentLocale = "en";
5854
- static fallbackLocale = "en";
5855
- static registerTranslations(locale, catalog) {
5856
- if (!I18nManager.translations[locale]) {
5857
- I18nManager.translations[locale] = {};
5858
- }
5859
- I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
5860
- }
5861
- static setLocale(locale) {
5862
- const normalized = I18nManager.normalizeLocale(locale);
5863
- if (I18nManager.translations[normalized]) {
5864
- I18nManager.currentLocale = normalized;
5865
- return normalized;
5866
- }
5867
- const baseLocale = normalized.split("-")[0];
5868
- if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
5869
- I18nManager.currentLocale = baseLocale;
5870
- return baseLocale;
5871
- }
5872
- return I18nManager.currentLocale;
5873
- }
5874
- static getLocale() {
5875
- return I18nManager.currentLocale;
5876
- }
5877
- static setFallbackLocale(locale) {
5878
- I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
5879
- }
5880
- static t(key, params, locale) {
5881
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
5882
- let value = I18nManager.getTranslationValue(key, targetLocale);
5883
- if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
5884
- value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
5885
- }
5886
- if (value === undefined) {
5887
- return key;
5888
- }
5889
- if (isPluralForm(value) && params && "count" in params) {
5890
- const count = typeof params.count === "number" ? params.count : Number(params.count);
5891
- value = selectPluralForm(value, count);
5892
- } else if (isPluralForm(value)) {
5893
- value = value.other;
5894
- }
5895
- if (typeof value !== "string") {
5896
- return key;
5897
- }
5898
- return params ? I18nManager.interpolate(value, params) : value;
5899
- }
5900
- static has(key, locale) {
5901
- const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
5902
- const value = I18nManager.getTranslationValue(key, targetLocale);
5903
- if (value !== undefined) {
5904
- return true;
5905
- }
5906
- if (targetLocale !== I18nManager.fallbackLocale) {
5907
- return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
5908
- }
5909
- return false;
5910
- }
5911
- static getAvailableLocales() {
5912
- return Object.keys(I18nManager.translations);
5913
- }
5914
- static clearTranslations() {
5915
- I18nManager.translations = {};
5916
- I18nManager.currentLocale = "en";
5917
- }
5918
- static getTranslationValue(key, locale) {
5919
- const catalog = I18nManager.translations[locale];
5920
- if (!catalog) {
5921
- return;
5922
- }
5923
- const keys = key.split(".");
5924
- let value = catalog;
5925
- for (const k of keys) {
5926
- if (value && typeof value === "object" && k in value) {
5927
- value = value[k];
5928
- } else {
5929
- return;
5930
- }
5931
- }
5932
- return value;
5933
- }
5934
- static interpolate(template, params) {
5935
- return template.replace(/\{(\w+)\}/g, (_, key) => {
5936
- const value = params[key];
5937
- return value !== undefined ? String(value) : `{${key}}`;
5938
- });
5939
- }
5940
- static normalizeLocale(locale) {
5941
- const normalized = locale.toLowerCase().replace(/_/g, "-");
5942
- const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
5943
- if (specialLocales.includes(normalized)) {
5944
- return normalized;
5945
- }
5946
- return normalized.split("-")[0];
5947
- }
5948
- static deepMerge(target, source) {
5949
- const result = { ...target };
5950
- for (const key of Object.keys(source)) {
5951
- const sourceValue = source[key];
5952
- const targetValue = result[key];
5953
- if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
5954
- result[key] = I18nManager.deepMerge(targetValue, sourceValue);
5955
- } else {
5956
- result[key] = sourceValue;
5957
- }
5958
- }
5959
- return result;
5960
- }
5961
- }
5962
6002
 
5963
- // ../packager/packager-core/src/i18n/locales/de.ts
5964
- var de = {
5965
- toolCore: {
5966
- errors: {
5967
- internal: "Internal error: {message}",
5968
- fileNotFound: "File not found: {path}",
5969
- fileReadFailed: "Failed to read file: {path}",
5970
- fileWriteFailed: "Failed to write file: {path}",
5971
- directoryNotFound: "Directory not found: {path}",
5972
- invalidPath: "{path} is not a valid path",
5973
- operationCanceled: "Operation was canceled",
5974
- invalidParameter: "Invalid parameter: {parameter}"
5975
- },
5976
- progress: {
5977
- copying: "Copying files...",
5978
- building: "Building project...",
5979
- packaging: "Creating package...",
5980
- validating: "Validating...",
5981
- analyzing: "Analyzing...",
5982
- restoring: "Restoring dependencies..."
5983
- },
5984
- validation: {
5985
- requiredField: "{field} is required",
5986
- invalidValue: "Invalid value for {field}",
5987
- pathNotFound: "Path not found: {path}",
5988
- fileRequired: "File is required: {path}",
5989
- directoryRequired: "Directory is required: {path}"
5990
- },
5991
- warnings: {
5992
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
5993
- },
5994
- info: {
5995
- operationComplete: "Operation completed successfully",
5996
- filesProcessed: {
5997
- zero: "No files processed",
5998
- one: "{count} file processed",
5999
- other: "{count} files processed"
6000
- }
6001
- }
6002
- }
6003
- };
6004
-
6005
- // ../packager/packager-core/src/i18n/locales/en.ts
6006
- var en = {
6007
- toolCore: {
6008
- errors: {
6009
- internal: "Internal error: {message}",
6010
- fileNotFound: "File not found: {path}",
6011
- fileReadFailed: "Failed to read file: {path}",
6012
- fileWriteFailed: "Failed to write file: {path}",
6013
- directoryNotFound: "Directory not found: {path}",
6014
- invalidPath: "{path} is not a valid path",
6015
- operationCanceled: "Operation was canceled",
6016
- invalidParameter: "Invalid parameter: {parameter}"
6017
- },
6018
- progress: {
6019
- copying: "Copying files...",
6020
- building: "Building project...",
6021
- packaging: "Creating package...",
6022
- validating: "Validating...",
6023
- analyzing: "Analyzing...",
6024
- restoring: "Restoring dependencies..."
6025
- },
6026
- validation: {
6027
- requiredField: "{field} is required",
6028
- invalidValue: "Invalid value for {field}",
6029
- pathNotFound: "Path not found: {path}",
6030
- fileRequired: "File is required: {path}",
6031
- directoryRequired: "Directory is required: {path}"
6032
- },
6033
- warnings: {
6034
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6035
- },
6036
- info: {
6037
- operationComplete: "Operation completed successfully",
6038
- filesProcessed: {
6039
- zero: "No files processed",
6040
- one: "{count} file processed",
6041
- other: "{count} files processed"
6042
- }
6043
- }
6044
- }
6045
- };
6046
-
6047
- // ../packager/packager-core/src/i18n/locales/es.ts
6048
- var es = {
6049
- toolCore: {
6050
- errors: {
6051
- internal: "Internal error: {message}",
6052
- fileNotFound: "File not found: {path}",
6053
- fileReadFailed: "Failed to read file: {path}",
6054
- fileWriteFailed: "Failed to write file: {path}",
6055
- directoryNotFound: "Directory not found: {path}",
6056
- invalidPath: "{path} is not a valid path",
6057
- operationCanceled: "Operation was canceled",
6058
- invalidParameter: "Invalid parameter: {parameter}"
6059
- },
6060
- progress: {
6061
- copying: "Copying files...",
6062
- building: "Building project...",
6063
- packaging: "Creating package...",
6064
- validating: "Validating...",
6065
- analyzing: "Analyzing...",
6066
- restoring: "Restoring dependencies..."
6067
- },
6068
- validation: {
6069
- requiredField: "{field} is required",
6070
- invalidValue: "Invalid value for {field}",
6071
- pathNotFound: "Path not found: {path}",
6072
- fileRequired: "File is required: {path}",
6073
- directoryRequired: "Directory is required: {path}"
6074
- },
6075
- warnings: {
6076
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6077
- },
6078
- info: {
6079
- operationComplete: "Operation completed successfully",
6080
- filesProcessed: {
6081
- zero: "No files processed",
6082
- one: "{count} file processed",
6083
- other: "{count} files processed"
6084
- }
6085
- }
6086
- }
6087
- };
6088
-
6089
- // ../packager/packager-core/src/i18n/locales/es-MX.ts
6090
- var es_MX = {
6091
- toolCore: {
6092
- errors: {
6093
- internal: "Internal error: {message}",
6094
- fileNotFound: "File not found: {path}",
6095
- fileReadFailed: "Failed to read file: {path}",
6096
- fileWriteFailed: "Failed to write file: {path}",
6097
- directoryNotFound: "Directory not found: {path}",
6098
- invalidPath: "{path} is not a valid path",
6099
- operationCanceled: "Operation was canceled",
6100
- invalidParameter: "Invalid parameter: {parameter}"
6101
- },
6102
- progress: {
6103
- copying: "Copying files...",
6104
- building: "Building project...",
6105
- packaging: "Creating package...",
6106
- validating: "Validating...",
6107
- analyzing: "Analyzing...",
6108
- restoring: "Restoring dependencies..."
6109
- },
6110
- validation: {
6111
- requiredField: "{field} is required",
6112
- invalidValue: "Invalid value for {field}",
6113
- pathNotFound: "Path not found: {path}",
6114
- fileRequired: "File is required: {path}",
6115
- directoryRequired: "Directory is required: {path}"
6116
- },
6117
- warnings: {
6118
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6119
- },
6120
- info: {
6121
- operationComplete: "Operation completed successfully",
6122
- filesProcessed: {
6123
- zero: "No files processed",
6124
- one: "{count} file processed",
6125
- other: "{count} files processed"
6126
- }
6127
- }
6128
- }
6129
- };
6130
-
6131
- // ../packager/packager-core/src/i18n/locales/fr.ts
6132
- var fr = {
6133
- toolCore: {
6134
- errors: {
6135
- internal: "Internal error: {message}",
6136
- fileNotFound: "File not found: {path}",
6137
- fileReadFailed: "Failed to read file: {path}",
6138
- fileWriteFailed: "Failed to write file: {path}",
6139
- directoryNotFound: "Directory not found: {path}",
6140
- invalidPath: "{path} is not a valid path",
6141
- operationCanceled: "Operation was canceled",
6142
- invalidParameter: "Invalid parameter: {parameter}"
6143
- },
6144
- progress: {
6145
- copying: "Copying files...",
6146
- building: "Building project...",
6147
- packaging: "Creating package...",
6148
- validating: "Validating...",
6149
- analyzing: "Analyzing...",
6150
- restoring: "Restoring dependencies..."
6151
- },
6152
- validation: {
6153
- requiredField: "{field} is required",
6154
- invalidValue: "Invalid value for {field}",
6155
- pathNotFound: "Path not found: {path}",
6156
- fileRequired: "File is required: {path}",
6157
- directoryRequired: "Directory is required: {path}"
6158
- },
6159
- warnings: {
6160
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6161
- },
6162
- info: {
6163
- operationComplete: "Operation completed successfully",
6164
- filesProcessed: {
6165
- zero: "No files processed",
6166
- one: "{count} file processed",
6167
- other: "{count} files processed"
6168
- }
6169
- }
6170
- }
6171
- };
6172
-
6173
- // ../packager/packager-core/src/i18n/locales/ja.ts
6174
- var ja = {
6175
- toolCore: {
6176
- errors: {
6177
- internal: "Internal error: {message}",
6178
- fileNotFound: "File not found: {path}",
6179
- fileReadFailed: "Failed to read file: {path}",
6180
- fileWriteFailed: "Failed to write file: {path}",
6181
- directoryNotFound: "Directory not found: {path}",
6182
- invalidPath: "{path} is not a valid path",
6183
- operationCanceled: "Operation was canceled",
6184
- invalidParameter: "Invalid parameter: {parameter}"
6185
- },
6186
- progress: {
6187
- copying: "Copying files...",
6188
- building: "Building project...",
6189
- packaging: "Creating package...",
6190
- validating: "Validating...",
6191
- analyzing: "Analyzing...",
6192
- restoring: "Restoring dependencies..."
6193
- },
6194
- validation: {
6195
- requiredField: "{field} is required",
6196
- invalidValue: "Invalid value for {field}",
6197
- pathNotFound: "Path not found: {path}",
6198
- fileRequired: "File is required: {path}",
6199
- directoryRequired: "Directory is required: {path}"
6200
- },
6201
- warnings: {
6202
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6203
- },
6204
- info: {
6205
- operationComplete: "Operation completed successfully",
6206
- filesProcessed: {
6207
- zero: "No files processed",
6208
- one: "{count} file processed",
6209
- other: "{count} files processed"
6210
- }
6211
- }
6212
- }
6213
- };
6214
-
6215
- // ../packager/packager-core/src/i18n/locales/ko.ts
6216
- var ko = {
6217
- toolCore: {
6218
- errors: {
6219
- internal: "Internal error: {message}",
6220
- fileNotFound: "File not found: {path}",
6221
- fileReadFailed: "Failed to read file: {path}",
6222
- fileWriteFailed: "Failed to write file: {path}",
6223
- directoryNotFound: "Directory not found: {path}",
6224
- invalidPath: "{path} is not a valid path",
6225
- operationCanceled: "Operation was canceled",
6226
- invalidParameter: "Invalid parameter: {parameter}"
6227
- },
6228
- progress: {
6229
- copying: "Copying files...",
6230
- building: "Building project...",
6231
- packaging: "Creating package...",
6232
- validating: "Validating...",
6233
- analyzing: "Analyzing...",
6234
- restoring: "Restoring dependencies..."
6235
- },
6236
- validation: {
6237
- requiredField: "{field} is required",
6238
- invalidValue: "Invalid value for {field}",
6239
- pathNotFound: "Path not found: {path}",
6240
- fileRequired: "File is required: {path}",
6241
- directoryRequired: "Directory is required: {path}"
6242
- },
6243
- warnings: {
6244
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6245
- },
6246
- info: {
6247
- operationComplete: "Operation completed successfully",
6248
- filesProcessed: {
6249
- zero: "No files processed",
6250
- one: "{count} file processed",
6251
- other: "{count} files processed"
6252
- }
6253
- }
6254
- }
6255
- };
6256
-
6257
- // ../packager/packager-core/src/i18n/locales/pt.ts
6258
- var pt = {
6259
- toolCore: {
6260
- errors: {
6261
- internal: "Internal error: {message}",
6262
- fileNotFound: "File not found: {path}",
6263
- fileReadFailed: "Failed to read file: {path}",
6264
- fileWriteFailed: "Failed to write file: {path}",
6265
- directoryNotFound: "Directory not found: {path}",
6266
- invalidPath: "{path} is not a valid path",
6267
- operationCanceled: "Operation was canceled",
6268
- invalidParameter: "Invalid parameter: {parameter}"
6269
- },
6270
- progress: {
6271
- copying: "Copying files...",
6272
- building: "Building project...",
6273
- packaging: "Creating package...",
6274
- validating: "Validating...",
6275
- analyzing: "Analyzing...",
6276
- restoring: "Restoring dependencies..."
6277
- },
6278
- validation: {
6279
- requiredField: "{field} is required",
6280
- invalidValue: "Invalid value for {field}",
6281
- pathNotFound: "Path not found: {path}",
6282
- fileRequired: "File is required: {path}",
6283
- directoryRequired: "Directory is required: {path}"
6284
- },
6285
- warnings: {
6286
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6287
- },
6288
- info: {
6289
- operationComplete: "Operation completed successfully",
6290
- filesProcessed: {
6291
- zero: "No files processed",
6292
- one: "{count} file processed",
6293
- other: "{count} files processed"
6294
- }
6295
- }
6296
- }
6297
- };
6298
-
6299
- // ../packager/packager-core/src/i18n/locales/pt-BR.ts
6300
- var pt_BR = {
6301
- toolCore: {
6302
- errors: {
6303
- internal: "Internal error: {message}",
6304
- fileNotFound: "File not found: {path}",
6305
- fileReadFailed: "Failed to read file: {path}",
6306
- fileWriteFailed: "Failed to write file: {path}",
6307
- directoryNotFound: "Directory not found: {path}",
6308
- invalidPath: "{path} is not a valid path",
6309
- operationCanceled: "Operation was canceled",
6310
- invalidParameter: "Invalid parameter: {parameter}"
6311
- },
6312
- progress: {
6313
- copying: "Copying files...",
6314
- building: "Building project...",
6315
- packaging: "Creating package...",
6316
- validating: "Validating...",
6317
- analyzing: "Analyzing...",
6318
- restoring: "Restoring dependencies..."
6319
- },
6320
- validation: {
6321
- requiredField: "{field} is required",
6322
- invalidValue: "Invalid value for {field}",
6323
- pathNotFound: "Path not found: {path}",
6324
- fileRequired: "File is required: {path}",
6325
- directoryRequired: "Directory is required: {path}"
6326
- },
6327
- warnings: {
6328
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6329
- },
6330
- info: {
6331
- operationComplete: "Operation completed successfully",
6332
- filesProcessed: {
6333
- zero: "No files processed",
6334
- one: "{count} file processed",
6335
- other: "{count} files processed"
6336
- }
6337
- }
6338
- }
6339
- };
6340
-
6341
- // ../packager/packager-core/src/i18n/locales/ro.ts
6342
- var ro = {
6343
- toolCore: {
6344
- errors: {
6345
- internal: "Internal error: {message}",
6346
- fileNotFound: "File not found: {path}",
6347
- fileReadFailed: "Failed to read file: {path}",
6348
- fileWriteFailed: "Failed to write file: {path}",
6349
- directoryNotFound: "Directory not found: {path}",
6350
- invalidPath: "{path} is not a valid path",
6351
- operationCanceled: "Operation was canceled",
6352
- invalidParameter: "Invalid parameter: {parameter}"
6353
- },
6354
- progress: {
6355
- copying: "Copying files...",
6356
- building: "Building project...",
6357
- packaging: "Creating package...",
6358
- validating: "Validating...",
6359
- analyzing: "Analyzing...",
6360
- restoring: "Restoring dependencies..."
6361
- },
6362
- validation: {
6363
- requiredField: "{field} is required",
6364
- invalidValue: "Invalid value for {field}",
6365
- pathNotFound: "Path not found: {path}",
6366
- fileRequired: "File is required: {path}",
6367
- directoryRequired: "Directory is required: {path}"
6368
- },
6369
- warnings: {
6370
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6371
- },
6372
- info: {
6373
- operationComplete: "Operation completed successfully",
6374
- filesProcessed: {
6375
- zero: "No files processed",
6376
- one: "{count} file processed",
6377
- other: "{count} files processed"
6378
- }
6379
- }
6380
- }
6381
- };
6382
-
6383
- // ../packager/packager-core/src/i18n/locales/ru.ts
6384
- var ru = {
6385
- toolCore: {
6386
- errors: {
6387
- internal: "Internal error: {message}",
6388
- fileNotFound: "File not found: {path}",
6389
- fileReadFailed: "Failed to read file: {path}",
6390
- fileWriteFailed: "Failed to write file: {path}",
6391
- directoryNotFound: "Directory not found: {path}",
6392
- invalidPath: "{path} is not a valid path",
6393
- operationCanceled: "Operation was canceled",
6394
- invalidParameter: "Invalid parameter: {parameter}"
6395
- },
6396
- progress: {
6397
- copying: "Copying files...",
6398
- building: "Building project...",
6399
- packaging: "Creating package...",
6400
- validating: "Validating...",
6401
- analyzing: "Analyzing...",
6402
- restoring: "Restoring dependencies..."
6403
- },
6404
- validation: {
6405
- requiredField: "{field} is required",
6406
- invalidValue: "Invalid value for {field}",
6407
- pathNotFound: "Path not found: {path}",
6408
- fileRequired: "File is required: {path}",
6409
- directoryRequired: "Directory is required: {path}"
6410
- },
6411
- warnings: {
6412
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6413
- },
6414
- info: {
6415
- operationComplete: "Operation completed successfully",
6416
- filesProcessed: {
6417
- zero: "No files processed",
6418
- one: "{count} file processed",
6419
- other: "{count} files processed"
6420
- }
6421
- }
6422
- }
6423
- };
6424
-
6425
- // ../packager/packager-core/src/i18n/locales/tr.ts
6426
- var tr = {
6427
- toolCore: {
6428
- errors: {
6429
- internal: "Internal error: {message}",
6430
- fileNotFound: "File not found: {path}",
6431
- fileReadFailed: "Failed to read file: {path}",
6432
- fileWriteFailed: "Failed to write file: {path}",
6433
- directoryNotFound: "Directory not found: {path}",
6434
- invalidPath: "{path} is not a valid path",
6435
- operationCanceled: "Operation was canceled",
6436
- invalidParameter: "Invalid parameter: {parameter}"
6437
- },
6438
- progress: {
6439
- copying: "Copying files...",
6440
- building: "Building project...",
6441
- packaging: "Creating package...",
6442
- validating: "Validating...",
6443
- analyzing: "Analyzing...",
6444
- restoring: "Restoring dependencies..."
6445
- },
6446
- validation: {
6447
- requiredField: "{field} is required",
6448
- invalidValue: "Invalid value for {field}",
6449
- pathNotFound: "Path not found: {path}",
6450
- fileRequired: "File is required: {path}",
6451
- directoryRequired: "Directory is required: {path}"
6452
- },
6453
- warnings: {
6454
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6455
- },
6456
- info: {
6457
- operationComplete: "Operation completed successfully",
6458
- filesProcessed: {
6459
- zero: "No files processed",
6460
- one: "{count} file processed",
6461
- other: "{count} files processed"
6462
- }
6463
- }
6464
- }
6465
- };
6466
-
6467
- // ../packager/packager-core/src/i18n/locales/zh-CN.ts
6468
- var zh_CN = {
6469
- toolCore: {
6470
- errors: {
6471
- internal: "Internal error: {message}",
6472
- fileNotFound: "File not found: {path}",
6473
- fileReadFailed: "Failed to read file: {path}",
6474
- fileWriteFailed: "Failed to write file: {path}",
6475
- directoryNotFound: "Directory not found: {path}",
6476
- invalidPath: "{path} is not a valid path",
6477
- operationCanceled: "Operation was canceled",
6478
- invalidParameter: "Invalid parameter: {parameter}"
6479
- },
6480
- progress: {
6481
- copying: "Copying files...",
6482
- building: "Building project...",
6483
- packaging: "Creating package...",
6484
- validating: "Validating...",
6485
- analyzing: "Analyzing...",
6486
- restoring: "Restoring dependencies..."
6487
- },
6488
- validation: {
6489
- requiredField: "{field} is required",
6490
- invalidValue: "Invalid value for {field}",
6491
- pathNotFound: "Path not found: {path}",
6492
- fileRequired: "File is required: {path}",
6493
- directoryRequired: "Directory is required: {path}"
6494
- },
6495
- warnings: {
6496
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6497
- },
6498
- info: {
6499
- operationComplete: "Operation completed successfully",
6500
- filesProcessed: {
6501
- zero: "No files processed",
6502
- one: "{count} file processed",
6503
- other: "{count} files processed"
6504
- }
6505
- }
6506
- }
6507
- };
6508
-
6509
- // ../packager/packager-core/src/i18n/locales/zh-TW.ts
6510
- var zh_TW = {
6511
- toolCore: {
6512
- errors: {
6513
- internal: "Internal error: {message}",
6514
- fileNotFound: "File not found: {path}",
6515
- fileReadFailed: "Failed to read file: {path}",
6516
- fileWriteFailed: "Failed to write file: {path}",
6517
- directoryNotFound: "Directory not found: {path}",
6518
- invalidPath: "{path} is not a valid path",
6519
- operationCanceled: "Operation was canceled",
6520
- invalidParameter: "Invalid parameter: {parameter}"
6521
- },
6522
- progress: {
6523
- copying: "Copying files...",
6524
- building: "Building project...",
6525
- packaging: "Creating package...",
6526
- validating: "Validating...",
6527
- analyzing: "Analyzing...",
6528
- restoring: "Restoring dependencies..."
6529
- },
6530
- validation: {
6531
- requiredField: "{field} is required",
6532
- invalidValue: "Invalid value for {field}",
6533
- pathNotFound: "Path not found: {path}",
6534
- fileRequired: "File is required: {path}",
6535
- directoryRequired: "Directory is required: {path}"
6536
- },
6537
- warnings: {
6538
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6539
- },
6540
- info: {
6541
- operationComplete: "Operation completed successfully",
6542
- filesProcessed: {
6543
- zero: "No files processed",
6544
- one: "{count} file processed",
6545
- other: "{count} files processed"
6546
- }
6547
- }
6548
- }
6549
- };
6550
-
6551
- // ../packager/packager-core/src/i18n/locales/zu.ts
6552
- var zu = {
6553
- toolCore: {
6554
- errors: {
6555
- internal: "Internal error: {message}",
6556
- fileNotFound: "File not found: {path}",
6557
- fileReadFailed: "Failed to read file: {path}",
6558
- fileWriteFailed: "Failed to write file: {path}",
6559
- directoryNotFound: "Directory not found: {path}",
6560
- invalidPath: "{path} is not a valid path",
6561
- operationCanceled: "Operation was canceled",
6562
- invalidParameter: "Invalid parameter: {parameter}"
6563
- },
6564
- progress: {
6565
- copying: "Copying files...",
6566
- building: "Building project...",
6567
- packaging: "Creating package...",
6568
- validating: "Validating...",
6569
- analyzing: "Analyzing...",
6570
- restoring: "Restoring dependencies..."
6571
- },
6572
- validation: {
6573
- requiredField: "{field} is required",
6574
- invalidValue: "Invalid value for {field}",
6575
- pathNotFound: "Path not found: {path}",
6576
- fileRequired: "File is required: {path}",
6577
- directoryRequired: "Directory is required: {path}"
6578
- },
6579
- warnings: {
6580
- factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
6581
- },
6582
- info: {
6583
- operationComplete: "Operation completed successfully",
6584
- filesProcessed: {
6585
- zero: "No files processed",
6586
- one: "{count} file processed",
6587
- other: "{count} files processed"
6588
- }
6589
- }
6590
- }
6591
- };
6592
-
6593
- // ../packager/packager-core/src/i18n/translation-service.ts
6594
- class TranslationService {
6595
- static instance;
6596
- currentLocale = "en";
6597
- constructor() {}
6598
- static getInstance() {
6599
- if (!TranslationService.instance) {
6600
- TranslationService.instance = new TranslationService;
6601
- }
6602
- return TranslationService.instance;
6603
- }
6604
- setLocale(locale) {
6605
- this.currentLocale = I18nManager.setLocale(locale);
6606
- }
6607
- getLocale() {
6608
- return this.currentLocale;
6609
- }
6610
- t(key, params) {
6611
- return I18nManager.t(key, params, this.currentLocale);
6612
- }
6613
- tLocale(key, locale, params) {
6614
- return I18nManager.t(key, params, locale);
6615
- }
6616
- has(key) {
6617
- return I18nManager.has(key, this.currentLocale);
6618
- }
6619
- getAvailableLocales() {
6620
- return I18nManager.getAvailableLocales();
6621
- }
6622
- }
6623
- var translate = TranslationService.getInstance();
6624
-
6625
- // ../packager/packager-core/src/i18n/index.ts
6626
- I18nManager.registerTranslations("en", en);
6627
- I18nManager.registerTranslations("de", de);
6628
- I18nManager.registerTranslations("es", es);
6629
- I18nManager.registerTranslations("es-mx", es_MX);
6630
- I18nManager.registerTranslations("fr", fr);
6631
- I18nManager.registerTranslations("ja", ja);
6632
- I18nManager.registerTranslations("ko", ko);
6633
- I18nManager.registerTranslations("pt", pt);
6634
- I18nManager.registerTranslations("pt-br", pt_BR);
6635
- I18nManager.registerTranslations("ro", ro);
6636
- I18nManager.registerTranslations("ru", ru);
6637
- I18nManager.registerTranslations("tr", tr);
6638
- I18nManager.registerTranslations("zh-cn", zh_CN);
6639
- I18nManager.registerTranslations("zh-tw", zh_TW);
6640
- I18nManager.registerTranslations("zu", zu);
6641
- I18nManager.setLocale("en");
6642
- // ../packager/packager-core/src/services/tools-factory-repository.ts
6643
- class ToolsFactoryRepository {
6644
- projectFactoryMap = new Map;
6645
- solutionFactory = null;
6646
- registerProjectToolFactory(factory) {
6647
- for (const type of factory.supportedTypes) {
6648
- const existing = this.projectFactoryMap.get(type);
6649
- if (existing) {
6650
- if (existing.constructor?.name !== factory.constructor?.name) {
6651
- console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
6652
- }
6653
- continue;
6654
- }
6655
- this.projectFactoryMap.set(type, factory);
6656
- }
6657
- }
6658
- registerSolutionToolFactory(factory) {
6659
- this.solutionFactory = factory;
6660
- }
6661
- getSolutionToolFactory() {
6662
- if (!this.solutionFactory) {
6663
- throw new Error("No solution tool factory is registered");
6664
- }
6665
- return this.solutionFactory;
6666
- }
6667
- canHandleProject(projectType) {
6668
- return this.projectFactoryMap.has(projectType);
6669
- }
6670
- getProjectToolFactory(projectType) {
6671
- const factory = this.projectFactoryMap.get(projectType);
6672
- if (!factory) {
6673
- throw new Error(`No tool factory found for project type '${projectType}'`);
6674
- }
6675
- return factory;
6676
- }
6677
- reset() {
6678
- this.projectFactoryMap.clear();
6679
- this.solutionFactory = null;
6680
- }
6681
- }
6682
- var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
6683
- var _global = globalThis;
6684
- if (!_global[REGISTRY_KEY]) {
6685
- _global[REGISTRY_KEY] = new ToolsFactoryRepository;
6686
- }
6687
- var toolsFactoryRepository = _global[REGISTRY_KEY];
6688
- export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, InvalidArgumentError, Command, getOutputSink, logger, makeTrackedFetch, RESULTS, OutputFormatter, processContext, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward, zipSync };
6003
+ export { catchError, describeConnectivityError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, makeTrackedFetch, RESULTS, OutputFormatter, InvalidArgumentError, Command, Option, processContext, isGuid, canPrompt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, trackShipSucceeded, normalizeProjectType, tryRegisterProjectInParentSolution, findNearestParentUipxFile, findSolutionFileUpward };
6689
6004
 
6690
- //# debugId=6C9263E7BAAE0C9864756E2164756E21
6005
+ //# debugId=CDE57FA834CA3B8764756E2164756E21