@memberjunction/core-entities 2.67.0 → 2.69.0

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.
@@ -685,6 +685,16 @@ exports.AIAgentActionSchema = zod_1.z.object({
685
685
  * * Display Name: Updated At
686
686
  * * SQL Data Type: datetimeoffset
687
687
  * * Default Value: getutcdate()`),
688
+ MinExecutionsPerRun: zod_1.z.number().nullable().describe(`
689
+ * * Field Name: MinExecutionsPerRun
690
+ * * Display Name: Min Executions Per Run
691
+ * * SQL Data Type: int
692
+ * * Description: Minimum number of times this action must be executed per agent run`),
693
+ MaxExecutionsPerRun: zod_1.z.number().nullable().describe(`
694
+ * * Field Name: MaxExecutionsPerRun
695
+ * * Display Name: Max Executions Per Run
696
+ * * SQL Data Type: int
697
+ * * Description: Maximum number of times this action can be executed per agent run`),
688
698
  Agent: zod_1.z.string().nullable().describe(`
689
699
  * * Field Name: Agent
690
700
  * * Display Name: Agent
@@ -1108,14 +1118,76 @@ exports.AIAgentSchema = zod_1.z.object({
1108
1118
  * * Field Name: PayloadSelfReadPaths
1109
1119
  * * Display Name: Payload Self Read Paths
1110
1120
  * * SQL Data Type: nvarchar(MAX)
1111
- * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
1121
+ * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
1112
1122
  flow when the agent executes its own prompt step.`),
1113
1123
  PayloadSelfWritePaths: zod_1.z.string().nullable().describe(`
1114
1124
  * * Field Name: PayloadSelfWritePaths
1115
1125
  * * Display Name: Payload Self Write Paths
1116
1126
  * * SQL Data Type: nvarchar(MAX)
1117
- * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
1127
+ * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
1118
1128
  data flow when the agent executes its own prompt step.`),
1129
+ PayloadScope: zod_1.z.string().nullable().describe(`
1130
+ * * Field Name: PayloadScope
1131
+ * * Display Name: Payload Scope
1132
+ * * SQL Data Type: nvarchar(MAX)
1133
+ * * Description: Defines the scope/path within the parent payload that this sub-agent operates on. When set, the sub-agent receives only this portion of the payload and all change requests are relative to this scope. Format: /path/to/scope (e.g. /PropA/SubProp1)`),
1134
+ FinalPayloadValidation: zod_1.z.string().nullable().describe(`
1135
+ * * Field Name: FinalPayloadValidation
1136
+ * * Display Name: Final Payload Validation
1137
+ * * SQL Data Type: nvarchar(MAX)
1138
+ * * Description: Optional JSON schema or requirements that define the expected structure and content of the agent's final payload. Used to validate the output when the agent declares success. Similar to OutputExample in AI Prompts.`),
1139
+ FinalPayloadValidationMode: zod_1.z.union([zod_1.z.literal('Retry'), zod_1.z.literal('Fail'), zod_1.z.literal('Warn')]).describe(`
1140
+ * * Field Name: FinalPayloadValidationMode
1141
+ * * Display Name: Final Payload Validation Mode
1142
+ * * SQL Data Type: nvarchar(25)
1143
+ * * Default Value: Retry
1144
+ * * Value List Type: List
1145
+ * * Possible Values
1146
+ * * Retry
1147
+ * * Fail
1148
+ * * Warn
1149
+ * * Description: Determines how to handle validation failures when FinalPayloadValidation is specified. Options: Retry (default) - retry the agent with validation feedback, Fail - fail the agent run immediately, Warn - log a warning but allow success.`),
1150
+ FinalPayloadValidationMaxRetries: zod_1.z.number().describe(`
1151
+ * * Field Name: FinalPayloadValidationMaxRetries
1152
+ * * Display Name: Final Payload Validation Max Retries
1153
+ * * SQL Data Type: int
1154
+ * * Default Value: 3
1155
+ * * Description: Maximum number of retry attempts allowed when FinalPayloadValidation fails with
1156
+ Retry mode. After reaching this limit, the validation will fail permanently.`),
1157
+ MaxCostPerRun: zod_1.z.number().nullable().describe(`
1158
+ * * Field Name: MaxCostPerRun
1159
+ * * Display Name: Max Cost Per Run
1160
+ * * SQL Data Type: decimal(10, 4)
1161
+ * * Description: Maximum cost in dollars allowed for a single agent run. Run will be terminated
1162
+ if this limit is exceeded.`),
1163
+ MaxTokensPerRun: zod_1.z.number().nullable().describe(`
1164
+ * * Field Name: MaxTokensPerRun
1165
+ * * Display Name: Max Tokens Per Run
1166
+ * * SQL Data Type: int
1167
+ * * Description: Maximum total tokens (input + output) allowed for a single agent run. Run will
1168
+ be terminated if this limit is exceeded.`),
1169
+ MaxIterationsPerRun: zod_1.z.number().nullable().describe(`
1170
+ * * Field Name: MaxIterationsPerRun
1171
+ * * Display Name: Max Iterations Per Run
1172
+ * * SQL Data Type: int
1173
+ * * Description: Maximum number of prompt iterations allowed for a single agent run. Run will be
1174
+ terminated if this limit is exceeded.`),
1175
+ MaxTimePerRun: zod_1.z.number().nullable().describe(`
1176
+ * * Field Name: MaxTimePerRun
1177
+ * * Display Name: Max Time Per Run
1178
+ * * SQL Data Type: int
1179
+ * * Description: Maximum time in seconds allowed for a single agent run. Run will be terminated
1180
+ if this limit is exceeded.`),
1181
+ MinExecutionsPerRun: zod_1.z.number().nullable().describe(`
1182
+ * * Field Name: MinExecutionsPerRun
1183
+ * * Display Name: Min Executions Per Run
1184
+ * * SQL Data Type: int
1185
+ * * Description: When acting as a sub-agent, minimum number of times this agent must be executed per parent agent run`),
1186
+ MaxExecutionsPerRun: zod_1.z.number().nullable().describe(`
1187
+ * * Field Name: MaxExecutionsPerRun
1188
+ * * Display Name: Max Executions Per Run
1189
+ * * SQL Data Type: int
1190
+ * * Description: When acting as a sub-agent, maximum number of times this agent can be executed per parent agent run`),
1119
1191
  Parent: zod_1.z.string().nullable().describe(`
1120
1192
  * * Field Name: Parent
1121
1193
  * * Display Name: Parent
@@ -1669,6 +1741,12 @@ exports.AIPromptSchema = zod_1.z.object({
1669
1741
  * * Display Name: Top Log Probs
1670
1742
  * * SQL Data Type: int
1671
1743
  * * Description: Default number of top log probabilities to include when IncludeLogProbs is true. Can be overridden at runtime.`),
1744
+ FailoverStrategy: zod_1.z.string().describe(`
1745
+ * * Field Name: FailoverStrategy
1746
+ * * Display Name: Failover Strategy
1747
+ * * SQL Data Type: nvarchar(50)
1748
+ * * Default Value: SameModelDifferentVendor
1749
+ * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None`),
1672
1750
  FailoverMaxAttempts: zod_1.z.number().nullable().describe(`
1673
1751
  * * Field Name: FailoverMaxAttempts
1674
1752
  * * Display Name: Failover Max Attempts
@@ -1681,12 +1759,6 @@ exports.AIPromptSchema = zod_1.z.object({
1681
1759
  * * SQL Data Type: int
1682
1760
  * * Default Value: 5
1683
1761
  * * Description: Initial delay in seconds between failover attempts`),
1684
- FailoverStrategy: zod_1.z.string().describe(`
1685
- * * Field Name: FailoverStrategy
1686
- * * Display Name: Failover Strategy
1687
- * * SQL Data Type: nvarchar(50)
1688
- * * Default Value: SameModelDifferentVendor
1689
- * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None`),
1690
1762
  FailoverModelStrategy: zod_1.z.string().describe(`
1691
1763
  * * Field Name: FailoverModelStrategy
1692
1764
  * * Display Name: Failover Model Strategy
@@ -7084,6 +7156,19 @@ exports.AIAgentRunStepSchema = zod_1.z.object({
7084
7156
  * * Display Name: Payload At End
7085
7157
  * * SQL Data Type: nvarchar(MAX)
7086
7158
  * * Description: JSON serialization of the Payload state at the end of this step`),
7159
+ FinalPayloadValidationResult: zod_1.z.string().nullable().describe(`
7160
+ * * Field Name: FinalPayloadValidationResult
7161
+ * * Display Name: Final Payload Validation Result
7162
+ * * SQL Data Type: nvarchar(25)
7163
+ * * Description: Result of the final payload validation for this step. Pass indicates successful
7164
+ validation, Retry means validation failed but will retry, Fail means validation failed
7165
+ permanently, Warn means validation failed but execution continues.`),
7166
+ FinalPayloadValidationMessages: zod_1.z.string().nullable().describe(`
7167
+ * * Field Name: FinalPayloadValidationMessages
7168
+ * * Display Name: Final Payload Validation Messages
7169
+ * * SQL Data Type: nvarchar(MAX)
7170
+ * * Description: Validation error messages or warnings from final payload validation. Contains
7171
+ detailed information about what validation rules failed.`),
7087
7172
  });
7088
7173
  /**
7089
7174
  * zod schema definition for the entity MJ: AI Agent Runs
@@ -7270,6 +7355,13 @@ exports.AIAgentRunSchema = zod_1.z.object({
7270
7355
  * * Display Name: Starting Payload
7271
7356
  * * SQL Data Type: nvarchar(MAX)
7272
7357
  * * Description: The initial payload provided at the start of this run. Can be populated from the FinalPayload of the LastRun.`),
7358
+ TotalPromptIterations: zod_1.z.number().describe(`
7359
+ * * Field Name: TotalPromptIterations
7360
+ * * Display Name: Total Prompt Iterations
7361
+ * * SQL Data Type: int
7362
+ * * Default Value: 0
7363
+ * * Description: Total number of prompt iterations executed during this agent run. Incremented
7364
+ each time the agent processes a prompt step.`),
7273
7365
  Agent: zod_1.z.string().nullable().describe(`
7274
7366
  * * Field Name: Agent
7275
7367
  * * Display Name: Agent
@@ -8163,6 +8255,12 @@ exports.AIPromptRunSchema = zod_1.z.object({
8163
8255
  * * Display Name: Failover Durations
8164
8256
  * * SQL Data Type: nvarchar(MAX)
8165
8257
  * * Description: JSON array of duration in milliseconds for each failover attempt`),
8258
+ OriginalModelID: zod_1.z.string().nullable().describe(`
8259
+ * * Field Name: OriginalModelID
8260
+ * * Display Name: Original Model ID
8261
+ * * SQL Data Type: uniqueidentifier
8262
+ * * Related Entity/Foreign Key: AI Models (vwAIModels.ID)
8263
+ * * Description: The AI Model ID that was originally attempted before any failovers`),
8166
8264
  OriginalRequestStartTime: zod_1.z.date().nullable().describe(`
8167
8265
  * * Field Name: OriginalRequestStartTime
8168
8266
  * * Display Name: Original Request Start Time
@@ -8173,12 +8271,6 @@ exports.AIPromptRunSchema = zod_1.z.object({
8173
8271
  * * Display Name: Total Failover Duration
8174
8272
  * * SQL Data Type: int
8175
8273
  * * Description: Total time spent in failover attempts in milliseconds`),
8176
- OriginalModelID: zod_1.z.string().nullable().describe(`
8177
- * * Field Name: OriginalModelID
8178
- * * Display Name: Original Model ID
8179
- * * SQL Data Type: uniqueidentifier
8180
- * * Related Entity/Foreign Key: AI Models (vwAIModels.ID)
8181
- * * Description: The AI Model ID that was originally attempted before any failovers`),
8182
8274
  Prompt: zod_1.z.string().describe(`
8183
8275
  * * Field Name: Prompt
8184
8276
  * * Display Name: Prompt
@@ -13571,6 +13663,57 @@ let AIAgentActionEntity = class AIAgentActionEntity extends core_1.BaseEntity {
13571
13663
  return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
13572
13664
  }
13573
13665
  /**
13666
+ * Validate() method override for AI Agent Actions entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
13667
+ * * MaxExecutionsPerRun: This rule ensures that if a value for the maximum number of executions per run is provided, it must be greater than zero. If no value is provided, that's acceptable.
13668
+ * * Table-Level: This rule ensures that the minimum number of executions per run cannot be greater than the maximum number of executions per run. If either value is not specified, the rule is considered satisfied.
13669
+ * * MinExecutionsPerRun: This rule ensures that if a value for 'Minimum Executions Per Run' is provided, it must be zero or greater. If the value is not provided (left blank), that's also allowed.
13670
+ * @public
13671
+ * @method
13672
+ * @override
13673
+ */
13674
+ Validate() {
13675
+ const result = super.Validate();
13676
+ this.ValidateMaxExecutionsPerRunGreaterThanZero(result);
13677
+ this.ValidateMinExecutionsPerRunLessThanOrEqualToMax(result);
13678
+ this.ValidateMinExecutionsPerRunIsNonNegative(result);
13679
+ return result;
13680
+ }
13681
+ /**
13682
+ * This rule ensures that if a value for the maximum number of executions per run is provided, it must be greater than zero. If no value is provided, that's acceptable.
13683
+ * @param result - the ValidationResult object to add any errors or warnings to
13684
+ * @public
13685
+ * @method
13686
+ */
13687
+ ValidateMaxExecutionsPerRunGreaterThanZero(result) {
13688
+ if (this.MaxExecutionsPerRun !== null && this.MaxExecutionsPerRun <= 0) {
13689
+ result.Errors.push(new core_1.ValidationErrorInfo("MaxExecutionsPerRun", "If a maximum executions per run is specified, it must be greater than zero.", this.MaxExecutionsPerRun, core_1.ValidationErrorType.Failure));
13690
+ }
13691
+ }
13692
+ /**
13693
+ * This rule ensures that the minimum number of executions per run cannot be greater than the maximum number of executions per run. If either value is not specified, the rule is considered satisfied.
13694
+ * @param result - the ValidationResult object to add any errors or warnings to
13695
+ * @public
13696
+ * @method
13697
+ */
13698
+ ValidateMinExecutionsPerRunLessThanOrEqualToMax(result) {
13699
+ if (this.MinExecutionsPerRun !== null &&
13700
+ this.MaxExecutionsPerRun !== null &&
13701
+ this.MinExecutionsPerRun > this.MaxExecutionsPerRun) {
13702
+ result.Errors.push(new core_1.ValidationErrorInfo("MinExecutionsPerRun", "The minimum executions per run cannot be greater than the maximum executions per run.", this.MinExecutionsPerRun, core_1.ValidationErrorType.Failure));
13703
+ }
13704
+ }
13705
+ /**
13706
+ * This rule ensures that if a value for 'Minimum Executions Per Run' is provided, it must be zero or greater. If the value is not provided (left blank), that's also allowed.
13707
+ * @param result - the ValidationResult object to add any errors or warnings to
13708
+ * @public
13709
+ * @method
13710
+ */
13711
+ ValidateMinExecutionsPerRunIsNonNegative(result) {
13712
+ if (this.MinExecutionsPerRun !== null && this.MinExecutionsPerRun < 0) {
13713
+ result.Errors.push(new core_1.ValidationErrorInfo("MinExecutionsPerRun", "Minimum executions per run must be zero or greater.", this.MinExecutionsPerRun, core_1.ValidationErrorType.Failure));
13714
+ }
13715
+ }
13716
+ /**
13574
13717
  * * Field Name: ID
13575
13718
  * * Display Name: ID
13576
13719
  * * SQL Data Type: uniqueidentifier
@@ -13645,6 +13788,30 @@ let AIAgentActionEntity = class AIAgentActionEntity extends core_1.BaseEntity {
13645
13788
  return this.Get('__mj_UpdatedAt');
13646
13789
  }
13647
13790
  /**
13791
+ * * Field Name: MinExecutionsPerRun
13792
+ * * Display Name: Min Executions Per Run
13793
+ * * SQL Data Type: int
13794
+ * * Description: Minimum number of times this action must be executed per agent run
13795
+ */
13796
+ get MinExecutionsPerRun() {
13797
+ return this.Get('MinExecutionsPerRun');
13798
+ }
13799
+ set MinExecutionsPerRun(value) {
13800
+ this.Set('MinExecutionsPerRun', value);
13801
+ }
13802
+ /**
13803
+ * * Field Name: MaxExecutionsPerRun
13804
+ * * Display Name: Max Executions Per Run
13805
+ * * SQL Data Type: int
13806
+ * * Description: Maximum number of times this action can be executed per agent run
13807
+ */
13808
+ get MaxExecutionsPerRun() {
13809
+ return this.Get('MaxExecutionsPerRun');
13810
+ }
13811
+ set MaxExecutionsPerRun(value) {
13812
+ this.Set('MaxExecutionsPerRun', value);
13813
+ }
13814
+ /**
13648
13815
  * * Field Name: Agent
13649
13816
  * * Display Name: Agent
13650
13817
  * * SQL Data Type: nvarchar(255)
@@ -14405,6 +14572,9 @@ let AIAgentEntity = class AIAgentEntity extends core_1.BaseEntity {
14405
14572
  * Validate() method override for AI Agents entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
14406
14573
  * * Table-Level: This rule makes sure that if the ParentID is set (not empty), then the ExposeAsAction option must be disabled. If ExposeAsAction is enabled, ParentID must be empty.
14407
14574
  * * Table-Level: This rule ensures that if context compression is enabled, all related settings (message threshold, prompt ID, and message retention count) must be specified. If context compression is not enabled, these settings may be left unspecified.
14575
+ * * MinExecutionsPerRun: This rule ensures that if the minimum executions per run value is provided, it must be zero or greater.
14576
+ * * Table-Level: This rule ensures that if both 'Minimum Executions Per Run' and 'Maximum Executions Per Run' are specified, the minimum must not be greater than the maximum. If either field is not specified, this rule does not apply.
14577
+ * * MaxExecutionsPerRun: This rule ensures that the maximum number of executions per run can either be left blank (unspecified) or, if provided, it must be a positive number greater than zero.
14408
14578
  * @public
14409
14579
  * @method
14410
14580
  * @override
@@ -14413,6 +14583,9 @@ let AIAgentEntity = class AIAgentEntity extends core_1.BaseEntity {
14413
14583
  const result = super.Validate();
14414
14584
  this.ValidateParentIDMustBeNullIfExposeAsActionTrue(result);
14415
14585
  this.ValidateEnableContextCompressionRequiresContextFields(result);
14586
+ this.ValidateMinExecutionsPerRunIsNonNegative(result);
14587
+ this.ValidateMinExecutionsPerRunLessThanOrEqualToMaxExecutionsPerRun(result);
14588
+ this.ValidateMaxExecutionsPerRunIsNullOrPositive(result);
14416
14589
  return result;
14417
14590
  }
14418
14591
  /**
@@ -14446,6 +14619,39 @@ let AIAgentEntity = class AIAgentEntity extends core_1.BaseEntity {
14446
14619
  }
14447
14620
  }
14448
14621
  /**
14622
+ * This rule ensures that if the minimum executions per run value is provided, it must be zero or greater.
14623
+ * @param result - the ValidationResult object to add any errors or warnings to
14624
+ * @public
14625
+ * @method
14626
+ */
14627
+ ValidateMinExecutionsPerRunIsNonNegative(result) {
14628
+ if (this.MinExecutionsPerRun !== null && this.MinExecutionsPerRun < 0) {
14629
+ result.Errors.push(new core_1.ValidationErrorInfo("MinExecutionsPerRun", "If specified, the minimum executions per run must be zero or greater.", this.MinExecutionsPerRun, core_1.ValidationErrorType.Failure));
14630
+ }
14631
+ }
14632
+ /**
14633
+ * This rule ensures that if both 'Minimum Executions Per Run' and 'Maximum Executions Per Run' are specified, the minimum must not be greater than the maximum. If either field is not specified, this rule does not apply.
14634
+ * @param result - the ValidationResult object to add any errors or warnings to
14635
+ * @public
14636
+ * @method
14637
+ */
14638
+ ValidateMinExecutionsPerRunLessThanOrEqualToMaxExecutionsPerRun(result) {
14639
+ if (this.MinExecutionsPerRun !== null && this.MaxExecutionsPerRun !== null && this.MinExecutionsPerRun > this.MaxExecutionsPerRun) {
14640
+ result.Errors.push(new core_1.ValidationErrorInfo("MinExecutionsPerRun", "Minimum executions per run cannot be greater than maximum executions per run.", this.MinExecutionsPerRun, core_1.ValidationErrorType.Failure));
14641
+ }
14642
+ }
14643
+ /**
14644
+ * This rule ensures that the maximum number of executions per run can either be left blank (unspecified) or, if provided, it must be a positive number greater than zero.
14645
+ * @param result - the ValidationResult object to add any errors or warnings to
14646
+ * @public
14647
+ * @method
14648
+ */
14649
+ ValidateMaxExecutionsPerRunIsNullOrPositive(result) {
14650
+ if (this.MaxExecutionsPerRun !== null && this.MaxExecutionsPerRun <= 0) {
14651
+ result.Errors.push(new core_1.ValidationErrorInfo("MaxExecutionsPerRun", "MaxExecutionsPerRun must be left blank or must be greater than zero.", this.MaxExecutionsPerRun, core_1.ValidationErrorType.Failure));
14652
+ }
14653
+ }
14654
+ /**
14449
14655
  * * Field Name: ID
14450
14656
  * * Display Name: ID
14451
14657
  * * SQL Data Type: uniqueidentifier
@@ -14736,6 +14942,138 @@ data flow when the agent executes its own prompt step.
14736
14942
  this.Set('PayloadSelfWritePaths', value);
14737
14943
  }
14738
14944
  /**
14945
+ * * Field Name: PayloadScope
14946
+ * * Display Name: Payload Scope
14947
+ * * SQL Data Type: nvarchar(MAX)
14948
+ * * Description: Defines the scope/path within the parent payload that this sub-agent operates on. When set, the sub-agent receives only this portion of the payload and all change requests are relative to this scope. Format: /path/to/scope (e.g. /PropA/SubProp1)
14949
+ */
14950
+ get PayloadScope() {
14951
+ return this.Get('PayloadScope');
14952
+ }
14953
+ set PayloadScope(value) {
14954
+ this.Set('PayloadScope', value);
14955
+ }
14956
+ /**
14957
+ * * Field Name: FinalPayloadValidation
14958
+ * * Display Name: Final Payload Validation
14959
+ * * SQL Data Type: nvarchar(MAX)
14960
+ * * Description: Optional JSON schema or requirements that define the expected structure and content of the agent's final payload. Used to validate the output when the agent declares success. Similar to OutputExample in AI Prompts.
14961
+ */
14962
+ get FinalPayloadValidation() {
14963
+ return this.Get('FinalPayloadValidation');
14964
+ }
14965
+ set FinalPayloadValidation(value) {
14966
+ this.Set('FinalPayloadValidation', value);
14967
+ }
14968
+ /**
14969
+ * * Field Name: FinalPayloadValidationMode
14970
+ * * Display Name: Final Payload Validation Mode
14971
+ * * SQL Data Type: nvarchar(25)
14972
+ * * Default Value: Retry
14973
+ * * Value List Type: List
14974
+ * * Possible Values
14975
+ * * Retry
14976
+ * * Fail
14977
+ * * Warn
14978
+ * * Description: Determines how to handle validation failures when FinalPayloadValidation is specified. Options: Retry (default) - retry the agent with validation feedback, Fail - fail the agent run immediately, Warn - log a warning but allow success.
14979
+ */
14980
+ get FinalPayloadValidationMode() {
14981
+ return this.Get('FinalPayloadValidationMode');
14982
+ }
14983
+ set FinalPayloadValidationMode(value) {
14984
+ this.Set('FinalPayloadValidationMode', value);
14985
+ }
14986
+ /**
14987
+ * * Field Name: FinalPayloadValidationMaxRetries
14988
+ * * Display Name: Final Payload Validation Max Retries
14989
+ * * SQL Data Type: int
14990
+ * * Default Value: 3
14991
+ * * Description: Maximum number of retry attempts allowed when FinalPayloadValidation fails with
14992
+ Retry mode. After reaching this limit, the validation will fail permanently.
14993
+ */
14994
+ get FinalPayloadValidationMaxRetries() {
14995
+ return this.Get('FinalPayloadValidationMaxRetries');
14996
+ }
14997
+ set FinalPayloadValidationMaxRetries(value) {
14998
+ this.Set('FinalPayloadValidationMaxRetries', value);
14999
+ }
15000
+ /**
15001
+ * * Field Name: MaxCostPerRun
15002
+ * * Display Name: Max Cost Per Run
15003
+ * * SQL Data Type: decimal(10, 4)
15004
+ * * Description: Maximum cost in dollars allowed for a single agent run. Run will be terminated
15005
+ if this limit is exceeded.
15006
+ */
15007
+ get MaxCostPerRun() {
15008
+ return this.Get('MaxCostPerRun');
15009
+ }
15010
+ set MaxCostPerRun(value) {
15011
+ this.Set('MaxCostPerRun', value);
15012
+ }
15013
+ /**
15014
+ * * Field Name: MaxTokensPerRun
15015
+ * * Display Name: Max Tokens Per Run
15016
+ * * SQL Data Type: int
15017
+ * * Description: Maximum total tokens (input + output) allowed for a single agent run. Run will
15018
+ be terminated if this limit is exceeded.
15019
+ */
15020
+ get MaxTokensPerRun() {
15021
+ return this.Get('MaxTokensPerRun');
15022
+ }
15023
+ set MaxTokensPerRun(value) {
15024
+ this.Set('MaxTokensPerRun', value);
15025
+ }
15026
+ /**
15027
+ * * Field Name: MaxIterationsPerRun
15028
+ * * Display Name: Max Iterations Per Run
15029
+ * * SQL Data Type: int
15030
+ * * Description: Maximum number of prompt iterations allowed for a single agent run. Run will be
15031
+ terminated if this limit is exceeded.
15032
+ */
15033
+ get MaxIterationsPerRun() {
15034
+ return this.Get('MaxIterationsPerRun');
15035
+ }
15036
+ set MaxIterationsPerRun(value) {
15037
+ this.Set('MaxIterationsPerRun', value);
15038
+ }
15039
+ /**
15040
+ * * Field Name: MaxTimePerRun
15041
+ * * Display Name: Max Time Per Run
15042
+ * * SQL Data Type: int
15043
+ * * Description: Maximum time in seconds allowed for a single agent run. Run will be terminated
15044
+ if this limit is exceeded.
15045
+ */
15046
+ get MaxTimePerRun() {
15047
+ return this.Get('MaxTimePerRun');
15048
+ }
15049
+ set MaxTimePerRun(value) {
15050
+ this.Set('MaxTimePerRun', value);
15051
+ }
15052
+ /**
15053
+ * * Field Name: MinExecutionsPerRun
15054
+ * * Display Name: Min Executions Per Run
15055
+ * * SQL Data Type: int
15056
+ * * Description: When acting as a sub-agent, minimum number of times this agent must be executed per parent agent run
15057
+ */
15058
+ get MinExecutionsPerRun() {
15059
+ return this.Get('MinExecutionsPerRun');
15060
+ }
15061
+ set MinExecutionsPerRun(value) {
15062
+ this.Set('MinExecutionsPerRun', value);
15063
+ }
15064
+ /**
15065
+ * * Field Name: MaxExecutionsPerRun
15066
+ * * Display Name: Max Executions Per Run
15067
+ * * SQL Data Type: int
15068
+ * * Description: When acting as a sub-agent, maximum number of times this agent can be executed per parent agent run
15069
+ */
15070
+ get MaxExecutionsPerRun() {
15071
+ return this.Get('MaxExecutionsPerRun');
15072
+ }
15073
+ set MaxExecutionsPerRun(value) {
15074
+ this.Set('MaxExecutionsPerRun', value);
15075
+ }
15076
+ /**
14739
15077
  * * Field Name: Parent
14740
15078
  * * Display Name: Parent
14741
15079
  * * SQL Data Type: nvarchar(255)
@@ -15459,11 +15797,11 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
15459
15797
  }
15460
15798
  /**
15461
15799
  * Validate() method override for AI Prompts entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
15462
- * * CacheSimilarityThreshold: This rule ensures that if a cache similarity threshold is provided, it must be a value between 0 and 1, inclusive. If no value is provided, that's also allowed.
15463
- * * CacheTTLSeconds: This rule ensures that if the cache expiration time in seconds is provided, it must be greater than zero.
15464
15800
  * * FailoverStrategy: This rule ensures that the FailoverStrategy field, if specified, must be either 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank (unset).
15465
15801
  * * FailoverModelStrategy: This rule ensures that the value for FailoverModelStrategy is either 'RequireSameModel', 'PreferDifferentModel', 'PreferSameModel', or left blank (not set). Any other value is not allowed.
15466
15802
  * * FailoverErrorScope: This rule ensures that the FailoverErrorScope field can only be set to 'ServiceErrorOnly', 'RateLimitOnly', 'NetworkOnly', 'All', or left empty.
15803
+ * * CacheSimilarityThreshold: This rule ensures that if a cache similarity threshold is provided, it must be a value between 0 and 1, inclusive. If no value is provided, that's also allowed.
15804
+ * * CacheTTLSeconds: This rule ensures that if the cache expiration time in seconds is provided, it must be greater than zero.
15467
15805
  * * Table-Level: This rule ensures that the ResultSelectorPromptID field must be different from the ID field. In other words, a result selector prompt cannot reference itself.
15468
15806
  * * Table-Level: This rule ensures that if the cache match type is set to 'Vector', the cache similarity threshold must be specified. If the match type is anything other than 'Vector', the similarity threshold can be left empty.
15469
15807
  * * Table-Level: This rule ensures that if the parallelization mode is set to 'StaticCount', then the number of parallel tasks (ParallelCount) must be provided.
@@ -15475,11 +15813,11 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
15475
15813
  */
15476
15814
  Validate() {
15477
15815
  const result = super.Validate();
15478
- this.ValidateCacheSimilarityThresholdIsBetweenZeroAndOne(result);
15479
- this.ValidateCacheTTLSecondsGreaterThanZero(result);
15480
15816
  this.ValidateFailoverStrategyAllowedValues(result);
15481
15817
  this.ValidateFailoverModelStrategyAgainstAllowedValues(result);
15482
15818
  this.ValidateFailoverErrorScopeAgainstAllowedValues(result);
15819
+ this.ValidateCacheSimilarityThresholdIsBetweenZeroAndOne(result);
15820
+ this.ValidateCacheTTLSecondsGreaterThanZero(result);
15483
15821
  this.ValidateResultSelectorPromptIDNotEqualID(result);
15484
15822
  this.ValidateCacheSimilarityThresholdRequiredForVectorCache(result);
15485
15823
  this.ValidateParallelCountWhenParallelizationModeIsStaticCount(result);
@@ -15488,28 +15826,6 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
15488
15826
  return result;
15489
15827
  }
15490
15828
  /**
15491
- * This rule ensures that if a cache similarity threshold is provided, it must be a value between 0 and 1, inclusive. If no value is provided, that's also allowed.
15492
- * @param result - the ValidationResult object to add any errors or warnings to
15493
- * @public
15494
- * @method
15495
- */
15496
- ValidateCacheSimilarityThresholdIsBetweenZeroAndOne(result) {
15497
- if (this.CacheSimilarityThreshold !== null && (this.CacheSimilarityThreshold < 0 || this.CacheSimilarityThreshold > 1)) {
15498
- result.Errors.push(new core_1.ValidationErrorInfo("CacheSimilarityThreshold", "Cache similarity threshold must be between 0 and 1.", this.CacheSimilarityThreshold, core_1.ValidationErrorType.Failure));
15499
- }
15500
- }
15501
- /**
15502
- * This rule ensures that if the cache expiration time in seconds is provided, it must be greater than zero.
15503
- * @param result - the ValidationResult object to add any errors or warnings to
15504
- * @public
15505
- * @method
15506
- */
15507
- ValidateCacheTTLSecondsGreaterThanZero(result) {
15508
- if (this.CacheTTLSeconds !== null && this.CacheTTLSeconds <= 0) {
15509
- result.Errors.push(new core_1.ValidationErrorInfo("CacheTTLSeconds", "If cache expiration time (CacheTTLSeconds) is specified, it must be greater than zero.", this.CacheTTLSeconds, core_1.ValidationErrorType.Failure));
15510
- }
15511
- }
15512
- /**
15513
15829
  * This rule ensures that the FailoverStrategy field, if specified, must be either 'None', 'PowerRank', 'NextBestModel', 'SameModelDifferentVendor', or left blank (unset).
15514
15830
  * @param result - the ValidationResult object to add any errors or warnings to
15515
15831
  * @public
@@ -15554,6 +15870,28 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
15554
15870
  }
15555
15871
  }
15556
15872
  /**
15873
+ * This rule ensures that if a cache similarity threshold is provided, it must be a value between 0 and 1, inclusive. If no value is provided, that's also allowed.
15874
+ * @param result - the ValidationResult object to add any errors or warnings to
15875
+ * @public
15876
+ * @method
15877
+ */
15878
+ ValidateCacheSimilarityThresholdIsBetweenZeroAndOne(result) {
15879
+ if (this.CacheSimilarityThreshold !== null && (this.CacheSimilarityThreshold < 0 || this.CacheSimilarityThreshold > 1)) {
15880
+ result.Errors.push(new core_1.ValidationErrorInfo("CacheSimilarityThreshold", "Cache similarity threshold must be between 0 and 1.", this.CacheSimilarityThreshold, core_1.ValidationErrorType.Failure));
15881
+ }
15882
+ }
15883
+ /**
15884
+ * This rule ensures that if the cache expiration time in seconds is provided, it must be greater than zero.
15885
+ * @param result - the ValidationResult object to add any errors or warnings to
15886
+ * @public
15887
+ * @method
15888
+ */
15889
+ ValidateCacheTTLSecondsGreaterThanZero(result) {
15890
+ if (this.CacheTTLSeconds !== null && this.CacheTTLSeconds <= 0) {
15891
+ result.Errors.push(new core_1.ValidationErrorInfo("CacheTTLSeconds", "If cache expiration time (CacheTTLSeconds) is specified, it must be greater than zero.", this.CacheTTLSeconds, core_1.ValidationErrorType.Failure));
15892
+ }
15893
+ }
15894
+ /**
15557
15895
  * This rule ensures that the ResultSelectorPromptID field must be different from the ID field. In other words, a result selector prompt cannot reference itself.
15558
15896
  * @param result - the ValidationResult object to add any errors or warnings to
15559
15897
  * @public
@@ -16224,6 +16562,19 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
16224
16562
  this.Set('TopLogProbs', value);
16225
16563
  }
16226
16564
  /**
16565
+ * * Field Name: FailoverStrategy
16566
+ * * Display Name: Failover Strategy
16567
+ * * SQL Data Type: nvarchar(50)
16568
+ * * Default Value: SameModelDifferentVendor
16569
+ * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None
16570
+ */
16571
+ get FailoverStrategy() {
16572
+ return this.Get('FailoverStrategy');
16573
+ }
16574
+ set FailoverStrategy(value) {
16575
+ this.Set('FailoverStrategy', value);
16576
+ }
16577
+ /**
16227
16578
  * * Field Name: FailoverMaxAttempts
16228
16579
  * * Display Name: Failover Max Attempts
16229
16580
  * * SQL Data Type: int
@@ -16250,19 +16601,6 @@ let AIPromptEntity = class AIPromptEntity extends core_1.BaseEntity {
16250
16601
  this.Set('FailoverDelaySeconds', value);
16251
16602
  }
16252
16603
  /**
16253
- * * Field Name: FailoverStrategy
16254
- * * Display Name: Failover Strategy
16255
- * * SQL Data Type: nvarchar(50)
16256
- * * Default Value: SameModelDifferentVendor
16257
- * * Description: Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None
16258
- */
16259
- get FailoverStrategy() {
16260
- return this.Get('FailoverStrategy');
16261
- }
16262
- set FailoverStrategy(value) {
16263
- this.Set('FailoverStrategy', value);
16264
- }
16265
- /**
16266
16604
  * * Field Name: FailoverModelStrategy
16267
16605
  * * Display Name: Failover Model Strategy
16268
16606
  * * SQL Data Type: nvarchar(50)
@@ -29782,6 +30120,7 @@ let AIAgentRunStepEntity = class AIAgentRunStepEntity extends core_1.BaseEntity
29782
30120
  /**
29783
30121
  * Validate() method override for MJ: AI Agent Run Steps entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
29784
30122
  * * StepNumber: This rule ensures that the step number must always be greater than zero.
30123
+ * * FinalPayloadValidationResult: This rule ensures that the FinalPayloadValidationResult field is either left blank or is set to one of the following values: 'Warn', 'Fail', 'Retry', or 'Pass'. No other values are allowed.
29785
30124
  * @public
29786
30125
  * @method
29787
30126
  * @override
@@ -29789,6 +30128,7 @@ let AIAgentRunStepEntity = class AIAgentRunStepEntity extends core_1.BaseEntity
29789
30128
  Validate() {
29790
30129
  const result = super.Validate();
29791
30130
  this.ValidateStepNumberGreaterThanZero(result);
30131
+ this.ValidateFinalPayloadValidationResultAllowedValues(result);
29792
30132
  return result;
29793
30133
  }
29794
30134
  /**
@@ -29803,6 +30143,18 @@ let AIAgentRunStepEntity = class AIAgentRunStepEntity extends core_1.BaseEntity
29803
30143
  }
29804
30144
  }
29805
30145
  /**
30146
+ * This rule ensures that the FinalPayloadValidationResult field is either left blank or is set to one of the following values: 'Warn', 'Fail', 'Retry', or 'Pass'. No other values are allowed.
30147
+ * @param result - the ValidationResult object to add any errors or warnings to
30148
+ * @public
30149
+ * @method
30150
+ */
30151
+ ValidateFinalPayloadValidationResultAllowedValues(result) {
30152
+ const allowedValues = ["Warn", "Fail", "Retry", "Pass"];
30153
+ if (this.FinalPayloadValidationResult !== null && !allowedValues.includes(this.FinalPayloadValidationResult)) {
30154
+ result.Errors.push(new core_1.ValidationErrorInfo("FinalPayloadValidationResult", "If a final payload validation result is specified, it must be either 'Warn', 'Fail', 'Retry', or 'Pass'.", this.FinalPayloadValidationResult, core_1.ValidationErrorType.Failure));
30155
+ }
30156
+ }
30157
+ /**
29806
30158
  * * Field Name: ID
29807
30159
  * * Display Name: ID
29808
30160
  * * SQL Data Type: uniqueidentifier
@@ -30031,6 +30383,33 @@ let AIAgentRunStepEntity = class AIAgentRunStepEntity extends core_1.BaseEntity
30031
30383
  set PayloadAtEnd(value) {
30032
30384
  this.Set('PayloadAtEnd', value);
30033
30385
  }
30386
+ /**
30387
+ * * Field Name: FinalPayloadValidationResult
30388
+ * * Display Name: Final Payload Validation Result
30389
+ * * SQL Data Type: nvarchar(25)
30390
+ * * Description: Result of the final payload validation for this step. Pass indicates successful
30391
+ validation, Retry means validation failed but will retry, Fail means validation failed
30392
+ permanently, Warn means validation failed but execution continues.
30393
+ */
30394
+ get FinalPayloadValidationResult() {
30395
+ return this.Get('FinalPayloadValidationResult');
30396
+ }
30397
+ set FinalPayloadValidationResult(value) {
30398
+ this.Set('FinalPayloadValidationResult', value);
30399
+ }
30400
+ /**
30401
+ * * Field Name: FinalPayloadValidationMessages
30402
+ * * Display Name: Final Payload Validation Messages
30403
+ * * SQL Data Type: nvarchar(MAX)
30404
+ * * Description: Validation error messages or warnings from final payload validation. Contains
30405
+ detailed information about what validation rules failed.
30406
+ */
30407
+ get FinalPayloadValidationMessages() {
30408
+ return this.Get('FinalPayloadValidationMessages');
30409
+ }
30410
+ set FinalPayloadValidationMessages(value) {
30411
+ this.Set('FinalPayloadValidationMessages', value);
30412
+ }
30034
30413
  };
30035
30414
  exports.AIAgentRunStepEntity = AIAgentRunStepEntity;
30036
30415
  exports.AIAgentRunStepEntity = AIAgentRunStepEntity = __decorate([
@@ -30451,6 +30830,20 @@ let AIAgentRunEntity = class AIAgentRunEntity extends core_1.BaseEntity {
30451
30830
  this.Set('StartingPayload', value);
30452
30831
  }
30453
30832
  /**
30833
+ * * Field Name: TotalPromptIterations
30834
+ * * Display Name: Total Prompt Iterations
30835
+ * * SQL Data Type: int
30836
+ * * Default Value: 0
30837
+ * * Description: Total number of prompt iterations executed during this agent run. Incremented
30838
+ each time the agent processes a prompt step.
30839
+ */
30840
+ get TotalPromptIterations() {
30841
+ return this.Get('TotalPromptIterations');
30842
+ }
30843
+ set TotalPromptIterations(value) {
30844
+ this.Set('TotalPromptIterations', value);
30845
+ }
30846
+ /**
30454
30847
  * * Field Name: Agent
30455
30848
  * * Display Name: Agent
30456
30849
  * * SQL Data Type: nvarchar(255)
@@ -32864,6 +33257,19 @@ let AIPromptRunEntity = class AIPromptRunEntity extends core_1.BaseEntity {
32864
33257
  this.Set('FailoverDurations', value);
32865
33258
  }
32866
33259
  /**
33260
+ * * Field Name: OriginalModelID
33261
+ * * Display Name: Original Model ID
33262
+ * * SQL Data Type: uniqueidentifier
33263
+ * * Related Entity/Foreign Key: AI Models (vwAIModels.ID)
33264
+ * * Description: The AI Model ID that was originally attempted before any failovers
33265
+ */
33266
+ get OriginalModelID() {
33267
+ return this.Get('OriginalModelID');
33268
+ }
33269
+ set OriginalModelID(value) {
33270
+ this.Set('OriginalModelID', value);
33271
+ }
33272
+ /**
32867
33273
  * * Field Name: OriginalRequestStartTime
32868
33274
  * * Display Name: Original Request Start Time
32869
33275
  * * SQL Data Type: datetime
@@ -32888,19 +33294,6 @@ let AIPromptRunEntity = class AIPromptRunEntity extends core_1.BaseEntity {
32888
33294
  this.Set('TotalFailoverDuration', value);
32889
33295
  }
32890
33296
  /**
32891
- * * Field Name: OriginalModelID
32892
- * * Display Name: Original Model ID
32893
- * * SQL Data Type: uniqueidentifier
32894
- * * Related Entity/Foreign Key: AI Models (vwAIModels.ID)
32895
- * * Description: The AI Model ID that was originally attempted before any failovers
32896
- */
32897
- get OriginalModelID() {
32898
- return this.Get('OriginalModelID');
32899
- }
32900
- set OriginalModelID(value) {
32901
- this.Set('OriginalModelID', value);
32902
- }
32903
- /**
32904
33297
  * * Field Name: Prompt
32905
33298
  * * Display Name: Prompt
32906
33299
  * * SQL Data Type: nvarchar(255)