@memberjunction/core-entities 5.44.0 → 5.45.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.
@@ -2819,17 +2819,23 @@ detailed information about what validation rules failed.`),
2819
2819
  * * Display Name: Comments
2820
2820
  * * SQL Data Type: nvarchar(MAX)
2821
2821
  * * Description: Human-readable notes and comments about this agent run step`),
2822
+ Skills: z.any().nullable().describe(`
2823
+ * * Field Name: Skills
2824
+ * * Display Name: Skills Used
2825
+ * * SQL Data Type: nvarchar(MAX)
2826
+ * * JSON Type: Array<MJAIAgentRunStepEntity_AgentSkillInvocation>
2827
+ * * 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).`),
2822
2828
  AgentRun: z.string().nullable().describe(`
2823
2829
  * * Field Name: AgentRun
2824
- * * Display Name: Agent Run
2830
+ * * Display Name: Agent Run Context
2825
2831
  * * SQL Data Type: nvarchar(255)`),
2826
2832
  Parent: z.string().nullable().describe(`
2827
2833
  * * Field Name: Parent
2828
- * * Display Name: Parent Step
2834
+ * * Display Name: Parent Step Context
2829
2835
  * * SQL Data Type: nvarchar(255)`),
2830
2836
  RootParentID: z.string().nullable().describe(`
2831
2837
  * * Field Name: RootParentID
2832
- * * Display Name: Root Parent Step
2838
+ * * Display Name: Root Parent
2833
2839
  * * SQL Data Type: uniqueidentifier`),
2834
2840
  });
2835
2841
  /**
@@ -2838,7 +2844,7 @@ detailed information about what validation rules failed.`),
2838
2844
  export const MJAIAgentRunSchema = z.object({
2839
2845
  ID: z.string().describe(`
2840
2846
  * * Field Name: ID
2841
- * * Display Name: Run ID
2847
+ * * Display Name: ID
2842
2848
  * * SQL Data Type: uniqueidentifier
2843
2849
  * * Default Value: newsequentialid()
2844
2850
  * * Description: Unique identifier for this agent run`),
@@ -2935,12 +2941,12 @@ export const MJAIAgentRunSchema = z.object({
2935
2941
  * * Default Value: getutcdate()`),
2936
2942
  TotalPromptTokensUsed: z.number().nullable().describe(`
2937
2943
  * * Field Name: TotalPromptTokensUsed
2938
- * * Display Name: Prompt Tokens
2944
+ * * Display Name: Total Prompt Tokens
2939
2945
  * * SQL Data Type: int
2940
2946
  * * Description: Total number of prompt/input tokens used across all AIPromptRun executions during this agent run. This provides a breakdown of the TotalTokensUsed field to help analyze the ratio of input vs output tokens consumed by the agent.`),
2941
2947
  TotalCompletionTokensUsed: z.number().nullable().describe(`
2942
2948
  * * Field Name: TotalCompletionTokensUsed
2943
- * * Display Name: Completion Tokens
2949
+ * * Display Name: Total Completion Tokens
2944
2950
  * * SQL Data Type: int
2945
2951
  * * Description: Total number of completion/output tokens generated across all AIPromptRun executions during this agent run. This provides a breakdown of the TotalTokensUsed field to help analyze the ratio of input vs output tokens consumed by the agent.`),
2946
2952
  TotalTokensUsedRollup: z.number().nullable().describe(`
@@ -2950,12 +2956,12 @@ export const MJAIAgentRunSchema = z.object({
2950
2956
  * * Description: Total tokens used including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalTokensUsed. For parent agents, this includes the sum of all descendant agent tokens. Calculated as TotalPromptTokensUsedRollup + TotalCompletionTokensUsedRollup.`),
2951
2957
  TotalPromptTokensUsedRollup: z.number().nullable().describe(`
2952
2958
  * * Field Name: TotalPromptTokensUsedRollup
2953
- * * Display Name: Prompt Tokens (Rollup)
2959
+ * * Display Name: Total Prompt Tokens (Rollup)
2954
2960
  * * SQL Data Type: int
2955
2961
  * * Description: Total prompt/input tokens including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalPromptTokensUsed. For parent agents, this includes the sum of all descendant agent prompt tokens.`),
2956
2962
  TotalCompletionTokensUsedRollup: z.number().nullable().describe(`
2957
2963
  * * Field Name: TotalCompletionTokensUsedRollup
2958
- * * Display Name: Completion Tokens (Rollup)
2964
+ * * Display Name: Total Completion Tokens (Rollup)
2959
2965
  * * SQL Data Type: int
2960
2966
  * * Description: Total completion/output tokens including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalCompletionTokensUsed. For parent agents, this includes the sum of all descendant agent completion tokens.`),
2961
2967
  TotalCostRollup: z.number().nullable().describe(`
@@ -2971,7 +2977,7 @@ export const MJAIAgentRunSchema = z.object({
2971
2977
  * * Description: Optional tracking of a specific conversation detail (e.g. a specific message) that spawned this agent run`),
2972
2978
  ConversationDetailSequence: z.number().nullable().describe(`
2973
2979
  * * Field Name: ConversationDetailSequence
2974
- * * Display Name: Detail Sequence
2980
+ * * Display Name: Conversation Detail Sequence
2975
2981
  * * SQL Data Type: int
2976
2982
  * * Description: If a conversation detail spawned multiple agent runs, tracks the order of their spawn/execution`),
2977
2983
  CancellationReason: z.union([z.literal('System'), z.literal('Timeout'), z.literal('User Request')]).nullable().describe(`
@@ -3006,7 +3012,7 @@ export const MJAIAgentRunSchema = z.object({
3006
3012
  * * Description: JSON serialization of the final Payload state at the end of the agent run`),
3007
3013
  Message: z.string().nullable().describe(`
3008
3014
  * * Field Name: Message
3009
- * * Display Name: Final Message
3015
+ * * Display Name: Message
3010
3016
  * * SQL Data Type: nvarchar(MAX)
3011
3017
  * * Description: Final message from the agent to the end user at the end of a run`),
3012
3018
  LastRunID: z.string().nullable().describe(`
@@ -3047,12 +3053,12 @@ each time the agent processes a prompt step.`),
3047
3053
  * * Description: Runtime vendor override that was used for this execution. When set along with OverrideModelID, this vendor was used to provide the model.`),
3048
3054
  Data: z.string().nullable().describe(`
3049
3055
  * * Field Name: Data
3050
- * * Display Name: Input Data
3056
+ * * Display Name: Data
3051
3057
  * * SQL Data Type: nvarchar(MAX)
3052
3058
  * * Description: JSON serialized data that was passed for template rendering and prompt execution. This data was passed to the agent's prompt as well as all sub-agents.`),
3053
3059
  Verbose: z.boolean().nullable().describe(`
3054
3060
  * * Field Name: Verbose
3055
- * * Display Name: Verbose Logging
3061
+ * * Display Name: Verbose
3056
3062
  * * SQL Data Type: bit
3057
3063
  * * Default Value: 0
3058
3064
  * * Description: Indicates whether verbose logging was enabled during this agent execution. When true, detailed decision-making and execution flow was logged.`),
@@ -3112,12 +3118,12 @@ each time the agent processes a prompt step.`),
3112
3118
  * * Description: Optional company scope for multi-tenant memory. When populated, Memory Manager uses this to scope extracted notes to the company. Flows from ExecuteAgentParams.companyId at agent invocation time.`),
3113
3119
  TotalCacheReadTokensUsed: z.number().nullable().describe(`
3114
3120
  * * Field Name: TotalCacheReadTokensUsed
3115
- * * Display Name: Cache Read Tokens
3121
+ * * Display Name: Total Cache Read Tokens
3116
3122
  * * SQL Data Type: int
3117
3123
  * * Description: Total input tokens served from the AI provider's prompt cache (cache reads / hits) across this agent run, summed from child prompt runs' TokensCacheReadRollup and sub-agent runs' TotalCacheReadTokensUsed. Counts only; the cost impact (cache reads are billed at a steep discount) is reflected in TotalCost. The cache counterpart of TotalPromptTokensUsed.`),
3118
3124
  TotalCacheWriteTokensUsed: z.number().nullable().describe(`
3119
3125
  * * Field Name: TotalCacheWriteTokensUsed
3120
- * * Display Name: Cache Write Tokens
3126
+ * * Display Name: Total Cache Write Tokens
3121
3127
  * * SQL Data Type: int
3122
3128
  * * Description: Total input tokens written to the AI provider's prompt cache (cache writes / creation) across this agent run, summed from child prompt runs' TokensCacheWriteRollup and sub-agent runs' TotalCacheWriteTokensUsed. Populated for providers that bill cache creation (e.g. Anthropic); 0 or NULL otherwise. The cache counterpart of TotalCompletionTokensUsed.`),
3123
3129
  LastHeartbeatAt: z.date().nullable().describe(`
@@ -3131,53 +3137,59 @@ each time the agent processes a prompt step.`),
3131
3137
  * * SQL Data Type: uniqueidentifier
3132
3138
  * * Related Entity/Foreign Key: MJ: AI Agent Sessions (vwAIAgentSessions.ID)
3133
3139
  * * Description: Links this run to the long-lived AIAgentSession it executed within. NULL for runs outside any real-time session. This is the persisted session reference and is distinct from the per-connection transport sessionID.`),
3140
+ PlanMode: z.boolean().describe(`
3141
+ * * Field Name: PlanMode
3142
+ * * Display Name: Plan Mode
3143
+ * * SQL Data Type: bit
3144
+ * * Default Value: 0
3145
+ * * Description: 1 when this run executed under plan mode (whether via the per-request planMode flag or the agent's RequirePlanMode setting). Drives plan-mode indicators in the run UX and supports plan-drift auditing (comparing the approved plan against the steps that actually executed).`),
3134
3146
  Agent: z.string().nullable().describe(`
3135
3147
  * * Field Name: Agent
3136
- * * Display Name: Agent Info
3148
+ * * Display Name: Agent Name
3137
3149
  * * SQL Data Type: nvarchar(255)`),
3138
3150
  ParentRun: z.string().nullable().describe(`
3139
3151
  * * Field Name: ParentRun
3140
- * * Display Name: Parent Run Info
3152
+ * * Display Name: Parent Run Name
3141
3153
  * * SQL Data Type: nvarchar(255)`),
3142
3154
  Conversation: z.string().nullable().describe(`
3143
3155
  * * Field Name: Conversation
3144
- * * Display Name: Conversation Info
3156
+ * * Display Name: Conversation Name
3145
3157
  * * SQL Data Type: nvarchar(255)`),
3146
3158
  User: z.string().nullable().describe(`
3147
3159
  * * Field Name: User
3148
- * * Display Name: User Info
3160
+ * * Display Name: User Name
3149
3161
  * * SQL Data Type: nvarchar(100)`),
3150
3162
  ConversationDetail: z.string().nullable().describe(`
3151
3163
  * * Field Name: ConversationDetail
3152
- * * Display Name: Conversation Detail Info
3164
+ * * Display Name: Conversation Detail Name
3153
3165
  * * SQL Data Type: nvarchar(100)`),
3154
3166
  LastRun: z.string().nullable().describe(`
3155
3167
  * * Field Name: LastRun
3156
- * * Display Name: Last Run Info
3168
+ * * Display Name: Last Run Name
3157
3169
  * * SQL Data Type: nvarchar(255)`),
3158
3170
  Configuration: z.string().nullable().describe(`
3159
3171
  * * Field Name: Configuration
3160
- * * Display Name: Configuration Info
3172
+ * * Display Name: Configuration Name
3161
3173
  * * SQL Data Type: nvarchar(100)`),
3162
3174
  OverrideModel: z.string().nullable().describe(`
3163
3175
  * * Field Name: OverrideModel
3164
- * * Display Name: Override Model Info
3176
+ * * Display Name: Override Model Name
3165
3177
  * * SQL Data Type: nvarchar(50)`),
3166
3178
  OverrideVendor: z.string().nullable().describe(`
3167
3179
  * * Field Name: OverrideVendor
3168
- * * Display Name: Override Vendor Info
3180
+ * * Display Name: Override Vendor Name
3169
3181
  * * SQL Data Type: nvarchar(50)`),
3170
3182
  ScheduledJobRun: z.string().nullable().describe(`
3171
3183
  * * Field Name: ScheduledJobRun
3172
- * * Display Name: Scheduled Job Run Info
3184
+ * * Display Name: Scheduled Job Run Name
3173
3185
  * * SQL Data Type: nvarchar(200)`),
3174
3186
  TestRun: z.string().nullable().describe(`
3175
3187
  * * Field Name: TestRun
3176
- * * Display Name: Test Run Info
3188
+ * * Display Name: Test Run Name
3177
3189
  * * SQL Data Type: nvarchar(255)`),
3178
3190
  PrimaryScopeEntity: z.string().nullable().describe(`
3179
3191
  * * Field Name: PrimaryScopeEntity
3180
- * * Display Name: Primary Scope Entity Info
3192
+ * * Display Name: Primary Scope Entity Name
3181
3193
  * * SQL Data Type: nvarchar(255)`),
3182
3194
  RootParentRunID: z.string().nullable().describe(`
3183
3195
  * * Field Name: RootParentRunID
@@ -3676,6 +3688,17 @@ export const MJAIAgentSessionSchema = z.object({
3676
3688
  * * Display Name: Recording File ID
3677
3689
  * * SQL Data Type: uniqueidentifier
3678
3690
  * * Related Entity/Foreign Key: MJ: Files (vwFiles.ID)`),
3691
+ LinkedEntityID: z.string().nullable().describe(`
3692
+ * * Field Name: LinkedEntityID
3693
+ * * Display Name: Linked Entity ID
3694
+ * * SQL Data Type: uniqueidentifier
3695
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
3696
+ * * Description: Polymorphic counterparty-identity entity. Foreign key to Entity — identifies WHICH entity this realtime session's counterparty resolved to (e.g. User, a member/contact record, BizAppsCommon Person). Paired with LinkedRecordID via the CK_AIAgentSession_LinkBinding both-or-neither check, mirroring Conversation's linked pair. NULL while the session's counterparty is anonymous/unresolved.`),
3697
+ LinkedRecordID: z.string().nullable().describe(`
3698
+ * * Field Name: LinkedRecordID
3699
+ * * Display Name: Linked Record ID
3700
+ * * SQL Data Type: nvarchar(500)
3701
+ * * Description: Polymorphic counterparty-identity record key. The primary-key value of the record (within LinkedEntityID's entity) this session resolved to, serialized as a string so any entity type can be referenced regardless of PK shape (UUID, int, composite). NVARCHAR(500), intentionally NOT FK-constrained. Used together with LinkedEntityID — see CK_AIAgentSession_LinkBinding. NULL while the session's counterparty is anonymous/unresolved.`),
3679
3702
  Agent: z.string().nullable().describe(`
3680
3703
  * * Field Name: Agent
3681
3704
  * * Display Name: Agent
@@ -3692,6 +3715,10 @@ export const MJAIAgentSessionSchema = z.object({
3692
3715
  * * Field Name: RecordingFile
3693
3716
  * * Display Name: Recording File
3694
3717
  * * SQL Data Type: nvarchar(500)`),
3718
+ LinkedEntity: z.string().nullable().describe(`
3719
+ * * Field Name: LinkedEntity
3720
+ * * Display Name: Linked Entity
3721
+ * * SQL Data Type: nvarchar(255)`),
3695
3722
  RootLastSessionID: z.string().nullable().describe(`
3696
3723
  * * Field Name: RootLastSessionID
3697
3724
  * * Display Name: Root Last Session ID
@@ -4137,22 +4164,22 @@ export const MJAIAgentSchema = z.object({
4137
4164
  * * Description: When true, enables automatic compression of conversation context when the message threshold is reached.`),
4138
4165
  ContextCompressionMessageThreshold: z.number().nullable().describe(`
4139
4166
  * * Field Name: ContextCompressionMessageThreshold
4140
- * * Display Name: Context Compression Message Threshold
4167
+ * * Display Name: Compression Message Threshold
4141
4168
  * * SQL Data Type: int
4142
4169
  * * Description: Number of messages that triggers context compression when EnableContextCompression is true.`),
4143
4170
  ContextCompressionPromptID: z.string().nullable().describe(`
4144
4171
  * * Field Name: ContextCompressionPromptID
4145
- * * Display Name: Context Compression Prompt
4172
+ * * Display Name: Compression Prompt
4146
4173
  * * SQL Data Type: uniqueidentifier
4147
4174
  * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)`),
4148
4175
  ContextCompressionMessageRetentionCount: z.number().nullable().describe(`
4149
4176
  * * Field Name: ContextCompressionMessageRetentionCount
4150
- * * Display Name: Context Compression Message Retention Count
4177
+ * * Display Name: Compression Retention Count
4151
4178
  * * SQL Data Type: int
4152
4179
  * * Description: Number of recent messages to keep uncompressed when context compression is applied.`),
4153
4180
  TypeID: z.string().nullable().describe(`
4154
4181
  * * Field Name: TypeID
4155
- * * Display Name: Type
4182
+ * * Display Name: Agent Type
4156
4183
  * * SQL Data Type: uniqueidentifier
4157
4184
  * * Related Entity/Foreign Key: MJ: AI Agent Types (vwAIAgentTypes.ID)
4158
4185
  * * Description: Reference to the AIAgentType that defines the category and system-level behavior for this agent. Cannot be null.`),
@@ -4189,25 +4216,25 @@ export const MJAIAgentSchema = z.object({
4189
4216
  * * Description: Controls whether model selection is driven by the Agent Type's system prompt or the Agent's specific prompt. Default is Agent Type for backward compatibility.`),
4190
4217
  PayloadDownstreamPaths: z.string().describe(`
4191
4218
  * * Field Name: PayloadDownstreamPaths
4192
- * * Display Name: Payload Downstream Paths
4219
+ * * Display Name: Downstream Payload Paths
4193
4220
  * * SQL Data Type: nvarchar(MAX)
4194
4221
  * * Default Value: ["*"]
4195
4222
  * * Description: JSON array of paths that define which parts of the payload should be sent downstream to sub-agents. Use ["*"] to send entire payload, or specify paths like ["customer.id", "campaign.*", "analysis.sentiment"]`),
4196
4223
  PayloadUpstreamPaths: z.string().describe(`
4197
4224
  * * Field Name: PayloadUpstreamPaths
4198
- * * Display Name: Payload Upstream Paths
4225
+ * * Display Name: Upstream Payload Paths
4199
4226
  * * SQL Data Type: nvarchar(MAX)
4200
4227
  * * Default Value: ["*"]
4201
4228
  * * Description: JSON array of paths that define which parts of the payload sub-agents are allowed to write back upstream. Use ["*"] to allow all writes, or specify paths like ["analysis.results", "recommendations.*"]`),
4202
4229
  PayloadSelfReadPaths: z.string().nullable().describe(`
4203
4230
  * * Field Name: PayloadSelfReadPaths
4204
- * * Display Name: Payload Self Read Paths
4231
+ * * Display Name: Self-Read Payload Paths
4205
4232
  * * SQL Data Type: nvarchar(MAX)
4206
4233
  * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
4207
4234
  flow when the agent executes its own prompt step.`),
4208
4235
  PayloadSelfWritePaths: z.string().nullable().describe(`
4209
4236
  * * Field Name: PayloadSelfWritePaths
4210
- * * Display Name: Payload Self Write Paths
4237
+ * * Display Name: Self-Write Payload Paths
4211
4238
  * * SQL Data Type: nvarchar(MAX)
4212
4239
  * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
4213
4240
  data flow when the agent executes its own prompt step.`),
@@ -4218,12 +4245,12 @@ data flow when the agent executes its own prompt step.`),
4218
4245
  * * 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)`),
4219
4246
  FinalPayloadValidation: z.string().nullable().describe(`
4220
4247
  * * Field Name: FinalPayloadValidation
4221
- * * Display Name: Final Payload Validation Schema
4248
+ * * Display Name: Final Payload Validation
4222
4249
  * * SQL Data Type: nvarchar(MAX)
4223
4250
  * * 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.`),
4224
4251
  FinalPayloadValidationMode: z.union([z.literal('Fail'), z.literal('Retry'), z.literal('Warn')]).describe(`
4225
4252
  * * Field Name: FinalPayloadValidationMode
4226
- * * Display Name: Final Payload Validation Mode
4253
+ * * Display Name: Final Validation Mode
4227
4254
  * * SQL Data Type: nvarchar(25)
4228
4255
  * * Default Value: Retry
4229
4256
  * * Value List Type: List
@@ -4234,7 +4261,7 @@ data flow when the agent executes its own prompt step.`),
4234
4261
  * * 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.`),
4235
4262
  FinalPayloadValidationMaxRetries: z.number().describe(`
4236
4263
  * * Field Name: FinalPayloadValidationMaxRetries
4237
- * * Display Name: Final Payload Validation Max Retries
4264
+ * * Display Name: Final Validation Max Retries
4238
4265
  * * SQL Data Type: int
4239
4266
  * * Default Value: 3
4240
4267
  * * Description: Maximum number of retry attempts allowed when FinalPayloadValidation fails with
@@ -4275,12 +4302,12 @@ if this limit is exceeded.`),
4275
4302
  * * Description: When acting as a sub-agent, maximum number of times this agent can be executed per parent agent run`),
4276
4303
  StartingPayloadValidation: z.string().nullable().describe(`
4277
4304
  * * Field Name: StartingPayloadValidation
4278
- * * Display Name: Starting Payload Validation Schema
4305
+ * * Display Name: Starting Payload Validation
4279
4306
  * * SQL Data Type: nvarchar(MAX)
4280
4307
  * * Description: Optional JSON schema validation to apply to the input payload before agent execution begins. Uses the same JSONValidator format as FinalPayloadValidation.`),
4281
4308
  StartingPayloadValidationMode: z.union([z.literal('Fail'), z.literal('Warn')]).describe(`
4282
4309
  * * Field Name: StartingPayloadValidationMode
4283
- * * Display Name: Starting Payload Validation Mode
4310
+ * * Display Name: Starting Validation Mode
4284
4311
  * * SQL Data Type: nvarchar(25)
4285
4312
  * * Default Value: Fail
4286
4313
  * * Value List Type: List
@@ -4290,7 +4317,7 @@ if this limit is exceeded.`),
4290
4317
  * * Description: Determines how to handle StartingPayloadValidation failures. Fail = reject invalid input, Warn = log warning but proceed.`),
4291
4318
  DefaultPromptEffortLevel: z.number().nullable().describe(`
4292
4319
  * * Field Name: DefaultPromptEffortLevel
4293
- * * Display Name: Default Prompt Effort Level
4320
+ * * Display Name: Default Effort Level
4294
4321
  * * SQL Data Type: int
4295
4322
  * * Description: Default effort level for all prompts executed by this agent (1-100, where 1=minimal effort, 100=maximum effort). Takes precedence over individual prompt EffortLevel settings but can be overridden by runtime parameters. Inherited by sub-agents unless explicitly overridden.`),
4296
4323
  ChatHandlingOption: z.union([z.literal('Failed'), z.literal('Retry'), z.literal('Success')]).nullable().describe(`
@@ -4311,7 +4338,7 @@ if this limit is exceeded.`),
4311
4338
  * * Description: Default artifact type produced by this agent. This is the primary artifact type; additional artifact types can be linked via AIAgentArtifactType junction table. Can be NULL if agent does not produce artifacts by default.`),
4312
4339
  OwnerUserID: z.string().describe(`
4313
4340
  * * Field Name: OwnerUserID
4314
- * * Display Name: Owner User
4341
+ * * Display Name: Owner
4315
4342
  * * SQL Data Type: uniqueidentifier
4316
4343
  * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
4317
4344
  * * Default Value: ECAFCCEC-6A37-EF11-86D4-000D3A4E707E
@@ -4435,7 +4462,7 @@ if this limit is exceeded.`),
4435
4462
  * * Description: File size threshold for inline storage. Files <= this size are stored as base64 inline, larger files use MJStorage. NULL uses system default (1MB). Set to 0 to always use MJStorage.`),
4436
4463
  AgentTypePromptParams: z.string().nullable().describe(`
4437
4464
  * * Field Name: AgentTypePromptParams
4438
- * * Display Name: Agent Type Prompt Params
4465
+ * * Display Name: Prompt Parameters
4439
4466
  * * SQL Data Type: nvarchar(MAX)
4440
4467
  * * Description: JSON object containing parameter values that customize how this agent's type-level system prompt is rendered. The schema is defined by the agent type's PromptParamsSchema field. Allows per-agent control over which prompt sections are included, enabling token savings by excluding unused documentation.`),
4441
4468
  ScopeConfig: z.string().nullable().describe(`
@@ -4557,17 +4584,33 @@ if this limit is exceeded.`),
4557
4584
  * * Limited
4558
4585
  * * None
4559
4586
  * * Description: Whether this agent accepts skills: None (no skills — default), All (any Active skill), or Limited (only skills assigned via AIAgentSkill). This is the per-agent gate; AISkill.Status and AIAgentSkill.Status provide catalog- and assignment-level gating on top.`),
4587
+ SkillActivationMode: z.union([z.literal('Auto'), z.literal('RequestedOnly')]).describe(`
4588
+ * * Field Name: SkillActivationMode
4589
+ * * Display Name: Skill Activation Mode
4590
+ * * SQL Data Type: nvarchar(20)
4591
+ * * Default Value: RequestedOnly
4592
+ * * Value List Type: List
4593
+ * * Possible Values
4594
+ * * Auto
4595
+ * * RequestedOnly
4596
+ * * Description: Controls whether this agent may ever self-activate skills from its prompt catalog. Auto: the agent sees its allowed skills whose own ActivationMode is Auto (double gate) and may activate them mid-run on its own judgment. RequestedOnly (default): the agent's prompt catalog is empty and skills only enter a run via an explicit user request (/skill mention). Orthogonal to AcceptsSkills, which governs which skills are available at all; this governs who may pull the activation trigger.`),
4597
+ RequirePlanMode: z.boolean().describe(`
4598
+ * * Field Name: RequirePlanMode
4599
+ * * Display Name: Require Plan Mode
4600
+ * * SQL Data Type: bit
4601
+ * * Default Value: 0
4602
+ * * Description: When 1, every root-level run of this agent executes in plan mode regardless of the per-request planMode flag — the agent must present a plan and receive human approval before any Actions or Sub-Agent steps execute. SupportsPlanMode is irrelevant when this is set. Use for high-consequence agents (e.g. ones with outbound-communication capabilities) where human-in-the-loop review is mandatory.`),
4560
4603
  Parent: z.string().nullable().describe(`
4561
4604
  * * Field Name: Parent
4562
- * * Display Name: Parent
4605
+ * * Display Name: Parent Agent Name
4563
4606
  * * SQL Data Type: nvarchar(255)`),
4564
4607
  ContextCompressionPrompt: z.string().nullable().describe(`
4565
4608
  * * Field Name: ContextCompressionPrompt
4566
- * * Display Name: Context Compression Prompt Name
4609
+ * * Display Name: Compression Prompt Name
4567
4610
  * * SQL Data Type: nvarchar(255)`),
4568
4611
  Type: z.string().nullable().describe(`
4569
4612
  * * Field Name: Type
4570
- * * Display Name: Type Name
4613
+ * * Display Name: Type
4571
4614
  * * SQL Data Type: nvarchar(100)`),
4572
4615
  DefaultArtifactType: z.string().nullable().describe(`
4573
4616
  * * Field Name: DefaultArtifactType
@@ -4575,7 +4618,7 @@ if this limit is exceeded.`),
4575
4618
  * * SQL Data Type: nvarchar(100)`),
4576
4619
  OwnerUser: z.string().describe(`
4577
4620
  * * Field Name: OwnerUser
4578
- * * Display Name: Owner User Name
4621
+ * * Display Name: Owner Name
4579
4622
  * * SQL Data Type: nvarchar(100)`),
4580
4623
  AttachmentStorageProvider: z.string().nullable().describe(`
4581
4624
  * * Field Name: AttachmentStorageProvider
@@ -4603,11 +4646,11 @@ if this limit is exceeded.`),
4603
4646
  * * SQL Data Type: nvarchar(255)`),
4604
4647
  RootParentID: z.string().nullable().describe(`
4605
4648
  * * Field Name: RootParentID
4606
- * * Display Name: Root Parent ID
4649
+ * * Display Name: Root Parent
4607
4650
  * * SQL Data Type: uniqueidentifier`),
4608
4651
  RootDefaultCoAgentID: z.string().nullable().describe(`
4609
4652
  * * Field Name: RootDefaultCoAgentID
4610
- * * Display Name: Root Default Co-Agent ID
4653
+ * * Display Name: Root Default Co-Agent
4611
4654
  * * SQL Data Type: uniqueidentifier`),
4612
4655
  });
4613
4656
  /**
@@ -7557,6 +7600,16 @@ export const MJAISkillSchema = z.object({
7557
7600
  * * Display Name: Updated At
7558
7601
  * * SQL Data Type: datetimeoffset
7559
7602
  * * Default Value: getutcdate()`),
7603
+ ActivationMode: z.union([z.literal('Auto'), z.literal('RequestedOnly')]).describe(`
7604
+ * * Field Name: ActivationMode
7605
+ * * Display Name: Activation Mode
7606
+ * * SQL Data Type: nvarchar(20)
7607
+ * * Default Value: RequestedOnly
7608
+ * * Value List Type: List
7609
+ * * Possible Values
7610
+ * * Auto
7611
+ * * RequestedOnly
7612
+ * * Description: Controls whether this skill may ever be self-activated by an agent. Auto: the skill may appear in accepting agents' prompt catalogs and be activated mid-run on agent judgment — but only for agents whose own SkillActivationMode is also Auto (double gate). RequestedOnly (default): the skill is excluded from prompt catalogs entirely and can only be activated when the user explicitly requests it for the run (a /skill mention flowing through ExecuteAgentParams.requestedSkillIDs). All other activation gates (AcceptsSkills, skill Status, per-agent assignment, user Run permission) apply unchanged in both modes.`),
7560
7613
  CreatedByUser: z.string().describe(`
7561
7614
  * * Field Name: CreatedByUser
7562
7615
  * * Display Name: Created By User
@@ -12965,6 +13018,141 @@ export const MJConversationDetailSchema = z.object({
12965
13018
  * * Display Name: Root Parent ID
12966
13019
  * * SQL Data Type: uniqueidentifier`),
12967
13020
  });
13021
+ /**
13022
+ * zod schema definition for the entity MJ: Conversation Widget Instances
13023
+ */
13024
+ export const MJConversationWidgetInstanceSchema = z.object({
13025
+ ID: z.string().describe(`
13026
+ * * Field Name: ID
13027
+ * * Display Name: ID
13028
+ * * SQL Data Type: uniqueidentifier
13029
+ * * Default Value: newsequentialid()`),
13030
+ Name: z.string().describe(`
13031
+ * * Field Name: Name
13032
+ * * Display Name: Name
13033
+ * * SQL Data Type: nvarchar(255)
13034
+ * * Description: Human-readable name for this widget deployment (e.g. "Acme Marketing Site Support").`),
13035
+ PublicKey: z.string().describe(`
13036
+ * * Field Name: PublicKey
13037
+ * * Display Name: Public Key
13038
+ * * SQL Data Type: nvarchar(100)
13039
+ * * Description: Public, non-secret embed key (e.g. "pk_live_…") placed in the host page's data-widget-key attribute. Used to resolve this configuration at POST /widget/session. Unique. Not a credential — security comes from the origin allowlist, rate limits, the restricted guest role, and short-lived minted tokens.`),
13040
+ ApplicationID: z.string().describe(`
13041
+ * * Field Name: ApplicationID
13042
+ * * Display Name: Application ID
13043
+ * * SQL Data Type: uniqueidentifier
13044
+ * * Related Entity/Foreign Key: MJ: Applications (vwApplications.ID)
13045
+ * * Description: Foreign key to Application — the single app a guest session is scoped to. Mirrors the magic-link single-application model.`),
13046
+ PinnedAgentID: z.string().describe(`
13047
+ * * Field Name: PinnedAgentID
13048
+ * * Display Name: Pinned Agent ID
13049
+ * * SQL Data Type: uniqueidentifier
13050
+ * * Related Entity/Foreign Key: MJ: AI Agents (vwAIAgents.ID)
13051
+ * * Description: Foreign key to AIAgent — the support agent that is PINNED for every turn (passed as explicitAgentId). D5: pinning fixes which agent runs; combined with the restricted guest role it prevents a public visitor from reaching arbitrary agents/data. The pinned agent's own tool/handoff surface should be support-scoped.`),
13052
+ GuestRoleID: z.string().describe(`
13053
+ * * Field Name: GuestRoleID
13054
+ * * Display Name: Guest Role ID
13055
+ * * SQL Data Type: uniqueidentifier
13056
+ * * Related Entity/Foreign Key: MJ: Roles (vwRoles.ID)
13057
+ * * Description: Foreign key to Role — the restricted guest role assigned to the synthesized guest principal. This role's entity permissions are the real authorization boundary (read/write only the visitor's own Conversation + Conversation Details). Roles ride per-session JWT claims, not DB rows on the shared Anonymous principal.`),
13058
+ AllowedOrigins: z.string().nullable().describe(`
13059
+ * * Field Name: AllowedOrigins
13060
+ * * Display Name: Allowed Origins
13061
+ * * SQL Data Type: nvarchar(MAX)
13062
+ * * Description: Allowed embedding origins for this widget, as a JSON array of origin strings (e.g. ["https://www.acme.com","https://acme.com"]). Enforced both at mint (POST /widget/session rejects unlisted Origin) and via CORS. NULL or empty means no origin is allowed (fail-closed).`),
13063
+ Modality: z.union([z.literal('Both'), z.literal('Text'), z.literal('Voice')]).describe(`
13064
+ * * Field Name: Modality
13065
+ * * Display Name: Modality
13066
+ * * SQL Data Type: nvarchar(10)
13067
+ * * Default Value: Text
13068
+ * * Value List Type: List
13069
+ * * Possible Values
13070
+ * * Both
13071
+ * * Text
13072
+ * * Voice
13073
+ * * Description: Which modalities this widget exposes: Text (chat only), Voice (client-direct realtime only), or Both. Gates whether the realtime-mint path is offered to the guest.`),
13074
+ AuthStrategy: z.union([z.literal('Anonymous'), z.literal('HostIdentity'), z.literal('MagicLinkUpgrade')]).describe(`
13075
+ * * Field Name: AuthStrategy
13076
+ * * Display Name: Auth Strategy
13077
+ * * SQL Data Type: nvarchar(20)
13078
+ * * Default Value: Anonymous
13079
+ * * Value List Type: List
13080
+ * * Possible Values
13081
+ * * Anonymous
13082
+ * * HostIdentity
13083
+ * * MagicLinkUpgrade
13084
+ * * Description: Pluggable public-auth strategy (D1): Anonymous (guest-first, default), MagicLinkUpgrade (guest may escalate to an email-verified session), or HostIdentity (an authenticated host portal posts a signed identity assertion exchanged for an MJ guest JWT). All three converge on AuthProviderFactory + buildMagicLinkSessionUser.`),
13085
+ Status: z.union([z.literal('Active'), z.literal('Disabled')]).describe(`
13086
+ * * Field Name: Status
13087
+ * * Display Name: Status
13088
+ * * SQL Data Type: nvarchar(20)
13089
+ * * Default Value: Active
13090
+ * * Value List Type: List
13091
+ * * Possible Values
13092
+ * * Active
13093
+ * * Disabled
13094
+ * * Description: Lifecycle status. Active widgets mint sessions; Disabled widgets reject all mints (used to turn off a deployment without deleting its config).`),
13095
+ SessionTTLMinutes: z.number().describe(`
13096
+ * * Field Name: SessionTTLMinutes
13097
+ * * Display Name: Session TTL Minutes
13098
+ * * SQL Data Type: int
13099
+ * * Default Value: 15
13100
+ * * Description: Time-to-live in minutes for a minted guest session JWT. Short by design (default 15) to limit replay/theft; the widget refreshes before expiry. Capped at 1440 (24h).`),
13101
+ RateLimitPerMinute: z.number().describe(`
13102
+ * * Field Name: RateLimitPerMinute
13103
+ * * Display Name: Rate Limit Per Minute
13104
+ * * SQL Data Type: int
13105
+ * * Default Value: 30
13106
+ * * Description: Maximum number of guest-session mints allowed per minute per source IP/origin for this widget. Reuses the magic-link rate-limit pattern.`),
13107
+ VoiceMaxSessionMinutes: z.number().nullable().describe(`
13108
+ * * Field Name: VoiceMaxSessionMinutes
13109
+ * * Display Name: Voice Max Session Minutes
13110
+ * * SQL Data Type: int
13111
+ * * Description: Optional hard ceiling (minutes) on a single voice session's duration for this widget. NULL means fall back to the server-wide default. Voice is the biggest cost/abuse surface; the SessionJanitor enforces this server-side (W4).`),
13112
+ EnabledChannels: z.string().nullable().describe(`
13113
+ * * Field Name: EnabledChannels
13114
+ * * Display Name: Enabled Channels
13115
+ * * SQL Data Type: nvarchar(MAX)
13116
+ * * Description: Which MJ interactive channels this widget may attach when a voice session is active, as a JSON array of channel names (e.g. ["Whiteboard"]). Resolved client-side through MJGlobal.ClassFactory the same way the realtime client driver is resolved; each named channel is scoped by the existing Widget Guest RLS on AI Agent Session Channels. NULL or empty array = no channels (the backwards-compatible default). Remote Browser, given its control surface, should only be listed when a deployment explicitly opts in.`),
13117
+ HostPublicKey: z.string().nullable().describe(`
13118
+ * * Field Name: HostPublicKey
13119
+ * * Display Name: Host Public Key
13120
+ * * SQL Data Type: nvarchar(MAX)
13121
+ * * Description: PEM-encoded RS256 public key for the host-identity auth strategy (D1). When AuthStrategy is HostIdentity, the host signs a short-lived identity assertion with its private key; the HostIdentityProvider verifies it against this per-instance key. Supersedes the interim config map (mj.config.cjs hostPublicKeys keyed by PublicKey). NULL when the widget does not use host identity; a HostIdentity widget with no key fails closed at mint.`),
13122
+ RememberReturningVisitors: z.boolean().describe(`
13123
+ * * Field Name: RememberReturningVisitors
13124
+ * * Display Name: Remember Returning Visitors
13125
+ * * SQL Data Type: bit
13126
+ * * Default Value: 0
13127
+ * * Description: Returning-visitor memory opt-in (R6). When 0 (default) this widget sets no durable visitor cookie and writes no cross-session recap — fully off. When 1, the widget mints a durable VisitorKey cookie, links each new Conversation to the visitor's prior one, and writes a recap memory note on close so a returning visitor's agent opens with prior context.`),
13128
+ VisitorMemoryRetentionDays: z.number().nullable().describe(`
13129
+ * * Field Name: VisitorMemoryRetentionDays
13130
+ * * Display Name: Visitor Memory Retention Days
13131
+ * * SQL Data Type: int
13132
+ * * Description: Retention window (days) for returning-visitor recap memory notes generated by this widget. NULL means use the system default. Past this window the visitor's auto-generated recap notes decay/archive via the Memory Manager. Ignored when RememberReturningVisitors = 0.`),
13133
+ __mj_CreatedAt: z.date().describe(`
13134
+ * * Field Name: __mj_CreatedAt
13135
+ * * Display Name: Created At
13136
+ * * SQL Data Type: datetimeoffset
13137
+ * * Default Value: getutcdate()`),
13138
+ __mj_UpdatedAt: z.date().describe(`
13139
+ * * Field Name: __mj_UpdatedAt
13140
+ * * Display Name: Updated At
13141
+ * * SQL Data Type: datetimeoffset
13142
+ * * Default Value: getutcdate()`),
13143
+ Application: z.string().describe(`
13144
+ * * Field Name: Application
13145
+ * * Display Name: Application
13146
+ * * SQL Data Type: nvarchar(100)`),
13147
+ PinnedAgent: z.string().nullable().describe(`
13148
+ * * Field Name: PinnedAgent
13149
+ * * Display Name: Pinned Agent
13150
+ * * SQL Data Type: nvarchar(255)`),
13151
+ GuestRole: z.string().describe(`
13152
+ * * Field Name: GuestRole
13153
+ * * Display Name: Guest Role
13154
+ * * SQL Data Type: nvarchar(50)`),
13155
+ });
12968
13156
  /**
12969
13157
  * zod schema definition for the entity MJ: Conversations
12970
13158
  */
