@memberjunction/server 5.11.0 → 5.12.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.
Files changed (40) hide show
  1. package/dist/agents/skip-sdk.d.ts.map +1 -1
  2. package/dist/agents/skip-sdk.js +1 -0
  3. package/dist/agents/skip-sdk.js.map +1 -1
  4. package/dist/generated/generated.d.ts +163 -0
  5. package/dist/generated/generated.d.ts.map +1 -1
  6. package/dist/generated/generated.js +897 -0
  7. package/dist/generated/generated.js.map +1 -1
  8. package/dist/generic/ResolverBase.js +3 -3
  9. package/dist/generic/ResolverBase.js.map +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +29 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/resolvers/AdhocQueryResolver.d.ts.map +1 -1
  14. package/dist/resolvers/AdhocQueryResolver.js +8 -0
  15. package/dist/resolvers/AdhocQueryResolver.js.map +1 -1
  16. package/dist/resolvers/CreateQueryResolver.d.ts +2 -0
  17. package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
  18. package/dist/resolvers/CreateQueryResolver.js +11 -0
  19. package/dist/resolvers/CreateQueryResolver.js.map +1 -1
  20. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  21. package/dist/resolvers/GetDataResolver.js +16 -2
  22. package/dist/resolvers/GetDataResolver.js.map +1 -1
  23. package/dist/resolvers/QueryResolver.d.ts +2 -0
  24. package/dist/resolvers/QueryResolver.d.ts.map +1 -1
  25. package/dist/resolvers/QueryResolver.js +20 -0
  26. package/dist/resolvers/QueryResolver.js.map +1 -1
  27. package/dist/resolvers/RunAIAgentResolver.d.ts +24 -0
  28. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  29. package/dist/resolvers/RunAIAgentResolver.js +264 -1
  30. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  31. package/package.json +59 -59
  32. package/src/agents/skip-sdk.ts +1 -0
  33. package/src/generated/generated.ts +623 -1
  34. package/src/generic/ResolverBase.ts +3 -3
  35. package/src/index.ts +31 -2
  36. package/src/resolvers/AdhocQueryResolver.ts +8 -0
  37. package/src/resolvers/CreateQueryResolver.ts +9 -0
  38. package/src/resolvers/GetDataResolver.ts +18 -2
  39. package/src/resolvers/QueryResolver.ts +18 -0
  40. package/src/resolvers/RunAIAgentResolver.ts +301 -2
@@ -2915,6 +2915,10 @@ __decorate([
2915
2915
  MaxLength(36),
2916
2916
  __metadata("design:type", String)
2917
2917
  ], MJAction_.prototype, "DefaultCompactPromptID", void 0);
