@memberjunction/core-entities 6.1.0-edge.6 → 6.1.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.
@@ -143,6 +143,12 @@ export const MJAIAgentActionSchema = z.object({
143
143
  * * SQL Data Type: uniqueidentifier
144
144
  * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)
145
145
  * * Description: Optional override for AI summarization prompt when CompactMode=AISummary. Lookup hierarchy: this field -> Action.DefaultCompactPromptID -> system default. Allows agent-specific summarization focus (e.g., technical vs. marketing perspective).`),
146
+ DeclareAsNativeTool: z.boolean().describe(`
147
+ * * Field Name: DeclareAsNativeTool
148
+ * * Display Name: Declare As Native Tool
149
+ * * SQL Data Type: bit
150
+ * * Default Value: 1
151
+ * * Description: Whether this Action may be declared as a native tool for this agent (1, default). 0 keeps it out of the tool set on native turns; because the prose catalog is not rendered in native mode, the action is then unavailable on those turns. Use for actions an agent holds but should rarely reach for on its own.`),
146
152
  Agent: z.string().nullable().describe(`
147
153
  * * Field Name: Agent
148
154
  * * Display Name: Agent
@@ -1584,6 +1590,68 @@ export const MJAIAgentPermissionSchema = z.object({
1584
1590
  * * Display Name: User
1585
1591
  * * SQL Data Type: nvarchar(100)`),
1586
1592
  });
1593
+ /**
1594
+ * zod schema definition for the entity MJ: AI Agent Personas
1595
+ */
1596
+ export const MJAIAgentPersonaSchema = z.object({
1597
+ ID: z.string().describe(`
1598
+ * * Field Name: ID
1599
+ * * Display Name: ID
1600
+ * * SQL Data Type: uniqueidentifier
1601
+ * * Default Value: newsequentialid()`),
1602
+ AgentID: z.string().describe(`
1603
+ * * Field Name: AgentID
1604
+ * * Display Name: Agent
1605
+ * * SQL Data Type: uniqueidentifier
1606
+ * * Related Entity/Foreign Key: MJ: AI Agents (vwAIAgents.ID)`),
1607
+ PersonaID: z.string().describe(`
1608
+ * * Field Name: PersonaID
1609
+ * * Display Name: Persona
1610
+ * * SQL Data Type: uniqueidentifier
1611
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)`),
1612
+ IsDefault: z.boolean().describe(`
1613
+ * * Field Name: IsDefault
1614
+ * * Display Name: Is Default Persona
1615
+ * * SQL Data Type: bit
1616
+ * * Default Value: 0
1617
+ * * Description: Indicates whether this persona is the default presentation for the agent when none is explicitly requested.`),
1618
+ Sequence: z.number().describe(`
1619
+ * * Field Name: Sequence
1620
+ * * Display Name: Display Sequence
1621
+ * * SQL Data Type: int
1622
+ * * Default Value: 0
1623
+ * * Description: Ordering sequence for displaying available personas in user interfaces.`),
1624
+ IsAllowed: z.boolean().describe(`
1625
+ * * Field Name: IsAllowed
1626
+ * * Display Name: Is Allowed
1627
+ * * SQL Data Type: bit
1628
+ * * Default Value: 1
1629
+ * * Description: Whether the agent is allowed to use this persona. Set to 0 to explicitly disable or veto a persona.`),
1630
+ StyleOverride: z.any().nullable().describe(`
1631
+ * * Field Name: StyleOverride
1632
+ * * Display Name: Style Override
1633
+ * * SQL Data Type: nvarchar(MAX)
1634
+ * * JSON Type: MJAIAgentPersonaEntity_IAIAgentPersonaStyleOverride
1635
+ * * Description: Optional JSON payload overriding or refining persona presentation specifically for this agent (e.g. Tone or SpeakingStyle adjustments).`),
1636
+ __mj_CreatedAt: z.date().describe(`
1637
+ * * Field Name: __mj_CreatedAt
1638
+ * * Display Name: Created At
1639
+ * * SQL Data Type: datetimeoffset
1640
+ * * Default Value: getutcdate()`),
1641
+ __mj_UpdatedAt: z.date().describe(`
1642
+ * * Field Name: __mj_UpdatedAt
1643
+ * * Display Name: Updated At
1644
+ * * SQL Data Type: datetimeoffset
1645
+ * * Default Value: getutcdate()`),
1646
+ Agent: z.string().nullable().describe(`
1647
+ * * Field Name: Agent
1648
+ * * Display Name: Agent Name
1649
+ * * SQL Data Type: nvarchar(255)`),
1650
+ Persona: z.string().describe(`
1651
+ * * Field Name: Persona
1652
+ * * Display Name: Persona Name
1653
+ * * SQL Data Type: nvarchar(100)`),
1654
+ });
1587
1655
  /**
1588
1656
  * zod schema definition for the entity MJ: AI Agent Prompts
1589
1657
  */
@@ -2252,6 +2320,32 @@ detailed information about what validation rules failed.`),
2252
2320
  * * SQL Data Type: nvarchar(MAX)
2253
2321
  * * JSON Type: Array<MJAIAgentRunStepEntity_AgentSkillInvocation>
2254
2322
  * * Description: JSON array of skill-invocation records (AgentSkillInvocation[]) associating this step with the skills involved in it, or NULL when no skills are in play. Each record carries SkillID, SkillName, ActivationType (requested = user /skill mention; auto = agent self-activation), Provenance of authority (the gate values that admitted the skill: AcceptsSkills, both ActivationMode dials, and who requested it), and an optional agent-stated Reason when self-activated. Population: Skill steps record the activation(s) they performed; Prompt steps record the full set of skills in effect for that turn; Actions and Sub-Agent steps record the skill(s) through which the executed tool became available (NULL means the tool was a native grant).`),
2323
+ ToolCallingMode: z.union([z.literal('Envelope'), z.literal('Native'), z.literal('NativeFallback'), z.literal('NativeImplicit')]).nullable().describe(`
2324
+ * * Field Name: ToolCallingMode
2325
+ * * Display Name: Tool Calling Mode
2326
+ * * SQL Data Type: nvarchar(25)
2327
+ * * Value List Type: List
2328
+ * * Possible Values
2329
+ * * Envelope
2330
+ * * Native
2331
+ * * NativeFallback
2332
+ * * NativeImplicit
2333
+ * * Description: Which tool-calling path this step's model call took: Native (Actions as tools, envelope control flow), NativeImplicit (Actions, sub-agents, payload changes and ask_user as tools; plain text ends the turn), Envelope (prose action catalog + JSON envelope), or NativeFallback (a native attempt failed in a tools-specific way and completed via an envelope retry). NULL for steps that never reached a model call, and for rows predating the feature.`),
2334
+ NativeToolCallCount: z.number().nullable().describe(`
2335
+ * * Field Name: NativeToolCallCount
2336
+ * * Display Name: Native Tool Call Count
2337
+ * * SQL Data Type: int
2338
+ * * Description: How many native tool calls the model made on this step. 0 on a native-mode step where the model chose to answer with the envelope instead; NULL when the step took the envelope path or never reached a model call.`),
2339
+ NativeDualChannel: z.boolean().nullable().describe(`
2340
+ * * Field Name: NativeDualChannel
2341
+ * * Display Name: Native Dual Channel
2342
+ * * SQL Data Type: bit
2343
+ * * Description: On a native-mode step where the model made tool calls: 1 when the same turn also carried a parseable JSON Loop envelope (the model answered on both channels; the loop dispatched the tool call and discarded the envelope), 0 when the tool calls came alone. NULL when the step made no tool calls or took the envelope path.`),
2344
+ NativeToolResultsSent: z.boolean().nullable().describe(`
2345
+ * * Field Name: NativeToolResultsSent
2346
+ * * Display Name: Native Tool Results Sent
2347
+ * * SQL Data Type: bit
2348
+ * * Description: For native tool-calling steps: 1 = the results of this step's tool calls were returned to the model as native tool-result turns, 0 = as the markdown action-results user message. NULL for envelope steps and for rows predating the feature.`),
2255
2349
  AgentRun: z.string().nullable().describe(`
2256
2350
  * * Field Name: AgentRun
2257
2351
  * * Display Name: Agent Run Context
@@ -4131,6 +4225,12 @@ if this limit is exceeded.`),
4131
4225
  * * SQL Data Type: uniqueidentifier
4132
4226
  * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)
4133
4227
  * * Description: Per-agent override for the cross-turn conversation compaction prompt. Null inherits the agent type's value.`),
4228
+ DeclareActionsAsNativeTools: z.boolean().describe(`
4229
+ * * Field Name: DeclareActionsAsNativeTools
4230
+ * * Display Name: Declare Actions As Native Tools
4231
+ * * SQL Data Type: bit
4232
+ * * Default Value: 1
4233
+ * * Description: When native tool calling is in effect for a run, whether this agent's Actions are declared as native tools (1, default) or withheld so the agent runs on the envelope path with the prose action catalog (0). Set 0 for coordinator agents whose prompt forbids doing work themselves. Controls supply only: capability and preference on the model and prompt still decide whether declared tools are used.`),
4134
4234
  Parent: z.string().nullable().describe(`
4135
4235
  * * Field Name: Parent
4136
4236
  * * Display Name: Parent
@@ -5158,6 +5258,56 @@ export const MJAIModelModalitySchema = z.object({
5158
5258
  * * Display Name: Modality
5159
5259
  * * SQL Data Type: nvarchar(50)`),
5160
5260
  });
5261
+ /**
5262
+ * zod schema definition for the entity MJ: AI Model Personas
5263
+ */
5264
+ export const MJAIModelPersonaSchema = z.object({
5265
+ ID: z.string().describe(`
5266
+ * * Field Name: ID
5267
+ * * Display Name: ID
5268
+ * * SQL Data Type: uniqueidentifier
5269
+ * * Default Value: newsequentialid()`),
5270
+ ModelID: z.string().describe(`
5271
+ * * Field Name: ModelID
5272
+ * * Display Name: Model ID
5273
+ * * SQL Data Type: uniqueidentifier
5274
+ * * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)`),
5275
+ PersonaID: z.string().describe(`
5276
+ * * Field Name: PersonaID
5277
+ * * Display Name: Persona ID
5278
+ * * SQL Data Type: uniqueidentifier
5279
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)`),
5280
+ Sequence: z.number().describe(`
5281
+ * * Field Name: Sequence
5282
+ * * Display Name: Sequence
5283
+ * * SQL Data Type: int
5284
+ * * Default Value: 0
5285
+ * * Description: Deterministic ordering sequence for persona priority at the model level.`),
5286
+ IsSupported: z.boolean().describe(`
5287
+ * * Field Name: IsSupported
5288
+ * * Display Name: Is Supported
5289
+ * * SQL Data Type: bit
5290
+ * * Default Value: 1
5291
+ * * Description: Whether this persona is supported by the specific model. Set to 0 to explicitly disable an inherited vendor persona for this model.`),
5292
+ __mj_CreatedAt: z.date().describe(`
5293
+ * * Field Name: __mj_CreatedAt
5294
+ * * Display Name: Created At
5295
+ * * SQL Data Type: datetimeoffset
5296
+ * * Default Value: getutcdate()`),
5297
+ __mj_UpdatedAt: z.date().describe(`
5298
+ * * Field Name: __mj_UpdatedAt
5299
+ * * Display Name: Updated At
5300
+ * * SQL Data Type: datetimeoffset
5301
+ * * Default Value: getutcdate()`),
5302
+ Model: z.string().describe(`
5303
+ * * Field Name: Model
5304
+ * * Display Name: Model
5305
+ * * SQL Data Type: nvarchar(50)`),
5306
+ Persona: z.string().describe(`
5307
+ * * Field Name: Persona
5308
+ * * Display Name: Persona
5309
+ * * SQL Data Type: nvarchar(100)`),
5310
+ });
5161
5311
  /**
5162
5312
  * zod schema definition for the entity MJ: AI Model Price Types
5163
5313
  */