@@ -13102,6 +13290,17 @@ export const MJConversationSchema = z.object({
13102
13290
  * * Display Name: Egress ID
13103
13291
  * * SQL Data Type: nvarchar(255)
13104
13292
  * * Description: The LiveKit egress session id for this meeting's room recording. Set when recording starts; used to stop the egress and to correlate the egress-completion result with this conversation. NULL when the meeting was not recorded.`),
13293
+ VisitorKey: z.string().nullable().describe(`
13294
+ * * Field Name: VisitorKey
13295
+ * * Display Name: Visitor Key
13296
+ * * SQL Data Type: nvarchar(255)
13297
+ * * Description: Durable, opaque returning-visitor anchor (R3). Holds the value of a long-lived first-party cookie minted by the widget on first visit, used to find this visitor's prior conversations while they are still anonymous. Distinct from ExternalID (which stays per-session for RLS isolation). NULL for conversations that are not widget returning-visitor sessions.`),
13298
+ LastConversationID: z.string().nullable().describe(`
13299
+ * * Field Name: LastConversationID
13300
+ * * Display Name: Last Conversation ID
13301
+ * * SQL Data Type: uniqueidentifier
13302
+ * * Related Entity/Foreign Key: MJ: Conversations (vwConversations.ID)
13303
+ * * Description: Conversation-altitude returning-visitor chain (R2). Self-foreign-key to the visitor's immediately prior Conversation (found by VisitorKey or the resolved LinkedEntityID/LinkedRecordID pair at mint time). History and memory are conversation-scoped, so the chain lives here — NOT on AIAgentSession.LastSessionID, which owns reconnect/resume semantics and is walked by the replay viewer. Named to mirror AIAgentSession.LastSessionID. NULL for a brand-new visitor's first conversation.`),
13105
13304
  User: z.string().describe(`
13106
13305
  * * Field Name: User
13107
13306
  * * Display Name: User
@@ -13138,6 +13337,14 @@ export const MJConversationSchema = z.object({
13138
13337
  * * Field Name: RecordingFile
13139
13338
  * * Display Name: Recording File
13140
13339
  * * SQL Data Type: nvarchar(500)`),
13340
+ LastConversation: z.string().nullable().describe(`
13341
+ * * Field Name: LastConversation
13342
+ * * Display Name: Last Conversation
13343
+ * * SQL Data Type: nvarchar(255)`),
13344
+ RootLastConversationID: z.string().nullable().describe(`
13345
+ * * Field Name: RootLastConversationID
13346
+ * * Display Name: Root Last Conversation ID
13347
+ * * SQL Data Type: uniqueidentifier`),
13141
13348
  });
