@memberjunction/server 2.59.0 → 2.60.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.
@@ -1904,6 +1904,12 @@ let AIAgentRun_ = class AIAgentRun_ {
1904
1904
  TotalPromptTokensUsedRollup;
1905
1905
  TotalCompletionTokensUsedRollup;
1906
1906
  TotalCostRollup;
1907
+ ConversationDetailID;
1908
+ ConversationDetailSequence;
1909
+ CancellationReason;
1910
+ FinalStep;
1911
+ FinalPayload;
1912
+ Message;
1907
1913
  Agent;
1908
1914
  Conversation;
1909
1915
  User;
@@ -2009,6 +2015,33 @@ __decorate([
2009
2015
  Field(() => Float, { nullable: true, description: `Total cost including this agent run and all sub-agent runs. For leaf agents (no sub-agents), this equals TotalCost. For parent agents, this includes the sum of all descendant agent costs. Note: This assumes all costs are in the same currency for accurate rollup.` }),
2010
2016
  __metadata("design:type", Number)
2011
2017
  ], AIAgentRun_.prototype, "TotalCostRollup", void 0);
2018
+ __decorate([
2019
+ Field({ nullable: true, description: `Optional tracking of a specific conversation detail (e.g. a specific message) that spawned this agent run` }),
2020
+ MaxLength(16),
2021
+ __metadata("design:type", String)
2022
+ ], AIAgentRun_.prototype, "ConversationDetailID", void 0);
2023
+ __decorate([
2024
+ Field(() => Int, { nullable: true, description: `If a conversation detail spawned multiple agent runs, tracks the order of their spawn/execution` }),
2025
+ __metadata("design:type", Number)
2026
+ ], AIAgentRun_.prototype, "ConversationDetailSequence", void 0);
2027
+ __decorate([
2028
+ Field({ nullable: true, description: `Reason for cancellation if the agent run was cancelled` }),
2029
+ MaxLength(60),
2030
+ __metadata("design:type", String)
2031
+ ], AIAgentRun_.prototype, "CancellationReason", void 0);
2032
+ __decorate([
2033
+ Field({ nullable: true, description: `The final step type that concluded the agent run` }),
2034
+ MaxLength(60),
2035
+ __metadata("design:type", String)
2036
+ ], AIAgentRun_.prototype, "FinalStep", void 0);
2037
+ __decorate([
2038
+ Field({ nullable: true, description: `JSON serialization of the final Payload state at the end of the agent run` }),
2039
+ __metadata("design:type", String)
2040
+ ], AIAgentRun_.prototype, "FinalPayload", void 0);
2041
+ __decorate([
2042
+ Field({ nullable: true, description: `Final message from the agent to the end user at the end of a run` }),
2043
+ __metadata("design:type", String)
2044
+ ], AIAgentRun_.prototype, "Message", void 0);
2012
2045
  __decorate([
2013
2046
  Field({ nullable: true }),
2014
2047
  MaxLength(510),
@@ -2061,6 +2094,12 @@ let CreateAIAgentRunInput = class CreateAIAgentRunInput {
2061
2094
  TotalPromptTokensUsedRollup;
2062
2095
  TotalCompletionTokensUsedRollup;
2063
2096
  TotalCostRollup;
2097
+ ConversationDetailID;
2098
+ ConversationDetailSequence;
2099
+ CancellationReason;
2100
+ FinalStep;
2101
+ FinalPayload;
2102
+ Message;
2064
2103
  };
2065
2104
  __decorate([
2066
2105
  Field({ nullable: true }),
@@ -2142,6 +2181,30 @@ __decorate([
2142
2181
  Field(() => Float, { nullable: true }),
2143
2182
  __metadata("design:type", Number)
2144
2183
  ], CreateAIAgentRunInput.prototype, "TotalCostRollup", void 0);
2184
+ __decorate([
2185
+ Field({ nullable: true }),
2186
+ __metadata("design:type", String)
2187
+ ], CreateAIAgentRunInput.prototype, "ConversationDetailID", void 0);
2188
+ __decorate([
2189
+ Field(() => Int, { nullable: true }),
2190
+ __metadata("design:type", Number)
2191
+ ], CreateAIAgentRunInput.prototype, "ConversationDetailSequence", void 0);
2192
+ __decorate([
2193
+ Field({ nullable: true }),
2194
+ __metadata("design:type", String)
2195
+ ], CreateAIAgentRunInput.prototype, "CancellationReason", void 0);
2196
+ __decorate([
2197
+ Field({ nullable: true }),
2198
+ __metadata("design:type", String)
2199
+ ], CreateAIAgentRunInput.prototype, "FinalStep", void 0);
2200
+ __decorate([
2201
+ Field({ nullable: true }),
2202
+ __metadata("design:type", String)
2203
+ ], CreateAIAgentRunInput.prototype, "FinalPayload", void 0);
2204
+ __decorate([
2205
+ Field({ nullable: true }),
2206
+ __metadata("design:type", String)
2207
+ ], CreateAIAgentRunInput.prototype, "Message", void 0);
2145
2208
  CreateAIAgentRunInput = __decorate([
2146
2209
  InputType()
2147
2210
  ], CreateAIAgentRunInput);
@@ -2167,6 +2230,12 @@ let UpdateAIAgentRunInput = class UpdateAIAgentRunInput {
2167
2230
  TotalPromptTokensUsedRollup;
2168
2231
  TotalCompletionTokensUsedRollup;
2169
2232
  TotalCostRollup;
2233
+ ConversationDetailID;
2234
+ ConversationDetailSequence;
2235
+ CancellationReason;
2236
+ FinalStep;
2237
+ FinalPayload;
2238
+ Message;
2170
2239
  OldValues___;
2171
2240
  };
2172
2241
  __decorate([
@@ -2249,6 +2318,30 @@ __decorate([
2249
2318
  Field(() => Float, { nullable: true }),
2250
2319
  __metadata("design:type", Number)
2251
2320
  ], UpdateAIAgentRunInput.prototype, "TotalCostRollup", void 0);
2321
+ __decorate([
2322
+ Field({ nullable: true }),
2323
+ __metadata("design:type", String)
2324
+ ], UpdateAIAgentRunInput.prototype, "ConversationDetailID", void 0);
2325
+ __decorate([
2326
+ Field(() => Int, { nullable: true }),
2327
+ __metadata("design:type", Number)
2328
+ ], UpdateAIAgentRunInput.prototype, "ConversationDetailSequence", void 0);
2329
+ __decorate([
2330
+ Field({ nullable: true }),
2331
+ __metadata("design:type", String)
2332
+ ], UpdateAIAgentRunInput.prototype, "CancellationReason", void 0);
2333
+ __decorate([
2334
+ Field({ nullable: true }),
2335
+ __metadata("design:type", String)
2336
+ ], UpdateAIAgentRunInput.prototype, "FinalStep", void 0);
2337
+ __decorate([
2338
+ Field({ nullable: true }),
2339
+ __metadata("design:type", String)
2340
+ ], UpdateAIAgentRunInput.prototype, "FinalPayload", void 0);
2341
+ __decorate([
2342
+ Field({ nullable: true }),
2343
+ __metadata("design:type", String)
2344
+ ], UpdateAIAgentRunInput.prototype, "Message", void 0);
2252
2345
  __decorate([
2253
2346
  Field(() => [KeyValuePairInput], { nullable: true }),
2254
2347
  __metadata("design:type", Array)
@@ -3244,6 +3337,8 @@ let AIAgent_ = class AIAgent_ {
3244
3337
  DriverClass;
3245
3338
  IconClass;
3246
3339
  ModelSelectionMode;
3340
+ PayloadDownstreamPaths;
3341
+ PayloadUpstreamPaths;
3247
3342
  Parent;
3248
3343
  ContextCompressionPrompt;
3249
3344
  Type;
@@ -3347,6 +3442,14 @@ __decorate([
3347
3442
  MaxLength(100),
3348
3443
  __metadata("design:type", String)
3349
3444
  ], AIAgent_.prototype, "ModelSelectionMode", void 0);
3445
+ __decorate([
3446
+ Field({ description: `JSON array of paths that define which parts of the payload should be sent downstream to sub-agents. Use ["*"] to send entire payload, or specify paths like ["customer.id", "campaign.*", "analysis.sentiment"]` }),
3447
+ __metadata("design:type", String)
3448
+ ], AIAgent_.prototype, "PayloadDownstreamPaths", void 0);
3449
+ __decorate([
3450
+ Field({ description: `JSON array of paths that define which parts of the payload sub-agents are allowed to write back upstream. Use ["*"] to allow all writes, or specify paths like ["analysis.results", "recommendations.*"]` }),
3451
+ __metadata("design:type", String)
3452
+ ], AIAgent_.prototype, "PayloadUpstreamPaths", void 0);
3350
3453
  __decorate([
3351
3454
  Field({ nullable: true }),
3352
3455
  MaxLength(510),
@@ -3424,6 +3527,8 @@ let CreateAIAgentInput = class CreateAIAgentInput {
3424
3527
  DriverClass;
3425
3528
  IconClass;
3426
3529
  ModelSelectionMode;
3530
+ PayloadDownstreamPaths;
3531
+ PayloadUpstreamPaths;
3427
3532
  };
3428
3533
  __decorate([
3429
3534
  Field({ nullable: true }),
@@ -3493,6 +3598,14 @@ __decorate([
3493
3598
  Field({ nullable: true }),
3494
3599
  __metadata("design:type", String)
3495
3600
  ], CreateAIAgentInput.prototype, "ModelSelectionMode", void 0);
3601
+ __decorate([
3602
+ Field({ nullable: true }),
3603
+ __metadata("design:type", String)
3604
+ ], CreateAIAgentInput.prototype, "PayloadDownstreamPaths", void 0);
3605
+ __decorate([
3606
+ Field({ nullable: true }),
3607
+ __metadata("design:type", String)
3608
+ ], CreateAIAgentInput.prototype, "PayloadUpstreamPaths", void 0);
3496
3609
  CreateAIAgentInput = __decorate([
3497
3610
  InputType()
3498
3611
  ], CreateAIAgentInput);
@@ -3515,6 +3628,8 @@ let UpdateAIAgentInput = class UpdateAIAgentInput {
3515
3628
  DriverClass;
3516
3629
  IconClass;
3517
3630
  ModelSelectionMode;
3631
+ PayloadDownstreamPaths;
3632
+ PayloadUpstreamPaths;
3518
3633
  OldValues___;
3519
3634
  };
3520
3635
  __decorate([
@@ -3585,6 +3700,14 @@ __decorate([
3585
3700
  Field({ nullable: true }),
3586
3701
  __metadata("design:type", String)
3587
3702
  ], UpdateAIAgentInput.prototype, "ModelSelectionMode", void 0);
3703
+ __decorate([
3704
+ Field({ nullable: true }),
3705
+ __metadata("design:type", String)
3706
+ ], UpdateAIAgentInput.prototype, "PayloadDownstreamPaths", void 0);
3707
+ __decorate([
3708
+ Field({ nullable: true }),
3709
+ __metadata("design:type", String)
3710
+ ], UpdateAIAgentInput.prototype, "PayloadUpstreamPaths", void 0);
3588
3711
  __decorate([
3589
3712
  Field(() => [KeyValuePairInput], { nullable: true }),
3590
3713
  __metadata("design:type", Array)
@@ -32135,6 +32258,7 @@ let ConversationDetail_ = class ConversationDetail_ {
32135
32258
  User;
32136
32259
  Artifact;
32137
32260
  Reports_ConversationDetailIDArray;
32261
+ MJ_AIAgentRuns_ConversationDetailIDArray;
32138
32262
  };
32139
32263
  __decorate([
32140
32264
  Field(),
@@ -32232,6 +32356,10 @@ __decorate([
32232
32356
  Field(() => [Report_]),
32233
32357
  __metadata("design:type", Array)
32234
32358
  ], ConversationDetail_.prototype, "Reports_ConversationDetailIDArray", void 0);
32359
+ __decorate([
32360
+ Field(() => [AIAgentRun_]),
32361
+ __metadata("design:type", Array)
32362
+ ], ConversationDetail_.prototype, "MJ_AIAgentRuns_ConversationDetailIDArray", void 0);
32235
32363
  ConversationDetail_ = __decorate([
32236
32364
  ObjectType()
32237
32365
  ], ConversationDetail_);
@@ -32474,6 +32602,14 @@ let ConversationDetailResolver = class ConversationDetailResolver extends Resolv
32474
32602
  const result = this.ArrayMapFieldNamesToCodeNames('Reports', rows);
32475
32603
  return result;
32476
32604
  }
32605
+ async MJ_AIAgentRuns_ConversationDetailIDArray(conversationdetail_, { dataSources, userPayload }, pubSub) {
32606
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
32607
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
32608
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ConversationDetailID]='${conversationdetail_.ID}' ` + this.getRowLevelSecurityWhereClause('MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
32609
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
32610
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
32611
+ return result;
32612
+ }
32477
32613
  async CreateConversationDetail(input, { dataSources, userPayload }, pubSub) {
32478
32614
  const connPool = GetReadWriteDataSource(dataSources);
32479
32615
  return this.CreateRecord('Conversation Details', input, connPool, userPayload, pubSub);
@@ -32533,6 +32669,15 @@ __decorate([
32533
32669
  __metadata("design:paramtypes", [ConversationDetail_, Object, PubSubEngine]),
32534
32670
  __metadata("design:returntype", Promise)
32535
32671
  ], ConversationDetailResolver.prototype, "Reports_ConversationDetailIDArray", null);
32672
+ __decorate([
32673
+ FieldResolver(() => [AIAgentRun_]),
32674
+ __param(0, Root()),
32675
+ __param(1, Ctx()),
32676
+ __param(2, PubSub()),
32677
+ __metadata("design:type", Function),
32678
+ __metadata("design:paramtypes", [ConversationDetail_, Object, PubSubEngine]),
32679
+ __metadata("design:returntype", Promise)
32680
+ ], ConversationDetailResolver.prototype, "MJ_AIAgentRuns_ConversationDetailIDArray", null);
32536
32681
  __decorate([
32537
32682
  Mutation(() => ConversationDetail_),
32538
32683
  __param(0, Arg('input', () => CreateConversationDetailInput)),
@@ -62958,6 +63103,8 @@ let AIAgentRunStep_ = class AIAgentRunStep_ {
62958
63103
  _mj__CreatedAt;
62959
63104
  _mj__UpdatedAt;
62960
63105
  TargetLogID;
63106
+ PayloadAtStart;
63107
+ PayloadAtEnd;
62961
63108
  };
62962
63109
  __decorate([
62963
63110
  Field({ description: `Unique identifier for this execution step` }),
@@ -62974,7 +63121,7 @@ __decorate([
62974
63121
  __metadata("design:type", Number)
62975
63122
  ], AIAgentRunStep_.prototype, "StepNumber", void 0);
62976
63123
  __decorate([
62977
- Field({ description: `Type of execution step: prompt, tool, subagent, decision` }),
63124
+ Field({ description: `Type of execution step: Prompt, Actions, Sub-Agent, Decision, Chat, Validation` }),
62978
63125
  MaxLength(100),
62979
63126
  __metadata("design:type", String)
62980
63127
  ], AIAgentRunStep_.prototype, "StepType", void 0);
@@ -63034,6 +63181,14 @@ __decorate([
63034
63181
  MaxLength(16),
63035
63182
  __metadata("design:type", String)
63036
63183
  ], AIAgentRunStep_.prototype, "TargetLogID", void 0);
63184
+ __decorate([
63185
+ Field({ nullable: true, description: `JSON serialization of the Payload state at the start of this step` }),
63186
+ __metadata("design:type", String)
63187
+ ], AIAgentRunStep_.prototype, "PayloadAtStart", void 0);
63188
+ __decorate([
63189
+ Field({ nullable: true, description: `JSON serialization of the Payload state at the end of this step` }),
63190
+ __metadata("design:type", String)
63191
+ ], AIAgentRunStep_.prototype, "PayloadAtEnd", void 0);
63037
63192
  AIAgentRunStep_ = __decorate([
63038
63193
  ObjectType()
63039
63194
  ], AIAgentRunStep_);
@@ -63053,6 +63208,8 @@ let CreateAIAgentRunStepInput = class CreateAIAgentRunStepInput {
63053
63208
  InputData;
63054
63209
  OutputData;
63055
63210
  TargetLogID;
63211
+ PayloadAtStart;
63212
+ PayloadAtEnd;
63056
63213
  };
63057
63214
  __decorate([
63058
63215
  Field({ nullable: true }),
@@ -63110,6 +63267,14 @@ __decorate([
63110
63267
  Field({ nullable: true }),
63111
63268
  __metadata("design:type", String)
63112
63269
  ], CreateAIAgentRunStepInput.prototype, "TargetLogID", void 0);
63270
+ __decorate([
63271
+ Field({ nullable: true }),
63272
+ __metadata("design:type", String)
63273
+ ], CreateAIAgentRunStepInput.prototype, "PayloadAtStart", void 0);
63274
+ __decorate([
63275
+ Field({ nullable: true }),
63276
+ __metadata("design:type", String)
63277
+ ], CreateAIAgentRunStepInput.prototype, "PayloadAtEnd", void 0);
63113
63278
  CreateAIAgentRunStepInput = __decorate([
63114
63279
  InputType()
63115
63280
  ], CreateAIAgentRunStepInput);
@@ -63129,6 +63294,8 @@ let UpdateAIAgentRunStepInput = class UpdateAIAgentRunStepInput {
63129
63294
  InputData;
63130
63295
  OutputData;
63131
63296
  TargetLogID;
63297
+ PayloadAtStart;
63298
+ PayloadAtEnd;
63132
63299
  OldValues___;
63133
63300
  };
63134
63301
  __decorate([
@@ -63187,6 +63354,14 @@ __decorate([
63187
63354
  Field({ nullable: true }),
63188
63355
  __metadata("design:type", String)
63189
63356
  ], UpdateAIAgentRunStepInput.prototype, "TargetLogID", void 0);
63357
+ __decorate([
63358
+ Field({ nullable: true }),
63359
+ __metadata("design:type", String)
63360
+ ], UpdateAIAgentRunStepInput.prototype, "PayloadAtStart", void 0);
63361
+ __decorate([
63362
+ Field({ nullable: true }),
63363
+ __metadata("design:type", String)
63364
+ ], UpdateAIAgentRunStepInput.prototype, "PayloadAtEnd", void 0);
63190
63365
  __decorate([
63191
63366
  Field(() => [KeyValuePairInput], { nullable: true }),
63192
63367
  __metadata("design:type", Array)