@memberjunction/server 5.21.0 → 5.23.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 (50) hide show
  1. package/README.md +44 -0
  2. package/dist/agents/skip-sdk.d.ts.map +1 -1
  3. package/dist/agents/skip-sdk.js +32 -2
  4. package/dist/agents/skip-sdk.js.map +1 -1
  5. package/dist/generated/generated.d.ts +172 -4
  6. package/dist/generated/generated.d.ts.map +1 -1
  7. package/dist/generated/generated.js +931 -2
  8. package/dist/generated/generated.js.map +1 -1
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +10 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/resolvers/AutotagPipelineResolver.d.ts +21 -0
  14. package/dist/resolvers/AutotagPipelineResolver.d.ts.map +1 -0
  15. package/dist/resolvers/AutotagPipelineResolver.js +147 -0
  16. package/dist/resolvers/AutotagPipelineResolver.js.map +1 -0
  17. package/dist/resolvers/ClientToolRequestResolver.d.ts +43 -0
  18. package/dist/resolvers/ClientToolRequestResolver.d.ts.map +1 -0
  19. package/dist/resolvers/ClientToolRequestResolver.js +161 -0
  20. package/dist/resolvers/ClientToolRequestResolver.js.map +1 -0
  21. package/dist/resolvers/FetchEntityVectorsResolver.d.ts +29 -0
  22. package/dist/resolvers/FetchEntityVectorsResolver.d.ts.map +1 -0
  23. package/dist/resolvers/FetchEntityVectorsResolver.js +218 -0
  24. package/dist/resolvers/FetchEntityVectorsResolver.js.map +1 -0
  25. package/dist/resolvers/PipelineProgressResolver.d.ts +33 -0
  26. package/dist/resolvers/PipelineProgressResolver.d.ts.map +1 -0
  27. package/dist/resolvers/PipelineProgressResolver.js +138 -0
  28. package/dist/resolvers/PipelineProgressResolver.js.map +1 -0
  29. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  30. package/dist/resolvers/RunAIAgentResolver.js +7 -5
  31. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  32. package/dist/resolvers/SearchKnowledgeResolver.d.ts +85 -0
  33. package/dist/resolvers/SearchKnowledgeResolver.d.ts.map +1 -0
  34. package/dist/resolvers/SearchKnowledgeResolver.js +587 -0
  35. package/dist/resolvers/SearchKnowledgeResolver.js.map +1 -0
  36. package/dist/resolvers/VectorizeEntityResolver.d.ts +21 -0
  37. package/dist/resolvers/VectorizeEntityResolver.d.ts.map +1 -0
  38. package/dist/resolvers/VectorizeEntityResolver.js +134 -0
  39. package/dist/resolvers/VectorizeEntityResolver.js.map +1 -0
  40. package/package.json +63 -62
  41. package/src/agents/skip-sdk.ts +31 -2
  42. package/src/generated/generated.ts +650 -7
  43. package/src/index.ts +13 -0
  44. package/src/resolvers/AutotagPipelineResolver.ts +146 -0
  45. package/src/resolvers/ClientToolRequestResolver.ts +128 -0
  46. package/src/resolvers/FetchEntityVectorsResolver.ts +234 -0
  47. package/src/resolvers/PipelineProgressResolver.ts +107 -0
  48. package/src/resolvers/RunAIAgentResolver.ts +7 -5
  49. package/src/resolvers/SearchKnowledgeResolver.ts +614 -0
  50. package/src/resolvers/VectorizeEntityResolver.ts +123 -0
@@ -4741,6 +4741,259 @@ MJAIAgentCategoryResolver = __decorate([
4741
4741
  ], MJAIAgentCategoryResolver);
4742
4742
  export { MJAIAgentCategoryResolver };
4743
4743
  //****************************************************************************
