@uipath/uipath-typescript 1.4.2 → 1.5.1

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 (52) hide show
  1. package/README.md +7 -1
  2. package/dist/agent-memory/index.d.ts +4 -1
  3. package/dist/agents/index.cjs +341 -6
  4. package/dist/agents/index.d.ts +717 -16
  5. package/dist/agents/index.mjs +342 -7
  6. package/dist/assets/index.cjs +132 -15
  7. package/dist/assets/index.d.ts +12 -1
  8. package/dist/assets/index.mjs +132 -15
  9. package/dist/attachments/index.cjs +120 -12
  10. package/dist/attachments/index.mjs +120 -12
  11. package/dist/buckets/index.cjs +136 -15
  12. package/dist/buckets/index.d.ts +12 -1
  13. package/dist/buckets/index.mjs +136 -15
  14. package/dist/cases/index.cjs +1203 -938
  15. package/dist/cases/index.d.ts +325 -45
  16. package/dist/cases/index.mjs +1203 -938
  17. package/dist/conversational-agent/index.cjs +48 -10
  18. package/dist/conversational-agent/index.d.ts +117 -6
  19. package/dist/conversational-agent/index.mjs +48 -10
  20. package/dist/core/index.cjs +1 -1
  21. package/dist/core/index.mjs +1 -1
  22. package/dist/entities/index.cjs +448 -9
  23. package/dist/entities/index.d.ts +441 -1
  24. package/dist/entities/index.mjs +447 -10
  25. package/dist/feedback/index.cjs +25 -9
  26. package/dist/feedback/index.mjs +25 -9
  27. package/dist/index.cjs +1281 -330
  28. package/dist/index.d.ts +1988 -143
  29. package/dist/index.mjs +1282 -331
  30. package/dist/index.umd.js +1230 -279
  31. package/dist/jobs/index.cjs +141 -19
  32. package/dist/jobs/index.d.ts +22 -6
  33. package/dist/jobs/index.mjs +141 -19
  34. package/dist/maestro-processes/index.cjs +553 -354
  35. package/dist/maestro-processes/index.d.ts +376 -47
  36. package/dist/maestro-processes/index.mjs +553 -354
  37. package/dist/notifications/index.cjs +2012 -0
  38. package/dist/notifications/index.d.ts +615 -0
  39. package/dist/notifications/index.mjs +2010 -0
  40. package/dist/processes/index.cjs +118 -18
  41. package/dist/processes/index.d.ts +18 -2
  42. package/dist/processes/index.mjs +118 -18
  43. package/dist/queues/index.cjs +131 -14
  44. package/dist/queues/index.d.ts +12 -1
  45. package/dist/queues/index.mjs +131 -14
  46. package/dist/tasks/index.cjs +125 -13
  47. package/dist/tasks/index.d.ts +4 -1
  48. package/dist/tasks/index.mjs +125 -13
  49. package/dist/traces/index.cjs +220 -6
  50. package/dist/traces/index.d.ts +360 -25
  51. package/dist/traces/index.mjs +221 -7
  52. package/package.json +14 -4
@@ -300,6 +300,24 @@ declare class BaseService {
300
300
  private determineHasMorePages;
301
301
  }
302
302
 
303
+ /**
304
+ * Common enum for job state used across services
305
+ */
306
+ declare enum JobState {
307
+ Pending = "Pending",
308
+ Running = "Running",
309
+ Stopping = "Stopping",
310
+ Terminating = "Terminating",
311
+ Faulted = "Faulted",
312
+ Successful = "Successful",
313
+ Stopped = "Stopped",
314
+ Suspended = "Suspended",
315
+ Resumed = "Resumed",
316
+ Cancelled = "Cancelled",
317
+ /** Server-side fallback for an unrecognized or missing job state. */
318
+ Unknown = "Unknown"
319
+ }
320
+
303
321
  /**
304
322
  * Filter fields shared by agent endpoints that accept a
305
323
  * folder/agent/project scope (`/Agents/agents`, `/Agents/errors`, etc.).
@@ -326,9 +344,9 @@ declare enum AgentListSortColumn {
326
344
  HealthScore = "HealthScore",
327
345
  LastIncident = "LastIncident",
328
346
  FolderName = "FolderName",
329
- /** Quantity of AGU (Agent Units) consumed */
347
+ /** Quantity of Agent Units consumed */
330
348
  QuantityAGU = "QuantityAGU",
331
- /** Quantity of PLTU (Platform Units) consumed */
349
+ /** Quantity of Platform Units consumed */
332
350
  QuantityPLTU = "QuantityPLTU",
333
351
  FolderPath = "FolderPath"
334
352
  }
@@ -338,7 +356,10 @@ declare enum AgentListSortColumn {
338
356
  interface AgentListOrderBy {
339
357
  /** Column to sort by */
340
358
  column: AgentListSortColumn;
341
- /** Sort descending. Defaults to false. */
359
+ /**
360
+ * Sort descending.
361
+ * @default false
362
+ */
342
363
  desc?: boolean;
343
364
  }
344
365
  /**
@@ -372,9 +393,9 @@ interface AgentListItem {
372
393
  unitsQuantity: number;
373
394
  /** Display name of the units (if any). May be `null` or `""`. */
374
395
  unitsName: string | null;
375
- /** Quantity of AGU (Agent Units) consumed by this agent */
396
+ /** Quantity of Agent Units consumed by this agent */
376
397
  quantityAGU: number;
377
- /** Quantity of PLTU (Platform Units) consumed by this agent */
398
+ /** Quantity of Platform Units consumed by this agent */
378
399
  quantityPLTU: number;
379
400
  }