@@ -5550,6 +5700,180 @@ export const MJAIModelSchema = z.object({
5550
5700
  * * Display Name: Supports Effort Level
5551
5701
  * * SQL Data Type: bit`),
5552
5702
  });
5703
+ /**
5704
+ * zod schema definition for the entity MJ: AI Persona Vendors
5705
+ */
5706
+ export const MJAIPersonaVendorSchema = z.object({
5707
+ ID: z.string().describe(`
5708
+ * * Field Name: ID
5709
+ * * Display Name: ID
5710
+ * * SQL Data Type: uniqueidentifier
5711
+ * * Default Value: newsequentialid()`),
5712
+ PersonaID: z.string().describe(`
5713
+ * * Field Name: PersonaID
5714
+ * * Display Name: Persona
5715
+ * * SQL Data Type: uniqueidentifier
5716
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)`),
5717
+ VendorID: z.string().describe(`
5718
+ * * Field Name: VendorID
5719
+ * * Display Name: Vendor
5720
+ * * SQL Data Type: uniqueidentifier
5721
+ * * Related Entity/Foreign Key: MJ: AI Vendors (vwAIVendors.ID)`),
5722
+ ModalityID: z.string().describe(`
5723
+ * * Field Name: ModalityID
5724
+ * * Display Name: Modality
5725
+ * * SQL Data Type: uniqueidentifier
5726
+ * * Related Entity/Foreign Key: MJ: AI Modalities (vwAIModalities.ID)`),
5727
+ APIName: z.string().describe(`
5728
+ * * Field Name: APIName
5729
+ * * Display Name: API Asset Name
5730
+ * * SQL Data Type: nvarchar(255)
5731
+ * * Description: Vendor-specific asset name or identifier passed over the wire (e.g., alloy, sage, an ElevenLabs voice_id, or a HeyGen avatar_id).`),
5732
+ Status: z.union([z.literal('Active'), z.literal('Deprecated'), z.literal('Inactive'), z.literal('Preview')]).describe(`
5733
+ * * Field Name: Status
5734
+ * * Display Name: Status
5735
+ * * SQL Data Type: nvarchar(20)
5736
+ * * Default Value: Active
5737
+ * * Value List Type: List
5738
+ * * Possible Values
5739
+ * * Active
5740
+ * * Deprecated
5741
+ * * Inactive
5742
+ * * Preview
5743
+ * * Description: Current operational status of this vendor persona binding.`),
5744
+ Priority: z.number().describe(`
5745
+ * * Field Name: Priority
5746
+ * * Display Name: Priority
5747
+ * * SQL Data Type: int
5748
+ * * Default Value: 0
5749
+ * * Description: Selection priority when multiple vendor bindings qualify for a given persona and modality. Higher numbers indicate higher priority.`),
5750
+ VendorSettings: z.any().nullable().describe(`
5751
+ * * Field Name: VendorSettings
5752
+ * * Display Name: Vendor Settings
5753
+ * * SQL Data Type: nvarchar(MAX)
5754
+ * * JSON Type: MJAIPersonaVendorEntity_IAIPersonaVendorSettings
5755
+ * * Description: Provider-specific configuration JSON (e.g., ElevenLabs stability, similarityBoost, style, useSpeakerBoost).`),
5756
+ __mj_CreatedAt: z.date().describe(`
5757
+ * * Field Name: __mj_CreatedAt
5758
+ * * Display Name: Created At
5759
+ * * SQL Data Type: datetimeoffset
5760
+ * * Default Value: getutcdate()`),
5761
+ __mj_UpdatedAt: z.date().describe(`
5762
+ * * Field Name: __mj_UpdatedAt
5763
+ * * Display Name: Updated At
5764
+ * * SQL Data Type: datetimeoffset
5765
+ * * Default Value: getutcdate()`),
5766
+ Persona: z.string().describe(`
5767
+ * * Field Name: Persona
5768
+ * * Display Name: Persona Name
5769
+ * * SQL Data Type: nvarchar(100)`),
5770
+ Vendor: z.string().describe(`
5771
+ * * Field Name: Vendor
5772
+ * * Display Name: Vendor Name
5773
+ * * SQL Data Type: nvarchar(50)`),
5774
+ Modality: z.string().describe(`
5775
+ * * Field Name: Modality
5776
+ * * Display Name: Modality Name
5777
+ * * SQL Data Type: nvarchar(50)`),
5778
+ });
5779
+ /**
5780
+ * zod schema definition for the entity MJ: AI Personas
5781
+ */
5782
+ export const MJAIPersonaSchema = z.object({
5783
+ ID: z.string().describe(`
5784
+ * * Field Name: ID
5785
+ * * Display Name: ID
5786
+ * * SQL Data Type: uniqueidentifier
5787
+ * * Default Value: newsequentialid()`),
5788
+ Name: z.string().describe(`
5789
+ * * Field Name: Name
5790
+ * * Display Name: Persona Name
5791
+ * * SQL Data Type: nvarchar(100)
5792
+ * * Description: Unique display name identifying this persona (e.g., Alloy, Aria, Sage). Globally unique across all sources to maintain deterministic cross-modality catalog curation.`),
5793
+ Description: z.string().nullable().describe(`
5794
+ * * Field Name: Description
5795
+ * * Display Name: Description
5796
+ * * SQL Data Type: nvarchar(MAX)
5797
+ * * Description: Optional description of the persona, its characteristics, and intended personality.`),
5798
+ PerceivedGender: z.string().nullable().describe(`
5799
+ * * Field Name: PerceivedGender
5800
+ * * Display Name: Perceived Gender
5801
+ * * SQL Data Type: nvarchar(50)
5802
+ * * Description: The perceived gender presentation of this persona (e.g., Male, Female, Neutral, Non-Binary).`),
5803
+ Locale: z.string().nullable().describe(`
5804
+ * * Field Name: Locale
5805
+ * * Display Name: Locale
5806
+ * * SQL Data Type: nvarchar(20)
5807
+ * * Description: BCP 47 language and locale tag primarily associated with this persona (e.g., en-US, es-ES).`),
5808
+ PerceivedAgeRangeMin: z.number().nullable().describe(`
5809
+ * * Field Name: PerceivedAgeRangeMin
5810
+ * * Display Name: Perceived Age Range Min
5811
+ * * SQL Data Type: int
5812
+ * * Description: Approximate minimum perceived age for this persona, enabling numerical filtering.`),
5813
+ PerceivedAgeRangeMax: z.number().nullable().describe(`
5814
+ * * Field Name: PerceivedAgeRangeMax
5815
+ * * Display Name: Perceived Age Range Max
5816
+ * * SQL Data Type: int
5817
+ * * Description: Approximate maximum perceived age for this persona, enabling numerical filtering.`),
5818
+ Tone: z.string().nullable().describe(`
5819
+ * * Field Name: Tone
5820
+ * * Display Name: Tone
5821
+ * * SQL Data Type: nvarchar(255)
5822
+ * * Description: Core tonal quality for this persona (e.g., Warm, Authoritative, Enthusiastic, Calm). Injected into prompt context for conversational delivery.`),
5823
+ SpeakingStyle: z.string().nullable().describe(`
5824
+ * * Field Name: SpeakingStyle
5825
+ * * Display Name: Speaking Style
5826
+ * * SQL Data Type: nvarchar(255)
5827
+ * * Description: Stylistic manner of speaking (e.g., Casual and conversational, Direct and concise, Academic).`),
5828
+ StyleDescriptors: z.any().nullable().describe(`
5829
+ * * Field Name: StyleDescriptors
5830
+ * * Display Name: Style Descriptors
5831
+ * * SQL Data Type: nvarchar(MAX)
5832
+ * * JSON Type: MJAIPersonaEntity_IAIPersonaStyleDescriptors
5833
+ * * Description: Additional descriptive keywords or JSON metadata capturing nuanced personality and presentation traits.`),
5834
+ PreviewAudioURL: z.string().nullable().describe(`
5835
+ * * Field Name: PreviewAudioURL
5836
+ * * Display Name: Preview Audio URL
5837
+ * * SQL Data Type: nvarchar(1000)
5838
+ * * Description: URL to a sample audio file demonstrating this persona's voice.`),
5839
+ PreviewImageURL: z.string().nullable().describe(`
5840
+ * * Field Name: PreviewImageURL
5841
+ * * Display Name: Preview Image URL
5842
+ * * SQL Data Type: nvarchar(1000)
5843
+ * * Description: URL to a preview avatar image for this persona.`),
5844
+ PreviewVideoURL: z.string().nullable().describe(`
5845
+ * * Field Name: PreviewVideoURL
5846
+ * * Display Name: Preview Video URL
5847
+ * * SQL Data Type: nvarchar(1000)
5848
+ * * Description: URL to a preview video demonstrating this persona's visual animation or avatar.`),
5849
+ Source: z.union([z.literal('BuiltIn'), z.literal('Cloned'), z.literal('Custom')]).describe(`
5850
+ * * Field Name: Source
5851
+ * * Display Name: Source
5852
+ * * SQL Data Type: nvarchar(20)
5853
+ * * Default Value: BuiltIn
5854
+ * * Value List Type: List
5855
+ * * Possible Values
5856
+ * * BuiltIn
5857
+ * * Cloned
5858
+ * * Custom
5859
+ * * Description: Origin of this persona: BuiltIn (provided by system/catalog), Custom (user-defined), or Cloned (derived/voice-cloned).`),
5860
+ IsActive: z.boolean().describe(`
5861
+ * * Field Name: IsActive
5862
+ * * Display Name: Is Active
5863
+ * * SQL Data Type: bit
5864
+ * * Default Value: 1
5865
+ * * Description: Whether this persona is currently active and available for selection.`),
5866
+ __mj_CreatedAt: z.date().describe(`
5867
+ * * Field Name: __mj_CreatedAt
5868
+ * * Display Name: Created At
5869
+ * * SQL Data Type: datetimeoffset
5870
+ * * Default Value: getutcdate()`),
5871
+ __mj_UpdatedAt: z.date().describe(`
5872
+ * * Field Name: __mj_UpdatedAt
5873
+ * * Display Name: Updated At
5874
+ * * SQL Data Type: datetimeoffset
5875
+ * * Default Value: getutcdate()`),
5876
+ });
5553
5877
  /**
5554
5878
  * zod schema definition for the entity MJ: AI Prompt Categories
5555
5879
  */