4744
+ // ENTITY CLASS for MJ: AI Agent Client Tools
4745
+ //****************************************************************************
4746
+ let MJAIAgentClientTool_ = class MJAIAgentClientTool_ {
4747
+ };
4748
+ __decorate([
4749
+ Field(),
4750
+ MaxLength(36),
4751
+ __metadata("design:type", String)
4752
+ ], MJAIAgentClientTool_.prototype, "ID", void 0);
4753
+ __decorate([
4754
+ Field(),
4755
+ MaxLength(36),
4756
+ __metadata("design:type", String)
4757
+ ], MJAIAgentClientTool_.prototype, "AgentID", void 0);
4758
+ __decorate([
4759
+ Field(),
4760
+ MaxLength(36),
4761
+ __metadata("design:type", String)
4762
+ ], MJAIAgentClientTool_.prototype, "ClientToolDefinitionID", void 0);
4763
+ __decorate([
4764
+ Field(() => Boolean, { description: `When true, the agent expects this tool to always be available on the client. If the client has not registered a handler, agent execution may warn or fail depending on configuration.` }),
4765
+ __metadata("design:type", Boolean)
4766
+ ], MJAIAgentClientTool_.prototype, "IsRequired", void 0);
4767
+ __decorate([
4768
+ Field(() => Int, { description: `Sort order for tool listing in prompts. Lower numbers appear first. Tools with the same priority are listed alphabetically.` }),
4769
+ __metadata("design:type", Number)
4770
+ ], MJAIAgentClientTool_.prototype, "Priority", void 0);
4771
+ __decorate([
4772
+ Field(),
4773
+ __metadata("design:type", Date)
4774
+ ], MJAIAgentClientTool_.prototype, "_mj__CreatedAt", void 0);
4775
+ __decorate([
4776
+ Field(),
4777
+ __metadata("design:type", Date)
4778
+ ], MJAIAgentClientTool_.prototype, "_mj__UpdatedAt", void 0);
4779
+ __decorate([
4780
+ Field({ nullable: true }),
4781
+ MaxLength(255),
4782
+ __metadata("design:type", String)
4783
+ ], MJAIAgentClientTool_.prototype, "Agent", void 0);
4784
+ __decorate([
4785
+ Field(),
4786
+ MaxLength(200),
4787
+ __metadata("design:type", String)
4788
+ ], MJAIAgentClientTool_.prototype, "ClientToolDefinition", void 0);
4789
+ MJAIAgentClientTool_ = __decorate([
4790
+ ObjectType()
4791
+ ], MJAIAgentClientTool_);
4792
+ export { MJAIAgentClientTool_ };
4793
+ //****************************************************************************
4794
+ // INPUT TYPE for MJ: AI Agent Client Tools
4795
+ //****************************************************************************
4796
+ let CreateMJAIAgentClientToolInput = class CreateMJAIAgentClientToolInput {
4797
+ };
4798
+ __decorate([
4799
+ Field({ nullable: true }),
4800
+ __metadata("design:type", String)
4801
+ ], CreateMJAIAgentClientToolInput.prototype, "ID", void 0);
4802
+ __decorate([
4803
+ Field({ nullable: true }),
4804
+ __metadata("design:type", String)
4805
+ ], CreateMJAIAgentClientToolInput.prototype, "AgentID", void 0);
4806
+ __decorate([
4807
+ Field({ nullable: true }),
4808
+ __metadata("design:type", String)
4809
+ ], CreateMJAIAgentClientToolInput.prototype, "ClientToolDefinitionID", void 0);
4810
+ __decorate([
4811
+ Field(() => Boolean, { nullable: true }),
4812
+ __metadata("design:type", Boolean)
4813
+ ], CreateMJAIAgentClientToolInput.prototype, "IsRequired", void 0);
4814
+ __decorate([
4815
+ Field(() => Int, { nullable: true }),
4816
+ __metadata("design:type", Number)
4817
+ ], CreateMJAIAgentClientToolInput.prototype, "Priority", void 0);
4818
+ CreateMJAIAgentClientToolInput = __decorate([
4819
+ InputType()
4820
+ ], CreateMJAIAgentClientToolInput);
4821
+ export { CreateMJAIAgentClientToolInput };
4822
+ //****************************************************************************
4823
+ // INPUT TYPE for MJ: AI Agent Client Tools
4824
+ //****************************************************************************
4825
+ let UpdateMJAIAgentClientToolInput = class UpdateMJAIAgentClientToolInput {
4826
+ };
4827
+ __decorate([
4828
+ Field(),
4829
+ __metadata("design:type", String)
4830
+ ], UpdateMJAIAgentClientToolInput.prototype, "ID", void 0);
4831
+ __decorate([
4832
+ Field({ nullable: true }),
4833
+ __metadata("design:type", String)
4834
+ ], UpdateMJAIAgentClientToolInput.prototype, "AgentID", void 0);
4835
+ __decorate([
4836
+ Field({ nullable: true }),
4837
+ __metadata("design:type", String)
4838
+ ], UpdateMJAIAgentClientToolInput.prototype, "ClientToolDefinitionID", void 0);
4839
+ __decorate([
4840
+ Field(() => Boolean, { nullable: true }),
4841
+ __metadata("design:type", Boolean)
4842
+ ], UpdateMJAIAgentClientToolInput.prototype, "IsRequired", void 0);
4843
+ __decorate([
4844
+ Field(() => Int, { nullable: true }),
4845
+ __metadata("design:type", Number)
4846
+ ], UpdateMJAIAgentClientToolInput.prototype, "Priority", void 0);
4847
+ __decorate([
4848
+ Field(() => [KeyValuePairInput], { nullable: true }),
4849
+ __metadata("design:type", Array)
4850
+ ], UpdateMJAIAgentClientToolInput.prototype, "OldValues___", void 0);
4851
+ UpdateMJAIAgentClientToolInput = __decorate([
4852
+ InputType()
4853
+ ], UpdateMJAIAgentClientToolInput);
4854
+ export { UpdateMJAIAgentClientToolInput };
4855
+ //****************************************************************************
4856
+ // RESOLVER for MJ: AI Agent Client Tools
4857
+ //****************************************************************************
4858
+ let RunMJAIAgentClientToolViewResult = class RunMJAIAgentClientToolViewResult {
4859
+ };
4860
+ __decorate([
4861
+ Field(() => [MJAIAgentClientTool_]),
4862
+ __metadata("design:type", Array)
4863
+ ], RunMJAIAgentClientToolViewResult.prototype, "Results", void 0);
4864
+ __decorate([
4865
+ Field(() => String, { nullable: true }),
4866
+ __metadata("design:type", String)
4867
+ ], RunMJAIAgentClientToolViewResult.prototype, "UserViewRunID", void 0);
4868
+ __decorate([
4869
+ Field(() => Int, { nullable: true }),
4870
+ __metadata("design:type", Number)
4871
+ ], RunMJAIAgentClientToolViewResult.prototype, "RowCount", void 0);
4872
+ __decorate([
4873
+ Field(() => Int, { nullable: true }),
4874
+ __metadata("design:type", Number)
4875
+ ], RunMJAIAgentClientToolViewResult.prototype, "TotalRowCount", void 0);
4876
+ __decorate([
4877
+ Field(() => Int, { nullable: true }),
4878
+ __metadata("design:type", Number)
4879
+ ], RunMJAIAgentClientToolViewResult.prototype, "ExecutionTime", void 0);
4880
+ __decorate([
4881
+ Field({ nullable: true }),
4882
+ __metadata("design:type", String)
4883
+ ], RunMJAIAgentClientToolViewResult.prototype, "ErrorMessage", void 0);
4884
+ __decorate([
4885
+ Field(() => Boolean, { nullable: false }),
4886
+ __metadata("design:type", Boolean)
4887
+ ], RunMJAIAgentClientToolViewResult.prototype, "Success", void 0);
4888
+ RunMJAIAgentClientToolViewResult = __decorate([
4889
+ ObjectType()
4890
+ ], RunMJAIAgentClientToolViewResult);
4891
+ export { RunMJAIAgentClientToolViewResult };
4892
+ let MJAIAgentClientToolResolver = class MJAIAgentClientToolResolver extends ResolverBase {
4893
+ async RunMJAIAgentClientToolViewByID(input, { providers, userPayload }, pubSub) {
4894
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4895
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
4896
+ }
4897
+ async RunMJAIAgentClientToolViewByName(input, { providers, userPayload }, pubSub) {
4898
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4899
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
4900
+ }
4901
+ async RunMJAIAgentClientToolDynamicView(input, { providers, userPayload }, pubSub) {
4902
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4903
+ input.EntityName = 'MJ: AI Agent Client Tools';
4904
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
4905
+ }
4906
+ async MJAIAgentClientTool(ID, { userPayload, providers }, pubSub) {
4907
+ this.CheckUserReadPermissions('MJ: AI Agent Client Tools', userPayload);
4908
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4909
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentClientTools')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Client Tools', userPayload, EntityPermissionType.Read, 'AND');
4910
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
4911
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Agent Client Tools', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
4912
+ return result;
4913
+ }
4914
+ async CreateMJAIAgentClientTool(input, { providers, userPayload }, pubSub) {
4915
+ const provider = GetReadWriteProvider(providers);
4916
+ return this.CreateRecord('MJ: AI Agent Client Tools', input, provider, userPayload, pubSub);
4917
+ }
4918
+ async UpdateMJAIAgentClientTool(input, { providers, userPayload }, pubSub) {
4919
+ const provider = GetReadWriteProvider(providers);
4920
+ return this.UpdateRecord('MJ: AI Agent Client Tools', input, provider, userPayload, pubSub);
4921
+ }
4922
+ async DeleteMJAIAgentClientTool(ID, options, { providers, userPayload }, pubSub) {
4923
+ const provider = GetReadWriteProvider(providers);
4924
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
4925
+ return this.DeleteRecord('MJ: AI Agent Client Tools', key, options, provider, userPayload, pubSub);
4926
+ }
4927
+ };
4928
+ __decorate([
4929
+ Query(() => RunMJAIAgentClientToolViewResult),
4930
+ __param(0, Arg('input', () => RunViewByIDInput)),
4931
+ __param(1, Ctx()),
4932
+ __param(2, PubSub()),
4933
+ __metadata("design:type", Function),
4934
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
4935
+ __metadata("design:returntype", Promise)
4936
+ ], MJAIAgentClientToolResolver.prototype, "RunMJAIAgentClientToolViewByID", null);
4937
+ __decorate([
4938
+ Query(() => RunMJAIAgentClientToolViewResult),
4939
+ __param(0, Arg('input', () => RunViewByNameInput)),
4940
+ __param(1, Ctx()),
4941
+ __param(2, PubSub()),
4942
+ __metadata("design:type", Function),
4943
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
4944
+ __metadata("design:returntype", Promise)
4945
+ ], MJAIAgentClientToolResolver.prototype, "RunMJAIAgentClientToolViewByName", null);
4946
+ __decorate([
4947
+ Query(() => RunMJAIAgentClientToolViewResult),
4948
+ __param(0, Arg('input', () => RunDynamicViewInput)),
4949
+ __param(1, Ctx()),
4950
+ __param(2, PubSub()),
4951
+ __metadata("design:type", Function),
4952
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
4953
+ __metadata("design:returntype", Promise)
4954
+ ], MJAIAgentClientToolResolver.prototype, "RunMJAIAgentClientToolDynamicView", null);
4955
+ __decorate([
4956
+ Query(() => MJAIAgentClientTool_, { nullable: true }),
4957
+ __param(0, Arg('ID', () => String)),
4958
+ __param(1, Ctx()),
4959
+ __param(2, PubSub()),
4960
+ __metadata("design:type", Function),
4961
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
4962
+ __metadata("design:returntype", Promise)
4963
+ ], MJAIAgentClientToolResolver.prototype, "MJAIAgentClientTool", null);
4964
+ __decorate([
4965
+ Mutation(() => MJAIAgentClientTool_),
4966
+ __param(0, Arg('input', () => CreateMJAIAgentClientToolInput)),
4967
+ __param(1, Ctx()),
4968
+ __param(2, PubSub()),
4969
+ __metadata("design:type", Function),
4970
+ __metadata("design:paramtypes", [CreateMJAIAgentClientToolInput, Object, PubSubEngine]),
4971
+ __metadata("design:returntype", Promise)
4972
+ ], MJAIAgentClientToolResolver.prototype, "CreateMJAIAgentClientTool", null);
4973
+ __decorate([
4974
+ Mutation(() => MJAIAgentClientTool_),
4975
+ __param(0, Arg('input', () => UpdateMJAIAgentClientToolInput)),
4976
+ __param(1, Ctx()),
4977
+ __param(2, PubSub()),
4978
+ __metadata("design:type", Function),
4979
+ __metadata("design:paramtypes", [UpdateMJAIAgentClientToolInput, Object, PubSubEngine]),
4980
+ __metadata("design:returntype", Promise)
4981
+ ], MJAIAgentClientToolResolver.prototype, "UpdateMJAIAgentClientTool", null);
4982
+ __decorate([
4983
+ Mutation(() => MJAIAgentClientTool_),
4984
+ __param(0, Arg('ID', () => String)),
4985
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
4986
+ __param(2, Ctx()),
4987
+ __param(3, PubSub()),
4988
+ __metadata("design:type", Function),
4989
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
4990
+ __metadata("design:returntype", Promise)
4991
+ ], MJAIAgentClientToolResolver.prototype, "DeleteMJAIAgentClientTool", null);
4992
+ MJAIAgentClientToolResolver = __decorate([
4993
+ Resolver(MJAIAgentClientTool_)
4994
+ ], MJAIAgentClientToolResolver);
4995
+ export { MJAIAgentClientToolResolver };
4996
+ //****************************************************************************
4744
4997
  // ENTITY CLASS for MJ: AI Agent Configurations
4745
4998
  //****************************************************************************