380
401
  /**
@@ -429,7 +450,10 @@ declare enum AgentErrorSortColumn {
429
450
  interface AgentErrorOrderBy {
430
451
  /** Column to sort by */
431
452
  column: AgentErrorSortColumn;
432
- /** Sort descending. Defaults to false (ascending) server-side. */
453
+ /**
454
+ * Sort descending.
455
+ * @default false
456
+ */
433
457
  desc?: boolean;
434
458
  }
435
459
  /**
@@ -490,7 +514,10 @@ interface AgentGetErrorsTimelineResponse {
490
514
  * Options for getting the agent errors timeline.
491
515
  */
492
516
  interface AgentGetErrorsTimelineOptions extends AgentFilterOptions {
493
- /** Max number of agents to return. Defaults to 10 server-side. */
517
+ /**
518
+ * Max number of agents to return.
519
+ * @default 10
520
+ */
494
521
  limit?: number;
495
522
  }
496
523
  /**
@@ -499,7 +526,7 @@ interface AgentGetErrorsTimelineOptions extends AgentFilterOptions {
499
526
  interface AgentGetConsumptionTimelineResponse {
500
527
  /** Bucket timestamp (ISO 8601, UTC) */
501
528
  timeSlice: string;
502
- /** AGU quantity consumed in this time bucket */
529
+ /** Agent Units quantity consumed in this time bucket */
503
530
  aguConsumption: number;
504
531
  }
505
532
  /**
@@ -525,6 +552,296 @@ interface AgentGetLatencyTimelineResponse {
525
552
  */
526
553
  interface AgentGetLatencyTimelineOptions extends AgentFilterOptions {
527
554
  }
