@uipath/agent-tool 1.202.1-preview.220 → 1.202.1-preview.238

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,8 +1,8 @@
1
1
  import {
2
2
  AgentDebugCancelledError,
3
3
  AgentDebugService
4
- } from "./packager-tool-yngdncw0.js";
5
- import"./packager-tool-dqyyvj4p.js";
4
+ } from "./packager-tool-4bjdtvjx.js";
5
+ import"./packager-tool-dfss2mt6.js";
6
6
  import"./packager-tool-b098y4a2.js";
7
7
  import"./packager-tool-1yh8g550.js";
8
8
  // ../executor/project-executor/src/models/run-status.ts
@@ -10,7 +10,7 @@ import {
10
10
  isGuid,
11
11
  logger,
12
12
  normalizeProjectType
13
- } from "./packager-tool-dqyyvj4p.js";
13
+ } from "./packager-tool-dfss2mt6.js";
14
14
  import"./packager-tool-b098y4a2.js";
15
15
  import {
16
16
  __commonJS,
package/dist/index.js CHANGED
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-xj4d0tny.js";
5
+ } from "./packager-tool-dzpw3ckq.js";
6
6
  import"./packager-tool-4mna26cc.js";
7
7
  import"./packager-tool-c23zrhj8.js";
8
- import"./packager-tool-yngdncw0.js";
8
+ import"./packager-tool-4bjdtvjx.js";
9
9
  import {
10
10
  Command
11
- } from "./packager-tool-dqyyvj4p.js";
11
+ } from "./packager-tool-dfss2mt6.js";
12
12
  import"./packager-tool-mc1499dc.js";
13
13
  import"./packager-tool-b098y4a2.js";
14
14
  import"./packager-tool-1yh8g550.js";
@@ -15,7 +15,7 @@ import {
15
15
  summarizePlatformBody,
16
16
  updateSolutionFile,
17
17
  updateUipxSolutionId
18
- } from "./packager-tool-dqyyvj4p.js";
18
+ } from "./packager-tool-dfss2mt6.js";
19
19
  import {
20
20
  zipSync
21
21
  } from "./packager-tool-b098y4a2.js";