4746
4999
  let MJAIAgentConfiguration_ = class MJAIAgentConfiguration_ {
@@ -12491,6 +12744,10 @@ __decorate([
12491
12744
  MaxLength(36),
12492
12745
  __metadata("design:type", String)
12493
12746
  ], MJAIAgent_.prototype, "CategoryID", void 0);
12747
+ __decorate([
12748
+ Field(() => Boolean, { description: `When true (default), this agent accepts runtime-registered ephemeral client tools that are not defined in metadata. Set to false for agents that require strict tool governance.` }),
12749
+ __metadata("design:type", Boolean)
12750
+ ], MJAIAgent_.prototype, "AllowEphemeralClientTools", void 0);
12494
12751
  __decorate([
12495
12752
  Field({ nullable: true }),
12496
12753
  MaxLength(255),
@@ -12571,6 +12828,10 @@ __decorate([
12571
12828
  Field(() => [MJAIAgentModality_]),
12572
12829
  __metadata("design:type", Array)
12573
12830
  ], MJAIAgent_.prototype, "MJAIAgentModalities_AgentIDArray", void 0);
12831
+ __decorate([
12832
+ Field(() => [MJAIAgentClientTool_]),
12833
+ __metadata("design:type", Array)
12834
+ ], MJAIAgent_.prototype, "MJAIAgentClientTools_AgentIDArray", void 0);
12574
12835
  __decorate([
12575
12836
  Field(() => [MJAIAgentNote_]),
12576
12837
  __metadata("design:type", Array)
@@ -12868,6 +13129,10 @@ __decorate([
12868
13129
  Field({ nullable: true }),
12869
13130
  __metadata("design:type", String)
12870
13131
  ], CreateMJAIAgentInput.prototype, "CategoryID", void 0);
13132
+ __decorate([
13133
+ Field(() => Boolean, { nullable: true }),
13134
+ __metadata("design:type", Boolean)
13135
+ ], CreateMJAIAgentInput.prototype, "AllowEphemeralClientTools", void 0);
12871
13136
  CreateMJAIAgentInput = __decorate([
12872
13137
  InputType()
12873
13138
  ], CreateMJAIAgentInput);
@@ -13117,6 +13382,10 @@ __decorate([
13117
13382
  Field({ nullable: true }),
13118
13383
  __metadata("design:type", String)
13119
13384
  ], UpdateMJAIAgentInput.prototype, "CategoryID", void 0);
13385
+ __decorate([
13386
+ Field(() => Boolean, { nullable: true }),
13387
+ __metadata("design:type", Boolean)
13388
+ ], UpdateMJAIAgentInput.prototype, "AllowEphemeralClientTools", void 0);
13120
13389
  __decorate([
13121
13390
  Field(() => [KeyValuePairInput], { nullable: true }),
13122
13391
  __metadata("design:type", Array)
@@ -13264,6 +13533,14 @@ let MJAIAgentResolver = class MJAIAgentResolver extends ResolverBase {
13264
13533
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Modalities', rows, this.GetUserFromPayload(userPayload));
13265
13534
  return result;
13266
13535
  }
13536
+ async MJAIAgentClientTools_AgentIDArray(mjaiagent_, { userPayload, providers }, pubSub) {
13537
+ this.CheckUserReadPermissions('MJ: AI Agent Client Tools', userPayload);
13538
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13539
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentClientTools')} WHERE ${provider.QuoteIdentifier('AgentID')}='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Client Tools', userPayload, EntityPermissionType.Read, 'AND');
13540
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
13541
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Client Tools', rows, this.GetUserFromPayload(userPayload));
13542
+ return result;
13543
+ }
13267
13544
  async MJAIAgentNotes_AgentIDArray(mjaiagent_, { userPayload, providers }, pubSub) {
13268
13545
  this.CheckUserReadPermissions('MJ: AI Agent Notes', userPayload);
13269
13546
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -13500,6 +13777,15 @@ __decorate([
13500
13777
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
13501
13778
  __metadata("design:returntype", Promise)
13502
13779
  ], MJAIAgentResolver.prototype, "MJAIAgentModalities_AgentIDArray", null);
13780
+ __decorate([
13781
+ FieldResolver(() => [MJAIAgentClientTool_]),
13782
+ __param(0, Root()),
13783
+ __param(1, Ctx()),
13784
+ __param(2, PubSub()),
13785
+ __metadata("design:type", Function),
13786
+ __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
13787
+ __metadata("design:returntype", Promise)
13788
+ ], MJAIAgentResolver.prototype, "MJAIAgentClientTools_AgentIDArray", null);
13503
13789
  __decorate([
13504
13790
  FieldResolver(() => [MJAIAgentNote_]),
13505
13791
  __param(0, Root()),
@@ -13975,6 +14261,307 @@ MJAIArchitectureResolver = __decorate([
13975
14261
  ], MJAIArchitectureResolver);
13976
14262
  export { MJAIArchitectureResolver };
13977
14263
  //****************************************************************************
14264
+ // ENTITY CLASS for MJ: AI Client Tool Definitions
14265
+ //****************************************************************************
14266
+ let MJAIClientToolDefinition_ = class MJAIClientToolDefinition_ {
14267
+ };
14268
+ __decorate([
14269
+ Field(),
14270
+ MaxLength(36),
14271
+ __metadata("design:type", String)
14272
+ ], MJAIClientToolDefinition_.prototype, "ID", void 0);
14273
+ __decorate([
14274
+ Field({ description: `Unique identifier for the client tool (e.g., NavigateToApp, NavigateToRecord). Used to match tool invocations from the LLM to registered handlers on the client.` }),
14275
+ MaxLength(200),
14276
+ __metadata("design:type", String)
14277
+ ], MJAIClientToolDefinition_.prototype, "Name", void 0);
14278
+ __decorate([
14279
+ Field({ description: `Human-readable description of what the tool does. This text is injected into the LLM system prompt so it knows when and how to use the tool.` }),
14280
+ __metadata("design:type", String)
14281
+ ], MJAIClientToolDefinition_.prototype, "Description", void 0);
14282
+ __decorate([
14283
+ Field({ nullable: true, description: `Tool category for grouping and filtering (e.g., navigation, form, display, data).` }),
14284
+ MaxLength(50),
14285
+ __metadata("design:type", String)
14286
+ ], MJAIClientToolDefinition_.prototype, "Category", void 0);
14287
+ __decorate([
14288
+ Field({ nullable: true, description: `JSON Schema defining the input parameters the tool accepts. Included in the LLM prompt so it generates valid parameter objects.` }),
14289
+ __metadata("design:type", String)
14290
+ ], MJAIClientToolDefinition_.prototype, "InputSchemaJSON", void 0);
14291
+ __decorate([
14292
+ Field({ nullable: true, description: `JSON Schema describing the return value from the tool. Optional — used for documentation and LLM context.` }),
14293
+ __metadata("design:type", String)
14294
+ ], MJAIClientToolDefinition_.prototype, "OutputSchemaJSON", void 0);
14295
+ __decorate([
14296
+ Field(() => Int, { nullable: true, description: `Default timeout in milliseconds for this tool. Can be overridden per-invocation by the LLM or per-run by execution params. Default is 30000ms (30 seconds).` }),
14297
+ __metadata("design:type", Number)
14298
+ ], MJAIClientToolDefinition_.prototype, "DefaultTimeoutMs", void 0);
14299
+ __decorate([
14300
+ Field({ nullable: true, description: `When set, the client only sends this tool to the server when the user is in the specified context (e.g., entity-form, dashboard, search). Null means the tool is always available.` }),
14301
+ MaxLength(100),
14302
+ __metadata("design:type", String)
14303
+ ], MJAIClientToolDefinition_.prototype, "RequiresContextType", void 0);
14304
+ __decorate([
14305
+ Field(),
14306
+ __metadata("design:type", Date)
14307
+ ], MJAIClientToolDefinition_.prototype, "_mj__CreatedAt", void 0);
14308
+ __decorate([
14309
+ Field(),
14310
+ __metadata("design:type", Date)
14311
+ ], MJAIClientToolDefinition_.prototype, "_mj__UpdatedAt", void 0);
14312
+ __decorate([
14313
+ Field(() => [MJAIAgentClientTool_]),
14314
+ __metadata("design:type", Array)
14315
+ ], MJAIClientToolDefinition_.prototype, "MJAIAgentClientTools_ClientToolDefinitionIDArray", void 0);
14316
+ MJAIClientToolDefinition_ = __decorate([
14317
+ ObjectType()
14318
+ ], MJAIClientToolDefinition_);
14319
+ export { MJAIClientToolDefinition_ };
14320
+ //****************************************************************************
14321
+ // INPUT TYPE for MJ: AI Client Tool Definitions
14322
+ //****************************************************************************
14323
+ let CreateMJAIClientToolDefinitionInput = class CreateMJAIClientToolDefinitionInput {
14324
+ };
14325
+ __decorate([
14326
+ Field({ nullable: true }),
14327
+ __metadata("design:type", String)
14328
+ ], CreateMJAIClientToolDefinitionInput.prototype, "ID", void 0);
14329
+ __decorate([
14330
+ Field({ nullable: true }),
14331
+ __metadata("design:type", String)
14332
+ ], CreateMJAIClientToolDefinitionInput.prototype, "Name", void 0);
14333
+ __decorate([
14334
+ Field({ nullable: true }),
14335
+ __metadata("design:type", String)
14336
+ ], CreateMJAIClientToolDefinitionInput.prototype, "Description", void 0);
14337
+ __decorate([
14338
+ Field({ nullable: true }),
14339
+ __metadata("design:type", String)
14340
+ ], CreateMJAIClientToolDefinitionInput.prototype, "Category", void 0);
14341
+ __decorate([
14342
+ Field({ nullable: true }),
14343
+ __metadata("design:type", String)
14344
+ ], CreateMJAIClientToolDefinitionInput.prototype, "InputSchemaJSON", void 0);
14345
+ __decorate([
14346
+ Field({ nullable: true }),
14347
+ __metadata("design:type", String)
14348
+ ], CreateMJAIClientToolDefinitionInput.prototype, "OutputSchemaJSON", void 0);
14349
+ __decorate([
14350
+ Field(() => Int, { nullable: true }),
14351
+ __metadata("design:type", Number)
14352
+ ], CreateMJAIClientToolDefinitionInput.prototype, "DefaultTimeoutMs", void 0);
14353
+ __decorate([
14354
+ Field({ nullable: true }),
14355
+ __metadata("design:type", String)
14356
+ ], CreateMJAIClientToolDefinitionInput.prototype, "RequiresContextType", void 0);
14357
+ CreateMJAIClientToolDefinitionInput = __decorate([
14358
+ InputType()
14359
+ ], CreateMJAIClientToolDefinitionInput);
14360
+ export { CreateMJAIClientToolDefinitionInput };
14361
+ //****************************************************************************
14362
+ // INPUT TYPE for MJ: AI Client Tool Definitions
14363
+ //****************************************************************************
14364
+ let UpdateMJAIClientToolDefinitionInput = class UpdateMJAIClientToolDefinitionInput {
14365
+ };
14366
+ __decorate([
14367
+ Field(),
14368
+ __metadata("design:type", String)
14369
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "ID", void 0);
14370
+ __decorate([
14371
+ Field({ nullable: true }),
14372
+ __metadata("design:type", String)
14373
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "Name", void 0);
14374
+ __decorate([
14375
+ Field({ nullable: true }),
14376
+ __metadata("design:type", String)
14377
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "Description", void 0);
14378
+ __decorate([
14379
+ Field({ nullable: true }),
14380
+ __metadata("design:type", String)
14381
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "Category", void 0);
14382
+ __decorate([
14383
+ Field({ nullable: true }),
14384
+ __metadata("design:type", String)
14385
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "InputSchemaJSON", void 0);
14386
+ __decorate([
14387
+ Field({ nullable: true }),
14388
+ __metadata("design:type", String)
14389
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "OutputSchemaJSON", void 0);
14390
+ __decorate([
14391
+ Field(() => Int, { nullable: true }),
14392
+ __metadata("design:type", Number)
14393
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "DefaultTimeoutMs", void 0);
14394
+ __decorate([
14395
+ Field({ nullable: true }),
14396
+ __metadata("design:type", String)
14397
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "RequiresContextType", void 0);
14398
+ __decorate([
14399
+ Field(() => [KeyValuePairInput], { nullable: true }),
14400
+ __metadata("design:type", Array)
14401
+ ], UpdateMJAIClientToolDefinitionInput.prototype, "OldValues___", void 0);
14402
+ UpdateMJAIClientToolDefinitionInput = __decorate([
14403
+ InputType()
14404
+ ], UpdateMJAIClientToolDefinitionInput);
14405
+ export { UpdateMJAIClientToolDefinitionInput };
14406
+ //****************************************************************************
14407
+ // RESOLVER for MJ: AI Client Tool Definitions
14408
+ //****************************************************************************
14409
+ let RunMJAIClientToolDefinitionViewResult = class RunMJAIClientToolDefinitionViewResult {
14410
+ };
14411
+ __decorate([
14412
+ Field(() => [MJAIClientToolDefinition_]),
14413
+ __metadata("design:type", Array)
14414
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "Results", void 0);
14415
+ __decorate([
14416
+ Field(() => String, { nullable: true }),
14417
+ __metadata("design:type", String)
14418
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "UserViewRunID", void 0);
14419
+ __decorate([
14420
+ Field(() => Int, { nullable: true }),
14421
+ __metadata("design:type", Number)
14422
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "RowCount", void 0);
14423
+ __decorate([
14424
+ Field(() => Int, { nullable: true }),
14425
+ __metadata("design:type", Number)
14426
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "TotalRowCount", void 0);
14427
+ __decorate([
14428
+ Field(() => Int, { nullable: true }),
14429
+ __metadata("design:type", Number)
14430
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "ExecutionTime", void 0);
14431
+ __decorate([
14432
+ Field({ nullable: true }),
14433
+ __metadata("design:type", String)
14434
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "ErrorMessage", void 0);
14435
+ __decorate([
14436
+ Field(() => Boolean, { nullable: false }),
14437
+ __metadata("design:type", Boolean)
14438
+ ], RunMJAIClientToolDefinitionViewResult.prototype, "Success", void 0);
14439
+ RunMJAIClientToolDefinitionViewResult = __decorate([
14440
+ ObjectType()
14441
+ ], RunMJAIClientToolDefinitionViewResult);
14442
+ export { RunMJAIClientToolDefinitionViewResult };
14443
+ let MJAIClientToolDefinitionResolver = class MJAIClientToolDefinitionResolver extends ResolverBase {
14444
+ async RunMJAIClientToolDefinitionViewByID(input, { providers, userPayload }, pubSub) {
14445
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14446
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
14447
+ }
14448
+ async RunMJAIClientToolDefinitionViewByName(input, { providers, userPayload }, pubSub) {
14449
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14450
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
14451
+ }
14452
+ async RunMJAIClientToolDefinitionDynamicView(input, { providers, userPayload }, pubSub) {
14453
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14454
+ input.EntityName = 'MJ: AI Client Tool Definitions';
14455
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
14456
+ }
14457
+ async MJAIClientToolDefinition(ID, { userPayload, providers }, pubSub) {
14458
+ this.CheckUserReadPermissions('MJ: AI Client Tool Definitions', userPayload);
14459
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14460
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIClientToolDefinitions')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Client Tool Definitions', userPayload, EntityPermissionType.Read, 'AND');
14461
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
14462
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Client Tool Definitions', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
14463
+ return result;
14464
+ }
14465
+ async MJAIAgentClientTools_ClientToolDefinitionIDArray(mjaiclienttooldefinition_, { userPayload, providers }, pubSub) {
14466
+ this.CheckUserReadPermissions('MJ: AI Agent Client Tools', userPayload);
14467
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
14468
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentClientTools')} WHERE ${provider.QuoteIdentifier('ClientToolDefinitionID')}='${mjaiclienttooldefinition_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Client Tools', userPayload, EntityPermissionType.Read, 'AND');
14469
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
14470
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Client Tools', rows, this.GetUserFromPayload(userPayload));
14471
+ return result;
14472
+ }
14473
+ async CreateMJAIClientToolDefinition(input, { providers, userPayload }, pubSub) {
14474
+ const provider = GetReadWriteProvider(providers);
14475
+ return this.CreateRecord('MJ: AI Client Tool Definitions', input, provider, userPayload, pubSub);
14476
+ }
14477
+ async UpdateMJAIClientToolDefinition(input, { providers, userPayload }, pubSub) {
14478
+ const provider = GetReadWriteProvider(providers);
14479
+ return this.UpdateRecord('MJ: AI Client Tool Definitions', input, provider, userPayload, pubSub);
14480
+ }
14481
+ async DeleteMJAIClientToolDefinition(ID, options, { providers, userPayload }, pubSub) {
14482
+ const provider = GetReadWriteProvider(providers);
14483
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
14484
+ return this.DeleteRecord('MJ: AI Client Tool Definitions', key, options, provider, userPayload, pubSub);
14485
+ }
14486
+ };
14487
+ __decorate([
14488
+ Query(() => RunMJAIClientToolDefinitionViewResult),
14489
+ __param(0, Arg('input', () => RunViewByIDInput)),
14490
+ __param(1, Ctx()),
14491
+ __param(2, PubSub()),
14492
+ __metadata("design:type", Function),
14493
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
14494
+ __metadata("design:returntype", Promise)
14495
+ ], MJAIClientToolDefinitionResolver.prototype, "RunMJAIClientToolDefinitionViewByID", null);
14496
+ __decorate([
14497
+ Query(() => RunMJAIClientToolDefinitionViewResult),
14498
+ __param(0, Arg('input', () => RunViewByNameInput)),
14499
+ __param(1, Ctx()),
14500
+ __param(2, PubSub()),
14501
+ __metadata("design:type", Function),
14502
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
14503
+ __metadata("design:returntype", Promise)
14504
+ ], MJAIClientToolDefinitionResolver.prototype, "RunMJAIClientToolDefinitionViewByName", null);
14505
+ __decorate([
14506
+ Query(() => RunMJAIClientToolDefinitionViewResult),
14507
+ __param(0, Arg('input', () => RunDynamicViewInput)),
14508
+ __param(1, Ctx()),
14509
+ __param(2, PubSub()),
14510
+ __metadata("design:type", Function),
14511
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
14512
+ __metadata("design:returntype", Promise)
14513
+ ], MJAIClientToolDefinitionResolver.prototype, "RunMJAIClientToolDefinitionDynamicView", null);
14514
+ __decorate([
14515
+ Query(() => MJAIClientToolDefinition_, { nullable: true }),
14516
+ __param(0, Arg('ID', () => String)),
14517
+ __param(1, Ctx()),
14518
+ __param(2, PubSub()),
14519
+ __metadata("design:type", Function),
14520
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
14521
+ __metadata("design:returntype", Promise)
14522
+ ], MJAIClientToolDefinitionResolver.prototype, "MJAIClientToolDefinition", null);
14523
+ __decorate([
14524
+ FieldResolver(() => [MJAIAgentClientTool_]),
14525
+ __param(0, Root()),
14526
+ __param(1, Ctx()),
14527
+ __param(2, PubSub()),
14528
+ __metadata("design:type", Function),
14529
+ __metadata("design:paramtypes", [MJAIClientToolDefinition_, Object, PubSubEngine]),
14530
+ __metadata("design:returntype", Promise)
14531
+ ], MJAIClientToolDefinitionResolver.prototype, "MJAIAgentClientTools_ClientToolDefinitionIDArray", null);
14532
+ __decorate([
14533
+ Mutation(() => MJAIClientToolDefinition_),
14534
+ __param(0, Arg('input', () => CreateMJAIClientToolDefinitionInput)),
14535
+ __param(1, Ctx()),
14536
+ __param(2, PubSub()),
14537
+ __metadata("design:type", Function),
14538
+ __metadata("design:paramtypes", [CreateMJAIClientToolDefinitionInput, Object, PubSubEngine]),
14539
+ __metadata("design:returntype", Promise)
14540
+ ], MJAIClientToolDefinitionResolver.prototype, "CreateMJAIClientToolDefinition", null);
14541
+ __decorate([
14542
+ Mutation(() => MJAIClientToolDefinition_),
14543
+ __param(0, Arg('input', () => UpdateMJAIClientToolDefinitionInput)),
14544
+ __param(1, Ctx()),
14545
+ __param(2, PubSub()),
14546
+ __metadata("design:type", Function),
14547
+ __metadata("design:paramtypes", [UpdateMJAIClientToolDefinitionInput, Object, PubSubEngine]),
14548
+ __metadata("design:returntype", Promise)
14549
+ ], MJAIClientToolDefinitionResolver.prototype, "UpdateMJAIClientToolDefinition", null);
14550
+ __decorate([
14551
+ Mutation(() => MJAIClientToolDefinition_),
14552
+ __param(0, Arg('ID', () => String)),
14553
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
14554
+ __param(2, Ctx()),
14555
+ __param(3, PubSub()),
14556
+ __metadata("design:type", Function),
14557
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
14558
+ __metadata("design:returntype", Promise)
14559
+ ], MJAIClientToolDefinitionResolver.prototype, "DeleteMJAIClientToolDefinition", null);
14560
+ MJAIClientToolDefinitionResolver = __decorate([
14561
+ Resolver(MJAIClientToolDefinition_)
14562
+ ], MJAIClientToolDefinitionResolver);
14563
+ export { MJAIClientToolDefinitionResolver };
14564
+ //****************************************************************************
13978
14565
  // ENTITY CLASS for MJ: AI Configuration Params
13979
14566
  //****************************************************************************
13980
14567
  let MJAIConfigurationParam_ = class MJAIConfigurationParam_ {
@@ -18104,10 +18691,18 @@ __decorate([
18104
18691
  Field(() => [MJAIModelCost_]),
18105
18692
  __metadata("design:type", Array)
18106
18693
  ], MJAIModel_.prototype, "MJAIModelCosts_ModelIDArray", void 0);
18694
+ __decorate([
18695
+ Field(() => [MJContentType_]),
18696
+ __metadata("design:type", Array)
18697
+ ], MJAIModel_.prototype, "MJContentTypes_EmbeddingModelIDArray", void 0);
18107
18698
  __decorate([
18108
18699
  Field(() => [MJAIPromptModel_]),
18109
18700
  __metadata("design:type", Array)
18110
18701
  ], MJAIModel_.prototype, "MJAIPromptModels_ModelIDArray", void 0);
18702
+ __decorate([
18703
+ Field(() => [MJContentSource_]),
18704
+ __metadata("design:type", Array)
18705
+ ], MJAIModel_.prototype, "MJContentSources_EmbeddingModelIDArray", void 0);
18111
18706
  __decorate([
18112
18707
  Field(() => [MJAIPromptRun_]),
18113
18708
  __metadata("design:type", Array)
@@ -18501,6 +19096,14 @@ let MJAIModelResolver = class MJAIModelResolver extends ResolverBase {
18501
19096
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Model Costs', rows, this.GetUserFromPayload(userPayload));
18502
19097
  return result;
18503
19098
  }
19099
+ async MJContentTypes_EmbeddingModelIDArray(mjaimodel_, { userPayload, providers }, pubSub) {
19100
+ this.CheckUserReadPermissions('MJ: Content Types', userPayload);
19101
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19102
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentTypes')} WHERE ${provider.QuoteIdentifier('EmbeddingModelID')}='${mjaimodel_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Types', userPayload, EntityPermissionType.Read, 'AND');
19103
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
19104
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Types', rows, this.GetUserFromPayload(userPayload));
19105
+ return result;
19106
+ }
18504
19107
  async MJAIPromptModels_ModelIDArray(mjaimodel_, { userPayload, providers }, pubSub) {
18505
19108
  this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
18506
19109
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -18509,6 +19112,14 @@ let MJAIModelResolver = class MJAIModelResolver extends ResolverBase {
18509
19112
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows, this.GetUserFromPayload(userPayload));
18510
19113
  return result;
18511
19114
  }
19115
+ async MJContentSources_EmbeddingModelIDArray(mjaimodel_, { userPayload, providers }, pubSub) {
19116
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
19117
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19118
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('EmbeddingModelID')}='${mjaimodel_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
19119
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
19120
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
19121
+ return result;
19122
+ }
18512
19123
  async MJAIPromptRuns_OriginalModelIDArray(mjaimodel_, { userPayload, providers }, pubSub) {
18513
19124
  this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
18514
19125
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -18742,6 +19353,15 @@ __decorate([
18742
19353
  __metadata("design:paramtypes", [MJAIModel_, Object, PubSubEngine]),
18743
19354
  __metadata("design:returntype", Promise)
18744
19355
  ], MJAIModelResolver.prototype, "MJAIModelCosts_ModelIDArray", null);
19356
+ __decorate([
19357
+ FieldResolver(() => [MJContentType_]),
19358
+ __param(0, Root()),
19359
+ __param(1, Ctx()),
19360
+ __param(2, PubSub()),
19361
+ __metadata("design:type", Function),
19362
+ __metadata("design:paramtypes", [MJAIModel_, Object, PubSubEngine]),
19363
+ __metadata("design:returntype", Promise)
19364
+ ], MJAIModelResolver.prototype, "MJContentTypes_EmbeddingModelIDArray", null);
18745
19365
  __decorate([
18746
19366
  FieldResolver(() => [MJAIPromptModel_]),
18747
19367
  __param(0, Root()),
@@ -18751,6 +19371,15 @@ __decorate([
18751
19371
  __metadata("design:paramtypes", [MJAIModel_, Object, PubSubEngine]),
18752
19372
  __metadata("design:returntype", Promise)
18753
19373
  ], MJAIModelResolver.prototype, "MJAIPromptModels_ModelIDArray", null);
19374
+ __decorate([
19375
+ FieldResolver(() => [MJContentSource_]),
19376
+ __param(0, Root()),
19377
+ __param(1, Ctx()),
19378
+ __param(2, PubSub()),
19379
+ __metadata("design:type", Function),
19380
+ __metadata("design:paramtypes", [MJAIModel_, Object, PubSubEngine]),
19381
+ __metadata("design:returntype", Promise)
19382
+ ], MJAIModelResolver.prototype, "MJContentSources_EmbeddingModelIDArray", null);
18754
19383
  __decorate([
18755
19384
  FieldResolver(() => [MJAIPromptRun_]),
18756
19385
  __param(0, Root()),
@@ -38363,6 +38992,10 @@ __decorate([
38363
38992
  Field(),
38364
38993
  __metadata("design:type", Date)
38365
38994
  ], MJContentItemTag_.prototype, "_mj__UpdatedAt", void 0);
38995
+ __decorate([
38996
+ Field(() => Float, { description: `Relevance weight for this tag (0.0-1.0). 1.0 = highly relevant central topic, 0.5 = moderately relevant, 0.1 = tangentially related. Assigned by the LLM during autotagging.` }),
38997
+ __metadata("design:type", Number)
38998
+ ], MJContentItemTag_.prototype, "Weight", void 0);
38366
38999
  __decorate([
38367
39000
  Field({ nullable: true }),
38368
39001
  MaxLength(250),
@@ -38389,6 +39022,10 @@ __decorate([
38389
39022
  Field({ nullable: true }),
38390
39023
  __metadata("design:type", String)
38391
39024
  ], CreateMJContentItemTagInput.prototype, "Tag", void 0);
39025
+ __decorate([
39026
+ Field(() => Float, { nullable: true }),
39027
+ __metadata("design:type", Number)
39028
+ ], CreateMJContentItemTagInput.prototype, "Weight", void 0);
38392
39029
  CreateMJContentItemTagInput = __decorate([
38393
39030
  InputType()
38394
39031
  ], CreateMJContentItemTagInput);
@@ -38410,6 +39047,10 @@ __decorate([
38410
39047
  Field({ nullable: true }),
38411
39048
  __metadata("design:type", String)
38412
39049
  ], UpdateMJContentItemTagInput.prototype, "Tag", void 0);
39050
+ __decorate([
39051
+ Field(() => Float, { nullable: true }),
39052
+ __metadata("design:type", Number)
39053
+ ], UpdateMJContentItemTagInput.prototype, "Weight", void 0);
38413
39054
  __decorate([
38414
39055
  Field(() => [KeyValuePairInput], { nullable: true }),
38415
39056
  __metadata("design:type", Array)
@@ -39984,6 +40625,16 @@ __decorate([
39984
40625
  Field(),
39985
40626
  __metadata("design:type", Date)
39986
40627
  ], MJContentSource_.prototype, "_mj__UpdatedAt", void 0);
40628
+ __decorate([
40629
+ Field({ nullable: true, description: `Per-source override for the AI embedding model. When NULL, falls back to the ContentType default.` }),
40630
+ MaxLength(36),
40631
+ __metadata("design:type", String)
40632
+ ], MJContentSource_.prototype, "EmbeddingModelID", void 0);
40633
+ __decorate([
40634
+ Field({ nullable: true, description: `Per-source override for the vector index. When NULL, falls back to the ContentType default.` }),
40635
+ MaxLength(36),
40636
+ __metadata("design:type", String)
40637
+ ], MJContentSource_.prototype, "VectorIndexID", void 0);
39987
40638
  __decorate([
39988
40639
  Field(),
39989
40640
  MaxLength(255),
@@ -39999,6 +40650,16 @@ __decorate([
39999
40650
  MaxLength(255),
40000
40651
  __metadata("design:type", String)
40001
40652
  ], MJContentSource_.prototype, "ContentFileType", void 0);
40653
+ __decorate([
40654
+ Field({ nullable: true }),
40655
+ MaxLength(50),
40656
+ __metadata("design:type", String)
40657
+ ], MJContentSource_.prototype, "EmbeddingModel", void 0);
40658
+ __decorate([
40659
+ Field({ nullable: true }),
40660
+ MaxLength(255),
40661
+ __metadata("design:type", String)
40662
+ ], MJContentSource_.prototype, "VectorIndex", void 0);
40002
40663
  __decorate([
40003
40664
  Field(() => [MJContentItem_]),
40004
40665
  __metadata("design:type", Array)
@@ -40044,6 +40705,14 @@ __decorate([
40044
40705
  Field({ nullable: true }),
40045
40706
  __metadata("design:type", String)
40046
40707
  ], CreateMJContentSourceInput.prototype, "URL", void 0);
40708
+ __decorate([
40709
+ Field({ nullable: true }),
40710
+ __metadata("design:type", String)
40711
+ ], CreateMJContentSourceInput.prototype, "EmbeddingModelID", void 0);
40712
+ __decorate([
40713
+ Field({ nullable: true }),
40714
+ __metadata("design:type", String)
40715
+ ], CreateMJContentSourceInput.prototype, "VectorIndexID", void 0);
40047
40716
  CreateMJContentSourceInput = __decorate([
40048
40717
  InputType()
40049
40718
  ], CreateMJContentSourceInput);
@@ -40077,6 +40746,14 @@ __decorate([
40077
40746
  Field({ nullable: true }),
40078
40747
  __metadata("design:type", String)
40079
40748
  ], UpdateMJContentSourceInput.prototype, "URL", void 0);
40749
+ __decorate([
40750
+ Field({ nullable: true }),
40751
+ __metadata("design:type", String)
40752
+ ], UpdateMJContentSourceInput.prototype, "EmbeddingModelID", void 0);
40753
+ __decorate([
40754
+ Field({ nullable: true }),
40755
+ __metadata("design:type", String)
40756
+ ], UpdateMJContentSourceInput.prototype, "VectorIndexID", void 0);
40080
40757
  __decorate([
40081
40758
  Field(() => [KeyValuePairInput], { nullable: true }),
40082
40759
  __metadata("design:type", Array)
@@ -40560,11 +41237,31 @@ __decorate([
40560
41237
  Field(),
40561
41238
  __metadata("design:type", Date)
40562
41239
  ], MJContentType_.prototype, "_mj__UpdatedAt", void 0);
41240
+ __decorate([
41241
+ Field({ nullable: true, description: `Default AI embedding model for vectorizing content items of this type. Sources can override per-source. If NULL, uses the first available embedding model.` }),
41242
+ MaxLength(36),
41243
+ __metadata("design:type", String)
41244
+ ], MJContentType_.prototype, "EmbeddingModelID", void 0);
41245
+ __decorate([
41246
+ Field({ nullable: true, description: `Default vector index for storing embeddings of this content type. Sources can override per-source. If NULL, uses the first available vector index.` }),
41247
+ MaxLength(36),
41248
+ __metadata("design:type", String)
41249
+ ], MJContentType_.prototype, "VectorIndexID", void 0);
40563
41250
  __decorate([
40564
41251
  Field(),
40565
41252
  MaxLength(50),
40566
41253
  __metadata("design:type", String)
40567
41254
  ], MJContentType_.prototype, "AIModel", void 0);
41255
+ __decorate([
41256
+ Field({ nullable: true }),
41257
+ MaxLength(50),
41258
+ __metadata("design:type", String)
41259
+ ], MJContentType_.prototype, "EmbeddingModel", void 0);
41260
+ __decorate([
41261
+ Field({ nullable: true }),
41262
+ MaxLength(255),
41263
+ __metadata("design:type", String)
41264
+ ], MJContentType_.prototype, "VectorIndex", void 0);
40568
41265
  __decorate([
40569
41266
  Field(() => [MJContentSource_]),
40570
41267
  __metadata("design:type", Array)
@@ -40606,6 +41303,14 @@ __decorate([
40606
41303
  Field(() => Int, { nullable: true }),
40607
41304
  __metadata("design:type", Number)
40608
41305
  ], CreateMJContentTypeInput.prototype, "MaxTags", void 0);
41306
+ __decorate([
41307
+ Field({ nullable: true }),
41308
+ __metadata("design:type", String)
41309
+ ], CreateMJContentTypeInput.prototype, "EmbeddingModelID", void 0);
41310
+ __decorate([
41311
+ Field({ nullable: true }),
41312
+ __metadata("design:type", String)
41313
+ ], CreateMJContentTypeInput.prototype, "VectorIndexID", void 0);
40609
41314
  CreateMJContentTypeInput = __decorate([
40610
41315
  InputType()
40611
41316
  ], CreateMJContentTypeInput);
@@ -40639,6 +41344,14 @@ __decorate([
40639
41344
  Field(() => Int, { nullable: true }),
40640
41345
  __metadata("design:type", Number)
40641
41346
  ], UpdateMJContentTypeInput.prototype, "MaxTags", void 0);
41347
+ __decorate([
41348
+ Field({ nullable: true }),
41349
+ __metadata("design:type", String)
41350
+ ], UpdateMJContentTypeInput.prototype, "EmbeddingModelID", void 0);
41351
+ __decorate([
41352
+ Field({ nullable: true }),
41353
+ __metadata("design:type", String)
41354
+ ], UpdateMJContentTypeInput.prototype, "VectorIndexID", void 0);
40642
41355
  __decorate([
40643
41356
  Field(() => [KeyValuePairInput], { nullable: true }),
40644
41357
  __metadata("design:type", Array)
@@ -48613,6 +49326,10 @@ __decorate([
48613
49326
  Field(),
48614
49327
  __metadata("design:type", Date)
48615
49328
  ], MJDuplicateRunDetailMatch_.prototype, "_mj__UpdatedAt", void 0);
49329
+ __decorate([
49330
+ Field({ nullable: true, description: `JSON metadata snapshot of the matched record from the vector database at detection time. Contains display fields (Name, Description, EntityIcon, etc.) for rich UI rendering without additional lookups.` }),
49331
+ __metadata("design:type", String)
49332
+ ], MJDuplicateRunDetailMatch_.prototype, "RecordMetadata", void 0);
48616
49333
  __decorate([
48617
49334
  Field(),
48618
49335
  MaxLength(500),
@@ -48676,6 +49393,10 @@ __decorate([
48676
49393
  Field({ nullable: true }),
48677
49394
  __metadata("design:type", Date)
48678
49395
  ], CreateMJDuplicateRunDetailMatchInput.prototype, "MergedAt", void 0);
49396
+ __decorate([
49397
+ Field({ nullable: true }),
49398
+ __metadata("design:type", String)
49399
+ ], CreateMJDuplicateRunDetailMatchInput.prototype, "RecordMetadata", void 0);
48679
49400
  CreateMJDuplicateRunDetailMatchInput = __decorate([
48680
49401
  InputType()
48681
49402
  ], CreateMJDuplicateRunDetailMatchInput);
@@ -48729,6 +49450,10 @@ __decorate([
48729
49450
  Field({ nullable: true }),
48730
49451
  __metadata("design:type", Date)
48731
49452
  ], UpdateMJDuplicateRunDetailMatchInput.prototype, "MergedAt", void 0);
49453
+ __decorate([
49454
+ Field({ nullable: true }),
49455
+ __metadata("design:type", String)
49456
+ ], UpdateMJDuplicateRunDetailMatchInput.prototype, "RecordMetadata", void 0);
48732
49457
  __decorate([
48733
49458
  Field(() => [KeyValuePairInput], { nullable: true }),
48734
49459
  __metadata("design:type", Array)
@@ -48928,6 +49653,10 @@ __decorate([
48928
49653
  Field(),
48929
49654
  __metadata("design:type", Date)
48930
49655
  ], MJDuplicateRunDetail_.prototype, "_mj__UpdatedAt", void 0);
49656
+ __decorate([
49657
+ Field({ nullable: true, description: `JSON metadata snapshot of the source record from the vector database at detection time. Contains display fields (Name, Description, EntityIcon, etc.) for rich UI rendering without additional lookups.` }),
49658
+ __metadata("design:type", String)
49659
+ ], MJDuplicateRunDetail_.prototype, "RecordMetadata", void 0);
48931
49660
  __decorate([
48932
49661
  Field(),
48933
49662
  MaxLength(255),
@@ -48978,6 +49707,10 @@ __decorate([
48978
49707
  Field({ nullable: true }),
48979
49708
  __metadata("design:type", String)
48980
49709
  ], CreateMJDuplicateRunDetailInput.prototype, "MergeErrorMessage", void 0);
49710
+ __decorate([
49711
+ Field({ nullable: true }),
49712
+ __metadata("design:type", String)
49713
+ ], CreateMJDuplicateRunDetailInput.prototype, "RecordMetadata", void 0);
48981
49714
  CreateMJDuplicateRunDetailInput = __decorate([
48982
49715
  InputType()
48983
49716
  ], CreateMJDuplicateRunDetailInput);
@@ -49019,6 +49752,10 @@ __decorate([
49019
49752
  Field({ nullable: true }),
49020
49753
  __metadata("design:type", String)
49021
49754
  ], UpdateMJDuplicateRunDetailInput.prototype, "MergeErrorMessage", void 0);
49755
+ __decorate([
49756
+ Field({ nullable: true }),
49757
+ __metadata("design:type", String)
49758
+ ], UpdateMJDuplicateRunDetailInput.prototype, "RecordMetadata", void 0);
49022
49759
  __decorate([
49023
49760
  Field(() => [KeyValuePairInput], { nullable: true }),
49024
49761
  __metadata("design:type", Array)
@@ -49206,7 +49943,7 @@ __decorate([
49206
49943
  __metadata("design:type", String)
49207
49944
  ], MJDuplicateRun_.prototype, "StartedByUserID", void 0);
49208
49945
  __decorate([
49209
- Field(),
49946
+ Field({ nullable: true, description: `Optional List ID to narrow the scope of duplicate detection. When NULL, all records in the entity are scanned. When set, only records in the specified list are checked for duplicates.` }),
49210
49947
  MaxLength(36),
49211
49948
  __metadata("design:type", String)
49212
49949
  ], MJDuplicateRun_.prototype, "SourceListID", void 0);
@@ -49260,7 +49997,7 @@ __decorate([
49260
49997
  __metadata("design:type", String)
49261
49998
  ], MJDuplicateRun_.prototype, "StartedByUser", void 0);
49262
49999
  __decorate([
49263
- Field(),
50000
+ Field({ nullable: true }),
49264
50001
  MaxLength(100),
49265
50002
  __metadata("design:type", String)
49266
50003
  ], MJDuplicateRun_.prototype, "SourceList", void 0);
@@ -56678,6 +57415,15 @@ __decorate([
56678
57415
  Field(),
56679
57416
  __metadata("design:type", Date)
56680
57417
  ], MJEntityDocument_.prototype, "_mj__UpdatedAt", void 0);
57418
+ __decorate([
57419
+ Field({ nullable: true, description: `Optional foreign key to the specific Vector Index where this entity document's embeddings should be stored. When specified, the vectorization pipeline will upsert vectors directly to this index rather than auto-creating or looking up an index based on VectorDatabaseID + AIModelID. This enables explicit control over which Pinecone/Weaviate/etc. index is used per entity document, supporting multi-index architectures and shared indexes across entity types.` }),
57420
+ MaxLength(36),
57421
+ __metadata("design:type", String)
57422
+ ], MJEntityDocument_.prototype, "VectorIndexID", void 0);
57423
+ __decorate([
57424
+ Field({ nullable: true, description: `JSON configuration settings for this entity document. Controls vector metadata field inclusion (which fields get stored in the vector index for search result display), large field truncation limits, and future settings like sync scheduling and threshold overrides. NULL means use system defaults.` }),
57425
+ __metadata("design:type", String)
57426
+ ], MJEntityDocument_.prototype, "Configuration", void 0);
56681
57427
  __decorate([
56682
57428
  Field(),
56683
57429
  MaxLength(100),
@@ -56703,6 +57449,11 @@ __decorate([
56703
57449
  MaxLength(50),
56704
57450
  __metadata("design:type", String)
56705
57451
  ], MJEntityDocument_.prototype, "AIModel", void 0);
57452
+ __decorate([
57453
+ Field({ nullable: true }),
57454
+ MaxLength(255),
57455
+ __metadata("design:type", String)
57456
+ ], MJEntityDocument_.prototype, "VectorIndex", void 0);
56706
57457
  __decorate([
56707
57458
  Field(() => [MJEntityDocumentRun_]),
56708
57459
  __metadata("design:type", Array)
@@ -56764,6 +57515,14 @@ __decorate([
56764
57515
  Field(() => Float, { nullable: true }),
56765
57516
  __metadata("design:type", Number)
56766
57517
  ], CreateMJEntityDocumentInput.prototype, "AbsoluteMatchThreshold", void 0);
57518
+ __decorate([
57519
+ Field({ nullable: true }),
57520
+ __metadata("design:type", String)
57521
+ ], CreateMJEntityDocumentInput.prototype, "VectorIndexID", void 0);
57522
+ __decorate([
57523
+ Field({ nullable: true }),
57524
+ __metadata("design:type", String)
57525
+ ], CreateMJEntityDocumentInput.prototype, "Configuration", void 0);
56767
57526
  CreateMJEntityDocumentInput = __decorate([
56768
57527
  InputType()
56769
57528
  ], CreateMJEntityDocumentInput);
@@ -56813,6 +57572,14 @@ __decorate([
56813
57572
  Field(() => Float, { nullable: true }),
56814
57573
  __metadata("design:type", Number)
56815
57574
  ], UpdateMJEntityDocumentInput.prototype, "AbsoluteMatchThreshold", void 0);
57575
+ __decorate([
57576
+ Field({ nullable: true }),
57577
+ __metadata("design:type", String)
57578
+ ], UpdateMJEntityDocumentInput.prototype, "VectorIndexID", void 0);
57579
+ __decorate([
57580
+ Field({ nullable: true }),
57581
+ __metadata("design:type", String)
57582
+ ], UpdateMJEntityDocumentInput.prototype, "Configuration", void 0);
56816
57583
  __decorate([
56817
57584
  Field(() => [KeyValuePairInput], { nullable: true }),
56818
57585
  __metadata("design:type", Array)
@@ -57550,6 +58317,19 @@ __decorate([
57550
58317
  Field({ nullable: true, description: `JSON configuration for additional fields to join from the related entity into this entity's base view. Supports modes: extend (add to NameField), override (replace NameField), disable (no joins). Schema: { mode?: string, fields?: [{ field: string, alias?: string }] }` }),
57551
58318
  __metadata("design:type", String)
57552
58319
  ], MJEntityField_.prototype, "RelatedEntityJoinFields", void 0);
58320
+ __decorate([
58321
+ Field({ nullable: true, description: `The name of the TypeScript interface/type for this JSON field. When set, CodeGen emits a strongly-typed Object-suffixed accessor using this type instead of only the default string getter/setter.` }),
58322
+ MaxLength(255),
58323
+ __metadata("design:type", String)
58324
+ ], MJEntityField_.prototype, "JSONType", void 0);
58325
+ __decorate([
58326
+ Field(() => Boolean, { description: `If true, the field holds a JSON array of JSONType items. The Object accessor returns Array<JSONType> | null and the setter accepts Array<JSONType> | null.` }),
58327
+ __metadata("design:type", Boolean)
58328
+ ], MJEntityField_.prototype, "JSONTypeIsArray", void 0);
58329
+ __decorate([
58330
+ Field({ nullable: true, description: `Raw TypeScript code emitted by CodeGen above the entity class definition. Typically contains the interface/type definition referenced by JSONType. Can include imports, multiple types, or any valid TypeScript.` }),
58331
+ __metadata("design:type", String)
58332
+ ], MJEntityField_.prototype, "JSONTypeDefinition", void 0);
57553
58333
  __decorate([
57554
58334
  Field({ nullable: true }),
57555
58335
  __metadata("design:type", String)
@@ -57795,6 +58575,18 @@ __decorate([
57795
58575
  Field({ nullable: true }),
57796
58576
  __metadata("design:type", String)
57797
58577
  ], CreateMJEntityFieldInput.prototype, "RelatedEntityJoinFields", void 0);
58578
+ __decorate([
58579
+ Field({ nullable: true }),
58580
+ __metadata("design:type", String)
58581
+ ], CreateMJEntityFieldInput.prototype, "JSONType", void 0);
58582
+ __decorate([
58583
+ Field(() => Boolean, { nullable: true }),
58584
+ __metadata("design:type", Boolean)
58585
+ ], CreateMJEntityFieldInput.prototype, "JSONTypeIsArray", void 0);
58586
+ __decorate([
58587
+ Field({ nullable: true }),
58588
+ __metadata("design:type", String)
58589
+ ], CreateMJEntityFieldInput.prototype, "JSONTypeDefinition", void 0);
57798
58590
  CreateMJEntityFieldInput = __decorate([
57799
58591
  InputType()
57800
58592
  ], CreateMJEntityFieldInput);
@@ -57976,6 +58768,18 @@ __decorate([
57976
58768
  Field({ nullable: true }),
57977
58769
  __metadata("design:type", String)
57978
58770
  ], UpdateMJEntityFieldInput.prototype, "RelatedEntityJoinFields", void 0);
58771
+ __decorate([
58772
+ Field({ nullable: true }),
58773
+ __metadata("design:type", String)
58774
+ ], UpdateMJEntityFieldInput.prototype, "JSONType", void 0);
58775
+ __decorate([
58776
+ Field(() => Boolean, { nullable: true }),
58777
+ __metadata("design:type", Boolean)
58778
+ ], UpdateMJEntityFieldInput.prototype, "JSONTypeIsArray", void 0);
58779
+ __decorate([
58780
+ Field({ nullable: true }),
58781
+ __metadata("design:type", String)
58782
+ ], UpdateMJEntityFieldInput.prototype, "JSONTypeDefinition", void 0);
57979
58783
  __decorate([
57980
58784
  Field(() => [KeyValuePairInput], { nullable: true }),
57981
58785
  __metadata("design:type", Array)
@@ -99376,6 +100180,10 @@ __decorate([
99376
100180
  Field(),
99377
100181
  __metadata("design:type", Date)
99378
100182
  ], MJVectorDatabase_.prototype, "_mj__UpdatedAt", void 0);
100183
+ __decorate([
100184
+ Field({ nullable: true, description: `JSON configuration settings for this vector database provider. Stores provider-specific connection settings like custom host URLs, authentication configuration, timeouts, retry policies, and batch size limits. NULL means use defaults from environment variables or provider defaults.` }),
100185
+ __metadata("design:type", String)
100186
+ ], MJVectorDatabase_.prototype, "Configuration", void 0);
99379
100187
  __decorate([
99380
100188
  Field(() => [MJVectorIndex_]),
99381
100189
  __metadata("design:type", Array)
@@ -99413,6 +100221,10 @@ __decorate([
99413
100221
  Field({ nullable: true }),
99414
100222
  __metadata("design:type", String)
99415
100223
  ], CreateMJVectorDatabaseInput.prototype, "ClassKey", void 0);
100224
+ __decorate([
100225
+ Field({ nullable: true }),
100226
+ __metadata("design:type", String)
100227
+ ], CreateMJVectorDatabaseInput.prototype, "Configuration", void 0);
99416
100228
  CreateMJVectorDatabaseInput = __decorate([
99417
100229
  InputType()
99418
100230
  ], CreateMJVectorDatabaseInput);
@@ -99442,6 +100254,10 @@ __decorate([
99442
100254
  Field({ nullable: true }),
99443
100255
  __metadata("design:type", String)
99444
100256
  ], UpdateMJVectorDatabaseInput.prototype, "ClassKey", void 0);
100257
+ __decorate([
100258
+ Field({ nullable: true }),
100259
+ __metadata("design:type", String)
100260
+ ], UpdateMJVectorDatabaseInput.prototype, "Configuration", void 0);
99445
100261
  __decorate([
99446
100262
  Field(() => [KeyValuePairInput], { nullable: true }),
99447
100263
  __metadata("design:type", Array)
@@ -99662,6 +100478,24 @@ __decorate([
99662
100478
  Field(),
99663
100479
  __metadata("design:type", Date)
99664
100480
  ], MJVectorIndex_.prototype, "_mj__UpdatedAt", void 0);
100481
+ __decorate([
100482
+ Field({ nullable: true, description: `The provider's native identifier for this index. For Pinecone this is the index name; for other providers it may be a separate UUID or identifier. Used for syncing operations between MJ metadata and the remote vector database.` }),
100483
+ MaxLength(500),
100484
+ __metadata("design:type", String)
100485
+ ], MJVectorIndex_.prototype, "ExternalID", void 0);
100486
+ __decorate([
100487
+ Field(() => Int, { nullable: true, description: `The number of dimensions for vectors stored in this index. Determined by the embedding model (e.g., 1536 for text-embedding-3-small, 768 for all-mpnet-base-v2). Set automatically when the index is created via the vector database provider.` }),
100488
+ __metadata("design:type", Number)
100489
+ ], MJVectorIndex_.prototype, "Dimensions", void 0);
100490
+ __decorate([
100491
+ Field({ nullable: true, description: `The distance metric used for similarity calculations in this index. Common values: cosine (default, measures angular similarity), euclidean (L2 distance), dotproduct (inner product). Must match what the vector database provider was configured with.` }),
100492
+ MaxLength(50),
100493
+ __metadata("design:type", String)
100494
+ ], MJVectorIndex_.prototype, "Metric", void 0);
100495
+ __decorate([
100496
+ Field({ nullable: true, description: `JSON object containing provider-specific configuration for this index. For Pinecone serverless: {"cloud":"aws","region":"us-east-1"}. For pod-based: {"environment":"us-east1-gcp","podType":"p1.x1","replicas":1}. Stored as a flexible JSON bag to support any provider without schema changes.` }),
100497
+ __metadata("design:type", String)
100498
+ ], MJVectorIndex_.prototype, "ProviderConfig", void 0);
99665
100499
  __decorate([
99666
100500
  Field(),
99667
100501
  MaxLength(100),
@@ -99676,6 +100510,18 @@ __decorate([
99676
100510
  Field(() => [MJEntityRecordDocument_]),
99677
100511
  __metadata("design:type", Array)
99678
100512
  ], MJVectorIndex_.prototype, "MJEntityRecordDocuments_VectorIndexIDArray", void 0);
100513
+ __decorate([
100514
+ Field(() => [MJEntityDocument_]),
100515
+ __metadata("design:type", Array)
100516
+ ], MJVectorIndex_.prototype, "MJEntityDocuments_VectorIndexIDArray", void 0);
100517
+ __decorate([
100518
+ Field(() => [MJContentType_]),
100519
+ __metadata("design:type", Array)
100520
+ ], MJVectorIndex_.prototype, "MJContentTypes_VectorIndexIDArray", void 0);
100521
+ __decorate([
100522
+ Field(() => [MJContentSource_]),
100523
+ __metadata("design:type", Array)
100524
+ ], MJVectorIndex_.prototype, "MJContentSources_VectorIndexIDArray", void 0);
99679
100525
  MJVectorIndex_ = __decorate([
99680
100526
  ObjectType({ description: `Defines vector indexes within a given Vector Database.` })
99681
100527
  ], MJVectorIndex_);
@@ -99705,6 +100551,22 @@ __decorate([
99705
100551
  Field({ nullable: true }),
99706
100552
  __metadata("design:type", String)
99707
100553
  ], CreateMJVectorIndexInput.prototype, "EmbeddingModelID", void 0);
100554
+ __decorate([
100555
+ Field({ nullable: true }),
100556
+ __metadata("design:type", String)
100557
+ ], CreateMJVectorIndexInput.prototype, "ExternalID", void 0);
100558
+ __decorate([
100559
+ Field(() => Int, { nullable: true }),
100560
+ __metadata("design:type", Number)
100561
+ ], CreateMJVectorIndexInput.prototype, "Dimensions", void 0);
100562
+ __decorate([
100563
+ Field({ nullable: true }),
100564
+ __metadata("design:type", String)
100565
+ ], CreateMJVectorIndexInput.prototype, "Metric", void 0);
100566
+ __decorate([
100567
+ Field({ nullable: true }),
100568
+ __metadata("design:type", String)
100569
+ ], CreateMJVectorIndexInput.prototype, "ProviderConfig", void 0);
99708
100570
  CreateMJVectorIndexInput = __decorate([
99709
100571
  InputType()
99710
100572
  ], CreateMJVectorIndexInput);
@@ -99734,6 +100596,22 @@ __decorate([
99734
100596
  Field({ nullable: true }),
99735
100597
  __metadata("design:type", String)
99736
100598
  ], UpdateMJVectorIndexInput.prototype, "EmbeddingModelID", void 0);
100599
+ __decorate([
100600
+ Field({ nullable: true }),
100601
+ __metadata("design:type", String)
100602
+ ], UpdateMJVectorIndexInput.prototype, "ExternalID", void 0);
100603
+ __decorate([
100604
+ Field(() => Int, { nullable: true }),
100605
+ __metadata("design:type", Number)
100606
+ ], UpdateMJVectorIndexInput.prototype, "Dimensions", void 0);
100607
+ __decorate([
100608
+ Field({ nullable: true }),
100609
+ __metadata("design:type", String)
100610
+ ], UpdateMJVectorIndexInput.prototype, "Metric", void 0);
100611
+ __decorate([
100612
+ Field({ nullable: true }),
100613
+ __metadata("design:type", String)
100614
+ ], UpdateMJVectorIndexInput.prototype, "ProviderConfig", void 0);
99737
100615
  __decorate([
99738
100616
  Field(() => [KeyValuePairInput], { nullable: true }),
99739
100617
  __metadata("design:type", Array)
@@ -99809,6 +100687,30 @@ let MJVectorIndexResolver = class MJVectorIndexResolver extends ResolverBase {
99809
100687
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Record Documents', rows, this.GetUserFromPayload(userPayload));
99810
100688
  return result;
99811
100689
  }
100690
+ async MJEntityDocuments_VectorIndexIDArray(mjvectorindex_, { userPayload, providers }, pubSub) {
100691
+ this.CheckUserReadPermissions('MJ: Entity Documents', userPayload);
100692
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
100693
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityDocuments')} WHERE ${provider.QuoteIdentifier('VectorIndexID')}='${mjvectorindex_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Documents', userPayload, EntityPermissionType.Read, 'AND');
100694
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
100695
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Documents', rows, this.GetUserFromPayload(userPayload));
100696
+ return result;
100697
+ }
100698
+ async MJContentTypes_VectorIndexIDArray(mjvectorindex_, { userPayload, providers }, pubSub) {
100699
+ this.CheckUserReadPermissions('MJ: Content Types', userPayload);
100700
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
100701
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentTypes')} WHERE ${provider.QuoteIdentifier('VectorIndexID')}='${mjvectorindex_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Types', userPayload, EntityPermissionType.Read, 'AND');
100702
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
100703
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Types', rows, this.GetUserFromPayload(userPayload));
100704
+ return result;
100705
+ }
100706
+ async MJContentSources_VectorIndexIDArray(mjvectorindex_, { userPayload, providers }, pubSub) {
100707
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
100708
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
100709
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('VectorIndexID')}='${mjvectorindex_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
100710
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
100711
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
100712
+ return result;
100713
+ }
99812
100714
  async CreateMJVectorIndex(input, { providers, userPayload }, pubSub) {
99813
100715
  const provider = GetReadWriteProvider(providers);
99814
100716
  return this.CreateRecord('MJ: Vector Indexes', input, provider, userPayload, pubSub);
@@ -99868,6 +100770,33 @@ __decorate([
99868
100770
  __metadata("design:paramtypes", [MJVectorIndex_, Object, PubSubEngine]),
99869
100771
  __metadata("design:returntype", Promise)
99870
100772
  ], MJVectorIndexResolver.prototype, "MJEntityRecordDocuments_VectorIndexIDArray", null);
100773
+ __decorate([
100774
+ FieldResolver(() => [MJEntityDocument_]),
100775
+ __param(0, Root()),
100776
+ __param(1, Ctx()),
100777
+ __param(2, PubSub()),
100778
+ __metadata("design:type", Function),
100779
+ __metadata("design:paramtypes", [MJVectorIndex_, Object, PubSubEngine]),
100780
+ __metadata("design:returntype", Promise)
100781
+ ], MJVectorIndexResolver.prototype, "MJEntityDocuments_VectorIndexIDArray", null);
100782
+ __decorate([
100783
+ FieldResolver(() => [MJContentType_]),
100784
+ __param(0, Root()),
100785
+ __param(1, Ctx()),
100786
+ __param(2, PubSub()),
100787
+ __metadata("design:type", Function),
100788
+ __metadata("design:paramtypes", [MJVectorIndex_, Object, PubSubEngine]),
100789
+ __metadata("design:returntype", Promise)
100790
+ ], MJVectorIndexResolver.prototype, "MJContentTypes_VectorIndexIDArray", null);
100791
+ __decorate([
100792
+ FieldResolver(() => [MJContentSource_]),
100793
+ __param(0, Root()),
100794
+ __param(1, Ctx()),
100795
+ __param(2, PubSub()),
100796
+ __metadata("design:type", Function),
100797
+ __metadata("design:paramtypes", [MJVectorIndex_, Object, PubSubEngine]),
100798
+ __metadata("design:returntype", Promise)
100799
+ ], MJVectorIndexResolver.prototype, "MJContentSources_VectorIndexIDArray", null);
99871
100800
  __decorate([
99872
100801
  Mutation(() => MJVectorIndex_),
99873
100802
  __param(0, Arg('input', () => CreateMJVectorIndexInput)),