@uipath/case-tool 1.203.0-preview.205 → 1.204.0-preview.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +6 -1
  2. package/dist/THIRD-PARTY-NOTICES.md +48 -9
  3. package/dist/authoring-0hr88kff.js +623 -0
  4. package/dist/{case-api-v6cjyrfw.js → case-api-gdaj9469.js} +5 -5
  5. package/dist/case-bindings-service-c2mze9vj.js +476 -0
  6. package/dist/{case-debug-studio-web-service-shg84pn8.js → case-debug-studio-web-service-cc0vj7md.js} +11 -10
  7. package/dist/case-described-io-service-cpe5h2ks.js +132 -0
  8. package/dist/{case-format-service-q345a2fd.js → case-format-service-qwyjyt0y.js} +2 -2
  9. package/dist/{case-pack-service-29rza2q2.js → case-pack-service-47yrvmg0.js} +11 -11
  10. package/dist/case-shape-reader-mw58avr0.js +13 -0
  11. package/dist/case-splice-service-9zvw19ca.js +312 -0
  12. package/dist/{case-validate-service-2n2bqc1g.js → case-validate-service-vrvx19c1.js} +415 -1449
  13. package/dist/{connector-enrichment-service-h662r92z.js → connector-enrichment-service-rg87npf0.js} +20 -18
  14. package/dist/{connector-lookup-service-y7x6xsc6.js → connector-lookup-service-c49pvfwb.js} +7 -7
  15. package/dist/{connector-task-spec-qm6q8qma.js → connector-task-spec-t3tjeeqt.js} +86 -26
  16. package/dist/{debug-service-8x087xxt.js → debug-service-vf5mw0nr.js} +3 -3
  17. package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
  18. package/dist/{enrichment-service-7vbxcwge.js → enrichment-service-78b0gqck.js} +8 -7
  19. package/dist/index-hhsf00x8.js +15 -0
  20. package/dist/{index-fz4ttsde.js → index-j2r3jb6c.js} +5 -3
  21. package/dist/{index-jxj2jz45.js → index-rgw7caht.js} +416 -87
  22. package/dist/{index-k4xz16db.js → index-wmffgzmr.js} +12522 -7316
  23. package/dist/{index-va9sm89y.js → index-ynnr55wk.js} +59 -27
  24. package/dist/index.js +15 -11
  25. package/dist/{input-reader-pnh948bq.js → input-reader-bb0ptk2v.js} +2 -2
  26. package/dist/migration-diagnosis-ag2sgd1e.js +71 -0
  27. package/dist/{node-strategy-gc4sg6a2.js → node-strategy-5pz40tee.js} +1 -1
  28. package/dist/{node-sync-service-mehbp4qq.js → node-sync-service-xw3tpfj5.js} +6 -6
  29. package/dist/out-target-1f4n9vqb.js +70 -0
  30. package/dist/{packager-tool-wefb1zw3.js → packager-tool-0p3td5zv.js} +8 -7
  31. package/dist/packager-tool-21qfsbxn.js +17 -0
  32. package/dist/{strict-sdd-audit-8e2fh9jg.js → packager-tool-4e56rmwe.js} +2771 -1746
  33. package/dist/{packager-tool-sfkyb4kz.js → packager-tool-4rqd21wc.js} +194 -2
  34. package/dist/packager-tool-57pzrd0g.js +32 -0
  35. package/dist/{packager-tool-kpcjnxd1.js → packager-tool-58kx79ta.js} +586 -113
  36. package/dist/{packager-tool-hrdan5ms.js → packager-tool-5qghkdd0.js} +2 -2
  37. package/dist/packager-tool-5qp9xza1.js +10 -0
  38. package/dist/packager-tool-8a9yqfq7.js +76 -0
  39. package/dist/{packager-tool-40vq60aa.js → packager-tool-8mpxsyje.js} +4 -4
  40. package/dist/{packager-tool-e3k5gzd3.js → packager-tool-a6wztj6y.js} +669 -100
  41. package/dist/{packager-tool-p0zh9hw6.js → packager-tool-ayevyw80.js} +5 -5
  42. package/dist/packager-tool-b250k6w4.js +75 -0
  43. package/dist/packager-tool-bfgdz1zh.js +73 -0
  44. package/dist/{packager-tool-p7jgrm5r.js → packager-tool-cmwets3m.js} +1 -1
  45. package/dist/{packager-tool-d4sjk46c.js → packager-tool-cv05dwac.js} +18 -21
  46. package/dist/packager-tool-d7jjng8a.js +21 -0
  47. package/dist/packager-tool-dthjwajc.js +13 -0
  48. package/dist/{packager-tool-zcsm7dsj.js → packager-tool-e760vtgg.js} +4 -4
  49. package/dist/packager-tool-f78ntj5g.js +228 -0
  50. package/dist/{packager-tool-2xfyykm0.js → packager-tool-ggbvxvey.js} +320 -200
  51. package/dist/{packager-tool-6karkrc8.js → packager-tool-jx0yq0b5.js} +6 -6
  52. package/dist/{packager-tool-cg2j4rma.js → packager-tool-kacqd7h7.js} +4 -4
  53. package/dist/packager-tool-mknccck5.js +24 -0
  54. package/dist/{packager-tool-sv0d6wb6.js → packager-tool-nj4seavy.js} +7 -3
  55. package/dist/{packager-tool-adcaxdhs.js → packager-tool-paepfv5d.js} +1 -1
  56. package/dist/{packager-tool-052kvydg.js → packager-tool-pm646ag4.js} +1 -1
  57. package/dist/{packager-tool-dd8bq6az.js → packager-tool-rgpdaxbx.js} +548 -108
  58. package/dist/{packager-tool-8q7vzh65.js → packager-tool-s3e2kepj.js} +455 -13
  59. package/dist/{packager-tool-r84ng21s.js → packager-tool-sag9gz55.js} +3 -1
  60. package/dist/{packager-tool-0mj06yen.js → packager-tool-sq931c23.js} +5 -22
  61. package/dist/{packager-tool-yrsrzz1a.js → packager-tool-v99ygh9f.js} +23 -8
  62. package/dist/packager-tool-wj9d9mqe.js +267 -0
  63. package/dist/{packager-tool-hz1mz8fs.js → packager-tool-wjaya2k2.js} +2 -2
  64. package/dist/packager-tool-xcd87qyx.js +44 -0
  65. package/dist/{packager-tool-0v3s8r01.js → packager-tool-xdxr3ync.js} +4 -2
  66. package/dist/{packager-tool-61hxhgeg.js → packager-tool-xkgq5fkf.js} +3 -3
  67. package/dist/packager-tool.js +6 -6
  68. package/dist/{project-artifacts-8snev67g.js → project-artifacts-wzrhketn.js} +1 -1
  69. package/dist/resolved-check-p99hysaw.js +50 -0
  70. package/dist/{resourcesSyncService-pmfwz9cd.js → resourcesSyncService-1ezvhcbc.js} +25 -18
  71. package/dist/rule-group-members-zje7n3kf.js +76 -0
  72. package/dist/sdd-convert-service-gp9733qv.js +1962 -0
  73. package/dist/{sdd-lookup-x08j9g9m.js → sdd-lookup-vpjej1kt.js} +2 -2
  74. package/dist/sdd-resolve-service-4hx64x3z.js +288 -0
  75. package/dist/strict-case-rules-ksy8q7pg.js +731 -0
  76. package/dist/strict-entry-points-v14d7y50.js +124 -0
  77. package/dist/strict-sdd-audit-k6hh0mbr.js +23 -0
  78. package/dist/task-selector-8bjn35dv.js +57 -0
  79. package/dist/tool.js +15 -11
  80. package/dist/{trigger-enrichment-service-xexg7qbk.js → trigger-enrichment-service-pjw5ysny.js} +41 -23
  81. package/package.json +2 -2
  82. package/dist/authoring-kngaggwm.js +0 -360
  83. package/dist/case-bindings-service-1wxfghzd.js +0 -240
  84. package/dist/packager-tool-83qnybab.js +0 -1564
  85. package/dist/strict-case-rules-x6t0vb40.js +0 -409
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./packager-tool-0v3s8r01.js";
3
+ } from "./packager-tool-xdxr3ync.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __require,
@@ -2859,6 +2859,13 @@ function setExitCode(code) {
2859
2859
  process.exitCode = code;
2860
2860
  }