@@ -5707,6 +6031,12 @@ export const MJAIPromptModelSchema = z.object({
5707
6031
  * * Display Name: Effort Level
5708
6032
  * * SQL Data Type: int
5709
6033
  * * Description: Model-specific effort level override (1-100, where 1=minimal effort, 100=maximum effort). Allows customizing effort level per model - useful when a more capable model can use lower effort for tasks that require higher effort from lesser models. Takes precedence over agent and prompt effort levels but can be overridden by runtime parameters.`),
6034
+ PromptConfiguration: z.any().nullable().describe(`
6035
+ * * Field Name: PromptConfiguration
6036
+ * * Display Name: Prompt Configuration
6037
+ * * SQL Data Type: nvarchar(MAX)
6038
+ * * JSON Type: MJAIPromptModelEntity_IAIPromptModelConfiguration
6039
+ * * Description: Most-specific layer of the prompt configuration bag (JSON, IAIPromptModelConfiguration shape) — configuration for THIS prompt on THIS model. Deep-merges per key over the AIPrompt layer, which in turn sits above the model-catalog ModelConfiguration cascade. NULL = inherit the merged configuration unchanged.`),
5710
6040
  Prompt: z.string().describe(`
5711
6041
  * * Field Name: Prompt
5712
6042
  * * Display Name: Prompt
@@ -6315,6 +6645,17 @@ export const MJAIPromptRunSchema = z.object({
6315
6645
  * * SQL Data Type: uniqueidentifier
6316
6646
  * * Related Entity/Foreign Key: MJ: AI Usage Types (vwAIUsageTypes.ID)
6317
6647
  * * Description: The base measure this run's quantities are counted in. Defaults to Tokens, where the Tokens* columns carry the quantity and the units columns are unused; a continuous-media run sets it to Seconds, Characters or Images and populates InputUnitsUsed / OutputUnitsUsed. Always the base measure, never the billing measure: audio billed per hour is still recorded as Seconds, and the price unit type converts. NULL means token-billed, which is what every row predating this column is; it is read as Tokens at one seam in MJAIPromptRunEntityServer, and becomes NOT NULL in the release after the AI Usage Types seed ships.`),
6648
+ ToolCallingMode: z.union([z.literal('Envelope'), z.literal('Native'), z.literal('NativeFallback'), z.literal('NativeImplicit')]).nullable().describe(`
6649
+ * * Field Name: ToolCallingMode
6650
+ * * Display Name: Tool Calling Mode
6651
+ * * SQL Data Type: nvarchar(25)
6652
+ * * Value List Type: List
6653
+ * * Possible Values
6654
+ * * Envelope
6655
+ * * Native
6656
+ * * NativeFallback
6657
+ * * NativeImplicit
6658
+ * * Description: Which tool-calling path this run actually took. 'Native' = Actions declared as tools, control flow in the JSON envelope (the hybrid). 'NativeImplicit' = Actions, sub-agents, payload_change_request and ask_user declared as tools; a tool call continues the loop and plain text ends the turn. 'Envelope' = no tools declared — the vendor-agnostic JSON-envelope path, including a prompt that asked for native mode on a model/vendor without the capability (also logs a warning). 'NativeFallback' = a native attempt failed in a tools-specific way and completed via a single envelope retry. NULL = pre-feature rows or a run that never reached a model call.`),
6318
6659
  Prompt: z.string().describe(`
6319
6660
  * * Field Name: Prompt
6320
6661
  * * Display Name: Prompt
@@ -6806,6 +7147,12 @@ export const MJAIPromptSchema = z.object({
6806
7147
  * * SQL Data Type: bit
6807
7148
  * * Default Value: 0
6808
7149
  * * Description: Only applies when SelectionStrategy is Specific. When 0 (default), if none of the explicitly configured AIPromptModel entries have valid API credentials the system automatically falls back to Default/ByPower model selection across all active models matching the prompt AIModelTypeID. When 1, the system will hard-fail with an error instead of falling back, ensuring only the explicitly configured models are ever used.`),
7150
+ PromptConfiguration: z.any().nullable().describe(`
7151
+ * * Field Name: PromptConfiguration
7152
+ * * Display Name: Prompt Configuration
7153
+ * * SQL Data Type: nvarchar(MAX)
7154
+ * * JSON Type: MJAIPromptEntity_IAIPromptConfiguration
7155
+ * * Description: Per-prompt call-time configuration bag (JSON, IAIPromptConfiguration shape: LLM / Realtime / Vision / Audio sections). Base layer of the prompt Configuration cascade — AIPromptModel rows inherit from it per key and may override — and itself layered on top of the resolved AIModel/AIModelVendor ModelConfiguration. NULL = contributes nothing.`),
6809
7156
  Template: z.string().describe(`
6810
7157
  * * Field Name: Template
6811
7158
  * * Display Name: Template Text
@@ -7054,6 +7401,12 @@ export const MJAISkillActionSchema = z.object({
7054
7401
  * * Display Name: Updated At
7055
7402
  * * SQL Data Type: datetimeoffset
7056
7403
  * * Default Value: getutcdate()`),
7404
+ ExposeToModel: z.boolean().describe(`
7405
+ * * Field Name: ExposeToModel
7406
+ * * Display Name: Expose to Model
7407
+ * * SQL Data Type: bit
7408
+ * * Default Value: 1
7409
+ * * Description: Whether activating the skill puts this action into the agent's run. 1 (default): the action is described to the model and callable during the run, today's behaviour. 0: the action stays bundled with the skill (SKILL.md export, tooling) but is left out of the run entirely: not described to the model and not executable by the agent; only application code invokes it, through the Actions API. Use 0 for actions a person triggers through the UI on a later turn, such as a menu button in the skill's reply.`),
7057
7410
  Skill: z.string().describe(`
7058
7411
  * * Field Name: Skill
7059
7412
  * * Display Name: Skill
@@ -16837,6 +17190,12 @@ export const MJEntitySchema = z.object({
16837
17190
  * * SQL Data Type: nvarchar(MAX)
16838
17191
  * * JSON Type: MJEntityEntity_IEntitySubtypeSelectorConfig
16839
17192
  * * Description: Optional JSON configuration specifying the declarative subtype selector for this entity (shape = IEntitySubtypeSelectorConfig). Path is a dotted foreign-key dereference path ending at a column containing the target subtype entity name (e.g. "ProductID.ProductTypeID.OrderLineExtensionEntity"). Read by BaseEntity.ResolveSubtypeEntityName() as a fallback when no runtime EntitySubtypeResolver is registered, and by offline tooling like Loom and CodeGen to determine conditional IsA child entities. NULL means no declarative subtype selector is configured.`),
17193
+ EnableFieldLevelSecurity: z.boolean().describe(`
17194
+ * * Field Name: EnableFieldLevelSecurity
17195
+ * * Display Name: Enable Field Level Security
17196
+ * * SQL Data Type: bit
17197
+ * * Default Value: 0
17198
+ * * Description: When 1, field-level (column-level) security is enforced for this entity and every enforcement point consults EntityFieldPermission rows. When 0 (the default), field-level security is off entirely and any existing permission rows are retained but inactive. Enabling snapshots the entity's current entity-level permissions into per-field rows, so turning it on changes no behavior until an administrator tightens a field; disabling preserves the rows so re-enabling does not lose the configuration.`),
16840
17199
  CodeName: z.string().nullable().describe(`
16841
17200
  * * Field Name: CodeName
16842
17201
  * * Display Name: Code Name
@@ -17619,6 +17978,77 @@ export const MJEntityDocumentSchema = z.object({
17619
17978
  * * Display Name: Reasoning Agent Name
17620
17979
  * * SQL Data Type: nvarchar(255)`),
17621
17980
  });
17981
+ /**
17982
+ * zod schema definition for the entity MJ: Entity Field Permissions
17983
+ */
17984
+ export const MJEntityFieldPermissionSchema = z.object({
17985
+ ID: z.string().describe(`
17986
+ * * Field Name: ID
17987
+ * * Display Name: ID
17988
+ * * SQL Data Type: uniqueidentifier
17989
+ * * Default Value: newsequentialid()`),
17990
+ EntityFieldID: z.string().describe(`
17991
+ * * Field Name: EntityFieldID
17992
+ * * Display Name: Entity Field ID
17993
+ * * SQL Data Type: uniqueidentifier
17994
+ * * Related Entity/Foreign Key: MJ: Entity Fields (vwEntityFields.ID)`),
17995
+ RoleID: z.string().describe(`
17996
+ * * Field Name: RoleID
17997
+ * * Display Name: Role ID
17998
+ * * SQL Data Type: uniqueidentifier
17999
+ * * Related Entity/Foreign Key: MJ: Roles (vwRoles.ID)`),
18000
+ ReadAccess: z.union([z.literal('Allow'), z.literal('Deny'), z.literal('No Access')]).describe(`
18001
+ * * Field Name: ReadAccess
18002
+ * * Display Name: Read Access
18003
+ * * SQL Data Type: nvarchar(20)
18004
+ * * Default Value: No Access
18005
+ * * Value List Type: List
18006
+ * * Possible Values
18007
+ * * Allow
18008
+ * * Deny
18009
+ * * No Access
18010
+ * * Description: Whether this role may read the field's values. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default) and leaves the outcome to the user's other roles. Enforced at the API output boundary (result projection and GraphQL field mapping), by predicate validation which rejects an ExtraFilter/OrderBy/Aggregate referencing an unreadable field, and by the strongly-typed accessor path which throws.`),
18011
+ UpdateAccess: z.union([z.literal('Allow'), z.literal('Deny'), z.literal('No Access')]).describe(`
18012
+ * * Field Name: UpdateAccess
18013
+ * * Display Name: Update Access
18014
+ * * SQL Data Type: nvarchar(20)
18015
+ * * Default Value: No Access
18016
+ * * Value List Type: List
18017
+ * * Possible Values
18018
+ * * Allow
18019
+ * * Deny
18020
+ * * No Access
18021
+ * * Description: Whether this role may modify the field's value on an EXISTING record. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default). Requires ReadAccess = Allow — a field a user cannot see is one they cannot change. Enforced server-side before SQL generation; the client-side BaseEntity check is UX-level defense-in-depth only.`),
18022
+ CreateAccess: z.union([z.literal('Allow'), z.literal('Deny'), z.literal('No Access')]).describe(`
18023
+ * * Field Name: CreateAccess
18024
+ * * Display Name: Create Access
18025
+ * * SQL Data Type: nvarchar(20)
18026
+ * * Default Value: No Access
18027
+ * * Value List Type: List
18028
+ * * Possible Values
18029
+ * * Allow
18030
+ * * Deny
18031
+ * * No Access
18032
+ * * Description: Whether this role may supply the field's value when INSERTING a record. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default). Requires ReadAccess = Allow. When a user may not create a field, any value they supply is dropped and the column takes its default — the insert is not rejected, matching the read path where a denied field is simply absent rather than an error. A NOT NULL column with no default that a user cannot create makes records uncreatable for that user; restricted fields should be nullable or defaulted.`),
18033
+ __mj_CreatedAt: z.date().describe(`
18034
+ * * Field Name: __mj_CreatedAt
18035
+ * * Display Name: Created At
18036
+ * * SQL Data Type: datetimeoffset
18037
+ * * Default Value: getutcdate()`),
18038
+ __mj_UpdatedAt: z.date().describe(`
18039
+ * * Field Name: __mj_UpdatedAt
18040
+ * * Display Name: Updated At
18041
+ * * SQL Data Type: datetimeoffset
18042
+ * * Default Value: getutcdate()`),
18043
+ EntityField: z.string().describe(`
18044
+ * * Field Name: EntityField
18045
+ * * Display Name: Entity Field
18046
+ * * SQL Data Type: nvarchar(255)`),
18047
+ Role: z.string().describe(`
18048
+ * * Field Name: Role
18049
+ * * Display Name: Role
18050
+ * * SQL Data Type: nvarchar(50)`),
18051
+ });
17622
18052
  /**
17623
18053
  * zod schema definition for the entity MJ: Entity Field Values
17624
18054
  */
@@ -33535,6 +33965,19 @@ let MJAIAgentActionEntity = class MJAIAgentActionEntity extends BaseEntity {
33535
33965
  this.Set('CompactPromptID', value);
33536
33966
  }
33537
33967
  /**
33968
+ * * Field Name: DeclareAsNativeTool
33969
+ * * Display Name: Declare As Native Tool
33970
+ * * SQL Data Type: bit
33971
+ * * Default Value: 1
33972
+ * * Description: Whether this Action may be declared as a native tool for this agent (1, default). 0 keeps it out of the tool set on native turns; because the prose catalog is not rendered in native mode, the action is then unavailable on those turns. Use for actions an agent holds but should rarely reach for on its own.
33973
+ */
33974
+ get DeclareAsNativeTool() {
33975
+ return this.Get('DeclareAsNativeTool');
33976
+ }
33977
+ set DeclareAsNativeTool(value) {
33978
+ this.Set('DeclareAsNativeTool', value);
33979
+ }
33980
+ /**
33538
33981
  * * Field Name: Agent
33539
33982
  * * Display Name: Agent
33540
33983
  * * SQL Data Type: nvarchar(255)
@@ -37090,6 +37533,184 @@ MJAIAgentPermissionEntity = __decorate([
37090
37533
  RegisterClass(BaseEntity, 'MJ: AI Agent Permissions')
37091
37534
  ], MJAIAgentPermissionEntity);
37092
37535
  export { MJAIAgentPermissionEntity };
37536
+ /**
37537
+ * MJ: AI Agent Personas - strongly typed entity sub-class
37538
+ * * Schema: __mj
37539
+ * * Base Table: AIAgentPersona
37540
+ * * Base View: vwAIAgentPersonas
37541
+ * * @description Configures which personas an AI agent is permitted to wear, their preference order, and which persona serves as the agent's default identity.
37542
+ * * Primary Key: ID
37543
+ * @extends {BaseEntity}
37544
+ * @class
37545
+ * @public
37546
+ */
37547
+ let MJAIAgentPersonaEntity = class MJAIAgentPersonaEntity extends BaseEntity {
37548
+ constructor() {
37549
+ super(...arguments);
37550
+ this._StyleOverrideObject_cached = undefined;
37551
+ this._StyleOverrideObject_lastRaw = null;
37552
+ }
37553
+ /**
37554
+ * Loads the MJ: AI Agent Personas record from the database
37555
+ * @param ID: string - primary key value to load the MJ: AI Agent Personas record.
37556
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
37557
+ * @returns {Promise<boolean>} - true if successful, false otherwise
37558
+ * @public
37559
+ * @async
37560
+ * @memberof MJAIAgentPersonaEntity
37561
+ * @method
37562
+ * @override
37563
+ */
37564
+ async Load(ID, EntityRelationshipsToLoad) {
37565
+ const compositeKey = new CompositeKey();
37566
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
37567
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
37568
+ }
37569
+ /**
37570
+ * * Field Name: ID
37571
+ * * Display Name: ID
37572
+ * * SQL Data Type: uniqueidentifier
37573
+ * * Default Value: newsequentialid()
37574
+ */
37575
+ get ID() {
37576
+ return this.Get('ID');
37577
+ }
37578
+ set ID(value) {
37579
+ this.Set('ID', value);
37580
+ }
37581
+ /**
37582
+ * * Field Name: AgentID
37583
+ * * Display Name: Agent
37584
+ * * SQL Data Type: uniqueidentifier
37585
+ * * Related Entity/Foreign Key: MJ: AI Agents (vwAIAgents.ID)
37586
+ */
37587
+ get AgentID() {
37588
+ return this.Get('AgentID');
37589
+ }
37590
+ set AgentID(value) {
37591
+ this.Set('AgentID', value);
37592
+ }
37593
+ /**
37594
+ * * Field Name: PersonaID
37595
+ * * Display Name: Persona
37596
+ * * SQL Data Type: uniqueidentifier
37597
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)
37598
+ */
37599
+ get PersonaID() {
37600
+ return this.Get('PersonaID');
37601
+ }
37602
+ set PersonaID(value) {
37603
+ this.Set('PersonaID', value);
37604
+ }
37605
+ /**
37606
+ * * Field Name: IsDefault
37607
+ * * Display Name: Is Default Persona
37608
+ * * SQL Data Type: bit
37609
+ * * Default Value: 0
37610
+ * * Description: Indicates whether this persona is the default presentation for the agent when none is explicitly requested.
37611
+ */
37612
+ get IsDefault() {
37613
+ return this.Get('IsDefault');
37614
+ }
37615
+ set IsDefault(value) {
37616
+ this.Set('IsDefault', value);
37617
+ }
37618
+ /**
37619
+ * * Field Name: Sequence
37620
+ * * Display Name: Display Sequence
37621
+ * * SQL Data Type: int
37622
+ * * Default Value: 0
37623
+ * * Description: Ordering sequence for displaying available personas in user interfaces.
37624
+ */
37625
+ get Sequence() {
37626
+ return this.Get('Sequence');
37627
+ }
37628
+ set Sequence(value) {
37629
+ this.Set('Sequence', value);
37630
+ }
37631
+ /**
37632
+ * * Field Name: IsAllowed
37633
+ * * Display Name: Is Allowed
37634
+ * * SQL Data Type: bit
37635
+ * * Default Value: 1
37636
+ * * Description: Whether the agent is allowed to use this persona. Set to 0 to explicitly disable or veto a persona.
37637
+ */
37638
+ get IsAllowed() {
37639
+ return this.Get('IsAllowed');
37640
+ }
37641
+ set IsAllowed(value) {
37642
+ this.Set('IsAllowed', value);
37643
+ }
37644
+ /**
37645
+ * * Field Name: StyleOverride
37646
+ * * Display Name: Style Override
37647
+ * * SQL Data Type: nvarchar(MAX)
37648
+ * * JSON Type: MJAIAgentPersonaEntity_IAIAgentPersonaStyleOverride
37649
+ * * Description: Optional JSON payload overriding or refining persona presentation specifically for this agent (e.g. Tone or SpeakingStyle adjustments).
37650
+ */
37651
+ get StyleOverride() {
37652
+ return this.Get('StyleOverride');
37653
+ }
37654
+ set StyleOverride(value) {
37655
+ this.Set('StyleOverride', value);
37656
+ }
37657
+ /**
37658
+ * Typed accessor for StyleOverride — returns parsed JSON as MJAIAgentPersonaEntity_IAIAgentPersonaStyleOverride.
37659
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
37660
+ */
37661
+ get StyleOverrideObject() {
37662
+ const raw = this.StyleOverride;
37663
+ if (raw !== this._StyleOverrideObject_lastRaw) {
37664
+ this._StyleOverrideObject_cached = raw ? JSON.parse(raw) : null;
37665
+ this._StyleOverrideObject_lastRaw = raw;
37666
+ }
37667
+ return this._StyleOverrideObject_cached;
37668
+ }
37669
+ set StyleOverrideObject(value) {
37670
+ const raw = value ? JSON.stringify(value) : null;
37671
+ this.StyleOverride = raw;
37672
+ this._StyleOverrideObject_cached = value;
37673
+ this._StyleOverrideObject_lastRaw = raw;
37674
+ }
37675
+ /**
37676
+ * * Field Name: __mj_CreatedAt
37677
+ * * Display Name: Created At
37678
+ * * SQL Data Type: datetimeoffset
37679
+ * * Default Value: getutcdate()
37680
+ */
37681
+ get __mj_CreatedAt() {
37682
+ return this.Get('__mj_CreatedAt');
37683
+ }
37684
+ /**
37685
+ * * Field Name: __mj_UpdatedAt
37686
+ * * Display Name: Updated At
37687
+ * * SQL Data Type: datetimeoffset
37688
+ * * Default Value: getutcdate()
37689
+ */
37690
+ get __mj_UpdatedAt() {
37691
+ return this.Get('__mj_UpdatedAt');
37692
+ }
37693
+ /**
37694
+ * * Field Name: Agent
37695
+ * * Display Name: Agent Name
37696
+ * * SQL Data Type: nvarchar(255)
37697
+ */
37698
+ get Agent() {
37699
+ return this.Get('Agent');
37700
+ }
37701
+ /**
37702
+ * * Field Name: Persona
37703
+ * * Display Name: Persona Name
37704
+ * * SQL Data Type: nvarchar(100)
37705
+ */
37706
+ get Persona() {
37707
+ return this.Get('Persona');
37708
+ }
37709
+ };
37710
+ MJAIAgentPersonaEntity = __decorate([
37711
+ RegisterClass(BaseEntity, 'MJ: AI Agent Personas')
37712
+ ], MJAIAgentPersonaEntity);
37713
+ export { MJAIAgentPersonaEntity };
37093
37714
  /**
37094
37715
  * MJ: AI Agent Prompts - strongly typed entity sub-class
37095
37716
  * * Schema: __mj
@@ -38797,6 +39418,60 @@ detailed information about what validation rules failed.
38797
39418
  this._SkillsObject_lastRaw = raw;
38798
39419
  }
38799
39420
  /**
39421
+ * * Field Name: ToolCallingMode
39422
+ * * Display Name: Tool Calling Mode
39423
+ * * SQL Data Type: nvarchar(25)
39424
+ * * Value List Type: List
39425
+ * * Possible Values
39426
+ * * Envelope
39427
+ * * Native
39428
+ * * NativeFallback
39429
+ * * NativeImplicit
39430
+ * * Description: Which tool-calling path this step's model call took: Native (Actions as tools, envelope control flow), NativeImplicit (Actions, sub-agents, payload changes and ask_user as tools; plain text ends the turn), Envelope (prose action catalog + JSON envelope), or NativeFallback (a native attempt failed in a tools-specific way and completed via an envelope retry). NULL for steps that never reached a model call, and for rows predating the feature.
39431
+ */
39432
+ get ToolCallingMode() {
39433
+ return this.Get('ToolCallingMode');
39434
+ }
39435
+ set ToolCallingMode(value) {
39436
+ this.Set('ToolCallingMode', value);
39437
+ }
39438
+ /**
39439
+ * * Field Name: NativeToolCallCount
39440
+ * * Display Name: Native Tool Call Count
39441
+ * * SQL Data Type: int
39442
+ * * Description: How many native tool calls the model made on this step. 0 on a native-mode step where the model chose to answer with the envelope instead; NULL when the step took the envelope path or never reached a model call.
39443
+ */
39444
+ get NativeToolCallCount() {
39445
+ return this.Get('NativeToolCallCount');
39446
+ }
39447
+ set NativeToolCallCount(value) {
39448
+ this.Set('NativeToolCallCount', value);
39449
+ }
39450
+ /**
39451
+ * * Field Name: NativeDualChannel
39452
+ * * Display Name: Native Dual Channel
39453
+ * * SQL Data Type: bit
39454
+ * * Description: On a native-mode step where the model made tool calls: 1 when the same turn also carried a parseable JSON Loop envelope (the model answered on both channels; the loop dispatched the tool call and discarded the envelope), 0 when the tool calls came alone. NULL when the step made no tool calls or took the envelope path.
39455
+ */
39456
+ get NativeDualChannel() {
39457
+ return this.Get('NativeDualChannel');
39458
+ }
39459
+ set NativeDualChannel(value) {
39460
+ this.Set('NativeDualChannel', value);
39461
+ }
39462
+ /**
39463
+ * * Field Name: NativeToolResultsSent
39464
+ * * Display Name: Native Tool Results Sent
39465
+ * * SQL Data Type: bit
39466
+ * * Description: For native tool-calling steps: 1 = the results of this step's tool calls were returned to the model as native tool-result turns, 0 = as the markdown action-results user message. NULL for envelope steps and for rows predating the feature.
39467
+ */
39468
+ get NativeToolResultsSent() {
39469
+ return this.Get('NativeToolResultsSent');
39470
+ }
39471
+ set NativeToolResultsSent(value) {
39472
+ this.Set('NativeToolResultsSent', value);
39473
+ }
39474
+ /**
38800
39475
  * * Field Name: AgentRun
38801
39476
  * * Display Name: Agent Run Context
38802
39477
  * * SQL Data Type: nvarchar(255)
@@ -43535,6 +44210,19 @@ if this limit is exceeded.
43535
44210
  this.Set('ConversationSummaryPromptID', value);
43536
44211
  }
43537
44212
  /**
44213
+ * * Field Name: DeclareActionsAsNativeTools
44214
+ * * Display Name: Declare Actions As Native Tools
44215
+ * * SQL Data Type: bit
44216
+ * * Default Value: 1
44217
+ * * Description: When native tool calling is in effect for a run, whether this agent's Actions are declared as native tools (1, default) or withheld so the agent runs on the envelope path with the prose action catalog (0). Set 0 for coordinator agents whose prompt forbids doing work themselves. Controls supply only: capability and preference on the model and prompt still decide whether declared tools are used.
44218
+ */
44219
+ get DeclareActionsAsNativeTools() {
44220
+ return this.Get('DeclareActionsAsNativeTools');
44221
+ }
44222
+ set DeclareActionsAsNativeTools(value) {
44223
+ this.Set('DeclareActionsAsNativeTools', value);
44224
+ }
44225
+ /**
43538
44226
  * * Field Name: Parent
43539
44227
  * * Display Name: Parent
43540
44228
  * * SQL Data Type: nvarchar(255)
@@ -46218,6 +46906,135 @@ MJAIModelModalityEntity = __decorate([
46218
46906
  RegisterClass(BaseEntity, 'MJ: AI Model Modalities')
46219
46907
  ], MJAIModelModalityEntity);
46220
46908
  export { MJAIModelModalityEntity };
46909
+ /**
46910
+ * MJ: AI Model Personas - strongly typed entity sub-class
46911
+ * * Schema: __mj
46912
+ * * Base Table: AIModelPersona
46913
+ * * Base View: vwAIModelPersonas
46914
+ * * @description Specifies per-model persona availability overrides where a model's supported personas differ from its vendor's default catalog.
46915
+ * * Primary Key: ID
46916
+ * @extends {BaseEntity}
46917
+ * @class
46918
+ * @public
46919
+ */
46920
+ let MJAIModelPersonaEntity = class MJAIModelPersonaEntity extends BaseEntity {
46921
+ /**
46922
+ * Loads the MJ: AI Model Personas record from the database
46923
+ * @param ID: string - primary key value to load the MJ: AI Model Personas record.
46924
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
46925
+ * @returns {Promise<boolean>} - true if successful, false otherwise
46926
+ * @public
46927
+ * @async
46928
+ * @memberof MJAIModelPersonaEntity
46929
+ * @method
46930
+ * @override
46931
+ */
46932
+ async Load(ID, EntityRelationshipsToLoad) {
46933
+ const compositeKey = new CompositeKey();
46934
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
46935
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
46936
+ }
46937
+ /**
46938
+ * * Field Name: ID
46939
+ * * Display Name: ID
46940
+ * * SQL Data Type: uniqueidentifier
46941
+ * * Default Value: newsequentialid()
46942
+ */
46943
+ get ID() {
46944
+ return this.Get('ID');
46945
+ }
46946
+ set ID(value) {
46947
+ this.Set('ID', value);
46948
+ }
46949
+ /**
46950
+ * * Field Name: ModelID
46951
+ * * Display Name: Model ID
46952
+ * * SQL Data Type: uniqueidentifier
46953
+ * * Related Entity/Foreign Key: MJ: AI Models (vwAIModels.ID)
46954
+ */
46955
+ get ModelID() {
46956
+ return this.Get('ModelID');
46957
+ }
46958
+ set ModelID(value) {
46959
+ this.Set('ModelID', value);
46960
+ }
46961
+ /**
46962
+ * * Field Name: PersonaID
46963
+ * * Display Name: Persona ID
46964
+ * * SQL Data Type: uniqueidentifier
46965
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)
46966
+ */
46967
+ get PersonaID() {
46968
+ return this.Get('PersonaID');
46969
+ }
46970
+ set PersonaID(value) {
46971
+ this.Set('PersonaID', value);
46972
+ }
46973
+ /**
46974
+ * * Field Name: Sequence
46975
+ * * Display Name: Sequence
46976
+ * * SQL Data Type: int
46977
+ * * Default Value: 0
46978
+ * * Description: Deterministic ordering sequence for persona priority at the model level.
46979
+ */
46980
+ get Sequence() {
46981
+ return this.Get('Sequence');
46982
+ }
46983
+ set Sequence(value) {
46984
+ this.Set('Sequence', value);
46985
+ }
46986
+ /**
46987
+ * * Field Name: IsSupported
46988
+ * * Display Name: Is Supported
46989
+ * * SQL Data Type: bit
46990
+ * * Default Value: 1
46991
+ * * Description: Whether this persona is supported by the specific model. Set to 0 to explicitly disable an inherited vendor persona for this model.
46992
+ */
46993
+ get IsSupported() {
46994
+ return this.Get('IsSupported');
46995
+ }
46996
+ set IsSupported(value) {
46997
+ this.Set('IsSupported', value);
46998
+ }
46999
+ /**
47000
+ * * Field Name: __mj_CreatedAt
47001
+ * * Display Name: Created At
47002
+ * * SQL Data Type: datetimeoffset
47003
+ * * Default Value: getutcdate()
47004
+ */
47005
+ get __mj_CreatedAt() {
47006
+ return this.Get('__mj_CreatedAt');
47007
+ }
47008
+ /**
47009
+ * * Field Name: __mj_UpdatedAt
47010
+ * * Display Name: Updated At
47011
+ * * SQL Data Type: datetimeoffset
47012
+ * * Default Value: getutcdate()
47013
+ */
47014
+ get __mj_UpdatedAt() {
47015
+ return this.Get('__mj_UpdatedAt');
47016
+ }
47017
+ /**
47018
+ * * Field Name: Model
47019
+ * * Display Name: Model
47020
+ * * SQL Data Type: nvarchar(50)
47021
+ */
47022
+ get Model() {
47023
+ return this.Get('Model');
47024
+ }
47025
+ /**
47026
+ * * Field Name: Persona
47027
+ * * Display Name: Persona
47028
+ * * SQL Data Type: nvarchar(100)
47029
+ */
47030
+ get Persona() {
47031
+ return this.Get('Persona');
47032
+ }
47033
+ };
47034
+ MJAIModelPersonaEntity = __decorate([
47035
+ RegisterClass(BaseEntity, 'MJ: AI Model Personas')
47036
+ ], MJAIModelPersonaEntity);
47037
+ export { MJAIModelPersonaEntity };
46221
47038
  /**
46222
47039
  * MJ: AI Model Price Types - strongly typed entity sub-class
46223
47040
  * * Schema: __mj
@@ -46361,6 +47178,7 @@ let MJAIModelPriceUnitTypeEntity = class MJAIModelPriceUnitTypeEntity extends Ba
46361
47178
  * Validate() method override for MJ: AI Model Price Unit Types entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
46362
47179
  * * DriverClass: This rule ensures that the DriverClass field contains at least one non-whitespace character and is not left blank.
46363
47180
  * * Name: This rule ensures that the Name field is not empty or made up only of spaces. It must contain at least one non-space character.
47181
+ * * UnitsPerBillingUnit: Units per billing unit must be greater than zero to ensure valid billing calculations.
46364
47182
  * @public
46365
47183
  * @method
46366
47184
  * @override
@@ -46369,6 +47187,7 @@ let MJAIModelPriceUnitTypeEntity = class MJAIModelPriceUnitTypeEntity extends Ba
46369
47187
  const result = super.Validate();
46370
47188
  this.ValidateDriverClassNotBlank(result);
46371
47189
  this.ValidateNameHasNonWhitespaceCharacters(result);
47190
+ this.ValidateUnitsPerBillingUnitGreaterThanZero(result);
46372
47191
  result.Success = result.Success && (result.Errors.length === 0);
46373
47192
  return result;
46374
47193
  }
@@ -46395,6 +47214,17 @@ let MJAIModelPriceUnitTypeEntity = class MJAIModelPriceUnitTypeEntity extends Ba
46395
47214
  }
46396
47215
  }
46397
47216
  /**
47217
+ * Units per billing unit must be greater than zero to ensure valid billing calculations.
47218
+ * @param result - the ValidationResult object to add any errors or warnings to
47219
+ * @public
47220
+ * @method
47221
+ */
47222
+ ValidateUnitsPerBillingUnitGreaterThanZero(result) {
47223
+ if (this.UnitsPerBillingUnit != null && this.UnitsPerBillingUnit <= 0) {
47224
+ result.Errors.push(new ValidationErrorInfo("UnitsPerBillingUnit", "Units per billing unit must be greater than zero.", this.UnitsPerBillingUnit, ValidationErrorType.Failure));
47225
+ }
47226
+ }
47227
+ /**
46398
47228
  * * Field Name: ID
46399
47229
  * * Display Name: ID
46400
47230
  * * SQL Data Type: uniqueidentifier
@@ -47433,6 +48263,471 @@ MJAIModelEntity = __decorate([
47433
48263
  RegisterClass(BaseEntity, 'MJ: AI Models')
47434
48264
  ], MJAIModelEntity);
47435
48265
  export { MJAIModelEntity };
48266
+ /**
48267
+ * MJ: AI Persona Vendors - strongly typed entity sub-class
48268
+ * * Schema: __mj
48269
+ * * Base Table: AIPersonaVendor
48270
+ * * Base View: vwAIPersonaVendors
48271
+ * * @description Concrete vendor and modality binding for a persona, mapping the abstract persona to a provider-specific wire asset identifier (voice ID or avatar ID).
48272
+ * * Primary Key: ID
48273
+ * @extends {BaseEntity}
48274
+ * @class
48275
+ * @public
48276
+ */
48277
+ let MJAIPersonaVendorEntity = class MJAIPersonaVendorEntity extends BaseEntity {
48278
+ constructor() {
48279
+ super(...arguments);
48280
+ this._VendorSettingsObject_cached = undefined;
48281
+ this._VendorSettingsObject_lastRaw = null;
48282
+ }
48283
+ /**
48284
+ * Loads the MJ: AI Persona Vendors record from the database
48285
+ * @param ID: string - primary key value to load the MJ: AI Persona Vendors record.
48286
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
48287
+ * @returns {Promise<boolean>} - true if successful, false otherwise
48288
+ * @public
48289
+ * @async
48290
+ * @memberof MJAIPersonaVendorEntity
48291
+ * @method
48292
+ * @override
48293
+ */
48294
+ async Load(ID, EntityRelationshipsToLoad) {
48295
+ const compositeKey = new CompositeKey();
48296
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
48297
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
48298
+ }
48299
+ /**
48300
+ * * Field Name: ID
48301
+ * * Display Name: ID
48302
+ * * SQL Data Type: uniqueidentifier
48303
+ * * Default Value: newsequentialid()
48304
+ */
48305
+ get ID() {
48306
+ return this.Get('ID');
48307
+ }
48308
+ set ID(value) {
48309
+ this.Set('ID', value);
48310
+ }
48311
+ /**
48312
+ * * Field Name: PersonaID
48313
+ * * Display Name: Persona
48314
+ * * SQL Data Type: uniqueidentifier
48315
+ * * Related Entity/Foreign Key: MJ: AI Personas (vwAIPersonas.ID)
48316
+ */
48317
+ get PersonaID() {
48318
+ return this.Get('PersonaID');
48319
+ }
48320
+ set PersonaID(value) {
48321
+ this.Set('PersonaID', value);
48322
+ }
48323
+ /**
48324
+ * * Field Name: VendorID
48325
+ * * Display Name: Vendor
48326
+ * * SQL Data Type: uniqueidentifier
48327
+ * * Related Entity/Foreign Key: MJ: AI Vendors (vwAIVendors.ID)
48328
+ */
48329
+ get VendorID() {
48330
+ return this.Get('VendorID');
48331
+ }
48332
+ set VendorID(value) {
48333
+ this.Set('VendorID', value);
48334
+ }
48335
+ /**
48336
+ * * Field Name: ModalityID
48337
+ * * Display Name: Modality
48338
+ * * SQL Data Type: uniqueidentifier
48339
+ * * Related Entity/Foreign Key: MJ: AI Modalities (vwAIModalities.ID)
48340
+ */
48341
+ get ModalityID() {
48342
+ return this.Get('ModalityID');
48343
+ }
48344
+ set ModalityID(value) {
48345
+ this.Set('ModalityID', value);
48346
+ }
48347
+ /**
48348
+ * * Field Name: APIName
48349
+ * * Display Name: API Asset Name
48350
+ * * SQL Data Type: nvarchar(255)
48351
+ * * Description: Vendor-specific asset name or identifier passed over the wire (e.g., alloy, sage, an ElevenLabs voice_id, or a HeyGen avatar_id).
48352
+ */
48353
+ get APIName() {
48354
+ return this.Get('APIName');
48355
+ }
48356
+ set APIName(value) {
48357
+ this.Set('APIName', value);
48358
+ }
48359
+ /**
48360
+ * * Field Name: Status
48361
+ * * Display Name: Status
48362
+ * * SQL Data Type: nvarchar(20)
48363
+ * * Default Value: Active
48364
+ * * Value List Type: List
48365
+ * * Possible Values
48366
+ * * Active
48367
+ * * Deprecated
48368
+ * * Inactive
48369
+ * * Preview
48370
+ * * Description: Current operational status of this vendor persona binding.
48371
+ */
48372
+ get Status() {
48373
+ return this.Get('Status');
48374
+ }
48375
+ set Status(value) {
48376
+ this.Set('Status', value);
48377
+ }
48378
+ /**
48379
+ * * Field Name: Priority
48380
+ * * Display Name: Priority
48381
+ * * SQL Data Type: int
48382
+ * * Default Value: 0
48383
+ * * Description: Selection priority when multiple vendor bindings qualify for a given persona and modality. Higher numbers indicate higher priority.
48384
+ */
48385
+ get Priority() {
48386
+ return this.Get('Priority');
48387
+ }
48388
+ set Priority(value) {
48389
+ this.Set('Priority', value);
48390
+ }
48391
+ /**
48392
+ * * Field Name: VendorSettings
48393
+ * * Display Name: Vendor Settings
48394
+ * * SQL Data Type: nvarchar(MAX)
48395
+ * * JSON Type: MJAIPersonaVendorEntity_IAIPersonaVendorSettings
48396
+ * * Description: Provider-specific configuration JSON (e.g., ElevenLabs stability, similarityBoost, style, useSpeakerBoost).
48397
+ */
48398
+ get VendorSettings() {
48399
+ return this.Get('VendorSettings');
48400
+ }
48401
+ set VendorSettings(value) {
48402
+ this.Set('VendorSettings', value);
48403
+ }
48404
+ /**
48405
+ * Typed accessor for VendorSettings — returns parsed JSON as MJAIPersonaVendorEntity_IAIPersonaVendorSettings.
48406
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
48407
+ */
48408
+ get VendorSettingsObject() {
48409
+ const raw = this.VendorSettings;
48410
+ if (raw !== this._VendorSettingsObject_lastRaw) {
48411
+ this._VendorSettingsObject_cached = raw ? JSON.parse(raw) : null;
48412
+ this._VendorSettingsObject_lastRaw = raw;
48413
+ }
48414
+ return this._VendorSettingsObject_cached;
48415
+ }
48416
+ set VendorSettingsObject(value) {
48417
+ const raw = value ? JSON.stringify(value) : null;
48418
+ this.VendorSettings = raw;
48419
+ this._VendorSettingsObject_cached = value;
48420
+ this._VendorSettingsObject_lastRaw = raw;
48421
+ }
48422
+ /**
48423
+ * * Field Name: __mj_CreatedAt
48424
+ * * Display Name: Created At
48425
+ * * SQL Data Type: datetimeoffset
48426
+ * * Default Value: getutcdate()
48427
+ */
48428
+ get __mj_CreatedAt() {
48429
+ return this.Get('__mj_CreatedAt');
48430
+ }
48431
+ /**
48432
+ * * Field Name: __mj_UpdatedAt
48433
+ * * Display Name: Updated At
48434
+ * * SQL Data Type: datetimeoffset
48435
+ * * Default Value: getutcdate()
48436
+ */
48437
+ get __mj_UpdatedAt() {
48438
+ return this.Get('__mj_UpdatedAt');
48439
+ }
48440
+ /**
48441
+ * * Field Name: Persona
48442
+ * * Display Name: Persona Name
48443
+ * * SQL Data Type: nvarchar(100)
48444
+ */
48445
+ get Persona() {
48446
+ return this.Get('Persona');
48447
+ }
48448
+ /**
48449
+ * * Field Name: Vendor
48450
+ * * Display Name: Vendor Name
48451
+ * * SQL Data Type: nvarchar(50)
48452
+ */
48453
+ get Vendor() {
48454
+ return this.Get('Vendor');
48455
+ }
48456
+ /**
48457
+ * * Field Name: Modality
48458
+ * * Display Name: Modality Name
48459
+ * * SQL Data Type: nvarchar(50)
48460
+ */
48461
+ get Modality() {
48462
+ return this.Get('Modality');
48463
+ }
48464
+ };
48465
+ MJAIPersonaVendorEntity = __decorate([
48466
+ RegisterClass(BaseEntity, 'MJ: AI Persona Vendors')
48467
+ ], MJAIPersonaVendorEntity);
48468
+ export { MJAIPersonaVendorEntity };
48469
+ /**
48470
+ * MJ: AI Personas - strongly typed entity sub-class
48471
+ * * Schema: __mj
48472
+ * * Base Table: AIPersona
48473
+ * * Base View: vwAIPersonas
48474
+ * * @description Abstract, provider-agnostic presentational identity (voice and/or visual appearance) that AI agents can assume when interacting with users.
48475
+ * * Primary Key: ID
48476
+ * @extends {BaseEntity}
48477
+ * @class
48478
+ * @public
48479
+ */
48480
+ let MJAIPersonaEntity = class MJAIPersonaEntity extends BaseEntity {
48481
+ constructor() {
48482
+ super(...arguments);
48483
+ this._StyleDescriptorsObject_cached = undefined;
48484
+ this._StyleDescriptorsObject_lastRaw = null;
48485
+ }
48486
+ /**
48487
+ * Loads the MJ: AI Personas record from the database
48488
+ * @param ID: string - primary key value to load the MJ: AI Personas record.
48489
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
48490
+ * @returns {Promise<boolean>} - true if successful, false otherwise
48491
+ * @public
48492
+ * @async
48493
+ * @memberof MJAIPersonaEntity
48494
+ * @method
48495
+ * @override
48496
+ */
48497
+ async Load(ID, EntityRelationshipsToLoad) {
48498
+ const compositeKey = new CompositeKey();
48499
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
48500
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
48501
+ }
48502
+ /**
48503
+ * * Field Name: ID
48504
+ * * Display Name: ID
48505
+ * * SQL Data Type: uniqueidentifier
48506
+ * * Default Value: newsequentialid()
48507
+ */
48508
+ get ID() {
48509
+ return this.Get('ID');
48510
+ }
48511
+ set ID(value) {
48512
+ this.Set('ID', value);
48513
+ }
48514
+ /**
48515
+ * * Field Name: Name
48516
+ * * Display Name: Persona Name
48517
+ * * SQL Data Type: nvarchar(100)
48518
+ * * Description: Unique display name identifying this persona (e.g., Alloy, Aria, Sage). Globally unique across all sources to maintain deterministic cross-modality catalog curation.
48519
+ */
48520
+ get Name() {
48521
+ return this.Get('Name');
48522
+ }
48523
+ set Name(value) {
48524
+ this.Set('Name', value);
48525
+ }
48526
+ /**
48527
+ * * Field Name: Description
48528
+ * * Display Name: Description
48529
+ * * SQL Data Type: nvarchar(MAX)
48530
+ * * Description: Optional description of the persona, its characteristics, and intended personality.
48531
+ */
48532
+ get Description() {
48533
+ return this.Get('Description');
48534
+ }
48535
+ set Description(value) {
48536
+ this.Set('Description', value);
48537
+ }
48538
+ /**
48539
+ * * Field Name: PerceivedGender
48540
+ * * Display Name: Perceived Gender
48541
+ * * SQL Data Type: nvarchar(50)
48542
+ * * Description: The perceived gender presentation of this persona (e.g., Male, Female, Neutral, Non-Binary).
48543
+ */
48544
+ get PerceivedGender() {
48545
+ return this.Get('PerceivedGender');
48546
+ }
48547
+ set PerceivedGender(value) {
48548
+ this.Set('PerceivedGender', value);
48549
+ }
48550
+ /**
48551
+ * * Field Name: Locale
48552
+ * * Display Name: Locale
48553
+ * * SQL Data Type: nvarchar(20)
48554
+ * * Description: BCP 47 language and locale tag primarily associated with this persona (e.g., en-US, es-ES).
48555
+ */
48556
+ get Locale() {
48557
+ return this.Get('Locale');
48558
+ }
48559
+ set Locale(value) {
48560
+ this.Set('Locale', value);
48561
+ }
48562
+ /**
48563
+ * * Field Name: PerceivedAgeRangeMin
48564
+ * * Display Name: Perceived Age Range Min
48565
+ * * SQL Data Type: int
48566
+ * * Description: Approximate minimum perceived age for this persona, enabling numerical filtering.
48567
+ */
48568
+ get PerceivedAgeRangeMin() {
48569
+ return this.Get('PerceivedAgeRangeMin');
48570
+ }
48571
+ set PerceivedAgeRangeMin(value) {
48572
+ this.Set('PerceivedAgeRangeMin', value);
48573
+ }
48574
+ /**
48575
+ * * Field Name: PerceivedAgeRangeMax
48576
+ * * Display Name: Perceived Age Range Max
48577
+ * * SQL Data Type: int
48578
+ * * Description: Approximate maximum perceived age for this persona, enabling numerical filtering.
48579
+ */
48580
+ get PerceivedAgeRangeMax() {
48581
+ return this.Get('PerceivedAgeRangeMax');
48582
+ }
48583
+ set PerceivedAgeRangeMax(value) {
48584
+ this.Set('PerceivedAgeRangeMax', value);
48585
+ }
48586
+ /**
48587
+ * * Field Name: Tone
48588
+ * * Display Name: Tone
48589
+ * * SQL Data Type: nvarchar(255)
48590
+ * * Description: Core tonal quality for this persona (e.g., Warm, Authoritative, Enthusiastic, Calm). Injected into prompt context for conversational delivery.
48591
+ */
48592
+ get Tone() {
48593
+ return this.Get('Tone');
48594
+ }
48595
+ set Tone(value) {
48596
+ this.Set('Tone', value);
48597
+ }
48598
+ /**
48599
+ * * Field Name: SpeakingStyle
48600
+ * * Display Name: Speaking Style
48601
+ * * SQL Data Type: nvarchar(255)
48602
+ * * Description: Stylistic manner of speaking (e.g., Casual and conversational, Direct and concise, Academic).
48603
+ */
48604
+ get SpeakingStyle() {
48605
+ return this.Get('SpeakingStyle');
48606
+ }
48607
+ set SpeakingStyle(value) {
48608
+ this.Set('SpeakingStyle', value);
48609
+ }
48610
+ /**
48611
+ * * Field Name: StyleDescriptors
48612
+ * * Display Name: Style Descriptors
48613
+ * * SQL Data Type: nvarchar(MAX)
48614
+ * * JSON Type: MJAIPersonaEntity_IAIPersonaStyleDescriptors
48615
+ * * Description: Additional descriptive keywords or JSON metadata capturing nuanced personality and presentation traits.
48616
+ */
48617
+ get StyleDescriptors() {
48618
+ return this.Get('StyleDescriptors');
48619
+ }
48620
+ set StyleDescriptors(value) {
48621
+ this.Set('StyleDescriptors', value);
48622
+ }
48623
+ /**
48624
+ * Typed accessor for StyleDescriptors — returns parsed JSON as MJAIPersonaEntity_IAIPersonaStyleDescriptors.
48625
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
48626
+ */
48627
+ get StyleDescriptorsObject() {
48628
+ const raw = this.StyleDescriptors;
48629
+ if (raw !== this._StyleDescriptorsObject_lastRaw) {
48630
+ this._StyleDescriptorsObject_cached = raw ? JSON.parse(raw) : null;
48631
+ this._StyleDescriptorsObject_lastRaw = raw;
48632
+ }
48633
+ return this._StyleDescriptorsObject_cached;
48634
+ }
48635
+ set StyleDescriptorsObject(value) {
48636
+ const raw = value ? JSON.stringify(value) : null;
48637
+ this.StyleDescriptors = raw;
48638
+ this._StyleDescriptorsObject_cached = value;
48639
+ this._StyleDescriptorsObject_lastRaw = raw;
48640
+ }
48641
+ /**
48642
+ * * Field Name: PreviewAudioURL
48643
+ * * Display Name: Preview Audio URL
48644
+ * * SQL Data Type: nvarchar(1000)
48645
+ * * Description: URL to a sample audio file demonstrating this persona's voice.
48646
+ */
48647
+ get PreviewAudioURL() {
48648
+ return this.Get('PreviewAudioURL');
48649
+ }
48650
+ set PreviewAudioURL(value) {
48651
+ this.Set('PreviewAudioURL', value);
48652
+ }
48653
+ /**
48654
+ * * Field Name: PreviewImageURL
48655
+ * * Display Name: Preview Image URL
48656
+ * * SQL Data Type: nvarchar(1000)
48657
+ * * Description: URL to a preview avatar image for this persona.
48658
+ */
48659
+ get PreviewImageURL() {
48660
+ return this.Get('PreviewImageURL');
48661
+ }
48662
+ set PreviewImageURL(value) {
48663
+ this.Set('PreviewImageURL', value);
48664
+ }
48665
+ /**
48666
+ * * Field Name: PreviewVideoURL
48667
+ * * Display Name: Preview Video URL
48668
+ * * SQL Data Type: nvarchar(1000)
48669
+ * * Description: URL to a preview video demonstrating this persona's visual animation or avatar.
48670
+ */
48671
+ get PreviewVideoURL() {
48672
+ return this.Get('PreviewVideoURL');
48673
+ }
48674
+ set PreviewVideoURL(value) {
48675
+ this.Set('PreviewVideoURL', value);
48676
+ }
48677
+ /**
48678
+ * * Field Name: Source
48679
+ * * Display Name: Source
48680
+ * * SQL Data Type: nvarchar(20)
48681
+ * * Default Value: BuiltIn
48682
+ * * Value List Type: List
48683
+ * * Possible Values
48684
+ * * BuiltIn
48685
+ * * Cloned
48686
+ * * Custom
48687
+ * * Description: Origin of this persona: BuiltIn (provided by system/catalog), Custom (user-defined), or Cloned (derived/voice-cloned).
48688
+ */
48689
+ get Source() {
48690
+ return this.Get('Source');
48691
+ }
48692
+ set Source(value) {
48693
+ this.Set('Source', value);
48694
+ }
48695
+ /**
48696
+ * * Field Name: IsActive
48697
+ * * Display Name: Is Active
48698
+ * * SQL Data Type: bit
48699
+ * * Default Value: 1
48700
+ * * Description: Whether this persona is currently active and available for selection.
48701
+ */
48702
+ get IsActive() {
48703
+ return this.Get('IsActive');
48704
+ }
48705
+ set IsActive(value) {
48706
+ this.Set('IsActive', value);
48707
+ }
48708
+ /**
48709
+ * * Field Name: __mj_CreatedAt
48710
+ * * Display Name: Created At
48711
+ * * SQL Data Type: datetimeoffset
48712
+ * * Default Value: getutcdate()
48713
+ */
48714
+ get __mj_CreatedAt() {
48715
+ return this.Get('__mj_CreatedAt');
48716
+ }
48717
+ /**
48718
+ * * Field Name: __mj_UpdatedAt
48719
+ * * Display Name: Updated At
48720
+ * * SQL Data Type: datetimeoffset
48721
+ * * Default Value: getutcdate()
48722
+ */
48723
+ get __mj_UpdatedAt() {
48724
+ return this.Get('__mj_UpdatedAt');
48725
+ }
48726
+ };
48727
+ MJAIPersonaEntity = __decorate([
48728
+ RegisterClass(BaseEntity, 'MJ: AI Personas')
48729
+ ], MJAIPersonaEntity);
48730
+ export { MJAIPersonaEntity };
47436
48731
  /**
47437
48732
  * MJ: AI Prompt Categories - strongly typed entity sub-class
47438
48733
  * * Schema: __mj
@@ -47591,6 +48886,11 @@ export { MJAIPromptCategoryEntity };
47591
48886
  * @public
47592
48887
  */
47593
48888
  let MJAIPromptModelEntity = class MJAIPromptModelEntity extends BaseEntity {
48889
+ constructor() {
48890
+ super(...arguments);
48891
+ this._PromptConfigurationObject_cached = undefined;
48892
+ this._PromptConfigurationObject_lastRaw = null;
48893
+ }
47594
48894
  /**
47595
48895
  * Loads the MJ: AI Prompt Models record from the database
47596
48896
  * @param ID: string - primary key value to load the MJ: AI Prompt Models record.
@@ -47886,6 +49186,37 @@ let MJAIPromptModelEntity = class MJAIPromptModelEntity extends BaseEntity {
47886
49186
  this.Set('EffortLevel', value);
47887
49187
  }
47888
49188
  /**
49189
+ * * Field Name: PromptConfiguration
49190
+ * * Display Name: Prompt Configuration
49191
+ * * SQL Data Type: nvarchar(MAX)
49192
+ * * JSON Type: MJAIPromptModelEntity_IAIPromptModelConfiguration
49193
+ * * Description: Most-specific layer of the prompt configuration bag (JSON, IAIPromptModelConfiguration shape) — configuration for THIS prompt on THIS model. Deep-merges per key over the AIPrompt layer, which in turn sits above the model-catalog ModelConfiguration cascade. NULL = inherit the merged configuration unchanged.
49194
+ */
49195
+ get PromptConfiguration() {
49196
+ return this.Get('PromptConfiguration');
49197
+ }
49198
+ set PromptConfiguration(value) {
49199
+ this.Set('PromptConfiguration', value);
49200
+ }
49201
+ /**
49202
+ * Typed accessor for PromptConfiguration — returns parsed JSON as MJAIPromptModelEntity_IAIPromptModelConfiguration.
49203
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
49204
+ */
49205
+ get PromptConfigurationObject() {
49206
+ const raw = this.PromptConfiguration;
49207
+ if (raw !== this._PromptConfigurationObject_lastRaw) {
49208
+ this._PromptConfigurationObject_cached = raw ? JSON.parse(raw) : null;
49209
+ this._PromptConfigurationObject_lastRaw = raw;
49210
+ }
49211
+ return this._PromptConfigurationObject_cached;
49212
+ }
49213
+ set PromptConfigurationObject(value) {
49214
+ const raw = value ? JSON.stringify(value) : null;
49215
+ this.PromptConfiguration = raw;
49216
+ this._PromptConfigurationObject_cached = value;
49217
+ this._PromptConfigurationObject_lastRaw = raw;
49218
+ }
49219
+ /**
47889
49220
  * * Field Name: Prompt
47890
49221
  * * Display Name: Prompt
47891
49222
  * * SQL Data Type: nvarchar(255)
@@ -48233,6 +49564,8 @@ let MJAIPromptRunEntity = class MJAIPromptRunEntity extends BaseEntity {
48233
49564
  /**
48234
49565
  * Validate() method override for MJ: AI Prompt Runs entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
48235
49566
  * * EffortLevel: This rule ensures that if an effort level is provided, it must be between 1 and 100, inclusive.
49567
+ * * InputUnitsUsed: Input units used must be greater than or equal to zero to ensure usage is not recorded as a negative value.
49568
+ * * OutputUnitsUsed: The number of output units used cannot be negative, ensuring accurate tracking of resource usage.
48236
49569
  * * Table-Level: This rule ensures that if the 'CompletedAt' date is provided, it must be the same as or later than the 'RunAt' date. If 'CompletedAt' is not specified, there is no restriction.
48237
49570
  * * Table-Level: This rule ensures that if either the number of prompt tokens or completion tokens is missing, or the total tokens used is missing, the check passes automatically. However, if all three are provided, then the total tokens used must exactly equal the sum of prompt tokens and completion tokens.
48238
49571
  * @public
@@ -48242,6 +49575,8 @@ let MJAIPromptRunEntity = class MJAIPromptRunEntity extends BaseEntity {
48242
49575
  Validate() {
48243
49576
  const result = super.Validate();
48244
49577
  this.ValidateEffortLevelIsBetween1And100(result);
49578
+ this.ValidateInputUnitsUsedGreaterThanOrEqualToZero(result);
49579
+ this.ValidateOutputUnitsUsedGreaterThanOrEqualToZero(result);
48245
49580
  this.ValidateCompletedAtNotBeforeRunAt(result);
48246
49581
  this.ValidateTokensUsedEqualsPromptPlusCompletion(result);
48247
49582
  result.Success = result.Success && (result.Errors.length === 0);
@@ -48259,6 +49594,28 @@ let MJAIPromptRunEntity = class MJAIPromptRunEntity extends BaseEntity {
48259
49594
  }
48260
49595
  }
48261
49596
  /**
49597
+ * Input units used must be greater than or equal to zero to ensure usage is not recorded as a negative value.
49598
+ * @param result - the ValidationResult object to add any errors or warnings to
49599
+ * @public
49600
+ * @method
49601
+ */
49602
+ ValidateInputUnitsUsedGreaterThanOrEqualToZero(result) {
49603
+ if (this.InputUnitsUsed != null && this.InputUnitsUsed < 0) {
49604
+ result.Errors.push(new ValidationErrorInfo("InputUnitsUsed", "Input units used must be greater than or equal to zero.", this.InputUnitsUsed, ValidationErrorType.Failure));
49605
+ }
49606
+ }
49607
+ /**
49608
+ * The number of output units used cannot be negative, ensuring accurate tracking of resource usage.
49609
+ * @param result - the ValidationResult object to add any errors or warnings to
49610
+ * @public
49611
+ * @method
49612
+ */
49613
+ ValidateOutputUnitsUsedGreaterThanOrEqualToZero(result) {
49614
+ if (this.OutputUnitsUsed != null && this.OutputUnitsUsed < 0) {
49615
+ result.Errors.push(new ValidationErrorInfo("OutputUnitsUsed", "Output units used must be greater than or equal to 0.", this.OutputUnitsUsed, ValidationErrorType.Failure));
49616
+ }
49617
+ }
49618
+ /**
48262
49619
  * This rule ensures that if the 'CompletedAt' date is provided, it must be the same as or later than the 'RunAt' date. If 'CompletedAt' is not specified, there is no restriction.
48263
49620
  * @param result - the ValidationResult object to add any errors or warnings to
48264
49621
  * @public
@@ -49410,6 +50767,24 @@ let MJAIPromptRunEntity = class MJAIPromptRunEntity extends BaseEntity {
49410
50767
  this.Set('UsageTypeID', value);
49411
50768
  }
49412
50769
  /**
50770
+ * * Field Name: ToolCallingMode
50771
+ * * Display Name: Tool Calling Mode
50772
+ * * SQL Data Type: nvarchar(25)
50773
+ * * Value List Type: List
50774
+ * * Possible Values
50775
+ * * Envelope
50776
+ * * Native
50777
+ * * NativeFallback
50778
+ * * NativeImplicit
50779
+ * * Description: Which tool-calling path this run actually took. 'Native' = Actions declared as tools, control flow in the JSON envelope (the hybrid). 'NativeImplicit' = Actions, sub-agents, payload_change_request and ask_user declared as tools; a tool call continues the loop and plain text ends the turn. 'Envelope' = no tools declared — the vendor-agnostic JSON-envelope path, including a prompt that asked for native mode on a model/vendor without the capability (also logs a warning). 'NativeFallback' = a native attempt failed in a tools-specific way and completed via a single envelope retry. NULL = pre-feature rows or a run that never reached a model call.
50780
+ */
50781
+ get ToolCallingMode() {
50782
+ return this.Get('ToolCallingMode');
50783
+ }
50784
+ set ToolCallingMode(value) {
50785
+ this.Set('ToolCallingMode', value);
50786
+ }
50787
+ /**
49413
50788
  * * Field Name: Prompt
49414
50789
  * * Display Name: Prompt
49415
50790
  * * SQL Data Type: nvarchar(255)
@@ -49674,6 +51049,8 @@ let MJAIPromptEntity = class MJAIPromptEntity extends BaseEntity {
49674
51049
  Load: 'lazy',
49675
51050
  Source: 'cache',
49676
51051
  });
51052
+ this._PromptConfigurationObject_cached = undefined;
51053
+ this._PromptConfigurationObject_lastRaw = null;
49677
51054
  }
49678
51055
  /**
49679
51056
  * Loads the MJ: AI Prompts record from the database
@@ -50604,6 +51981,37 @@ let MJAIPromptEntity = class MJAIPromptEntity extends BaseEntity {
50604
51981
  this.Set('RequireSpecificModels', value);
50605
51982
  }
50606
51983
  /**
51984
+ * * Field Name: PromptConfiguration
51985
+ * * Display Name: Prompt Configuration
51986
+ * * SQL Data Type: nvarchar(MAX)
51987
+ * * JSON Type: MJAIPromptEntity_IAIPromptConfiguration
51988
+ * * Description: Per-prompt call-time configuration bag (JSON, IAIPromptConfiguration shape: LLM / Realtime / Vision / Audio sections). Base layer of the prompt Configuration cascade — AIPromptModel rows inherit from it per key and may override — and itself layered on top of the resolved AIModel/AIModelVendor ModelConfiguration. NULL = contributes nothing.
51989
+ */
51990
+ get PromptConfiguration() {
51991
+ return this.Get('PromptConfiguration');
51992
+ }
51993
+ set PromptConfiguration(value) {
51994
+ this.Set('PromptConfiguration', value);
51995
+ }
51996
+ /**
51997
+ * Typed accessor for PromptConfiguration — returns parsed JSON as MJAIPromptEntity_IAIPromptConfiguration.
51998
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
51999
+ */
52000
+ get PromptConfigurationObject() {
52001
+ const raw = this.PromptConfiguration;
52002
+ if (raw !== this._PromptConfigurationObject_lastRaw) {
52003
+ this._PromptConfigurationObject_cached = raw ? JSON.parse(raw) : null;
52004
+ this._PromptConfigurationObject_lastRaw = raw;
52005
+ }
52006
+ return this._PromptConfigurationObject_cached;
52007
+ }
52008
+ set PromptConfigurationObject(value) {
52009
+ const raw = value ? JSON.stringify(value) : null;
52010
+ this.PromptConfiguration = raw;
52011
+ this._PromptConfigurationObject_cached = value;
52012
+ this._PromptConfigurationObject_lastRaw = raw;
52013
+ }
52014
+ /**
50607
52015
  * * Field Name: Template
50608
52016
  * * Display Name: Template Text
50609
52017
  * * SQL Data Type: nvarchar(255)
@@ -51207,6 +52615,19 @@ let MJAISkillActionEntity = class MJAISkillActionEntity extends BaseEntity {
51207
52615
  return this.Get('__mj_UpdatedAt');
51208
52616
  }
51209
52617
  /**
52618
+ * * Field Name: ExposeToModel
52619
+ * * Display Name: Expose to Model
52620
+ * * SQL Data Type: bit
52621
+ * * Default Value: 1
52622
+ * * Description: Whether activating the skill puts this action into the agent's run. 1 (default): the action is described to the model and callable during the run, today's behaviour. 0: the action stays bundled with the skill (SKILL.md export, tooling) but is left out of the run entirely: not described to the model and not executable by the agent; only application code invokes it, through the Actions API. Use 0 for actions a person triggers through the UI on a later turn, such as a menu button in the skill's reply.
52623
+ */
52624
+ get ExposeToModel() {
52625
+ return this.Get('ExposeToModel');
52626
+ }
52627
+ set ExposeToModel(value) {
52628
+ this.Set('ExposeToModel', value);
52629
+ }
52630
+ /**
51210
52631
  * * Field Name: Skill
51211
52632
  * * Display Name: Skill
51212
52633
  * * SQL Data Type: nvarchar(255)
@@ -75651,6 +77072,19 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
75651
77072
  this._SubtypeSelectorObject_lastRaw = raw;
75652
77073
  }
75653
77074
  /**
77075
+ * * Field Name: EnableFieldLevelSecurity
77076
+ * * Display Name: Enable Field Level Security
77077
+ * * SQL Data Type: bit
77078
+ * * Default Value: 0
77079
+ * * Description: When 1, field-level (column-level) security is enforced for this entity and every enforcement point consults EntityFieldPermission rows. When 0 (the default), field-level security is off entirely and any existing permission rows are retained but inactive. Enabling snapshots the entity's current entity-level permissions into per-field rows, so turning it on changes no behavior until an administrator tightens a field; disabling preserves the rows so re-enabling does not lose the configuration.
77080
+ */
77081
+ get EnableFieldLevelSecurity() {
77082
+ return this.Get('EnableFieldLevelSecurity');
77083
+ }
77084
+ set EnableFieldLevelSecurity(value) {
77085
+ this.Set('EnableFieldLevelSecurity', value);
77086
+ }
77087
+ /**
75654
77088
  * * Field Name: CodeName
75655
77089
  * * Display Name: Code Name
75656
77090
  * * SQL Data Type: nvarchar(MAX)
@@ -77652,6 +79086,190 @@ MJEntityDocumentEntity = __decorate([
77652
79086
  RegisterClass(BaseEntity, 'MJ: Entity Documents')
77653
79087
  ], MJEntityDocumentEntity);
77654
79088
  export { MJEntityDocumentEntity };
79089
+ /**
79090
+ * MJ: Entity Field Permissions - strongly typed entity sub-class
79091
+ * * Schema: __mj
79092
+ * * Base Table: EntityFieldPermission
79093
+ * * Base View: vwEntityFieldPermissions
79094
+ * * @description Role-based field-level (column-level) security. One row per (entity field, role), carrying three independent trinary verbs — ReadAccess, UpdateAccess and CreateAccess — each Allow, Deny or No Access. Rows are only consulted when the parent entity has EnableFieldLevelSecurity = 1. Across the roles a user holds, a verb resolves to (any Allow) AND NOT (any Deny); No Access is neutral and grants nothing while blocking nothing. Read is required for Update and Create, enforced per row by a CHECK constraint and again after aggregation. Primary keys and MemberJunction system audit columns are never restrictable.
79095
+ * * Primary Key: ID
79096
+ * @extends {BaseEntity}
79097
+ * @class
79098
+ * @public
79099
+ */
79100
+ let MJEntityFieldPermissionEntity = class MJEntityFieldPermissionEntity extends BaseEntity {
79101
+ /**
79102
+ * Loads the MJ: Entity Field Permissions record from the database
79103
+ * @param ID: string - primary key value to load the MJ: Entity Field Permissions record.
79104
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
79105
+ * @returns {Promise<boolean>} - true if successful, false otherwise
79106
+ * @public
79107
+ * @async
79108
+ * @memberof MJEntityFieldPermissionEntity
79109
+ * @method
79110
+ * @override
79111
+ */
79112
+ async Load(ID, EntityRelationshipsToLoad) {
79113
+ const compositeKey = new CompositeKey();
79114
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
79115
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
79116
+ }
79117
+ /**
79118
+ * Validate() method override for MJ: Entity Field Permissions entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
79119
+ * * Table-Level: To grant Create or Update access, Read access must also be set to 'Allow'. This prevents users from having permission to modify or create data they cannot view.
79120
+ * @public
79121
+ * @method
79122
+ * @override
79123
+ */
79124
+ Validate() {
79125
+ const result = super.Validate();
79126
+ this.ValidateReadAccessRequiredForCreateOrUpdate(result);
79127
+ result.Success = result.Success && (result.Errors.length === 0);
79128
+ return result;
79129
+ }
79130
+ /**
79131
+ * To grant Create or Update access, Read access must also be set to 'Allow'. This prevents users from having permission to modify or create data they cannot view.
79132
+ * @param result - the ValidationResult object to add any errors or warnings to
79133
+ * @public
79134
+ * @method
79135
+ */
79136
+ ValidateReadAccessRequiredForCreateOrUpdate(result) {
79137
+ const hasUpdate = this.UpdateAccess === "Allow";
79138
+ const hasCreate = this.CreateAccess === "Allow";
79139
+ const hasRead = this.ReadAccess === "Allow";
79140
+ if ((hasUpdate || hasCreate) && !hasRead) {
79141
+ result.Errors.push(new ValidationErrorInfo("ReadAccess", "Read access must be set to 'Allow' if either Create or Update access is allowed.", this.ReadAccess, ValidationErrorType.Failure));
79142
+ }
79143
+ }
79144
+ /**
79145
+ * * Field Name: ID
79146
+ * * Display Name: ID
79147
+ * * SQL Data Type: uniqueidentifier
79148
+ * * Default Value: newsequentialid()
79149
+ */
79150
+ get ID() {
79151
+ return this.Get('ID');
79152
+ }
79153
+ set ID(value) {
79154
+ this.Set('ID', value);
79155
+ }
79156
+ /**
79157
+ * * Field Name: EntityFieldID
79158
+ * * Display Name: Entity Field ID
79159
+ * * SQL Data Type: uniqueidentifier
79160
+ * * Related Entity/Foreign Key: MJ: Entity Fields (vwEntityFields.ID)
79161
+ */
79162
+ get EntityFieldID() {
79163
+ return this.Get('EntityFieldID');
79164
+ }
79165
+ set EntityFieldID(value) {
79166
+ this.Set('EntityFieldID', value);
79167
+ }
79168
+ /**
79169
+ * * Field Name: RoleID
79170
+ * * Display Name: Role ID
79171
+ * * SQL Data Type: uniqueidentifier
79172
+ * * Related Entity/Foreign Key: MJ: Roles (vwRoles.ID)
79173
+ */
79174
+ get RoleID() {
79175
+ return this.Get('RoleID');
79176
+ }
79177
+ set RoleID(value) {
79178
+ this.Set('RoleID', value);
79179
+ }
79180
+ /**
79181
+ * * Field Name: ReadAccess
79182
+ * * Display Name: Read Access
79183
+ * * SQL Data Type: nvarchar(20)
79184
+ * * Default Value: No Access
79185
+ * * Value List Type: List
79186
+ * * Possible Values
79187
+ * * Allow
79188
+ * * Deny
79189
+ * * No Access
79190
+ * * Description: Whether this role may read the field's values. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default) and leaves the outcome to the user's other roles. Enforced at the API output boundary (result projection and GraphQL field mapping), by predicate validation which rejects an ExtraFilter/OrderBy/Aggregate referencing an unreadable field, and by the strongly-typed accessor path which throws.
79191
+ */
79192
+ get ReadAccess() {
79193
+ return this.Get('ReadAccess');
79194
+ }
79195
+ set ReadAccess(value) {
79196
+ this.Set('ReadAccess', value);
79197
+ }
79198
+ /**
79199
+ * * Field Name: UpdateAccess
79200
+ * * Display Name: Update Access
79201
+ * * SQL Data Type: nvarchar(20)
79202
+ * * Default Value: No Access
79203
+ * * Value List Type: List
79204
+ * * Possible Values
79205
+ * * Allow
79206
+ * * Deny
79207
+ * * No Access
79208
+ * * Description: Whether this role may modify the field's value on an EXISTING record. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default). Requires ReadAccess = Allow — a field a user cannot see is one they cannot change. Enforced server-side before SQL generation; the client-side BaseEntity check is UX-level defense-in-depth only.
79209
+ */
79210
+ get UpdateAccess() {
79211
+ return this.Get('UpdateAccess');
79212
+ }
79213
+ set UpdateAccess(value) {
79214
+ this.Set('UpdateAccess', value);
79215
+ }
79216
+ /**
79217
+ * * Field Name: CreateAccess
79218
+ * * Display Name: Create Access
79219
+ * * SQL Data Type: nvarchar(20)
79220
+ * * Default Value: No Access
79221
+ * * Value List Type: List
79222
+ * * Possible Values
79223
+ * * Allow
79224
+ * * Deny
79225
+ * * No Access
79226
+ * * Description: Whether this role may supply the field's value when INSERTING a record. Allow grants it; Deny blocks it and beats every Allow from the user's other roles; No Access is neutral (the default). Requires ReadAccess = Allow. When a user may not create a field, any value they supply is dropped and the column takes its default — the insert is not rejected, matching the read path where a denied field is simply absent rather than an error. A NOT NULL column with no default that a user cannot create makes records uncreatable for that user; restricted fields should be nullable or defaulted.
79227
+ */
79228
+ get CreateAccess() {
79229
+ return this.Get('CreateAccess');
79230
+ }
79231
+ set CreateAccess(value) {
79232
+ this.Set('CreateAccess', value);
79233
+ }
79234
+ /**
79235
+ * * Field Name: __mj_CreatedAt
79236
+ * * Display Name: Created At
79237
+ * * SQL Data Type: datetimeoffset
79238
+ * * Default Value: getutcdate()
79239
+ */
79240
+ get __mj_CreatedAt() {
79241
+ return this.Get('__mj_CreatedAt');
79242
+ }
79243
+ /**
79244
+ * * Field Name: __mj_UpdatedAt
79245
+ * * Display Name: Updated At
79246
+ * * SQL Data Type: datetimeoffset
79247
+ * * Default Value: getutcdate()
79248
+ */
79249
+ get __mj_UpdatedAt() {
79250
+ return this.Get('__mj_UpdatedAt');
79251
+ }
79252
+ /**
79253
+ * * Field Name: EntityField
79254
+ * * Display Name: Entity Field
79255
+ * * SQL Data Type: nvarchar(255)
79256
+ */
79257
+ get EntityField() {
79258
+ return this.Get('EntityField');
79259
+ }
79260
+ /**
79261
+ * * Field Name: Role
79262
+ * * Display Name: Role
79263
+ * * SQL Data Type: nvarchar(50)
79264
+ */
79265
+ get Role() {
79266
+ return this.Get('Role');
79267
+ }
79268
+ };
79269
+ MJEntityFieldPermissionEntity = __decorate([
79270
+ RegisterClass(BaseEntity, 'MJ: Entity Field Permissions')
79271
+ ], MJEntityFieldPermissionEntity);
79272
+ export { MJEntityFieldPermissionEntity };
77655
79273
  /**
77656
79274
  * MJ: Entity Field Values - strongly typed entity sub-class
77657
79275
  * * Schema: __mj
@@ -83175,6 +84793,37 @@ let MJFormChromeRuleEntity = class MJFormChromeRuleEntity extends BaseEntity {
83175
84793
  return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
83176
84794
  }
83177
84795
  /**
84796
+ * Validate() method override for MJ: Form Chrome Rules entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
84797
+ * * Table-Level: Ensures that if the target kind is 'Relationship', a related entity is specified and the contribution key is left empty. Conversely, if the target kind is 'Contribution', a contribution key must be provided and the related entity must be left empty.
84798
+ * @public
84799
+ * @method
84800
+ * @override
84801
+ */
84802
+ Validate() {
84803
+ const result = super.Validate();
84804
+ this.ValidateTargetKindDependencies(result);
84805
+ result.Success = result.Success && (result.Errors.length === 0);
84806
+ return result;
84807
+ }
84808
+ /**
84809
+ * Ensures that if the target kind is 'Relationship', a related entity is specified and the contribution key is left empty. Conversely, if the target kind is 'Contribution', a contribution key must be provided and the related entity must be left empty.
84810
+ * @param result - the ValidationResult object to add any errors or warnings to
84811
+ * @public
84812
+ * @method
84813
+ */
84814
+ ValidateTargetKindDependencies(result) {
84815
+ if (this.TargetKind === "Relationship") {
84816
+ if (this.RelatedEntityID == null || this.ContributionKey != null) {
84817
+ result.Errors.push(new ValidationErrorInfo("TargetKind", "When Target Kind is 'Relationship', Related Entity ID must be provided and Contribution Key must be empty.", this.TargetKind, ValidationErrorType.Failure));
84818
+ }
84819
+ }
84820
+ else if (this.TargetKind === "Contribution") {
84821
+ if (this.ContributionKey == null || this.RelatedEntityID != null) {
84822
+ result.Errors.push(new ValidationErrorInfo("TargetKind", "When Target Kind is 'Contribution', Contribution Key must be provided and Related Entity ID must be empty.", this.TargetKind, ValidationErrorType.Failure));
84823
+ }
84824
+ }
84825
+ }
84826
+ /**
83178
84827
  * * Field Name: ID
83179
84828
  * * Display Name: ID
83180
84829
  * * SQL Data Type: uniqueidentifier