13142
13349
  /**
13143
13350
  * zod schema definition for the entity MJ: Countries
@@ -15344,6 +15551,16 @@ export const MJEntitySchema = z.object({
15344
15551
  * * SQL Data Type: bit
15345
15552
  * * Default Value: 0
15346
15553
  * * Description: When set to 1 AND TrackRecordChanges is also 1, the external change detection system will scan this entity for changes made outside the MJ framework (direct SQL, third-party tools, etc.) and replay them through Save() to create proper RecordChange audit entries. Default is 0 (opt-out) because most entities, especially __mj schema metadata tables, are managed by migrations/CodeGen and should not be scanned.`),
15554
+ ExternalDataSourceID: z.string().nullable().describe(`
15555
+ * * Field Name: ExternalDataSourceID
15556
+ * * Display Name: External Data Source ID
15557
+ * * SQL Data Type: uniqueidentifier
15558
+ * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)`),
15559
+ ExternalObjectName: z.string().nullable().describe(`
15560
+ * * Field Name: ExternalObjectName
15561
+ * * Display Name: External Object Name
15562
+ * * SQL Data Type: nvarchar(255)
15563
+ * * Description: Remote object name (table / view / collection) on the external system that backs this entity. Resolved against the data source DefaultSchema/DefaultDatabase when unqualified. Only meaningful when ExternalDataSourceID is set.`),
15347
15564
  CodeName: z.string().nullable().describe(`
15348
15565
  * * Field Name: CodeName
15349
15566
  * * Display Name: Code Name
@@ -17754,6 +17971,206 @@ export const MJExplorerNavigationItemSchema = z.object({
17754
17971
  * * SQL Data Type: datetimeoffset
17755
17972
  * * Default Value: getutcdate()`),
17756
17973
  });
17974
+ /**
17975
+ * zod schema definition for the entity MJ: External Data Source Types
17976
+ */
17977
+ export const MJExternalDataSourceTypeSchema = z.object({
17978
+ ID: z.string().describe(`
17979
+ * * Field Name: ID
17980
+ * * Display Name: ID
17981
+ * * SQL Data Type: uniqueidentifier
17982
+ * * Default Value: newsequentialid()`),
17983
+ Name: z.string().describe(`
17984
+ * * Field Name: Name
17985
+ * * Display Name: Name
17986
+ * * SQL Data Type: nvarchar(100)
17987
+ * * Description: Display name of the external data source driver type (e.g. Snowflake, Oracle, MongoDB, PostgreSQL).`),
17988
+ Description: z.string().nullable().describe(`
17989
+ * * Field Name: Description
17990
+ * * Display Name: Description
17991
+ * * SQL Data Type: nvarchar(MAX)
17992
+ * * Description: Human-readable description of the driver type and what remote systems it targets.`),
17993
+ DriverClass: z.string().describe(`
17994
+ * * Field Name: DriverClass
17995
+ * * Display Name: Driver Class
17996
+ * * SQL Data Type: nvarchar(255)
17997
+ * * Description: Driver class resolved at runtime via MJGlobal.ClassFactory.CreateInstance(BaseExternalDataSourceDriver, DriverClass). MUST match the @RegisterClass key on the concrete driver (e.g. 'SnowflakeExternalDriver').`),
17998
+ RequiredCredentialTypeID: z.string().nullable().describe(`
17999
+ * * Field Name: RequiredCredentialTypeID
18000
+ * * Display Name: Required Credential Type ID
18001
+ * * SQL Data Type: uniqueidentifier
18002
+ * * Related Entity/Foreign Key: MJ: Credential Types (vwCredentialTypes.ID)`),
18003
+ MetadataIntrospectionStrategy: z.union([z.literal('InformationSchema'), z.literal('Manual'), z.literal('NativeCatalog'), z.literal('SampledDocuments')]).describe(`
18004
+ * * Field Name: MetadataIntrospectionStrategy
18005
+ * * Display Name: Metadata Introspection Strategy
18006
+ * * SQL Data Type: nvarchar(17)
18007
+ * * Default Value: Manual
18008
+ * * Value List Type: List
18009
+ * * Possible Values
18010
+ * * InformationSchema
18011
+ * * Manual
18012
+ * * NativeCatalog
18013
+ * * SampledDocuments
18014
+ * * Description: How the metadata-introspection command hydrates Entity/EntityField rows from this driver family: InformationSchema (ANSI INFORMATION_SCHEMA), NativeCatalog (vendor catalog views), SampledDocuments (infer shape from sampled documents, e.g. MongoDB), or Manual (no automated introspection).`),
18015
+ FilterDialect: z.union([z.literal('ansi'), z.literal('mongo-ast'), z.literal('mysql'), z.literal('oracle'), z.literal('pgsql'), z.literal('tsql')]).describe(`
18016
+ * * Field Name: FilterDialect
18017
+ * * Display Name: Filter Dialect
18018
+ * * SQL Data Type: nvarchar(9)
18019
+ * * Default Value: ansi
18020
+ * * Value List Type: List
18021
+ * * Possible Values
18022
+ * * ansi
18023
+ * * mongo-ast
18024
+ * * mysql
18025
+ * * oracle
18026
+ * * pgsql
18027
+ * * tsql
18028
+ * * Description: Dialect the driver expects for RunView filter pass-through: tsql, ansi, pgsql, mysql, oracle, or mongo-ast (MongoDB filter AST translated within the driver).`),
18029
+ PagingStrategy: z.union([z.literal('Cursor'), z.literal('LimitOffset'), z.literal('OffsetFetch'), z.literal('TopSkip')]).describe(`
18030
+ * * Field Name: PagingStrategy
18031
+ * * Display Name: Paging Strategy
18032
+ * * SQL Data Type: nvarchar(11)
18033
+ * * Default Value: LimitOffset
18034
+ * * Value List Type: List
18035
+ * * Possible Values
18036
+ * * Cursor
18037
+ * * LimitOffset
18038
+ * * OffsetFetch
18039
+ * * TopSkip
18040
+ * * Description: Pagination mechanism the driver uses: OffsetFetch (SQL Server OFFSET/FETCH), LimitOffset (Postgres/MySQL LIMIT/OFFSET), TopSkip, or Cursor.`),
18041
+ SupportsSchemaIntrospection: z.boolean().describe(`
18042
+ * * Field Name: SupportsSchemaIntrospection
18043
+ * * Display Name: Supports Schema Introspection
18044
+ * * SQL Data Type: bit
18045
+ * * Default Value: 1
18046
+ * * Description: Whether the driver can introspect remote schema metadata to assist Entity/EntityField generation.`),
18047
+ SupportsNativeQueries: z.boolean().describe(`
18048
+ * * Field Name: SupportsNativeQueries
18049
+ * * Display Name: Supports Native Queries
18050
+ * * SQL Data Type: bit
18051
+ * * Default Value: 1
18052
+ * * Description: Whether the driver supports native-dialect query execution for MJ Queries that set ExternalDataSourceID.`),
18053
+ SupportsReadWrite: z.boolean().describe(`
18054
+ * * Field Name: SupportsReadWrite
18055
+ * * Display Name: Supports Read Write
18056
+ * * SQL Data Type: bit
18057
+ * * Default Value: 0
18058
+ * * Description: Reserved for a future write-capable phase. Always 0 in the current read-only design; external entities are read-only.`),
18059
+ Status: z.union([z.literal('Active'), z.literal('Deprecated')]).describe(`
18060
+ * * Field Name: Status
18061
+ * * Display Name: Status
18062
+ * * SQL Data Type: nvarchar(10)
18063
+ * * Default Value: Active
18064
+ * * Value List Type: List
18065
+ * * Possible Values
18066
+ * * Active
18067
+ * * Deprecated
18068
+ * * Description: Lifecycle status of the driver-type catalog entry: Active or Deprecated.`),
18069
+ __mj_CreatedAt: z.date().describe(`
18070
+ * * Field Name: __mj_CreatedAt
18071
+ * * Display Name: Created At
18072
+ * * SQL Data Type: datetimeoffset
18073
+ * * Default Value: getutcdate()`),
18074
+ __mj_UpdatedAt: z.date().describe(`
18075
+ * * Field Name: __mj_UpdatedAt
18076
+ * * Display Name: Updated At
18077
+ * * SQL Data Type: datetimeoffset
18078
+ * * Default Value: getutcdate()`),
18079
+ RequiredCredentialType: z.string().nullable().describe(`
18080
+ * * Field Name: RequiredCredentialType
18081
+ * * Display Name: Required Credential Type
18082
+ * * SQL Data Type: nvarchar(100)`),
18083
+ });
18084
+ /**
18085
+ * zod schema definition for the entity MJ: External Data Sources
18086
+ */
18087
+ export const MJExternalDataSourceSchema = z.object({
18088
+ ID: z.string().describe(`
18089
+ * * Field Name: ID
18090
+ * * Display Name: ID
18091
+ * * SQL Data Type: uniqueidentifier
18092
+ * * Default Value: newsequentialid()`),
18093
+ Name: z.string().describe(`
18094
+ * * Field Name: Name
18095
+ * * Display Name: Name
18096
+ * * SQL Data Type: nvarchar(100)
18097
+ * * Description: Display name of this configured external data source instance.`),
18098
+ Description: z.string().nullable().describe(`
18099
+ * * Field Name: Description
18100
+ * * Display Name: Description
18101
+ * * SQL Data Type: nvarchar(MAX)
18102
+ * * Description: Human-readable description of what this data source connects to and what it is used for.`),
18103
+ TypeID: z.string().describe(`
18104
+ * * Field Name: TypeID
18105
+ * * Display Name: Type ID
18106
+ * * SQL Data Type: uniqueidentifier
18107
+ * * Related Entity/Foreign Key: MJ: External Data Source Types (vwExternalDataSourceTypes.ID)`),
18108
+ CredentialID: z.string().nullable().describe(`
18109
+ * * Field Name: CredentialID
18110
+ * * Display Name: Credential ID
18111
+ * * SQL Data Type: uniqueidentifier
18112
+ * * Related Entity/Foreign Key: MJ: Credentials (vwCredentials.ID)`),
18113
+ DefaultSchema: z.string().nullable().describe(`
18114
+ * * Field Name: DefaultSchema
18115
+ * * Display Name: Default Schema
18116
+ * * SQL Data Type: nvarchar(255)
18117
+ * * Description: Default schema/namespace to resolve unqualified ExternalObjectName values against on the remote system (e.g. a SQL schema, Snowflake schema).`),
18118
+ DefaultDatabase: z.string().nullable().describe(`
18119
+ * * Field Name: DefaultDatabase
18120
+ * * Display Name: Default Database
18121
+ * * SQL Data Type: nvarchar(255)
18122
+ * * Description: Default database/catalog on the remote system (e.g. Snowflake database, MongoDB dbName). Nullable when the driver derives it from connection config.`),
18123
+ ConnectionConfig: z.string().nullable().describe(`
18124
+ * * Field Name: ConnectionConfig
18125
+ * * Display Name: Connection Config
18126
+ * * SQL Data Type: nvarchar(MAX)
18127
+ * * Description: JSON blob of NON-SECRET driver configuration (host, port, region, warehouse, replica-set name, pool sizing). All secrets flow through CredentialID -> Credential -> CredentialEngine; never store secrets here.`),
18128
+ DefaultCacheTTLSeconds: z.number().describe(`
18129
+ * * Field Name: DefaultCacheTTLSeconds
18130
+ * * Display Name: Default Cache TTL Seconds
18131
+ * * SQL Data Type: int
18132
+ * * Default Value: 300
18133
+ * * Description: Default server-side cache TTL (seconds) for reads against this source. External reads use time-based TTL because no event-driven invalidation is possible on remote systems. Default 300.`),
18134
+ Status: z.union([z.literal('Active'), z.literal('Disabled'), z.literal('TestFailed')]).describe(`
18135
+ * * Field Name: Status
18136
+ * * Display Name: Status
18137
+ * * SQL Data Type: nvarchar(10)
18138
+ * * Default Value: Active
18139
+ * * Value List Type: List
18140
+ * * Possible Values
18141
+ * * Active
18142
+ * * Disabled
18143
+ * * TestFailed
18144
+ * * Description: Operational status of this data source: Active (usable), Disabled (RunView fails fast), or TestFailed (last connection test failed).`),
18145
+ LastConnectionTestAt: z.date().nullable().describe(`
18146
+ * * Field Name: LastConnectionTestAt
18147
+ * * Display Name: Last Connection Test At
18148
+ * * SQL Data Type: datetimeoffset
18149
+ * * Description: Timestamp of the most recent connection test against this source.`),
18150
+ LastConnectionTestResult: z.string().nullable().describe(`
18151
+ * * Field Name: LastConnectionTestResult
18152
+ * * Display Name: Last Connection Test Result
18153
+ * * SQL Data Type: nvarchar(MAX)
18154
+ * * Description: Result message from the most recent connection test (success detail or error text).`),
18155
+ __mj_CreatedAt: z.date().describe(`
18156
+ * * Field Name: __mj_CreatedAt
18157
+ * * Display Name: Created At
18158
+ * * SQL Data Type: datetimeoffset
18159
+ * * Default Value: getutcdate()`),
18160
+ __mj_UpdatedAt: z.date().describe(`
18161
+ * * Field Name: __mj_UpdatedAt
18162
+ * * Display Name: Updated At
18163
+ * * SQL Data Type: datetimeoffset
18164
+ * * Default Value: getutcdate()`),
18165
+ Type: z.string().describe(`
18166
+ * * Field Name: Type
18167
+ * * Display Name: Type
18168
+ * * SQL Data Type: nvarchar(100)`),
18169
+ Credential: z.string().nullable().describe(`
18170
+ * * Field Name: Credential
18171
+ * * Display Name: Credential
18172
+ * * SQL Data Type: nvarchar(200)`),
18173
+ });
17757
18174
  /**
17758
18175
  * zod schema definition for the entity MJ: File Categories
17759
18176
  */
@@ -22361,6 +22778,11 @@ export const MJQuerySchema = z.object({
22361
22778
  * * SQL Data Type: bit
22362
22779
  * * Default Value: 0
22363
22780
  * * Description: When true, this query can be referenced by other queries using composition syntax. Only queries that are both Reusable and Approved can be composed into other queries.`),
22781
+ ExternalDataSourceID: z.string().nullable().describe(`
22782
+ * * Field Name: ExternalDataSourceID
22783
+ * * Display Name: External Data Source ID
22784
+ * * SQL Data Type: uniqueidentifier
22785
+ * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)`),
22364
22786
  Category: z.string().nullable().describe(`
22365
22787
  * * Field Name: Category
22366
22788
  * * Display Name: Category Name
@@ -22373,6 +22795,10 @@ export const MJQuerySchema = z.object({
22373
22795
  * * Field Name: SQLDialect
22374
22796
  * * Display Name: SQL Dialect Name
22375
22797
  * * SQL Data Type: nvarchar(100)`),
22798
+ ExternalDataSource: z.string().nullable().describe(`
22799
+ * * Field Name: ExternalDataSource
22800
+ * * Display Name: External Data Source
22801
+ * * SQL Data Type: nvarchar(100)`),
22376
22802
  });
22377
22803
  /**
22378
22804
  * zod schema definition for the entity MJ: Query Categories
@@ -29276,6 +29702,363 @@ export const MJUserRoleSchema = z.object({
29276
29702
  * * Display Name: Role
29277
29703
  * * SQL Data Type: nvarchar(50)`),
29278
29704
  });
29705
+ /**
29706
+ * zod schema definition for the entity MJ: User Routine Recipients
29707
+ */
29708
+ export const MJUserRoutineRecipientSchema = z.object({
29709
+ ID: z.string().describe(`
29710
+ * * Field Name: ID
29711
+ * * Display Name: ID
29712
+ * * SQL Data Type: uniqueidentifier
29713
+ * * Default Value: newsequentialid()`),
29714
+ RoutineID: z.string().describe(`
29715
+ * * Field Name: RoutineID
29716
+ * * Display Name: Routine
29717
+ * * SQL Data Type: uniqueidentifier
29718
+ * * Related Entity/Foreign Key: MJ: User Routines (vwUserRoutines.ID)
29719
+ * * Description: Routine this recipient belongs to.`),
29720
+ UserID: z.string().nullable().describe(`
29721
+ * * Field Name: UserID
29722
+ * * Display Name: User
29723
+ * * SQL Data Type: uniqueidentifier
29724
+ * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
29725
+ * * Description: Internal MJ user recipient (when notifying an existing user). Either UserID or Email is set.`),
29726
+ Email: z.string().nullable().describe(`
29727
+ * * Field Name: Email
29728
+ * * Display Name: Email Address
29729
+ * * SQL Data Type: nvarchar(255)
29730
+ * * Description: External email recipient (when notifying a non-user). Either UserID or Email is set.`),
29731
+ Channel: z.union([z.literal('Email'), z.literal('InApp')]).describe(`
29732
+ * * Field Name: Channel
29733
+ * * Display Name: Channel
29734
+ * * SQL Data Type: nvarchar(20)
29735
+ * * Default Value: InApp
29736
+ * * Value List Type: List
29737
+ * * Possible Values
29738
+ * * Email
29739
+ * * InApp
29740
+ * * Description: Delivery channel for this recipient: InApp or Email.`),
29741
+ Sequence: z.number().describe(`
29742
+ * * Field Name: Sequence
29743
+ * * Display Name: Sequence
29744
+ * * SQL Data Type: int
29745
+ * * Default Value: 0
29746
+ * * Description: Explicit display/notification ordering of recipients within a routine (ascending).`),
29747
+ __mj_CreatedAt: z.date().describe(`
29748
+ * * Field Name: __mj_CreatedAt
29749
+ * * Display Name: Created At
29750
+ * * SQL Data Type: datetimeoffset
29751
+ * * Default Value: getutcdate()`),
29752
+ __mj_UpdatedAt: z.date().describe(`
29753
+ * * Field Name: __mj_UpdatedAt
29754
+ * * Display Name: Updated At
29755
+ * * SQL Data Type: datetimeoffset
29756
+ * * Default Value: getutcdate()`),
29757
+ Routine: z.string().describe(`
29758
+ * * Field Name: Routine
29759
+ * * Display Name: Routine Name
29760
+ * * SQL Data Type: nvarchar(255)`),
29761
+ User: z.string().nullable().describe(`
29762
+ * * Field Name: User
29763
+ * * Display Name: User Name
29764
+ * * SQL Data Type: nvarchar(100)`),
29765
+ });
29766
+ /**
29767
+ * zod schema definition for the entity MJ: User Routine Runs
29768
+ */
29769
+ export const MJUserRoutineRunSchema = z.object({
29770
+ ID: z.string().describe(`
29771
+ * * Field Name: ID
29772
+ * * Display Name: ID
29773
+ * * SQL Data Type: uniqueidentifier
29774
+ * * Default Value: newsequentialid()`),
29775
+ RoutineID: z.string().describe(`
29776
+ * * Field Name: RoutineID
29777
+ * * Display Name: Routine
29778
+ * * SQL Data Type: uniqueidentifier
29779
+ * * Related Entity/Foreign Key: MJ: User Routines (vwUserRoutines.ID)
29780
+ * * Description: Routine this run belongs to.`),
29781
+ StartedAt: z.date().describe(`
29782
+ * * Field Name: StartedAt
29783
+ * * Display Name: Started At
29784
+ * * SQL Data Type: datetimeoffset
29785
+ * * Default Value: sysdatetimeoffset()
29786
+ * * Description: When the run started.`),
29787
+ CompletedAt: z.date().nullable().describe(`
29788
+ * * Field Name: CompletedAt
29789
+ * * Display Name: Completed At
29790
+ * * SQL Data Type: datetimeoffset
29791
+ * * Description: When the run completed (null while running).`),
29792
+ Status: z.union([z.literal('Failed'), z.literal('Running'), z.literal('Skipped'), z.literal('Success')]).describe(`
29793
+ * * Field Name: Status
29794
+ * * Display Name: Status
29795
+ * * SQL Data Type: nvarchar(20)
29796
+ * * Default Value: Running
29797
+ * * Value List Type: List
29798
+ * * Possible Values
29799
+ * * Failed
29800
+ * * Running
29801
+ * * Skipped
29802
+ * * Success
29803
+ * * Description: Run outcome.`),
29804
+ AgentRunID: z.string().nullable().describe(`
29805
+ * * Field Name: AgentRunID
29806
+ * * Display Name: Agent Run
29807
+ * * SQL Data Type: uniqueidentifier
29808
+ * * Related Entity/Foreign Key: MJ: AI Agent Runs (vwAIAgentRuns.ID)
29809
+ * * Description: Linked AI Agent Run when the routine target is an agent.`),
29810
+ PromptRunID: z.string().nullable().describe(`
29811
+ * * Field Name: PromptRunID
29812
+ * * Display Name: Prompt Run
29813
+ * * SQL Data Type: uniqueidentifier
29814
+ * * Related Entity/Foreign Key: MJ: AI Prompt Runs (vwAIPromptRuns.ID)
29815
+ * * Description: For Prompt targets, links to the MJ: AI Prompt Runs record for this execution — tokens, cost, and full telemetry live there (never duplicated here).`),
29816
+ ActionExecutionLogID: z.string().nullable().describe(`
29817
+ * * Field Name: ActionExecutionLogID
29818
+ * * Display Name: Action Execution Log
29819
+ * * SQL Data Type: uniqueidentifier
29820
+ * * Related Entity/Foreign Key: MJ: Action Execution Logs (vwActionExecutionLogs.ID)
29821
+ * * Description: For Action targets, links to the MJ: Action Execution Logs record for this execution — params, results, and telemetry live there (never duplicated here).`),
29822
+ ResultSummary: z.string().nullable().describe(`
29823
+ * * Field Name: ResultSummary
29824
+ * * Display Name: Result Summary
29825
+ * * SQL Data Type: nvarchar(MAX)
29826
+ * * Description: Human-readable summary of the run result.`),
29827
+ ResultHash: z.string().nullable().describe(`
29828
+ * * Field Name: ResultHash
29829
+ * * Display Name: Result Hash
29830
+ * * SQL Data Type: nvarchar(100)
29831
+ * * Description: Hash of the result, compared against the routine LastResultHash for OnChange detection.`),
29832
+ NotificationSent: z.boolean().describe(`
29833
+ * * Field Name: NotificationSent
29834
+ * * Display Name: Notification Sent
29835
+ * * SQL Data Type: bit
29836
+ * * Default Value: 0
29837
+ * * Description: Whether a notification was dispatched for this run.`),
29838
+ ErrorMessage: z.string().nullable().describe(`
29839
+ * * Field Name: ErrorMessage
29840
+ * * Display Name: Error Message
29841
+ * * SQL Data Type: nvarchar(MAX)
29842
+ * * Description: Error detail when Status is Failed.`),
29843
+ __mj_CreatedAt: z.date().describe(`
29844
+ * * Field Name: __mj_CreatedAt
29845
+ * * Display Name: Created At
29846
+ * * SQL Data Type: datetimeoffset
29847
+ * * Default Value: getutcdate()`),
29848
+ __mj_UpdatedAt: z.date().describe(`
29849
+ * * Field Name: __mj_UpdatedAt
29850
+ * * Display Name: Updated At
29851
+ * * SQL Data Type: datetimeoffset
29852
+ * * Default Value: getutcdate()`),
29853
+ Routine: z.string().describe(`
29854
+ * * Field Name: Routine
29855
+ * * Display Name: Routine Name
29856
+ * * SQL Data Type: nvarchar(255)`),
29857
+ AgentRun: z.string().nullable().describe(`
29858
+ * * Field Name: AgentRun
29859
+ * * Display Name: Agent Run Reference
29860
+ * * SQL Data Type: nvarchar(255)`),
29861
+ PromptRun: z.string().nullable().describe(`
29862
+ * * Field Name: PromptRun
29863
+ * * Display Name: Prompt Run Reference
29864
+ * * SQL Data Type: nvarchar(255)`),
29865
+ ActionExecutionLog: z.string().nullable().describe(`
29866
+ * * Field Name: ActionExecutionLog
29867
+ * * Display Name: Action Execution Log Reference
29868
+ * * SQL Data Type: nvarchar(425)`),
29869
+ });
29870
+ /**
29871
+ * zod schema definition for the entity MJ: User Routines
29872
+ */
29873
+ export const MJUserRoutineSchema = z.object({
29874
+ ID: z.string().describe(`
29875
+ * * Field Name: ID
29876
+ * * Display Name: ID
29877
+ * * SQL Data Type: uniqueidentifier
29878
+ * * Default Value: newsequentialid()`),
29879
+ UserID: z.string().describe(`
29880
+ * * Field Name: UserID
29881
+ * * Display Name: User
29882
+ * * SQL Data Type: uniqueidentifier
29883
+ * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
29884
+ * * Description: Owner of the routine. Routines are private to their owner (row-level access).`),
29885
+ EnvironmentID: z.string().nullable().describe(`
29886
+ * * Field Name: EnvironmentID
29887
+ * * Display Name: Environment
29888
+ * * SQL Data Type: uniqueidentifier
29889
+ * * Related Entity/Foreign Key: MJ: Environments (vwEnvironments.ID)
29890
+ * * Description: Optional environment scope for the routine.`),
29891
+ Name: z.string().describe(`
29892
+ * * Field Name: Name
29893
+ * * Display Name: Name
29894
+ * * SQL Data Type: nvarchar(255)
29895
+ * * Description: User-facing routine name.`),
29896
+ Description: z.string().nullable().describe(`
29897
+ * * Field Name: Description
29898
+ * * Display Name: Description
29899
+ * * SQL Data Type: nvarchar(MAX)
29900
+ * * Description: Optional description of what the routine does.`),
29901
+ Status: z.union([z.literal('Active'), z.literal('Disabled'), z.literal('Paused')]).describe(`
29902
+ * * Field Name: Status
29903
+ * * Display Name: Status
29904
+ * * SQL Data Type: nvarchar(20)
29905
+ * * Default Value: Active
29906
+ * * Value List Type: List
29907
+ * * Possible Values
29908
+ * * Active
29909
+ * * Disabled
29910
+ * * Paused
29911
+ * * Description: Lifecycle status: Active (eligible to run), Paused (temporarily off), Disabled (off).`),
29912
+ RoutineType: z.union([z.literal('Monitoring'), z.literal('Scheduled')]).describe(`
29913
+ * * Field Name: RoutineType
29914
+ * * Display Name: Routine Type
29915
+ * * SQL Data Type: nvarchar(20)
29916
+ * * Default Value: Scheduled
29917
+ * * Value List Type: List
29918
+ * * Possible Values
29919
+ * * Monitoring
29920
+ * * Scheduled
29921
+ * * Description: Scheduled (always notify per NotifyCondition) or Monitoring (intended for OnChange detection via result hashing).`),
29922
+ TargetType: z.union([z.literal('Action'), z.literal('Agent'), z.literal('Prompt')]).describe(`
29923
+ * * Field Name: TargetType
29924
+ * * Display Name: Target Type
29925
+ * * SQL Data Type: nvarchar(20)
29926
+ * * Value List Type: List
29927
+ * * Possible Values
29928
+ * * Action
29929
+ * * Agent
29930
+ * * Prompt
29931
+ * * Description: What kind of target this routine runs: Agent, Action, or Prompt. Determines how TargetID is interpreted.`),
29932
+ TargetID: z.string().describe(`
29933
+ * * Field Name: TargetID
29934
+ * * Display Name: Target
29935
+ * * SQL Data Type: uniqueidentifier
29936
+ * * Description: Polymorphic reference resolved by TargetType (AIAgent.ID, Action.ID, or AIPrompt.ID). No FK because the target table varies.`),
29937
+ InitialMessage: z.string().nullable().describe(`
29938
+ * * Field Name: InitialMessage
29939
+ * * Display Name: Initial Message
29940
+ * * SQL Data Type: nvarchar(MAX)
29941
+ * * Description: For Agent targets, the user message sent to the agent on each run.`),
29942
+ StartingPayload: z.string().nullable().describe(`
29943
+ * * Field Name: StartingPayload
29944
+ * * Display Name: Starting Payload
29945
+ * * SQL Data Type: nvarchar(MAX)
29946
+ * * Description: Optional JSON starting payload passed to the target on each run.`),
29947
+ RequestedSkillIDs: z.string().nullable().describe(`
29948
+ * * Field Name: RequestedSkillIDs
29949
+ * * Display Name: Requested Skills
29950
+ * * SQL Data Type: nvarchar(MAX)
29951
+ * * Description: Optional JSON array of MJ: AI Skills IDs to pre-activate when the routine target is an Agent — threaded as ExecuteAgentParams.requestedSkillIDs so the agent starts each scheduled run with the requested skills' instructions and tools in effect (subject to all availability gates; ActivationMode does not gate this explicit-request path). Ignored for Action/Prompt targets.`),
29952
+ CronExpression: z.string().describe(`
29953
+ * * Field Name: CronExpression
29954
+ * * Display Name: Cron Expression
29955
+ * * SQL Data Type: nvarchar(100)
29956
+ * * Description: Standard cron expression evaluated by the dispatcher to determine when the routine is due.`),
29957
+ StartAt: z.date().nullable().describe(`
29958
+ * * Field Name: StartAt
29959
+ * * Display Name: Start At
29960
+ * * SQL Data Type: datetimeoffset
29961
+ * * Description: Optional activation window start. An Active routine does not run before this time; once current time passes StartAt the dispatcher begins scheduling it. NULL = eligible immediately.`),
29962
+ EndAt: z.date().nullable().describe(`
29963
+ * * Field Name: EndAt
29964
+ * * Display Name: End At
29965
+ * * SQL Data Type: datetimeoffset
29966
+ * * Description: Optional activation window end. An Active routine stops running once current time passes EndAt — automatic sunset without changing Status. NULL = no end.`),
29967
+ NotificationTemplateID: z.string().nullable().describe(`
29968
+ * * Field Name: NotificationTemplateID
29969
+ * * Display Name: Notification Template
29970
+ * * SQL Data Type: uniqueidentifier
29971
+ * * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)
29972
+ * * Description: Optional MJ Template used to render routine notifications from the runs output data (result summary, status, target info) via the standard MJ templating architecture. When NULL, the system default routine-notification template (seeded via metadata, resolvable per instance — not hardcoded) is used.`),
29973
+ Timezone: z.string().describe(`
29974
+ * * Field Name: Timezone
29975
+ * * Display Name: Timezone
29976
+ * * SQL Data Type: nvarchar(100)
29977
+ * * Default Value: UTC
29978
+ * * Description: IANA timezone used when evaluating CronExpression (e.g. America/Chicago).`),
29979
+ NextRunAt: z.date().nullable().describe(`
29980
+ * * Field Name: NextRunAt
29981
+ * * Display Name: Next Run At
29982
+ * * SQL Data Type: datetimeoffset
29983
+ * * Description: Next scheduled run time, computed after each run.`),
29984
+ LastRunAt: z.date().nullable().describe(`
29985
+ * * Field Name: LastRunAt
29986
+ * * Display Name: Last Run At
29987
+ * * SQL Data Type: datetimeoffset
29988
+ * * Description: Timestamp of the most recent run.`),
29989
+ LastRunStatus: z.union([z.literal('Failed'), z.literal('Running'), z.literal('Skipped'), z.literal('Success')]).nullable().describe(`
29990
+ * * Field Name: LastRunStatus
29991
+ * * Display Name: Last Run Status
29992
+ * * SQL Data Type: nvarchar(20)
29993
+ * * Value List Type: List
29994
+ * * Possible Values
29995
+ * * Failed
29996
+ * * Running
29997
+ * * Skipped
29998
+ * * Success
29999
+ * * Description: Outcome of the most recent run.`),
30000
+ LastResultHash: z.string().nullable().describe(`
30001
+ * * Field Name: LastResultHash
30002
+ * * Display Name: Last Result Hash
30003
+ * * SQL Data Type: nvarchar(100)
30004
+ * * Description: Hash of the most recent result, used by Monitoring routines to detect change for OnChange notifications.`),
30005
+ NotifyCondition: z.union([z.literal('Always'), z.literal('OnChange'), z.literal('OnFailure'), z.literal('OnSuccess')]).describe(`
30006
+ * * Field Name: NotifyCondition
30007
+ * * Display Name: Notify Condition
30008
+ * * SQL Data Type: nvarchar(20)
30009
+ * * Default Value: Always
30010
+ * * Value List Type: List
30011
+ * * Possible Values
30012
+ * * Always
30013
+ * * OnChange
30014
+ * * OnFailure
30015
+ * * OnSuccess
30016
+ * * Description: When to notify: Always, OnSuccess, OnFailure, or OnChange (result differs from prior run).`),
30017
+ NotifyViaInApp: z.boolean().describe(`
30018
+ * * Field Name: NotifyViaInApp
30019
+ * * Display Name: Notify Via In-App
30020
+ * * SQL Data Type: bit
30021
+ * * Default Value: 1
30022
+ * * Description: Deliver notifications via in-app notification.`),
30023
+ NotifyViaEmail: z.boolean().describe(`
30024
+ * * Field Name: NotifyViaEmail
30025
+ * * Display Name: Notify Via Email
30026
+ * * SQL Data Type: bit
30027
+ * * Default Value: 0
30028
+ * * Description: Deliver notifications via email.`),
30029
+ __mj_CreatedAt: z.date().describe(`
30030
+ * * Field Name: __mj_CreatedAt
30031
+ * * Display Name: Created At
30032
+ * * SQL Data Type: datetimeoffset
30033
+ * * Default Value: getutcdate()`),
30034
+ __mj_UpdatedAt: z.date().describe(`
30035
+ * * Field Name: __mj_UpdatedAt
30036
+ * * Display Name: Updated At
30037
+ * * SQL Data Type: datetimeoffset
30038
+ * * Default Value: getutcdate()`),
30039
+ ConversationID: z.string().nullable().describe(`
30040
+ * * Field Name: ConversationID
30041
+ * * Display Name: Conversation
30042
+ * * SQL Data Type: uniqueidentifier
30043
+ * * Related Entity/Foreign Key: MJ: Conversations (vwConversations.ID)
30044
+ * * Description: The dedicated conversation this routine's Agent runs append to (created on first conversation-mode run, Application-scoped so it stays out of the default chat list). NULL when the routine has never run in conversation mode.`),
30045
+ User: z.string().describe(`
30046
+ * * Field Name: User
30047
+ * * Display Name: User Name
30048
+ * * SQL Data Type: nvarchar(100)`),
30049
+ Environment: z.string().nullable().describe(`
30050
+ * * Field Name: Environment
30051
+ * * Display Name: Environment Name
30052
+ * * SQL Data Type: nvarchar(255)`),
30053
+ NotificationTemplate: z.string().nullable().describe(`
30054
+ * * Field Name: NotificationTemplate
30055
+ * * Display Name: Notification Template Name
30056
+ * * SQL Data Type: nvarchar(255)`),
30057
+ Conversation: z.string().nullable().describe(`
30058
+ * * Field Name: Conversation
30059
+ * * Display Name: Conversation Name
30060
+ * * SQL Data Type: nvarchar(255)`),
30061
+ });
29279
30062
  /**
29280
30063
  * zod schema definition for the entity MJ: User Settings
29281
30064
  */
