@memberjunction/server 2.67.0 → 2.69.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/server",
3
- "version": "2.67.0",
3
+ "version": "2.69.0",
4
4
  "description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./src/index.ts",
@@ -22,39 +22,39 @@
22
22
  "dependencies": {
23
23
  "@apollo/server": "^4.9.1",
24
24
  "@graphql-tools/utils": "^10.0.1",
25
- "@memberjunction/actions": "2.67.0",
26
- "@memberjunction/ai": "2.67.0",
27
- "@memberjunction/ai-core-plus": "2.67.0",
28
- "@memberjunction/ai-agents": "2.67.0",
29
- "@memberjunction/aiengine": "2.67.0",
30
- "@memberjunction/ai-prompts": "2.67.0",
31
- "@memberjunction/ai-agent-manager-actions": "2.67.0",
32
- "@memberjunction/ai-mistral": "2.67.0",
33
- "@memberjunction/ai-openai": "2.67.0",
34
- "@memberjunction/ai-anthropic": "2.67.0",
35
- "@memberjunction/ai-groq": "2.67.0",
36
- "@memberjunction/ai-cerebras": "2.67.0",
37
- "@memberjunction/ai-vectors-pinecone": "2.67.0",
38
- "@memberjunction/core": "2.67.0",
39
- "@memberjunction/core-actions": "2.67.0",
40
- "@memberjunction/actions-bizapps-accounting": "2.67.0",
41
- "@memberjunction/actions-bizapps-crm": "2.67.0",
42
- "@memberjunction/actions-bizapps-lms": "2.67.0",
43
- "@memberjunction/actions-bizapps-social": "2.67.0",
44
- "@memberjunction/core-entities": "2.67.0",
45
- "@memberjunction/core-entities-server": "2.67.0",
46
- "@memberjunction/data-context": "2.67.0",
47
- "@memberjunction/data-context-server": "2.67.0",
48
- "@memberjunction/doc-utils": "2.67.0",
49
- "@memberjunction/entity-communications-server": "2.67.0",
50
- "@memberjunction/external-change-detection": "2.67.0",
51
- "@memberjunction/global": "2.67.0",
52
- "@memberjunction/graphql-dataprovider": "2.67.0",
53
- "@memberjunction/queue": "2.67.0",
54
- "@memberjunction/skip-types": "2.67.0",
55
- "@memberjunction/sqlserver-dataprovider": "2.67.0",
56
- "@memberjunction/storage": "2.67.0",
57
- "@memberjunction/templates": "2.67.0",
25
+ "@memberjunction/actions": "2.69.0",
26
+ "@memberjunction/ai": "2.69.0",
27
+ "@memberjunction/ai-core-plus": "2.69.0",
28
+ "@memberjunction/ai-agents": "2.69.0",
29
+ "@memberjunction/aiengine": "2.69.0",
30
+ "@memberjunction/ai-prompts": "2.69.0",
31
+ "@memberjunction/ai-agent-manager-actions": "2.69.0",
32
+ "@memberjunction/ai-mistral": "2.69.0",
33
+ "@memberjunction/ai-openai": "2.69.0",
34
+ "@memberjunction/ai-anthropic": "2.69.0",
35
+ "@memberjunction/ai-groq": "2.69.0",
36
+ "@memberjunction/ai-cerebras": "2.69.0",
37
+ "@memberjunction/ai-vectors-pinecone": "2.69.0",
38
+ "@memberjunction/core": "2.69.0",
39
+ "@memberjunction/core-actions": "2.69.0",
40
+ "@memberjunction/actions-bizapps-accounting": "2.69.0",
41
+ "@memberjunction/actions-bizapps-crm": "2.69.0",
42
+ "@memberjunction/actions-bizapps-lms": "2.69.0",
43
+ "@memberjunction/actions-bizapps-social": "2.69.0",
44
+ "@memberjunction/core-entities": "2.69.0",
45
+ "@memberjunction/core-entities-server": "2.69.0",
46
+ "@memberjunction/data-context": "2.69.0",
47
+ "@memberjunction/data-context-server": "2.69.0",
48
+ "@memberjunction/doc-utils": "2.69.0",
49
+ "@memberjunction/entity-communications-server": "2.69.0",
50
+ "@memberjunction/external-change-detection": "2.69.0",
51
+ "@memberjunction/global": "2.69.0",
52
+ "@memberjunction/graphql-dataprovider": "2.69.0",
53
+ "@memberjunction/queue": "2.69.0",
54
+ "@memberjunction/skip-types": "2.69.0",
55
+ "@memberjunction/sqlserver-dataprovider": "2.69.0",
56
+ "@memberjunction/storage": "2.69.0",
57
+ "@memberjunction/templates": "2.69.0",
58
58
  "@types/compression": "^1.7.5",
59
59
  "@types/cors": "^2.8.13",
60
60
  "@types/jsonwebtoken": "9.0.6",
@@ -1318,6 +1318,10 @@ export class AIAgentRun_ {
1318
1318
  @Field({nullable: true, description: `The initial payload provided at the start of this run. Can be populated from the FinalPayload of the LastRun.`})
1319
1319
  StartingPayload?: string;
1320
1320
 
1321
+ @Field(() => Int, {description: `Total number of prompt iterations executed during this agent run. Incremented
1322
+ each time the agent processes a prompt step.`})
1323
+ TotalPromptIterations: number;
1324
+
1321
1325
  @Field({nullable: true})
1322
1326
  @MaxLength(510)
1323
1327
  Agent?: string;
@@ -1429,6 +1433,9 @@ export class CreateAIAgentRunInput {
1429
1433
 
1430
1434
  @Field({ nullable: true })
1431
1435
  StartingPayload: string | null;
1436
+
1437
+ @Field(() => Int, { nullable: true })
1438
+ TotalPromptIterations?: number;
1432
1439
  }
1433
1440
 
1434
1441
 
@@ -1521,6 +1528,9 @@ export class UpdateAIAgentRunInput {
1521
1528
  @Field({ nullable: true })
1522
1529
  StartingPayload?: string | null;
1523
1530
 
1531
+ @Field(() => Int, { nullable: true })
1532
+ TotalPromptIterations?: number;
1533
+
1524
1534
  @Field(() => [KeyValuePairInput], { nullable: true })
1525
1535
  OldValues___?: KeyValuePairInput[];
1526
1536
  }
@@ -2204,14 +2214,50 @@ export class AIAgent_ {
2204
2214
  @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.*"]`})
2205
2215
  PayloadUpstreamPaths: string;
2206
2216
 
2207
- @Field({nullable: true, description: `JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
2217
+ @Field({nullable: true, description: `JSON array of paths that specify what parts of the payload the agent's own prompt can read. Controls downstream data
2208
2218
  flow when the agent executes its own prompt step.`})
2209
2219
  PayloadSelfReadPaths?: string;
2210
2220
 
2211
- @Field({nullable: true, description: `JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
2221
+ @Field({nullable: true, description: `JSON array of paths that specify what parts of the payload the agent's own prompt can write back. Controls upstream
2212
2222
  data flow when the agent executes its own prompt step.`})
2213
2223
  PayloadSelfWritePaths?: string;
2214
2224
 
2225
+ @Field({nullable: true, description: `Defines the scope/path within the parent payload that this sub-agent operates on. When set, the sub-agent receives only this portion of the payload and all change requests are relative to this scope. Format: /path/to/scope (e.g. /PropA/SubProp1)`})
2226
+ PayloadScope?: string;
2227
+
2228
+ @Field({nullable: true, description: `Optional JSON schema or requirements that define the expected structure and content of the agent's final payload. Used to validate the output when the agent declares success. Similar to OutputExample in AI Prompts.`})
2229
+ FinalPayloadValidation?: string;
2230
+
2231
+ @Field({description: `Determines how to handle validation failures when FinalPayloadValidation is specified. Options: Retry (default) - retry the agent with validation feedback, Fail - fail the agent run immediately, Warn - log a warning but allow success.`})
2232
+ @MaxLength(50)
2233
+ FinalPayloadValidationMode: string;
2234
+
2235
+ @Field(() => Int, {description: `Maximum number of retry attempts allowed when FinalPayloadValidation fails with
2236
+ Retry mode. After reaching this limit, the validation will fail permanently.`})
2237
+ FinalPayloadValidationMaxRetries: number;
2238
+
2239
+ @Field(() => Float, {nullable: true, description: `Maximum cost in dollars allowed for a single agent run. Run will be terminated
2240
+ if this limit is exceeded.`})
2241
+ MaxCostPerRun?: number;
2242
+
2243
+ @Field(() => Int, {nullable: true, description: `Maximum total tokens (input + output) allowed for a single agent run. Run will
2244
+ be terminated if this limit is exceeded.`})
2245
+ MaxTokensPerRun?: number;
2246
+
2247
+ @Field(() => Int, {nullable: true, description: `Maximum number of prompt iterations allowed for a single agent run. Run will be
2248
+ terminated if this limit is exceeded.`})
2249
+ MaxIterationsPerRun?: number;
2250
+
2251
+ @Field(() => Int, {nullable: true, description: `Maximum time in seconds allowed for a single agent run. Run will be terminated
2252
+ if this limit is exceeded.`})
2253
+ MaxTimePerRun?: number;
2254
+
2255
+ @Field(() => Int, {nullable: true, description: `When acting as a sub-agent, minimum number of times this agent must be executed per parent agent run`})
2256
+ MinExecutionsPerRun?: number;
2257
+
2258
+ @Field(() => Int, {nullable: true, description: `When acting as a sub-agent, maximum number of times this agent can be executed per parent agent run`})
2259
+ MaxExecutionsPerRun?: number;
2260
+
2215
2261
  @Field({nullable: true})
2216
2262
  @MaxLength(510)
2217
2263
  Parent?: string;
@@ -2323,6 +2369,36 @@ export class CreateAIAgentInput {
2323
2369
 
2324
2370
  @Field({ nullable: true })
2325
2371
  PayloadSelfWritePaths: string | null;
2372
+
2373
+ @Field({ nullable: true })
2374
+ PayloadScope: string | null;
2375
+
2376
+ @Field({ nullable: true })
2377
+ FinalPayloadValidation: string | null;
2378
+
2379
+ @Field({ nullable: true })
2380
+ FinalPayloadValidationMode?: string;
2381
+
2382
+ @Field(() => Int, { nullable: true })
2383
+ FinalPayloadValidationMaxRetries?: number;
2384
+
2385
+ @Field(() => Float, { nullable: true })
2386
+ MaxCostPerRun: number | null;
2387
+
2388
+ @Field(() => Int, { nullable: true })
2389
+ MaxTokensPerRun: number | null;
2390
+
2391
+ @Field(() => Int, { nullable: true })
2392
+ MaxIterationsPerRun: number | null;
2393
+
2394
+ @Field(() => Int, { nullable: true })
2395
+ MaxTimePerRun: number | null;
2396
+
2397
+ @Field(() => Int, { nullable: true })
2398
+ MinExecutionsPerRun: number | null;
2399
+
2400
+ @Field(() => Int, { nullable: true })
2401
+ MaxExecutionsPerRun: number | null;
2326
2402
  }
2327
2403
 
2328
2404
 
@@ -2394,6 +2470,36 @@ export class UpdateAIAgentInput {
2394
2470
  @Field({ nullable: true })
2395
2471
  PayloadSelfWritePaths?: string | null;
2396
2472
 
2473
+ @Field({ nullable: true })
2474
+ PayloadScope?: string | null;
2475
+
2476
+ @Field({ nullable: true })
2477
+ FinalPayloadValidation?: string | null;
2478
+
2479
+ @Field({ nullable: true })
2480
+ FinalPayloadValidationMode?: string;
2481
+
2482
+ @Field(() => Int, { nullable: true })
2483
+ FinalPayloadValidationMaxRetries?: number;
2484
+
2485
+ @Field(() => Float, { nullable: true })
2486
+ MaxCostPerRun?: number | null;
2487
+
2488
+ @Field(() => Int, { nullable: true })
2489
+ MaxTokensPerRun?: number | null;
2490
+
2491
+ @Field(() => Int, { nullable: true })
2492
+ MaxIterationsPerRun?: number | null;
2493
+
2494
+ @Field(() => Int, { nullable: true })
2495
+ MaxTimePerRun?: number | null;
2496
+
2497
+ @Field(() => Int, { nullable: true })
2498
+ MinExecutionsPerRun?: number | null;
2499
+
2500
+ @Field(() => Int, { nullable: true })
2501
+ MaxExecutionsPerRun?: number | null;
2502
+
2397
2503
  @Field(() => [KeyValuePairInput], { nullable: true })
2398
2504
  OldValues___?: KeyValuePairInput[];
2399
2505
  }
@@ -3512,6 +3618,12 @@ export class AIAgentAction_ {
3512
3618
  @MaxLength(10)
3513
3619
  _mj__UpdatedAt: Date;
3514
3620
 
3621
+ @Field(() => Int, {nullable: true, description: `Minimum number of times this action must be executed per agent run`})
3622
+ MinExecutionsPerRun?: number;
3623
+
3624
+ @Field(() => Int, {nullable: true, description: `Maximum number of times this action can be executed per agent run`})
3625
+ MaxExecutionsPerRun?: number;
3626
+
3515
3627
  @Field({nullable: true})
3516
3628
  @MaxLength(510)
3517
3629
  Agent?: string;
@@ -3538,6 +3650,12 @@ export class CreateAIAgentActionInput {
3538
3650
 
3539
3651
  @Field({ nullable: true })
3540
3652
  Status?: string;
3653
+
3654
+ @Field(() => Int, { nullable: true })
3655
+ MinExecutionsPerRun: number | null;
3656
+
3657
+ @Field(() => Int, { nullable: true })
3658
+ MaxExecutionsPerRun: number | null;
3541
3659
  }
3542
3660
 
3543
3661
 
@@ -3558,6 +3676,12 @@ export class UpdateAIAgentActionInput {
3558
3676
  @Field({ nullable: true })
3559
3677
  Status?: string;
3560
3678
 
3679
+ @Field(() => Int, { nullable: true })
3680
+ MinExecutionsPerRun?: number | null;
3681
+
3682
+ @Field(() => Int, { nullable: true })
3683
+ MaxExecutionsPerRun?: number | null;
3684
+
3561
3685
  @Field(() => [KeyValuePairInput], { nullable: true })
3562
3686
  OldValues___?: KeyValuePairInput[];
3563
3687
  }
@@ -3969,16 +4093,16 @@ export class AIPrompt_ {
3969
4093
  @Field(() => Int, {nullable: true, description: `Default number of top log probabilities to include when IncludeLogProbs is true. Can be overridden at runtime.`})
3970
4094
  TopLogProbs?: number;
3971
4095
 
4096
+ @Field({description: `Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None`})
4097
+ @MaxLength(100)
4098
+ FailoverStrategy: string;
4099
+
3972
4100
  @Field(() => Int, {nullable: true, description: `Maximum number of failover attempts before giving up`})
3973
4101
  FailoverMaxAttempts?: number;
3974
4102
 
3975
4103
  @Field(() => Int, {nullable: true, description: `Initial delay in seconds between failover attempts`})
3976
4104
  FailoverDelaySeconds?: number;
3977
4105
 
3978
- @Field({description: `Failover strategy to use when the primary model fails. Options: SameModelDifferentVendor, NextBestModel, PowerRank, None`})
3979
- @MaxLength(100)
3980
- FailoverStrategy: string;
3981
-
3982
4106
  @Field({description: `Strategy for selecting failover models. Options: PreferSameModel, PreferDifferentModel, RequireSameModel`})
3983
4107
  @MaxLength(100)
3984
4108
  FailoverModelStrategy: string;
@@ -4170,15 +4294,15 @@ export class CreateAIPromptInput {
4170
4294
  @Field(() => Int, { nullable: true })
4171
4295
  TopLogProbs: number | null;
4172
4296
 
4297
+ @Field({ nullable: true })
4298
+ FailoverStrategy?: string;
4299
+
4173
4300
  @Field(() => Int, { nullable: true })
4174
4301
  FailoverMaxAttempts?: number | null;
4175
4302
 
4176
4303
  @Field(() => Int, { nullable: true })
4177
4304
  FailoverDelaySeconds?: number | null;
4178
4305
 
4179
- @Field({ nullable: true })
4180
- FailoverStrategy?: string;
4181
-
4182
4306
  @Field({ nullable: true })
4183
4307
  FailoverModelStrategy?: string;
4184
4308
 
@@ -4321,15 +4445,15 @@ export class UpdateAIPromptInput {
4321
4445
  @Field(() => Int, { nullable: true })
4322
4446
  TopLogProbs?: number | null;
4323
4447
 
4448
+ @Field({ nullable: true })
4449
+ FailoverStrategy?: string;
4450
+
4324
4451
  @Field(() => Int, { nullable: true })
4325
4452
  FailoverMaxAttempts?: number | null;
4326
4453
 
4327
4454
  @Field(() => Int, { nullable: true })
4328
4455
  FailoverDelaySeconds?: number | null;
4329
4456
 
4330
- @Field({ nullable: true })
4331
- FailoverStrategy?: string;
4332
-
4333
4457
  @Field({ nullable: true })
4334
4458
  FailoverModelStrategy?: string;
4335
4459
 
@@ -39577,6 +39701,10 @@ export class AIPromptRun_ {
39577
39701
  @Field({nullable: true, description: `JSON array of duration in milliseconds for each failover attempt`})
39578
39702
  FailoverDurations?: string;
39579
39703
 
39704
+ @Field({nullable: true, description: `The AI Model ID that was originally attempted before any failovers`})
39705
+ @MaxLength(16)
39706
+ OriginalModelID?: string;
39707
+
39580
39708
  @Field({nullable: true, description: `Timestamp when the original request started, before any failovers`})
39581
39709
  @MaxLength(8)
39582
39710
  OriginalRequestStartTime?: Date;
@@ -39584,10 +39712,6 @@ export class AIPromptRun_ {
39584
39712
  @Field(() => Int, {nullable: true, description: `Total time spent in failover attempts in milliseconds`})
39585
39713
  TotalFailoverDuration?: number;
39586
39714
 
39587
- @Field({nullable: true, description: `The AI Model ID that was originally attempted before any failovers`})
39588
- @MaxLength(16)
39589
- OriginalModelID?: string;
39590
-
39591
39715
  @Field()
39592
39716
  @MaxLength(510)
39593
39717
  Prompt: string;
@@ -39790,14 +39914,14 @@ export class CreateAIPromptRunInput {
39790
39914
  @Field({ nullable: true })
39791
39915
  FailoverDurations: string | null;
39792
39916
 
39917
+ @Field({ nullable: true })
39918
+ OriginalModelID: string | null;
39919
+
39793
39920
  @Field({ nullable: true })
39794
39921
  OriginalRequestStartTime: Date | null;
39795
39922
 
39796
39923
  @Field(() => Int, { nullable: true })
39797
39924
  TotalFailoverDuration: number | null;
39798
-
39799
- @Field({ nullable: true })
39800
- OriginalModelID: string | null;
39801
39925
  }
39802
39926
 
39803
39927
 
@@ -39971,15 +40095,15 @@ export class UpdateAIPromptRunInput {
39971
40095
  @Field({ nullable: true })
39972
40096
  FailoverDurations?: string | null;
39973
40097
 
40098
+ @Field({ nullable: true })
40099
+ OriginalModelID?: string | null;
40100
+
39974
40101
  @Field({ nullable: true })
39975
40102
  OriginalRequestStartTime?: Date | null;
39976
40103
 
39977
40104
  @Field(() => Int, { nullable: true })
39978
40105
  TotalFailoverDuration?: number | null;
39979
40106
 
39980
- @Field({ nullable: true })
39981
- OriginalModelID?: string | null;
39982
-
39983
40107
  @Field(() => [KeyValuePairInput], { nullable: true })
39984
40108
  OldValues___?: KeyValuePairInput[];
39985
40109
  }
@@ -40160,6 +40284,16 @@ export class AIAgentRunStep_ {
40160
40284
  @Field({nullable: true, description: `JSON serialization of the Payload state at the end of this step`})
40161
40285
  PayloadAtEnd?: string;
40162
40286
 
40287
+ @Field({nullable: true, description: `Result of the final payload validation for this step. Pass indicates successful
40288
+ validation, Retry means validation failed but will retry, Fail means validation failed
40289
+ permanently, Warn means validation failed but execution continues.`})
40290
+ @MaxLength(50)
40291
+ FinalPayloadValidationResult?: string;
40292
+
40293
+ @Field({nullable: true, description: `Validation error messages or warnings from final payload validation. Contains
40294
+ detailed information about what validation rules failed.`})
40295
+ FinalPayloadValidationMessages?: string;
40296
+
40163
40297
  }
40164
40298
 
40165
40299
  //****************************************************************************
@@ -40214,6 +40348,12 @@ export class CreateAIAgentRunStepInput {
40214
40348
 
40215
40349
  @Field({ nullable: true })
40216
40350
  PayloadAtEnd: string | null;
40351
+
40352
+ @Field({ nullable: true })
40353
+ FinalPayloadValidationResult: string | null;
40354
+
40355
+ @Field({ nullable: true })
40356
+ FinalPayloadValidationMessages: string | null;
40217
40357
  }
40218
40358
 
40219
40359
 
@@ -40270,6 +40410,12 @@ export class UpdateAIAgentRunStepInput {
40270
40410
  @Field({ nullable: true })
40271
40411
  PayloadAtEnd?: string | null;
40272
40412
 
40413
+ @Field({ nullable: true })
40414
+ FinalPayloadValidationResult?: string | null;
40415
+
40416
+ @Field({ nullable: true })
40417
+ FinalPayloadValidationMessages?: string | null;
40418
+
40273
40419
  @Field(() => [KeyValuePairInput], { nullable: true })
40274
40420
  OldValues___?: KeyValuePairInput[];
40275
40421
  }
package/src/index.ts CHANGED
@@ -45,7 +45,7 @@ import { LoadAnthropicLLM } from '@memberjunction/ai-anthropic';
45
45
  import { LoadGroqLLM } from '@memberjunction/ai-groq';
46
46
  import { LoadCerebrasLLM } from '@memberjunction/ai-cerebras';
47
47
  import { LoadMistralLLM } from '@memberjunction/ai-mistral';
48
- // Load AI LLMs
48
+ // Load AI LLMs and Base AI Engine
49
49
  // These imports are necessary to ensure the LLMs are registered in the MemberJunction AI
50
50
  // system. They are not tree-shaken because they are dynamically loaded at runtime.
51
51
  LoadOpenAILLM();