2861
2861
 
2862
+ // ../common/src/local-permission-codes.ts
2863
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
2864
+ "EACCES",
2865
+ "EPERM",
2866
+ "EROFS"
2867
+ ]);
2868
+
2862
2869
  // ../common/src/output-codecs.ts
2863
2870
  var yamlSlot = singleton("YamlCodec");
2864
2871
  var jmespathSlot = singleton("JmespathCodec");
@@ -2891,19 +2898,210 @@ var filterSlot = singleton("OutputFilter");
2891
2898
  function getOutputFormat() {
2892
2899
  return formatSlot.get("json");
2893
2900
  }
2894
- function getOutputFormatExplicit() {
2895
- return formatExplicitSlot.get(false) ?? false;
2896
- }
2897
2901
  function getOutputFilter() {
2898
2902
  return filterSlot.get();
2899
2903
  }
2900
2904
 
2905
+ // ../common/src/error-graph.ts
2906
+ function* walkErrorGraph(error) {
2907
+ const queue = [error];
2908
+ const seen = new Set;
2909
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2910
+ const current = queue.shift();
2911
+ if (current === null || typeof current !== "object")
2912
+ continue;
2913
+ if (seen.has(current))
2914
+ continue;
2915
+ seen.add(current);
2916
+ const cur = current;
2917
+ yield cur;
2918
+ if (cur.cause !== undefined)
2919
+ queue.push(cur.cause);
2920
+ if (Array.isArray(cur.errors))
2921
+ queue.push(...cur.errors);
2922
+ }
2923
+ return;
2924
+ }
2925
+ function parseHttpStatusFromMessage(message) {
2926
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
2927
+ if (!match)
2928
+ return;
2929
+ const status = Number(match[1]);
2930
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
2931
+ }
2932
+ function findHttpStatusInGraph(error) {
2933
+ for (const node of walkErrorGraph(error)) {
2934
+ const response = node.response;
2935
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
2936
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
2937
+ return explicit;
2938
+ }
2939
+ if (typeof node.message === "string") {
2940
+ const parsed = parseHttpStatusFromMessage(node.message);
2941
+ if (parsed !== undefined && parsed >= 400) {
2942
+ return parsed;
2943
+ }
2944
+ }
2945
+ }
2946
+ return;
2947
+ }
2948
+
2949
+ // ../common/src/telemetry/telemetry-dimensions.ts
2950
+ var BaseDimensions = {
2951
+ ApplicationName: "ApplicationName",
2952
+ ProductVersion: "ProductVersion",
2953
+ InstallationId: "InstallationId",
2954
+ CloudUserId: "CloudUserId",
2955
+ CloudTenantId: "CloudTenantId",
2956
+ CloudOrganizationId: "CloudOrganizationId",
2957
+ IsInternalUser: "IsInternalUser",
2958
+ Environment: "Environment",
2959
+ BaseUrl: "BaseUrl",
2960
+ Region: "Region",
2961
+ Agent: "Agent",
2962
+ AgentVersion: "AgentVersion",
2963
+ AgentModel: "AgentModel",
2964
+ ToolName: "ToolName",
2965
+ ToolVersion: "ToolVersion",
2966
+ ExecutionContext: "ExecutionContext",
2967
+ CiProvider: "CiProvider",
2968
+ SessionIdSource: "SessionIdSource",
2969
+ SessionId: "SessionId"
2970
+ };
2971
+ var CommandDimensions = {
2972
+ IsCommand: "IsCommand",
2973
+ IsReexec: "IsReexec",
2974
+ CommandName: "CommandName",
2975
+ ExitCode: "ExitCode",
2976
+ TerminalOutcome: "TerminalOutcome",
2977
+ ErrorClass: "ErrorClass",
2978
+ TerminalSignal: "TerminalSignal",
2979
+ ErrorMessage: "ErrorMessage",
2980
+ SkillName: "SkillName",
2981
+ ProductArea: "ProductArea",
2982
+ Mode: "Mode"
2983
+ };
2984
+ var ShipDimensions = {
2985
+ ShipKind: "ShipKind",
2986
+ Target: "Target",
2987
+ ProjectType: "ProjectType",
2988
+ ProjectTypes: "ProjectTypes",
2989
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
2990
+ PackageName: "PackageName",
2991
+ PackageVersion: "PackageVersion",
2992
+ PackageVersionKey: "PackageVersionKey",
2993
+ DeploymentKey: "DeploymentKey",
2994
+ SolutionId: "SolutionId",
2995
+ FolderKey: "FolderKey",
2996
+ FeedId: "FeedId"
2997
+ };
2998
+ var ErrorDimensions = {
2999
+ Result: "Result",
3000
+ ErrorCode: "ErrorCode",
3001
+ Retry: "Retry",
3002
+ ErrorMessage: "ErrorMessage"
3003
+ };
3004
+ var AuthDimensions = {
3005
+ AuthenticationMethod: "AuthenticationMethod",
3006
+ Success: "Success",
3007
+ Reason: "Reason"
3008
+ };
3009
+ var SkillsDimensions = {
3010
+ SchemaVersion: "SchemaVersion",
3011
+ AgentType: "AgentType",
3012
+ SkillsVersion: "SkillsVersion",
3013
+ UipSubcommand: "UipSubcommand",
3014
+ FileExtension: "FileExtension",
3015
+ SubagentModel: "SubagentModel",
3016
+ SubagentType: "SubagentType",
3017
+ PermissionMode: "PermissionMode",
3018
+ EffortLevel: "EffortLevel",
3019
+ SessionSource: "SessionSource",
3020
+ Outcome: "Outcome",
3021
+ DurationMs: "DurationMs",
3022
+ Source: "Source"
3023
+ };
3024
+ var PackagerDimensions = {
3025
+ ProjectId: "ProjectId",
3026
+ ProjectType: "ProjectType",
3027
+ SolutionId: "SolutionId"
3028
+ };
3029
+ var ScopeDimensions = {
3030
+ FolderId: "FolderId"
3031
+ };
3032
+ var ID_DIMENSIONS = new Set([
3033
+ BaseDimensions.CloudUserId,
3034
+ BaseDimensions.CloudTenantId,
3035
+ BaseDimensions.CloudOrganizationId,
3036
+ BaseDimensions.InstallationId,
3037
+ ShipDimensions.ArtifactCorrelationKey,
3038
+ ShipDimensions.PackageVersionKey,
3039
+ ShipDimensions.DeploymentKey,
3040
+ ShipDimensions.SolutionId,
3041
+ ShipDimensions.FolderKey,
3042
+ ShipDimensions.FeedId,
3043
+ PackagerDimensions.ProjectId
3044
+ ]);
3045
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
3046
+ var RESERVED_DIMENSION_NAMES = new Set([
3047
+ ...Object.values(BaseDimensions),
3048
+ ...Object.values(CommandDimensions),
3049
+ ...Object.values(ShipDimensions),
3050
+ ...Object.values(ErrorDimensions),
3051
+ ...Object.values(AuthDimensions),
3052
+ ...Object.values(SkillsDimensions),
3053
+ ...Object.values(PackagerDimensions),
3054
+ ...Object.values(ScopeDimensions)
3055
+ ]);
3056
+ var CURATED_DIMENSIONS = new Set([
3057
+ BaseDimensions.ApplicationName,
3058
+ BaseDimensions.ProductVersion,
3059
+ BaseDimensions.InstallationId,
3060
+ BaseDimensions.CloudUserId,
3061
+ BaseDimensions.CloudTenantId,
3062
+ BaseDimensions.CloudOrganizationId,
3063
+ BaseDimensions.IsInternalUser,
3064
+ BaseDimensions.Environment,
3065
+ BaseDimensions.BaseUrl,
3066
+ BaseDimensions.Region,
3067
+ BaseDimensions.Agent,
3068
+ BaseDimensions.AgentVersion,
3069
+ BaseDimensions.ToolVersion,
3070
+ BaseDimensions.ExecutionContext,
3071
+ BaseDimensions.CiProvider,
3072
+ BaseDimensions.SessionIdSource,
3073
+ BaseDimensions.SessionId,
3074
+ ...Object.values(CommandDimensions),
3075
+ ...Object.values(ShipDimensions)
3076
+ ]);
3077
+ function lowercaseIdDimensionValues(properties) {
3078
+ let changed = false;
3079
+ const result = {
3080
+ ...properties
3081
+ };
3082
+ for (const key of Object.keys(result)) {
3083
+ const value = result[key];
3084
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
3085
+ continue;
3086
+ }
3087
+ const lowered = value.toLowerCase();
3088
+ if (lowered !== value) {
3089
+ result[key] = lowered;
3090
+ changed = true;
3091
+ }
3092
+ }
3093
+ return changed ? result : properties;
3094
+ }
3095
+
2901
3096
  // ../common/src/telemetry/command-terminal.ts