555
+ /**
556
+ * A single agent's error count over the requested window, with the first and
557
+ * last jobs where errors were observed.
558
+ */
559
+ interface AgentTopErrorCount {
560
+ /** Agent name */
561
+ name: string;
562
+ /** Error count for this agent over the requested window */
563
+ count: number;
564
+ /** Agent ID (GUID) */
565
+ agentId: string;
566
+ /** First job in the window where this agent reported errors */
567
+ firstSeenJob: AgentJobInfo;
568
+ /** Last job in the window where this agent reported errors */
569
+ lastSeenJob: AgentJobInfo;
570
+ }
571
+ /**
572
+ * Response from getting the top agents by error count.
573
+ */
574
+ interface AgentGetTopErrorCountResponse {
575
+ /** Total error count across all agents in the window. */
576
+ totalErrors: number;
577
+ /** Top-N agents ranked by error count. */
578
+ data: AgentTopErrorCount[];
579
+ }
580
+ /**
581
+ * Options for getting the top agents by error count.
582
+ */
583
+ interface AgentGetTopErrorCountOptions extends AgentFilterOptions {
584
+ /**
585
+ * Max number of agents to return. Defaults to 10 server-side.
586
+ * @default 10
587
+ */
588
+ limit?: number;
589
+ }
590
+ /**
591
+ * Agent type, used to filter consumption results.
592
+ *
593
+ * Wire format is the string name, per the API's `StringEnumConverter` serialization.
594
+ */
595
+ declare enum AgentType {
596
+ Autonomous = "Autonomous",
597
+ Conversational = "Conversational",
598
+ Coded = "Coded"
599
+ }
600
+ /**
601
+ * A single agent's unit consumption over the requested window, with the first
602
+ * and last jobs where consumption was recorded.
603
+ */
604
+ interface AgentConsumption {
605
+ /** Agent ID (GUID) */
606
+ agentId: string;
607
+ /** Agent display name */
608
+ agentName: string;
609
+ /** Total quantity consumed by this agent. `null` if no consumption is recorded. */
610
+ consumedQuantity: number | null;
611
+ /** Agent Units quantity consumed. `null` if no consumption is recorded. */
612
+ consumedAGUQuantity: number | null;
613
+ /** Platform Units quantity consumed. `null` if no consumption is recorded. */
614
+ consumedPLTUQuantity: number | null;
615
+ /** First job in the window where this agent recorded consumption */
616
+ firstSeenJob: AgentJobInfo;
617
+ /** Last job in the window where this agent recorded consumption */
618
+ lastSeenJob: AgentJobInfo;
619
+ }
620
+ /**
621
+ * Response from getting the top agents by consumption.
622
+ */
623
+ interface AgentGetTopConsumptionResponse {
624
+ /** Window start date. */
625
+ startDate: string;
626
+ /** Window end date. */
627
+ endDate: string;
628
+ /** Total quantity consumed across all matching agents in the window. */
629
+ totalConsumed: number;
630
+ /** Total Agent Units quantity consumed. */
631
+ totalAGUConsumed: number;
632
+ /** Total Platform Units quantity consumed. */
633
+ totalPLTUConsumed: number;
634
+ /** Limit applied (echoed from the request). */
635
+ limit: number;
636
+ /** Top-N agents ranked by consumption. Empty array when no agents matched. */
637
+ agents: AgentConsumption[];
638
+ }
639
+ /**
640
+ * Options for getting the top agents by consumption.
641
+ */
642
+ interface AgentGetTopConsumptionOptions extends AgentFilterOptions {
643
+ /**
644
+ * Max number of agents to return. Defaults to 10 server-side.
645
+ * @default 10
646
+ */
647
+ limit?: number;
648
+ /**
649
+ * Health-based filter. `true` returns only healthy agents, `false` only
650
+ * unhealthy. Omit to include both.
651
+ */
652
+ healthy?: boolean;
653
+ /**
654
+ * Health-score cutoff used when `healthy` is set. Defaults to 75.0
655
+ * server-side.
656
+ * @default 75.0
657
+ */
658
+ healthThreshold?: number;
659
+ /**
660
+ * Filter to specific agent types. Multiple types are combined with `OR` and
661
+ * sent to the API as a comma-separated string.
662
+ */
663
+ agentTypes?: AgentType[];
664
+ }
665
+ /**
666
+ * Distribution of incidents across types over the requested window.
667
+ */
668
+ interface AgentGetIncidentDistributionResponse {
669
+ /** Number of error-type incidents in the window */
670
+ errorCount: number;
671
+ /** Number of escalation-type incidents in the window */
672
+ escalationCount: number;
673
+ /** Number of policy-type incidents in the window */
674
+ policyCount: number;
675
+ }
676
+ /**
677
+ * Options for getting the incident distribution.
678
+ *
679
+ * Currently identical to {@link AgentFilterOptions}; named distinctly so that
680
+ * future per-method filters can be added without a breaking change.
681
+ */
682
+ interface AgentGetIncidentDistributionOptions extends AgentFilterOptions {
683
+ }
684
+ /**
685
+ * Per-agent (process + folder) stats within an {@link AgentSummaryPeriod}.
686
+ */
687
+ interface AgentSummaryEntry {
688
+ /** Process key (GUID) */
689
+ processKey: string;
690
+ /** Folder key (GUID) the agent ran in */
691
+ folderKey: string;
692
+ /** Process version */
693
+ processVersion: string;
694
+ /** Total job runs in the period */
695
+ totalJobs: number;
696
+ /** Number of successful runs in the period */
697
+ successfulJobs: number;
698
+ /** Success rate as a percentage (0-100) */
699
+ successRate: number;
700
+ /** Average run duration in seconds */
701
+ averageDurationSeconds: number;
702
+ /** First job completion timestamp (ISO 8601, UTC) */
703
+ firstJobFinished: string;
704
+ /** Last job completion timestamp (ISO 8601, UTC) */
705
+ lastJobFinished: string;
706
+ /**
707
+ * Status of the most recent run, normalized to {@link JobState}. The API's
708
+ * `Success` label maps to {@link JobState.Successful}; any unrecognized value
709
+ * becomes {@link JobState.Unknown}.
710
+ */
711
+ lastJobStatus: JobState;
712
+ }
713
+ /**
714
+ * Aggregate stats for a single period within an {@link AgentGetSummaryResponse}
715
+ * — covers the requested window for either the current period or an optional
716
+ * lookback period.
717
+ */
718
+ interface AgentSummaryPeriod {
719
+ /** Total job runs across all agents in the period */
720
+ totalJobs: number;
721
+ /** Number of successful runs across all agents in the period */
722
+ successfulJobs: number;
723
+ /** Overall success rate as a percentage (0-100) */
724
+ successRate: number;
725
+ /** Average run duration in seconds across all agents in the period */
726
+ averageDurationSeconds: number;
727
+ /** Period start time (ISO 8601, UTC) */
728
+ startTime: string;
729
+ /** Period end time (ISO 8601, UTC) */
730
+ endTime: string;
731
+ /** Per-agent breakdown */
732
+ agents: AgentSummaryEntry[];
733
+ }
734
+ /**
735
+ * Response from getting the agent summary.
736
+ */
737
+ interface AgentGetSummaryResponse {
738
+ /** Aggregate stats for the requested window. Always present. */
739
+ currentPeriodSummary: AgentSummaryPeriod;
740
+ /** Aggregate stats for the prior window of equal length. Only present when `lookbackPeriodAnalysis: true` was sent. */
741
+ lookbackPeriodSummary?: AgentSummaryPeriod;
742
+ }
743
+ /**
744
+ * Job execution mode filter accepted by the summary endpoints.
745
+ *
746
+ * Wire format is the string name (`"Debug"` / `"Runtime"`), per the API's
747
+ * `StringEnumConverter` serialization.
748
+ */
749
+ declare enum AgentExecutionType {
750
+ /** Test runs */
751
+ Debug = "Debug",
752
+ /** Production runs */
753
+ Runtime = "Runtime"
754
+ }
755
+ /**
756
+ * Options for getting the agent summary.
757
+ */
758
+ interface AgentGetSummaryOptions extends AgentFilterOptions {
759
+ /**
760
+ * When `true`, it also computes a `lookbackPeriodSummary` for the
761
+ * prior window of equal length. Defaults to `false` server-side.
762
+ * @default false
763
+ */
764
+ lookbackPeriodAnalysis?: boolean;
765
+ /** Filter to a specific process by key (GUID). */
766
+ processKey?: string;
767
+ /**
768
+ * Filter to a specific folder by key (GUID).
769
+ *
770
+ * The summary endpoint accepts both — `folderKey` selects a
771
+ * single folder, `folderKeys` filters the lookup to a list of folders.
772
+ */
773
+ folderKey?: string;
774
+ /**
775
+ * Filter to a specific execution type — `Debug` (test runs) or
776
+ * `Runtime` (production runs).
777
+ */
778
+ executionType?: AgentExecutionType;
779
+ }
780
+ /**
781
+ * Job-type breakdown of unit consumption — completed jobs vs jobs still in
782
+ * progress at query time.
783
+ */
784
+ interface AgentJobConsumptionSummary {
785
+ /** Units consumed by jobs that have completed in the period */
786
+ completeJobs: number;
787
+ /** Units consumed by jobs still in progress at query time */
788
+ incompleteJobs: number;
789
+ }
790
+ /**
791
+ * Per-agent (process + folder) unit consumption entry within an
792
+ * {@link AgentUnitConsumptionPeriod}.
793
+ */
794
+ interface AgentUnitConsumptionEntry {
795
+ /** Folder key (GUID) the agent ran in */
796
+ folderKey: string;
797
+ /** Process key (GUID) */
798
+ processKey: string;
799
+ /** Process version */
800
+ processVersion: string;
801
+ /** First job completion timestamp (ISO 8601). `"0001-01-01T00:00:00"` if no completion in the period. */
802
+ firstJobFinished: string;
803
+ /** Last job completion timestamp (ISO 8601). `"0001-01-01T00:00:00"` if no completion in the period. */
804
+ lastJobFinished: string;
805
+ /** Agent Units consumption for this agent, split by job completion status */
806
+ agentUnitConsumption: AgentJobConsumptionSummary;
807
+ /** Platform Units consumption for this agent, split by job completion status */
808
+ platformUnitConsumption: AgentJobConsumptionSummary;
809
+ }
810
+ /**
811
+ * Aggregate Agent Units and Platform Units consumption for a single period within an
812
+ * {@link AgentGetUnitConsumptionSummaryResponse} — covers the requested window
813
+ * for either the current period or an optional lookback period.
814
+ */
815
+ interface AgentUnitConsumptionPeriod {
816
+ /** Total Agent Units consumed across all agents in the period, split by job completion */
817
+ totalAgentUnitConsumption: AgentJobConsumptionSummary;
818
+ /** Total Platform Units consumed across all agents in the period, split by job completion */
819
+ totalPlatformUnitConsumption: AgentJobConsumptionSummary;
820
+ /** Period start time (ISO 8601, UTC) */
821
+ startTime: string;
822
+ /** Period end time (ISO 8601, UTC) */
823
+ endTime: string;
824
+ /** Per-agent consumption breakdown */
825
+ agentConsumption: AgentUnitConsumptionEntry[];
826
+ }
827
+ /**
828
+ * Response from getting the agent unit consumption summary.
829
+ */
830
+ interface AgentGetUnitConsumptionSummaryResponse {
831
+ /** Aggregate consumption for the requested window. Always present. */
832
+ currentPeriodSummary: AgentUnitConsumptionPeriod;
833
+ /** Aggregate consumption for the prior window of equal length. Only present when `lookbackPeriodAnalysis: true` was sent. */
834
+ lookbackPeriodSummary?: AgentUnitConsumptionPeriod;
835
+ }
836
+ /**
837
+ * Options for getting the agent unit consumption summary.
838
+ *
839
+ * Currently identical to {@link AgentGetSummaryOptions} (the API uses the same
840
+ * `AgentsSummaryRequest` schema for both endpoints); named distinctly so that
841
+ * future per-method filters can be added without a breaking change.
842
+ */
843
+ interface AgentGetUnitConsumptionSummaryOptions extends AgentGetSummaryOptions {
844
+ }
528
845
 