2918
+ __decorate([
2919
+ Field({ nullable: true, description: `Optional JSON configuration for the action. For integration actions, contains routing info: integrationName, objectName, verb, and optional connectorConfig. Non-integration actions leave this NULL.` }),
2920
+ __metadata("design:type", String)
2921
+ ], MJAction_.prototype, "Config", void 0);
2918
2922
  __decorate([
2919
2923
  Field({ nullable: true }),
2920
2924
  MaxLength(255),
@@ -3081,6 +3085,10 @@ __decorate([
3081
3085
  Field({ nullable: true }),
3082
3086
  __metadata("design:type", String)
3083
3087
  ], CreateMJActionInput.prototype, "DefaultCompactPromptID", void 0);
3088
+ __decorate([
3089
+ Field({ nullable: true }),
3090
+ __metadata("design:type", String)
3091
+ ], CreateMJActionInput.prototype, "Config", void 0);
3084
3092
  CreateMJActionInput = __decorate([
3085
3093
  InputType()
3086
3094
  ], CreateMJActionInput);
@@ -3174,6 +3182,10 @@ __decorate([
3174
3182
  Field({ nullable: true }),
3175
3183
  __metadata("design:type", String)
3176
3184
  ], UpdateMJActionInput.prototype, "DefaultCompactPromptID", void 0);
3185
+ __decorate([
3186
+ Field({ nullable: true }),
3187
+ __metadata("design:type", String)
3188
+ ], UpdateMJActionInput.prototype, "Config", void 0);
3177
3189
  __decorate([
3178
3190
  Field(() => [KeyValuePairInput], { nullable: true }),
3179
3191
  __metadata("design:type", Array)
@@ -4421,6 +4433,314 @@ MJAIAgentArtifactTypeResolver = __decorate([
4421
4433
  ], MJAIAgentArtifactTypeResolver);
4422
4434
  export { MJAIAgentArtifactTypeResolver };
4423
4435
  //****************************************************************************
4436
+ // ENTITY CLASS for MJ: AI Agent Categories
4437
+ //****************************************************************************
4438
+ let MJAIAgentCategory_ = class MJAIAgentCategory_ {
4439
+ };
4440
+ __decorate([
4441
+ Field({ description: `Primary key for the AIAgentCategory record.` }),
4442
+ MaxLength(36),
4443
+ __metadata("design:type", String)
4444
+ ], MJAIAgentCategory_.prototype, "ID", void 0);
4445
+ __decorate([
4446
+ Field({ description: `Unique display name for the category (e.g., Research, Customer Support, Data Processing).` }),
4447
+ MaxLength(200),
4448
+ __metadata("design:type", String)
4449
+ ], MJAIAgentCategory_.prototype, "Name", void 0);
4450
+ __decorate([
4451
+ Field({ nullable: true, description: `Optional description explaining the purpose and scope of this category.` }),
4452
+ __metadata("design:type", String)
4453
+ ], MJAIAgentCategory_.prototype, "Description", void 0);
4454
+ __decorate([
4455
+ Field({ nullable: true, description: `Self-referencing foreign key to the parent category, forming a tree hierarchy. NULL for root categories.` }),
4456
+ MaxLength(36),
4457
+ __metadata("design:type", String)
4458
+ ], MJAIAgentCategory_.prototype, "ParentID", void 0);
4459
+ __decorate([
4460
+ Field({ nullable: true, description: `JSON-serialized AgentRequestAssignmentStrategy defining who receives feedback requests for agents in this category. Inherited by child categories that do not define their own strategy.` }),
4461
+ __metadata("design:type", String)
4462
+ ], MJAIAgentCategory_.prototype, "AssignmentStrategy", void 0);
4463
+ __decorate([
4464
+ Field({ description: `Whether this category is Active, Disabled, or Pending.` }),
4465
+ MaxLength(20),
4466
+ __metadata("design:type", String)
4467
+ ], MJAIAgentCategory_.prototype, "Status", void 0);
4468
+ __decorate([
4469
+ Field(),
4470
+ __metadata("design:type", Date)
4471
+ ], MJAIAgentCategory_.prototype, "_mj__CreatedAt", void 0);
4472
+ __decorate([
4473
+ Field(),
4474
+ __metadata("design:type", Date)
4475
+ ], MJAIAgentCategory_.prototype, "_mj__UpdatedAt", void 0);
4476
+ __decorate([
4477
+ Field({ nullable: true }),
4478
+ MaxLength(200),
4479
+ __metadata("design:type", String)
4480
+ ], MJAIAgentCategory_.prototype, "Parent", void 0);
4481
+ __decorate([
4482
+ Field({ nullable: true }),
4483
+ MaxLength(36),
4484
+ __metadata("design:type", String)
4485
+ ], MJAIAgentCategory_.prototype, "RootParentID", void 0);
4486
+ __decorate([
4487
+ Field(() => [MJAIAgentCategory_]),
4488
+ __metadata("design:type", Array)
4489
+ ], MJAIAgentCategory_.prototype, "MJAIAgentCategories_ParentIDArray", void 0);
4490
+ __decorate([
4491
+ Field(() => [MJAIAgent_]),
4492
+ __metadata("design:type", Array)
4493
+ ], MJAIAgentCategory_.prototype, "MJAIAgents_CategoryIDArray", void 0);
4494
+ MJAIAgentCategory_ = __decorate([
4495
+ ObjectType({ description: `Hierarchical organizational grouping for AI agents. Categories form a tree via the ParentID self-referencing foreign key and can carry inherited assignment strategies.` })
4496
+ ], MJAIAgentCategory_);
4497
+ export { MJAIAgentCategory_ };
4498
+ //****************************************************************************
4499
+ // INPUT TYPE for MJ: AI Agent Categories
4500
+ //****************************************************************************
4501
+ let CreateMJAIAgentCategoryInput = class CreateMJAIAgentCategoryInput {
4502
+ };
4503
+ __decorate([
4504
+ Field({ nullable: true }),
4505
+ __metadata("design:type", String)
4506
+ ], CreateMJAIAgentCategoryInput.prototype, "ID", void 0);
4507
+ __decorate([
4508
+ Field({ nullable: true }),
4509
+ __metadata("design:type", String)
4510
+ ], CreateMJAIAgentCategoryInput.prototype, "Name", void 0);
4511
+ __decorate([
4512
+ Field({ nullable: true }),
4513
+ __metadata("design:type", String)
4514
+ ], CreateMJAIAgentCategoryInput.prototype, "Description", void 0);
4515
+ __decorate([
4516
+ Field({ nullable: true }),
4517
+ __metadata("design:type", String)
4518
+ ], CreateMJAIAgentCategoryInput.prototype, "ParentID", void 0);
4519
+ __decorate([
4520
+ Field({ nullable: true }),
4521
+ __metadata("design:type", String)
4522
+ ], CreateMJAIAgentCategoryInput.prototype, "AssignmentStrategy", void 0);
4523
+ __decorate([
4524
+ Field({ nullable: true }),
4525
+ __metadata("design:type", String)
4526
+ ], CreateMJAIAgentCategoryInput.prototype, "Status", void 0);
4527
+ CreateMJAIAgentCategoryInput = __decorate([
4528
+ InputType()
4529
+ ], CreateMJAIAgentCategoryInput);
4530
+ export { CreateMJAIAgentCategoryInput };
4531
+ //****************************************************************************
4532
+ // INPUT TYPE for MJ: AI Agent Categories
4533
+ //****************************************************************************
4534
+ let UpdateMJAIAgentCategoryInput = class UpdateMJAIAgentCategoryInput {
4535
+ };
4536
+ __decorate([
4537
+ Field(),
4538
+ __metadata("design:type", String)
4539
+ ], UpdateMJAIAgentCategoryInput.prototype, "ID", void 0);
4540
+ __decorate([
4541
+ Field({ nullable: true }),
4542
+ __metadata("design:type", String)
4543
+ ], UpdateMJAIAgentCategoryInput.prototype, "Name", void 0);
4544
+ __decorate([
4545
+ Field({ nullable: true }),
4546
+ __metadata("design:type", String)
4547
+ ], UpdateMJAIAgentCategoryInput.prototype, "Description", void 0);
4548
+ __decorate([
4549
+ Field({ nullable: true }),
4550
+ __metadata("design:type", String)
4551
+ ], UpdateMJAIAgentCategoryInput.prototype, "ParentID", void 0);
4552
+ __decorate([
4553
+ Field({ nullable: true }),
4554
+ __metadata("design:type", String)
4555
+ ], UpdateMJAIAgentCategoryInput.prototype, "AssignmentStrategy", void 0);
4556
+ __decorate([
4557
+ Field({ nullable: true }),
4558
+ __metadata("design:type", String)
4559
+ ], UpdateMJAIAgentCategoryInput.prototype, "Status", void 0);
4560
+ __decorate([
4561
+ Field(() => [KeyValuePairInput], { nullable: true }),
4562
+ __metadata("design:type", Array)
4563
+ ], UpdateMJAIAgentCategoryInput.prototype, "OldValues___", void 0);
4564
+ UpdateMJAIAgentCategoryInput = __decorate([
4565
+ InputType()
4566
+ ], UpdateMJAIAgentCategoryInput);
4567
+ export { UpdateMJAIAgentCategoryInput };
4568
+ //****************************************************************************
4569
+ // RESOLVER for MJ: AI Agent Categories
4570
+ //****************************************************************************
4571
+ let RunMJAIAgentCategoryViewResult = class RunMJAIAgentCategoryViewResult {
4572
+ };
4573
+ __decorate([
4574
+ Field(() => [MJAIAgentCategory_]),
4575
+ __metadata("design:type", Array)
4576
+ ], RunMJAIAgentCategoryViewResult.prototype, "Results", void 0);
4577
+ __decorate([
4578
+ Field(() => String, { nullable: true }),
4579
+ __metadata("design:type", String)
4580
+ ], RunMJAIAgentCategoryViewResult.prototype, "UserViewRunID", void 0);
4581
+ __decorate([
4582
+ Field(() => Int, { nullable: true }),
4583
+ __metadata("design:type", Number)
4584
+ ], RunMJAIAgentCategoryViewResult.prototype, "RowCount", void 0);
4585
+ __decorate([
4586
+ Field(() => Int, { nullable: true }),
4587
+ __metadata("design:type", Number)
4588
+ ], RunMJAIAgentCategoryViewResult.prototype, "TotalRowCount", void 0);
4589
+ __decorate([
4590
+ Field(() => Int, { nullable: true }),
4591
+ __metadata("design:type", Number)
4592
+ ], RunMJAIAgentCategoryViewResult.prototype, "ExecutionTime", void 0);
4593
+ __decorate([
4594
+ Field({ nullable: true }),
4595
+ __metadata("design:type", String)
4596
+ ], RunMJAIAgentCategoryViewResult.prototype, "ErrorMessage", void 0);
4597
+ __decorate([
4598
+ Field(() => Boolean, { nullable: false }),
4599
+ __metadata("design:type", Boolean)
4600
+ ], RunMJAIAgentCategoryViewResult.prototype, "Success", void 0);
4601
+ RunMJAIAgentCategoryViewResult = __decorate([
4602
+ ObjectType()
4603
+ ], RunMJAIAgentCategoryViewResult);
4604
+ export { RunMJAIAgentCategoryViewResult };
4605
+ let MJAIAgentCategoryResolver = class MJAIAgentCategoryResolver extends ResolverBase {
4606
+ async RunMJAIAgentCategoryViewByID(input, { providers, userPayload }, pubSub) {
4607
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4608
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
4609
+ }
4610
+ async RunMJAIAgentCategoryViewByName(input, { providers, userPayload }, pubSub) {
4611
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4612
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
4613
+ }
4614
+ async RunMJAIAgentCategoryDynamicView(input, { providers, userPayload }, pubSub) {
4615
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4616
+ input.EntityName = 'MJ: AI Agent Categories';
4617
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
4618
+ }
4619
+ async MJAIAgentCategory(ID, { userPayload, providers }, pubSub) {
4620
+ this.CheckUserReadPermissions('MJ: AI Agent Categories', userPayload);
4621
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4622
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCategories')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Categories', userPayload, EntityPermissionType.Read, 'AND');
4623
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
4624
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Agent Categories', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
4625
+ return result;
4626
+ }
4627
+ async MJAIAgentCategories_ParentIDArray(mjaiagentcategory_, { userPayload, providers }, pubSub) {
4628
+ this.CheckUserReadPermissions('MJ: AI Agent Categories', userPayload);
4629
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4630
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCategories')} WHERE ${provider.QuoteIdentifier('ParentID')}='${mjaiagentcategory_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Categories', userPayload, EntityPermissionType.Read, 'AND');
4631
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
4632
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Categories', rows, this.GetUserFromPayload(userPayload));
4633
+ return result;
4634
+ }
4635
+ async MJAIAgents_CategoryIDArray(mjaiagentcategory_, { userPayload, providers }, pubSub) {
4636
+ this.CheckUserReadPermissions('MJ: AI Agents', userPayload);
4637
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4638
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgents')} WHERE ${provider.QuoteIdentifier('CategoryID')}='${mjaiagentcategory_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agents', userPayload, EntityPermissionType.Read, 'AND');
4639
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
4640
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agents', rows, this.GetUserFromPayload(userPayload));
4641
+ return result;
4642
+ }
4643
+ async CreateMJAIAgentCategory(input, { providers, userPayload }, pubSub) {
4644
+ const provider = GetReadWriteProvider(providers);
4645
+ return this.CreateRecord('MJ: AI Agent Categories', input, provider, userPayload, pubSub);
4646
+ }
4647
+ async UpdateMJAIAgentCategory(input, { providers, userPayload }, pubSub) {
4648
+ const provider = GetReadWriteProvider(providers);
4649
+ return this.UpdateRecord('MJ: AI Agent Categories', input, provider, userPayload, pubSub);
4650
+ }
4651
+ async DeleteMJAIAgentCategory(ID, options, { providers, userPayload }, pubSub) {
4652
+ const provider = GetReadWriteProvider(providers);
4653
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
4654
+ return this.DeleteRecord('MJ: AI Agent Categories', key, options, provider, userPayload, pubSub);
4655
+ }
4656
+ };
4657
+ __decorate([
4658
+ Query(() => RunMJAIAgentCategoryViewResult),
4659
+ __param(0, Arg('input', () => RunViewByIDInput)),
4660
+ __param(1, Ctx()),
4661
+ __param(2, PubSub()),
4662
+ __metadata("design:type", Function),
4663
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
4664
+ __metadata("design:returntype", Promise)
4665
+ ], MJAIAgentCategoryResolver.prototype, "RunMJAIAgentCategoryViewByID", null);
4666
+ __decorate([
4667
+ Query(() => RunMJAIAgentCategoryViewResult),
4668
+ __param(0, Arg('input', () => RunViewByNameInput)),
4669
+ __param(1, Ctx()),
4670
+ __param(2, PubSub()),
4671
+ __metadata("design:type", Function),
4672
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
4673
+ __metadata("design:returntype", Promise)
4674
+ ], MJAIAgentCategoryResolver.prototype, "RunMJAIAgentCategoryViewByName", null);
4675
+ __decorate([
4676
+ Query(() => RunMJAIAgentCategoryViewResult),
4677
+ __param(0, Arg('input', () => RunDynamicViewInput)),
4678
+ __param(1, Ctx()),
4679
+ __param(2, PubSub()),
4680
+ __metadata("design:type", Function),
4681
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
4682
+ __metadata("design:returntype", Promise)
4683
+ ], MJAIAgentCategoryResolver.prototype, "RunMJAIAgentCategoryDynamicView", null);
4684
+ __decorate([
4685
+ Query(() => MJAIAgentCategory_, { nullable: true }),
4686
+ __param(0, Arg('ID', () => String)),
4687
+ __param(1, Ctx()),
4688
+ __param(2, PubSub()),
4689
+ __metadata("design:type", Function),
4690
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
4691
+ __metadata("design:returntype", Promise)
4692
+ ], MJAIAgentCategoryResolver.prototype, "MJAIAgentCategory", null);
4693
+ __decorate([
4694
+ FieldResolver(() => [MJAIAgentCategory_]),
4695
+ __param(0, Root()),
4696
+ __param(1, Ctx()),
4697
+ __param(2, PubSub()),
4698
+ __metadata("design:type", Function),
4699
+ __metadata("design:paramtypes", [MJAIAgentCategory_, Object, PubSubEngine]),
4700
+ __metadata("design:returntype", Promise)
4701
+ ], MJAIAgentCategoryResolver.prototype, "MJAIAgentCategories_ParentIDArray", null);
4702
+ __decorate([
4703
+ FieldResolver(() => [MJAIAgent_]),
4704
+ __param(0, Root()),
4705
+ __param(1, Ctx()),
4706
+ __param(2, PubSub()),
4707
+ __metadata("design:type", Function),
4708
+ __metadata("design:paramtypes", [MJAIAgentCategory_, Object, PubSubEngine]),
4709
+ __metadata("design:returntype", Promise)
4710
+ ], MJAIAgentCategoryResolver.prototype, "MJAIAgents_CategoryIDArray", null);
4711
+ __decorate([
4712
+ Mutation(() => MJAIAgentCategory_),
4713
+ __param(0, Arg('input', () => CreateMJAIAgentCategoryInput)),
4714
+ __param(1, Ctx()),
4715
+ __param(2, PubSub()),
4716
+ __metadata("design:type", Function),
4717
+ __metadata("design:paramtypes", [CreateMJAIAgentCategoryInput, Object, PubSubEngine]),
4718
+ __metadata("design:returntype", Promise)
4719
+ ], MJAIAgentCategoryResolver.prototype, "CreateMJAIAgentCategory", null);
4720
+ __decorate([
4721
+ Mutation(() => MJAIAgentCategory_),
4722
+ __param(0, Arg('input', () => UpdateMJAIAgentCategoryInput)),
4723
+ __param(1, Ctx()),
4724
+ __param(2, PubSub()),
4725
+ __metadata("design:type", Function),
4726
+ __metadata("design:paramtypes", [UpdateMJAIAgentCategoryInput, Object, PubSubEngine]),
4727
+ __metadata("design:returntype", Promise)
4728
+ ], MJAIAgentCategoryResolver.prototype, "UpdateMJAIAgentCategory", null);
4729
+ __decorate([
4730
+ Mutation(() => MJAIAgentCategory_),
4731
+ __param(0, Arg('ID', () => String)),
4732
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
4733
+ __param(2, Ctx()),
4734
+ __param(3, PubSub()),
4735
+ __metadata("design:type", Function),
4736
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
4737
+ __metadata("design:returntype", Promise)
4738
+ ], MJAIAgentCategoryResolver.prototype, "DeleteMJAIAgentCategory", null);
4739
+ MJAIAgentCategoryResolver = __decorate([
4740
+ Resolver(MJAIAgentCategory_)
4741
+ ], MJAIAgentCategoryResolver);
4742
+ export { MJAIAgentCategoryResolver };
4743
+ //****************************************************************************
4424
4744
  // ENTITY CLASS for MJ: AI Agent Configurations
4425
4745
  //****************************************************************************
4426
4746
  let MJAIAgentConfiguration_ = class MJAIAgentConfiguration_ {
@@ -8121,6 +8441,306 @@ MJAIAgentRelationshipResolver = __decorate([
8121
8441
  ], MJAIAgentRelationshipResolver);
8122
8442
  export { MJAIAgentRelationshipResolver };
8123
8443
  //****************************************************************************
8444
+ // ENTITY CLASS for MJ: AI Agent Request Types
8445
+ //****************************************************************************
8446
+ let MJAIAgentRequestType_ = class MJAIAgentRequestType_ {
8447
+ };
8448
+ __decorate([
8449
+ Field({ description: `Primary key for the AIAgentRequestType record.` }),
8450
+ MaxLength(36),
8451
+ __metadata("design:type", String)
8452
+ ], MJAIAgentRequestType_.prototype, "ID", void 0);
8453
+ __decorate([
8454
+ Field({ description: `Unique display name for the request type (e.g., Approval, Information, Choice).` }),
8455
+ MaxLength(100),
8456
+ __metadata("design:type", String)
8457
+ ], MJAIAgentRequestType_.prototype, "Name", void 0);
8458
+ __decorate([
8459
+ Field({ nullable: true, description: `Explains when and how this request type should be used by agents.` }),
8460
+ __metadata("design:type", String)
8461
+ ], MJAIAgentRequestType_.prototype, "Description", void 0);
8462
+ __decorate([
8463
+ Field({ nullable: true, description: `Font Awesome icon class for UI rendering of this request type.` }),
8464
+ MaxLength(100),
8465
+ __metadata("design:type", String)
8466
+ ], MJAIAgentRequestType_.prototype, "Icon", void 0);
8467
+ __decorate([
8468
+ Field(),
8469
+ __metadata("design:type", Date)
8470
+ ], MJAIAgentRequestType_.prototype, "_mj__CreatedAt", void 0);
8471
+ __decorate([
8472
+ Field(),
8473
+ __metadata("design:type", Date)
8474
+ ], MJAIAgentRequestType_.prototype, "_mj__UpdatedAt", void 0);
8475
+ __decorate([
8476
+ Field({ nullable: true, description: `JSON-serialized AgentRequestAssignmentStrategy defining the default assignment strategy for requests of this type. Used as the lowest-priority fallback in the resolution chain.` }),
8477
+ __metadata("design:type", String)
8478
+ ], MJAIAgentRequestType_.prototype, "DefaultAssignmentStrategy", void 0);
8479
+ __decorate([
8480
+ Field(() => Int, { nullable: true, description: `Default priority (1-100) for requests of this type when no explicit priority is provided. NULL means use the system default of 50.` }),
8481
+ __metadata("design:type", Number)
8482
+ ], MJAIAgentRequestType_.prototype, "DefaultPriority", void 0);
8483
+ __decorate([
8484
+ Field(() => Int, { nullable: true, description: `Default expiration time in minutes for requests of this type. NULL means requests do not expire by default.` }),
8485
+ __metadata("design:type", Number)
8486
+ ], MJAIAgentRequestType_.prototype, "DefaultExpirationMinutes", void 0);
8487
+ __decorate([
8488
+ Field(() => Boolean, { description: `Whether requests of this type require a structured response from the human before the agent can resume. When 0, the agent may proceed with just an acknowledgment.` }),
8489
+ __metadata("design:type", Boolean)
8490
+ ], MJAIAgentRequestType_.prototype, "RequiresResponse", void 0);
8491
+ __decorate([
8492
+ Field(() => [MJAIAgentRequest_]),
8493
+ __metadata("design:type", Array)
8494
+ ], MJAIAgentRequestType_.prototype, "MJAIAgentRequests_RequestTypeIDArray", void 0);
8495
+ MJAIAgentRequestType_ = __decorate([
8496
+ ObjectType({ description: `Lookup table categorizing the types of requests an agent can make to a human (e.g., Approval, Information, Choice, Review, Custom).` })
8497
+ ], MJAIAgentRequestType_);
8498
+ export { MJAIAgentRequestType_ };
8499
+ //****************************************************************************
8500
+ // INPUT TYPE for MJ: AI Agent Request Types
8501
+ //****************************************************************************
8502
+ let CreateMJAIAgentRequestTypeInput = class CreateMJAIAgentRequestTypeInput {
8503
+ };
8504
+ __decorate([
8505
+ Field({ nullable: true }),
8506
+ __metadata("design:type", String)
8507
+ ], CreateMJAIAgentRequestTypeInput.prototype, "ID", void 0);
8508
+ __decorate([
8509
+ Field({ nullable: true }),
8510
+ __metadata("design:type", String)
8511
+ ], CreateMJAIAgentRequestTypeInput.prototype, "Name", void 0);
8512
+ __decorate([
8513
+ Field({ nullable: true }),
8514
+ __metadata("design:type", String)
8515
+ ], CreateMJAIAgentRequestTypeInput.prototype, "Description", void 0);
8516
+ __decorate([
8517
+ Field({ nullable: true }),
8518
+ __metadata("design:type", String)
8519
+ ], CreateMJAIAgentRequestTypeInput.prototype, "Icon", void 0);
8520
+ __decorate([
8521
+ Field({ nullable: true }),
8522
+ __metadata("design:type", String)
8523
+ ], CreateMJAIAgentRequestTypeInput.prototype, "DefaultAssignmentStrategy", void 0);
8524
+ __decorate([
8525
+ Field(() => Int, { nullable: true }),
8526
+ __metadata("design:type", Number)
8527
+ ], CreateMJAIAgentRequestTypeInput.prototype, "DefaultPriority", void 0);
8528
+ __decorate([
8529
+ Field(() => Int, { nullable: true }),
8530
+ __metadata("design:type", Number)
8531
+ ], CreateMJAIAgentRequestTypeInput.prototype, "DefaultExpirationMinutes", void 0);
8532
+ __decorate([
8533
+ Field(() => Boolean, { nullable: true }),
8534
+ __metadata("design:type", Boolean)
8535
+ ], CreateMJAIAgentRequestTypeInput.prototype, "RequiresResponse", void 0);
8536
+ CreateMJAIAgentRequestTypeInput = __decorate([
8537
+ InputType()
8538
+ ], CreateMJAIAgentRequestTypeInput);
8539
+ export { CreateMJAIAgentRequestTypeInput };
8540
+ //****************************************************************************
8541
+ // INPUT TYPE for MJ: AI Agent Request Types
8542
+ //****************************************************************************
8543
+ let UpdateMJAIAgentRequestTypeInput = class UpdateMJAIAgentRequestTypeInput {
8544
+ };
8545
+ __decorate([
8546
+ Field(),
8547
+ __metadata("design:type", String)
8548
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "ID", void 0);
8549
+ __decorate([
8550
+ Field({ nullable: true }),
8551
+ __metadata("design:type", String)
8552
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "Name", void 0);
8553
+ __decorate([
8554
+ Field({ nullable: true }),
8555
+ __metadata("design:type", String)
8556
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "Description", void 0);
8557
+ __decorate([
8558
+ Field({ nullable: true }),
8559
+ __metadata("design:type", String)
8560
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "Icon", void 0);
8561
+ __decorate([
8562
+ Field({ nullable: true }),
8563
+ __metadata("design:type", String)
8564
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "DefaultAssignmentStrategy", void 0);
8565
+ __decorate([
8566
+ Field(() => Int, { nullable: true }),
8567
+ __metadata("design:type", Number)
8568
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "DefaultPriority", void 0);
8569
+ __decorate([
8570
+ Field(() => Int, { nullable: true }),
8571
+ __metadata("design:type", Number)
8572
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "DefaultExpirationMinutes", void 0);
8573
+ __decorate([
8574
+ Field(() => Boolean, { nullable: true }),
8575
+ __metadata("design:type", Boolean)
8576
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "RequiresResponse", void 0);
8577
+ __decorate([
8578
+ Field(() => [KeyValuePairInput], { nullable: true }),
8579
+ __metadata("design:type", Array)
8580
+ ], UpdateMJAIAgentRequestTypeInput.prototype, "OldValues___", void 0);
8581
+ UpdateMJAIAgentRequestTypeInput = __decorate([
8582
+ InputType()
8583
+ ], UpdateMJAIAgentRequestTypeInput);
8584
+ export { UpdateMJAIAgentRequestTypeInput };
8585
+ //****************************************************************************
8586
+ // RESOLVER for MJ: AI Agent Request Types
8587
+ //****************************************************************************
8588
+ let RunMJAIAgentRequestTypeViewResult = class RunMJAIAgentRequestTypeViewResult {
8589
+ };
8590
+ __decorate([
8591
+ Field(() => [MJAIAgentRequestType_]),
8592
+ __metadata("design:type", Array)
8593
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "Results", void 0);
8594
+ __decorate([
8595
+ Field(() => String, { nullable: true }),
8596
+ __metadata("design:type", String)
8597
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "UserViewRunID", void 0);
8598
+ __decorate([
8599
+ Field(() => Int, { nullable: true }),
8600
+ __metadata("design:type", Number)
8601
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "RowCount", void 0);
8602
+ __decorate([
8603
+ Field(() => Int, { nullable: true }),
8604
+ __metadata("design:type", Number)
8605
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "TotalRowCount", void 0);
8606
+ __decorate([
8607
+ Field(() => Int, { nullable: true }),
8608
+ __metadata("design:type", Number)
8609
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "ExecutionTime", void 0);
8610
+ __decorate([
8611
+ Field({ nullable: true }),
8612
+ __metadata("design:type", String)
8613
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "ErrorMessage", void 0);
8614
+ __decorate([
8615
+ Field(() => Boolean, { nullable: false }),
8616
+ __metadata("design:type", Boolean)
8617
+ ], RunMJAIAgentRequestTypeViewResult.prototype, "Success", void 0);
8618
+ RunMJAIAgentRequestTypeViewResult = __decorate([
8619
+ ObjectType()
8620
+ ], RunMJAIAgentRequestTypeViewResult);
8621
+ export { RunMJAIAgentRequestTypeViewResult };
8622
+ let MJAIAgentRequestTypeResolver = class MJAIAgentRequestTypeResolver extends ResolverBase {
8623
+ async RunMJAIAgentRequestTypeViewByID(input, { providers, userPayload }, pubSub) {
8624
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8625
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
8626
+ }
8627
+ async RunMJAIAgentRequestTypeViewByName(input, { providers, userPayload }, pubSub) {
8628
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8629
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
8630
+ }
8631
+ async RunMJAIAgentRequestTypeDynamicView(input, { providers, userPayload }, pubSub) {
8632
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8633
+ input.EntityName = 'MJ: AI Agent Request Types';
8634
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
8635
+ }
8636
+ async MJAIAgentRequestType(ID, { userPayload, providers }, pubSub) {
8637
+ this.CheckUserReadPermissions('MJ: AI Agent Request Types', userPayload);
8638
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8639
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentRequestTypes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Request Types', userPayload, EntityPermissionType.Read, 'AND');
8640
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
8641
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Agent Request Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
8642
+ return result;
8643
+ }
8644
+ async MJAIAgentRequests_RequestTypeIDArray(mjaiagentrequesttype_, { userPayload, providers }, pubSub) {
8645
+ this.CheckUserReadPermissions('MJ: AI Agent Requests', userPayload);
8646
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8647
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentRequests')} WHERE ${provider.QuoteIdentifier('RequestTypeID')}='${mjaiagentrequesttype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
8648
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
8649
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Requests', rows, this.GetUserFromPayload(userPayload));
8650
+ return result;
8651
+ }
8652
+ async CreateMJAIAgentRequestType(input, { providers, userPayload }, pubSub) {
8653
+ const provider = GetReadWriteProvider(providers);
8654
+ return this.CreateRecord('MJ: AI Agent Request Types', input, provider, userPayload, pubSub);
8655
+ }
8656
+ async UpdateMJAIAgentRequestType(input, { providers, userPayload }, pubSub) {
8657
+ const provider = GetReadWriteProvider(providers);
8658
+ return this.UpdateRecord('MJ: AI Agent Request Types', input, provider, userPayload, pubSub);
8659
+ }
8660
+ async DeleteMJAIAgentRequestType(ID, options, { providers, userPayload }, pubSub) {
8661
+ const provider = GetReadWriteProvider(providers);
8662
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
8663
+ return this.DeleteRecord('MJ: AI Agent Request Types', key, options, provider, userPayload, pubSub);
8664
+ }
8665
+ };
8666
+ __decorate([
8667
+ Query(() => RunMJAIAgentRequestTypeViewResult),
8668
+ __param(0, Arg('input', () => RunViewByIDInput)),
8669
+ __param(1, Ctx()),
8670
+ __param(2, PubSub()),
8671
+ __metadata("design:type", Function),
8672
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
8673
+ __metadata("design:returntype", Promise)
8674
+ ], MJAIAgentRequestTypeResolver.prototype, "RunMJAIAgentRequestTypeViewByID", null);
8675
+ __decorate([
8676
+ Query(() => RunMJAIAgentRequestTypeViewResult),
8677
+ __param(0, Arg('input', () => RunViewByNameInput)),
8678
+ __param(1, Ctx()),
8679
+ __param(2, PubSub()),
8680
+ __metadata("design:type", Function),
8681
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
8682
+ __metadata("design:returntype", Promise)
8683
+ ], MJAIAgentRequestTypeResolver.prototype, "RunMJAIAgentRequestTypeViewByName", null);
8684
+ __decorate([
8685
+ Query(() => RunMJAIAgentRequestTypeViewResult),
8686
+ __param(0, Arg('input', () => RunDynamicViewInput)),
8687
+ __param(1, Ctx()),
8688
+ __param(2, PubSub()),
8689
+ __metadata("design:type", Function),
8690
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
8691
+ __metadata("design:returntype", Promise)
8692
+ ], MJAIAgentRequestTypeResolver.prototype, "RunMJAIAgentRequestTypeDynamicView", null);
8693
+ __decorate([
8694
+ Query(() => MJAIAgentRequestType_, { nullable: true }),
8695
+ __param(0, Arg('ID', () => String)),
8696
+ __param(1, Ctx()),
8697
+ __param(2, PubSub()),
8698
+ __metadata("design:type", Function),
8699
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
8700
+ __metadata("design:returntype", Promise)
8701
+ ], MJAIAgentRequestTypeResolver.prototype, "MJAIAgentRequestType", null);
8702
+ __decorate([
8703
+ FieldResolver(() => [MJAIAgentRequest_]),
8704
+ __param(0, Root()),
8705
+ __param(1, Ctx()),
8706
+ __param(2, PubSub()),
8707
+ __metadata("design:type", Function),
8708
+ __metadata("design:paramtypes", [MJAIAgentRequestType_, Object, PubSubEngine]),
8709
+ __metadata("design:returntype", Promise)
8710
+ ], MJAIAgentRequestTypeResolver.prototype, "MJAIAgentRequests_RequestTypeIDArray", null);
8711
+ __decorate([
8712
+ Mutation(() => MJAIAgentRequestType_),
8713
+ __param(0, Arg('input', () => CreateMJAIAgentRequestTypeInput)),
8714
+ __param(1, Ctx()),
8715
+ __param(2, PubSub()),
8716
+ __metadata("design:type", Function),
8717
+ __metadata("design:paramtypes", [CreateMJAIAgentRequestTypeInput, Object, PubSubEngine]),
8718
+ __metadata("design:returntype", Promise)
8719
+ ], MJAIAgentRequestTypeResolver.prototype, "CreateMJAIAgentRequestType", null);
8720
+ __decorate([
8721
+ Mutation(() => MJAIAgentRequestType_),
8722
+ __param(0, Arg('input', () => UpdateMJAIAgentRequestTypeInput)),
8723
+ __param(1, Ctx()),
8724
+ __param(2, PubSub()),
8725
+ __metadata("design:type", Function),
8726
+ __metadata("design:paramtypes", [UpdateMJAIAgentRequestTypeInput, Object, PubSubEngine]),
8727
+ __metadata("design:returntype", Promise)
8728
+ ], MJAIAgentRequestTypeResolver.prototype, "UpdateMJAIAgentRequestType", null);
8729
+ __decorate([
8730
+ Mutation(() => MJAIAgentRequestType_),
8731
+ __param(0, Arg('ID', () => String)),
8732
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
8733
+ __param(2, Ctx()),
8734
+ __param(3, PubSub()),
8735
+ __metadata("design:type", Function),
8736
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
8737
+ __metadata("design:returntype", Promise)
8738
+ ], MJAIAgentRequestTypeResolver.prototype, "DeleteMJAIAgentRequestType", null);
8739
+ MJAIAgentRequestTypeResolver = __decorate([
8740
+ Resolver(MJAIAgentRequestType_)
8741
+ ], MJAIAgentRequestTypeResolver);
8742
+ export { MJAIAgentRequestTypeResolver };
8743
+ //****************************************************************************
8124
8744
  // ENTITY CLASS for MJ: AI Agent Requests
8125
8745
  //****************************************************************************
8126
8746
  let MJAIAgentRequest_ = class MJAIAgentRequest_ {
@@ -8178,6 +8798,47 @@ __decorate([
8178
8798
  Field(),
8179
8799
  __metadata("design:type", Date)
8180
8800
  ], MJAIAgentRequest_.prototype, "_mj__UpdatedAt", void 0);
8801
+ __decorate([
8802
+ Field({ nullable: true, description: `Foreign key to AIAgentRequestType. Categorizes the purpose of this request (Approval, Information, Choice, Review, Custom).` }),
8803
+ MaxLength(36),
8804
+ __metadata("design:type", String)
8805
+ ], MJAIAgentRequest_.prototype, "RequestTypeID", void 0);
8806
+ __decorate([
8807
+ Field({ nullable: true, description: `JSON-serialized AgentResponseForm defining the structured input form the agent presents to the human. Uses the same form types as ConversationDetail.ResponseForm.` }),
8808
+ __metadata("design:type", String)
8809
+ ], MJAIAgentRequest_.prototype, "ResponseSchema", void 0);
8810
+ __decorate([
8811
+ Field({ nullable: true, description: `JSON structured response data provided by the human, conforming to the ResponseSchema definition.` }),
8812
+ __metadata("design:type", String)
8813
+ ], MJAIAgentRequest_.prototype, "ResponseData", void 0);
8814
+ __decorate([
8815
+ Field(() => Int, { description: `Urgency level of the request as an integer from 1 (lowest) to 100 (highest). Default is 50. Suggested ranges: 1-25 Low, 26-50 Normal, 51-75 High, 76-100 Critical. Used for notification routing and dashboard sorting.` }),
8816
+ __metadata("design:type", Number)
8817
+ ], MJAIAgentRequest_.prototype, "Priority", void 0);
8818
+ __decorate([
8819
+ Field({ nullable: true, description: `Optional deadline for the human to respond. After this time the request may be marked Expired by a background process.` }),
8820
+ __metadata("design:type", Date)
8821
+ ], MJAIAgentRequest_.prototype, "ExpiresAt", void 0);
8822
+ __decorate([
8823
+ Field({ nullable: true, description: `Foreign key to AIAgentRun. The agent run that created this request. Used to trace request origin in run chains.` }),
8824
+ MaxLength(36),
8825
+ __metadata("design:type", String)
8826
+ ], MJAIAgentRequest_.prototype, "OriginatingAgentRunID", void 0);
8827
+ __decorate([
8828
+ Field({ nullable: true, description: `Foreign key to AIAgentRunStep. The specific execution step that triggered this request.` }),
8829
+ MaxLength(36),
8830
+ __metadata("design:type", String)
8831
+ ], MJAIAgentRequest_.prototype, "OriginatingAgentRunStepID", void 0);
8832
+ __decorate([
8833
+ Field({ nullable: true, description: `Foreign key to AIAgentRun. The new agent run spawned after the human responds. NULL until a response triggers a resuming run.` }),
8834
+ MaxLength(36),
8835
+ __metadata("design:type", String)
8836
+ ], MJAIAgentRequest_.prototype, "ResumingAgentRunID", void 0);
8837
+ __decorate([
8838
+ Field({ nullable: true, description: `Identifies where the response originated: Conversation (handled by chat resolver), Dashboard (slide-in panel), or API (external integration). Used by the server-side entity subclass to determine whether agent resumption is needed.` }),
8839
+ MaxLength(20),
8840
+ __metadata("design:type", String)
8841
+ ], MJAIAgentRequest_.prototype, "ResponseSource", void 0);
8181
8842
  __decorate([
8182
8843
  Field({ nullable: true }),
8183
8844
  MaxLength(255),
@@ -8193,6 +8854,26 @@ __decorate([
8193
8854
  MaxLength(100),
8194
8855
  __metadata("design:type", String)
8195
8856
  ], MJAIAgentRequest_.prototype, "ResponseByUser", void 0);
8857
+ __decorate([
8858
+ Field({ nullable: true }),
8859
+ MaxLength(100),
8860
+ __metadata("design:type", String)
8861
+ ], MJAIAgentRequest_.prototype, "RequestType", void 0);
8862
+ __decorate([
8863
+ Field({ nullable: true }),
8864
+ MaxLength(255),
8865
+ __metadata("design:type", String)
8866
+ ], MJAIAgentRequest_.prototype, "OriginatingAgentRun", void 0);
8867
+ __decorate([
8868
+ Field({ nullable: true }),
8869
+ MaxLength(255),
8870
+ __metadata("design:type", String)
8871
+ ], MJAIAgentRequest_.prototype, "OriginatingAgentRunStep", void 0);
8872
+ __decorate([
8873
+ Field({ nullable: true }),
8874
+ MaxLength(255),
8875
+ __metadata("design:type", String)
8876
+ ], MJAIAgentRequest_.prototype, "ResumingAgentRun", void 0);
8196
8877
  MJAIAgentRequest_ = __decorate([
8197
8878
  ObjectType({ description: `Table to log AI Agent requests, responses, and their statuses.` })
8198
8879
  ], MJAIAgentRequest_);
@@ -8242,6 +8923,42 @@ __decorate([
8242
8923
  Field({ nullable: true }),
8243
8924
  __metadata("design:type", String)
8244
8925
  ], CreateMJAIAgentRequestInput.prototype, "Comments", void 0);
8926
+ __decorate([
8927
+ Field({ nullable: true }),
8928
+ __metadata("design:type", String)
8929
+ ], CreateMJAIAgentRequestInput.prototype, "RequestTypeID", void 0);
8930
+ __decorate([
8931
+ Field({ nullable: true }),
8932
+ __metadata("design:type", String)
8933
+ ], CreateMJAIAgentRequestInput.prototype, "ResponseSchema", void 0);
8934
+ __decorate([
8935
+ Field({ nullable: true }),
8936
+ __metadata("design:type", String)
8937
+ ], CreateMJAIAgentRequestInput.prototype, "ResponseData", void 0);
8938
+ __decorate([
8939
+ Field(() => Int, { nullable: true }),
8940
+ __metadata("design:type", Number)
8941
+ ], CreateMJAIAgentRequestInput.prototype, "Priority", void 0);
8942
+ __decorate([
8943
+ Field({ nullable: true }),
8944
+ __metadata("design:type", Date)
8945
+ ], CreateMJAIAgentRequestInput.prototype, "ExpiresAt", void 0);
8946
+ __decorate([
8947
+ Field({ nullable: true }),
8948
+ __metadata("design:type", String)
8949
+ ], CreateMJAIAgentRequestInput.prototype, "OriginatingAgentRunID", void 0);
8950
+ __decorate([
8951
+ Field({ nullable: true }),
8952
+ __metadata("design:type", String)
8953
+ ], CreateMJAIAgentRequestInput.prototype, "OriginatingAgentRunStepID", void 0);
8954
+ __decorate([
8955
+ Field({ nullable: true }),
8956
+ __metadata("design:type", String)
8957
+ ], CreateMJAIAgentRequestInput.prototype, "ResumingAgentRunID", void 0);
8958
+ __decorate([
8959
+ Field({ nullable: true }),
8960
+ __metadata("design:type", String)
8961
+ ], CreateMJAIAgentRequestInput.prototype, "ResponseSource", void 0);
8245
8962
  CreateMJAIAgentRequestInput = __decorate([
8246
8963
  InputType()
8247
8964
  ], CreateMJAIAgentRequestInput);
@@ -8291,6 +9008,42 @@ __decorate([
8291
9008
  Field({ nullable: true }),
8292
9009
  __metadata("design:type", String)
8293
9010
  ], UpdateMJAIAgentRequestInput.prototype, "Comments", void 0);
9011
+ __decorate([
9012
+ Field({ nullable: true }),
9013
+ __metadata("design:type", String)
9014
+ ], UpdateMJAIAgentRequestInput.prototype, "RequestTypeID", void 0);
9015
+ __decorate([
9016
+ Field({ nullable: true }),
9017
+ __metadata("design:type", String)
9018
+ ], UpdateMJAIAgentRequestInput.prototype, "ResponseSchema", void 0);
9019
+ __decorate([
9020
+ Field({ nullable: true }),
9021
+ __metadata("design:type", String)
9022
+ ], UpdateMJAIAgentRequestInput.prototype, "ResponseData", void 0);
9023
+ __decorate([
9024
+ Field(() => Int, { nullable: true }),
9025
+ __metadata("design:type", Number)
9026
+ ], UpdateMJAIAgentRequestInput.prototype, "Priority", void 0);
9027
+ __decorate([
9028
+ Field({ nullable: true }),
9029
+ __metadata("design:type", Date)
9030
+ ], UpdateMJAIAgentRequestInput.prototype, "ExpiresAt", void 0);
9031
+ __decorate([
9032
+ Field({ nullable: true }),
9033
+ __metadata("design:type", String)
9034
+ ], UpdateMJAIAgentRequestInput.prototype, "OriginatingAgentRunID", void 0);
9035
+ __decorate([
9036
+ Field({ nullable: true }),
9037
+ __metadata("design:type", String)
9038
+ ], UpdateMJAIAgentRequestInput.prototype, "OriginatingAgentRunStepID", void 0);
9039
+ __decorate([
9040
+ Field({ nullable: true }),
9041
+ __metadata("design:type", String)
9042
+ ], UpdateMJAIAgentRequestInput.prototype, "ResumingAgentRunID", void 0);
9043
+ __decorate([
9044
+ Field({ nullable: true }),
9045
+ __metadata("design:type", String)
9046
+ ], UpdateMJAIAgentRequestInput.prototype, "ResponseSource", void 0);
8294
9047
  __decorate([
8295
9048
  Field(() => [KeyValuePairInput], { nullable: true }),
8296
9049
  __metadata("design:type", Array)
@@ -8976,6 +9729,10 @@ __decorate([
8976
9729
  Field(() => [MJAIAgentRunStep_]),
8977
9730
  __metadata("design:type", Array)
8978
9731
  ], MJAIAgentRunStep_.prototype, "MJAIAgentRunSteps_ParentIDArray", void 0);
9732
+ __decorate([
9733
+ Field(() => [MJAIAgentRequest_]),
9734
+ __metadata("design:type", Array)
9735
+ ], MJAIAgentRunStep_.prototype, "MJAIAgentRequests_OriginatingAgentRunStepIDArray", void 0);
8979
9736
  MJAIAgentRunStep_ = __decorate([
8980
9737
  ObjectType({ description: `Provides basic, step-by-step tracking of agent execution. Each step represents a discrete action within an agent run, such as prompt execution, tool usage, decision making, or sub-agent coordination.` })
8981
9738
  ], MJAIAgentRunStep_);
@@ -9229,6 +9986,14 @@ let MJAIAgentRunStepResolver = class MJAIAgentRunStepResolver extends ResolverBa
9229
9986
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows, this.GetUserFromPayload(userPayload));
9230
9987
  return result;
9231
9988
  }
9989
+ async MJAIAgentRequests_OriginatingAgentRunStepIDArray(mjaiagentrunstep_, { userPayload, providers }, pubSub) {
9990
+ this.CheckUserReadPermissions('MJ: AI Agent Requests', userPayload);
9991
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
9992
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentRequests')} WHERE ${provider.QuoteIdentifier('OriginatingAgentRunStepID')}='${mjaiagentrunstep_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
9993
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
9994
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Requests', rows, this.GetUserFromPayload(userPayload));
9995
+ return result;
9996
+ }
9232
9997
  async CreateMJAIAgentRunStep(input, { providers, userPayload }, pubSub) {
9233
9998
  const provider = GetReadWriteProvider(providers);
9234
9999
  return this.CreateRecord('MJ: AI Agent Run Steps', input, provider, userPayload, pubSub);
@@ -9288,6 +10053,15 @@ __decorate([
9288
10053
  __metadata("design:paramtypes", [MJAIAgentRunStep_, Object, PubSubEngine]),
9289
10054
  __metadata("design:returntype", Promise)
9290
10055
  ], MJAIAgentRunStepResolver.prototype, "MJAIAgentRunSteps_ParentIDArray", null);
10056
+ __decorate([
10057
+ FieldResolver(() => [MJAIAgentRequest_]),
10058
+ __param(0, Root()),
10059
+ __param(1, Ctx()),
10060
+ __param(2, PubSub()),
10061
+ __metadata("design:type", Function),
10062
+ __metadata("design:paramtypes", [MJAIAgentRunStep_, Object, PubSubEngine]),
10063
+ __metadata("design:returntype", Promise)
10064
+ ], MJAIAgentRunStepResolver.prototype, "MJAIAgentRequests_OriginatingAgentRunStepIDArray", null);
9291
10065
  __decorate([
9292
10066
  Mutation(() => MJAIAgentRunStep_),
9293
10067
  __param(0, Arg('input', () => CreateMJAIAgentRunStepInput)),
@@ -9614,6 +10388,14 @@ __decorate([
9614
10388
  Field(() => [MJAIAgentRunMedia_]),
9615
10389
  __metadata("design:type", Array)
9616
10390
  ], MJAIAgentRun_.prototype, "MJAIAgentRunMedias_AgentRunIDArray", void 0);
10391
+ __decorate([
10392
+ Field(() => [MJAIAgentRequest_]),
10393
+ __metadata("design:type", Array)
10394
+ ], MJAIAgentRun_.prototype, "MJAIAgentRequests_OriginatingAgentRunIDArray", void 0);
10395
+ __decorate([
10396
+ Field(() => [MJAIAgentRequest_]),
10397
+ __metadata("design:type", Array)
10398
+ ], MJAIAgentRun_.prototype, "MJAIAgentRequests_ResumingAgentRunIDArray", void 0);
9617
10399
  __decorate([
9618
10400
  Field(() => [MJAIPromptRun_]),
9619
10401
  __metadata("design:type", Array)
@@ -10091,6 +10873,22 @@ let MJAIAgentRunResolver = class MJAIAgentRunResolver extends ResolverBase {
10091
10873
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Medias', rows, this.GetUserFromPayload(userPayload));
10092
10874
  return result;
10093
10875
  }
10876
+ async MJAIAgentRequests_OriginatingAgentRunIDArray(mjaiagentrun_, { userPayload, providers }, pubSub) {
10877
+ this.CheckUserReadPermissions('MJ: AI Agent Requests', userPayload);
10878
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10879
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentRequests')} WHERE ${provider.QuoteIdentifier('OriginatingAgentRunID')}='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
10880
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
10881
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Requests', rows, this.GetUserFromPayload(userPayload));
10882
+ return result;
10883
+ }
10884
+ async MJAIAgentRequests_ResumingAgentRunIDArray(mjaiagentrun_, { userPayload, providers }, pubSub) {
10885
+ this.CheckUserReadPermissions('MJ: AI Agent Requests', userPayload);
10886
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10887
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentRequests')} WHERE ${provider.QuoteIdentifier('ResumingAgentRunID')}='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
10888
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
10889
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Requests', rows, this.GetUserFromPayload(userPayload));
10890
+ return result;
10891
+ }
10094
10892
  async MJAIPromptRuns_AgentRunIDArray(mjaiagentrun_, { userPayload, providers }, pubSub) {
10095
10893
  this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
10096
10894
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -10202,6 +11000,24 @@ __decorate([
10202
11000
  __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
10203
11001
  __metadata("design:returntype", Promise)
10204
11002
  ], MJAIAgentRunResolver.prototype, "MJAIAgentRunMedias_AgentRunIDArray", null);
11003
+ __decorate([
11004
+ FieldResolver(() => [MJAIAgentRequest_]),
11005
+ __param(0, Root()),
11006
+ __param(1, Ctx()),
11007
+ __param(2, PubSub()),
11008
+ __metadata("design:type", Function),
11009
+ __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
11010
+ __metadata("design:returntype", Promise)
11011
+ ], MJAIAgentRunResolver.prototype, "MJAIAgentRequests_OriginatingAgentRunIDArray", null);
11012
+ __decorate([
11013
+ FieldResolver(() => [MJAIAgentRequest_]),
11014
+ __param(0, Root()),
11015
+ __param(1, Ctx()),
11016
+ __param(2, PubSub()),
11017
+ __metadata("design:type", Function),
11018
+ __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
11019
+ __metadata("design:returntype", Promise)
11020
+ ], MJAIAgentRunResolver.prototype, "MJAIAgentRequests_ResumingAgentRunIDArray", null);
10205
11021
  __decorate([
10206
11022
  FieldResolver(() => [MJAIPromptRun_]),
10207
11023
  __param(0, Root()),
@@ -11098,6 +11914,10 @@ __decorate([
11098
11914
  Field({ nullable: true, description: `JSON Schema defining the available prompt parameters for this agent type. Includes property definitions with types, defaults, and descriptions. Used by agents of this type to customize which prompt sections are included in the system prompt. The schema follows JSON Schema draft-07 format.` }),
11099
11915
  __metadata("design:type", String)
11100
11916
  ], MJAIAgentType_.prototype, "PromptParamsSchema", void 0);
11917
+ __decorate([
11918
+ Field({ nullable: true, description: `JSON-serialized AgentRequestAssignmentStrategy defining the default assignment strategy for all agents of this type. Overridden by per-invocation or category-level strategies in the resolution chain.` }),
11919
+ __metadata("design:type", String)
11920
+ ], MJAIAgentType_.prototype, "AssignmentStrategy", void 0);
11101
11921
  __decorate([
11102
11922
  Field({ nullable: true }),
11103
11923
  MaxLength(255),
@@ -11160,6 +11980,10 @@ __decorate([
11160
11980
  Field({ nullable: true }),
11161
11981
  __metadata("design:type", String)
11162
11982
  ], CreateMJAIAgentTypeInput.prototype, "PromptParamsSchema", void 0);
11983
+ __decorate([
11984
+ Field({ nullable: true }),
11985
+ __metadata("design:type", String)
11986
+ ], CreateMJAIAgentTypeInput.prototype, "AssignmentStrategy", void 0);
11163
11987
  CreateMJAIAgentTypeInput = __decorate([
11164
11988
  InputType()
11165
11989
  ], CreateMJAIAgentTypeInput);
@@ -11213,6 +12037,10 @@ __decorate([
11213
12037
  Field({ nullable: true }),
11214
12038
  __metadata("design:type", String)
11215
12039
  ], UpdateMJAIAgentTypeInput.prototype, "PromptParamsSchema", void 0);
12040
+ __decorate([
12041
+ Field({ nullable: true }),
12042
+ __metadata("design:type", String)
12043
+ ], UpdateMJAIAgentTypeInput.prototype, "AssignmentStrategy", void 0);
11216
12044
  __decorate([
11217
12045
  Field(() => [KeyValuePairInput], { nullable: true }),
11218
12046
  __metadata("design:type", Array)
@@ -11658,6 +12486,11 @@ __decorate([
11658
12486
  Field({ nullable: true, description: `JSON configuration for optional reranking of retrieved memory items. Schema: { enabled: boolean, rerankerModelId: string, retrievalMultiplier: number (default 3), minRelevanceThreshold: number (default 0.5), rerankPromptId?: string, contextFields?: string[], fallbackOnError: boolean (default true) }. When null or disabled, vector search results are used directly without reranking.` }),
11659
12487
  __metadata("design:type", String)
11660
12488
  ], MJAIAgent_.prototype, "RerankerConfiguration", void 0);
12489
+ __decorate([
12490
+ Field({ nullable: true, description: `Foreign key to AIAgentCategory. Assigns this agent to an organizational category for grouping, filtering, and inherited assignment strategy resolution.` }),
12491
+ MaxLength(36),
12492
+ __metadata("design:type", String)
12493
+ ], MJAIAgent_.prototype, "CategoryID", void 0);
11661
12494
  __decorate([
11662
12495
  Field({ nullable: true }),
11663
12496
  MaxLength(255),
@@ -11688,6 +12521,11 @@ __decorate([
11688
12521
  MaxLength(50),
11689
12522
  __metadata("design:type", String)
11690
12523
  ], MJAIAgent_.prototype, "AttachmentStorageProvider", void 0);
12524
+ __decorate([
12525
+ Field({ nullable: true }),
12526
+ MaxLength(200),
12527
+ __metadata("design:type", String)
12528
+ ], MJAIAgent_.prototype, "Category", void 0);
11691
12529
  __decorate([
11692
12530
  Field({ nullable: true }),
11693
12531
  MaxLength(36),
@@ -12026,6 +12864,10 @@ __decorate([
12026
12864
  Field({ nullable: true }),
12027
12865
  __metadata("design:type", String)
12028
12866
  ], CreateMJAIAgentInput.prototype, "RerankerConfiguration", void 0);
12867
+ __decorate([
12868
+ Field({ nullable: true }),
12869
+ __metadata("design:type", String)
12870
+ ], CreateMJAIAgentInput.prototype, "CategoryID", void 0);
12029
12871
  CreateMJAIAgentInput = __decorate([
12030
12872
  InputType()
12031
12873
  ], CreateMJAIAgentInput);
@@ -12271,6 +13113,10 @@ __decorate([
12271
13113
  Field({ nullable: true }),
12272
13114
  __metadata("design:type", String)
12273
13115
  ], UpdateMJAIAgentInput.prototype, "RerankerConfiguration", void 0);
13116
+ __decorate([
13117
+ Field({ nullable: true }),
13118
+ __metadata("design:type", String)
13119
+ ], UpdateMJAIAgentInput.prototype, "CategoryID", void 0);
12274
13120
  __decorate([
12275
13121
  Field(() => [KeyValuePairInput], { nullable: true }),
12276
13122
  __metadata("design:type", Array)
@@ -62541,6 +63387,21 @@ __decorate([
62541
63387
  Field(),
62542
63388
  __metadata("design:type", Date)
62543
63389
  ], MJIntegrationObject_.prototype, "_mj__UpdatedAt", void 0);
63390
+ __decorate([
63391
+ Field({ nullable: true, description: `API path for create/update operations when different from the read APIPath. If NULL, the read APIPath is used for writes as well.` }),
63392
+ MaxLength(500),
63393
+ __metadata("design:type", String)
63394
+ ], MJIntegrationObject_.prototype, "WriteAPIPath", void 0);
63395
+ __decorate([
63396
+ Field({ nullable: true, description: `HTTP method for create operations. Defaults to POST.` }),
63397
+ MaxLength(10),
63398
+ __metadata("design:type", String)
63399
+ ], MJIntegrationObject_.prototype, "WriteMethod", void 0);
63400
+ __decorate([
63401
+ Field({ nullable: true, description: `HTTP method for delete operations. Defaults to DELETE.` }),
63402
+ MaxLength(10),
63403
+ __metadata("design:type", String)
63404
+ ], MJIntegrationObject_.prototype, "DeleteMethod", void 0);
62544
63405
  __decorate([
62545
63406
  Field(),
62546
63407
  MaxLength(100),
@@ -62631,6 +63492,18 @@ __decorate([
62631
63492
  Field({ nullable: true }),
62632
63493
  __metadata("design:type", String)
62633
63494
  ], CreateMJIntegrationObjectInput.prototype, "Status", void 0);
63495
+ __decorate([
63496
+ Field({ nullable: true }),
63497
+ __metadata("design:type", String)
63498
+ ], CreateMJIntegrationObjectInput.prototype, "WriteAPIPath", void 0);
63499
+ __decorate([
63500
+ Field({ nullable: true }),
63501
+ __metadata("design:type", String)
63502
+ ], CreateMJIntegrationObjectInput.prototype, "WriteMethod", void 0);
63503
+ __decorate([
63504
+ Field({ nullable: true }),
63505
+ __metadata("design:type", String)
63506
+ ], CreateMJIntegrationObjectInput.prototype, "DeleteMethod", void 0);
62634
63507
  CreateMJIntegrationObjectInput = __decorate([
62635
63508
  InputType()
62636
63509
  ], CreateMJIntegrationObjectInput);
@@ -62708,6 +63581,18 @@ __decorate([
62708
63581
  Field({ nullable: true }),
62709
63582
  __metadata("design:type", String)
62710
63583
  ], UpdateMJIntegrationObjectInput.prototype, "Status", void 0);
63584
+ __decorate([
63585
+ Field({ nullable: true }),
63586
+ __metadata("design:type", String)
63587
+ ], UpdateMJIntegrationObjectInput.prototype, "WriteAPIPath", void 0);
63588
+ __decorate([
63589
+ Field({ nullable: true }),
63590
+ __metadata("design:type", String)
63591
+ ], UpdateMJIntegrationObjectInput.prototype, "WriteMethod", void 0);
63592
+ __decorate([
63593
+ Field({ nullable: true }),
63594
+ __metadata("design:type", String)
63595
+ ], UpdateMJIntegrationObjectInput.prototype, "DeleteMethod", void 0);
62711
63596
  __decorate([
62712
63597
  Field(() => [KeyValuePairInput], { nullable: true }),
62713
63598
  __metadata("design:type", Array)
@@ -63500,6 +64385,10 @@ __decorate([
63500
64385
  MaxLength(36),
63501
64386
  __metadata("design:type", String)
63502
64387
  ], MJIntegration_.prototype, "CredentialTypeID", void 0);
64388
+ __decorate([
64389
+ Field({ nullable: true, description: `Icon for the integration. Supports Font Awesome CSS classes, image URLs, or base64 data URIs.` }),
64390
+ __metadata("design:type", String)
64391
+ ], MJIntegration_.prototype, "Icon", void 0);
63503
64392
  __decorate([
63504
64393
  Field({ nullable: true }),
63505
64394
  MaxLength(100),
@@ -63566,6 +64455,10 @@ __decorate([
63566
64455
  Field({ nullable: true }),
63567
64456
  __metadata("design:type", String)
63568
64457
  ], CreateMJIntegrationInput.prototype, "CredentialTypeID", void 0);
64458
+ __decorate([
64459
+ Field({ nullable: true }),
64460
+ __metadata("design:type", String)
64461
+ ], CreateMJIntegrationInput.prototype, "Icon", void 0);
63569
64462
  CreateMJIntegrationInput = __decorate([
63570
64463
  InputType()
63571
64464
  ], CreateMJIntegrationInput);
@@ -63611,6 +64504,10 @@ __decorate([
63611
64504
  Field({ nullable: true }),
63612
64505
  __metadata("design:type", String)
63613
64506
  ], UpdateMJIntegrationInput.prototype, "CredentialTypeID", void 0);
64507
+ __decorate([
64508
+ Field({ nullable: true }),
64509
+ __metadata("design:type", String)
64510
+ ], UpdateMJIntegrationInput.prototype, "Icon", void 0);
63614
64511
  __decorate([
63615
64512
  Field(() => [KeyValuePairInput], { nullable: true }),
63616
64513
  __metadata("design:type", Array)