@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.
- package/README.md +7 -1
- package/dist/agent-memory/index.d.ts +4 -1
- package/dist/agents/index.cjs +341 -6
- package/dist/agents/index.d.ts +717 -16
- package/dist/agents/index.mjs +342 -7
- package/dist/assets/index.cjs +132 -15
- package/dist/assets/index.d.ts +12 -1
- package/dist/assets/index.mjs +132 -15
- package/dist/attachments/index.cjs +120 -12
- package/dist/attachments/index.mjs +120 -12
- package/dist/buckets/index.cjs +136 -15
- package/dist/buckets/index.d.ts +12 -1
- package/dist/buckets/index.mjs +136 -15
- package/dist/cases/index.cjs +1203 -938
- package/dist/cases/index.d.ts +325 -45
- package/dist/cases/index.mjs +1203 -938
- package/dist/conversational-agent/index.cjs +48 -10
- package/dist/conversational-agent/index.d.ts +117 -6
- package/dist/conversational-agent/index.mjs +48 -10
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/entities/index.cjs +448 -9
- package/dist/entities/index.d.ts +441 -1
- package/dist/entities/index.mjs +447 -10
- package/dist/feedback/index.cjs +25 -9
- package/dist/feedback/index.mjs +25 -9
- package/dist/index.cjs +1281 -330
- package/dist/index.d.ts +1988 -143
- package/dist/index.mjs +1282 -331
- package/dist/index.umd.js +1230 -279
- package/dist/jobs/index.cjs +141 -19
- package/dist/jobs/index.d.ts +22 -6
- package/dist/jobs/index.mjs +141 -19
- package/dist/maestro-processes/index.cjs +553 -354
- package/dist/maestro-processes/index.d.ts +376 -47
- package/dist/maestro-processes/index.mjs +553 -354
- package/dist/notifications/index.cjs +2012 -0
- package/dist/notifications/index.d.ts +615 -0
- package/dist/notifications/index.mjs +2010 -0
- package/dist/processes/index.cjs +118 -18
- package/dist/processes/index.d.ts +18 -2
- package/dist/processes/index.mjs +118 -18
- package/dist/queues/index.cjs +131 -14
- package/dist/queues/index.d.ts +12 -1
- package/dist/queues/index.mjs +131 -14
- package/dist/tasks/index.cjs +125 -13
- package/dist/tasks/index.d.ts +4 -1
- package/dist/tasks/index.mjs +125 -13
- package/dist/traces/index.cjs +220 -6
- package/dist/traces/index.d.ts +360 -25
- package/dist/traces/index.mjs +221 -7
- package/package.json +14 -4
package/dist/traces/index.d.ts
CHANGED
|
@@ -633,7 +633,7 @@ interface AgentTraceGetLatencyTimelineOptions extends AgentTraceFilterOptions {
|
|
|
633
633
|
}
|
|
634
634
|
/**
|
|
635
635
|
* Per-agent unit consumption totals over the requested window (trace-level) —
|
|
636
|
-
* a flat per-(agent, version, folder) breakdown of
|
|
636
|
+
* a flat per-(agent, version, folder) breakdown of Agent Units and Platform Units consumed.
|
|
637
637
|
*/
|
|
638
638
|
interface AgentTraceGetUnitConsumptionResponse {
|
|
639
639
|
/** Agent ID these totals belong to. */
|
|
@@ -674,33 +674,33 @@ interface AgentSpanGetResponse {
|
|
|
674
674
|
status: string;
|
|
675
675
|
/** Organization ID (GUID). */
|
|
676
676
|
organizationId: string;
|
|
677
|
-
/** Tenant ID (GUID).
|
|
677
|
+
/** Tenant ID (GUID). */
|
|
678
678
|
tenantId: string | null;
|
|
679
|
-
/** Span retention expiry time.
|
|
679
|
+
/** Span retention expiry time. */
|
|
680
680
|
expiredTime: string | null;
|
|
681
|
-
/** Folder key (GUID) the span was recorded in.
|
|
681
|
+
/** Folder key (GUID) the span was recorded in. */
|
|
682
682
|
folderKey: string | null;
|
|
683
|
-
/** Span source.
|
|
683
|
+
/** Span source. */
|
|
684
684
|
source: string | null;
|
|
685
|
-
/** Span type.
|
|
685
|
+
/** Span type. */
|
|
686
686
|
spanType: string | null;
|
|
687
|
-
/** Process key (GUID).
|
|
687
|
+
/** Process key (GUID). */
|
|
688
688
|
processKey: string | null;
|
|
689
|
-
/** Job key (GUID).
|
|
689
|
+
/** Job key (GUID). */
|
|
690
690
|
jobKey: string | null;
|
|
691
|
-
/** Reference ID (GUID).
|
|
691
|
+
/** Reference ID (GUID). */
|
|
692
692
|
referenceId: string | null;
|
|
693
|
-
/** Verbosity level.
|
|
693
|
+
/** Verbosity level. */
|
|
694
694
|
verbosityLevel: string | null;
|
|
695
695
|
/** Record last-updated time. */
|
|
696
696
|
updatedAt: string;
|
|
697
697
|
/** Whether the span payload is stored as a large payload. */
|
|
698
698
|
isLargePayload: boolean;
|
|
699
|
-
/** Payload compression type.
|
|
699
|
+
/** Payload compression type. */
|
|
700
700
|
compressionType: string | null;
|
|
701
|
-
/** Agent version that produced the span.
|
|
701
|
+
/** Agent version that produced the span. */
|
|
702
702
|
agentVersion: string | null;
|
|
703
|
-
/** Raw span context as a JSON string.
|
|
703
|
+
/** Raw span context as a JSON string. */
|
|
704
704
|
context: string | null;
|
|
705
705
|
}
|
|
706
706
|
/**
|
|
@@ -722,6 +722,153 @@ type AgentTraceGetSpansByReferenceOptions = PaginationOptions & {
|
|
|
722
722
|
/** Execution type filter */
|
|
723
723
|
executionType?: SpanExecutionType;
|
|
724
724
|
};
|
|
725
|
+
/**
|
|
726
|
+
* Evaluation mode of a governance decision.
|
|
727
|
+
*/
|
|
728
|
+
declare enum AgentGovernanceMode {
|
|
729
|
+
/** Policy evaluated and logged, but not enforced. */
|
|
730
|
+
Audit = "AUDIT",
|
|
731
|
+
/** Policy evaluated and enforced. */
|
|
732
|
+
Enforce = "ENFORCE",
|
|
733
|
+
/** Unrecognized or missing mode. */
|
|
734
|
+
Unknown = "Unknown"
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Verdict of a governance decision (`Deny` = violation).
|
|
738
|
+
*/
|
|
739
|
+
declare enum AgentGovernanceVerdict {
|
|
740
|
+
/** Allowed — not a violation. */
|
|
741
|
+
Allow = "ALLOW",
|
|
742
|
+
/** Denied — counts as a violation. */
|
|
743
|
+
Deny = "DENY",
|
|
744
|
+
/** Unrecognized or missing verdict. */
|
|
745
|
+
Unknown = "Unknown"
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* A single governance decision — one policy's allow/deny result for an agent run.
|
|
749
|
+
*/
|
|
750
|
+
interface AgentGovernanceDecisionGetResponse {
|
|
751
|
+
/** Tenant ID (GUID). */
|
|
752
|
+
tenantId: string | null;
|
|
753
|
+
/** Decision window start time — ISO 8601, UTC. */
|
|
754
|
+
startTime: string;
|
|
755
|
+
/** Decision window end time — ISO 8601, UTC. */
|
|
756
|
+
endTime: string | null;
|
|
757
|
+
/** Trace ID (GUID). */
|
|
758
|
+
traceId: string | null;
|
|
759
|
+
/** Job key (GUID). */
|
|
760
|
+
jobKey: string | null;
|
|
761
|
+
/** Folder key (GUID). */
|
|
762
|
+
folderKey: string | null;
|
|
763
|
+
/** Runtime the evaluator ran in (context, not a filter). */
|
|
764
|
+
source: string | null;
|
|
765
|
+
/** Policy ID. */
|
|
766
|
+
policyId: string | null;
|
|
767
|
+
/** Policy display name. */
|
|
768
|
+
policyName: string | null;
|
|
769
|
+
/** Governance pack name. */
|
|
770
|
+
packName: string | null;
|
|
771
|
+
/** Governance hook (e.g. `BEFORE_MODEL`). */
|
|
772
|
+
hook: string | null;
|
|
773
|
+
/** Evaluation mode, normalized to {@link AgentGovernanceMode} ({@link AgentGovernanceMode.Unknown} when missing/unrecognized). */
|
|
774
|
+
mode: AgentGovernanceMode;
|
|
775
|
+
/** Enforcement action applied. `null` in audit mode (no action enforced). */
|
|
776
|
+
actionApplied: string | null;
|
|
777
|
+
/** Verdict, normalized to {@link AgentGovernanceVerdict} (`Deny` = violation). */
|
|
778
|
+
evaluatorResult: AgentGovernanceVerdict;
|
|
779
|
+
/** Human-readable reason. */
|
|
780
|
+
reason: string | null;
|
|
781
|
+
/** Resolved agent ID (GUID). */
|
|
782
|
+
agentId: string | null;
|
|
783
|
+
/** Agent display name. */
|
|
784
|
+
agentName: string | null;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Options for the governance decisions query — optional filters plus pagination.
|
|
788
|
+
*/
|
|
789
|
+
type AgentGovernanceDecisionsOptions = PaginationOptions & {
|
|
790
|
+
/** Inclusive upper bound for the query window. Defaults to now when omitted. */
|
|
791
|
+
endTime?: Date;
|
|
792
|
+
/** Filter on the governance hook. */
|
|
793
|
+
hook?: string;
|
|
794
|
+
/** Filter on the verdict. */
|
|
795
|
+
evaluatorResult?: AgentGovernanceVerdict;
|
|
796
|
+
/** Filter on a single policy ID. */
|
|
797
|
+
policyId?: string;
|
|
798
|
+
/** Filter on a single agent by its project key. */
|
|
799
|
+
agentId?: string;
|
|
800
|
+
/** When `true`, restrict to violations (deny verdicts). */
|
|
801
|
+
violationsOnly?: boolean;
|
|
802
|
+
};
|
|
803
|
+
/**
|
|
804
|
+
* One breakdown entry in the governance summary — counts for a single key.
|
|
805
|
+
*/
|
|
806
|
+
interface AgentGovernanceCountItem {
|
|
807
|
+
/** The value this row groups by — the distinct hook, agent id, policy id, or pack name for this breakdown. */
|
|
808
|
+
key: string | null;
|
|
809
|
+
/** Display name (populated for the policy and agent breakdowns). */
|
|
810
|
+
name: string | null;
|
|
811
|
+
/** Number of decisions for this key. */
|
|
812
|
+
count: number;
|
|
813
|
+
/** Number of violations (deny verdicts) for this key. */
|
|
814
|
+
violationCount: number;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Sections the governance summary can compute. `action` and `mode` are opt-in.
|
|
818
|
+
*/
|
|
819
|
+
declare enum AgentGovernanceSection {
|
|
820
|
+
/** Scalar totals (`total`, `violations`). */
|
|
821
|
+
Totals = "totals",
|
|
822
|
+
/** Breakdown by governance hook. */
|
|
823
|
+
Hook = "hook",
|
|
824
|
+
/** Breakdown by agent. */
|
|
825
|
+
Agent = "agent",
|
|
826
|
+
/** Breakdown by policy. */
|
|
827
|
+
Policy = "policy",
|
|
828
|
+
/** Breakdown by governance pack. */
|
|
829
|
+
Pack = "pack",
|
|
830
|
+
/** Breakdown by enforcement action (opt-in). */
|
|
831
|
+
Action = "action",
|
|
832
|
+
/** Breakdown by evaluation mode (opt-in). */
|
|
833
|
+
Mode = "mode"
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Aggregated governance posture over the requested window.
|
|
837
|
+
*/
|
|
838
|
+
interface AgentGovernanceGetSummaryResponse {
|
|
839
|
+
/** Total decisions in the window. */
|
|
840
|
+
total: number;
|
|
841
|
+
/** Total violations (deny verdicts). */
|
|
842
|
+
violations: number;
|
|
843
|
+
/** Breakdown by governance hook. */
|
|
844
|
+
byHook: AgentGovernanceCountItem[];
|
|
845
|
+
/** Breakdown by agent. */
|
|
846
|
+
byAgent: AgentGovernanceCountItem[];
|
|
847
|
+
/** Breakdown by policy. */
|
|
848
|
+
byPolicy: AgentGovernanceCountItem[];
|
|
849
|
+
/** Breakdown by governance pack. */
|
|
850
|
+
byPack: AgentGovernanceCountItem[];
|
|
851
|
+
/** Breakdown by enforcement action. Empty unless `action` is requested in `sections`. */
|
|
852
|
+
byAction: AgentGovernanceCountItem[];
|
|
853
|
+
/** Breakdown by evaluation mode. Empty unless `mode` is requested in `sections`. */
|
|
854
|
+
byMode: AgentGovernanceCountItem[];
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Options for the governance summary.
|
|
858
|
+
*/
|
|
859
|
+
interface AgentGovernanceSummaryOptions {
|
|
860
|
+
/** Inclusive upper bound for the query window. Defaults to now when omitted. */
|
|
861
|
+
endTime?: Date;
|
|
862
|
+
/** Top-N size for each breakdown. */
|
|
863
|
+
topN?: number;
|
|
864
|
+
/** Restrict totals and breakdowns to a single governance pack. */
|
|
865
|
+
packName?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Which sections to compute. Omit for the default set
|
|
868
|
+
* (`totals`, `hook`, `agent`, `policy`, `pack`); `action` and `mode` are opt-in.
|
|
869
|
+
*/
|
|
870
|
+
sections?: AgentGovernanceSection[];
|
|
871
|
+
}
|
|
725
872
|
|
|
726
873
|
/**
|
|
727
874
|
* Service for retrieving UiPath Agent trace metrics.
|
|
@@ -805,7 +952,7 @@ interface AgentTracesServiceModel {
|
|
|
805
952
|
* // Get per-agent unit consumption
|
|
806
953
|
* const result = await trace.getUnitConsumption();
|
|
807
954
|
* result.forEach((row) => {
|
|
808
|
-
* console.log(`${row.agentId}: ${row.agentUnitsConsumed}
|
|
955
|
+
* console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
|
|
809
956
|
* });
|
|
810
957
|
* ```
|
|
811
958
|
* @example
|
|
@@ -844,10 +991,6 @@ interface AgentTracesServiceModel {
|
|
|
844
991
|
/**
|
|
845
992
|
* Retrieves spans whose reference hierarchy contains the given reference id.
|
|
846
993
|
*
|
|
847
|
-
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
848
|
-
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
849
|
-
* {@link NonPaginatedResponse}.
|
|
850
|
-
*
|
|
851
994
|
* @param referenceId - Reference id matched against each span's reference hierarchy
|
|
852
995
|
* @param options - Optional pagination and hierarchy/time filters
|
|
853
996
|
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentSpanGetResponse}
|
|
@@ -880,6 +1023,104 @@ interface AgentTracesServiceModel {
|
|
|
880
1023
|
* ```
|
|
881
1024
|
*/
|
|
882
1025
|
getSpansByReference<T extends AgentTraceGetSpansByReferenceOptions = AgentTraceGetSpansByReferenceOptions>(referenceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentSpanGetResponse> : NonPaginatedResponse<AgentSpanGetResponse>>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Lists individual governance decisions from agent execution traces — each
|
|
1028
|
+
* policy check's allow/deny outcome with its agent, policy, pack, hook, and
|
|
1029
|
+
* mode, plus the trace it belongs to — over the requested window. Filterable
|
|
1030
|
+
* and paginated.
|
|
1031
|
+
*
|
|
1032
|
+
* @remarks Requires the caller to be an organization admin. Non-admin callers get a `403` and the SDK throws an {@link AuthorizationError}.
|
|
1033
|
+
*
|
|
1034
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1035
|
+
* @param options - Optional window end, filters, and pagination
|
|
1036
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentGovernanceDecisionGetResponse}
|
|
1037
|
+
* @example
|
|
1038
|
+
* ```typescript
|
|
1039
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
1040
|
+
*
|
|
1041
|
+
* const trace = new AgentTraces(sdk);
|
|
1042
|
+
*
|
|
1043
|
+
* // Decision rows since a start time
|
|
1044
|
+
* const result = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'));
|
|
1045
|
+
* result.items.forEach((row) => {
|
|
1046
|
+
* console.log(`${row.hook} ${row.policyId}: ${row.evaluatorResult}`);
|
|
1047
|
+
* });
|
|
1048
|
+
* ```
|
|
1049
|
+
* @example
|
|
1050
|
+
* ```typescript
|
|
1051
|
+
* // Violations only, for one agent, paginated
|
|
1052
|
+
* const page = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'), {
|
|
1053
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
1054
|
+
* violationsOnly: true,
|
|
1055
|
+
* agentId: '<agentProjectKey>',
|
|
1056
|
+
* pageSize: 25,
|
|
1057
|
+
* });
|
|
1058
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
1059
|
+
* const next = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'), { cursor: page.nextCursor });
|
|
1060
|
+
* }
|
|
1061
|
+
* ```
|
|
1062
|
+
* @example
|
|
1063
|
+
* ```typescript
|
|
1064
|
+
* import { isAuthorizationError } from '@uipath/uipath-typescript/core';
|
|
1065
|
+
*
|
|
1066
|
+
* // Non-admin callers get a 403
|
|
1067
|
+
* try {
|
|
1068
|
+
* await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'));
|
|
1069
|
+
* } catch (error) {
|
|
1070
|
+
* if (isAuthorizationError(error)) {
|
|
1071
|
+
* console.error('Governance data requires an organization admin.');
|
|
1072
|
+
* }
|
|
1073
|
+
* }
|
|
1074
|
+
* ```
|
|
1075
|
+
*/
|
|
1076
|
+
getGovernanceDecisions<T extends AgentGovernanceDecisionsOptions = AgentGovernanceDecisionsOptions>(startTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentGovernanceDecisionGetResponse> : NonPaginatedResponse<AgentGovernanceDecisionGetResponse>>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Summarizes governance decisions across agent execution traces — total
|
|
1079
|
+
* decisions and violations, plus top breakdowns by hook, agent, policy, and
|
|
1080
|
+
* pack — over the requested window. Filterable.
|
|
1081
|
+
*
|
|
1082
|
+
* @remarks Requires the caller to be an organization admin. Non-admin callers get a `403` and the SDK throws an {@link AuthorizationError}.
|
|
1083
|
+
*
|
|
1084
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1085
|
+
* @param options - Optional window end, top-N, pack scope, and sections
|
|
1086
|
+
* @returns Promise resolving to {@link AgentGovernanceGetSummaryResponse}
|
|
1087
|
+
* @example
|
|
1088
|
+
* ```typescript
|
|
1089
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
1090
|
+
*
|
|
1091
|
+
* const trace = new AgentTraces(sdk);
|
|
1092
|
+
*
|
|
1093
|
+
* // Default posture since a start time
|
|
1094
|
+
* const summary = await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'));
|
|
1095
|
+
* console.log(`${summary.violations} / ${summary.total} violations`);
|
|
1096
|
+
* summary.byPolicy.forEach((p) => console.log(`${p.key}: ${p.violationCount}`));
|
|
1097
|
+
* ```
|
|
1098
|
+
* @example
|
|
1099
|
+
* ```typescript
|
|
1100
|
+
* import { AgentGovernanceSection } from '@uipath/uipath-typescript/traces';
|
|
1101
|
+
*
|
|
1102
|
+
* // Top 5 per breakdown, scoped to a pack, including the opt-in action/mode sections
|
|
1103
|
+
* const summary = await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'), {
|
|
1104
|
+
* topN: 5,
|
|
1105
|
+
* packName: 'ISO/IEC 42001:2023 Runtime',
|
|
1106
|
+
* sections: [AgentGovernanceSection.Action, AgentGovernanceSection.Mode],
|
|
1107
|
+
* });
|
|
1108
|
+
* ```
|
|
1109
|
+
* @example
|
|
1110
|
+
* ```typescript
|
|
1111
|
+
* import { isAuthorizationError } from '@uipath/uipath-typescript/core';
|
|
1112
|
+
*
|
|
1113
|
+
* // Non-admin callers get a 403
|
|
1114
|
+
* try {
|
|
1115
|
+
* await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'));
|
|
1116
|
+
* } catch (error) {
|
|
1117
|
+
* if (isAuthorizationError(error)) {
|
|
1118
|
+
* console.error('Governance data requires an organization admin.');
|
|
1119
|
+
* }
|
|
1120
|
+
* }
|
|
1121
|
+
* ```
|
|
1122
|
+
*/
|
|
1123
|
+
getGovernanceSummary(startTime: Date, options?: AgentGovernanceSummaryOptions): Promise<AgentGovernanceGetSummaryResponse>;
|
|
883
1124
|
}
|
|
884
1125
|
|
|
885
1126
|
/**
|
|
@@ -964,7 +1205,7 @@ declare class AgentTracesService extends BaseService implements AgentTracesServi
|
|
|
964
1205
|
* // Get per-agent unit consumption
|
|
965
1206
|
* const result = await trace.getUnitConsumption();
|
|
966
1207
|
* result.forEach((row) => {
|
|
967
|
-
* console.log(`${row.agentId}: ${row.agentUnitsConsumed}
|
|
1208
|
+
* console.log(`${row.agentId}: ${row.agentUnitsConsumed} Agent Units, ${row.platformUnitsConsumed} Platform Units`);
|
|
968
1209
|
* });
|
|
969
1210
|
* ```
|
|
970
1211
|
* @example
|
|
@@ -1003,10 +1244,6 @@ declare class AgentTracesService extends BaseService implements AgentTracesServi
|
|
|
1003
1244
|
/**
|
|
1004
1245
|
* Retrieves spans whose reference hierarchy contains the given reference id.
|
|
1005
1246
|
*
|
|
1006
|
-
* Returns a {@link PaginatedResponse} when pagination options (`pageSize`,
|
|
1007
|
-
* `cursor`, or `jumpToPage`) are provided, otherwise a
|
|
1008
|
-
* {@link NonPaginatedResponse}.
|
|
1009
|
-
*
|
|
1010
1247
|
* @param referenceId - Reference id matched against each span's reference hierarchy
|
|
1011
1248
|
* @param options - Optional pagination and hierarchy/time filters
|
|
1012
1249
|
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentSpanGetResponse}
|
|
@@ -1039,8 +1276,106 @@ declare class AgentTracesService extends BaseService implements AgentTracesServi
|
|
|
1039
1276
|
* ```
|
|
1040
1277
|
*/
|
|
1041
1278
|
getSpansByReference<T extends AgentTraceGetSpansByReferenceOptions = AgentTraceGetSpansByReferenceOptions>(referenceId: string, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentSpanGetResponse> : NonPaginatedResponse<AgentSpanGetResponse>>;
|
|
1279
|
+
/**
|
|
1280
|
+
* Lists individual governance decisions from agent execution traces — each
|
|
1281
|
+
* policy check's allow/deny outcome with its agent, policy, pack, hook, and
|
|
1282
|
+
* mode, plus the trace it belongs to — over the requested window. Filterable
|
|
1283
|
+
* and paginated.
|
|
1284
|
+
*
|
|
1285
|
+
* @remarks Requires the caller to be an organization admin. Non-admin callers get a `403` and the SDK throws an {@link AuthorizationError}.
|
|
1286
|
+
*
|
|
1287
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1288
|
+
* @param options - Optional window end, filters, and pagination
|
|
1289
|
+
* @returns Promise resolving to a paginated or non-paginated list of {@link AgentGovernanceDecisionGetResponse}
|
|
1290
|
+
* @example
|
|
1291
|
+
* ```typescript
|
|
1292
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
1293
|
+
*
|
|
1294
|
+
* const trace = new AgentTraces(sdk);
|
|
1295
|
+
*
|
|
1296
|
+
* // Decision rows since a start time
|
|
1297
|
+
* const result = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'));
|
|
1298
|
+
* result.items.forEach((row) => {
|
|
1299
|
+
* console.log(`${row.hook} ${row.policyId}: ${row.evaluatorResult}`);
|
|
1300
|
+
* });
|
|
1301
|
+
* ```
|
|
1302
|
+
* @example
|
|
1303
|
+
* ```typescript
|
|
1304
|
+
* // Violations only, for one agent, paginated
|
|
1305
|
+
* const page = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'), {
|
|
1306
|
+
* endTime: new Date('2025-06-01T00:00:00Z'),
|
|
1307
|
+
* violationsOnly: true,
|
|
1308
|
+
* agentId: '<agentProjectKey>',
|
|
1309
|
+
* pageSize: 25,
|
|
1310
|
+
* });
|
|
1311
|
+
* if (page.hasNextPage && page.nextCursor) {
|
|
1312
|
+
* const next = await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'), { cursor: page.nextCursor });
|
|
1313
|
+
* }
|
|
1314
|
+
* ```
|
|
1315
|
+
* @example
|
|
1316
|
+
* ```typescript
|
|
1317
|
+
* import { isAuthorizationError } from '@uipath/uipath-typescript/core';
|
|
1318
|
+
*
|
|
1319
|
+
* // Non-admin callers get a 403
|
|
1320
|
+
* try {
|
|
1321
|
+
* await trace.getGovernanceDecisions(new Date('2025-05-01T00:00:00Z'));
|
|
1322
|
+
* } catch (error) {
|
|
1323
|
+
* if (isAuthorizationError(error)) {
|
|
1324
|
+
* console.error('Governance data requires an organization admin.');
|
|
1325
|
+
* }
|
|
1326
|
+
* }
|
|
1327
|
+
* ```
|
|
1328
|
+
*/
|
|
1329
|
+
getGovernanceDecisions<T extends AgentGovernanceDecisionsOptions = AgentGovernanceDecisionsOptions>(startTime: Date, options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<AgentGovernanceDecisionGetResponse> : NonPaginatedResponse<AgentGovernanceDecisionGetResponse>>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Summarizes governance decisions across agent execution traces — total
|
|
1332
|
+
* decisions and violations, plus top breakdowns by hook, agent, policy, and
|
|
1333
|
+
* pack — over the requested window. Filterable.
|
|
1334
|
+
*
|
|
1335
|
+
* @remarks Requires the caller to be an organization admin. Non-admin callers get a `403` and the SDK throws an {@link AuthorizationError}.
|
|
1336
|
+
*
|
|
1337
|
+
* @param startTime - Inclusive lower bound for the query window
|
|
1338
|
+
* @param options - Optional window end, top-N, pack scope, and sections
|
|
1339
|
+
* @returns Promise resolving to {@link AgentGovernanceGetSummaryResponse}
|
|
1340
|
+
* @example
|
|
1341
|
+
* ```typescript
|
|
1342
|
+
* import { AgentTraces } from '@uipath/uipath-typescript/traces';
|
|
1343
|
+
*
|
|
1344
|
+
* const trace = new AgentTraces(sdk);
|
|
1345
|
+
*
|
|
1346
|
+
* // Default posture since a start time
|
|
1347
|
+
* const summary = await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'));
|
|
1348
|
+
* console.log(`${summary.violations} / ${summary.total} violations`);
|
|
1349
|
+
* summary.byPolicy.forEach((p) => console.log(`${p.key}: ${p.violationCount}`));
|
|
1350
|
+
* ```
|
|
1351
|
+
* @example
|
|
1352
|
+
* ```typescript
|
|
1353
|
+
* import { AgentGovernanceSection } from '@uipath/uipath-typescript/traces';
|
|
1354
|
+
*
|
|
1355
|
+
* // Top 5 per breakdown, scoped to a pack, including the opt-in action/mode sections
|
|
1356
|
+
* const summary = await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'), {
|
|
1357
|
+
* topN: 5,
|
|
1358
|
+
* packName: 'ISO/IEC 42001:2023 Runtime',
|
|
1359
|
+
* sections: [AgentGovernanceSection.Action, AgentGovernanceSection.Mode],
|
|
1360
|
+
* });
|
|
1361
|
+
* ```
|
|
1362
|
+
* @example
|
|
1363
|
+
* ```typescript
|
|
1364
|
+
* import { isAuthorizationError } from '@uipath/uipath-typescript/core';
|
|
1365
|
+
*
|
|
1366
|
+
* // Non-admin callers get a 403
|
|
1367
|
+
* try {
|
|
1368
|
+
* await trace.getGovernanceSummary(new Date('2025-05-01T00:00:00Z'));
|
|
1369
|
+
* } catch (error) {
|
|
1370
|
+
* if (isAuthorizationError(error)) {
|
|
1371
|
+
* console.error('Governance data requires an organization admin.');
|
|
1372
|
+
* }
|
|
1373
|
+
* }
|
|
1374
|
+
* ```
|
|
1375
|
+
*/
|
|
1376
|
+
getGovernanceSummary(startTime: Date, options?: AgentGovernanceSummaryOptions): Promise<AgentGovernanceGetSummaryResponse>;
|
|
1042
1377
|
private buildTraceFilterBody;
|
|
1043
1378
|
}
|
|
1044
1379
|
|
|
1045
|
-
export { SpanExecutionType as AgentTraceExecutionType, AgentTracesService as AgentTraces, SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, TracesService as Traces };
|
|
1046
|
-
export type { AgentSpanGetResponse, AgentTraceFilterOptions, AgentTraceGetErrorsTimelineOptions, AgentTraceGetErrorsTimelineResponse, AgentTraceGetLatencyTimelineOptions, AgentTraceGetLatencyTimelineResponse, AgentTraceGetSpansByReferenceOptions, AgentTraceGetUnitConsumptionOptions, AgentTraceGetUnitConsumptionResponse, AgentTracesServiceModel, SpanAttachment, SpanContext, SpanGetResponse, SpanReferenceHierarchyEntry, TracesGetByIdOptions, TracesServiceModel };
|
|
1380
|
+
export { AgentGovernanceMode, AgentGovernanceSection, AgentGovernanceVerdict, SpanExecutionType as AgentTraceExecutionType, AgentTracesService as AgentTraces, SpanAttachmentDirection, SpanAttachmentProvider, SpanExecutionType, SpanPermissionStatus, SpanSource, SpanStatus, SpanVerbosityLevel, TracesService as Traces };
|
|
1381
|
+
export type { AgentGovernanceCountItem, AgentGovernanceDecisionGetResponse, AgentGovernanceDecisionsOptions, AgentGovernanceGetSummaryResponse, AgentGovernanceSummaryOptions, AgentSpanGetResponse, AgentTraceFilterOptions, AgentTraceGetErrorsTimelineOptions, AgentTraceGetErrorsTimelineResponse, AgentTraceGetLatencyTimelineOptions, AgentTraceGetLatencyTimelineResponse, AgentTraceGetSpansByReferenceOptions, AgentTraceGetUnitConsumptionOptions, AgentTraceGetUnitConsumptionResponse, AgentTracesServiceModel, SpanAttachment, SpanContext, SpanGetResponse, SpanReferenceHierarchyEntry, TracesGetByIdOptions, TracesServiceModel };
|