529
846
  /**
530
847
  * Service for retrieving runtime data for UiPath Agents.
@@ -666,7 +983,7 @@ interface AgentServiceModel {
666
983
  */
667
984
  getErrorsTimeline(startTime: Date, endTime: Date, options?: AgentGetErrorsTimelineOptions): Promise<AgentGetErrorsTimelineResponse[]>;
668
985
  /**
669
- * Retrieves a time-series of AGU (Agent Units) consumption over the requested window.
986
+ * Retrieves a time-series of Agent Units consumption over the requested window.
670
987
  *
671
988
  * @param startTime - Inclusive lower bound for the query window
672
989
  * @param endTime - Exclusive upper bound for the query window
@@ -678,13 +995,13 @@ interface AgentServiceModel {
678
995
  *
679
996
  * const agents = new Agents(sdk);
680
997
  *
681
- * // AGU consumption timeline in May 2025
998
+ * // Agent Units consumption timeline in May 2025
682
999
  * const result = await agents.getConsumptionTimeline(
683
1000
  * new Date('2025-05-01T00:00:00Z'),
684
1001
  * new Date('2025-06-01T00:00:00Z'),
685
1002
  * );
686
1003
  * result.forEach((point) => {
687
- * console.log(`${point.timeSlice}: ${point.aguConsumption} AGU`);
1004
+ * console.log(`${point.timeSlice}: ${point.aguConsumption} Agent Units`);
688
1005
  * });
689
1006
  * ```
690
1007
  * @example
@@ -738,6 +1055,198 @@ interface AgentServiceModel {
738
1055
  * ```
739
1056
  */
740
1057
  getLatencyTimeline(startTime: Date, endTime: Date, options?: AgentGetLatencyTimelineOptions): Promise<AgentGetLatencyTimelineResponse[]>;