2902
3097
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
2903
3098
  var AUTH_ERROR_CODES = new Set([
2904
3099
  "authentication_required",
2905
3100
  "permission_denied"
2906
3101
  ]);
3102
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
3103
+ "local_permission_denied"
3104
+ ]);
2907
3105
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
2908
3106
  var NETWORK_HTTP_ERROR_CODES = new Set([
2909
3107
  "network_error",
@@ -3044,6 +3242,9 @@ function classifyFromErrorCode(errorCode) {
3044
3242
  if (AUTH_ERROR_CODES.has(errorCode)) {
3045
3243
  return "auth";
3046
3244
  }
3245
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
3246
+ return "local_permission";
3247
+ }
3047
3248
  if (VALIDATION_ERROR_CODES.has(errorCode)) {
3048
3249
  return "validation";
3049
3250
  }
@@ -3055,6 +3256,15 @@ function classifyFromErrorCode(errorCode) {
3055
3256
  }
3056
3257
  return;
3057
3258
  }
3259
+ function hasLocalPermissionCode(error) {
3260
+ for (const node of walkErrorGraph(error)) {
3261
+ const code = node.code;
3262
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
3263
+ return true;
3264
+ }
3265
+ }
3266
+ return false;
3267
+ }
3058
3268
  function classifyFromError(error) {
3059
3269
  const code = findCodeInCauseChain(error);
3060
3270
  if (code) {
@@ -3071,6 +3281,9 @@ function classifyFromError(error) {
3071
3281
  return "missing_dependency";
3072
3282
  }
3073
3283
  }
3284
+ if (hasLocalPermissionCode(error)) {
3285
+ return "local_permission";
3286
+ }
3074
3287
  const message = stringField(error, "message");
3075
3288
  if (message?.includes("fetch failed") === true) {
3076
3289
  return "network_http";
@@ -3086,7 +3299,7 @@ function classifyError(input) {
3086
3299
  if (recorded?.errorClass) {
3087
3300
  return recorded.errorClass;
3088
3301
  }
3089
- const status = recorded?.context?.httpStatus;
3302
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
3090
3303
  if (status !== undefined) {
3091
3304
  return classifyHttpStatus(status);
3092
3305
  }
@@ -3109,17 +3322,18 @@ function buildCommandTerminalTelemetryProperties(input) {
3109
3322
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
3110
3323
  const terminalSignal = terminalSignalFor(input, outcome);
3111
3324
  return {
3112
- exit_code: input.exitCode,
3113
- terminal_outcome: outcome,
3114
- ...errorClass ? { error_class: errorClass } : {},
3115
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
3325
+ [CommandDimensions.ExitCode]: input.exitCode,
3326
+ [CommandDimensions.TerminalOutcome]: outcome,
3327
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
3328
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
3116
3329
  };
3117
3330
  }
3118
3331
 
3119
3332
  // ../common/src/telemetry/telemetry-events.ts
3120
3333
  var CommonTelemetryEvents = {
3121
- Error: "uip.error",
3122
- ShipSucceeded: "uip.ship.succeeded"
3334
+ Start: "Application.Start",
3335
+ Error: "Application.Error",
3336
+ ShipSucceeded: "Cli.ShipSucceeded"
3123
3337
  };
3124
3338
 
3125
3339
  // ../common/src/registry.ts
@@ -3327,8 +3541,8 @@ function detectExecutionContext(options = {}) {
3327
3541
  function getExecutionContextTelemetryProperties() {
3328
3542
  const detected = detectExecutionContext();
3329
3543
  return {
3330
- execution_context: detected.executionContext,
3331
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
3544
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
3545
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
3332
3546
  };
3333
3547
  }
3334
3548
  // ../common/src/telemetry/node-context-storage.ts
@@ -3371,7 +3585,7 @@ function getInboundTraceContext() {
3371
3585
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
3372
3586
  var SESSION_ID_MAX_LENGTH = 64;
3373
3587
  var RANDOM_SESSION_ID_LENGTH = 32;
3374
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
3588
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
3375
3589
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
3376
3590
  var INHERITED_SESSION_SOURCES = [
3377
3591
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -3423,6 +3637,9 @@ function resolveTelemetrySession() {
3423
3637
  telemetrySessionSlot.set(resolved);
3424
3638
  return resolved;
3425
3639
  }
3640
+ function getTelemetrySessionId() {
3641
+ return resolveTelemetrySession().id;
3642
+ }
3426
3643
  function getTelemetrySessionSource() {
3427
3644
  return resolveTelemetrySession().source;
3428
3645
  }
@@ -3503,7 +3720,10 @@ class TelemetryService {
3503
3720
  } catch (error) {
3504
3721
  const durationMs = clock.elapsedMs();
3505
3722
  const err = error instanceof Error ? error : new Error(String(error));
3506
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
3723
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
3724
+ ...properties,
3725
+ [CommandDimensions.ErrorMessage]: err.message
3726
+ }, context));
3507
3727
  throw error;
3508
3728
  }
3509
3729
  }
@@ -3574,7 +3794,10 @@ class TelemetryService {
3574
3794
  const durationMs = clock.elapsedMs();
3575
3795
  const err = error instanceof Error ? error : new Error(String(error));
3576
3796
  await this.telemetryProvider.trackDependency({
3577
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
3797
+ ...this.spanFor(name, durationMs, false, {
3798
+ ...properties,
3799
+ [CommandDimensions.ErrorMessage]: err.message
3800
+ }, childContext),
3578
3801
  type
3579
3802
  });
3580
3803
  throw error;
@@ -3609,9 +3832,10 @@ class TelemetryService {
3609
3832
  ...globalProperties,
3610
3833
  ...this.defaultProperties,
3611
3834
  ...redactProperties(properties ?? {}),
3612
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
3835
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
3836
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
3613
3837
  };
3614
- return enriched;
3838
+ return lowercaseIdDimensionValues(enriched);
3615
3839
  }
3616
3840
  generateId() {
3617
3841
  const bytes = new Uint8Array(8);
@@ -3934,6 +4158,9 @@ function toPascalCaseData(value, verbatimKeys, subtrees) {
3934
4158
  function normalizeDataKeys(data, verbatimKeys, subtrees) {
3935
4159
  return toPascalCaseData(data, verbatimKeys, subtrees);
3936
4160
  }
4161
+ function pascalCaseDataKeys(data) {
4162
+ return normalizeDataKeys(data);
4163
+ }
3937
4164
  function toVerbatimKeySet(preserve) {
3938
4165
  if (!Array.isArray(preserve))
3939
4166
  return;
@@ -4405,7 +4632,165 @@ class FilterImplicitLimitError extends Error {
4405
4632
  this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
4406
4633
  }
4407
4634
  }
4408
- function applyFilter(data, filter) {
4635
+ function countRecords(data) {
4636
+ if (Array.isArray(data))
4637
+ return data.length;
4638
+ return data == null ? 0 : 1;
4639
+ }
4640
+ function availableFields(data) {
4641
+ const records = Array.isArray(data) ? data : [data];
4642
+ const keys = new Set;
4643
+ for (const record of records) {
4644
+ if (record && typeof record === "object" && !Array.isArray(record)) {
4645
+ for (const key of Object.keys(record))
4646
+ keys.add(key);
4647
+ }
4648
+ }
4649
+ return [...keys];
4650
+ }
4651
+ function decodeQuotedIdentifier(whole, inner) {
4652
+ const [error, decoded] = catchError(() => JSON.parse(whole));
4653
+ if (!error && typeof decoded === "string")
4654
+ return decoded;
4655
+ return inner.replace(/\\(.)/g, "$1");
4656
+ }
4657
+ function referencedFields(filter) {
4658
+ const top = new Set;
4659
+ const nested = new Set;
4660
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
4661
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
4662
+ const quoted = [];
4663
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
4664
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
4665
+ if (!isAlias) {
4666
+ quoted.push({
4667
+ name: decodeQuotedIdentifier(whole, name),
4668
+ index,
4669
+ tail: isPathTail(withoutValueLiterals, index)
4670
+ });
4671
+ }
4672
+ return `"${" ".repeat(whole.length - 2)}"`;
4673
+ });
4674
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
4675
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
4676
+ const place = (name, index, tail) => {
4677
+ if (tail || index >= rootEnd)
4678
+ nested.add(name);
4679
+ else
4680
+ top.add(name);
4681
+ };
4682
+ for (const entry of quoted)
4683
+ place(entry.name, entry.index, entry.tail);
4684
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
4685
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
4686
+ for (const match of identifiers) {
4687
+ const [, name, trailing] = match;
4688
+ if (trailing || reserved.has(name))
4689
+ continue;
4690
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
4691
+ }
4692
+ return {
4693
+ top: [...top],
4694
+ nested: [...nested].filter((name) => !top.has(name)),
4695
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
4696
+ };
4697
+ }
4698
+ function appearsBelowTopLevel(data, name) {
4699
+ let budget = 2000;
4700
+ const visit = (value, depth) => {
4701
+ if (budget-- <= 0 || depth > 4)
4702
+ return false;
4703
+ if (value === null || typeof value !== "object")
4704
+ return false;
4705
+ if (Array.isArray(value))
4706
+ return value.some((entry) => visit(entry, depth));
4707
+ const record = value;
4708
+ if (depth > 0 && Object.hasOwn(record, name))
4709
+ return true;
4710
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
4711
+ };
4712
+ return visit(data, 0);
4713
+ }
4714
+ function alwaysNullKeys(records) {
4715
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
4716
+ if (objects.length === 0 || objects.length !== records.length)
4717
+ return [];
4718
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
4719
+ if (keys.length === 0)
4720
+ return [];
4721
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
4722
+ return nullKeys.length === keys.length ? nullKeys : [];
4723
+ }
4724
+ function carriesOnlyNulls(value) {
4725
+ if (value === null)
4726
+ return true;
4727
+ if (Array.isArray(value)) {
4728
+ return value.length > 0 && value.every(carriesOnlyNulls);
4729
+ }
4730
+ if (typeof value === "object" && value !== undefined) {
4731
+ const values = Object.values(value);
4732
+ return values.length > 0 && values.every(carriesOnlyNulls);
4733
+ }
4734
+ return false;
4735
+ }
4736
+ function nameList(names, cap2 = 12) {
4737
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
4738
+ const rest = names.length - shown.length;
4739
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
4740
+ }
4741
+ function buildFilterWarning(filter, data, outcome) {
4742
+ const present = availableFields(data);
4743
+ const refs = referencedFields(filter);
4744
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
4745
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
4746
+ const count = countRecords(data);
4747
+ const scope = `${count} record(s)`;
4748
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
4749
+ const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
4750
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
4751
+ let detail;
4752
+ let lede;
4753
+ if (outcome.kind === "null-elements") {
4754
+ lede = "returned only null values";
4755
+ const projected = `all ${outcome.count} of the elements it projected are null`;
4756
+ if (unknown.length > 0) {
4757
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4758
+ } else if (unchecked.length > 0) {
4759
+ detail = withSoundness(projected);
4760
+ } else {
4761
+ detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
4762
+ }
4763
+ } else if (outcome.kind === "null-rows") {
4764
+ lede = "returned only null values";
4765
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
4766
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
4767
+ } else if (outcome.kind === "null-values") {
4768
+ lede = "returned only null values";
4769
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
4770
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
4771
+ if (sameSet) {
4772
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
4773
+ } else if (unknown.length > 0) {
4774
+ detail = `${projected}, because ${isNotAField(unknown)}`;
4775
+ } else {
4776
+ detail = withSoundness(`${projected} on all ${scope}`);
4777
+ }
4778
+ } else {
4779
+ lede = "returned nothing";
4780
+ if (unknown.length > 0) {
4781
+ detail = isNotAField(unknown);
4782
+ } else {
4783
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
4784
+ detail = withSoundness(`${selection} — it read ${scope}`);
4785
+ }
4786
+ }
4787
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
4788
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
4789
+ }
4790
+ function appendWarning(existing, note) {
4791
+ return existing ? `${existing} ${note}` : note;
4792
+ }
4793
+ function applyFilter(data, filter, onWarning) {
4409
4794
  const codec = requireJmespath();
4410
4795
  let result;
4411
4796
  try {
@@ -4413,9 +4798,34 @@ function applyFilter(data, filter) {
4413
4798
  } catch (err) {
4414
4799
  throw new FilterEvaluationError(filter, err);
4415
4800
  }
4416
- if (result == null)
4801
+ const inputCount = countRecords(data);
4802
+ const warn = (outcome) => {
4803
+ if (inputCount === 0)
4804
+ return;
4805
+ const note = buildFilterWarning(filter, data, outcome);
4806
+ getOutputSink().writeErr(`[WARN] ${note}
4807
+ `);
4808
+ onWarning?.(note);
4809
+ };
4810
+ const warnIfAllNull = (records) => {
4811
+ const keys = alwaysNullKeys(records);
4812
+ if (keys.length > 0)
4813
+ warn({ kind: "null-values", keys });
4814
+ };
4815
+ if (result == null) {
4816
+ warn({ kind: "empty" });
4417
4817
  return [];
4818
+ }
4418
4819
  if (Array.isArray(result)) {
4820
+ if (result.length === 0) {
4821
+ warn({ kind: "empty" });
4822
+ } else if (result.every((entry) => entry === null)) {
4823
+ warn({ kind: "null-elements", count: result.length });
4824
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
4825
+ warn({ kind: "null-rows", count: result.length });
4826
+ } else {
4827
+ warnIfAllNull(result);
4828
+ }
4419
4829
  if (result.length > 0 && typeof result[0] !== "object") {
4420
4830
  const fieldMatch = filter.match(/\.(\w+)$/);
4421
4831
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -4423,10 +4833,30 @@ function applyFilter(data, filter) {
4423
4833
  }
4424
4834
  return result;
4425
4835
  }
4426
- if (typeof result === "object")
4836
+ if (typeof result === "object") {
4837
+ warnIfAllNull([result]);
4427
4838
  return result;
4839
+ }
4428
4840
  return { Value: result };
4429
4841
  }
4842
+ function filterFailureData(envelope) {
4843
+ const filter = getOutputFilter();
4844
+ const data = envelope.Data;
4845
+ if (!filter || data == null)
4846
+ return;
4847
+ let note;
4848
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
4849
+ note = n;
4850
+ }));
4851
+ if (filterError) {
4852
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
4853
+ return;
4854
+ }
4855
+ envelope.Data = filtered;
4856
+ if (note) {
4857
+ envelope.Warning = appendWarning(envelope.Warning, note);
4858
+ }
4859
+ }
4430
4860
  function defaultErrorCodeForResult(result) {
4431
4861
  switch (result) {
4432
4862
  case RESULTS.AuthenticationError:
@@ -4441,7 +4871,7 @@ function defaultErrorCodeForResult(result) {
4441
4871
  return "unknown_error";
4442
4872
  }
4443
4873
  }
4444
- function parseHttpStatusFromMessage(message) {
4874
+ function parseHttpStatusFromMessage2(message) {
4445
4875
  const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
4446
4876
  if (!match)
4447
4877
  return;
@@ -4470,10 +4900,10 @@ function defaultErrorCodeForHttpStatus(status) {
4470
4900
  return "server_error";
4471
4901
  return;
4472
4902
  }
4473
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
4903
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
4474
4904
  function defaultErrorCodeForFailure(data) {
4475
4905
  if (data.Result === RESULTS.Failure) {
4476
- const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
4906
+ const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
4477
4907
  const errorCode = defaultErrorCodeForHttpStatus(status);
4478
4908
  if (errorCode)
4479
4909
  return errorCode;
@@ -4509,8 +4939,14 @@ var OutputFormatter;
4509
4939
  }
4510
4940
  const filter = getOutputFilter();
4511
4941
  if (filter) {
4512
- const filtered = applyFilter(data.Data, filter);
4942
+ let note;
4943
+ const filtered = applyFilter(data.Data, filter, (n) => {
4944
+ note = n;
4945
+ });
4513
4946
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
4947
+ if (note) {
4948
+ data.Warning = appendWarning(data.Warning, note);
4949
+ }
4514
4950
  }
4515
4951
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
4516
4952
  }
@@ -4538,12 +4974,13 @@ var OutputFormatter;
4538
4974
  delete envelope.TelemetryErrorClass;
4539
4975
  delete envelope.TelemetryTerminalOutcome;
4540
4976
  delete envelope.TelemetryTerminalSignal;
4977
+ filterFailureData(envelope);
4541
4978
  if (!suppressTelemetry) {
4542
4979
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
4543
- result: data.Result,
4544
- errorCode: data.ErrorCode,
4545
- retry: data.Retry,
4546
- message: data.Message
4980
+ [ErrorDimensions.Result]: data.Result,
4981
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
4982
+ [ErrorDimensions.Retry]: data.Retry,
4983
+ [ErrorDimensions.ErrorMessage]: data.Message
4547
4984
  });
4548
4985
  }
4549
4986
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -4586,13 +5023,20 @@ var OutputFormatter;
4586
5023
  OutputFormatter.log = log;
4587
5024
  function formatToString(data) {
4588
5025
  const filter = getOutputFilter();
5026
+ const envelope = data;
4589
5027
  if ("Data" in data && data.Data != null) {
4590
5028
  data.Data = normalizeDataKeys(data.Data);
4591
5029
  if (filter) {
4592
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
5030
+ let note;
5031
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
5032
+ note = n;
5033
+ }));
5034
+ if (note) {
5035
+ envelope.Warning = appendWarning(envelope.Warning, note);
5036
+ }
4593
5037
  }
4594
5038
  }
4595
- const output = normalizeOutputKeys(data);
5039
+ const output = normalizeOutputKeys(envelope);
4596
5040
  const lines = [];
4597
5041
  const sink = getOutputSink();
4598
5042
  printOutput(output, getOutputFormat(), (msg) => {
@@ -4620,18 +5064,6 @@ var {
4620
5064
  Help
4621
5065
  } = import__.default;
4622
5066
 
4623
- // ../common/src/preview.ts
4624
- var previewSlot = singleton("PreviewBuild");
4625
- function isPreviewBuild() {
4626
- return previewSlot.get(false) ?? false;
4627
- }
4628
- Command.prototype.previewCommand = function(nameAndArgs, opts) {
4629
- if (isPreviewBuild()) {
4630
- return this.command(nameAndArgs, opts);
4631
- }
4632
- return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
4633
- };
4634
-
4635
5067
  // ../common/src/content-hash.ts
4636
5068
  function isBrowserRuntime() {
4637
5069
  const runtime = globalThis;
@@ -4696,8 +5128,8 @@ async function readStdin() {
4696
5128
  }
4697
5129
 
4698
5130
  // ../common/src/error-handler.ts
4699
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
4700
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
5131
+ var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
5132
+ var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
4701
5133
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
4702
5134
  var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
4703
5135
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -4724,14 +5156,14 @@ var TLS_ERROR_CODES2 = new Set([
4724
5156
  ]);
4725
5157
  var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
4726
5158
  var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
4727
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
4728
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
5159
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
4729
5160
  function localPermissionInstructions(code, path) {
4730
5161
  const target = path !== undefined ? `'${path}'` : "a local file or resource";
4731
5162
  if (code === "EROFS") {
4732
5163
  return `The filesystem containing ${target} is read-only (EROFS), so the ` + "CLI could not write to it. This is a local environment problem, " + "not a UiPath service error — retrying will not help. Use a " + "writable location, or give this environment write access to the " + "path.";
4733
5164
  }
4734
- const remedy = process.platform === "win32" ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
5165
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
5166
+ const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
4735
5167
  return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
4736
5168
  }
4737
5169
  function describeConnectivityError(error) {
@@ -4785,48 +5217,6 @@ function localPermissionPath(path, message) {
4785
5217
  return path;
4786
5218
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
4787
5219
  }
4788
- function* walkErrorGraph(error) {
4789
- const queue = [error];
4790
- const seen = new Set;
4791
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
4792
- const current = queue.shift();
4793
- if (current === null || typeof current !== "object")
4794
- continue;
4795
- if (seen.has(current))
4796
- continue;
4797
- seen.add(current);
4798
- const cur = current;
4799
- yield cur;
4800
- if (cur.cause !== undefined)
4801
- queue.push(cur.cause);
4802
- if (Array.isArray(cur.errors))
4803
- queue.push(...cur.errors);
4804
- }
4805
- return;
4806
- }
4807
- function parseHttpStatusFromMessage2(message) {
4808
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
4809
- if (!match)
4810
- return;
4811
- const status = Number(match[1]);
4812
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
4813
- }
4814
- function findHttpStatusInGraph(error) {
4815
- for (const node of walkErrorGraph(error)) {
4816
- const response = node.response;
4817
- const explicit = typeof node.status === "number" ? node.status : response?.status;
4818
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
4819
- return explicit;
4820
- }
4821
- if (typeof node.message === "string") {
4822
- const parsed = parseHttpStatusFromMessage2(node.message);
4823
- if (parsed !== undefined && parsed >= 400) {
4824
- return parsed;
4825
- }
4826
- }
4827
- }
4828
- return;
4829
- }
4830
5220
  function isHtmlDocument(body) {
4831
5221
  return /^\s*(<!doctype html|<html\b)/i.test(body);
4832
5222
  }
@@ -4899,7 +5289,7 @@ async function extractErrorDetails(error, options) {
4899
5289
  const response = err.response;
4900
5290
  const rawMessage = typeof err.message === "string" ? err.message : "Unknown error";
4901
5291
  const explicitStatus = err.status ?? response?.status;
4902
- const inferredStatus = explicitStatus === undefined ? parseHttpStatusFromMessage2(rawMessage) : undefined;
5292
+ const inferredStatus = explicitStatus === undefined ? parseHttpStatusFromMessage(rawMessage) : undefined;
4903
5293
  const status = explicitStatus ?? inferredStatus;
4904
5294
  const isSuccessfulResponse = status !== undefined && status >= 200 && status < 300;
4905
5295
  let rawBody;
@@ -5102,12 +5492,24 @@ Command.prototype.examples = function(examples) {
5102
5492
  examplesByCommand.set(this, examples);
5103
5493
  return this;
5104
5494
  };
5495
+ // ../common/src/preview.ts
5496
+ var previewSlot = singleton("PreviewBuild");
5497
+ function isPreviewBuild() {
5498
+ return previewSlot.get(false) ?? false;
5499
+ }
5500
+ Command.prototype.previewCommand = function(nameAndArgs, opts) {
5501
+ if (isPreviewBuild()) {
5502
+ return this.command(nameAndArgs, opts);
5503
+ }
5504
+ return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
5505
+ };
5506
+
5105
5507
  // ../common/src/telemetry/command-attribution.ts
5106
5508
  var LEGACY_SKILL_NAMESPACE = "uipath:";
5107
5509
  var MAX_SKILL_NAME_LENGTH = 80;
5108
5510
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
5109
5511
  function productMode(productArea, mode) {
5110
- return { product_area: productArea, mode };
5512
+ return { ProductArea: productArea, Mode: mode };
5111
5513
  }
5112
5514
  function attributionRecord(groups) {
5113
5515
  const record = {};
@@ -5165,6 +5567,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
5165
5567
  ["rpa", "build", ["uip.rpa-legacy"]],
5166
5568
  ["conversational", "operate", ["uip.conversational"]],
5167
5569
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
5570
+ ["coding-agents", "build", ["uip.coder"]],
5168
5571
  ["agenthub", "build", ["uip.agenthub"]],
5169
5572
  ["coded-apps", "build", ["uip.codedapp"]],
5170
5573
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -5250,32 +5653,64 @@ function normalizeSkillName(value) {
5250
5653
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
5251
5654
  const skillName = normalizeSkillName(skillSource);
5252
5655
  return {
5253
- ...skillName ? { skill_name: skillName } : {},
5656
+ ...skillName ? { SkillName: skillName } : {},
5254
5657
  ...getCommandProductModeAttribution(commandPath)
5255
5658
  };
5256
5659
  }
5660
+ var AGENT_SESSION_ENV = {
5661
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
5662
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
5663
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
5664
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
5665
+ };
5666
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
5667
+ function sanitizeTelemetryToken(value) {
5668
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
5669
+ }
5670
+ function buildAgentSessionTelemetry(env) {
5671
+ const dimensions = {};
5672
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
5673
+ const value = env[variable]?.trim();
5674
+ if (value) {
5675
+ dimensions[key] = sanitizeTelemetryToken(value);
5676
+ }
5677
+ }
5678
+ return dimensions;
5679
+ }
5257
5680
 
5258
5681
  // ../common/src/telemetry/command-name.ts
5259
- var TELEMETRY_COMMAND_ROOT = "uip";
5682
+ var TELEMETRY_NAME_ROOT = "Cli";
5683
+ var CLI_COMMAND_ROOT = "uip";
5684
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
5260
5685
  function commandTelemetryName(parts) {
5686
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
5687
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
5688
+ }
5689
+ function commandInvocationPath(parts) {
5690
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
5691
+ }
5692
+ function vetCommandTokens(parts) {
5261
5693
  const tokens = [];
5262
5694
  for (const part of parts) {
5263
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
5695
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
5264
5696
  if (pieces.every(isCommandToken)) {
5265
5697
  tokens.push(...pieces);
5266
5698
  continue;
5267
5699
  }
5268
5700
  tokens.push(UNKNOWN_TOKEN);
5269
5701
  }
5270
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
5702
+ return tokens;
5703
+ }
5704
+ function pascalizeToken(token) {
5705
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
5271
5706
  }
5272
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
5707
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
5273
5708
  var MAX_COMMAND_TOKEN_LENGTH = 32;
5274
5709
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
5275
5710
  function isCommandToken(token) {
5276
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
5711
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
5277
5712
  }
5278
- var UNKNOWN_TOKEN = "<unknown>";
5713
+ var UNKNOWN_TOKEN = "unknown";
5279
5714
 
5280
5715
  // ../common/src/telemetry/invocation-request.ts
5281
5716
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -5380,7 +5815,7 @@ function withheldArgumentValues(cmd) {
5380
5815
  });
5381
5816
  return values;
5382
5817
  }
5383
- function deriveCommandPath(cmd) {
5818
+ function deriveCommandParts(cmd) {
5384
5819
  const parts = [];
5385
5820
  let current = cmd;
5386
5821
  while (current) {
@@ -5393,14 +5828,13 @@ function deriveCommandPath(cmd) {
5393
5828
  if (parts.length > 1) {
5394
5829
  parts.shift();
5395
5830
  }
5396
- return commandTelemetryName(parts);
5831
+ return parts;
5397
5832
  }
5398
5833
  function isErrorContext(value) {
5399
5834
  return value !== null && typeof value === "object";
5400
5835
  }
5401
5836
  function commandHelpHint(commandPath) {
5402
- const command = commandPath.replace(/\./g, " ");
5403
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
5837
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
5404
5838
  }
5405
5839
  function isPromptCancellation(error) {
5406
5840
  return error instanceof Error && error.name === "ExitPromptError";
@@ -5425,7 +5859,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5425
5859
  yaml: getOutputFormat() === "yaml",
5426
5860
  filter: getOutputFilter() !== undefined
5427
5861
  });
5428
- const telemetryName = deriveCommandPath(command);
5862
+ const commandParts = deriveCommandParts(command);
5863
+ const telemetryName = commandTelemetryName(commandParts);
5864
+ const commandPath = commandInvocationPath(commandParts);
5429
5865
  const props = typeof properties === "function" ? properties(...args) : properties;
5430
5866
  markCommandStart();
5431
5867
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -5460,7 +5896,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5460
5896
  Result: finalResult,
5461
5897
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
5462
5898
  Message: errorMessage,
5463
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
5899
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
5464
5900
  ...customRetry ? { Retry: customRetry } : {},
5465
5901
  ...customContext ? { Context: customContext } : {}
5466
5902
  });
@@ -5477,8 +5913,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5477
5913
  recordedFailure,
5478
5914
  pollSignal: context.pollSignal
5479
5915
  });