@@ -33336,6 +34119,7 @@ let MJAIAgentChannelEntity = class MJAIAgentChannelEntity extends BaseEntity {
33336
34119
  * * Field Name: UIConfig
33337
34120
  * * Display Name: UI Configuration
33338
34121
  * * SQL Data Type: nvarchar(MAX)
34122
+ * * JSON Type: MJAIAgentChannelEntity_IChannelUIConfig
33339
34123
  * * Description: Channel-definition-level presentation/chrome config JSON (shape = IChannelUIConfig): tab DisplayName, GroupName, Color (prefer a design-token name), Icon, SortOrder. Distinct from ConfigSchema, which validates per-session AIAgentSessionChannel.Config state-of-record. Null = host defaults.
33340
34124
  */
33341
34125
  get UIConfig() {
@@ -37265,6 +38049,11 @@ export { MJAIAgentRunMediaEntity };
37265
38049
  * @public
37266
38050
  */
37267
38051
  let MJAIAgentRunStepEntity = class MJAIAgentRunStepEntity extends BaseEntity {
38052
+ constructor() {
38053
+ super(...arguments);
38054
+ this._SkillsObject_cached = undefined;
38055
+ this._SkillsObject_lastRaw = null;
38056
+ }
37268
38057
  /**
37269
38058
  * Loads the MJ: AI Agent Run Steps record from the database
37270
38059
  * @param ID: string - primary key value to load the MJ: AI Agent Run Steps record.
@@ -37653,8 +38442,39 @@ detailed information about what validation rules failed.
37653
38442
  this.Set('Comments', value);
37654
38443
  }
37655
38444
  /**
38445
+ * * Field Name: Skills
38446
+ * * Display Name: Skills Used
38447
+ * * SQL Data Type: nvarchar(MAX)
38448
+ * * JSON Type: Array<MJAIAgentRunStepEntity_AgentSkillInvocation>
38449
+ * * 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).
38450
+ */
38451
+ get Skills() {
38452
+ return this.Get('Skills');
38453
+ }
38454
+ set Skills(value) {
38455
+ this.Set('Skills', value);
38456
+ }
38457
+ /**
38458
+ * Typed accessor for Skills — returns parsed JSON as Array<MJAIAgentRunStepEntity_AgentSkillInvocation>.
38459
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
38460
+ */
38461
+ get SkillsObject() {
38462
+ const raw = this.Skills;
38463
+ if (raw !== this._SkillsObject_lastRaw) {
38464
+ this._SkillsObject_cached = raw ? JSON.parse(raw) : null;
38465
+ this._SkillsObject_lastRaw = raw;
38466
+ }
38467
+ return this._SkillsObject_cached;
38468
+ }
38469
+ set SkillsObject(value) {
38470
+ const raw = value ? JSON.stringify(value) : null;
38471
+ this.Skills = raw;
38472
+ this._SkillsObject_cached = value;
38473
+ this._SkillsObject_lastRaw = raw;
38474
+ }
38475
+ /**
37656
38476
  * * Field Name: AgentRun
37657
- * * Display Name: Agent Run
38477
+ * * Display Name: Agent Run Context
37658
38478
  * * SQL Data Type: nvarchar(255)
37659
38479
  */
37660
38480
  get AgentRun() {
@@ -37662,7 +38482,7 @@ detailed information about what validation rules failed.
37662
38482
  }
37663
38483
  /**
37664
38484
  * * Field Name: Parent
37665
- * * Display Name: Parent Step
38485
+ * * Display Name: Parent Step Context
37666
38486
  * * SQL Data Type: nvarchar(255)
37667
38487
  */
37668
38488
  get Parent() {
@@ -37670,7 +38490,7 @@ detailed information about what validation rules failed.
37670
38490
  }
37671
38491
  /**
37672
38492
  * * Field Name: RootParentID
37673
- * * Display Name: Root Parent Step
38493
+ * * Display Name: Root Parent
37674
38494
  * * SQL Data Type: uniqueidentifier
37675
38495
  */
37676
38496
  get RootParentID() {
@@ -37793,7 +38613,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
37793
38613
  }
37794
38614
  /**
37795
38615
  * * Field Name: ID
37796
- * * Display Name: Run ID
38616
+ * * Display Name: ID
37797
38617
  * * SQL Data Type: uniqueidentifier
37798
38618
  * * Default Value: newsequentialid()
37799
38619
  * * Description: Unique identifier for this agent run
@@ -37997,7 +38817,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
37997
38817
  }
37998
38818
  /**
37999
38819
  * * Field Name: TotalPromptTokensUsed
38000
- * * Display Name: Prompt Tokens
38820
+ * * Display Name: Total Prompt Tokens
38001
38821
  * * SQL Data Type: int
38002
38822
  * * Description: Total number of prompt/input tokens used across all AIPromptRun executions during this agent run. This provides a breakdown of the TotalTokensUsed field to help analyze the ratio of input vs output tokens consumed by the agent.
38003
38823
  */
@@ -38009,7 +38829,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
38009
38829
  }
38010
38830
  /**
38011
38831
  * * Field Name: TotalCompletionTokensUsed
38012
- * * Display Name: Completion Tokens
38832
+ * * Display Name: Total Completion Tokens
38013
38833
  * * SQL Data Type: int
38014
38834
  * * Description: Total number of completion/output tokens generated across all AIPromptRun executions during this agent run. This provides a breakdown of the TotalTokensUsed field to help analyze the ratio of input vs output tokens consumed by the agent.
38015
38835
  */
@@ -38033,7 +38853,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
38033
38853
  }
38034
38854
  /**
38035
38855
  * * Field Name: TotalPromptTokensUsedRollup
38036
- * * Display Name: Prompt Tokens (Rollup)
38856
+ * * Display Name: Total Prompt Tokens (Rollup)
38037
38857
  * * SQL Data Type: int
38038
38858
  * * Description: Total prompt/input tokens including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalPromptTokensUsed. For parent agents, this includes the sum of all descendant agent prompt tokens.
38039
38859
  */
@@ -38045,7 +38865,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
38045
38865
  }
38046
38866
  /**
38047
38867
  * * Field Name: TotalCompletionTokensUsedRollup
38048
- * * Display Name: Completion Tokens (Rollup)
38868
+ * * Display Name: Total Completion Tokens (Rollup)
38049
38869
  * * SQL Data Type: int
38050
38870
  * * Description: Total completion/output tokens including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalCompletionTokensUsed. For parent agents, this includes the sum of all descendant agent completion tokens.
38051
38871
  */
@@ -38082,7 +38902,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
38082
38902
  }
38083
38903
  /**
38084
38904
  * * Field Name: ConversationDetailSequence
38085
- * * Display Name: Detail Sequence
38905
+ * * Display Name: Conversation Detail Sequence
38086
38906
  * * SQL Data Type: int
38087
38907
  * * Description: If a conversation detail spawned multiple agent runs, tracks the order of their spawn/execution
38088
38908
  */
@@ -38145,7 +38965,7 @@ let MJAIAgentRunEntity = class MJAIAgentRunEntity extends BaseEntity {
38145
38965
  }
38146
38966
  /**
38147
38967
  * * Field Name: Message
38148
- * * Display Name: Final Message
38968
+ * * Display Name: Message
38149
38969
  * * SQL Data Type: nvarchar(MAX)
38150
38970
  * * Description: Final message from the agent to the end user at the end of a run
38151
38971
  */
@@ -38235,7 +39055,7 @@ each time the agent processes a prompt step.
38235
39055
  }
38236
39056
  /**
38237
39057
  * * Field Name: Data
38238
- * * Display Name: Input Data
39058
+ * * Display Name: Data
38239
39059
  * * SQL Data Type: nvarchar(MAX)
38240
39060
  * * Description: JSON serialized data that was passed for template rendering and prompt execution. This data was passed to the agent's prompt as well as all sub-agents.
38241
39061
  */
@@ -38247,7 +39067,7 @@ each time the agent processes a prompt step.
38247
39067
  }
38248
39068
  /**
38249
39069
  * * Field Name: Verbose
38250
- * * Display Name: Verbose Logging
39070
+ * * Display Name: Verbose
38251
39071
  * * SQL Data Type: bit
38252
39072
  * * Default Value: 0
38253
39073
  * * Description: Indicates whether verbose logging was enabled during this agent execution. When true, detailed decision-making and execution flow was logged.
@@ -38402,7 +39222,7 @@ each time the agent processes a prompt step.
38402
39222
  }
38403
39223
  /**
38404
39224
  * * Field Name: TotalCacheReadTokensUsed
38405
- * * Display Name: Cache Read Tokens
39225
+ * * Display Name: Total Cache Read Tokens
38406
39226
  * * SQL Data Type: int
38407
39227
  * * Description: Total input tokens served from the AI provider's prompt cache (cache reads / hits) across this agent run, summed from child prompt runs' TokensCacheReadRollup and sub-agent runs' TotalCacheReadTokensUsed. Counts only; the cost impact (cache reads are billed at a steep discount) is reflected in TotalCost. The cache counterpart of TotalPromptTokensUsed.
38408
39228
  */
@@ -38414,7 +39234,7 @@ each time the agent processes a prompt step.
38414
39234
  }
38415
39235
  /**
38416
39236
  * * Field Name: TotalCacheWriteTokensUsed
38417
- * * Display Name: Cache Write Tokens
39237
+ * * Display Name: Total Cache Write Tokens
38418
39238
  * * SQL Data Type: int
38419
39239
  * * Description: Total input tokens written to the AI provider's prompt cache (cache writes / creation) across this agent run, summed from child prompt runs' TokensCacheWriteRollup and sub-agent runs' TotalCacheWriteTokensUsed. Populated for providers that bill cache creation (e.g. Anthropic); 0 or NULL otherwise. The cache counterpart of TotalCompletionTokensUsed.
38420
39240
  */
@@ -38450,8 +39270,21 @@ each time the agent processes a prompt step.
38450
39270
  this.Set('AgentSessionID', value);
38451
39271
  }
38452
39272
  /**
39273
+ * * Field Name: PlanMode
39274
+ * * Display Name: Plan Mode
39275
+ * * SQL Data Type: bit
39276
+ * * Default Value: 0
39277
+ * * Description: 1 when this run executed under plan mode (whether via the per-request planMode flag or the agent's RequirePlanMode setting). Drives plan-mode indicators in the run UX and supports plan-drift auditing (comparing the approved plan against the steps that actually executed).
39278
+ */
39279
+ get PlanMode() {
39280
+ return this.Get('PlanMode');
39281
+ }
39282
+ set PlanMode(value) {
39283
+ this.Set('PlanMode', value);
39284
+ }
39285
+ /**
38453
39286
  * * Field Name: Agent
38454
- * * Display Name: Agent Info
39287
+ * * Display Name: Agent Name
38455
39288
  * * SQL Data Type: nvarchar(255)
38456
39289
  */
38457
39290
  get Agent() {
@@ -38459,7 +39292,7 @@ each time the agent processes a prompt step.
38459
39292
  }
38460
39293
  /**
38461
39294
  * * Field Name: ParentRun
38462
- * * Display Name: Parent Run Info
39295
+ * * Display Name: Parent Run Name
38463
39296
  * * SQL Data Type: nvarchar(255)
38464
39297
  */
38465
39298
  get ParentRun() {
@@ -38467,7 +39300,7 @@ each time the agent processes a prompt step.
38467
39300
  }
38468
39301
  /**
38469
39302
  * * Field Name: Conversation
38470
- * * Display Name: Conversation Info
39303
+ * * Display Name: Conversation Name
38471
39304
  * * SQL Data Type: nvarchar(255)
38472
39305
  */
38473
39306
  get Conversation() {
@@ -38475,7 +39308,7 @@ each time the agent processes a prompt step.
38475
39308
  }
38476
39309
  /**
38477
39310
  * * Field Name: User
38478
- * * Display Name: User Info
39311
+ * * Display Name: User Name
38479
39312
  * * SQL Data Type: nvarchar(100)
38480
39313
  */
38481
39314
  get User() {
@@ -38483,7 +39316,7 @@ each time the agent processes a prompt step.
38483
39316
  }
38484
39317
  /**
38485
39318
  * * Field Name: ConversationDetail
38486
- * * Display Name: Conversation Detail Info
39319
+ * * Display Name: Conversation Detail Name
38487
39320
  * * SQL Data Type: nvarchar(100)
38488
39321
  */
38489
39322
  get ConversationDetail() {
@@ -38491,7 +39324,7 @@ each time the agent processes a prompt step.
38491
39324
  }
38492
39325
  /**
38493
39326
  * * Field Name: LastRun
38494
- * * Display Name: Last Run Info
39327
+ * * Display Name: Last Run Name
38495
39328
  * * SQL Data Type: nvarchar(255)
38496
39329
  */
38497
39330
  get LastRun() {
@@ -38499,7 +39332,7 @@ each time the agent processes a prompt step.
38499
39332
  }
38500
39333
  /**
38501
39334
  * * Field Name: Configuration
38502
- * * Display Name: Configuration Info
39335
+ * * Display Name: Configuration Name
38503
39336
  * * SQL Data Type: nvarchar(100)
38504
39337
  */
38505
39338
  get Configuration() {
@@ -38507,7 +39340,7 @@ each time the agent processes a prompt step.
38507
39340
  }
38508
39341
  /**
38509
39342
  * * Field Name: OverrideModel
38510
- * * Display Name: Override Model Info
39343
+ * * Display Name: Override Model Name
38511
39344
  * * SQL Data Type: nvarchar(50)
38512
39345
  */
38513
39346
  get OverrideModel() {
@@ -38515,7 +39348,7 @@ each time the agent processes a prompt step.
38515
39348
  }
38516
39349
  /**
38517
39350
  * * Field Name: OverrideVendor
38518
- * * Display Name: Override Vendor Info
39351
+ * * Display Name: Override Vendor Name
38519
39352
  * * SQL Data Type: nvarchar(50)
38520
39353
  */
38521
39354
  get OverrideVendor() {
@@ -38523,7 +39356,7 @@ each time the agent processes a prompt step.
38523
39356
  }
38524
39357
  /**
38525
39358
  * * Field Name: ScheduledJobRun
38526
- * * Display Name: Scheduled Job Run Info
39359
+ * * Display Name: Scheduled Job Run Name
38527
39360
  * * SQL Data Type: nvarchar(200)
38528
39361
  */
38529
39362
  get ScheduledJobRun() {
@@ -38531,7 +39364,7 @@ each time the agent processes a prompt step.
38531
39364
  }
38532
39365
  /**
38533
39366
  * * Field Name: TestRun
38534
- * * Display Name: Test Run Info
39367
+ * * Display Name: Test Run Name
38535
39368
  * * SQL Data Type: nvarchar(255)
38536
39369
  */
38537
39370
  get TestRun() {
@@ -38539,7 +39372,7 @@ each time the agent processes a prompt step.
38539
39372
  }
38540
39373
  /**
38541
39374
  * * Field Name: PrimaryScopeEntity
38542
- * * Display Name: Primary Scope Entity Info
39375
+ * * Display Name: Primary Scope Entity Name
38543
39376
  * * SQL Data Type: nvarchar(255)
38544
39377
  */
38545
39378
  get PrimaryScopeEntity() {
@@ -39473,6 +40306,32 @@ let MJAIAgentSessionEntity = class MJAIAgentSessionEntity extends BaseEntity {
39473
40306
  return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
39474
40307
  }
39475
40308
  /**
40309
+ * Validate() method override for MJ: AI Agent Sessions entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
40310
+ * * Table-Level: Both Linked Entity ID and Linked Record ID must either be provided together or both left empty. This ensures that a link to an external record is always complete with both its entity type and record identifier.
40311
+ * @public
40312
+ * @method
40313
+ * @override
40314
+ */
40315
+ Validate() {
40316
+ const result = super.Validate();
40317
+ this.ValidateLinkedEntityAndRecordCoexistence(result);
40318
+ result.Success = result.Success && (result.Errors.length === 0);
40319
+ return result;
40320
+ }
40321
+ /**
40322
+ * Both Linked Entity ID and Linked Record ID must either be provided together or both left empty. This ensures that a link to an external record is always complete with both its entity type and record identifier.
40323
+ * @param result - the ValidationResult object to add any errors or warnings to
40324
+ * @public
40325
+ * @method
40326
+ */
40327
+ ValidateLinkedEntityAndRecordCoexistence(result) {
40328
+ const hasEntity = this.LinkedEntityID != null;
40329
+ const hasRecord = this.LinkedRecordID != null && this.LinkedRecordID !== "";
40330
+ if (hasEntity !== hasRecord) {
40331
+ result.Errors.push(new ValidationErrorInfo("LinkedEntityID", "Both Linked Entity ID and Linked Record ID must be provided together, or both must be left blank.", this.LinkedEntityID, ValidationErrorType.Failure));
40332
+ }
40333
+ }
40334
+ /**
39476
40335
  * * Field Name: ID
39477
40336
  * * Display Name: ID
39478
40337
  * * SQL Data Type: uniqueidentifier
@@ -39678,6 +40537,31 @@ let MJAIAgentSessionEntity = class MJAIAgentSessionEntity extends BaseEntity {
39678
40537
  this.Set('RecordingFileID', value);
39679
40538
  }
39680
40539
  /**
40540
+ * * Field Name: LinkedEntityID
40541
+ * * Display Name: Linked Entity ID
40542
+ * * SQL Data Type: uniqueidentifier
40543
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
40544
+ * * Description: Polymorphic counterparty-identity entity. Foreign key to Entity — identifies WHICH entity this realtime session's counterparty resolved to (e.g. User, a member/contact record, BizAppsCommon Person). Paired with LinkedRecordID via the CK_AIAgentSession_LinkBinding both-or-neither check, mirroring Conversation's linked pair. NULL while the session's counterparty is anonymous/unresolved.
40545
+ */
40546
+ get LinkedEntityID() {
40547
+ return this.Get('LinkedEntityID');
40548
+ }
40549
+ set LinkedEntityID(value) {
40550
+ this.Set('LinkedEntityID', value);
40551
+ }
40552
+ /**
40553
+ * * Field Name: LinkedRecordID
40554
+ * * Display Name: Linked Record ID
40555
+ * * SQL Data Type: nvarchar(500)
40556
+ * * Description: Polymorphic counterparty-identity record key. The primary-key value of the record (within LinkedEntityID's entity) this session resolved to, serialized as a string so any entity type can be referenced regardless of PK shape (UUID, int, composite). NVARCHAR(500), intentionally NOT FK-constrained. Used together with LinkedEntityID — see CK_AIAgentSession_LinkBinding. NULL while the session's counterparty is anonymous/unresolved.
40557
+ */
40558
+ get LinkedRecordID() {
40559
+ return this.Get('LinkedRecordID');
40560
+ }
40561
+ set LinkedRecordID(value) {
40562
+ this.Set('LinkedRecordID', value);
40563
+ }
40564
+ /**
39681
40565
  * * Field Name: Agent
39682
40566
  * * Display Name: Agent
39683
40567
  * * SQL Data Type: nvarchar(255)
@@ -39710,6 +40594,14 @@ let MJAIAgentSessionEntity = class MJAIAgentSessionEntity extends BaseEntity {
39710
40594
  return this.Get('RecordingFile');
39711
40595
  }
39712
40596
  /**
40597
+ * * Field Name: LinkedEntity
40598
+ * * Display Name: Linked Entity
40599
+ * * SQL Data Type: nvarchar(255)
40600
+ */
40601
+ get LinkedEntity() {
40602
+ return this.Get('LinkedEntity');
40603
+ }
40604
+ /**
39713
40605
  * * Field Name: RootLastSessionID
39714
40606
  * * Display Name: Root Last Session ID
39715
40607
  * * SQL Data Type: uniqueidentifier
@@ -41012,7 +41904,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41012
41904
  }
41013
41905
  /**
41014
41906
  * * Field Name: ContextCompressionMessageThreshold
41015
- * * Display Name: Context Compression Message Threshold
41907
+ * * Display Name: Compression Message Threshold
41016
41908
  * * SQL Data Type: int
41017
41909
  * * Description: Number of messages that triggers context compression when EnableContextCompression is true.
41018
41910
  */
@@ -41024,7 +41916,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41024
41916
  }