1058
+ /**
1059
+ * Retrieves the top-N agents ranked by error count over the requested window.
1060
+ *
1061
+ * @param startTime - Inclusive lower bound for the query window
1062
+ * @param endTime - Exclusive upper bound for the query window
1063
+ * @param options - Optional filters
1064
+ * @returns Promise resolving to {@link AgentGetTopErrorCountResponse}
1065
+ * @example
1066
+ * ```typescript
1067
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1068
+ *
1069
+ * const agents = new Agents(sdk);
1070
+ *
1071
+ * // Top agents by error count in May 2025
1072
+ * const result = await agents.getTopErrorCount(
1073
+ * new Date('2025-05-01T00:00:00Z'),
1074
+ * new Date('2025-06-01T00:00:00Z'),
1075
+ * );
1076
+ * result.data.forEach((agent) => {
1077
+ * console.log(`${agent.name}: ${agent.count} errors`);
1078
+ * });
1079
+ * ```
1080
+ * @example
1081
+ * ```typescript
1082
+ * // Scope to specific folders and top 5 agents
1083
+ * const result = await agents.getTopErrorCount(
1084
+ * new Date('2025-05-01T00:00:00Z'),
1085
+ * new Date('2025-06-01T00:00:00Z'),
1086
+ * {
1087
+ * folderKeys: ['<folderKey1>'],
1088
+ * limit: 5,
1089
+ * },
1090
+ * );
1091
+ * ```
1092
+ */
1093
+ getTopErrorCount(startTime: Date, endTime: Date, options?: AgentGetTopErrorCountOptions): Promise<AgentGetTopErrorCountResponse>;
1094
+ /**
1095
+ * Retrieves the top-N agents ranked by unit consumption over the requested window.
1096
+ *
1097
+ * @param startTime - Inclusive lower bound for the query window
1098
+ * @param endTime - Exclusive upper bound for the query window
1099
+ * @param options - Optional filters
1100
+ * @returns Promise resolving to {@link AgentGetTopConsumptionResponse}
1101
+ * @example
1102
+ * ```typescript
1103
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1104
+ *
1105
+ * const agents = new Agents(sdk);
1106
+ *
1107
+ * // Top agents by consumption in May 2025
1108
+ * const result = await agents.getTopConsumption(
1109
+ * new Date('2025-05-01T00:00:00Z'),
1110
+ * new Date('2025-06-01T00:00:00Z'),
1111
+ * );
1112
+ * console.log(`Total consumed: ${result.totalConsumed}`);
1113
+ * result.agents.forEach((agent) => {
1114
+ * console.log(`${agent.agentName}: ${agent.consumedQuantity}`);
1115
+ * });
1116
+ * ```
1117
+ * @example
1118
+ * ```typescript
1119
+ * import { Agents, AgentType } from '@uipath/uipath-typescript/agents';
1120
+ *
1121
+ * const agents = new Agents(sdk);
1122
+ *
1123
+ * // Top 5 healthy autonomous agents by consumption
1124
+ * const result = await agents.getTopConsumption(
1125
+ * new Date('2025-05-01T00:00:00Z'),
1126
+ * new Date('2025-06-01T00:00:00Z'),
1127
+ * {
1128
+ * limit: 5,
1129
+ * healthy: true,
1130
+ * agentTypes: [AgentType.Autonomous],
1131
+ * },
1132
+ * );
1133
+ * ```
1134
+ */
1135
+ getTopConsumption(startTime: Date, endTime: Date, options?: AgentGetTopConsumptionOptions): Promise<AgentGetTopConsumptionResponse>;
1136
+ /**
1137
+ * Retrieves breakdown of agent incidents count — errors, escalations,
1138
+ * and policy violations over a requested window.
1139
+ *
1140
+ * @param startTime - Inclusive lower bound for the query window
1141
+ * @param endTime - Exclusive upper bound for the query window
1142
+ * @param options - Optional filters
1143
+ * @returns Promise resolving to {@link AgentGetIncidentDistributionResponse}
1144
+ * @example
1145
+ * ```typescript
1146
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1147
+ *
1148
+ * const agents = new Agents(sdk);
1149
+ *
1150
+ * // Incident distribution in May 2025
1151
+ * const result = await agents.getIncidentDistribution(
1152
+ * new Date('2025-05-01T00:00:00Z'),
1153
+ * new Date('2025-06-01T00:00:00Z'),
1154
+ * );
1155
+ * console.log(`Errors: ${result.errorCount}, Escalations: ${result.escalationCount}, Policy: ${result.policyCount}`);
1156
+ * ```
1157
+ * @example
1158
+ * ```typescript
1159
+ * // Scope to specific folders
1160
+ * const result = await agents.getIncidentDistribution(
1161
+ * new Date('2025-05-01T00:00:00Z'),
1162
+ * new Date('2025-06-01T00:00:00Z'),
1163
+ * {
1164
+ * folderKeys: ['<folderKey1>'],
1165
+ * },
1166
+ * );
1167
+ * ```
1168
+ */
1169
+ getIncidentDistribution(startTime: Date, endTime: Date, options?: AgentGetIncidentDistributionOptions): Promise<AgentGetIncidentDistributionResponse>;
1170
+ /**
1171
+ * Retrieves a job-execution summary for the requested window: overall totals
1172
+ * (total jobs, successful jobs, success rate, average duration) alongside a
1173
+ * per-agent breakdown. When `lookbackPeriodAnalysis` is enabled, a comparable
1174
+ * summary for the preceding window of equal length is included too.
1175
+ *
1176
+ * @param startTime - Inclusive lower bound for the query window
1177
+ * @param endTime - Exclusive upper bound for the query window
1178
+ * @param options - Optional filters
1179
+ * @returns Promise resolving to {@link AgentGetSummaryResponse}
1180
+ * @example
1181
+ * ```typescript
1182
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1183
+ *
1184
+ * const agents = new Agents(sdk);
1185
+ *
1186
+ * // Summary for May 2025
1187
+ * const result = await agents.getSummary(
1188
+ * new Date('2025-05-01T00:00:00Z'),
1189
+ * new Date('2025-06-01T00:00:00Z'),
1190
+ * );
1191
+ * console.log(`Success rate: ${result.currentPeriodSummary.successRate}%`);
1192
+ * ```
1193
+ * @example
1194
+ * ```typescript
1195
+ * import { Agents, AgentExecutionType } from '@uipath/uipath-typescript/agents';
1196
+ *
1197
+ * const agents = new Agents(sdk);
1198
+ *
1199
+ * // Runtime-only summary with lookback comparison
1200
+ * const result = await agents.getSummary(
1201
+ * new Date('2025-05-01T00:00:00Z'),
1202
+ * new Date('2025-06-01T00:00:00Z'),
1203
+ * {
1204
+ * lookbackPeriodAnalysis: true,
1205
+ * executionType: AgentExecutionType.Runtime,
1206
+ * },
1207
+ * );
1208
+ * ```
1209
+ */
1210
+ getSummary(startTime: Date, endTime: Date, options?: AgentGetSummaryOptions): Promise<AgentGetSummaryResponse>;
1211
+ /**
1212
+ * Retrieves an aggregate Agent Units and Platform Units consumption summary per agent over the
1213
+ * requested window.
1214
+ *
1215
+ * @param startTime - Inclusive lower bound for the query window
1216
+ * @param endTime - Exclusive upper bound for the query window
1217
+ * @param options - Optional filters
1218
+ * @returns Promise resolving to {@link AgentGetUnitConsumptionSummaryResponse}
1219
+ * @example
1220
+ * ```typescript
1221
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1222
+ *
1223
+ * const agents = new Agents(sdk);
1224
+ *
1225
+ * // Unit consumption summary for May 2025
1226
+ * const result = await agents.getUnitConsumptionSummary(
1227
+ * new Date('2025-05-01T00:00:00Z'),
1228
+ * new Date('2025-06-01T00:00:00Z'),
1229
+ * );
1230
+ * console.log(`Agent Units complete jobs: ${result.currentPeriodSummary.totalAgentUnitConsumption.completeJobs}`);
1231
+ * ```
1232
+ * @example
1233
+ * ```typescript
1234
+ * import { Agents, AgentExecutionType } from '@uipath/uipath-typescript/agents';
1235
+ *
1236
+ * const agents = new Agents(sdk);
1237
+ *
1238
+ * // Runtime-only summary with lookback comparison
1239
+ * const result = await agents.getUnitConsumptionSummary(
1240
+ * new Date('2025-05-01T00:00:00Z'),
1241
+ * new Date('2025-06-01T00:00:00Z'),
1242
+ * {
1243
+ * lookbackPeriodAnalysis: true,
1244
+ * executionType: AgentExecutionType.Runtime,
1245
+ * },
1246
+ * );
1247
+ * ```
1248
+ */
1249
+ getUnitConsumptionSummary(startTime: Date, endTime: Date, options?: AgentGetUnitConsumptionSummaryOptions): Promise<AgentGetUnitConsumptionSummaryResponse>;
741
1250
  }