5480
- if (terminalTelemetry.error_class === "internal" && error) {
5481
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
5916
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
5917
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
5482
5918
  }
5483
5919
  const commandParams = extractCommandParams(command);
5484
5920
  if (props) {
@@ -5489,10 +5925,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5489
5925
  const baseProperties = redactProperties({
5490
5926
  ...commandParams,
5491
5927
  ...props,
5492
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
5493
- command: "true",
5928
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
5929
+ ...buildAgentSessionTelemetry(process.env),
5930
+ [CommandDimensions.CommandName]: commandPath,
5931
+ [CommandDimensions.IsCommand]: "true",
5494
5932
  ...terminalTelemetry,
5495
- ...errorMessage ? { errorMessage } : {}
5933
+ ...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
5496
5934
  });
5497
5935
  emitInvocationRequest(telemetryName, success, baseProperties);
5498
5936
  } finally {
@@ -5715,7 +6153,7 @@ function extractHttpStatus(err) {
5715
6153
  const structured = e.response?.status ?? e.status ?? e.statusCode;
5716
6154
  if (structured !== undefined)
5717
6155
  return structured;
5718
- return typeof e.message === "string" ? parseHttpStatusFromMessage2(e.message) : undefined;
6156
+ return typeof e.message === "string" ? parseHttpStatusFromMessage(e.message) : undefined;
5719
6157
  }
5720
6158
  var GENERIC = "Check authentication and parameters";
5721
6159
  function instructionsFor(ctx, err) {
@@ -5799,6 +6237,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
5799
6237
  // ../common/src/interactivity-context.ts
5800
6238
  var modeSlot = singleton("InteractivityMode");
5801
6239
  var interactiveFlagSlot = singleton("InteractiveFlag");
6240
+ // ../common/src/mime-types.ts
6241
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
6242
+ pdf: "application/pdf",
6243
+ png: "image/png",
6244
+ jpg: "image/jpeg",
6245
+ jpeg: "image/jpeg",
6246
+ gif: "image/gif",
6247
+ webp: "image/webp",
6248
+ bmp: "image/bmp",
6249
+ tif: "image/tiff",
6250
+ tiff: "image/tiff",
6251
+ svg: "image/svg+xml",
6252
+ txt: "text/plain",
6253
+ log: "text/plain",
6254
+ md: "text/markdown",
6255
+ csv: "text/csv",
6256
+ tsv: "text/tab-separated-values",
6257
+ json: "application/json",
6258
+ xml: "application/xml",
6259
+ html: "text/html",
6260
+ htm: "text/html",
6261
+ yaml: "application/yaml",
6262
+ yml: "application/yaml",
6263
+ doc: "application/msword",
6264
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
6265
+ xls: "application/vnd.ms-excel",
6266
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
6267
+ ppt: "application/vnd.ms-powerpoint",
6268
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
6269
+ zip: "application/zip",
6270
+ mp3: "audio/mpeg",
6271
+ wav: "audio/wav",
6272
+ mp4: "video/mp4"
6273
+ });
5802
6274
  // ../common/src/option-aliases.ts
