@uipath/ixp-tool 1.201.0-preview.115 → 1.201.0-preview.121

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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  package_default,
5
5
  registerCommands
6
- } from "./tool-jb4q26s4.js";
6
+ } from "./tool-0fw76nep.js";
7
7
  import"./tool-9qecd4wb.js";
8
8
  import"./tool-7eva0peq.js";
9
9
  import"./tool-5arsyj36.js";
@@ -2112,7 +2112,7 @@ var require_commander = __commonJS((exports) => {
2112
2112
  var package_default = {
2113
2113
  name: "@uipath/ixp-tool",
2114
2114
  license: "MIT",
2115
- version: "1.201.0-preview.115",
2115
+ version: "1.201.0-preview.121",
2116
2116
  description: "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
2117
2117
  private: false,
2118
2118
  repository: {
@@ -2212,17 +2212,18 @@ var TLS_ERROR_CODES = new Set([
2212
2212
  ]);
2213
2213
  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.";
2214
2214
  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.";
2215
+ var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
2216
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
2217
+ function localPermissionInstructions(code, path) {
2218
+ const target = path !== undefined ? `'${path}'` : "a local file or resource";
2219
+ if (code === "EROFS") {
2220
+ 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.";
2221
+ }
2222
+ 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.";
2223
+ 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}`;
2224
+ }
2215
2225
  function describeConnectivityError(error) {
2216
- const queue = [error];
2217
- const seen = new Set;
2218
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2219
- const current = queue.shift();
2220
- if (current === null || typeof current !== "object")
2221
- continue;
2222
- if (seen.has(current))
2223
- continue;
2224
- seen.add(current);
2225
- const cur = current;
2226
+ for (const cur of walkErrorGraph(error)) {
2226
2227
  const code = typeof cur.code === "string" ? cur.code : undefined;
2227
2228
  const message = typeof cur.message === "string" ? cur.message : undefined;
2228
2229
  if (code && TLS_ERROR_CODES.has(code)) {
@@ -2241,6 +2242,49 @@ function describeConnectivityError(error) {
2241
2242
  instructions: NETWORK_INSTRUCTIONS
2242
2243
  };
2243
2244
  }
2245
+ }
2246
+ return;
2247
+ }
2248
+ function describePermissionError(error) {
2249
+ for (const cur of walkErrorGraph(error)) {
2250
+ const message = typeof cur.message === "string" ? cur.message : undefined;
2251
+ const code = matchLocalPermissionCode(cur.code, message);
2252
+ if (!code)
2253
+ continue;
2254
+ const path = localPermissionPath(cur.path, message);
2255
+ return {
2256
+ code,
2257
+ message: message ?? code,
2258
+ ...path !== undefined ? { path } : {},
2259
+ instructions: localPermissionInstructions(code, path)
2260
+ };
2261
+ }
2262
+ return;
2263
+ }
2264
+ function matchLocalPermissionCode(code, message) {
2265
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
2266
+ return code;
2267
+ }
2268
+ const match = message ? LOCAL_PERMISSION_MESSAGE_PATTERN.exec(message) : null;
2269
+ return match ? match[1] : undefined;
2270
+ }
2271
+ function localPermissionPath(path, message) {
2272
+ if (typeof path === "string")
2273
+ return path;
2274
+ return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
2275
+ }
2276
+ function* walkErrorGraph(error) {
2277
+ const queue = [error];
2278
+ const seen = new Set;
2279
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2280
+ const current = queue.shift();
2281
+ if (current === null || typeof current !== "object")
2282
+ continue;
2283
+ if (seen.has(current))
2284
+ continue;
2285
+ seen.add(current);
2286
+ const cur = current;
2287
+ yield cur;
2244
2288
  if (cur.cause !== undefined)
2245
2289
  queue.push(cur.cause);
2246
2290
  if (Array.isArray(cur.errors))
@@ -2301,6 +2345,12 @@ function classifyError(status, error) {
2301
2345
  if (status !== undefined && status >= 500 && status < 600) {
2302
2346
  return { errorCode: "server_error", retry: "RetryLater" };
2303
2347
  }
2348
+ if (status === undefined && describePermissionError(error)) {
2349
+ return {
2350
+ errorCode: "local_permission_denied",
2351
+ retry: "RetryWillNotFix"
2352
+ };
2353
+ }
2304
2354
  const connectivity = describeConnectivityError(error);
2305
2355
  if (connectivity) {
2306
2356
  return {
@@ -2403,6 +2453,16 @@ async function extractErrorDetails(error, options) {
2403
2453
  message = `${message}: ${connectivity.message}`;
2404
2454
  }
2405
2455
  }
2456
+ const permission = status === undefined ? describePermissionError(error) : undefined;
2457
+ if (permission) {
2458
+ if (permission.message !== message && !message.includes(permission.message)) {
2459
+ message = `${message}: ${permission.message}`;
2460
+ }
2461
+ if (!message.includes(permission.instructions)) {
2462
+ const punctuated = message.endsWith(".") ? message : `${message}.`;
2463
+ message = `${punctuated} ${permission.instructions}`;
2464
+ }
2465
+ }
2406
2466
  let details = rawMessage;
2407
2467
  if (rawBody) {
2408
2468
  if (parsedBody) {
@@ -2442,6 +2502,9 @@ async function extractErrorDetails(error, options) {
2442
2502
  if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
2443
2503
  context.traceId = parsedBody.traceId;
2444
2504
  }
2505
+ if (permission?.path !== undefined) {
2506
+ context.path = permission.path;
2507
+ }
2445
2508
  if (status === 429) {
2446
2509
  const resp = response;
2447
2510
  const headersObj = resp?.headers;
@@ -3671,6 +3734,7 @@ var CLI_ERROR_CODES = [
3671
3734
  "invalid_argument",
3672
3735
  "authentication_required",
3673
3736
  "permission_denied",
3737
+ "local_permission_denied",
3674
3738
  "not_found",
3675
3739
  "rate_limited",
3676
3740
  "network_error",
@@ -4106,12 +4170,16 @@ function defaultErrorCodeForHttpStatus(status) {
4106
4170
  return "server_error";
4107
4171
  return;
4108
4172
  }
4173
+ var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
4109
4174
  function defaultErrorCodeForFailure(data) {
4110
4175
  if (data.Result === RESULTS.Failure) {
4111
4176
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
4112
4177
  const errorCode = defaultErrorCodeForHttpStatus(status);
4113
4178
  if (errorCode)
4114
4179
  return errorCode;
4180
+ if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
4181
+ return "local_permission_denied";
4182
+ }
4115
4183
  }
4116
4184
  return defaultErrorCodeForResult(data.Result);
4117
4185
  }
@@ -4673,11 +4741,10 @@ function getSdkUserAgentToken(pkg) {
4673
4741
  const packageName = pkg.name.replace(/^@uipath\//, "");
4674
4742
  return getEffectiveUserAgent(`${packageName}/${pkg.version}`);
4675
4743
  }
4676
- // ../common/src/tool-provider.ts
4677
- var factorySlot = singleton("PackagerFactoryProvider");
4678
- var moduleSlot = singleton("ToolModuleProvider");
4679
4744
  // ../common/src/telemetry/ship-succeeded.ts
4680
4745
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
4746
+ // ../common/src/tool-provider.ts
4747
+ var factorySlot = singleton("PackagerFactoryProvider");
4681
4748
  // ../auth/src/config.ts
4682
4749
  var DEFAULT_CLIENT_ID = "36dea5b8-e8bb-423d-8e7b-c808df8f1c00";
4683
4750
  var AUTH_FILE_CONFIG_KEY = Symbol.for("@uipath/auth/AuthFileConfig");
@@ -5918,6 +5985,9 @@ function normalizeTokenRefreshUnavailableFailure() {
5918
5985
  function errorMessage(error) {
5919
5986
  return error instanceof Error ? error.message : String(error);
5920
5987
  }
5988
+ // ../auth/src/tenantSelection.ts
5989
+ var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
5990
+
5921
5991
  // ../auth/src/selectTenant.ts
5922
5992
  var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
5923
5993
  var INVALID_TENANT_CODE = "INVALID_TENANT";
@@ -5929,7 +5999,7 @@ var TENANT_SELECTION_CODES = new Set([
5929
5999
  var package_default2 = {
5930
6000
  name: "@uipath/ixp-sdk",
5931
6001
  license: "MIT",
5932
- version: "1.201.0-preview.115",
6002
+ version: "1.201.0-preview.121",
5933
6003
  description: "SDK for the UiPath IXP (Intelligent eXtraction Platform) API — projects, taxonomies, prompts, predictions, and model publishing.",
5934
6004
  repository: {
5935
6005
  type: "git",
@@ -6110,6 +6180,28 @@ async function getDeploymentTaxonomy(config, projectName, version) {
6110
6180
  }
6111
6181
  return designtimeGet(config, `/api/projects/${encodeURIComponent(projectName)}/models/${version}/taxonomy`, "Failed to get deployment taxonomy");
6112
6182
  }
6183
+ function deploymentsPath(projectName) {
6184
+ return `/api/projects/${encodeURIComponent(projectName)}/deployments`;
6185
+ }
6186
+ async function deployModel(config, projectName, options) {
6187
+ const body = {
6188
+ ModelVersion: options.modelVersion,
6189
+ FolderKey: options.folderKey
6190
+ };
6191
+ if (options.deploymentTitle !== undefined) {
6192
+ body.DeploymentTitle = options.deploymentTitle;
6193
+ }
6194
+ return designtimePost(config, deploymentsPath(projectName), body, "Failed to deploy model");
6195
+ }
6196
+ async function upgradeDeployment(config, projectName, deploymentName, options) {
6197
+ return designtimePut(config, `${deploymentsPath(projectName)}/${encodeURIComponent(deploymentName)}`, {
6198
+ ModelVersion: options.modelVersion,
6199
+ FolderKey: options.folderKey
6200
+ }, "Failed to upgrade deployment");
6201
+ }
6202
+ async function listDeployments(config, projectName) {
6203
+ return designtimeGet(config, deploymentsPath(projectName), "Failed to list deployments");
6204
+ }
6113
6205
  // ../ixp-sdk/src/documents-service.ts
6114
6206
  function documentsPath(projectName) {
6115
6207
  return `/api/projects/${encodeURIComponent(projectName)}/documents`;
@@ -6309,7 +6401,11 @@ async function parseResponseBody(error) {
6309
6401
  } catch {}
6310
6402
  return;
6311
6403
  }
6312
- async function emitError(error, message) {
6404
+ function httpStatusOf(error) {
6405
+ const status = error?.status;
6406
+ return typeof status === "number" ? status : undefined;
6407
+ }
6408
+ async function emitError(error, message, hint) {
6313
6409
  const details = await extractErrorDetails(error);
6314
6410
  const body = await parseResponseBody(error);
6315
6411
  let instructions = details.message;
@@ -6326,7 +6422,7 @@ async function emitError(error, message) {
6326
6422
  Result: details.result,
6327
6423
  ErrorCode: details.errorCode,
6328
6424
  Message: message,
6329
- Instructions: instructions,
6425
+ Instructions: hint ? `${instructions} ${hint}` : instructions,
6330
6426
  Retry: details.retry,
6331
6427
  ...context ? { Context: context } : {}
6332
6428
  });
@@ -6539,6 +6635,7 @@ var registerDataTypesCommand = (program2) => {
6539
6635
  };
6540
6636
 
6541
6637
  // src/commands/deployments.ts
6638
+ var DEPLOY_CONFLICT_HINT = "To change the version an existing deployment serves, use `uip ixp deployments upgrade <project-name> <deployment-name> --version <number> --folder-key <guid>`. Get <deployment-name> from the DeploymentName field of `uip ixp deployments list` — it is not the title you passed to --title.";
6542
6639
  var DEPLOYMENTS_GET_TAXONOMY_EXAMPLES = [
6543
6640
  {
6544
6641
  Description: "Inspect the project taxonomy pinned to a specific trained model version (the schema that powers the deployed model)",
@@ -6554,8 +6651,133 @@ var DEPLOYMENTS_GET_TAXONOMY_EXAMPLES = [
6554
6651
  }
6555
6652
  }
6556
6653
  ];
6654
+ var DEPLOYMENTS_CREATE_EXAMPLES = [
6655
+ {
6656
+ Description: "Deploy a trained model version to an Orchestrator folder",
6657
+ Command: "uip ixp deployments create my-invoices-a1b2c3d4-ixp --version 13 --folder-key 3f0a91c7-1111-2222-3333-444455556666",
6658
+ Output: {
6659
+ Code: "IxpDeploymentsCreate",
6660
+ Data: {
6661
+ ProjectName: "my-invoices-a1b2c3d4-ixp",
6662
+ ModelVersion: 13,
6663
+ FolderKey: "3f0a91c7-1111-2222-3333-444455556666",
6664
+ DeploymentName: "my-invoices-a1b2c3d4-7c3f21e8-ixp",
6665
+ DeploymentTitle: "my-invoices-a1b2c3d4"
6666
+ }
6667
+ }
6668
+ },
6669
+ {
6670
+ Description: "Deploy under a chosen title",
6671
+ Command: "uip ixp deployments create my-invoices-a1b2c3d4-ixp --version 13 --folder-key 3f0a91c7-1111-2222-3333-444455556666 --title invoices",
6672
+ Output: {
6673
+ Code: "IxpDeploymentsCreate",
6674
+ Data: {
6675
+ ProjectName: "my-invoices-a1b2c3d4-ixp",
6676
+ ModelVersion: 13,
6677
+ FolderKey: "3f0a91c7-1111-2222-3333-444455556666",
6678
+ DeploymentName: "invoices-08963f00-ixp",
6679
+ DeploymentTitle: "invoices"
6680
+ }
6681
+ }
6682
+ }
6683
+ ];
6684
+ var DEPLOYMENTS_UPGRADE_EXAMPLES = [
6685
+ {
6686
+ Description: "Move an existing deployment to another trained model version",
6687
+ Command: "uip ixp deployments upgrade my-invoices-a1b2c3d4-ixp invoices-08963f00-ixp --version 14 --folder-key 3f0a91c7-1111-2222-3333-444455556666",
6688
+ Output: {
6689
+ Code: "IxpDeploymentsUpgrade",
6690
+ Data: {
6691
+ ProjectName: "my-invoices-a1b2c3d4-ixp",
6692
+ ModelVersion: 14,
6693
+ FolderKey: "3f0a91c7-1111-2222-3333-444455556666",
6694
+ DeploymentName: "invoices-08963f00-ixp",
6695
+ DeploymentTitle: "invoices"
6696
+ }
6697
+ }
6698
+ }
6699
+ ];
6700
+ var DEPLOYMENTS_LIST_EXAMPLES = [
6701
+ {
6702
+ Description: "List every folder this project's model versions are deployed to",
6703
+ Command: "uip ixp deployments list my-invoices-a1b2c3d4-ixp",
6704
+ Output: {
6705
+ Code: "IxpDeploymentsList",
6706
+ Data: [
6707
+ {
6708
+ DeploymentName: "invoices-08963f00-ixp",
6709
+ DeploymentTitle: "invoices",
6710
+ ModelVersion: 13,
6711
+ FolderKey: "3f0a91c7-1111-2222-3333-444455556666",
6712
+ DeployedAt: "2026-08-18T11:26:25.367124+00:00"
6713
+ }
6714
+ ]
6715
+ }
6716
+ }
6717
+ ];
6557
6718
  var registerDeploymentsCommand = (program2) => {
6558
- const deployments = program2.command("deployments").description("Inspect IXP deployments — project taxonomy pinned to a specific trained model version");
6719
+ const deployments = program2.command("deployments").description("Manage IXP deployments — deploy trained model versions to Orchestrator folders, move a deployment to another version, and inspect the taxonomy pinned to a version");
6720
+ deployments.command("create").description("Deploy a trained model version to an Orchestrator folder, making it callable at runtime by activities and Maestro Flow. Only ever adds a deployment — moving an existing one is `deployments upgrade`.").argument("<project-name>", "Project name").requiredOption("--version <number>", "Trained model version to deploy (non-negative integer). Get available versions from `uip ixp projects list-models <project-name> --output json`.", (raw) => parseBoundedInt(raw, "--version", { min: 0, max: 1e6 })).requiredOption("--folder-key <guid>", "Orchestrator folder key (GUID) to deploy into. Get it from `uip or folders list --output json`.").option("--title <title>", "Title to deploy under (defaults to the project name minus its '-ixp' suffix). Comes back verbatim as DeploymentTitle; the backend slugs and suffixes it into the name the runtime resolves, returned as DeploymentName.").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(DEPLOYMENTS_CREATE_EXAMPLES).trackedAction(processContext, async (projectName, options) => {
6721
+ const [err, deployment] = await catchError2((async () => {
6722
+ const config = await createIxpConfig({
6723
+ tenant: options.tenant
6724
+ });
6725
+ return await deployModel(config, projectName, {
6726
+ modelVersion: options.version,
6727
+ folderKey: options.folderKey,
6728
+ deploymentTitle: options.title
6729
+ });
6730
+ })());
6731
+ if (err) {
6732
+ await emitError(err, "Failed to deploy model", httpStatusOf(err) === 409 ? DEPLOY_CONFLICT_HINT : undefined);
6733
+ processContext.exit(1);
6734
+ return;
6735
+ }
6736
+ OutputFormatter.success({
6737
+ Result: "Success",
6738
+ Code: "IxpDeploymentsCreate",
6739
+ Data: deployment
6740
+ });
6741
+ });
6742
+ deployments.command("upgrade").description("Move an existing deployment to another trained model version, changing which version every runtime caller of that folder and name gets").argument("<project-name>", "Project name").argument("<deployment-name>", "Deployment to move, addressed by the name the runtime resolves — the DeploymentName field of `uip ixp deployments list <project-name> --output json`, not the title it was created under.").requiredOption("--version <number>", "Trained model version to move the deployment to (non-negative integer). Get available versions from `uip ixp projects list-models <project-name> --output json`.", (raw) => parseBoundedInt(raw, "--version", { min: 0, max: 1e6 })).requiredOption("--folder-key <guid>", "Orchestrator folder key (GUID) hosting the deployment. The same name can be deployed in several folders, so the folder is part of the identity.").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(DEPLOYMENTS_UPGRADE_EXAMPLES).trackedAction(processContext, async (projectName, deploymentName, options) => {
6743
+ const [err, deployment] = await catchError2((async () => {
6744
+ const config = await createIxpConfig({
6745
+ tenant: options.tenant
6746
+ });
6747
+ return await upgradeDeployment(config, projectName, deploymentName, {
6748
+ modelVersion: options.version,
6749
+ folderKey: options.folderKey
6750
+ });
6751
+ })());
6752
+ if (err) {
6753
+ await emitError(err, "Failed to upgrade deployment");
6754
+ processContext.exit(1);
6755
+ return;
6756
+ }
6757
+ OutputFormatter.success({
6758
+ Result: "Success",
6759
+ Code: "IxpDeploymentsUpgrade",
6760
+ Data: deployment
6761
+ });
6762
+ });
6763
+ deployments.command("list").description("List the project's model deployments, across every version and folder it has been deployed to").argument("<project-name>", "Project name").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(DEPLOYMENTS_LIST_EXAMPLES).trackedAction(processContext, async (projectName, options) => {
6764
+ const [err, response] = await catchError2((async () => {
6765
+ const config = await createIxpConfig({
6766
+ tenant: options.tenant
6767
+ });
6768
+ return await listDeployments(config, projectName);
6769
+ })());
6770
+ if (err) {
6771
+ await emitError(err, "Failed to list deployments");
6772
+ processContext.exit(1);
6773
+ return;
6774
+ }
6775
+ OutputFormatter.success({
6776
+ Result: "Success",
6777
+ Code: "IxpDeploymentsList",
6778
+ Data: response.Deployments ?? []
6779
+ });
6780
+ });
6559
6781
  deployments.command("get-taxonomy").description("Get the project taxonomy (data types + field groups) at a specific trained model version").argument("<project-name>", "Project name").requiredOption("--version <number>", "Trained model version (non-negative integer). Get available versions from `uip ixp projects list-models <project-name> --output json`.", (raw) => parseBoundedInt(raw, "--version", { min: 0, max: 1e6 })).addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(DEPLOYMENTS_GET_TAXONOMY_EXAMPLES).trackedAction(processContext, async (projectName, options) => {
6560
6782
  const [err, taxonomy] = await catchError2((async () => {
6561
6783
  const config = await createIxpConfig({
@@ -7290,6 +7512,10 @@ function buildSingleOccurrenceConfirm(group, options) {
7290
7512
  };
7291
7513
  }
7292
7514
  function buildConfirmBody(options) {
7515
+ const body = buildConfirmTargeting(options);
7516
+ return options.modelVersion === undefined ? body : { ...body, ModelVersion: options.modelVersion };
7517
+ }
7518
+ function buildConfirmTargeting(options) {
7293
7519
  if (options.updates && options.group) {
7294
7520
  return {
7295
7521
  Group: options.group,
@@ -7570,32 +7796,33 @@ var LABELLINGS_MARK_MISSING_EXAMPLES = [
7570
7796
  ];
7571
7797
  var LABELLINGS_GET_PREDICTIONS_EXAMPLES = [
7572
7798
  {
7573
- Description: "Get predictions for every document in the project as JSON",
7574
- Command: "uip ixp labellings get-predictions my-invoices --output json",
7799
+ Description: "Get predictions for a single document",
7800
+ Command: "uip ixp labellings get-predictions my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
7575
7801
  Output: {
7576
7802
  Code: "IxpLabellingsGetPredictions",
7577
7803
  Data: {
7578
7804
  ProjectName: "my-invoices",
7579
- TotalDocuments: 12,
7580
- DocumentsWithPredictions: 10,
7805
+ TotalDocuments: 1,
7806
+ DocumentsWithPredictions: 1,
7581
7807
  Predictions: []
7582
7808
  }
7583
7809
  }
7584
7810
  },
7585
7811
  {
7586
- Description: "Get predictions for a single document",
7587
- Command: "uip ixp labellings get-predictions my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
7812
+ Description: "Deprecated: omit the document id to fetch every document in the project. Removed in the next release — pass a document id instead.",
7813
+ Command: "uip ixp labellings get-predictions my-invoices --output json",
7588
7814
  Output: {
7589
7815
  Code: "IxpLabellingsGetPredictions",
7590
7816
  Data: {
7591
7817
  ProjectName: "my-invoices",
7592
- TotalDocuments: 1,
7593
- DocumentsWithPredictions: 1,
7818
+ TotalDocuments: 12,
7819
+ DocumentsWithPredictions: 10,
7594
7820
  Predictions: []
7595
7821
  }
7596
7822
  }
7597
7823
  }
7598
7824
  ];
7825
+ var PROJECT_WIDE_DEPRECATION_WARNING = "[WARN] Omitting <document-id> is deprecated and will be removed in the next release. " + "Pass a document id; use `uip ixp documents list` to enumerate them.\n";
7599
7826
  var LIST_PAGE_SIZE = 100;
7600
7827
  async function listAllDocumentIds(config, projectName) {
7601
7828
  const ids = [];
@@ -7616,7 +7843,10 @@ async function listAllDocumentIds(config, projectName) {
7616
7843
  }
7617
7844
  var registerLabellingsCommand = (program2) => {
7618
7845
  const labelling = program2.command("labellings").description("Manage IXP labellings and predictions");
7619
- labelling.command("confirm").description("Confirm IXP-generated predictions as ground truth. Confirms all documents, or a single document if document-id is provided. For a repeatable field group, narrow with --group: alone it confirms every occurrence; add --occurrence to confirm ONE occurrence (the ergonomic single-line form); or use --updates to confirm SEVERAL occurrences in one atomic call (one request). --updates is the superset — --occurrence <N> equals --updates with a single entry — so reach for --occurrence for one line and --updates when several lines need confirming together (or with different per-line fields/corrections).").argument("<project-name>", "Project name").argument("[document-id]", "Document ID — confirm only this document (omit to confirm all)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --fields <field-ids>", "Comma-separated field IDs to confirm (omit to confirm all predicted fields). Without --group, confirms each field_id across every occurrence it appears in. With --group + --occurrence, confirms only within that specific occurrence.").option("-c, --corrections <json>", 'Override predicted values while keeping references: [{"field_id":"...","value":"corrected"}]. Applies across every occurrence the field appears in (or just the targeted occurrence when --group + --occurrence are given).').option("--group <name>", 'Target field group (label_def). Must be the FULL label path exactly as shown in the "Name" field of `get-predictions` (e.g. "Invoice > Line Items"), not just the leaf name. On its own, confirms every occurrence of the group as-is. Add --occurrence to target a single occurrence, or --updates to batch specific occurrences in one call. Combine with --fields to limit to specific fields within the group.').option("--occurrence <index>", "Single-occurrence form: 0-based index of ONE occurrence within --group to confirm. Use --fields to limit to specific fields in that occurrence; omit --fields to confirm every predicted field there. Requires --group. Mutually exclusive with --updates — for several occurrences in one call, use --updates instead.").option("--updates <json>", 'Batched form: confirm SEVERAL occurrences of --group in one atomic call. JSON array of {"occurrence":<0-based-index>,"fields"?:["<field_id>",...],"corrections"?:{"<field_id>":"<value>"}}. Per entry: omit "fields" to confirm every predicted field in that occurrence (same default as --occurrence without --fields), or list specific ones. Un-selected fields in a selected occurrence carry forward their existing annotation; occurrences not listed are left as-is. Equivalent to running --occurrence once per entry, but in a single request. Mutually exclusive with --fields, --corrections, and --occurrence.').examples(LABELLINGS_CONFIRM_EXAMPLES).trackedAction(processContext, async (projectName, documentUid, options) => {
7846
+ labelling.command("confirm").description("Confirm IXP-generated predictions as ground truth. Confirms all documents, or a single document if document-id is provided. For a repeatable field group, narrow with --group: alone it confirms every occurrence; add --occurrence to confirm ONE occurrence (the ergonomic single-line form); or use --updates to confirm SEVERAL occurrences in one atomic call (one request). --updates is the superset — --occurrence <N> equals --updates with a single entry — so reach for --occurrence for one line and --updates when several lines need confirming together (or with different per-line fields/corrections).").argument("<project-name>", "Project name").argument("[document-id]", "Document ID — confirm only this document (omit to confirm all)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).option("-f, --fields <field-ids>", "Comma-separated field IDs to confirm (omit to confirm all predicted fields). Without --group, confirms each field_id across every occurrence it appears in. With --group + --occurrence, confirms only within that specific occurrence.").option("-c, --corrections <json>", 'Override predicted values while keeping references: [{"field_id":"...","value":"corrected"}]. Applies across every occurrence the field appears in (or just the targeted occurrence when --group + --occurrence are given).').option("--group <name>", 'Target field group (label_def). Must be the FULL label path exactly as shown in the "Name" field of `get-predictions` (e.g. "Invoice > Line Items"), not just the leaf name. On its own, confirms every occurrence of the group as-is. Add --occurrence to target a single occurrence, or --updates to batch specific occurrences in one call. Combine with --fields to limit to specific fields within the group.').option("--occurrence <index>", "Single-occurrence form: 0-based index of ONE occurrence within --group to confirm. Use --fields to limit to specific fields in that occurrence; omit --fields to confirm every predicted field there. Requires --group. Mutually exclusive with --updates — for several occurrences in one call, use --updates instead.").option("--updates <json>", 'Batched form: confirm SEVERAL occurrences of --group in one atomic call. JSON array of {"occurrence":<0-based-index>,"fields"?:["<field_id>",...],"corrections"?:{"<field_id>":"<value>"}}. Per entry: omit "fields" to confirm every predicted field in that occurrence (same default as --occurrence without --fields), or list specific ones. Un-selected fields in a selected occurrence carry forward their existing annotation; occurrences not listed are left as-is. Equivalent to running --occurrence once per entry, but in a single request. Mutually exclusive with --fields, --corrections, and --occurrence.').option("-m, --model-version <version>", "Optimistic-concurrency guard: the model version (from `get-predictions`' ModelVersion) the predictions being confirmed were reviewed against. If a retrain has produced a newer version since, the confirm is rejected instead of stamping drifted values as ground truth — re-read predictions and review again. Omit to skip the check.", (raw) => parseBoundedInt(raw, "--model-version", {
7847
+ min: 0,
7848
+ max: Number.MAX_SAFE_INTEGER
7849
+ })).examples(LABELLINGS_CONFIRM_EXAMPLES).trackedAction(processContext, async (projectName, documentUid, options) => {
7620
7850
  const [err, result] = await catchError2((async () => {
7621
7851
  validateConfirmMode(documentUid, options);
7622
7852
  const config = await createIxpConfig({
@@ -7706,7 +7936,10 @@ var registerLabellingsCommand = (program2) => {
7706
7936
  }
7707
7937
  }, { preserveDataKeys: true });
7708
7938
  });
7709
- labelling.command("get-predictions").description("Get IXP model predictions for documents in a project. Returns predicted labels and field values, plus the ModelVersion that produced them (null when a document has no predictions yet).").argument("<project-name>", "Project name").argument("[document-id]", "Document ID get predictions for only this document (omit for all)").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(LABELLINGS_GET_PREDICTIONS_EXAMPLES).trackedAction(processContext, async (projectName, documentUid, options) => {
7939
+ labelling.command("get-predictions").description("Get IXP model predictions for documents in a project. Returns predicted labels and field values, plus the ModelVersion that produced them (null when a document has no predictions yet).").argument("<project-name>", "Project name").argument("[document-id]", "Document ID. Omitting it fans out across every document in the project — deprecated, and removed in the next release.").addOption(createHiddenDeprecatedTenantOption("-t, --tenant <tenant-name>")).examples(LABELLINGS_GET_PREDICTIONS_EXAMPLES).trackedAction(processContext, async (projectName, documentUid, options) => {
7940
+ if (!documentUid) {
7941
+ getOutputSink().writeErr(PROJECT_WIDE_DEPRECATION_WARNING);
7942
+ }
7710
7943
  const [err, result] = await catchError2((async () => {
7711
7944
  const config = await createIxpConfig({
7712
7945
  tenant: options.tenant
@@ -7950,12 +8183,49 @@ var PROJECTS_GET_METRICS_EXAMPLES = [
7950
8183
  Output: {
7951
8184
  Code: "IxpProjectsGetMetrics",
7952
8185
  Data: {
7953
- Metrics: {
7954
- ModelVersion: 4,
7955
- NumValidatedDocuments: 12,
7956
- ProjectScore: 0.87,
7957
- ProjectScoreQuality: "Good"
7958
- }
8186
+ ModelVersion: 35,
8187
+ ValidatedDocuments: 8,
8188
+ ProjectScore: 0.8662574291229248,
8189
+ ProjectScoreQuality: "excellent",
8190
+ FieldGroups: [
8191
+ {
8192
+ FieldGroup: "Invoice",
8193
+ F1: 0.8939051628112793,
8194
+ Precision: 0.824999988079071,
8195
+ Recall: 0.9753694534301758,
8196
+ ErrorRate: 0.1621621549129486,
8197
+ Documents: 8
8198
+ }
8199
+ ],
8200
+ Fields: [
8201
+ {
8202
+ FieldGroup: "Invoice",
8203
+ FieldId: "1e8eadeac608df18",
8204
+ Name: "Invoice Number",
8205
+ F1: 0.875,
8206
+ Precision: 0.875,
8207
+ Recall: 0.875,
8208
+ ErrorRate: 0.125,
8209
+ Documents: 8,
8210
+ Annotations: 8,
8211
+ Quality: "good"
8212
+ }
8213
+ ]
8214
+ }
8215
+ }
8216
+ },
8217
+ {
8218
+ Description: "Get metrics for a specific model version",
8219
+ Command: "uip ixp projects get-metrics my-invoices --model-version 32 --output json",
8220
+ Output: {
8221
+ Code: "IxpProjectsGetMetrics",
8222
+ Data: {
8223
+ ModelVersion: 32,
8224
+ ValidatedDocuments: 2,
8225
+ ProjectScore: 0.8385416865348816,
8226
+ ProjectScoreQuality: "good",
8227
+ FieldGroups: [],
8228
+ Fields: []
7959
8229
  }
7960
8230
  }
7961
8231
  }
@@ -8570,4 +8840,4 @@ var registerCommands = async (program2) => {
8570
8840
 
8571
8841
  export { package_default, Command, metadata, registerCommands };
8572
8842
 
8573
- //# debugId=BE77515DFEEBC05764756E2164756E21
8843
+ //# debugId=602E75D2CA2C538164756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-jb4q26s4.js";
4
+ } from "./tool-0fw76nep.js";
5
5
  import"./tool-9qecd4wb.js";
6
6
  import"./tool-7eva0peq.js";
7
7
  import"./tool-5arsyj36.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/ixp-tool",
3
3
  "license": "MIT",
4
- "version": "1.201.0-preview.115",
4
+ "version": "1.201.0-preview.121",
5
5
  "description": "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
29
+ "gitHead": "c70ccfc0b12e637441d67df1d212b71d7784b5f8"
30
30
  }