742
1251
 
743
1252
  /**
@@ -877,7 +1386,7 @@ declare class AgentService extends BaseService implements AgentServiceModel {
877
1386
  */
878
1387
  getErrorsTimeline(startTime: Date, endTime: Date, options?: AgentGetErrorsTimelineOptions): Promise<AgentGetErrorsTimelineResponse[]>;
879
1388
  /**
880
- * Retrieves a time-series of AGU (Agent Units) consumption over the requested window.
1389
+ * Retrieves a time-series of Agent Units consumption over the requested window.
881
1390
  *
882
1391
  * @param startTime - Inclusive lower bound for the query window
883
1392
  * @param endTime - Exclusive upper bound for the query window
@@ -889,13 +1398,13 @@ declare class AgentService extends BaseService implements AgentServiceModel {
889
1398
  *
890
1399
  * const agents = new Agents(sdk);
891
1400
  *
892
- * // AGU consumption timeline in May 2025
1401
+ * // Agent Units consumption timeline in May 2025
893
1402
  * const result = await agents.getConsumptionTimeline(
894
1403
  * new Date('2025-05-01T00:00:00Z'),
895
1404
  * new Date('2025-06-01T00:00:00Z'),
896
1405
  * );
897
1406
  * result.forEach((point) => {
898
- * console.log(`${point.timeSlice}: ${point.aguConsumption} AGU`);
1407
+ * console.log(`${point.timeSlice}: ${point.aguConsumption} Agent Units`);
899
1408
  * });
900
1409
  * ```
901
1410
  * @example
@@ -949,6 +1458,198 @@ declare class AgentService extends BaseService implements AgentServiceModel {
949
1458
  * ```
950
1459
  */
951
1460
  getLatencyTimeline(startTime: Date, endTime: Date, options?: AgentGetLatencyTimelineOptions): Promise<AgentGetLatencyTimelineResponse[]>;