5803
6275
  function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
5804
6276
  getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
@@ -5882,6 +6354,7 @@ var ScreenLogger;
5882
6354
  })(ScreenLogger ||= {});
5883
6355
  // ../common/src/sdk-user-agent.ts
5884
6356
  var USER_AGENT_HEADER = "User-Agent";
6357
+ var AGENT_PROPERTY = BaseDimensions.Agent;
5885
6358
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
5886
6359
  function userAgentPatchKey(userAgent) {
5887
6360
  return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
@@ -5966,6 +6439,6 @@ function unsupportedSolutionProjectType(projectType) {
5966
6439
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
5967
6440
  // ../common/src/tool-provider.ts
5968
6441
  var factorySlot = singleton("PackagerFactoryProvider");
5969
- export { catchError, extractErrorMessage, logger, getOutputFormat, getOutputFormatExplicit, RESULTS, EXIT_CODES, Pagination, OutputFormatter, summarizePlatformBody, InvalidArgumentError, Command, Option, isPreviewBuild, processContext, UIPATH_HOME_DIR, DEFAULT_PAGE_SIZE, hashContent, instructionsFor, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, readStdin };
6442
+ export { catchError, extractErrorMessage, getOutputSink, logger, RESULTS, EXIT_CODES, Pagination, pascalCaseDataKeys, OutputFormatter, summarizePlatformBody, InvalidArgumentError, Command, Option, processContext, UIPATH_HOME_DIR, DEFAULT_PAGE_SIZE, hashContent, instructionsFor, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, unsupportedSolutionProjectType, readStdin };
5970
6443
 
5971
- //# debugId=06DE45F65B6D555764756E2164756E21
6444
+ //# debugId=81A93FB32D41F78B64756E2164756E21