41025
41917
  /**
41026
41918
  * * Field Name: ContextCompressionPromptID
41027
- * * Display Name: Context Compression Prompt
41919
+ * * Display Name: Compression Prompt
41028
41920
  * * SQL Data Type: uniqueidentifier
41029
41921
  * * Related Entity/Foreign Key: MJ: AI Prompts (vwAIPrompts.ID)
41030
41922
  */
@@ -41036,7 +41928,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41036
41928
  }
41037
41929
  /**
41038
41930
  * * Field Name: ContextCompressionMessageRetentionCount
41039
- * * Display Name: Context Compression Message Retention Count
41931
+ * * Display Name: Compression Retention Count
41040
41932
  * * SQL Data Type: int
41041
41933
  * * Description: Number of recent messages to keep uncompressed when context compression is applied.
41042
41934
  */
@@ -41048,7 +41940,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41048
41940
  }
41049
41941
  /**
41050
41942
  * * Field Name: TypeID
41051
- * * Display Name: Type
41943
+ * * Display Name: Agent Type
41052
41944
  * * SQL Data Type: uniqueidentifier
41053
41945
  * * Related Entity/Foreign Key: MJ: AI Agent Types (vwAIAgentTypes.ID)
41054
41946
  * * Description: Reference to the AIAgentType that defines the category and system-level behavior for this agent. Cannot be null.
@@ -41120,7 +42012,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41120
42012
  }
41121
42013
  /**
41122
42014
  * * Field Name: PayloadDownstreamPaths
41123
- * * Display Name: Payload Downstream Paths
42015
+ * * Display Name: Downstream Payload Paths
41124
42016
  * * SQL Data Type: nvarchar(MAX)
41125
42017
  * * Default Value: ["*"]
41126
42018
  * * Description: JSON array of paths that define which parts of the payload should be sent downstream to sub-agents. Use ["*"] to send entire payload, or specify paths like ["customer.id", "campaign.*", "analysis.sentiment"]
@@ -41133,7 +42025,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41133
42025
  }
41134
42026
  /**
41135
42027
  * * Field Name: PayloadUpstreamPaths
41136
- * * Display Name: Payload Upstream Paths
42028
+ * * Display Name: Upstream Payload Paths
41137
42029
  * * SQL Data Type: nvarchar(MAX)
41138
42030
  * * Default Value: ["*"]
41139
42031
  * * Description: JSON array of paths that define which parts of the payload sub-agents are allowed to write back upstream. Use ["*"] to allow all writes, or specify paths like ["analysis.results", "recommendations.*"]
@@ -41146,7 +42038,7 @@ let MJAIAgentEntity = class MJAIAgentEntity extends BaseEntity {
41146
42038
  }
41147
42039
  /**
41148
42040
  * * Field Name: PayloadSelfReadPaths
41149
- * * Display Name: Payload Self Read Paths
42041
+ * * Display Name: Self-Read Payload Paths
41150
42042
  * * SQL Data Type: nvarchar(MAX)
41151
42043
  * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
41152
42044
  flow when the agent executes its own prompt step.
@@ -41159,7 +42051,7 @@ flow when the agent executes its own prompt step.
41159
42051
  }
41160
42052
  /**
41161
42053
  * * Field Name: PayloadSelfWritePaths
41162
- * * Display Name: Payload Self Write Paths
42054
+ * * Display Name: Self-Write Payload Paths
41163
42055
  * * SQL Data Type: nvarchar(MAX)
41164
42056
  * * Description: JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
41165
42057
  data flow when the agent executes its own prompt step.
@@ -41184,7 +42076,7 @@ data flow when the agent executes its own prompt step.
41184
42076
  }
41185
42077
  /**
41186
42078
  * * Field Name: FinalPayloadValidation
41187
- * * Display Name: Final Payload Validation Schema
42079
+ * * Display Name: Final Payload Validation
41188
42080
  * * SQL Data Type: nvarchar(MAX)
41189
42081
  * * 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.
41190
42082
  */
@@ -41196,7 +42088,7 @@ data flow when the agent executes its own prompt step.
41196
42088
  }
41197
42089
  /**
41198
42090
  * * Field Name: FinalPayloadValidationMode
41199
- * * Display Name: Final Payload Validation Mode
42091
+ * * Display Name: Final Validation Mode
41200
42092
  * * SQL Data Type: nvarchar(25)
41201
42093
  * * Default Value: Retry
41202
42094
  * * Value List Type: List
@@ -41214,7 +42106,7 @@ data flow when the agent executes its own prompt step.
41214
42106
  }
41215
42107
  /**
41216
42108
  * * Field Name: FinalPayloadValidationMaxRetries
41217
- * * Display Name: Final Payload Validation Max Retries
42109
+ * * Display Name: Final Validation Max Retries
41218
42110
  * * SQL Data Type: int
41219
42111
  * * Default Value: 3
41220
42112
  * * Description: Maximum number of retry attempts allowed when FinalPayloadValidation fails with
@@ -41304,7 +42196,7 @@ if this limit is exceeded.
41304
42196
  }
41305
42197
  /**
41306
42198
  * * Field Name: StartingPayloadValidation
41307
- * * Display Name: Starting Payload Validation Schema
42199
+ * * Display Name: Starting Payload Validation
41308
42200
  * * SQL Data Type: nvarchar(MAX)
41309
42201
  * * Description: Optional JSON schema validation to apply to the input payload before agent execution begins. Uses the same JSONValidator format as FinalPayloadValidation.
41310
42202
  */
@@ -41316,7 +42208,7 @@ if this limit is exceeded.
41316
42208
  }
41317
42209
  /**
41318
42210
  * * Field Name: StartingPayloadValidationMode
41319
- * * Display Name: Starting Payload Validation Mode
42211
+ * * Display Name: Starting Validation Mode
41320
42212
  * * SQL Data Type: nvarchar(25)
41321
42213
  * * Default Value: Fail
41322
42214
  * * Value List Type: List
@@ -41333,7 +42225,7 @@ if this limit is exceeded.
41333
42225
  }
41334
42226
  /**
41335
42227
  * * Field Name: DefaultPromptEffortLevel
41336
- * * Display Name: Default Prompt Effort Level
42228
+ * * Display Name: Default Effort Level
41337
42229
  * * SQL Data Type: int
41338
42230
  * * Description: Default effort level for all prompts executed by this agent (1-100, where 1=minimal effort, 100=maximum effort). Takes precedence over individual prompt EffortLevel settings but can be overridden by runtime parameters. Inherited by sub-agents unless explicitly overridden.
41339
42231
  */
@@ -41375,7 +42267,7 @@ if this limit is exceeded.
41375
42267
  }
41376
42268
  /**
41377
42269
  * * Field Name: OwnerUserID
41378
- * * Display Name: Owner User
42270
+ * * Display Name: Owner
41379
42271
  * * SQL Data Type: uniqueidentifier
41380
42272
  * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
41381
42273
  * * Default Value: ECAFCCEC-6A37-EF11-86D4-000D3A4E707E
@@ -41618,7 +42510,7 @@ if this limit is exceeded.
41618
42510
  }
41619
42511
  /**
41620
42512
  * * Field Name: AgentTypePromptParams
41621
- * * Display Name: Agent Type Prompt Params
42513
+ * * Display Name: Prompt Parameters
41622
42514
  * * SQL Data Type: nvarchar(MAX)
41623
42515
  * * Description: JSON object containing parameter values that customize how this agent's type-level system prompt is rendered. The schema is defined by the agent type's PromptParamsSchema field. Allows per-agent control over which prompt sections are included, enabling token savings by excluding unused documentation.
41624
42516
  */
@@ -41874,8 +42766,38 @@ if this limit is exceeded.
41874
42766
  this.Set('AcceptsSkills', value);
41875
42767
  }
41876
42768
  /**
42769
+ * * Field Name: SkillActivationMode
42770
+ * * Display Name: Skill Activation Mode
42771
+ * * SQL Data Type: nvarchar(20)
42772
+ * * Default Value: RequestedOnly
42773
+ * * Value List Type: List
42774
+ * * Possible Values
42775
+ * * Auto
42776
+ * * RequestedOnly
42777
+ * * Description: Controls whether this agent may ever self-activate skills from its prompt catalog. Auto: the agent sees its allowed skills whose own ActivationMode is Auto (double gate) and may activate them mid-run on its own judgment. RequestedOnly (default): the agent's prompt catalog is empty and skills only enter a run via an explicit user request (/skill mention). Orthogonal to AcceptsSkills, which governs which skills are available at all; this governs who may pull the activation trigger.
42778
+ */
42779
+ get SkillActivationMode() {
42780
+ return this.Get('SkillActivationMode');
42781
+ }
42782
+ set SkillActivationMode(value) {
42783
+ this.Set('SkillActivationMode', value);
42784
+ }
42785
+ /**
42786
+ * * Field Name: RequirePlanMode
42787
+ * * Display Name: Require Plan Mode
42788
+ * * SQL Data Type: bit
42789
+ * * Default Value: 0
42790
+ * * Description: When 1, every root-level run of this agent executes in plan mode regardless of the per-request planMode flag — the agent must present a plan and receive human approval before any Actions or Sub-Agent steps execute. SupportsPlanMode is irrelevant when this is set. Use for high-consequence agents (e.g. ones with outbound-communication capabilities) where human-in-the-loop review is mandatory.
42791
+ */
42792
+ get RequirePlanMode() {
42793
+ return this.Get('RequirePlanMode');
42794
+ }
42795
+ set RequirePlanMode(value) {
42796
+ this.Set('RequirePlanMode', value);
42797
+ }
42798
+ /**
41877
42799
  * * Field Name: Parent
41878
- * * Display Name: Parent
42800
+ * * Display Name: Parent Agent Name
41879
42801
  * * SQL Data Type: nvarchar(255)
41880
42802
  */
41881
42803
  get Parent() {
@@ -41883,7 +42805,7 @@ if this limit is exceeded.
41883
42805
  }
41884
42806
  /**
41885
42807
  * * Field Name: ContextCompressionPrompt
41886
- * * Display Name: Context Compression Prompt Name
42808
+ * * Display Name: Compression Prompt Name
41887
42809
  * * SQL Data Type: nvarchar(255)
41888
42810
  */
41889
42811
  get ContextCompressionPrompt() {
@@ -41891,7 +42813,7 @@ if this limit is exceeded.
41891
42813
  }
41892
42814
  /**
41893
42815
  * * Field Name: Type
41894
- * * Display Name: Type Name
42816
+ * * Display Name: Type
41895
42817
  * * SQL Data Type: nvarchar(100)
41896
42818
  */
41897
42819
  get Type() {
@@ -41907,7 +42829,7 @@ if this limit is exceeded.
41907
42829
  }
41908
42830
  /**
41909
42831
  * * Field Name: OwnerUser
41910
- * * Display Name: Owner User Name
42832
+ * * Display Name: Owner Name
41911
42833
  * * SQL Data Type: nvarchar(100)
41912
42834
  */
41913
42835
  get OwnerUser() {
@@ -41963,7 +42885,7 @@ if this limit is exceeded.
41963
42885
  }
41964
42886
  /**
41965
42887
  * * Field Name: RootParentID
41966
- * * Display Name: Root Parent ID
42888
+ * * Display Name: Root Parent
41967
42889
  * * SQL Data Type: uniqueidentifier
41968
42890
  */
41969
42891
  get RootParentID() {
@@ -41971,7 +42893,7 @@ if this limit is exceeded.
41971
42893
  }
41972
42894
  /**
41973
42895
  * * Field Name: RootDefaultCoAgentID
41974
- * * Display Name: Root Default Co-Agent ID
42896
+ * * Display Name: Root Default Co-Agent
41975
42897
  * * SQL Data Type: uniqueidentifier
41976
42898
  */