1461
+ /**
1462
+ * Retrieves the top-N agents ranked by error count over the requested window.
1463
+ *
1464
+ * @param startTime - Inclusive lower bound for the query window
1465
+ * @param endTime - Exclusive upper bound for the query window
1466
+ * @param options - Optional filters
1467
+ * @returns Promise resolving to {@link AgentGetTopErrorCountResponse}
1468
+ * @example
1469
+ * ```typescript
1470
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1471
+ *
1472
+ * const agents = new Agents(sdk);
1473
+ *
1474
+ * // Top agents by error count in May 2025
1475
+ * const result = await agents.getTopErrorCount(
1476
+ * new Date('2025-05-01T00:00:00Z'),
1477
+ * new Date('2025-06-01T00:00:00Z'),
1478
+ * );
1479
+ * result.data.forEach((agent) => {
1480
+ * console.log(`${agent.name}: ${agent.count} errors`);
1481
+ * });
1482
+ * ```
1483
+ * @example
1484
+ * ```typescript
1485
+ * // Scope to specific folders and top 5 agents
1486
+ * const result = await agents.getTopErrorCount(
1487
+ * new Date('2025-05-01T00:00:00Z'),
1488
+ * new Date('2025-06-01T00:00:00Z'),
1489
+ * {
1490
+ * folderKeys: ['<folderKey1>'],
1491
+ * limit: 5,
1492
+ * },
1493
+ * );
1494
+ * ```
1495
+ */
1496
+ getTopErrorCount(startTime: Date, endTime: Date, options?: AgentGetTopErrorCountOptions): Promise<AgentGetTopErrorCountResponse>;
1497
+ /**
1498
+ * Retrieves the top-N agents ranked by unit consumption over the requested window.
1499
+ *
1500
+ * @param startTime - Inclusive lower bound for the query window
1501
+ * @param endTime - Exclusive upper bound for the query window
1502
+ * @param options - Optional filters
1503
+ * @returns Promise resolving to {@link AgentGetTopConsumptionResponse}
1504
+ * @example
1505
+ * ```typescript
1506
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1507
+ *
1508
+ * const agents = new Agents(sdk);
1509
+ *
1510
+ * // Top agents by consumption in May 2025
1511
+ * const result = await agents.getTopConsumption(
1512
+ * new Date('2025-05-01T00:00:00Z'),
1513
+ * new Date('2025-06-01T00:00:00Z'),
1514
+ * );
1515
+ * console.log(`Total consumed: ${result.totalConsumed}`);
1516
+ * result.agents.forEach((agent) => {
1517
+ * console.log(`${agent.agentName}: ${agent.consumedQuantity}`);
1518
+ * });
1519
+ * ```
1520
+ * @example
1521
+ * ```typescript
1522
+ * import { Agents, AgentType } from '@uipath/uipath-typescript/agents';
1523
+ *
1524
+ * const agents = new Agents(sdk);
1525
+ *
1526
+ * // Top 5 healthy autonomous agents by consumption
1527
+ * const result = await agents.getTopConsumption(
1528
+ * new Date('2025-05-01T00:00:00Z'),
1529
+ * new Date('2025-06-01T00:00:00Z'),
1530
+ * {
1531
+ * limit: 5,
1532
+ * healthy: true,
1533
+ * agentTypes: [AgentType.Autonomous],
1534
+ * },
1535
+ * );
1536
+ * ```
1537
+ */
1538
+ getTopConsumption(startTime: Date, endTime: Date, options?: AgentGetTopConsumptionOptions): Promise<AgentGetTopConsumptionResponse>;
1539
+ /**
1540
+ * Retrieves breakdown of agent incidents count — errors, escalations,
1541
+ * and policy violations over a requested window.
1542
+ *
1543
+ * @param startTime - Inclusive lower bound for the query window
1544
+ * @param endTime - Exclusive upper bound for the query window
1545
+ * @param options - Optional filters
1546
+ * @returns Promise resolving to {@link AgentGetIncidentDistributionResponse}
1547
+ * @example
1548
+ * ```typescript
1549
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1550
+ *
1551
+ * const agents = new Agents(sdk);
1552
+ *
1553
+ * // Incident distribution in May 2025
1554
+ * const result = await agents.getIncidentDistribution(
1555
+ * new Date('2025-05-01T00:00:00Z'),
1556
+ * new Date('2025-06-01T00:00:00Z'),
1557
+ * );
1558
+ * console.log(`Errors: ${result.errorCount}, Escalations: ${result.escalationCount}, Policy: ${result.policyCount}`);
1559
+ * ```
1560
+ * @example
1561
+ * ```typescript
1562
+ * // Scope to specific folders
1563
+ * const result = await agents.getIncidentDistribution(
1564
+ * new Date('2025-05-01T00:00:00Z'),
1565
+ * new Date('2025-06-01T00:00:00Z'),
1566
+ * {
1567
+ * folderKeys: ['<folderKey1>'],
1568
+ * },
1569
+ * );
1570
+ * ```
1571
+ */
1572
+ getIncidentDistribution(startTime: Date, endTime: Date, options?: AgentGetIncidentDistributionOptions): Promise<AgentGetIncidentDistributionResponse>;
1573
+ /**
1574
+ * Retrieves a job-execution summary for the requested window: overall totals
1575
+ * (total jobs, successful jobs, success rate, average duration) alongside a
1576
+ * per-agent breakdown. When `lookbackPeriodAnalysis` is enabled, a comparable
1577
+ * summary for the preceding window of equal length is included too.
1578
+ *
1579
+ * @param startTime - Inclusive lower bound for the query window
1580
+ * @param endTime - Exclusive upper bound for the query window
1581
+ * @param options - Optional filters
1582
+ * @returns Promise resolving to {@link AgentGetSummaryResponse}
1583
+ * @example
1584
+ * ```typescript
1585
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1586
+ *
1587
+ * const agents = new Agents(sdk);
1588
+ *
1589
+ * // Summary for May 2025
1590
+ * const result = await agents.getSummary(
1591
+ * new Date('2025-05-01T00:00:00Z'),
1592
+ * new Date('2025-06-01T00:00:00Z'),
1593
+ * );
1594
+ * console.log(`Success rate: ${result.currentPeriodSummary.successRate}%`);
1595
+ * ```
1596
+ * @example
1597
+ * ```typescript
1598
+ * import { Agents, AgentExecutionType } from '@uipath/uipath-typescript/agents';
1599
+ *
1600
+ * const agents = new Agents(sdk);
1601
+ *
1602
+ * // Runtime-only summary with lookback comparison
1603
+ * const result = await agents.getSummary(
1604
+ * new Date('2025-05-01T00:00:00Z'),
1605
+ * new Date('2025-06-01T00:00:00Z'),
1606
+ * {
1607
+ * lookbackPeriodAnalysis: true,
1608
+ * executionType: AgentExecutionType.Runtime,
1609
+ * },
1610
+ * );
1611
+ * ```
1612
+ */
1613
+ getSummary(startTime: Date, endTime: Date, options?: AgentGetSummaryOptions): Promise<AgentGetSummaryResponse>;
1614
+ /**
1615
+ * Retrieves an aggregate Agent Units and Platform Units consumption summary per agent over the
1616
+ * requested window.
1617
+ *
1618
+ * @param startTime - Inclusive lower bound for the query window
1619
+ * @param endTime - Exclusive upper bound for the query window
1620
+ * @param options - Optional filters
1621
+ * @returns Promise resolving to {@link AgentGetUnitConsumptionSummaryResponse}
1622
+ * @example
1623
+ * ```typescript
1624
+ * import { Agents } from '@uipath/uipath-typescript/agents';
1625
+ *
1626
+ * const agents = new Agents(sdk);
1627
+ *
1628
+ * // Unit consumption summary for May 2025
1629
+ * const result = await agents.getUnitConsumptionSummary(
1630
+ * new Date('2025-05-01T00:00:00Z'),
1631
+ * new Date('2025-06-01T00:00:00Z'),
1632
+ * );
1633
+ * console.log(`Agent Units complete jobs: ${result.currentPeriodSummary.totalAgentUnitConsumption.completeJobs}`);
1634
+ * ```
1635
+ * @example
1636
+ * ```typescript
1637
+ * import { Agents, AgentExecutionType } from '@uipath/uipath-typescript/agents';
1638
+ *
1639
+ * const agents = new Agents(sdk);
1640
+ *
1641
+ * // Runtime-only summary with lookback comparison
1642
+ * const result = await agents.getUnitConsumptionSummary(
1643
+ * new Date('2025-05-01T00:00:00Z'),
1644
+ * new Date('2025-06-01T00:00:00Z'),
1645
+ * {
1646
+ * lookbackPeriodAnalysis: true,
1647
+ * executionType: AgentExecutionType.Runtime,
1648
+ * },
1649
+ * );
1650
+ * ```
1651
+ */
1652
+ getUnitConsumptionSummary(startTime: Date, endTime: Date, options?: AgentGetUnitConsumptionSummaryOptions): Promise<AgentGetUnitConsumptionSummaryResponse>;
952
1653
  /**
953
1654
  * Builds the common POST request body shared by the agent filter endpoints —
954
1655
  * the required time window plus any optional folder/agent/project/process
@@ -957,5 +1658,5 @@ declare class AgentService extends BaseService implements AgentServiceModel {
957
1658
  private buildAgentFilterBody;
958
1659
  }
959
1660
 
960
- export { AgentErrorSortColumn, AgentListSortColumn, AgentService as Agents };
961
- export type { AgentError, AgentErrorOrderBy, AgentFilterOptions, AgentGetAllOptions, AgentGetConsumptionTimelineOptions, AgentGetConsumptionTimelineResponse, AgentGetErrorsOptions, AgentGetErrorsTimelineOptions, AgentGetErrorsTimelineResponse, AgentGetLatencyTimelineOptions, AgentGetLatencyTimelineResponse, AgentJobInfo, AgentListItem, AgentListOrderBy, AgentServiceModel };
1661
+ export { AgentErrorSortColumn, AgentExecutionType, AgentListSortColumn, AgentType, AgentService as Agents };
1662
+ export type { AgentConsumption, AgentError, AgentErrorOrderBy, AgentFilterOptions, AgentGetAllOptions, AgentGetConsumptionTimelineOptions, AgentGetConsumptionTimelineResponse, AgentGetErrorsOptions, AgentGetErrorsTimelineOptions, AgentGetErrorsTimelineResponse, AgentGetIncidentDistributionOptions, AgentGetIncidentDistributionResponse, AgentGetLatencyTimelineOptions, AgentGetLatencyTimelineResponse, AgentGetSummaryOptions, AgentGetSummaryResponse, AgentGetTopConsumptionOptions, AgentGetTopConsumptionResponse, AgentGetTopErrorCountOptions, AgentGetTopErrorCountResponse, AgentGetUnitConsumptionSummaryOptions, AgentGetUnitConsumptionSummaryResponse, AgentJobConsumptionSummary, AgentJobInfo, AgentListItem, AgentListOrderBy, AgentServiceModel, AgentSummaryEntry, AgentSummaryPeriod, AgentTopErrorCount, AgentUnitConsumptionEntry, AgentUnitConsumptionPeriod };