@@ -2971,7 +2971,7 @@ function querystringSingleKey2(key, value, keyPrefix = "") {
2971
2971
  var package_default = {
2972
2972
  name: "@uipath/solution-sdk",
2973
2973
  license: "SEE LICENSE IN LICENSE.txt",
2974
- version: "1.202.1-preview.220",
2974
+ version: "1.202.1-preview.238",
2975
2975
  repository: {
2976
2976
  type: "git",
2977
2977
  url: "https://github.com/UiPath/cli.git",
@@ -4238,4 +4238,4 @@ function parseOutput(outputArguments) {
4238
4238
 
4239
4239
  export { StudioWebIncompatibleProjectError, isSolutionUploadHttpError, buildSolutionUploadFailureOutput, migrateLegacyToolGuardrailPolicies, AgentProjectService, resolveStudioWebConfig, AgentLocalWorkspaceEvalPreparer, AgentDebugCancelledError, AgentDebugService };
4240
4240
 
4241
- //# debugId=C5F482DC5E55D3F564756E2164756E21
4241
+ //# debugId=0EA0A6C6A226934064756E2164756E21
@@ -6124,7 +6124,165 @@ class FilterImplicitLimitError extends Error {
6124
6124
  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).";
6125
6125
  }
6126
6126
  }
6127
- function applyFilter(data, filter) {
6127
+ function countRecords(data) {
6128
+ if (Array.isArray(data))
6129
+ return data.length;
6130
+ return data == null ? 0 : 1;
6131
+ }
6132
+ function availableFields(data) {
6133
+ const records = Array.isArray(data) ? data : [data];
6134
+ const keys = new Set;
6135
+ for (const record of records) {
6136
+ if (record && typeof record === "object" && !Array.isArray(record)) {
6137
+ for (const key of Object.keys(record))
6138
+ keys.add(key);
6139
+ }
6140
+ }
6141
+ return [...keys];
6142
+ }
6143
+ function decodeQuotedIdentifier(whole, inner) {
6144
+ const [error, decoded] = catchError2(() => JSON.parse(whole));
6145
+ if (!error && typeof decoded === "string")
6146
+ return decoded;
6147
+ return inner.replace(/\\(.)/g, "$1");
6148
+ }
6149
+ function referencedFields(filter) {
6150
+ const top = new Set;
6151
+ const nested = new Set;
6152
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
6153
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
6154
+ const quoted = [];
6155
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
6156
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
6157
+ if (!isAlias) {
6158
+ quoted.push({
6159
+ name: decodeQuotedIdentifier(whole, name),
6160
+ index,
6161
+ tail: isPathTail(withoutValueLiterals, index)
6162
+ });
6163
+ }
6164
+ return `"${" ".repeat(whole.length - 2)}"`;
6165
+ });
6166
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
6167
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
6168
+ const place = (name, index, tail) => {
6169
+ if (tail || index >= rootEnd)
6170
+ nested.add(name);
6171
+ else
6172
+ top.add(name);
6173
+ };
6174
+ for (const entry of quoted)
6175
+ place(entry.name, entry.index, entry.tail);
6176
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
6177
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
6178
+ for (const match of identifiers) {
6179
+ const [, name, trailing] = match;
6180
+ if (trailing || reserved.has(name))
6181
+ continue;
6182
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
6183
+ }
6184
+ return {
6185
+ top: [...top],
6186
+ nested: [...nested].filter((name) => !top.has(name)),
6187
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
6188
+ };
6189
+ }
6190
+ function appearsBelowTopLevel(data, name) {
6191
+ let budget = 2000;
6192
+ const visit = (value, depth) => {
6193
+ if (budget-- <= 0 || depth > 4)
6194
+ return false;
6195
+ if (value === null || typeof value !== "object")
6196
+ return false;
6197
+ if (Array.isArray(value))
6198
+ return value.some((entry) => visit(entry, depth));
6199
+ const record = value;
6200
+ if (depth > 0 && Object.hasOwn(record, name))
6201
+ return true;
6202
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
6203
+ };
6204
+ return visit(data, 0);
6205
+ }
6206
+ function alwaysNullKeys(records) {
6207
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
6208
+ if (objects.length === 0 || objects.length !== records.length)
6209
+ return [];
6210
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
6211
+ if (keys.length === 0)
6212
+ return [];
6213
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
6214
+ return nullKeys.length === keys.length ? nullKeys : [];
6215
+ }
6216
+ function carriesOnlyNulls(value) {
6217
+ if (value === null)
6218
+ return true;
6219
+ if (Array.isArray(value)) {
6220
+ return value.length > 0 && value.every(carriesOnlyNulls);
6221
+ }
6222
+ if (typeof value === "object" && value !== undefined) {
6223
+ const values = Object.values(value);
6224
+ return values.length > 0 && values.every(carriesOnlyNulls);
6225
+ }
6226
+ return false;
6227
+ }
6228
+ function nameList(names, cap2 = 12) {
6229
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
6230
+ const rest = names.length - shown.length;
6231
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
6232
+ }
6233
+ function buildFilterWarning(filter, data, outcome) {
6234
+ const present = availableFields(data);
6235
+ const refs = referencedFields(filter);
6236
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
6237
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
6238
+ const count = countRecords(data);
6239
+ const scope = `${count} record(s)`;
6240
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
6241
+ 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" : "";
6242
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
6243
+ let detail;
6244
+ let lede;
6245
+ if (outcome.kind === "null-elements") {
6246
+ lede = "returned only null values";
6247
+ const projected = `all ${outcome.count} of the elements it projected are null`;
6248
+ if (unknown.length > 0) {
6249
+ detail = `${projected}, because ${isNotAField(unknown)}`;
6250
+ } else if (unchecked.length > 0) {
6251
+ detail = withSoundness(projected);
6252
+ } else {
6253
+ 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`;
6254
+ }
6255
+ } else if (outcome.kind === "null-rows") {
6256
+ lede = "returned only null values";
6257
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
6258
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
6259
+ } else if (outcome.kind === "null-values") {
6260
+ lede = "returned only null values";
6261
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
6262
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
6263
+ if (sameSet) {
6264
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
6265
+ } else if (unknown.length > 0) {
6266
+ detail = `${projected}, because ${isNotAField(unknown)}`;
6267
+ } else {
6268
+ detail = withSoundness(`${projected} on all ${scope}`);
6269
+ }
6270
+ } else {
6271
+ lede = "returned nothing";
6272
+ if (unknown.length > 0) {
6273
+ detail = isNotAField(unknown);
6274
+ } else {
6275
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
6276
+ detail = withSoundness(`${selection} — it read ${scope}`);
6277
+ }
6278
+ }
6279
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
6280
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
6281
+ }
6282
+ function appendWarning(existing, note) {
6283
+ return existing ? `${existing} ${note}` : note;
6284
+ }
6285
+ function applyFilter(data, filter, onWarning) {
6128
6286
  const codec = requireJmespath();
6129
6287
  let result;
6130
6288
  try {
@@ -6132,9 +6290,34 @@ function applyFilter(data, filter) {
6132
6290
  } catch (err) {
6133
6291
  throw new FilterEvaluationError(filter, err);
6134
6292
  }
6135
- if (result == null)
6293
+ const inputCount = countRecords(data);
6294
+ const warn = (outcome) => {
6295
+ if (inputCount === 0)
6296
+ return;
6297
+ const note = buildFilterWarning(filter, data, outcome);
6298
+ getOutputSink().writeErr(`[WARN] ${note}
6299
+ `);
6300
+ onWarning?.(note);
6301
+ };
6302
+ const warnIfAllNull = (records) => {
6303
+ const keys = alwaysNullKeys(records);
6304
+ if (keys.length > 0)
6305
+ warn({ kind: "null-values", keys });
6306
+ };
6307
+ if (result == null) {
6308
+ warn({ kind: "empty" });
6136
6309
  return [];
6310
+ }
6137
6311
  if (Array.isArray(result)) {
6312
+ if (result.length === 0) {
6313
+ warn({ kind: "empty" });
6314
+ } else if (result.every((entry) => entry === null)) {
6315
+ warn({ kind: "null-elements", count: result.length });
6316
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
6317
+ warn({ kind: "null-rows", count: result.length });
6318
+ } else {
6319
+ warnIfAllNull(result);
6320
+ }
6138
6321
  if (result.length > 0 && typeof result[0] !== "object") {
6139
6322
  const fieldMatch = filter.match(/\.(\w+)$/);
6140
6323
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -6142,10 +6325,30 @@ function applyFilter(data, filter) {
6142
6325
  }
6143
6326
  return result;
6144
6327
  }
6145
- if (typeof result === "object")
6328
+ if (typeof result === "object") {
6329
+ warnIfAllNull([result]);
6146
6330
  return result;
6331
+ }
6147
6332
  return { Value: result };
6148
6333
  }
6334
+ function filterFailureData(envelope) {
6335
+ const filter = getOutputFilter();
6336
+ const data = envelope.Data;
6337
+ if (!filter || data == null)
6338
+ return;
6339
+ let note;
6340
+ const [filterError, filtered] = catchError2(() => applyFilter(data, filter, (n) => {
6341
+ note = n;
6342
+ }));
6343
+ if (filterError) {
6344
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
6345
+ return;
6346
+ }
6347
+ envelope.Data = filtered;
6348
+ if (note) {
6349
+ envelope.Warning = appendWarning(envelope.Warning, note);
6350
+ }
6351
+ }
6149
6352
  function defaultErrorCodeForResult(result) {
6150
6353
  switch (result) {
6151
6354
  case RESULTS.AuthenticationError:
@@ -6228,8 +6431,14 @@ var OutputFormatter;
6228
6431
  }
6229
6432
  const filter = getOutputFilter();
6230
6433
  if (filter) {
6231
- const filtered = applyFilter(data.Data, filter);
6434
+ let note;
6435
+ const filtered = applyFilter(data.Data, filter, (n) => {
6436
+ note = n;
6437
+ });
6232
6438
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
6439
+ if (note) {
6440
+ data.Warning = appendWarning(data.Warning, note);
6441
+ }
6233
6442
  }
6234
6443
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
6235
6444
  }
@@ -6257,6 +6466,7 @@ var OutputFormatter;
6257
6466
  delete envelope.TelemetryErrorClass;
6258
6467
  delete envelope.TelemetryTerminalOutcome;
6259
6468
  delete envelope.TelemetryTerminalSignal;
6469
+ filterFailureData(envelope);
6260
6470
  if (!suppressTelemetry) {
6261
6471
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
6262
6472
  result: data.Result,
@@ -6305,13 +6515,20 @@ var OutputFormatter;
6305
6515
  OutputFormatter.log = log;
6306
6516
  function formatToString(data) {
6307
6517
  const filter = getOutputFilter();
6518
+ const envelope = data;
6308
6519
  if ("Data" in data && data.Data != null) {
6309
6520
  data.Data = normalizeDataKeys(data.Data);
6310
6521
  if (filter) {
6311
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
6522
+ let note;
6523
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
6524
+ note = n;
6525
+ }));
6526
+ if (note) {
6527
+ envelope.Warning = appendWarning(envelope.Warning, note);
6528
+ }
6312
6529
  }
6313
6530
  }
6314
- const output = normalizeOutputKeys(data);
6531
+ const output = normalizeOutputKeys(envelope);
6315
6532
  const lines = [];
6316
6533
  const sink = getOutputSink();
6317
6534
  printOutput(output, getOutputFormat(), (msg) => {
@@ -9766,4 +9983,4 @@ async function createApiClient(ApiClass, options) {
9766
9983
  }
9767
9984
  export { getFileSystem, getLoginStatusAsync, getAuthContext, catchError2 as catchError, extractErrorMessage, extractErrorMessageSync, logger, RESULTS, OutputFormatter, summarizePlatformBody, Command, processContext, isGuid, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, normalizeProjectType, readUipxFile, prepareProjectLocation, updateUipxSolutionId, findSolutionFile, updateSolutionFile, tryRegisterProjectInParentSolution, findSolutionFileUpward, PersonalWorkspacesApi, UsersApi, createApiClient };
9768
9985
 
9769
- //# debugId=454C1F3EF82FD88D64756E2164756E21
9986
+ //# debugId=00F534C529B0997664756E2164756E21
@@ -13,7 +13,7 @@ import {
13
13
  isSolutionUploadHttpError,
14
14
  migrateLegacyToolGuardrailPolicies,
15
15
  resolveStudioWebConfig
16
- } from "./packager-tool-yngdncw0.js";
16
+ } from "./packager-tool-4bjdtvjx.js";
17
17
  import {
18
18
  OutputFormatter,
19
19
  RESULTS,
@@ -31,7 +31,7 @@ import {
31
31
  prepareProjectLocation,
32
32
  processContext,
33
33
  tryRegisterProjectInParentSolution
34
- } from "./packager-tool-dqyyvj4p.js";
34
+ } from "./packager-tool-dfss2mt6.js";
35
35
  import {
36
36
  currentAgentStorageSchema,
37
37
  currentEvaluationSetStorageSchema,
@@ -6990,7 +6990,7 @@ var require_index_cjs = __commonJS(function(exports, module) {
6990
6990
  var package_default = {
6991
6991
  name: "@uipath/agent-tool",
6992
6992
  license: "SEE LICENSE IN LICENSE.txt",
6993
- version: "1.202.1-preview.220",
6993
+ version: "1.202.1-preview.238",
6994
6994
  description: "cli plugin for creating and managing UiPath low-code agents",
6995
6995
  private: false,
6996
6996
  repository: {
@@ -7433,7 +7433,7 @@ class VoidApiResponse {
7433
7433
  var package_default2 = {
7434
7434
  name: "@uipath/agent-sdk",
7435
7435
  license: "SEE LICENSE IN LICENSE.txt",
7436
- version: "1.202.1-preview.220",
7436
+ version: "1.202.1-preview.238",
7437
7437
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
7438
7438
  repository: {
7439
7439
  type: "git",
@@ -12794,7 +12794,7 @@ var registerGuardrailCommands = (program) => {
12794
12794
 
12795
12795
  // src/services/project-artifacts.ts
12796
12796
  async function ensureProjectArtifacts(args) {
12797
- const { addProjectArtifactsToSolutionAsync } = await import("./index-sq0hb4z6.js");
12797
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-6y9hbzz6.js");
12798
12798
  return addProjectArtifactsToSolutionAsync(args);
12799
12799
  }
12800
12800
 
@@ -33286,7 +33286,7 @@ class TextApiResponse {
33286
33286
  var package_default3 = {
33287
33287
  name: "@uipath/integrationservice-sdk",
33288
33288
  license: "SEE LICENSE IN LICENSE.txt",
33289
- version: "1.202.1-preview.220",
33289
+ version: "1.202.1-preview.238",
33290
33290
  repository: {
33291
33291
  type: "git",
33292
33292
  url: "https://github.com/UiPath/cli.git",
@@ -43465,4 +43465,4 @@ var registerCommands = async (program) => {
43465
43465
 
43466
43466
  export { metadata, registerCommands };
43467
43467
 
43468
- //# debugId=DC3F5BF464E3F65A64756E2164756E21
43468
+ //# debugId=0DFF489D22E321DA64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./packager-tool-xj4d0tny.js";
4
+ } from "./packager-tool-dzpw3ckq.js";
5
5
  import"./packager-tool-4mna26cc.js";
6
6
  import"./packager-tool-c23zrhj8.js";
7
- import"./packager-tool-yngdncw0.js";
8
- import"./packager-tool-dqyyvj4p.js";
7
+ import"./packager-tool-4bjdtvjx.js";
8
+ import"./packager-tool-dfss2mt6.js";
9
9
  import"./packager-tool-mc1499dc.js";
10
10
  import"./packager-tool-b098y4a2.js";
11
11
  import"./packager-tool-1yh8g550.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/agent-tool",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.1-preview.220",
4
+ "version": "1.202.1-preview.238",
5
5
  "description": "cli plugin for creating and managing UiPath low-code agents",
6
6
  "private": false,
7
7
  "repository": {
@@ -28,5 +28,5 @@
28
28
  "files": [
29
29
  "dist"
30
30
  ],
31
- "gitHead": "a09041733b628c3f6b658a1f58349ea0f40bb492"
31
+ "gitHead": "537e43df1d3583633cfd3a0b88634f9ce3ba9d6b"
32
32
  }