41977
42899
  get RootDefaultCoAgentID() {
@@ -49680,6 +50602,23 @@ let MJAISkillEntity = class MJAISkillEntity extends BaseEntity {
49680
50602
  return this.Get('__mj_UpdatedAt');
49681
50603
  }
49682
50604
  /**
50605
+ * * Field Name: ActivationMode
50606
+ * * Display Name: Activation Mode
50607
+ * * SQL Data Type: nvarchar(20)
50608
+ * * Default Value: RequestedOnly
50609
+ * * Value List Type: List
50610
+ * * Possible Values
50611
+ * * Auto
50612
+ * * RequestedOnly
50613
+ * * Description: Controls whether this skill may ever be self-activated by an agent. Auto: the skill may appear in accepting agents' prompt catalogs and be activated mid-run on agent judgment — but only for agents whose own SkillActivationMode is also Auto (double gate). RequestedOnly (default): the skill is excluded from prompt catalogs entirely and can only be activated when the user explicitly requests it for the run (a /skill mention flowing through ExecuteAgentParams.requestedSkillIDs). All other activation gates (AcceptsSkills, skill Status, per-agent assignment, user Run permission) apply unchanged in both modes.
50614
+ */
50615
+ get ActivationMode() {
50616
+ return this.Get('ActivationMode');
50617
+ }
50618
+ set ActivationMode(value) {
50619
+ this.Set('ActivationMode', value);
50620
+ }
50621
+ /**
49683
50622
  * * Field Name: CreatedByUser
49684
50623
  * * Display Name: Created By User
49685
50624
  * * SQL Data Type: nvarchar(100)
@@ -51906,6 +52845,7 @@ let MJApplicationEntity = class MJApplicationEntity extends BaseEntity {
51906
52845
  * * Field Name: AgentSettings
51907
52846
  * * Display Name: Agent Settings
51908
52847
  * * SQL Data Type: nvarchar(MAX)
52848
+ * * JSON Type: MJApplicationEntity_IAgentSettings
51909
52849
  * * Description: App-scoped agent configuration JSON (shape = IAgentSettings). Declares the default/lead agent, relevant agents available to conversational and realtime co-agents, app-scoped client tool references, and realtime persona/disclosure overrides that layer into the agent config cascade. Null = no app-level agent config.
51910
52850
  */
51911
52851
  get AgentSettings() {
@@ -63254,6 +64194,358 @@ MJConversationDetailEntity = __decorate([
63254
64194
  RegisterClass(BaseEntity, 'MJ: Conversation Details')
63255
64195
  ], MJConversationDetailEntity);
63256
64196
  export { MJConversationDetailEntity };
64197
+ /**
64198
+ * MJ: Conversation Widget Instances - strongly typed entity sub-class
64199
+ * * Schema: __mj
64200
+ * * Base Table: ConversationWidgetInstance
64201
+ * * Base View: vwConversationWidgetInstances
64202
+ * * @description Durable per-deployment configuration for one embeddable public support widget (text and/or voice). One row per site/embed. Resolves a public widget key to its application scope, pinned support agent, restricted guest role, allowed origins, modality, auth strategy, and abuse ceilings. Reuses the magic-link anonymous-embed minting path at session time; this entity holds only the configuration.
64203
+ * * Primary Key: ID
64204
+ * @extends {BaseEntity}
64205
+ * @class
64206
+ * @public
64207
+ */
64208
+ let MJConversationWidgetInstanceEntity = class MJConversationWidgetInstanceEntity extends BaseEntity {
64209
+ /**
64210
+ * Loads the MJ: Conversation Widget Instances record from the database
64211
+ * @param ID: string - primary key value to load the MJ: Conversation Widget Instances record.
64212
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
64213
+ * @returns {Promise<boolean>} - true if successful, false otherwise
64214
+ * @public
64215
+ * @async
64216
+ * @memberof MJConversationWidgetInstanceEntity
64217
+ * @method
64218
+ * @override
64219
+ */
64220
+ async Load(ID, EntityRelationshipsToLoad) {
64221
+ const compositeKey = new CompositeKey();
64222
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
64223
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
64224
+ }
64225
+ /**
64226
+ * Validate() method override for MJ: Conversation Widget Instances entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
64227
+ * * RateLimitPerMinute: The rate limit per minute must be a positive number greater than zero to ensure the application can process requests.
64228
+ * * SessionTTLMinutes: The session time-to-live (TTL) must be greater than 0 minutes and cannot exceed 1440 minutes (24 hours).
64229
+ * * VisitorMemoryRetentionDays: The visitor memory retention period, if specified, must be a positive number of days greater than zero.
64230
+ * @public
64231
+ * @method
64232
+ * @override
64233
+ */
64234
+ Validate() {
64235
+ const result = super.Validate();
64236
+ this.ValidateRateLimitPerMinuteGreaterThanZero(result);
64237
+ this.ValidateSessionTTLMinutesRange(result);
64238
+ this.ValidateVisitorMemoryRetentionDaysGreaterThanZero(result);
64239
+ result.Success = result.Success && (result.Errors.length === 0);
64240
+ return result;
64241
+ }
64242
+ /**
64243
+ * The rate limit per minute must be a positive number greater than zero to ensure the application can process requests.
64244
+ * @param result - the ValidationResult object to add any errors or warnings to
64245
+ * @public
64246
+ * @method
64247
+ */
64248
+ ValidateRateLimitPerMinuteGreaterThanZero(result) {
64249
+ if (this.RateLimitPerMinute !== undefined && this.RateLimitPerMinute !== null && this.RateLimitPerMinute <= 0) {
64250
+ result.Errors.push(new ValidationErrorInfo("RateLimitPerMinute", "The rate limit per minute must be greater than 0.", this.RateLimitPerMinute, ValidationErrorType.Failure));
64251
+ }
64252
+ }
64253
+ /**
64254
+ * The session time-to-live (TTL) must be greater than 0 minutes and cannot exceed 1440 minutes (24 hours).
64255
+ * @param result - the ValidationResult object to add any errors or warnings to
64256
+ * @public
64257
+ * @method
64258
+ */
64259
+ ValidateSessionTTLMinutesRange(result) {
64260
+ if (this.SessionTTLMinutes != null && (this.SessionTTLMinutes <= 0 || this.SessionTTLMinutes > 1440)) {
64261
+ result.Errors.push(new ValidationErrorInfo("SessionTTLMinutes", "Session TTL must be greater than 0 and less than or equal to 1440 minutes (24 hours).", this.SessionTTLMinutes, ValidationErrorType.Failure));
64262
+ }
64263
+ }
64264
+ /**
64265
+ * The visitor memory retention period, if specified, must be a positive number of days greater than zero.
64266
+ * @param result - the ValidationResult object to add any errors or warnings to
64267
+ * @public
64268
+ * @method
64269
+ */
64270
+ ValidateVisitorMemoryRetentionDaysGreaterThanZero(result) {
64271
+ if (this.VisitorMemoryRetentionDays != null && this.VisitorMemoryRetentionDays <= 0) {
64272
+ result.Errors.push(new ValidationErrorInfo("VisitorMemoryRetentionDays", "Visitor memory retention days must be greater than 0.", this.VisitorMemoryRetentionDays, ValidationErrorType.Failure));
64273
+ }
64274
+ }
64275
+ /**
64276
+ * * Field Name: ID
64277
+ * * Display Name: ID
64278
+ * * SQL Data Type: uniqueidentifier
64279
+ * * Default Value: newsequentialid()
64280
+ */
64281
+ get ID() {
64282
+ return this.Get('ID');
64283
+ }
64284
+ set ID(value) {
64285
+ this.Set('ID', value);
64286
+ }
64287
+ /**
64288
+ * * Field Name: Name
64289
+ * * Display Name: Name
64290
+ * * SQL Data Type: nvarchar(255)
64291
+ * * Description: Human-readable name for this widget deployment (e.g. "Acme Marketing Site Support").
64292
+ */
64293
+ get Name() {
64294
+ return this.Get('Name');
64295
+ }
64296
+ set Name(value) {
64297
+ this.Set('Name', value);
64298
+ }
64299
+ /**
64300
+ * * Field Name: PublicKey
64301
+ * * Display Name: Public Key
64302
+ * * SQL Data Type: nvarchar(100)
64303
+ * * Description: Public, non-secret embed key (e.g. "pk_live_…") placed in the host page's data-widget-key attribute. Used to resolve this configuration at POST /widget/session. Unique. Not a credential — security comes from the origin allowlist, rate limits, the restricted guest role, and short-lived minted tokens.
64304
+ */
64305
+ get PublicKey() {
64306
+ return this.Get('PublicKey');
64307
+ }
64308
+ set PublicKey(value) {
64309
+ this.Set('PublicKey', value);
64310
+ }
64311
+ /**
64312
+ * * Field Name: ApplicationID
64313
+ * * Display Name: Application ID
64314
+ * * SQL Data Type: uniqueidentifier
64315
+ * * Related Entity/Foreign Key: MJ: Applications (vwApplications.ID)
64316
+ * * Description: Foreign key to Application — the single app a guest session is scoped to. Mirrors the magic-link single-application model.
64317
+ */
64318
+ get ApplicationID() {
64319
+ return this.Get('ApplicationID');
64320
+ }
64321
+ set ApplicationID(value) {
64322
+ this.Set('ApplicationID', value);
64323
+ }
64324
+ /**
64325
+ * * Field Name: PinnedAgentID
64326
+ * * Display Name: Pinned Agent ID
64327
+ * * SQL Data Type: uniqueidentifier
64328
+ * * Related Entity/Foreign Key: MJ: AI Agents (vwAIAgents.ID)
64329
+ * * Description: Foreign key to AIAgent — the support agent that is PINNED for every turn (passed as explicitAgentId). D5: pinning fixes which agent runs; combined with the restricted guest role it prevents a public visitor from reaching arbitrary agents/data. The pinned agent's own tool/handoff surface should be support-scoped.
64330
+ */
64331
+ get PinnedAgentID() {
64332
+ return this.Get('PinnedAgentID');
64333
+ }
64334
+ set PinnedAgentID(value) {
64335
+ this.Set('PinnedAgentID', value);
64336
+ }
64337
+ /**
64338
+ * * Field Name: GuestRoleID
64339
+ * * Display Name: Guest Role ID
64340
+ * * SQL Data Type: uniqueidentifier
64341
+ * * Related Entity/Foreign Key: MJ: Roles (vwRoles.ID)
64342
+ * * Description: Foreign key to Role — the restricted guest role assigned to the synthesized guest principal. This role's entity permissions are the real authorization boundary (read/write only the visitor's own Conversation + Conversation Details). Roles ride per-session JWT claims, not DB rows on the shared Anonymous principal.
64343
+ */
64344
+ get GuestRoleID() {
64345
+ return this.Get('GuestRoleID');
64346
+ }
64347
+ set GuestRoleID(value) {
64348
+ this.Set('GuestRoleID', value);
64349
+ }
64350
+ /**
64351
+ * * Field Name: AllowedOrigins
64352
+ * * Display Name: Allowed Origins
64353
+ * * SQL Data Type: nvarchar(MAX)
64354
+ * * Description: Allowed embedding origins for this widget, as a JSON array of origin strings (e.g. ["https://www.acme.com","https://acme.com"]). Enforced both at mint (POST /widget/session rejects unlisted Origin) and via CORS. NULL or empty means no origin is allowed (fail-closed).
64355
+ */
64356
+ get AllowedOrigins() {
64357
+ return this.Get('AllowedOrigins');
64358
+ }
64359
+ set AllowedOrigins(value) {
64360
+ this.Set('AllowedOrigins', value);
64361
+ }
64362
+ /**
64363
+ * * Field Name: Modality
64364
+ * * Display Name: Modality
64365
+ * * SQL Data Type: nvarchar(10)
64366
+ * * Default Value: Text
64367
+ * * Value List Type: List
64368
+ * * Possible Values
64369
+ * * Both
64370
+ * * Text
64371
+ * * Voice
64372
+ * * Description: Which modalities this widget exposes: Text (chat only), Voice (client-direct realtime only), or Both. Gates whether the realtime-mint path is offered to the guest.
64373
+ */
64374
+ get Modality() {
64375
+ return this.Get('Modality');
64376
+ }
64377
+ set Modality(value) {
64378
+ this.Set('Modality', value);
64379
+ }
64380
+ /**
64381
+ * * Field Name: AuthStrategy
64382
+ * * Display Name: Auth Strategy
64383
+ * * SQL Data Type: nvarchar(20)
64384
+ * * Default Value: Anonymous
64385
+ * * Value List Type: List
64386
+ * * Possible Values
64387
+ * * Anonymous
64388
+ * * HostIdentity
64389
+ * * MagicLinkUpgrade
64390
+ * * Description: Pluggable public-auth strategy (D1): Anonymous (guest-first, default), MagicLinkUpgrade (guest may escalate to an email-verified session), or HostIdentity (an authenticated host portal posts a signed identity assertion exchanged for an MJ guest JWT). All three converge on AuthProviderFactory + buildMagicLinkSessionUser.
64391
+ */
64392
+ get AuthStrategy() {
64393
+ return this.Get('AuthStrategy');
64394
+ }
64395
+ set AuthStrategy(value) {
64396
+ this.Set('AuthStrategy', value);
64397
+ }
64398
+ /**
64399
+ * * Field Name: Status
64400
+ * * Display Name: Status
64401
+ * * SQL Data Type: nvarchar(20)
64402
+ * * Default Value: Active
64403
+ * * Value List Type: List
64404
+ * * Possible Values
64405
+ * * Active
64406
+ * * Disabled
64407
+ * * Description: Lifecycle status. Active widgets mint sessions; Disabled widgets reject all mints (used to turn off a deployment without deleting its config).
64408
+ */
64409
+ get Status() {
64410
+ return this.Get('Status');
64411
+ }
64412
+ set Status(value) {
64413
+ this.Set('Status', value);
64414
+ }
64415
+ /**
64416
+ * * Field Name: SessionTTLMinutes
64417
+ * * Display Name: Session TTL Minutes
64418
+ * * SQL Data Type: int
64419
+ * * Default Value: 15
64420
+ * * Description: Time-to-live in minutes for a minted guest session JWT. Short by design (default 15) to limit replay/theft; the widget refreshes before expiry. Capped at 1440 (24h).
64421
+ */
64422
+ get SessionTTLMinutes() {
64423
+ return this.Get('SessionTTLMinutes');
64424
+ }
64425
+ set SessionTTLMinutes(value) {
64426
+ this.Set('SessionTTLMinutes', value);
64427
+ }
64428
+ /**
64429
+ * * Field Name: RateLimitPerMinute
64430
+ * * Display Name: Rate Limit Per Minute
64431
+ * * SQL Data Type: int
64432
+ * * Default Value: 30
64433
+ * * Description: Maximum number of guest-session mints allowed per minute per source IP/origin for this widget. Reuses the magic-link rate-limit pattern.
64434
+ */
64435
+ get RateLimitPerMinute() {
64436
+ return this.Get('RateLimitPerMinute');
64437
+ }
64438
+ set RateLimitPerMinute(value) {
64439
+ this.Set('RateLimitPerMinute', value);
64440
+ }
64441
+ /**
64442
+ * * Field Name: VoiceMaxSessionMinutes
64443
+ * * Display Name: Voice Max Session Minutes
64444
+ * * SQL Data Type: int
64445
+ * * Description: Optional hard ceiling (minutes) on a single voice session's duration for this widget. NULL means fall back to the server-wide default. Voice is the biggest cost/abuse surface; the SessionJanitor enforces this server-side (W4).
64446
+ */
64447
+ get VoiceMaxSessionMinutes() {
64448
+ return this.Get('VoiceMaxSessionMinutes');
64449
+ }
64450
+ set VoiceMaxSessionMinutes(value) {
64451
+ this.Set('VoiceMaxSessionMinutes', value);
64452
+ }
64453
+ /**
64454
+ * * Field Name: EnabledChannels
64455
+ * * Display Name: Enabled Channels
64456
+ * * SQL Data Type: nvarchar(MAX)
64457
+ * * Description: Which MJ interactive channels this widget may attach when a voice session is active, as a JSON array of channel names (e.g. ["Whiteboard"]). Resolved client-side through MJGlobal.ClassFactory the same way the realtime client driver is resolved; each named channel is scoped by the existing Widget Guest RLS on AI Agent Session Channels. NULL or empty array = no channels (the backwards-compatible default). Remote Browser, given its control surface, should only be listed when a deployment explicitly opts in.
64458
+ */
64459
+ get EnabledChannels() {
64460
+ return this.Get('EnabledChannels');
64461
+ }
64462
+ set EnabledChannels(value) {
64463
+ this.Set('EnabledChannels', value);
64464
+ }
64465
+ /**
64466
+ * * Field Name: HostPublicKey
64467
+ * * Display Name: Host Public Key
64468
+ * * SQL Data Type: nvarchar(MAX)
64469
+ * * Description: PEM-encoded RS256 public key for the host-identity auth strategy (D1). When AuthStrategy is HostIdentity, the host signs a short-lived identity assertion with its private key; the HostIdentityProvider verifies it against this per-instance key. Supersedes the interim config map (mj.config.cjs hostPublicKeys keyed by PublicKey). NULL when the widget does not use host identity; a HostIdentity widget with no key fails closed at mint.
64470
+ */
64471
+ get HostPublicKey() {
64472
+ return this.Get('HostPublicKey');
64473
+ }
64474
+ set HostPublicKey(value) {
64475
+ this.Set('HostPublicKey', value);
64476
+ }
64477
+ /**
64478
+ * * Field Name: RememberReturningVisitors
64479
+ * * Display Name: Remember Returning Visitors
64480
+ * * SQL Data Type: bit
64481
+ * * Default Value: 0
64482
+ * * Description: Returning-visitor memory opt-in (R6). When 0 (default) this widget sets no durable visitor cookie and writes no cross-session recap — fully off. When 1, the widget mints a durable VisitorKey cookie, links each new Conversation to the visitor's prior one, and writes a recap memory note on close so a returning visitor's agent opens with prior context.
64483
+ */
64484
+ get RememberReturningVisitors() {
64485
+ return this.Get('RememberReturningVisitors');
64486
+ }
64487
+ set RememberReturningVisitors(value) {
64488
+ this.Set('RememberReturningVisitors', value);
64489
+ }
64490
+ /**
64491
+ * * Field Name: VisitorMemoryRetentionDays
64492
+ * * Display Name: Visitor Memory Retention Days
64493
+ * * SQL Data Type: int
64494
+ * * Description: Retention window (days) for returning-visitor recap memory notes generated by this widget. NULL means use the system default. Past this window the visitor's auto-generated recap notes decay/archive via the Memory Manager. Ignored when RememberReturningVisitors = 0.
64495
+ */
64496
+ get VisitorMemoryRetentionDays() {
64497
+ return this.Get('VisitorMemoryRetentionDays');
64498
+ }
64499
+ set VisitorMemoryRetentionDays(value) {
64500
+ this.Set('VisitorMemoryRetentionDays', value);
64501
+ }
64502
+ /**
64503
+ * * Field Name: __mj_CreatedAt
64504
+ * * Display Name: Created At
64505
+ * * SQL Data Type: datetimeoffset
64506
+ * * Default Value: getutcdate()
64507
+ */
64508
+ get __mj_CreatedAt() {
64509
+ return this.Get('__mj_CreatedAt');
64510
+ }
64511
+ /**
64512
+ * * Field Name: __mj_UpdatedAt
64513
+ * * Display Name: Updated At
64514
+ * * SQL Data Type: datetimeoffset
64515
+ * * Default Value: getutcdate()
64516
+ */
64517
+ get __mj_UpdatedAt() {
64518
+ return this.Get('__mj_UpdatedAt');
64519
+ }
64520
+ /**
64521
+ * * Field Name: Application
64522
+ * * Display Name: Application
64523
+ * * SQL Data Type: nvarchar(100)
64524
+ */
64525
+ get Application() {
64526
+ return this.Get('Application');
64527
+ }
64528
+ /**
64529
+ * * Field Name: PinnedAgent
64530
+ * * Display Name: Pinned Agent
64531
+ * * SQL Data Type: nvarchar(255)
64532
+ */
64533
+ get PinnedAgent() {
64534
+ return this.Get('PinnedAgent');
64535
+ }
64536
+ /**
64537
+ * * Field Name: GuestRole
64538
+ * * Display Name: Guest Role
64539
+ * * SQL Data Type: nvarchar(50)
64540
+ */
64541
+ get GuestRole() {
64542
+ return this.Get('GuestRole');
64543
+ }
64544
+ };
64545
+ MJConversationWidgetInstanceEntity = __decorate([
64546
+ RegisterClass(BaseEntity, 'MJ: Conversation Widget Instances')
64547
+ ], MJConversationWidgetInstanceEntity);
64548
+ export { MJConversationWidgetInstanceEntity };
63257
64549
  /**
63258
64550
  * MJ: Conversations - strongly typed entity sub-class
63259
64551
  * * Schema: __mj
@@ -63649,6 +64941,31 @@ let MJConversationEntity = class MJConversationEntity extends BaseEntity {
63649
64941
  this.Set('EgressID', value);
63650
64942
  }
63651
64943
  /**
64944
+ * * Field Name: VisitorKey
64945
+ * * Display Name: Visitor Key
64946
+ * * SQL Data Type: nvarchar(255)
64947
+ * * Description: Durable, opaque returning-visitor anchor (R3). Holds the value of a long-lived first-party cookie minted by the widget on first visit, used to find this visitor's prior conversations while they are still anonymous. Distinct from ExternalID (which stays per-session for RLS isolation). NULL for conversations that are not widget returning-visitor sessions.
64948
+ */
64949
+ get VisitorKey() {
64950
+ return this.Get('VisitorKey');
64951
+ }
64952
+ set VisitorKey(value) {
64953
+ this.Set('VisitorKey', value);
64954
+ }
64955
+ /**
64956
+ * * Field Name: LastConversationID
64957
+ * * Display Name: Last Conversation ID
64958
+ * * SQL Data Type: uniqueidentifier
64959
+ * * Related Entity/Foreign Key: MJ: Conversations (vwConversations.ID)
64960
+ * * Description: Conversation-altitude returning-visitor chain (R2). Self-foreign-key to the visitor's immediately prior Conversation (found by VisitorKey or the resolved LinkedEntityID/LinkedRecordID pair at mint time). History and memory are conversation-scoped, so the chain lives here — NOT on AIAgentSession.LastSessionID, which owns reconnect/resume semantics and is walked by the replay viewer. Named to mirror AIAgentSession.LastSessionID. NULL for a brand-new visitor's first conversation.
64961
+ */
64962
+ get LastConversationID() {
64963
+ return this.Get('LastConversationID');
64964
+ }
64965
+ set LastConversationID(value) {
64966
+ this.Set('LastConversationID', value);
64967
+ }
64968
+ /**
63652
64969
  * * Field Name: User
63653
64970
  * * Display Name: User
63654
64971
  * * SQL Data Type: nvarchar(100)
@@ -63720,6 +65037,22 @@ let MJConversationEntity = class MJConversationEntity extends BaseEntity {
63720
65037
  get RecordingFile() {
63721
65038
  return this.Get('RecordingFile');
63722
65039
  }
65040
+ /**
65041
+ * * Field Name: LastConversation
65042
+ * * Display Name: Last Conversation
65043
+ * * SQL Data Type: nvarchar(255)
65044
+ */
65045
+ get LastConversation() {
65046
+ return this.Get('LastConversation');
65047
+ }
65048
+ /**
65049
+ * * Field Name: RootLastConversationID
65050
+ * * Display Name: Root Last Conversation ID
65051
+ * * SQL Data Type: uniqueidentifier
65052
+ */
65053
+ get RootLastConversationID() {
65054
+ return this.Get('RootLastConversationID');
65055
+ }
63723
65056
  };
63724
65057
  MJConversationEntity = __decorate([
63725
65058
  RegisterClass(BaseEntity, 'MJ: Conversations')
@@ -69142,6 +70475,30 @@ let MJEntityEntity = class MJEntityEntity extends BaseEntity {
69142
70475
  this.Set('DetectExternalChanges', value);
69143
70476
  }
69144
70477
  /**
70478
+ * * Field Name: ExternalDataSourceID
70479
+ * * Display Name: External Data Source ID
70480
+ * * SQL Data Type: uniqueidentifier
70481
+ * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)
70482
+ */
70483
+ get ExternalDataSourceID() {
70484
+ return this.Get('ExternalDataSourceID');
70485
+ }
70486
+ set ExternalDataSourceID(value) {
70487
+ this.Set('ExternalDataSourceID', value);
70488
+ }
70489
+ /**
70490
+ * * Field Name: ExternalObjectName
70491
+ * * Display Name: External Object Name
70492
+ * * SQL Data Type: nvarchar(255)
70493
+ * * Description: Remote object name (table / view / collection) on the external system that backs this entity. Resolved against the data source DefaultSchema/DefaultDatabase when unqualified. Only meaningful when ExternalDataSourceID is set.
70494
+ */
70495
+ get ExternalObjectName() {
70496
+ return this.Get('ExternalObjectName');
70497
+ }
70498
+ set ExternalObjectName(value) {
70499
+ this.Set('ExternalObjectName', value);
70500
+ }
70501
+ /**
69145
70502
  * * Field Name: CodeName
69146
70503
  * * Display Name: Code Name
69147
70504
  * * SQL Data Type: nvarchar(MAX)
@@ -74990,25 +76347,24 @@ MJExplorerNavigationItemEntity = __decorate([
74990
76347
  ], MJExplorerNavigationItemEntity);
74991
76348
  export { MJExplorerNavigationItemEntity };
74992
76349
  /**
74993
- * MJ: File Categories - strongly typed entity sub-class
76350
+ * MJ: External Data Source Types - strongly typed entity sub-class
74994
76351
  * * Schema: __mj
74995
- * * Base Table: FileCategory
74996
- * * Base View: vwFileCategories
74997
- * * @description Organizes files into categories for classification, access control, and lifecycle management across the file storage system.
76352
+ * * Base Table: ExternalDataSourceType
76353
+ * * Base View: vwExternalDataSourceTypes
74998
76354
  * * Primary Key: ID
74999
76355
  * @extends {BaseEntity}
75000
76356
  * @class
75001
76357
  * @public
75002
76358
  */
75003
- let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
76359
+ let MJExternalDataSourceTypeEntity = class MJExternalDataSourceTypeEntity extends BaseEntity {
75004
76360
  /**
75005
- * Loads the MJ: File Categories record from the database
75006
- * @param ID: string - primary key value to load the MJ: File Categories record.
76361
+ * Loads the MJ: External Data Source Types record from the database
76362
+ * @param ID: string - primary key value to load the MJ: External Data Source Types record.
75007
76363
  * @param EntityRelationshipsToLoad - (optional) the relationships to load
75008
76364
  * @returns {Promise<boolean>} - true if successful, false otherwise
75009
76365
  * @public
75010
76366
  * @async
75011
- * @memberof MJFileCategoryEntity
76367
+ * @memberof MJExternalDataSourceTypeEntity
75012
76368
  * @method
75013
76369
  * @override
75014
76370
  */
@@ -75032,7 +76388,8 @@ let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
75032
76388
  /**
75033
76389
  * * Field Name: Name
75034
76390
  * * Display Name: Name
75035
- * * SQL Data Type: nvarchar(255)
76391
+ * * SQL Data Type: nvarchar(100)
76392
+ * * Description: Display name of the external data source driver type (e.g. Snowflake, Oracle, MongoDB, PostgreSQL).
75036
76393
  */
75037
76394
  get Name() {
75038
76395
  return this.Get('Name');
@@ -75041,21 +76398,243 @@ let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
75041
76398
  this.Set('Name', value);
75042
76399
  }
75043
76400
  /**
75044
- * * Field Name: ParentID
75045
- * * Display Name: Parent ID
76401
+ * * Field Name: Description
76402
+ * * Display Name: Description
76403
+ * * SQL Data Type: nvarchar(MAX)
76404
+ * * Description: Human-readable description of the driver type and what remote systems it targets.
76405
+ */
76406
+ get Description() {
76407
+ return this.Get('Description');
76408
+ }
76409
+ set Description(value) {
76410
+ this.Set('Description', value);
76411
+ }
76412
+ /**
76413
+ * * Field Name: DriverClass
76414
+ * * Display Name: Driver Class
76415
+ * * SQL Data Type: nvarchar(255)
76416
+ * * Description: Driver class resolved at runtime via MJGlobal.ClassFactory.CreateInstance(BaseExternalDataSourceDriver, DriverClass). MUST match the @RegisterClass key on the concrete driver (e.g. 'SnowflakeExternalDriver').
76417
+ */
76418
+ get DriverClass() {
76419
+ return this.Get('DriverClass');
76420
+ }
76421
+ set DriverClass(value) {
76422
+ this.Set('DriverClass', value);
76423
+ }
76424
+ /**
76425
+ * * Field Name: RequiredCredentialTypeID
76426
+ * * Display Name: Required Credential Type ID
75046
76427
  * * SQL Data Type: uniqueidentifier
75047
- * * Related Entity/Foreign Key: MJ: File Categories (vwFileCategories.ID)
76428
+ * * Related Entity/Foreign Key: MJ: Credential Types (vwCredentialTypes.ID)
75048
76429
  */
75049
- get ParentID() {
75050
- return this.Get('ParentID');
76430
+ get RequiredCredentialTypeID() {
76431
+ return this.Get('RequiredCredentialTypeID');
75051
76432
  }
75052
- set ParentID(value) {
75053
- this.Set('ParentID', value);
76433
+ set RequiredCredentialTypeID(value) {
76434
+ this.Set('RequiredCredentialTypeID', value);
76435
+ }
76436
+ /**
76437
+ * * Field Name: MetadataIntrospectionStrategy
76438
+ * * Display Name: Metadata Introspection Strategy
76439
+ * * SQL Data Type: nvarchar(17)
76440
+ * * Default Value: Manual
76441
+ * * Value List Type: List
76442
+ * * Possible Values
76443
+ * * InformationSchema
76444
+ * * Manual
76445
+ * * NativeCatalog
76446
+ * * SampledDocuments
76447
+ * * Description: How the metadata-introspection command hydrates Entity/EntityField rows from this driver family: InformationSchema (ANSI INFORMATION_SCHEMA), NativeCatalog (vendor catalog views), SampledDocuments (infer shape from sampled documents, e.g. MongoDB), or Manual (no automated introspection).
76448
+ */
76449
+ get MetadataIntrospectionStrategy() {
76450
+ return this.Get('MetadataIntrospectionStrategy');
76451
+ }
76452
+ set MetadataIntrospectionStrategy(value) {
76453
+ this.Set('MetadataIntrospectionStrategy', value);
76454
+ }
76455
+ /**
76456
+ * * Field Name: FilterDialect
76457
+ * * Display Name: Filter Dialect
76458
+ * * SQL Data Type: nvarchar(9)
76459
+ * * Default Value: ansi
76460
+ * * Value List Type: List
76461
+ * * Possible Values
76462
+ * * ansi
76463
+ * * mongo-ast
76464
+ * * mysql
76465
+ * * oracle
76466
+ * * pgsql
76467
+ * * tsql
76468
+ * * Description: Dialect the driver expects for RunView filter pass-through: tsql, ansi, pgsql, mysql, oracle, or mongo-ast (MongoDB filter AST translated within the driver).
76469
+ */
76470
+ get FilterDialect() {
76471
+ return this.Get('FilterDialect');
76472
+ }
76473
+ set FilterDialect(value) {
76474
+ this.Set('FilterDialect', value);
76475
+ }
76476
+ /**
76477
+ * * Field Name: PagingStrategy
76478
+ * * Display Name: Paging Strategy
76479
+ * * SQL Data Type: nvarchar(11)
76480
+ * * Default Value: LimitOffset
76481
+ * * Value List Type: List
76482
+ * * Possible Values
76483
+ * * Cursor
76484
+ * * LimitOffset
76485
+ * * OffsetFetch
76486
+ * * TopSkip
76487
+ * * Description: Pagination mechanism the driver uses: OffsetFetch (SQL Server OFFSET/FETCH), LimitOffset (Postgres/MySQL LIMIT/OFFSET), TopSkip, or Cursor.
76488
+ */
76489
+ get PagingStrategy() {
76490
+ return this.Get('PagingStrategy');
76491
+ }
76492
+ set PagingStrategy(value) {
76493
+ this.Set('PagingStrategy', value);
76494
+ }
76495
+ /**
76496
+ * * Field Name: SupportsSchemaIntrospection
76497
+ * * Display Name: Supports Schema Introspection
76498
+ * * SQL Data Type: bit
76499
+ * * Default Value: 1
76500
+ * * Description: Whether the driver can introspect remote schema metadata to assist Entity/EntityField generation.
76501
+ */
76502
+ get SupportsSchemaIntrospection() {
76503
+ return this.Get('SupportsSchemaIntrospection');
76504
+ }
76505
+ set SupportsSchemaIntrospection(value) {
76506
+ this.Set('SupportsSchemaIntrospection', value);
76507
+ }
76508
+ /**
76509
+ * * Field Name: SupportsNativeQueries
76510
+ * * Display Name: Supports Native Queries
76511
+ * * SQL Data Type: bit
76512
+ * * Default Value: 1
76513
+ * * Description: Whether the driver supports native-dialect query execution for MJ Queries that set ExternalDataSourceID.
76514
+ */
76515
+ get SupportsNativeQueries() {
76516
+ return this.Get('SupportsNativeQueries');
76517
+ }
76518
+ set SupportsNativeQueries(value) {
76519
+ this.Set('SupportsNativeQueries', value);
76520
+ }
76521
+ /**
76522
+ * * Field Name: SupportsReadWrite
76523
+ * * Display Name: Supports Read Write
76524
+ * * SQL Data Type: bit
76525
+ * * Default Value: 0
76526
+ * * Description: Reserved for a future write-capable phase. Always 0 in the current read-only design; external entities are read-only.
76527
+ */
76528
+ get SupportsReadWrite() {
76529
+ return this.Get('SupportsReadWrite');
76530
+ }
76531
+ set SupportsReadWrite(value) {
76532
+ this.Set('SupportsReadWrite', value);
76533
+ }
76534
+ /**
76535
+ * * Field Name: Status
76536
+ * * Display Name: Status
76537
+ * * SQL Data Type: nvarchar(10)
76538
+ * * Default Value: Active
76539
+ * * Value List Type: List
76540
+ * * Possible Values
76541
+ * * Active
76542
+ * * Deprecated
76543
+ * * Description: Lifecycle status of the driver-type catalog entry: Active or Deprecated.
76544
+ */
76545
+ get Status() {
76546
+ return this.Get('Status');
76547
+ }
76548
+ set Status(value) {
76549
+ this.Set('Status', value);
76550
+ }
76551
+ /**
76552
+ * * Field Name: __mj_CreatedAt
76553
+ * * Display Name: Created At
76554
+ * * SQL Data Type: datetimeoffset
76555
+ * * Default Value: getutcdate()
76556
+ */
76557
+ get __mj_CreatedAt() {
76558
+ return this.Get('__mj_CreatedAt');
76559
+ }
76560
+ /**
76561
+ * * Field Name: __mj_UpdatedAt
76562
+ * * Display Name: Updated At
76563
+ * * SQL Data Type: datetimeoffset
76564
+ * * Default Value: getutcdate()
76565
+ */
76566
+ get __mj_UpdatedAt() {
76567
+ return this.Get('__mj_UpdatedAt');
76568
+ }
76569
+ /**
76570
+ * * Field Name: RequiredCredentialType
76571
+ * * Display Name: Required Credential Type
76572
+ * * SQL Data Type: nvarchar(100)
76573
+ */
76574
+ get RequiredCredentialType() {
76575
+ return this.Get('RequiredCredentialType');
76576
+ }
76577
+ };
76578
+ MJExternalDataSourceTypeEntity = __decorate([
76579
+ RegisterClass(BaseEntity, 'MJ: External Data Source Types')
76580
+ ], MJExternalDataSourceTypeEntity);
76581
+ export { MJExternalDataSourceTypeEntity };
76582
+ /**
76583
+ * MJ: External Data Sources - strongly typed entity sub-class
76584
+ * * Schema: __mj
76585
+ * * Base Table: ExternalDataSource
76586
+ * * Base View: vwExternalDataSources
76587
+ * * Primary Key: ID
76588
+ * @extends {BaseEntity}
76589
+ * @class
76590
+ * @public
76591
+ */
76592
+ let MJExternalDataSourceEntity = class MJExternalDataSourceEntity extends BaseEntity {
76593
+ /**
76594
+ * Loads the MJ: External Data Sources record from the database
76595
+ * @param ID: string - primary key value to load the MJ: External Data Sources record.
76596
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
76597
+ * @returns {Promise<boolean>} - true if successful, false otherwise
76598
+ * @public
76599
+ * @async
76600
+ * @memberof MJExternalDataSourceEntity
76601
+ * @method
76602
+ * @override
76603
+ */
76604
+ async Load(ID, EntityRelationshipsToLoad) {
76605
+ const compositeKey = new CompositeKey();
76606
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
76607
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
76608
+ }
76609
+ /**
76610
+ * * Field Name: ID
76611
+ * * Display Name: ID
76612
+ * * SQL Data Type: uniqueidentifier
76613
+ * * Default Value: newsequentialid()
76614
+ */
76615
+ get ID() {
76616
+ return this.Get('ID');
76617
+ }
76618
+ set ID(value) {
76619
+ this.Set('ID', value);
76620
+ }
76621
+ /**
76622
+ * * Field Name: Name
76623
+ * * Display Name: Name
76624
+ * * SQL Data Type: nvarchar(100)
76625
+ * * Description: Display name of this configured external data source instance.
76626
+ */
76627
+ get Name() {
76628
+ return this.Get('Name');
76629
+ }
76630
+ set Name(value) {
76631
+ this.Set('Name', value);
75054
76632
  }
75055
76633
  /**
75056
76634
  * * Field Name: Description
75057
76635
  * * Display Name: Description
75058
76636
  * * SQL Data Type: nvarchar(MAX)
76637
+ * * Description: Human-readable description of what this data source connects to and what it is used for.
75059
76638
  */
75060
76639
  get Description() {
75061
76640
  return this.Get('Description');
@@ -75064,6 +76643,121 @@ let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
75064
76643
  this.Set('Description', value);
75065
76644
  }
75066
76645
  /**
76646
+ * * Field Name: TypeID
76647
+ * * Display Name: Type ID
76648
+ * * SQL Data Type: uniqueidentifier
76649
+ * * Related Entity/Foreign Key: MJ: External Data Source Types (vwExternalDataSourceTypes.ID)
76650
+ */
76651
+ get TypeID() {
76652
+ return this.Get('TypeID');
76653
+ }
76654
+ set TypeID(value) {
76655
+ this.Set('TypeID', value);
76656
+ }
76657
+ /**
76658
+ * * Field Name: CredentialID
76659
+ * * Display Name: Credential ID
76660
+ * * SQL Data Type: uniqueidentifier
76661
+ * * Related Entity/Foreign Key: MJ: Credentials (vwCredentials.ID)
76662
+ */
76663
+ get CredentialID() {
76664
+ return this.Get('CredentialID');
76665
+ }
76666
+ set CredentialID(value) {
76667
+ this.Set('CredentialID', value);
76668
+ }
76669
+ /**
76670
+ * * Field Name: DefaultSchema
76671
+ * * Display Name: Default Schema
76672
+ * * SQL Data Type: nvarchar(255)
76673
+ * * Description: Default schema/namespace to resolve unqualified ExternalObjectName values against on the remote system (e.g. a SQL schema, Snowflake schema).
76674
+ */
76675
+ get DefaultSchema() {
76676
+ return this.Get('DefaultSchema');
76677
+ }
76678
+ set DefaultSchema(value) {
76679
+ this.Set('DefaultSchema', value);
76680
+ }
76681
+ /**
76682
+ * * Field Name: DefaultDatabase
76683
+ * * Display Name: Default Database
76684
+ * * SQL Data Type: nvarchar(255)
76685
+ * * Description: Default database/catalog on the remote system (e.g. Snowflake database, MongoDB dbName). Nullable when the driver derives it from connection config.
76686
+ */
76687
+ get DefaultDatabase() {
76688
+ return this.Get('DefaultDatabase');
76689
+ }
76690
+ set DefaultDatabase(value) {
76691
+ this.Set('DefaultDatabase', value);
76692
+ }
76693
+ /**
76694
+ * * Field Name: ConnectionConfig
76695
+ * * Display Name: Connection Config
76696
+ * * SQL Data Type: nvarchar(MAX)
76697
+ * * Description: JSON blob of NON-SECRET driver configuration (host, port, region, warehouse, replica-set name, pool sizing). All secrets flow through CredentialID -> Credential -> CredentialEngine; never store secrets here.
76698
+ */
76699
+ get ConnectionConfig() {
76700
+ return this.Get('ConnectionConfig');
76701
+ }
76702
+ set ConnectionConfig(value) {
76703
+ this.Set('ConnectionConfig', value);
76704
+ }
76705
+ /**
76706
+ * * Field Name: DefaultCacheTTLSeconds
76707
+ * * Display Name: Default Cache TTL Seconds
76708
+ * * SQL Data Type: int
76709
+ * * Default Value: 300
76710
+ * * Description: Default server-side cache TTL (seconds) for reads against this source. External reads use time-based TTL because no event-driven invalidation is possible on remote systems. Default 300.
76711
+ */
76712
+ get DefaultCacheTTLSeconds() {
76713
+ return this.Get('DefaultCacheTTLSeconds');
76714
+ }
76715
+ set DefaultCacheTTLSeconds(value) {
76716
+ this.Set('DefaultCacheTTLSeconds', value);
76717
+ }
76718
+ /**
76719
+ * * Field Name: Status
76720
+ * * Display Name: Status
76721
+ * * SQL Data Type: nvarchar(10)
76722
+ * * Default Value: Active
76723
+ * * Value List Type: List
76724
+ * * Possible Values
76725
+ * * Active
76726
+ * * Disabled
76727
+ * * TestFailed
76728
+ * * Description: Operational status of this data source: Active (usable), Disabled (RunView fails fast), or TestFailed (last connection test failed).
76729
+ */
76730
+ get Status() {
76731
+ return this.Get('Status');
76732
+ }
76733
+ set Status(value) {
76734
+ this.Set('Status', value);
76735
+ }
76736
+ /**
76737
+ * * Field Name: LastConnectionTestAt
76738
+ * * Display Name: Last Connection Test At
76739
+ * * SQL Data Type: datetimeoffset
76740
+ * * Description: Timestamp of the most recent connection test against this source.
76741
+ */
76742
+ get LastConnectionTestAt() {
76743
+ return this.Get('LastConnectionTestAt');
76744
+ }
76745
+ set LastConnectionTestAt(value) {
76746
+ this.Set('LastConnectionTestAt', value);
76747
+ }
76748
+ /**
76749
+ * * Field Name: LastConnectionTestResult
76750
+ * * Display Name: Last Connection Test Result
76751
+ * * SQL Data Type: nvarchar(MAX)
76752
+ * * Description: Result message from the most recent connection test (success detail or error text).
76753
+ */
76754
+ get LastConnectionTestResult() {
76755
+ return this.Get('LastConnectionTestResult');
76756
+ }
76757
+ set LastConnectionTestResult(value) {
76758
+ this.Set('LastConnectionTestResult', value);
76759
+ }
76760
+ /**
75067
76761
  * * Field Name: __mj_CreatedAt
75068
76762
  * * Display Name: Created At
75069
76763
  * * SQL Data Type: datetimeoffset
@@ -75082,46 +76776,159 @@ let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
75082
76776
  return this.Get('__mj_UpdatedAt');
75083
76777
  }
75084
76778
  /**
75085
- * * Field Name: Parent
75086
- * * Display Name: Parent
75087
- * * SQL Data Type: nvarchar(255)
76779
+ * * Field Name: Type
76780
+ * * Display Name: Type
76781
+ * * SQL Data Type: nvarchar(100)
75088
76782
  */
75089
- get Parent() {
75090
- return this.Get('Parent');
76783
+ get Type() {
76784
+ return this.Get('Type');
75091
76785
  }
75092
76786
  /**
75093
- * * Field Name: RootParentID
75094
- * * Display Name: Root Parent ID
75095
- * * SQL Data Type: uniqueidentifier
76787
+ * * Field Name: Credential
76788
+ * * Display Name: Credential
76789
+ * * SQL Data Type: nvarchar(200)
75096
76790
  */
75097
- get RootParentID() {
75098
- return this.Get('RootParentID');
76791
+ get Credential() {
76792
+ return this.Get('Credential');
75099
76793
  }
75100
76794
  };
75101
- MJFileCategoryEntity = __decorate([
75102
- RegisterClass(BaseEntity, 'MJ: File Categories')
75103
- ], MJFileCategoryEntity);
75104
- export { MJFileCategoryEntity };
76795
+ MJExternalDataSourceEntity = __decorate([
76796
+ RegisterClass(BaseEntity, 'MJ: External Data Sources')
76797
+ ], MJExternalDataSourceEntity);
76798
+ export { MJExternalDataSourceEntity };
75105
76799
  /**
75106
- * MJ: File Entity Record Links - strongly typed entity sub-class
76800
+ * MJ: File Categories - strongly typed entity sub-class
75107
76801
  * * Schema: __mj
75108
- * * Base Table: FileEntityRecordLink
75109
- * * Base View: vwFileEntityRecordLinks
75110
- * * @description Associates files with entity records, enabling attachment management and document relationships throughout the system.
76802
+ * * Base Table: FileCategory
76803
+ * * Base View: vwFileCategories
76804
+ * * @description Organizes files into categories for classification, access control, and lifecycle management across the file storage system.
75111
76805
  * * Primary Key: ID
75112
76806
  * @extends {BaseEntity}
75113
76807
  * @class
75114
76808
  * @public
75115
76809
  */
75116
- let MJFileEntityRecordLinkEntity = class MJFileEntityRecordLinkEntity extends BaseEntity {
76810
+ let MJFileCategoryEntity = class MJFileCategoryEntity extends BaseEntity {
75117
76811
  /**
75118
- * Loads the MJ: File Entity Record Links record from the database
75119
- * @param ID: string - primary key value to load the MJ: File Entity Record Links record.
76812
+ * Loads the MJ: File Categories record from the database
76813
+ * @param ID: string - primary key value to load the MJ: File Categories record.
75120
76814
  * @param EntityRelationshipsToLoad - (optional) the relationships to load
75121
76815
  * @returns {Promise<boolean>} - true if successful, false otherwise
75122
76816
  * @public
75123
76817
  * @async
75124
- * @memberof MJFileEntityRecordLinkEntity
76818
+ * @memberof MJFileCategoryEntity
76819
+ * @method
76820
+ * @override
76821
+ */
76822
+ async Load(ID, EntityRelationshipsToLoad) {
76823
+ const compositeKey = new CompositeKey();
76824
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
76825
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
76826
+ }
76827
+ /**
76828
+ * * Field Name: ID
76829
+ * * Display Name: ID
76830
+ * * SQL Data Type: uniqueidentifier
76831
+ * * Default Value: newsequentialid()
76832
+ */
76833
+ get ID() {
76834
+ return this.Get('ID');
76835
+ }
76836
+ set ID(value) {
76837
+ this.Set('ID', value);
76838
+ }
76839
+ /**
76840
+ * * Field Name: Name
76841
+ * * Display Name: Name
76842
+ * * SQL Data Type: nvarchar(255)
76843
+ */
76844
+ get Name() {
76845
+ return this.Get('Name');
76846
+ }
76847
+ set Name(value) {
76848
+ this.Set('Name', value);
76849
+ }
76850
+ /**
76851
+ * * Field Name: ParentID
76852
+ * * Display Name: Parent ID
76853
+ * * SQL Data Type: uniqueidentifier
76854
+ * * Related Entity/Foreign Key: MJ: File Categories (vwFileCategories.ID)
76855
+ */
76856
+ get ParentID() {
76857
+ return this.Get('ParentID');
76858
+ }
76859
+ set ParentID(value) {
76860
+ this.Set('ParentID', value);
76861
+ }
76862
+ /**
76863
+ * * Field Name: Description
76864
+ * * Display Name: Description
76865
+ * * SQL Data Type: nvarchar(MAX)
76866
+ */
76867
+ get Description() {
76868
+ return this.Get('Description');
76869
+ }
76870
+ set Description(value) {
76871
+ this.Set('Description', value);
76872
+ }
76873
+ /**
76874
+ * * Field Name: __mj_CreatedAt
76875
+ * * Display Name: Created At
76876
+ * * SQL Data Type: datetimeoffset
76877
+ * * Default Value: getutcdate()
76878
+ */
76879
+ get __mj_CreatedAt() {
76880
+ return this.Get('__mj_CreatedAt');
76881
+ }
76882
+ /**
76883
+ * * Field Name: __mj_UpdatedAt
76884
+ * * Display Name: Updated At
76885
+ * * SQL Data Type: datetimeoffset
76886
+ * * Default Value: getutcdate()
76887
+ */
76888
+ get __mj_UpdatedAt() {
76889
+ return this.Get('__mj_UpdatedAt');
76890
+ }
76891
+ /**
76892
+ * * Field Name: Parent
76893
+ * * Display Name: Parent
76894
+ * * SQL Data Type: nvarchar(255)
76895
+ */
76896
+ get Parent() {
76897
+ return this.Get('Parent');
76898
+ }
76899
+ /**
76900
+ * * Field Name: RootParentID
76901
+ * * Display Name: Root Parent ID
76902
+ * * SQL Data Type: uniqueidentifier
76903
+ */
76904
+ get RootParentID() {
76905
+ return this.Get('RootParentID');
76906
+ }
76907
+ };
76908
+ MJFileCategoryEntity = __decorate([
76909
+ RegisterClass(BaseEntity, 'MJ: File Categories')
76910
+ ], MJFileCategoryEntity);
76911
+ export { MJFileCategoryEntity };
76912
+ /**
76913
+ * MJ: File Entity Record Links - strongly typed entity sub-class
76914
+ * * Schema: __mj
76915
+ * * Base Table: FileEntityRecordLink
76916
+ * * Base View: vwFileEntityRecordLinks
76917
+ * * @description Associates files with entity records, enabling attachment management and document relationships throughout the system.
76918
+ * * Primary Key: ID
76919
+ * @extends {BaseEntity}
76920
+ * @class
76921
+ * @public
76922
+ */
76923
+ let MJFileEntityRecordLinkEntity = class MJFileEntityRecordLinkEntity extends BaseEntity {
76924
+ /**
76925
+ * Loads the MJ: File Entity Record Links record from the database
76926
+ * @param ID: string - primary key value to load the MJ: File Entity Record Links record.
76927
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
76928
+ * @returns {Promise<boolean>} - true if successful, false otherwise
76929
+ * @public
76930
+ * @async
76931
+ * @memberof MJFileEntityRecordLinkEntity
75125
76932
  * @method
75126
76933
  * @override
75127
76934
  */
@@ -86394,6 +88201,18 @@ let MJQueryEntity = class MJQueryEntity extends BaseEntity {
86394
88201
  this.Set('Reusable', value);
86395
88202
  }
86396
88203
  /**
88204
+ * * Field Name: ExternalDataSourceID
88205
+ * * Display Name: External Data Source ID
88206
+ * * SQL Data Type: uniqueidentifier
88207
+ * * Related Entity/Foreign Key: MJ: External Data Sources (vwExternalDataSources.ID)
88208
+ */
88209
+ get ExternalDataSourceID() {
88210
+ return this.Get('ExternalDataSourceID');
88211
+ }
88212
+ set ExternalDataSourceID(value) {
88213
+ this.Set('ExternalDataSourceID', value);
88214
+ }
88215
+ /**
86397
88216
  * * Field Name: Category
86398
88217
  * * Display Name: Category Name
86399
88218
  * * SQL Data Type: nvarchar(50)
@@ -86417,6 +88236,14 @@ let MJQueryEntity = class MJQueryEntity extends BaseEntity {
86417
88236
  get SQLDialect() {
86418
88237
  return this.Get('SQLDialect');
86419
88238
  }
88239
+ /**
88240
+ * * Field Name: ExternalDataSource
88241
+ * * Display Name: External Data Source
88242
+ * * SQL Data Type: nvarchar(100)
88243
+ */
88244
+ get ExternalDataSource() {
88245
+ return this.Get('ExternalDataSource');
88246
+ }
86420
88247
  };
86421
88248
  MJQueryEntity = __decorate([
86422
88249
  RegisterClass(BaseEntity, 'MJ: Queries')
@@ -103801,6 +105628,809 @@ MJUserRoleEntity = __decorate([
103801
105628
  RegisterClass(BaseEntity, 'MJ: User Roles')
103802
105629
  ], MJUserRoleEntity);
103803
105630
  export { MJUserRoleEntity };
105631
+ /**
105632
+ * MJ: User Routine Recipients - strongly typed entity sub-class
105633
+ * * Schema: __mj
105634
+ * * Base Table: UserRoutineRecipient
105635
+ * * Base View: vwUserRoutineRecipients
105636
+ * * Primary Key: ID
105637
+ * @extends {BaseEntity}
105638
+ * @class
105639
+ * @public
105640
+ */
105641
+ let MJUserRoutineRecipientEntity = class MJUserRoutineRecipientEntity extends BaseEntity {
105642
+ /**
105643
+ * Loads the MJ: User Routine Recipients record from the database
105644
+ * @param ID: string - primary key value to load the MJ: User Routine Recipients record.
105645
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
105646
+ * @returns {Promise<boolean>} - true if successful, false otherwise
105647
+ * @public
105648
+ * @async
105649
+ * @memberof MJUserRoutineRecipientEntity
105650
+ * @method
105651
+ * @override
105652
+ */
105653
+ async Load(ID, EntityRelationshipsToLoad) {
105654
+ const compositeKey = new CompositeKey();
105655
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
105656
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
105657
+ }
105658
+ /**
105659
+ * * Field Name: ID
105660
+ * * Display Name: ID
105661
+ * * SQL Data Type: uniqueidentifier
105662
+ * * Default Value: newsequentialid()
105663
+ */
105664
+ get ID() {
105665
+ return this.Get('ID');
105666
+ }
105667
+ set ID(value) {
105668
+ this.Set('ID', value);
105669
+ }
105670
+ /**
105671
+ * * Field Name: RoutineID
105672
+ * * Display Name: Routine
105673
+ * * SQL Data Type: uniqueidentifier
105674
+ * * Related Entity/Foreign Key: MJ: User Routines (vwUserRoutines.ID)
105675
+ * * Description: Routine this recipient belongs to.
105676
+ */
105677
+ get RoutineID() {
105678
+ return this.Get('RoutineID');
105679
+ }
105680
+ set RoutineID(value) {
105681
+ this.Set('RoutineID', value);
105682
+ }
105683
+ /**
105684
+ * * Field Name: UserID
105685
+ * * Display Name: User
105686
+ * * SQL Data Type: uniqueidentifier
105687
+ * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
105688
+ * * Description: Internal MJ user recipient (when notifying an existing user). Either UserID or Email is set.
105689
+ */
105690
+ get UserID() {
105691
+ return this.Get('UserID');
105692
+ }
105693
+ set UserID(value) {
105694
+ this.Set('UserID', value);
105695
+ }
105696
+ /**
105697
+ * * Field Name: Email
105698
+ * * Display Name: Email Address
105699
+ * * SQL Data Type: nvarchar(255)
105700
+ * * Description: External email recipient (when notifying a non-user). Either UserID or Email is set.
105701
+ */
105702
+ get Email() {
105703
+ return this.Get('Email');
105704
+ }
105705
+ set Email(value) {
105706
+ this.Set('Email', value);
105707
+ }
105708
+ /**
105709
+ * * Field Name: Channel
105710
+ * * Display Name: Channel
105711
+ * * SQL Data Type: nvarchar(20)
105712
+ * * Default Value: InApp
105713
+ * * Value List Type: List
105714
+ * * Possible Values
105715
+ * * Email
105716
+ * * InApp
105717
+ * * Description: Delivery channel for this recipient: InApp or Email.
105718
+ */
105719
+ get Channel() {
105720
+ return this.Get('Channel');
105721
+ }
105722
+ set Channel(value) {
105723
+ this.Set('Channel', value);
105724
+ }
105725
+ /**
105726
+ * * Field Name: Sequence
105727
+ * * Display Name: Sequence
105728
+ * * SQL Data Type: int
105729
+ * * Default Value: 0
105730
+ * * Description: Explicit display/notification ordering of recipients within a routine (ascending).
105731
+ */
105732
+ get Sequence() {
105733
+ return this.Get('Sequence');
105734
+ }
105735
+ set Sequence(value) {
105736
+ this.Set('Sequence', value);
105737
+ }
105738
+ /**
105739
+ * * Field Name: __mj_CreatedAt
105740
+ * * Display Name: Created At
105741
+ * * SQL Data Type: datetimeoffset
105742
+ * * Default Value: getutcdate()
105743
+ */
105744
+ get __mj_CreatedAt() {
105745
+ return this.Get('__mj_CreatedAt');
105746
+ }
105747
+ /**
105748
+ * * Field Name: __mj_UpdatedAt
105749
+ * * Display Name: Updated At
105750
+ * * SQL Data Type: datetimeoffset
105751
+ * * Default Value: getutcdate()
105752
+ */
105753
+ get __mj_UpdatedAt() {
105754
+ return this.Get('__mj_UpdatedAt');
105755
+ }
105756
+ /**
105757
+ * * Field Name: Routine
105758
+ * * Display Name: Routine Name
105759
+ * * SQL Data Type: nvarchar(255)
105760
+ */
105761
+ get Routine() {
105762
+ return this.Get('Routine');
105763
+ }
105764
+ /**
105765
+ * * Field Name: User
105766
+ * * Display Name: User Name
105767
+ * * SQL Data Type: nvarchar(100)
105768
+ */
105769
+ get User() {
105770
+ return this.Get('User');
105771
+ }
105772
+ };
105773
+ MJUserRoutineRecipientEntity = __decorate([
105774
+ RegisterClass(BaseEntity, 'MJ: User Routine Recipients')
105775
+ ], MJUserRoutineRecipientEntity);
105776
+ export { MJUserRoutineRecipientEntity };
105777
+ /**
105778
+ * MJ: User Routine Runs - strongly typed entity sub-class
105779
+ * * Schema: __mj
105780
+ * * Base Table: UserRoutineRun
105781
+ * * Base View: vwUserRoutineRuns
105782
+ * * Primary Key: ID
105783
+ * @extends {BaseEntity}
105784
+ * @class
105785
+ * @public
105786
+ */
105787
+ let MJUserRoutineRunEntity = class MJUserRoutineRunEntity extends BaseEntity {
105788
+ /**
105789
+ * Loads the MJ: User Routine Runs record from the database
105790
+ * @param ID: string - primary key value to load the MJ: User Routine Runs record.
105791
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
105792
+ * @returns {Promise<boolean>} - true if successful, false otherwise
105793
+ * @public
105794
+ * @async
105795
+ * @memberof MJUserRoutineRunEntity
105796
+ * @method
105797
+ * @override
105798
+ */
105799
+ async Load(ID, EntityRelationshipsToLoad) {
105800
+ const compositeKey = new CompositeKey();
105801
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
105802
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
105803
+ }
105804
+ /**
105805
+ * * Field Name: ID
105806
+ * * Display Name: ID
105807
+ * * SQL Data Type: uniqueidentifier
105808
+ * * Default Value: newsequentialid()
105809
+ */
105810
+ get ID() {
105811
+ return this.Get('ID');
105812
+ }
105813
+ set ID(value) {
105814
+ this.Set('ID', value);
105815
+ }
105816
+ /**
105817
+ * * Field Name: RoutineID
105818
+ * * Display Name: Routine
105819
+ * * SQL Data Type: uniqueidentifier
105820
+ * * Related Entity/Foreign Key: MJ: User Routines (vwUserRoutines.ID)
105821
+ * * Description: Routine this run belongs to.
105822
+ */
105823
+ get RoutineID() {
105824
+ return this.Get('RoutineID');
105825
+ }
105826
+ set RoutineID(value) {
105827
+ this.Set('RoutineID', value);
105828
+ }
105829
+ /**
105830
+ * * Field Name: StartedAt
105831
+ * * Display Name: Started At
105832
+ * * SQL Data Type: datetimeoffset
105833
+ * * Default Value: sysdatetimeoffset()
105834
+ * * Description: When the run started.
105835
+ */
105836
+ get StartedAt() {
105837
+ return this.Get('StartedAt');
105838
+ }
105839
+ set StartedAt(value) {
105840
+ this.Set('StartedAt', value);
105841
+ }
105842
+ /**
105843
+ * * Field Name: CompletedAt
105844
+ * * Display Name: Completed At
105845
+ * * SQL Data Type: datetimeoffset
105846
+ * * Description: When the run completed (null while running).
105847
+ */
105848
+ get CompletedAt() {
105849
+ return this.Get('CompletedAt');
105850
+ }
105851
+ set CompletedAt(value) {
105852
+ this.Set('CompletedAt', value);
105853
+ }
105854
+ /**
105855
+ * * Field Name: Status
105856
+ * * Display Name: Status
105857
+ * * SQL Data Type: nvarchar(20)
105858
+ * * Default Value: Running
105859
+ * * Value List Type: List
105860
+ * * Possible Values
105861
+ * * Failed
105862
+ * * Running
105863
+ * * Skipped
105864
+ * * Success
105865
+ * * Description: Run outcome.
105866
+ */
105867
+ get Status() {
105868
+ return this.Get('Status');
105869
+ }
105870
+ set Status(value) {
105871
+ this.Set('Status', value);
105872
+ }
105873
+ /**
105874
+ * * Field Name: AgentRunID
105875
+ * * Display Name: Agent Run
105876
+ * * SQL Data Type: uniqueidentifier
105877
+ * * Related Entity/Foreign Key: MJ: AI Agent Runs (vwAIAgentRuns.ID)
105878
+ * * Description: Linked AI Agent Run when the routine target is an agent.
105879
+ */
105880
+ get AgentRunID() {
105881
+ return this.Get('AgentRunID');
105882
+ }
105883
+ set AgentRunID(value) {
105884
+ this.Set('AgentRunID', value);
105885
+ }
105886
+ /**
105887
+ * * Field Name: PromptRunID
105888
+ * * Display Name: Prompt Run
105889
+ * * SQL Data Type: uniqueidentifier
105890
+ * * Related Entity/Foreign Key: MJ: AI Prompt Runs (vwAIPromptRuns.ID)
105891
+ * * Description: For Prompt targets, links to the MJ: AI Prompt Runs record for this execution — tokens, cost, and full telemetry live there (never duplicated here).
105892
+ */
105893
+ get PromptRunID() {
105894
+ return this.Get('PromptRunID');
105895
+ }
105896
+ set PromptRunID(value) {
105897
+ this.Set('PromptRunID', value);
105898
+ }
105899
+ /**
105900
+ * * Field Name: ActionExecutionLogID
105901
+ * * Display Name: Action Execution Log
105902
+ * * SQL Data Type: uniqueidentifier
105903
+ * * Related Entity/Foreign Key: MJ: Action Execution Logs (vwActionExecutionLogs.ID)
105904
+ * * Description: For Action targets, links to the MJ: Action Execution Logs record for this execution — params, results, and telemetry live there (never duplicated here).
105905
+ */
105906
+ get ActionExecutionLogID() {
105907
+ return this.Get('ActionExecutionLogID');
105908
+ }
105909
+ set ActionExecutionLogID(value) {
105910
+ this.Set('ActionExecutionLogID', value);
105911
+ }
105912
+ /**
105913
+ * * Field Name: ResultSummary
105914
+ * * Display Name: Result Summary
105915
+ * * SQL Data Type: nvarchar(MAX)
105916
+ * * Description: Human-readable summary of the run result.
105917
+ */
105918
+ get ResultSummary() {
105919
+ return this.Get('ResultSummary');
105920
+ }
105921
+ set ResultSummary(value) {
105922
+ this.Set('ResultSummary', value);
105923
+ }
105924
+ /**
105925
+ * * Field Name: ResultHash
105926
+ * * Display Name: Result Hash
105927
+ * * SQL Data Type: nvarchar(100)
105928
+ * * Description: Hash of the result, compared against the routine LastResultHash for OnChange detection.
105929
+ */
105930
+ get ResultHash() {
105931
+ return this.Get('ResultHash');
105932
+ }
105933
+ set ResultHash(value) {
105934
+ this.Set('ResultHash', value);
105935
+ }
105936
+ /**
105937
+ * * Field Name: NotificationSent
105938
+ * * Display Name: Notification Sent
105939
+ * * SQL Data Type: bit
105940
+ * * Default Value: 0
105941
+ * * Description: Whether a notification was dispatched for this run.
105942
+ */
105943
+ get NotificationSent() {
105944
+ return this.Get('NotificationSent');
105945
+ }
105946
+ set NotificationSent(value) {
105947
+ this.Set('NotificationSent', value);
105948
+ }
105949
+ /**
105950
+ * * Field Name: ErrorMessage
105951
+ * * Display Name: Error Message
105952
+ * * SQL Data Type: nvarchar(MAX)
105953
+ * * Description: Error detail when Status is Failed.
105954
+ */
105955
+ get ErrorMessage() {
105956
+ return this.Get('ErrorMessage');
105957
+ }
105958
+ set ErrorMessage(value) {
105959
+ this.Set('ErrorMessage', value);
105960
+ }
105961
+ /**
105962
+ * * Field Name: __mj_CreatedAt
105963
+ * * Display Name: Created At
105964
+ * * SQL Data Type: datetimeoffset
105965
+ * * Default Value: getutcdate()
105966
+ */
105967
+ get __mj_CreatedAt() {
105968
+ return this.Get('__mj_CreatedAt');
105969
+ }
105970
+ /**
105971
+ * * Field Name: __mj_UpdatedAt
105972
+ * * Display Name: Updated At
105973
+ * * SQL Data Type: datetimeoffset
105974
+ * * Default Value: getutcdate()
105975
+ */
105976
+ get __mj_UpdatedAt() {
105977
+ return this.Get('__mj_UpdatedAt');
105978
+ }
105979
+ /**
105980
+ * * Field Name: Routine
105981
+ * * Display Name: Routine Name
105982
+ * * SQL Data Type: nvarchar(255)
105983
+ */
105984
+ get Routine() {
105985
+ return this.Get('Routine');
105986
+ }
105987
+ /**
105988
+ * * Field Name: AgentRun
105989
+ * * Display Name: Agent Run Reference
105990
+ * * SQL Data Type: nvarchar(255)
105991
+ */
105992
+ get AgentRun() {
105993
+ return this.Get('AgentRun');
105994
+ }
105995
+ /**
105996
+ * * Field Name: PromptRun
105997
+ * * Display Name: Prompt Run Reference
105998
+ * * SQL Data Type: nvarchar(255)
105999
+ */
106000
+ get PromptRun() {
106001
+ return this.Get('PromptRun');
106002
+ }
106003
+ /**
106004
+ * * Field Name: ActionExecutionLog
106005
+ * * Display Name: Action Execution Log Reference
106006
+ * * SQL Data Type: nvarchar(425)
106007
+ */
106008
+ get ActionExecutionLog() {
106009
+ return this.Get('ActionExecutionLog');
106010
+ }
106011
+ };
106012
+ MJUserRoutineRunEntity = __decorate([
106013
+ RegisterClass(BaseEntity, 'MJ: User Routine Runs')
106014
+ ], MJUserRoutineRunEntity);
106015
+ export { MJUserRoutineRunEntity };
106016
+ /**
106017
+ * MJ: User Routines - strongly typed entity sub-class
106018
+ * * Schema: __mj
106019
+ * * Base Table: UserRoutine
106020
+ * * Base View: vwUserRoutines
106021
+ * * Primary Key: ID
106022
+ * @extends {BaseEntity}
106023
+ * @class
106024
+ * @public
106025
+ */
106026
+ let MJUserRoutineEntity = class MJUserRoutineEntity extends BaseEntity {
106027
+ /**
106028
+ * Loads the MJ: User Routines record from the database
106029
+ * @param ID: string - primary key value to load the MJ: User Routines record.
106030
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
106031
+ * @returns {Promise<boolean>} - true if successful, false otherwise
106032
+ * @public
106033
+ * @async
106034
+ * @memberof MJUserRoutineEntity
106035
+ * @method
106036
+ * @override
106037
+ */
106038
+ async Load(ID, EntityRelationshipsToLoad) {
106039
+ const compositeKey = new CompositeKey();
106040
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
106041
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
106042
+ }
106043
+ /**
106044
+ * * Field Name: ID
106045
+ * * Display Name: ID
106046
+ * * SQL Data Type: uniqueidentifier
106047
+ * * Default Value: newsequentialid()
106048
+ */
106049
+ get ID() {
106050
+ return this.Get('ID');
106051
+ }
106052
+ set ID(value) {
106053
+ this.Set('ID', value);
106054
+ }
106055
+ /**
106056
+ * * Field Name: UserID
106057
+ * * Display Name: User
106058
+ * * SQL Data Type: uniqueidentifier
106059
+ * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
106060
+ * * Description: Owner of the routine. Routines are private to their owner (row-level access).
106061
+ */
106062
+ get UserID() {
106063
+ return this.Get('UserID');
106064
+ }
106065
+ set UserID(value) {
106066
+ this.Set('UserID', value);
106067
+ }
106068
+ /**
106069
+ * * Field Name: EnvironmentID
106070
+ * * Display Name: Environment
106071
+ * * SQL Data Type: uniqueidentifier
106072
+ * * Related Entity/Foreign Key: MJ: Environments (vwEnvironments.ID)
106073
+ * * Description: Optional environment scope for the routine.
106074
+ */
106075
+ get EnvironmentID() {
106076
+ return this.Get('EnvironmentID');
106077
+ }
106078
+ set EnvironmentID(value) {
106079
+ this.Set('EnvironmentID', value);
106080
+ }
106081
+ /**
106082
+ * * Field Name: Name
106083
+ * * Display Name: Name
106084
+ * * SQL Data Type: nvarchar(255)
106085
+ * * Description: User-facing routine name.
106086
+ */
106087
+ get Name() {
106088
+ return this.Get('Name');
106089
+ }
106090
+ set Name(value) {
106091
+ this.Set('Name', value);
106092
+ }
106093
+ /**
106094
+ * * Field Name: Description
106095
+ * * Display Name: Description
106096
+ * * SQL Data Type: nvarchar(MAX)
106097
+ * * Description: Optional description of what the routine does.
106098
+ */
106099
+ get Description() {
106100
+ return this.Get('Description');
106101
+ }
106102
+ set Description(value) {
106103
+ this.Set('Description', value);
106104
+ }
106105
+ /**
106106
+ * * Field Name: Status
106107
+ * * Display Name: Status
106108
+ * * SQL Data Type: nvarchar(20)
106109
+ * * Default Value: Active
106110
+ * * Value List Type: List
106111
+ * * Possible Values
106112
+ * * Active
106113
+ * * Disabled
106114
+ * * Paused
106115
+ * * Description: Lifecycle status: Active (eligible to run), Paused (temporarily off), Disabled (off).
106116
+ */
106117
+ get Status() {
106118
+ return this.Get('Status');
106119
+ }
106120
+ set Status(value) {
106121
+ this.Set('Status', value);
106122
+ }
106123
+ /**
106124
+ * * Field Name: RoutineType
106125
+ * * Display Name: Routine Type
106126
+ * * SQL Data Type: nvarchar(20)
106127
+ * * Default Value: Scheduled
106128
+ * * Value List Type: List
106129
+ * * Possible Values
106130
+ * * Monitoring
106131
+ * * Scheduled
106132
+ * * Description: Scheduled (always notify per NotifyCondition) or Monitoring (intended for OnChange detection via result hashing).
106133
+ */
106134
+ get RoutineType() {
106135
+ return this.Get('RoutineType');
106136
+ }
106137
+ set RoutineType(value) {
106138
+ this.Set('RoutineType', value);
106139
+ }
106140
+ /**
106141
+ * * Field Name: TargetType
106142
+ * * Display Name: Target Type
106143
+ * * SQL Data Type: nvarchar(20)
106144
+ * * Value List Type: List
106145
+ * * Possible Values
106146
+ * * Action
106147
+ * * Agent
106148
+ * * Prompt
106149
+ * * Description: What kind of target this routine runs: Agent, Action, or Prompt. Determines how TargetID is interpreted.
106150
+ */
106151
+ get TargetType() {
106152
+ return this.Get('TargetType');
106153
+ }
106154
+ set TargetType(value) {
106155
+ this.Set('TargetType', value);
106156
+ }
106157
+ /**
106158
+ * * Field Name: TargetID
106159
+ * * Display Name: Target
106160
+ * * SQL Data Type: uniqueidentifier
106161
+ * * Description: Polymorphic reference resolved by TargetType (AIAgent.ID, Action.ID, or AIPrompt.ID). No FK because the target table varies.
106162
+ */
106163
+ get TargetID() {
106164
+ return this.Get('TargetID');
106165
+ }
106166
+ set TargetID(value) {
106167
+ this.Set('TargetID', value);
106168
+ }
106169
+ /**
106170
+ * * Field Name: InitialMessage
106171
+ * * Display Name: Initial Message
106172
+ * * SQL Data Type: nvarchar(MAX)
106173
+ * * Description: For Agent targets, the user message sent to the agent on each run.
106174
+ */
106175
+ get InitialMessage() {
106176
+ return this.Get('InitialMessage');
106177
+ }
106178
+ set InitialMessage(value) {
106179
+ this.Set('InitialMessage', value);
106180
+ }
106181
+ /**
106182
+ * * Field Name: StartingPayload
106183
+ * * Display Name: Starting Payload
106184
+ * * SQL Data Type: nvarchar(MAX)
106185
+ * * Description: Optional JSON starting payload passed to the target on each run.
106186
+ */
106187
+ get StartingPayload() {
106188
+ return this.Get('StartingPayload');
106189
+ }
106190
+ set StartingPayload(value) {
106191
+ this.Set('StartingPayload', value);
106192
+ }
106193
+ /**
106194
+ * * Field Name: RequestedSkillIDs
106195
+ * * Display Name: Requested Skills
106196
+ * * SQL Data Type: nvarchar(MAX)
106197
+ * * Description: Optional JSON array of MJ: AI Skills IDs to pre-activate when the routine target is an Agent — threaded as ExecuteAgentParams.requestedSkillIDs so the agent starts each scheduled run with the requested skills' instructions and tools in effect (subject to all availability gates; ActivationMode does not gate this explicit-request path). Ignored for Action/Prompt targets.
106198
+ */
106199
+ get RequestedSkillIDs() {
106200
+ return this.Get('RequestedSkillIDs');
106201
+ }
106202
+ set RequestedSkillIDs(value) {
106203
+ this.Set('RequestedSkillIDs', value);
106204
+ }
106205
+ /**
106206
+ * * Field Name: CronExpression
106207
+ * * Display Name: Cron Expression
106208
+ * * SQL Data Type: nvarchar(100)
106209
+ * * Description: Standard cron expression evaluated by the dispatcher to determine when the routine is due.
106210
+ */
106211
+ get CronExpression() {
106212
+ return this.Get('CronExpression');
106213
+ }
106214
+ set CronExpression(value) {
106215
+ this.Set('CronExpression', value);
106216
+ }
106217
+ /**
106218
+ * * Field Name: StartAt
106219
+ * * Display Name: Start At
106220
+ * * SQL Data Type: datetimeoffset
106221
+ * * Description: Optional activation window start. An Active routine does not run before this time; once current time passes StartAt the dispatcher begins scheduling it. NULL = eligible immediately.
106222
+ */
106223
+ get StartAt() {
106224
+ return this.Get('StartAt');
106225
+ }
106226
+ set StartAt(value) {
106227
+ this.Set('StartAt', value);
106228
+ }
106229
+ /**
106230
+ * * Field Name: EndAt
106231
+ * * Display Name: End At
106232
+ * * SQL Data Type: datetimeoffset
106233
+ * * Description: Optional activation window end. An Active routine stops running once current time passes EndAt — automatic sunset without changing Status. NULL = no end.
106234
+ */
106235
+ get EndAt() {
106236
+ return this.Get('EndAt');
106237
+ }
106238
+ set EndAt(value) {
106239
+ this.Set('EndAt', value);
106240
+ }
106241
+ /**
106242
+ * * Field Name: NotificationTemplateID
106243
+ * * Display Name: Notification Template
106244
+ * * SQL Data Type: uniqueidentifier
106245
+ * * Related Entity/Foreign Key: MJ: Templates (vwTemplates.ID)
106246
+ * * Description: Optional MJ Template used to render routine notifications from the runs output data (result summary, status, target info) via the standard MJ templating architecture. When NULL, the system default routine-notification template (seeded via metadata, resolvable per instance — not hardcoded) is used.
106247
+ */
106248
+ get NotificationTemplateID() {
106249
+ return this.Get('NotificationTemplateID');
106250
+ }
106251
+ set NotificationTemplateID(value) {
106252
+ this.Set('NotificationTemplateID', value);
106253
+ }
106254
+ /**
106255
+ * * Field Name: Timezone
106256
+ * * Display Name: Timezone
106257
+ * * SQL Data Type: nvarchar(100)
106258
+ * * Default Value: UTC
106259
+ * * Description: IANA timezone used when evaluating CronExpression (e.g. America/Chicago).
106260
+ */
106261
+ get Timezone() {
106262
+ return this.Get('Timezone');
106263
+ }
106264
+ set Timezone(value) {
106265
+ this.Set('Timezone', value);
106266
+ }
106267
+ /**
106268
+ * * Field Name: NextRunAt
106269
+ * * Display Name: Next Run At
106270
+ * * SQL Data Type: datetimeoffset
106271
+ * * Description: Next scheduled run time, computed after each run.
106272
+ */
106273
+ get NextRunAt() {
106274
+ return this.Get('NextRunAt');
106275
+ }
106276
+ set NextRunAt(value) {
106277
+ this.Set('NextRunAt', value);
106278
+ }
106279
+ /**
106280
+ * * Field Name: LastRunAt
106281
+ * * Display Name: Last Run At
106282
+ * * SQL Data Type: datetimeoffset
106283
+ * * Description: Timestamp of the most recent run.
106284
+ */
106285
+ get LastRunAt() {
106286
+ return this.Get('LastRunAt');
106287
+ }
106288
+ set LastRunAt(value) {
106289
+ this.Set('LastRunAt', value);
106290
+ }
106291
+ /**
106292
+ * * Field Name: LastRunStatus
106293
+ * * Display Name: Last Run Status
106294
+ * * SQL Data Type: nvarchar(20)
106295
+ * * Value List Type: List
106296
+ * * Possible Values
106297
+ * * Failed
106298
+ * * Running
106299
+ * * Skipped
106300
+ * * Success
106301
+ * * Description: Outcome of the most recent run.
106302
+ */
106303
+ get LastRunStatus() {
106304
+ return this.Get('LastRunStatus');
106305
+ }
106306
+ set LastRunStatus(value) {
106307
+ this.Set('LastRunStatus', value);
106308
+ }
106309
+ /**
106310
+ * * Field Name: LastResultHash
106311
+ * * Display Name: Last Result Hash
106312
+ * * SQL Data Type: nvarchar(100)
106313
+ * * Description: Hash of the most recent result, used by Monitoring routines to detect change for OnChange notifications.
106314
+ */
106315
+ get LastResultHash() {
106316
+ return this.Get('LastResultHash');
106317
+ }
106318
+ set LastResultHash(value) {
106319
+ this.Set('LastResultHash', value);
106320
+ }
106321
+ /**
106322
+ * * Field Name: NotifyCondition
106323
+ * * Display Name: Notify Condition
106324
+ * * SQL Data Type: nvarchar(20)
106325
+ * * Default Value: Always
106326
+ * * Value List Type: List
106327
+ * * Possible Values
106328
+ * * Always
106329
+ * * OnChange
106330
+ * * OnFailure
106331
+ * * OnSuccess
106332
+ * * Description: When to notify: Always, OnSuccess, OnFailure, or OnChange (result differs from prior run).
106333
+ */
106334
+ get NotifyCondition() {
106335
+ return this.Get('NotifyCondition');
106336
+ }
106337
+ set NotifyCondition(value) {
106338
+ this.Set('NotifyCondition', value);
106339
+ }
106340
+ /**
106341
+ * * Field Name: NotifyViaInApp
106342
+ * * Display Name: Notify Via In-App
106343
+ * * SQL Data Type: bit
106344
+ * * Default Value: 1
106345
+ * * Description: Deliver notifications via in-app notification.
106346
+ */
106347
+ get NotifyViaInApp() {
106348
+ return this.Get('NotifyViaInApp');
106349
+ }
106350
+ set NotifyViaInApp(value) {
106351
+ this.Set('NotifyViaInApp', value);
106352
+ }
106353
+ /**
106354
+ * * Field Name: NotifyViaEmail
106355
+ * * Display Name: Notify Via Email
106356
+ * * SQL Data Type: bit
106357
+ * * Default Value: 0
106358
+ * * Description: Deliver notifications via email.
106359
+ */
106360
+ get NotifyViaEmail() {
106361
+ return this.Get('NotifyViaEmail');
106362
+ }
106363
+ set NotifyViaEmail(value) {
106364
+ this.Set('NotifyViaEmail', value);
106365
+ }
106366
+ /**
106367
+ * * Field Name: __mj_CreatedAt
106368
+ * * Display Name: Created At
106369
+ * * SQL Data Type: datetimeoffset
106370
+ * * Default Value: getutcdate()
106371
+ */
106372
+ get __mj_CreatedAt() {
106373
+ return this.Get('__mj_CreatedAt');
106374
+ }
106375
+ /**
106376
+ * * Field Name: __mj_UpdatedAt
106377
+ * * Display Name: Updated At
106378
+ * * SQL Data Type: datetimeoffset
106379
+ * * Default Value: getutcdate()
106380
+ */
106381
+ get __mj_UpdatedAt() {
106382
+ return this.Get('__mj_UpdatedAt');
106383
+ }
106384
+ /**
106385
+ * * Field Name: ConversationID
106386
+ * * Display Name: Conversation
106387
+ * * SQL Data Type: uniqueidentifier
106388
+ * * Related Entity/Foreign Key: MJ: Conversations (vwConversations.ID)
106389
+ * * Description: The dedicated conversation this routine's Agent runs append to (created on first conversation-mode run, Application-scoped so it stays out of the default chat list). NULL when the routine has never run in conversation mode.
106390
+ */
106391
+ get ConversationID() {
106392
+ return this.Get('ConversationID');
106393
+ }
106394
+ set ConversationID(value) {
106395
+ this.Set('ConversationID', value);
106396
+ }
106397
+ /**
106398
+ * * Field Name: User
106399
+ * * Display Name: User Name
106400
+ * * SQL Data Type: nvarchar(100)
106401
+ */
106402
+ get User() {
106403
+ return this.Get('User');
106404
+ }
106405
+ /**
106406
+ * * Field Name: Environment
106407
+ * * Display Name: Environment Name
106408
+ * * SQL Data Type: nvarchar(255)
106409
+ */
106410
+ get Environment() {
106411
+ return this.Get('Environment');
106412
+ }
106413
+ /**
106414
+ * * Field Name: NotificationTemplate
106415
+ * * Display Name: Notification Template Name
106416
+ * * SQL Data Type: nvarchar(255)
106417
+ */
106418
+ get NotificationTemplate() {
106419
+ return this.Get('NotificationTemplate');
106420
+ }
106421
+ /**
106422
+ * * Field Name: Conversation
106423
+ * * Display Name: Conversation Name
106424
+ * * SQL Data Type: nvarchar(255)
106425
+ */
106426
+ get Conversation() {
106427
+ return this.Get('Conversation');
106428
+ }
106429
+ };
106430
+ MJUserRoutineEntity = __decorate([
106431
+ RegisterClass(BaseEntity, 'MJ: User Routines')
106432
+ ], MJUserRoutineEntity);
106433
+ export { MJUserRoutineEntity };
103804
106434
  /**
103805
106435
  * MJ: User Settings - strongly typed entity sub-class
103806
106436
  * * Schema: __mj